Results 1 to 2 of 2

Thread: height()

  1. #1
    Join Date
    Jan 2006
    Posts
    976
    Thanks
    53
    Qt products
    Qt3
    Platforms
    Windows

    Default height()

    Hi,
    Qt Code:
    1. QPushButton* b = new QPushButton(myFrame);
    2. b->setGeometry(20,90, 100,40);
    3. myFrame->setGeometry(0,0,200, height() );
    To copy to clipboard, switch view to plain text mode 
    I'd like height of myFrame is equal to height() if it return a value that can contain button b;
    Otherwise I'd like add a value to height to make b buton visible. How do it? Exist a function that return the value minimun_height_to_contain_the_object_inserted? Or Do I implement it?
    (the height() value change in relation to height of my application window and this I want! but the button b is not visible)
    Regards

  2. #2
    Join Date
    Jan 2006
    Posts
    70
    Thanks
    13
    Thanked 5 Times in 5 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: height()

    I think this is what you are asking for.


    Qt Code:
    1. QPushButton* b = new QPushButton(myFrame);
    2. b->setGeometry(20,90, 100,40);
    3.  
    4. int minHeight = (b->height() > height()) ? b->height() : height();
    5.  
    6. myFrame->setGeometry(0,0,200, minHeight );
    To copy to clipboard, switch view to plain text mode 
    Last edited by bitChanger; 22nd March 2006 at 20:34.

Similar Threads

  1. Same height for QComboBox and QPushButton
    By cevou in forum Qt Programming
    Replies: 5
    Last Post: 12th May 2012, 07:56
  2. QLayout: different SizeConstraints for width and height?
    By PhilippB in forum Qt Programming
    Replies: 0
    Last Post: 23rd February 2009, 16:33
  3. row height in QTreeView and QTableView
    By yuriry in forum Qt Programming
    Replies: 2
    Last Post: 9th October 2008, 00:58
  4. How can I get the Systray height ?
    By Nyphel in forum Qt Programming
    Replies: 3
    Last Post: 12th March 2007, 09:04
  5. QTextEdit height using Qt3.3.5
    By vermarajeev in forum Qt Programming
    Replies: 3
    Last Post: 15th December 2006, 08:43

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.