how to start the log file when CTRL+ALT+T is pressed and if it presssed again it should stop.... how it can be done...
how to start the log file when CTRL+ALT+T is pressed and if it presssed again it should stop.... how it can be done...
What is it exactly that you don't know how to implement?
I want to start the log file creation when CTRL+ALT+L is presssed and have to stop it when the same combination has been clicked.. please help me..
I understand what you want, I'm asking what are you having problems with? Tell us what you have already tried and what didn't work.
Qt Code:
{ if (event->key() == Qt::Key_Control && Qt::Key_Alt && Qt::Key_V) { } I have tried this one, but after pressing the key combination also the message box is not shown.. }To copy to clipboard, switch view to plain text mode
No its a dialog
A dialog is also a widgetOk, does it have keyboard focus?
Furthermore your code is incorrect:
this can be translated to:Qt Code:
if (event->key() == Qt::Key_Control && Qt::Key_Alt && Qt::Key_V)To copy to clipboard, switch view to plain text mode
which again translates to:Qt Code:
if(event->key() == Qt::Key_Control && 0x01000023 && 0x56)To copy to clipboard, switch view to plain text mode
and then to:Qt Code:
if(event->key() == Qt::Key_Control && true && true)To copy to clipboard, switch view to plain text mode
which as you probably guess is not what you want. Read what QKeyEvent::key() is and use it with conjunction with QKeyEvent::modifiers(). Or just use QShortcut.Qt Code:
if(event->key() == Qt::Key_Control)To copy to clipboard, switch view to plain text mode
Learning a bit more C++ wouldn't hurt either.
How to perform those key combinations in it?? please help me with the above codes.
What didn't you understand from my previous post? Make sure you widget accepts focus, use QKeyEvent::key() in conjunction with QKeyEvent::modifiers() or use QShortcut. If you expect me to provide full working code then that's not going to happen, I rarely do that in the Newbie forum. And please correct your profile information, somehow I doubt you're using Qt3 or Qt/Embedded.
You are using logical AND where you want bit-wise AND.please help me with the above codes.
http://en.wikipedia.org/wiki/Operato...ical_operators
How to capture the key press events in QT in windows7?? CTRL+ALT+ some alphabet combination's. if we press this combination.. the particular event function should be called...
I have used the following code.. it works fine in xp(Qt 1.3.1) but it is not working in windows 7.,(Qt 4.3)::
Qt Code:
To copy to clipboard, switch view to plain text mode
For the last time: shortcuts, key events and such work in terms of focus. One of children of the window containing the shortcut needs to have focus for the shortcut to trigger.
Bookmarks