Results 1 to 3 of 3

Thread: Help Request for designing .ini editor application in Qt for a total newbe

  1. #1
    Join Date
    Mar 2014
    Posts
    9
    Thanks
    5
    Qt products
    Qt5

    Default Help Request for designing .ini editor application in Qt for a total newbe

    Hello there, this will be my very first post on this forum

    Why I need help

    As mentioned in title, I'm a total newbe to projecting my own applications,
    I finished C++ course on University and know the general principles of object programing,
    but I never really wrote a GUI application from a scratch.

    What advice do I need

    I need to know the general approach I should take, what Qt elements would fit best for the purpose,
    what approach should I take in regards to data representation, save and load mechanics, how to combine it with
    the interface and stuff.
    If you've got good reading materials in regards to the topic, I'll be glad to read them instead.
    I don't want you to write the program for me, because I want to learn how to do it myself, I just want directions.

    What I intend to create

    I want to create an application that will allow me to easily modify certain .ini files, which represent
    HUD elements in a game. I want to easily place them on the screen, easily be able to mess around with the textures of the element
    (by selecting region from tga graphic file), and be able to rearange them in fashion of GIMP layers.

    The Ini Structure consists of
    • A main ini file, containing list of ini files with elements to load.
    • ini files containing a header with offset property, and elements separated using a comment line
    • elements of 3 types: Text, Icon(aka textures), Effects, all of which are represented on screen as rectangles and contain properties
    • properties of various nature, such as ID, hud group, hud layer, rectangle, and various other properties. I could load them all, but I see no need to, as some of them are irrelevant to the program purpose.
    • A single tga texture file that some elements such as icons can select an area of to be used as their texture



    So let's go through what that application will do from start to end:
    1. Load (parse) hud data from .ini files/create new project with default data values and store them in a structure of some sort (List? Hash?)
    2. Represent the hud elements in some kind of view, with list of them, in which I'd be able to select them, move around (accurately), change anchor points, resize them, mess with layers they will be displayed on, also easily group them and break the group on demand.
    3. Show dialog that will display a tga graphic, and allow me to select the region off this graphic, and then pass it to the view.
    4. Allow me to Save the modified data in the a structure of .ini files.



    Main challenges:

    • Coming up with a proper design of application, that wouldn't create a mess in memory, in code, that would be object-oriented,
      relatively simple and intuitive.
    • Finding the best way of representing the elements on screen. I already found out that I can use QGraphicsView, I'm not sure though how to connect the whole graphic elements and loading/saving mechanism, nor how should I approach edit mode changes or event handling.
    Last edited by Bziur; 1st March 2014 at 15:18.

  2. #2
    Join Date
    Nov 2012
    Posts
    47
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: Help Request for designing .ini editor application in Qt for a total newbe

    Starts with opening Qt
    I'm a newbie. Don't trust me

  3. The following user says thank you to ttimt for this useful post:

    Bziur (2nd March 2014)

  4. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Help Request for designing .ini editor application in Qt for a total newbe

    Nothing described is beyond a C++ program using Qt for support. You need to start with Getting Started Programming with Qt Widgets, the documentation and the numerous examples. "C++ GUI Programming with Qt 4" by Blanchette and Summerfield is a good resource (you will need to make minor adaptation for Qt5 but the principals are still good). The first edition is available online (http://www.qtrac.eu/marksummerfield.html) the second ed is still in print.

    QGraphicsView seems a reasonable base for a game scene editor.
    You will need to find a way to read the (unusual) Truevision TGA files as Qt does not contain one.
    Questions of how that view of your data structure is tied to the data structure, and how that data structure is related to its persistent format are far too broad to answer. They are strongly dependent on exactly how the data structure looks and operates.
    If the INI files are sufficiently generic then QSettings may be able to read/write them, but it's more likely you will have to roll your own with QTextStream and QFile.

Similar Threads

  1. Replies: 2
    Last Post: 10th May 2013, 14:30
  2. Designing a Node Editor (Hint: Blender Node Editor)
    By Mind Calamity in forum Qt Programming
    Replies: 4
    Last Post: 5th October 2011, 16:22
  3. Replies: 1
    Last Post: 11th March 2011, 16:51
  4. Designing transaction in the code equals designing problems
    By kornicameister in forum Qt Programming
    Replies: 8
    Last Post: 3rd February 2011, 01:11
  5. Designing a new core application
    By bothapn in forum Qt Programming
    Replies: 7
    Last Post: 19th March 2006, 11:34

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.