forked from arcnexus/RedFoX
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcolumnafecha.cpp
35 lines (27 loc) · 880 Bytes
/
columnafecha.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
* ColumnaFecha.cpp
*
* Created on: September 2012
* Author: ArcNexus
*/
#include "columnafecha.h"
ColumnaFecha::ColumnaFecha()
{
// TODO Auto-generated constructor stub
}
ColumnaFecha::~ColumnaFecha()
{
// TODO Auto-generated destructor stub
}
void ColumnaFecha::paint(QPainter *painter, const QStyleOptionViewItem &option,
const QModelIndex &index) const
{
QString cFecha = index.model()->data(index, Qt::DisplayRole).toString();
QDate fecha;
fecha = QDate::fromString(cFecha, "yyyy-MM-dd");
cFecha= fecha.toString("dd/MM/yyyy");
QStyleOptionViewItem myOption = option;
myOption.displayAlignment = Qt::AlignRight | Qt::AlignVCenter;
drawDisplay(painter, myOption, myOption.rect,cFecha);
drawFocus(painter, myOption, myOption.rect);
}