mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-06 00:55:50 +00:00
enhanced SceneToolBar tool handling (remove and insert at specific point)
This commit is contained in:
parent
29c9b6bd01
commit
bf40a3bb5d
@ -31,9 +31,20 @@ CSVWidget::SceneToolbar::SceneToolbar (int buttonSize, QWidget *parent)
|
||||
connect (focusScene, SIGNAL (activated()), this, SIGNAL (focusSceneRequest()));
|
||||
}
|
||||
|
||||
void CSVWidget::SceneToolbar::addTool (SceneTool *tool)
|
||||
void CSVWidget::SceneToolbar::addTool (SceneTool *tool, SceneTool *insertPoint)
|
||||
{
|
||||
mLayout->addWidget (tool, 0, Qt::AlignTop);
|
||||
if (!insertPoint)
|
||||
mLayout->addWidget (tool, 0, Qt::AlignTop);
|
||||
else
|
||||
{
|
||||
int index = mLayout->indexOf (insertPoint);
|
||||
mLayout->insertWidget (index+1, tool, 0, Qt::AlignTop);
|
||||
}
|
||||
}
|
||||
|
||||
void CSVWidget::SceneToolbar::removeTool (SceneTool *tool)
|
||||
{
|
||||
mLayout->removeWidget (tool);
|
||||
}
|
||||
|
||||
int CSVWidget::SceneToolbar::getButtonSize() const
|
||||
|
@ -25,7 +25,11 @@ namespace CSVWidget
|
||||
|
||||
SceneToolbar (int buttonSize, QWidget *parent = 0);
|
||||
|
||||
void addTool (SceneTool *tool);
|
||||
/// If insertPoint==0, insert \a tool at the end of the scrollbar. Otherwise
|
||||
/// insert tool after \a insertPoint.
|
||||
void addTool (SceneTool *tool, SceneTool *insertPoint = 0);
|
||||
|
||||
void removeTool (SceneTool *tool);
|
||||
|
||||
int getButtonSize() const;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user