diff --git a/QGCSetup.pri b/QGCSetup.pri index bb9b03c872084aa192441710f559417228f80ebb..8b08abae97c80beaca7325df3677834b123682c8 100644 --- a/QGCSetup.pri +++ b/QGCSetup.pri @@ -63,7 +63,8 @@ WindowsBuild { ReleaseBuild: DLL_QT_DEBUGCHAR = "" COPY_FILE_LIST = \ $$BASEDIR\\libs\\lib\\sdl\\win32\\SDL.dll \ - $$BASEDIR\\libs\\thirdParty\\libxbee\\lib\\libxbee.dll + $$BASEDIR\\libs\\thirdParty\\libxbee\\lib\\libxbee.dll \ + $$BASEDIR\\deploy\\libeay32.dll for(COPY_FILE, COPY_FILE_LIST) { QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY \"$$COPY_FILE\" \"$$DESTDIR_WIN\" diff --git a/deploy/libeay32.dll b/deploy/libeay32.dll new file mode 100644 index 0000000000000000000000000000000000000000..fadf8b2d519836e7e03bfdbdadbba9d391829b62 Binary files /dev/null and b/deploy/libeay32.dll differ diff --git a/src/FactSystem/FactMetaData.cc b/src/FactSystem/FactMetaData.cc index 422d4f0a479acc823bb58ec0d8812c2930568f9c..f9b87557323d82fcd9fac0b2c38a69505b1c0323 100644 --- a/src/FactSystem/FactMetaData.cc +++ b/src/FactSystem/FactMetaData.cc @@ -17,10 +17,22 @@ #include "QGroundControlQmlGlobal.h" #include +#include #include #include +// Conversion Constants +// Time +const qreal FactMetaData::UnitConsts_s::secondsPerHour = 3600.0; + +// Velocity +const qreal FactMetaData::UnitConsts_s::knotsToKPH = 1.852; // exact, hence weird base for knotsToMetersPerSecond + +// Length +const qreal FactMetaData::UnitConsts_s::milesToMeters = 1609.344; +const qreal FactMetaData::UnitConsts_s::feetToMeters = 0.3048; + // Built in translations for all Facts const FactMetaData::BuiltInTranslation_s FactMetaData::_rgBuiltInTranslations[] = { { "centi-degrees", "deg", FactMetaData::_centiDegreesToDegrees, FactMetaData::_degreesToCentiDegrees }, @@ -379,62 +391,62 @@ void FactMetaData::setBuiltInTranslator(void) QVariant FactMetaData::_degreesToRadians(const QVariant& degrees) { - return QVariant(degrees.toDouble() * (M_PI / 180.0)); + return QVariant(qDegreesToRadians(degrees.toDouble())); } QVariant FactMetaData::_radiansToDegrees(const QVariant& radians) { - return QVariant(radians.toDouble() * (180 / M_PI)); + return QVariant(qRadiansToDegrees(radians.toDouble())); } QVariant FactMetaData::_centiDegreesToDegrees(const QVariant& centiDegrees) { - return QVariant(centiDegrees.toFloat() / 100.0f); + return QVariant(centiDegrees.toReal() / 100.0); } QVariant FactMetaData::_degreesToCentiDegrees(const QVariant& degrees) { - return QVariant((unsigned int)(degrees.toFloat() * 100.0f)); + return QVariant(qRound(degrees.toReal() * 100.0)); } QVariant FactMetaData::_metersToFeet(const QVariant& meters) { - return QVariant(meters.toDouble() * 3.28083989501); + return QVariant(meters.toDouble() * 1.0/constants.feetToMeters); } QVariant FactMetaData::_feetToMeters(const QVariant& feet) { - return QVariant(feet.toDouble() * 0.305); + return QVariant(feet.toDouble() * constants.feetToMeters); } QVariant FactMetaData::_metersPerSecondToMilesPerHour(const QVariant& metersPerSecond) { - return QVariant((metersPerSecond.toDouble() * 0.000621371192) * 60.0 * 60.0); + return QVariant((metersPerSecond.toDouble() * 1.0/constants.milesToMeters) * constants.secondsPerHour); } QVariant FactMetaData::_milesPerHourToMetersPerSecond(const QVariant& milesPerHour) { - return QVariant((milesPerHour.toDouble() * 1609.344) / (60.0 * 60.0)); + return QVariant((milesPerHour.toDouble() * constants.milesToMeters) / constants.secondsPerHour); } QVariant FactMetaData::_metersPerSecondToKilometersPerHour(const QVariant& metersPerSecond) { - return QVariant((metersPerSecond.toDouble() / 1000.0) * 60.0 * 60.0); + return QVariant((metersPerSecond.toDouble() / 1000.0) * constants.secondsPerHour); } QVariant FactMetaData::_kilometersPerHourToMetersPerSecond(const QVariant& kilometersPerHour) { - return QVariant((kilometersPerHour.toDouble() * 1000.0) / (60.0 * 60.0)); + return QVariant((kilometersPerHour.toDouble() * 1000.0) / constants.secondsPerHour); } QVariant FactMetaData::_metersPerSecondToKnots(const QVariant& metersPerSecond) { - return QVariant(metersPerSecond.toDouble() * 1.94384449244); + return QVariant(metersPerSecond.toDouble() * constants.secondsPerHour / (1000.0 * constants.knotsToKPH)); } QVariant FactMetaData::_knotsToMetersPerSecond(const QVariant& knots) { - return QVariant(knots.toDouble() * 0.51444444444); + return QVariant(knots.toDouble() * (constants.knotsToKPH / (1000.0 * constants.secondsPerHour))); } QVariant FactMetaData::_percentToNorm(const QVariant& percent) diff --git a/src/FactSystem/FactMetaData.h b/src/FactSystem/FactMetaData.h index 92cc8cca947f235647bf404c41044da0fc701969..db8f5b8a2cb428afdd7640d3b3c7d9246c7dd62d 100644 --- a/src/FactSystem/FactMetaData.h +++ b/src/FactSystem/FactMetaData.h @@ -188,6 +188,14 @@ private: bool _rebootRequired; double _increment; + // Exact conversion constants + static const struct UnitConsts_s { + static const qreal secondsPerHour; + static const qreal knotsToKPH; + static const qreal milesToMeters; + static const qreal feetToMeters; + } constants; + struct BuiltInTranslation_s { const char* rawUnits; const char* cookedUnits; @@ -195,6 +203,7 @@ private: Translator cookedTranslator; }; + static const BuiltInTranslation_s _rgBuiltInTranslations[]; static const AppSettingsTranslation_s _rgAppSettingsTranslations[]; diff --git a/src/FlightMap/FlightMap.qml b/src/FlightMap/FlightMap.qml index 3cccb5705bd64799a42f515165fbb14b7c7f5541..bcce2ad89ed849aaf925f67496b5580d7b2aa4c1 100644 --- a/src/FlightMap/FlightMap.qml +++ b/src/FlightMap/FlightMap.qml @@ -128,4 +128,152 @@ Map { label: "Q" } } + + //---- Polygon drawing code + + // + // Usage: + // + // Connections { + // target: map.polygonDraw + // + // onPolygonStarted: { + // // Polygon creation has started + // } + // + // onPolygonFinished: { + // // Polygon capture complete, coordinates signal variable contains the polygon points + // } + // } + // + // map.polygonDraqw.startPolgyon() - begin capturing a new polygon + // map.polygonDraqw.endPolygon() - end capture (right-click will also end capture) + + // Not sure why this is needed, but trying to reference polygonDrawer directly from other code doesn't work + property alias polygonDraw: polygonDrawer + + QGCLabel { + id: polygonHelp + anchors.topMargin: parent.height - ScreenTools.availableHeight + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + horizontalAlignment: Text.AlignHCenter + text: qsTr("Click to add point %1").arg(ScreenTools.isMobile || !polygonDrawer.polygonReady ? "" : qsTr("- Right Click to end polygon")) + visible: polygonDrawer.drawingPolygon + } + + MouseArea { + id: polygonDrawer + anchors.fill: parent + acceptedButtons: Qt.LeftButton | Qt.RightButton + visible: drawingPolygon + z: 1000 // Hack to fix MouseArea layering for now + + property alias drawingPolygon: polygonDrawer.hoverEnabled + property bool polygonReady: polygonDrawerPolygon.path.length > 3 ///< true: enough points have been captured to create a closed polygon + + /// New polygon capture has started + signal polygonStarted + + /// Polygon capture is complete + /// @param coordinates Map coordinates for the polygon points + signal polygonFinished(var coordinates) + + /// Begin capturing a new polygon + /// polygonStarted will be signalled + function startPolygon() { + polygonDrawer.drawingPolygon = true + polygonDrawer._clearPolygon() + polygonDrawer.polygonStarted() + } + + /// Finish capturing the polygon + /// polygonFinished will be signalled + /// @return true: polygon completed, false: not enough points to complete polygon + function finishPolygon() { + if (!polygonDrawer.polygonReady) { + return false + } + + var polygonPath = polygonDrawerPolygon.path + polygonPath.pop() // get rid of drag coordinate + polygonDrawer._clearPolygon() + polygonDrawer.drawingPolygon = false + polygonDrawer.polygonFinished(polygonPath) + return true + } + + function _clearPolygon() { + // Simpler methods to clear the path simply don't work due to bugs. This craziness does. + var bogusCoord = _map.toCoordinate(Qt.point(height/2, width/2)) + polygonDrawerPolygon.path = [ bogusCoord, bogusCoord ] + polygonDrawerNextPoint.path = [ bogusCoord, bogusCoord ] + polygonDrawerPolygon.path = [ ] + polygonDrawerNextPoint.path = [ ] + } + + onClicked: { + if (mouse.button == Qt.LeftButton) { + if (polygonDrawerPolygon.path.length > 2) { + // Make sure the new line doesn't intersect the existing polygon + var lastSegment = polygonDrawerPolygon.path.length - 2 + var newLineA = _map.fromCoordinate(polygonDrawerPolygon.path[lastSegment], false /* clipToViewPort */) + var newLineB = _map.fromCoordinate(polygonDrawerPolygon.path[lastSegment+1], false /* clipToViewPort */) + for (var i=0; i 0 ? height * 2 : 0 + clip: true + + delegate: Rectangle { + height: _rowHeight + width: _rowWidth + color: Qt.rgba(0,0,0,0) + + Row { + id: factRow + spacing: Math.ceil(ScreenTools.defaultFontPixelWidth * 0.5) + anchors.verticalCenter: parent.verticalCenter + + property Fact modelFact: object + + QGCLabel { + id: nameLabel + width: ScreenTools.defaultFontPixelWidth * 20 + text: factRow.modelFact.name + clip: true + } - //--------------------------------------------- - // Paremeters view - Component { - id: factRowsComponent - Column { - spacing: Math.ceil(ScreenTools.defaultFontPixelHeight * 0.25) - Repeater { - model: parameterNames - Rectangle { - height: _rowHeight - width: _rowWidth - color: Qt.rgba(0,0,0,0) - Row { - id: factRow - property Fact modelFact: controller.getParameterFact(componentId, modelData) - spacing: Math.ceil(ScreenTools.defaultFontPixelWidth * 0.5) - anchors.verticalCenter: parent.verticalCenter - QGCLabel { - id: nameLabel - width: ScreenTools.defaultFontPixelWidth * 20 - text: factRow.modelFact.name - clip: true - } - QGCLabel { - id: valueLabel - width: ScreenTools.defaultFontPixelWidth * 20 - color: factRow.modelFact.defaultValueAvailable ? (factRow.modelFact.valueEqualsDefault ? __qgcPal.text : __qgcPal.warningText) : __qgcPal.text - text: factRow.modelFact.enumStrings.length == 0 ? factRow.modelFact.valueString + " " + factRow.modelFact.units : factRow.modelFact.enumStringValue - clip: true - } - QGCLabel { - text: factRow.modelFact.shortDescription - } - Component.onCompleted: { - if(_rowWidth < factRow.width + ScreenTools.defaultFontPixelWidth) { - _rowWidth = factRow.width + ScreenTools.defaultFontPixelWidth - } - } + QGCLabel { + id: valueLabel + width: ScreenTools.defaultFontPixelWidth * 20 + color: factRow.modelFact.defaultValueAvailable ? (factRow.modelFact.valueEqualsDefault ? __qgcPal.text : __qgcPal.warningText) : __qgcPal.text + text: factRow.modelFact.enumStrings.length == 0 ? factRow.modelFact.valueString + " " + factRow.modelFact.units : factRow.modelFact.enumStringValue + clip: true } - Rectangle { - width: _rowWidth - height: 1 - color: __qgcPal.text - opacity: 0.15 - anchors.bottom: parent.bottom - anchors.left: parent.left + + QGCLabel { + text: factRow.modelFact.shortDescription } - MouseArea { - anchors.fill: parent - acceptedButtons: Qt.LeftButton - onClicked: { - _editorDialogFact = factRow.modelFact - showDialog(editorDialogComponent, qsTr("Parameter Editor"), qgcView.showDialogDefaultWidth, StandardButton.Cancel | StandardButton.Save) + + Component.onCompleted: { + if(_rowWidth < factRow.width + ScreenTools.defaultFontPixelWidth) { + _rowWidth = factRow.width + ScreenTools.defaultFontPixelWidth } } } + + Rectangle { + width: _rowWidth + height: 1 + color: __qgcPal.text + opacity: 0.15 + anchors.bottom: parent.bottom + anchors.left: parent.left + } + + MouseArea { + anchors.fill: parent + acceptedButtons: Qt.LeftButton + onClicked: { + _editorDialogFact = factRow.modelFact + showDialog(editorDialogComponent, qsTr("Parameter Editor"), qgcView.showDialogDefaultWidth, StandardButton.Cancel | StandardButton.Save) + } + } } } - } + } // QGCViewPanel Component { id: editorDialogComponent @@ -320,44 +260,6 @@ QGCView { } } - Component { - id: searchDialogComponent - - QGCViewDialog { - - function accept() { - _searchResults = controller.searchParametersForComponent(-1, searchFor.text, true /*searchInName.checked*/, true /*searchInDescriptions.checked*/) - _searchFilter = true - hideDialog() - } - - function reject() { - _searchFilter = false - hideDialog() - } - - QGCLabel { - id: searchForLabel - text: qsTr("Search for:") - } - - QGCTextField { - id: searchFor - anchors.topMargin: defaultTextHeight / 3 - anchors.top: searchForLabel.bottom - width: ScreenTools.defaultFontPixelWidth * 20 - } - - QGCLabel { - anchors.topMargin: defaultTextHeight - anchors.top: searchFor.bottom - width: parent.width - wrapMode: Text.WordWrap - text: qsTr("Hint: Leave 'Search For' blank and click Apply to list all parameters sorted by name.") - } - } - } - Component { id: mobileFilePicker diff --git a/src/QmlControls/ParameterEditorController.cc b/src/QmlControls/ParameterEditorController.cc index 7f007c0f0cd256a32a79a72e745d81b2098a9278..84764bdf90ea7b66d2a26d4e45f9cd76bb87a86b 100644 --- a/src/QmlControls/ParameterEditorController.cc +++ b/src/QmlControls/ParameterEditorController.cc @@ -25,14 +25,20 @@ /// @Brief Constructs a new ParameterEditorController Widget. This widget is used within the PX4VehicleConfig set of screens. ParameterEditorController::ParameterEditorController(void) + : _currentComponentId(_vehicle->defaultComponentId()) + , _parameters(new QmlObjectListModel(this)) { - if (_autopilot) { - const QMap >& groupMap = _autopilot->getGroupMap(); - - foreach (int componentId, groupMap.keys()) { - _componentIds += QString("%1").arg(componentId); - } + const QMap >& groupMap = _autopilot->getGroupMap(); + foreach (int componentId, groupMap.keys()) { + _componentIds += QString("%1").arg(componentId); } + + _currentGroup = groupMap[_currentComponentId].keys()[0]; + _updateParameters(); + + connect(this, &ParameterEditorController::searchTextChanged, this, &ParameterEditorController::_updateParameters); + connect(this, &ParameterEditorController::currentComponentIdChanged, this, &ParameterEditorController::_updateParameters); + connect(this, &ParameterEditorController::currentGroupChanged, this, &ParameterEditorController::_updateParameters); } ParameterEditorController::~ParameterEditorController() @@ -42,16 +48,16 @@ ParameterEditorController::~ParameterEditorController() QStringList ParameterEditorController::getGroupsForComponent(int componentId) { - const QMap >& groupMap = _autopilot->getGroupMap(); + const QMap >& groupMap = _autopilot->getGroupMap(); - return groupMap[componentId].keys(); + return groupMap[componentId].keys(); } QStringList ParameterEditorController::getParametersForGroup(int componentId, QString group) { - const QMap >& groupMap = _autopilot->getGroupMap(); - - return groupMap[componentId][group]; + const QMap >& groupMap = _autopilot->getGroupMap(); + + return groupMap[componentId][group]; } QStringList ParameterEditorController::searchParametersForComponent(int componentId, const QString& searchText, bool searchInName, bool searchInDescriptions) @@ -78,8 +84,8 @@ QStringList ParameterEditorController::searchParametersForComponent(int componen void ParameterEditorController::clearRCToParam(void) { - Q_ASSERT(_uas); - _uas->unsetRCToParameterMap(); + Q_ASSERT(_uas); + _uas->unsetRCToParameterMap(); } void ParameterEditorController::saveToFile(const QString& filename) @@ -92,15 +98,15 @@ void ParameterEditorController::saveToFile(const QString& filename) if (!filename.isEmpty()) { QFile file(filename); - if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) { + if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) { qgcApp()->showMessage(QString("Unable to create file: %1").arg(filename)); - return; - } + return; + } - QTextStream stream(&file); - _autopilot->writeParametersToStream(stream); - file.close(); - } + QTextStream stream(&file); + _autopilot->writeParametersToStream(stream); + file.close(); + } } void ParameterEditorController::saveToFilePicker(void) @@ -156,7 +162,7 @@ void ParameterEditorController::loadFromFilePicker(void) void ParameterEditorController::refresh(void) { - _autopilot->refreshAllParameters(); + _autopilot->refreshAllParameters(); } void ParameterEditorController::resetAllToDefaults(void) @@ -170,8 +176,31 @@ void ParameterEditorController::setRCToParam(const QString& paramName) #ifdef __mobile__ Q_UNUSED(paramName) #else - Q_ASSERT(_uas); + Q_ASSERT(_uas); QGCMapRCToParamDialog * d = new QGCMapRCToParamDialog(paramName, _uas, qgcApp()->toolbox()->multiVehicleManager(), MainWindow::instance()); - d->exec(); + d->exec(); #endif } + +void ParameterEditorController::_updateParameters(void) +{ + QObjectList newParameterList; + + if (_searchText.isEmpty()) { + const QMap >& groupMap = _autopilot->getGroupMap(); + foreach (const QString& parameter, groupMap[_currentComponentId][_currentGroup]) { + newParameterList.append(_autopilot->getParameterFact(_currentComponentId, parameter)); + } + } else { + foreach(const QString ¶meter, _autopilot->parameterNames(_vehicle->defaultComponentId())) { + Fact* fact = _autopilot->getParameterFact(_vehicle->defaultComponentId(), parameter); + if (fact->name().contains(_searchText, Qt::CaseInsensitive) || + fact->shortDescription().contains(_searchText, Qt::CaseInsensitive) || + fact->longDescription().contains(_searchText, Qt::CaseInsensitive)) { + newParameterList.append(fact); + } + } + } + + _parameters->swapObjectList(newParameterList); +} diff --git a/src/QmlControls/ParameterEditorController.h b/src/QmlControls/ParameterEditorController.h index 3ab58d2db2d85e1a08420e3dc97271b37b1e278d..74e2d3e05e34a9cf999c876fd78d70a53547f2e4 100644 --- a/src/QmlControls/ParameterEditorController.h +++ b/src/QmlControls/ParameterEditorController.h @@ -20,6 +20,7 @@ #include "AutoPilotPlugin.h" #include "UASInterface.h" #include "FactPanelController.h" +#include "QmlObjectListModel.h" class ParameterEditorController : public FactPanelController { @@ -29,7 +30,11 @@ public: ParameterEditorController(void); ~ParameterEditorController(); - Q_PROPERTY(QStringList componentIds MEMBER _componentIds CONSTANT) + Q_PROPERTY(QString searchText MEMBER _searchText NOTIFY searchTextChanged) + Q_PROPERTY(int currentComponentId MEMBER _currentComponentId NOTIFY currentComponentIdChanged) + Q_PROPERTY(QString currentGroup MEMBER _currentGroup NOTIFY currentGroupChanged) + Q_PROPERTY(QmlObjectListModel* parameters MEMBER _parameters CONSTANT) + Q_PROPERTY(QVariantList componentIds MEMBER _componentIds CONSTANT) Q_INVOKABLE QStringList getGroupsForComponent(int componentId); Q_INVOKABLE QStringList getParametersForGroup(int componentId, QString group); @@ -47,10 +52,20 @@ public: QList model(void); signals: + void searchTextChanged(QString searchText); + void currentComponentIdChanged(int componentId); + void currentGroupChanged(QString group); void showErrorMessage(const QString& errorMsg); - + +private slots: + void _updateParameters(void); + private: - QStringList _componentIds; + QVariantList _componentIds; + QString _searchText; + int _currentComponentId; + QString _currentGroup; + QmlObjectListModel* _parameters; }; #endif diff --git a/src/QmlControls/QGCView.qml b/src/QmlControls/QGCView.qml index 4c54ec9b1835f8e8b4c0a4502e3380b762158d43..0dd6ff6eb44baae61b15a04ddb18490e792b699e 100644 --- a/src/QmlControls/QGCView.qml +++ b/src/QmlControls/QGCView.qml @@ -123,6 +123,9 @@ FactPanel { return } + __rejectButton.enabled = true + __acceptButton.enabled = true + __stopAllAnimations() __dialogCharWidth = charWidth @@ -144,6 +147,9 @@ FactPanel { return } + __rejectButton.enabled = true + __acceptButton.enabled = true + __stopAllAnimations() __dialogCharWidth = showDialogDefaultWidth @@ -302,7 +308,10 @@ FactPanel { anchors.right: __acceptButton.visible ? __acceptButton.left : parent.right anchors.bottom: parent.bottom - onClicked: __dialogComponentLoader.item.reject() + onClicked: { + enabled = false // prevent multiple clicks + __dialogComponentLoader.item.reject() + } } QGCButton { @@ -311,6 +320,7 @@ FactPanel { primary: true onClicked: { + enabled = false // prevent multiple clicks __dialogComponentLoader.item.accept() } } diff --git a/src/QmlControls/QGroundControlQmlGlobal.cc b/src/QmlControls/QGroundControlQmlGlobal.cc index ac1556dd1a1150e4d70e80288a66ffc3dd9568c2..b785bb951d67f85d6f8fa9a1b27b7b2c7078a07d 100644 --- a/src/QmlControls/QGroundControlQmlGlobal.cc +++ b/src/QmlControls/QGroundControlQmlGlobal.cc @@ -14,6 +14,8 @@ #include "QGroundControlQmlGlobal.h" #include +#include +#include static const char* kQmlGlobalKeyName = "QGCQml"; @@ -264,3 +266,11 @@ Fact* QGroundControlQmlGlobal::speedUnits(void) return _speedUnitsFact; } + +bool QGroundControlQmlGlobal::linesIntersect(QPointF line1A, QPointF line1B, QPointF line2A, QPointF line2B) +{ + QPointF intersectPoint; + + return QLineF(line1A, line1B).intersect(QLineF(line2A, line2B), &intersectPoint) == QLineF::BoundedIntersection && + intersectPoint != line1A && intersectPoint != line1B; +} diff --git a/src/QmlControls/QGroundControlQmlGlobal.h b/src/QmlControls/QGroundControlQmlGlobal.h index c2b030fad8c56c503ab7318cb129ad02c839102d..a7efb6c0c5ce457573bdf908ae75ace8e6e742fc 100644 --- a/src/QmlControls/QGroundControlQmlGlobal.h +++ b/src/QmlControls/QGroundControlQmlGlobal.h @@ -130,6 +130,8 @@ public: /// Updates the logging filter rules after settings have changed Q_INVOKABLE void updateLoggingFilterRules(void) { QGCLoggingCategoryRegister::instance()->setFilterRulesFromSettings(QString()); } + Q_INVOKABLE bool linesIntersect(QPointF xLine1, QPointF yLine1, QPointF xLine2, QPointF yLine2); + // Property accesors FlightMapSettings* flightMapSettings () { return _flightMapSettings; } diff --git a/src/QmlControls/QmlObjectListModel.cc b/src/QmlControls/QmlObjectListModel.cc index 3d14e8f031eb97b05efd0e0350bb209413a6afc9..e7687aa162c9526f6c71e0bcddf381d15f6b624a 100644 --- a/src/QmlControls/QmlObjectListModel.cc +++ b/src/QmlControls/QmlObjectListModel.cc @@ -179,7 +179,7 @@ void QmlObjectListModel::append(QObject* object) insert(_objectList.count(), object); } -QObjectList QmlObjectListModel::swapObjectList(QObjectList newlist) +QObjectList QmlObjectListModel::swapObjectList(const QObjectList& newlist) { QObjectList oldlist(_objectList); beginResetModel(); diff --git a/src/QmlControls/QmlObjectListModel.h b/src/QmlControls/QmlObjectListModel.h index 0adcb3fd1bd44ad332467d20d54a8564ccbc8ed5..aefcac74ceb4a5073c5ff45739208a31651b3dbb 100644 --- a/src/QmlControls/QmlObjectListModel.h +++ b/src/QmlControls/QmlObjectListModel.h @@ -37,7 +37,7 @@ public: void setDirty(bool dirty); void append(QObject* object); - QObjectList swapObjectList(QObjectList newlist); + QObjectList swapObjectList(const QObjectList& newlist); void clear(void); QObject* removeAt(int i); QObject* removeOne(QObject* object) { return removeAt(indexOf(object)); } diff --git a/src/VideoStreaming/VideoStreaming.pri b/src/VideoStreaming/VideoStreaming.pri index b13bc9dc059aa80c4c424d190f9fa99a5b04058c..554c2bd0faba62f1050bd072449590756fb1c5d4 100644 --- a/src/VideoStreaming/VideoStreaming.pri +++ b/src/VideoStreaming/VideoStreaming.pri @@ -57,28 +57,24 @@ LinuxBuild { $$GST_ROOT/include/gstreamer-1.0 \ $$GST_ROOT/include/glib-2.0 \ $$GST_ROOT/lib/gstreamer-1.0/include \ - $$GST_ROOT/lib/glib-2.0/include - } - - COPY_FILE_LIST = \ - $$GST_ROOT\\bin\\libffi-6.dll \ - $$GST_ROOT\\bin\\libglib-2.0-0.dll \ - $$GST_ROOT\\bin\\libgmodule-2.0-0.dll \ - $$GST_ROOT\\bin\\libgobject-2.0-0.dll \ - $$GST_ROOT\\bin\\libgstbase-1.0-0.dll \ - $$GST_ROOT\\bin\\libgstreamer-1.0-0.dll \ - $$GST_ROOT\\bin\\libgstvideo-1.0-0.dll \ - $$GST_ROOT\\bin\\libintl-8.dll \ - $$GST_ROOT\\bin\\liborc-0.4-0.dll \ - $$GST_ROOT\\bin\\libwinpthread-1.dll \ - - DESTDIR_WIN = $$replace(DESTDIR, "/", "\\") - - for(COPY_FILE, COPY_FILE_LIST) { - QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY \"$$COPY_FILE\" \"$$DESTDIR_WIN\" + $$GST_ROOT/lib/glib-2.0/include + COPY_FILE_LIST = \ + $$GST_ROOT\\bin\\libffi-6.dll \ + $$GST_ROOT\\bin\\libglib-2.0-0.dll \ + $$GST_ROOT\\bin\\libgmodule-2.0-0.dll \ + $$GST_ROOT\\bin\\libgobject-2.0-0.dll \ + $$GST_ROOT\\bin\\libgstbase-1.0-0.dll \ + $$GST_ROOT\\bin\\libgstreamer-1.0-0.dll \ + $$GST_ROOT\\bin\\libgstvideo-1.0-0.dll \ + $$GST_ROOT\\bin\\libintl-8.dll \ + $$GST_ROOT\\bin\\liborc-0.4-0.dll \ + $$GST_ROOT\\bin\\libwinpthread-1.dll + DESTDIR_WIN = $$replace(DESTDIR, "/", "\\") + for(COPY_FILE, COPY_FILE_LIST) { + QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY \"$$COPY_FILE\" \"$$DESTDIR_WIN\" + } + QMAKE_POST_LINK += $$escape_expand(\\n) } - QMAKE_POST_LINK += $$escape_expand(\\n) - } else:AndroidBuild { #- gstreamer assumed to be installed in $$PWD/../../android/gstreamer-1.0-android-armv7-1.5.2 GST_ROOT = $$PWD/../../gstreamer-1.0-android-armv7-1.5.2 diff --git a/src/ui/uas/UASQuickView.cc b/src/ui/uas/UASQuickView.cc index 05322f058cefe11d3a9379d7ed94144a80bf626e..df55c6776adbe5e0ef3852eb9579858f2ce7e067 100644 --- a/src/ui/uas/UASQuickView.cc +++ b/src/ui/uas/UASQuickView.cc @@ -199,6 +199,7 @@ void UASQuickView::resizeEvent(QResizeEvent *evt) } void UASQuickView::recalculateItemTextSizing() { + return; int minpixelsize = 65535; for (QMap::const_iterator i = uasPropertyToLabelMap.constBegin();i!=uasPropertyToLabelMap.constEnd();i++) { diff --git a/src/ui/uas/UASQuickViewTextItem.cc b/src/ui/uas/UASQuickViewTextItem.cc index 2183cd8bfc7c42bf3e1ff771b52a026aa160e1de..4b10677745bc8dd0f1dffb69be9838723d512061 100644 --- a/src/ui/uas/UASQuickViewTextItem.cc +++ b/src/ui/uas/UASQuickViewTextItem.cc @@ -14,7 +14,7 @@ UASQuickViewTextItem::UASQuickViewTextItem(QWidget *parent) : UASQuickViewItem(p titleLabel->setSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::Minimum); titleLabel->setObjectName(QString::fromUtf8("title")); QFont titlefont = titleLabel->font(); - titlefont.setPixelSize(this->height() / 4.0); + //titlefont.setPixelSize(this->height() / 4.0); titleLabel->setFont(titlefont); layout->addWidget(titleLabel); @@ -25,7 +25,7 @@ UASQuickViewTextItem::UASQuickViewTextItem(QWidget *parent) : UASQuickViewItem(p valueLabel->setObjectName(QString::fromUtf8("value")); valueLabel->setText("0.00"); QFont valuefont = valueLabel->font(); - valuefont.setPixelSize(this->height() / 2.0); + //valuefont.setPixelSize(this->height() / 2.0); valueLabel->setFont(valuefont); layout->addWidget(valueLabel);