Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/QtWidgets/qabstractscrollarea.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 QABSTRACTSCROLLAREA_H
0005 #define QABSTRACTSCROLLAREA_H
0006 
0007 #include <QtWidgets/qtwidgetsglobal.h>
0008 #include <QtWidgets/qframe.h>
0009 
0010 QT_BEGIN_NAMESPACE
0011 
0012 
0013 #if QT_CONFIG(scrollarea)
0014 
0015 class QMargins;
0016 class QScrollBar;
0017 class QAbstractScrollAreaPrivate;
0018 
0019 class Q_WIDGETS_EXPORT QAbstractScrollArea : public QFrame
0020 {
0021     Q_OBJECT
0022 
0023     Q_PROPERTY(Qt::ScrollBarPolicy verticalScrollBarPolicy READ verticalScrollBarPolicy
0024                WRITE setVerticalScrollBarPolicy)
0025     Q_PROPERTY(Qt::ScrollBarPolicy horizontalScrollBarPolicy READ horizontalScrollBarPolicy
0026                WRITE setHorizontalScrollBarPolicy)
0027     Q_PROPERTY(SizeAdjustPolicy sizeAdjustPolicy READ sizeAdjustPolicy WRITE setSizeAdjustPolicy)
0028 
0029 public:
0030     explicit QAbstractScrollArea(QWidget *parent = nullptr);
0031     ~QAbstractScrollArea();
0032 
0033     enum SizeAdjustPolicy {
0034         AdjustIgnored,
0035         AdjustToContentsOnFirstShow,
0036         AdjustToContents
0037     };
0038     Q_ENUM(SizeAdjustPolicy)
0039 
0040     Qt::ScrollBarPolicy verticalScrollBarPolicy() const;
0041     void setVerticalScrollBarPolicy(Qt::ScrollBarPolicy);
0042     QScrollBar *verticalScrollBar() const;
0043     void setVerticalScrollBar(QScrollBar *scrollbar);
0044 
0045     Qt::ScrollBarPolicy horizontalScrollBarPolicy() const;
0046     void setHorizontalScrollBarPolicy(Qt::ScrollBarPolicy);
0047     QScrollBar *horizontalScrollBar() const;
0048     void setHorizontalScrollBar(QScrollBar *scrollbar);
0049 
0050     QWidget *cornerWidget() const;
0051     void setCornerWidget(QWidget *widget);
0052 
0053     void addScrollBarWidget(QWidget *widget, Qt::Alignment alignment);
0054     QWidgetList scrollBarWidgets(Qt::Alignment alignment);
0055 
0056     QWidget *viewport() const;
0057     void setViewport(QWidget *widget);
0058     QSize maximumViewportSize() const;
0059 
0060     QSize minimumSizeHint() const override;
0061 
0062     QSize sizeHint() const override;
0063 
0064     virtual void setupViewport(QWidget *viewport);
0065 
0066     SizeAdjustPolicy sizeAdjustPolicy() const;
0067     void setSizeAdjustPolicy(SizeAdjustPolicy policy);
0068 
0069 protected:
0070     QAbstractScrollArea(QAbstractScrollAreaPrivate &dd, QWidget *parent = nullptr);
0071     void setViewportMargins(int left, int top, int right, int bottom);
0072     void setViewportMargins(const QMargins &margins);
0073     QMargins viewportMargins() const;
0074 
0075     bool eventFilter(QObject *, QEvent *) override;
0076     bool event(QEvent *) override;
0077     virtual bool viewportEvent(QEvent *);
0078 
0079     void resizeEvent(QResizeEvent *) override;
0080     void paintEvent(QPaintEvent *) override;
0081     void mousePressEvent(QMouseEvent *) override;
0082     void mouseReleaseEvent(QMouseEvent *) override;
0083     void mouseDoubleClickEvent(QMouseEvent *) override;
0084     void mouseMoveEvent(QMouseEvent *) override;
0085 #if QT_CONFIG(wheelevent)
0086     void wheelEvent(QWheelEvent *) override;
0087 #endif
0088 #ifndef QT_NO_CONTEXTMENU
0089     void contextMenuEvent(QContextMenuEvent *) override;
0090 #endif
0091 #if QT_CONFIG(draganddrop)
0092     void dragEnterEvent(QDragEnterEvent *) override;
0093     void dragMoveEvent(QDragMoveEvent *) override;
0094     void dragLeaveEvent(QDragLeaveEvent *) override;
0095     void dropEvent(QDropEvent *) override;
0096 #endif
0097 
0098     void keyPressEvent(QKeyEvent *) override;
0099 
0100     virtual void scrollContentsBy(int dx, int dy);
0101 
0102     virtual QSize viewportSizeHint() const;
0103 
0104 private:
0105     Q_DECLARE_PRIVATE(QAbstractScrollArea)
0106     Q_DISABLE_COPY(QAbstractScrollArea)
0107     Q_PRIVATE_SLOT(d_func(), void _q_hslide(int))
0108     Q_PRIVATE_SLOT(d_func(), void _q_vslide(int))
0109     Q_PRIVATE_SLOT(d_func(), void _q_showOrHideScrollBars())
0110 
0111     friend class QStyleSheetStyle;
0112     friend class QWidgetPrivate;
0113 };
0114 
0115 #endif // QT_CONFIG(scrollarea)
0116 
0117 QT_END_NAMESPACE
0118 
0119 #endif // QABSTRACTSCROLLAREA_H