pgLab/pglab/ResultTableModelUtil.h

27 lines
899 B
C
Raw Normal View History

#pragma once
#include "Pgsql_declare.h"
#include <QAbstractTableModel>
#include <QColor>
2018-01-15 13:32:18 +01:00
Qt::Alignment GetDefaultAlignmentForType(Oid oid);
QColor GetDefaultColorForType(Oid oid);
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; }
inline QColor GetDefaultBoolColor(bool v)
{
return v ? Qt::darkGreen : Qt::darkRed;
}
inline QColor GetDefaultIntegerColor() { return Qt::darkBlue; }
inline QColor GetDefaultFloatColor() { return Qt::darkCyan; }
inline QColor GetDefaultNumericColor() { return Qt::darkGreen; }
2018-01-15 13:32:18 +01:00
inline QColor GetDefaultNullColor() { return Qt::gray; }
QString FormatBoolForDisplay(bool v);
class QTableView;
void SetTableViewDefault(QTableView *tv);