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]() {

View File

@@ -44,3 +44,6 @@ SOURCES += \
$$PWD/detail/utils.cpp \
$$PWD/keyframe.cpp \
$$PWD/treeitem.cpp
RESOURCES += \
$$PWD/curveeditor.qrc

View File

@@ -0,0 +1,20 @@
<RCC>
<qresource prefix="/curveeditor">
<file>images/tangetToolsSplineIcon.png</file>
<file>images/tangetToolsSplineIcon@2x.png</file>
<file>images/tangetToolsLinearIcon.png</file>
<file>images/tangetToolsLinearIcon@2x.png</file>
<file>images/tangetToolsStepIcon.png</file>
<file>images/tangetToolsStepIcon@2x.png</file>
<file>images/treeview_eye.png</file>
<file>images/treeview_eye@2x.png</file>
<file>images/treeview_pin.png</file>
<file>images/treeview_pin@2x.png</file>
<file>images/treeview_unpin.png</file>
<file>images/treeview_unpin@2x.png</file>
<file>images/treeview_unlock@2x.png</file>
<file>images/treeview_lock.png</file>
<file>images/treeview_lock@2x.png</file>
<file>images/treeview_unlock.png</file>
</qresource>
</RCC>

View File

@@ -41,10 +41,10 @@ namespace DesignTools {
struct TreeItemStyleOption
{
double margins;
QIcon pinnedIcon = QIcon(":/ICON_PINNED");
QIcon unpinnedIcon = QIcon(":/ICON_UNPINNED");
QIcon lockedIcon = QIcon(":/ICON_LOCKED");
QIcon unlockedIcon = QIcon(":/ICON_UNLOCKED");
QIcon pinnedIcon = QIcon(":/curveeditor/images/treeview_pin.png");
QIcon unpinnedIcon = QIcon(":/curveeditor/images/treeview_unpin.png");
QIcon lockedIcon = QIcon(":/curveeditor/images/treeview_lock.png");
QIcon unlockedIcon = QIcon(":/curveeditor/images/treeview_unlock.png");
};
struct HandleItemStyleOption

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 383 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 463 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 902 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 946 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 909 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 278 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 245 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB