qt4

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

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

how to add an widget into the Form In QtDesigner

in qdesigner_workbench.cpp, how can I add a widget (say QLabel) into a FormWindow by code? Since methods like createWidget()...etc are all abstract, how do I properly use the internal mechanics to add QLabel into the active FormWindow? EDIT: In qdesigner_workbench.cpp, this is currently what I have: QDesignerFormWindowManagerInterfac...

Qt moc_ include file problem

I'm trying to compile the basic tutorial program at http://doc.trolltech.com/4.4/mainwindows-application.html and running into a problem. Doing things the way the tutorial program does them, gives a compile error: In file included from debug\moc_mainwindow.cpp:10: debug\../mainwindow.h:2: error: expected class-name before '{' token deb...

Qt invokeMethod with QString

I have a daemon running on DBus that offers service for launching applications. I want to pass two strings to this service API (appPath, appArgs). I have registered the service and the object path with DBus. My service method gets called, but I do not receive the arguments properly () in my service. This is how I'm doing it from my adap...

How can I set the path + filename in Qt Designer's property box?

I sucessfully added a QLabel widget into the FormWindow and set a pixmap in code, but when examine the property box the pixmap filepath field was empty even if the image did get loaded properly. The QPixmap struct has no members holding the path, so this info must be somewhere in the Property Box. How can I access it? If the pixmap fil...

Accessing Qt widget from different thread

In Qt an object belongs to the thread on which it has been created. We need to access controls created in main thread from background thread. However as soon as we refer the object, application goes into hang state. Please let me know how to access and modify controls in the different thread which hasn't created the controls. Thanks in ...

Text under a widget added with QToolbar.addWidget()

I have a QToolbar with toolButtonStyle set to Qt::ToolButtonTextUnderIcon in which I add a QLineEdit through addWidget(). I'd like to have descriptive text under that widget like I do with other buttons, but I don't know how to do it or if it's even possible. I tried: lineEdit = QLineEdit() action = self.toolBar.addWidget(lineEdit) acti...

URL for multiple markers in Google Maps

In a desktop Qt application, I have some GPS coordinates that I'd like to show on a map. My plan is to construct an URL with the coordinates and let a web browser and Google maps or a similar service do the heavy lifting. After reading some apparently reverse-engineered documentation at mapki.com slash wiki slash Google_Map_Parameter...

Filling the parent with Qt widgets

I'd like to create an application's main window in qt4 designer. When I add a layout element to the centralwidget, that element stays in the middle of the window and does not move when the window is resized. How can I make it "fill" the whole area (and resize its children properly)? All children widgets of my layout are expanding proper...

Custom painting QMainWindow title bar

Does anybody know how can I customize title bar of a main window in QT? I would like to make some custom painting over the "normal" drawing. The QT version I'm interested in is 4.5 or 4.6 (beta) ...

How can I add widgets to title bars in QMainWindow?

Is any posibility to add widgets in titlebar of QMainWindow? I try to avoid "emulate" a title bar by making a custom widget for that and hiding the default title bar (from Qt::WindowFlags). I am using QT 4.5 or 4.6 beta. ...

PySide Qt4 widget exchange in a hboxlayout

I'd like to exchange a widget inside a QHBoxLayout. This code seems to work, but as soon as I do the actual app._exec(), the code crashes with terminate called after throwing an instance of 'boost::python::error_already_set'. Is there any way to get the actual error message? (or to resolve this problem) gaParent = gameArea.parent().layo...

When dragging a row in a QTableWidget, how can I find out what row index it was dragged FROM and TO?

I'm trying to keep some array data synchronized with the contents of a QTableWidget. I'd like to enable drag and drop reordering (moving items within the table, as opposed to copying), but it's not clear to me how, when the drop event is fired, I can find out what index the item was dragged FROM. Hence, I have no way of knowing what ob...

Qt Creator Project Build Error

Hello everyone, I get the following error when building a project in Qt Creator: **error: collect2: ld returned 1 exit status** Below is the compile output **Running build steps for project mw_fe...** Starting: F:/Qt/2009.04/qt/bin/qmake.exe C:/Documents and Settings/Administrator/My Documents/mw_fe/mw_fe.pro -spec win32-g++ -r CON...

How to read data from file and display in QEditText box in QT

i would like to read a line of data from text file and display that data in Text Edit box ...

how to export headers using Qt pro files

I've a project with following files TestProject/api/apiheader1.h TestProject/api/apiheader2.h TestProject/src/apiimplementaton.cpp TestProject/inc/apiimplementation.h TestProject/TestProject.pro When the project TestProject.pro is built headers apiheader1.h, apiheader2.h needs to be copied to /usr/include/TestLib/. Is it possible to d...

QComboBox with single value: Select this value

I have a QComboBox which changes its selection possibilities depending on certain conditions. Because of special combinations, it might have only one selection left over, which has to be "confirmed" by the user, preferably by looking at all possible selections, seeing that there is only one, and then selecting this. My problem: If a us...

Modifying Qt core components/widgets, best practices?

Hello everyone, I'm trying to enhance Qt's QPrintPreviewWidget by allowing it to display page numbers (in the footer somewhere). Unfortunately, I can't quite figure out how to go about it without hacking up Qt's source. I see a great spot for this additional code (in qpaintengine_preview.cpp, in newPage() method) but that means I'm goin...