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. How to set QMainWindow to fixed size?
Forum Updated to NodeBB v4.3 + New Features

How to set QMainWindow to fixed size?

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 485 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.
  • L Offline
    L Offline
    loudking
    wrote on last edited by
    #1

    Hello all,

    I would like my main window to have two properties:

    1. Dynamically change its size according to system default font and size, i.e. it should not have same size on Windows and Linux.

    2. Do not change size during execution as label content may change.

    I tried to use:

    setFixedSize() - fits requirement 2 but not 1.

    layout()->setSizeConstraint(QLayout::SetFixedSize); - fits requirement 1 but not 2.

    Could you please give me some advice?

    Thanks in advance.

    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