Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. SetMinimumHeight() problem - widget is minimizing
Forum Updated to NodeBB v4.3 + New Features

SetMinimumHeight() problem - widget is minimizing

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    never_ever
    wrote on last edited by
    #1

    Hi,
    I have problem with setMinimumHeight function.

    When I create new widget I set size policy to expanding (horizontal and vertical). I have function where I set custom size of widget by setting minimum and maximum height of widget to the same size and then minimum and maximum sizes are restored to default values.

    @
    void MyWidget::setActive(bool isActive)
    {
    ...
    //first part
    setMaximumHeight(customHeight);
    setMinimumHeight(customHeight);

    QApplication::processEvents();
    //second part
    setMaximumHeight(2000);
    setMinimumHeight(1);
    QApplication::processEvents();
    

    }
    @

    In first part I want to resize widget (it is my widget - inheriting QDockWidget - so I can't do this by using function resize).
    I do it by setting minimum and maximum height to the same value.
    In second part I restore default minimum and maximum values, because I want to have possibility to resize that widget manually.
    But setting minimum height to minimum (for some reasons I should set it to 1 not to 0) causes that my widget is resizing to that height and I don't know why.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved