Results 1 to 6 of 6

Thread: QDialog - customize the buttons

  1. #1
    Join Date
    Dec 2007
    Posts
    33
    Thanks
    7
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default QDialog - customize the buttons

    Hello

    i have implemented my About this app window using Qdialog
    so basically i get a small popup which displays some informations about my app.

    Code example:
    Qt Code:
    1. QDialog about(this);
    2. about.setModal(true);
    3. about.setWindowTitle(tr("About my app"));
    4. about.setLayout(mainLayout);
    To copy to clipboard, switch view to plain text mode 

    Using this code i get a small window with 2 window-control buttons in the head:
    1 x X to close the window
    1 x ? which can be used for helpdialogs.

    Can i get rid of this question-mark button in the qdialog window ?
    Best regards 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: QDialog - customize the buttons

    Have you seen QMessageBox::about()?

  3. #3
    Join Date
    Dec 2007
    Posts
    33
    Thanks
    7
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: QDialog - customize the buttons

    Hi,

    yeah while checking some other examples from my QT installation i noticed this possible solution.

    unfortunaly it seems to not support links and/or html which i was using inside my text.
    So i switched back to QDialog.

    But thanks for the offered help.

  4. #4
    Join Date
    Mar 2007
    Location
    Ukraine, Odessa
    Posts
    140
    Thanks
    15
    Thanked 11 Times in 10 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: QDialog - customize the buttons

    Take a look at window flags and QWidget::setWindowFlags(Qt::WindowFlags type)
    Last edited by THRESHE; 11th March 2008 at 13:26.
    C++ & AMD forever

  5. #5
    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: QDialog - customize the buttons

    Quote Originally Posted by ape View Post
    unfortunaly it seems to not support links and/or html which i was using inside my text.
    Works fine for me...

    Qt Code:
    1. #include <QApplication>
    2. #include <QMessageBox>
    3.  
    4. int main(int argc, char **argv){
    5. QApplication app(argc, argv);
    6. QMessageBox::about(0, "title", "<html><body><a href='href'>link</a></body></html>");
    7. return 0;
    8. }
    To copy to clipboard, switch view to plain text mode 

  6. The following user says thank you to wysota for this useful post:

    ape (12th March 2008)

  7. #6
    Join Date
    Dec 2007
    Posts
    33
    Thanks
    7
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: QDialog - customize the buttons

    You are right.

    Dont know what i have done wrong last time i have tried your idea.
    Thanks again for your help.

Similar Threads

  1. QDialog margin and spacing
    By TheRonin in forum Qt Programming
    Replies: 4
    Last Post: 29th October 2007, 10:11
  2. How to add Buttons in QDialog ?
    By npc in forum Newbie
    Replies: 2
    Last Post: 25th April 2007, 17:35
  3. Resizing a QDialog to the content size
    By Nyphel in forum Qt Programming
    Replies: 8
    Last Post: 15th March 2007, 08: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.