Lot of code for generating code. Working on unit tests.

This commit is contained in:
eelke 2018-09-09 18:52:32 +02:00
parent da45929b12
commit 8f4845d4d2
42 changed files with 1089 additions and 267 deletions

View file

@ -1,6 +1,7 @@
#include "BaseTableModel.h"
#include "ResultTableModelUtil.h"
#include <QBrush>
#include "Pgsql_oids.h"
using namespace Pgsql;
@ -10,7 +11,7 @@ QVariant BaseTableModel::data(const QModelIndex &index, int role) const
Oid oid = getType(index.column());
if (role == Qt::DisplayRole) {
v = getData(index);
if (oid == BOOLOID) {
if (oid == bool_oid) {
v = FormatBoolForDisplay(v.toBool());
}
}
@ -18,7 +19,7 @@ QVariant BaseTableModel::data(const QModelIndex &index, int role) const
v = (int)GetDefaultAlignmentForType(oid);
}
else if (role == Qt::ForegroundRole) {
if (oid == BOOLOID) {
if (oid == bool_oid) {
QVariant d = getData(index);
if (d.type() == QVariant::Bool) {
v = QBrush(GetDefaultBoolColor(d.toBool()));