2017-12-09 10:45:13 +01:00
|
|
|
|
#pragma once
|
2025-02-23 08:32:15 +01:00
|
|
|
|
#include "Pgsql_oids.h"
|
2017-12-09 10:45:13 +01:00
|
|
|
|
#include <QAbstractTableModel>
|
|
|
|
|
|
#include <QColor>
|
2025-02-23 08:32:15 +01:00
|
|
|
|
#include <util/Colors.h>
|
2017-12-09 10:45:13 +01:00
|
|
|
|
|
2018-01-15 13:32:18 +01:00
|
|
|
|
Qt::Alignment GetDefaultAlignmentForType(Oid oid);
|
2025-02-23 08:32:15 +01:00
|
|
|
|
|
|
|
|
|
|
// 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;
|
|
|
|
|
|
// }
|
2017-12-09 10:45:13 +01:00
|
|
|
|
|
2019-01-06 21:37:57 +01:00
|
|
|
|
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; }
|
2017-12-09 10:45:13 +01:00
|
|
|
|
|
|
|
|
|
|
inline QColor GetDefaultBoolColor(bool v)
|
|
|
|
|
|
{
|
2025-02-23 08:32:15 +01:00
|
|
|
|
const ColorTheme& colorTheme = GetColorTheme();
|
|
|
|
|
|
return v ? colorTheme.booleanTrue : colorTheme.booleanFalse;
|
2017-12-09 10:45:13 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-02-23 08:32:15 +01:00
|
|
|
|
// inline QColor GetDefaultIntegerColor() { return Qt::darkBlue; }
|
|
|
|
|
|
// inline QColor GetDefaultFloatColor() { return Qt::darkCyan; }
|
|
|
|
|
|
// inline QColor GetDefaultNumericColor() { return Qt::darkGreen; }
|
|
|
|
|
|
// inline QColor GetDefaultNullColor() { return Qt::gray; }
|
2017-12-09 10:45:13 +01:00
|
|
|
|
|
|
|
|
|
|
QString FormatBoolForDisplay(bool v);
|
|
|
|
|
|
|
2017-12-12 20:13:53 +01:00
|
|
|
|
class QTableView;
|
|
|
|
|
|
void SetTableViewDefault(QTableView *tv);
|