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,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    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,348
    Qt products
    Qt5
    Platforms
    Windows
    Thanks
    318
    Thanked 872 Times in 859 Posts

    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, 09:41
  2. alternative to qtextedit
    By Rooster in forum Newbie
    Replies: 4
    Last Post: 7th August 2008, 03:36
  3. alternative to QMessageBox
    By incapacitant in forum Newbie
    Replies: 20
    Last Post: 24th May 2006, 15:49
  4. alternative to COM??
    By TheKedge in forum Qt Programming
    Replies: 2
    Last Post: 20th January 2006, 16: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
  •  
Qt is a trademark of The Qt Company.