File indexing completed on 2024-06-09 13:46:43

0001 /****************************************************************************
0002 **
0003 ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
0004 ** Contact: http://www.qt-project.org/legal
0005 **
0006 ** This file is part of the Qt3Support module of the Qt Toolkit.
0007 **
0008 ** $QT_BEGIN_LICENSE:LGPL$
0009 ** Commercial License Usage
0010 ** Licensees holding valid commercial Qt licenses may use this file in
0011 ** accordance with the commercial license agreement provided with the
0012 ** Software or, alternatively, in accordance with the terms contained in
0013 ** a written agreement between you and Digia.  For licensing terms and
0014 ** conditions see http://qt.digia.com/licensing.  For further information
0015 ** use the contact form at http://qt.digia.com/contact-us.
0016 **
0017 ** GNU Lesser General Public License Usage
0018 ** Alternatively, this file may be used under the terms of the GNU Lesser
0019 ** General Public License version 2.1 as published by the Free Software
0020 ** Foundation and appearing in the file LICENSE.LGPL included in the
0021 ** packaging of this file.  Please review the following information to
0022 ** ensure the GNU Lesser General Public License version 2.1 requirements
0023 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
0024 **
0025 ** In addition, as a special exception, Digia gives you certain additional
0026 ** rights.  These rights are described in the Digia Qt LGPL Exception
0027 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
0028 **
0029 ** GNU General Public License Usage
0030 ** Alternatively, this file may be used under the terms of the GNU
0031 ** General Public License version 3.0 as published by the Free Software
0032 ** Foundation and appearing in the file LICENSE.GPL included in the
0033 ** packaging of this file.  Please review the following information to
0034 ** ensure the GNU General Public License version 3.0 requirements will be
0035 ** met: http://www.gnu.org/copyleft/gpl.html.
0036 **
0037 **
0038 ** $QT_END_LICENSE$
0039 **
0040 ****************************************************************************/
0041 
0042 #ifndef KTL_Q3FRAME_H
0043 #define KTL_Q3FRAME_H
0044 
0045 #include <QFrame>
0046 
0047 // QT_BEGIN_HEADER
0048 
0049 // QT_BEGIN_NAMESPACE
0050 
0051 // QT_MODULE(Qt3SupportLight)
0052 
0053 class KtlQ3Frame : public QFrame
0054 {
0055     Q_OBJECT
0056     Q_PROPERTY(int margin READ margin WRITE setMargin)
0057     Q_PROPERTY(QRect contentsRect READ contentsRect)
0058 
0059 public:
0060     KtlQ3Frame(QWidget *parent, const char *name = nullptr, Qt::WindowFlags f = {});
0061     ~KtlQ3Frame() override;
0062 #ifndef qdoc
0063     bool lineShapesOk() const
0064     {
0065         return true;
0066     }
0067 #endif
0068 
0069     int margin() const
0070     {
0071         return marg;
0072     }
0073     void setMargin(int);
0074 
0075     QRect contentsRect() const;
0076     int frameWidth() const;
0077 
0078 protected:
0079     void paintEvent(QPaintEvent *) override;
0080     void resizeEvent(QResizeEvent *) override;
0081 
0082     virtual void frameChanged();
0083     virtual void drawFrame(QPainter *);
0084     virtual void drawContents(QPainter *);
0085 
0086 private:
0087     Q_DISABLE_COPY(KtlQ3Frame)
0088 
0089     int marg;
0090 };
0091 
0092 // QT_END_NAMESPACE
0093 
0094 // QT_END_HEADER
0095 
0096 #endif // KTL_Q3FRAME_H