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. application window size control
Forum Updated to NodeBB v4.3 + New Features

application window size control

Scheduled Pinned Locked Moved Unsolved General and Desktop
resizeapplication
2 Posts 2 Posters 1.5k Views
  • 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.
  • A Offline
    A Offline
    applefier
    wrote on 2 Dec 2015, 11:25 last edited by
    #1

    How do I prevent the application window from getting resized by its layouts/widgets but allow it to be resized by the user using mouse or the maximize button?

    Thanks.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mostefa
      wrote on 2 Dec 2015, 12:27 last edited by mostefa 12 Feb 2015, 13:03
      #2

      Hello @applefier ,

      To fix the size of your layout you can use

      the setSizeConstraint ( SizeConstraint ) function

      and you have to put QLayout::SetFixedSize as arg of SizeConstraint

      Here is the doc explanation:

      sizeConstraint : SizeConstraint
      

      This property holds the resize mode of the layout.

      enum QLayout::SizeConstraint
      

      The possible values are:

      Constant	Value	Description
      QLayout::SetDefaultConstraint	0	The main widget's minimum size is set to minimumSize(), unless the widget already has a minimum size.
      QLayout::SetFixedSize	3	The main widget's size is set to sizeHint(); it cannot be resized at all.
      QLayout::SetMinimumSize	2	The main widget's minimum size is set to minimumSize(); it cannot be smaller.
      QLayout::SetMaximumSize	4	The main widget's maximum size is set to maximumSize(); it cannot be larger.
      QLayout::SetMinAndMaxSize	5	The main widget's minimum size is set to minimumSize() and its maximum size is set to maximumSize().
      QLayout::SetNoConstraint	1	The widget is not constrained.
      

      Hope this will work,

      Regards !

      1 Reply Last reply
      0

      2/2

      2 Dec 2015, 12:27

      • Login

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