pyqt4

PyQt4 Signals and Slots

I'm still learning Python and PyQt4, I just can't seem to get anything to display on my gui window when the "Harvest" button is pushed. I highlighted in bold my lack of knowledge on signals and slots. Updated Code: import sys, random, sqlite3, os from PyQt4.QtCore import * from PyQt4.QtGui import * from PyQt4 import QtGui, QtCore from ...

PyQt: Trouble with asterisk on modification in QPlainTextEdit

I'm having a problem with a QPlainTextEdit. I want the "contents have been modified" asterisk to appear in the title bar whenever the contents have been modified. In the example below, type a few letters. The asterisk appears as it should. Hit Ctrl+S, the asterisk disappears as it should. But then if you type a few more letters... w...

QComboBox inside QTreeWidgetItem

Is there something similar to the (PyQT) QTreeWidgetItem.setCheckState(0, Qt.Checked) but for the combo box? I can't see anything in the reference, so how can I insert a custom QComboBox as one of the elements within QTreeWidgetItem? ...

how do i place QTableWidgetItem Icon in center of cell

i want a table cell to have just an icon without any text. i see the QTableWidgetItem class has a method to align the text (int QTableWidgetItem::textAlignment () const) i find no way to adjust the placement of the icon (which seems to get stuck on the left -- even where there is no text in the cell) look at the Status and Energy colu...

How to load a bitmap on a window on PyQt

I currently have a PIL Image that I'd like to display on a PyQt window. I know this must be easy, but I can't find anywhere how to do it. Could anyone give me a hand on this? Here is the code of the window I currently have: import sys from PyQt4 import QtGui class Window(QtGui.QWidget): def __init__(self, parent=None): QtGu...

Couple of questions regarding PyQt

I have a couple of questions. I have an algorithm that will generate a couple of pictures in python that must be displayed on a form. I am using PyGt for this. My question is: where should I run my code? Right from the initializer? In that case from what I tested, the form won't show up. Should I set up a timer in the constructor tha...

Getting only one dimension of indexes from the getSelectedIndexes function in QT?

I'm working on a small project in QT (well, pyQT4 actually, but it shouldn't matter too much) and I've run into the following problem. I have a QTableView with several rows and columns. I have set the selection mode to be rows only. When I call getSelectedIndexes() on my QTableView, I get an index for every row and column, which in the c...

Debugging a pyQT4 app?

I have a fairly simple app built with pyqt4. I wanted to debug one of the functions connected to one of the buttons in my app. However, when I do the following python -m pdb app.pyw > break app.pyw:55 # This is where the signal handling function starts. things don't quite work like I'd hope. Instead of breaking in the function where ...

Using Windows 7 taskbar features in PyQt

Hi all. I am looking for information on the integration of some of the new Windows 7 taskbar features into my PyQt applications. Specifically if there already exists the possibility to use the new progress indicator (see here) and the quick links (www.petri.co.il/wp-content/uploads/new_win7_taskbar_features_8.gif). If anyone could pro...

Building executables for Python 3 and PyQt

Hi all. I built a rather simple application in Python 3.1 using PyQt4. Being done, I want the application to be distributed to computers without either of those installed. I almost exclusively care about Windows platforms, so my goal is to have a single executable file and maybe some resource files and .dlls in the end. Having searche...

Embedding a control in a QTableView?

I'm working a small qt app (using PyQt4) and I've come up with an idea but I'm unsure as to how to implement it. I have a QTableView that represents some data and I'd like to add another column to the QTableView that contains a checkbox control that could be wired up to some piece of the model. For example, something like this: Note t...

QtPython Qtreewidget Problem

Hello Everybody, I trying to do a Qtreewidget to attend a customer design suggestion. I am coding it on QtPython. I did a first try using Qt Designer, then generated the code. But when I try to run it, an error comes out: self.centralwidget.setSortingEnabled(__sortingEnabled) AttributeError: setSortingEnabled I googled around, but d...

Qt Python : QTreeWidget Child Problem

Hello Everybody, I have a QTreewidget that works fine if I have just one level on my treelist. If I decide to add child sublevels, it gives me an error. Here is the code, that works nice only without the "childs" lines on it (see after "child 1" and "child 2"). def eqpt_centralwdg(self,MainWindow): self.centralwidget = QtGui.QWidg...

How make Qt Designers autosize layouts work with Pyqt4?

I'm trying a simple example with Qt Designer and Pyqt4, when I preview the UI in Qt Designer (control+R) it looks good, but when I try to execute the generated UI code, layouts don't work properly and instead of autosizing widgets to the max they are so small that they can't be used. If I use fixed sizes it works well. The code used to...

Stackless Python and PyQt

What experiences do you have with Stackless Python and PyQt? Issues i would be happy if people address: Compilation of PyQt for Stackless: does PyQt need to be compiled especially for Stackless? is the compilation smooth? problems with bindings etc. Stability: any unexpected crashes, freezes, pauses and other weirdities? Memory Manage...

List view is not refreshed if setTabText() is called

Yes, I know this sounds crazy. But here's the situation. I composed a minimal code reproducing the bug. The code creates main window with QTabWidget, which, in turn, has one tab with QListView and a button. List view is connected to QAbstractListModel. Initially, list model contains empty list. If user clicks on a button, it is populate...

PyQt subclassing

The usual way to use Qt widgets from Python seems to be to subclass them. Qt widget classes have a great many methods, so inevitably I'm going to end up adding a method to the subclass, with the same name as one inherited from the Qt widget. In Python, all methods are virtual, so what I'm concerned about is that some Qt code might end u...

Python+Qt, QScrollArea problem: what's wrong with this code?

I have the following code: #!/usr/bin/env python import sys from PyQt4 import QtGui, QtCore class SimfilePanel(QtGui.QWidget): '''This class provides the simfile panel shown on the right side of the main window.''' def __init__(self, parent=None): '''Load song info here.''' QtGui.QWidget.__init__(self, parent) ## Mak...

Troubles installing PyQt4

I'm following this guide. Python is at C:\Python31 PyQt4 is at C:\Python31\pyqt sip is at C:\Python31\sip Qt is at C:\Qt\4.6.0 I followed the instructions on that guide, but when I tried to test it (from PyQt4.Qt install *), it said the module didn't exist. I checked all the files that guide said should exist, and none of them existe...

QCheckBox: is it really not possible to differentiate between user-induced changes to state and those made programmatically? If so, should it be considered an inconsistency?

Do I miss something or there is really no (ready / built-in) way to programmatically change the state of a QCheckBox without emitting the "void stateChanged ( int state )" signal? The above-mentioned signal is emitted regardless of whether "void setCheckState ( Qt::CheckState state )" was called or the user changed the state via the ui,...