When user changes month or year in SearchBanner, A new date wasn't selected by default resulting in bad SQL query

This commit is contained in:
Grégory Soutadé 2013-01-13 20:36:42 +01:00
parent d74ad570ad
commit e9c677f5b2
3 changed files with 19 additions and 1 deletions

View File

@ -1,4 +1,4 @@
v0.4 (27/12/2012)
v0.4 (13/01/2013)
** User **
Add icons for low resolution
Sort categories using translated names
@ -9,6 +9,7 @@ v0.4 (27/12/2012)
** Bugs **
Remove some bugs in GridAccount
When user changes month or year in SearchBanner, A new date wasn't selected by default resulting in bad SQL query
v0.3 (31/05/2012)

View File

@ -42,6 +42,9 @@ SearchBanner::SearchBanner(KissCount* kiss, QFrame *parent, void* caller, OnButt
// _calendarFrom->setNavigationBarVisible(false);
_calendarFrom->setVerticalHeaderFormat(QCalendarWidget::NoVerticalHeader);
_calendarFrom->setMaximumSize(_calendarFrom->sizeHint());
_calendarFrom->setSelectedDate(QDate::currentDate());
connect(_calendarFrom, SIGNAL(currentPageChanged(int, int)), this, SLOT(OnCalendarFromPageChanged(int, int)));
_calendarTo = new QCalendarWidget(this);
_calendarTo->setGridVisible(false);
@ -49,7 +52,9 @@ SearchBanner::SearchBanner(KissCount* kiss, QFrame *parent, void* caller, OnButt
// _calendarTo->setNavigationBarVisible(false);
_calendarTo->setVerticalHeaderFormat(QCalendarWidget::NoVerticalHeader);
_calendarTo->setMaximumSize(_calendarTo->sizeHint());
_calendarTo->setSelectedDate(QDate::currentDate());
connect(_calendarTo, SIGNAL(currentPageChanged(int, int)), this, SLOT(OnCalendarToPageChanged(int, int)));
_description = new QLineEdit(this);
_description->setMinimumWidth(_description->width()*2);
@ -122,6 +127,16 @@ SearchBanner::~SearchBanner()
if (_operations) delete _operations;
}
void SearchBanner::OnCalendarFromPageChanged(int year, int month)
{
_calendarFrom->setSelectedDate(QDate(year, month, 1));
}
void SearchBanner::OnCalendarToPageChanged(int year, int month)
{
_calendarTo->setSelectedDate(QDate(year, month, 1));
}
std::vector<Operation> * SearchBanner::Search()
{
QString *description=0;

View File

@ -39,6 +39,8 @@ public:
private slots:
void OnEnter();
void OnCalendarFromPageChanged(int year, int month);
void OnCalendarToPageChanged(int year, int month);
private:
KissCount* _kiss;