1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-07 03:22:33 +01:00

Add html files to qrc

Apparently this works now with newer Qt versions...
This commit is contained in:
Elias Steurer 2020-08-22 12:14:05 +02:00
parent 2e670ed84c
commit c32ea21e13
4 changed files with 3 additions and 111 deletions

View File

@ -115,7 +115,7 @@ Drawer {
opacity: 0
property bool ready: false
url: Qt.resolvedUrl(".") + "WorkshopPreview.html"
url: "qrc:/assets/WorkshopPreview.html"
onUrlChanged: print(url)
Behavior on opacity {

View File

@ -5,5 +5,6 @@
<file>dot.png</file>
<file>qtquickcontrols2.conf</file>
<file>WebView.qml</file>
<file>index.html</file>
</qresource>
</RCC>

View File

@ -1,99 +0,0 @@
TEMPLATE = app
QT += qml quick quickcontrols2 widgets core webengine
CONFIG += c++17
DEFINES += QT_DEPRECATED_WARNINGS
TARGETPATH = ScreenPlayWallpaper
RESOURCES += \
SPWResources.qrc
SOURCES += \
main.cpp \
src/basewindow.cpp \
HEADERS += \
src/basewindow.h \
win32 {
include($$PWD/../Common/qt-breakpad/qt-breakpad.pri)
LIBS += -luser32
SOURCES += \
src/windowsdesktopproperties.cpp \
src/winwindow.cpp
HEADERS += \
src/windowsdesktopproperties.h \
src/winwindow.h
CONFIG(debug, debug|release) {
install_it.path = $${OUT_PWD}/debug/
install_it.files += \
$$PWD/../Common/vcpkg/installed/x64-windows/debug/bin/libcrypto-1_1-x64.dll \
$$PWD/../Common/vcpkg/installed/x64-windows/debug/bin/libssl-1_1-x64.dll \
} else {
install_it.path = $${OUT_PWD}/release/
install_it.files += \
$$PWD/../Common/vcpkg/installed/x64-windows/bin/libcrypto-1_1-x64.dll \
$$PWD/../Common/vcpkg/installed/x64-windows/bin/libssl-1_1-x64.dll \
}
}
include(../ScreenPlaySDK/ScreenPlaySDK.pri)
macx {
QMAKE_LIBDIR += $$OUT_PWD/
install_it.path = $${OUT_PWD}/../ScreenPlaySDK
html_data.files = index.html
html_data.path = Contents/MacOS
QMAKE_BUNDLE_DATA += html_data
QMAKE_LFLAGS += -framework Cocoa
SOURCES += src/macintegration.cpp
HEADERS += src/macintegration.h \
src/macbridge.h
OBJECTIVE_SOURCES += src/MacBridge.mm
SOURCES += \
src/macwindow.cpp
HEADERS += \
src/macwindow.h
}
unix:!macx {
install_it.path = $${OUT_PWD}/
LIBS += -lX11
SOURCES += \
src/linuxwindow.cpp
HEADERS += \
src/linuxwindow.h
CONFIG(debug, debug|release) {
install_it.files += \
$$PWD/../Common/vcpkg/installed/x64-linux/debug/bin/libcrypto-1_1-x64.so \
$$PWD/../Common/vcpkg/installed/x64-linux/debug/bin/libssl-1_1-x64.so \
} else {
install_it.files += \
$$PWD/../Common/vcpkg/installed/x64-linux/bin/libcrypto-1_1-x64.so \
$$PWD/../Common/vcpkg/installed/x64-linux/bin/libssl-1_1-x64.so \
}
}
install_it.files += index.html \
INSTALLS += install_it
DISTFILES += \
index.html

View File

@ -37,18 +37,8 @@ Item {
WebEngineView {
id: webView
anchors.fill: parent
url: {
if (Wallpaper.type === Wallpaper.WallpaperType.Video) {
return Qt.resolvedUrl(Wallpaper.getApplicationPath(
) + "/index.html")
}
if (Wallpaper.type === Wallpaper.WallpaperType.Html) {
return Qt.resolvedUrl(Wallpaper.fullContentPath + "/index.html")
}
}
url: "qrc:/index.html"
onJavaScriptConsoleMessage: print(lineNumber, message)
onLoadProgressChanged: {
if ((loadProgress === 100)) {