2022-06-07 11:55:27 +00:00
|
|
|
// Copyright (C) 2015 The Qt Company Ltd.
|
2024-03-15 08:19:25 +00:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
#ifndef AX2_H
|
|
|
|
#define AX2_H
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
#include <QPainter>
|
|
|
|
|
|
|
|
//! [0]
|
|
|
|
class QAxWidget2 : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
Q_CLASSINFO("ClassID", "{58139D56-6BE9-4b17-937D-1B1EDEDD5B71}")
|
|
|
|
Q_CLASSINFO("InterfaceID", "{B66280AB-08CC-4dcc-924F-58E6D7975B7D}")
|
|
|
|
Q_CLASSINFO("EventsID", "{D72BACBA-03C4-4480-B4BB-DE4FE3AA14A0}")
|
|
|
|
Q_CLASSINFO("ToSuperClass", "QAxWidget2")
|
|
|
|
Q_CLASSINFO("StockEvents", "yes")
|
|
|
|
Q_CLASSINFO("Insertable", "yes")
|
|
|
|
|
2017-08-21 11:23:48 +00:00
|
|
|
Q_PROPERTY(int lineWidth READ lineWidth WRITE setLineWidth)
|
2011-04-27 10:05:43 +00:00
|
|
|
public:
|
2019-06-04 12:31:18 +00:00
|
|
|
using QWidget::QWidget;
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
int lineWidth() const
|
|
|
|
{
|
2017-08-21 11:23:48 +00:00
|
|
|
return m_lineWidth;
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
2017-08-21 11:23:48 +00:00
|
|
|
|
|
|
|
void setLineWidth(int lw)
|
2011-04-27 10:05:43 +00:00
|
|
|
{
|
2017-08-21 11:23:48 +00:00
|
|
|
m_lineWidth = lw;
|
2014-01-15 21:17:52 +00:00
|
|
|
repaint();
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
protected:
|
2019-06-04 13:24:37 +00:00
|
|
|
void paintEvent(QPaintEvent *e) override
|
2011-04-27 10:05:43 +00:00
|
|
|
{
|
2017-08-21 11:23:48 +00:00
|
|
|
QPainter paint(this);
|
2014-01-15 21:17:52 +00:00
|
|
|
QPen pen = paint.pen();
|
2017-08-21 11:23:48 +00:00
|
|
|
pen.setWidth(m_lineWidth);
|
|
|
|
paint.setPen(pen);
|
2011-04-27 10:05:43 +00:00
|
|
|
|
2014-01-15 21:17:52 +00:00
|
|
|
QRect r = rect();
|
2017-08-21 11:23:48 +00:00
|
|
|
r.adjust(10, 10, -10, -10);
|
|
|
|
paint.drawEllipse(r);
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
2019-06-04 12:31:18 +00:00
|
|
|
int m_lineWidth = 1;
|
2011-04-27 10:05:43 +00:00
|
|
|
};
|
|
|
|
//! [0]
|
|
|
|
|
|
|
|
#endif // AX2_H
|