-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
83390c3
commit b6ffd7f
Showing
23 changed files
with
202 additions
and
276 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,31 @@ | ||
add_subdirectory(Source) | ||
set(CMAKE_PREFIX_PATH ${QT_LIB_PREFIX}) | ||
find_package( | ||
Qt6 ${QT_VERSION} | ||
COMPONENTS Core Gui Widgets Quick | ||
REQUIRED | ||
) | ||
|
||
qt_standard_project_setup(REQUIRES ${QT_VERSION}) | ||
|
||
file(GLOB_RECURSE SOURCES Src/*.cpp) | ||
qt_add_executable(Editor ${SOURCES}) | ||
target_include_directories(Editor PRIVATE Include) | ||
target_link_libraries(Editor PRIVATE Core RHI Runtime Qt6::Core Qt6::Gui Qt6::Widgets Qt6::Quick) | ||
|
||
# TODO config runtime dependencies in Windows | ||
|
||
file(GLOB_RECURSE QML_SOURCES QML/*.qml) | ||
file(GLOB_RECURSE RESOURCES Resource/*) | ||
|
||
list(APPEND RESOURCES_PENDING_SET_ALIAS ${QML_SOURCES} ${RESOURCES}) | ||
foreach (RESOURCE ${RESOURCES_PENDING_SET_ALIAS}) | ||
get_filename_component(FILENAME ${RESOURCE} NAME) | ||
set_source_files_properties(${RESOURCE} PROPERTIES QT_RESOURCE_ALIAS ${FILENAME}) | ||
endforeach () | ||
|
||
qt_add_qml_module( | ||
Editor | ||
URI editor | ||
QML_FILES ${QML_SOURCES} | ||
RESOURCES ${RESOURCES} | ||
) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,28 @@ | ||
// | ||
// Created by Kindem on 2024/12/31. | ||
// | ||
|
||
#pragma once | ||
|
||
#include <unordered_set> | ||
|
||
#include <QQuickView> | ||
|
||
namespace Editor { | ||
class QmlHotReloadEngine { | ||
public: | ||
static QmlHotReloadEngine& Get(); | ||
|
||
~QmlHotReloadEngine(); | ||
|
||
void Start(); | ||
void Stop(); | ||
void Register(QQuickView* inView); | ||
void Unregister(QQuickView* inView); | ||
|
||
private: | ||
QmlHotReloadEngine(); | ||
|
||
std::unordered_set<QQuickView*> liveQuickViews; | ||
}; | ||
} |
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,16 @@ | ||
// | ||
// Created by johnk on 2024/6/23. | ||
// | ||
|
||
#pragma once | ||
|
||
#include <Editor/Widget/QmlWidget.h> | ||
|
||
namespace Editor { | ||
class Launcher final : public QmlWidget { | ||
Q_OBJECT | ||
|
||
public: | ||
Launcher(); | ||
}; | ||
} |
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,24 @@ | ||
// | ||
// Created by Kindem on 2024/12/31. | ||
// | ||
|
||
#pragma once | ||
|
||
#include <QQuickView> | ||
#include <QWidget> | ||
|
||
namespace Editor { | ||
class QmlWidget : public QWidget { | ||
Q_OBJECT | ||
|
||
public: | ||
explicit QmlWidget(const std::string& qmlFileName, QWidget* parent = nullptr); | ||
|
||
QQuickView* GetQuickView(); | ||
const QUrl& GetQmlUrl() const; | ||
|
||
private: | ||
QUrl url; | ||
QQuickView* quickView; | ||
}; | ||
} |
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,5 @@ | ||
import QtQuick | ||
|
||
Rectangle { | ||
color: 'red' | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.