mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-12-24 23:31:32 +08:00
fix: FloatingWidget calls ContainerWidget::hideSectionContent(...) instead
of it's own close() method to be consistent in the way of hiding and showing contents.
This commit is contained in:
parent
932ec71ad8
commit
14a80f1753
@ -30,6 +30,9 @@ public:
|
||||
public://private:
|
||||
bool takeContent(InternalContentData& data);
|
||||
|
||||
private slots:
|
||||
void onCloseButtonClicked();
|
||||
|
||||
private:
|
||||
ContainerWidget* _container;
|
||||
SectionContent::RefPtr _content;
|
||||
|
@ -38,8 +38,11 @@ FloatingWidget::FloatingWidget(ContainerWidget* container, SectionContent::RefPt
|
||||
closeButton->setToolTip(tr("Close"));
|
||||
closeButton->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||
_titleLayout->addWidget(closeButton);
|
||||
//QObject::connect(closeButton, &QPushButton::clicked, this, &FloatingWidget::close);
|
||||
QObject::connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
||||
QObject::connect(closeButton, &QPushButton::clicked, this, &FloatingWidget::onCloseButtonClicked);
|
||||
#else
|
||||
QObject::connect(closeButton, SIGNAL(clicked(bool)), this, SLOT(onCloseButtonClicked()));
|
||||
#endif
|
||||
|
||||
// Content
|
||||
l->addWidget(contentWidget, 1);
|
||||
@ -70,4 +73,9 @@ bool FloatingWidget::takeContent(InternalContentData& data)
|
||||
return true;
|
||||
}
|
||||
|
||||
void FloatingWidget::onCloseButtonClicked()
|
||||
{
|
||||
_container->hideSectionContent(_content);
|
||||
}
|
||||
|
||||
ADS_NAMESPACE_END
|
||||
|
Loading…
Reference in New Issue
Block a user