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


C++ Station::name方法代码示例

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


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

示例1: main

int main() {

    Station test;

    cout << "Station name:" << test.name() << endl;
    return 0;
}
开发者ID:nettube,项目名称:librail,代码行数:7,代码来源:main.cpp

示例2: s

void
LastFmUserSettings::addRecentStation( const Station& station )
{
    MyQSettings s( this );

    QList<Station> stations = recentStations();

    // remove duplicates
    for ( int i = 0; i < stations.count(); ++i )
        if ( stations[i].url() == station.url() )
            stations.removeAt( i-- );

    stations.prepend( station );

    s.remove( "RecentStations" );

    s.beginGroup( "RecentStations" );
    int j = stations.count();
    while (j--)
        s.setValue( QString::number( j ), stations[j].url() );
    s.endGroup();

    s.setValue( "StationNames/" + station.url(), station.name() );
    s.sync();

    emit userChanged( username() );
    emit historyChanged();
}
开发者ID:exic,项目名称:last.fm-dbus,代码行数:28,代码来源:LastFmSettings.cpp

示例3: retrieveJourneysFromStation

void Ratp::retrieveJourneysFromStation(const QString &request, const Station &station, int limit)
{
    Q_UNUSED(limit)
    QString fileName = QString(":/data/backward/%1.xml").arg(station.name().at(0).toLower());

    QVariantMap disambiguation;
    disambiguation.insert("id", "org.SfietKonstantin.publictransportation.ratp");

    Company company (disambiguation, "RATP", QVariantMap());

    bool ok;
    QString error;

    QList<InfoJourneys> infoJourneysList =
            OfflineXmlJourneysFromStationHelper::journeysFromStation(fileName, station,
                                                                     disambiguation, company,
                                                                     &ok, &error);

    if (!ok) {
        emit errorRetrieved(request, BACKEND_WARNING, error);
        return;
    }

    debug("ratp-plugin") << infoJourneysList.count();
    emit journeysFromStationRetrieved(request, infoJourneysList);
}
开发者ID:SfietKonstantin,项目名称:publictransportation-old,代码行数:26,代码来源:ratp.cpp

示例4: stationId

void
CashReconcile::slotShiftClose()
{
    QDate date = _date->getDate();
    Id station_id = stationId();
    Id employee_id = employeeId();

    // Posting time is current time if closing for today or 11:59:59 PM
    QTime time = QTime::currentTime();
    if (date != QDate::currentDate())
	time = QTime(23, 59, 59);

    QString name;
    if (station_id != INVALID_ID) {
	Station station;
	_quasar->db()->lookup(station_id, station);
	name = station.name();
    } else if (employee_id != INVALID_ID) {
	Employee employee;
	_quasar->db()->lookup(employee_id, employee);
	name = employee.nameFL();
    } else {
	name = "<None>";
    }
    if (name.isEmpty()) name = tr("<blank>");

    QString message = "Are you sure you want to ringoff \n\"" + name + "\"";
    int choice = QMessageBox::warning(this, tr("Ringoff?"), message,
				      tr("Yes"), tr("No"));
    if (choice != 0) return;

    // Create the shift
    Shift shift;
    shift.setStoreId(_store->getId());
    shift.setStationId(station_id);
    shift.setEmployeeId(employee_id);
    shift.setPostDate(date);
    shift.setPostTime(time);
    if (!_quasar->db()->create(shift)) {
	message = tr("Failed creating shift close transaction");
	QMessageBox::critical(this, tr("Error"), message);
	return;
    }

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

    bool result = _quasar->db()->shiftClose(shift);
    QApplication::restoreOverrideCursor();

    if (!result) {
	message = tr("Failed setting shift in transactions");
	QMessageBox::critical(this, tr("Error"), message);
    } else {
	message = "The shift for \"" + name + "\"\nhas been closed";
	QMessageBox::information(this, tr("Information"), message);
	slotRefresh();
    }
}
开发者ID:cwarden,项目名称:quasar,代码行数:59,代码来源:cash_reconcile.cpp

示例5: re_stations

void
StationsPluginLondon::handleInfos(const QByteArray & data)
{
  QRegExp re_stations("station\\=\\{(.*)\\}\\;");
  QRegExp re_items("\\s*(\\w+)\\s*:(.*),");
  int ofs = 0;

  re_stations.setMinimal(true);
  re_items.setMinimal(true);

  while ((ofs = re_stations.indexIn(data, ofs)) >= 0) {
    bool ok;
    int id;
    QPointF pos;
    Station *station;
    QMap<QString, QString> values;

    ofs += re_stations.matchedLength();

    int station_ofs = 0;
    QString station_data = re_stations.capturedTexts().at(1);

    while ((station_ofs = re_items.indexIn(station_data, station_ofs)) >= 0) {
      QStringList capt = re_items.capturedTexts();

      if (capt.size() < 3)
	continue ;

      station_ofs += re_items.matchedLength();
      values[capt.at(1)] = capt.at(2);
      values[capt.at(1)].replace("\"", "");
    }

    id = values["id"].toInt(&ok);
    pos = QPointF(values["lat"].toDouble(),
		  values["long"].toDouble());

    if (!ok)
      continue ;

    station = getOrCreateStation(id);

    if (station->name().isEmpty())
      station->setName(values["name"]);
    if (station->pos().isNull())
      station->setPos(pos);
    station->setBikes(values["nbBikes"].toInt());
    station->setFreeSlots(values["nbEmptyDocks"].toInt());
    station->setTotalSlots(station->bikes() + station->freeSlots());

    storeOrDropStation(station);
  }

  emit stationsCreated(stations.values());
  emit stationsUpdated(stations.values());
}
开发者ID:iksaif,项目名称:lugdulov,代码行数:56,代码来源:london.cpp

示例6: stationsCreated

void
StationsPluginWien::handleInfos(const QByteArray & data)
{
  QDomDocument doc;
  QDomNode node;

  doc.setContent(data);
  node = doc.firstChildElement("stations").firstChildElement("station");

  while (!node.isNull()) {
    Station *station;
    QDomNamedNodeMap attrs = node.attributes();
    int id;
    bool ok;
    qreal lat, lng;

    id = node.firstChildElement("id").text().toInt(&ok);

    if (!ok)
      continue ;

    station = getOrCreateStation(id);

    station->setData(node.firstChildElement("internal_id").text().toInt());

    if (station->name().isEmpty())
      station->setName(node.firstChildElement("name").text());
    if (station->description().isEmpty())
      station->setDescription(node.firstChildElement("description").text());

    lng = node.firstChildElement("longitude").text().toDouble();
    lat = node.firstChildElement("latitude").text().toDouble();

    if (station->pos().isNull())
      station->setPos(QPointF(lat, lng));

    station->setBikes(node.firstChildElement("free_bikes").text().toInt());
    station->setFreeSlots(node.firstChildElement("free_boxes").text().toInt());
    station->setTotalSlots(node.firstChildElement("boxes").text().toInt());

    storeOrDropStation(station);

    node = node.nextSiblingElement("station");
  }

  emit stationsCreated(stations.values());
  emit stationsUpdated(stations.values());
}
开发者ID:iksaif,项目名称:lugdulov,代码行数:48,代码来源:wien.cpp

示例7: tr


//.........这里部分代码省略.........
	}
    }

    // Sort tenders by menu number
    std::sort(_summary.begin(), _summary.end());

    // Prepare over/short transaction
    TenderAdjust adjustment;
    adjustment.setPostDate(date);
    adjustment.setPostTime(time);
    adjustment.setMemo(tr("Over/Short"));
    adjustment.setStoreId(store_id);
    adjustment.setStationId(station_id);
    adjustment.setEmployeeId(employee_id);
    adjustment.setShiftId(shift_id);
    adjustment.setAccountId(adjust_id);

    // Prepare transfer out transaction
    TenderAdjust transOut;
    transOut.setPostDate(date);
    transOut.setPostTime(time);
    transOut.setMemo(tr("Deposit to safe"));
    transOut.setStoreId(store_id);
    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);
开发者ID:cwarden,项目名称:quasar,代码行数:67,代码来源:cash_reconcile.cpp


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