本文整理汇总了C++中XTreeWidgetItem::rawValue方法的典型用法代码示例。如果您正苦于以下问题:C++ XTreeWidgetItem::rawValue方法的具体用法?C++ XTreeWidgetItem::rawValue怎么用?C++ XTreeWidgetItem::rawValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XTreeWidgetItem 的用法示例。
在下文中一共展示了XTreeWidgetItem::rawValue方法的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: sPopulateMenu
void dspInventoryAvailabilityByParameterList::sPopulateMenu(QMenu *menu, QTreeWidgetItem *selected)
{
XTreeWidgetItem * item = (XTreeWidgetItem*)selected;
int menuItem;
menuItem = menu->insertItem(tr("View Inventory History..."), this, SLOT(sViewHistory()), 0);
if (!_privileges->check("ViewInventoryHistory"))
menu->setItemEnabled(menuItem, FALSE);
menu->insertSeparator();
menuItem = menu->insertItem(tr("View Allocations..."), this, SLOT(sViewAllocations()), 0);
if (item->rawValue("allocated").toDouble() == 0.0)
menu->setItemEnabled(menuItem, FALSE);
menuItem = menu->insertItem(tr("View Orders..."), this, SLOT(sViewOrders()), 0);
if (item->rawValue("ordered").toDouble() == 0.0)
menu->setItemEnabled(menuItem, FALSE);
menuItem = menu->insertItem(tr("Running Availability..."), this, SLOT(sRunningAvailability()), 0);
menu->insertSeparator();
if (((XTreeWidgetItem *)selected)->altId() == 1)
{
menuItem = menu->insertItem(tr("Create P/R..."), this, SLOT(sCreatePR()), 0);
if (!_privileges->check("MaintainPurchaseRequests"))
menu->setItemEnabled(menuItem, FALSE);
menuItem = menu->insertItem(tr("Create P/O..."), this, SLOT(sCreatePO()), 0);
if (!_privileges->check("MaintainPurchaseOrders"))
menu->setItemEnabled(menuItem, FALSE);
menu->insertSeparator();
}
else if (((XTreeWidgetItem *)selected)->altId() == 2)
{
menuItem = menu->insertItem(tr("Create W/O..."), this, SLOT(sCreateWO()), 0);
if (!_privileges->check("MaintainWorkOrders"))
menu->setItemEnabled(menuItem, FALSE);
menuItem = menu->insertItem(tr("Post Misc. Production..."), this, SLOT(sPostMiscProduction()), 0);
if (!_privileges->check("PostMiscProduction"))
menu->setItemEnabled(menuItem, FALSE);
menu->insertSeparator();
}
menu->insertItem(tr("View Substitute Availability..."), this, SLOT(sViewSubstituteAvailability()), 0);
menu->insertSeparator();
menuItem = menu->insertItem(tr("Issue Count Tag..."), this, SLOT(sIssueCountTag()), 0);
if (!_privileges->check("IssueCountTags"))
menu->setItemEnabled(menuItem, FALSE);
menuItem = menu->insertItem(tr("Enter Misc. Inventory Count..."), this, SLOT(sEnterMiscCount()), 0);
if (!_privileges->check("EnterMiscCounts"))
menu->setItemEnabled(menuItem, FALSE);
}
开发者ID:,项目名称:,代码行数:60,代码来源:
示例2: 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
示例3: 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
示例4: sPopulateMenu
void dspPoItemsByItem::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *pSelected, int)
{
QAction *menuItem;
XTreeWidgetItem *item = dynamic_cast<XTreeWidgetItem*>(pSelected);
if (item && item->rawValue("poitem_status") == "U")
{
menuItem = pMenu->addAction(tr("Edit Order..."), this, SLOT(sEditOrder()));
menuItem->setEnabled(_privileges->check("MaintainPurchaseOrders"));
}
menuItem = pMenu->addAction(tr("View Order..."), this, SLOT(sViewOrder()));
menuItem->setEnabled(_privileges->check("MaintainPurchaseOrders") ||
_privileges->check("ViewPurchaseOrders"));
menuItem = pMenu->addAction(tr("Running Availability..."), this, SLOT(sRunningAvailability()));
menuItem->setEnabled(_privileges->check("ViewInventoryAvailability"));
pMenu->addSeparator();
if (item && item->rawValue("poitem_status") == "U")
{
menuItem = pMenu->addAction(tr("Edit Item..."), this, SLOT(sEditItem()));
menuItem->setEnabled(_privileges->check("MaintainPurchaseOrders"));
}
menuItem = pMenu->addAction(tr("View Item..."), this, SLOT(sViewItem()));
menuItem->setEnabled(_privileges->check("MaintainPurchaseOrders") ||
_privileges->check("ViewPurchaseOrders"));
if (item && item->rawValue("poitem_status") != "C")
{
menuItem = pMenu->addAction(tr("Reschedule..."), this, SLOT(sReschedule()));
menuItem->setEnabled(_privileges->check("ReschedulePurchaseOrders"));
menuItem = pMenu->addAction(tr("Change Qty..."), this, SLOT(sChangeQty()));
menuItem->setEnabled(_privileges->check("ChangePurchaseOrderQty"));
pMenu->addSeparator();
}
if (item && item->rawValue("poitem_status") == "O")
{
menuItem = pMenu->addAction(tr("Close Item..."), this, SLOT(sCloseItem()));
menuItem->setEnabled(_privileges->check("MaintainPurchaseOrders"));
}
else if (item && item->rawValue("poitem_status") == "C")
{
menuItem = pMenu->addAction(tr("Open Item..."), this, SLOT(sOpenItem()));
menuItem->setEnabled(_privileges->check("MaintainPurchaseOrders"));
}
}
开发者ID:AlFoX,项目名称:qt-client,代码行数:53,代码来源:dspPoItemsByItem.cpp
示例5: sHandleButtons
void createFiscalYear::sHandleButtons()
{
XTreeWidgetItem *lastFY = _fy->topLevelItem(0);
bool newAP = _choose->code() == "PERIOD" && _period->allValid()
&& lastFY
&& lastFY->rawValue("start").toDate() <= QDate::currentDate()
&& lastFY->rawValue("end").toDate() >= QDate::currentDate();
bool newFY = _choose->code() == "NEWFY"
&& _firstDay->isValid() && _style->isValid();
bool copyFY = _choose->code() == "COPYFY" && _fy->id() != -1;
_save->setEnabled(newAP || newFY || copyFY);
}
开发者ID:dwatson78,项目名称:qt-client,代码行数:13,代码来源:createfiscalyear.cpp
示例6: sModifyAll
void editOwners::sModifyAll()
{
if(!_newOwner->isValid())
{
QMessageBox::critical( this, tr("No New Owner"),
tr("A new owner must be selected before you can continue."));
_newOwner->setFocus();
return;
}
int ret = QMessageBox::warning(this, tr("Confirm Ownership Modification"),
tr("<p>Are you sure that you want to change the new owner "
"to '%1' for the selected records?")
.arg(_newOwner->username()),
QMessageBox::Yes | QMessageBox::No,
QMessageBox::Yes);
if(ret == QMessageBox::Yes)
{
QList<XTreeWidgetItem*> all = _list->findItems("", Qt::MatchContains);
for (int i = 0; i < all.size(); i++)
{
XTreeWidgetItem *currentItem = static_cast<XTreeWidgetItem*>(all[i]);
if (currentItem->rawValue("type_name").toString() != "")
modifyOne(currentItem);
}
sFillList();
}
}
开发者ID:ChristopherCotnoir,项目名称:qt-client,代码行数:31,代码来源:editOwners.cpp
示例7: rawValue
QVariant XTreeWidgetItemProto::rawValue(const QString pName)
{
XTreeWidgetItem *item = qscriptvalue_cast<XTreeWidgetItem*>(thisObject());
if (item)
return item->rawValue(pName);
return QVariant();
}
开发者ID:Dinesh-Ramakrishnan,项目名称:qt-client,代码行数:7,代码来源:xtreewidgetitemproto.cpp
示例8: sVoidVoucher
void selectPayments::sVoidVoucher()
{
bool update = false;
QList<XTreeWidgetItem*> list = _apopen->selectedItems();
XTreeWidgetItem * cursor = 0;
XSqlQuery dspVoidVoucher;
dspVoidVoucher.prepare("SELECT voidApopenVoucher(:apopen_id, :voidDate) AS result;");
for(int i = 0; i < list.size(); i++)
{
cursor = (XTreeWidgetItem*)list.at(i);
if ( (cursor->rawValue("doctype") == tr("Voucher")) && (cursor->rawValue("selected") == 0.0) )
{
XDateInputDialog newdlg(this, "", true);
ParameterList params;
params.append("label", tr("On what date did you void the Voucher?"));
params.append("default", cursor->rawValue("apopen_docdate"));
newdlg.set(params);
int returnVal = newdlg.exec();
if (returnVal == XDialog::Accepted)
{
QDate voidDate = newdlg.getDate();
dspVoidVoucher.bindValue(":apopen_id", cursor->id());
dspVoidVoucher.bindValue(":voidDate", voidDate);
dspVoidVoucher.exec();
if(dspVoidVoucher.first())
{
if(dspVoidVoucher.value("result").toInt() < 0)
{
ErrorReporter::error(QtCriticalMsg, this, tr("Error Voiding Voucher"),
dspVoidVoucher, __FILE__, __LINE__);
return;
}
}
else
{
ErrorReporter::error(QtCriticalMsg, this, tr("Voiding Voucher"),
dspVoidVoucher, __FILE__, __LINE__);
return;
}
update = true;
}
}
}
if(update)
sFillList();
}
开发者ID:dwatson78,项目名称:qt-client,代码行数:47,代码来源:selectPayments.cpp
示例9: sHandleChoice
void createFiscalYear::sHandleChoice(int selection)
{
QWidget *page = NULL;
XTreeWidgetItem *lastFY = _fy->topLevelItem(0);
bool fyExists = (lastFY != NULL);
bool fyIsCurrent = fyExists
&& lastFY->rawValue("start").toDate() <= QDate::currentDate()
&& lastFY->rawValue("end").toDate() >= QDate::currentDate();
_fy->setEnabled(hasPriv(cEdit));
_period->setEnabled(hasPriv(cEdit));
_period->setVisible(fyIsCurrent);
_noFYLit->setVisible(! fyIsCurrent);
_fy->setVisible(fyExists);
_noFYToCopyLit->setVisible(! fyExists);
_save->setText(saveButtonText);
if (! hasPriv())
page = _noPrivPage;
else
switch (selection) {
case 1:
page = _newPeriodPage;
break;
case 2:
page = _newFYPage;
break;
case 3:
page = _copyFYPage;
_save->setText(tr("Copy Fiscal Year"));
break;
default:
qWarning() << "Probable bug at" << __FILE__ << __LINE__ << ":" << selection;
}
if (page)
{
_stack->setCurrentWidget(page);
}
sHandleButtons();
}
开发者ID:dwatson78,项目名称:qt-client,代码行数:43,代码来源:createfiscalyear.cpp
示例10: sFillList
void dspCountSlipsByWarehouse::sFillList()
{
if (DEBUG)
qDebug("dspCountSlipsByWarehouse::sFillList() about to populate _cntslip");
display::sFillList();
if (_numericSlips->isChecked() && list()->topLevelItemCount() > 1)
{
if (DEBUG)
qDebug("dspCountSlipsByWarehouse::sFillList() looking for slip # gaps "
"in %d items", list()->topLevelItemCount());
XTreeWidgetItem *last =list()->topLevelItem(0);
int slipNumber = last->rawValue("slipnumber").toInt();
for (int i = 1; i < list()->topLevelItemCount(); i++)
{
XTreeWidgetItem *curr = list()->topLevelItem(i);
if (DEBUG)
qDebug("row %d has slipNumber %d and current %d",
i, slipNumber, curr->rawValue("slipnumber").toInt());
if (slipNumber == (curr->rawValue("slipnumber").toInt() - 1) || slipNumber == -1)
slipNumber = curr->rawValue("slipnumber").toInt();
else if (slipNumber >= 0)
{
if (slipNumber == curr->rawValue("slipnumber").toInt() - 2)
curr = new XTreeWidgetItem( list(), last, -1,
QVariant("----"), "----", "----", "----",
tr("Missing Slip #%1").arg(slipNumber + 1),
"----", "----", "----" );
else
curr = new XTreeWidgetItem( list(), last, -1,
QVariant("----"), "----", "----", "----",
tr("Missing Slips #%1 to #%2").arg(slipNumber + 1).arg(curr->rawValue("slipnumber").toInt() - 1),
"----", "----", "----" );
curr->setTextColor(namedColor("error"));
slipNumber = -1;
//i++; // 'cause we just added an item!
}
last = curr;
}
}
}
开发者ID:ChristopherCotnoir,项目名称:qt-client,代码行数:43,代码来源:dspCountSlipsByWarehouse.cpp
示例11: sHandleSelection
void listRecurringInvoices::sHandleSelection()
{
XTreeWidgetItem *selected = 0;
QList<XTreeWidgetItem *> selectedlist = _invchead->selectedItems();
if (selectedlist.size() > 0)
selected = (XTreeWidgetItem *)(selectedlist[0]);
if (selected)
_edit->setEnabled(_privileges->check("MaintainMiscInvoices")
&& !selected->rawValue("invchead_posted").toBool());
}
开发者ID:szuke,项目名称:qt-client,代码行数:12,代码来源:listRecurringInvoices.cpp
示例12: sHandleButtons
void commentTypes::sHandleButtons()
{
bool enableButtons;
XTreeWidgetItem *selected = (XTreeWidgetItem*)_cmnttype->currentItem();
if (selected)
enableButtons = ! selected->rawValue("cmnttype_sys").toBool();
else
enableButtons = FALSE;
_edit->setEnabled(enableButtons);
_delete->setEnabled(enableButtons);
}
开发者ID:,项目名称:,代码行数:13,代码来源:
示例13: sInvoiceInformation
void dspSalesHistoryByCustomer::sInvoiceInformation()
{
XTreeWidgetItem * item = (XTreeWidgetItem*)_sohist->currentItem();
if(0 == item)
return;
ParameterList params;
params.append("invoiceNumber", item->rawValue("invoicenumber").toString());
dspInvoiceInformation *newdlg = new dspInvoiceInformation();
newdlg->set(params);
omfgThis->handleNewWindow(newdlg);
}
开发者ID:,项目名称:,代码行数:13,代码来源:
示例14: sVoidInvoiceDetails
void dspAROpenItems::sVoidInvoiceDetails()
{
XSqlQuery dspVoidInvoiceDetails;
XTreeWidgetItem *pItem = list()->currentItem();
if(pItem->rawValue("posted") != 0 &&
QMessageBox::question(this, tr("Void Posted Invoice?"),
tr("<p>This Invoice has already been posted. "
"Are you sure you want to void it?"),
QMessageBox::Yes,
QMessageBox::No | QMessageBox::Default) == QMessageBox::No)
{
return;
}
XSqlQuery rollback;
rollback.prepare("ROLLBACK;");
XSqlQuery post;
post.prepare("SELECT voidInvoice(:invchead_id) AS result;");
dspVoidInvoiceDetails.exec("BEGIN;"); // because of possible lot, serial, or location distribution cancelations
post.bindValue(":invchead_id", list()->currentItem()->id("docnumber"));
post.exec();
if (post.first())
{
int result = post.value("result").toInt();
if (result < 0)
{
rollback.exec();
systemError(this, storedProcErrorLookup("voidInvoice", result),
__FILE__, __LINE__);
return;
}
else if (distributeInventory::SeriesAdjust(result, this) == XDialog::Rejected)
{
rollback.exec();
QMessageBox::information( this, tr("Void Invoice"), tr("Transaction Canceled") );
return;
}
dspVoidInvoiceDetails.exec("COMMIT;");
sFillList();
}
else if (post.lastError().type() != QSqlError::NoError)
{
rollback.exec();
systemError(this, tr("A System Error occurred voiding Invoice.\n%1")
.arg(post.lastError().databaseText()),
__FILE__, __LINE__);
}
}
开发者ID:,项目名称:,代码行数:51,代码来源:
示例15: sVoidVoucher
void selectPayments::sVoidVoucher()
{
bool update = false;
QList<XTreeWidgetItem*> list = _apopen->selectedItems();
XTreeWidgetItem * cursor = 0;
XSqlQuery dspVoidVoucher;
dspVoidVoucher.prepare("SELECT voidApopenVoucher(:apopen_id) AS result;");
for(int i = 0; i < list.size(); i++)
{
cursor = (XTreeWidgetItem*)list.at(i);
if ( (cursor->rawValue("doctype") == tr("Voucher")) && (cursor->rawValue("selected") == 0.0) )
{
dspVoidVoucher.bindValue(":apopen_id", cursor->id());
dspVoidVoucher.exec();
if(dspVoidVoucher.first())
{
if(dspVoidVoucher.value("result").toInt() < 0)
{
systemError( this, tr("A System Error occurred at %1::%2, Error #%3.")
.arg(__FILE__)
.arg(__LINE__)
.arg(dspVoidVoucher.value("result").toInt()) );
return;
}
}
else
{
ErrorReporter::error(QtCriticalMsg, this, tr("Voiding Voucher"),
dspVoidVoucher, __FILE__, __LINE__);
return;
}
update = true;
}
}
if(update)
sFillList();
}
开发者ID:ChristopherCotnoir,项目名称:qt-client,代码行数:38,代码来源:selectPayments.cpp
示例16: sHandleButtons
void commentTypes::sHandleButtons()
{
XTreeWidgetItem *selected = (XTreeWidgetItem*)_cmnttype->currentItem();
if (selected && _privileges->check("MaintainCommentTypes"))
{
_edit->setEnabled(true);
_delete->setEnabled(!selected->rawValue("cmnttype_sys").toBool());
}
else
{
_edit->setEnabled(false);
_delete->setEnabled(false);
}
}
开发者ID:AlFoX,项目名称:qt-client,代码行数:14,代码来源:commentTypes.cpp
示例17: sPopulateMenu
void dspSummarizedBankrecHistory::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *selected, int)
{
QAction *menuItem;
XTreeWidgetItem * item = (XTreeWidgetItem*)selected;
if (item->rawValue("bankrec_posted").toBool())
{
XSqlQuery menu;
menu.prepare("SELECT bankrec_id "
"FROM bankrec "
"WHERE (bankrec_bankaccnt_id=:bankrec_bankaccnt_id) "
" AND (bankrec_opendate > :bankrec_enddate) "
" AND (bankrec_posted);");
menu.bindValue(":bankrec_bankaccnt_id", _bankaccnt->id());
menu.bindValue(":bankrec_enddate", item->rawValue("bankrec_enddate").toDate());
menu.exec();
if (!menu.first())
{
menuItem = pMenu->addAction(tr("Reopen..."), this, SLOT(sReopen()));
menuItem->setEnabled(_privileges->check("MaintainBankRec"));
}
}
}
开发者ID:ChristopherCotnoir,项目名称:qt-client,代码行数:23,代码来源:dspSummarizedBankrecHistory.cpp
示例18: sHandleItemSelection
void viewCheckRun::sHandleItemSelection()
{
XTreeWidgetItem *selected = _check->currentItem();
bool select = false;
if (! selected)
{
_void->setEnabled(FALSE);
_delete->setEnabled(FALSE);
_replace->setEnabled(FALSE);
select = true;
_edit->setEnabled(FALSE);
return;
}
if (selected->rawValue("checkhead_void").toBool())
{
_void->setEnabled(FALSE);
_delete->setEnabled(TRUE);
_replace->setEnabled(TRUE);
_edit->setEnabled(FALSE);
}
else if (! selected->rawValue("checkhead_void").isNull() &&
! selected->rawValue("checkhead_void").toBool())
{
// This was not allowing voiding of ACH checks. No strong case could be
// made to disallow this since ACH is manuall at this time. Should that
// requirement change this is the original line
//_void->setEnabled(selected->rawValue("checkhead_ach_batch").isNull());
_void->setEnabled(true);
_delete->setEnabled(FALSE);
_replace->setEnabled(FALSE);
select = selected->rawValue("checkhead_ach_batch").isNull();
_edit->setEnabled(selected->rawValue("checkhead_misc").toBool() &&
! selected->rawValue("checkhead_printed").toBool());
}
QMenu * printMenu = new QMenu;
if (select)
printMenu->addAction(tr("Selected Check..."), this, SLOT(sPrint()));
if (_vendorgroup->isAll())
printMenu->addAction(tr("Check Run..."), this, SLOT(sPrintCheckRun()));
printMenu->addAction(tr("Edit List"), this, SLOT(sPrintEditList()));
_print->setMenu(printMenu);
QMenu * postMenu = new QMenu;
if (selected->rawValue("checkhead_printed").toBool() &&
_privileges->check("PostPayments"))
postMenu->addAction(tr("Selected Check..."), this, SLOT(sPost()));
if (_vendorgroup->isAll())
postMenu->addAction(tr("All Checks..."), this, SLOT(sPostChecks()));
_postCheck->setMenu(postMenu);
}
开发者ID:,项目名称:,代码行数:57,代码来源:
示例19: sFillList
void dspInvoiceRegister::sFillList()
{
display::sFillList();
list()->expandAll();
// calculate subtotals and grand total for debit and credit columns and add rows for them
double debittotal = 0.0;
double credittotal = 0.0;
for (int i = 0; i < list()->topLevelItemCount(); i++)
{
double debitsum = 0.0;
double creditsum = 0.0;
XTreeWidgetItem *item = 0;
for (int j = 0; j < list()->topLevelItem(i)->childCount(); j++)
{
item = list()->topLevelItem(i)->child(j);
// qDebug("in loop @ %d %p", j, item);
if (item)
{
debitsum += item->rawValue("debit").toDouble();
creditsum += item->rawValue("credit").toDouble();
debittotal += item->rawValue("debit").toDouble();
credittotal += item->rawValue("credit").toDouble();
}
}
if (item)
{
// qDebug("adding subtotal %p", item);
item = new XTreeWidgetItem(list()->topLevelItem(i), -1, -1, tr("Subtotal"));
item->setData(list()->column("debit"), Qt::EditRole, formatMoney(debitsum));
item->setData(list()->column("credit"), Qt::EditRole, formatMoney(creditsum));
}
}
XTreeWidgetItem *item = new XTreeWidgetItem(list(), -1, -1, tr("Total"));
item->setData(list()->column("debit"), Qt::EditRole, formatMoney(debittotal));
item->setData(list()->column("credit"), Qt::EditRole, formatMoney(credittotal));
}
开发者ID:,项目名称:,代码行数:37,代码来源:
示例20: sPopulateMenu
void dspVoucherRegister::sPopulateMenu(QMenu * menuThis, QTreeWidgetItem*, int)
{
menuThis->addAction(tr("View..."), this, SLOT(sViewTrans()));
XTreeWidgetItem *item = dynamic_cast<XTreeWidgetItem*>(list()->currentItem());
if(0 == item)
return;
QString doctype = item->rawValue("gltrans_doctype").toString();
if (doctype == "VO")
menuThis->addAction(tr("View Voucher..."), this, SLOT(sViewDocument()));
else if (doctype == "IN")
menuThis->addAction(tr("View Invoice..."), this, SLOT(sViewDocument()));
else if (doctype == "PO")
menuThis->addAction(tr("View Purchase Order..."), this, SLOT(sViewDocument()));
}
开发者ID:Dinesh-Ramakrishnan,项目名称:qt-client,代码行数:16,代码来源:dspVoucherRegister.cpp
注:本文中的XTreeWidgetItem::rawValue方法示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论