mirror of
https://github.com/YACReader/yacreader
synced 2025-07-22 06:54:39 -04:00
a?adida alineaci?n personalizada de las columnas de la tabla
corregido bug que causaba que las columnas de la tabla no se ajustasen adecuadamente
This commit is contained in:
@ -63,6 +63,22 @@ QVariant TableModel::data(const QModelIndex &index, int role) const
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
if (role == Qt::TextAlignmentRole)
|
||||
{
|
||||
switch(index.column())//TODO obtener esto de la query
|
||||
{
|
||||
case 0:
|
||||
return Qt::AlignRight | Qt::AlignVCenter;
|
||||
case 3:
|
||||
return Qt::AlignRight | Qt::AlignVCenter;
|
||||
case 7:
|
||||
return Qt::AlignRight | Qt::AlignVCenter;
|
||||
default:
|
||||
return Qt::AlignLeft | Qt::AlignVCenter;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (role != Qt::DisplayRole)
|
||||
return QVariant();
|
||||
|
||||
@ -108,6 +124,22 @@ QVariant TableModel::headerData(int section, Qt::Orientation orientation,
|
||||
}
|
||||
}
|
||||
|
||||
if (orientation == Qt::Horizontal && role == Qt::TextAlignmentRole)
|
||||
{
|
||||
switch(section)//TODO obtener esto de la query
|
||||
{
|
||||
case 0:
|
||||
return Qt::AlignRight | Qt::AlignVCenter;
|
||||
case 3:
|
||||
return Qt::AlignRight | Qt::AlignVCenter;
|
||||
case 7:
|
||||
return Qt::AlignRight | Qt::AlignVCenter;
|
||||
default:
|
||||
return Qt::AlignLeft | Qt::AlignVCenter;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(orientation == Qt::Vertical && role == Qt::DecorationRole)
|
||||
{
|
||||
QString fileName = _data.value(section)->data(FILE_NAME).toString();
|
||||
|
Reference in New Issue
Block a user