Skip to content

Commit

Permalink
QCommonStyle: use logging categories
Browse files Browse the repository at this point in the history
Use qCWarning instead of qWarning, to give users more control over
debug output if needed.

Fixes: QTBUG-105332
Change-Id: I830dd160f75eb9885d80b80336bfb27da676e4bc
Reviewed-by: Richard Moe Gustavsen <[email protected]>
  • Loading branch information
Timur Pocheptsov committed Aug 9, 2022
1 parent 38ca34a commit 75d4958
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/widgets/styles/qcommonstyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,17 @@
#include <private/qstyleanimation_p.h>
#endif

#include <qloggingcategory.h>

#include <limits.h>

#include <private/qtextengine_p.h>
#include <private/qstylehelper_p.h>

QT_BEGIN_NAMESPACE

Q_LOGGING_CATEGORY(lcCommonStyle, "qt.widgets.commonstyle");

using namespace Qt::StringLiterals;

static qreal qt_getDevicePixelRatio(const QWidget *widget)
Expand Down Expand Up @@ -1104,7 +1108,7 @@ void QCommonStylePrivate::viewItemLayout(const QStyleOptionViewItem *opt, QRect
}
break; }
default:
qWarning("doLayout: decoration position is invalid");
qCWarning(lcCommonStyle, "doLayout: decoration position is invalid");
decoration = *pixmapRect;
break;
}
Expand Down Expand Up @@ -3875,7 +3879,7 @@ void QCommonStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCompl
break;
#endif // QT_CONFIG(mdiarea)
default:
qWarning("QCommonStyle::drawComplexControl: Control %d not handled", cc);
qCWarning(lcCommonStyle, "QCommonStyle::drawComplexControl: Control %d not handled", cc);
}
}

Expand Down Expand Up @@ -4011,7 +4015,7 @@ QStyle::SubControl QCommonStyle::hitTestComplexControl(ComplexControl cc, const
}
break;
default:
qWarning("QCommonStyle::hitTestComplexControl: Case %d not handled", cc);
qCWarning(lcCommonStyle, "QCommonStyle::hitTestComplexControl: Case %d not handled", cc);
}
return sc;
}
Expand Down Expand Up @@ -4450,7 +4454,7 @@ QRect QCommonStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex
}
#endif // QT_CONFIG(mdiarea)
default:
qWarning("QCommonStyle::subControlRect: Case %d not handled", cc);
qCWarning(lcCommonStyle, "QCommonStyle::subControlRect: Case %d not handled", cc);
}
#if !QT_CONFIG(slider) && !QT_CONFIG(spinbox) && !QT_CONFIG(toolbutton) && !QT_CONFIG(groupbox)
Q_UNUSED(widget);
Expand Down

0 comments on commit 75d4958

Please sign in to comment.