From 3e664bf438d4a3ab9a5f1633f2db171632b777b8 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Fri, 31 Mar 2017 12:16:41 +0200 Subject: Change some Scene3D/Window qWarnings to qCDebug None of these is fatal. It is perfectly possible to get input via other means, for example. Change-Id: I7880c8f5aa611908d7e09d03fe0c8100f8c8d183 Reviewed-by: Sean Harmer --- src/quick3d/imports/scene3d/scene3ditem.cpp | 4 +- src/quick3d/quick3dextras/qt3dquickwindow.cpp | 5 +- .../quick3dextras/qt3dquickwindowlogging.cpp | 50 ++++++++++++++++ .../quick3dextras/qt3dquickwindowlogging_p.h | 66 ++++++++++++++++++++++ src/quick3d/quick3dextras/quick3dextras.pro | 7 ++- 5 files changed, 125 insertions(+), 7 deletions(-) create mode 100644 src/quick3d/quick3dextras/qt3dquickwindowlogging.cpp create mode 100644 src/quick3d/quick3dextras/qt3dquickwindowlogging_p.h diff --git a/src/quick3d/imports/scene3d/scene3ditem.cpp b/src/quick3d/imports/scene3d/scene3ditem.cpp index 4a5c959c4..2c3cc4384 100644 --- a/src/quick3d/imports/scene3d/scene3ditem.cpp +++ b/src/quick3d/imports/scene3d/scene3ditem.cpp @@ -179,7 +179,7 @@ void Scene3DItem::applyRootEntityChange() QList cameras = m_entity->findChildren(); if (cameras.isEmpty()) { - qWarning() << "No camera found and automatic aspect ratio requested"; + qCDebug(Scene3D) << "No camera found and automatic aspect ratio requested"; } else { m_camera = cameras.first(); setCameraAspectModeHelper(); @@ -191,7 +191,7 @@ void Scene3DItem::applyRootEntityChange() if (inputSettings) { inputSettings->setEventSource(this); } else { - qWarning() << "No Input Settings found, keyboard and mouse events won't be handled"; + qCDebug(Scene3D) << "No Input Settings found, keyboard and mouse events won't be handled"; } } } diff --git a/src/quick3d/quick3dextras/qt3dquickwindow.cpp b/src/quick3d/quick3dextras/qt3dquickwindow.cpp index 46f96bfa9..7fecf0d46 100644 --- a/src/quick3d/quick3dextras/qt3dquickwindow.cpp +++ b/src/quick3d/quick3dextras/qt3dquickwindow.cpp @@ -49,6 +49,7 @@ ****************************************************************************/ #include +#include #include #include #include @@ -211,7 +212,7 @@ void Qt3DQuickWindow::onSceneCreated(QObject *rootObject) QList cameras = rootObject->findChildren(); if (cameras.isEmpty()) { - qWarning() << "No camera found"; + qCDebug(QuickWindow) << "No camera found"; } else { m_camera = cameras.first(); setCameraAspectModeHelper(); @@ -223,7 +224,7 @@ void Qt3DQuickWindow::onSceneCreated(QObject *rootObject) if (inputSettings) { inputSettings->setEventSource(this); } else { - qWarning() << "No Input Settings found, keyboard and mouse events won't be handled"; + qCDebug(QuickWindow) << "No Input Settings found, keyboard and mouse events won't be handled"; } } diff --git a/src/quick3d/quick3dextras/qt3dquickwindowlogging.cpp b/src/quick3d/quick3dextras/qt3dquickwindowlogging.cpp new file mode 100644 index 000000000..cd74d6b3e --- /dev/null +++ b/src/quick3d/quick3dextras/qt3dquickwindowlogging.cpp @@ -0,0 +1,50 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qt3dquickwindowlogging_p.h" + +QT_BEGIN_NAMESPACE + +namespace Qt3DExtras { + +Q_LOGGING_CATEGORY(QuickWindow, "Qt3D.QuickWindow", QtWarningMsg) + +} // Qt3DExtras + +QT_END_NAMESPACE diff --git a/src/quick3d/quick3dextras/qt3dquickwindowlogging_p.h b/src/quick3d/quick3dextras/qt3dquickwindowlogging_p.h new file mode 100644 index 000000000..75a774dda --- /dev/null +++ b/src/quick3d/quick3dextras/qt3dquickwindowlogging_p.h @@ -0,0 +1,66 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QT3D_QUICKWINDOWLOGGING_P_H +#define QT3D_QUICKWINDOWLOGGING_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include + +QT_BEGIN_NAMESPACE + +namespace Qt3DExtras { + +Q_DECLARE_LOGGING_CATEGORY(QuickWindow) + +} // Qt3DRender + +QT_END_NAMESPACE + +#endif // QT3D_QUICKWINDOWLOGGING_P_H diff --git a/src/quick3d/quick3dextras/quick3dextras.pro b/src/quick3d/quick3dextras/quick3dextras.pro index c2fce8b10..9044c1668 100644 --- a/src/quick3d/quick3dextras/quick3dextras.pro +++ b/src/quick3d/quick3dextras/quick3dextras.pro @@ -14,13 +14,14 @@ gcov { } SOURCES += \ - qt3dquickwindow.cpp - + qt3dquickwindow.cpp \ + qt3dquickwindowlogging.cpp HEADERS += \ qt3dquickextras_global.h \ qt3dquickextras_global_p.h \ - qt3dquickwindow.h + qt3dquickwindow.h \ + qt3dquickwindowlogging_p.h # otherwise mingw headers do not declare common functions like ::strcasecmp win32-g++*:QMAKE_CXXFLAGS_CXX11 = -std=gnu++0x -- cgit v1.2.3