Skip to content

Tag: pyqt

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…

QtConcurrent in PySide/PyQt

I’m trying to figure out if subclassing QtConcurrent and writing a run method inside it will work: Or is it completely useless? Answer It’s completely useless, because QtConcurrent is a namespace, not a class. Also, neither PyQt nor PySide provide any of the functionality provided by QtConcurrent,…

How to grab a desktop screenshot with PyQt?

Can I take a screenshot from desktop or any window with PyQt? How to handle keyPressEvent on desktop? Thanks. Answer Example of how to take a screenshot of the desktop: If you want to take a screenshot of a specific window, replace QApplication.desktop() with the widget you want to take a screenshot of.

PyQt: How to connect QComboBox to function with Arguments

QComboBox is connected to a function using following syntax: But I need to be able to send the arguments from ComboBox to myFunction(). But if I use: I am getting What syntax needs to be used to connect a QComboBox to a function that is able to receive arguments sent from Comobobox? EDITED LATER: Here is the …