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
4
votes
1 answer

Catch QWidget real visibility status changing

I have C++ Qt 5.2.1 based project and one of graphic component looks like: +-- ParentWidget == QScrollArea ----------+ | |^| | +-- MiddleWidget == QWidget -------+ | | | | (>) Expand/collapse button |…
serg.v.gusev
  • 501
  • 4
  • 13
4
votes
1 answer

PyQt: Adding widgets to scrollarea during the runtime

I'm trying to add new widgets (in the example below I use labels) during the runtime by pressing on a button. Here the example: import sys from PyQt4.QtCore import * from PyQt4.QtGui import * class Widget(QWidget): def __init__(self, parent=…
lucaboni
  • 2,334
  • 2
  • 29
  • 41
4
votes
1 answer

Getting rid of unnecessary scrollbar in QScrollArea

I'm working on a Configuration QDialog. It has several categories (General, Appearance, etc.) that get loaded when the user clicks on them. Each category has its own page. These pages are separate classes in their own right (each has its own ui,…
Will Kraft
  • 553
  • 1
  • 8
  • 23
4
votes
2 answers

Scrolling in QScrollArea pyqt

How can I auto scroll for the scroll area? For example, when there is a new update instead of the view of the scroll area staying the same, I want to go down with the new text. Think of it as in a CMD console, when you type a command it autoscroll…
user1582983
3
votes
2 answers

Set QScrollbar width to prevent the need for horizontal scrollbar

Is there a way to set the width of a QScrollArea so that a horizontal scrollbar is not needed? I know I can hide horizontal scrollbar by setting it's policy to always off. However, I want to make the QScrollArea large enough to not need it. I'm…
durden2.0
  • 9,222
  • 9
  • 44
  • 57
3
votes
1 answer

Custom collapsible widget causing size issues

I came across this post answer on How to make an expandable/collapsable section widget in Qt, but the proposed solution is not without flaws. In fact, as you can see below, once the widget has been expanded and closed, it doesn't reset the window…
Hippo
  • 31
  • 6
3
votes
2 answers

Setting the scroll bar to the bottom on PyQt5 (using scrollArea and a gridLayout)

I have a QScrollArea with a QGridLayout within. This said QGridLayout is filled with buttons on a 100x100 grid. I want the vertical scrollbar to start on the bottom instead of the top. I've searched online how to do it, but nothing worked so…
3
votes
1 answer

QBoxLayout stretches its widgets when resizing it's containing ScrollArea, rather than scrolling

I have a ScrollArea, containing a VBoxLayout containing several Labels: realmScroll = QScrollArea(self.container.widget()) realmScroll.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded) realmScroll.setWidgetResizable(True) # setting this to False has…
Ross
  • 46,186
  • 39
  • 120
  • 173
3
votes
1 answer

PyQt5 set widget size to minimum and fix

def __init__(self): super().__init__() self.order_list = [str(i) * 2 * i for i in range(20)] self.space = 18 self.init_ui() def init_ui(self): self.setGeometry(300, 300, 300, 300) self.layout = Qw.QGridLayout(self) …
alexe-mgn
  • 47
  • 1
  • 1
  • 6
3
votes
1 answer

PyQt5 QScrollArea widget with dynamically created GroupBoxes

I'm trying to make a toolbox widget that will do various different things. But I'm having trouble with the layout management regarding the QScrollArea. Following the stripped version of the code I have: from PyQt5 import QtWidgets import sys class…
Ned U
  • 401
  • 2
  • 7
  • 15
3
votes
1 answer

pyqt5 tab area not filling the whole available space

I am experimenting with a GUI - I'd like to have scrollbars and tabs. I've tinkered with the scroll bars as the "outer most" widget, with a QTabWidget inside, and also the other way around: The QTabWidget has a QWidget tab, and the QScrollArea's…
Erik Iverson
  • 309
  • 1
  • 11
3
votes
1 answer

How to use QScrollArea for one or many QGroupBox?

I have been trying to insert one/many QGroupBox into one QScrollArea. The problem is: The Scroll bar does not show. Here is my code: # -*- coding: utf-8 -*- from PyQt5.QtWidgets import QWidget from PyQt5.QtWidgets import QLabel from…
Rt Rtt
  • 595
  • 2
  • 13
  • 33
3
votes
1 answer

QScrollArea with dynamically added widget

I have some problem placing custom widget in QScrollArea. My custom widget contains 4 labels in QGridLayout filling it. Now I want to keep this widget in QScrollArea and be able to add more labels to it but I want only 4 of them to be shown in…
michszm
  • 113
  • 1
  • 3
  • 10
3
votes
2 answers

How to determine whether the scrollbar of scrollArea is visible in PyQt5?

Well. The question seems to be very easy, but the result I get is different from what I expect to. I have an app, which height depends on its content. Here is auto-resize code: def resizeApp(self): n = len(self.listOfWidgets) if…
Devilhunter
  • 123
  • 2
  • 11
3
votes
0 answers

Touch scroll in a PySide QScrollArea

Implementing kinetic scrolling under Qt5 is quite simple with the QScroller class, but this unfortunately isn't an option currently with PySide, as PySide is Qt4-based, and PySide 2 (Qt5-based) doesn't yet have QScroller support. I have a…
jars121
  • 1,127
  • 2
  • 20
  • 35
1 2
3
19 20