Results 1 to 3 of 3

Thread: Special Dialog

  1. #1
    Join Date
    May 2006
    Posts
    57
    Thanks
    12
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question Special Dialog

    I want to make a dialog window that has 4 pushbuttons and I want that when push a button closes the window and the main window it receives something to know that button I press; How I do it?

  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: Special Dialog

    Quote Originally Posted by avis_phoenix View Post
    I want to make a dialog window that has 4 pushbuttons and I want that when push a button closes the window and the main window it receives something to know that button I press; How I do it?
    The docs say:

    void QDialog::done ( int r ) [virtual slot]
    Closes the dialog and sets its result code to r. If this dialog is shown with exec(), done() causes the local event loop to finish, and exec() to return r.
    Therefore probably the easiest way is to use QSignalMapper or QButtonGroup to transform clicked(void) into clicked(int) and connect it to that slot.

  3. #3
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Special Dialog

    QButtonGroup could be a good choice too as it has a signal called buttonClicked(int id).
    J-P Nurmi

Similar Threads

  1. Replies: 3
    Last Post: 23rd July 2006, 18:02
  2. Show/hide part of dialog with resizing.
    By Spockmeat in forum Qt Tools
    Replies: 6
    Last Post: 7th June 2006, 08:22
  3. Dialog positioning in GNOME
    By simk in forum Qt Programming
    Replies: 2
    Last Post: 16th March 2006, 09:41
  4. Shape-changing dialog with qt4.1
    By moe in forum Qt Tools
    Replies: 3
    Last Post: 2nd February 2006, 10:12
  5. Updating a QTableWidget through a Dialog
    By dragon in forum Newbie
    Replies: 3
    Last Post: 19th January 2006, 21:16

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.