MainWindow::MainWindow(QWidget *parent):QMainWindow(parent),ui(new Ui::MainWindow) { ui->setupUi(this); ui->label_GenerationTime->setText("Current Generation Time: 00:00:00"); ui->progressBar->setValue(0); ui->progressBar->setAlignment(Qt::AlignRight); ui->list_LevelSet->setContextMenuPolicy(Qt::CustomContextMenu); ui->lineEdit_GeneratorSeed->setValidator(new QIntValidator(0,999999999,this)); ui->lineEdit_GeneratorSeed->setText(0000000000); ui->spin_TimeLimit->setValue(1.00); connect(&Generator, SIGNAL(changeProgressBar(float)), this, SLOT(changeProgressBar(float))); connect(&Generator, SIGNAL(addToList(int)), this, SLOT(addToList(int))); connect(&Generator, SIGNAL(regenFinished(int)), this, SLOT(displayLevel(int))); connect(&Generator, SIGNAL(regenFinished(int)), this, SLOT(displayLevelGenTime(int))); connect(&thread, SIGNAL(finished()), this, SLOT(stopTimer())); connect(&timer, SIGNAL(timeout()), this, SLOT(updateTimer())); connect(&Generator, SIGNAL(resetGUI()), this, SLOT(resetGUI())); connect(ui->list_LevelSet, SIGNAL(currentRowChanged(int)), this, SLOT(displayLevel(int))); connect(ui->combo_RoomH, SIGNAL(currentTextChanged(QString)), this, SLOT(disable3by3(QString))); connect(ui->combo_RoomW, SIGNAL(currentTextChanged(QString)), this, SLOT(disable3by3(QString))); connect(ui->list_LevelSet, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(rightClickMenu(QPoint))); connect(&Generator, SIGNAL(displayGenSeed()), this, SLOT(displayGenSeed())); scene = new QGraphicsScene(this); ui->graphicsView->setScene(scene); Generator.setupForThread(thread); Generator.moveToThread(&thread); }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); // ui->tableWidget->resizeColumnsToContents(); myDB = new db(); // qDebug()<< myDB->setClass("呆扳手","8-10"); // qDebug()<< myDB->setClass("呆扳手","9-11"); // qDebug()<<myDB->getEtalon("呆扳手"); // detail myDetail = {0,3,"2014.06.18",3,4,5,6,7,8,9,10}; // qDebug()<< myDB->setDetail(myDetail); // qDebug()<< myDB->updateDetail((detail){0,3,"2014.06.18",44,4,5,6,7,8,9,10}); // qDebug()<< myDB->getDetail(1).at(0).date; // ui->namesComboBox->addItems(myDB->getAllName()); // changeEtalon(ui->namesComboBox->currentText()); // QObject::connect(ui->tableWidget,SIGNAL(changeSize(int,int)),this,SLOT(resetWindowsSize(int,int))); QObject::connect(ui->namesComboBox,SIGNAL(currentTextChanged(QString)),this,SLOT(changeEtalon(QString))); QObject::connect(ui->etalonComboBox,SIGNAL(currentTextChanged(QString)),this,SLOT(on_serachButton_clicked())); QObject::connect(ui->tableWidget,SIGNAL(itemChanged(QTableWidgetItem*)),this,SLOT(addWare(QTableWidgetItem*))); ui->namesComboBox->addItems(myDB->getAllName()); ui->tableWidget->installEventFilter(this); // qDebug()<<"get details by name:"<<myDB->getDetailsByName("呆扳手").length(); // ui->tableWidget->setRowCount(1); // ui->tableWidget->setItem(0,0,new QTableWidgetItem(QString("2221"))); }
void eaps8000UsbUICharWindow::connectUiElements() { connect( _ui->btn_emergencyStop, SIGNAL( clicked() ), this, SLOT( emergencyStop() ) ); connect( _ui->cob_setValue, SIGNAL( currentTextChanged( QString ) ), this, SLOT( setValueSelectionChanged() ) ); connect( _ui->cob_unit, SIGNAL( currentTextChanged( QString ) ), this, SLOT( updateUnitRange() ) ); connect( _ui->chb_calcValues, SIGNAL( stateChanged( int ) ), this, SLOT( fixStepSizeChanged() ) ); connect( _ui->dsb_fromValue, SIGNAL( valueChanged( double ) ), this, SLOT( calculateRemainingTicks() ) ); connect( _ui->dsb_toValue, SIGNAL( valueChanged( double ) ), this, SLOT( calculateRemainingTicks() ) ); connect( _ui->dsb_stepSize, SIGNAL( valueChanged( double ) ), this, SLOT( calculateRemainingTicks() ) ); connect( _ui->spb_repeat, SIGNAL( valueChanged( int ) ), this, SLOT( calculateRemainingTicks() ) ); connect( _ui->chb_loop, SIGNAL( stateChanged( int ) ), this, SLOT( calculateRemainingTicks() ) ); connect( _ui->btn_connect, SIGNAL( clicked() ), this, SLOT( connectivityButtonPressed() ) ); connect( _ui->btn_startStop, SIGNAL( clicked() ), this, SLOT( startStop() ) ); connect( _ui->btn_resetInfo, SIGNAL( clicked() ), this, SLOT( resetInfo() ) ); }
void ViMainCorrelationWidget::updateCorrelators() { QObject::disconnect(mUi->correlatorComboBox, SIGNAL(currentTextChanged(QString)), mUi->correlationWidget, SLOT(changeCorrelator(QString))); mUi->scrollArea->show(); // Table must be visible before setting the data, in order to resize properly mUi->correlatorContainer->show(); ViAudioObjectQueue objects = mObjects; if(objects.isEmpty()) objects = mUi->projectLoader->objects(); QSet<QString> correlators; ViCorrelationGroups correlations; QStringList keys; for(int i = 0; i < objects.size(); ++i) { correlations = objects[i]->correlations(); for(int j = 0; j < correlations.size(); ++j) { keys = correlations[j].correlators(); for(int k = 0; k < keys.size(); ++k) { correlators.insert(ViName::formatName(keys[k], "", true)); } } } mUi->correlatorComboBox->clear(); mUi->correlatorComboBox->addItems(correlators.toList()); mUi->correlatorComboBox->setCurrentText(ViCorrelatorManager::defaultName()); QObject::connect(mUi->correlatorComboBox, SIGNAL(currentTextChanged(QString)), mUi->correlationWidget, SLOT(changeCorrelator(QString))); mUi->correlationWidget->changeCorrelator(mUi->correlatorComboBox->currentText()); }
Arduino::Arduino(QWidget *parent) : QDialog(parent), ui(new Ui::Arduino) { ui->setupUi(this); setWindowIcon(QIcon(":/icon")); arduino = new QSerialPort(this); baudRateList << "1200" << "2400" << "4800" << "9600" << "19200" << "38400" << "57600" << "115200"; ports = QSerialPortInfo::availablePorts(); QListIterator <QSerialPortInfo> iter(ports); QListIterator <QString> baudIter(baudRateList); while (iter.hasNext()){ ui->comportBox->addItem(iter.next().portName()); } while (baudIter.hasNext()){ ui->baudrateBox->addItem(baudIter.next()); } ui->baudrateBox->setCurrentText("9600"); connect(ui->comportBox, SIGNAL(currentTextChanged(QString)), this, SLOT(setPortName())); connect(ui->baudrateBox, SIGNAL(currentTextChanged(QString)),this, SLOT(setBaudRate())); connect(ui->connectButton, SIGNAL(clicked()), this, SLOT(connectArduino())); connect(ui->forwardButton, SIGNAL(pressed()), this, SLOT(forward())); connect(ui->backwardButton, SIGNAL(pressed()), this, SLOT(backward())); connect(ui->leftButton, SIGNAL(pressed()), this, SLOT(left())); connect(ui->rightButton, SIGNAL(pressed()), this, SLOT(right())); connect(ui->stopButton, SIGNAL(clicked()), this, SLOT(stop())); connect(ui->forwardButton, SIGNAL(released()), this, SLOT(stop())); connect(ui->leftButton, SIGNAL(released()), this, SLOT(stop())); connect(ui->rightButton, SIGNAL(released()), this, SLOT(stop())); connect(ui->backwardButton, SIGNAL(released()), this, SLOT(stop())); ui->statusLabel->setText("Connect BT Module"); arduino->setPortName(currentPort); ui->speedLabel->setText("Running at default speed: 230"); }
Figure2D::Figure2D(QWidget *parent) : QGraphicsView(parent), lbProjX(new QLabel("xlabelhere",this)), lbProjY(new QLabel("ylabelhere",this)) { setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform); // Create a new scene setScene(new VibesScene2D(this)); this->scale(1.0, -1.0); this->show(); setDragMode(ScrollHandDrag); // Force full viewport update (avoid problems with axes) setViewportUpdateMode(FullViewportUpdate); // Never show the scrollbars setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); // Keep the view centered when resizing window setResizeAnchor(AnchorViewCenter); lbProjX->setAlignment(Qt::AlignRight); lbProjX->move(width()-50, 0); lbProjX->setSizePolicy(QSizePolicy::Ignored,QSizePolicy::Ignored); lbProjX->resize(100, 20); lbProjX->installEventFilter(this); lbProjX->show(); lbProjY->move(5, 15); lbProjY->setSizePolicy(QSizePolicy::Ignored,QSizePolicy::Ignored); lbProjY->resize(100, 20); lbProjY->installEventFilter(this); lbProjY->show(); cbProjX = new QComboBox(lbProjX); cbProjX->setMaximumSize(lbProjX->size()); connect(cbProjX, SIGNAL(currentTextChanged(QString)), lbProjX, SLOT(setText(QString))); connect(cbProjX, SIGNAL(currentIndexChanged(QString)), lbProjX, SLOT(setText(QString))); for (int i=0; i<3; ++i) cbProjX->addItem(QString("x: dim %1").arg(i), i); cbProjX->setCurrentIndex(scene()->dimX()); //cbProjX->installEventFilter(this); connect(cbProjX, SIGNAL(currentIndexChanged(int)), scene(), SLOT(setDimX(int))); connect(scene(), SIGNAL(changedDimX(int)), cbProjX, SLOT(setCurrentIndex(int))); cbProjY = new QComboBox(lbProjY); cbProjY->setMaximumSize(lbProjY->size()); connect(cbProjY, SIGNAL(currentTextChanged(QString)), lbProjY, SLOT(setText(QString))); connect(cbProjY, SIGNAL(currentIndexChanged(QString)), lbProjY, SLOT(setText(QString))); for (int i=0; i<3; ++i) cbProjY->addItem(QString("y: dim %1").arg(i), i); cbProjY->setCurrentIndex(scene()->dimY()); //cbProjY->installEventFilter(this); connect(cbProjY, SIGNAL(currentIndexChanged(int)), scene(), SLOT(setDimY(int))); connect(scene(), SIGNAL(changedDimY(int)), cbProjY, SLOT(setCurrentIndex(int))); connect(scene(), SIGNAL(dimensionsChanged()), this, SLOT(refreshProjectionSelectors())); }
void WeatherParamSetupWidget::onAirportChanged(int index){ disconnect(planeNameComboBox, SIGNAL(currentTextChanged(QString)), this, SLOT(onPlaneNameChanged(QString))); planeNameComboBox->clear(); Airport airport = airportList[index]; QStringList planeNameList = airport.planeName().split(",", QString::SkipEmptyParts); planeNameComboBox->addItems(planeNameList); connect(planeNameComboBox, SIGNAL(currentTextChanged(QString)), this, SLOT(onPlaneNameChanged(QString))); this->onPlaneNameChanged(planeNameList[0]); }
void BehaviorReferenceGeneratorUI::toggleSignals(bool toggleconnections){ if (toggleconnections){ connect(name, SIGNAL(textEdited(QString)), this, SLOT(setName(QString)), Qt::UniqueConnection); connect(behaviorName, SIGNAL(currentTextChanged(QString)), this, SLOT(setBehaviorName(QString)), Qt::UniqueConnection); }else{ disconnect(name, SIGNAL(textEdited(QString)), this, SLOT(setName())); disconnect(behaviorName, SIGNAL(currentTextChanged(QString)), this, SLOT(setBehaviorName(QString))); } }
StatisticsWidget::StatisticsWidget(User* user, QWidget* parent) : QWidget(parent), ui(new Ui::StatisticsWidget), _user(user) { ui->setupUi(this); ui->fromDTE->setDate(QDateTime::currentDateTime().addDays(-1).date()); ui->toDTE->setDate(QDateTime::currentDateTime().addDays(1).date()); connect(ui->viewCB, SIGNAL(currentTextChanged(QString)), this, SLOT(renderData())); connect(ui->groupByCB, SIGNAL(currentTextChanged(QString)), this, SLOT(renderData())); connect(ui->fromDTE, SIGNAL(editingFinished()), this, SLOT(renderData())); connect(ui->toDTE, SIGNAL(editingFinished()), this, SLOT(renderData())); renderData(); }
SessionWizard::SessionWizard(Session *session, Class *cl, QWidget *parent, Qt::WindowFlags f): QDialog(parent, f) { setupUi(this); QObject::connect(btnMatch, SIGNAL(released()), this, SLOT(match())); QObject::connect(btnSplit, SIGNAL(released()), this, SLOT(split())); twMatchedPairs->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); twMatchedPairs->horizontalHeader()->hide(); twMatchedPairs->verticalHeader()->hide(); QObject::connect(lwSessionStudents, SIGNAL(currentTextChanged(QString)), this, SLOT(toggleMatchEnabled())); QObject::connect(lwClassStudents, SIGNAL(currentTextChanged(QString)), this, SLOT(toggleMatchEnabled())); QObject::connect(twMatchedPairs, SIGNAL(currentItemChanged(QTableWidgetItem *, QTableWidgetItem *)), this, SLOT(toggleSplitEnabled())); toggleMatchEnabled(); toggleSplitEnabled(); lblSessionName->setText(QString("%1 - %2").arg(session->dateTimeToString()).arg(session->name())); lblClassName->setText(cl->name()); for (int i = 0; i < session->numStudents(); ++i) { QListWidgetItem *item = new QListWidgetItem(session->student(i)->name()); item->setData(Qt::UserRole, i); lwSessionStudents->addItem(item); } for (int i = 0; i < cl->numMembers(); ++i) { QListWidgetItem *item = new QListWidgetItem(cl->member(i)->name()); item->setData(Qt::UserRole, i); lwClassStudents->addItem(item); } QString str1; QString str2; bool found = false; for (int i = 0; i < lwSessionStudents->count();) { for (int j = 0; j < lwClassStudents->count();) { str1 = lwSessionStudents->item(i)->text().toLower().simplified(); str1.remove(" "); str2 = lwClassStudents->item(j)->text().toLower().simplified(); str2.remove(" "); if (str1 == str2) { lwSessionStudents->setCurrentRow(i); lwClassStudents->setCurrentRow(j); match(); found = true; break; } else { j++; } } if (!found) { i++; } else { found = false; } } }
void SerialConfigWindow::on_portNameComboBox_currentTextChanged(const QString & text) { if ( port->isOpen() ) { QMessageBox::warning(this,"incorrect operation", "you should close the active port first before switch port \n", QMessageBox::Ok, QMessageBox::Ok) ; portNameComboBox->disconnect(portNameComboBox,SIGNAL(currentTextChanged(QString)),this,SLOT(on_portNameComboBox_currentTextChanged(QString))); portNameComboBox->setCurrentText ( port->portName() ); portNameComboBox->connect(portNameComboBox,SIGNAL(currentTextChanged(QString)),this,SLOT(on_portNameComboBox_currentTextChanged(QString))); } else { port->setPortName(portNameComboBox->currentText()); } }
isis::viewer::ui::AboutDialog::AboutDialog ( QWidget *parent, isis::viewer::QViewerCore *core ) : QDialog ( parent ), m_ViewerCore( core ) { m_Interface.setupUi( this ); connect( m_Interface.authorsList, SIGNAL( currentTextChanged( QString ) ), this, SLOT( onAuthorClicked( QString ) ) ); connect( m_Interface.sendMailButton, SIGNAL( pressed() ), this, SLOT( sendEmailClicked() ) ); m_Interface.sendMailButton->setIcon( QIcon( ":/common/icon_email.gif" ) ); m_Interface.sendMailButton->setEnabled( false ); QPixmap pixMap( m_ViewerCore->getSettings()->getPropertyAs<std::string>( "vastSymbol" ).c_str() ); const float ratio = pixMap.height() / ( float )pixMap.width(); m_Interface.vastSymbolLabel->setPixmap( QPixmap( m_ViewerCore->getSettings()->getPropertyAs<std::string>( "vastSymbol" ).c_str() ).scaled( 200 / ratio , m_Interface.vastSymbolLabel->height(), Qt::KeepAspectRatio ) ); QPalette pal; pal.setColor( QPalette::Text, Qt::blue ); m_Interface.contactEdit->setPalette( pal ); m_authorMap["Erik Tuerke"] = std::string( "*****@*****.**" ); m_authorMap["Enrico Reimer"] = std::string( "*****@*****.**" ); }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); default_scale = 1; current_scale = 1; image.load(":/aliceA.png"); scaled = image; files_names = QStringList(); pImage_lbl = new QLabel(); pImage_lbl->setAlignment(Qt::AlignCenter); ui->imageArea->setWidget(pImage_lbl); ui->imageArea->setBackgroundRole(QPalette::NoRole); loadListOfFiles(); setAcceptDrops(true); connect(&interpret, SIGNAL(ready(QImage)), this, SLOT(updateImage(QImage))); connect(ui->gammaSlider, SIGNAL(sliderReleased()), this, SLOT(refreshGamma())); connect(ui->zoomSlider, SIGNAL(sliderReleased()), this, SLOT(scaleImage())); connect(ui->filesList, SIGNAL(itemSelectionChanged()), this, SLOT(restoreDefaultScale())); connect(ui->filesList, SIGNAL(currentTextChanged(QString)), this, SLOT(updateImage(QString))); updateImage("aliceA.png"); }
//VOXOX CHANGE by Rolando - 2009.05.11 - method called when lineedit lost focus void VoxOxToolTipLineEdit::leaveEvent ( QEvent * event ){ if (QLineEdit::text() == _toolTip || QLineEdit::text().isEmpty()) {//VOXOX CHANGE by Rolando - 2009.05.11 - if current text is equal to tooltip or is empty displayToolTipMessage(); } else{ int cursorPositionValue = cursorPosition();//VOXOX CHANGE by Rolando - 2009.06.02 - gets current Cursor Position int intSelectedStart = -1; QString stringText; if(hasSelectedText()){//VOXOX CHANGE by Rolando - 2009.06.02 - if there is selected text stringText = selectedText();//VOXOX CHANGE by Rolando - 2009.06.02 - gets selected text intSelectedStart = selectionStart();//VOXOX CHANGE by Rolando - 2009.06.02 - gets position where selection starts } if(_message == QLineEdit::text()){//VOXOX CHANGE by Rolando - 2009.05.11 - if current text is equal to _message then sets _shortMessage QLineEdit::setText(_shortMessage); } else{//VOXOX CHANGE by Rolando - 2009.05.11 - if current text is not equal to _message then updates _shortMessage and _message and then sets _shortMessage as current text updateMessageText(QLineEdit::text()); QLineEdit::setText(_shortMessage); } //VOXOX CHANGE by Rolando - 2009.10.13 if(intSelectedStart >= 0 && intSelectedStart + stringText.length() <= getMaximumCharsAllowed()){//VOXOX CHANGE by Rolando - 2009.06.02 - if there is a text selected setSelection(intSelectedStart, stringText.length());//VOXOX CHANGE by Rolando - 2009.06.02 - as we set the long message in lineedit, we need to set the text was selected } currentTextChanged(text()); } QLineEdit::leaveEvent(event); //changeFocusToParent();//VOXOX CHANGE by Rolando - 2009.05.22 - method to send focus to another widget when mouse leaves the lineedit }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); midi = new MistyMidi(); loadPortNames(); connect(ui->intputList, SIGNAL(currentTextChanged(QString)), midi, SLOT(input_changed(QString))); connect(midi, SIGNAL(send_message(QString)), this, SLOT(updatelog(QString))); ui->actionE_xit->setShortcut(QKeySequence::Quit); ui->synthList->setRowCount(1); ui->synthList->setItem(0, 0, new QTableWidgetItem("Piano", QTableWidgetItem::Type)); SynthSelector *combo = new SynthSelector(ui->synthList, outputs); ui->synthList->setCellWidget(0, 1, combo); QDir mididir ("MIDI"); if(mididir.exists()) { mididir.setFilter(QDir::Files | QDir::NoSymLinks); mididir.setNameFilters(QStringList("*.mid")); QFileInfoList files = mididir.entryInfoList(); for(int i=0; i<files.size(); i++) { ui->accompanimentList->addItem(files.at(i).fileName()); } } else { ui->accompanimentList->addItem(QString("Midi Directory %1 Not Found").arg(mididir.absolutePath())); } }
void MainWindow::setupSessionViewer() { SVSelectedSessionWidget->setEnabled(false); enableSVTools(); passMarkDetailsTab->setEnabled(false); scoringSystemTab->setEnabled(false); QObject::connect(SVLSListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem *)), this, SLOT(setCurrentSession(QListWidgetItem *))); QObject::connect(SVLASListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem *)), this, SLOT(setCurrentSession(QListWidgetItem *))); QObject::connect(SVLCListWidget, SIGNAL(currentTextChanged(QString)), this, SLOT(setCurrentStudent())); QObject::connect(SVLCListWidget, SIGNAL(itemClicked(QListWidgetItem *)), this, SLOT(showSelectedStudentTab())); QObject::connect(actionDelete_log, SIGNAL(triggered()), this, SLOT(deleteLog())); QObject::connect(actionArchive_session, SIGNAL(triggered()), this, SLOT(archiveSession())); QObject::connect(actionRestore_session, SIGNAL(triggered()), this, SLOT(restoreSession())); QObject::connect(actionCopy_to_archive, SIGNAL(triggered()), this, SLOT(copyToArchive())); QObject::connect(actionCopy_from_archive, SIGNAL(triggered()), this, SLOT(copyFromArchive())); QObject::connect(actionPrint_all, SIGNAL(triggered()), this, SLOT(printAll())); QObject::connect(actionPrint_session_summary, SIGNAL(triggered()), this, SLOT(printSessionSummary())); QObject::connect(SVLSSearchLineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(searchSVLS(const QString &))); QObject::connect(SVSearchDetailsLineEdit, SIGNAL(textChanged(QLineEdit *, const QString &)), SVPassMarkTableWidget, SLOT(filterItems(QLineEdit *, const QString &))); SVLSListWidget->setSortingEnabled(true); SVLASListWidget->setSortingEnabled(true); SVPassMarkTableWidget->horizontalHeader()->setResizeMode(0, QHeaderView::Stretch); SVPassMarkTableWidget->horizontalHeader()->setResizeMode(1, QHeaderView::ResizeToContents); SVPassMarkTableWidget->setEditTriggers(QAbstractItemView::NoEditTriggers); SVScoringSystemTableWidget->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents); SVScoringSystemTableWidget->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents); SVScoringSystemTableWidget->setEditTriggers(QAbstractItemView::NoEditTriggers); for (int i = 0; i < SVScoringSystemTableWidget->rowCount(); ++i) { SVScoringSystemTableWidget->setItem(i, 1, new QTableWidgetItem); } hideArchive(); }
void SearchBar::setCurrentIndex(int index) { m_lineEdit->setText(itemText(index)); emit currentTextChanged(m_lineEdit->text()); m_popupList->clearSelection(); m_menu->hide(); }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); if(initalized==false){ QPalette Pal(palette()); initalized=true; Pal.setColor(QPalette::Background, defaultcolor); ui->color_display->setAutoFillBackground(true); ui->color_display->setPalette(Pal); } //connect //display to control //QObject::connect(ui->AngleInput,SIGNAL(textChanged(QString)),ui->openGLWidget,SLOT(changeAngle(QString))); QObject::connect(ui->openGLWidget,SIGNAL(axiomRead(QString)),ui->Axiom,SLOT(setText(QString))); QObject::connect(ui->openGLWidget,SIGNAL(angleRead(QString)),ui->AngleInput,SLOT(setText(QString))); QObject::connect(ui->openGLWidget,SIGNAL(RuleRead(QString)),ui->RuleDIsplay,SLOT(setPlainText(QString))); QObject::connect(ui->openGLWidget,SIGNAL(iterationRead(int)),ui->Iteration_spinBox,SLOT(setValue(int))); QObject::connect(ui->openGLWidget,SIGNAL(RuleCalculated(QString)),ui->L_systemResult,SLOT(setPlainText(QString))); //control to display QObject::connect(ui->Axiom,SIGNAL(textEdited(QString)),ui->openGLWidget,SLOT(changeAxiom(QString))); QObject::connect(ui->AngleInput,SIGNAL(textEdited(QString)),ui->openGLWidget,SLOT(changeAngle(QString))); QObject::connect(ui->Iteration_spinBox,SIGNAL(valueChanged(int)),ui->openGLWidget,SLOT(changeIteration(int))); QObject::connect(ui->foceUpdateButton,SIGNAL(pressed()),ui->openGLWidget,SLOT(UpdateL_system())); QObject::connect(ui->FileSelector,SIGNAL(currentTextChanged(QString)),ui->openGLWidget,SLOT(ChangeTemplate(QString))); QObject::connect(ui->foceUpdateButton,SIGNAL(pressed()),ui->openGLWidget,SLOT(setFocus())); QObject::connect(this,SIGNAL(ColorChange(QColor)),ui->openGLWidget,SLOT(getChangedColor(QColor))); //this->setAttribute(Qt::WA_TranslucentBackground, true); }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), _ui(new Ui::MainWindow), _nextScene(QString::null) { _ui->setupUi(this); Camera* camera = new Camera; camera->set(config->defaultCameraVerticalFOV(), config->defaultCameraAspectRatio()); camera->setAperture(config->defaultCameraAperture()); camera->setFocalPlane(config->defaultCameraFocusPlane()); _ui->renderer->setCamera(camera); _setConfig(); _ui->sceneNames->addItems(sceneGenerator->scenes()); _ui->sceneNames->setCurrentIndex(0); logger->setConsole(_ui->console); logger->setStatusBar(_ui->statusBar); onLoadScene(); connect(_ui->action_Save, SIGNAL(triggered()), SLOT(onSaveImage())); connect(_ui->action_Play_Pause, SIGNAL(triggered()), SLOT(onPlayPause())); connect(_ui->action_Stop, SIGNAL(triggered()), SLOT(onStop())); connect(_ui->action_Reload, SIGNAL(triggered()), SLOT(onLoadScene())); connect(_ui->sceneNames, SIGNAL(currentIndexChanged(QString)), SLOT(onLoadScene())); connect(_ui->integrator, SIGNAL(currentTextChanged(QString)), SLOT(onIntegratorChanged())); connect(_ui->renderer, SIGNAL(renderingFinished()), SLOT(onRenderingFinished())); connect(_ui->renderer, SIGNAL(renderingStarted()), SLOT(onRenderingStarted())); connect(_ui->renderer, SIGNAL(clicked(Intersection)), SLOT(onClick(Intersection))); QTimer* progressTimer = new QTimer(this); connect(progressTimer, SIGNAL(timeout()), SLOT(onUpdateProgress())); progressTimer->start(35); }
void VoxOxToolTipLineEdit::keyPressEvent(QKeyEvent * event) { if (!_cleared) { clearLineEdit(); repaintPrimaryColor(); } if (event->key()==Qt::Key_Return || event->key()==Qt::Key_Enter) {//if key pressed was return or enter if(!QLineEdit::text().isEmpty()){ updateMessageText(QLineEdit::text()); QLineEdit::setText(_shortMessage); currentTextChanged(text()); } QLineEdit::keyPressEvent(event); changeFocusToParent();//VOXOX CHANGE by Rolando - 2009.05.22 - method to send focus to another widget when mouse leaves the lineedit } else{//if key pressed was not return or enter key int cursorPositionValue = cursorPosition();//VOXOX CHANGE by Rolando - 2009.06.02 - gets current Cursor Position bool isShortMessage = QLineEdit::text() == _shortMessage;//VOXOX CHANGE by Rolando - 2009.06.02 - we need to check if current text is equal to _shortMessage int intSelectedStart = -1; QString text; if(hasSelectedText()){//VOXOX CHANGE by Rolando - 2009.06.02 - if there is selected text text = selectedText();//VOXOX CHANGE by Rolando - 2009.06.02 - gets selected text intSelectedStart = selectionStart();//VOXOX CHANGE by Rolando - 2009.06.02 - gets position where selection starts } QLineEdit::setText(_message);//VOXOX CHANGE by Rolando - 2009.06.02 - sets long message if(intSelectedStart >= 0){//VOXOX CHANGE by Rolando - 2009.06.02 - if there is a text selected setSelection(intSelectedStart, text.length());//VOXOX CHANGE by Rolando - 2009.06.02 - as we set the long message in lineedit, we need to set the text was selected } else{ //VOXOX CHANGE by Rolando - 2009.06.02 - if there is not a text selected if(isShortMessage){//VOXOX CHANGE by Rolando - 2009.06.02 - if we had currentText equal to _shortMessage //VOXOX CHANGE by Rolando - 2009.10.13 if(cursorPositionValue == _shortMessage.length()){//VOXOX CHANGE by Rolando - 2009.06.02 - if cursor position is the rightest pos allowed setCursorPosition(_message.length());//VOXOX CHANGE by Rolando - 2009.06.02 - we move the cursor to rightest position after we changed the current text by _message } else{ //VOXOX CHANGE by Rolando - 2009.06.02 - if cursor position is not the rightest pos allowed setCursorPosition(cursorPositionValue);//VOXOX CHANGE by Rolando - 2009.06.02 - if cursor position is not the rightest pos allowed } } else{ //VOXOX CHANGE by Rolando - 2009.06.02 - if we had not currentText equal to _shortMessage setCursorPosition(cursorPositionValue);//VOXOX CHANGE by Rolando - 2009.06.02 - we move the cursor to old position + 1 } } QLineEdit::keyPressEvent(event);//processes event - it should be processed before update _shortMessage and _message variables updateMessageText(QLineEdit::text());//VOXOX CHANGE by Rolando - 2009.06.02 - we update the short and long messages } keyPressedSignal(event->key()); }
ComboBox::ComboBox(QGraphicsItem* parent) : QGraphicsProxyWidget(parent) { widget = new QComboBox; setWidget(widget); QObject::connect(widget, SIGNAL(currentIndexChanged(QString)), this, SIGNAL(currentTextChanged(QString))); }
void WeatherParamSetupWidget::initConnect(){ connect(airportComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(onAirportChanged(int))); connect(planeNameComboBox, SIGNAL(currentTextChanged(QString)), this, SLOT(onPlaneNameChanged(QString))); if(SharedMemory::isWelcome){ connect(previousButton, SIGNAL(clicked()), this, SIGNAL(previousClicked())); connect(nextButton, SIGNAL(clicked()), this, SIGNAL(nextClicked())); } }
PropertiesPane::PropertiesPane(QWidget *parent) : QWidget(parent), ui(new Ui::PropertiesPane), scene(NULL) { ui->setupUi(this); this->scene = (SceneWidget*)parent; this->root = scene->root; this->nameEdit.setEnabled(false); this->nameEdit.setFrame(false); this->xBox.setFrame(false); this->yBox.setFrame(false); this->widthBox.setFrame(false); this->heightBox.setFrame(false); this->visibleBox.setChecked(true); this->rowsBox.setValue(1); this->rowsBox.setFrame(false); this->rowsBox.setMinimum(1); this->colsBox.setValue(1); this->colsBox.setFrame(false); this->colsBox.setMinimum(1); this->xBox.setMinimum(-2000); this->xBox.setMaximum(2000); this->yBox.setMinimum(-2000); this->yBox.setMaximum(2000); this->widthBox.setMaximum(2000); this->heightBox.setMaximum(2000); this->scaleBox.setFrame(false); this->scaleBox.setValue(1.0000); this->scaleBox.setMaximum(1.0000); this->scaleBox.setDecimals(5); this->scaleBox.setSingleStep(0.00001); this->anchorxBox.setMinimum(-2000); this->anchorxBox.setMaximum(2000); this->anchoryBox.setMinimum(-2000); this->anchoryBox.setMaximum(2000); ui->tableWidget->setCellWidget(0,1,&nameEdit); ui->tableWidget->setCellWidget(1,1,&xBox); ui->tableWidget->setCellWidget(2,1,&yBox); ui->tableWidget->setCellWidget(3,1,&widthBox); ui->tableWidget->setCellWidget(4,1,&heightBox); ui->tableWidget->setCellWidget(5,1,&anchorxBox); ui->tableWidget->setCellWidget(6,1,&anchoryBox); ui->tableWidget->setCellWidget(7,1,&visibleBox); ui->tableWidget->setCellWidget(8,1,&rowsBox); ui->tableWidget->setCellWidget(9,1,&colsBox); ui->tableWidget->setCellWidget(10,1,&scaleBox); ui->tableWidget->setCellWidget(11,1,&parentBox); connect(&anchorxBox,SIGNAL(valueChanged(int)),this,SLOT(setSXanchor(int))); connect(&anchoryBox,SIGNAL(valueChanged(int)),this,SLOT(setSYanchor(int))); connect(&visibleBox,SIGNAL(clicked(bool)),this,SLOT(setSVisible(bool))); connect(&rowsBox,SIGNAL(valueChanged(int)),this,SLOT(setSRow(int))); connect(&colsBox,SIGNAL(valueChanged(int)),this,SLOT(setSCol(int))); connect(&scaleBox,SIGNAL(valueChanged(double)),this,SLOT(setSScale(double))); connect(&parentBox,SIGNAL(currentTextChanged(QString)),this,SLOT(setSParent(QString))); }
//! [9] void MainWindow::createDockWindows() { QDockWidget *dock = new QDockWidget(tr("Customers"), this); dock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); customerList = new QListWidget(dock); customerList->addItems(QStringList() << "John Doe, Harmony Enterprises, 12 Lakeside, Ambleton" << "Jane Doe, Memorabilia, 23 Watersedge, Beaton" << "Tammy Shea, Tiblanka, 38 Sea Views, Carlton" << "Tim Sheen, Caraba Gifts, 48 Ocean Way, Deal" << "Sol Harvey, Chicos Coffee, 53 New Springs, Eccleston" << "Sally Hobart, Tiroli Tea, 67 Long River, Fedula"); dock->setWidget(customerList); addDockWidget(Qt::RightDockWidgetArea, dock); viewMenu->addAction(dock->toggleViewAction()); dock = new QDockWidget(tr("Paragraphs"), this); paragraphsList = new QListWidget(dock); paragraphsList->addItems(QStringList() << "Thank you for your payment which we have received today." << "Your order has been dispatched and should be with you " "within 28 days." << "We have dispatched those items that were in stock. The " "rest of your order will be dispatched once all the " "remaining items have arrived at our warehouse. No " "additional shipping charges will be made." << "You made a small overpayment (less than $5) which we " "will keep on account for you, or return at your request." << "You made a small underpayment (less than $1), but we have " "sent your order anyway. We'll add this underpayment to " "your next bill." << "Unfortunately you did not send enough money. Please remit " "an additional $. Your order will be dispatched as soon as " "the complete amount has been received." << "You made an overpayment (more than $5). Do you wish to " "buy more items, or should we return the excess to you?"); dock->setWidget(paragraphsList); addDockWidget(Qt::RightDockWidgetArea, dock); viewMenu->addAction(dock->toggleViewAction()); connect(customerList, SIGNAL(currentTextChanged(QString)), this, SLOT(insertCustomer(QString))); connect(paragraphsList, SIGNAL(currentTextChanged(QString)), this, SLOT(addParagraph(QString))); }
void KCompletionBox::slotItemClicked( QListWidgetItem *item ) { if ( item ) { hide(); emit currentTextChanged( item->text() ); emit activated( item->text() ); } }
void OptConstraintDialog::setupDialog(){ uiOptConstraint->setupUi(this); this->setWindowTitle("Optimizer – Constraints"); setToolTips(); uiOptConstraint->optConChangeNameEdit->setPlaceholderText("Constraint name"); connect(uiOptConstraint->optConstraintListWidget,SIGNAL(currentTextChanged(QString)), uiOptConstraint->optConItemSelectedLabel,SLOT(setText(QString))); //connect(uiOptConstraint->optConstraintListWidget,SIGNAL(currentTextChanged(QString)), uiOptConstraint->optConChangeNameEdit, SLOT(setText(QString))); initializeConPropertiesDialog(); }
FilterDialog::FilterDialog( QWidget *parent ) : QDialog( parent ) { ui.setupUi( this ); ui.originalLabel->setPixmap( QPixmap( "source.jpeg" ) ); connect( ui.filterList, SIGNAL(currentTextChanged(QString)), this, SLOT(filterChanged(QString)) ); findFilters(); filterChanged( QString() ); }
WizardPageChoix::WizardPageChoix(QStringList choix, QWidget *parent) : QWizardPage(parent), ui(new Ui::WizardPageChoix) { ui->setupUi(this); ui->comboBox->clear(); ui->comboBox->addItems(choix); connect(ui->comboBox, SIGNAL(currentTextChanged(QString)), this, SLOT(change(QString))); }
void eaps8000UsbWindow::connectUiElements() { connect( _ui->btn_emergencyStop, SIGNAL( clicked() ), this, SLOT( emergencyStop() ) ); connect( _ui->cob_measuredValues, SIGNAL( currentTextChanged( QString ) ), this, SLOT( visibilitySelectionChanged() ) ); connect( _ui->cob_setValue, SIGNAL( currentTextChanged( QString ) ), this, SLOT( setValueSelectionChanged() ) ); connect( _ui->cob_setValueUnit, SIGNAL( currentTextChanged( QString ) ), this, SLOT( updateUnitRange() ) ); connect( _ui->btn_connect, SIGNAL( clicked() ), this, SLOT( connectivityButtonPressed() ) ); connect( _ui->btn_setValue, SIGNAL( clicked() ), this, SLOT( setValue() ) ); connect( _ui->btn_measuredValuesVisibility, SIGNAL( clicked() ), this, SLOT( changeVisibility() ) ); connect( _ui->btn_resetInfo, SIGNAL( clicked() ), this, SLOT( resetInfo() ) ); }
addClass::addClass(db* myDB, QWidget *parent) : QDialog(parent), ui(new Ui::addClass), myDB1(myDB) { ui->setupUi(this); QObject::connect(ui->namesComboBox,SIGNAL(currentTextChanged(QString)),this,SLOT(changeEtalon(QString))); ui->namesComboBox->addItems(myDB1->getAllName()); }