diff options
Diffstat (limited to 'Swift/QtUI/QtVCardWidget/QtCloseButton.cpp')
-rw-r--r-- | Swift/QtUI/QtVCardWidget/QtCloseButton.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/Swift/QtUI/QtVCardWidget/QtCloseButton.cpp b/Swift/QtUI/QtVCardWidget/QtCloseButton.cpp index 9d79859..ec7941c 100644 --- a/Swift/QtUI/QtVCardWidget/QtCloseButton.cpp +++ b/Swift/QtUI/QtVCardWidget/QtCloseButton.cpp @@ -24,28 +24,28 @@ QtCloseButton::QtCloseButton(QWidget *parent) : QAbstractButton(parent) { } QSize QtCloseButton::sizeHint() const { - return QSize(style()->pixelMetric(QStyle::PM_TabCloseIndicatorWidth, 0, 0), style()->pixelMetric(QStyle::PM_TabCloseIndicatorHeight, 0, 0)); + return QSize(style()->pixelMetric(QStyle::PM_TabCloseIndicatorWidth, 0, 0), style()->pixelMetric(QStyle::PM_TabCloseIndicatorHeight, 0, 0)); } bool QtCloseButton::event(QEvent *e) { - if (e->type() == QEvent::Enter || e->type() == QEvent::Leave) { - update(); - } - return QAbstractButton::event(e); + if (e->type() == QEvent::Enter || e->type() == QEvent::Leave) { + update(); + } + return QAbstractButton::event(e); } void QtCloseButton::paintEvent(QPaintEvent *) { - QPainter painter(this); - painter.setRenderHint(QPainter::HighQualityAntialiasing); - QStyleOption opt; - opt.init(this); - opt.state |= QStyle::State_AutoRaise; - if (underMouse() && !isDown()) { - opt.state |= QStyle::State_Raised; - } else if (isDown()) { - opt.state |= QStyle::State_Sunken; - } - style()->drawPrimitive(QStyle::PE_IndicatorTabClose, &opt, &painter, this); + QPainter painter(this); + painter.setRenderHint(QPainter::HighQualityAntialiasing); + QStyleOption opt; + opt.init(this); + opt.state |= QStyle::State_AutoRaise; + if (underMouse() && !isDown()) { + opt.state |= QStyle::State_Raised; + } else if (isDown()) { + opt.state |= QStyle::State_Sunken; + } + style()->drawPrimitive(QStyle::PE_IndicatorTabClose, &opt, &painter, this); } } |