b
This commit is contained in:
+40
-23
@@ -20,6 +20,20 @@
|
||||
//#pragma comment(lib, "Version")
|
||||
|
||||
|
||||
|
||||
//include
|
||||
#include "dlink.h"
|
||||
|
||||
|
||||
|
||||
//#pragma comment(lib, "../../thirdpart/lib/Dlink")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
QSize GetDesktopSize() {
|
||||
#ifdef __arm__
|
||||
int fb_fd = open("/dev/fb0", O_RDWR);
|
||||
@@ -48,7 +62,6 @@ QSize GetDesktopSize() {
|
||||
|
||||
return QSize(lcd_width, lcd_height);
|
||||
#endif
|
||||
//return QSize(800, 480);
|
||||
return QSize(800, 480);
|
||||
}
|
||||
|
||||
@@ -66,21 +79,12 @@ void CheckDirs(const QString &path, const QStringList &dirs) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
#define SoftWareVersion "V1.0.0"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
void LoadLang(QApplication *a)
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
|
||||
MainWindow w;
|
||||
|
||||
QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF8"));
|
||||
|
||||
QTranslator * qtTranslator = new QTranslator{};
|
||||
QString lang = "qt_" + QLocale::system().name();
|
||||
if (qtTranslator->load(lang, QLibraryInfo::location(QLibraryInfo::TranslationsPath))
|
||||
&& a.installTranslator(qtTranslator))
|
||||
&& a->installTranslator(qtTranslator))
|
||||
{
|
||||
qDebug() << "Success to load translator " <<lang << " from " << QLibraryInfo::location(QLibraryInfo::TranslationsPath);
|
||||
}
|
||||
@@ -92,7 +96,7 @@ int main(int argc, char *argv[])
|
||||
QTranslator * myappTranslator = new QTranslator{};
|
||||
lang = "SimpleGroundStation_" + QLocale::system().name();
|
||||
if (myappTranslator->load(lang, QCoreApplication::applicationDirPath())
|
||||
&& a.installTranslator(myappTranslator))
|
||||
&& a->installTranslator(myappTranslator))
|
||||
{
|
||||
qDebug() << "Success to load translator " <<lang << " from " << QCoreApplication::applicationDirPath();
|
||||
}
|
||||
@@ -100,23 +104,36 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
qWarning() << "Fail to load translator " <<lang << " from " << QCoreApplication::applicationDirPath();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void RegisterType(void)
|
||||
{
|
||||
|
||||
qmlRegisterModule("Drivers.LinkUI",1,0);
|
||||
|
||||
qmlRegisterType<LinkUI>("Drivers.LinkUI",1,0,"LinkUI");
|
||||
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
MainWindow w;
|
||||
|
||||
a.setAttribute(Qt::AA_DontCreateNativeWidgetSiblings);
|
||||
|
||||
QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF8"));
|
||||
|
||||
LoadLang(&a);
|
||||
|
||||
RegisterType();
|
||||
|
||||
w.setWindowTitle(QStringLiteral("GCS New Frame @ %1"));//with version
|
||||
// 主要是控制HDMI输出,如果是LCD显示,此行无关紧要
|
||||
w.resize(GetDesktopSize());
|
||||
|
||||
|
||||
a.setAttribute(Qt::AA_DontCreateNativeWidgetSiblings);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
w.show();
|
||||
|
||||
return a.exec();
|
||||
|
||||
Reference in New Issue
Block a user