Results 1 to 4 of 4

Thread: SetWFlags

  1. #1
    Join Date
    Mar 2006
    Posts
    7
    Thanks
    1
    Qt products
    Qt3
    Platforms
    MacOS X Unix/X11 Windows

    Default SetWFlags

    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
    Qt Code:
    1. //-----------------------------------------------------------------------------
    2. vgui_qt_window::vgui_qt_window(int w, int h, const char* title)
    3. : QMainWindow(0, "vgui_qt_mainwindow_without_menu",
    4. Qt::WStyle_Customize | Qt::WDestructiveClose |
    5. Qt::WStyle_NormalBorder | Qt::WStyle_SysMenu |
    6. Qt::WStyle_MinMax),
    7. statusbar (this),
    8. use_menubar(false),
    9. use_statusbar(true)
    10. {
    11. setup_widget(w, h, title);
    12. }
    To copy to clipboard, switch view to plain text mode 

    This is my constructor

    Qt Code:
    1. Tgui_qt_window::Tgui_qt_window(int w, int h, const char* title, bool alwaysOnTop)
    2. : vgui_qt_window(w,h,title)
    3. {
    4. this->setWFlags(Qt::WStyle_Customize | Qt::WDestructiveClose |
    5. Qt::WStyle_NormalBorder | Qt::WStyle_SysMenu |
    6. Qt::WStyle_MinMax | QT::WStyle_StaysOnTop);
    7. }
    To copy to clipboard, switch view to plain text mode 

  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: SetWFlags

    For some flags to work if set after constructing an object, you have to reparent() the widget.

  3. #3
    Join Date
    Mar 2006
    Posts
    7
    Thanks
    1
    Qt products
    Qt3
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: SetWFlags

    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

  4. #4
    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: SetWFlags

    Quote Originally Posted by xplizion
    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

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.