Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/QtWidgets/qscrollarea.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // Copyright (C) 2016 The Qt Company Ltd.
0002 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
0003 
0004 #ifndef QSCROLLAREA_H
0005 #define QSCROLLAREA_H
0006 
0007 #include <QtWidgets/qtwidgetsglobal.h>
0008 #include <QtWidgets/qabstractscrollarea.h>
0009 
0010 QT_REQUIRE_CONFIG(scrollarea);
0011 
0012 QT_BEGIN_NAMESPACE
0013 
0014 class QScrollAreaPrivate;
0015 
0016 class Q_WIDGETS_EXPORT QScrollArea : public QAbstractScrollArea
0017 {
0018     Q_OBJECT
0019     Q_PROPERTY(bool widgetResizable READ widgetResizable WRITE setWidgetResizable)
0020     Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment)
0021 
0022 public:
0023     explicit QScrollArea(QWidget *parent = nullptr);
0024     ~QScrollArea();
0025 
0026     QWidget *widget() const;
0027     void setWidget(QWidget *widget);
0028     QWidget *takeWidget();
0029 
0030     bool widgetResizable() const;
0031     void setWidgetResizable(bool resizable);
0032 
0033     QSize sizeHint() const override;
0034 
0035     bool focusNextPrevChild(bool next) override;
0036 
0037     Qt::Alignment alignment() const;
0038     void setAlignment(Qt::Alignment);
0039 
0040     void ensureVisible(int x, int y, int xmargin = 50, int ymargin = 50);
0041     void ensureWidgetVisible(QWidget *childWidget, int xmargin = 50, int ymargin = 50);
0042 
0043 protected:
0044     QScrollArea(QScrollAreaPrivate &dd, QWidget *parent = nullptr);
0045     bool event(QEvent *) override;
0046     bool eventFilter(QObject *, QEvent *) override;
0047     void resizeEvent(QResizeEvent *) override;
0048     void scrollContentsBy(int dx, int dy) override;
0049 
0050     QSize viewportSizeHint() const override;
0051 
0052 private:
0053     Q_DECLARE_PRIVATE(QScrollArea)
0054     Q_DISABLE_COPY(QScrollArea)
0055 };
0056 
0057 QT_END_NAMESPACE
0058 
0059 #endif // QSCROLLAREA_H