Messy commit. Testing suff and some improvements to how data is shown.

This commit is contained in:
eelke 2017-12-09 10:45:13 +01:00
parent bebb3391c3
commit 3a13b7ffb4
59 changed files with 2045 additions and 716 deletions

View file

@ -0,0 +1,57 @@
#include "ResultTableModelUtil.h"
using namespace Pgsql;
int GetDefaultAlignmentForType(Oid o)
{
int r;
switch (o) {
case INT2OID:
case INT4OID:
case INT8OID:
case FLOAT4OID:
case FLOAT8OID:
case NUMERICOID:
case OIDOID:
r = GetDefaultNumberAlignment();
break;
case BOOLOID:
r = GetDefaultBoolAlignment(); // Qt::AlignCenter;
break;
default:
r = GetDefaultAlignment();
}
return r;
}
QColor GetDefaultColorForType(Oid o)
{
QColor c;
switch (o) {
case INT2OID:
case INT4OID:
case INT8OID:
c = GetDefaultIntegerColor();
break;
case FLOAT4OID:
case FLOAT8OID:
c = GetDefaultFloatColor();
break;
case NUMERICOID:
c = GetDefaultNumericColor();
break;
case OIDOID:
case BOOLOID:
default:
c = Qt::black;
}
return c;
}
QString FormatBoolForDisplay(bool v)
{
return v ? "TRUE" : "FALSE";
}