From 93c08510555607a88f2e8f475881fe89983ff44c Mon Sep 17 00:00:00 2001 From: ykeara Date: Fri, 27 Mar 2026 15:57:21 -0500 Subject: [PATCH] fix dx11 rendering in vr, fix various qrc references --- src/main.cpp | 41 ++++++++++--------- src/overlaycontroller.cpp | 8 ++-- src/res/qml/RootPage.qml | 26 ++++++------ .../device_selector/MicVolumeSlider.qml | 2 +- .../device_selector/MirrorVolumeSlider.qml | 2 +- src/res/qml/common/MyComboBox.qml | 1 + src/res/qml/common/MyDialogOkCancelPopup.qml | 1 + src/res/qml/common/MyDialogOkPopup.qml | 1 + src/res/qml/common/MyPushButton.qml | 1 + src/res/qml/common/MyPushButton2.qml | 1 + src/res/qml/common/MyRadioButton.qml | 1 + src/res/qml/common/MySlider.qml | 1 + src/res/qml/common/MyStackViewPage.qml | 3 +- src/res/qml/common/MyText.qml | 2 +- src/res/qml/common/MyToggleButton.qml | 3 +- src/res/qml/common/mainwidget.qml | 3 +- .../media_keys/MediaControllerKeys.qml | 8 ++-- src/tabcontrollers/AudioTabController.cpp | 4 +- 18 files changed, 62 insertions(+), 47 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 09417a5..ae2eba1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -51,12 +51,12 @@ int main( int argc, char* argv[] ) QQmlEngine qmlEngine; // Just error checking to ensure QRC works properly - //qDebug() << "list of qmldirs"; - //QDirIterator it( ":", QDirIterator::Subdirectories ); - //while ( it.hasNext() ) - //{ - // qDebug() << it.next(); - //} + qDebug() << "list of qmldirs"; + QDirIterator it( ":", QDirIterator::Subdirectories ); + while ( it.hasNext() ) + { + qDebug() << it.next(); + } std::unique_ptr controller( new advsettings::OverlayController( commandLineArgs.desktopMode, @@ -103,23 +103,26 @@ int main( int argc, char* argv[] ) || settings::getSetting( settings::BoolSetting::APPLICATION_desktopModeToggle ) ) { - qDebug() << "Desktop MODE!"; - auto m_pWindow = new QQuickWindow(); - qobject_cast( quickObj ) - ->setParentItem( m_pWindow->contentItem() ); - m_pWindow->setGeometry( - 0, - 0, - static_cast( - qobject_cast( quickObj )->width() ), - static_cast( - qobject_cast( quickObj )->height() ) ); - m_pWindow->show(); + //TODO TEMP + //qDebug() << "Desktop MODE!"; + //auto m_pWindow = new QQuickWindow(); + //qobject_cast( quickObj ) + // ->setParentItem( m_pWindow->contentItem() ); + //m_pWindow->setGeometry( + // 0, + // 0, + // static_cast( + // qobject_cast( quickObj )->width() ), + // static_cast( + // qobject_cast( quickObj )->height() ) ); + //m_pWindow->show(); } if ( commandLineArgs.resetSettings ) { + qInfo() << "WEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE"; // resets all settings if called - ovr_settings_wrapper::resetAllSettings(); + //TODO TEMP + //ovr_settings_wrapper::resetAllSettings(); } return mainEventLoop.exec(); diff --git a/src/overlaycontroller.cpp b/src/overlaycontroller.cpp index cd2ab31..5e3d21a 100644 --- a/src/overlaycontroller.cpp +++ b/src/overlaycontroller.cpp @@ -30,6 +30,7 @@ #include #include #include +#include // application namespace namespace advsettings @@ -92,6 +93,7 @@ OverlayController::OverlayController( bool desktopMode, { m_desktopMode = desktopModeToggle(); } + m_desktopMode = false; if ( !vr::VROverlay() ) { @@ -535,8 +537,7 @@ void OverlayController::SetOverlayFromQRhiTexture( QRhiTexture& tex ) break; case QRhi::D3D11: { - qInfo() << "YEPPPERS HERE WE GO!"; - vrTex.handle = reinterpret_cast( tex.nativeTexture().object ); + vrTex.handle = reinterpret_cast( tex.nativeTexture().object ); vrTex.eType = vr::TextureType_DirectX; vrTex.eColorSpace = vr::ColorSpace_Auto; @@ -609,7 +610,8 @@ bool OverlayController::pollNextEvent( vr::VROverlayHandle_t ulOverlayHandle, QPointF OverlayController::getMousePositionForEvent( vr::VREvent_Mouse_t mouse ) { - float y = mouse.y; + //TODO temp mouse is negative?? + float y = m_window.height() - mouse.y; #ifdef __linux__ float h = static_cast( m_window.height() ); y = h - y; diff --git a/src/res/qml/RootPage.qml b/src/res/qml/RootPage.qml index f76943e..c8b7507 100644 --- a/src/res/qml/RootPage.qml +++ b/src/res/qml/RootPage.qml @@ -28,7 +28,7 @@ MyStackViewPage { spacing: 10 MyPushButton { id: steamVRButton - iconPath: "qrc:/main_menu_icons/steamvr_tab_icon" + iconPath: "qrc:/qt/qml/AdvancedSettings/src/res/img/main_menu_icons/steamvr_tab_icon.svg" activationSoundEnabled: false text: " SteamVR" Layout.fillWidth: true @@ -40,7 +40,7 @@ MyStackViewPage { MyPushButton { id: chaperoneButton - iconPath: "qrc:/main_menu_icons/chaperone_tab_icon" + iconPath: "qrc:/qt/qml/AdvancedSettings/src/res/img/main_menu_icons/chaperone_tab_icon.svg" activationSoundEnabled: false text: " Chaperone" Layout.fillWidth: true @@ -52,7 +52,7 @@ MyStackViewPage { MyPushButton { id: playSpaceButton - iconPath: "qrc:/main_menu_icons/offsets_tab_icon" + iconPath: "qrc:/qt/qml/AdvancedSettings/src/res/img/main_menu_icons/offsets_tab_icon.svg" activationSoundEnabled: false text: " Offsets" Layout.fillWidth: true @@ -64,7 +64,7 @@ MyStackViewPage { MyPushButton { id: motionButton - iconPath: "qrc:/main_menu_icons/motion_tab_icon" + iconPath: "qrc:/qt/qml/AdvancedSettings/src/res/img/main_menu_icons/motion_tab_icon.svg" activationSoundEnabled: false text: " Motion" Layout.fillWidth: true @@ -75,7 +75,7 @@ MyStackViewPage { } MyPushButton { id: rotationButton - iconPath: "qrc:/main_menu_icons/rotation_tab_icon" + iconPath: "qrc:/qt/qml/AdvancedSettings/src/res/img/main_menu_icons/rotation_tab_icon.svg" activationSoundEnabled: false text: " Rotation" Layout.fillWidth: true @@ -87,7 +87,7 @@ MyStackViewPage { MyPushButton { id: fixFloorButton - iconPath: "qrc:/main_menu_icons/space_fix_tab_icon" + iconPath: "qrc:/qt/qml/AdvancedSettings/src/res/img/main_menu_icons/space_fix_tab_icon.svg" activationSoundEnabled: false text: " Space Fix" Layout.fillWidth: true @@ -99,7 +99,7 @@ MyStackViewPage { MyPushButton { id: audioButton - iconPath: "qrc:/main_menu_icons/audio_tab_icon" + iconPath: "qrc:/qt/qml/AdvancedSettings/src/res/img/main_menu_icons/audio_tab_icon.svg" activationSoundEnabled: false text: " Audio" Layout.fillWidth: true @@ -111,7 +111,7 @@ MyStackViewPage { MyPushButton { id: videoButton - iconPath: "qrc:/main_menu_icons/video_tab_icon" + iconPath: "qrc:/qt/qml/AdvancedSettings/src/res/img/main_menu_icons/video_tab_icon.svg" activationSoundEnabled: false text: " Video" Layout.fillWidth: true @@ -123,7 +123,7 @@ MyStackViewPage { MyPushButton { id: utilitiesButton - iconPath: "qrc:/main_menu_icons/utilities_tab_icon" + iconPath: "qrc:/qt/qml/AdvancedSettings/src/res/img/main_menu_icons/utilities_tab_icon.svg" activationSoundEnabled: false text: " Utilities" Layout.fillWidth: true @@ -136,7 +136,7 @@ MyStackViewPage { MyPushButton { id: statisticsButton - iconPath: "qrc:/main_menu_icons/statistics_tab_icon" + iconPath: "qrc:/qt/qml/AdvancedSettings/src/res/img/main_menu_icons/statistics_tab_icon.svg" activationSoundEnabled: false text: " Statistics" Layout.fillWidth: true @@ -153,7 +153,7 @@ MyStackViewPage { MyPushButton { id: bindingsButton - iconPath: "qrc:/main_menu_icons/bindings_tab_icon" + iconPath: "qrc:/qt/qml/AdvancedSettings/src/res/img/main_menu_icons/bindings_tab_icon.svg" activationSoundEnabled: false text: " Bindings" Layout.fillWidth: true @@ -164,7 +164,7 @@ MyStackViewPage { MyPushButton { id: settingsButton - iconPath: "qrc:/main_menu_icons/settings_tab_icon" + iconPath: "qrc:/qt/qml/AdvancedSettings/src/res/img/main_menu_icons/settings_tab_icon.svg" activationSoundEnabled: false text: " Settings" Layout.fillWidth: true @@ -379,7 +379,7 @@ MyStackViewPage { Layout.leftMargin: 12 checkable: true contentItem: Image { - source: parent.checked ? "qrc:/microphone/off" : "qrc:/microphone/on" + source: parent.checked ? "qrc:/qt/qml/AdvancedSettings/src/res/img/audio/microphone/mic_off.svg" : "qrc:/qt/qml/AdvancedSettings/src/res/img/audio/microphone/mic_on.svg" sourceSize.width: 32 sourceSize.height: 32 anchors.fill: parent diff --git a/src/res/qml/audio_page/device_selector/MicVolumeSlider.qml b/src/res/qml/audio_page/device_selector/MicVolumeSlider.qml index e485c5a..8e2ef6f 100644 --- a/src/res/qml/audio_page/device_selector/MicVolumeSlider.qml +++ b/src/res/qml/audio_page/device_selector/MicVolumeSlider.qml @@ -61,7 +61,7 @@ ColumnLayout { Layout.leftMargin: 12 checkable: true contentItem: Image { - source: parent.checked ? "qrc:/microphone/off" : "qrc:/microphone/on" + source: parent.checked ? "qrc:/qt/qml/AdvancedSettings/src/res/img/audio/microphone/mic_on.svg" : "qrc:/qt/qml/AdvancedSettings/src/res/img/audio/microphone/mic_off.svg" sourceSize.width: 32 sourceSize.height: 32 anchors.fill: parent diff --git a/src/res/qml/audio_page/device_selector/MirrorVolumeSlider.qml b/src/res/qml/audio_page/device_selector/MirrorVolumeSlider.qml index f70f6cb..21a5bae 100644 --- a/src/res/qml/audio_page/device_selector/MirrorVolumeSlider.qml +++ b/src/res/qml/audio_page/device_selector/MirrorVolumeSlider.qml @@ -62,7 +62,7 @@ ColumnLayout { Layout.leftMargin: 12 checkable: true contentItem: Image { - source: parent.checked ? "qrc:/speaker/off" : "qrc:/speaker/on" + source: parent.checked ? "qrc:/qt/qml/AdvancedSettings/src/res/img/audio/speaker/speaker_off.svg" : "qrc:/qt/qml/AdvancedSettings/src/res/img/audio/speaker/speaker_on.svg" sourceSize.width: 32 sourceSize.height: 32 anchors.fill: parent diff --git a/src/res/qml/common/MyComboBox.qml b/src/res/qml/common/MyComboBox.qml index eb589e2..0687659 100644 --- a/src/res/qml/common/MyComboBox.qml +++ b/src/res/qml/common/MyComboBox.qml @@ -1,5 +1,6 @@ import QtQuick 2.7 import QtQuick.Controls 2.0 +import ovras.advsettings import "." // QTBUG-34418, singletons require explicit import to load qmldir file diff --git a/src/res/qml/common/MyDialogOkCancelPopup.qml b/src/res/qml/common/MyDialogOkCancelPopup.qml index 429a1f1..80c9616 100644 --- a/src/res/qml/common/MyDialogOkCancelPopup.qml +++ b/src/res/qml/common/MyDialogOkCancelPopup.qml @@ -1,6 +1,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.0 import QtQuick.Layouts 1.3 +import ovras.advsettings Popup { id: myDialogPopup diff --git a/src/res/qml/common/MyDialogOkPopup.qml b/src/res/qml/common/MyDialogOkPopup.qml index 6d4d7e1..9c3da17 100644 --- a/src/res/qml/common/MyDialogOkPopup.qml +++ b/src/res/qml/common/MyDialogOkPopup.qml @@ -1,6 +1,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.0 import QtQuick.Layouts 1.3 +import ovras.advsettings Popup { id: myDialogPopup diff --git a/src/res/qml/common/MyPushButton.qml b/src/res/qml/common/MyPushButton.qml index 31e4a8e..20a28f7 100644 --- a/src/res/qml/common/MyPushButton.qml +++ b/src/res/qml/common/MyPushButton.qml @@ -1,5 +1,6 @@ import QtQuick 2.7 import QtQuick.Controls 2.0 +import ovras.advsettings import "." // QTBUG-34418, singletons require explicit import to load qmldir file Button { diff --git a/src/res/qml/common/MyPushButton2.qml b/src/res/qml/common/MyPushButton2.qml index b1e9f6e..8742b60 100644 --- a/src/res/qml/common/MyPushButton2.qml +++ b/src/res/qml/common/MyPushButton2.qml @@ -1,5 +1,6 @@ import QtQuick 2.7 import QtQuick.Controls 2.0 +import ovras.advsettings import "." // QTBUG-34418, singletons require explicit import to load qmldir file Button { diff --git a/src/res/qml/common/MyRadioButton.qml b/src/res/qml/common/MyRadioButton.qml index 8f721c8..a03a20a 100644 --- a/src/res/qml/common/MyRadioButton.qml +++ b/src/res/qml/common/MyRadioButton.qml @@ -1,5 +1,6 @@ import QtQuick 2.7 import QtQuick.Controls 2.0 +import ovras.advsettings import "." // QTBUG-34418, singletons require explicit import to load qmldir file RadioButton { diff --git a/src/res/qml/common/MySlider.qml b/src/res/qml/common/MySlider.qml index 0d6e8e0..52e265f 100644 --- a/src/res/qml/common/MySlider.qml +++ b/src/res/qml/common/MySlider.qml @@ -1,5 +1,6 @@ import QtQuick 2.7 import QtQuick.Controls 2.0 +import ovras.advsettings import "." // QTBUG-34418, singletons require explicit import to load qmldir file diff --git a/src/res/qml/common/MyStackViewPage.qml b/src/res/qml/common/MyStackViewPage.qml index 2a28a3f..a928d35 100644 --- a/src/res/qml/common/MyStackViewPage.qml +++ b/src/res/qml/common/MyStackViewPage.qml @@ -1,6 +1,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.0 import QtQuick.Layouts 1.2 +import ovras.advsettings import "." // QTBUG-34418, singletons require explicit import to load qmldir file // Needed for OverlayController in the default folder. import ".." @@ -26,7 +27,7 @@ Rectangle { enabled: headerShowBackButton opacity: headerShowBackButton ? 1.0 : 0.0 contentItem: Image { - source: "qrc:/common/backarrow" + source: "qrc:/qt/qml/AdvancedSettings/src/res/img/common/check.svg" sourceSize.width: 50 sourceSize.height: 50 anchors.fill: parent diff --git a/src/res/qml/common/MyText.qml b/src/res/qml/common/MyText.qml index 30b8c0b..7a1869e 100644 --- a/src/res/qml/common/MyText.qml +++ b/src/res/qml/common/MyText.qml @@ -1,6 +1,6 @@ import QtQuick 2.7 import QtQuick.Controls 2.0 - +import ovras.advsettings Text { color: "#d9dbe0" diff --git a/src/res/qml/common/MyToggleButton.qml b/src/res/qml/common/MyToggleButton.qml index 9584072..0ad3b15 100644 --- a/src/res/qml/common/MyToggleButton.qml +++ b/src/res/qml/common/MyToggleButton.qml @@ -1,5 +1,6 @@ import QtQuick 2.7 import QtQuick.Controls 2.0 +import ovras.advsettings import "." // QTBUG-34418, singletons require explicit import to load qmldir file // Needed for OverlayControllers in the default folder. import ".." @@ -31,7 +32,7 @@ CheckBox { height: 28 x: (parent.width - width) / 2 y: (parent.height - height) / 2 - source: "qrc:/common/box_checkmark" + source: "qrc:/qt/qml/AdvancedSettings/src/res/img/common/check.svg" sourceSize.width: width sourceSize.height: height visible: parent.parent.checked diff --git a/src/res/qml/common/mainwidget.qml b/src/res/qml/common/mainwidget.qml index bab8361..30dc057 100644 --- a/src/res/qml/common/mainwidget.qml +++ b/src/res/qml/common/mainwidget.qml @@ -1,5 +1,5 @@ import QtQuick -import QtQuick.Controls +import QtQuick.Controls.Material import QtQuick.Layouts import ".." import "../utilities_page" @@ -11,6 +11,7 @@ import "../steamvr_page" import "../rotation_page" import "../chaperone_page/chaperone_additional" import "../steamvr_page/steamvr_additional" +import ovras.advsettings Rectangle { id: root diff --git a/src/res/qml/utilities_page/media_keys/MediaControllerKeys.qml b/src/res/qml/utilities_page/media_keys/MediaControllerKeys.qml index 77b84d8..aaf8f14 100644 --- a/src/res/qml/utilities_page/media_keys/MediaControllerKeys.qml +++ b/src/res/qml/utilities_page/media_keys/MediaControllerKeys.qml @@ -25,10 +25,10 @@ GroupBox { } RowLayout { - property string playPauseButtonPath: "qrc:/media_keys/play_pause" - property string stopButtonPath: "qrc:/media_keys/stop" - property string previousButtonPath: "qrc:/media_keys/previous" - property string nextButtonPath: "qrc:/media_keys/next" + property string playPauseButtonPath: "qrc:/qt/qml/AdvancedSettings/src/res/img/audio/media_keys/outline_play_pause_white_24dp.svg" + property string stopButtonPath: "qrc:/qt/qml/AdvancedSettings/src/res/img/audio/media_keys/outline_stop_white_24dp.svg" + property string previousButtonPath: "qrc:/qt/qml/AdvancedSettings/src/res/img/audio/media_keys/outline_skip_previous_white_24dp.svg" + property string nextButtonPath: "qrc:/qt/qml/AdvancedSettings/src/res/img/audio/media_keys/outline_skip_next_white_24dp.svg" MediaButton { id: previousSongButton diff --git a/src/tabcontrollers/AudioTabController.cpp b/src/tabcontrollers/AudioTabController.cpp index a84fcd0..cde95f1 100644 --- a/src/tabcontrollers/AudioTabController.cpp +++ b/src/tabcontrollers/AudioTabController.cpp @@ -89,9 +89,9 @@ void AudioTabController::initStage2( OverlayController* var_parent ) } m_pushToTalkValues.pushToTalkImg.reset( - new QImage( ":qt/qml/AdvancedSettings/src/res/img/microphone/ptt_notification.png" ) ); + new QImage( ":/qt/qml/AdvancedSettings/src/res/img/audio/microphone/ptt_notification.png" ) ); m_pushToTalkValues.pushToMuteImg.reset( - new QImage( ":qt/qml/AdvancedSettings/src/res/img/microphone/ptm_notification.png" ) ); + new QImage( ":/qt/qml/AdvancedSettings/src/res/img/audio/microphone/ptm_notification.png" ) ); auto* pushToImg = m_pushToTalkValues.pushToTalkImg.get(); if ( settings::getSetting( settings::BoolSetting::AUDIO_micReversePtt ) )