Results 1 to 4 of 4

Thread: this->frameGeometry().height is equal to this->size() ????

  1. #1
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default this->frameGeometry().height is equal to this->size() ????

    I'd want to know the 'client' area for my main window, but I can't,
    I Have the same value for both this->frameGeometry().height and this->size() ?
    I'm using XP + QT4.7.2 + mingw
    Any idea ?

  2. #2
    Join Date
    Jan 2006
    Location
    Napoli, Italy
    Posts
    621
    Thanks
    5
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: this->frameGeometry().height is equal to this->size() ????

    See here for more information about window geometry.

    This code

    Qt Code:
    1. void MyMainWindow::on_actionAction_1_triggered()
    2. {
    3. QString text;
    4.  
    5. text.append (tr ("Frame Geometry (%1 x %2)\n")
    6. .arg(frameGeometry ().width ()).arg (frameGeometry ().height ()));
    7. text.append (tr ("Client Geometry (%1 x %2)\n")
    8. .arg(width ()).arg (height ()));
    9. text.append (tr ("CentralWidget Geometry (%1 x %2)\n")
    10. .arg(centralWidget ()->width ()).arg (centralWidget ()->height ()));
    11.  
    12.  
    13. QMessageBox::information (this, tr ("Information"), text);
    14. }
    To copy to clipboard, switch view to plain text mode 

    shows this result

    window_geometry.png
    A camel can go 14 days without drink,
    I can't!!!

  3. #3
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: this->frameGeometry().height is equal to this->size() ????

    I suspect than Mywindow has to be visible to I can know the framegeometry values ?

  4. #4
    Join Date
    Jan 2006
    Location
    Napoli, Italy
    Posts
    621
    Thanks
    5
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: this->frameGeometry().height is equal to this->size() ????

    of course.

    Qt uses Window System information to know frameGeometry()
    A camel can go 14 days without drink,
    I can't!!!

Similar Threads

  1. How to get frameGeometry without showing the window
    By mortoray in forum Qt Programming
    Replies: 0
    Last Post: 4th December 2010, 16:22
  2. Replies: 0
    Last Post: 26th October 2010, 18:59
  3. Font Height and width based on font size
    By Ghufran in forum Qt Programming
    Replies: 1
    Last Post: 31st July 2010, 09:02
  4. Replies: 2
    Last Post: 23rd March 2009, 18:26
  5. Replies: 1
    Last Post: 24th October 2006, 17:40

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.