Allow compiling without the qml module

This commit is contained in:
GriffinR
2025-08-07 13:29:05 -04:00
parent 5174dcb6eb
commit 6f4f393a88
15 changed files with 154 additions and 29 deletions

View File

@@ -1,3 +1,4 @@
#ifdef QT_QML_LIB
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "scripting.h"
@@ -963,3 +964,5 @@ void MainWindow::setFloorNumber(int floorNumber) {
this->editor->map->header()->setFloorNumber(floorNumber);
}
#endif // QT_QML_LIB

View File

@@ -1,6 +1,8 @@
#ifdef QT_QML_LIB
#include "mapview.h"
#include "scripting.h"
#include "imageproviders.h"
#include "editor.h"
void MapView::updateScene() {
if (this->scene()) {
@@ -300,3 +302,5 @@ void MapView::addMetatileImage(int x, int y, int metatileId, bool setTransparenc
if (this->getOverlay(layer)->addImage(x, y, image))
this->updateScene();
}
#endif // QT_QML_LIB

View File

@@ -1,12 +1,10 @@
#ifdef QT_QML_LIB
#include "scriptutility.h"
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "scripting.h"
#include "config.h"
ScriptUtility::ScriptUtility(MainWindow *mainWindow) {
this->window = mainWindow;
}
ScriptUtility::~ScriptUtility() {
if (window && window->ui && window->ui->menuTools) {
for (auto action : this->registeredActions) {
@@ -318,3 +316,5 @@ bool ScriptUtility::isPrimaryTileset(QString tilesetName) {
bool ScriptUtility::isSecondaryTileset(QString tilesetName) {
return getSecondaryTilesetNames().contains(tilesetName);
}
#endif // QT_QML_LIB

View File

@@ -1,8 +1,10 @@
#if __has_include(<QQmlEngine>)
#include <QQmlEngine>
#include "scripting.h"
#include "log.h"
#include "config.h"
#include "mainwindow.h"
const QMap<CallbackType, QString> callbackFunctions = {
{OnProjectOpened, "onProjectOpened"},
@@ -422,3 +424,6 @@ const QImage * Scripting::getImage(const QString &inputFilepath, bool useCache)
instance->imageCache.insert(inputFilepath, image);
return image;
}
#endif // __has_include(<QQmlEngine>)