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
I have solved that
Qt Code:
(event->modifiers() & Qt::AltModifier)&& (event->key()==Qt::Key_L)) { }To copy to clipboard, switch view to plain text mode
The above code works fine in xp .. But it Fails in windows 7.. please help me
In window 7 even the key press event is not called... please help me in fixing this...
No. it is not accepting it. but it works good in xp
Whether it can be applied using the dialogs instead
Is it possible to apply the key press events for the dialog based applications???
Bookmarks