mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-11-15 21:25:44 +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:
|
public://private:
|
||||||
bool takeContent(InternalContentData& data);
|
bool takeContent(InternalContentData& data);
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void onCloseButtonClicked();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ContainerWidget* _container;
|
ContainerWidget* _container;
|
||||||
SectionContent::RefPtr _content;
|
SectionContent::RefPtr _content;
|
||||||
|
@ -38,8 +38,11 @@ FloatingWidget::FloatingWidget(ContainerWidget* container, SectionContent::RefPt
|
|||||||
closeButton->setToolTip(tr("Close"));
|
closeButton->setToolTip(tr("Close"));
|
||||||
closeButton->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
closeButton->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||||
_titleLayout->addWidget(closeButton);
|
_titleLayout->addWidget(closeButton);
|
||||||
//QObject::connect(closeButton, &QPushButton::clicked, this, &FloatingWidget::close);
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
||||||
QObject::connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));
|
QObject::connect(closeButton, &QPushButton::clicked, this, &FloatingWidget::onCloseButtonClicked);
|
||||||
|
#else
|
||||||
|
QObject::connect(closeButton, SIGNAL(clicked(bool)), this, SLOT(onCloseButtonClicked()));
|
||||||
|
#endif
|
||||||
|
|
||||||
// Content
|
// Content
|
||||||
l->addWidget(contentWidget, 1);
|
l->addWidget(contentWidget, 1);
|
||||||
@ -70,4 +73,9 @@ bool FloatingWidget::takeContent(InternalContentData& data)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FloatingWidget::onCloseButtonClicked()
|
||||||
|
{
|
||||||
|
_container->hideSectionContent(_content);
|
||||||
|
}
|
||||||
|
|
||||||
ADS_NAMESPACE_END
|
ADS_NAMESPACE_END
|
||||||
|
Loading…
Reference in New Issue
Block a user