#include "ResultTableModelUtil.h" #include "Pgsql_oids.h" #include #include using namespace Pgsql; Qt::Alignment GetDefaultAlignmentForType(Oid o) { Qt::Alignment r; switch (o) { case int2_oid: case int4_oid: case int8_oid: case float4_oid: case float8_oid: case numeric_oid: case oid_oid: r = GetDefaultNumberAlignment(); break; case bool_oid: r = GetDefaultBoolAlignment(); // Qt::AlignCenter; break; default: r = GetDefaultAlignment(); } return r; } QColor GetDefaultColorForType(Oid o) { QColor c; switch (o) { case int2_oid: case int4_oid: case int8_oid: c = GetDefaultIntegerColor(); break; case float4_oid: case float8_oid: c = GetDefaultFloatColor(); break; case numeric_oid: c = GetDefaultNumericColor(); break; case oid_oid: case bool_oid: 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); }