需要加入plugins,不然发布后数据库没办法读取
This commit is contained in:
@@ -13,6 +13,7 @@ QT += svg
|
||||
QT += texttospeech
|
||||
|
||||
|
||||
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||
|
||||
|
||||
|
||||
+18
-5
@@ -51,7 +51,7 @@ QSize GetDesktopSize() {
|
||||
#endif
|
||||
|
||||
QScreen *screen=QGuiApplication::primaryScreen ();
|
||||
QRect mm=screen->availableGeometry() ;
|
||||
QRect mm=screen->availableGeometry();
|
||||
int screen_width = mm.width();
|
||||
int screen_height = mm.height();
|
||||
qDebug()<<"availableGeometry:" << screen_width<<screen_height;
|
||||
@@ -66,7 +66,8 @@ QSize GetDesktopSize() {
|
||||
screen_height = 768;
|
||||
}
|
||||
|
||||
return QSize(screen_width, screen_height);//最大1366*768
|
||||
//return QSize(screen_width, screen_height);//最大1366*768
|
||||
return QSize(1000, 700);//最大1366*768
|
||||
}
|
||||
|
||||
void CheckDir(const QString &path) {
|
||||
@@ -128,6 +129,14 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
|
||||
QString strLibPath(QDir::toNativeSeparators(QApplication::applicationDirPath()) + QDir::separator() + "plugins");
|
||||
|
||||
|
||||
|
||||
//QString strLibPath("./plugins");
|
||||
QApplication::addLibraryPath(strLibPath);
|
||||
|
||||
qDebug() << strLibPath;
|
||||
|
||||
a.setAttribute(Qt::AA_DontCreateNativeWidgetSiblings);
|
||||
|
||||
@@ -143,10 +152,14 @@ int main(int argc, char *argv[])
|
||||
|
||||
w.setWindowTitle(QString("GCS New Frame by Qt%1").arg(QT_VERSION_STR));//with version
|
||||
// 主要是控制HDMI输出,如果是LCD显示,此行无关紧要
|
||||
//w.resize(GetDesktopSize());
|
||||
//w.move(0,0);
|
||||
w.resize(GetDesktopSize());
|
||||
|
||||
w.setWindowState(Qt::WindowMaximized);
|
||||
QScreen *screen=QGuiApplication::primaryScreen ();;
|
||||
w.move((screen->availableGeometry().width()-w.width())/2,(screen->availableGeometry().height()-w.height())/2);
|
||||
|
||||
//qDebug() << screen;
|
||||
|
||||
//w.setWindowState(Qt::WindowMaximized);
|
||||
|
||||
w.show();
|
||||
|
||||
|
||||
@@ -294,6 +294,8 @@ void MainWindow::closeEvent(QCloseEvent *event)
|
||||
|
||||
void MainWindow::resizeEvent(QResizeEvent *event)
|
||||
{
|
||||
qDebug() << event;
|
||||
|
||||
Q_UNUSED(event)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user