diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2018-06-28 14:45:22 +0200 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2018-12-17 11:57:50 +0000 |
commit | 8bf2dacabf0a9e5d37df6a202ef0a337995fc8ed (patch) | |
tree | 5ff1bfc24b01d5b6f96c00cc5c98537ddc72bd09 /src/quickcontrols2 | |
parent | c98f8abe34c526bbf66000567b8e1084a788b26b (diff) |
Add logging categories for Tumbler and TumblerView
Both types are complex, so it helps having logging that can simply
be turned on or off to aid debugging.
Change-Id: Id90a8b48b949d17710e8e0882531a497e80aae8b
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/quickcontrols2')
-rw-r--r-- | src/quickcontrols2/qquicktumblerview.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/quickcontrols2/qquicktumblerview.cpp b/src/quickcontrols2/qquicktumblerview.cpp index a510a1fe..5f5c065d 100644 --- a/src/quickcontrols2/qquicktumblerview.cpp +++ b/src/quickcontrols2/qquicktumblerview.cpp @@ -36,6 +36,7 @@ #include "qquicktumblerview_p.h" +#include <QtCore/qloggingcategory.h> #include <QtQuick/private/qquickitem_p.h> #include <QtQuick/private/qquicklistview_p.h> #include <QtQuick/private/qquickpathview_p.h> @@ -45,6 +46,8 @@ QT_BEGIN_NAMESPACE +Q_LOGGING_CATEGORY(lcTumblerView, "qt.quick.controls.tumblerview") + QQuickTumblerView::QQuickTumblerView(QQuickItem *parent) : QQuickItem(parent) { @@ -59,6 +62,8 @@ QVariant QQuickTumblerView::model() const void QQuickTumblerView::setModel(const QVariant &model) { + qCDebug(lcTumblerView) << "setting model to:" << model << "on" + << (m_pathView ? static_cast<QObject*>(m_pathView) : static_cast<QObject*>(m_listView)); if (model == m_model) return; @@ -85,6 +90,8 @@ QQmlComponent *QQuickTumblerView::delegate() const void QQuickTumblerView::setDelegate(QQmlComponent *delegate) { + qCDebug(lcTumblerView) << "setting delegate to:" << delegate << "on" + << (m_pathView ? static_cast<QObject*>(m_pathView) : static_cast<QObject*>(m_listView)); if (delegate == m_delegate) return; @@ -135,6 +142,8 @@ void QQuickTumblerView::createView() } if (!m_pathView) { + qCDebug(lcTumblerView) << "creating PathView"; + m_pathView = new QQuickPathView; QQmlEngine::setContextForObject(m_pathView, qmlContext(this)); QQml_setParent_noEvent(m_pathView, this); @@ -150,6 +159,8 @@ void QQuickTumblerView::createView() updateView(); // Set the model. updateModel(); + + qCDebug(lcTumblerView) << "finished creating PathView"; } } else { if (m_pathView) { @@ -162,6 +173,8 @@ void QQuickTumblerView::createView() } if (!m_listView) { + qCDebug(lcTumblerView) << "creating ListView"; + m_listView = new QQuickListView; QQmlEngine::setContextForObject(m_listView, qmlContext(this)); QQml_setParent_noEvent(m_listView, this); @@ -181,6 +194,8 @@ void QQuickTumblerView::createView() // which we don't want when the contentItem has just been created. m_listView->setDelegate(m_delegate); m_listView->setHighlightMoveDuration(1000); + + qCDebug(lcTumblerView) << "finished creating ListView"; } } } |