Added stylesheet, demo docs etc.
This commit is contained in:
23
main.cpp
23
main.cpp
@@ -30,6 +30,7 @@
|
||||
|
||||
#include <QApplication>
|
||||
#include <QMetaEnum>
|
||||
#include <QFile>
|
||||
|
||||
// main.cpp
|
||||
#include <QCoreApplication>
|
||||
@@ -65,6 +66,22 @@ if (ok) {
|
||||
|
||||
#include <QThread>
|
||||
|
||||
bool setApplicationStyleSheet( QAnyStringView path )
|
||||
{
|
||||
QFile styleFile( path.toString() );
|
||||
if (styleFile.open(QIODevice::ReadOnly | QIODevice::Text))
|
||||
{
|
||||
QString style = styleFile.readAll();
|
||||
qApp->setStyleSheet(style);
|
||||
styleFile.close();
|
||||
return true;
|
||||
}
|
||||
|
||||
qWarning() << "Konnte Stylesheet nicht laden:" << styleFile.errorString();
|
||||
return true;
|
||||
}
|
||||
|
||||
// 2. Datei öffnen und lesen
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
auto x = BC::ID::Motor_Status_Main;
|
||||
@@ -80,8 +97,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
|
||||
QApplication app(argc, argv);
|
||||
BCMainWindow w;
|
||||
w.show();
|
||||
setApplicationStyleSheet( ":/BionxControl.qss"_L1 );
|
||||
|
||||
QMetaEnum metaEnum = QMetaEnum::fromType<BC::ID>();
|
||||
|
||||
@@ -103,6 +119,9 @@ int main(int argc, char *argv[])
|
||||
//myMgr.loadXml();
|
||||
|
||||
|
||||
BCMainWindow w;
|
||||
w.show();
|
||||
|
||||
return app.exec();
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user