Results 1 to 2 of 2

Thread: Rounded Dialog and Titlebar

  1. #1
    Join Date
    Jul 2007
    Location
    California, USA
    Posts
    62
    Thanks
    17
    Thanked 7 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question Rounded Dialog and Titlebar

    I think I am asking for too much but I would like to have a rounded dialog that keeps its titlebar. I saw the great code in

    http://www.qtcentre.org/forum/f-qt-p...ners-3205.html

    which gives me a nice rounded dialog but I see that I lose the titlebar. I create it very simply:

    in RoundedTest.h:
    Qt Code:
    1. RoundedTest(QWidget *parent = 0, Qt::WFlags flags = 0);
    To copy to clipboard, switch view to plain text mode 

    in RoundedTest.cpp:
    Qt Code:
    1. RoundedTest::RoundedTest(QWidget *parent, Qt::WFlags flags)
    2. : QDialog(parent, flags)
    3. {
    4. setupUi(this);
    5. }
    To copy to clipboard, switch view to plain text mode 

    and created with:
    Qt Code:
    1. RoundedTest w;
    To copy to clipboard, switch view to plain text mode 
    I tried forcing the title bar by passing in Qt::Window or Qt:: Dialog as the flag but that didn't make a difference. I think that I am going to need to make my own close/minimize button and also interpret mouse events to do the move but if I can the dialog do it for me, that would be better.

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Rounded Dialog and Titlebar

    Theoretically, you could do it on Windows, if you draw the window frame yourself, but that's some work and requires non portable code. To see an example, search in the Qt Software section for argb windows, or something like that.

    The easiest solution is to draw manually some sort of title bar.

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.