本文整理汇总了C++中ListView::addMoneyColumn方法的典型用法代码示例。如果您正苦于以下问题:C++ ListView::addMoneyColumn方法的具体用法?C++ ListView::addMoneyColumn怎么用?C++ ListView::addMoneyColumn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ListView
的用法示例。
在下文中一共展示了ListView::addMoneyColumn方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: tr
//.........这里部分代码省略.........
transOut.setStationId(station_id);
transOut.setEmployeeId(employee_id);
transOut.setShiftId(shift_id);
transOut.setAccountId(transfer_id);
// Memo for transfer in depends on method
QString memo;
if (station_id != INVALID_ID) {
Station station;
_quasar->db()->lookup(station_id, station);
memo = tr("Deposit from: %1").arg(station.name());
} else {
Employee employee;
_quasar->db()->lookup(employee_id, employee);
memo = tr("Deposit from: %1").arg(employee.nameFL());
}
// Prepare transfer in transaction
TenderAdjust transIn;
transIn.setPostDate(date);
transIn.setPostTime(time);
transIn.setMemo(memo);
transIn.setStoreId(safe_store_id);
transIn.setStationId(safe_station_id);
transIn.setEmployeeId(safe_employee_id);
transIn.setAccountId(transfer_id);
// Setup screen
QDialog* dialog = new QDialog(this, "Summary", true);
dialog->setCaption(tr("Reconcile Summary"));
ListView* tenderList = new ListView(dialog);
tenderList->addTextColumn(tr("Tender"), 20);
tenderList->addMoneyColumn(tr("Shifts"));
tenderList->addMoneyColumn(tr("Counts"));
tenderList->addMoneyColumn(tr("Over/Short"));
tenderList->setAllColumnsShowFocus(true);
tenderList->setSorting(-1);
QFrame* buttons = new QFrame(dialog);
QPushButton* post = new QPushButton(tr("Reconcile"), buttons);
QPushButton* cancel = new QPushButton(tr("Cancel"), buttons);
cancel->setDefault(true);
connect(post, SIGNAL(clicked()), dialog, SLOT(accept()));
connect(cancel, SIGNAL(clicked()), dialog, SLOT(reject()));
QGridLayout* buttonGrid = new QGridLayout(buttons);
buttonGrid->setSpacing(3);
buttonGrid->setMargin(3);
buttonGrid->setColStretch(0, 1);
buttonGrid->addWidget(post, 0, 1);
buttonGrid->addWidget(cancel, 0, 2);
QGridLayout* grid = new QGridLayout(dialog);
grid->setSpacing(3);
grid->setMargin(3);
grid->setRowStretch(0, 1);
grid->setColStretch(0, 1);
grid->addWidget(tenderList, 0, 0);
grid->addWidget(buttons, 1, 0);
// Process summary info
fixed shiftsTotal = 0.0;
fixed countsTotal = 0.0;
fixed overShort = 0.0;
示例2: QFrame
void
TxSummary::addFrame(EmployeeInfo& info)
{
QString name = info.employee.name();
if (name.isEmpty()) name = "<Blank>";
QFrame* frame = new QFrame(_tabs);
_tabs->addTab(frame, name);
_frames.push_back(frame);
ListView* list = new ListView(frame);
list->setAllColumnsShowFocus(true);
list->setSorting(-1);
list->addTextColumn(tr(""), 12);
for (unsigned int i = 0; i < _tenders.size(); ++i) {
if (_tenderCnts[i] == 0)
continue;
list->addMoneyColumn(_tenders[i].name());
}
list->addMoneyColumn(tr("Total"));
QLabel* voidTxLabel = new QLabel(tr("Trans. Voids:"), frame);
IntegerEdit* voidTxCnt = new IntegerEdit(frame);
voidTxCnt->setLength(6, '9');
voidTxCnt->setFocusPolicy(NoFocus);
voidTxCnt->setInt(info.voidTxCnt);
QLabel* voidItemLabel = new QLabel(tr("Item Voids:"), frame);
IntegerEdit* voidItemCnt = new IntegerEdit(frame);
voidItemCnt->setLength(6, '9');
voidItemCnt->setFocusPolicy(NoFocus);
voidItemCnt->setInt(info.voidItemCnt);
QLabel* discountLabel = new QLabel(tr("Discounts:"), frame);
MoneyEdit* discountTotal = new MoneyEdit(frame);
discountTotal->setLength(8, '9');
discountTotal->setFocusPolicy(NoFocus);
discountTotal->setFixed(info.discountTotal);
QGridLayout* grid = new QGridLayout(frame);
grid->setSpacing(3);
grid->setMargin(3);
grid->setRowStretch(0, 1);
grid->setColStretch(2, 1);
grid->addMultiCellWidget(list, 0, 0, 0, 4);
grid->addWidget(voidTxLabel, 1, 0);
grid->addWidget(voidTxCnt, 1, 1);
grid->addWidget(discountLabel, 1, 3);
grid->addWidget(discountTotal, 1, 4);
grid->addWidget(voidItemLabel, 2, 0);
grid->addWidget(voidItemCnt, 2, 1);
EmployeeLine total;
total.addLine(info.sales);
total.addLine(info.returns);
total.addLine(info.payouts);
total.addLine(info.payments);
total.addLine(info.withdraws);
total.addLine(info.nosales);
total.addLine(info.others);
EmployeeLine remain;
remain.addLine(total);
remain.addLine(info.deposits);
remain.addLine(info.overShorts);
_last = NULL;
listItem(list, tr("Sales"), info.sales);
listItem(list, tr("Returns"), info.returns);
listItem(list, tr("Payouts"), info.payouts);
listItem(list, tr("Payments"), info.payments);
listItem(list, tr("Withdraws"), info.withdraws);
listItem(list, tr("Nosales"), info.nosales);
listItem(list, tr("Other"), info.others);
listItem(list, tr("Total"), total);
listItem(list, tr("Deposited"), info.deposits);
listItem(list, tr("Over/Short"), info.overShorts);
listItem(list, tr("Remain"), remain);
}