qt4

Is it possible to transate the wParam parameter into the actual message string?

I am trying to get the actual system messages that are represented by the intergers returned in the wParam property of the message. Is there anyway to do this or a function that can achieve this? ...

Create a random string or number in Qt4

Is there any function or something like that by which I can create totally random strings or numbers? ...

Dynamic Creation in Qt of QSlider with associated QLCDNumber

I was wondering what's the best way to go about the following scenario? I am dynamically creating QSliders that I wish to link to an associated QLCDNumber for display. The thing is I would like to have tenths available, so I would like to have a conversion between the QSLider and the QLCDNumber to divide by 10. At this point all I keep ...

Creating a QThread event loop in an existing non QT thread

My code is a plugin of a host software which gets limited processing time. Therefore, I create a second thread (via system API) and start QApplication there. That way, the GUI runs smoothly. Now, I would like to run a QThread event loop in the original such that I could use Signal/Slot (Qt::QueuedConnection) to invoke functions that are...

HowTo restore QTreeView last expanded state?

Hi. What I have: QTreeView class with table data And connected QAbstractTableModel model Question: how to save expanded state of items? Is some one have finished solutions? PS: I know, that I can do this code by myself, but I don't have much time, and this is not the major problem of our project, but still we need it, because app ...

[QT/C++]Creating objects of class through its name stored in a string?

Can I create an object of a class at runtime, by extracting the class name stored in a string? eg: I want to create and object of class QButton like QString strClassName = "QButton"; QButton *pBtn = new strClassName(); I want to read an xml file of all the controls and instantiate them at runtime using this way. Thanks! ...

Visual Studio compiled Qt Plugin doesn't load in release mode

Hi, I am developing a Qt application and a Qt Plugin library. Everything is working fine as far as I use the debug mode. Nevertheless, when I try to compile in release mode the plugin doesn't load. I got the following error message from QPluginLoader: Expected build key "Windows msvc release full-config" got "Windows msvc debug ful...

About signals and slots in qt

I am a beginner in Qt.I dont know how to connect two forms,I am able to open second form but cannot access the first form.Please help..urgent... :) Guru THIS IS MY PROGRAM #include<QApplication> #include<QLabel> #include<QPushButton> #include<QGridLayout> class form1 { public: QWidget *window1; QLabel *l1; ...

Q_OBJECT linker error!!

Hi, I am receiving the following linker error when I build my application. HIMyClass.obj:: error: unresolved external symbol "public: virtual struct QMetaObject const * __thiscall CHIMyClass::metaObject(void)const " (?metaObject@CHIMyClass@@UBEPBUQMetaObject@@XZ) File not found : HIMyClass.obj HIMyClass.obj:: error...

Create make with Qt4 and MySQL driver plugin

Installing QT plain is no problem, but when you've got to recompile QT with a MySQL driver plugin? Confusing. And when I do run configure, Qt registers my MySQL driver, but when I attempt to run mingw32-make, this abomination shows up on my command prompt: g++.exe: ....corelibcodecsqisciicodec.cpp: No such file or directory g++.exe: n...

[Qt]paintEvent not getting called in custom button derived from QAbstractButton

I'm trying to create a custom button, derived from "QAbstractbutton". I have overridden the paintEvent. However, my button is not visible in my widget. What I see is that the paintEvent is not getting called even after calling update/repaint/show on my button. What could be the missing link here? Thanks! ...

Qt + XCompositeRender problem

I want to render the contents of the window in to QWidget ( or QPixmap ) using XComposite and XRender. The Issue I'm facing is that I can't get the picture be rendered in the QWidget. The code below has been written using the following tutorial: http://ktown.kde.org/~fredrik/composite_howto.html The window ID is hardcoded, so there can b...

In QT & C++, Covert QMap<QString, QMap<QString, int> > to a single QVariant type.

Apparently QVariant (needed for QSettings class) supports creation from QMap<QString, QVariant> But trying to initialise something like this: QMap<QString, QVariant(QMap<QString, QVariant>)> i; Returns instantiated from here. <-- points to code above. function returning a function. So then i tried the QMap<QString, QVariant> overlo...

How to broadcast a signal in Qt4

I'm wanting a paradigm in a Qt4 (PyQt4) program where a component is able to respond to a signal without knowing anything about where it is coming from. My intial reading suggests that I have to explicitly connect signals to slots. But what I want is for any of a number of components to be able to send a signal, and for it to be proce...

HowTo find Subitem in QAbstractItemModel and QTreeView class?

Hello. Question: how to find sub item, in a QTreeView loaded QAbstractItemModel model with model->match() method? Problem: model->match() can't find sub items, wtf?! Here is the example: As you can see from the picture, I'm trying to expand Layouts sub item with this code: void Dialog::restoreState(void) { // get list QSet...

Invoke slot method without connection ?

I have a live object implemented in the following way. It is used to execute long tasks in background. The main thread invoke the tasks by sending a signal to the public slots (i.e. doTask). Here is a stripped down example (not tested). class MyTask : public QObject { Q_OBJECT public: MyTask(); ~MyTask(); public slots: ...

how to use QT graphic view for drawing

hello im trying to use the graphic veiw of QT to draw lines it's possible to draw a multiple objects in the scene but is it possible to do a (real time lines ) drawing inside the Qt scene , and how ? a sample code would be highly appreciated thanks in advance ...

what's the difference between Qmainwindow and Qwidget and Qdialog?

whats the difference between Qmainwindow and Qwidget and Qdialog in Qt programming. Are they similar with java awt and java swing? ...

Qt4 slots and signals: Qt4 has trouble finding the signal.

Hi, I am trying to get the statusbar to update with the FPS of the contents of a QGLWidget. I have connected them as follows (In class MainWin): glWidget = new GLWidget; ui.verticalLayout->addWidget(glWidget); connect(glWidget, SIGNAL( updateFPSSignal(float) ), this, SLOT( updateFPSSlot(float) )); } The ...

Using PyQt and Qt4, is this the proper way to get a throbber in a QTabWidget tab?

I have some code creating a QTabWidget from Python using PyQt4. I want to get a 'throbber' animated gif in the tab. The /only way/ I have found how to do this is the following convoluted method. tabBar = self.tabReports.tabBar() lbl = QtGui.QLabel(self.tabReports) movie = QtGui.QMovie(os.path.join(self.basedir, "images\\throbber.gif")) ...