Results 1 to 2 of 2

Thread: Transferring data from sub-dialog to maindialog

  1. #1
    Join Date
    Jun 2007
    Location
    India
    Posts
    33
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Transferring data from sub-dialog to maindialog

    Hello all

    I have a dialog which from which i have created few sub-dialogs. These dialogs are activated when i click the corresponding button from maindialog. All sub-dialogs have some input fields and an 'OK' button. When I press OK button, I want the data entered in the input fields to be displayed in the main dialog. I am not sure about the procedure for transferring the data back to maindialog. Could anyone tell me how to do that?

    Also, if the user is not entering any data and simply clicking OK, some default values must be displayed in main-dialog.

    The main thing is not to display the input data, but to use it for some other purpose [which even i am not much clear about ]

    any examples? any help will be really appreciated. Please let me know if anymore clarification is required from my side.

    I use Qt 4.2.2 from WinXP with MinGW.

    Thanks

  2. #2
    Join Date
    Mar 2006
    Location
    The Netherlands
    Posts
    300
    Thanks
    9
    Thanked 29 Times in 29 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Transferring data from sub-dialog to maindialog

    There are a couple of ways. But the easiest way I can think of is this:

    * In your custom dialog, define a few public functions for retrieving the data.
    * Use the return value of exec() to see if the user clicked Cancel or OK.
    * Don't destroy the dialog object yet (make sure it doesn't have the Qt::WA_DeleteOnClose attribute activated). Use its public functions to get the data.
    "The strength of a civilization is not measured by its ability to wage wars, but rather by its ability to prevent them." - Gene Roddenberry

Similar Threads

  1. Replies: 2
    Last Post: 23rd May 2007, 03:51
  2. Replies: 3
    Last Post: 17th May 2007, 13:50
  3. Transferring data input from a Widget to a cpp file
    By Ahmad in forum Qt Programming
    Replies: 1
    Last Post: 10th March 2007, 09:59
  4. speed of setdata - lots of items in treeview
    By Big Duck in forum Qt Programming
    Replies: 4
    Last Post: 6th July 2006, 12:53

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.