//-------------------------------------------------------------------- // initialize application void TestCube::appInit() { MovementApp::appInit(); mgString title; title.format("%s, %s", mgProgramName, mgProgramVersion); mgPlatform->setWindowTitle(title); // load the shaders we use m_floorShader = mgVertex::loadShader("litTexture"); m_cubeShader = mgVertexTA::loadShader("litTextureArray"); // rotation angle for cube m_angle = 0.0; // load texture patterns loadTextures(); // create vertex and index buffers m_cubeIndexes = NULL; m_cubeVertexes = NULL; m_floorVertexes = NULL; m_animate = true; // create the help pane m_help = new HelpUI(m_options); m_help->setDebugApp(this); setUI(m_help); }
/** * @brief Widget::Widget * @param parent */ Widget::Widget(QWidget *parent) : QWidget(parent) ,serialPort(new QSerialPort(this)) ,serialPortStatusBar(new QStatusBar()) ,serialPortLabel(new QLabel(tr("Serial port:"))) ,serialPortComboBox(new QComboBox()) ,serialPortBaudRateLabel(new QLabel(tr("Baud Rate:"))) ,serialPortBaudRateComboBox(new QComboBox()) ,serialPortDataBitsLabel(new QLabel(tr("Data Bits:"))) ,serialPortDataBisComboBox(new QComboBox()) ,serialPortParityLabel(new QLabel(tr("Parity:"))) ,serialPortParityComboBox(new QComboBox()) ,serialPortStopBitsLabel(new QLabel(tr("Stop Bits:"))) ,serialPortStopBitsComboBox(new QComboBox()) ,serialPortFlowControlLabel(new QLabel(tr("Flow Control:"))) ,serialPortFlowControlComboBox(new QComboBox()) ,closeOrOpenSerialPortBtn(new QPushButton(tr("Open Serial Port"))) ,senderBtn(new QPushButton(tr("Send"))) ,serialPortTextBrowser(new QTextBrowser()) ,serialPortLineEdit(new QLineEdit()) { setWindowIcon(QIcon(":/new/Icon/ICON")); setWindowTitle(tr("SerialCOM Assistant")); setUI(); openSerialPort(); activeSignalAndSlot(); }
DataWidget::DataWidget(QWidget *parent) : QWidget(parent) { setWindowTitle("Data"); this->setFixedSize(500,500); setUI(); pitch=roll=yaw=0.0; }
Animation* GameCritterObject::setActionAnimation(std::string action) { Animation* animation = new Animation("art/critters/" + _generateArmorFrmString() + action + ".frm", orientation()); animation->play(); auto queue = new AnimationQueue(); queue->setRepeat(true); queue->animations()->push_back(animation); queue->start(); setUI(queue); return animation; }
bool Game::init(){ if(!Layer::init()){ return false; } //计数器设为0 index=0; auto contactListener=EventListenerPhysicsContact::create(); contactListener->onContactBegin=CC_CALLBACK_1(Game::onContactBegin, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(contactListener, this); setUI(); return true; }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); dictionary = new Diccionario("diccionario.xml"); dictionary->loadDictionary(); loadIntoTable(); layoutSet = false; loadTags(); setUI(); }
void myExchangeFormStock::checkAndSetDisable(const myExchangeData &exchangeData) { setUI(exchangeData); if (exchangeData.accountMoney == exchangeData.assetData.accountCode && exchangeData.accountMoney != "") ui->moneyAccount->setDisabled(true); if (exchangeData.assetData.assetCode != "") { ui->codeLineEdit->setDisabled(true); ui->radioSH->setDisabled(true); ui->radioSZ->setDisabled(true); ui->radioOther->setDisabled(true); } if (exchangeData.assetData.assetName != "") ui->nameLineEdit->setDisabled(true); }
UI::Animation* CritterObject::setActionAnimation(const std::string& action) { UI::Animation* animation = new UI::Animation("art/critters/" + _generateArmorFrmString() + action + ".frm", orientation()); animation->addEventHandler("animationEnded", [animation](Event::Event* event) { animation->setCurrentFrame(0); }); animation->play(); /*auto queue = new AnimationQueue(); queue->setRepeat(true); queue->animations()->push_back(animation); queue->start();*/ setUI(animation); return animation; }
Qhijridate::Qhijridate( QWidget * parent, Qt::WFlags f) : QDialog(parent, f) { #ifdef Q_WS_WIN path = QCoreApplication::applicationDirPath (); #else path = "/usr/share/qsalat/"; #endif if (path.data()[path.size() - 1] != '/') path += "/"; setupUi(this); setUI(); setActions(); hijri = new Qhijri(); init(); }
Sis3100Module::Sis3100Module(int _id, QString _name) : BaseInterface(_id, _name) , id (getId ()) , name (getName ()) { deviceOpen = false; devicePath = tr("/dev/sis1100_00remote"); controlPath = tr("/dev/sis1100_00ctrl"); // Create channels container // Create user interface setUI (new Sis3100UI(this)); std::cout << "Instantiated Sis3100 Module" << std::endl; }
Player::Player( QWidget * parent, Qt::WFlags f) : QMainWindow(parent, f) { setupUi(this); path = QCoreApplication::applicationDirPath (); if (path.data()[path.size() - 1] != '/') path += "/"; videoPlayer->mediaObject()->setTickInterval(1000); setUI(); setActions(); init(); adjustWindow(); videoPlayer->installEventFilter(this); videoPlayer->videoWidget()->installEventFilter(this); isFullScreen = false; //addButton->hide(); }
Qcalculation::Qcalculation( QWidget * parent, Qt::WFlags f) : QDialog(parent, f) { #ifdef Q_WS_WIN path = QCoreApplication::applicationDirPath (); #else path = "/usr/share/qsalat/"; #endif if (path.data()[path.size() - 1] != '/') path += "/"; setupUi(this); setUI(); setActions(); date = QDate::currentDate(); prayers = new Qpray(); times = new QString[7]; init(0); }
//-------------------------------------------------------------- // initialize application void Crafty::appInit() { MovementApp::appInit(); mgPlatform->setWindowTitle("Crafty, Part 58"); // get lighting and material m_options.getPoint("matColor", mgPoint3(1,1,1), m_matColor); m_options.getPoint("sunlightColor", mgPoint3(0.8, 0.8, 0.8), m_sunlightColor); m_options.getPoint("moonlightColor", mgPoint3(0.1, 0.1, 0.1), m_moonlightColor); m_options.getPoint("torchlightColor", mgPoint3(0.5, 0.5, 0.5), m_torchlightColor); // since the view list goes up as the cube of distance, limit it int viewDistance = m_options.getInteger("viewDistance", 300); viewDistance = min(450, viewDistance); m_fogMaxDist = viewDistance; // create the sky m_lightDir = mgPoint3(0.0, 0.5, 1.0); m_sky = new StarrySky(m_options); m_sky->setMoonDir(m_lightDir); m_sky->setSunDir(m_lightDir); m_sky->setFogInten(1.0, 1.0); m_sky->setFogDist(1000.0, m_fogMaxDist); m_world = new ChunkWorld(m_options); m_world->setTorchColor(m_torchlightColor); m_world->setFogHeight(FOG_BOT_HEIGHT, FOG_TOP_HEIGHT); m_world->setFogInten(1.0, 1.0); m_world->setFogDist(m_fogMaxDist); setDaylight(true); setFoggy(true); m_eyePt = mgPoint3(721, 72, -179); m_eyeRotX = -1.32; // -33; m_eyeRotY = -111.56; // -29; m_eyeRotZ = 0; setDeskMode(true); // create the help pane m_help = new HelpUI(m_options); setUI(m_help); }
DialogEmprunter::DialogEmprunter(std::list<ObjetEmpruntable *> objets, QWidget *parent) : QDialog(parent) { setUI(); // remplit la liste d'objets empruntables for (auto it = objets.begin(); it != objets.end(); it++) { QString s = ((*it)->obtenirTitre() + " (").c_str() + QString::number((*it)->obtenirNbDisponibles()) + QString(")"); QListWidgetItem* item = new QListWidgetItem(s, listeObjets_); item->setData(Qt::UserRole, QVariant::fromValue<ObjetEmpruntable*>(*it)); } // Connexions entre les signaux et les slots connect(listeObjets_, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(activerBoutonEmprunter())); connect(boutons_, &QDialogButtonBox::accepted, this, &QDialog::accept); connect(boutons_, &QDialogButtonBox::rejected, this, &QDialog::reject); }
Caen785Module::Caen785Module(int _id, QString _name) : BaseModule(_id, _name) , dmx (evslots, this) { setChannels(); createOutputPlugin(); evcntr = 0; status1 = 0; status2 = 0; // Setup conf.base_addr = 0x40000000; // Create user interface setUI (new Caen785UI(this)); std::cout << "Instantiated Caen785Module" << std::endl; }
OpencvWidget::OpencvWidget(QWidget *parent) : QWidget(parent) { MatRows = 200; MatCols = 300; CreateObj(); setUI(); QObject::connect( funs[0], SIGNAL(triggered()), this, SLOT(createCameraThread()) ); QObject::connect( funs[1], SIGNAL(triggered()), this, SLOT(createOptFlowThread()) ); QObject::connect( funs[2], SIGNAL(triggered()), this, SLOT(createFeatureMatchThread()) ); QObject::connect( funs[3], SIGNAL(triggered()), this, SLOT(createContourThread()) ); QObject::connect( funs[4], SIGNAL(triggered()), this, SLOT(createRGBLineChart()) ); QObject::connect( funs[5], SIGNAL(triggered()), this, SLOT(createBackProjection()) ); this->setWindowTitle("My_project"); this->resize(800, 600); this->show(); }
void InfoLikeBox::onEnter() { ccxGameNode::onEnter(); Vector<__String*> vStr = USER_DB->getDocStorageList(); for(__String* str : vStr) { if(str->compare(USER_DB->getDocInfoIdx()->getCString()) == 0) { _bIsLike = true; break; } else if(str->compare(USER_DB->getDocInfoIdx()->getCString()) != 0) { _bIsLike = false; } } setUI(); }
Qyearly::Qyearly( QWidget * parent, Qt::WFlags f) : QDialog(parent, f) { #ifdef Q_WS_WIN path = QCoreApplication::applicationDirPath (); #else path = "/usr/share/qsalat/"; #endif if (path.data()[path.size() - 1] != '/') path += "/"; setupUi(this); setUI(); #ifdef Q_WS_WIN file = path+"data/qsalat.xml"; #else file = QDir::homePath ()+"/.qsalat/config/qsalat.xml"; #endif parser.readFile(file); date = QDate::currentDate(); prayers = new Qpray(); init(); setActions(); }
void HAlarm::on_pushButton_4_clicked() { action="i"; setUI(); filterTargets(); updateButtons(false,false,false,true,true); ui->leCreator->setText(user->getName()); QString filter=""; QSqlTableModel* lvmod=static_cast<QSqlTableModel*> (ui->lvTarget->model()); lvmod->setFilter(filter); ui->deData->setDate(QDate::currentDate()); ui->ptDescrizione->setPlainText(""); mod->insertRow(mod->rowCount()); ui->tvMain->setCurrentIndex(mod->index(mod->rowCount(),0)); toggleUIInteractivity(true); }
HAlarm::HAlarm(QWidget *parent, QSqlDatabase pdb, HUser *puser) : QWidget(parent), ui(new Ui::HAlarm) { ui->setupUi(this); updateButtons(true,true,true,false,false); db=pdb; action="n"; user=puser; if (!db.isOpen()) { QMessageBox::warning(this,QApplication::applicationName(),"Attenzione: connessioe chiusa, riloggare",QMessageBox::Ok); } mod= new QSqlTableModel(0,db); mod->setTable("notifiche"); mod->setSort(1,Qt::DescendingOrder); mod->select(); usermod=new QSqlTableModel(0,db); usermod->setTable("utenti"); usermod->setFilter("attivo > 0"); usermod->setSort(4,Qt::AscendingOrder); usermod->select(); groupmod=new QSqlTableModel(0,db); groupmod->setTable("gruppi"); groupmod->setSort(1,Qt::AscendingOrder); groupmod->select(); getTypes(); ui->lvTarget->setModel(groupmod); ui->lvTarget->setModelColumn(1); ui->lvTarget->selectionModel()->setCurrentIndex(ui->lvTarget->model()->index(0,0),QItemSelectionModel::SelectCurrent); ui->tvMain->setModel(mod); ui->tvMain->setCurrentIndex(mod->index(0,0)); ui->tvMain->setColumnHidden(0,true); ui->tvMain->setColumnHidden(3,true); ui->tvMain->setColumnHidden(4,true); ui->tvMain->setColumnHidden(6,true); ui->tvMain->setColumnHidden(7,true); ui->tvMain->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); toggleUIInteractivity(false); QDataWidgetMapper *wmap=new QDataWidgetMapper(); wmap->setModel(mod); wmap->addMapping(ui->deData,1); wmap->addMapping(ui->cbTipo,2,"currentText"); wmap->addMapping(ui->ptDescrizione,5); wmap->addMapping(ui->cbAttiva,7); wmap->addMapping(ui->leCreator,8); wmap->toFirst(); ui->tvMain->setCurrentIndex(ui->tvMain->model()->index(-1,0)); connect(ui->tvMain->selectionModel(),SIGNAL(currentChanged(QModelIndex,QModelIndex)),wmap,SLOT(setCurrentModelIndex(QModelIndex))); connect(ui->tvMain->selectionModel(),SIGNAL(currentChanged(QModelIndex,QModelIndex)),this,SLOT(setUI())); connect(ui->tvMain->selectionModel(),SIGNAL(currentChanged(QModelIndex,QModelIndex)),this,SLOT(filterTargets())); ui->tvMain->setCurrentIndex(ui->tvMain->model()->index(0,0)); // setUI(); // filterTargets(); }
Widget::Widget(QWidget *parent) : QWidget(parent) { setUI(); connect(start, SIGNAL(clicked()), this, SLOT(startAlgorithm())); }
//-------------------------------------------------------------- // initialize application void Landscape::appInit() { MovementApp::appInit(); mgPlatform->setWindowTitle("Landscape, Part 58"); // create the help pane m_help = new HelpUI(m_options); setUI(m_help); // load textures loadTextures(); // load shaders mgVertex::loadShader("litTexture"); mgVertex::loadShader("unlitTexture"); mgVertexTA::loadShader("litTextureArray"); VertexTerrain::loadShader("terrain"); mgVertex::loadShader("water"); // create the sky m_lightDir = mgPoint3(0.0, 0.5, 1.0); m_lightColor = mgPoint3(0.8, 0.8, 0.8); m_lightAmbient = mgPoint3(0.2, 0.2, 0.2); m_fogColor = mgPoint3(0.8, 0.8, 0.8); m_fogMaxDist = 13000.0; m_fogTopHeight = 2000.0; // WATER_LEVEL + 128.0;// m_fogMaxDist; m_fogBotHeight = WATER_LEVEL; m_fogBotInten = 1.0; m_fogTopInten = 0.8; m_sky = new StarrySky(m_options); m_sky->setFogInten(m_fogBotInten, m_fogTopInten); m_sky->setMoonDir(m_lightDir); m_sky->setSunDir(m_lightDir); setDayLight(true); m_maxCount = 0; // number of terrain chunks in use // generate the initial terrain for (int x = 0; x <= 2; x++) { for (int z = 0; z <= 2; z++) { Terrain* chunk = new Terrain( (x-1) * HORIZON_SIZE - HORIZON_SIZE/2, (z-1) * HORIZON_SIZE - HORIZON_SIZE/2, HORIZON_SIZE, HORIZON_SIZE); chunk->createHeightmap(); m_terrain[x][z] = chunk; } } // subdivide terrain around the eye checkTerrainResolution(); m_mapView = false; m_terrainGrid = GRID_TERRAIN; m_mapGrid = GRID_CHUNKS; m_eyeHeight = 1.75; m_eyePt = mgPoint3(7012.1, 358.22, -6287.94); // nice area for initial coordinate double ht = Terrain::heightAtPt(m_eyePt.x, m_eyePt.z); ht = max(ht, WATER_LEVEL); m_eyePt.y = ht + m_eyeHeight; m_eyeRotX = 4.4; m_eyeRotY = 2.84; m_eyeRotZ = 0.0; // init threads m_threadCount = m_options.getInteger("threadCount", 1); m_buildLock = mgOSLock::create(); m_shutdown = false; if (m_threadCount > 0) { m_buildEvent = mgOSEvent::create(); m_buildThreads = mgOSThread::create(m_threadCount, buildThreadProc, mgOSThread::PRIORITY_LOW, this, NULL); } }
void UIStorageScene::onEnter() { CustomUI::onEnter(); setUI(); }