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. hide() or load data on constructor in QDialog?

hide() or load data on constructor in QDialog?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 311 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.
  • U Offline
    U Offline
    U7Development
    wrote on last edited by U7Development
    #1

    Hi !.

    I have a QMainWindow that has a QMenu , there is a QAction that opens a QDialog window, this QDialog window has a QTableWidget, it reads from a std::vector<MyObject>, where MyObject is an object that contains QString fields that will be loaded into the table...

    What is the most orthodox way to follow:

    1. show() QDialog ... load data table on constructor from std::vector use it then close(), this will delete the QDialog window pointer so each time i open this will need constructor to read data

    2. show QDialog ... load data table from std::vector then hide() (it will load data once, but will be kept on memory)

    3. any other way?

    Thanks.

    JonBJ 1 Reply Last reply
    0
    • U U7Development

      Hi !.

      I have a QMainWindow that has a QMenu , there is a QAction that opens a QDialog window, this QDialog window has a QTableWidget, it reads from a std::vector<MyObject>, where MyObject is an object that contains QString fields that will be loaded into the table...

      What is the most orthodox way to follow:

      1. show() QDialog ... load data table on constructor from std::vector use it then close(), this will delete the QDialog window pointer so each time i open this will need constructor to read data

      2. show QDialog ... load data table from std::vector then hide() (it will load data once, but will be kept on memory)

      3. any other way?

      Thanks.

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @U7Development
      Do you want to trade speed or space? How big is the data, how often do you show/hide dialog? Your choice!

      1 Reply Last reply
      2
      • U Offline
        U Offline
        U7Development
        wrote on last edited by
        #3

        That is a good point, i'm really not sure how much data is going my client manipulate... the only think i know is speed is more important... so i guess hide() makes more sense to me right now..

        The good point is i confirmed with your answer that both ways are fine.

        Thanks.!

        1 Reply Last reply
        1

        • Login

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