Results 1 to 4 of 4

Thread: Initialising a dialog with the MainWindow pointer

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2009
    Location
    Laval, France
    Posts
    124
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    1
    Thanked 2 Times in 2 Posts

    Default Re: Initialising a dialog with the MainWindow pointer

    Thankyou d_strantz for replying with a clear answer.
    I worked for a company that had a design style where there was a "central" object that owned all the shared services like the database connection, and objects would ask this one directly for the services.
    I'll consider the idea that dialogs etc do not know where information is stored, they just emit signals saying "i need this kind of information" and the connections created (for example in the MainWindow) decide who shall supply what information.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,332
    Qt products
    Qt5
    Platforms
    Windows
    Thanks
    317
    Thanked 871 Times in 858 Posts

    Default Re: Initialising a dialog with the MainWindow pointer

    I'll consider the idea that dialogs etc do not know where information is stored, they just emit signals saying "i need this kind of information" and the connections created (for example in the MainWindow) decide who shall supply what information.
    That would be an excellent choice. Even if there is a "Master of the Universe", using signals and slots can hide all of that. You might also think about the idea that the MainWindow might not be the master either - it could create a master object, and connect the dialog signals and slots to that object instead of handling them itself. That will help give you a system where all of the business logic is as separate as possible from the GUI logic so that changes in the GUI will not force you into a redesign of the business logic.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. about dialog and mainwindow (ui,,ui)
    By Newbit in forum Newbie
    Replies: 0
    Last Post: 28th October 2014, 08:41
  2. Using Variables From Dialog In MainWindow
    By steadi in forum Newbie
    Replies: 2
    Last Post: 7th October 2012, 23:18
  3. How to call a dialog from a mainwindow
    By luiz4um in forum Qt Programming
    Replies: 26
    Last Post: 29th June 2010, 10:41
  4. Pointer to MainWindow
    By ThomasBrown in forum Qt Programming
    Replies: 1
    Last Post: 26th March 2010, 04:49
  5. Communication between MainWindow and a dialog
    By Backslash in forum Newbie
    Replies: 9
    Last Post: 3rd August 2007, 04:27

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
  •  
Qt is a trademark of The Qt Company.