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. Controlling Margin and Spacing during resize
Forum Updated to NodeBB v4.3 + New Features

Controlling Margin and Spacing during resize

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 477 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.
  • B Offline
    B Offline
    BKBK
    wrote on last edited by
    #1

    This app has a GL widget within a QGridLayout. When being resized the QGLWidget has a paintGL() that gets called as it is resized. It can make adjustment during the resize. I am not seeing anything from the QWidget that is or might be called as the widgets are resized. Is there a way to write a function that is called during that operation?
    SetColSpacing() and SetRowSpacing() set the minimum spacing. Is there a way to set maximum spacing:
    The goal is to prevent the spacing and margins to change during the resize operations.

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

      Hi,

      Are you thinking about the QWidget::resizeEvent method ? Or the QGLWidget::resizeGL method ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • B Offline
        B Offline
        BKBK
        wrote on last edited by BKBK
        #3

        Don't know, might be, sounds good, looking them up.
        Edit
        Yes, that is what I wanted. Its an intermediate step.
        I created a resize() method used it to interrogate the grid layout to get the values for column and row spacing, and for margin and spacing. I was hoping those values would change when the widget was resized. In that event they could be re-written during the resize event to preclude the spacing from changing.
        They don't change.
        To recap: As the enclosing widget is resized, the GL widget is to change size, but the spacing between the widgets is not to change.

        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