Debugger: Add Image viewer with color picker and context menu.

Change-Id: I31673da5ba85e87c9819059a9e6806b5deecff1e
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
Friedemann Kleint
2013-01-08 16:20:26 +01:00
committed by hjk
parent 7bd95a4f7a
commit 78d134cdcd
4 changed files with 244 additions and 7 deletions

View File

@@ -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;