summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosef Weidendorfer <Josef.Weidendorfer@gmx.de>2016-10-24 20:40:54 (GMT)
committerJosef Weidendorfer <Josef.Weidendorfer@gmx.de>2016-10-24 20:40:54 (GMT)
commite34e7a5b5b2044e960f644e2fab804b84ff25d4d (patch)
treeeeee8e2ebd6aa4f4a89ffccaa937a606b3e66742
parent5fcda87e4cf8d4ae61fe5afb2bde605834d3eda0 (diff)
Enable icons for cycles
This was commented out long ago... compiles fine even with Qt4.
-rw-r--r--libviews/callgraphview.cpp15
-rw-r--r--libviews/callitem.cpp9
-rw-r--r--libviews/instritem.cpp8
3 files changed, 9 insertions, 23 deletions
diff --git a/libviews/callgraphview.cpp b/libviews/callgraphview.cpp
index 2e0843e..84e4251 100644
--- a/libviews/callgraphview.cpp
+++ b/libviews/callgraphview.cpp
@@ -1305,16 +1305,11 @@ CanvasEdgeLabel::CanvasEdgeLabel(CallGraphView* v, CanvasEdge* ce, int x,
_percentage = inclP;
if (_percentage > 100.0) _percentage = 100.0;
- if (e->call() && (e->call()->isRecursion() || e->call()->inCycle())) {
- QString icon = "edit-undo";
-#if 0
- KIconLoader* loader = KIconLoader::global();
- QPixmap p= loader->loadIcon(icon, KIconLoader::Small, 0,
- KIconLoader::DefaultState, QStringList(), 0,
- true);
- setPixmap(0, p);
-#endif
- }
+ if (e->call() && (e->call()->isRecursion() || e->call()->inCycle())) {
+ QFontMetrics fm(font());
+ QPixmap p = QIcon::fromTheme(QString("edit-undo")).pixmap(fm.height());
+ setPixmap(pixPos, p); // replace percentage pixmap
+ }
}
void CanvasEdgeLabel::paint(QPainter* p,
diff --git a/libviews/callitem.cpp b/libviews/callitem.cpp
index 298c2f9..603eacb 100644
--- a/libviews/callitem.cpp
+++ b/libviews/callitem.cpp
@@ -147,13 +147,8 @@ void CallItem::updateCost()
QPixmap p;
if (sameCycle && !selectedIsCycle && !shownIsCycle) {
-
- QString icon = "edit-undo";
-#if 0 // TODO
- KIconLoader* loader = KIconLoader::global();
- p= loader->loadIcon(icon, KIconLoader::Small, 0,
- KIconLoader::DefaultState, QStringList(), 0, true);
-#endif
+ QFontMetrics fm(font(4));
+ p = QIcon::fromTheme(QString("edit-undo")).pixmap(fm.height());
}
setIcon(4, p);
}
diff --git a/libviews/instritem.cpp b/libviews/instritem.cpp
index 592be77..2fa043a 100644
--- a/libviews/instritem.cpp
+++ b/libviews/instritem.cpp
@@ -196,12 +196,8 @@ void InstrItem::updateCost()
QString str;
QPixmap p;
- QString icon = "edit-undo";
-#if 0 // TODO
- KIconLoader* loader = KIconLoader::global();
- p= loader->loadIcon(icon, KIconLoader::Small, 0,
- KIconLoader::DefaultState, QStringList(), 0, true);
-#endif
+ QFontMetrics fm(font(1));
+ p = QIcon::fromTheme(QString("edit-undo")).pixmap(fm.height());
if (p.isNull())
str = QObject::tr("(cycle)");