-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added ignore reset navigation by mouse press for diagnostic
- Loading branch information
1 parent
e36e8c6
commit 5a3cf8f
Showing
14 changed files
with
122 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
/* | ||
* SPDX-License-Identifier: GPL-3.0-only | ||
* MuseScore-CLA-applies | ||
* | ||
* MuseScore | ||
* Music Composition & Notation | ||
* | ||
* Copyright (C) 2021 MuseScore BVBA and others | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 3 as | ||
* published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
#ifndef MU_DIAGNOSTICS_DIAGNOSTICSCHECK_H | ||
#define MU_DIAGNOSTICS_DIAGNOSTICSCHECK_H | ||
|
||
#include <QObject> | ||
|
||
#include "log.h" | ||
|
||
namespace mu::diagnostics { | ||
inline bool isDiagnosticObject(const QObject* obj, bool print = false) | ||
{ | ||
if (print) { | ||
LOGI() << "objectName: " << obj->objectName() << ", className: " << obj->metaObject()->className(); | ||
} | ||
if (obj->objectName().toLower().contains("diagnostic")) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
|
||
inline bool isDiagnosticChild(const QObject* obj, bool print = false) | ||
{ | ||
for (const QObject* ch : obj->children()) { | ||
if (isDiagnosticObject(ch, print)) { | ||
return true; | ||
} | ||
|
||
if (isDiagnosticChild(ch, print)) { | ||
return true; | ||
} | ||
} | ||
|
||
return false; | ||
} | ||
|
||
inline bool isDiagnosticParent(const QObject* obj, bool print = false) | ||
{ | ||
QObject* prn = obj->parent(); | ||
if (!prn) { | ||
return false; | ||
} | ||
|
||
if (isDiagnosticObject(prn, print)) { | ||
return true; | ||
} | ||
|
||
return isDiagnosticParent(prn, print); | ||
} | ||
|
||
inline bool isDiagnosticHierarchy(const QObject* obj, bool print = false) | ||
{ | ||
if (isDiagnosticObject(obj, print)) { | ||
return true; | ||
} | ||
if (isDiagnosticParent(obj, print)) { | ||
return true; | ||
} | ||
if (isDiagnosticChild(obj, print)) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
} | ||
|
||
#endif // MU_DIAGNOSTICS_DIAGNOSTICSCHECK_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters