From 48a0501adb0aa1c11acacf32dcc6e9100265e44c Mon Sep 17 00:00:00 2001 From: GiWoong Kim Date: Tue, 7 Jul 2015 20:17:52 +0900 Subject: [PATCH] ui: modified qt5_early_prepare add AA_X11InitThreads attribute call a qInstallMessageHandler after QApplication object is created use addLibraryPath instead of setLibraryPaths Change-Id: Ia63cfdf35a141295657fa235c443b0662752465c Signed-off-by: GiWoong Kim --- tizen/src/display/qt5_supplement.cpp | 39 ++++++++++++++---------------- tizen/src/ui/controller/dockingconview.cpp | 2 +- tizen/src/ui/layout/hardwarekey.cpp | 2 +- 3 files changed, 20 insertions(+), 23 deletions(-) diff --git a/tizen/src/display/qt5_supplement.cpp b/tizen/src/display/qt5_supplement.cpp index a097e12..05cb1cb 100644 --- a/tizen/src/display/qt5_supplement.cpp +++ b/tizen/src/display/qt5_supplement.cpp @@ -277,33 +277,30 @@ void qt5_destroy() void qt5_early_prepare(bool isOnscreen) { - Q_INIT_RESOURCE(resource); - qInstallMessageHandler(qMessageOutput); qt5IsOnscreen = isOnscreen; -#ifdef CONFIG_DARWIN -#define LIBQCOCOA "libqcocoa.dylib" - /* load libqcocoa.dylib */ - QStringList libPaths = QCoreApplication::libraryPaths(); - qDebug() << "default Qt plugin library path : " << libPaths; - - int i = 0; - for ( ; i < libPaths.count(); i++) { - QFileInfo libFileInfo(libPaths.at(i) + QDir::separator() + - "platforms" + QDir::separator() + LIBQCOCOA); - if (libFileInfo.exists() == true) { - break; - } - } + Q_INIT_RESOURCE(resource); - if (i >= libPaths.count()) { - qDebug() << LIBQCOCOA << " file not found. " << - "Qt plugin library path is converted to current path."; - QCoreApplication::setLibraryPaths(QStringList(QDir::currentPath())); - } +#ifdef CONFIG_LINUX + /* QGLWidget threading: Note that under X11 it is necessary to set the + * Qt::AA_X11InitThreads application attribute to make the X11 library + * and GLX calls thread safe, otherwise the above scenarios will fail. */ + + /* Calls XInitThreads() as part of the QApplication construction in order + * to make Xlib calls thread-safe. This attribute must be set before + * QApplication is constructed. */ + QCoreApplication::setAttribute(Qt::AA_X11InitThreads); #endif qt5App = new QApplication(argc, argv); + + /* add the path in the application's main() function, right after the + * QApplication object is created */ + qt5App->addLibraryPath(QDir::currentPath()); //TODO: consider a symbolic link + + qInstallMessageHandler(qMessageOutput); + + qDebug() << "* Qt plugin library path:" << QCoreApplication::libraryPaths(); } void qt5_prepare(void) diff --git a/tizen/src/ui/controller/dockingconview.cpp b/tizen/src/ui/controller/dockingconview.cpp index 9c2bebe..23ff6c7 100644 --- a/tizen/src/ui/controller/dockingconview.cpp +++ b/tizen/src/ui/controller/dockingconview.cpp @@ -72,7 +72,7 @@ void DockingConView::createItems(ControllerForm *conForm) } } } else { - GeneralPurposeCon *generalCon = new GeneralPurposeCon(this, keyList, + GeneralPurposeCon *generalCon = new GeneralPurposeCon(parentWidget(), keyList, QSize(conForm->centerRect.width(), conForm->centerRect.height() - GPC_HEAD_SPACING)); diff --git a/tizen/src/ui/layout/hardwarekey.cpp b/tizen/src/ui/layout/hardwarekey.cpp index e525d36..ba09e50 100644 --- a/tizen/src/ui/layout/hardwarekey.cpp +++ b/tizen/src/ui/layout/hardwarekey.cpp @@ -40,5 +40,5 @@ HardwareKey::HardwareKey(QString name, int keycode, QRect region, QString toolti HardwareKey::~HardwareKey() { - qDebug("destroy HW key"); + /* do nothing */ } -- 2.7.4