[kgraphviewer-devel] [kgraphviewer] src/part: remove some (but not all) legacy QT3 calls
Milian Wolff
mail at milianw.de
Sun Apr 8 23:20:02 UTC 2012
Git commit cc6314b4f7a9a5eb22d077555f927820e5360f99 by Milian Wolff.
Committed on 09/04/2012 at 01:02.
Pushed by mwolff into branch 'master'.
remove some (but not all) legacy QT3 calls
patch by Ivan Brezina, thanks!
REVIEW: 102967
M +1 -1 src/part/dot2qtconsts.cpp
M +4 -3 src/part/dotgraphview.cpp
M +1 -1 src/part/graphedge.cpp
http://commits.kde.org/kgraphviewer/cc6314b4f7a9a5eb22d077555f927820e5360f99
diff --git a/src/part/dot2qtconsts.cpp b/src/part/dot2qtconsts.cpp
index d1fba1f..ae79885 100644
--- a/src/part/dot2qtconsts.cpp
+++ b/src/part/dot2qtconsts.cpp
@@ -874,7 +874,7 @@ QColor Dot2QtConsts::qtColor(const QString& dotColor) const
{
// kDebug() << "Dot2QtConsts::qtColor";
QColor color;
- if (parse_numeric_color(dotColor.ascii(), color))
+ if (parse_numeric_color(qPrintable(dotColor), color))
{
return color;
}
diff --git a/src/part/dotgraphview.cpp b/src/part/dotgraphview.cpp
index 4b3ca03..4c51bce 100644
--- a/src/part/dotgraphview.cpp
+++ b/src/part/dotgraphview.cpp
@@ -68,6 +68,7 @@
#include <QScrollBar>
#include <QUuid>
#include <QSvgGenerator>
+#include <QApplication>
#include <kdebug.h>
#include <klocale.h>
@@ -1129,9 +1130,9 @@ void DotGraphView::keyPressEvent(QKeyEvent* e)
scrollContentsBy(int(-d->m_canvas->width()),0);
else if (e->key() == Qt::Key_End)
scrollContentsBy(int(d->m_canvas->width()),0);
- else if (e->key() == Qt::Key_Prior)
+ else if (e->key() == Qt::Key_PageUp)
scrollContentsBy(0,-viewport()->height()/2);
- else if (e->key() == Qt::Key_Next)
+ else if (e->key() == Qt::Key_PageDown)
scrollContentsBy(0,viewport()->height()/2);
else if (e->key() == Qt::Key_Left)
scrollContentsBy(-viewport()->width()/10,0);
@@ -1157,7 +1158,7 @@ void DotGraphView::wheelEvent(QWheelEvent* e)
return;
}
e->accept();
- if (e->state() == Qt::ShiftModifier)
+ if (QApplication::keyboardModifiers() == Qt::ShiftModifier)
{
kDebug() << " + Shift: zooming";
// move canvas...
diff --git a/src/part/graphedge.cpp b/src/part/graphedge.cpp
index 3492f99..8453064 100644
--- a/src/part/graphedge.cpp
+++ b/src/part/graphedge.cpp
@@ -66,7 +66,7 @@ GraphEdge::GraphEdge(const GraphEdge& edge) :
void GraphEdge::colors(const QString& cs)
{
- m_colors = QStringList::split(":", cs);
+ m_colors = cs.split(':');
// kDebug() << fromNode()->id() << " -> " << toNode()->id() << ": nb colors: " << m_colors.size();
}
More information about the kgraphviewer-devel
mailing list