本文整理汇总了C++中QValueList::back方法的典型用法代码示例。如果您正苦于以下问题:C++ QValueList::back方法的具体用法?C++ QValueList::back怎么用?C++ QValueList::back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QValueList
的用法示例。
在下文中一共展示了QValueList::back方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: validDateRange
void MyMoneyReport::validDateRange ( QDate& _db, QDate& _de )
{
_db = fromDate();
_de = toDate();
// if either begin or end date are invalid we have one of the following
// possible date filters:
//
// a) begin date not set - first transaction until given end date
// b) end date not set - from given date until last transaction
// c) both not set - first transaction until last transaction
//
// If there is no transaction in the engine at all, we use the current
// year as the filter criteria.
if ( !_db.isValid() || !_de.isValid() ) {
QValueList<MyMoneyTransaction> list = MyMoneyFile::instance()->transactionList ( *this );
QDate tmpBegin, tmpEnd;
if ( !list.isEmpty() ) {
qHeapSort ( list );
tmpBegin = list.front().postDate();
tmpEnd = list.back().postDate();
} else {
tmpBegin = QDate ( QDate::currentDate().year(), 1, 1 ); // the first date in the file
tmpEnd = QDate ( QDate::currentDate().year(), 12, 31 );// the last date in the file
}
if ( !_db.isValid() )
_db = tmpBegin;
if ( !_de.isValid() )
_de = tmpEnd;
}
if ( _db > _de )
_db = _de;
}