Qt/MacOSX preferences menu item
Hello,
I'm developping an application with Qt (I'm working on MacOSX)!! When I run the application, a menu (with the name of the application) is created. This menu contains the preferences item and I wan't to configure it.
So I don't know how to create the preferences dialog box and how link it with Qt !! Does Qt offer functions to configure the preferences menu item?
Re: Qt/MacOSX preferences menu item
Quote:
Originally Posted by mcenatie
Hello,
I'm developping an application with Qt (I'm working on MacOSX)!! When I run the application, a menu (with the name of the application) is created. This menu contains the preferences item and I wan't to configure it.
So I don't know how to create the preferences dialog box and how link it with Qt !! Does Qt offer functions to configure the preferences menu item?
Well, not really clear... AFAIUnderstand you want to provide a dialog that allow user to customize your app. Qt does not provide such kind of dialog so you have to create your own and deal with QSettings to save the configuration in a permanent manner.
Re: Qt/MacOSX preferences menu item
In fact, when I'm designing my main window, I have only three menus. But when I run the application, there is one more menu ! MacOS X automatically adds this menu and I wan't to know if Qt provides function to modify this menu!!
Re: Qt/MacOSX preferences menu item
Quote:
Originally Posted by mcenatie
In fact, when I'm designing my main window, I have only three menus. But when I run the application, there is one more menu ! MacOS X automatically adds this menu and I wan't to know if Qt provides function to modify this menu!!
If you include a preferences action in your menu bar (with a name like Options or Preferences), it will end up in the Mac OS X application menu (which will have the same title as your application, in bold). Otherwise, it functions exactly as it would when it appears in its normal place in a Windows or X11 app. Everything else - the design of the preferences dialog and processing it - is your job; Qt has a QSettings class to write preferences using either Carbon preferences (on OS X), the registry (on Windows) and an XML file (on X11).
Re: Qt/MacOSX preferences menu item
Quote:
Originally Posted by Matt Smith
Qt has a QSettings class to write preferences using either Carbon preferences (on OS X), the registry (on Windows) and an XML file (on X11).
Actually it writes an ini file on X11. I personally would have preferred an XML file because of its hierarchical structure and a more logical mapping with the Windows registry, GNOME conf, etc.