Results 1 to 5 of 5

Thread: Transfer Data Between Dialogs

  1. #1
    Join Date
    Jul 2009
    Posts
    49
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Transfer Data Between Dialogs

    Hai

    I have some doubts on data sharing between UI Dialogs or Classes.

    I want to get the value of textedit in another window.like that.

    suggestion please


    suree
    Bangalore

  2. #2
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Transfer Data Between Dialogs

    take a look at the dialogs example which comes with qt

  3. #3
    Join Date
    Aug 2008
    Posts
    134
    Thanks
    10
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Transfer Data Between Dialogs

    Create the instance of the class wherever you want to get the value of that class and write public function to get the value of controls.

    Ex: if classA contains the textedit and you want to access the value in classB use the instance of classA in class B and expose a method in classA to get the value of textedit and use it in classB by calling it.

  4. #4
    Join Date
    Jul 2009
    Posts
    49
    Thanks
    1
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Smile Re: Transfer Data Between Dialogs

    Store the lineedit value in a variable and call it in the other form using extern below is the code snippet


    int input1;
    input = lineEdit->text().toInt();

    In the next window.cpp use

    extern int input1;
    ineEdit->setText(QString::number(input1,10 ) );

    Hope this helps

  5. #5
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Transfer Data Between Dialogs

    This question was asked before. Several times. Please use the search engine of the forum.
    Solutions: A signal/slot connection or a pointer to the other dialog.

Similar Threads

  1. Replies: 28
    Last Post: 7th May 2010, 12:29
  2. data rate transfer is decreasing in TCP connection
    By navi1084 in forum Qt Programming
    Replies: 3
    Last Post: 19th June 2009, 16:15
  3. QDialog and QMainWindow Data Transfer
    By Ahmad in forum Qt Programming
    Replies: 12
    Last Post: 6th May 2007, 07:02
  4. Replies: 1
    Last Post: 9th March 2007, 21:07

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.