#include "ResultTableModelUtil.h" #include #include using namespace Pgsql; int GetDefaultAlignmentForType(Oid o) { int r; switch (o) { case INT2OID: case INT4OID: case INT8OID: case FLOAT4OID: case FLOAT8OID: case NUMERICOID: case OIDOID: r = GetDefaultNumberAlignment(); break; case BOOLOID: r = GetDefaultBoolAlignment(); // Qt::AlignCenter; break; default: r = GetDefaultAlignment(); } return r; } QColor GetDefaultColorForType(Oid o) { QColor c; switch (o) { case INT2OID: case INT4OID: case INT8OID: c = GetDefaultIntegerColor(); break; case FLOAT4OID: case FLOAT8OID: c = GetDefaultFloatColor(); break; case NUMERICOID: c = GetDefaultNumericColor(); break; case OIDOID: case BOOLOID: default: c = Qt::black; } return c; } QString FormatBoolForDisplay(bool v) { return v ? "TRUE" : "FALSE"; } // // // // Source Sans Pro // 10 // // // // QAbstractItemView::NoEditTriggers // // // QAbstractItemView::ScrollPerPixel // // // QAbstractItemView::ScrollPerPixel // // // false // // // 20 // // // 16 // // void SetTableViewDefault(QTableView *tv) { tv->setAlternatingRowColors(true); tv->verticalHeader()->setMinimumSectionSize(16); tv->verticalHeader()->setDefaultSectionSize(20); }