QLineEdit: de-inline effective*TextMargin()
Saves 327b in text size, but done mainly because such functions shouldn't be inline in the first place. Change-Id: Ieea97f13620e4411dc01cb0d390bd668c13cfa7a Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>bb10
parent
264c72837d
commit
41ca17fa97
|
|
@ -523,6 +523,28 @@ void QLineEditPrivate::removeAction(QAction *action)
|
|||
q->update();
|
||||
}
|
||||
|
||||
static bool isSideWidgetVisible(const QLineEditPrivate::SideWidgetEntry &e)
|
||||
{
|
||||
return e.widget->isVisible();
|
||||
}
|
||||
|
||||
int QLineEditPrivate::effectiveLeftTextMargin() const
|
||||
{
|
||||
const auto &list = leftSideWidgetList();
|
||||
return leftTextMargin + (QLineEditIconButton::IconMargin + iconSize().width())
|
||||
* int(std::count_if(list.begin(), list.end(),
|
||||
isSideWidgetVisible));
|
||||
}
|
||||
|
||||
int QLineEditPrivate::effectiveRightTextMargin() const
|
||||
{
|
||||
const auto &list = rightSideWidgetList();
|
||||
return rightTextMargin + (QLineEditIconButton::IconMargin + iconSize().width())
|
||||
* int(std::count_if(list.begin(), list.end(),
|
||||
isSideWidgetVisible));
|
||||
}
|
||||
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -231,27 +231,6 @@ private:
|
|||
};
|
||||
Q_DECLARE_TYPEINFO(QLineEditPrivate::SideWidgetEntry, Q_PRIMITIVE_TYPE);
|
||||
|
||||
static bool isSideWidgetVisible(const QLineEditPrivate::SideWidgetEntry &e)
|
||||
{
|
||||
return e.widget->isVisible();
|
||||
}
|
||||
|
||||
inline int QLineEditPrivate::effectiveLeftTextMargin() const
|
||||
{
|
||||
const auto &list = leftSideWidgetList();
|
||||
return leftTextMargin + (QLineEditIconButton::IconMargin + iconSize().width())
|
||||
* int(std::count_if(list.begin(), list.end(),
|
||||
isSideWidgetVisible));
|
||||
}
|
||||
|
||||
inline int QLineEditPrivate::effectiveRightTextMargin() const
|
||||
{
|
||||
const auto &list = rightSideWidgetList();
|
||||
return rightTextMargin + (QLineEditIconButton::IconMargin + iconSize().width())
|
||||
* int(std::count_if(list.begin(), list.end(),
|
||||
isSideWidgetVisible));
|
||||
}
|
||||
|
||||
#endif // QT_NO_LINEEDIT
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
|
|
|||
Loading…
Reference in New Issue