Flexible models #76

Merged
eelke merged 9 commits from flexible-models into master 2018-09-02 10:30:31 +00:00
2 changed files with 8 additions and 2 deletions
Showing only changes of commit 49f009bdf9 - Show all commits

View file

@ -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<QBrush>(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,

View file

@ -3,6 +3,12 @@
#include <QStyledItemDelegate>
/** 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: