MainWindow::MainWindow(QWidget * parent) : QMainWindow(parent) { setupUi(); connectSignals(); setupModels(); }
void DlgContractors::remove() { if (!ui->tableView->currentIndex().isValid()) return; int row = ui->tableView->currentIndex().row(); if (QMessageBox::warning(this,"Remove Article",tr("Удалить контрагента? "), QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) { QSqlQuery sql; sql.exec(QString("DELETE FROM contractor WHERE co_id = %1").arg( proxyModel->data(proxyModel->index(ui->tableView->currentIndex().row(),0)).toInt())); if (sql.lastError().isValid()) { QMessageBox::warning(this,"Remove Contractor",sql.lastError().text()); return; } setupModels(); row = row <= proxyModel->rowCount()-1 ? row : proxyModel->rowCount()-1; ui->tableView->setCurrentIndex(proxyModel->index(row,1)); ui->tableView->setFocus(); } }
/* Update model caches after basket assignement. */ void resetModel() { remainingNotional_ = basket_->remainingNotional(); attachRatio_ = basket_->remainingAttachmentAmount() /remainingNotional_; detachRatio_ = basket_->remainingDetachmentAmount() /remainingNotional_; basketAttach_ = boost::shared_ptr<Basket>(new Basket(basket_->refDate(),basket_->remainingNames(), basket_->remainingNotionals(), basket_->pool(), 0.0, attachRatio_, basket_->claim() )); basketDetach_ = boost::shared_ptr<Basket>(new Basket(basket_->refDate(),basket_->remainingNames(), basket_->remainingNotionals(), basket_->pool(), 0.0, detachRatio_, basket_->claim() )); setupModels(); }
MainWindow::MainWindow(Document *document, QWidget* parent): QMainWindow(parent), Ui::MainWindow(), document(document), current_selected_font_collection(0) { settings = new Settings(this); Ui::MainWindow::setupUi(this); setupModels(); setupUi(); hideOptionalUi(); loadStandardFontSizes(); connectUi(); loadSettings(); translator = new QTranslator(this); reloadTranslations(); #ifdef Q_OS_MAC osx::MenuBar::generate(this); #endif if (not settings->donated()) showDonationDialog(); LOG("System font paths:"); foreach(QString system_font_path, systemFontPaths) { LOG(system_font_path.toStdString()); }
TreeScreen::TreeScreen(QWidget *parent) : QWidget(parent) { setupActions(); setupUI(); setupModels(); setupSignals(); assembly(); }
FindTableWidget::FindTableWidget(QWidget *parent) : QWidget(parent) { setupUI(); setupModels(); setupSignals(); assembly(); clearAll(); }
int daBalboa_c::onCreate() { setupModels(); this->scale = (Vec){1.0, 1.0, 1.0}; this->isBigBoss = (this->settings >> 28); ActivePhysics::Info HitMeBaby; HitMeBaby.xDistToCenter = 0.0; HitMeBaby.yDistToCenter = 27.0; HitMeBaby.xDistToEdge = 18.0; HitMeBaby.yDistToEdge = 24.0; HitMeBaby.category1 = 0x3; HitMeBaby.category2 = 0x0; HitMeBaby.bitfield1 = 0x4F; HitMeBaby.bitfield2 = 0xFFBAFFFE; HitMeBaby.unkShort1C = 0; HitMeBaby.callback = &balbieCollisionCallback; this->aPhysics.initWithStruct(this, &HitMeBaby); this->aPhysics.addToList(); ActivePhysics::Info spikeInfo = { 0.0f, 0.0f, 16.0f, 16.0f, 3, 0, 0x4F, 0xFFBAFFFE, 0, &dEn_c::collisionCallback}; spikeCollision.initWithStruct(this, &spikeInfo); spikeCollision.trpValue0 = 0.0f; spikeCollision.trpValue1 = 0.0f; spikeCollision.trpValue2 = -16.0f; spikeCollision.trpValue3 = 16.0f; spikeCollision.collisionCheckType = 3; this->rot.x = 0; // X is vertical axis this->rot.y = 0xE000; // Y is horizontal axis this->rot.z = 0; // Z is ... an axis >.> this->upsideDown = 0; this->direction = 0; // Heading left. this->pos.z = -800.0; this->pos.y -= 8.0; this->damage = 3; this->isRevenging = 0; this->PopUp[0] = (Vec){this->pos.x, this->pos.y - 54.0f, this->pos.z}; this->PopUp[1] = (Vec){this->pos.x - 224.0f, this->pos.y - 54.0f, this->pos.z}; this->PopUp[2] = (Vec){this->pos.x - 112.0f, this->pos.y - 22.0f, this->pos.z}; this->PopUp[3] = (Vec){this->pos.x - 112.0f, this->pos.y - 22.0f, this->pos.z}; doStateChange(&StateID_Grow); this->onExecute(); return true; }
OptionsDialog::OptionsDialog(ModelsRepository * provider, QWidget *parent) : QDialog(parent), ui(new Ui::OptionsDialog), _modelsProvider(provider) { ui->setupUi(this); setupModels(); setupConnections(); setupGeneralSettings(); ui->pageSelectionWidget->setCurrentRow(0); ui->buttonBox->button(QDialogButtonBox::Apply)->setEnabled(false); }
void DlgContractors::insert() { DlgEditContractor *dlg = new DlgEditContractor(this); if (dlg->exec() == QDialog::Accepted) { setupModels(); setCurrentIndex(dlg->id()); ui->tableView->setFocus(); } delete dlg; }
DbManager::DbManager() : QObject() { closingAll = false; nconn = 0; m_driverModel = new QStandardItemModel(this); m_model = new QStandardItemModel(this); lastUsedDbIndex = 0; setupConnections(); setupModels(); openList(); }
ResourceBrowser::ResourceBrowser() : KXmlGuiWindow() { Nepomuk::ResourceManager::instance()->init(); setWindowTitle(i18n("Resource Browser")); setWindowIcon(KIcon("nepomuk")); buildCentralUI(); setupDockWidgets(); setupActions(); setupModels(); populateDefaultResources(); setupGUI(); }
Document::Document(QObject *parent): QObject(parent), groups(NULL), people(NULL), albums(NULL), photo_import(NULL), person_photos(NULL), people_with_photos(NULL), photographed_people(NULL) { filesystemWatchers(); setupModels(); setupProxyModels(); connectModels(); }
DlgEditStorageLimit::DlgEditStorageLimit(QWidget *parent) : QDialog(parent), ui(new Ui::DlgEditStorageLimit) { ui->setupUi(this); idModel = new QSqlQueryModel(this); limitModel = new QStandardItemModel(this); typeModel = new QStandardItemModel(this); setupModels(); connect(ui->cmbType, SIGNAL(currentIndexChanged(int)), SLOT(setupModelId())); }
void DlgContractors::edit() { if (!ui->tableView->currentIndex().isValid()) return; DlgEditContractor *dlg = new DlgEditContractor(this); if (dlg->exec(proxyModel->data(proxyModel->index(ui->tableView->currentIndex().row(),0)).toInt() ) == QDialog::Accepted) { setupModels(); setCurrentIndex(dlg->id()); ui->tableView->setFocus(); } delete dlg; }
DlgContractors::DlgContractors(QWidget *parent) : QDialog(parent), ui(new Ui::DlgContractors) { ui->setupUi(this); typeModel = new TypeContractorModel(this); organizationModel = new QSqlQueryModel(this); model = new QSqlQueryModel(this); proxyModel = new QSortFilterProxyModel(this); proxyModel->setSourceModel(model); ui->tableView->setModel(proxyModel); setupModels(); setupColumns(); setWindowTitle(tr("Контрагенты")); connect(ui->btnInsert,SIGNAL(clicked()),SLOT(insert())); connect(ui->btnEdit,SIGNAL(clicked()),SLOT(edit())); connect(ui->btnRemove,SIGNAL(clicked()),SLOT(remove())); connect(ui->tableView,SIGNAL(doubleClicked(QModelIndex)),SLOT(edit())); acInsert = new QAction(tr("Добавить"),this); connect(acInsert,SIGNAL(triggered()),SLOT(insert())); acInsert->setShortcut(Qt::Key_Insert); acEdit = new QAction(tr("Изменить"),this); connect(acEdit,SIGNAL(triggered()),SLOT(edit())); acEdit->setShortcut(Qt::Key_Return); acRemove = new QAction(tr("Удалить"),this); connect(acRemove,SIGNAL(triggered()),SLOT(remove())); acRemove->setShortcut(Qt::Key_Delete); ui->tableView->addAction(acInsert); ui->tableView->addAction(acEdit); ui->tableView->addAction(acRemove); }
int daRamboo_c::onCreate() { setupModels(); this->scale = (Vec){2.0, 2.0, 2.0}; this->aPhysics.collisionCheckType = 1; ActivePhysics::Info HitMeBaby; HitMeBaby.xDistToCenter = 160.0; HitMeBaby.yDistToCenter = 80.0; HitMeBaby.xDistToEdge = 132.0; HitMeBaby.yDistToEdge = 132.0; HitMeBaby.category1 = 0x3; HitMeBaby.category2 = 0x0; HitMeBaby.bitfield1 = 0x4F; HitMeBaby.bitfield2 = 0x80222; HitMeBaby.unkShort1C = 0; HitMeBaby.callback = &dEn_c::collisionCallback; this->aPhysics.initWithStruct(this, &HitMeBaby); this->aPhysics.addToList(); this->Baseline = this->pos.y; this->rot.x = 0; // X is vertical axis this->rot.y = 0xE000; // Y is horizontal axis this->rot.z = 0; // Z is ... an axis >.> this->direction = 0; // Heading left. this->Hiding = 1; this->dying = 0; this->speed.x = 0.0; this->ytimer = 0; this->pos.z = 3300.0; char eventNum = (this->settings >> 16) & 0xFF; this->eventFlag = (u64)1 << (eventNum - 1); nw4r::g3d::ResAnmChr anmChr = this->resFile.GetResAnmChr("fog"); this->anmFog.bind(&this->fogModel, anmChr, 1); this->fogModel.bindAnim(&this->anmFog, 0.0); this->anmFog.setUpdateRate(1.0); nw4r::g3d::ResAnmTexSrt anmSrt = this->resFile.GetResAnmTexSrt("fog"); //bindEntry(mdl_c* model, ResAnmTexSrt anmSrt, int which, int playState?); this->fogSrt.bindEntry(&this->fogModel, anmSrt, 0, 1); this->fogModel.bindAnim(&this->fogSrt, 1.0); //setFrameForEntry(float frame, int which); this->fogSrt.setFrameForEntry(1.0, 0); //setUpdateRateForEntry(float rate, int which); this->fogSrt.setUpdateRateForEntry(1.0, 0); doStateChange(&StateID_Grow); this->onExecute(); return true; }
// react to base correl surface notifications (quotes or reference date) void update() { setupModels(); // tell basket to notify instruments, etc, we are invalid if(!basket_.empty()) basket_->notifyObservers(); }
SkeletalAnimation::SkeletalAnimation(Ogre::SceneManager* mSceneMgr) : NUM_MODELS(6), ANIM_CHOP(8) { mSceneManager = mSceneMgr; setupModels(); }