Browse Source

Mavericks fix to APM_Toolbar

QTBUG 34300 causes relative path references to qml file loading to fail.
QGC4.4
Don Gagne 12 years ago
parent
commit
feda356f72
  1. 9
      src/ui/apmtoolbar.cpp

9
src/ui/apmtoolbar.cpp

@ -10,7 +10,16 @@ APMToolBar::APMToolBar(QWidget *parent): @@ -10,7 +10,16 @@ APMToolBar::APMToolBar(QWidget *parent):
QDeclarativeView(parent), m_uas(0)
{
// Configure our QML object
// Hack to fix QTBUG 34300 on OSX where QDir::currentPath has changed behavior. This causes
// relative paths to inside the .app package to fail.
#ifdef Q_OS_MAC
QString qmlFile = QApplication::applicationDirPath();
qmlFile.append("/qml/ApmToolBar.qml");
setSource(QUrl::fromLocalFile(qmlFile));
#else
setSource(QUrl::fromLocalFile("qml/ApmToolBar.qml"));
#endif
setResizeMode(QDeclarativeView::SizeRootObjectToView);
this->rootContext()->setContextProperty("globalObj", this);
connect(LinkManager::instance(),SIGNAL(newLink(LinkInterface*)),

Loading…
Cancel
Save