qt

QWidget's paintEvent() lagging application

i'm studying and modifying the fridge magnets example, and the last thing I've tried to do was to draw a few labels and lines that are supposed to be on the background. After looking around trying to figure out how to draw the labels and lines, I learned that I could override QWidget's paintEvent() to do it. After I did it though, the a...

QNetworkAccessManager handling asynchronous thread

Hi, I am new to QT. I have created object class QNetworkAccessManager main window as parent. Also registered to SIGNAL finished. It is working fine. But I want to know in which thread it will run. Will it block the main thread. If i need to perform sequence of get operation how should I need to write the code. Please give me some sample...

Can I have more than one line in a table header in Qt?

I'm using Qt4 and I have a QTableView which displays data using a custom model. I'd like to have two rows in the table header, ideally with some of the cells in the first row spanning multiple columns. Is this possible? ...

How do I know which thread called a method

I have a threadSafe method that gets called by multiple threads. Is there a way to know which thread called it? ...

how to specify Qt plugin constructor?

I wonder if it is possible to specify a constructor in a Qt plugin interface? (extending an app) I want to force the plugins using the interface to take a parameter in the constructor. ...

synchronising threads with mutexes

In Qt, I have a method which contains a mutex lock and unlock. The problem is when the mutex is unlock it sometimes take long before the other thread gets the lock back. In other words it seems the same thread can get the lock back(method called in a loop) even though another thread is waiting for it. What can I do about this? One thre...

Do I need to call QThread.exec() in my thread?

I am not calling exec() yet my timer and QUdpSocket work just fine. Is exec used to wait for an event to continue? ...

How to generate .sln/.vcproj using qmake

Hi! I have main.cpp in c:\test folder and do the following: qmake -project qmake -tp vc test.pro The answer is: WARNING: Unable to generate output for: C:/test//Makefile.Debug [TEMPLATE vcapp] WARNING: Unable to generate output for: C:/test//Makefile.Release [TEMPLATE vcapp] But, I don't need make files. I need .vcproj! Environme...

Does QNetworkManager get accept compressed replies by default?

I am using QNetworkManager to fetch files from a server, however what I cannot figure out is if the files are compressed during the transfer with the standard gzip compression and if not how to get them to download compressed. How would I go about checking? ...

Is it possible to run the main QT program on a thread ?

I have a simple QT object. When I execute the code below the control is transfer to the QT object, but I would like to make the QT part work like a thread. int main(int argc, char *args[]) { gui *GUI; //// before call QApplication app(argc,args); GUI = new gui(); GUI->show(); ////i want to be able to do stuff...

Qt in visual studio: connecting slots and signals doesn't work.

Hi, I have installed Qt and Qt for VS plugin. Everything works fine, UI applications compile and run that's ok, but connecting signals and slots doesn't. I have Q_OBJECT in my class and for connecting I am using this code in constructor: connect(ui.mainTableView, SIGNAL(activated(const QModelIndex &)), this, SLOT(showDetail(con...

Problem in animation of progressbar in QT

Hi.. i did progress bar in QT, i used both in emulator and mobile.. the infinite progress bar in appearing but its not getting animated.. (infinite progress is not coming) here is the code which i hv written QApplication a(argc, argv); QProgressDialog *dialog = new QProgressDialog(); dialog->setMinimum(0); dialog->setMaximum(0); di...

how to change the look and feel for Qt form ?

i need to change my form look and feel and i dont know : what i need to download and install ? is there any ready to use look and feel installed into qt library ? i am using windows and qt 4.4.3 ...

Qt Asynchronous Action During aboutToQuit

Hi all, I've got some Asynchronous cleanup activity I need to do as my Qt application is shutting down. My current approach is to trap the aboutToQuit signal. I launch my Asynchronous behavior, and then the application shuts down. Is there any way to block Qt from shutting down until my asynchronous behavior is complete? This works on...

Can I use waitForReadyRead in a QThread that belongs to the mainthread?

I have a QThread that contains a QUDPsocket (socket is member not local to QThread::run(), maybe I should change that from what I am reading). This QThread is instantiated in my QMainWindow class ie the GUI thread(I am not calling move to thread). Is it still safe to use waitForReadyRead or do I absolutly need to instantiate the QThread ...

How to start Qt development on Windows, but targeting Maemo 5?

Hello Everyone, I've recently heard about Qt and read about how fun it is to develop with. By the way, I'm also buying a Nokia N900 and I heard that its operating system, Maemo 5, supports Qt quite nicely, so I thought I'll give it a shot. I'm a .NET developer, so I'd prefer to develop on Windows, and if it is possible, using Visual St...

How can I make a banner in QT, like the news banner of CNN/FOX?

Hi, as the title says, I want to add my main window a banner in the bottom of the window that shows text that runs from left to right, just like you can see in your TV when watching fox/CNN... I'm using QT 4.5.2 Thanks a lot :) ...

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

Streaming to QTextEdit via QTextStream

I have often wanted to use QTextEdit as a quick means of displaying what is being written to a stream. That is, rather than writing to QTextStream out(stdout), I want to do something like: QTextEdit qte; QTextStream out(qte); I could do something similar if I emit a signal after writing to a QTextStream attached to a QString....

How to return a const QString reference in case of failure?

Hi, consider the following code: const QString& MyClass::getID(int index) const { if (i < myArraySize && myArray[i]) { return myArray[i]->id; // id is a QString } else { return my_global_empty_qstring; // is a global empty QString } } How can I avoid to have an empty QString without changing the return type...