Results 1 to 7 of 7

Thread: how to get geometry of QMainWindow without menubar and toolbars?

  1. #1
    Join Date
    May 2008
    Location
    Ukraine, Berdyansk
    Posts
    14
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default how to get geometry of QMainWindow without menubar and toolbars?

    How to get rect of central rect plus dockwidets?
    I mean i want to know size of mainwidget without toolbars and menubar.

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: how to get geometry of QMainWindow without menubar and toolbars?

    Qt Code:
    1. QRect size = centralWidget()->geometry();
    To copy to clipboard, switch view to plain text mode 
    ?

  3. #3
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: how to get geometry of QMainWindow without menubar and toolbars?

    Just curious, what do you want this information for?
    J-P Nurmi

  4. #4
    Join Date
    May 2008
    Location
    Ukraine, Berdyansk
    Posts
    14
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to get geometry of QMainWindow without menubar and toolbars?

    Quote Originally Posted by spirit View Post
    Qt Code:
    1. QRect size = centralWidget()->geometry();
    To copy to clipboard, switch view to plain text mode 
    ?
    and what if QDockWidget is docked?



    i what to know geometry of light blue area.

  5. #5
    Join Date
    May 2008
    Location
    Ukraine, Berdyansk
    Posts
    14
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to get geometry of QMainWindow without menubar and toolbars?

    Quote Originally Posted by jpn View Post
    Just curious, what do you want this information for?
    to place widget that cover central widget and dock widgets.

  6. #6
    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: how to get geometry of QMainWindow without menubar and toolbars?

    Quote Originally Posted by EnErGy[CSDX] View Post
    to place widget that cover central widget and dock widgets.
    Ok, but why?

    Nevertheless it might be easier to calculate the area by substracting the part taken by the menu, toolbars and statusbar from the whole widget.

  7. #7
    Join Date
    May 2008
    Location
    Ukraine, Berdyansk
    Posts
    14
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to get geometry of QMainWindow without menubar and toolbars?

    Quote Originally Posted by wysota View Post
    Ok, but why?

    Nevertheless it might be easier to calculate the area by substracting the part taken by the menu, toolbars and statusbar from the whole widget.
    this is not easy solution, but looks like it is only one posible.

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.