Results 1 to 3 of 3

Thread: Button Return

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2011
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Button Return

    How can i return any value when i will click to button. It is possible to use QObject::connect(&get, SIGNAL(clicked()), &give, SLOT(return value)?


    Qt Code:
    1. int main(int argc, char *argv[]) {
    2. int a = 10;
    3.  
    4. QApplication app(int argc, char *argv[]);
    5.  
    6. QWidget wid1;
    7. wid1.resize(100, 100);
    8.  
    9. QWidget wid2;
    10. wid2.resize(100,100);
    11.  
    12. QPushButton but1("Text", &wid1);
    13. but1.geometry(0,0,100,100);
    14. QObject::connect(&but1, SIGNAL(clicked()), &wid1, SLOT(>>return value<<));
    15.  
    16. QPushButton but2("Text", &wid2);
    17. but2.geometry(0.0.100.100);
    18. QObject::connect(&but2, SIGNAL(clicked()), &wid1, SLOT(>>return value<<));
    19. }
    To copy to clipboard, switch view to plain text mode 

    (ignore the code errors... i want only know, if i can použÃ*t QObject::connect(&but2, SIGNAL(clicked()), &wid1, SLOT(return a = 50);
    Last edited by lorin; 8th January 2011 at 19:15.

Similar Threads

  1. Changing text of button in no relation to button
    By Sabre Runner in forum Newbie
    Replies: 22
    Last Post: 23rd September 2010, 12:29
  2. QSqlQuery don't return
    By ShadowBelmolve in forum Newbie
    Replies: 2
    Last Post: 9th September 2010, 20:28
  3. Replies: 6
    Last Post: 21st August 2010, 21:09
  4. Replies: 1
    Last Post: 2nd August 2010, 05:40
  5. Custom widget: a button within a button
    By Gnurou in forum Qt Programming
    Replies: 7
    Last Post: 18th June 2009, 09:03

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.