Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-20 09:24:01

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 // Qt-Security score:significant reason:default
0004 
0005 #ifndef QFRAME_H
0006 #define QFRAME_H
0007 
0008 #include <QtWidgets/qtwidgetsglobal.h>
0009 #include <QtWidgets/qwidget.h>
0010 
0011 QT_BEGIN_NAMESPACE
0012 
0013 
0014 class QFramePrivate;
0015 class QStyleOptionFrame;
0016 
0017 class Q_WIDGETS_EXPORT QFrame : public QWidget
0018 {
0019     Q_OBJECT
0020 
0021     Q_PROPERTY(Shape frameShape READ frameShape WRITE setFrameShape)
0022     Q_PROPERTY(Shadow frameShadow READ frameShadow WRITE setFrameShadow)
0023     Q_PROPERTY(int lineWidth READ lineWidth WRITE setLineWidth)
0024     Q_PROPERTY(int midLineWidth READ midLineWidth WRITE setMidLineWidth)
0025     Q_PROPERTY(int frameWidth READ frameWidth)
0026     Q_PROPERTY(QRect frameRect READ frameRect WRITE setFrameRect DESIGNABLE false)
0027 
0028 public:
0029     explicit QFrame(QWidget* parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
0030     ~QFrame();
0031 
0032     int frameStyle() const;
0033     void setFrameStyle(int);
0034 
0035     int frameWidth() const;
0036 
0037     QSize sizeHint() const override;
0038 
0039     enum Shape {
0040         NoFrame  = 0, // no frame
0041         Box = 0x0001, // rectangular box
0042         Panel = 0x0002, // rectangular panel
0043         WinPanel = 0x0003, // rectangular panel (Windows)
0044         HLine = 0x0004, // horizontal line
0045         VLine = 0x0005, // vertical line
0046         StyledPanel = 0x0006 // rectangular panel depending on the GUI style
0047     };
0048     Q_ENUM(Shape)
0049     enum Shadow {
0050         Plain = 0x0010, // plain line
0051         Raised = 0x0020, // raised shadow effect
0052         Sunken = 0x0030 // sunken shadow effect
0053     };
0054     Q_ENUM(Shadow)
0055 
0056     enum StyleMask {
0057         Shadow_Mask = 0x00f0, // mask for the shadow
0058         Shape_Mask = 0x000f // mask for the shape
0059     };
0060 
0061     Shape frameShape() const;
0062     void setFrameShape(Shape);
0063     Shadow frameShadow() const;
0064     void setFrameShadow(Shadow);
0065 
0066     int lineWidth() const;
0067     void setLineWidth(int);
0068 
0069     int midLineWidth() const;
0070     void setMidLineWidth(int);
0071 
0072     QRect frameRect() const;
0073     void setFrameRect(const QRect &);
0074 
0075 protected:
0076     bool event(QEvent *e) override;
0077     void paintEvent(QPaintEvent *) override;
0078     void changeEvent(QEvent *) override;
0079     void drawFrame(QPainter *);
0080 
0081 
0082 protected:
0083     QFrame(QFramePrivate &dd, QWidget* parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
0084     virtual void initStyleOption(QStyleOptionFrame *option) const;
0085 
0086 private:
0087     Q_DISABLE_COPY(QFrame)
0088     Q_DECLARE_PRIVATE(QFrame)
0089 };
0090 
0091 Q_DECLARE_MIXED_ENUM_OPERATORS_SYMMETRIC(int, QFrame::Shape, QFrame::Shadow)
0092 
0093 QT_END_NAMESPACE
0094 
0095 #endif // QFRAME_H