#pragma once #include "Pgsql_oids.h" #include #include #include Qt::Alignment GetDefaultAlignmentForType(Oid oid); // inline QColor GetDefaultColorForType(Oid oid) // { // using namespace Pgsql; // const ColorTheme &theme = GetColorTheme(); // QColor c; // switch (oid) { // case int2_oid: // case int4_oid: // case int8_oid: // c = theme.integerColor; // break; // case float4_oid: // case float8_oid: // c = theme.floatColor; // break; // case numeric_oid: // c = theme.numericColor; // break; // case oid_oid: // case bool_oid: // default: // c = Qt::black; // } // return c; // } inline Qt::Alignment GetDefaultAlignment() { return Qt::AlignLeft | Qt::AlignVCenter; } inline Qt::Alignment GetDefaultBoolAlignment() { return Qt::AlignCenter | Qt::AlignVCenter; } inline Qt::Alignment GetDefaultNumberAlignment() { return Qt::AlignRight | Qt::AlignVCenter; } inline QColor GetDefaultBoolColor(bool v) { const ColorTheme& colorTheme = GetColorTheme(); return v ? colorTheme.booleanTrue : colorTheme.booleanFalse; } // inline QColor GetDefaultIntegerColor() { return Qt::darkBlue; } // inline QColor GetDefaultFloatColor() { return Qt::darkCyan; } // inline QColor GetDefaultNumericColor() { return Qt::darkGreen; } // inline QColor GetDefaultNullColor() { return Qt::gray; } QString FormatBoolForDisplay(bool v); class QTableView; void SetTableViewDefault(QTableView *tv);