2016-01-19 19:21:06 +08:00
# Advanced Docking System
2016-04-18 18:47:42 +08:00
[![Travis Build ](https://travis-ci.org/mfreiholz/Qt-Advanced-Docking-System.svg?branch=master )](https://travis-ci.org/mfreiholz/Qt-Advanced-Docking-System)
2016-04-27 23:59:07 +08:00
[![Gitter ](https://badges.gitter.im/mfreiholz/Qt-Advanced-Docking-System.svg )](https://gitter.im/mfreiholz/Qt-Advanced-Docking-System?utm_source=badge& utm_medium=badge& utm_campaign=pr-badge)
2016-04-05 14:01:14 +08:00
2016-02-15 19:27:23 +08:00
Manages content widgets more like Visual Studio or similar programs.
2016-02-02 21:35:51 +08:00
I also try to get everything done with basic Qt functionality.
Basic usage of QWidgets an QLayouts and using basic styles as much as possible.
2016-01-19 19:21:06 +08:00
2016-03-08 21:24:33 +08:00
![Layout of widgets ](preview.png )
![Dropping widgets ](preview-dragndrop.png )
2016-02-17 17:57:28 +08:00
2016-02-19 19:41:15 +08:00
## Tested Compatible Environments
- Windows 10 / Qt 5.5.1 / VC12
- Windows 10 / Qt 5.5.1 / MinGW
- Windows 10 / Qt 4.5.3 / VC9
- Ubuntu 15.10
2016-02-02 21:35:51 +08:00
## Build
Open the `build.pro` with QtCreator and start the build, that's it.
2016-02-19 19:41:15 +08:00
You can run the demo project and test it yourself.
2016-01-19 19:21:06 +08:00
2016-02-18 22:06:00 +08:00
## Release & Development
2016-02-19 19:41:15 +08:00
The `master` branch is not guaranteed to be stable or does not even build, since it is the main working branch.
If you want a version that builds, you should always use a release/beta tag.
2016-02-18 22:06:00 +08:00
2016-03-31 20:47:19 +08:00
## Getting started / Example
2016-04-05 13:39:15 +08:00
The following example shows the minimum code required to use ADS.
2016-03-31 20:47:19 +08:00
_MyWindow.h_
```cpp
#include <QMainWindow>
#include "ads/API.h"
#include "ads/ContainerWidget.h"
#include "ads/SectionContent.h"
class MyWindow : public QMainWindow
{
Q_OBJECT
public:
2016-04-05 13:39:15 +08:00
MyWindow(QWidget* parent);
2016-03-31 20:47:19 +08:00
private:
2016-04-05 13:39:15 +08:00
// The main container for dockings.
ADS_NS::ContainerWidget* _container;
// You always want to keep a reference of your content,
// in case you need to perform any action on it (show, hide, ...)
ADS_NS::SectionContent::RefPtr _sc1;
2016-03-31 20:47:19 +08:00
};
```
2016-04-05 13:39:15 +08:00
_MyWindow.cpp_
```cpp
#include "MyWindow.h"
#include <QLabel>
MyWindow::MyWindow(QWidget* parent) : QMainWindow(parent)
{
_container = new ADS_NS::ContainerWidget();
setCentralWidget(_container);
_sc1 = ADS_NS::SectionContent::newSectionContent(QString("Unique-Internal-Name"), _container, new QLabel("Visible Title"), new QLabel("Content Widget"));
_container->addSectionContent(_sc1, NULL, ADS_NS::CenterDropArea);
}
2016-04-18 18:47:42 +08:00
static void initStyleSheet(QApplication& a)
{
//Q_INIT_RESOURCE(ads); // If static linked.
QFile f(":ads/stylesheets/default-windows.css");
if (f.open(QFile::ReadOnly))
{
const QByteArray ba = f.readAll();
f.close();
a.setStyleSheet(QString(ba));
}
}
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
a.setQuitOnLastWindowClosed(true);
initStyleSheet(a);
MainWindow mw;
mw.show();
return a.exec();
}
2016-04-05 13:39:15 +08:00
```
2016-02-19 19:41:15 +08:00
## Developers
[Manuel Freiholz ](https://mfreiholz.de ), Project Maintainer
2016-01-19 19:21:06 +08:00
2016-02-19 19:41:15 +08:00
## License information
![WTFPL ](license.png )
This projects uses the [WTFPL license ](http://www.wtfpl.net/ )
(Do **W**hat **T**he **F**uck You Want To **P**ublic **L**icense)
Using it? Let us know by creating a [new issue ](https://github.com/mfreiholz/qt-docks/issues/new ) (You don't have to, of course).