Results 1 to 4 of 4

Thread: Customizing Mainwindow's title bar

  1. #1
    Join Date
    Jan 2006
    Posts
    4
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Customizing Mainwindow's title bar

    Hi all,
    I am developing an MDI application with several child widgets, the central widget being a QWorkspace. As per the requirement, the user should not be allowed to either maximize or minimize the Mainwindow. Hence, in the title bar of the main window, only close option (x) should be given.......can anybody help me how to use the qt widget flags to achieve the same......

    Thanks for any help in advance ,
    Anitha

  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: Customizing Mainwindow's title bar

    You have to set appropriate flags in the constructor (third argument) of the child window. You'll need WStyle_Customize, WStyle_SysMenu (when using Windows), and WStyle_MinMax and probably one of main types like WStyle_TopLevel to have a start. If you negate the WStyle_MinMax flag, you should disable those buttons you don't want.

  3. #3
    Join Date
    Jan 2006
    Posts
    4
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: Customizing Mainwindow's title bar

    When the application starts, a login window appears(which is a QDialog) and on successful login, Mainwindow is shown maximized.

    Here is what i am trying to do:

    MainWindow *mw;
    mw = new MainWindow(login, "MainWindow", ((Qt::WType_TopLevel) & (Qt::WStyle_Customize |~Qt::WStyle_SysMenu)));
    But, this displays the mainwindow similar to a dialog and is not maximized. It will have only an option to close the window. What i want is after logging in, a mainwindow should be shown(maximized) with only a close option.
    Is it correct what i am doing?????

    Thank u very much for the fast reply

  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: Customizing Mainwindow's title bar

    If I understand correctly, the problem is that the window is not maximized? You can try to maximize it by setting its size to the size of your desktop (accessible through QDesktopWidget).

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.