Home > Mobile >  Press Alt + f4 window will break out
Press Alt + f4 window will break out

Time:10-02

Modifiers () also doesn't work
What's wrong with the

CodePudding user response:

The code you write you don't have the feel wrong... Key only F4, Alt is KeyboardModifier,
So you should judge e - & gt; Modifiers () is equal to Qt: : AltModifier

CodePudding user response:

reference 1/f, an idle guitarist reply:
the code you write you don't have the feel wrong... Key only F4, Alt is KeyboardModifier,
So you should judge e - & gt; Modifiers () is equal to the Qt: : AltModifier

Tried this method won't work

CodePudding user response:

Then in processing closeevent

CodePudding user response:

The Windows default shortcut keys to close the window,

CodePudding user response:

reference 4 floor ooolinux response:
Windows default shortcut keys to close the window,

What do you mean can't change the keyboard events

CodePudding user response:

Unless the hooks, the word count

CodePudding user response:

 
Void MainWindow: : closeEvent (QCloseEvent * event)
{
The event - & gt; Ignore ();
}

CodePudding user response:

The key is MainWindow can get Alt + F4 keyboard events?

CodePudding user response:

refer to the eighth floor fearlazy response:
MainWindow can get Alt + F4 is the key to the keyboard event?

Seems to be no, press the Alt + f4 will exit the
But the use of closeEvent () function, press will not exit
  •  Tags:  
  • Qt
  • Related