Giter VIP home page Giter VIP logo

qt-advanced-docking-system's Introduction

Advanced Docking System for Qt

Gitter

Manages content widgets more like Visual Studio or similar programs. 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.

Layout of widgets Dropping widgets

Tested Compatible Environments

  • Windows 7 / 8 / 8.1 / 10
  • Ubuntu 15.10

Build

Open the build.pro with QtCreator and start the build, that's it. You can run the demo project and test it yourself.

Release & Development

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.

Getting started / Example

The following example shows the minimum code required to use ADS.

MyWindow.h

#include <QMainWindow>
#include "ads/API.h"
#include "ads/ContainerWidget.h"
#include "ads/SectionContent.h"
class MyWindow : public QMainWindow
{
	Q_OBJECT
public:
	MyWindow(QWidget* parent);
	
private:
	// 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; 
};

MyWindow.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);
}

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();
}

Developers

Manuel Freiholz, Project Maintainer

License information

WTFPL

This projects uses the WTFPL license (Do What The Fuck You Want To Public License)

Using it? Let us know by creating a new issue (You don't have to, of course).

qt-advanced-docking-system's People

Contributors

mfreiholz avatar tanaxiusi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.