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. Is possible to set a minimum width to a widget became visible using CSS or editing her properties in Qt Designer?
Forum Updated to NodeBB v4.3 + New Features

Is possible to set a minimum width to a widget became visible using CSS or editing her properties in Qt Designer?

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 452 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.
  • K Offline
    K Offline
    Karine
    wrote on 4 Nov 2022, 16:02 last edited by
    #1

    In this example the Pink QWidget has her Horizontal and Vertical policy set to Ignored so it can be completely 'resized' to the minimum size, which is 0.

    How I can set a 'minimum visible width' to the PushButton became visible?

    I created this gif to illustrate what I'm talking about:

    enter image description here

    As seen in the gif the PushButton became visible as soon as her parent becomes visible (default behavior), I would like to make it visible only when there's a specific amount of space in the parent.

    I wonder if this could be achieved with any kind of CSS similar to:

         min-width: 0;
         max-width: 200;
         /* min-visible-width: 100; */ <- example
    
    

    or by editing the button/parent properties in the Qt Designer, instead of subclassing the button and setting it hidden/unhidden according to her size.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 4 Nov 2022, 19:41 last edited by
      #2

      Hi,

      AFAIK, no.

      You should re-implement your purple widget to handle the button as an invisible widget will not resize even if its containing widget does.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0

      1/2

      4 Nov 2022, 16:02

      • Login

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