本文整理汇总了C++中PeriodListViewItem::id方法的典型用法代码示例。如果您正苦于以下问题:C++ PeriodListViewItem::id方法的具体用法?C++ PeriodListViewItem::id怎么用?C++ PeriodListViewItem::id使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PeriodListViewItem
的用法示例。
在下文中一共展示了PeriodListViewItem::id方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sFillCustom
void dspTimePhasedOpenARItems::sFillCustom()
{
XSqlQuery dspFillCustom;
if (!_periods->isPeriodSelected())
{
if (isVisible())
QMessageBox::warning( this, tr("Select Calendar Periods"),
tr("Please select one or more Calendar Periods") );
return;
}
_columnDates.clear();
list()->setColumnCount(2);
QString sql("SELECT cust_id, cust_number, cust_name");
QStringList linetotal;
int columns = 1;
QList<XTreeWidgetItem*> selected = _periods->selectedItems();
for (int i = 0; i < selected.size(); i++)
{
PeriodListViewItem *cursor = (PeriodListViewItem*)selected[i];
QString bucketname = QString("bucket%1").arg(columns++);
sql += QString(", openARItemsValue(cust_id, %2) AS %1,"
" 'curr' AS %3_xtnumericrole, 0 AS %4_xttotalrole")
.arg(bucketname)
.arg(cursor->id())
.arg(bucketname)
.arg(bucketname);
list()->addColumn(formatDate(cursor->startDate()), _bigMoneyColumn, Qt::AlignRight, true, bucketname);
_columnDates.append(DatePair(cursor->startDate(), cursor->endDate()));
linetotal << QString("openARItemsValue(cust_id, %2)").arg(cursor->id());
}
list()->addColumn(tr("Total"), _bigMoneyColumn, Qt::AlignRight, true, "linetotal");
sql += ", " + linetotal.join("+") + " AS linetotal,"
" 'curr' AS linetotal_xtnumericrole,"
" 0 AS linetotal_xttotalrole,"
" (" + linetotal.join("+") + ") = 0.0 AS xthiddenrole "
"FROM custinfo LEFT OUTER JOIN custgrpitem ON (cust_id = custgrpitem_cust_id) "
"<? if exists('cust_id') ?>"
"WHERE (cust_id=<? value('cust_id') ?>)"
"<? elseif exists('custtype_id') ?>"
"WHERE (cust_custtype_id=<? value('custtype_id') ?>)"
"<? elseif exists('custgrp_id') ?>"
"WHERE (custgrpitem_custgrp_id=<? value('custgrp_id') ?>)"
"<? elseif exists('custtype_pattern') ?>"
"WHERE (cust_custtype_id IN (SELECT custtype_id FROM custtype WHERE (custtype_code ~ <? value('custtype_pattern') ?>))) "
"<? endif ?>"
"ORDER BY cust_number;";
MetaSQLQuery mql(sql);
ParameterList params;
if (! setParams(params))
return;
dspFillCustom = mql.toQuery(params);
list()->populate(dspFillCustom);
if (dspFillCustom.lastError().type() != QSqlError::NoError)
{
systemError(this, dspFillCustom.lastError().databaseText(), __FILE__, __LINE__);
return;
}
}