Hello all
can you gimme an opinion? Whats the better to make some threads and use signal/slots?
Qthreads, QtConcurrent, QRunnable, another one...
Thanks everyone
Hello all
can you gimme an opinion? Whats the better to make some threads and use signal/slots?
Qthreads, QtConcurrent, QRunnable, another one...
Thanks everyone
all the options you suggested are good.
No, they are great!
It depends what for though, which you didn't mention.
Can you tell me what is better - a hammer or a screw driver?
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
youŕe right xD
I'am asking it cause i am trying use the signal/slot with QRunnable, but when i put the Q_OBJECT macro, i get a "undefined reference to vtable". As i searched, this error occurs when a virtual method is missing, but i didnt create any virtual method and the run() is ok.
Any idea friend?
Tio (25th May 2010)
Wysota
So, there's no way, right?
MOC uses vtable, maybe you forgot to run that (and added newly built files) after you added Q_OBJECT macro.
Wysota
No, i ve just made the class inherit from QRunnable.
QObject, i guess?
Tio (26th May 2010)
ok wysota, thanks
my conclusion is: use QThreads xD
hugs people, thanks a lot
You could have just subclassed both QObject and QRunnable at the same time...
i´ve tried it wysota, but the problem persist...it´s a problem when there is a noob like me xD
class Thread : public QRunnable, QObject , in header file
Thread::Thread(QString strCaminhoOff, QString strCaminhoPP) : QRunnable , in constructor
Maybe is missing inherit QObject in constructor, but the QT creator dont let me put it there...
In other hand, the aplication in QThread is fine, for now xD
ps: in time -> which tag i choose up there to my text appears like a QT code? =P
yeah, i think so...thanks for all help friend.
c ya
Bookmarks