diff --git a/src/main.cpp b/src/main.cpp index 79067a5..11c93dd 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -49,7 +49,7 @@ int main(int argc, char *argv[]) DApplication::loadDXcbPlugin(); QScopedPointer app(new DApplication(argc, argv)); #else - QScopedPointer app(DApplication::globalApplication(argc,argv)); + QScopedPointer 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)); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 617b96a..440a1b6 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -25,7 +25,9 @@ #include #include + #include +#include 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() diff --git a/src/mainwindow.h b/src/mainwindow.h index 0f910b3..446db05 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -27,6 +27,7 @@ class MainWidget; DWIDGET_USE_NAMESPACE + class MainWindow : public DMainWindow { Q_OBJECT