Results 1 to 3 of 3

Thread: accepted() alternative

  1. #1
    Join Date
    Dec 2010
    Posts
    23
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Windows

    Default accepted() alternative

    I am looking for another way to pass on an accepted() type slot variable in addition to an already existing accepted() slot.

    I have a dialog box with two buttons, one of them has a slot calling the accepted() call so another source file can see if that button has been pushed, but I don't know how to do it with the other button. I want the main source file to know which button I pushed (but the buttons have unique values, so I can't use a Save or Delete or anything like that).

    Thank you in advance

  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: accepted() alternative

    Have your dialog contain a getter which will return the state of the dialog (i.e. the button id that was clicked).
    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.


  3. #3
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: accepted() alternative

    Wouldn't a QDialogButtonBox work in this case? The clicked() signal tells you which button was pressed.

Similar Threads

  1. Alternative to sscanf ??
    By Windsoarer in forum Qt Programming
    Replies: 7
    Last Post: 26th June 2009, 08:41
  2. alternative to qtextedit
    By Rooster in forum Newbie
    Replies: 4
    Last Post: 7th August 2008, 02:36
  3. Why Yahoo & Gmail e-mail accounts are not accepted???
    By pat in forum Introduction to Qt
    Replies: 7
    Last Post: 20th May 2008, 17:16
  4. alternative to QMessageBox
    By incapacitant in forum Newbie
    Replies: 20
    Last Post: 24th May 2006, 14:49
  5. alternative to COM??
    By TheKedge in forum Qt Programming
    Replies: 2
    Last Post: 20th January 2006, 15:02

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.