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 raise a separate widget in a main window?
Forum Updated to NodeBB v4.3 + New Features

How to raise a separate widget in a main window?

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 2.5k 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.
  • O Offline
    O Offline
    olejacob
    wrote on last edited by
    #1

    Hi,

    I'm creating an application with many different widgets, let say that the widgets are distributed in 8x8 matrix in a QGridLayout.

    Since the widgets are very small, I want to click on a widget at location e.g 4x4 (matrix sense), and then this widget is raised in full size and shown on top of the main window....Pretty much as an advanced pop-up window. When I want to lower the widget again, I just click lower, or close the widget and then it re-apperas in the main window again with the new modified settings.

    How can I do this?

    Best regards,

    Ole J. Hagen

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      I feel you should work mouseEvents and resizing of window/widget. This is very much like any soft-keyboard.

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      0
      • O Offline
        O Offline
        olejacob
        wrote on last edited by
        #3

        Hi,

        Ok, a new description.
        A Qt application with a QMainWindow consists of 16 tiny widgets arranged in a 4x4 matrix. All of these widgets contains two sliders, a knob and a progressbar.

        When I want to change something in a widget located at location (3,3), then the widget is too small to be used. Therefore I want to raise the selected widget from the MainWindow and be in front of the MainWindow and resize it so we can change the parameters in it. When we are finished changing parameters, then the widget should go back to it's original location at (3,3).

        How can this be done?
        I guess I need to do re-parenting to 0 for the particular widget that I choose, and re-parent it back to MainWindow when I'm finished with it.

        How can I be certain that this widget ends up at the location (3,3) again?

        How can I solve this?

        Ole

        1 Reply Last reply
        0
        • dheerendraD Offline
          dheerendraD Offline
          dheerendra
          Qt Champions 2022
          wrote on last edited by
          #4

          Would you mind sharing your email id ? I can send you the sample program which does this similar stuff. Based on this you can design your screen.

          Dheerendra
          @Community Service
          Certified Qt Specialist
          http://www.pthinks.com

          1 Reply Last reply
          0
          • N Offline
            N Offline
            NicuPopescu
            wrote on last edited by
            #5

            QWidget::raise() for displaying in front of any other sibbling widget, and QWidget::stackUnder(QWidget * w) to restore its position in the children stack, of course preserving before the bigger resizing the widget under which it should be stacked (the widget upward in the stack)

            hope it helps :)

            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