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. Fixed size of scrollbar in qscrollarea not fully show up.
Forum Updated to NodeBB v4.3 + New Features

Fixed size of scrollbar in qscrollarea not fully show up.

Scheduled Pinned Locked Moved Solved General and Desktop
10 Posts 2 Posters 1.9k Views 2 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.
  • D Offline
    D Offline
    doodle
    wrote on last edited by doodle
    #1

    code:

    ui->scrollArea->verticalScrollBar()->setMinimumWidth(50);
    QWidget *cen = new QWidget;
    QVBoxLayout *layout = new QVBoxLayout(cen);
    layout->addWidget(plabela);
    layout->addWidget(plabelb);
    ui->scrollArea->setWidget(cen);
    ui->scrollArea->setWidgetResizable(true);
    

    result:
    alt text
    https://drive.google.com/file/d/1jzXNbhqDqHKCuItitUy_EgCnh_wVkJ6I/view?usp=sharing

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

      Hi
      I just did it with stylesheet
      QScrollBar::vertical{width:50px;}

      1 Reply Last reply
      1
      • D Offline
        D Offline
        doodle
        wrote on last edited by
        #3

        Thanks!
        It's so convinent with stylesheet.

        mrjjM 1 Reply Last reply
        0
        • D doodle

          Thanks!
          It's so convinent with stylesheet.

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @doodle
          Hi
          Yes often yes. :)
          Not sure the scrollArea->verticalScrollBar() is in a layout or why setMinimumWidth
          have no effect.

          1 Reply Last reply
          0
          • D Offline
            D Offline
            doodle
            wrote on last edited by
            #5

            By the way, what's the situation of stylesheet in qt? I found that the qt creator not support it very well.

            mrjjM 1 Reply Last reply
            0
            • D doodle

              By the way, what's the situation of stylesheet in qt? I found that the qt creator not support it very well.

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by mrjj
              #6

              @doodle
              Hi
              What you mean , not support in what way.?
              Creator even has a build in stylesheet editor :)
              alt text

              1 Reply Last reply
              0
              • D Offline
                D Offline
                doodle
                wrote on last edited by
                #7

                I mean syntax completion and validation.

                mrjjM 1 Reply Last reply
                0
                • D doodle

                  I mean syntax completion and validation.

                  mrjjM Offline
                  mrjjM Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @doodle
                  Well the editor does syntax check but it has no code completion. But does open
                  webpage with help on F1. There is still no API to ask for values from stylesheet (in code) and
                  Creator cant auto apply stylesheets when u create say a new form.
                  But other than that , its ok supported.

                  1 Reply Last reply
                  2
                  • D Offline
                    D Offline
                    doodle
                    wrote on last edited by
                    #9

                    Got it, thank you for your details.

                    mrjjM 1 Reply Last reply
                    0
                    • D doodle

                      Got it, thank you for your details.

                      mrjjM Offline
                      mrjjM Offline
                      mrjj
                      Lifetime Qt Champion
                      wrote on last edited by mrjj
                      #10

                      @doodle
                      np. as a final note.
                      Since stylesheets are cascading.
                      It works best setting stylesheet on QApplication as then
                      all forms and Widgets t are created are affected.
                      Also keeps stylesheet as one file and much easier to
                      maintain than setting stylesheet many places.

                      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