mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2025-03-16 02:59:51 +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;
|
QAction* Action;
|
||||||
if (Index >= 0 && Index < menu->actions().count())
|
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);
|
menu->insertAction(menu->actions().at(Index), Action);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Action = menu->addAction(DockWidget->windowTitle());
|
Action = menu->addAction(DockWidget->icon(), DockWidget->windowTitle());
|
||||||
}
|
}
|
||||||
QVariant vAction = QVariant::fromValue(Action);
|
QVariant vAction = QVariant::fromValue(Action);
|
||||||
DockWidget->setProperty(ACTION_PROPERTY, vAction);
|
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
|
} // namespace ads
|
||||||
|
|
||||||
|
@ -227,6 +227,11 @@ public:
|
|||||||
*/
|
*/
|
||||||
void setIcon(const QIcon& Icon);
|
void setIcon(const QIcon& Icon);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns tzhe icon that has been assigned to the dock widget
|
||||||
|
*/
|
||||||
|
QIcon icon() const;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
/**
|
/**
|
||||||
* This property controls whether the dock widget is open or closed.
|
* This property controls whether the dock widget is open or closed.
|
||||||
|
Loading…
Reference in New Issue
Block a user