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


C++ Store::number方法代码示例

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


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

示例1: ListViewItem

void
Journal::addToList(JournalWindow* window, const Gltx& gltx)
{
    if (window == NULL) return;
    ListViewItem* item = new ListViewItem(window->list, window->last,
					  gltx.id());
    window->last = item;

    Store store;
    findStore(gltx.storeId(), store);

    item->setValue(0, gltx.dataTypeName());
    item->setValue(1, gltx.number());
    item->setValue(2, store.number());
    item->setValue(3, gltx.postDate());
    item->setValue(4, gltx.memo());
    item->setValue(7, !gltx.isActive());

    for (unsigned int i = 0; i < gltx.accounts().size(); ++i) {
	const AccountLine& line = gltx.accounts()[i];

	Account account;
	for (unsigned int a = 0; a < _accounts.size(); ++a) {
	    if (_accounts[a].id() == line.account_id) {
		account = _accounts[a];
		break;
	    }
	}

	ListViewItem* item = new ListViewItem(window->list, window->last,
					      gltx.id());
	window->last = item;

	item->setValue(4, account.name());
	if (line.amount >= 0.0)
	    item->setValue(5, line.amount);
	else
	    item->setValue(6, -line.amount);
    }
}
开发者ID:cwarden,项目名称:quasar,代码行数:40,代码来源:journal.cpp

示例2: setEnabled

void
ItemInquiry::slotRefresh(QDate from, QDate to, Id store_id)
{
    if (loading) return;
    loading = true;
    needsRefresh = false;
    delete _grid;
    _grid = NULL;

    // Clear data
    list->clear();
    for (int label = 0; label < 10; ++label)
        labels[label]->setText(" ");

    // Get item to show and return if none
    Id item_id = search->getId();
    if (item_id == INVALID_ID) {
        loading = false;
        return;
    }

    setEnabled(false);
    QApplication::setOverrideCursor(waitCursor);
    qApp->processEvents();

    // Get item information
    Item item;
    quasar->db()->lookup(item_id, item);

    fixed beginOnHand = 0.0;
    fixed beginCost = 0.0;
    fixed beginOnOrder = 0.0;
    fixed totalDebits = 0.0;
    fixed totalCredits = 0.0;

    labels[0]->setText(tr("Beginning Balance"));
    labels[1]->setText(tr("Total Increase"));
    labels[2]->setText(tr("Total Decrease"));
    labels[3]->setText(tr("Net Change"));
    labels[4]->setText(tr("Ending Balance"));

    // Get beginning balance
    if (!from.isNull())
        quasar->db()->itemGeneral(item.id(), "", store_id, from - 1,
                                  beginOnHand, beginCost, beginOnOrder);

    // Select transactions
    vector<Gltx> gltxs;
    vector<fixed> quantities;
    vector<fixed> ext_costs;
    vector<fixed> ext_prices;
    vector<bool> void_flags;
    quasar->db()->selectItem(item.id(), store_id, from, to, gltxs,
                             quantities, ext_costs, ext_prices, void_flags);

    // Setup grid
    _grid = new Grid(8);
    Grid* header = new Grid(1, _grid);
    TextFrame* text;
    text = new TextFrame(tr("Item Inquiry"), header);
    text->setFont(Font("Times", 24));
    header->set(USE_NEXT, 0, text);
    text = new TextFrame(item.number() + " " + item.description(), header);
    text->setFont(Font("Times", 18));
    header->set(USE_NEXT, 0, text);
    text = new TextFrame(DateValcon().format(from) + tr(" to ") +
                         DateValcon().format(to), header);
    text->setFont(Font("Times", 18));
    header->set(USE_NEXT, 0, text);
    header->setColumnWeight(0, 1);

    _grid->set(0, 0, 1, _grid->columns(), header, Grid::AllSides);
    _grid->set(USE_NEXT, 0, "");
    for (int column = 0; column < 8; ++column) {
        _grid->setColumnSticky(column, column < 4 ? Grid::Left : Grid::Right);
        _grid->setColumnPad(column, 5);
    }
    _grid->set(2, 0, tr("Type"));
    _grid->set(3, 0, new LineFrame(_grid), Grid::LeftRight);
    _grid->set(2, 1, tr("Id #"));
    _grid->set(3, 1, new LineFrame(_grid), Grid::LeftRight);
    _grid->set(2, 2, tr("Store"));
    _grid->set(3, 2, new LineFrame(_grid), Grid::LeftRight);
    _grid->set(2, 3, tr("Date"));
    _grid->set(3, 3, new LineFrame(_grid), Grid::LeftRight);
    _grid->set(2, 4, tr("Memo"));
    _grid->set(3, 4, new LineFrame(_grid), Grid::LeftRight);
    _grid->set(2, 5, tr("Debit"));
    _grid->set(3, 5, new LineFrame(_grid), Grid::LeftRight);
    _grid->set(2, 6, tr("Credit"));
    _grid->set(3, 6, new LineFrame(_grid), Grid::LeftRight);
    _grid->set(2, 7, tr("Voided?"));
    _grid->set(3, 7, new LineFrame(_grid), Grid::LeftRight);
    _grid->setHeaderRows(_grid->rows());

    // Setup progress dialog
    QProgressDialog* progress = new QProgressDialog(tr("Loading data..."),
            tr("Cancel"), gltxs.size(),
            this, "Progress", true);
    progress->setMinimumDuration(1000);
//.........这里部分代码省略.........
开发者ID:cwarden,项目名称:quasar,代码行数:101,代码来源:item_inquiry.cpp


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