pyqt4

pyqt custom item delegate for qtablewidget

I have a QTableWidget with 5 columns in it, how do I set all items on column 2 to be a QProgressBar? I tried something like: self.downloads_table = QtGui.QTableWidget(0, 5) self.downloads_table.setItemDelegateForColumn(2, DownloadDelegate(self)) Where DownloadDelegate is: class DownloadDelegate(QItemDelegate): def __init__(self, ...

PyQt4 signals and slots

Hello, I am writing my first Python app with PyQt4. I have a MainWindow and a Dialog class, which is a part of MainWindow class: self.loginDialog = LoginDialog(); I use slots and signals. Here's a connection made in MainWindow: QtCore.QObject.connect(self.loginDialog, QtCore.SIGNAL("aa(str)"), self.login) And I try to emit signal ...

PyQt4 Drag & Drop

Hi fellows! Qt4 has support for Drag & Drop actions and I've used them like in the tutorial. Now I want to be able to drag external elements (files) into the GUI form and perform actions based on that (like get the full path and copy it somewhere). I'm not sure whether this is a limitation like something Qt cannot do. Does someone kno...

Qt winId() forcing 32bit values

Hi all Im trying to embed a display from an alien application (python OCC) into (Py)Qt using the winId of the widget. But when i pass it to OCC i get an overflow error. Inspecting the winId qt returns its 4318283408 which is more than a 32bit number. Im running 64bits (osx) and both libraries are compiled for 64bit, but i have a hunch t...

PyQt lineEdit with colors

Hi fellows! I'm trying to format a Qt lineEdit text with colors. def __init__(self): QtGui.QMainWindow.__init__(self) self.ui = Ui_MainWindow() self.ui.setupUi(self) self.ui.lineEdit.setText("here be colors") I searched a lot but only found customized drawing widgets with monstrous amounts of code. I...

How to intercept ALL signals emitted by a given event in QT?

I can imagine that there might be quite a few of them depending on the event, but at the same time, I guess this can be a best way to debug, and an interesting lesson. Why would I need it? I'm using some custom class based on the QWidget, which does not expand when I de-attach a QDockWidget based in the same window. Knowing what signals...

QRadioButton and QVBoxLayOut

Hi all, I used next code to dynamically create a group of radio buttons: self.wPaymantType.qgbSomeSelectionGroup = QtGuig.QGroupBox() vbox = QtGui.QVBoxLayout() for row in listOfChoices: radio = QtGui.QRadioButton(row) if bIsFirst: radio.setChecked(True) bIsFirst = False if len(row.name) > nMaxLen: ...

QObject (QPlainTextEdit) & Multithreading issues

Im currently trying to learn Networking with Python asyncore and pyqt4. I coded a small server, which basically listens on some port, and resends all messages it recieves to the sender. Since both qts QApplication.exec_() and asyncore.loop() are functions which never return i could not start them both in one thread, so i stared asyncor...

PyQt post installation question

I successfully installed PyQt in both mac and PC. To do so I had to install mingw (on PC), Xcode (on MAC) and Qt4.6 library. Now that I have PyQt working perfectly, I would like to uninstall mingw, Xcode and Qt Library from both mac and PC. I know I can remove Xcode and mingw, but what care should I take before removing Qt library. I k...

Retrieving text from password field [python][pyqt4]

def welcomeStage (self): self.test = QtGui.QLineEdit (self) self.test.move (50, 150) QtCore.QObject.connect (self.test, QtCore.SIGNAL ('returnPressed()'), self.passwordStage) def passwordStage (self): self.email = self.test.text() self.test.clear() self.test.setEchoMode (QtGui.QLineEdit.Password) QtC...

Using KWallet in PyQt4.

It would be great if anyone could show me how to use KWallet with pyqt4 ...

Python: Embed Chaco in PyQt4 Mystery

How do i go about adding Chaco to an existing PyQt4 application? Hours of searches yielded little (search for yourself). So far i've figured i need the following lines: import os os.environ['ETS_TOOLKIT']='qt4' i could not find PyQt4-Chaco code anywhere on the internets i would be very grateful to anyone filling in the blanks to sho...

PyQt and Bespin (KDE style)

What tab widget decorate by Bespin Tabs? I tried QTabWidget, QTabBar, KTabWidget, KTabBar, bau no effect. What Im doing wrong? All KDE apps and SMPlayer decorate by Bespin, but acetoneiso and PyQt apps have regular tabs=( I mean this Bespin: http://kde-look.org/content/show.php/Bespin?content=63928 ...

Is widget animation supported in PyQt?

The new animation framework in QT4 looks incredible. I'm trying to implement some simple widget animation in PyQt4, though I'm having errors. self.button = QtGui.QPushButton ("Hello", self) self.button.setGeometry (5, 10, 100, 25) animate = QtCore.QPropertyAnimation (self.button, "geometry") animate.setDuration (10...

PyQt4 QDialog connections not being made.

I am working on an application using PyQt4 and the designer it provides. I have a main window application that works fine, but I wanted to create custom message dialogs. I designed a dialog and set up some custom signal/slot connections in the __init__ method and wrote an if __name__=='__main__': and had a test. The custom slots work ...

What Is The Best Way To Play Audio Through Qt?

I am building an application in pyQt4 and I want it to be able to play audio files. I was considering doing this through pyMedia as I could not get anywhere with the documentation, although the QAudio classes did initially look promising. It is important that the solution be cross-platform. Does anyone have any suggestions? ...

QT4, GTK+, wxWidgets or IronPython for a native Windows app using Python

Hi there. I need to build a native windows app using Python (and py2exe, I guess). Feature requirements are: Taskbar icon Alert notifications (next to Taskbar Icon) Chromeless window (ideally a pretty, rounded, coloured one). Webkit to render some of the Chromeless window So far I've identified the following possible toolkits: pyG...

PyQT4 issue with jpeg when compiled

In a PyQT4 program, I have a QLabel displaying an image with the following code : in the init code : Image=QImage(som_path_from_a_fileDialog) in the resize method : pixmap = QPixmap.fromImage(Image) pixmap = pixmap.scaled(self.display.size()) self.display.setPixmap(pixmap) When I execute my script with python, it works fine, and I...

pyqt jpeg support not working in bundled form

To enable jpeg support in a PyQT application, you have to manually include the qjpeg4.dll. It works fine when the dll and pyd file are not bundled together in the final exe. For example with py2exe you can do the following : DATA=[('imageformats',['C:\\Python26/Lib/site-packages/PyQt4/plugins/imageformats/qjpeg4.dll'])] setup(console=[{...

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