see mousePressEvent().Since there is not such a thing like clicked signal emitted from QMainWindow I'm wondering how can I check if the window was clicked while 'lock' state.
see mousePressEvent().Since there is not such a thing like clicked signal emitted from QMainWindow I'm wondering how can I check if the window was clicked while 'lock' state.
==========================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.
Tomasz (13th December 2010)
Thanks! I've reimplemented this function:
Qt Code:
{ if(event->button()==Qt::LeftButton) { out << "test" << endl; } }To copy to clipboard, switch view to plain text mode
And it works just fine. One more question. When I've reimplemented it, it will be working all the time that way. Can I make it work this way only in my 'lock' mode? I think I can use some variable to detect that mode, but is this the only way?
thanks in advance
best regards
Tomasz
I am not quite sure I understand your last question.
One way you could go about it, is just emit a signal in your mousePressEvent(), and in the slot you can have the logic for doing things depending on your mode, as you wanted in your original question.
But that is only a semantic difference.
You can just as well do that in the mousePressEVent().
P.S
Instead of using QTextStream for debug messages you can use qDebug().
==========================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.
Tomasz (13th December 2010)
Bookmarks