aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/debugger/watchhandler.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <[email protected]>2013-01-08 16:20:26 +0100
committerhjk <[email protected]>2013-01-08 17:16:28 +0100
commit78d134cdcd2a3fe5b9d0d338af729ff99e543f57 (patch)
tree763fd0fa527cb4ac0c26c52b3944794f0f7b0a86 /src/plugins/debugger/watchhandler.cpp
parent7bd95a4f7a3f4f66c5ffd78264d111b65b044011 (diff)
Debugger: Add Image viewer with color picker and context menu.
Diffstat (limited to 'src/plugins/debugger/watchhandler.cpp')
-rw-r--r--src/plugins/debugger/watchhandler.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp
index 5a274066a00..15ac26206a9 100644
--- a/src/plugins/debugger/watchhandler.cpp
+++ b/src/plugins/debugger/watchhandler.cpp
@@ -36,6 +36,7 @@
#include "debuggerengine.h"
#include "debuggerdialogs.h"
#include "watchutils.h"
+#include "imageviewer.h"
#include <utils/qtcassert.h>
#include <utils/savedaction.h>
@@ -1673,11 +1674,11 @@ void WatchHandler::showEditValue(const WatchData &data)
break;
case DisplayImageData:
case DisplayImageFile: { // QImage
- QLabel *l = qobject_cast<QLabel *>(w);
+ ImageViewer *l = qobject_cast<ImageViewer *>(w);
if (!l) {
removeSeparateWidget(w);
delete w;
- l = new QLabel;
+ l = new ImageViewer;
const QString title = data.address ?
tr("%1 Object at %2").arg(QLatin1String(data.type),
QLatin1String(data.hexAddress())) :
@@ -1707,9 +1708,7 @@ void WatchHandler::showEditValue(const WatchData &data)
ba = f.readAll();
bits = (uchar*)ba.data();
}
- QImage im(bits, width, height, QImage::Format(format));
- l->setPixmap(QPixmap::fromImage(im));
- l->resize(width, height);
+ l->setImage(QImage(bits, width, height, QImage::Format(format)));
showSeparateWidget(l);
}
break;