Flexible models #76
2 changed files with 8 additions and 2 deletions
|
|
@ -83,7 +83,7 @@ void PgLabItemDelegate::initStyleOption(QStyleOptionViewItem *option,
|
||||||
Oid oid = InvalidOid;
|
Oid oid = InvalidOid;
|
||||||
value = index.data(Qt::UserRole); // get OID
|
value = index.data(Qt::UserRole); // get OID
|
||||||
if (value.isValid())
|
if (value.isValid())
|
||||||
oid = value.toInt(); //getType(index.column());
|
oid = value.toUInt(); //getType(index.column());
|
||||||
|
|
||||||
value = index.data(Qt::DisplayRole);
|
value = index.data(Qt::DisplayRole);
|
||||||
|
|
||||||
|
|
@ -112,7 +112,7 @@ void PgLabItemDelegate::initStyleOption(QStyleOptionViewItem *option,
|
||||||
// option->backgroundBrush = qvariant_cast<QBrush>(index.data(Qt::BackgroundRole));
|
// option->backgroundBrush = qvariant_cast<QBrush>(index.data(Qt::BackgroundRole));
|
||||||
|
|
||||||
// disable style animations for checkboxes etc. within itemviews (QTBUG-30146)
|
// disable style animations for checkboxes etc. within itemviews (QTBUG-30146)
|
||||||
option->styleObject = 0;
|
option->styleObject = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PgLabItemDelegate::paint(QPainter *painter,
|
void PgLabItemDelegate::paint(QPainter *painter,
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,12 @@
|
||||||
|
|
||||||
#include <QStyledItemDelegate>
|
#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
|
class PgLabItemDelegate : public QStyledItemDelegate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue