Skip to content

Commit e113790

Browse files
committed
Various fixes after code review
Minimum required Qt lowered to 5.5.0 Added CI for Qt 5.5.1 build Increased C++ standard to C++14 Fixed use of spaces instead of tabs Removed duplicate constructors
1 parent ee616c2 commit e113790

12 files changed

+54
-45
lines changed

.travis.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,30 @@ git:
88
matrix:
99
fast_finish: true
1010
include:
11+
- name: Ubuntu qmake Qt5.5.1
12+
os: linux
13+
dist: trusty
14+
group: stable
15+
addons:
16+
apt:
17+
sources:
18+
- ubuntu-toolchain-r-test
19+
- sourceline: 'ppa:beineri/opt-qt551-trusty'
20+
update: true
21+
packages:
22+
- qt55base
23+
- qt55tools
24+
- gcc-6
25+
- g++-6
26+
- libc6-i386
27+
script:
28+
- PATH="/opt/qt55/bin:$PATH"
29+
- CXX="g++-6"
30+
- CC="gcc-6"
31+
- qt55-env.sh
32+
- qmake
33+
- make
34+
- make install
1135
- name: Ubuntu qmake dll
1236
os: linux
1337
dist: xenial

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
cmake_minimum_required(VERSION 3.3)
22
set(ads_VERSION "2.3.2")
3-
set(CMAKE_CXX_STANDARD 11)
3+
set(CMAKE_CXX_STANDARD 14)
44
set(CMAKE_CXX_STANDARD_REQUIRED ON)
55
set(CMAKE_CXX_EXTENSIONS OFF)
66
set(CMAKE_AUTOMOC ON)
77
set(CMAKE_AUTORCC ON)
88
project(QtAdvancedDockingSystem VERSION ${ads_VERSION})
99
option(BUILD_STATIC "Build the static library" OFF)
1010
option(BUILD_EXAMPLES "Build the examples" ON)
11-
set(REQUIRED_QT_VERSION 5.7.0)
11+
set(REQUIRED_QT_VERSION 5.5.0)
1212
find_package(Qt5Core ${REQUIRED_QT_VERSION} REQUIRED)
1313
find_package(Qt5Gui ${REQUIRED_QT_VERSION} REQUIRED)
1414
find_package(Qt5Widgets ${REQUIRED_QT_VERSION} REQUIRED)

demo/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
cmake_minimum_required(VERSION 3.3)
2-
set (CMAKE_CXX_STANDARD 11)
2+
set (CMAKE_CXX_STANDARD 14)
33
set(CMAKE_CXX_STANDARD_REQUIRED ON)
44
set(CMAKE_CXX_EXTENSIONS OFF)
55
set(CMAKE_AUTOMOC ON)
66
set(CMAKE_AUTOUIC ON)
77
set(CMAKE_AUTORCC ON)
88
project(ads_demo VERSION "1.0")
9-
set(REQUIRED_QT_VERSION 5.7.0)
9+
set(REQUIRED_QT_VERSION 5.5.0)
1010
find_package(Qt5Core ${REQUIRED_QT_VERSION} REQUIRED)
1111
find_package(Qt5Gui ${REQUIRED_QT_VERSION} REQUIRED)
1212
find_package(Qt5Widgets ${REQUIRED_QT_VERSION} REQUIRED)

demo/demo.pro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ ADS_OUT_ROOT = $${OUT_PWD}/..
33
TARGET = AdvancedDockingSystemDemo
44
DESTDIR = $${ADS_OUT_ROOT}/lib
55
QT += core gui widgets
6-
CONFIG += c++11
6+
CONFIG += c++14
77
CONFIG += debug_and_release
88
DEFINES += QT_DEPRECATED_WARNINGS
99

example/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
cmake_minimum_required(VERSION 3.3)
2-
set (CMAKE_CXX_STANDARD 11)
2+
set (CMAKE_CXX_STANDARD 14)
33
set(CMAKE_CXX_STANDARD_REQUIRED ON)
44
set(CMAKE_CXX_EXTENSIONS OFF)
55
set(CMAKE_AUTOMOC ON)
66
set(CMAKE_AUTOUIC ON)
77
project(ads_example VERSION "1.0")
8-
set(REQUIRED_QT_VERSION 5.7.0)
8+
set(REQUIRED_QT_VERSION 5.5.0)
99
find_package(Qt5Core ${REQUIRED_QT_VERSION} REQUIRED)
1010
find_package(Qt5Gui ${REQUIRED_QT_VERSION} REQUIRED)
1111
find_package(Qt5Widgets ${REQUIRED_QT_VERSION} REQUIRED)

example/example.pro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ QT += core gui widgets
55
TARGET = Example1
66
DESTDIR = $${ADS_OUT_ROOT}/lib
77
TEMPLATE = app
8-
CONFIG += c++11
8+
CONFIG += c++14
99
CONFIG += debug_and_release
1010
adsBuildStatic {
1111
DEFINES += ADS_STATIC

src/DockAreaWidget.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class CDockAreaLayout
9898
*/
9999
void insertWidget(int index, QWidget* Widget)
100100
{
101-
Widget->setParent(nullptr);
101+
Widget->setParent(nullptr);
102102
if (index < 0)
103103
{
104104
index = m_Widgets.count();
@@ -127,7 +127,7 @@ class CDockAreaLayout
127127
auto LayoutItem = m_ParentLayout->takeAt(1);
128128
if (LayoutItem)
129129
{
130-
LayoutItem->widget()->setParent(nullptr);
130+
LayoutItem->widget()->setParent(nullptr);
131131
}
132132
m_CurrentWidget = nullptr;
133133
m_CurrentIndex = -1;
@@ -167,7 +167,7 @@ class CDockAreaLayout
167167
auto LayoutItem = m_ParentLayout->takeAt(1);
168168
if (LayoutItem)
169169
{
170-
LayoutItem->widget()->setParent(nullptr);
170+
LayoutItem->widget()->setParent(nullptr);
171171
}
172172

173173
m_ParentLayout->addWidget(next);
@@ -315,9 +315,9 @@ void DockAreaWidgetPrivate::createTitleBar()
315315
{
316316
TitleBar = new CDockAreaTitleBar(_this);
317317
Layout->addWidget(TitleBar);
318-
QObject::connect(tabBar(), &CDockAreaTabBar::tabCloseRequested, _this, &CDockAreaWidget::onTabCloseRequested);
319-
QObject::connect(TitleBar, &CDockAreaTitleBar::tabBarClicked, _this, &CDockAreaWidget::setCurrentIndex);
320-
QObject::connect(tabBar(), &CDockAreaTabBar::tabMoved, _this, &CDockAreaWidget::reorderDockWidget);
318+
QObject::connect(tabBar(), &CDockAreaTabBar::tabCloseRequested, _this, &CDockAreaWidget::onTabCloseRequested);
319+
QObject::connect(TitleBar, &CDockAreaTitleBar::tabBarClicked, _this, &CDockAreaWidget::setCurrentIndex);
320+
QObject::connect(tabBar(), &CDockAreaTabBar::tabMoved, _this, &CDockAreaWidget::reorderDockWidget);
321321
}
322322

323323

src/DockContainerWidget.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ class DockContainerWidgetPrivate
127127
QGridLayout* Layout = nullptr;
128128
QSplitter* RootSplitter = nullptr;
129129
bool isFloating = false;
130-
CDockAreaWidget* LastAddedAreaCache[5];
130+
CDockAreaWidget* LastAddedAreaCache[5];
131131
int VisibleDockAreaCount = -1;
132132
CDockAreaWidget* TopLevelDockArea = nullptr;
133133

@@ -266,7 +266,7 @@ class DockContainerWidgetPrivate
266266
/**
267267
* Helper function for creation of new splitter
268268
*/
269-
CDockSplitter* newSplitter(Qt::Orientation orientation, QWidget* parent = nullptr)
269+
CDockSplitter* newSplitter(Qt::Orientation orientation, QWidget* parent = nullptr)
270270
{
271271
CDockSplitter* s = new CDockSplitter(orientation, parent);
272272
s->setOpaqueResize(DockManager->configFlags().testFlag(CDockManager::OpaqueSplitterResize));
@@ -290,7 +290,7 @@ class DockContainerWidgetPrivate
290290
DockContainerWidgetPrivate::DockContainerWidgetPrivate(CDockContainerWidget* _public) :
291291
_this(_public)
292292
{
293-
std::fill(std::begin(LastAddedAreaCache),std::end(LastAddedAreaCache), nullptr);
293+
std::fill(std::begin(LastAddedAreaCache),std::end(LastAddedAreaCache), nullptr);
294294
}
295295

296296

@@ -540,10 +540,10 @@ void DockContainerWidgetPrivate::appendDockAreas(const QList<CDockAreaWidget*> N
540540
DockAreas.append(NewDockAreas);
541541
for (auto DockArea : NewDockAreas)
542542
{
543-
QObject::connect(DockArea,
544-
&CDockAreaWidget::viewToggled,
545-
_this,
546-
std::bind(&DockContainerWidgetPrivate::onDockAreaViewToggled, this, std::placeholders::_1));
543+
QObject::connect(DockArea,
544+
&CDockAreaWidget::viewToggled,
545+
_this,
546+
std::bind(&DockContainerWidgetPrivate::onDockAreaViewToggled, this, std::placeholders::_1));
547547
}
548548
}
549549

@@ -613,7 +613,7 @@ bool DockContainerWidgetPrivate::restoreSplitter(QXmlStreamReader& s,
613613
QSplitter* Splitter = nullptr;
614614
if (!Testing)
615615
{
616-
Splitter = newSplitter(static_cast<Qt::Orientation>(Orientation));
616+
Splitter = newSplitter(static_cast<Qt::Orientation>(Orientation));
617617
}
618618
bool Visible = false;
619619
QList<int> Sizes;
@@ -1054,7 +1054,7 @@ void CDockContainerWidget::removeDockArea(CDockAreaWidget* area)
10541054

10551055
// Remove are from parent splitter and recursively hide tree of parent
10561056
// splitters if it has no visible content
1057-
area->setParent(nullptr);
1057+
area->setParent(nullptr);
10581058
internal::hideEmptyParentSplitters(Splitter);
10591059

10601060
// If splitter has more than 1 widgets, we are finished and can leave
@@ -1085,7 +1085,7 @@ void CDockContainerWidget::removeDockArea(CDockAreaWidget* area)
10851085
}
10861086

10871087
// We replace the superfluous RootSplitter with the ChildSplitter
1088-
ChildSplitter->setParent(nullptr);
1088+
ChildSplitter->setParent(nullptr);
10891089
QLayoutItem* li = d->Layout->replaceWidget(Splitter, ChildSplitter);
10901090
d->RootSplitter = ChildSplitter;
10911091
delete li;
@@ -1126,14 +1126,14 @@ CDockAreaWidget* CDockContainerWidget::dockAreaAt(const QPoint& GlobalPos) const
11261126
}
11271127
}
11281128

1129-
return nullptr;
1129+
return nullptr;
11301130
}
11311131

11321132

11331133
//============================================================================
11341134
CDockAreaWidget* CDockContainerWidget::dockArea(int Index) const
11351135
{
1136-
return (Index < dockAreaCount()) ? d->DockAreas[Index] : nullptr;
1136+
return (Index < dockAreaCount()) ? d->DockAreas[Index] : nullptr;
11371137
}
11381138

11391139

src/DockManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ struct DockManagerPrivate
7272
QMenu* ViewMenu;
7373
CDockManager::eViewMenuInsertionOrder MenuInsertionOrder = CDockManager::MenuAlphabeticallySorted;
7474
bool RestoringState = false;
75-
CDockManager::ConfigFlags ConfigFlags = CDockManager::DefaultConfig;
75+
CDockManager::ConfigFlags ConfigFlags = CDockManager::DefaultConfig;
7676

7777
/**
7878
* Private data constructor

src/ads_globals.cpp

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ namespace internal
4444
void replaceSplitterWidget(QSplitter* Splitter, QWidget* From, QWidget* To)
4545
{
4646
int index = Splitter->indexOf(From);
47-
From->setParent(nullptr);
47+
From->setParent(nullptr);
4848
Splitter->insertWidget(index, To);
4949
}
5050

@@ -90,18 +90,6 @@ void hideEmptyParentSplitters(CDockSplitter* Splitter)
9090
}
9191
}
9292

93-
CDockInsertParam::CDockInsertParam(Qt::Orientation orient, bool bottomRight)
94-
: QPair<Qt::Orientation, bool>(orient,bottomRight)
95-
{}
96-
97-
CDockInsertParam::CDockInsertParam(const CDockInsertParam &p)
98-
: QPair<Qt::Orientation, bool>(p)
99-
{}
100-
101-
CDockInsertParam::CDockInsertParam(CDockInsertParam &&p)
102-
: QPair<Qt::Orientation, bool>(std::move(p))
103-
{}
104-
10593
} // namespace internal
10694
} // namespace ads
10795

0 commit comments

Comments
 (0)