mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -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:
parent
8f22c65c83
commit
871d10af90
@ -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();
|
||||
|
@ -934,7 +934,7 @@ void LibraryWindow::loadCovers(const QModelIndex & mi)
|
||||
|
||||
//debido a un bug, qt4 no es capaz de ajustar el ancho teniendo en cuenta todas la filas (no sólo las visibles)
|
||||
//así que se ecala la primera vez y después se deja el control al usuario.
|
||||
if(!settings->contains(COMICS_VIEW_HEADERS))
|
||||
//if(!settings->contains(COMICS_VIEW_HEADERS))
|
||||
comicView->resizeColumnsToContents();
|
||||
comicView->horizontalHeader()->setStretchLastSection(true);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user