Qt6 (#669)
* update qt6 upgrade progress * add flawed addition for QRenderTarget and link needed libs * update to better logging format * move many assets and qml files into qrc * get rid of deprecation messages * remove additional deprecation notices * make Qt6 finally render on desktop with some progress on vr * initialize QRhi with QQuickRenderControl * use default values to stop SegFaults * fix compilation on windows * add windows files for aiding in running exe * fix formatting of testing qt.conf * first attempt on using textures instead of files in AudioTabController * Fix public/private access issue --------- Co-authored-by: RTUnreal <unreal@rtinf.net>
This commit is contained in:
+19
-28
@@ -1,6 +1,11 @@
|
||||
#include "utils/setup.h"
|
||||
#include "settings/settings.h"
|
||||
#include "openvr/ovr_settings_wrapper.h"
|
||||
|
||||
#include <QtLogging>
|
||||
#include <QtDebug>
|
||||
#include <memory>
|
||||
|
||||
#ifdef _WIN64
|
||||
# include <windows.h>
|
||||
extern "C" __declspec( dllexport ) DWORD NvOptimusEnablement = 0x00000001;
|
||||
@@ -8,16 +13,13 @@ extern "C" __declspec( dllexport ) DWORD AmdPowerXpressRequestHighPerformance
|
||||
= 0x00000001;
|
||||
#endif
|
||||
|
||||
INITIALIZE_EASYLOGGINGPP
|
||||
|
||||
int main( int argc, char* argv[] )
|
||||
{
|
||||
setUpLogging();
|
||||
|
||||
LOG( INFO ) << "Settings File: "
|
||||
<< settings::initializeAndGetSettingsPath();
|
||||
qInfo() << "Settings File: " << settings::initializeAndGetSettingsPath();
|
||||
|
||||
LOG( INFO ) << settings::getSettingsAndValues();
|
||||
qInfo() << settings::getSettingsAndValues();
|
||||
|
||||
QCoreApplication::setAttribute( Qt::AA_Use96Dpi );
|
||||
QCoreApplication::setAttribute( Qt::AA_UseDesktopOpenGL );
|
||||
@@ -30,8 +32,6 @@ int main( int argc, char* argv[] )
|
||||
mainEventLoop.setApplicationVersion(
|
||||
application_strings::applicationVersionString );
|
||||
|
||||
qInstallMessageHandler( mainQtMessageHandler );
|
||||
|
||||
const auto commandLineArgs
|
||||
= argument::returnCommandLineParser( mainEventLoop );
|
||||
|
||||
@@ -51,34 +51,25 @@ int main( int argc, char* argv[] )
|
||||
{
|
||||
QQmlEngine qmlEngine;
|
||||
|
||||
advsettings::OverlayController controller( commandLineArgs.desktopMode,
|
||||
commandLineArgs.forceNoSound,
|
||||
qmlEngine );
|
||||
|
||||
constexpr auto widgetPath = "res/qml/common/mainwidget.qml";
|
||||
const auto path = paths::binaryDirectoryFindFile( widgetPath );
|
||||
|
||||
if ( !path.has_value() )
|
||||
{
|
||||
LOG( ERROR ) << "Unable to find file '" << widgetPath << "'.";
|
||||
throw std::runtime_error(
|
||||
"Unable to find critical file. See log for more information." );
|
||||
}
|
||||
std::unique_ptr<advsettings::OverlayController> controller(
|
||||
new advsettings::OverlayController( commandLineArgs.desktopMode,
|
||||
commandLineArgs.forceNoSound,
|
||||
qmlEngine ) );
|
||||
|
||||
const auto url
|
||||
= QUrl::fromLocalFile( QString::fromStdString( ( *path ) ) );
|
||||
= QUrl( "qrc:/qt/qml/AdvancedSettings/common/mainwidget.qml" );
|
||||
|
||||
QQmlComponent component( &qmlEngine, url );
|
||||
auto errors = component.errors();
|
||||
for ( auto& e : errors )
|
||||
{
|
||||
LOG( ERROR ) << "QML Error: " << e.toString().toStdString()
|
||||
<< std::endl;
|
||||
qCritical() << "QML Error: "
|
||||
<< e.toString().toStdString(); //<< std::endl;
|
||||
}
|
||||
auto quickObj = component.create();
|
||||
controller.SetWidget( qobject_cast<QQuickItem*>( quickObj ),
|
||||
application_strings::applicationDisplayName,
|
||||
application_strings::applicationKey );
|
||||
controller->SetWidget( qobject_cast<QQuickItem*>( quickObj ),
|
||||
application_strings::applicationDisplayName,
|
||||
application_strings::applicationKey );
|
||||
|
||||
// Attempts to install the application manifest on all "regular" starts.
|
||||
if ( !commandLineArgs.forceNoManifest )
|
||||
@@ -99,7 +90,7 @@ int main( int argc, char* argv[] )
|
||||
}
|
||||
catch ( std::exception& e )
|
||||
{
|
||||
LOG( ERROR ) << e.what();
|
||||
qCritical() << e.what();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,7 +120,7 @@ int main( int argc, char* argv[] )
|
||||
}
|
||||
catch ( const std::exception& e )
|
||||
{
|
||||
LOG( FATAL ) << e.what();
|
||||
qFatal() << e.what();
|
||||
return ReturnErrorCode::GENERAL_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user