diff options
Diffstat (limited to 'examples/activeqt/multiple/ax2.h')
-rw-r--r-- | examples/activeqt/multiple/ax2.h | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/examples/activeqt/multiple/ax2.h b/examples/activeqt/multiple/ax2.h index 8b04653..1e1b312 100644 --- a/examples/activeqt/multiple/ax2.h +++ b/examples/activeqt/multiple/ax2.h @@ -6,7 +6,17 @@ ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -55,38 +65,39 @@ class QAxWidget2 : public QWidget Q_CLASSINFO("StockEvents", "yes") Q_CLASSINFO("Insertable", "yes") - Q_PROPERTY( int lineWidth READ lineWidth WRITE setLineWidth ) + Q_PROPERTY(int lineWidth READ lineWidth WRITE setLineWidth) public: - QAxWidget2(QWidget *parent = 0) - : QWidget(parent), line_width( 1 ) + explicit QAxWidget2(QWidget *parent = nullptr) + : QWidget(parent), m_lineWidth(1) { } int lineWidth() const { - return line_width; + return m_lineWidth; } - void setLineWidth( int lw ) + + void setLineWidth(int lw) { - line_width = lw; + m_lineWidth = lw; repaint(); } protected: - void paintEvent( QPaintEvent *e ) + void paintEvent(QPaintEvent *e) { - QPainter paint( this ); + QPainter paint(this); QPen pen = paint.pen(); - pen.setWidth( line_width ); - paint.setPen( pen ); + pen.setWidth(m_lineWidth); + paint.setPen(pen); QRect r = rect(); - r.adjust( 10, 10, -10, -10 ); - paint.drawEllipse( r ); + r.adjust(10, 10, -10, -10); + paint.drawEllipse(r); } private: - int line_width; + int m_lineWidth; }; //! [0] |