Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Attach button and other widgets to the right side of the parent widget, on resize.

Attach button and other widgets to the right side of the parent widget, on resize.

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
3 Posts 3 Posters 1.6k 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.
  • F Offline
    F Offline
    Furkas
    wrote on last edited by
    #1

    Hello,
    I'm using Qt5.6, for an UI widgets desktop application, on windows platform.
    I want to attach pushbuttons to the right side of the frame, as the user resize the application window.
    The mainwindow is a QWidget, with some other widgets placed using Designer.
    When I reduce the application frame, the right side is masked.
    How can I link the button so they can move with the right side (and eventually disapears to the left side if there isnt enough room ...)
    Thanks for your advices

    raven-worxR 1 Reply Last reply
    0
    • F Furkas

      Hello,
      I'm using Qt5.6, for an UI widgets desktop application, on windows platform.
      I want to attach pushbuttons to the right side of the frame, as the user resize the application window.
      The mainwindow is a QWidget, with some other widgets placed using Designer.
      When I reduce the application frame, the right side is masked.
      How can I link the button so they can move with the right side (and eventually disapears to the left side if there isnt enough room ...)
      Thanks for your advices

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @Furkas

      1. use QLayouts. Spacer <-> Widget
      2. call setGeometry()/move() manually in the resizeEvent() handler of the parent widget with the calculated position

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        Hi! To add to @raven-worx, have a look at this screenshot:

        screenshot layout

        First your central widget needs a horizontal layout. This can be selected in the property editor on the right. Next is to add a vertical layout from the component menu on the left (not shown in the screenshot). You can then drop your buttons in this vertical layout and also add one or more vertical spacers to it if you like.

        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