Skip to content

Commit 2c15d5d

Browse files
Fixed regression caused by setDockArea() function removed from DockWidgetTab
1 parent f236de3 commit 2c15d5d

File tree

4 files changed

+29
-1
lines changed

4 files changed

+29
-1
lines changed

src/DockAreaTitleBar.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ void DockAreaTitleBarPrivate::createButtons()
235235
#endif
236236
_this->connect(TabsMenu, SIGNAL(aboutToShow()), SLOT(onTabsMenuAboutToShow()));
237237
TabsMenuButton->setMenu(TabsMenu);
238-
internal::setToolTip(TabsMenuButton, QObject::tr("List all tabs"));
238+
internal::setToolTip(TabsMenuButton, QObject::tr("List All Tabs"));
239239
TabsMenuButton->setSizePolicy(ButtonSizePolicy);
240240
Layout->addWidget(TabsMenuButton, 0);
241241
_this->connect(TabsMenuButton->menu(), SIGNAL(triggered(QAction*)),

src/DockAreaWidget.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,7 @@ void CDockAreaWidget::insertDockWidget(int index, CDockWidget* DockWidget,
398398
bool Activate)
399399
{
400400
d->ContentsLayout->insertWidget(index, DockWidget);
401+
DockWidget->tabWidget()->setDockAreaWidget(this);
401402
auto TabWidget = DockWidget->tabWidget();
402403
// Inserting the tab will change the current index which in turn will
403404
// make the tab widget visible in the slot

src/DockWidgetTab.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,20 @@ CDockWidget* CDockWidgetTab::dockWidget() const
464464
}
465465

466466

467+
//============================================================================
468+
void CDockWidgetTab::setDockAreaWidget(CDockAreaWidget* DockArea)
469+
{
470+
d->DockArea = DockArea;
471+
}
472+
473+
474+
//============================================================================
475+
CDockAreaWidget* CDockWidgetTab::dockAreaWidget() const
476+
{
477+
return d->DockArea;
478+
}
479+
480+
467481
//============================================================================
468482
void CDockWidgetTab::setIcon(const QIcon& Icon)
469483
{

src/DockWidgetTab.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,19 @@ private slots:
9494
*/
9595
void setActiveTab(bool active);
9696

97+
/**
98+
* Sets the dock area widget the dockWidget returned by dockWidget()
99+
* function belongs to.
100+
*/
101+
void setDockAreaWidget(CDockAreaWidget* DockArea);
102+
103+
/**
104+
* Returns the dock area widget this title bar belongs to.
105+
* \return This function returns 0 if the dock widget that owns this title
106+
* bar widget has not been added to any dock area yet.
107+
*/
108+
CDockAreaWidget* dockAreaWidget() const;
109+
97110
/**
98111
* Returns the dock widget this title widget belongs to
99112
*/

0 commit comments

Comments
 (0)