Changeset 5531d6


Ignore:
Timestamp:
01/13/12 14:36:38 (4 months ago)
Author:
Micke Prag <micke.prag@…>
Branches:
('master', 'deebf2045e7119c339412580f37a1e653f7d5715')('controller-upgrade', '00f95d22e12d96ef089e0902ef62ae8ce841dc6f')
Children:
aadc4554fc97f0caac4d591e1b9f8197e02d94f0
Parents:
ab436a212fb4158c66b118c557ab4b4f8275033d
git-author:
Micke Prag <micke.prag@telldus.se>2012-01-13 14:36:38+01:00
git-committer:
Micke Prag <micke.prag@telldus.se>2012-01-13 14:36:38+01:00
Message:

Add QtComponents to the QML plugin

Location:
telldus-gui/Plugins/QML
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • telldus-gui/Plugins/QML/CMakeLists.txt

    r3738b3 r5531d6  
    2424 
    2525INCLUDE( ../TelldusCenterPlugin.cmake NO_POLICY_SCOPE ) 
     26 
     27SET(QT_COMPONENTS_OUTPUT_DIR "${CMAKE_BINARY_DIR}/TelldusCenter/Plugins/declarative") 
     28INCLUDE( ${CMAKE_SOURCE_DIR}/3rdparty/qt-components-desktop.cmake NO_POLICY_SCOPE ) 
  • telldus-gui/Plugins/QML/qmlview.cpp

    r61331e r5531d6  
    33#include <QDeclarativeContext> 
    44#include <QScriptValueIterator> 
     5#include <QDeclarativeEngine> 
    56#include <QVariant> 
     7#include <QApplication> 
    68 
    79class QMLView::PrivateData { 
     
    1618        setAttribute(Qt::WA_TranslucentBackground); 
    1719        setStyleSheet("background:transparent;"); 
     20 
     21        QDeclarativeEngine *eng = this->engine(); 
     22        QStringList paths(eng->importPathList()); 
     23        QDir pluginsDir = QDir(qApp->applicationDirPath()); 
     24 
     25#if defined(Q_OS_MAC) 
     26        if (pluginsDir.dirName() == "MacOS") { 
     27                pluginsDir.cdUp(); 
     28        } 
     29#endif 
     30 
     31        if (pluginsDir.cd("Plugins/declarative")) { 
     32                paths << pluginsDir.absolutePath(); 
     33        } 
     34 
     35        eng->setImportPathList(paths); 
    1836 
    1937        d = new PrivateData; 
Note: See TracChangeset for help on using the changeset viewer.