PDA

View Full Version : SetWFlags



xplizion
2nd March 2006, 15:10
I'll post this in newbie section myself ;)

I inherit from a class that inherits from QMainWindow
this class calls upon the constructor of QMainWindow, now there is 1 thing I need to change to the flags of the mainwindow so I call the constructor of my upperclass
and afterwards I set the flags with setWFlags but it doesn't seem to do anything


This is the super class constructor which I call


//-----------------------------------------------------------------------------
vgui_qt_window::vgui_qt_window(int w, int h, const char* title)
: QMainWindow(0, "vgui_qt_mainwindow_without_menu",
Qt::WStyle_Customize | Qt::WDestructiveClose |
Qt::WStyle_NormalBorder | Qt::WStyle_SysMenu |
Qt::WStyle_MinMax),
statusbar (this),
use_menubar(false),
use_statusbar(true)
{
setup_widget(w, h, title);
}


This is my constructor



Tgui_qt_window::Tgui_qt_window(int w, int h, const char* title, bool alwaysOnTop)
: vgui_qt_window(w,h,title)
{
this->setWFlags(Qt::WStyle_Customize | Qt::WDestructiveClose |
Qt::WStyle_NormalBorder | Qt::WStyle_SysMenu |
Qt::WStyle_MinMax | QT::WStyle_StaysOnTop);
}

wysota
2nd March 2006, 15:20
For some flags to work if set after constructing an object, you have to reparent() the widget.

xplizion
2nd March 2006, 15:41
thx that solved it :)

is there a list on qt doc which flags that require this? can't seem to find it if there is...

grtz and thx again ;)

xplizion

wysota
2nd March 2006, 15:55
is there a list on qt doc which flags that require this?
No, I don't think so. It's a question of experience and searching through the net ;)