diff options
author | Liang Qi <liang.qi@qt.io> | 2017-10-30 08:42:53 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2017-10-30 08:48:01 +0100 |
commit | c9acfe0bc8dbaec1065614fa2039ebe7e05b4bda (patch) | |
tree | 6ced392965bf01be840da14e7f1606b0b5b2293d /examples/activeqt/multiple/ax2.h | |
parent | f263d206341472e23e0e1ad536faa1b0a22286c0 (diff) | |
parent | cacf666f95df9790cebf5d5cdb0609cee257fab3 (diff) |
Merge remote-tracking branch 'origin/5.9' into 5.10v5.10.0-beta4
Conflicts:
.qmake.conf
Change-Id: Ie457478a64a28434afb3361dfc6f9478dd9c58bd
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] |