diff options
author | hjk <qtc-committer@nokia.com> | 2010-03-15 15:36:00 +0100 |
---|---|---|
committer | hjk <qtc-committer@nokia.com> | 2010-03-16 12:08:33 +0100 |
commit | 0cd06f55bc3618567246cf97417ee632db70dfab (patch) | |
tree | 76ce9452f84a1bea769e889e09f342a336300eee /src/plugins/debugger/watchhandler.cpp | |
parent | 8ebe4e90cd044abbf0b978ae328afbb3fb247eea (diff) | |
download | qt-creator-0cd06f55bc3618567246cf97417ee632db70dfab.tar.gz |
debugger: don't hard code typeformats except for ints and strings
Diffstat (limited to 'src/plugins/debugger/watchhandler.cpp')
-rw-r--r-- | src/plugins/debugger/watchhandler.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index d6e39b1805..b8c0f1e64f 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -108,6 +108,7 @@ public: //////////////////////////////////////////////////////////////////// WatchData::WatchData() : + editformat(0), hasChildren(false), generation(-1), valueEnabled(true), @@ -818,6 +819,8 @@ QVariant WatchModel::data(const QModelIndex &idx, int role) const return m_handler->m_expandedINames.contains(data.iname); case TypeFormatListRole: + if (!data.typeFormats.isEmpty()) + return data.typeFormats.split(','); if (isIntType(data.type)) return QStringList() << tr("decimal") << tr("hexadecimal") << tr("binary") << tr("octal"); @@ -828,10 +831,6 @@ QVariant WatchModel::data(const QModelIndex &idx, int role) const << tr("UTF8 string") << tr("UTF16 string") << tr("UCS4 string"); - if (data.type.endsWith(QLatin1String("QImage"))) - return QStringList() - << tr("normal") - << tr("displayed"); break; case TypeFormatRole: @@ -1255,9 +1254,7 @@ void WatchHandler::insertData(const WatchData &data) QTC_ASSERT(model, return); MODEL_DEBUG("NOTHING NEEDED: " << data.toString()); model->insertData(data); - - if (!data.editvalue.isEmpty()) - showEditValue(data); + showEditValue(data); } } @@ -1352,8 +1349,10 @@ static void swapEndian(char *d, int nchar) void WatchHandler::showEditValue(const WatchData &data) { QWidget *w = m_editWindows.value(data.iname); - - if (data.editformat == 0x1 || data.editformat == 0x3) { + if (data.editformat == 0x0) { + m_editWindows.remove(data.iname); + delete w; + } else if (data.editformat == 0x1 || data.editformat == 0x3) { // QImage if (!w) { w = new QLabel; |