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; } }
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 }
void ProvidersEditor::setDb(QSqlDatabase database) { db = database; if (!db.isOpen()) db.open(); setupModel(); }
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 ) ) ); }
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(); } }
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; }
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); }
NBMediaInfoModel::NBMediaInfoModel( QString fileName ) : QAbstractItemModel() { mFileName = QString( fileName ); rootNode = new NBMediaInfoNode(); setupModel(); };
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 } }
void FileResourcesModel::setFilter(const QString &filter) { if (m_filter != filter) { m_filter = filter; setupModel(); } }
FilterTid::FilterTid (QWidget * parent) : FilterBase(parent) , m_ui(new Ui_FilterTid) , m_model(0) { initUI(); setupModel(); }
// 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(); }
MainDialog::MainDialog(QWidget *parent) : VyborgMainDialog(parent) { setupModel(); setupView(); setupMapperDialog(); setupFilterDialog(); setupSortDialog(); }
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); }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { setWindowTitle(tr("Custom Model")); createMenu(); setupModel(); setupView(); }
FListView::FListView(QWidget* parent /* = 0 */) : QTreeView(parent), listmodel(new QDirModel(this)), curr_path(QDir::homePath()) { setupModel(); setupGui(); setRootIndex(listmodel->index(curr_path)); setCurrentIndex(listmodel->index(0,0, rootIndex())); }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); setupGui(); setupAction(); setupModel(); setupConnection(); }
void MainWindow::grp2() { num1 = 2; qDebug() << "grp2" ; setupModel("./Closer/out.ro","./NumberSystem/out.ro"); setupChart(); setWindowTitle("Плотность заполнения основной области"); ui->textBrowser->setText("Метод преобразования системы счисления : Плотность заполнения основной области"); ui->textBrowser_2->setText("Метод складывания : Плотность заполнения основной области"); }
void TabViewIndexModel::setModelNodeBackend(const QVariant &modelNodeBackend) { QObject* modelNodeBackendObject = modelNodeBackend.value<QObject*>(); if (modelNodeBackendObject) setModelNode(modelNodeBackendObject->property("modelNode").value<QmlDesigner::ModelNode>()); setupModel(); emit modelNodeBackendChanged(); }
ColorizerRow::ColorizerRow (QWidget * parent) : FilterBase(parent) , m_ui(new Ui_ColorizerRow) , m_data() , m_model(0) , m_src_model(0) { initUI(); setupModel(); }
void MainWindow::grp3() { num1 = 3; qDebug() << "grp3" ; setupModel("./Closer/out.time","./NumberSystem/out.time"); setupChart(); setWindowTitle("Время поиска"); ui->textBrowser->setText("Метод преобразования системы счисления : Время поиска"); ui->textBrowser_2->setText("Метод складывания : Время поиска"); }
AMBeamlineParallelActionsList::AMBeamlineParallelActionsList(QObject *parent) : QObject(parent) { insertRowLatch_ = -1; actions_ = NULL; currentStage_ = -1; isRunning_ = false; setupModel(); connect(this, SIGNAL(stageStarted(int)), this, SLOT(onStageStarted(int))); }
FilterLvl::FilterLvl (QWidget * parent) : FilterBase(parent) , m_ui(new Ui_FilterLvl) , m_data() , m_model(0) , m_delegate(0) { initUI(); setupModel(); }
FilterFileLine::FilterFileLine (QWidget * parent) : FilterBase(parent) , m_ui(new Ui_FilterFileLine) , m_data() , m_model(0) , m_proxy(0) , m_proxy_selection(0) { initUI(); setupModel(); }
//! [Set up widgets] Window::Window(QWidget *parent) : QWidget(parent) { setupModel(); nameLabel = new QLabel(tr("Na&me:")); nameEdit = new QLineEdit(); addressLabel = new QLabel(tr("&Address:")); addressEdit = new QTextEdit(); typeLabel = new QLabel(tr("&Type:")); typeComboBox = new QComboBox(); nextButton = new QPushButton(tr("&Next")); previousButton = new QPushButton(tr("&Previous")); nameLabel->setBuddy(nameEdit); addressLabel->setBuddy(addressEdit); typeLabel->setBuddy(typeComboBox); //! [Set up widgets] //! [Set up the mapper] QSqlTableModel *relModel = model->relationModel(typeIndex); typeComboBox->setModel(relModel); typeComboBox->setModelColumn(relModel->fieldIndex("description")); mapper = new QDataWidgetMapper(this); mapper->setModel(model); mapper->setItemDelegate(new QSqlRelationalDelegate(this)); mapper->addMapping(nameEdit, model->fieldIndex("name")); mapper->addMapping(addressEdit, model->fieldIndex("address")); mapper->addMapping(typeComboBox, typeIndex); //! [Set up the mapper] //! [Set up connections and layouts] connect(previousButton, SIGNAL(clicked()), mapper, SLOT(toPrevious())); connect(nextButton, SIGNAL(clicked()), mapper, SLOT(toNext())); connect(mapper, SIGNAL(currentIndexChanged(int)), this, SLOT(updateButtons(int))); QGridLayout *layout = new QGridLayout(); layout->addWidget(nameLabel, 0, 0, 1, 1); layout->addWidget(nameEdit, 0, 1, 1, 1); layout->addWidget(previousButton, 0, 2, 1, 1); layout->addWidget(addressLabel, 1, 0, 1, 1); layout->addWidget(addressEdit, 1, 1, 2, 1); layout->addWidget(nextButton, 1, 2, 1, 1); layout->addWidget(typeLabel, 3, 0, 1, 1); layout->addWidget(typeComboBox, 3, 1, 1, 1); setLayout(layout); setWindowTitle(tr("SQL Widget Mapper")); mapper->toFirst(); }
FilterScript::FilterScript (QWidget * parent) : FilterBase(parent) , m_ui(new Ui_FilterScript) , m_data() , m_se(0) , m_model(0) , m_delegate(0) { initUI(); setupModel(); m_se = new QScriptEngine(); }
static void * barcode_init (Display *dpy, Window win) { struct state *st = (struct state *) calloc (1, sizeof(*st)); st->dpy = dpy; st->window = win; initParams (st); setup (st); setupModel (st); return st; }
ViewDepartments::ViewDepartments(QWidget * parent): ui(new Ui::ViewDepartments) // ?? { ui->setupUi(this); setupModel(); QObject::connect(ui->action_New, SIGNAL(triggered()), this, SLOT(slotAdd())); QObject::connect(ui->action_Delete, SIGNAL(triggered()), this, SLOT(slotDelete())); QObject::connect(ui->action_Edit, SIGNAL(triggered()), this, SLOT(slotEdit())); QObject::connect(ui->action_Yes, SIGNAL(triggered()), this, SLOT(slotSave())); QObject::connect(ui->action_No, SIGNAL(triggered()), this, SLOT(slotCancel())); }
SampleView::SampleView(QWidget *parent) : QWidget(parent) { // Add sample dialog will be instansiated upon Add Sample request. addSampleDialog_ = 0; setupModel(); setupMainLayout(); setupMainConnections(); setWindowTitle("Sample Manager 1.0 - David Leacock"); }
LogDetailWidget::LogDetailWidget(QWidget *parent, QString name) : QWidget(parent), logMan(name.toStdString()) { ui.setupUi(this); this->name = name; this->setWindowTitle("Log Information - " + name); //db = new DBInterface; //vector<LogEvent> events = db->getAllEvents(name.toStdString()); //logMan.setEvents(events); QStandardItemModel *model = new QStandardItemModel(8, 2, this); pieChart = new PieView(ui.pie_tab); pieLayout = new QVBoxLayout(ui.pie_tab); pieLayout->addWidget(pieChart); ui.include_proc_view->setModel(model); pieChart->setModel(model); QItemSelectionModel *selectionModel = new QItemSelectionModel(model); pieChart->setSelectionModel(selectionModel); ui.include_proc_view->setSelectionModel(selectionModel); QHeaderView *headerView = ui.include_proc_view->horizontalHeader(); headerView->setStretchLastSection(true); setupModel(); markovLayout = new QVBoxLayout(ui.markov_tab); generateMarkov(); QLabel *label = new QLabel; QImage img(name + ".png"); label->setPixmap(QPixmap::fromImage(img)); markovLayout->addWidget(label); seqChart = new DistributedWidget; seqChart->initForProcess(logMan); seqLayout = new QVBoxLayout(ui.seq_tab); seqLayout->addWidget(seqChart); ui.aaView->setContextMenuPolicy(Qt::CustomContextMenu); connect(ui.aaView , SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onCustomMenuRequested(const QPoint &))); classifyAction(); funcKeyInput(); copyPaste(); }