diff --git a/.travis.yml b/.travis.yml index 61d0476..6b4afaa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,30 @@ git: matrix: fast_finish: true include: + - name: Ubuntu qmake Qt5.5.1 + os: linux + dist: trusty + group: stable + addons: + apt: + sources: + - ubuntu-toolchain-r-test + - sourceline: 'ppa:beineri/opt-qt551-trusty' + update: true + packages: + - qt55base + - qt55tools + - gcc-6 + - g++-6 + - libc6-i386 + script: + - PATH="/opt/qt55/bin:$PATH" + - CXX="g++-6" + - CC="gcc-6" + - qt55-env.sh + - qmake + - make + - make install - name: Ubuntu qmake dll os: linux dist: xenial diff --git a/CMakeLists.txt b/CMakeLists.txt index d6adb7a..1c9a0f9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.3) set(ads_VERSION "2.3.2") -set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_AUTOMOC ON) @@ -8,7 +8,7 @@ set(CMAKE_AUTORCC ON) project(QtAdvancedDockingSystem VERSION ${ads_VERSION}) option(BUILD_STATIC "Build the static library" OFF) option(BUILD_EXAMPLES "Build the examples" ON) -set(REQUIRED_QT_VERSION 5.7.0) +set(REQUIRED_QT_VERSION 5.5.0) find_package(Qt5Core ${REQUIRED_QT_VERSION} REQUIRED) find_package(Qt5Gui ${REQUIRED_QT_VERSION} REQUIRED) find_package(Qt5Widgets ${REQUIRED_QT_VERSION} REQUIRED) diff --git a/demo/CMakeLists.txt b/demo/CMakeLists.txt index 31a679f..7580503 100644 --- a/demo/CMakeLists.txt +++ b/demo/CMakeLists.txt @@ -1,12 +1,12 @@ cmake_minimum_required(VERSION 3.3) -set (CMAKE_CXX_STANDARD 11) +set (CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOUIC ON) set(CMAKE_AUTORCC ON) project(ads_demo VERSION "1.0") -set(REQUIRED_QT_VERSION 5.7.0) +set(REQUIRED_QT_VERSION 5.5.0) find_package(Qt5Core ${REQUIRED_QT_VERSION} REQUIRED) find_package(Qt5Gui ${REQUIRED_QT_VERSION} REQUIRED) find_package(Qt5Widgets ${REQUIRED_QT_VERSION} REQUIRED) diff --git a/demo/demo.pro b/demo/demo.pro index 5444514..2d787e9 100644 --- a/demo/demo.pro +++ b/demo/demo.pro @@ -3,7 +3,7 @@ ADS_OUT_ROOT = $${OUT_PWD}/.. TARGET = AdvancedDockingSystemDemo DESTDIR = $${ADS_OUT_ROOT}/lib QT += core gui widgets -CONFIG += c++11 +CONFIG += c++14 CONFIG += debug_and_release DEFINES += QT_DEPRECATED_WARNINGS diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index 9fa8931..dafffa7 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -1,11 +1,11 @@ cmake_minimum_required(VERSION 3.3) -set (CMAKE_CXX_STANDARD 11) +set (CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOUIC ON) project(ads_example VERSION "1.0") -set(REQUIRED_QT_VERSION 5.7.0) +set(REQUIRED_QT_VERSION 5.5.0) find_package(Qt5Core ${REQUIRED_QT_VERSION} REQUIRED) find_package(Qt5Gui ${REQUIRED_QT_VERSION} REQUIRED) find_package(Qt5Widgets ${REQUIRED_QT_VERSION} REQUIRED) diff --git a/example/example.pro b/example/example.pro index 1245326..6b37fd4 100644 --- a/example/example.pro +++ b/example/example.pro @@ -5,7 +5,7 @@ QT += core gui widgets TARGET = Example1 DESTDIR = $${ADS_OUT_ROOT}/lib TEMPLATE = app -CONFIG += c++11 +CONFIG += c++14 CONFIG += debug_and_release adsBuildStatic { DEFINES += ADS_STATIC diff --git a/src/DockAreaWidget.cpp b/src/DockAreaWidget.cpp index b1b4218..cddfe49 100644 --- a/src/DockAreaWidget.cpp +++ b/src/DockAreaWidget.cpp @@ -98,7 +98,7 @@ public: */ void insertWidget(int index, QWidget* Widget) { - Widget->setParent(nullptr); + Widget->setParent(nullptr); if (index < 0) { index = m_Widgets.count(); @@ -127,7 +127,7 @@ public: auto LayoutItem = m_ParentLayout->takeAt(1); if (LayoutItem) { - LayoutItem->widget()->setParent(nullptr); + LayoutItem->widget()->setParent(nullptr); } m_CurrentWidget = nullptr; m_CurrentIndex = -1; @@ -167,7 +167,7 @@ public: auto LayoutItem = m_ParentLayout->takeAt(1); if (LayoutItem) { - LayoutItem->widget()->setParent(nullptr); + LayoutItem->widget()->setParent(nullptr); } m_ParentLayout->addWidget(next); @@ -315,9 +315,9 @@ void DockAreaWidgetPrivate::createTitleBar() { TitleBar = new CDockAreaTitleBar(_this); Layout->addWidget(TitleBar); - QObject::connect(tabBar(), &CDockAreaTabBar::tabCloseRequested, _this, &CDockAreaWidget::onTabCloseRequested); - QObject::connect(TitleBar, &CDockAreaTitleBar::tabBarClicked, _this, &CDockAreaWidget::setCurrentIndex); - QObject::connect(tabBar(), &CDockAreaTabBar::tabMoved, _this, &CDockAreaWidget::reorderDockWidget); + QObject::connect(tabBar(), &CDockAreaTabBar::tabCloseRequested, _this, &CDockAreaWidget::onTabCloseRequested); + QObject::connect(TitleBar, &CDockAreaTitleBar::tabBarClicked, _this, &CDockAreaWidget::setCurrentIndex); + QObject::connect(tabBar(), &CDockAreaTabBar::tabMoved, _this, &CDockAreaWidget::reorderDockWidget); } diff --git a/src/DockContainerWidget.cpp b/src/DockContainerWidget.cpp index 10d7b80..6cc3a13 100644 --- a/src/DockContainerWidget.cpp +++ b/src/DockContainerWidget.cpp @@ -127,7 +127,7 @@ public: QGridLayout* Layout = nullptr; QSplitter* RootSplitter = nullptr; bool isFloating = false; - CDockAreaWidget* LastAddedAreaCache[5]; + CDockAreaWidget* LastAddedAreaCache[5]; int VisibleDockAreaCount = -1; CDockAreaWidget* TopLevelDockArea = nullptr; @@ -266,7 +266,7 @@ public: /** * Helper function for creation of new splitter */ - CDockSplitter* newSplitter(Qt::Orientation orientation, QWidget* parent = nullptr) + CDockSplitter* newSplitter(Qt::Orientation orientation, QWidget* parent = nullptr) { CDockSplitter* s = new CDockSplitter(orientation, parent); s->setOpaqueResize(DockManager->configFlags().testFlag(CDockManager::OpaqueSplitterResize)); @@ -290,7 +290,7 @@ public: DockContainerWidgetPrivate::DockContainerWidgetPrivate(CDockContainerWidget* _public) : _this(_public) { - std::fill(std::begin(LastAddedAreaCache),std::end(LastAddedAreaCache), nullptr); + std::fill(std::begin(LastAddedAreaCache),std::end(LastAddedAreaCache), nullptr); } @@ -540,10 +540,10 @@ void DockContainerWidgetPrivate::appendDockAreas(const QList N DockAreas.append(NewDockAreas); for (auto DockArea : NewDockAreas) { - QObject::connect(DockArea, - &CDockAreaWidget::viewToggled, - _this, - std::bind(&DockContainerWidgetPrivate::onDockAreaViewToggled, this, std::placeholders::_1)); + QObject::connect(DockArea, + &CDockAreaWidget::viewToggled, + _this, + std::bind(&DockContainerWidgetPrivate::onDockAreaViewToggled, this, std::placeholders::_1)); } } @@ -613,7 +613,7 @@ bool DockContainerWidgetPrivate::restoreSplitter(QXmlStreamReader& s, QSplitter* Splitter = nullptr; if (!Testing) { - Splitter = newSplitter(static_cast(Orientation)); + Splitter = newSplitter(static_cast(Orientation)); } bool Visible = false; QList Sizes; @@ -1054,7 +1054,7 @@ void CDockContainerWidget::removeDockArea(CDockAreaWidget* area) // Remove are from parent splitter and recursively hide tree of parent // splitters if it has no visible content - area->setParent(nullptr); + area->setParent(nullptr); internal::hideEmptyParentSplitters(Splitter); // If splitter has more than 1 widgets, we are finished and can leave @@ -1085,7 +1085,7 @@ void CDockContainerWidget::removeDockArea(CDockAreaWidget* area) } // We replace the superfluous RootSplitter with the ChildSplitter - ChildSplitter->setParent(nullptr); + ChildSplitter->setParent(nullptr); QLayoutItem* li = d->Layout->replaceWidget(Splitter, ChildSplitter); d->RootSplitter = ChildSplitter; delete li; @@ -1126,14 +1126,14 @@ CDockAreaWidget* CDockContainerWidget::dockAreaAt(const QPoint& GlobalPos) const } } - return nullptr; + return nullptr; } //============================================================================ CDockAreaWidget* CDockContainerWidget::dockArea(int Index) const { - return (Index < dockAreaCount()) ? d->DockAreas[Index] : nullptr; + return (Index < dockAreaCount()) ? d->DockAreas[Index] : nullptr; } diff --git a/src/DockManager.cpp b/src/DockManager.cpp index 638bfc0..44a0a2b 100644 --- a/src/DockManager.cpp +++ b/src/DockManager.cpp @@ -72,7 +72,7 @@ struct DockManagerPrivate QMenu* ViewMenu; CDockManager::eViewMenuInsertionOrder MenuInsertionOrder = CDockManager::MenuAlphabeticallySorted; bool RestoringState = false; - CDockManager::ConfigFlags ConfigFlags = CDockManager::DefaultConfig; + CDockManager::ConfigFlags ConfigFlags = CDockManager::DefaultConfig; /** * Private data constructor diff --git a/src/ads_globals.cpp b/src/ads_globals.cpp index 86133b5..2c6f17e 100644 --- a/src/ads_globals.cpp +++ b/src/ads_globals.cpp @@ -44,7 +44,7 @@ namespace internal void replaceSplitterWidget(QSplitter* Splitter, QWidget* From, QWidget* To) { int index = Splitter->indexOf(From); - From->setParent(nullptr); + From->setParent(nullptr); Splitter->insertWidget(index, To); } @@ -90,18 +90,6 @@ void hideEmptyParentSplitters(CDockSplitter* Splitter) } } -CDockInsertParam::CDockInsertParam(Qt::Orientation orient, bool bottomRight) - : QPair(orient,bottomRight) -{} - -CDockInsertParam::CDockInsertParam(const CDockInsertParam &p) - : QPair(p) -{} - -CDockInsertParam::CDockInsertParam(CDockInsertParam &&p) - : QPair(std::move(p)) -{} - } // namespace internal } // namespace ads diff --git a/src/ads_globals.h b/src/ads_globals.h index caa76af..aa5c99f 100644 --- a/src/ads_globals.h +++ b/src/ads_globals.h @@ -110,10 +110,7 @@ void hideEmptyParentSplitters(CDockSplitter* FirstParentSplitter); class CDockInsertParam : public QPair { public: - CDockInsertParam() = default; - CDockInsertParam(Qt::Orientation orient, bool append); - CDockInsertParam(const CDockInsertParam &p); - CDockInsertParam(CDockInsertParam &&p); + using QPair::QPair; Qt::Orientation orientation() const {return this->first;} bool append() const {return this->second;} int insertOffset() const {return append() ? 1 : 0;} diff --git a/src/src.pro b/src/src.pro index 5703459..b97c1cf 100644 --- a/src/src.pro +++ b/src/src.pro @@ -1,5 +1,5 @@ ADS_OUT_ROOT = $${OUT_PWD}/.. -CONFIG += c++11 +CONFIG += c++14 CONFIG += debug_and_release TARGET = $$qtLibraryTarget(qtadvanceddocking) DEFINES += QT_DEPRECATED_WARNINGS