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


C++ BedItem::getBed方法代码示例

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


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

示例1: slotSplitProfileAt

void BedItemModel::slotSplitProfileAt(const QModelIndex& idx) {
    if (!idx.isValid()) {
        return;
    }

    BedItem* itm = (BedItem*) itemFromIndex(idx);

    if (!itm) {
        return;
    }

    Bed* bed = itm->getBed();

    if (QMessageBox::Yes != QMessageBox::question((static_cast<ProfileLogger*>(QApplication::instance()))->getMainWindow(),
            tr("Split Profile?"),
            tr("Split Profile at bed %1?").arg(bed->getPosition()),
            QMessageBox::Yes | QMessageBox::No)) {
        return;
    }

    _profile->deleteBedsAbove(bed);
    itm->getBed()->getProfile()->splitAtBed(itm->getBed());

    reload();
}
开发者ID:BackupTheBerlios,项目名称:profilelogger-svn,代码行数:25,代码来源:BedItemModel.cpp

示例2: slotDelete

void BedItemModel::slotDelete(QModelIndexList lst) {
    if (lst.size() < 1) {
        return;
    }

    QStringList names;
    QList<Bed*> beds;

    for (QModelIndexList::iterator it = lst.begin(); it != lst.end(); it++) {
        BedItem* itm = (BedItem*) itemFromIndex(*it);
        names << QString::number(itm->getBed()->getPosition());

        beds << itm->getBed();
    }

    if (QMessageBox::Yes != QMessageBox::question((static_cast<ProfileLogger*>(QApplication::instance()))->getMainWindow(),
            tr("Delete beds?"),
            tr("Delete beds %1?").arg(names.join(", ")),
            QMessageBox::Yes | QMessageBox::No)) {
        return;
    }

    for (QList<Bed*>::iterator it = beds.begin(); it != beds.end(); it++) {
        _profile->deleteBed(*it);
    }

    reload();
}
开发者ID:BackupTheBerlios,项目名称:profilelogger-svn,代码行数:28,代码来源:BedItemModel.cpp

示例3: slotInsertProfileBelow

void BedItemModel::slotInsertProfileBelow(Profile* p, const QModelIndex& idx) {
    //FIXME: this is seriously buggy and currently not available in the gui
    BedItem* itm = (BedItem*) itemFromIndex(idx);

    if (!itm) {
        return;
    }

    int lastPos = itm->getBed()->getPosition() - 1;

    QList<Bed*>::iterator it = p->getLastBed();
    QList<Bed*> beds;
    
    for (QList<Bed*>::iterator it = p->getLastBed(); it != p->getFirstBed(); it--) {
        beds.prepend(*it);
        
    }

    for(int i = 0; i < beds.size(); i++) {
        Bed* b = beds.at(i);
        lastPos += i;
        (void) _profile->copyBed(b, 0, lastPos);
    }

    reload();
}
开发者ID:BackupTheBerlios,项目名称:profilelogger-svn,代码行数:26,代码来源:BedItemModel.cpp

示例4: slotCreateBedAbove

void BedItemModel::slotCreateBedAbove(const QModelIndex& idxBedBelow) {
    if (!idxBedBelow.isValid()) {
        return;
    }

    BedItem* bitm = (BedItem*) itemFromIndex(idxBedBelow);

    if (QMessageBox::Yes != QMessageBox::question((static_cast<ProfileLogger*>(QApplication::instance()))->getMainWindow(),
            tr("Create Bed Above?"),
            tr("Create Bed Above Bed %1?").arg(bitm->getBed()->getPosition()),
            QMessageBox::Yes | QMessageBox::No)) {
        return;
    }

    Bed* bed = _profile->createBed(0, bitm->getBed()->getPosition());

    BedEditorDialog* dlg = new BedEditorDialog((static_cast<ProfileLogger*>(QApplication::instance()))->getMainWindow(), bed);
    dlg->exec();

    reload();

    emit selectRequest(indexFromItem(findItemForBed(bed)));
}
开发者ID:BackupTheBerlios,项目名称:profilelogger-svn,代码行数:23,代码来源:BedItemModel.cpp

示例5: findItemForBed

BedItem* BedItemModel::findItemForBed(Bed* b) {
    if (!b) {
        return 0;
    }

    int max = rowCount();
    for (int r = 0; r < max; r++) {
        BedItem* itm = (BedItem*) item(r);
        if (itm->getBed()->getId() == b->getId()) {
            return itm;
        }
    }
    return 0;
}
开发者ID:BackupTheBerlios,项目名称:profilelogger-svn,代码行数:14,代码来源:BedItemModel.cpp

示例6: slotEdit

void BedItemModel::slotEdit(const QModelIndex& idx) {
    if (!idx.isValid()) {
        return;
    }

    BedItem* itm = (BedItem*) itemFromIndex(idx);
    Bed* bed = itm->getBed();

    BedEditorDialog* dlg = new BedEditorDialog((static_cast<ProfileLogger*>(QApplication::instance()))->getMainWindow(), bed);
    dlg->exec();

    reload();

    emit selectRequest(indexFromItem(findItemForBed(bed)));
}
开发者ID:BackupTheBerlios,项目名称:profilelogger-svn,代码行数:15,代码来源:BedItemModel.cpp

示例7: slotInsertProfileAbove

void BedItemModel::slotInsertProfileAbove(Profile* p, const QModelIndex& idx) {
    BedItem* itm = (BedItem*) itemFromIndex(idx);
    
    if (!itm) {
        return;
    }

    int lastPos = itm->getBed()->getPosition();
    
    for (QList<Bed*>::iterator it = p->getFirstBed(); it != p->getLastBed(); it++) {
        (void) _profile->copyBed(*it, 0, lastPos);
        lastPos++;
    }

    reload();
}
开发者ID:BackupTheBerlios,项目名称:profilelogger-svn,代码行数:16,代码来源:BedItemModel.cpp

示例8: slotDeleteBedsBelow

void BedItemModel::slotDeleteBedsBelow(const QModelIndex& idx) {
    BedItem* itm = (BedItem*) itemFromIndex(idx);

    if (!itm) {
        return;
    }

    Bed* bed = itm->getBed();

    if (QMessageBox::Yes != QMessageBox::question((static_cast<ProfileLogger*>(QApplication::instance()))->getMainWindow(),
            tr("Delete beds below %1?").arg(bed->getPosition()),
            tr("Delete beds below bed %1?").arg(bed->getPosition()),
            QMessageBox::Yes | QMessageBox::No)) {
        return;
    }

    _profile->deleteBedsBelow(bed);

    reload();
}
开发者ID:BackupTheBerlios,项目名称:profilelogger-svn,代码行数:20,代码来源:BedItemModel.cpp

示例9: slotMoveUp

void BedItemModel::slotMoveUp(const QModelIndex& idx) {
    if (!idx.isValid()) {
        return;
    }

    BedItem* itm = ((BedItem*) itemFromIndex(idx));

    if (!itm) {
        return;
    }

    Bed* bed = itm->getBed();

    if (QMessageBox::Yes != QMessageBox::question((static_cast<ProfileLogger*>(QApplication::instance()))->getMainWindow(),
            tr("Move Bed Up?"),
            tr("Move Bed %1 Up?").arg(bed->getPosition()),
            QMessageBox::Yes | QMessageBox::No)) {
        return;
    }

    _profile->moveBedUp(bed);
    reload();
}
开发者ID:BackupTheBerlios,项目名称:profilelogger-svn,代码行数:23,代码来源:BedItemModel.cpp

示例10: slotDuplicateAndInsertOnTop

void BedItemModel::slotDuplicateAndInsertOnTop(const QModelIndex& idx) {
    if (!idx.isValid()) {
        return;
    }

    BedItem* itm = (BedItem*) itemFromIndex(idx);
    if (!itm) {
        return;
    }

    Bed* src = itm->getBed();
    if (!src) {
        return;
    }

    if (QMessageBox::Yes != QMessageBox::question((static_cast<ProfileLogger*>(QApplication::instance()))->getMainWindow(),
            tr("Duplicate Bed and insert at top?"),
            tr("Duplicate bed %1 and insert at top?").arg(src->getPosition()),
            QMessageBox::Yes | QMessageBox::No)) {
        return;
    }

    Bed* bed = _profile->copyBed(src);
    /*
    Bed* bed = _profile->createBed();
    bed->getHeight()->setValue(src->getHeight()->getValue());
    bed->getHeight()->setUnit(src->getHeight()->getUnit());
    bed->setName(src->getName());
    bed->setLithology(src->getLithology());
    bed->setBaseCarbonateGrainSize(src->getBaseCarbonateGrainSize());
    bed->setBaseClasticGrainSize(src->getBaseClasticGrainSize());
    bed->setBeddingType(src->getBeddingType());
    bed->setColor(src->getColor());
    bed->setDescription(src->getDescription());
    bed->setFacies(src->getFacies());
    bed->setGrainSizeMode(src->getGrainSizeMode());
    bed->setOutcropQuality(src->getOutcropQuality());
    bed->setTopBoundaryType(src->getTopBoundaryType());
    bed->setTopCarbonateGrainSize(src->getTopCarbonateGrainSize());
    bed->setTopClasticGrainSize(src->getTopClasticGrainSize());

    for (QList<Fossil*>::iterator it = src->getFirstFossil();
            it != src->getLastFossil();
            it++) {
        bed->addFossil(*it);
    }

    for (QList<SedimentStructure*>::iterator it = src->getFirstSedimentStructure();
            it != src->getLastSedimentStructure();
            it++) {
        bed->addSedimentStructure(*it);
    }

    for (QList<CustomSymbol*>::iterator it = src->getFirstCustomSymbol();
            it != src->getLastCustomSymbol();
            it++) {
        bed->addCustomSymbol(*it);
    }
     */
    BedEditorDialog* dlg = new BedEditorDialog((static_cast<ProfileLogger*>(QApplication::instance()))->getMainWindow(), bed);
    dlg->exec();

    reload();

    emit selectRequest(indexFromItem(findItemForBed(bed)));
}
开发者ID:BackupTheBerlios,项目名称:profilelogger-svn,代码行数:66,代码来源:BedItemModel.cpp


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