feat: 启动时默认在屏幕中间

启动时默认在屏幕中间

Log: 位置相关
Change-Id: Ifa7df5fe7bce04dbd38d3b20f6f3ba0775468f5a
This commit is contained in:
Zhang Yong 2021-06-16 17:19:22 +08:00
parent 3cb047e159
commit 7c66205d3d
3 changed files with 7 additions and 2 deletions

View File

@ -68,6 +68,7 @@ int main(int argc, char *argv[])
app->loadTranslator(); app->loadTranslator();
OcrApplication instance; OcrApplication instance;
QDBusConnection dbus = QDBusConnection::sessionBus(); QDBusConnection dbus = QDBusConnection::sessionBus();

View File

@ -25,7 +25,9 @@
#include <QLabel> #include <QLabel>
#include <QDBusConnection> #include <QDBusConnection>
#include <DTitlebar> #include <DTitlebar>
#include <DWidgetUtil>
MainWindow::MainWindow(QWidget *parent) MainWindow::MainWindow(QWidget *parent)
: DMainWindow(parent) : DMainWindow(parent)
@ -37,6 +39,7 @@ MainWindow::MainWindow(QWidget *parent)
this->setCentralWidget(m_mainWidget); this->setCentralWidget(m_mainWidget);
this->resize(840, 550); this->resize(840, 550);
this->setMinimumSize(840, 550); this->setMinimumSize(840, 550);
Dtk::Widget::moveToCenter(this);
} }
MainWindow::~MainWindow() MainWindow::~MainWindow()

View File

@ -27,6 +27,7 @@
class MainWidget; class MainWidget;
DWIDGET_USE_NAMESPACE DWIDGET_USE_NAMESPACE
class MainWindow : public DMainWindow class MainWindow : public DMainWindow
{ {
Q_OBJECT Q_OBJECT