pyqt

PyQt and MVC-pattern

hi there, please, help me with designing MVC-pattern with PyQt. i want to split all program at 3 parts: 1. some class that is abstracted from all Qt classes(model) 2. some class that provides data from model to qt-app(controller) 3. Qt-app itself with defined method SignalsToSlots that connect signals with controller. is it optimally a...

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? ...

focusNextChild problems in PyQt

I'm trying to set the focus from one widget to the next one using the focusNextChild() method. It works, but I there seems to be a slight difference between using the tab-key or doing things in code. If the next control is a button, using the tab-key results in a focused button with its caption surrounded with little dots, so you see imm...

How insecure is / replacement for tmpnam?

I considered using tmpnam to set the output file name of a QPrinter. But the Python documentation recommends against using it. os.tmpnam() Return a unique path name that is reasonable for creating a temporary file. ... Applications are responsible for properly creating and managing files created using paths returned by t...

Qt Custom Window

Hi, Pardon me, I am a newbie :) Is it possible in Qt to create a custom window without borders but still draggable without holding down the Alt Key? I created a borderless window but in order to be able to drag it (on Linux) you have to hold down the alt key. I was planning to create a window with rounded corners. Any one have any ide...

PyQt: translating standard buttons

How can I easily translate standard buttons (Yes, No) from QMessageBox? I can't use self.tr on those arguments, so I would like to achieve it in some other simple way. Do I have to use whole translation system? ...

Using QFrame to display different panes of information?

I'm trying to get a QFrame to serve as a "display area" for a couple different kinds of information, eg: you click on something in a list view and an info pane shows up in the frame to give you information about it, you click on a different item and a different pane shows up. Having trouble swapping the different frames in and out of t...

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...

How can I capture _all_ mouse events in a widget descended from a Qt widget in PyQt?

In particular, I'm inheriting from QCalendarWidget and I want to override the mousePressEvent method to filter what dates are allowed to be selected (disjoint set, not a simple range). But when I override the method, it doesn't catch any events that are going to child widgets inside the calendar. How can I do this? ...

How to get SIP to find .sip files for and installed libary

I'm trying to create python bindings for source-highlight-qt using sip. I'm working on ubuntu - I've installed python-qt4-dev, which has installed the pyqt sip files to /usr/share/sip/PyQt4/ In my sip file, I've got this import: %Import QtCore/qstring.sip I'm getting this error when I run my configure.py: sip: Unable to find file ...

PyQt display fullscreen image

I'm using PyQt to capture my screen with QPixmap.grabWindow(QApplication.desktop().winId()) and I was wondering if there was a way I could display my screengrab fullscreen (no window borders, etc.) I'm trying to find a way to desaturate my display with PyQt ...

Convert PyQt to PIL image

I have an image in a QImage and I want to process it in PIL before I display it. While the ImageQT class lets me convert a PIL Image to a QImage, there doesn't appear to anything to go from a QImage to a PIL Image. ...

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...

QGraphicsScene and positioning

How to put QGraphicsScene's (0,0) to top-left corner of QGraphicsView? ...

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...

Qt Python radiobutton: activate event

Hi Everybody, I am developing a project for one customer, where the design has a radio button with exclusive options. Here is a piece of the code that runs and show two nice radio buttons: self.performGroupBox = QtGui.QGroupBox(self.centralwidget) self.performGroupBox.setGeometry(QtCore.QRect(50, 20, 181, 121)) self.perfo...