mfreiholz / qt-advanced-docking-system Goto Github PK
View Code? Open in Web Editor NEWAdvanced Docking System for Qt
License: Other
Advanced Docking System for Qt
License: Other
e.g. something like:
ContainerWidget::setFloating(SectionContent::RefPtr)
I have already pulled and tried out this docking system and am very pleased with it so far. If this works stable, I would love to use it with my commercial Desktop app "PokerRanger". Your first release seems to be a beta, so I am not sure whether I can really utilize it as of now since I need a certain degree of stability. Do you happen to know of any large/possibly commercial applications that are interested in using it as well? Could be interesting to know
I want to save the dock layout to a file and reload it when reopen.
the code of save dock layout :
QFile file("VisualLayout.ini");
if (file.open(QIODevice::WriteOnly))
{
QDataStream out(&file);
out << _dockMan->saveState();
file.close();
}
and the code of load the config file:
QFile file("VisualLayout.ini");
if (file.open(QIODevice::ReadOnly))
{
QByteArray ba;
QDataStream in(&file);
in >> ba;
file.close();
if (_dockMan->restoreState(ba))
{
qDebug() << QString("good");
}
else
{
qDebug() << QString("failed");
}
}
but it just reload the 1st dock area layout, and totally ignored other dock area.
Hello, my default development environment is Qt 5.15.2 with MSVC 2019 64-bit, and I have built both the .lib and .dll files using qmake. However, I am encountering compilation errors when trying to use them in my project. I have also attempted to modify the .pro file, but it has not resolved the issue.
Here is the .pro file after my modifications.
TEMPLATE = lib
CONFIG += c++17
DEFINES += ADS_NAMESPACE_ENABLED ADS_EXPORT
QT += core
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
INCLUDEPATH += $$PWD/include
RESOURCES += \
res/ads.qrc
!isEmpty(target.path): INSTALLS += target
include(AdvancedDockingSystem.pri)
And here is the part in my project related to importing the library and header files.
win32: LIBS += -L$$PWD/lib/ -lAdvancedDockingSystem
INCLUDEPATH += $$PWD/include
DEPENDPATH += $$PWD/include
The error message is:
error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: __cdecl ContainerWidget::ContainerWidget(class QWidget *)" (__imp_??0ContainerWidget@@QEAA@PEAVQWidget@@@Z),函数 "public: __cdecl TableViewForm::TableViewForm(class QWidget *)" (??0TableViewForm@@QEAA@PEAVQWidget@@@Z) 中引用了该符号
tableviewform.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: virtual __cdecl ContainerWidget::~ContainerWidget(void)" (__imp_??1ContainerWidget@@UEAA@XZ),函数 "public: virtual void * __cdecl ContainerWidget::`scalar deleting destructor'(unsigned int)" (??_GContainerWidget@@UEAAPEAXI@Z) 中引用了该符号
tableviewform.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: class SectionWidget * __cdecl ContainerWidget::addSectionContent(class QSharedPointer<class SectionContent> const &,class SectionWidget *,enum DropArea)" (__imp_?addSectionContent@ContainerWidget@@QEAAPEAVSectionWidget@@AEBV?$QSharedPointer@VSectionContent@@@@PEAV2@W4DropArea@@@Z),函数 "public: __cdecl TableViewForm::TableViewForm(class QWidget *)" (??0TableViewForm@@QEAA@PEAVQWidget@@@Z) 中引用了该符号
tableviewform.obj : error LNK2001: 无法解析的外部符号 "public: virtual struct QMetaObject const * __cdecl ContainerWidget::metaObject(void)const " (?metaObject@ContainerWidget@@UEBAPEBUQMetaObject@@XZ)
tableviewform.obj : error LNK2001: 无法解析的外部符号 "public: virtual int __cdecl ContainerWidget::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@ContainerWidget@@UEAAHW4Call@QMetaObject@@HPEAPEAX@Z)
tableviewform.obj : error LNK2001: 无法解析的外部符号 "public: virtual void * __cdecl ContainerWidget::qt_metacast(char const *)" (?qt_metacast@ContainerWidget@@UEAAPEAXPEBD@Z)
The app crashes, if the first SectionContent is not being added with CenterDropArea.
(see demo app example)
I connect the Singnal [ads::CDockWidget::topLevelChanged]
connect(tmp, &ads::CDockWidget::topLevelChanged, this, [&](bool topLevel) { ads::CDockWidget* dockw = ((ads::CDockWidget*)sender()); });
I want to konw where is the dockw? left,right,bottom or top?
And if it is left or right,i want to resize dockw.
How to do it?
Thank you
Looking for a suitable docking system for my project in Qt I found your code and liked it a lot. The only thing I miss is the possibility to dock widgets inside floatable windows. I was thinking on modifying the code myself to try and pass a sectionwidget directly inside the floatablewidget so i have something to dock into inside the floating window. Do you see any problem with this approach?
... with all of its functionality:
There was warning, I think need
for (const auto& ColorListEntry : qAsConst(ColorList)) {
...
}
Show them with vertical title headers on the edge, without contents. Only show contents temporary on click until another view gets focus.
Currently the ContainerWidget requires a margin/padding to allow dropping contents into the outer-areas.
Would it be possible to modify Teamspeak's Qt to have the widgets dock at more positions, like https://github.com/svenpaulsen/ts3client-dockwidget-plugin?
I'm not sure, if this issue is still valid.. Need to check it.
Seems to be a Qt4 Bug with event handling, since i can't reproduce this behavior with Qt5. The QSplitter seems to get the mouse-press event, which actually is a event of the SectionTitleWidget
to handle the movement.
Does anyone have an idea?
When I change the title of some tab, this title is not directly translated into the cached menu that opens upon clicking on the down arrow.
I could fix this by temporarily offering an "updateSectionContentTabMenus" method to ContainerWidget
that just calls on all sections the updateTabsMenu()
, but it seems that this is not very clean. Maybe, setting a title should invalidate the corresponding containerWidget's cache. Not sure, if the pointers/references are set in a way that allows for that in an easy way.
This is a very good feature, but I want to use it in QML projects. Is there any support?
In some cases it might be useful to know, if the visibility of a content changes.
signals:
void sectionContentVisibilityChanged(const SectionContent::RefPtr& sc, bool visible);
// OR
signals:
void sectionContentShown(const SectionContent::RefPtr& sc);
void sectionContentHidden(const SectionContent::RefPtr& sc);
Like Qt's default docking system the docked section content should enter the floating state with it's last known position. Double-Clicking the floating widget's title inserts the section-content into the last known section, if still available.
It would be easier when the SectionTitleWidget and SectionContentWidget are created inside the "SectionContent::newSectionContent(..)" method. This would make sure, that those two objects always exists.
Currently it's only possible to drop a floating-widget on to the drop-indicators.
ContainerWidget::showSectionContent
needs to insert the SC at the correct preferred position of SW
Make it possible to disable it global (ContainerWidget) for all and to disable it for each content on it's own.
What happens, if the latest position was on monitor X, but monitor has been disconnected? Will it be out of screen?
I'd like to have one or multiple custom buttons added to the title widget, probably left to the menu button.
It could be put into the title widget but say we have 5 buttons that could apply to any of the multiple tabs. This would bloat the menu since they would be multiplied by the number of tabs. So, for 3 tabs and 5 buttons, we'd actually had 15 buttons, although 5 would be sufficient. Writing an answer here at Github shows the same system: Write and Preview tabs are available but all the tool buttons like bold, italic, quote, ... are common for both of those tabs.
Currently it's unpredictable. It might be good to use the same width/height as the parent content, if dropped on existing content. In case of outer-drop we might use the preferred size of the content.
A SectionWidget always requires at least the width of the tab bar, which is not scrollable right now. In case of too many contents, this might be disturbing because the user can not downsize it's application as he may wants to.
Possible solutions:
I am planning to integrate AdvancedDockingSystem into my little project, but have come across some difficulties.
I am using Qt 5.13.0 with Visual Studio 2019 on Windows 10. According to the README, I checked out to the commit tagged 1.0.0
. And with the help of Qt VS Tools, I can convert Qt Creator project .pro
files into Visual Studio solution and projects in the solution.
However, as I started to build and run the project AdvancedDockingSystemDemo
, although it can be successfully built, once the executable is launched, there pops up an error message as follows:
(It is in simplified Chinese and the meaning in English is approximately Code cannot be executed due to the missing AdvancedDockingSystem1.dll. Re-installation of the program may solve the problem.
)
The error message indicates that something named AdvancedDockingSystem1.dll
is missing, so the program cannot be launched. So what does the problem come from and how can I solve it?
Thanks!
PS: I tried on Qt Creator and everything seems to work perfectly. And I think it may have something to do with the static linking done by Qt Creator (Visual Studio dynamically links Qt libraries to the built executable).
Global statics are never good. Hold one overlay for each ContainerWidget as member.
Hi,
I just found your advanced docking system and I have to admit I'm excited. It is really great and I searched for an improved Qt docking system for a long time. I had already thought about trying an implementation myself. I would like to say a big thank you for this great gift - I really like it.
The only thing that is missing for me is grouped dragging like it is suported by Qt since Qt 5.6. Maybe I will try to implment it myself and contribute it back.
Best regards,
Uwe
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.