diff --git a/pglab/PgLabItemDelegate.cpp b/pglab/PgLabItemDelegate.cpp index 0806003..73ea803 100644 --- a/pglab/PgLabItemDelegate.cpp +++ b/pglab/PgLabItemDelegate.cpp @@ -83,7 +83,7 @@ void PgLabItemDelegate::initStyleOption(QStyleOptionViewItem *option, Oid oid = InvalidOid; value = index.data(Qt::UserRole); // get OID if (value.isValid()) - oid = value.toInt(); //getType(index.column()); + oid = value.toUInt(); //getType(index.column()); value = index.data(Qt::DisplayRole); @@ -112,7 +112,7 @@ void PgLabItemDelegate::initStyleOption(QStyleOptionViewItem *option, // option->backgroundBrush = qvariant_cast(index.data(Qt::BackgroundRole)); // disable style animations for checkboxes etc. within itemviews (QTBUG-30146) - option->styleObject = 0; + option->styleObject = nullptr; } void PgLabItemDelegate::paint(QPainter *painter, diff --git a/pglab/PgLabItemDelegate.h b/pglab/PgLabItemDelegate.h index a1322cc..d11701b 100644 --- a/pglab/PgLabItemDelegate.h +++ b/pglab/PgLabItemDelegate.h @@ -3,6 +3,12 @@ #include +/** Delegate for rendering SQL data types in tableviews + * + * This delegate removes the need for the model to provide formatting information + * which in many cases solely based on the datatype so this delegate can determine + * on its own what the correct formatting is. + */ class PgLabItemDelegate : public QStyledItemDelegate { public: