Collection of minor code improvements.

Program should still behave exactly the same.
This commit is contained in:
eelke 2018-10-21 13:46:58 +02:00
parent 38ae5f50e4
commit d4d8316917
6 changed files with 12 additions and 16 deletions

View file

@ -42,8 +42,7 @@ QSize IconColumnDelegate::sizeHint(const QStyleOptionViewItem &,
void IconColumnDelegate::clearCache()
{
for (auto &e : m_Icons)
delete e.
second;
delete e.second;
m_Icons.clear();
}

View file

@ -3,6 +3,7 @@
#include "Pgsql_oids.h"
#include "ResultTableModelUtil.h"
#include "CustomDataRole.h"
PgLabItemDelegate::PgLabItemDelegate(QObject *parent)
: QStyledItemDelegate(parent)
@ -81,7 +82,7 @@ void PgLabItemDelegate::initStyleOption(QStyleOptionViewItem *option,
// }
Oid oid = InvalidOid;
value = index.data(Qt::UserRole); // get OID
value = index.data(CustomDataTypeRole); // get OID
if (value.isValid())
oid = value.toUInt(); //getType(index.column());