Results 1 to 2 of 2

Thread: Using One's widget variables on other Widget

  1. #1
    Join Date
    Jul 2013
    Posts
    16
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Using One's widget variables on other Widget

    I made two widgets using QT Designer which have their own header and source files like this,
    Widget-1:
    Qt Code:
    1. form1.ui
    2. ui_form1.h
    3. form1.h
    4. moc_form1.cpp
    5. form1.cpp
    6. main.cpp
    To copy to clipboard, switch view to plain text mode 

    Widget-2:
    Qt Code:
    1. form2.ui
    2. ui_form2.h
    3. form2.h
    4. moc_form2.cpp
    5. form2.cpp
    6. main.cpp
    To copy to clipboard, switch view to plain text mode 

    Form1 has QlineEdit and QCheckBox, and user will put the input on the Widget1 and after putting the input. User will press the pushButton and Widget2 will start executing. On Widget2, i want to use the values and conditions of the first widget's LineEdit and ChechBox. Can anyone tell me how i can do this. It will be of great help. Thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Using One's widget variables on other Widget

    Make one form emit signals when corresponding values of its items change and connect those signals to slots in the other widget where you will react on those changes.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 8
    Last Post: 2nd February 2012, 20:52
  2. Replies: 2
    Last Post: 23rd January 2012, 18:06
  3. Replies: 0
    Last Post: 3rd August 2011, 13:07
  4. Replies: 1
    Last Post: 24th June 2011, 00:09
  5. Replies: 1
    Last Post: 11th March 2011, 20:34

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.