LeechCraft  0.6.70-15082-g543737046d
Modular cross-platform feature rich live environment.
qmlerrorwatcher.cpp
Go to the documentation of this file.
1 /**********************************************************************
2  * LeechCraft - modular cross-platform feature rich internet client.
3  * Copyright (C) 2006-2014 Georg Rudoy
4  *
5  * Distributed under the Boost Software License, Version 1.0.
6  * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7  **********************************************************************/
8 
9 #include "qmlerrorwatcher.h"
10 #include <QQuickWidget>
11 #include <QQmlError>
12 #include <QtDebug>
13 
14 namespace LC::Util
15 {
16  void WatchQmlErrors (QQuickWidget *view)
17  {
18  QObject::connect (view,
19  &QQuickWidget::statusChanged,
20  [view]
21  {
22  if (view->status () == QQuickWidget::Error)
23  {
24  qWarning () << Q_FUNC_INFO
25  << "view errors:";
26  for (const auto& err : view->errors ())
27  qWarning () << "\t"
28  << err.toString ();
29  }
30  });
31  }
32 }
LC::Util
Definition: icoreproxy.h:33
qmlerrorwatcher.h
LC::Util::WatchQmlErrors
void WatchQmlErrors(QQuickWidget *view)
Utility function for logging errors from a QML view.
Definition: qmlerrorwatcher.cpp:22