mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 11:00:44 -06:00
Use the column type affinity for the default text alignment
In this way the entire column has the same alignment and gives a hint of the column datatype. Note that if the DB has data incoherent with the affinity, it will not be reflected in the text alignment. See issue #2032
This commit is contained in:
@@ -409,8 +409,7 @@ QVariant SqliteTableModel::data(const QModelIndex &index, int role) const
|
||||
QVariant condFormat = getMatchingCondFormat(row, column, data, role);
|
||||
if (condFormat.isValid())
|
||||
return condFormat;
|
||||
bool isNumber;
|
||||
data.toDouble(&isNumber);
|
||||
bool isNumber = m_vDataTypes.at(column) == SQLITE_INTEGER || m_vDataTypes.at(column) == SQLITE_FLOAT;
|
||||
return static_cast<int>((isNumber ? Qt::AlignRight : Qt::AlignLeft) | Qt::AlignVCenter);
|
||||
} else if(role == Qt::DecorationRole) {
|
||||
if(!row_available)
|
||||
|
||||
Reference in New Issue
Block a user