-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added show graphics info to diagnostics
- Loading branch information
1 parent
0755eaa
commit 8e678be
Showing
10 changed files
with
234 additions
and
0 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
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
38 changes: 38 additions & 0 deletions
38
src/framework/diagnostics/qml/Muse/Diagnostics/DiagnosticGraphicsInfoDialog.qml
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,38 @@ | ||
/* | ||
* 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/>. | ||
*/ | ||
import QtQuick 2.15 | ||
import Muse.Ui 1.0 | ||
import Muse.UiComponents 1.0 | ||
|
||
StyledDialogView { | ||
id: root | ||
|
||
title: "Diagnostic: Graphics Info" | ||
|
||
contentHeight: 480 | ||
contentWidth: 600 | ||
resizable: true | ||
|
||
DiagnosticGraphicsInfoPanel { | ||
anchors.fill: parent | ||
} | ||
} |
73 changes: 73 additions & 0 deletions
73
src/framework/diagnostics/qml/Muse/Diagnostics/DiagnosticGraphicsInfoPanel.qml
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,73 @@ | ||
/* | ||
* 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/>. | ||
*/ | ||
import QtQuick 2.15 | ||
|
||
import Muse.Ui 1.0 | ||
import Muse.UiComponents 1.0 | ||
import Muse.Diagnostics 1.0 | ||
|
||
Rectangle { | ||
|
||
anchors.fill: parent | ||
|
||
color: ui.theme.backgroundPrimaryColor | ||
|
||
Component.onCompleted: { | ||
graphicsInfo.init() | ||
} | ||
|
||
GraphicsInfoModel { | ||
id: graphicsInfo | ||
} | ||
|
||
Item { | ||
id: toolPanel | ||
anchors.left: parent.left | ||
anchors.right: parent.right | ||
anchors.margins: 16 | ||
height: 48 | ||
|
||
Row { | ||
id: btnRow | ||
anchors.fill: parent | ||
spacing: 8 | ||
|
||
FlatButton { | ||
anchors.verticalCenter: parent.verticalCenter | ||
text: "Copy to clipboard" | ||
onClicked: graphicsInfo.copyToClipboard() | ||
} | ||
} | ||
} | ||
|
||
StyledTextLabel { | ||
anchors.top: toolPanel.bottom | ||
anchors.left: parent.left | ||
anchors.right: parent.right | ||
anchors.bottom: parent.bottom | ||
anchors.margins: 16 | ||
verticalAlignment: Text.AlignTop | ||
horizontalAlignment: Text.AlignLeft | ||
text: graphicsInfo.info | ||
} | ||
|
||
} |
56 changes: 56 additions & 0 deletions
56
src/framework/diagnostics/view/system/graphicsinfomodel.cpp
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,56 @@ | ||
/* | ||
* SPDX-License-Identifier: GPL-3.0-only | ||
* MuseScore-CLA-applies | ||
* | ||
* MuseScore | ||
* Music Composition & Notation | ||
* | ||
* Copyright (C) 2024 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/>. | ||
*/ | ||
#include "graphicsinfomodel.h" | ||
|
||
#include <QClipboard> | ||
|
||
#include "ui/graphicsapiprovider.h" | ||
|
||
using namespace muse::diagnostics; | ||
|
||
GraphicsInfoModel::GraphicsInfoModel() | ||
{ | ||
} | ||
|
||
void GraphicsInfoModel::init() | ||
{ | ||
if (!uiengine()) { | ||
return; | ||
} | ||
|
||
QString gApi = uiengine()->graphicsApiName(); | ||
|
||
m_info = "\n"; | ||
m_info += "Graphics Api: " + gApi; | ||
|
||
emit infoChanged(); | ||
} | ||
|
||
void GraphicsInfoModel::copyToClipboard() | ||
{ | ||
QApplication::clipboard()->setText(m_info); | ||
} | ||
|
||
QString GraphicsInfoModel::info() const | ||
{ | ||
return m_info; | ||
} |
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,52 @@ | ||
/* | ||
* SPDX-License-Identifier: GPL-3.0-only | ||
* MuseScore-CLA-applies | ||
* | ||
* MuseScore | ||
* Music Composition & Notation | ||
* | ||
* Copyright (C) 2024 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/>. | ||
*/ | ||
#pragma once | ||
|
||
#include <QObject> | ||
|
||
#include "modularity/ioc.h" | ||
#include "ui/iuiengine.h" | ||
|
||
namespace muse::diagnostics { | ||
class GraphicsInfoModel : public QObject | ||
{ | ||
Q_OBJECT | ||
|
||
Q_PROPERTY(QString info READ info NOTIFY infoChanged FINAL) | ||
|
||
muse::Inject<ui::IUiEngine> uiengine; | ||
|
||
public: | ||
GraphicsInfoModel(); | ||
|
||
QString info() const; | ||
|
||
Q_INVOKABLE void init(); | ||
Q_INVOKABLE void copyToClipboard(); | ||
|
||
signals: | ||
void infoChanged(); | ||
|
||
private: | ||
QString m_info; | ||
}; | ||
} |