Quit in Windows
-
I'm writing an application for Windows and OS X using QT Creator. QT or OS X automatically puts a quit menu item but not for Windows. If I add 'Quit' with shortcut Command-Q in 'File' menu of my main application form, then Quit stops working under OS X. Do I need to add the Quit menu item dynamically or is there a way to create it in the form such that it works for both Windows and OS X?
-
I'm writing an application for Windows and OS X using QT Creator. QT or OS X automatically puts a quit menu item but not for Windows. If I add 'Quit' with shortcut Command-Q in 'File' menu of my main application form, then Quit stops working under OS X. Do I need to add the Quit menu item dynamically or is there a way to create it in the form such that it works for both Windows and OS X?
@mgreenish
just add it dynamically then:#ifndef Q_OS_MACOS menu->addAction( quitAction ); #endif
-
I'm writing an application for Windows and OS X using QT Creator. QT or OS X automatically puts a quit menu item but not for Windows. If I add 'Quit' with shortcut Command-Q in 'File' menu of my main application form, then Quit stops working under OS X. Do I need to add the Quit menu item dynamically or is there a way to create it in the form such that it works for both Windows and OS X?
@mgreenish
Windows apps don't tend to have aQuit
menu item. And personally I shudder when I see a Windows program with one! -
Hi,
Please show how you are setting up your Quit action.
-
@mgreenish
just add it dynamically then:#ifndef Q_OS_MACOS menu->addAction( quitAction ); #endif
@raven-worx said in Quit in Windows:
@mgreenish
just add it dynamically then:#ifndef Q_OS_MACOS menu->addAction( quitAction ); #endif
bad, bad !
action=menu->addAction(tr("Exit")); action->setMenuRole(QAction::QuitRole); action->setShortcut(QKeySequence::Quit);
should work well on all platforms.
-
@mgreenish
Windows apps don't tend to have aQuit
menu item. And personally I shudder when I see a Windows program with one!@JonB said in Quit in Windows:
Windows apps don't tend to have a Quit menu item. And personally I shudder when I see a Windows program with one!
actually its the exact opposite IMO. Almost all application with a File-menu have one.
@mpergand said in Quit in Windows:
bad, bad !
whats bad about it?!
-
@JonB said in Quit in Windows:
Windows apps don't tend to have a Quit menu item. And personally I shudder when I see a Windows program with one!
actually its the exact opposite IMO. Almost all application with a File-menu have one.
@mpergand said in Quit in Windows:
bad, bad !
whats bad about it?!
@raven-worx said in Quit in Windows:
@JonB said in Quit in Windows:
Windows apps don't tend to have a Quit menu item. And personally I shudder when I see a Windows program with one!
actually its the exact opposite IMO. Almost all application with a File-menu have one.
Pardon? Almost all Windows application have
Exit
on File menu, which is the standard (e.g. look at any Microsoft application), most I have seen which have aQuit
are "non-Windows" applications. -
@raven-worx said in Quit in Windows:
@JonB said in Quit in Windows:
Windows apps don't tend to have a Quit menu item. And personally I shudder when I see a Windows program with one!
actually its the exact opposite IMO. Almost all application with a File-menu have one.
Pardon? Almost all Windows application have
Exit
on File menu, which is the standard (e.g. look at any Microsoft application), most I have seen which have aQuit
are "non-Windows" applications.@JonB
so you just talking about the textsExit
andQuit
?!
I thought it's about haven such an action at all... -
Can you show a minimal example that reproduce the behaviour on macOS ?
By the way, which version of Qt are you using ?
Which version of macOS are you running ? -
@JonB
so you just talking about the textsExit
andQuit
?!
I thought it's about haven such an action at all...@raven-worx said in Quit in Windows:
@JonB
so you just talking about the textsExit
andQuit
?!
I thought it's about haven such an action at all...Yes. Just as MacOS users will expect the MacOS
Quit
instead ofExit
. -
Re: Quit in Windows
Hello all,
Thank you for the quick feedback. I have implemented the dynamic creation of the application 'Exit' only for Windows, as proposed.
@JonB: Yes, Exit is the standard on Windows, thank you for pointing that out but from your post, as raven-worx, I didn't understand right away you were saying they use 'Exit' rather than 'Quit'. Thanks for clarifying further on.
@SGaist: Thank you for the more complete code snippet. I figured out that i had made a mistake in my form declaration of the action and that is probably when when I tried to add it to the File menu, Command-Q stopped working under Mac.
Thanks!!