Results 1 to 6 of 6

Thread: QMenuBar's CornerWidget hides on maximizing QMdiSubWindow

  1. #1
    Join Date
    Mar 2009
    Location
    delhi India
    Posts
    56
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default QMenuBar's CornerWidget hides on maximizing QMdiSubWindow

    Hi,
    I have QMainwindow with QMenubar to which I have added the QcomboBox as cornerwidget.

    pMenuBar->setCornerWidget(pComboBox);

    I have QMdiArea whose parent is QMainwindow and I have set this QMdiArea to its central widget.

    mdi=new QMdiArea(this);
    setCentralWidget( mdi );

    Then I created QMdiSubWindow window.
    QMdiSubWindow *midsubWindow= mdi->addSubWindow(Qwidget);

    The application looks fine when the QMdiSubWindow is not Maximized (see Image.png)

    But the moment I Maximize the QMdiSubWindow it Hides the Combobox that I have set on QMenubar as Corner widget(see maximize.png ).

    I tried everything in my application but it looks like QT does not allow this.

    Attached are the two images which shows the scenario.

    Any help would be appreciated.

    Thanks.
    Attached Images Attached Images

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,716
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QMenuBar's CornerWidget hides on maximizing QMdiSubWindow

    One option would be to move the combobox to the left of the system buttons when you maximize.

    P.S
    Don't urge people to look at your posts per PM.
    Its against the rules and is just plain rude.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QMenuBar's CornerWidget hides on maximizing QMdiSubWindow

    please report a bug to nokia as well... may be they will give some attention to desktop then

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,716
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QMenuBar's CornerWidget hides on maximizing QMdiSubWindow

    You could also try using QMenuBar::setCornerWidget().
    This will place your combobox not at the far right, but after the last menu item.
    Another thing I would try would be to create a cusotom widget which would have the combobox and a spacer and set a horizontal layout as the main layout for that widget, and set that custom widget with setCornerWidget().
    |-----|<combobox>
    This way the the combobox will always be at the right most position on the menubar, but it should move to the left of the system buttons once they apear, and take their place when they disappear.

    please report a bug to nokia as well
    Why do you think its a bug?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  5. #5
    Join Date
    Mar 2009
    Location
    delhi India
    Posts
    56
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: QMenuBar's CornerWidget hides on maximizing QMdiSubWindow

    At first instance only i used setcornerWidget.

    I guess it hides on maximize coz datz how its wriiten in qMdiSubWindow.cpp .(I checked it )

    So i called the slot on OnMAximize() signal of QMDISUBWINDOW and shown my comboBox manually.

    It worked but still QMdisubwindows title bar buttons overlapped with the combobox.

    So i overrided the paintevent() and there i subtracted the QMainwindow width -QMdSubWwindowWidth-comboboxwith to get the xPos of combox so that it wont overlapp .

    It works fine now.

    So possibly its a bug.

    Possibly Its a Bug.


    Added after 27 minutes:


    Possibly a Bug.
    Last edited by vaibhav; 4th May 2011 at 15:29.

  6. #6
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QMenuBar's CornerWidget hides on maximizing QMdiSubWindow

    Quote Originally Posted by high_flyer View Post
    Why do you think its a bug?
    lets say its an undocumented feature

Similar Threads

  1. new dialog hides behind... help me please
    By cooper in forum Qt Programming
    Replies: 8
    Last Post: 14th June 2009, 22:55
  2. Update to 4.4.2: cornerWidget functionality changed
    By mclark in forum Qt Programming
    Replies: 5
    Last Post: 21st November 2008, 02:14
  3. Maximizing QWidget to front of desktop
    By JimDaniel in forum Qt Programming
    Replies: 2
    Last Post: 10th November 2007, 17:08
  4. Maximizing a widget
    By Max Yaffe in forum Qt Tools
    Replies: 3
    Last Post: 11th July 2007, 07:05
  5. maximizing own widget on parent
    By masoroso in forum Newbie
    Replies: 8
    Last Post: 21st April 2006, 18:12

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.