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 Set QSCROLLBAR to GROUPBOX
Forum Updated to NodeBB v4.3 + New Features

How to Set QSCROLLBAR to GROUPBOX

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 4 Posters 2.2k 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.
  • Pranit PatilP Offline
    Pranit PatilP Offline
    Pranit Patil
    wrote on last edited by VRonin
    #1

    im trying to set Qscrollbar to groupbox but its not working properly

    my code is for setup is below-

     uiPoMo->scrollArea->setWidget(uiPoMo->groupBox_SenoresDetails);
        uiPoMo->scrollArea->setWidgetResizable(true);
        uiPoMo->scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
        uiPoMo->scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
    
        QVBoxLayout* pQVBoxLayoutMain = new QVBoxLayout;
        pQVBoxLayoutMain->addWidget(uiPoMo->scrollArea);
        QWidget* central1 = new QWidget(this);
        central1->setLayout(pQVBoxLayoutMain);
    

    0_1532966414334_Screenshot_18.png

    @Embedded Software Developer
    God has given you one face, and you make yourself another.

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

      Hi,

      Do you mean you want to put a QScrollArea inside a QGroupBox ?

      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
      2
      • Pranit PatilP Offline
        Pranit PatilP Offline
        Pranit Patil
        wrote on last edited by
        #3

        I did but no effect.

        @Embedded Software Developer
        God has given you one face, and you make yourself another.

        jsulmJ 1 Reply Last reply
        0
        • Pranit PatilP Pranit Patil

          I did but no effect.

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

          @Pranit-Patil It is quite unusual to put scroll bars into a QGroupBox (I can't remember ever seen an application with such an interface). Why do you want to do this?

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

          Pranit PatilP 1 Reply Last reply
          1
          • jsulmJ jsulm

            @Pranit-Patil It is quite unusual to put scroll bars into a QGroupBox (I can't remember ever seen an application with such an interface). Why do you want to do this?

            Pranit PatilP Offline
            Pranit PatilP Offline
            Pranit Patil
            wrote on last edited by
            #5

            @jsulm my application need is like this only.
            we have no of sensors which will add dynamically and we want to show all sensor in that group box so ..

            @Embedded Software Developer
            God has given you one face, and you make yourself another.

            jsulmJ 1 Reply Last reply
            0
            • Pranit PatilP Pranit Patil

              @jsulm my application need is like this only.
              we have no of sensors which will add dynamically and we want to show all sensor in that group box so ..

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

              @Pranit-Patil Then you should have a scroll area in the widget where this group box is, not inside the group box. So, the group box would get bigger when more elements will be inside and user will be able to scroll to access the whole group box.

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

              1 Reply Last reply
              1
              • Pranit PatilP Offline
                Pranit PatilP Offline
                Pranit Patil
                wrote on last edited by
                #7

                sorry i didn't understand what your saying

                @Embedded Software Developer
                God has given you one face, and you make yourself another.

                jsulmJ 1 Reply Last reply
                0
                • Pranit PatilP Pranit Patil

                  sorry i didn't understand what your saying

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

                  @Pranit-Patil You put your group box in some widget, right? Then put there your scroll area and put the group box in this scroll area. I never saw a group box with scroll bars inside, this is really not how it should work. The scroll bars should be in the parent widget of your group box.

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

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

                    If you have a list/table of uniform things (like in your case sensors) use QTableWidget (or model+view) to display them instead of creating a layout of unmanageable widgets

                    "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
                    2

                    • Login

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