-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(GraphicalEffects): add own port of GraphicalEffects & fix minor …
…issues (#19) * fix: Minor issue on radius and colour * docs: add comment * fix(build): Fix platform judgement * fix(example): QML import PATH error * feat(GraphicalEffects): add own port of GraphicalEffects * chore: Update GraphicalEffects calls * fix(GraphicalEffects): fix class name and qrc import path * feat(example): add a rendering backend checker
- Loading branch information
1 parent
0f84941
commit f4f67b8
Showing
98 changed files
with
7,625 additions
and
57 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
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
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 |
---|---|---|
@@ -1,43 +1,72 @@ | ||
#include <qlogging.h> | ||
#include <qqmlcontext.h> | ||
#include <qtenvironmentvariables.h> | ||
#include <QApplication> | ||
#include <QMessageBox> | ||
#include <QObject> | ||
#include <QQmlApplicationEngine> | ||
#include <QQmlEngine> | ||
#include <qlogging.h> | ||
#include <QQuickWindow> | ||
#include <qqmlcontext.h> | ||
#include <qtenvironmentvariables.h> | ||
|
||
class AboutQtController : public QObject { | ||
Q_OBJECT | ||
public: | ||
AboutQtController(QObject* parent = nullptr) : QObject{parent} {} | ||
signals: | ||
void showAboutQt(); | ||
public slots: | ||
void showAboutQtDialog() { QMessageBox::aboutQt(nullptr, "About Qt"); } | ||
Q_OBJECT | ||
public: | ||
AboutQtController(QObject* parent = nullptr) | ||
: QObject { parent } | ||
{ | ||
} | ||
signals: | ||
void showAboutQt(); | ||
public slots: | ||
void showAboutQtDialog() { QMessageBox::aboutQt(nullptr, "About Qt"); } | ||
}; | ||
|
||
int main(int argc, char* argv[]) { | ||
qDebug() << "LINGMOUI_TEMP_IMPORT_PATH: " << LINGMOUI_TEMP_IMPORT_PATH; | ||
QString path = | ||
QString(LINGMOUI_TEMP_IMPORT_PATH) + ":" + qgetenv("QML_IMPORT_PATH"); | ||
int main(int argc, char* argv[]) | ||
{ | ||
qDebug() << "LINGMOUI_TEMP_IMPORT_PATH: " << LINGMOUI_TEMP_IMPORT_PATH; | ||
|
||
QApplication app(argc, argv); | ||
|
||
QQmlApplicationEngine engine; | ||
|
||
QApplication app(argc, argv); | ||
engine.addImportPath(LINGMOUI_TEMP_IMPORT_PATH); | ||
|
||
QQmlApplicationEngine engine; | ||
// 创建 AboutQtController 对象 | ||
AboutQtController aboutQtController(&app); | ||
|
||
engine.addImportPath(path); | ||
// 将 aboutQtController 注册到 QML 上下文中 | ||
engine.rootContext()->setContextProperty("aboutQtController", | ||
&aboutQtController); | ||
|
||
// 创建 AboutQtController 对象 | ||
AboutQtController aboutQtController(&app); | ||
engine.load(QUrl(QStringLiteral("qrc:/qml/main.qml"))); | ||
|
||
// 将 aboutQtController 注册到 QML 上下文中 | ||
engine.rootContext()->setContextProperty("aboutQtController", | ||
&aboutQtController); | ||
QString graphicsApiUsed = ""; | ||
switch(QQuickWindow::graphicsApi()) { | ||
case QSGRendererInterface::Unknown: | ||
graphicsApiUsed = "Unknown"; | ||
break; | ||
case QSGRendererInterface::Software: | ||
graphicsApiUsed = "Software Rendering"; | ||
break; | ||
case QSGRendererInterface::OpenGL: | ||
graphicsApiUsed = "OpenGL Rendering"; | ||
break; | ||
case QSGRendererInterface::Vulkan: | ||
graphicsApiUsed = "Vulkan Rendering"; | ||
break; | ||
case QSGRendererInterface::Direct3D11: | ||
graphicsApiUsed = "Direct3D11 Rendering"; | ||
break; | ||
case QSGRendererInterface::Direct3D12: | ||
graphicsApiUsed = "Direct3D11 Rendering"; | ||
break; | ||
default: | ||
graphicsApiUsed = "Unknown"; | ||
} | ||
|
||
engine.load(QUrl(QStringLiteral("qrc:/qml/main.qml"))); | ||
qDebug() << "Using graphical API: " << graphicsApiUsed; | ||
|
||
return app.exec(); | ||
return app.exec(); | ||
} | ||
|
||
#include "main.moc" |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import QtQuick | ||
import Qt5Compat.GraphicalEffects | ||
import LingmoUI.GraphicalEffects | ||
import LingmoUI | ||
|
||
Item { | ||
|
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
Oops, something went wrong.