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. Basic design recommendations wanted
Forum Update on Monday, May 27th 2025

Basic design recommendations wanted

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 4 Posters 911 Views
  • 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.
  • bart.hollisB Offline
    bart.hollisB Offline
    bart.hollis
    wrote on last edited by
    #1

    I just can't seem to get my head around the proper (Qt) way of designing the user interface. I want to create an application that will use an SQLite database with 5 tables. Of course, I want to be able to CRUD the data in these tables. The 5th table will be comprised of some user input but primarily assembled from the data in the other tables. So far, that seems the easy part.

    What I can't figure out is how to present the first four tables to the user. Pouring through the tutorials, there are plenty of examples of placing widgets but all of them are on the main window. Is that how it's supposed to work? Do I create some sort of widget for each table? Seems like I should create a window that can be called, do the process required and then deleted, but I can't seem to find a window class that does that. It doesn't seem that a mainWindow is right.

    Sorry this is so long. I really need a jump start!
    Bart

    jsulmJ 1 Reply Last reply
    0
    • bart.hollisB bart.hollis

      I just can't seem to get my head around the proper (Qt) way of designing the user interface. I want to create an application that will use an SQLite database with 5 tables. Of course, I want to be able to CRUD the data in these tables. The 5th table will be comprised of some user input but primarily assembled from the data in the other tables. So far, that seems the easy part.

      What I can't figure out is how to present the first four tables to the user. Pouring through the tutorials, there are plenty of examples of placing widgets but all of them are on the main window. Is that how it's supposed to work? Do I create some sort of widget for each table? Seems like I should create a window that can be called, do the process required and then deleted, but I can't seem to find a window class that does that. It doesn't seem that a mainWindow is right.

      Sorry this is so long. I really need a jump start!
      Bart

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @bart.hollis If you want to create a window you can create a dialog (see http://doc.qt.io/qt-5/qdialog.html)

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      3
      • AndeolA Offline
        AndeolA Offline
        Andeol
        wrote on last edited by
        #3

        Hi,

        there are plenty of examples of placing widgets but all of them are on the main window. Is that how it's supposed to work?

        At least that's one way, for simple GUI. Once the GUI gets more complex, with a lot of widgets to handle, we usually prefer to distribute the work. Like the mainWindow would contain a widget A and a widget B. But A and B both contain other widgets. Widgets containing other widgets is the heart of Qt GUI.

        Do I create some sort of widget for each table?

        That's probably what I would do if I were (was? I never know) in your shoes.

        I should create a window that can be called, do the process required and then deleted

        You can do that (any widget can be deleted, see http://doc.qt.io/qt-5/qwidget.html#dtor.QWidget), but are you sure you need to delete it yourself? Most of the time, you can just hide a widget when it's not useful, and show it again when it is.

        Developer for R++ : https://rplusplus.com/

        1 Reply Last reply
        2
        • M Offline
          M Offline
          mchinand
          wrote on last edited by
          #4

          Check out QTableView and QSqlTableModel and the examples that use them for displaying your first four tables.

          1 Reply Last reply
          3

          • Login

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