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

pyqt expand grid in scroll area

I have a grid area in a scroll area within a dialog class IndicSelectWindow(QDialog): def __init__(self, path, parent=None): super(IndicSelectWindow, self).__init__(parent) self.resize(500, 400) self.scroll_area =…
chrise
  • 4,039
  • 3
  • 39
  • 74
3
votes
1 answer

QLayout with minimum space required

I have a QVBoxLayout in wich I add dynamically on runtime other QWidget s: for(int i = 0; i < value; i++) { QList widgetList_i; //... widgetList_i.append(a lot of widgets) ui->verticalLayout->addWidget(widget_i); } There is a…
Ralf Wickum
  • 2,850
  • 9
  • 55
  • 103
3
votes
2 answers

QAbstractScrollArea introduces offset when using mapToGlobal

I have a slot for customContextMenuRequested and in try to convert point to global point (for context menu). If the class inherits QAbstractScrollArea, the mapToGlobal will have offset (and thus global point does not match cursor point). Here is…
Sasa
  • 1,597
  • 4
  • 16
  • 33
3
votes
1 answer

Qt - avoid white background when resizing (set immediately a background color)

The question is in bold at the end so please read this as a whole. I have a QAbstractScrollArea widget that I manually and completely render in the OnPaint() event. In its constructor I set setAttribute( Qt::WA_OpaquePaintEvent, true…
Albert
  • 1,085
  • 2
  • 10
  • 20
3
votes
1 answer

Qt: Strange behavior when calling setGeometry on a widget in QScrollArea

My environment is the following: Qt 5.4, build from source with -platform win32-msvc2013 -opengl desktop -no-icu -skip webkit Visual Studio 2013 Windows 7 x64 Consider the following setup (A QScrollArea containing a centered widget with fixed…
manuel
  • 533
  • 6
  • 16
3
votes
1 answer

Qt: Applying stylesheet on QScrollArea making horizontal scrollbar disappear but working perfectly for vertical scrollbar

I am trying to apply some style-sheet for scrollbars of QScrollArea and my style sheet as follows. QScrollBar:vertical { border-color: rgb(227, 227, 227); border-width: 1px; border-style: solid; background-color: rgb(240, 240, 240); …
Shakib Ahmed
  • 781
  • 2
  • 10
  • 24
3
votes
1 answer

QLabel::setPixmap() and QScrollArea::setWidget()

I've been tracking down a bug that boils down to this - if you show an image label inside a scroll area, the label will not be resized to the image's size if QLabel::setPixmap() is called after QScrollArea::setWidget(). This example illustrates the…
sashoalm
  • 75,001
  • 122
  • 434
  • 781
3
votes
1 answer

Generate PyQt Legend

I'm trying to build myself a simple graphics calculator, as a way of teaching myself PyQt. I'd like the calculator to have a pane which lists all of the equations plotted and shows the line style used. I began with a QListWidget to achieve these…
EddyTheB
  • 3,100
  • 4
  • 23
  • 32
3
votes
1 answer

How to prevent zooming in QScrollArea from being so rickety-flickery?

I'm working on a PDF reader with PyQt4 and python-popplerqt4. PDF pages (QPixmaps) are displayed into QLables, laid out vertically in a QFrame. The QFrame is placed into QScrollArea. QMainWindow |_ QScrollArea |_ QFrame (Document:…
neydroydrec
  • 6,973
  • 9
  • 57
  • 89
2
votes
2 answers

How to add a fixed header to a QScrollArea?

I currently have a QScrollArea defined by: self.results_grid_scrollarea = QScrollArea() self.results_grid_widget = QWidget() self.results_grid_layout =…
DazGreen
  • 23
  • 1
  • 4
2
votes
0 answers

Is there a non-fragile way to enforce a maximum window size based on the size of a QScrollArea's target widget?

I've got a Qt app with a window that contains a QScrollArea (plus a few small fixed-size controls around the borders, but window is mainly taken up by the QScrollArea). Inside the QScrollArea is a fixed-size view of various widgets that the user can…
Jeremy Friesner
  • 70,199
  • 15
  • 131
  • 234
2
votes
1 answer

Adding a QFrame to a QGridLayout that is inside a QScrollArea breaks scrolling

I'm working on a GUI that requires a scrollable QGridLayout based on the size of the window. My solution was to nest that within a QScrollArea. This works as long as I'm only adding standard widgets to the QGridLayout. When I switch to adding my…
2
votes
1 answer

Using QScrollArea collapses children widgets

I am trying to create a dynamic GUI with multiple Groupbox objects in a QVBoxLayout. As there are a lot of them, I will be needing a scroll area to make them available to the end user. So I tried to change to top widget of this tab from a QWidget to…
Jao
  • 558
  • 2
  • 12
2
votes
1 answer

Scroll to the bottom when adding an element to a QScrollArea

I have a QScrollArea and I would like when a I push my "Add" button that adds Widgets to the widgets contained in the QScrollArea for the scroll to scroll all the way to the bottom I made several attempts to Scroll to the bottomw ith code like …
Jim
  • 2,034
  • 2
  • 15
  • 29
2
votes
1 answer

How to use QScrollArea to make scrollbars appear

I am trying to create a scroll area with a vertical layout using pyqt5, and I am putting inside some labels. I know that even if it is a vertical layout it is supposed to scroll horizontally if the text does not fit. But no matter what I try it does…
Simon
  • 107
  • 9