qt4

QT: Pause function flow till QWebView SIGNAL is completed

Hello! I'm a mostly webdeveloper, so my question can be somekind of a beginners. I'm writing a function which works with QWebView content, some kind of a macro script which makes action on loaded web page. code is something like that: somefunction() { QWebView *webView; webView->load(QUrl("http://www.google.com")); <...> here I want...

QT4 How to use static fields ?

I am trying to use static fields in QT class MyLabel:public QLabel{ Q_OBJECT public: static QPixmap pix1; static QPixmap *pix2; static int WasInited; ... }; int MyLabel::WasInited = 0; MyLabel::MyLabel(){ . . . if (WasInited==0) pix1.load("pic.png"); // Error if (WasInited==0) pix2->load("pic.png"); // Error ...

qt designer and data bound controls ?

can I use QT Designer 4 to create / design tables or other controls with automatic binding to database connections? Or must I write specific code for that in my application? (i'm using python 2.5 with pyqt 4.8 on Windows xp, if it matters) Thanks. ...

QT: How to open several windows (QWidgets) at once?

Hello! I'm doing web interface testing program which should open two urls in two webkit windows simultaneously. I already did the code for the test automation. 1) User pushes 'Go' button and webkit (QWidget) window opens 2) TestBot class object performs tests 3) Closes Now my question: After clicking on the button 'Go', how do I op...

QMainWindow problem on Mac OS X

I have a Qt-based program, and I uses QMainWindow somewhere in the UI part. This program works fine on both Windows (windows 7) and linux (Ubuntu 10.04), however, when I try to run it on MAC, some UI problem occurs. The Central widget of QMainWindow shows up correctly, but the frame (where the "minimize", "maximize", "close" buttons sh...

QThread interaction with GUI

I am developing image aquisition software. I want to run display function in a separate thread (to ensure live view for easy image capture). For now I am subclassing QObject, creating DisplayObject and using QThread::moveToThread function. Problem is that DisplayObject has to interact with GUI (images need to be displayed in QGraphicsVie...

How to set output path of cmake / qt4 command QT4_WRAP_UI

I use the cmake command QT4_WRAP_UI. Is there an option to control the output path of the generated header files? ...

Compiling C code, does not see a #define'd constant

Greetings. I am trying to compile a 8hz mp3 encoder - C code in QT Creator. In a file l3psy.c that starts like this #include <stdio.h> #include "types.h" #include "error.h" #include "layer3.h" #include "l3psy.h" #include "fft.h" #include "tables.h" The build step complains about PI being undeclared here for(i=0;i<BLKSIZE;i++) wi...

Memory Management in Qt

HI all, I have small doubt about Qt memory management, Lets take an example of Listview, in listview we add each item by allocating memory dynamically. So in this case do we need to delete all the “new”ed items manually.. Eg: Qlistview *list = new Qlistview; QStandardItemModel *mModel = new QStandardItemModel(); list ->setModel(mMode...

How to anchor QGraphicsView to a special point on a scene?

How to anchor QGraphicsView to a special point on a scene? I want a center of a view is anchored to the scene point (0,0). But as said in docummentation: If the whole scene is visible in the view, (i.e., there are no visible scroll bars,) the view's alignment will decide where the scene will be rendered in the view. And i...

Convert a QDateTime in UTC to local system time

I construct a QDateTime from a string like this: QDateTime date = QDateTime::fromString("2010-10-25T10:28:58.570Z", "yyyy-MM-ddTHH:mm:ss.zzzZ"); I know that date is in UTC because that is the way it's stored. But when I want to display this date to the user, it should be in the user's local time zone. date.toLocalTime() looks promisin...

Why is PyQt connect() syntax so verbose?

I'm just learning PyQt and looking at the Signals and Slots mechanism. I'm a bit baffled by the verbose syntax. Why do we have: self.connect(dial, SIGNAL("valueChanged(int)"), spinbox.setValue) I would much prefer to write the following: self.connect(dial.valueChanged, spinbox.setValue) Can anyone tell me why the connect() syntax n...

Difference between to widgets to track down a resize problem in Qt

Hello everyone, Here are two designer .ui files : resize_not_ok.ui is a QTabWidget. In its first tab (layout being a QVerticalLayout) there is a QPushButton and a QVerticalSpacer resize_ok.ui follows the same structure, but the QTabWidget is inserted in a QWidget. This top-level QWidget has a QVertical layout with only the QTabWidget ...

Removing QGraphicsItem issue

Hi I have a problem with my piece of code. I am getting assertion failed message from qt when a use this code. But the message is being generated when repainting (somewhere in bst tree) the scene so i can not find out what is wrong in my code. Maybe i am missing something? Please take a look. I am using Qt 4.6 After this function progra...

How to read a software source code?

Hello I want to write gui with QT for aria2c( internet download manager ) but i don't know how to read this software code because it's codes doesn't documented please help me to how i can read this program code and use it's apis in my gui software? this program site : http://aria2.sourceforge.net/ i want program gui like idm( internet do...

How to get sender widget with a signal/slot mechanism?

It's possible to bind more than one signal to one slot (isn't?). So, is there a way to understand which widget sends the signal? I'm looking for something like sender argument of events in .NET ...

how to dynamically add a QWidget based to QGraphicsScene?

Hello, I want to add a QWidget based class(composed by buttons and labels an so on...) to my QGraphicScene scene in a special position and respecting the graphic style of my scene.? I am using QT 4.7. ...

How do I install Qt 4.7.0 on Snow Leopard ?

I tried using the binary installer and I get the same problem I am describing below. I have compiled it from source and used the instructions given on the Qt website, but I can't get Qt Creator to find Qt. I tried copying the Qt directory from /usr/local/Trolltech to /Developer/Applications/QT I have tried copying the frameworks into /D...

Missing rules XML file for qt's 'uic3 -convert'

I'm trying to run uic3 -convert to convert some QT3 .ui files to QT4. When I run it, uic3 reports that it's unable to find the rules file (q3porting.xml). Where does uic3 look for the q3porting.xml file Can I pass the rules file as an argument on the command line (similarly to using qt3to4 -rulesFile)? If not, what else can I do? ...

Ruby, Qt and third party widgets

I'm learning Ruby and, for this, I'm writing an application in it. My background is in C++/Qt. So I've started writing a Ruby/Qt app. But there's a few previously written widgets (C++) I would like to use, besides qwt. Is this possible? If it is, how should I do it? PS: It seems QtRuby from Korundum bindings do includes Qwt bindings. ...