PDA

View Full Version : Rounded Dialog and Titlebar



ntp
20th June 2008, 19:53
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-programming-2/t-toplevel-widget-with-rounded-corners-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:


RoundedTest(QWidget *parent = 0, Qt::WFlags flags = 0);


in RoundedTest.cpp:


RoundedTest::RoundedTest(QWidget *parent, Qt::WFlags flags)
: QDialog(parent, flags)
{
setupUi(this);
}


and created with:

RoundedTest w;
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.

marcel
20th June 2008, 21:49
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.