Skip to content

Commit 84b5012

Browse files
authored
Merge pull request #4 from githubuser0xFFFF/master
fork update
2 parents f7c8384 + 664a167 commit 84b5012

38 files changed

+1204
-433
lines changed

.cproject

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,6 @@
7171
</storageModule>
7272
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
7373
<storageModule moduleId="refreshScope"/>
74-
<storageModule moduleId="scannerConfiguration">
75-
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
76-
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1119687795;cdt.managedbuild.toolchain.gnu.mingw.base.1119687795.1949777584;cdt.managedbuild.tool.gnu.cpp.compiler.mingw.base.1947822681;cdt.managedbuild.tool.gnu.cpp.compiler.input.1318830536">
77-
<autodiscovery enabled="false" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"/>
78-
</scannerConfigBuildInfo>
79-
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1119687795;cdt.managedbuild.toolchain.gnu.mingw.base.1119687795.1949777584;cdt.managedbuild.tool.gnu.c.compiler.mingw.base.389117097;cdt.managedbuild.tool.gnu.c.compiler.input.1568363924">
80-
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
81-
</scannerConfigBuildInfo>
82-
</storageModule>
8374
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets">
8475
<buildTargets>
8576
<target name="Build all" path=" build" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
@@ -356,4 +347,13 @@
356347
</target>
357348
</buildTargets>
358349
</storageModule>
350+
<storageModule moduleId="scannerConfiguration">
351+
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
352+
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1119687795;cdt.managedbuild.toolchain.gnu.mingw.base.1119687795.1949777584;cdt.managedbuild.tool.gnu.cpp.compiler.mingw.base.1947822681;cdt.managedbuild.tool.gnu.cpp.compiler.input.1318830536">
353+
<autodiscovery enabled="false" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"/>
354+
</scannerConfigBuildInfo>
355+
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1119687795;cdt.managedbuild.toolchain.gnu.mingw.base.1119687795.1949777584;cdt.managedbuild.tool.gnu.c.compiler.mingw.base.389117097;cdt.managedbuild.tool.gnu.c.compiler.input.1568363924">
356+
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
357+
</scannerConfigBuildInfo>
358+
</storageModule>
359359
</cproject>

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ moc_*
88
ui_*
99
Makefile
1010

11+
# IDEs
12+
.idea

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ set(ads_SRCS
4040
src/ElidingLabel.cpp
4141
src/FloatingDockContainer.cpp
4242
src/ads.qrc
43+
src/linux/FloatingWidgetTitleBar.cpp
4344
)
4445
set(ads_INSTALL_INCLUDE
4546
src/ads_globals.h
@@ -54,6 +55,7 @@ set(ads_INSTALL_INCLUDE
5455
src/DockWidgetTab.h
5556
src/ElidingLabel.h
5657
src/FloatingDockContainer.h
58+
src/linux/FloatingWidgetTitleBar.h
5759
)
5860
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4")
5961
set(ads_PlatformDir "x86")
@@ -84,7 +86,7 @@ install(TARGETS qtadvanceddocking
8486
ARCHIVE DESTINATION lib COMPONENT library
8587
)
8688
target_include_directories(qtadvanceddocking PUBLIC
87-
$<BUILD_INTERFACE:${ads_INCLUDE}>
89+
"$<BUILD_INTERFACE:${ads_INCLUDE}>"
8890
$<INSTALL_INTERFACE:include>
8991
)
9092
target_link_libraries(qtadvanceddocking PUBLIC ${ads_LIBS})

README.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
# Advanced Docking System for Qt
22
[![Build Status](https://travis-ci.org/githubuser0xFFFF/Qt-Advanced-Docking-System.svg?branch=master)](https://travis-ci.org/githubuser0xFFFF/Qt-Advanced-Docking-System)
33
[![Build status](https://ci.appveyor.com/api/projects/status/qcfb3cy932jw9mpy/branch/master?svg=true)](https://ci.appveyor.com/project/githubuser0xFFFF/qt-advanced-docking-system/branch/master)
4+
[![License: LGPL v2.1](https://img.shields.io/badge/License-LGPL%20v2.1-blue.svg)](gnu-lgpl-v2.1.md)
45

56

67

78
Qt Advanced Docking System lets you create customizable layouts using a full
89
featured window docking system similar to what is found in many popular
910
integrated development environements (IDEs) such as Visual Studio.
1011
Everything is implemented with standard Qt functionality without any
11-
platform specific code. Basic usage of QWidgets an QLayouts and using basic
12+
platform specific code. Basic usage of QWidgets and QLayouts and using basic
1213
styles as much as possible.
1314

1415
This work is based on and inspired by the
@@ -60,9 +61,22 @@ main window layout.
6061
![Perspective](doc/perspectives_dark.png)
6162

6263
## Tested Compatible Environments
63-
- Windows 10 [![Build status](https://ci.appveyor.com/api/projects/status/qcfb3cy932jw9mpy/branch/master?svg=true)](https://ci.appveyor.com/project/githubuser0xFFFF/qt-advanced-docking-system/branch/master)
64-
- Ubuntu [![Build Status](https://travis-ci.org/githubuser0xFFFF/Qt-Advanced-Docking-System.svg?branch=master)](https://travis-ci.org/githubuser0xFFFF/Qt-Advanced-Docking-System)
65-
- macOS [![Build Status](https://travis-ci.org/githubuser0xFFFF/Qt-Advanced-Docking-System.svg?branch=master)](https://travis-ci.org/githubuser0xFFFF/Qt-Advanced-Docking-System)
64+
### Windows
65+
Windows 10 [![Build status](https://ci.appveyor.com/api/projects/status/qcfb3cy932jw9mpy/branch/master?svg=true)](https://ci.appveyor.com/project/githubuser0xFFFF/qt-advanced-docking-system/branch/master)
66+
67+
The library was developed on and for Windows. It is used in a commercial Windows application and is therefore constantly tested.
68+
69+
### macOS
70+
macOS [![Build Status](https://travis-ci.org/githubuser0xFFFF/Qt-Advanced-Docking-System.svg?branch=master)](https://travis-ci.org/githubuser0xFFFF/Qt-Advanced-Docking-System)
71+
72+
The application can be compiled for macOS. A user reported, that the library works on macOS. If have not tested it.
73+
74+
### Linux
75+
Ubuntu [![Build Status](https://travis-ci.org/githubuser0xFFFF/Qt-Advanced-Docking-System.svg?branch=master)](https://travis-ci.org/githubuser0xFFFF/Qt-Advanced-Docking-System)
76+
77+
The application can be compiled for Linux and has been developed and tested with **Kubuntu 18.04**.
78+
79+
![Advanced Docking on Linux](doc/linux_kubuntu_1804.png)
6680

6781
## Build
6882
Open the `ads.pro` with QtCreator and start the build, that's it.
@@ -144,5 +158,6 @@ MainWindow::~MainWindow()
144158
- Manuel Freiholz
145159
146160
## License information
161+
[![License: LGPL v2.1](https://img.shields.io/badge/License-LGPL%20v2.1-blue.svg)](gnu-lgpl-v2.1.md)
147162
This project uses the [LGPLv2.1 license](gnu-lgpl-v2.1.md)
148163

demo/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
2323
set(ads_demo_SRCS
2424
main.cpp
2525
MainWindow.cpp
26-
MainWindow.ui
27-
main.qrc
26+
mainwindow.ui
2827
)
2928
add_executable(AdvancedDockingSystemDemo WIN32 ${ads_demo_SRCS})
3029
if(BUILD_STATIC)

demo/MainWindow.cpp

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,32 @@ static ads::CDockWidget* createLongTextLabelDockWidget(QMenu* ViewMenu)
8888
}
8989

9090

91+
/**
92+
* Function returns a features string with closable (c), movable (m) and floatable (f)
93+
* features. i.e. The following string is for a not closable but movable and floatable
94+
* widget: c- m+ f+
95+
*/
96+
static QString featuresString(ads::CDockWidget* DockWidget)
97+
{
98+
auto f = DockWidget->features();
99+
return QString("c%1 m%2 f%3")
100+
.arg(f.testFlag(ads::CDockWidget::DockWidgetClosable) ? "+" : "-")
101+
.arg(f.testFlag(ads::CDockWidget::DockWidgetMovable) ? "+" : "-")
102+
.arg(f.testFlag(ads::CDockWidget::DockWidgetFloatable) ? "+" : "-");
103+
}
104+
105+
106+
/**
107+
* Appends the string returned by featuresString() to the window title of
108+
* the given DockWidget
109+
*/
110+
static void appendFeaturStringToWindowTitle(ads::CDockWidget* DockWidget)
111+
{
112+
DockWidget->setWindowTitle(DockWidget->windowTitle()
113+
+ QString(" (%1)").arg(featuresString(DockWidget)));
114+
}
115+
116+
91117
//============================================================================
92118
static ads::CDockWidget* createCalendarDockWidget(QMenu* ViewMenu)
93119
{
@@ -110,7 +136,8 @@ static ads::CDockWidget* createFileSystemTreeDockWidget(QMenu* ViewMenu)
110136
QFileSystemModel* m = new QFileSystemModel(w);
111137
m->setRootPath(QDir::currentPath());
112138
w->setModel(m);
113-
ads::CDockWidget* DockWidget = new ads::CDockWidget(QString("Filesystem %1").arg(FileSystemCount++));
139+
ads::CDockWidget* DockWidget = new ads::CDockWidget(QString("Filesystem %1")
140+
.arg(FileSystemCount++));
114141
DockWidget->setWidget(w);
115142
ViewMenu->addAction(DockWidget->toggleViewAction());
116143
return DockWidget;
@@ -185,6 +212,8 @@ void MainWindowPrivate::createContent()
185212
ToolBar->addAction(ui.actionSaveState);
186213
ToolBar->addAction(ui.actionRestoreState);
187214
FileSystemWidget->setFeature(ads::CDockWidget::DockWidgetMovable, false);
215+
FileSystemWidget->setFeature(ads::CDockWidget::DockWidgetFloatable, false);
216+
appendFeaturStringToWindowTitle(FileSystemWidget);
188217
auto TopDockArea = DockManager->addDockWidget(ads::TopDockWidgetArea, FileSystemWidget);
189218
DockWidget = createCalendarDockWidget(ViewMenu);
190219
DockWidget->setFeature(ads::CDockWidget::DockWidgetClosable, false);
@@ -270,19 +299,27 @@ CMainWindow::CMainWindow(QWidget *parent) :
270299
d->ui.setupUi(this);
271300
d->createActions();
272301

302+
// uncomment the following line if the tab close button should be
303+
// a QToolButton instead of a QPushButton
304+
// CDockManager::setConfigFlags(CDockManager::configFlags() | CDockManager::TabCloseButtonIsToolButton);
305+
306+
// uncomment the following line if you wand a fixed tab width that does
307+
// not change if the visibility of the close button changes
308+
// CDockManager::setConfigFlag(CDockManager::RetainTabSizeWhenCloseButtonHidden, true);
309+
273310
// Now create the dock manager and its content
274311
d->DockManager = new CDockManager(this);
275312

276313
// Uncomment the following line to have the old style where the dock
277314
// area close button closes the active tab
278-
//d->DockManager->setConfigFlags({
279-
// CDockManager::DockAreaHasCloseButton | CDockManager::DockAreaCloseButtonClosesTab});
315+
// CDockManager::setConfigFlags({CDockManager::DockAreaHasCloseButton
316+
// | CDockManager::DockAreaCloseButtonClosesTab});
280317
connect(d->PerspectiveComboBox, SIGNAL(activated(const QString&)),
281318
d->DockManager, SLOT(openPerspective(const QString&)));
282319

283320
d->createContent();
284321
// Default window geometry
285-
resize(800, 600);
322+
resize(1280, 720);
286323

287324
d->restoreState();
288325
d->restorePerspectives();

demo/demo.pro

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ HEADERS += \
2121
FORMS += \
2222
mainwindow.ui
2323

24-
RESOURCES += main.qrc
2524

2625
LIBS += -L$${ADS_OUT_ROOT}/lib
2726

demo/main.qrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

doc/linux_kubuntu_1804.png

232 KB
Loading

example/example.pro

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ HEADERS += \
2323
FORMS += \
2424
MainWindow.ui
2525

26-
#RESOURCES += main.qrc
2726

2827
LIBS += -L$${ADS_OUT_ROOT}/lib
2928

0 commit comments

Comments
 (0)