Questions tagged [pyqt4]

PyQt is a set of Python bindings for Qt application framework and runs on all platforms supported by Qt including Windows, MacOS/X and Linux.

PyQt is developed by Riverbank Computing.

It is available on all platforms under a variety of licenses including the GNU GPL (v2 and v3) and a commercial license.

Unlike Qt, PyQt v4 is not available under the LGPL.

5631 questions
8
votes
3 answers

QObject::connect: Cannot queue arguments of type 'QTextCursor'

Im trying to send a signal from a non-main thread in PyQt but i dont know what am doing wrong! And when i execute the program it fails with this error: QObject::connect: Cannot queue arguments of type 'QTextCursor' (Make sure 'QTextCursor' is…
karensantana
  • 1,599
  • 4
  • 21
  • 34
8
votes
4 answers

How to determine from a python application if X server/X forwarding is running?

I'm writing a linux application which uses PyQt4 for GUI and which will only be used during remote sessions (ssh -XY / vnc). So sometimes it may occur that a user will forget to run ssh with X forwarding parameters or X forwarding will be…
Michal
  • 6,411
  • 6
  • 32
  • 45
8
votes
1 answer

PyQt4 @pyqtSlot: what is the result kwarg for?

By reading this, two questions came up: 1. It says it is sometimes necessary to explicitly mark a Python method as being a Qt slot While I always use the @pyqtSlot decorator because it says: Connecting a signal to a decorated Python method…
Pedru
  • 1,430
  • 1
  • 14
  • 32
8
votes
1 answer

resource file in PyQt4

I'm trying to understand an example in PyQt4 (simpletreemodel.pyw) I see the code import simpletreemodel_rc But I can't see where the module is used in the example code When I examine the module simpletreemodel, I see: from PyQt4 import…
nam
  • 3,542
  • 9
  • 46
  • 68
7
votes
1 answer

How does one force PyCharm to open a file as XML?

I have some .ui files generated by Qt Designer; they are simple XML files but PyCharm refuses to open them. The filetype is listed among the ones "recognized" by PyCharm, but I can't find a way to specify how it should deal with it. Does anybody…
Giacomo Lacava
  • 1,784
  • 13
  • 25
7
votes
1 answer

programmatically edit tab order in pyqt4 python

I have a multiple textfield in my form. My problem is the tab order is wrong. Is there a way to edit tab order in code? Just like in QT Designer. thanks.
unice
  • 2,655
  • 5
  • 43
  • 78
7
votes
3 answers

PyQt4 - Remove Item Widget from QListWidget

I have a QListWidget and I need to remove some items. From what I've researched, this is a generally unpleasant thing to do. I've read a tonne of solutions, but none are applicable to my specific scenario. At the moment, I only have the actual…
Anti Earth
  • 4,671
  • 13
  • 52
  • 83
7
votes
3 answers

How to rotate a QPushButton?

I would like---with Python and Qt4---to rotate a QPushButton (or at least its text) so it can stand vertically. I've seen some documentation online, but I couldn't make much sense out of it---it's in C and I'm C-illiterate. From what I read though,…
neydroydrec
  • 6,973
  • 9
  • 57
  • 89
7
votes
1 answer

pyqt: how to remove elements from a QVBoxLayout?

I want a multi-color selection widget. The way I'm doing it is having a "+" button, and an initially empty vbox. When + is pressed, it adds a QHBoxLayout to the vbox containing a "-" button and 3 spinboxes. When the "-" button is pressed I want that…
Claudiu
  • 224,032
  • 165
  • 485
  • 680
7
votes
2 answers

pyqt4: how to show a modeless dialog?

for the life of me I can't figure this out... on a button press I have the code: @QtCore.pyqtSlot(): def buttonPressed(self): d = QtGui.QDialog() d.show() all that happens is a window briefly pops up without any contents and then…
Claudiu
  • 224,032
  • 165
  • 485
  • 680
7
votes
2 answers

how to create folder view in pyqt inside main window

I'm trying to implement a folder viewer to view the structure of a specific path. and this folder view should look like a the tree widget in PyQT , i know that the file dialog can help , but i need to have it inside my main window. i tried to…
Moayyad Yaghi
  • 3,622
  • 13
  • 51
  • 67
7
votes
2 answers

Can a PyQt4 QObject be queried to determine if the underlying C++ instance has been destroyed?

The destroyed() signal can be trapped for a QObject, but I would like to simply test if the Python object still references a valid C++ Qt object. Is there a method for doing so directly?
Judge Maygarden
  • 26,961
  • 9
  • 82
  • 99
7
votes
2 answers

Checkbox selection in QListView

I developed a simple dialog with a checkbox, which allows the user to select one or several items from a list. Besides the standard OK and Cancel buttons, it adds Select All and Unselect All buttons, allowing the user to check/uncheck all items at…
maurobio
  • 1,480
  • 4
  • 27
  • 38
7
votes
2 answers

How to detect the type of widget?

This should be a stupid question. I am just curious and could not find the answer on my own. E.g. I define in PyQt5 some widgets: self.lbl = QLabel("label") self.btn = QPushButton("click") self.txt = QLineEdit("text") Is there any method to detect…
Rt Rtt
  • 595
  • 2
  • 13
  • 33
7
votes
1 answer

PyQt4 to PyQt5 how?

My code was created with PyQt4 and I want to convert it to PyQt5. I have tried some scripts to convert the code; but, nothing changed except the name. What do I need to change manually in order to make the code work with PyQt5? Here is the first…
seghier
  • 167
  • 1
  • 2
  • 11