QmlDesigner: Add icons to curve editor

Change-Id: I77f9b28f8cfe04022571d9c0cc092b9206c4df60
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Thomas Hartmann
2019-08-13 15:21:12 +02:00
parent 3046c83f85
commit b6070995e0
20 changed files with 33 additions and 10 deletions

View File

@@ -42,12 +42,12 @@ CurveEditor::CurveEditor(CurveEditorModel *model, QWidget *parent)
, m_tree(new TreeView(model, this))
, m_view(new GraphicsView(model))
{
QSplitter *splitter = new QSplitter;
auto *splitter = new QSplitter;
splitter->addWidget(m_tree);
splitter->addWidget(m_view);
splitter->setStretchFactor(1, 2);
QVBoxLayout *box = new QVBoxLayout;
auto *box = new QVBoxLayout;
box->addWidget(createToolBar());
box->addWidget(splitter);
setLayout(box);
@@ -72,12 +72,12 @@ void CurveEditor::clearCanvas()
QToolBar *CurveEditor::createToolBar()
{
QToolBar *bar = new QToolBar;
auto *bar = new QToolBar;
bar->setFloatable(false);
QAction *tangentLinearAction = bar->addAction("Linear");
QAction *tangentStepAction = bar->addAction("Step");
QAction *tangentSplineAction = bar->addAction("Spline");
QAction *tangentLinearAction = bar->addAction(QIcon(":/curveeditor/images/tangetToolsLinearIcon.png"), "Linear");
QAction *tangentStepAction = bar->addAction(QIcon(":/curveeditor/images/tangetToolsStepIcon.png"), "Step");
QAction *tangentSplineAction = bar->addAction(QIcon(":/curveeditor/images/tangetToolsSplineIcon.png"), "Spline");
QAction *tangentDefaultAction = bar->addAction("Set Default");
auto setLinearInterpolation = [this]() {