make getStyleOption protected
This commit is contained in:
parent
9e710035f4
commit
bb34b97f74
|
@ -87,15 +87,6 @@ bool IconButton::eventFilter(QObject *obj, QEvent *event)
|
||||||
return QAbstractButton::eventFilter(obj, event);
|
return QAbstractButton::eventFilter(obj, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IconButton::updateOverlayGeometry()
|
|
||||||
{
|
|
||||||
if (!_overlay || !_geometryWidget)
|
|
||||||
return;
|
|
||||||
|
|
||||||
const int s = iconSize().width()/2;
|
|
||||||
_overlay->setGeometry(_geometryWidget->geometry().adjusted(-s, -s, s, s));
|
|
||||||
}
|
|
||||||
|
|
||||||
QStyleOptionButton IconButton::getStyleOption() const
|
QStyleOptionButton IconButton::getStyleOption() const
|
||||||
{
|
{
|
||||||
QStyleOptionButton option;
|
QStyleOptionButton option;
|
||||||
|
@ -107,3 +98,12 @@ QStyleOptionButton IconButton::getStyleOption() const
|
||||||
option.iconSize = iconSize();
|
option.iconSize = iconSize();
|
||||||
return option;
|
return option;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void IconButton::updateOverlayGeometry()
|
||||||
|
{
|
||||||
|
if (!_overlay || !_geometryWidget)
|
||||||
|
return;
|
||||||
|
|
||||||
|
const int s = iconSize().width()/2;
|
||||||
|
_overlay->setGeometry(_geometryWidget->geometry().adjusted(-s, -s, s, s));
|
||||||
|
}
|
||||||
|
|
|
@ -23,9 +23,10 @@ protected:
|
||||||
bool event(QEvent *event) Q_DECL_OVERRIDE;
|
bool event(QEvent *event) Q_DECL_OVERRIDE;
|
||||||
bool eventFilter(QObject *obj, QEvent *event) Q_DECL_OVERRIDE;
|
bool eventFilter(QObject *obj, QEvent *event) Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
|
QStyleOptionButton getStyleOption() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void updateOverlayGeometry();
|
void updateOverlayGeometry();
|
||||||
QStyleOptionButton getStyleOption() const;
|
|
||||||
|
|
||||||
RippleOverlay *const _overlay;
|
RippleOverlay *const _overlay;
|
||||||
QWidget *_geometryWidget;
|
QWidget *_geometryWidget;
|
||||||
|
|
Loading…
Reference in New Issue