Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Can i have multiple Qdialog boxes along with my Mainwindow in my application ??
Forum Updated to NodeBB v4.3 + New Features

Can i have multiple Qdialog boxes along with my Mainwindow in my application ??

Scheduled Pinned Locked Moved Unsolved General and Desktop
c++qlistwidgetqdialog
3 Posts 3 Posters 1.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mr-Workalot
    wrote on 25 Jun 2020, 21:04 last edited by Mr-Workalot
    #1

    i have a QListwidget in my UI , The items of these are foods like
    Pizza
    Turkish Delight
    Pasta
    Cake
    ...
    ...
    i have 22 of items like these

    So when ever i double click on each item, i have a separate modal QDialogbox pop-up which shows its recipe and the QDialog box also takes input with the help of few line edits.

    So my question is that having 22 separate QDialogboxes is okay ?Any downsides to this ? or can i do anything better as an alternative , because for each dialog box, i also have a .h and .cpp file also.

    J 1 Reply Last reply 25 Jun 2020, 21:22
    0
    • M Mr-Workalot
      25 Jun 2020, 21:04

      i have a QListwidget in my UI , The items of these are foods like
      Pizza
      Turkish Delight
      Pasta
      Cake
      ...
      ...
      i have 22 of items like these

      So when ever i double click on each item, i have a separate modal QDialogbox pop-up which shows its recipe and the QDialog box also takes input with the help of few line edits.

      So my question is that having 22 separate QDialogboxes is okay ?Any downsides to this ? or can i do anything better as an alternative , because for each dialog box, i also have a .h and .cpp file also.

      J Online
      J Online
      JonB
      wrote on 25 Jun 2020, 21:22 last edited by
      #2

      @Mr-Workalot
      Although it's possible to have 22 separate dialogs, is there not enough commonality in whatever you are showing on them to have a single, generic dialog and set variables/widgets to control the individual detail of what they display?

      1 Reply Last reply
      2
      • M Offline
        M Offline
        mrjj
        Lifetime Qt Champion
        wrote on 26 Jun 2020, 22:27 last edited by
        #3

        Hi
        The downside of having 22 dialogs is all the .cpp and .h you get and also adding new features, say you want to have an image of the
        dish at some later point you would have to add this 22 places.

        For your use case, it sounds like data driver would be much better.
        Meaning you have just one dialog and then based on the data structure where you keep the information about
        the recipes, you add the needed EditLines at runtime.

        SO as @JonB asks, are they that special each of the dishes that you cant handle them very much the same?

        1 Reply Last reply
        2

        1/3

        25 Jun 2020, 21:04

        • Login

        • Login or register to search.
        1 out of 3
        • First post
          1/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved