mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-12-25 07:31:33 +08:00
Fixed setWidget function of DockWidget to properly setup the internal scroll area
This commit is contained in:
parent
9b56ca08e1
commit
1fccb943fe
@ -243,14 +243,18 @@ void CDockWidget::setToggleViewActionChecked(bool Checked)
|
||||
void CDockWidget::setWidget(QWidget* widget, eInsertMode InsertMode)
|
||||
{
|
||||
QScrollArea* ScrollAreaWidget = qobject_cast<QScrollArea*>(widget);
|
||||
if (ScrollAreaWidget || ForceNoScrollArea != InsertMode)
|
||||
if (ScrollAreaWidget || ForceNoScrollArea == InsertMode)
|
||||
{
|
||||
d->setupScrollArea();
|
||||
d->ScrollArea->setWidget(widget);
|
||||
d->Layout->addWidget(widget);
|
||||
if (ScrollAreaWidget && ScrollAreaWidget->viewport())
|
||||
{
|
||||
ScrollAreaWidget->viewport()->setProperty("dockWidgetContent", true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
d->Layout->addWidget(widget);
|
||||
d->setupScrollArea();
|
||||
d->ScrollArea->setWidget(widget);
|
||||
}
|
||||
|
||||
d->Widget = widget;
|
||||
|
Loading…
Reference in New Issue
Block a user