diff --git a/tests/src/app/App.cpp b/tests/src/app/App.cpp index 795b117f8..274e5322f 100644 --- a/tests/src/app/App.cpp +++ b/tests/src/app/App.cpp @@ -2,7 +2,6 @@ #include #include #include -#include #include #include "../components/contacts/ContactsListProxyModel.hpp" @@ -84,7 +83,7 @@ void App::addContextProperties () { if (component.isError()) { qWarning() << component.errors(); } else { - // context->setContextProperty("CallsWindow", component.create()); + context->setContextProperty("CallsWindow", component.create()); } // Models. @@ -99,7 +98,7 @@ void App::addContextProperties () { void App::setTrayIcon () { QQuickWindow *root = qobject_cast(m_engine.rootObjects().at(0)); QMenu *menu = new QMenu(); - QSystemTrayIcon *tray_icon = new QSystemTrayIcon(root); + m_tray_icon = new QSystemTrayIcon(root); // trayIcon: Right click actions. QAction *quit_action = new QAction("Quit", root); @@ -109,7 +108,7 @@ void App::setTrayIcon () { root->connect(restore_action, &QAction::triggered, root, &QQuickWindow::showNormal); // trayIcon: Left click actions. - root->connect(tray_icon, &QSystemTrayIcon::activated, [root](QSystemTrayIcon::ActivationReason reason) { + root->connect(m_tray_icon, &QSystemTrayIcon::activated, [root](QSystemTrayIcon::ActivationReason reason) { if (reason == QSystemTrayIcon::Trigger) { if (root->visibility() == QWindow::Hidden) root->showNormal(); @@ -123,8 +122,8 @@ void App::setTrayIcon () { menu->addSeparator(); menu->addAction(quit_action); - tray_icon->setContextMenu(menu); - tray_icon->setIcon(QIcon(WINDOW_ICON_PATH)); - tray_icon->setToolTip("Linphone"); - tray_icon->show(); + m_tray_icon->setContextMenu(menu); + m_tray_icon->setIcon(QIcon(WINDOW_ICON_PATH)); + m_tray_icon->setToolTip("Linphone"); + m_tray_icon->show(); } diff --git a/tests/src/app/App.hpp b/tests/src/app/App.hpp index bbc5409b5..f38ea1cf5 100644 --- a/tests/src/app/App.hpp +++ b/tests/src/app/App.hpp @@ -4,6 +4,7 @@ #include #include #include +#include #include // =================================================================== @@ -20,6 +21,7 @@ private: QQmlApplicationEngine m_engine; QQmlFileSelector *m_file_selector; + QSystemTrayIcon *m_tray_icon; QTranslator m_translator; }; diff --git a/tests/ui/modules/Linphone/Chat/Message.qml b/tests/ui/modules/Linphone/Chat/Message.qml index 50e5868b7..342486ec8 100644 --- a/tests/ui/modules/Linphone/Chat/Message.qml +++ b/tests/ui/modules/Linphone/Chat/Message.qml @@ -22,9 +22,11 @@ Item { var children = root.children // Can be the `invertedMouseArea` of other message. - var mouseArea = children[children.length - 1] + var mouseArea = Utils.find(children, function (element) { + return Utils.qmlTypeof(element, 'QQuickMouseArea') + }) - if (Utils.qmlTypeof(mouseArea, 'QQuickMouseArea')) { + if (mouseArea != null) { mouseArea.cursorShape = hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor