mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-12-25 07:31:33 +08:00
Added support for display of dock widget icons in DockArea tab menus
This commit is contained in:
parent
3f40c997e5
commit
9cd2584de5
@ -224,12 +224,12 @@ void DockAreaWidgetPrivate::addTabsMenuEntry(CDockWidget* DockWidget,
|
||||
QAction* Action;
|
||||
if (Index >= 0 && Index < menu->actions().count())
|
||||
{
|
||||
Action = new QAction(DockWidget->windowTitle());
|
||||
Action = new QAction(DockWidget->icon(), DockWidget->windowTitle());
|
||||
menu->insertAction(menu->actions().at(Index), Action);
|
||||
}
|
||||
else
|
||||
{
|
||||
Action = menu->addAction(DockWidget->windowTitle());
|
||||
Action = menu->addAction(DockWidget->icon(), DockWidget->windowTitle());
|
||||
}
|
||||
QVariant vAction = QVariant::fromValue(Action);
|
||||
DockWidget->setProperty(ACTION_PROPERTY, vAction);
|
||||
|
@ -431,6 +431,13 @@ void CDockWidget::setIcon(const QIcon& Icon)
|
||||
}
|
||||
|
||||
|
||||
//============================================================================
|
||||
QIcon CDockWidget::icon() const
|
||||
{
|
||||
return d->TitleWidget->icon();
|
||||
}
|
||||
|
||||
|
||||
|
||||
} // namespace ads
|
||||
|
||||
|
@ -227,6 +227,11 @@ public:
|
||||
*/
|
||||
void setIcon(const QIcon& Icon);
|
||||
|
||||
/**
|
||||
* Returns tzhe icon that has been assigned to the dock widget
|
||||
*/
|
||||
QIcon icon() const;
|
||||
|
||||
public slots:
|
||||
/**
|
||||
* This property controls whether the dock widget is open or closed.
|
||||
|
Loading…
Reference in New Issue
Block a user