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. How to hide a widget

How to hide a widget

Scheduled Pinned Locked Moved Solved Mobile and Embedded
9 Posts 5 Posters 10.7k Views
  • 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.
  • S Offline
    S Offline
    Sherlin N G
    wrote on last edited by
    #1

    How to hide a widget(like a button or Groupbox) in the ui and invoke it when user wants it.

    1 Reply Last reply
    0
    • VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by
      #2

      QWidget::setVisible(bool) http://doc.qt.io/qt-5/qwidget.html#visible-prop

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      1 Reply Last reply
      5
      • S Offline
        S Offline
        Sherlin N G
        wrote on last edited by
        #3

        @VRonin thanks for the reply.I'm having another problem.
        My ui has a QComboBox widget with 5 options and i have 5 different GroupBox for them.When the user selects an option corresponding GroupBox should appear in the ui at the fixed x,y location.So how do I hide 5 GroupBoxes in the same place and show only 1 GroupBox??

        jsulmJ yuvaramY 2 Replies Last reply
        0
        • S Sherlin N G

          @VRonin thanks for the reply.I'm having another problem.
          My ui has a QComboBox widget with 5 options and i have 5 different GroupBox for them.When the user selects an option corresponding GroupBox should appear in the ui at the fixed x,y location.So how do I hide 5 GroupBoxes in the same place and show only 1 GroupBox??

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Sherlin-N-G Why do you want to have 5 group boxes? Why not use one group box and fill in needed data depending on selection in combo box?

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1
          • S Offline
            S Offline
            Sherlin N G
            wrote on last edited by
            #5

            How can you dynamically create a group box based on users selection? Can you show me an example?

            jsulmJ 1 Reply Last reply
            0
            • S Offline
              S Offline
              Sherlin N G
              wrote on last edited by
              #6

              My groupbox gets huge for certain options and for some options it is small and simple.So suggest me how to create a groupbox for different user options in the QCombobox.

              1 Reply Last reply
              0
              • S Sherlin N G

                @VRonin thanks for the reply.I'm having another problem.
                My ui has a QComboBox widget with 5 options and i have 5 different GroupBox for them.When the user selects an option corresponding GroupBox should appear in the ui at the fixed x,y location.So how do I hide 5 GroupBoxes in the same place and show only 1 GroupBox??

                yuvaramY Offline
                yuvaramY Offline
                yuvaram
                wrote on last edited by
                #7

                @Sherlin-N-G
                Use Grid layout to fix widget locations

                Yuvaram Aligeti
                Embedded Qt Developer
                : )

                1 Reply Last reply
                0
                • S Sherlin N G

                  How can you dynamically create a group box based on users selection? Can you show me an example?

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @Sherlin-N-G said in How to hide a widget:

                  How can you dynamically create a group box based on users selection?

                  I don't understand what the problem is. You can see here how to create a QGroupBox (actually in the same way any other Qt widget is created): http://doc.qt.io/qt-5/qtwidgets-widgets-groupbox-example.html

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • Pablo J. RoginaP Offline
                    Pablo J. RoginaP Offline
                    Pablo J. Rogina
                    wrote on last edited by
                    #9

                    @Sherlin-N-G please don't hijaack the topic of your post. If the issue with hiding a widget is solved, go and mark this post as such. Then, if you have a new issue with QGroupBox please go and create a new post about it. Thanks.

                    Upvote the answer(s) that helped you solve the issue
                    Use "Topic Tools" button to mark your post as Solved
                    Add screenshots via postimage.org
                    Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

                    1 Reply Last reply
                    1

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved