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. Fixing widget geometry
Forum Updated to NodeBB v4.3 + New Features

Fixing widget geometry

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

    I'm pretty new to QT and creating an app that requires one of its widgets to have identical height and width (i.e. square), no matter what the size / geometry of the containing view might be. Ideally the main window will have only two available size states - a "small" state that's some fraction of the screen size (and the same aspect ratio), and fullscreen.

    Can anyone point me at some example code or offer advice on the best way to realize this?

    Thanks in advance,

    Tony

    Dona nobis pacem

    1 Reply Last reply
    0
    • D Offline
      D Offline
      DerManu
      wrote on last edited by
      #2

      Set its sizePolicy to fixed and then use setSize.

      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