QStyleHints: code tidies
1. Use Q_D and Q_Q instead of d_func() and q_func(). 2. Use early return. 3. Remove unnecessary semicon. 4. Add one new line to separate two unrelated functions. Change-Id: Ie6171c857f00ca171e97723a0d517d2295bbbbd1 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit 528f28f380e3f0c55b9a305f6b208dc1a2db73d6)
This commit is contained in:
parent
377abfcb5e
commit
cbee4d6ff2
@ -129,7 +129,8 @@ int QStyleHints::touchDoubleTapDistance() const
|
||||
*/
|
||||
Qt::Appearance QStyleHints::appearance() const
|
||||
{
|
||||
return d_func()->appearance();
|
||||
Q_D(const QStyleHints);
|
||||
return d->appearance();
|
||||
}
|
||||
|
||||
Qt::ColorScheme QStyleHints::colorScheme() const
|
||||
@ -602,10 +603,11 @@ int QStyleHints::mouseQuickSelectionThreshold() const
|
||||
*/
|
||||
void QStyleHintsPrivate::setAppearance(Qt::Appearance appearance)
|
||||
{
|
||||
if (m_appearance != appearance) {
|
||||
m_appearance = appearance;
|
||||
emit q_func()->appearanceChanged(appearance);
|
||||
}
|
||||
if (m_appearance == appearance)
|
||||
return;
|
||||
m_appearance = appearance;
|
||||
Q_Q(QStyleHints);
|
||||
emit q->appearanceChanged(appearance);
|
||||
}
|
||||
|
||||
QStyleHintsPrivate *QStyleHintsPrivate::get(QStyleHints *q)
|
||||
|
@ -40,8 +40,9 @@ public:
|
||||
int m_mouseDoubleClickDistance = -1;
|
||||
int m_touchDoubleTapDistance = -1;
|
||||
|
||||
Qt::Appearance appearance() const { return m_appearance; };
|
||||
Qt::Appearance appearance() const { return m_appearance; }
|
||||
void setAppearance(Qt::Appearance appearance);
|
||||
|
||||
static QStyleHintsPrivate *get(QStyleHints *q);
|
||||
|
||||
private:
|
||||
|
Loading…
x
Reference in New Issue
Block a user