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


C++ ListView::setAllColumnsShowFocus方法代码示例

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


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

示例1: ListViewItem

ListView*
ReportList::findModule(const QString& name)
{
    // Check if already exists
    for (unsigned int i = 0; i < _views.size(); ++i) {
	if (_views[i]->name() == name)
	    return _views[i];
    }

    // Add to modules list
    if (_module->lastItem() == NULL) {
	ListViewItem* item = new ListViewItem(_module);
	item->setText(0, name);
    } else {
	ListViewItem* last = (ListViewItem*)_module->lastItem();
	ListViewItem* item = new ListViewItem(_module, last);
	item->setText(0, name);
    }

    // Create new ListView
    ListView* list = new ListView(_stack, name);
    list->setAllColumnsShowFocus(true);
    list->setShowSortIndicator(true);
    connect(list, SIGNAL(doubleClicked(QListViewItem*)), SLOT(slotView()));

    // Set columns depending on whether its the all tab or not
    if (name == tr("All")) {
	list->addTextColumn(tr("Name"), 60);
	list->addTextColumn(tr("Module"), 17);
    } else {
	list->addTextColumn(tr("Name"), 80);
    }
    list->setSorting(0);

    _views.push_back(list);
    _stack->addWidget(list);

    return list;
}
开发者ID:cwarden,项目名称:quasar,代码行数:39,代码来源:report_list.cpp

示例2: tr


//.........这里部分代码省略.........
    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;
    fixed transferAmt = 0.0;
    ListViewItem* last = NULL;
    for (i = 0; i < _summary.size(); ++i) {
开发者ID:cwarden,项目名称:quasar,代码行数:67,代码来源:cash_reconcile.cpp

示例3: 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);
}
开发者ID:cwarden,项目名称:quasar,代码行数:79,代码来源:tx_summary.cpp


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