本文整理汇总了C++中XTreeWidgetItem::child方法的典型用法代码示例。如果您正苦于以下问题:C++ XTreeWidgetItem::child方法的具体用法?C++ XTreeWidgetItem::child怎么用?C++ XTreeWidgetItem::child使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XTreeWidgetItem 的用法示例。
在下文中一共展示了XTreeWidgetItem::child方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1:
XTreeWidgetItem *XTreeWidgetItemProto::child(int idx) const
{
XTreeWidgetItem *item = qscriptvalue_cast<XTreeWidgetItem*>(thisObject());
if (item)
return item->child(idx);
return 0;
}
开发者ID:Dinesh-Ramakrishnan,项目名称:qt-client,代码行数:7,代码来源:xtreewidgetitemproto.cpp
示例2: sReceiptsToggleCleared
void reconcileBankaccount::sReceiptsToggleCleared()
{
XTreeWidgetItem *item = (XTreeWidgetItem*)_receipts->currentItem();
XTreeWidgetItem *child = 0;
bool setto = true;
if(0 == item)
return;
_receipts->scrollToItem(item);
if(item->altId() == 3)
{
setto = item->text(0) == tr("No");
for (int i = 0; i < item->childCount(); i++)
{
child = item->child(i);
if(child->text(0) != (setto ? tr("Yes") : tr("No")))
{
q.prepare("SELECT toggleBankrecCleared(:bankrecid, :source, :sourceid) AS cleared");
q.bindValue(":bankrecid", _bankrecid);
q.bindValue(":sourceid", child->id());
if(child->altId()==1)
q.bindValue(":source", "GL");
else if(child->altId()==2)
q.bindValue(":source", "AD");
q.exec();
if(q.first())
child->setText(0, (q.value("cleared").toBool() ? tr("Yes") : tr("No") ));
else if (q.lastError().type() != QSqlError::NoError)
{
systemError(this, q.lastError().databaseText(), __FILE__, __LINE__);
return;
}
}
}
item->setText(0, (setto ? tr("Yes") : tr("No")));
}
else
{
q.prepare("SELECT toggleBankrecCleared(:bankrecid, :source, :sourceid) AS cleared");
q.bindValue(":bankrecid", _bankrecid);
q.bindValue(":sourceid", item->id());
if(item->altId()==1)
q.bindValue(":source", "GL");
else if(item->altId()==2)
q.bindValue(":source", "AD");
q.exec();
if(q.first())
{
item->setText(0, (q.value("cleared").toBool() ? tr("Yes") : tr("No") ));
item = (XTreeWidgetItem*)item->QTreeWidgetItem::parent();
if(item != 0 && item->altId() == 3)
{
setto = true;
for (int i = 0; i < item->childCount(); i++)
{
setto = (setto && (item->child(i)->text(0) == tr("Yes")));
}
item->setText(0, (setto ? tr("Yes") : tr("No")));
}
}
else
{
populate();
if (q.lastError().type() != QSqlError::NoError)
{
systemError(this, q.lastError().databaseText(), __FILE__, __LINE__);
return;
}
}
}
}
开发者ID:,项目名称:,代码行数:73,代码来源:
示例3: sReceiptsToggleCleared
void reconcileBankaccount::sReceiptsToggleCleared()
{
XSqlQuery reconcileReceiptsToggleCleared;
XTreeWidgetItem *item = (XTreeWidgetItem*)_receipts->currentItem();
XTreeWidgetItem *child = 0;
bool setto = true;
if(0 == item)
return;
_receipts->scrollToItem(item);
if(item->altId() == 9)
{
setto = item->text(0) == tr("No");
for (int i = 0; i < item->childCount(); i++)
{
child = item->child(i);
if(child->text(0) != (setto ? tr("Yes") : tr("No")))
{
double rate = QLocale().toDouble(child->text(6));
double baseamount = QLocale().toDouble(child->text(7));
double amount = QLocale().toDouble(child->text(8));
if (_allowEdit->isChecked() && child->text(0) != tr("Yes"))
{
ParameterList params;
params.append("transtype", "receipt");
params.append("bankaccntid", _bankaccnt->id());
params.append("bankrecid", _bankrecid);
params.append("sourceid", child->id());
if(child->altId()==1)
params.append("source", "GL");
else if(child->altId()==2)
params.append("source", "SL");
else if(child->altId()==3)
params.append("source", "AD");
toggleBankrecCleared newdlg(this, "", TRUE);
newdlg.set(params);
newdlg.exec();
}
else
{
reconcileReceiptsToggleCleared.prepare("SELECT toggleBankrecCleared(:bankrecid, :source, :sourceid, :currrate, :amount) AS cleared");
reconcileReceiptsToggleCleared.bindValue(":bankrecid", _bankrecid);
reconcileReceiptsToggleCleared.bindValue(":sourceid", child->id());
if(child->altId()==1)
reconcileReceiptsToggleCleared.bindValue(":source", "GL");
else if(child->altId()==2)
reconcileReceiptsToggleCleared.bindValue(":source", "SL");
else if(child->altId()==3)
reconcileReceiptsToggleCleared.bindValue(":source", "AD");
reconcileReceiptsToggleCleared.bindValue(":currrate", rate);
reconcileReceiptsToggleCleared.bindValue(":amount", amount);
reconcileReceiptsToggleCleared.exec();
if(reconcileReceiptsToggleCleared.first())
child->setText(0, (reconcileReceiptsToggleCleared.value("cleared").toBool() ? tr("Yes") : tr("No") ));
else if (reconcileReceiptsToggleCleared.lastError().type() != QSqlError::NoError)
{
systemError(this, reconcileReceiptsToggleCleared.lastError().databaseText(), __FILE__, __LINE__);
return;
}
}
}
}
item->setText(0, (setto ? tr("Yes") : tr("No")));
populate();
}
else
{
double rate = QLocale().toDouble(item->text(6));
double baseamount = QLocale().toDouble(item->text(7));
double amount = QLocale().toDouble(item->text(8));
if (_allowEdit->isChecked() && item->text(0) != tr("Yes"))
{
ParameterList params;
params.append("transtype", "receipt");
params.append("bankaccntid", _bankaccnt->id());
params.append("bankrecid", _bankrecid);
params.append("sourceid", item->id());
if(item->altId()==1)
params.append("source", "GL");
else if(item->altId()==2)
params.append("source", "SL");
else if(item->altId()==3)
params.append("source", "AD");
toggleBankrecCleared newdlg(this, "", TRUE);
newdlg.set(params);
newdlg.exec();
populate();
}
else
{
reconcileReceiptsToggleCleared.prepare("SELECT toggleBankrecCleared(:bankrecid, :source, :sourceid, :currrate, :amount) AS cleared");
reconcileReceiptsToggleCleared.bindValue(":bankrecid", _bankrecid);
reconcileReceiptsToggleCleared.bindValue(":sourceid", item->id());
if(item->altId()==1)
reconcileReceiptsToggleCleared.bindValue(":source", "GL");
else if(item->altId()==2)
//.........这里部分代码省略.........
开发者ID:adammorawski,项目名称:qt-client,代码行数:101,代码来源:reconcileBankaccount.cpp
注:本文中的XTreeWidgetItem::child方法示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论