Results 1 to 3 of 3

Thread: Improper size issue in QWidget::sizeHint()

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2008
    Posts
    25
    Thanks
    9
    Thanked 1 Time in 1 Post

    Unhappy Improper size issue in QWidget::sizeHint()

    I am using QT 4.5.0.
    I am using a QWidget with 10 checkboxes. 5 of these checkboxes need to be show/hide dynamically depending on certain conditions.
    When i hide those 5 check boxes the QWidget is not getting self adjusted.

    I checked the sizeHint(), which is not getting self adjusted.

    In my case the widget is adjusting the visible 5 checkbox into the area which is used for showing the 10 checkboxs.

    What all may be the possible reasons which prevent the proper resizing of the QWidget ?

    Here is a sample code which i tried within a button click SLOT.

    QSize prefSize = QDialog::sizeHint();
    wholeWordsCheckBox->setVisible(false);
    backwardCheckBox->setVisible(false);
    searchSelectionCheckBox->setVisible(false);
    prefSize = QDialog::sizeHint();

    here the sizeHint() is working when the checkboxes are set as visible, but NOT working when the checkboxes are set as hidden.
    Last edited by George Neil; 22nd September 2009 at 09:56.

Similar Threads

  1. QLabel size policy
    By Caius Aérobus in forum Qt Programming
    Replies: 3
    Last Post: 7th December 2007, 17:57
  2. The issue on Form's size
    By adorp in forum Qt Programming
    Replies: 2
    Last Post: 23rd July 2007, 18:30
  3. Qt 4.1.1 linker warnings
    By Matt Smith in forum Installation and Deployment
    Replies: 0
    Last Post: 26th February 2006, 22:14

Tags for this Thread

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.