Skip to content
Advertisement

Tag: pyqt4

Adding items to QlistView

I’m using pyqt4 with python 2.7 and I have a list view widget that I can’t add items to it As you guys can see i used But it gave me an error that is talking about arguments and data types: Also, is it right to use ListView here or I should use listwidget? In general, what is the difference

How to delete row/rows from a qtableview in pyqt?

I am using QStandardItemModel for my qtableview. here when I am trying to delete the row selected(i.e. model.removeRow() ) I am getting a error” TypeError: argument 1 of QAbstractItemModel.removeRow() has an invalid type”. I have searched a lot for the correct way of deleting a selected row/rows in qtableview of pyqt. However, I am not able to delete the selected

Setting up stateChanged signal in QStackedWidget, pyqt

I have an example of QStacked Widget code from internet, which generates its own layout for each child (below) Now I want to collect data from all of them and process it later. How can I know which checkbox was checked, for example? This code layout.addWidget(QCheckBox(“Physics”).stateChanged.connect(self.state_changed)) gives me Process finished with exit code -1073741819 (0xC0000005) Answer When you write that

PyQt4 QWizard: How to disable the back button on a single page?

I would like to disable the “Back” button on a QWizard page. My Class inherits from QWizard and from a generated file. It looks somehow like this: from PyQt4 import QtGui Here http://doc.qt.digia.com/3.3/qwizard.html#backButton I found the method setBackEnabled(). With self.setBackEnabled(page1, False) I am not able to call this method. It says: Am I doing something wrong? Or is this method

How to make a PyQT4 window jump to the front?

I want to make a PyQT4 window(QtGui.QMainWindow) jump to the front when the application received a specified message from another machine. Usually the window is minimized. I tried the raise_() and show() method but it doesn’t work. Answer This works: Both are required for me on Win7. setWindowState restores the minimized window and gives focus. But if the window just

How can I change the cursor shape with PyQt?

I have a simple application that runs a process that can last for several minutes before completing. I am trying to provide an indication to the user that it is processing the request – such as changing the cursor to an hourglass. But I cannot quite get it to work right. All of my attempts have resulted in either an

Connecting slots and signals in PyQt4 in a loop

Im trying to build a calculator with PyQt4 and connecting the ‘clicked()’ signals from the buttons doesn’t work as expected. Im creating my buttons for the numbers inside a for loop where i try to connect them afterwards. When I click on the buttons all of them print out ‘9’. Why is that so and how can i fix this?

Advertisement