pyqt

How do you make QT threads in python for pyqt?

I see discussion about qt threads vs python threads but how do you create and call qt threads in python? how do you give it access to your functions in another thread? Thanks! ...

Multithreading with pyqt - Can't get the separate threads running at the same time?

I am trying to get a PyQT GUI running ontop of my python application and I have tried to get it separated into 2 threads so the GUI would be responsive while my main running loop goes, but I have not been able to get it going. Maybe I am misunderstanding it. Here is what I've tried: My Window and Worker thread are defined as follows: ...

How to animate a graph I've drawn in PyQt?

So I've managed to get a graph drawn up on my screen like such: class Window(QWidget): #stuff graphicsView = QGraphicsView(self) scene = QGraphicsScene(self) #draw our nodes and edges. for i in range(0, len(MAIN_WORLD.currentMax.tour) - 1): node = QGraphicsRectItem(MAIN_WORLD.currentM...

How to start a "drawing loop" in PyQt?

Often times when we're drawing a GUI, we want our GUI to update based on the data changing in our program. At the start of the program, let's say I've drawn my GUI based on my initial data. That data will be changing constantly, so how can I redraw my GUI constantly? ...

How to initialize a QT thread in python

As per examples seen online, I've created a Worker thread. I'm looking for a thread to run my GUI while one thread executes my code. Worker thread is defined as: class Worker(QThread): def __init__(self, parent = None): QThread.__init__(self, parent) self.exiting = False self.size = QSize(0, 0) def __...

QPushButton FocusIn generates which signal?

I am creating a small PyQt application and got stuck up in MouseOver effect. I have a QMainWindow which has three buttons named createProfileButton, downloadPackagesButton and installPackagesButton. All these are of type QPushButton Now I have created a Label which will hold the text when someone hovers the mouse over any of these butt...

setup Qt and PyQt on mac osx so my app can also deployable on windows

Hi, I've been coding with Python and C++ and now need to work on building a gui for data visualization purposes. I work on Mac Snow Leopard (intel), python 3.1 using gcc 4.2.1 (from Xcode 3.1) I wanted to first install Qt and then PyQt. And my goals are to be able to: - quickly prototype GUI and the accompanied logic that drives the GU...

How to swap the QGraphicsScene from a QGraphicsView?

QGraphicsView is often hooked up to a QGraphicsScene. What if I want to swap that QGraphicsScene for a new one? How can I accomplish this? Doing it right now is just drawing over the old one. ...

PyQt debugging in main loop

Hello. Can I debug PyQt application when is main loop running ? Pdb, NetBeans, PyDev, all "freeze" when sys.exit(app.exec_()) is executed. I probably missing something obvious. Or what can be problem, please ? I apologize for my "creepy" english. Thanks. ...

PyQt, Qt, one event handler working with many items

Hello, I have a couple of checkboxes on my form, and I don't want to write separate event handler for each, because they all will implement the same logic. Instead I want to write just one event handler that will know about what checkbox has been clicked. E.g. in Delphi I can use it this way: function click_handler(sender): begin ...

Qt, non-modal dialog doesn't close itself

I have one main Window and one non-modal Dialog. I suppose non-modal dialog should close itself when I close main window. Instead if I open non-modal dialog, I should close manually both of them - if I close main window, non-modal dialog will remain, and I need to close it manually. # App and main window app = QtGui.QApplication(sys.arg...

cross-platform html widget for pygtk

I'm trying to write a small gui app in pygtk which needs an html-rendering widget. I'd like to be able to use it in a windows environment. Currently I'm using pywebkitgtk on my GNU/Linux system, and it works extremely well, but it seems it's not possible to use this on Windows at this time. Can anyone give me any suggestions on how to...

Disable text selection in QT/WebKit GUI

I'm checking if it would be possible to implement a GUI using HTML through PyQT and WebKit. One of the problem is that using the mouse you can select the text making up the interface. Can this behaviour be disabled? Also, the mouse pointer changes to an insertion caret while over the selectable text. I would like to disable this, withou...

PyQt beginremoverows

Hi all, In the example below: from PyQt4 import QtCore, QtGui class Ui_Dialog(QtGui.QDialog): def __init__(self,parent=None): QtGui.QDialog.__init__(self,parent) self.setObjectName("Dialog") self.resize(600, 500) self.model = QtGui.QDirModel() self.tree = QtGui.QTreeView() self.tree...

Python Import and 'object has no attribute' with Qt

From research on Stack Overflow and other sites I'm 99% sure that the problem I'm having is due to incorrect importing. Below is a QLabel sub class that I'm using to respond to some mouse events: import Qt import sys class ASMovableLabel(Qt.QLabel): def mouseReleaseEvent(self, event): button = event.button() if b...

PyQt MenuBar Mac 0SX Snow Leopard

I am attempting to add an item to the application menu-bar of a simple PyQt example. However, the following code does not seem to alter the menu-bar at all. The only item in the menu is "Python". Below is the bulk of the code, minus imports and instantiation. class MainWindow(QtGui.QMainWindow): def __init__(self): QtGui.QM...

How can I write a Nokia application with pyqt?

I have seen questions on my Facebook group about 'Can I write Nokia apps with pyqt', but no one has answered. I am curious, can it be done? ...

How do I prevent Qt buttons from appearing in a separate frame?

I'm working on a PyQt application. Currently, there's a status panel (defined as a QWidget) which contains a QHBoxLayout. This layout is frequently updated with QPushButtons created by another portion of the application. Whenever the buttons which appear need to change (which is rather frequently) an update effect gets called. The e...

QtDesigner or doing all of the Qt boilerplate by hand?

When starting up a new project, as a beginner, which would you use? For example, in my situation. I'm going to have a program running on an infinite loop, constantly updating values. I need these values to be represented as a bar graph as they're updating. At the same time, the GUI has to be responsive to user feedback as there wil...

PyQt. TypeError

Hi everyone, I set filter on my QMainWindow with this: keyPressFilter = keypressfilter.KeyPressFilter(self) self.installEventFilter(keyPressFilter) KeyPressFilter itself: class KeyPressFilter(QObject): def __init__(self, parent=None): super(KeyPressFilter, self).__init__(parent) def eventFilter(self, obj, event): ...