Skip to content

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 i…

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 rest…

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…

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…