A<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://www.cppe.ru/index.php?action=history&amp;feed=atom&amp;title=C%2B%2B%2FQt%2FQStyle</id>
		<title>C++/Qt/QStyle - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://www.cppe.ru/index.php?action=history&amp;feed=atom&amp;title=C%2B%2B%2FQt%2FQStyle"/>
		<link rel="alternate" type="text/html" href="http://www.cppe.ru/index.php?title=C%2B%2B/Qt/QStyle&amp;action=history"/>
		<updated>2026-04-18T22:13:47Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://www.cppe.ru/index.php?title=C%2B%2B/Qt/QStyle&amp;diff=1214&amp;oldid=prev</id>
		<title> в 14:21, 25 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://www.cppe.ru/index.php?title=C%2B%2B/Qt/QStyle&amp;diff=1214&amp;oldid=prev"/>
				<updated>2010-05-25T14:21:06Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 14:21, 25 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://www.cppe.ru/index.php?title=C%2B%2B/Qt/QStyle&amp;diff=1215&amp;oldid=prev</id>
		<title>Admin: 1 версия:&amp;#32;Импорт контента...</title>
		<link rel="alternate" type="text/html" href="http://www.cppe.ru/index.php?title=C%2B%2B/Qt/QStyle&amp;diff=1215&amp;oldid=prev"/>
				<updated>2010-05-25T10:25:10Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия: Импорт контента...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==extends QStyle==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;  &lt;br /&gt;
/****************************************************************************&lt;br /&gt;
**&lt;br /&gt;
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).&lt;br /&gt;
** All rights reserved.&lt;br /&gt;
** Contact: Nokia Corporation (qt-info@nokia.com)&lt;br /&gt;
**&lt;br /&gt;
** This file is part of the documentation of the Qt Toolkit.&lt;br /&gt;
**&lt;br /&gt;
** $QT_BEGIN_LICENSE:LGPL$&lt;br /&gt;
** Commercial Usage&lt;br /&gt;
** Licensees holding valid Qt Commercial licenses may use this file in&lt;br /&gt;
** accordance with the Qt Commercial License Agreement provided with the&lt;br /&gt;
** Software or, alternatively, in accordance with the terms contained in&lt;br /&gt;
** a written agreement between you and Nokia.&lt;br /&gt;
**&lt;br /&gt;
** GNU Lesser General Public License Usage&lt;br /&gt;
** Alternatively, this file may be used under the terms of the GNU Lesser&lt;br /&gt;
** General Public License version 2.1 as published by the Free Software&lt;br /&gt;
** Foundation and appearing in the file LICENSE.LGPL included in the&lt;br /&gt;
** packaging of this file.  Please review the following information to&lt;br /&gt;
** ensure the GNU Lesser General Public License version 2.1 requirements&lt;br /&gt;
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.&lt;br /&gt;
**&lt;br /&gt;
** In addition, as a special exception, Nokia gives you certain additional&lt;br /&gt;
** rights.  These rights are described in the Nokia Qt LGPL Exception&lt;br /&gt;
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.&lt;br /&gt;
**&lt;br /&gt;
** GNU General Public License Usage&lt;br /&gt;
** Alternatively, this file may be used under the terms of the GNU&lt;br /&gt;
** General Public License version 3.0 as published by the Free Software&lt;br /&gt;
** Foundation and appearing in the file LICENSE.GPL included in the&lt;br /&gt;
** packaging of this file.  Please review the following information to&lt;br /&gt;
** ensure the GNU General Public License version 3.0 requirements will be&lt;br /&gt;
** met: http://www.gnu.org/copyleft/gpl.html.&lt;br /&gt;
**&lt;br /&gt;
** If you have questions regarding the use of this file, please contact&lt;br /&gt;
** Nokia at qt-info@nokia.com.&lt;br /&gt;
** $QT_END_LICENSE$&lt;br /&gt;
**&lt;br /&gt;
****************************************************************************/&lt;br /&gt;
#include &amp;lt;QtGui&amp;gt;&lt;br /&gt;
#include &amp;lt;QApplication&amp;gt;&lt;br /&gt;
class MyPushButton : public QPushButton&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
    MyPushButton(QWidget *parent = 0);&lt;br /&gt;
    void paintEvent(QPaintEvent *);&lt;br /&gt;
};&lt;br /&gt;
MyPushButton::MyPushButton(QWidget *parent)&lt;br /&gt;
    : QPushButton(parent)&lt;br /&gt;
{&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void MyPushButton::paintEvent(QPaintEvent *)&lt;br /&gt;
{&lt;br /&gt;
    QStyleOptionButton option;&lt;br /&gt;
    option.initFrom(this);&lt;br /&gt;
    option.state = isDown() ? QStyle::State_Sunken : QStyle::State_Raised;&lt;br /&gt;
    if (isDefault())&lt;br /&gt;
        option.features |= QStyleOptionButton::DefaultButton;&lt;br /&gt;
    option.text = text();&lt;br /&gt;
    option.icon = icon();&lt;br /&gt;
    QPainter painter(this);&lt;br /&gt;
    style()-&amp;gt;drawControl(QStyle::CE_PushButton, &amp;amp;option, &amp;amp;painter, this);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
class MyStyle : public QStyle&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
    MyStyle();&lt;br /&gt;
    void drawPrimitive(PrimitiveElement element, const QStyleOption *option,&lt;br /&gt;
                       QPainter *painter, const QWidget *widget);&lt;br /&gt;
};&lt;br /&gt;
MyStyle::MyStyle()&lt;br /&gt;
{&lt;br /&gt;
    QStyleOptionFrame *option;&lt;br /&gt;
    if (const QStyleOptionFrame *frameOption =&lt;br /&gt;
           qstyleoption_cast&amp;lt;const QStyleOptionFrame *&amp;gt;(option)) {&lt;br /&gt;
        QStyleOptionFrameV2 frameOptionV2(*frameOption);&lt;br /&gt;
        // draw the frame using frameOptionV2&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (const QStyleOptionProgressBar *progressBarOption =&lt;br /&gt;
           qstyleoption_cast&amp;lt;const QStyleOptionProgressBar *&amp;gt;(option)) {&lt;br /&gt;
        QStyleOptionProgressBarV2 progressBarV2(*progressBarOption);&lt;br /&gt;
        // draw the progress bar using progressBarV2&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (const QStyleOptionTab *tabOption =&lt;br /&gt;
           qstyleoption_cast&amp;lt;const QStyleOptionTab *&amp;gt;(option)) {&lt;br /&gt;
        QStyleOptionTabV2 tabV2(*tabOption);&lt;br /&gt;
        // draw the tab using tabV2&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void MyStyle::drawPrimitive(PrimitiveElement element,&lt;br /&gt;
                            const QStyleOption *option,&lt;br /&gt;
                            QPainter *painter,&lt;br /&gt;
                            const QWidget *widget)&lt;br /&gt;
{&lt;br /&gt;
    if (element == PE_FrameFocusRect) {&lt;br /&gt;
        const QStyleOptionFocusRect *focusRectOption =&lt;br /&gt;
                qstyleoption_cast&amp;lt;const QStyleOptionFocusRect *&amp;gt;(option);&lt;br /&gt;
        if (focusRectOption) {&lt;br /&gt;
            // ...&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    // ...&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
    QApplication app(argc, argv);&lt;br /&gt;
    MyPushButton button;&lt;br /&gt;
    button.show();&lt;br /&gt;
    return app.exec();&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==extends QStylePlugin==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;  &lt;br /&gt;
/****************************************************************************&lt;br /&gt;
**&lt;br /&gt;
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).&lt;br /&gt;
** All rights reserved.&lt;br /&gt;
** Contact: Nokia Corporation (qt-info@nokia.com)&lt;br /&gt;
**&lt;br /&gt;
** This file is part of the documentation of the Qt Toolkit.&lt;br /&gt;
**&lt;br /&gt;
** $QT_BEGIN_LICENSE:LGPL$&lt;br /&gt;
** Commercial Usage&lt;br /&gt;
** Licensees holding valid Qt Commercial licenses may use this file in&lt;br /&gt;
** accordance with the Qt Commercial License Agreement provided with the&lt;br /&gt;
** Software or, alternatively, in accordance with the terms contained in&lt;br /&gt;
** a written agreement between you and Nokia.&lt;br /&gt;
**&lt;br /&gt;
** GNU Lesser General Public License Usage&lt;br /&gt;
** Alternatively, this file may be used under the terms of the GNU Lesser&lt;br /&gt;
** General Public License version 2.1 as published by the Free Software&lt;br /&gt;
** Foundation and appearing in the file LICENSE.LGPL included in the&lt;br /&gt;
** packaging of this file.  Please review the following information to&lt;br /&gt;
** ensure the GNU Lesser General Public License version 2.1 requirements&lt;br /&gt;
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.&lt;br /&gt;
**&lt;br /&gt;
** In addition, as a special exception, Nokia gives you certain additional&lt;br /&gt;
** rights.  These rights are described in the Nokia Qt LGPL Exception&lt;br /&gt;
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.&lt;br /&gt;
**&lt;br /&gt;
** GNU General Public License Usage&lt;br /&gt;
** Alternatively, this file may be used under the terms of the GNU&lt;br /&gt;
** General Public License version 3.0 as published by the Free Software&lt;br /&gt;
** Foundation and appearing in the file LICENSE.GPL included in the&lt;br /&gt;
** packaging of this file.  Please review the following information to&lt;br /&gt;
** ensure the GNU General Public License version 3.0 requirements will be&lt;br /&gt;
** met: http://www.gnu.org/copyleft/gpl.html.&lt;br /&gt;
**&lt;br /&gt;
** If you have questions regarding the use of this file, please contact&lt;br /&gt;
** Nokia at qt-info@nokia.com.&lt;br /&gt;
** $QT_END_LICENSE$&lt;br /&gt;
**&lt;br /&gt;
****************************************************************************/&lt;br /&gt;
#include &amp;lt;QApplication&amp;gt;&lt;br /&gt;
#include &amp;lt;QtGui&amp;gt;&lt;br /&gt;
class MyStylePlugin : public QStylePlugin&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
    MyStylePlugin(QObject *parent = 0);&lt;br /&gt;
    QStyle *create(const QString &amp;amp;key);&lt;br /&gt;
    QStringList keys() const;&lt;br /&gt;
};&lt;br /&gt;
class RocketStyle : public QCommonStyle&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
    RocketStyle() {};&lt;br /&gt;
};&lt;br /&gt;
class StarBusterStyle : public QCommonStyle&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
    StarBusterStyle() {};&lt;br /&gt;
};&lt;br /&gt;
MyStylePlugin::MyStylePlugin(QObject *parent)&lt;br /&gt;
    : QStylePlugin(parent)&lt;br /&gt;
{&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
QStringList MyStylePlugin::keys() const&lt;br /&gt;
{&lt;br /&gt;
    return QStringList() &amp;lt;&amp;lt; &amp;quot;Rocket&amp;quot; &amp;lt;&amp;lt; &amp;quot;StarBuster&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
QStyle *MyStylePlugin::create(const QString &amp;amp;key)&lt;br /&gt;
{&lt;br /&gt;
    QString lcKey = key;&lt;br /&gt;
    if (lcKey == &amp;quot;rocket&amp;quot;) {&lt;br /&gt;
        return new RocketStyle;&lt;br /&gt;
    } else if (lcKey == &amp;quot;starbuster&amp;quot;) {&lt;br /&gt;
        return new StarBusterStyle;&lt;br /&gt;
    }&lt;br /&gt;
    return 0;&lt;br /&gt;
 &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
    QApplication app(argc, argv);&lt;br /&gt;
    MyStylePlugin plugin;&lt;br /&gt;
    return app.exec();&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==QStyleOptionFocusRect and QStyle::PE_FrameFocusRect==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;  &lt;br /&gt;
/****************************************************************************&lt;br /&gt;
**&lt;br /&gt;
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).&lt;br /&gt;
** All rights reserved.&lt;br /&gt;
** Contact: Nokia Corporation (qt-info@nokia.com)&lt;br /&gt;
**&lt;br /&gt;
** This file is part of the documentation of the Qt Toolkit.&lt;br /&gt;
**&lt;br /&gt;
** $QT_BEGIN_LICENSE:LGPL$&lt;br /&gt;
** Commercial Usage&lt;br /&gt;
** Licensees holding valid Qt Commercial licenses may use this file in&lt;br /&gt;
** accordance with the Qt Commercial License Agreement provided with the&lt;br /&gt;
** Software or, alternatively, in accordance with the terms contained in&lt;br /&gt;
** a written agreement between you and Nokia.&lt;br /&gt;
**&lt;br /&gt;
** GNU Lesser General Public License Usage&lt;br /&gt;
** Alternatively, this file may be used under the terms of the GNU Lesser&lt;br /&gt;
** General Public License version 2.1 as published by the Free Software&lt;br /&gt;
** Foundation and appearing in the file LICENSE.LGPL included in the&lt;br /&gt;
** packaging of this file.  Please review the following information to&lt;br /&gt;
** ensure the GNU Lesser General Public License version 2.1 requirements&lt;br /&gt;
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.&lt;br /&gt;
**&lt;br /&gt;
** In addition, as a special exception, Nokia gives you certain additional&lt;br /&gt;
** rights.  These rights are described in the Nokia Qt LGPL Exception&lt;br /&gt;
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.&lt;br /&gt;
**&lt;br /&gt;
** GNU General Public License Usage&lt;br /&gt;
** Alternatively, this file may be used under the terms of the GNU&lt;br /&gt;
** General Public License version 3.0 as published by the Free Software&lt;br /&gt;
** Foundation and appearing in the file LICENSE.GPL included in the&lt;br /&gt;
** packaging of this file.  Please review the following information to&lt;br /&gt;
** ensure the GNU General Public License version 3.0 requirements will be&lt;br /&gt;
** met: http://www.gnu.org/copyleft/gpl.html.&lt;br /&gt;
**&lt;br /&gt;
** If you have questions regarding the use of this file, please contact&lt;br /&gt;
** Nokia at qt-info@nokia.com.&lt;br /&gt;
** $QT_END_LICENSE$&lt;br /&gt;
**&lt;br /&gt;
****************************************************************************/&lt;br /&gt;
#include &amp;lt;QStyleOption&amp;gt;&lt;br /&gt;
#include &amp;lt;QStylePainter&amp;gt;&lt;br /&gt;
#include &amp;lt;QWidget&amp;gt;&lt;br /&gt;
class MyWidget : public QWidget&lt;br /&gt;
{&lt;br /&gt;
protected:&lt;br /&gt;
    void paintEvent(QPaintEvent *event);&lt;br /&gt;
    void paintEvent2(QPaintEvent *event);&lt;br /&gt;
};&lt;br /&gt;
 &lt;br /&gt;
void MyWidget::paintEvent(QPaintEvent * /* event */)&lt;br /&gt;
{&lt;br /&gt;
    QPainter painter(this);&lt;br /&gt;
&lt;br /&gt;
    QStyleOptionFocusRect option;&lt;br /&gt;
    option.initFrom(this);&lt;br /&gt;
    option.backgroundColor = palette().color(QPalette::Background);&lt;br /&gt;
&lt;br /&gt;
    style()-&amp;gt;drawPrimitive(QStyle::PE_FrameFocusRect, &amp;amp;option, &amp;amp;painter, this);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void MyWidget::paintEvent2(QPaintEvent * /* event */)&lt;br /&gt;
{&lt;br /&gt;
  &lt;br /&gt;
    QStylePainter painter(this);&lt;br /&gt;
&lt;br /&gt;
    QStyleOptionFocusRect option;&lt;br /&gt;
    option.initFrom(this);&lt;br /&gt;
    option.backgroundColor = palette().color(QPalette::Background);&lt;br /&gt;
&lt;br /&gt;
    painter.drawPrimitive(QStyle::PE_FrameFocusRect, option);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main()&lt;br /&gt;
{&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==QStyle options==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;  &lt;br /&gt;
/****************************************************************************&lt;br /&gt;
**&lt;br /&gt;
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).&lt;br /&gt;
** All rights reserved.&lt;br /&gt;
** Contact: Nokia Corporation (qt-info@nokia.com)&lt;br /&gt;
**&lt;br /&gt;
** This file is part of the documentation of the Qt Toolkit.&lt;br /&gt;
**&lt;br /&gt;
** $QT_BEGIN_LICENSE:LGPL$&lt;br /&gt;
** Commercial Usage&lt;br /&gt;
** Licensees holding valid Qt Commercial licenses may use this file in&lt;br /&gt;
** accordance with the Qt Commercial License Agreement provided with the&lt;br /&gt;
** Software or, alternatively, in accordance with the terms contained in&lt;br /&gt;
** a written agreement between you and Nokia.&lt;br /&gt;
**&lt;br /&gt;
** GNU Lesser General Public License Usage&lt;br /&gt;
** Alternatively, this file may be used under the terms of the GNU Lesser&lt;br /&gt;
** General Public License version 2.1 as published by the Free Software&lt;br /&gt;
** Foundation and appearing in the file LICENSE.LGPL included in the&lt;br /&gt;
** packaging of this file.  Please review the following information to&lt;br /&gt;
** ensure the GNU Lesser General Public License version 2.1 requirements&lt;br /&gt;
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.&lt;br /&gt;
**&lt;br /&gt;
** In addition, as a special exception, Nokia gives you certain additional&lt;br /&gt;
** rights.  These rights are described in the Nokia Qt LGPL Exception&lt;br /&gt;
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.&lt;br /&gt;
**&lt;br /&gt;
** GNU General Public License Usage&lt;br /&gt;
** Alternatively, this file may be used under the terms of the GNU&lt;br /&gt;
** General Public License version 3.0 as published by the Free Software&lt;br /&gt;
** Foundation and appearing in the file LICENSE.GPL included in the&lt;br /&gt;
** packaging of this file.  Please review the following information to&lt;br /&gt;
** ensure the GNU General Public License version 3.0 requirements will be&lt;br /&gt;
** met: http://www.gnu.org/copyleft/gpl.html.&lt;br /&gt;
**&lt;br /&gt;
** If you have questions regarding the use of this file, please contact&lt;br /&gt;
** Nokia at qt-info@nokia.com.&lt;br /&gt;
** $QT_END_LICENSE$&lt;br /&gt;
**&lt;br /&gt;
****************************************************************************/&lt;br /&gt;
#include &amp;lt;QtGui&amp;gt;&lt;br /&gt;
#include &amp;lt;QApplication&amp;gt;&lt;br /&gt;
class MyPushButton : public QPushButton&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
    MyPushButton(QWidget *parent = 0);&lt;br /&gt;
    void paintEvent(QPaintEvent *);&lt;br /&gt;
};&lt;br /&gt;
MyPushButton::MyPushButton(QWidget *parent)&lt;br /&gt;
    : QPushButton(parent)&lt;br /&gt;
{&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void MyPushButton::paintEvent(QPaintEvent *)&lt;br /&gt;
{&lt;br /&gt;
    QStyleOptionButton option;&lt;br /&gt;
    option.initFrom(this);&lt;br /&gt;
    option.state = isDown() ? QStyle::State_Sunken : QStyle::State_Raised;&lt;br /&gt;
    if (isDefault())&lt;br /&gt;
        option.features |= QStyleOptionButton::DefaultButton;&lt;br /&gt;
    option.text = text();&lt;br /&gt;
    option.icon = icon();&lt;br /&gt;
    QPainter painter(this);&lt;br /&gt;
    style()-&amp;gt;drawControl(QStyle::CE_PushButton, &amp;amp;option, &amp;amp;painter, this);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
class MyStyle : public QStyle&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
    MyStyle();&lt;br /&gt;
    void drawPrimitive(PrimitiveElement element, const QStyleOption *option,&lt;br /&gt;
                       QPainter *painter, const QWidget *widget);&lt;br /&gt;
};&lt;br /&gt;
MyStyle::MyStyle()&lt;br /&gt;
{&lt;br /&gt;
    QStyleOptionFrame *option;&lt;br /&gt;
    if (const QStyleOptionFrame *frameOption =&lt;br /&gt;
           qstyleoption_cast&amp;lt;const QStyleOptionFrame *&amp;gt;(option)) {&lt;br /&gt;
        QStyleOptionFrameV2 frameOptionV2(*frameOption);&lt;br /&gt;
        // draw the frame using frameOptionV2&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (const QStyleOptionProgressBar *progressBarOption =&lt;br /&gt;
           qstyleoption_cast&amp;lt;const QStyleOptionProgressBar *&amp;gt;(option)) {&lt;br /&gt;
        QStyleOptionProgressBarV2 progressBarV2(*progressBarOption);&lt;br /&gt;
        // draw the progress bar using progressBarV2&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (const QStyleOptionTab *tabOption =&lt;br /&gt;
           qstyleoption_cast&amp;lt;const QStyleOptionTab *&amp;gt;(option)) {&lt;br /&gt;
        QStyleOptionTabV2 tabV2(*tabOption);&lt;br /&gt;
        // draw the tab using tabV2&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void MyStyle::drawPrimitive(PrimitiveElement element,&lt;br /&gt;
                            const QStyleOption *option,&lt;br /&gt;
                            QPainter *painter,&lt;br /&gt;
                            const QWidget *widget)&lt;br /&gt;
{&lt;br /&gt;
    if (element == PE_FrameFocusRect) {&lt;br /&gt;
        const QStyleOptionFocusRect *focusRectOption =&lt;br /&gt;
                qstyleoption_cast&amp;lt;const QStyleOptionFocusRect *&amp;gt;(option);&lt;br /&gt;
        if (focusRectOption) {&lt;br /&gt;
            // ...&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    // ...&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
    QApplication app(argc, argv);&lt;br /&gt;
    MyPushButton button;&lt;br /&gt;
    button.show();&lt;br /&gt;
    return app.exec();&lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>