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

@ -49,7 +49,7 @@ int main(int argc, char *argv[])
DApplication::loadDXcbPlugin();
QScopedPointer<DApplication> app(new DApplication(argc, argv));
#else
QScopedPointer<DApplication> app(DApplication::globalApplication(argc,argv));
QScopedPointer<DApplication> app(DApplication::globalApplication(argc, argv));
#endif
app->setOrganizationName("deepin");
app->setApplicationName("deepin-ocr");
@ -68,6 +68,7 @@ int main(int argc, char *argv[])
app->loadTranslator();
OcrApplication instance;
QDBusConnection dbus = QDBusConnection::sessionBus();
@ -89,7 +90,7 @@ int main(int argc, char *argv[])
// 第二次运行此应用,
// 调用DBus接口处理交给第一次调用的进程
// 本进程退退出
OcrInterface *pOcr = new OcrInterface("com.deepin.Ocr","/com/deepin/Ocr", QDBusConnection::sessionBus(), &instance);
OcrInterface *pOcr = new OcrInterface("com.deepin.Ocr", "/com/deepin/Ocr", QDBusConnection::sessionBus(), &instance);
qDebug() << __FUNCTION__ << __LINE__;
pOcr->openFile(QString(argv[1]));
//pOcr->openImage(QImage(QSize(500, 145), QImage::Format_RGB32));

View File

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

View File

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