pyqt4

QT: Context menu (QMenu) reference from the QTableWidget.

I want to add a submenu in my context menu which is created like this: self.widget_alignment.setContextMenuPolicy(Qt.ActionsContextMenu) where widget_alignment is QTableWidget. I created a new QMenu instance: exchange_bases_menu = QMenu(self.widget_alignment) added some actions, and I found a method QAction QMenu.addMenu (self, QM...

What signal can be connected to an initial dialog display in pyqt4 (qt)

I have an application in which I would like to connect whatever signal is emitted when a pyqt4 dialog is displayed in order to do execute an initial method. I don't want the method to be called in the __init__ method for a number of reasons. I've spent quite some time searching but I have yet to find an answer. I'm sure there is a simple...

QsciScintilla marker background color

How to set a marker's background color (SC_MARK_BACKGROUND) within a QsciScintilla instance? I cannot see any way to pass it to markerDefine(). ...

PyQt4 QSpinBox.selectAll() not working as expected.

Python 2.5.4 PyQt4 I sub-classed a QDoubleSpinBox to emit a signal on a focusIn event: #Custom widgets for DPL GUI from PyQt4.QtCore import * from PyQt4.QtGui import * class DPLDoubleSpinBox(QDoubleSpinBox): __pyqtSignals__ = ("valueChanged(double)", "focusIn()") def __init__(self, *args): QDoubleSpinBox.__init__...

What is the correct method of handling events in PyQt 4?

I have seen examples like this: self.connect(self.ui.add_button, QtCore.SIGNAL('clicked()'),self.printer) And examples like this: self.ui.add_button.clicked.connect(self.printer) I'm just starting to learn Qt; which one should I focus on? ...

resizing of button icons in pyqt4

I want to make image in my QMainWindow so when you click on it you have a signal translating like qpushbutton I use this: self.quit=QtGui.QPushButton(self) self.quit.setIcon(QtGui.QIcon('images/9.bmp')) But the problem is whene I resize the window qpushbutton resized too but not his icon have you solution of my pro...

Eric4 dark theme stylesheet

Does anyone use Eric4 and has taken the time to create a dark themed stylesheet (.qss or .css)? Surely, not everyone uses the default theme. I wish Eric4 made this easier to configure through their preferences settings. Thanks! ...

show html with pyqt4

print "hellp world" :) i want to ask you if exist a function or class hwo can show the html code like the browser's jobe thx ...

PyQt 4 UI freezes

The following programm should just count up and int and displays its value in a label. But after a while the GUI stops working, while the loop continous. from PyQt4 import QtGui,QtCore import sys class main_window(QtGui.QWidget): def __init__(self,parent=None): #Layout QtGui.QWidget.__init__(self,parent) ...

how can I catch the error of "no existing page" in python

I developpe a browser with python and pyqt4 but I don't know what I put in loaderror try: self.webView.load(QtCore.QUrl(self.lineEdit.text())) except loaderreur: self.webView.load(QtCore.QUrl('erreur.html')) when the page doesn't exist thx ...

Is it possible to add PyQt4\PySide packages on a virtualenv sandbox?

Hi i'm using virtualenv with profit on my develop environment with web.py, simplejson and other web oriented packages. I'm preparing to develop a simple python client using Qt to reuse some Api developed with web.py. Does anybody here had succesfully installed PyQt4 with virtualenv? Is it possible? I've downloaded all the binaries and h...

pylint PyQt4 error

I write a program : from PyQt4.QtCore import * from PyQt4.QtGui import * def main(): app = QApplication([]) button = QPushButton("hello?") button.show() app.exec_() if __name__=="__main__": main() the file name is t.py, when I run: pylint t.py in ubuntu9.10, pyqt4, I got this: pylint t.py No config file foun...

date and countor time in pyqt4

hello world i want an exemple of countor of time with pyqt4 and also how to have a date actuall thx ...

Using multiple QStyledItemDelegate with stylesheets

I'm creating a styled QTreeView using double-dispatch to resolve specific delegate for data items, which is working great. I subclassed the delegates from QStyledItemDelegate to take advantage of stylesheets, enabling the designers to style the UI outside of the code. Unfortunately, I have been unable to address different styles from...

Qt4 Stylesheets and Focus Rect

I would like to use a stylesheet :focus pseudo-state to control the representation of the Tree view's focus state. Using the following stylesheet works well, except that the Qt system still draws it's own focus rect. How do I ask Qt to not draw the focus rect, while still being able to focus the control for keyboard input? QTreeView {...

python qt raise syntax error

I have a top level widget that is producing a syntax error in python. raise() on line 15. This is using the python Qt bindings. I know that raise is a python reserved word. I am looking for how to call the Qt "raise()" function with the python bindings. #!/usr/bin/python # simple.py import sys from PyQt4 import QtGui app = QtGui...

PyQt4 Signalling between classes

Hi folks, I have a family of classes (based on the same parent class) that are data cells in a QTableWidget (so they are all derived from QItemDelegate). I'm trying to create a signal that these classes can pass up to the controller to communicate data changes. I can't find the right combination (despite much experimentation and rea...

How can I disable clear of clipboard on exit of PyQt4 application?

I have a simple PyQt4 application (see the code below) that reveals next problem: if I select the text from QLineEdit and copy it to clipboard then I can paste it to another application only while my application is running. It seems that on exit PyQt application clears the clipboard so I can't paste the text after the application is clos...

QT4: Is it possible to make a QListView scroll smoothly?

I have a QListView in Icon mode with lots of icons, so that a scrollbar appears, but the scrolling is not smooth and this IMHO confuses the user since it jumps abruptly from one point to another at each scroll. I would like to make the scrolling smooth but I didn't find anything in the docs. Is it possible? ...

Pros and cons of using gettext instead of QObject.tr() for localization of PyQt4 application?

I have couple of application written in PyQt4 where I've used standard Python gettext library for internationalization and localization of GUI. It works good for me. But I've selected gettext just because I've already had knowledge and experience of gettext usage, and zero of experience with Qt4 tr() approach. Now I'd like to better com...