Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. qscrollbar

    Log in to post
    • All categories
    • T

      Unsolved QScrollBar slider shadow
      General and Desktop • qscrollbar shadow qt5.9.0 • • temi4

      1
      0
      Votes
      1
      Posts
      37
      Views

      No one has replied

    • H

      Unsolved Edit scrollbar colour through stylesheet in main window?
      General and Desktop • qscrollbar mainwindow stylesheet scroll scrollbar • • Hologram

      6
      0
      Votes
      6
      Posts
      139
      Views

      SGaist

      Don't you have access to the source code ?
      And if not, ask the authors ?

    • A

      Unsolved Clicking page control area of QScrollBar causes flash of gray
      General and Desktop • qscrollarea qscrollbar glitch • • AAhusk

      3
      0
      Votes
      3
      Posts
      89
      Views

      A

      @SGaist I'm not familiar with "movement direction feedback", but it very well could be that.

    • F

      Solved Sync of scrollbar values
      General and Desktop • qtableview qscrollbar connect • • firen

      3
      0
      Votes
      3
      Posts
      227
      Views

      F

      @mrjj Thank you. Yes with an own signal + slot for the switch it is working

    • Emrecp

      Unsolved Custom QScrollBar
      QML and Qt Quick • qscrollbar custom widget stylesheet qml • • Emrecp

      2
      0
      Votes
      2
      Posts
      406
      Views

      mrjj

      Hi
      I don't think Qt stylesheet supports even half of this

      #style-9::-webkit-scrollbar-track { -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3); background-color: #F5F5F5; }

      so you best bet is to dig into
      https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qscrollbar
      and see how close you can get it.

    • Alairion

      Solved QScrollArea and transparent scroll bar
      General and Desktop • qscrollarea qscrollbar qt5 • • Alairion

      3
      0
      Votes
      3
      Posts
      645
      Views

      Alairion

      Hi, thanks you for answer.
      The scroll area in my application is inside another widget, the main window, and it has an illustrated background. The problem is for main window not the content of the scroll area.
      Anyway, I found a workaround, I set the same background for the main window and the scroll bar, so the scroll bar is opaque but looks transparent.
      I still wonder why is there this strange behaviour with the scroll bar, but this topic can be considered as solved as I found a way to get around this.

    • K

      Solved How can I set maximum width to which QScrollArea (within QDialog) will expand without adding scrollbar?
      General and Desktop • qscrollbar qdialog • • Kot Shrodingera

      5
      0
      Votes
      5
      Posts
      1734
      Views

      K

      Thanks but I asked same question on StackOverflow
      https://stackoverflow.com/questions/55471486/how-can-i-set-maximum-width-to-which-qscrollarea-within-qdialog-will-expand-wi/
      The reason of such behaviour is cause QScrollArea::sizeHint() has boundedTo(QSize(36 * h, 24 * h)) , where h is fontMetrics().height(), at the end of implementation. So reimplementing sizeHint() is doing the job just fine

    • A

      Unsolved Disable slider of scrollbar in scrollarea
      General and Desktop • qscrollbar qscrollarea • • AlexanderB

      6
      0
      Votes
      6
      Posts
      1958
      Views

      mrjj

      @AlexanderB

      Hi
      If you look here
      https://code.woboq.org/qt5/qtbase/src/widgets/styles/qwindowsstyle.cpp.html

      in 1894
      void QWindowsStyle::drawComplexControl

      you can see the use of
      QRect groove = proxy()->subControlRect(CC_Slider, slider, SC_SliderGroove, widget);
      QRect handle = proxy()->subControlRect(CC_Slider, slider, SC_SliderHandle, widget);

      I assume you can get the various parts this way, even you changed it using stylesheet.

    • B

      Unsolved Scrollbar appearing/disappearing infinitely -> override calculation used to display scrollbar in QScrollArea
      General and Desktop • qscrollarea qscrollbar • • BryceBeagle

      4
      0
      Votes
      4
      Posts
      462
      Views

      SGaist

      I was thinking about the widgets.

      By the way, how are you adding them to the QScrollArea ?

    • Y

      Solved How to get usesScrollButtons buttons to scroll tabs when it has many tabs For MAC?
      General and Desktop • qtabbar macos qscrollbar qtabwidget • • Yash001

      11
      0
      Votes
      11
      Posts
      2589
      Views

      Y

      Thank You @SGaist and @AndyS. I am able to get QToolButton of QTabBar by applying Fusion style.

      I applied Fusion Style By:

      #include "mainwindow.h" #include <QTimer> #include <QtGlobal> #include <QFile> #include <QLocale> #include <QSplashScreen> #include <QGuiApplication> #include <qstylefactory.h> int main(int argc, char *argv[]) { QLocale::setDefault(QLocale::system()); QApplication a(argc, argv); a.setStyle(QStyleFactory::create("Fusion")); MainWindow w; w.showMaximized(); return a.exec(); }
    • M

      Solved Customizing ScrollBar of QListWidget
      General and Desktop • qlistwidget qscrollbar stylesheet • • mounipanditi

      5
      0
      Votes
      5
      Posts
      4274
      Views

      M

      @raven-worx

      my bad, Thanks for the link it helped a lot.

    • SolaVitae

      Unsolved Changing the scrollbar's icons
      General and Desktop • qscrollbar qwidget gui • • SolaVitae

      2
      0
      Votes
      2
      Posts
      2010
      Views

      mrjj

      Hi
      You did read ?
      http://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qscrollbar

    • O

      Solved QScrollBar subControlRect ignores orientation Qt5.9.1
      General and Desktop • qscrollbar subcontrolrect qstyle sub-controls • • Oleg21

      7
      0
      Votes
      7
      Posts
      1792
      Views

      SGaist

      Great !

      Thanks for sharing your findings !

      One last thing, you are leaking your opt object. You should rather build it on the stack and pass its address to subControlRect.

    • T

      Solved wheelEvent is calling twice on MAC.
      General and Desktop • qscrollbar qscrollarea qwheelevent • • tokafr

      4
      0
      Votes
      4
      Posts
      1164
      Views

      SGaist

      AFAIK, the Qt 4.8 series has no release officially supporting such a recent version of macOS. Therefore you may have surprises. Note that Qt 4 has reached end of life so unless you are locked to that version, you should really consider updating to Qt 5 which is now at it's 5.9.0 release.

    • T

      Solved QScrollBar acts differently when pressing arrow keys and scrolling.
      General and Desktop • qscrollbar qscrollarea qslider • • tokafr

      4
      0
      Votes
      4
      Posts
      1688
      Views

      T

      @SGaist Thanks I managed to do it this way.

    • T

      Unsolved Scrollbar doesn't appear on QListWidget when item starts on visible area.
      General and Desktop • qscrollbar qscrollarea qlistwidget qlistview • • tokafr

      3
      0
      Votes
      3
      Posts
      1239
      Views

      T

      @the_
      no it is Qt::ScrollBarAsNeeded.but scrolbar appears correctly after I resize the main widget even with 1 px.

    • P

      Unsolved expand the ScrollBar (PageStep) Size by Dragging
      General and Desktop • qscrollbar • • praveen0991kr

      1
      0
      Votes
      1
      Posts
      391
      Views

      No one has replied

    • Donn

      Unsolved Display multiple images in one QGraphicsView using QScrollBar
      General and Desktop • qgraphicsview qscrollbar image image display • • Donn

      1
      0
      Votes
      1
      Posts
      895
      Views

      No one has replied

    • T

      Unsolved Reduce painting area of qwidget.
      General and Desktop • qwidget qtableview qscrollbar qscrollarea • • tokafr

      2
      0
      Votes
      2
      Posts
      901
      Views

      mrjj

      hi
      I have never tried this myself so might be silly question,
      If you set the qtableview to always show horz scrollbar (Qt::ScrollBarPolicy)
      and then replace it with your own. the size should fit?

      Or is because your new scrollbar is bigger? (than the std one)

      the docs says
      "When a scroll bar becomes visible again, the viewport shrinks in order to make room for the scroll bar."

      so it should just work by auto. So I wonder if the custom bar dont give correct size info?

    • M

      QScrollBar - Hiding add-line and sub-line when moved
      General and Desktop • qscrollbar scroll scrollbar • • mat_de_b

      2
      0
      Votes
      2
      Posts
      4795
      Views

      mrjj

      Hi and welcome
      I think you might need to set margin for inner area
      The following works for me with 32x32 images for the ends

      /*inner area*/ QScrollBar::vertical { border: 1px solid #a5a5a5; background: none; width: 65px; margin: 42px 0 42px 0; /* match top/lower area*/ } /*the knob*/ QScrollBar::handle:vertical { background: #d5d5d5;; border: 2px solid #000000; min-height: 60px; border-radius: 12px; } /*lower arrow area*/ QScrollBar::add-line:vertical { border: 0px solid grey; background: NONE; height: 40px; subcontrol-position: bottom; subcontrol-origin: margin; } /*top arrow area*/ QScrollBar::sub-line:vertical { border: 0px solid grey; background: none; height: 40px; subcontrol-position: top; subcontrol-origin: margin; } /*arrows*/ QScrollBar::up-arrow:vertical { image: url(:/GFX/sbar/up_arrow_scrollbar.png); } /*pressed*/ QScrollBar::up-arrow:vertical::pressed { image: url(:/GFX/sbar/up_arrow_scrollbar_pressed.png); } QScrollBar::down-arrow:vertical::pressed { image: url(:/GFX/sbar/down_arrow_scrollbar_pressed.png); } QScrollBar::down-arrow:vertical { /* border: 2px solid grey; width: 3px; height: 23px; */ image: url(:/GFX/sbar/down_arrow_scrollbar.png); } QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical { background: none; }