pyqt

How to open a Pyqt 3.3 ui file with QtDesigner 4?

Hello, I've a PyQt 4 installed (I can't find PyQt 3 for Windows) and I would like to open a QtDesigner ui file which has been created with QtDesigner 3.3. When I open this file I've the following message: Please use uic3 -convert to convert to Qt4 Unfortunately, I don't see the uic3 tool in the bin folder of my install. Does anybody...

Looking for shared Qt stylesheets

OK, I'm using PyQt4, and need to "decorate" my program. and I want to use qss, it is simple, and easy to use/change. But I found there is no such site to share qss files, and I'm a programmer not a artist, so I won't try to write it myself. Are there any styles I can pick? ...

how to sort a QTableWidget with my own code?

Hi, I am using Qt4.5.2 on Linux. I have a simple QTableWidget, in which a column displays dates in a human-friendly format. Unfortunately "human-friendly dates" are not easy to sort correctly. So, in the QTableWidget I keep a hidden column with the UNIX timestamp corresponding to that date. I am trying to make sure that, whenever a req...

QWebView not loading external CSS

I am using a QWebView to display some content and I want to use custom CSS to spruce up the output. I found that I can use the QWebSettings.setUserStyleSheetUrl() method to load my own CSS into the view. The .css file is in the same directory as my main program. self.webview = QWebView(MainWindow) self.webview.settings().setUserStyleS...

How to make QLineEdit expand inside QScrollArea

I have a QLabel and a QLineEdit inside a QWidget. When I have the widget inside a QScrollArea, the line edit does not expand to occupy the excess width of the window. When the widget is not inside the scroll area, it does expand. I've tried setting the size policy of the line edit and the widget, to expand horizontally, but it doesn't ...

How can I make a single PyQt code to work in Windows and Linux?

PyQt experts: I developed the GUI in Windows and used setGeometry to position the widgets. When I tried to run the same code in Linux it looks cluttered. And added to that in Windows the font size of 8 seems good. But in Linux, especially in Ubuntu, it doesn't appear well since the font size is 10 by default. Some among the differences ...

Is it possible to access custom properties from QT Designer after converting to python?

Hi, I am new to PyQt and Qt Designer and I'm trying to create an easy method for relating qWidgets with the tables and columns in an SQLite database. My idea was to tag each qWidget in designer with two custom properties, one with the table name and one with the column name. Later, I would use the info provided by designer to build my o...

QSqlTableModel, data function overload

Hi everyone, I'm trying to inherit QSqlTableModel to make data im my table display in way i need. class TableViewModel(QSqlTableModel): def __init__(self): super(TableViewModel, self).__init__() def flags(self, modelIndex): if not modelIndex.isValid(): return if modelIndex.column() != 1 and modelIndex.column() !=...

PyQt with c++ classes

Hi everyone, i want to use from PyQt application classes (lib/tool) written on c++ with Qt usage. I searched for solution and found Boost.python. Is it a good decision or there are a better tools for this purpose? Thank you, Kenn ...

Translate standardButton in QDialogButtonBox

hi. i am using pyqt and designer. i have translated all the strings in my app with self.tr() + pylupdate4 and lrelease here is the snippet of code in my main(): app = QtGui.QApplication(sys.argv) app.setApplicationName('Mental Calculation') # initialize locale and load translation files if available locale = QtCore.QLocale() LOCALENAM...

Changing the color of the link on hover using stylesheets..

Hai all, I don't know why the following lines of code isn't working. My aim is to change color of the text when the link is hovered.. self.syncFolderSelection_addFileTypesTextBrowserInTable.setStyleSheet("QTextBrowser:hover{color:#00ff00;background-color:#ff0000;}") The BG color chages without any error but the foreground color is no...

how to word wrap a QTreeWidgetItem

hello all, i have to populate a QTreeWidget with items (or children of items) that may happen to be too long to fit in a single line, so i'm looking for a way to word wrap them. i thought myQTreeWidget.setWordWrap(True) (done via QtDesigner4) would have done the job, but that doesn't seem to be the case. i don't konw if it is relev...

PyQt QTreeWidget problem with custom delegate

Hi, All! I'm trying to write simple property editor. I have automatically generated pyqt class (WorkZone in the code below), and I need to view/edit some of it's properties with PropertyEditor, with the delegate PropertyEditorDelegate, that uses custom editors ColorEditor, LineEditor, etc. Main idea is that WorkZone knows what propertie...

pyqt QTreeWidget setItemWidget dissapears after drag/drop

I'm trying to keep a widget put into a QTreeWidgetItem after a reparent (drag and drop) using QTreeWidget.setItemWidget() But the result, if you compile the following code - is that the widget inside the QTreeWidgetItem disappears. Any idea why? What code would fix this (repopulate the QTreeWidgetItem with the widget I guess?) from Py...

How do I set up QtDesigner for a project that has animated elements?

I'm writing a project to simulate creatures moving around a map. These can be represented by simple circles, but I need a map/grid and those circles animated on top of the map. What elements should I use in QtDesigner to set up for this kind of GUI in my project? I've yet to do anything like this before ...

Linking a qtDesigner .ui file to python/pyqt?

So if I go into QtDesigner and build a UI, it'll be saved as a .ui file. How can I make this as a python file or use this in python? ...

Applying style sheets in pyqt

Hello all, If i apply a property to a parent widget it is automatically applied for child widgets too.. Is there any way of preventing this?? For example if i set background color as white in a dialog the button,combo boxes and scroll bars looks white as it lacks it native look(have to say it's unpleasant & ugly).. Is there any way that...

Allow user to select a file or a folder in QFileDialog

In PyQt you can do something like the following to allow the user to select a file filename = QtGui.QFileDialog.getOpenFileName(self, "Choose file..") However I would like a QFileDialog to open in which the user would be able to select either a file or a directory. I'm sure I've seen this feature in PyQt applications before, but I can...

creating dropbox like folder icons using pyqt??

Hello all, Is there a way that i can add my own icon to the existing folder and file icon like in dropbox or in ubuntu one.. Not only to the folders, it adds it's own icon to whatever the files you put inside the dropbox folder.. Is there anyway that i can achieve the same effect using pyqt.. Your suggestions are much awaited.. Thanks ...

QTableWidget signal cellChanged(): distinguish between user input and change by routines

i am using PyQt but my question is a general Qt one: I have a QTableWidget that is set up by the function updateTable. It writes the data from DATASET to the table when it is called. Unfortunately this causes my QTableWidget to emit the signal cellChanged() for every cell. The signal cellChanged() is connected to a function on_tableWid...