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. Stop a QDialog getting above a certain height, or make it resizeable by dragging the top, or make it accept being moved off the top of the screen
Forum Updated to NodeBB v4.3 + New Features

Stop a QDialog getting above a certain height, or make it resizeable by dragging the top, or make it accept being moved off the top of the screen

Scheduled Pinned Locked Moved General and Desktop
qdialogsize
2 Posts 2 Posters 1.9k Views 2 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
    Moschops
    wrote on last edited by Moschops
    #1

    I'm trying to stop a QDialog being too tall.

    I set its vertical size policy to maximum. I gave it a baseSize Height of 700. I set the maximumSize Height to 700. It still comes out too tall (far more than 700 pixels).

    What else can I try to stop it being taller than 700 pixels?

    Alternatively, I could manually resize it, except that the top of the dialog isn't draggable. The right side and left side can be dragged to resize horizontally, and the bottom edge could be dragged to resize vertically if only the bottom edge was on screen, but the top edge doesn't drag. So how can I make the top edge draggable?

    Alternatively to that, I could drag the whole window upwards via ALT+LEFT_MOUSE+MOUSE_MOVE until the bottom edge appears, and then resize it by dragging the bottom edge; except that when I try to do that it refuses to let the top level QDialog move off the top of the screen. The parent dialog behind it moves off the screen, though. So how can I make it so I'm allowed to drag the QDialog off screen so I can see the bottom edge so I can resize it?

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      hi
      It seems like if QDialog has a layout, the Maxsize don't work.
      however setting this on the inner layout
      OptionDialog d;
      d.layout()->setSizeConstraint (QLayout::SetMaximumSize);
      d.exec();

      Made the dialog, only be the MaximumSize.MaxHeight set in designer.
      all other values at default.
      Not sure its your case too.

      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