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. Resizing QFrame and a paradox
Qt 6.11 is out! See what's new in the release blog

Resizing QFrame and a paradox

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.4k 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.
  • M Offline
    M Offline
    m_pahlevanzadeh
    wrote on last edited by
    #1

    Dear all,

    I want to user can't maximum and minimum with mouse, my QFrame, and my scenrario:
    I have a QTableWidget in my QFrame , i disbable QTableWidget via "setVisible(False)" i want to when user checked an checkbox, my QFrame resize and bigger and show my QTableWidget with "setVisible(True)" , I didn't any problem with visibility, but i have problem with the following paradox:

    How i combine resizing QFrame, and disable my Qframe for mouse and keyboard?

    --mohsen

    1 Reply Last reply
    0
    • raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      since it works as expected when the widget is visible i assume you use layouts. Which control then the minimum size.
      You have the following possibilities:

      set the minimum size of the QFrame to the minimum sizehint of the QTableWidget

      or use the following code to add the widget to your layout:
      @
      class MyWidgetLayoutItem : public QWidgetItem
      {
      public:
      MyWidgetLayoutItem( QWidget * widget )
      : QWidgetItem(widget)
      {
      }

      virtual bool isEmpty () const
      {
          return false; //ensure this layoutitem is still taken into account even when the widget is hidden
      }
      

      };
      @

      and add it to the layout like this:
      @
      layout->addItem( new MyWidgetLayoutItem(tableWidget) );
      @

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      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