当前位置: 首页>>代码示例>>C++>>正文


C++ PeriodListViewItem::endDate方法代码示例

本文整理汇总了C++中PeriodListViewItem::endDate方法的典型用法代码示例。如果您正苦于以下问题:C++ PeriodListViewItem::endDate方法的具体用法?C++ PeriodListViewItem::endDate怎么用?C++ PeriodListViewItem::endDate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PeriodListViewItem的用法示例。


在下文中一共展示了PeriodListViewItem::endDate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: sFillList

void displayTimePhased::sFillList()
{
  ParameterList params;
  if(!setParams(params))
    return;

  if(_data->_baseColumns == -1)
    _data->_baseColumns = list()->columnCount();

  list()->clear();
  list()->setColumnCount(_data->_baseColumns);

  _columnDates.clear();
  _column = 0;

  QList<XTreeWidgetItem*> selected = _data->_periods->selectedItems();
  for (int i = 0; i < selected.size(); i++)
  {
    PeriodListViewItem *cursor = (PeriodListViewItem*)selected[i];
    QString bucketname = QString("bucket_%1").arg(cursor->id());
    list()->addColumn(formatDate(cursor->startDate()), _qtyColumn, Qt::AlignRight, true, bucketname);
    _columnDates.append(DatePair(cursor->startDate(), cursor->endDate()));
  }

  display::sFillList();
}
开发者ID:ChristopherCotnoir,项目名称:qt-client,代码行数:26,代码来源:displayTimePhased.cpp

示例2: 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;
  }
}
开发者ID:ChristopherCotnoir,项目名称:qt-client,代码行数:65,代码来源:dspTimePhasedOpenARItems.cpp


注:本文中的PeriodListViewItem::endDate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。