From e7a10091b64ddeb1d3e21e3f36abbf412021c815 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Mon, 1 Oct 2018 16:19:21 +0200 Subject: fixed many warnings --- src/gui/edgeitem.cpp | 4 ++++ src/gui/mainwindow.ui | 4 ++-- src/gui/stylepalette.cpp | 7 ++++--- src/gui/stylepalette.h | 4 ++-- src/gui/tikzscene.cpp | 2 +- src/gui/undocommands.cpp | 2 +- src/gui/undocommands.h | 2 -- 7 files changed, 14 insertions(+), 11 deletions(-) (limited to 'src/gui') diff --git a/src/gui/edgeitem.cpp b/src/gui/edgeitem.cpp index 146b4e0..2f5b15c 100644 --- a/src/gui/edgeitem.cpp +++ b/src/gui/edgeitem.cpp @@ -102,6 +102,8 @@ void EdgeItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidge painter->drawPath(pth); break; } + case EdgeStyle::NoTip: + break; } //QPen outline = QPen(Qt::red); @@ -126,6 +128,8 @@ void EdgeItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidge painter->drawPath(pth); break; } + case EdgeStyle::NoTip: + break; } if (isSelected()) { diff --git a/src/gui/mainwindow.ui b/src/gui/mainwindow.ui index cae5735..8eff5ee 100644 --- a/src/gui/mainwindow.ui +++ b/src/gui/mainwindow.ui @@ -62,8 +62,8 @@ p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Courier New'; font-size:10pt; font-weight:400; font-style:normal;"> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'.SF NS Text'; font-size:13pt;"><br /></p></body></html> - - 20 + + 20.000000000000000 diff --git a/src/gui/stylepalette.cpp b/src/gui/stylepalette.cpp index 447e7a4..7423f29 100644 --- a/src/gui/stylepalette.cpp +++ b/src/gui/stylepalette.cpp @@ -89,7 +89,8 @@ void StylePalette::changeNodeStyle(int increment) if (row < 0) row += _nodeModel->rowCount(); } - QModelIndex i1 = ui->styleListView->rootIndex().child(row, 0); + //QModelIndex i1 = ui->styleListView->rootIndex().child(row, 0); + QModelIndex i1 = _nodeModel->index(row,0); ui->styleListView->selectionModel()->select(i1, QItemSelectionModel::ClearAndSelect); ui->styleListView->scrollTo(i1); } @@ -126,12 +127,12 @@ QString StylePalette::activeEdgeStyleName() } } -void StylePalette::nodeStyleDoubleClicked(const QModelIndex &index) +void StylePalette::nodeStyleDoubleClicked(const QModelIndex &) { tikzit->activeWindow()->tikzScene()->applyActiveStyleToNodes(); } -void StylePalette::edgeStyleDoubleClicked(const QModelIndex &index) +void StylePalette::edgeStyleDoubleClicked(const QModelIndex &) { qDebug() << "got double click"; tikzit->activeWindow()->tikzScene()->applyActiveStyleToEdges(); diff --git a/src/gui/stylepalette.h b/src/gui/stylepalette.h index 5943e52..fc4e253 100644 --- a/src/gui/stylepalette.h +++ b/src/gui/stylepalette.h @@ -41,8 +41,8 @@ public: public slots: - void nodeStyleDoubleClicked(const QModelIndex &index); - void edgeStyleDoubleClicked(const QModelIndex &index); + void nodeStyleDoubleClicked(const QModelIndex &); + void edgeStyleDoubleClicked(const QModelIndex &); void on_buttonOpenTikzstyles_clicked(); void on_buttonEditTikzstyles_clicked(); void on_buttonRefreshTikzstyles_clicked(); diff --git a/src/gui/tikzscene.cpp b/src/gui/tikzscene.cpp index b9afe4a..b2c5fd7 100644 --- a/src/gui/tikzscene.cpp +++ b/src/gui/tikzscene.cpp @@ -669,7 +669,7 @@ void TikzScene::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) if (ok) { QMap oldLabels; oldLabels.insert(ni->node(), ni->node()->label()); - ChangeLabelCommand *cmd = new ChangeLabelCommand(this, graph(), oldLabels, newLabel); + ChangeLabelCommand *cmd = new ChangeLabelCommand(this, oldLabels, newLabel); _tikzDocument->undoStack()->push(cmd); } break; diff --git a/src/gui/undocommands.cpp b/src/gui/undocommands.cpp index 50b81a4..f713582 100644 --- a/src/gui/undocommands.cpp +++ b/src/gui/undocommands.cpp @@ -395,7 +395,7 @@ void PasteCommand::redo() GraphUpdateCommand::redo(); } -ChangeLabelCommand::ChangeLabelCommand(TikzScene *scene, Graph *graph, QMap oldLabels, QString newLabel, QUndoCommand *parent) : +ChangeLabelCommand::ChangeLabelCommand(TikzScene *scene, QMap oldLabels, QString newLabel, QUndoCommand *parent) : GraphUpdateCommand(scene, parent), _oldLabels(oldLabels), _newLabel(newLabel) { } diff --git a/src/gui/undocommands.h b/src/gui/undocommands.h index 1836892..dc60549 100644 --- a/src/gui/undocommands.h +++ b/src/gui/undocommands.h @@ -165,14 +165,12 @@ class ChangeLabelCommand : public GraphUpdateCommand { public: explicit ChangeLabelCommand(TikzScene *scene, - Graph *graph, QMap oldLabels, QString newLabel, QUndoCommand *parent = 0); void undo() override; void redo() override; private: - Graph *_graph; QMap _oldLabels; QString _newLabel; }; -- cgit v1.2.3