Search code examples
c++qtuser-interfacemenubar

Creating a "Save Current Setting" feature in the menu bar of my app using C++


I currently implemented an application with features that perform some image processing functions. Everytime I run the app, I lose my previous settings that I used for analyzing images. Currently, the app doesn't contain a menu bar feature. I am hoping with the menu bar, I can save the current setting (I mean the parameters that I set) so that it would be easy for me to revert back to the original setting whenever I want. I was thinking of implementing a "Save Current Setting" feature in my app. Can some one guide me on how I would go about doing this?

Note: I am working on Windows 7 OS and I wish to create the UI in QT or MFC.

EDIT (Re posting form the comment): The application takes in images and allows the tool operator to analyze them. I vary the parameters (For e.g: the scroll bars for adjusting the window sizes for the filters, radio buttons, check boxes, list boxes etc) in the app. I get different results with different settings. Currently it doesn't have any menu bar feature. I want to have a button that allows to me save the parameter setting. Suppose if I run the app 5 times and I find the 3 run to be better, I need to save that setting so that I can revert back to it whenever I want.

Thanks


Solution

  • I don't use either (Qt, MFC), but I think it's basically the same concept everywhere:

    1. Settings

    If you want to be able to store application settings, put them in a file and read the file when the app starts. Some systems have built-in technology for app settings (such as GSettings in Glib). I'm sure Qt has some interface for settings. Even if not, just write them to a key file (aka INI).

    1. Menu item

    I strongly suggest you do serious interface design. Do it as a separate part of the project, and don't mix coding with the interface design. Keep a separate list of the actions your app needs to do, and try to arrange them in buttons and menus. You're vert welcome to use conventions used by existing apps. For example, some GNOME apps have amazingly simple and easy-t0-use interfaces (sometimes at the cost of less features, though) which you can look at.

    You can also read the Gnome Human Interface Guidelines, which is an excellent document.

    1. Adding a menu bar

    I'm sure both MFC and Qt have a Menu class. Either you create an abject and pack it into your Window class, or you create the GUI using a GUI designer, maybe KDevelop or QtDesigner (or whatever KDE uses for Qt GUI design), and design it there.

    Good luck.