Qt Advanced Docking System
v1.0.0
Visual Studio 또는 유사한 프로그램과 유사한 콘텐츠 위젯을 관리합니다. 나는 또한 기본적인 Qt 기능으로 모든 것을 끝내려고 노력합니다. QWidgets 및 QLayouts의 기본 사용법과 기본 스타일을 최대한 많이 사용합니다.
QtCreator로 build.pro
열고 빌드를 시작하면 됩니다. 데모 프로젝트를 실행하고 직접 테스트할 수 있습니다.
master
브랜치는 기본 작업 브랜치이므로 안정성이 보장되지 않거나 빌드되지도 않습니다. 빌드되는 버전을 원한다면 항상 릴리스/베타 태그를 사용해야 합니다.
다음 예에서는 ADS를 사용하는 데 필요한 최소 코드를 보여줍니다.
마이윈도우.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;
};
마이윈도우.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 ();
}
Manuel Freiholz, 프로젝트 유지관리자
이 프로젝트는 WTFPL 라이선스(Do W hat The Fuck You Want To Public License )를 사용합니다.
그것을 사용합니까? 새로운 이슈를 생성하여 알려주세요(물론 꼭 그럴 필요는 없습니다).