Skip to content
Advertisement

Tag: pyqt

Is it possible to paint a QGraphicsItem inside the paint() method?

I’m creating a subclass of QGraphicsItem, and this subclass has different places that the user can click. My idea is for each component clicked to create a subclass of QGraphicsItem with mousePressEvent replaced. The problem is how can I merge this component into a subclass of QGraphicItem. Here’s the code I’m trying, but I do not know how to show

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

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, because it’s all template-based and therefore impossible to wrap. PS: the PySide documentation

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 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 code resulting an

Advertisement