Unverified Commit d591d86f authored by Daniel Agar's avatar Daniel Agar Committed by GitHub

initial optional cmake support (#6862)

parent 7e616472
......@@ -3,7 +3,6 @@ libs/lib/Frameworks/GStreamer.framework
*.swp
*.nfs
CMakeFiles
*Makefile*
tags
build*/
Info.plist
......@@ -86,4 +85,6 @@ src/latex/
.vagrant/
Qt*-linux*.tar.*
.vs/
libs/airmapd/include/boost
This diff is collapsed.
......@@ -63,6 +63,36 @@ pipeline {
}
}
stage('Linux Debug (cmake)') {
environment {
CCACHE_BASEDIR = "${env.WORKSPACE}"
CMAKE_BUILD_TYPE = 'Debug'
QT_VERSION = "5.11.0"
QT_MKSPEC = "gcc_64"
}
agent {
docker {
image 'mavlink/qgc-build-linux:2018-06-07'
args '-v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
}
}
steps {
sh 'export'
sh 'ccache -z'
sh 'make distclean'
sh 'make submodulesclean'
sh 'make linux'
//sh 'make linux check' // TODO: needs Xvfb or similar
sh 'ccache -s'
sh 'make distclean'
}
post {
cleanup {
sh 'git clean -ff -x -d .'
}
}
}
stage('Linux Release') {
environment {
CCACHE_BASEDIR = "${env.WORKSPACE}"
......@@ -95,6 +125,35 @@ pipeline {
}
}
stage('Linux Release (cmake)') {
environment {
CCACHE_BASEDIR = "${env.WORKSPACE}"
CMAKE_BUILD_TYPE = 'Release'
QT_VERSION = "5.11.0"
QT_MKSPEC = "gcc_64"
}
agent {
docker {
image 'mavlink/qgc-build-linux:2018-06-07'
args '-v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
}
}
steps {
sh 'export'
sh 'ccache -z'
sh 'make distclean'
sh 'make submodulesclean'
sh 'make linux'
sh 'ccache -s'
sh 'make distclean'
}
post {
cleanup {
sh 'git clean -ff -x -d .'
}
}
}
stage('OSX Debug') {
agent {
node {
......@@ -123,6 +182,34 @@ pipeline {
}
}
stage('OSX Debug (cmake)') {
agent {
node {
label 'mac'
}
}
environment {
CCACHE_BASEDIR = "${env.WORKSPACE}"
CMAKE_BUILD_TYPE = 'Debug'
QT_VERSION = "5.11.0"
QT_MKSPEC = "clang_64"
}
steps {
sh 'export'
sh 'ccache -z'
sh 'make distclean'
sh 'make submodulesclean'
sh 'make mac'
sh 'ccache -s'
sh 'make distclean'
}
post {
cleanup {
sh 'git clean -ff -x -d .'
}
}
}
stage('OSX Release') {
agent {
node {
......@@ -175,6 +262,34 @@ pipeline {
}
}
stage('OSX Release (cmake)') {
agent {
node {
label 'mac'
}
}
environment {
CCACHE_BASEDIR = "${env.WORKSPACE}"
CMAKE_BUILD_TYPE = 'Release'
QT_VERSION = "5.11.0"
QT_MKSPEC = "clang_64"
}
steps {
sh 'export'
sh 'ccache -z'
sh 'make distclean'
sh 'make submodulesclean'
sh 'make mac'
sh 'ccache -s'
sh 'make distclean'
}
post {
cleanup {
sh 'git clean -ff -x -d .'
}
}
}
} // parallel
} // stage('build')
} // stages
......
# Enforce the presence of the GIT repository
#
# We depend on our submodules, so we have to prevent attempts to
# compile without it being present.
ifeq ($(wildcard .git),)
$(error YOU HAVE TO USE GIT TO DOWNLOAD THIS REPOSITORY. ABORTING.)
endif
# explicity set default build target
all: linux
# Parsing
# --------------------------------------------------------------------
# assume 1st argument passed is the main target, the
# rest are arguments to pass to the makefile generated
# by cmake in the subdirectory
FIRST_ARG := $(firstword $(MAKECMDGOALS))
ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
j ?= 4
NINJA_BIN := ninja
ifndef NO_NINJA_BUILD
NINJA_BUILD := $(shell $(NINJA_BIN) --version 2>/dev/null)
ifndef NINJA_BUILD
NINJA_BIN := ninja-build
NINJA_BUILD := $(shell $(NINJA_BIN) --version 2>/dev/null)
endif
endif
ifdef NINJA_BUILD
PX4_CMAKE_GENERATOR := Ninja
PX4_MAKE := $(NINJA_BIN)
ifdef VERBOSE
PX4_MAKE_ARGS := -v
else
PX4_MAKE_ARGS :=
endif
else
ifdef SYSTEMROOT
# Windows
PX4_CMAKE_GENERATOR := "MSYS\ Makefiles"
else
PX4_CMAKE_GENERATOR := "Unix\ Makefiles"
endif
PX4_MAKE = $(MAKE)
PX4_MAKE_ARGS = -j$(j) --no-print-directory
endif
CMAKE_BUILD_TYPE ?= RelWithDebInfo
SRC_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
# Functions
# --------------------------------------------------------------------
# describe how to build a cmake config
define cmake-build
+@$(eval BUILD_DIR = $(SRC_DIR)/build/$@$(BUILD_DIR_SUFFIX))
+@if [ $(PX4_CMAKE_GENERATOR) = "Ninja" ] && [ -e $(BUILD_DIR)/Makefile ]; then rm -rf $(BUILD_DIR); fi
+@if [ ! -e $(BUILD_DIR)/CMakeCache.txt ]; then mkdir -p $(BUILD_DIR) && cd $(BUILD_DIR) && cmake $(2) -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -G"$(PX4_CMAKE_GENERATOR)" -DQT_MKSPEC=$(1) || (rm -rf $(BUILD_DIR)); fi
+@(cd $(BUILD_DIR) && $(PX4_MAKE) $(PX4_MAKE_ARGS) $(ARGS))
endef
# Qt mkspec
# android_armv7 android_x86 gcc_64
gcc_64:
$(call cmake-build,$@,$(SRC_DIR))
android_armv7:
$(call cmake-build,$@,$(SRC_DIR))
android_x86:
$(call cmake-build,$@,$(SRC_DIR))
clang_64:
$(call cmake-build,$@,$(SRC_DIR))
xcode:
@mkdir -p build/xcode; cd build/xcode; cmake -GXcode -DCMAKE_BUILD_TYPE=RelWithDebInfo $(SRC_DIR)
linux: gcc_64
android: android_armv7
mac: clang_64
# Astyle
# --------------------------------------------------------------------
.PHONY: check_format format
check_format:
$(call colorecho,"Checking formatting with astyle")
@$(SRC_DIR)/Tools/astyle/check_code_style_all.sh
@cd $(SRC_DIR) && git diff --check
format:
$(call colorecho,"Formatting with astyle")
@$(SRC_DIR)/Tools/astyle/check_code_style_all.sh --fix
# Testing
# --------------------------------------------------------------------
.PHONY: tests tests_coverage
tests:
tests_coverage:
# Cleanup
# --------------------------------------------------------------------
.PHONY: clean submodulesclean submodulesupdate distclean
clean:
@rm -rf $(SRC_DIR)/build
submodulesclean:
@git submodule foreach --quiet --recursive git clean -ff -x -d
@git submodule update --quiet --init --recursive --force || true
@git submodule sync --recursive
@git submodule update --init --recursive --force
submodulesupdate:
@git submodule update --quiet --init --recursive || true
@git submodule sync --recursive
@git submodule update --init --recursive
distclean:
@git submodule deinit -f .
@git clean -ff -x -d -e ".project" -e ".cproject" -e ".idea" -e ".settings" -e ".vscode"
......@@ -57,7 +57,6 @@ linux {
macx-clang | macx-llvm {
message("Mac build")
CONFIG += MacBuild
DEFINES += __macos__
CONFIG += x86_64
CONFIG -= x86
equals(QT_MAJOR_VERSION, 5) | greaterThan(QT_MINOR_VERSION, 5) {
......
<?xml version="1.0"?>
<manifest android:versionName="@QT_ANDROID_APP_VERSION@" package="@QT_ANDROID_APP_PACKAGE_NAME@" android:installLocation="auto" xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="@QT_ANDROID_APP_VERSION_CODE@">
<application android:label="@QT_ANDROID_APP_NAME@" android:name="org.qtproject.qt5.android.bindings.QtApplication">
<activity android:label="@QT_ANDROID_APP_NAME@" android:name="org.qtproject.qt5.android.bindings.QtActivity" android:screenOrientation="unspecified" android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|locale|fontScale|keyboard|keyboardHidden|navigation">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<meta-data android:name="android.app.lib_name" android:value="-- %%INSERT_APP_LIB_NAME%% --"/>
<meta-data android:name="android.app.qt_sources_resource_id" android:resource="@array/qt_sources"/>
<meta-data android:name="android.app.repository" android:value="default"/>
<meta-data android:name="android.app.qt_libs_resource_id" android:resource="@array/qt_libs"/>
<meta-data android:name="android.app.bundled_libs_resource_id" android:resource="@array/bundled_libs"/>
<!-- Deploy Qt libs as part of package -->
<meta-data android:name="android.app.bundle_local_qt_libs" android:value="-- %%BUNDLE_LOCAL_QT_LIBS%% --"/>
<meta-data android:name="android.app.bundled_in_lib_resource_id" android:resource="@array/bundled_in_lib"/>
<meta-data android:name="android.app.bundled_in_assets_resource_id" android:resource="@array/bundled_in_assets"/>
<!-- Run with local libs -->
<meta-data android:name="android.app.use_local_qt_libs" android:value="-- %%USE_LOCAL_QT_LIBS%% --"/>
<meta-data android:name="android.app.libs_prefix" android:value="/data/local/tmp/qt/"/>
<meta-data android:name="android.app.load_local_libs" android:value="-- %%INSERT_LOCAL_LIBS%% --"/>
<meta-data android:name="android.app.load_local_jars" android:value="-- %%INSERT_LOCAL_JARS%% --"/>
<meta-data android:name="android.app.static_init_classes" android:value="-- %%INSERT_INIT_CLASSES%% --"/>
<!-- Messages maps -->
<!--<meta-data android:name="android.app.ministro_not_found_msg" android:value="@string/ministro_not_found_msg"/>
<meta-data android:name="android.app.ministro_needed_msg" android:value="@string/ministro_needed_msg"/>
<meta-data android:name="android.app.fatal_error_msg" android:value="@string/fatal_error_msg"/>-->
</activity>
</application>
<supports-screens android:anyDensity="true" android:normalScreens="true" android:smallScreens="true" android:largeScreens="true"/>
<uses-sdk android:minSdkVersion="18" android:targetSdkVersion="19"/>
<uses-permission android:name="android.permission.INTERNET" />
</manifest>
cmake_minimum_required(VERSION 3.0)
cmake_policy(SET CMP0026 OLD) # allow use of the LOCATION target property
# store the current source directory for future use
set(QT_ANDROID_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR})
# check the JAVA_HOME environment variable
# (I couldn't find a way to set it from this script, it has to be defined outside)
set(JAVA_HOME $ENV{JAVA_HOME})
if(NOT JAVA_HOME)
message(FATAL_ERROR "The JAVA_HOME environment variable is not set. Please set it to the root directory of the JDK.")
endif()
# make sure that the Android toolchain is used
if(NOT ANDROID)
message(FATAL_ERROR "Trying to use the CMake Android package without the Android toolchain. Please use the provided toolchain (toolchain/android.toolchain.cmake)")
endif()
# find the Qt root directory
if(NOT Qt5Core_DIR)
find_package(Qt5Core REQUIRED)
endif()
get_filename_component(QT_ANDROID_QT_ROOT "${Qt5Core_DIR}/../../.." ABSOLUTE)
message(STATUS "Found Qt for Android: ${QT_ANDROID_QT_ROOT}")
# find the Android SDK
if(NOT QT_ANDROID_SDK_ROOT)
set(QT_ANDROID_SDK_ROOT $ENV{ANDROID_SDK})
if(NOT QT_ANDROID_SDK_ROOT)
message(FATAL_ERROR "Could not find the Android SDK. Please set either the ANDROID_SDK environment variable, or the QT_ANDROID_SDK_ROOT CMake variable to the root directory of the Android SDK")
endif()
endif()
string(REPLACE "\\" "/" QT_ANDROID_SDK_ROOT ${QT_ANDROID_SDK_ROOT}) # androiddeployqt doesn't like backslashes in paths
message(STATUS "Found Android SDK: ${QT_ANDROID_SDK_ROOT}")
# find the Android NDK
if(NOT QT_ANDROID_NDK_ROOT)
set(QT_ANDROID_NDK_ROOT $ENV{ANDROID_NDK})
if(NOT QT_ANDROID_NDK_ROOT)
set(QT_ANDROID_NDK_ROOT ${ANDROID_NDK})
if(NOT QT_ANDROID_NDK_ROOT)
message(FATAL_ERROR "Could not find the Android NDK. Please set either the ANDROID_NDK environment or CMake variable, or the QT_ANDROID_NDK_ROOT CMake variable to the root directory of the Android NDK")
endif()
endif()
endif()
string(REPLACE "\\" "/" QT_ANDROID_NDK_ROOT ${QT_ANDROID_NDK_ROOT}) # androiddeployqt doesn't like backslashes in paths
message(STATUS "Found Android NDK: ${QT_ANDROID_NDK_ROOT}")
include(CMakeParseArguments)
# define a macro to create an Android APK target
#
# example:
# add_qt_android_apk(my_app_apk my_app
# NAME "My App"
# VERSION_CODE 12
# PACKAGE_NAME "org.mycompany.myapp"
# PACKAGE_SOURCES ${CMAKE_CURRENT_LIST_DIR}/my-android-sources
# BUILDTOOLS_REVISION "23.0.3"
# KEYSTORE ${CMAKE_CURRENT_LIST_DIR}/mykey.keystore myalias
# KEYSTORE_PASSWORD xxxx
# DEPENDS a_linked_target "path/to/a_linked_library.so" ...
# INSTALL
#)
#
macro(add_qt_android_apk TARGET SOURCE_TARGET)
# parse the macro arguments
cmake_parse_arguments(ARG "INSTALL" "NAME;VERSION_CODE;PACKAGE_NAME;PACKAGE_SOURCES;KEYSTORE_PASSWORD;BUILDTOOLS_REVISION" "DEPENDS;KEYSTORE" ${ARGN})
# extract the full path of the source target binary
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
get_property(QT_ANDROID_APP_PATH TARGET ${SOURCE_TARGET} PROPERTY DEBUG_LOCATION)
else()
get_property(QT_ANDROID_APP_PATH TARGET ${SOURCE_TARGET} PROPERTY LOCATION)
endif()
# define the application name
if(ARG_NAME)
set(QT_ANDROID_APP_NAME ${ARG_NAME})
else()
set(QT_ANDROID_APP_NAME ${SOURCE_TARGET})
endif()
# define the application package name
if(ARG_PACKAGE_NAME)
set(QT_ANDROID_APP_PACKAGE_NAME ${ARG_PACKAGE_NAME})
else()
set(QT_ANDROID_APP_PACKAGE_NAME org.qtproject.${SOURCE_TARGET})
endif()
# set the Android SDK build-tools revision
if(ARG_BUILDTOOLS_REVISION)
set(QT_ANDROID_SDK_BUILDTOOLS_REVISION ${ARG_BUILDTOOLS_REVISION})
else()
set(QT_ANDROID_SDK_BUILDTOOLS_REVISION "")
endif()
# define the application source package directory
if(ARG_PACKAGE_SOURCES)
set(QT_ANDROID_APP_PACKAGE_SOURCE_ROOT ${ARG_PACKAGE_SOURCES})
else()
# get version code from arguments, or generate a fixed one if not provided
set(QT_ANDROID_APP_VERSION_CODE ${ARG_VERSION_CODE})
if(NOT QT_ANDROID_APP_VERSION_CODE)
set(QT_ANDROID_APP_VERSION_CODE 1)
endif()
# try to extract the app version from the target properties, or use the version code if not provided
get_property(QT_ANDROID_APP_VERSION TARGET ${SOURCE_TARGET} PROPERTY VERSION)
if(NOT QT_ANDROID_APP_VERSION)
set(QT_ANDROID_APP_VERSION ${QT_ANDROID_APP_VERSION_CODE})
endif()
# create a subdirectory for the extra package sources
set(QT_ANDROID_APP_PACKAGE_SOURCE_ROOT "${CMAKE_CURRENT_BINARY_DIR}/package")
# generate a manifest from the template
configure_file(${QT_ANDROID_SOURCE_DIR}/AndroidManifest.xml.in ${QT_ANDROID_APP_PACKAGE_SOURCE_ROOT}/AndroidManifest.xml @ONLY)
endif()
# set the list of dependant libraries
if(ARG_DEPENDS)
foreach(LIB ${ARG_DEPENDS})
if(TARGET ${LIB})
# item is a CMake target, extract the library path
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
get_property(LIB_PATH TARGET ${LIB} PROPERTY DEBUG_LOCATION)
else()
get_property(LIB_PATH TARGET ${LIB} PROPERTY LOCATION)
endif()
set(LIB ${LIB_PATH})
endif()
if(EXTRA_LIBS)
set(EXTRA_LIBS "${EXTRA_LIBS},${LIB}")
else()
set(EXTRA_LIBS "${LIB}")
endif()
endforeach()
set(QT_ANDROID_APP_EXTRA_LIBS "\"android-extra-libs\": \"${EXTRA_LIBS}\",")
endif()
# make sure that the output directory for the Android package exists
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/libs/${ANDROID_ABI})
# create the configuration file that will feed androiddeployqt
configure_file(${QT_ANDROID_SOURCE_DIR}/qtdeploy.json.in ${CMAKE_CURRENT_BINARY_DIR}/qtdeploy.json @ONLY)
# check if the apk must be signed
if(ARG_KEYSTORE)
set(SIGN_OPTIONS --release --sign ${ARG_KEYSTORE} --tsa http://timestamp.digicert.com)
if(ARG_KEYSTORE_PASSWORD)
set(SIGN_OPTIONS ${SIGN_OPTIONS} --storepass ${ARG_KEYSTORE_PASSWORD})
endif()
endif()
# check if the apk must be installed to the device
if(ARG_INSTALL)
set(INSTALL_OPTIONS --reinstall)
endif()
# specify the Android API level
if(ANDROID_NATIVE_API_LEVEL)
set(TARGET_LEVEL_OPTIONS --android-platform android-${ANDROID_NATIVE_API_LEVEL})
endif()
# create a custom command that will run the androiddeployqt utility to prepare the Android package
add_custom_target(
${TARGET}
ALL
DEPENDS ${SOURCE_TARGET}
COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_CURRENT_BINARY_DIR}/libs/${ANDROID_ABI} # it seems that recompiled libraries are not copied if we don't remove them first
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/libs/${ANDROID_ABI}
COMMAND ${CMAKE_COMMAND} -E copy ${QT_ANDROID_APP_PATH} ${CMAKE_CURRENT_BINARY_DIR}/libs/${ANDROID_ABI}
COMMAND ${QT_ANDROID_QT_ROOT}/bin/androiddeployqt --verbose --output ${CMAKE_CURRENT_BINARY_DIR} --input ${CMAKE_CURRENT_BINARY_DIR}/qtdeploy.json --gradle ${TARGET_LEVEL_OPTIONS} ${INSTALL_OPTIONS} ${SIGN_OPTIONS}
)
endmacro()
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
<key>CFBundleGetInfoString</key>
<string>${MACOSX_BUNDLE_INFO_STRING}</string>
<key>CFBundleIconFile</key>
<string>${MACOSX_BUNDLE_ICON_FILE}</string>
<key>CFBundleIdentifier</key>
<string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleLongVersionString</key>
<string>${MACOSX_BUNDLE_LONG_VERSION_STRING}</string>
<key>CFBundleName</key>
<string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
<key>CSResourcesFileMapped</key>
<true/>
<key>LSRequiresCarbon</key>
<true/>
<key>NSHumanReadableCopyright</key>
<string>${MACOSX_BUNDLE_COPYRIGHT}</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>
# The MIT License (MIT)
#
# Copyright (c) 2017 Nathan Osman
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
find_package(Qt5Core REQUIRED)
# Retrieve the absolute path to qmake and then use that path to find
# the macdeployqt binary
get_target_property(_qmake_executable Qt5::qmake IMPORTED_LOCATION)
get_filename_component(_qt_bin_dir "${_qmake_executable}" DIRECTORY)
find_program(MACDEPLOYQT_EXECUTABLE macdeployqt HINTS "${_qt_bin_dir}")
# Add commands that copy the required Qt files to the application bundle
# represented by the target
function(macdeployqt target)
add_custom_command(TARGET ${target} POST_BUILD
COMMAND "${MACDEPLOYQT_EXECUTABLE}"
\"$<TARGET_FILE_DIR:${target}>/../..\"
-always-overwrite
COMMENT "Deploying Qt..."
)
endfunction()
mark_as_advanced(MACDEPLOYQT_EXECUTABLE)
# The MIT License (MIT)
#
# Copyright (c) 2017 Nathan Osman
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
find_package(Qt5Core REQUIRED)
# Retrieve the absolute path to qmake and then use that path to find
# the windeployqt binary
get_target_property(_qmake_executable Qt5::qmake IMPORTED_LOCATION)
get_filename_component(_qt_bin_dir "${_qmake_executable}" DIRECTORY)
find_program(WINDEPLOYQT_EXECUTABLE windeployqt HINTS "${_qt_bin_dir}")
# Running this with MSVC 2015 requires CMake 3.6+
if((MSVC_VERSION VERSION_EQUAL 1900 OR MSVC_VERSION VERSION_GREATER 1900)
AND CMAKE_VERSION VERSION_LESS "3.6")
message(WARNING "Deploying with MSVC 2015+ requires CMake 3.6+")
endif()
# Add commands that copy the Qt runtime to the target's output directory after
# build and install the Qt runtime to the specified directory
function(windeployqt target directory)
# Run windeployqt immediately after build
add_custom_command(TARGET ${target} POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E
env PATH="${_qt_bin_dir}" "${WINDEPLOYQT_EXECUTABLE}"
--verbose 0
--no-compiler-runtime
--no-angle
--no-opengl-sw
\"$<TARGET_FILE:${target}>\"
)
# install(CODE ...) doesn't support generator expressions, but
# file(GENERATE ...) does - store the path in a file
file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${target}_path"
CONTENT "$<TARGET_FILE:${target}>"
)
# Before installation, run a series of commands that copy each of the Qt
# runtime files to the appropriate directory for installation
install(CODE
"
file(READ \"${CMAKE_CURRENT_BINARY_DIR}/${target}_path\" _file)
execute_process(
COMMAND \"${CMAKE_COMMAND}\" -E
env PATH=\"${_qt_bin_dir}\" \"${WINDEPLOYQT_EXECUTABLE}\"
--dry-run
--no-compiler-runtime
--no-angle
--no-opengl-sw
--list mapping
\${_file}
OUTPUT_VARIABLE _output
OUTPUT_STRIP_TRAILING_WHITESPACE
)
separate_arguments(_files WINDOWS_COMMAND \${_output})
while(_files)
list(GET _files 0 _src)
list(GET _files 1 _dest)
execute_process(
COMMAND \"${CMAKE_COMMAND}\" -E
copy \${_src} \"\${CMAKE_INSTALL_PREFIX}/${directory}/\${_dest}\"
)
list(REMOVE_AT _files 0 1)
endwhile()
"
)
# windeployqt doesn't work correctly with the system runtime libraries,
# so we fall back to one of CMake's own modules for copying them over
set(CMAKE_INSTALL_UCRT_LIBRARIES TRUE)
include(InstallRequiredSystemLibraries)
foreach(lib ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS})
get_filename_component(filename "${lib}" NAME)
add_custom_command(TARGET ${target} POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E
copy_if_different "${lib}" \"$<TARGET_FILE_DIR:${target}>\"
)
endforeach()
endfunction()
mark_as_advanced(WINDEPLOYQT_EXECUTABLE)
This diff is collapsed.
{
"description": "This file is to be read by androiddeployqt",
"qt": "@QT_ANDROID_QT_ROOT@",
"sdk": "@QT_ANDROID_SDK_ROOT@",
"ndk": "@QT_ANDROID_NDK_ROOT@",
"sdkBuildToolsRevision": "@QT_ANDROID_SDK_BUILDTOOLS_REVISION@",
"toolchain-prefix": "@ANDROID_TOOLCHAIN_MACHINE_NAME@",
"tool-prefix": "@ANDROID_TOOLCHAIN_MACHINE_NAME@",
"toolchain-version": "@ANDROID_COMPILER_VERSION@",
"ndk-host": "@ANDROID_NDK_HOST_SYSTEM_NAME@",
"target-architecture": "@ANDROID_ABI@",
"application-binary": "@QT_ANDROID_APP_PATH@",
"android-package": "@QT_ANDROID_APP_PACKAGE_NAME@",
"android-app-name": "@QT_ANDROID_APP_NAME@",
@QT_ANDROID_APP_EXTRA_LIBS@
"android-package-source-directory": "@QT_ANDROID_APP_PACKAGE_SOURCE_ROOT@"
}
#include "winver.h"
IDI_ICON1 ICON DISCARDABLE "@ICON_FILE@"
VS_VERSION_INFO VERSIONINFO
FILEVERSION @PROJECT_VERSION_MAJOR@,@PROJECT_VERSION_MINOR@,@PROJECT_VERSION_PATCH@,@PROJECT_VERSION_TWEAK@
PRODUCTVERSION @PROJECT_VERSION_MAJOR@,@PROJECT_VERSION_MINOR@,@PROJECT_VERSION_PATCH@,@PROJECT_VERSION_TWEAK@
FILEFLAGS 0x0L
FILEFLAGSMASK 0x3fL
FILEOS 0x00040004L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "000004b0"
BEGIN
VALUE "CompanyName", "@COMPANY@"
VALUE "FileDescription", "@PROJECT_NAME@"
VALUE "FileVersion", "@PROJECT_VERSION@"
VALUE "LegalCopyright", "@COPYRIGHT@"
VALUE "InternalName", "@PROJECT_NAME@"
VALUE "OriginalFilename", "@PROJECT_NAME@.exe"
VALUE "ProductName", "@PROJECT_NAME@"
VALUE "ProductVersion", "@PROJECT_VERSION@"
END
END
END
#!/bin/bash -x
set +e
#set +e
if [[ $# -eq 0 ]]; then
echo 'create_linux_appimage.sh QGC_SRC_DIR QGC_RELEASE_DIR'
......@@ -56,27 +56,27 @@ dpkg -x libts-0.0-0_1.0-11_amd64.deb libts
cp -L libts/usr/lib/x86_64-linux-gnu/libts-0.0.so.0 ${APPDIR}/usr/lib/x86_64-linux-gnu/
# copy QGroundControl release into appimage
cp -r ${QGC_RELEASE_DIR}/* ${APPDIR}/
rsync -av --exclude=*.cpp --exclude=*.h --exclude=*.o --exclude="CMake*" --exclude="*.cmake" ${QGC_RELEASE_DIR}/* ${APPDIR}/
rm -rf ${APPDIR}/package
mv ${APPDIR}/qgroundcontrol-start.sh ${APPDIR}/AppRun
cp ${QGC_SRC}/deploy/qgroundcontrol-start.sh ${APPDIR}/AppRun
# copy icon
cp ${QGC_SRC}/resources/icons/qgroundcontrol.png ${APPDIR}/
cat > ./qgroundcontrol.desktop <<\EOF
cat > ./QGroundControl.desktop <<\EOF
[Desktop Entry]
Type=Application
Name=QGroundControl
GenericName=Ground Control Station
Comment=UAS ground control station
Icon=qgroundcontrol
Icon=QGroundControl
Exec=AppRun
Terminal=false
Categories=Utility;
Keywords=computer;
EOF
VERSION=$(strings ${APPDIR}/qgroundcontrol | grep '^v[0-9*]\.[0-9*].[0-9*]' | head -n 1)
VERSION=$(strings ${APPDIR}/QGroundControl | grep '^v[0-9*]\.[0-9*].[0-9*]' | head -n 1)
echo QGC Version: ${VERSION}
# Go out of AppImage
......
......@@ -11139,19 +11139,6 @@ Errors:
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QGCWebView</name>
<message>
<location filename="../src/ui/QGCWebView.ui" line="14"/>
<source>Form</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ui/QGCWebView.ui" line="21"/>
<source>about:blank</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QGCXPlaneLink</name>
<message>
......
......@@ -382,7 +382,7 @@ FORMS += \
!MobileBuild {
FORMS += \
src/ui/Linechart.ui \
src/ui/linechart/Linechart.ui \
src/ui/MultiVehicleDockWidget.ui \
src/ui/QGCHilConfiguration.ui \
src/ui/QGCHilFlightGearConfiguration.ui \
......
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
/// @file
/// @author Don Gagne <don@thegagnes.com>
#include "PowerComponentController.h"
#include "QGCMAVLink.h"
#include "UAS.h"
#include <QVariant>
#include <QQmlProperty>
PowerComponentController::PowerComponentController(void)
{
}
PowerComponentController::~PowerComponentController()
{
_stopCalibration();
}
void PowerComponentController::calibrateEsc(void)
{
_warningMessages.clear();
connect(_uas, &UASInterface::textMessageReceived, this, &PowerComponentController::_handleUASTextMessage);
_uas->startCalibration(UASInterface::StartCalibrationEsc);
}
void PowerComponentController::busConfigureActuators(void)
{
_warningMessages.clear();
connect(_uas, &UASInterface::textMessageReceived, this, &PowerComponentController::_handleUASTextMessage);
_uas->startBusConfig(UASInterface::StartBusConfigActuators);
}
void PowerComponentController::stopBusConfigureActuators(void)
{
disconnect(_uas, &UASInterface::textMessageReceived, this, &PowerComponentController::_handleUASTextMessage);
_uas->startBusConfig(UASInterface::EndBusConfigActuators);
}
void PowerComponentController::_stopCalibration(void)
{
disconnect(_uas, &UASInterface::textMessageReceived, this, &PowerComponentController::_handleUASTextMessage);
}
void PowerComponentController::_stopBusConfig(void)
{
_stopCalibration();
}
void PowerComponentController::_handleUASTextMessage(int uasId, int compId, int severity, QString text)
{
Q_UNUSED(compId);
Q_UNUSED(severity);
UASInterface* uas = _autopilot->vehicle()->uas();
Q_ASSERT(uas);
if (uasId != uas->getUASID()) {
return;
}
// All calibration messages start with [cal]
QString calPrefix("[cal] ");
if (!text.startsWith(calPrefix)) {
return;
}
text = text.right(text.length() - calPrefix.length());
// Make sure we can understand this firmware rev
QString calStartPrefix("calibration started: ");
if (text.startsWith(calStartPrefix)) {
text = text.right(text.length() - calStartPrefix.length());
// Split version number and cal type
QStringList parts = text.split(" ");
if (parts.count() != 2) {
emit incorrectFirmwareRevReporting();
return;
}
#if 0
// FIXME: Cal version check is not working. Needs to be able to cancel, calibration
int firmwareRev = parts[0].toInt();
if (firmwareRev < _neededFirmwareRev) {
emit oldFirmware();
return;
}
if (firmwareRev > _neededFirmwareRev) {
emit newerFirmware();
return;
}
#endif
}
if (text == "Connect battery now") {
emit connectBattery();
return;
}
if (text == "Battery connected") {
emit batteryConnected();
return;
}
QString failedPrefix("calibration failed: ");
if (text.startsWith(failedPrefix)) {
QString failureText = text.right(text.length() - failedPrefix.length());
if (failureText.startsWith("Disconnect battery")) {
emit disconnectBattery();
return;
}
_stopCalibration();
emit calibrationFailed(text.right(text.length() - failedPrefix.length()));
return;
}
QString calCompletePrefix("calibration done:");
if (text.startsWith(calCompletePrefix)) {
_stopCalibration();
emit calibrationSuccess(_warningMessages);
return;
}
QString warningPrefix("config warning: ");
if (text.startsWith(warningPrefix)) {
_warningMessages << text.right(text.length() - warningPrefix.length());
}
QString busFailedPrefix("bus conf fail:");
if (text.startsWith(busFailedPrefix)) {
_stopBusConfig();
emit calibrationFailed(text.right(text.length() - failedPrefix.length()));
return;
}
QString busCompletePrefix("bus conf done:");
if (text.startsWith(calCompletePrefix)) {
_stopBusConfig();
emit calibrationSuccess(_warningMessages);
return;
}
QString busWarningPrefix("bus conf warn: ");
if (text.startsWith(busWarningPrefix)) {
_warningMessages << text.right(text.length() - warningPrefix.length());
}
}
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
/// @file
/// @author Don Gagne <don@thegagnes.com>
#ifndef PowerComponentController_H
#define PowerComponentController_H
#include <QObject>
#include <QQuickItem>
#include "UASInterface.h"
#include "FactPanelController.h"
/// Power Component MVC Controller for PowerComponent.qml.
class PowerComponentController : public FactPanelController
{
Q_OBJECT
public:
PowerComponentController(void);
~PowerComponentController();
Q_INVOKABLE void calibrateEsc(void);
Q_INVOKABLE void busConfigureActuators(void);
Q_INVOKABLE void stopBusConfigureActuators(void);
signals:
void oldFirmware(void);
void newerFirmware(void);
void incorrectFirmwareRevReporting(void);
void connectBattery(void);
void disconnectBattery(void);
void batteryConnected(void);
void calibrationFailed(const QString& errorMessage);
void calibrationSuccess(const QStringList& warningMessages);
private slots:
void _handleUASTextMessage(int uasId, int compId, int severity, QString text);
private:
void _stopCalibration(void);
void _stopBusConfig(void);
QStringList _warningMessages;
static const int _neededFirmwareRev = 1;
};
#endif
......@@ -842,7 +842,7 @@ QGCCameraControl::_handleLocalization(QByteArray& bytes)
}
//-- Find out where we are
QLocale locale = QLocale::system();
#if defined (__macos__)
#if defined (Q_OS_MAC)
locale = QLocale(locale.name());
#endif
QString localeName = locale.name().toLower().replace("-", "_");
......
......@@ -10,6 +10,7 @@
#include "KMLFileHelper.h"
#include <QFile>
#include <QVariant>
QDomDocument KMLFileHelper::loadFile(const QString& kmlFile, QString& errorString)
{
......
......@@ -102,7 +102,7 @@ private:
} else
#endif
{
#ifdef __macos__
#ifdef Q_OS_MAC
QString emptyTitle;
QMessageBox box(icon, emptyTitle, title, buttons, parent);
box.setDefaultButton(defaultButton);
......
......@@ -25,7 +25,7 @@
QGCQuickWidget::QGCQuickWidget(QWidget* parent) :
QQuickWidget(parent)
{
#ifndef __macos__
#ifndef Q_OS_MAC
// The following causes the Map control to hang after doing a pinch gesture on mac trackpads.
// By not turning this on for macos we lose pinch gesture, but two finger scroll still zooms the map.
// So it's a decent workaround. Qt bug reported: 53634
......
......@@ -49,19 +49,19 @@ public:
bool isMobile () { return qgcApp()->fakeMobile(); }
#endif
#if defined (__android__)
#if defined (Q_OS_ANDROID)
bool isAndroid () { return true; }
bool isiOS () { return false; }
bool isLinux () { return false; }
bool isMacOS () { return false; }
bool isWindows () { return false; }
#elif defined(__ios__)
#elif defined(Q_OS_IOS)
bool isAndroid () { return false; }
bool isiOS () { return true; }
bool isLinux () { return false; }
bool isMacOS () { return false; }
bool isWindows () { return false; }
#elif defined(__macos__)
#elif defined(Q_OS_MAC)
bool isAndroid () { return false; }
bool isiOS () { return false; }
bool isLinux () { return false; }
......
......@@ -49,7 +49,7 @@
#endif
#if defined(QGC_GST_STREAMING)
#if (defined(__macos__) && defined(QGC_INSTALL_RELEASE)) || defined(Q_OS_WIN)
#if (defined(Q_OS_MAC) && defined(QGC_INSTALL_RELEASE)) || defined(Q_OS_WIN)
static void qgcputenv(const QString& key, const QString& root, const QString& path)
{
QString value = root + path;
......@@ -104,7 +104,7 @@ int start_logger(const char *app_name)
void initializeVideoStreaming(int &argc, char* argv[], char* logpath, char* debuglevel)
{
#if defined(QGC_GST_STREAMING)
#ifdef __macos__
#ifdef Q_OS_MAC
#ifdef QGC_INSTALL_RELEASE
QString currentDir = QCoreApplication::applicationDirPath();
qgcputenv("GST_PLUGIN_SCANNER", currentDir, "/../Frameworks/GStreamer.framework/Versions/1.0/libexec/gstreamer-1.0/gst-plugin-scanner");
......@@ -139,7 +139,7 @@ void initializeVideoStreaming(int &argc, char* argv[], char* logpath, char* debu
// Our own plugin
GST_PLUGIN_STATIC_REGISTER(QGC_VIDEOSINK_PLUGIN);
// The static plugins we use
#if defined(__mobile__) && !defined(__macos__)
#if defined(__mobile__) && !defined(Q_OS_MAC)
GST_PLUGIN_STATIC_REGISTER(coreelements);
GST_PLUGIN_STATIC_REGISTER(libav);
GST_PLUGIN_STATIC_REGISTER(rtp);
......
......@@ -17,7 +17,7 @@
#ifndef GLUTILS_H
#define GLUTILS_H
#if defined(__mobile__) && !defined(__macos__)
#if defined(__mobile__) && !defined(Q_OS_MAC)
#include <QOpenGLFunctions>
#define getQOpenGLFunctions() QOpenGLContext::currentContext()->functions()
#define QOpenGLFunctionsDef QOpenGLFunctions
......
......@@ -625,7 +625,7 @@ bool QGCFlightGearLink::connectSimulation()
// Now set the FG arguments to the arguments from the UI
_fgArgList = uiArgList;
#if defined __macos__
#if defined Q_OS_MAC
// Mac installs will default to the /Applications folder 99% of the time. Anything other than
// that is pretty non-standard so we don't try to get fancy beyond hardcoding that path.
fgAppDir.setPath("/Applications");
......
This diff is collapsed.
/**
* @file
* @brief Definition of 3dConnexion 3dMouse interface for QGroundControl
*
* @author Matthias Krebs <makrebs@student.ethz.ch>
*
*/
#ifndef MOUSE6DOFINPUT_H
#define MOUSE6DOFINPUT_H
#include <QThread>
#ifdef QGC_MOUSE_ENABLED_WIN
#include "Mouse3DInput.h"
#endif //QGC_MOUSE_ENABLED_WIN
#include "UAS.h"
#include "Vehicle.h"
class Mouse6dofInput : public QThread
{
Q_OBJECT
public:
#ifdef QGC_MOUSE_ENABLED_WIN
Mouse6dofInput(Mouse3DInput* mouseInput);
#endif //QGC_MOUSE_ENABLED_WIN
#ifdef QGC_MOUSE_ENABLED_LINUX
Mouse6dofInput(QWidget* parent);
#endif //QGC_MOUSE_ENABLED_LINUX
~Mouse6dofInput();
void run();
const double mouse3DMax;
protected:
void init();
UAS* uas;
bool done;
bool mouseActive;
bool translationActive;
bool rotationActive;
double xValue;
double yValue;
double zValue;
double aValue;
double bValue;
double cValue;
signals:
/**
* @brief Input of the 3d mouse has changed
*
* @param x Input x direction, range [-1, 1]
* @param y Input y direction, range [-1, 1]
* @param z Input z direction, range [-1, 1]
* @param a Input x rotation, range [-1, 1]
* @param b Input y rotation, range [-1, 1]
* @param c Input z rotation, range [-1, 1]
*/
void mouse6dofChanged(double x, double y, double z, double a, double b, double c);
/**
* @brief Activity of translational 3DMouse inputs changed
* @param translationEnable, true: translational inputs active; false: translational inputs ingored
*/
void mouseTranslationActiveChanged(bool translationEnable);
/**
* @brief Activity of rotational 3DMouse inputs changed
* @param rotationEnable, true: rotational inputs active; false: rotational inputs ingored
*/
void mouseRotationActiveChanged(bool rotationEnable);
public slots:
#ifdef QGC_MOUSE_ENABLED_WIN
/** @brief Get a motion input from 3DMouse */
void motion3DMouse(std::vector<float> &motionData);
/** @brief Get a button input from 3DMouse */
void button3DMouseDown(int button);
#endif //QGC_MOUSE_ENABLED_WIN
#ifdef QGC_MOUSE_ENABLED_LINUX
/** @brief Get an XEvent to check it for an 3DMouse event (motion or button) */
void handleX11Event(XEvent* event);
#endif //QGC_MOUSE_ENABLED_LINUX
private slots:
void _activeVehicleChanged(Vehicle* vehicle);
};
#endif // MOUSE6DOFINPUT_H
......@@ -60,6 +60,9 @@
#endif
#ifdef Q_OS_WIN
#include <windows.h>
/// @brief CRT Report Hook installed using _CrtSetReportHook. We install this hook when
/// we don't want asserts to pop a dialog on windows.
int WindowsCrtReportHook(int reportType, char* message, int* returnValue)
......
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
/**
* @file
* @brief Brief Description
*
* @author Lorenz Meier <mavteam@student.ethz.ch>
*
*/
#include <InputConfigurationWidget.h>
#include <MG.h>
#include <QDebug>
InputConfigurationWidget::InputConfigurationWidget(QWidget *parent) : QWidget(parent)
{
/* Add UI components */
ui.setupUi(this);
}
InputConfigurationWidget::~InputConfigurationWidget()
{
}
......@@ -185,19 +185,6 @@ MainWindow::MainWindow()
// Create actions
connectCommonActions();
// Connect user interface devices
#ifdef QGC_MOUSE_ENABLED_WIN
emit initStatusChanged(tr("Initializing 3D mouse interface"), Qt::AlignLeft | Qt::AlignBottom, QColor(62, 93, 141));
mouseInput = new Mouse3DInput(this);
mouse = new Mouse6dofInput(mouseInput);
#endif //QGC_MOUSE_ENABLED_WIN
#if QGC_MOUSE_ENABLED_LINUX
emit initStatusChanged(tr("Initializing 3D mouse interface"), Qt::AlignLeft | Qt::AlignBottom, QColor(62, 93, 141));
mouse = new Mouse6dofInput(this);
connect(this, &MainWindow::x11EventOccured, mouse, &Mouse6dofInput::handleX11Event);
#endif //QGC_MOUSE_ENABLED_LINUX
// Set low power mode
enableLowPowerMode(_lowPowerMode);
......@@ -478,14 +465,6 @@ void MainWindow::saveLastUsedConnection(const QString connection)
settings.setValue(key, connection);
}
#ifdef QGC_MOUSE_ENABLED_LINUX
bool MainWindow::x11Event(XEvent *event)
{
emit x11EventOccured(event);
return false;
}
#endif // QGC_MOUSE_ENABLED_LINUX
#ifdef UNITTEST_BUILD
void MainWindow::_showQmlTestWidget(void)
{
......
......@@ -41,10 +41,6 @@
#include "ui_MainWindow.h"
#if (defined QGC_MOUSE_ENABLED_WIN) | (defined QGC_MOUSE_ENABLED_LINUX)
#include "Mouse6dofInput.h"
#endif // QGC_MOUSE_ENABLED_WIN
class QGCStatusBar;
class Linecharts;
......@@ -109,11 +105,6 @@ signals:
// Used for unit tests to know when the main window closes
void mainWindowClosed(void);
#ifdef QGC_MOUSE_ENABLED_LINUX
/** @brief Forward X11Event to catch 3DMouse inputs */
void x11EventOccured(XEvent *event);
#endif //QGC_MOUSE_ENABLED_LINUX
public:
QGCMAVLinkLogPlayer* getLogPlayer()
{
......@@ -135,12 +126,6 @@ protected:
Mouse6dofInput* mouse; ///< Implementation for 3dMouse input
#endif // QGC_MOUSE_ENABLED_WIN
#ifdef QGC_MOUSE_ENABLED_LINUX
/** @brief Reimplementation of X11Event to handle 3dMouse Events (magellan) */
bool x11Event(XEvent *event);
Mouse6dofInput* mouse; ///< Implementation for 3dMouse input
#endif // QGC_MOUSE_ENABLED_LINUX
/** User interface actions **/
QAction* connectUASAct;
QAction* disconnectUASAct;
......
#include "QGCWebView.h"
#include "ui_QGCWebView.h"
QGCWebView::QGCWebView(QWidget *parent) :
QWidget(parent),
ui(new Ui::QGCWebView)
{
ui->setupUi(this);
ui->webView->settings()->setAttribute(QWebSettings::PluginsEnabled, true);
ui->webView->load(QUrl("http://qgroundcontrol.org"));
}
QGCWebView::~QGCWebView()
{
delete ui;
}
void QGCWebView::changeEvent(QEvent *e)
{
QWidget::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
ui->retranslateUi(this);
break;
default:
break;
}
}
#ifndef QGCWEBVIEW_H
#define QGCWEBVIEW_H
#include <QWidget>
namespace Ui
{
class QGCWebView;
}
class QGCWebView : public QWidget
{
Q_OBJECT
public:
explicit QGCWebView(QWidget *parent = 0);
~QGCWebView();
protected:
void changeEvent(QEvent *e);
private:
Ui::QGCWebView *ui;
};
#endif // QGCWEBVIEW_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>QGCWebView</class>
<widget class="QWidget" name="QGCWebView">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QWebView" name="webView">
<property name="url">
<url>
<string>about:blank</string>
</url>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>QWebView</class>
<extends>QWidget</extends>
<header>QtWebKit/QWebView</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
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