本文整理汇总了C++中XTreeWidgetItem::text方法的典型用法代码示例。如果您正苦于以下问题:C++ XTreeWidgetItem::text方法的具体用法?C++ XTreeWidgetItem::text怎么用?C++ XTreeWidgetItem::text使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XTreeWidgetItem 的用法示例。
在下文中一共展示了XTreeWidgetItem::text方法的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: sClear
void selectPayments::sClear()
{
bool update = FALSE;
QList<XTreeWidgetItem*> list = _apopen->selectedItems();
XTreeWidgetItem * cursor = 0;
q.prepare("SELECT clearPayment(:apopen_id) AS result;");
for(int i = 0; i < list.size(); i++)
{
cursor = (XTreeWidgetItem*)list.at(i);
q.bindValue(":apopen_id", cursor->altId());
q.exec();
if (q.first())
{
int result = q.value("result").toInt();
if (result < 0)
{
systemError(this, cursor->text(0) + " " + cursor->text(2) + "\n" +
storedProcErrorLookup("clearPayment", result),
__FILE__, __LINE__);
return;
}
}
else if (q.lastError().type() != QSqlError::NoError)
{
systemError(this, q.lastError().databaseText(), __FILE__, __LINE__);
return;
}
update = TRUE;
}
if(update)
omfgThis->sPaymentsUpdated(-1, -1, TRUE);
}
开发者ID:,项目名称:,代码行数:33,代码来源:
示例2: sSearchInvoiceNum
void dspVendorAPHistory::sSearchInvoiceNum()
{
QString sub = _searchInvoiceNum->text().trimmed();
if(sub.isEmpty())
return;
XTreeWidgetItem *item = 0;
XTreeWidgetItem *foundSub = 0;
for (int i = 0; i < list()->topLevelItemCount(); i++)
{
item = list()->topLevelItem(i);
if (item->text(3) == sub)
{
foundSub = item;
break;
}
else if (foundSub == 0 && item->text(3).startsWith(sub))
foundSub = item;
}
if (foundSub)
{
list()->setCurrentItem(foundSub);
list()->scrollToItem(foundSub);
}
}
开发者ID:AlFoX,项目名称:qt-client,代码行数:25,代码来源:dspVendorAPHistory.cpp
示例3: sClear
void selectPayments::sClear()
{
XSqlQuery selectClear;
bool update = false;
QList<XTreeWidgetItem*> list = _apopen->selectedItems();
XTreeWidgetItem * cursor = 0;
selectClear.prepare("SELECT clearPayment(:apopen_id) AS result;");
for(int i = 0; i < list.size(); i++)
{
cursor = (XTreeWidgetItem*)list.at(i);
selectClear.bindValue(":apopen_id", cursor->altId());
selectClear.exec();
if (selectClear.first())
{
int result = selectClear.value("result").toInt();
if (result < 0)
{
ErrorReporter::error(QtCriticalMsg, this, cursor->text(0) + " " + cursor->text(2) + "\n" +
tr(" Error Clearing Payment Information"),
storedProcErrorLookup("clearPayment", result),
__FILE__, __LINE__);
return;
}
}
else if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Clearing Payment Information"),
selectClear, __FILE__, __LINE__))
{
return;
}
update = true;
}
if(update)
omfgThis->sPaymentsUpdated(-1, -1, true);
}
开发者ID:dwatson78,项目名称:qt-client,代码行数:35,代码来源:selectPayments.cpp
示例4: sPopulateMenu
void dspVendorAPHistory::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *pSelected)
{
int menuItem;
XTreeWidgetItem * item = (XTreeWidgetItem*)pSelected;
if (item->id() != -1)
{
menuItem = pMenu->insertItem(tr("Edit..."), this, SLOT(sEdit()), 0);
if (!_privileges->check("EditSalesHistory"))
pMenu->setItemEnabled(menuItem, FALSE);
pMenu->insertItem(tr("View A/P Open..."), this, SLOT(sView()), 0);
menuItem = pMenu->insertItem(tr("View G/L Series..."), this, SLOT(sViewGLSeries()), 0);
if (!_privileges->check("ViewGLTransactions"))
pMenu->setItemEnabled(menuItem, FALSE);
if(item->altId() == -1 && item->text(1)==tr("Voucher"))
{
menuItem = pMenu->insertItem(tr("View Voucher..."), this, SLOT(sViewVoucher()), 0);
if (!_privileges->check("ViewVouchers"))
pMenu->setItemEnabled(menuItem, FALSE);
if(item->text(7)==item->text(8))
{
pMenu->insertSeparator();
menuItem = pMenu->insertItem(tr("Void"), this, SLOT(sVoidVoucher()), 0);
if (!_privileges->check("MaintainAPMemos"))
pMenu->setItemEnabled(menuItem, FALSE);
}
}
}
}
开发者ID:,项目名称:,代码行数:34,代码来源:
示例5: sSelectLine
void selectPayments::sSelectLine()
{
XSqlQuery selectSelectLine;
ParameterList params;
params.append("type", "P");
int bankaccntid = _bankaccnt->id();
if(bankaccntid == -1)
{
selectBankAccount newdlg(this, "", TRUE);
newdlg.set(params);
bankaccntid = newdlg.exec();
}
if (bankaccntid != -1)
{
bool update = FALSE;
QList<XTreeWidgetItem*> list = _apopen->selectedItems();
XTreeWidgetItem * cursor = 0;
selectSelectLine.prepare("SELECT selectPayment(:apopen_id, :bankaccnt_id) AS result;");
XSqlQuery slctln;
slctln.prepare( "SELECT apopen_status FROM apopen WHERE apopen_id=:apopen_id;");
for(int i = 0; i < list.size(); i++)
{
cursor = (XTreeWidgetItem*)list.at(i);
selectSelectLine.bindValue(":apopen_id", cursor->id());
selectSelectLine.bindValue(":bankaccnt_id", bankaccntid);
slctln.bindValue(":apopen_id", cursor->id());
slctln.exec();
if (slctln.first())
{
if (slctln.value("apopen_status").toString() != "H")
{
selectSelectLine.exec();
if (selectSelectLine.first())
{
int result = selectSelectLine.value("result").toInt();
if (result < 0)
{
systemError(this, cursor->text(0) + " " + cursor->text(2) + "\n" +
storedProcErrorLookup("selectPayment", result),
__FILE__, __LINE__);
return;
}
}
else if (selectSelectLine.lastError().type() != QSqlError::NoError)
{
systemError(this, selectSelectLine.lastError().databaseText(), __FILE__, __LINE__);
return;
}
}
update = TRUE;
}
}
if(update)
omfgThis->sPaymentsUpdated(-1, -1, TRUE);
}
}
开发者ID:AlFoX,项目名称:qt-client,代码行数:58,代码来源:selectPayments.cpp
示例6: sEditPeriodLabel
void dspFinancialReport::sEditPeriodLabel()
{
XTreeWidgetItem * item = (XTreeWidgetItem*)_periods->currentItem();
if(!item)
return;
bool ok;
QString text = QInputDialog::getText( tr("Alternate Label"),
tr("Enter an alternate label for the period %1:").arg(item->text(0)),
QLineEdit::Normal, item->text(1), &ok, this );
if(ok)
item->setText(1, text);
}
开发者ID:,项目名称:,代码行数:13,代码来源:
示例7: manufItemDescrip
QString itemSourceSearch::manufItemDescrip()
{
XTreeWidgetItem * item = (XTreeWidgetItem*)_itemsrc->currentItem();
if(item)
return item->text(7);
return QString();
}
开发者ID:hescoinc,项目名称:qt-client,代码行数:7,代码来源:itemSourceSearch.cpp
示例8: text
QString XTreeWidgetItemProto::text(int p) const
{
XTreeWidgetItem *item = qscriptvalue_cast<XTreeWidgetItem*>(thisObject());
if (item)
return item->text(p);
return QString();
}
开发者ID:Dinesh-Ramakrishnan,项目名称:qt-client,代码行数:7,代码来源:xtreewidgetitemproto.cpp
示例9: vendItemNumber
QString itemSourceSearch::vendItemNumber()
{
XTreeWidgetItem * item = (XTreeWidgetItem*)_itemsrc->currentItem();
if(item)
return item->text(3);
return QString();
}
开发者ID:hescoinc,项目名称:qt-client,代码行数:7,代码来源:itemSourceSearch.cpp
示例10: sPopulateMenu
void dspVendorAPHistory::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *pSelected, int)
{
QAction *menuItem;
XTreeWidgetItem * item = (XTreeWidgetItem*)pSelected;
if (item->id() != -1)
{
menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit()));
menuItem->setEnabled(_privileges->check("EditAPOpenItem"));
pMenu->addAction(tr("View A/P Open..."), this, SLOT(sView()));
menuItem = pMenu->addAction(tr("View G/L Series..."), this, SLOT(sViewGLSeries()));
menuItem->setEnabled(_privileges->check("ViewGLTransactions"));
if(item->altId() == -1 && item->text(1)==tr("Voucher"))
{
menuItem = pMenu->addAction(tr("View Voucher..."), this, SLOT(sViewVoucher()));
menuItem->setEnabled(_privileges->check("ViewVouchers") || _privileges->check("MaintainVouchers"));
if(item->rawValue("amount")==item->rawValue("balance"))
{
pMenu->addSeparator();
menuItem = pMenu->addAction(tr("Void"), this, SLOT(sVoidVoucher()));
menuItem->setEnabled(_privileges->check("VoidPostedVouchers"));
}
}
}
}
开发者ID:AlFoX,项目名称:qt-client,代码行数:30,代码来源:dspVendorAPHistory.cpp
示例11: sChecksToggleCleared
void reconcileBankaccount::sChecksToggleCleared()
{
XSqlQuery reconcileChecksToggleCleared;
XTreeWidgetItem *item = (XTreeWidgetItem*)_checks->currentItem();
if(0 == item)
return;
_checks->scrollToItem(item);
double rate = item->rawValue("doc_exchrate").toDouble();
double baseamount = item->rawValue("base_amount").toDouble();
double amount = item->rawValue("amount").toDouble();
if (_allowEdit->isChecked() && item->text(0) != tr("Yes"))
{
ParameterList params;
params.append("transtype", "check");
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
{
reconcileChecksToggleCleared.prepare("SELECT toggleBankrecCleared(:bankrecid, :source, :sourceid, :currrate, :amount) AS cleared");
reconcileChecksToggleCleared.bindValue(":bankrecid", _bankrecid);
reconcileChecksToggleCleared.bindValue(":sourceid", item->id());
if(item->altId()==1)
reconcileChecksToggleCleared.bindValue(":source", "GL");
else if(item->altId()==2)
reconcileChecksToggleCleared.bindValue(":source", "SL");
else if(item->altId()==3)
reconcileChecksToggleCleared.bindValue(":source", "AD");
reconcileChecksToggleCleared.bindValue(":currrate", rate);
reconcileChecksToggleCleared.bindValue(":amount", amount);
reconcileChecksToggleCleared.exec();
if(reconcileChecksToggleCleared.first())
item->setText(0, (reconcileChecksToggleCleared.value("cleared").toBool() ? tr("Yes") : tr("No") ));
else
{
populate();
if (reconcileChecksToggleCleared.lastError().type() != QSqlError::NoError)
{
systemError(this, reconcileChecksToggleCleared.lastError().databaseText(), __FILE__, __LINE__);
return;
}
}
}
}
开发者ID:adammorawski,项目名称:qt-client,代码行数:59,代码来源:reconcileBankaccount.cpp
示例12: type
QString OrderList::type() const
{
if(selectedAtDone.count() > 0)
{
XTreeWidgetItem * item = (XTreeWidgetItem*)selectedAtDone.at(0);
return item->text(1);
}
return "";
}
开发者ID:,项目名称:,代码行数:10,代码来源:
示例13: sEditShippingFormWatermark
void printShippingForm::sEditShippingFormWatermark()
{
QList<QTreeWidgetItem*>selected = _shipformWatermarks->selectedItems();
for (int counter = 0; counter < selected.size(); counter++)
{
XTreeWidgetItem *cursor = static_cast<XTreeWidgetItem*>(selected[counter]);
ParameterList params;
params.append("watermark", cursor->text(1));
params.append("showPrices", (cursor->text(2) == tr("Yes")));
editICMWatermark newdlg(this, "", TRUE);
newdlg.set(params);
if (newdlg.exec() == XDialog::Accepted)
{
cursor->setText(1, newdlg.watermark());
cursor->setText(2, ((newdlg.showPrices()) ? tr("Yes") : tr("No")));
}
}
}
开发者ID:,项目名称:,代码行数:19,代码来源:
示例14: save
bool XDocCopySetter::save()
{
if (_x_metrics)
{
if (! _numCopiesMetric.isEmpty())
_x_metrics->set(_numCopiesMetric, _numOfCopies->value());
QString fullmetric("%1%2");
for (int i = 0; i < _watermarks->topLevelItemCount(); i++)
{
XTreeWidgetItem *item = _watermarks->topLevelItem(i);
if (! _watermarkMetric.isEmpty())
_x_metrics->set(fullmetric.arg(_watermarkMetric).arg(i), item->text(1));
if (! _showPriceMetric.isEmpty())
_x_metrics->set(fullmetric.arg(_showPriceMetric).arg(i), (item->text(2) == yesStr));
}
}
return true;
}
开发者ID:ChristopherCotnoir,项目名称:qt-client,代码行数:19,代码来源:xdoccopysetter.cpp
示例15: sSearch
/* do this differently than VirtualList::sSearch(QString&):
look for any consecutive characters that match, not just the
first field
*/
void AddressList::sSearch(const QString& pTarget)
{
XTreeWidgetItem *target = 0;
for (int i = 0; i < _listTab->topLevelItemCount(); i++)
{
target = _listTab->topLevelItem(i);
if (target == NULL ||
(target->text(0) + " " + target->text(1) + " " +
target->text(2) + " " + target->text(3) + " " +
target->text(4) + " " + target->text(5) + " " +
target->text(6) + " " + target->text(7)).contains(pTarget.toUpper(),
Qt::CaseInsensitive))
break;
}
if (target)
{
_listTab->setCurrentItem(target);
_listTab->scrollToItem(target);
}
}
开发者ID:,项目名称:,代码行数:25,代码来源:
示例16: sCollapsed
void dspFinancialReport::sCollapsed( QTreeWidgetItem * item )
{
for (int i = 0; i < item->childCount(); i++)
{
XTreeWidgetItem *child = (XTreeWidgetItem*)item->child(i);
if(child->altId() == -1)
{
for (int i = 1; i < _layout->columnCount(); i++)
item->setText(i, child->text(i));
return;
}
}
}
开发者ID:,项目名称:,代码行数:13,代码来源:
示例17: toString
QString XTreeWidgetItemProto::toString() const
{
QString returnVal = QString("XTreeWidgetItem");
XTreeWidgetItem *item = qscriptvalue_cast<XTreeWidgetItem*>(thisObject());
if (item)
{
QStringList data;
for (int i = 0; i < item->columnCount(); i++)
data << item->text(i);
returnVal += QString("(id = %1, altId = %2, data = [%3])")
.arg(item->id()).arg(item->altId()).arg(data.join(", "));
}
else
returnVal += "(unknown)";
return "[" + returnVal + "]";
}
开发者ID:Dinesh-Ramakrishnan,项目名称:qt-client,代码行数:17,代码来源:xtreewidgetitemproto.cpp
示例18: sViewAropen
void arWorkBench::sViewAropen()
{
ParameterList params;
XTreeWidgetItem * item = static_cast<XTreeWidgetItem*>(_aropen->currentItem());
if(_aropen->altId() == 1 && item)
{
params.append("invoiceNumber", item->text(1));
dspInvoiceInformation * newdlg = new dspInvoiceInformation();
newdlg->set(params);
omfgThis->handleNewWindow(newdlg);
}
else
{
params.append("mode", "view");
params.append("aropen_id", _aropen->id());
arOpenItem newdlg(this, "", TRUE);
newdlg.set(params);
newdlg.exec();
}
}
开发者ID:,项目名称:,代码行数:20,代码来源:
示例19: sToggleReceiving
void voucherItem::sToggleReceiving(QTreeWidgetItem *pItem)
{
XSqlQuery voucherToggleReceiving;
double vch = 0;
double amt = 0;
double rcv = 0;
double rej = 0;
QString s;
XTreeWidgetItem* item = (XTreeWidgetItem*)pItem;
if(item->id() == -1)
return;
// TODO: translation
if (item->text(4) == "Yes")
item->setText(4, "No");
else
item->setText(4, "Yes");
for (int i = 0; i < _uninvoiced->topLevelItemCount(); i++)
{
XTreeWidgetItem *item = _uninvoiced->topLevelItem(i);
double pp = item->data(3, Xt::RawRole).toDouble();
double qty = item->data(2, Xt::RawRole).toDouble();
if (item->text(4) == "Yes")
{
vch = vch + qty;
amt = amt + (qty * pp);
}
else
{
if (item->text(0) == "Receiving")
{
rcv = rcv + qty;
}
else
{
rej = rej + qty;
}
}
}
_qtyToVoucher->setDouble(vch);
_amtToVoucher->setDouble(amt);
_uninvoicedReceived->setDouble(rcv);
_uninvoicedRejected->setDouble(rej);
// Check PO Close flag
if ( ((_ordered->toDouble() <= (_received->toDouble() - _rejected->toDouble()))) && (_uninvoicedReceived->toDouble() == 0) && (_uninvoicedRejected->toDouble() == 0) )
_closePoitem->setChecked(true);
else
_closePoitem->setChecked(false);
// Update the receipt record
if (item->text("f_tagged") == "Yes")
{
if (item->altId() == 1)
voucherToggleReceiving.prepare( "UPDATE recv "
"SET recv_vohead_id=:vohead_id "
"WHERE (recv_id=:target_id);" );
else if (item->altId() == 2)
voucherToggleReceiving.prepare( "UPDATE poreject "
"SET poreject_vohead_id=:vohead_id,poreject_voitem_id=:voitem_id "
"WHERE (poreject_id=:target_id);" );
}
else
{
if (item->altId() == 1)
voucherToggleReceiving.prepare( "UPDATE recv "
"SET recv_vohead_id=NULL "
"WHERE ((recv_id=:target_id)"
" AND (recv_vohead_id=:vohead_id));" );
else if (item->altId() == 2)
voucherToggleReceiving.prepare( "UPDATE poreject "
"SET poreject_vohead_id=NULL,poreject_voitem_id=NULL "
"WHERE ((poreject_id=:target_id)"
" AND (poreject_vohead_id=:vohead_id));" );
}
voucherToggleReceiving.bindValue(":vohead_id", _voheadid);
voucherToggleReceiving.bindValue(":voitem_id", _voitemid);
voucherToggleReceiving.bindValue(":target_id", item->id());
voucherToggleReceiving.exec();
if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Saving Voucher Item Information"),
voucherToggleReceiving, __FILE__, __LINE__))
{
reject();
return;
}
}
开发者ID:xtuple,项目名称:qt-client,代码行数:92,代码来源:voucherItem.cpp
示例20: sToggleReceiving
void voucherItem::sToggleReceiving(QTreeWidgetItem *pItem)
{
double n;
QString s;
XTreeWidgetItem* item = (XTreeWidgetItem*)pItem;
if(item->id() == -1)
return;
if (item->text(3) == "Yes")
{
item->setText(3, "No");
if (item->text(0) == "Receiving")
{
n = _qtyToVoucher->toDouble();
_qtyToVoucher->setText(item->text(2));
n = n - _qtyToVoucher->toDouble();
_qtyToVoucher->setText(s.setNum(n));
n = _uninvoicedReceived->toDouble();
_uninvoicedReceived->setText(item->text(2));
n = n + _uninvoicedReceived->toDouble();
_uninvoicedReceived->setText(s.setNum(n));
}
else
{
n = _qtyToVoucher->toDouble();
_qtyToVoucher->setText(item->text(2));
n = n - _qtyToVoucher->toDouble();
_qtyToVoucher->setText(s.setNum(n));
n = _uninvoicedRejected->toDouble();
_uninvoicedRejected->setText(item->text(2));
n = n + _rejected->toDouble();
_uninvoicedRejected->setText(s.setNum(n));
}
}
else
{
item->setText(3, "Yes");
if (item->text(0) == "Receiving")
{
n = _qtyToVoucher->toDouble();
_qtyToVoucher->setText(item->text(2));
n = n + _qtyToVoucher->toDouble();
_qtyToVoucher->setText(s.setNum(n));
n = _uninvoicedReceived->toDouble();
_uninvoicedReceived->setText(item->text(2));
n = n - _uninvoicedReceived->toDouble();
_uninvoicedReceived->setText(s.setNum(n));
}
else
{
n = _qtyToVoucher->toDouble();
_qtyToVoucher->setText(item->text(2));
n = n + _qtyToVoucher->toDouble();
_qtyToVoucher->setText(s.setNum(n));
n = _uninvoicedRejected->toDouble();
_uninvoicedRejected->setText(item->text(2));
n = n + _uninvoicedRejected->toDouble();
_uninvoicedRejected->setText(s.setNum(n));
}
}
//Check PO Close flag
if ( ((_ordered->toDouble() <= (_received->toDouble() - _rejected->toDouble()))) && (_uninvoicedReceived->toDouble() == 0) && (_uninvoicedRejected->toDouble() == 0) )
_closePoitem->setChecked(true);
else
_closePoitem->setChecked(false);
// Save the voitem information
if (_voitemid != -1)
{
q.prepare( "UPDATE voitem "
"SET voitem_qty=:voitem_qty "
"WHERE (voitem_id=:voitem_id);" );
q.bindValue(":voitem_id", _voitemid);
}
else
{
// Get next voitem id
q.prepare("SELECT NEXTVAL('voitem_voitem_id_seq') AS voitemid");
q.exec();
if (q.first())
_voitemid = (q.value("voitemid").toInt());
else if (q.lastError().type() != QSqlError::NoError)
{
systemError(this, _rejectedMsg.arg(q.lastError().databaseText()),
__FILE__, __LINE__);
reject();
return;
}
q.prepare( "INSERT INTO voitem "
"(voitem_id, voitem_vohead_id, voitem_poitem_id, voitem_close, voitem_qty, voitem_freight) "
"VALUES "
"(:voitem_id, :vohead_id, :poitem_id, :voitem_close, :voitem_qty, :voitem_freight);" );
}
//.........这里部分代码省略.........
开发者ID:,项目名称:,代码行数:101,代码来源:
注:本文中的XTreeWidgetItem::text方法示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论