Commit 42233293 authored by Don Gagne's avatar Don Gagne

Merge pull request #1256 from DonLakeFlyer/Qt5.4

Qt 5.4 Upgrade
parents b1a9d302 80a6e84c
......@@ -19,10 +19,16 @@
installer {
MacBuild {
QMAKE_POST_LINK += && $$dirname(QMAKE_QMAKE)/macdeployqt $${DESTDIR}/qgroundcontrol.app
QMAKE_POST_LINK += && hdiutil create -layout SPUD -srcfolder $${DESTDIR}/qgroundcontrol.app -volname QGroundControl $${DESTDIR}/qgroundcontrol.dmg
# We copy qgroundcontrol.app to the current directory so we can run macdeployqt without a path to the
# qgroundcontrol.app file. If you specify a path to the .app file the symbolic links to plugins will not
# be created correctly.
QMAKE_POST_LINK += && rm -rf qgroundcontrol.app
QMAKE_POST_LINK += && cp -r $${DESTDIR}/qgroundcontrol.app .
QMAKE_POST_LINK += && $$dirname(QMAKE_QMAKE)/macdeployqt qgroundcontrol.app -verbose=2 -qmldir=src -dmg
QMAKE_POST_LINK += && rm -rf qgroundcontrol.app
QMAKE_POST_LINK += && mv qgroundcontrol.dmg release
}
WindowsBuild {
QMAKE_POST_LINK += $$escape_expand(\\n) $$quote(del /F "$$DESTDIR_WIN\\$${TARGET}.exp")
QMAKE_POST_LINK += $$escape_expand(\\n) $$quote(del /F "$$DESTDIR_WIN\\$${TARGET}.ilk")
......
......@@ -53,7 +53,7 @@ WindowsBuild {
MacBuild {
# Copy non-standard libraries and frameworks into app package
QMAKE_POST_LINK += && $$QMAKE_COPY_DIR $$BASEDIR/libs/lib/mac64/lib $$DESTDIR/$${TARGET}.app/Contents/libs
QMAKE_POST_LINK += && $$QMAKE_COPY_DIR -L $$BASEDIR/libs/lib/Frameworks $$DESTDIR/$${TARGET}.app/Contents/Frameworks
QMAKE_POST_LINK += && $$QMAKE_COPY_DIR -L $$BASEDIR/libs/lib/Frameworks $$DESTDIR/$${TARGET}.app/Contents
# Fix library paths inside executable
......
......@@ -51,28 +51,25 @@ Supported builds are 64 bit, built using the clang compiler.
#### Install QT
- - -
1. Download Qt 5.3 from: <http://download.qt-project.org/official_releases/qt/5.3/5.3.1/qt-opensource-mac-x64-clang-5.3.1.dmg>
1. Download Qt 5.4 from: <http://download.qt-project.org/official_releases/qt/5.4/5.4.0/qt-opensource-mac-x64-clang-5.4.0.dmg>
2. Double click the package installer and follow instructions.
#### Build QGroundControl
1. From the terminal change directory to your `groundcontrol` directory
2. Run `~/Qt5.3.1/5.3/clang_64/bin/qmake qgroundcontrol.pro -r -spec macx-clang`. If you installed a different version of Qt, or installed to a different location you may need to change the first portion of the path.
2. Run `~/Qt/5.4/clang_64/bin/qmake qgroundcontrol.pro -r -spec macx-clang`. If you installed a different version of Qt, or installed to a different location you may need to change the first portion of the path.
3. Run `make`
### Build on Linux
Supported builds for Linux are 32 or 64-bit, built using gcc.
#### Install Qt5.3+ and SDL1.2 prerequistites
* For Ubuntu (requires 14.10 for Qt5.3): `sudo apt-get install qtcreator qttools5-dev qtbase5-dev qt5-default qtdeclarative5-dev libqt5serialport5-dev libqt5svg5-dev libqt5webkit5-dev libsdl1.2-dev build-essential libudev-dev qml-module-qtgraphicaleffects`
#### Install Qt5.4 and SDL1.2 prerequistites
* For Fedora: `sudo yum install qt-creator qt5-qtbase-devel qt5-qtdeclarative-devel qt5-qtserialport-devel qt5-qtsvg-devel qt5-qtwebkit-devel SDL-devel SDL-static systemd-devel`
* For Arch Linux: `pacman -Sy qtcreator qt5-base qt5-declarative qt5-serialport qt5-svg qt5-webkit`
##### Install Qt5.3+ from PPA
Note: Please be aware that the time of writing, Qt5.3 is unavailable in the official repositories Ubuntu 14.04/Mint 17.*. If it has become available since, please follow the instructions for installing Qt5.3 on Ubuntu.
* Add this PPA to your sources.list: `ppa:beineri/opt-qt532-trusty`
* Run the following in your terminal: `sudo apt-get update && sudo apt-get install qt53tools qt53base qt53declarative qt53serialport qt53svg qt53webkit qt53quickcontrols qt53graphicaleffects`
* Next, set the environment variables by executing in the terminal: `source /opt/qt53/bin/qt53-env.sh` or copy and paste the contents to your `~/.profile` file to set them on login.
* Verify that the variables have been set: `echo $PATH && echo $QTDIR`. The output should read `/opt/qt53/bin:...` and `/opt/qt53`.
* For Ubuntu: Please be aware that the time of writing, Qt5.4 is unavailable in the official repositories Ubuntu 14.04/Mint 17.*.
* Add this PPA to your sources.list: `ppa:beineri/opt-qt54-trusty`
* Run the following in your terminal: `sudo apt-get update && sudo apt-get install qt54tools qt54base qt54declarative qt54serialport qt54svg qt54webkit qt54quickcontrols qt54xmlpatterns qt54x11extras qt54websockets qt54sensors qt54script qt54quick1 qt54qbs qt54multimedia qt54location qt54imageformats qt54graphicaleffects qt54creator qt54connectivity`
* Next, set the environment variables by executing in the terminal: `source /opt/qt53/bin/qt53-env.sh` or copy and paste the contents to your `~/.profile` file to set them on login.
* Verify that the variables have been set: `echo $PATH && echo $QTDIR`. The output should read `/opt/qt53/bin:...` and `/opt/qt53`.
#### [Optional] Install additional libraries
* For text-to-speech (espeak)
......@@ -95,8 +92,8 @@ Supported builds for Windows are 32 bit only built using Visual Studio 2013 or h
#### Install Visual Studio Express 2013
Only compilation using Visual Studio 2013 is supported. Download and install Visual Studio Express Edition (free) from here: <http://www.visualstudio.com/downloads/download-visual-studio-vs#d-express-windows-desktop>. Make sure you install the Windows Desktop version.
#### Install QT
Download Qt 5.3 from here: <http://download.qt-project.org/official_releases/qt/5.3/5.3.2/qt-opensource-windows-x86-msvc2013_opengl-5.3.2.exe>
#### Install Qt5.4
Download Qt 5.4 from here: <http://download.qt-project.org/official_releases/qt/5.4/5.4.0/qt-opensource-windows-x86-msvc2013_opengl-5.4.0.exe>
* The Qt variant should be for VS 2013, 32 bit (not 64) and include opengl.
#### Build QGroundControl
......
......@@ -29,8 +29,8 @@ exists(user_config.pri):infile(user_config.pri, CONFIG) {
# to allow us to easily modify suported build types in one place instead of duplicated throughout
# the project file.
!equals(QT_MAJOR_VERSION, 5) | !greaterThan(QT_MINOR_VERSION, 1) {
error("Unsupported Qt version, 5.2+ is required")
!equals(QT_MAJOR_VERSION, 5) | !greaterThan(QT_MINOR_VERSION, 3) {
error("Unsupported Qt version, 5.4+ is required")
}
linux {
......@@ -117,6 +117,7 @@ QT += network \
serialport \
sql \
printsupport \
qml \
quick \
quickwidgets
......@@ -184,7 +185,8 @@ WindowsBuild {
QMAKE_CXXFLAGS_WARN_ON += /W3 \
/wd4996 \ # silence warnings about deprecated strcpy and whatnot
/wd4005 \ # silence warnings about macro redefinition
/wd4290 # ignore exception specifications
/wd4290 \ # ignore exception specifications
/Zc:strictStrings- # work around win 8.1 sdk sapi.h problem
WarningsAsErrorsOn {
QMAKE_CXXFLAGS_WARN_ON += /WX
}
......
......@@ -25,6 +25,7 @@
/// @author Don Gagne <don@thegagnes.com>
#include "QGCQmlWidgetHolder.h"
#include "QGCMessageBox.h"
QGCQmlWidgetHolder::QGCQmlWidgetHolder(QWidget *parent) :
QWidget(parent)
......@@ -43,8 +44,19 @@ void QGCQmlWidgetHolder::setAutoPilot(AutoPilotPlugin* autoPilot)
_ui.qmlWidget->rootContext()->setContextProperty("autopilot", autoPilot);
}
void QGCQmlWidgetHolder::setSource(const QUrl& qmlUrl)
bool QGCQmlWidgetHolder::setSource(const QUrl& qmlUrl)
{
_ui.qmlWidget->setSource(qmlUrl);
_ui.qmlWidget->setMinimumSize(_ui.qmlWidget->rootObject()->width(), _ui.qmlWidget->rootObject()->height());
if (_ui.qmlWidget->status() != QQuickWidget::Ready) {
QString errorList;
foreach (QQmlError error, _ui.qmlWidget->errors()) {
errorList += error.toString();
errorList += "\n";
}
QGCMessageBox::warning(tr("Qml Error"), tr("Source not ready: %1\nErrors:\n%2").arg(_ui.qmlWidget->status()).arg(errorList));
return false;
}
return true;
}
......@@ -50,7 +50,7 @@ public:
void setAutoPilot(AutoPilotPlugin* autoPilot);
/// Sets the QML into the control
void setSource(const QUrl& qmlUrl);
bool setSource(const QUrl& qmlUrl);
private:
Ui::QGCQmlWidgetHolder _ui;
......
import QtQuick 2.2
import QtQuick 2.3
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2
......
import QtQuick 2.2
import QtQuick 2.3
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2
import QGroundControl.FactSystem 1.0
import QtGraphicalEffects 1.0
import QGroundControl.FactSystem 1.0
import QGroundControl.Palette 1.0
import QGroundControl.Controls 1.0
......
This diff is collapsed.
......@@ -17,7 +17,6 @@ class QGCMapToolBar : public QWidget
public:
explicit QGCMapToolBar(QWidget *parent = 0);
~QGCMapToolBar();
void setMap(QGCMapWidget* map);
......@@ -32,20 +31,19 @@ public slots:
void setStatusLabelText(const QString &text);
private:
Ui::QGCMapToolBar *ui;
Ui::QGCMapToolBar* _ui;
protected:
QGCMapWidget* map;
QMenu optionsMenu;
QMenu trailPlotMenu;
QMenu updateTimesMenu;
QMenu mapTypesMenu;
QGCMapWidget* _map;
QMenu* _optionsMenu;
QMenu* _trailPlotMenu;
QMenu* _updateTimesMenu;
QMenu* _mapTypesMenu;
QActionGroup* trailSettingsGroup;
QActionGroup* updateTimesGroup;
QActionGroup* mapTypesGroup;
QActionGroup* _trailSettingsGroup;
QActionGroup* _updateTimesGroup;
QActionGroup* _mapTypesGroup;
unsigned statusMaxLen;
unsigned _statusMaxLen;
};
#endif // QGCMAPTOOLBAR_H
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment