Results 1 to 4 of 4

Thread: Advice - First Qt4 App - Instrument Panel

  1. #1
    Join Date
    Jan 2011
    Posts
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Advice - First Qt4 App - Instrument Panel

    Hi all.
    First of all I would like to thank all those involved in the 'Qt Project' - I think Qt is amazing.
    I wish to learn Qt and I have obtained a few Qt books (C++ GUI Programming with Qt4, The Art of Building Qt4 Applications, Foundations of Qt Development).
    I have given myself a project as I find there is a very big difference in trying to learn from a book and actually creating a 'real' application that would be useful. The project is an instrument panel that will display the current status of certain instruments connected to the PC. These may include temperature, air pressure, humidity, and so on.
    As this is my first project I have a very great deal to learn.

    I would like each instrument in the instrument panel to have a label to identify that instrument and at least one other label (or alternative) to display the reading of the instrument (in addition to the analogue indication of the instrument pointer). The first would probably be best located over the instrument with the second probably located underneath the instument.
    'Temperature' instruments should probably look similar to a thermometer. Other instruments would probably look similar to a circular dial with a scale.
    It would seem to me that it would be appropriate to create some form of frame widget containing one of the required instruments and the required lables.
    Each frame widget could then be placed into a 'main window' widget.

    I am not at all sure how this type of construction would react to main window resizing.

    Would this be an appropriate approach, or is there a better approach?

    Take care.

    Mke

  2. #2
    Join Date
    Jul 2009
    Posts
    74
    Thanks
    2
    Thanked 6 Times in 6 Posts

    Default Re: Advice - First Qt4 App - Instrument Panel


  3. #3
    Join Date
    Jan 2011
    Posts
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Advice - First Qt4 App - Instrument Panel

    Quote Originally Posted by javimoya View Post
    Wow! They are nice looking instruments and, I suspect, just a tad better than I could cobble together

    But that's not really the problem that is exercising my mind just now.

    Let's say that there will be four or five circular gauge style instruments (a compass, an air pressure gauge, a humidity gauge, etc, etc) and a few vertical scale style instruments (thermometers mostly).
    Each of these will have an accompanying label over the instrument to identify the purpose of that instrument (e.g. Air Pressure). Each of these will also have a label underneath the instrument that will give a 'digital' indication of the scale reading (e.g. the scale needle might be pointing at a part of the scale in the region of 1000mB but the label undeneath might indicate 1002mB).

    And so the layout...
    I could create a main window and place each instrument on this along with the upper and lower labels and any other widgets that might be required. I could spend some time getting the layout just right. But when I resize the main window the layout will go all awry (I have actually tried this and that is what happens).
    And so is there a better approach?
    I could create each individual instrument in its own window type widget along with all the other widgets that 'belong' to that instrument (such as upper and lower labels). These instrument containers could then be added to the main window and laid out as required.
    This would seem to be a better approach. But I am not sure of a few things.

    And so the questions
    1. Would this be a good approach?
    2. Is there a better approach?
    3. What would be likely to happen if/when the main window is resized? (would each instrument container also resize 'appropriately'? And would each of the widgets _inside_ each instrument container resize 'appropriately'?)
    4. Would a frame or a docking window be a better container for the instrument and accompanying widgets?

    Or am I completely off course?

    Thanks for the reply, javimoya. Those are really nice instruments.

    Take care.

    Mike

  4. #4
    Join Date
    Jan 2011
    Posts
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Advice - First Qt4 App - Instrument Panel

    Update

    I have crudely 'hand-coded' some Qwt gauges and added these to a window. These gauges now resize as expected.

    The problems I have experienced with Qwt gauges 'created' using Qt Designer must be due to my lack of understanding of Qt Designer.

    As I now have a means to create gauges that behave as needed (I think) by sticking to the keyboard then this matter is now closed.

    I would like, again, to take the opportunity to thank the creators and maintainers of Qt. I continue to be amazed.

    Take care all.

    Mike

Similar Threads

  1. Don't show on panel?
    By neverlander in forum Newbie
    Replies: 10
    Last Post: 27th May 2010, 22:34
  2. Scrollable Panel
    By qtoptus in forum Qt Programming
    Replies: 1
    Last Post: 5th May 2010, 11:07
  3. collapsible panel/frame
    By prashant in forum Qt Programming
    Replies: 4
    Last Post: 5th September 2009, 19:17
  4. left/right panel with buttons
    By swiety in forum Qt Programming
    Replies: 1
    Last Post: 5th January 2008, 14:12
  5. Replies: 3
    Last Post: 26th November 2007, 19:01

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.