pgLab/pglab/ResultTableModelUtil.h

24 lines
742 B
C
Raw Normal View History

#pragma once
#include "Pgsql_declare.h"
#include <QAbstractTableModel>
#include <QColor>
int GetDefaultAlignmentForType(Oid oid);
QColor GetDefaultColorForType(Oid oid);
inline int GetDefaultAlignment() { return Qt::AlignLeft + Qt::AlignVCenter; }
inline int GetDefaultBoolAlignment() { return Qt::AlignCenter + Qt::AlignVCenter; }
inline int 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; }
QString FormatBoolForDisplay(bool v);