Questions tagged [qscrollarea]

QScrollArea is a Qt class that provides scrolling functionality to other widgets.

QScrollArea displays the contents of another widget within some frame. If that widget is bigger than the frame and does not fit, scrollbars will be provided so the entire widget can be viewed.

QScrollArea allows changing the scrollbar policies (which determine if the scrollbars are always on, always off, or activated when needed), and to programmatically get and set the scrollbar values.

It also allows customizing the visual appearance of the scrollbars.

Official documentation can be found here.

298 questions
35
votes
4 answers

How do i resize the contents of a QScrollArea as more widgets are placed inside

I have a QScrollArea Widget, which starts empty; It has a vertical layout, with a QGridLayout, and a vertical spacer to keep it at the top, and prevent it from stretching over the whole scroll area; Elsewhere in the program, there is a QTextEdit,…
will
  • 10,260
  • 6
  • 46
  • 69
24
votes
7 answers

QSpinBox inside a QScrollArea: How to prevent Spin Box from stealing focus when scrolling?

I have a control with several QSpinBox objects inside a QScrollArea. All works fine when scrolling in the scroll area unless the mouse happens to be over one of the QSpinBoxes. Then the QSpinBox steals focus and the wheel events manipulate the…
Grant Limberg
  • 20,913
  • 11
  • 63
  • 84
16
votes
1 answer

PyQt: How to make widget scrollable

I am trying to make my QGroupBox scrollable once it grows higher than 400px. The contents in the QGroupBox are generated using a for-loop. This is an example of how it was done: mygroupbox = QtGui.QGroupBox('this is my groupbox') myform =…
Chris Aung
  • 9,152
  • 33
  • 82
  • 127
12
votes
1 answer

How can I make a PyQt widget resizable by dragging?

I have a QScrollArea containing a widget with a QVBoxLayout. Inside this layout are several other widgets. I want the user to be able to drag the lower borders of those widgets to resize them in the vertical direction. When they are resized, I…
BrenBarn
  • 242,874
  • 37
  • 412
  • 384
12
votes
3 answers

Qt QGridLayout automatically centers (moves) items to the middle.

I have a QHBoxLayout on my form with 3 layouts added to it. The second one has the items concerning my question. I have a QVBoxLayout on the second pane of the main layout (the QHBoxLayout). This QVBoxLayout has a QScrollArea added to it with…
Phil
  • 13,875
  • 21
  • 81
  • 126
11
votes
4 answers

How to hide scrollbar in QScrollArea?

How can one hide the scrollbars in a QScrollArea? Currently I use the hide() method on the scrollbars returned by QScrollArea::horizontalScrollBar() and QScrollArea::verticalScrollBar() but the space reserved for scrollbars still remains. Obviously…
pafcu
  • 7,808
  • 12
  • 42
  • 55
9
votes
4 answers

PyQt: How to create a scrollable window

I think it should be much easier to create a scrollable window in PyQt. I have a list of labels that goes out of the window and I would like to scroll down to view them. At the moment the code does not give me an error, but the window just doesn't…
user3755529
  • 1,050
  • 1
  • 10
  • 30
9
votes
1 answer

Qt.ScrollBarAsNeeded not showing scrollbar when it's actually needed

I'm implementing a python application using PyQt5 and I encountered some problems when making use of a QScrollArea. This is the layout of my application: It's composed of 2 QScrollArea (left and right pane) and a QMdiArea (center widget) arranged…
Daniele Pantaleone
  • 2,657
  • 22
  • 33
9
votes
1 answer

QScrollArea not working as expected with QWidget and QVBoxLayout

So I have this QFrame which is the parent widget (represented by this in the code). In this widget, I want to place a QWidget at 10 px from top (and 10 px from bottom, as a result of which it will have a height of 140px, whereas parent is 160px).…
SexyBeast
  • 7,913
  • 28
  • 108
  • 196
8
votes
5 answers

How to adjust QTextEdit to fit it's contents

I'm developing a Qt Application and I'm trying to find a way to use QTextEdit as a label with long text without the scroll bar. In my ui I have a QScrollArea and inside of it I want to place a couple off QTextEdit widgets and I only want use…
madasionka
  • 812
  • 2
  • 10
  • 29
8
votes
1 answer

Qt: How to determine whether a widget is visible or not in the QScrollArea?

Someone suggested that I re-implement the QWheelEvent handler and check each child widgets' visibleRegion is 0 or not. Are there any better suggestions?
Nyaruko
  • 4,329
  • 9
  • 54
  • 105
7
votes
2 answers

QLabel showing an image inside a QScrollArea

I've successfully implemented a Image Viewer (for DICOM) in Qt. I can see the image and I can zoom in and out correctly. Now, I want to see scroll bars if the image is too big to show when I zoom in. I've used the UI. I placed a QScrollArea. Inside,…
Mark A.
  • 193
  • 1
  • 3
  • 14
6
votes
1 answer

Zooming and panning an image in a QScrollArea

I have created a preview that shows a rendered image. I used the Image Viewer Example for zooming functionality - so I have a class inheriting QScrollArea, capable of showing an image, in a QLabel, and zooming in/out/fit with specific limits. I was…
Thalia
  • 13,637
  • 22
  • 96
  • 190
6
votes
6 answers

QScrollArea does not scroll to maximum after widgets have been added

My setup looks like this: Main Window |- QHBoxLayout |- Some Widgets |- QScrollArea | |- QHBoxLayout | |- QGridLayout | |- Widgets dynamically loaded in at runtime | |-…
Lukas
  • 101
  • 1
  • 3
6
votes
1 answer

QScrollArea missing Scrollbar

I think it is the same problem as : QScrollArea resizing QWidget but there are not solution. so let me expose the problem. test 2 inherited from QWidget: composed : vector of QSpinBox QScrollArea QVBoxLayout test2 (QWidget) <- QScrollArea <-…
Setepenre
  • 1,883
  • 3
  • 13
  • 16
1
2 3
19 20