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


C++ setupModel函数代码示例

本文整理汇总了C++中setupModel函数的典型用法代码示例。如果您正苦于以下问题:C++ setupModel函数的具体用法?C++ setupModel怎么用?C++ setupModel使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: setRobotDescription

    virtual void setRobotDescription(robot_desc::URDF *file)
    {
	planning_node_util::NodeCollisionModel::setRobotDescription(file);	
	
	printf("=======================================\n");	
	m_kmodel->printModelInfo();
	printf("=======================================\n");

	/* set the data for the model */
	myModel *model = new myModel();
	model->collisionSpaceID = 0;
	model->collisionSpace = m_collisionSpace;
        model->kmodel = m_kmodel;
	model->groupName = m_kmodel->name;
	setupModel(model);

	/* remember the model by the robot's name */
	m_models[model->groupName] = model;
	
	/* create a model for each group */
	std::vector<std::string> groups;
	m_kmodel->getGroups(groups);

	for (unsigned int i = 0 ; i < groups.size() ; ++i)
	{
	    myModel *model = new myModel();
	    model->collisionSpaceID = 0;
	    model->collisionSpace = m_collisionSpace;
	    model->kmodel = m_kmodel;
	    model->groupID = m_kmodel->getGroupID(groups[i]);
	    model->groupName = groups[i];
	    setupModel(model);
	    m_models[model->groupName] = model;
	}
    }
开发者ID:goretkin,项目名称:kwc-ros-pkg,代码行数:35,代码来源:motion_validator.cpp

示例2: QStandardItemModel

void savesWidget::RefreshSaveTable(int index)
{
	if(index==0) //selection is none clear table
	{
	     model = new QStandardItemModel(0, 4, ui.savesTable);
		 model->setHeaderData(0, Qt::Horizontal, tr("Icon"));
		 model->setHeaderData(1, Qt::Horizontal, tr("Directory"));
		 model->setHeaderData(2, Qt::Horizontal, tr("Game Title"));
		 model->setHeaderData(3, Qt::Horizontal, tr("SaveData Title"));

		 ui.savesTable->setModel(model);
		 model->removeRows(0, model->rowCount(QModelIndex()), QModelIndex());//clear data
	}
	else if(index==1) //psp device
	{
		if(scanPSPdir())
		 setupModel(m_savePSPList);
		else
			emit ui.sourceselectCombo->setCurrentIndex(0);//set index to NONE
	}
	else if(index==2) //Local folder
	{
		if(scanLocalDir())
		 setupModel(m_savePSPLocal);
		else
			emit ui.sourceselectCombo->setCurrentIndex(0);//set index to NONE
	}
	else if(index==3) //jpcsp selection
	{
		if(scanJPCSPdir())
		 setupModel(m_saveJPCSPList);
		else
			emit ui.sourceselectCombo->setCurrentIndex(0);//set index to NONE
	}
	else if(index==4) //pcsp selection
	{
		if(scanPCSPdir())
		 setupModel(m_savePCSPList);
		else
			emit ui.sourceselectCombo->setCurrentIndex(0);//set index to NONE
	}
	else if(index==5) //pcsp selection
	{
		if(scanPSPEdir())
		 setupModel(m_savePSPEList);
		else
			emit ui.sourceselectCombo->setCurrentIndex(0);//set index to NONE
	}
	ui.savedatalabel->setText("");//clear text
}
开发者ID:georgemoralis,项目名称:pspudb,代码行数:50,代码来源:saveswidget.cpp

示例3: setupModel

void ProvidersEditor::setDb(QSqlDatabase database)
{
    db = database;
    if (!db.isOpen()) db.open();

    setupModel();
}
开发者ID:pasqal,项目名称:lemonpos,代码行数:7,代码来源:providerseditor.cpp

示例4: QDialog

MainWindow::MainWindow( QWidget* parent )
    : QDialog( parent )
    , m_chart( 0 )
    , m_diagram( 0 )
    , m_ternaryPlane( 0 )
{
    setupUi( this );
    // make a chart
    m_chart = new KDChart::Chart;
    // replace the default (cartesian) coordinate plane with a ternary one
    m_ternaryPlane = new KDChart::TernaryCoordinatePlane;
    m_chart->replaceCoordinatePlane( m_ternaryPlane );
    // make a ternary line diagram
    m_diagram = new KDChart::TernaryPointDiagram;
    // and replace the default diagram with it
    m_ternaryPlane->replaceDiagram( m_diagram );

    // add the three ternary axes, see the positions
    KDChart::TernaryAxis* axisA = new KDChart::TernaryAxis( m_diagram );
    axisA->setPosition( KDChartEnums::PositionSouth );
    KDChart::TernaryAxis* axisB = new KDChart::TernaryAxis( m_diagram );
    axisB->setPosition( KDChartEnums::PositionWest );
    KDChart::TernaryAxis* axisC = new KDChart::TernaryAxis( m_diagram );
    axisC->setPosition( KDChartEnums::PositionEast );

    QHBoxLayout* chartLayout = new QHBoxLayout( frame );
    chartLayout->addWidget( m_chart );

    setupModel();
    m_diagram->setModel( &m_model );
    connect( m_diagram, SIGNAL( clicked( QModelIndex ) ),
             SLOT( indexClicked( QModelIndex ) ) );
}
开发者ID:Wushaowei001,项目名称:mksPlanner,代码行数:33,代码来源:mainwindow.cpp

示例5: setupModel

void GradientModel::addStop(qreal position, const QColor &color)
{
    if (m_lock)
        return;

    if (!m_itemNode.isValid() || gradientPropertyName().isEmpty())
        return;

    if (m_itemNode.modelNode().hasNodeProperty(gradientPropertyName().toUtf8())) {
        //QmlDesigner::RewriterTransaction transaction = m_itemNode.modelNode().view()->beginRewriterTransaction();
        //### TODO does not work

        QmlDesigner::ModelNode gradientNode =  m_itemNode.modelNode().nodeProperty(gradientPropertyName().toUtf8()).modelNode();

        QmlDesigner::ModelNode gradientStopNode =
                m_itemNode.modelNode().view()->createModelNode("QtQuick.GradientStop",
                                                               m_itemNode.modelNode().view()->majorQtQuickVersion(), 0);
        gradientStopNode.variantProperty("position").setValue(position);
        gradientStopNode.variantProperty("color").setValue(color);
        gradientNode.nodeListProperty("stops").reparentHere(gradientStopNode);

        const QList<QmlDesigner::ModelNode> stopNodes = gradientNode.nodeListProperty("stops").toModelNodeList();

        int properPos = 0;
        for (int i = 0; i < stopNodes.count(); i++) {
            if (QmlDesigner::QmlObjectNode(stopNodes.at(i)).modelValue("position").toReal() < position)
                properPos = i + 1;
        }
        gradientNode.nodeListProperty("stops").slide(stopNodes.count() - 1, properPos);

        setupModel();
    }
}
开发者ID:edwardZhang,项目名称:qt-creator,代码行数:33,代码来源:gradientmodel.cpp

示例6:

bool
ossimOutlierRejection::execute()
{
   if(!setupModel(theModelDefinitionString))
   {
      return false;
   }
   ossim_float64 variance_pix2;
   if(removeOutliers(&variance_pix2, NULL)) //TBD : use target variance
   {
      //display RMS with unit
      cout<<"RMS="<<std::sqrt(variance_pix2)<<" pixels"<<endl;

      //export results
      if(theGeomOutputFilename!="")
      {
         if(!exportModel(theGeomOutputFilename)) return false;
      }
      if(theInlierOutputFilename!="")
      {
         if(!saveGMLTieSet(theInlierOutputFilename)) return false;
      }
   }
   else
   {
      return false;
   }

   return true;
}
开发者ID:ICODE-MDA,项目名称:AutomatedSARShipDetection,代码行数:30,代码来源:ossimOutlierRejection.cpp

示例7: QMenu

MainWindow::MainWindow()
{
    QMenu *fileMenu = new QMenu(tr("&File"), this);
    QAction *openAction = fileMenu->addAction(tr("&Open..."));
    openAction->setShortcut(QKeySequence(tr("Ctrl+O")));
    QAction *saveAction = fileMenu->addAction(tr("&Save As..."));
    saveAction->setShortcut(QKeySequence(tr("Ctrl+S")));
    QAction *quitAction = fileMenu->addAction(tr("E&xit"));
    quitAction->setShortcut(QKeySequence(tr("Ctrl+Q")));

    setupModel();
    setupViews();

    connect(openAction, SIGNAL(triggered()), this, SLOT(openFile()));
    connect(saveAction, SIGNAL(triggered()), this, SLOT(saveFile()));
    connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));

    menuBar()->addMenu(fileMenu);
    statusBar();

    openFile(":/Charts/qtdata.cht");

    setWindowTitle(tr("Chart"));
    resize(870, 550);
}
开发者ID:eagafonov,项目名称:qtmoko,代码行数:25,代码来源:mainwindow.cpp

示例8: QAbstractItemModel

NBMediaInfoModel::NBMediaInfoModel( QString fileName ) : QAbstractItemModel() {

	mFileName = QString( fileName );
	rootNode = new NBMediaInfoNode();

	setupModel();
};
开发者ID:marcusbritanicus,项目名称:NewBreeze,代码行数:7,代码来源:NBMediaInfo.cpp

示例9: QStandardItemModel

void fileBrowserWidget::RefreshFilesTable(int index)
{
	ui.JPCSPbutton->setEnabled(true);
	ui.CPSPEMUbutton->setEnabled(true);
	ui.PSPEbutton->setEnabled(true);

	if(index==0) //selection is none clear table
	{
		 model = new QStandardItemModel(0, 5, ui.fileTable);
		 model->setHeaderData(0, Qt::Horizontal, tr("Icon"));
		 model->setHeaderData(1, Qt::Horizontal, tr("Demo Name"));
		 model->setHeaderData(2, Qt::Horizontal, tr("Title"));
		 model->setHeaderData(3, Qt::Horizontal, tr("Disc ID"));
		 model->setHeaderData(4, Qt::Horizontal, tr("FW"));

		 ui.fileTable->setModel(model);
		 model->removeRows(0, model->rowCount(QModelIndex()), QModelIndex());//clear data 
		 
	}
	else if(index==1) //local folder
	{
		if(scanLocaldir())
		 setupModel(appLocalList);
		else
			emit ui.sourceselectCombo->setCurrentIndex(0);//set index to NONE
		
	}
}
开发者ID:georgemoralis,项目名称:pspudb,代码行数:28,代码来源:filebrowserwidget.cpp

示例10: setupModel

void FileResourcesModel::setFilter(const QString &filter)
{
    if (m_filter != filter) {
        m_filter = filter;
        setupModel();
    }
}
开发者ID:C-sjia,项目名称:qt-creator,代码行数:7,代码来源:fileresourcesmodel.cpp

示例11: FilterBase

FilterTid::FilterTid (QWidget * parent)
	: FilterBase(parent)
	, m_ui(new Ui_FilterTid)
  , m_model(0)
{
	initUI();
	setupModel();
}
开发者ID:BackupTheBerlios,项目名称:flogging,代码行数:8,代码来源:filter_tid.cpp

示例12: Q_ASSERT_X

// method for setting new model for this controller + view
void MWidgetController::setModel(MWidgetModel *model)
{
    Q_ASSERT_X(model, "MWidgetController", "MWidgetController::setModel() parameter model has to be valid!");
    Q_D(MWidgetController);
    d->setModel(model);
    //Call setupModel immediately since this is not called from the constructor
    setupModel();
}
开发者ID:arcean,项目名称:libmeegotouch-framework,代码行数:9,代码来源:mwidgetcontroller.cpp

示例13: VyborgMainDialog

MainDialog::MainDialog(QWidget *parent)
    : VyborgMainDialog(parent)
{
    setupModel();
    setupView();
    setupMapperDialog();
    setupFilterDialog();
    setupSortDialog();
}
开发者ID:Wushaowei001,项目名称:vyborg_src,代码行数:9,代码来源:maindialog.cpp

示例14: QWidget

EventViewer::EventViewer(QWidget *parent) :
    QWidget(parent)
{
    EVLayout = new QVBoxLayout(this);
    m_data = 0;
    setMinimumHeight(500);

    titleLabel = new QLabel;
    setTitleLabel("DEMO");
    EVLayout->addWidget(titleLabel);


    evt_plot = new Plot(this);
    rasterData = (SpectrogramData*)  evt_plot->getSpectrogram()->data();
    rasterData->resetData();
    evt_plot->setMaximumSize(640,160);
    evt_plot->setMinimumSize(640,160);
    evt_plot->showContour(false);
    evt_plot->updateScale();

    EVLayout->addWidget(evt_plot);

    btnLayout = new QHBoxLayout();

    evtN_lab = new QLabel("Event N:",this);
    evtN_lcd = new QLCDNumber(6,this);
    integrate_chbx = new QCheckBox("Integrate",this);
    integrate_chbx->setProperty("isPixel",false);

    nextEvent_pbtn = new QPushButton(QIcon(":/images/next.png"),"Next",this);
    prevEvent_pbtn= new QPushButton(QIcon(":/images/prev.png"),"Prev",this);;
    rwd_pbtn = new QPushButton(QIcon(":/images/rew.png"),"RWD",this);
    fwd_pbtn = new QPushButton(QIcon(":/images/fwd.png"),"FWD",this);

    connect(nextEvent_pbtn, SIGNAL(clicked()), this, SLOT(nextEvent()));
    connect(prevEvent_pbtn, SIGNAL(clicked()), this, SLOT(prevEvent()));
    connect(rwd_pbtn, SIGNAL(clicked()), this, SLOT(rewindEvent()));
    connect(fwd_pbtn, SIGNAL(clicked()), this, SLOT(forwardEvent()));


    btnLayout->addWidget(evtN_lab);
    btnLayout->addWidget(evtN_lcd);
    btnLayout->addWidget(integrate_chbx);
    btnLayout->addWidget(prevEvent_pbtn);
    btnLayout->addWidget(nextEvent_pbtn);
    btnLayout->addWidget(rwd_pbtn);
    btnLayout->addWidget(fwd_pbtn);
    EVLayout->addLayout(btnLayout);

    evtView = new QTreeView(this);
    setupModel();
    evtView->setColumnWidth(0 , 180);
    EVLayout->addWidget(evtView);



}
开发者ID:f-giorgi,项目名称:MTG,代码行数:57,代码来源:eventviewer.cpp

示例15: QMainWindow

MainWindow::MainWindow(QWidget *parent)
	: QMainWindow(parent)
{    
    setWindowTitle(tr("Custom Model"));
   
    createMenu(); 

    setupModel();
    setupView(); 
}
开发者ID:guolilong2012,项目名称:exercise_aka,代码行数:10,代码来源:mainwindow.cpp


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