Results 1 to 4 of 4

Thread: Passing Value from textbox of one form to the textbox of another form

  1. #1
    Join Date
    Apr 2013
    Posts
    5
    Thanks
    2
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Android Maemo/MeeGo

    Default Passing Value from textbox of one form to the textbox of another form

    Hello Everyone!

    I am working on a project in which I have to pass a string of one form (named as Dialog) to the string of another form (named as Browser). Please let me know whats the easiest way to do that also let me know if there is any option that a form owns another form in QT


    With Regards,

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,420
    Thanks
    37
    Thanked 1,545 Times in 1,495 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Passing Value from textbox of one form to the textbox of another form

    There are a lot of different ways.

    Every widget is a C++ object, so anyone holding pointers to a widget can call getter and setter methods.
    So one option is to call the text retrieval method on the first text box, take the returned QString object and pass it to the text setter of the second text box.

    If you need the two texts to be synchronized, you can create two signal/slot connections between them, so one always updates the other and vice versa.

    And, again since this is C++, you can always have the pointer to a form owned by any other class representing a form.

    Cheers,
    _

  3. The following user says thank you to anda_skoa for this useful post:

    rushanbashir (14th April 2013)

  4. #3
    Join Date
    Apr 2013
    Posts
    5
    Thanks
    2
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Android Maemo/MeeGo

    Default Re: Passing Value from textbox of one form to the textbox of another form

    Thank You very much for your prompt reply, Can you please suggest an example for pointers?

  5. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,420
    Thanks
    37
    Thanked 1,545 Times in 1,495 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Passing Value from textbox of one form to the textbox of another form

    Basically every Qt example out there contains access of widget properties by calling methods on object pointers

    Cheers,
    _

Similar Threads

  1. Replies: 4
    Last Post: 1st June 2012, 13:24
  2. textbox+highlighter
    By nima in forum Qt Programming
    Replies: 0
    Last Post: 27th June 2011, 15:39
  3. Displaying integer values into textbox
    By deck99 in forum Qt Programming
    Replies: 1
    Last Post: 10th March 2011, 13:07
  4. Textbox
    By Devoraz in forum Qt Programming
    Replies: 6
    Last Post: 23rd July 2009, 06:37
  5. Passing an object from one form to the other.
    By cbarmpar in forum Qt Programming
    Replies: 10
    Last Post: 3rd September 2008, 14:12

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.