Click here to Skip to main content
13,044,705 members (65,718 online)
Rate this:
Please Sign up or sign in to vote.
See more:
if ((event->type()==QEvent::KeyPress) && (event->modifiers() &&
     Qt::ControlModifier) &&
     (event->modifiers() && Qt::AltModifier) && (event->key()==Qt::Key_L))
    QMessageBox::warning(NULL,"keypress","key pressed",QMessageBox::Ok);

This code works fine in xp but fails in xp Win7.. Please help me
Posted 10-Apr-11 21:16pm
Updated 11-Apr-11 9:19am
Manfred R. Bihy 11-Apr-11 7:54am
Works fine in XP AND fails in XP. WTF! Not at the same time I hope?
Gokulnath007 11-Apr-11 8:04am
same code working fine in xp.. not working in windows 7.. nothing is returned when the key combination's are pressed
Emilio Garavaglia 11-Apr-11 15:20pm
Pay attention on what "paste as HTML" do when pasting code... I hope I interpreted well the mess in the question.
Please, check if my edit is what you wanted.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

There are no "language issues" in your code. You just call a number of Qt API. May be the version of Qt you are using is not fully compatible with W7.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

By fail, I assume you mean the if-block is never entered. You should break there in the debugger and see which of the sub-conditions do not return true on Windows 7. It may be a QT issue with W7, it may be a bug in your code, it may be that you need an updated QT version, could be anything really.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 11 Apr 2011
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100