ProjectOperationHandler::ProjectOperationHandler(QQmlApplicationEngine* engine, QWidget* parent) : m_engine{ engine } , m_parent{ parent } , m_projectName{ "" } , m_projectLocation{ "" } { QObject* rootObject = m_engine->rootObjects().first(); QObject* createProjectSlide = rootObject->findChild<QObject*>("createProjectMainIdName"); m_createProjectForm = rootObject->findChild<QObject*>("createProjectForm"); QObject::connect( m_createProjectForm, SIGNAL(nameChanged(QString)), this, SLOT(nameChanged(QString))); QObject::connect( m_createProjectForm, SIGNAL(locationChanged(QString)), this, SLOT(locationChanged(QString))); QObject::connect( m_createProjectForm, SIGNAL(browseClicked()), this, SLOT(browseClicked())); QObject::connect( m_createProjectForm, SIGNAL(cancelClicked()), this, SLOT(cancelClicked())); QObject::connect( m_createProjectForm, SIGNAL(createClicked()), this, SLOT(createClicked())); QObject* form = m_createProjectForm->findChild<QObject*>("projectLocationInput"); form->setProperty("text", QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)); QObject* mainPageForm = rootObject->findChild<QObject*>("mainPageForm", Qt::FindChildrenRecursively); QObject::connect(mainPageForm, SIGNAL(openProjectLocation(QString, QString)), this, SLOT(openProject(QString, QString))); }
RocketFtpDialog::RocketFtpDialog(RocketImageList *list, QWidget *parent) : QDialog(parent) { images = list; setupUi(this); statusBar = new QStatusBar(this); statusBar->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); statusBar->setSizeGripEnabled(false); progressBar = new QProgressBar(statusBar); progressBar->setTextVisible(false); new QHBoxLayout(progressBar); progressBar->layout()->setMargin(0); statusLabel = new QLabel("Ready.", progressBar); statusLabel->setAlignment(Qt::AlignLeft|Qt::AlignVCenter); progressBar->layout()->addItem(new QSpacerItem(5, 5)); progressBar->layout()->addWidget(statusLabel); statusBar->addWidget(progressBar, 1); layout()->addWidget(statusBar); connect(btnUpload, SIGNAL(clicked()), SLOT(uploadClicked())); connect(btnClose, SIGNAL(clicked()), SLOT(closeClicked())); connect(btnBrowse, SIGNAL(clicked()), SLOT(browseClicked())); linPort->setValidator(new QIntValidator(0, 65535, linPort)); QSettings settings; settings.beginGroup("ftp"); linAddress->setText(settings.value("address", "").toString()); linPort->setText(settings.value("port", "21").toString()); linUsername->setText(settings.value("username", "").toString()); linPassword->setText(settings.value("password", "").toString()); linLocation->setText(settings.value("location", "").toString()); }
/** * Constructor. * @param parent the parent (wizard) of this wizard page */ CodeGenOptionsPage::CodeGenOptionsPage(QWidget *parent) : QWizardPage(parent) { setTitle(i18n("Code Generation Options")); setSubTitle(i18n("Adjust code generation options.")); setupUi(this); m_pCodePolicyPage = 0; m_parentPolicy = UMLApp::app()->commonPolicy(); CodeGenerator* gen = UMLApp::app()->generator(); ui_forceDoc->setChecked(m_parentPolicy->getCodeVerboseDocumentComments()); ui_forceSections->setChecked(m_parentPolicy->getCodeVerboseSectionComments()); ui_outputDir->setText(m_parentPolicy->getOutputDirectory().absolutePath()); ui_includeHeadings->setChecked(m_parentPolicy->getIncludeHeadings()); ui_headingsDir->setText(m_parentPolicy->getHeadingFileDir()); overwriteToWidget(m_parentPolicy->getOverwritePolicy())->setChecked(true); ui_SelectEndLineCharsBox->setCurrentIndex(newLineToInteger(m_parentPolicy->getLineEndingType())); ui_SelectIndentationTypeBox->setCurrentIndex(indentTypeToInteger(m_parentPolicy->getIndentationType())); ui_SelectIndentationNumber->setValue(m_parentPolicy->getIndentationAmount()); connect(this, SIGNAL(syncCodeDocumentsToParent()), gen, SLOT(syncCodeToDocument())); connect(this, SIGNAL(languageChanged()), this, SLOT(updateCodeGenerationPolicyTab())); connect(this, SIGNAL(languageChanged()), this, SLOT(changeLanguage())); connect(ui_browseOutput, SIGNAL(clicked()), this, SLOT(browseClicked())); connect(ui_browseHeadings, SIGNAL(clicked()), this, SLOT(browseClicked())); setupActiveLanguageBox(); //now insert the language-dependant page, should there be one updateCodeGenerationPolicyTab(); }
/** Constructor */ FilePropertyWidget::FilePropertyWidget(Mantid::Kernel::Property *prop, QWidget *parent, QGridLayout *layout, int row) : TextPropertyWidget(prop, parent, layout, row) { m_fileProp = dynamic_cast<Mantid::API::FileProperty *>(prop); m_multipleFileProp = dynamic_cast<Mantid::API::MultipleFileProperty *>(prop); // Create a browse button m_browseButton = new QPushButton(tr("Browse"), m_parent); connect(m_browseButton, SIGNAL(clicked()), this, SLOT(browseClicked())); m_widgets.push_back(m_browseButton); // Add to the 2nd column m_gridLayout->addWidget(m_browseButton, m_row, 2, nullptr); }
HapticsPlayer::HapticsPlayer() : actuator(0) { ui.setupUi(this); #if defined(Q_WS_MAEMO_5) // maemo5 style problem: title of groupboxes is rendered badly if there isn't enough space // that is, the sizehint of the title area is Preferred rather than Minimum. // to fix that, we manually tweak some spacers. ui.verticalSpacer_2->changeSize(20, 20, QSizePolicy::Expanding, QSizePolicy::Fixed); ui.verticalSpacer_3->changeSize(20, 20, QSizePolicy::Expanding, QSizePolicy::Fixed); ui.verticalSpacer_4->changeSize(20, 30, QSizePolicy::Expanding, QSizePolicy::Fixed); ui.verticalSpacer_5->changeSize(20, 30, QSizePolicy::Expanding, QSizePolicy::Fixed); ui.verticalSpacer_6->changeSize(20, 20, QSizePolicy::Expanding, QSizePolicy::Fixed); ui.verticalSpacer_7->changeSize(20, 30, QSizePolicy::Expanding, QSizePolicy::Fixed); #endif connect(ui.actuators, SIGNAL(currentIndexChanged(int)), SLOT(actuatorChanged())); connect(ui.enabled, SIGNAL(toggled(bool)), SLOT(enabledChanged(bool))); connect(ui.playPause, SIGNAL(pressed()), SLOT(playPauseClicked())); connect(ui.stop, SIGNAL(pressed()), &effect, SLOT(stop())); connect(ui.duration, SIGNAL(valueChanged(int)), SLOT(durationChanged(int))); connect(ui.intensity, SIGNAL(valueChanged(int)), SLOT(intensityChanged(int))); //for the envelope connect(ui.attackTime, SIGNAL(valueChanged(int)), SLOT(attackTimeChanged(int))); connect(ui.attackIntensity, SIGNAL(valueChanged(int)), SLOT(attackIntensityChanged(int))); connect(ui.fadeTime, SIGNAL(valueChanged(int)), SLOT(fadeTimeChanged(int))); connect(ui.fadeIntensity, SIGNAL(valueChanged(int)), SLOT(fadeIntensityChanged(int))); //for the period connect(ui.grpPeriod, SIGNAL(toggled(bool)), SLOT(periodToggled(bool))); connect(ui.period, SIGNAL(valueChanged(int)), SLOT(periodChanged(int))); connect(ui.instantPlay, SIGNAL(pressed()), SLOT(instantPlayClicked())); //file API connect(ui.browse, SIGNAL(pressed()), SLOT(browseClicked())); connect(ui.filePlayPause, SIGNAL(pressed()), SLOT(filePlayPauseClicked())); connect(ui.fileStop, SIGNAL(pressed()), &fileEffect, SLOT(stop())); // if pausing a playing effect is not supported then stop playback connect(&fileEffect, SIGNAL(error(QFeedbackEffect::ErrorType)), &fileEffect, SLOT(stop())); foreach (QFeedbackActuator *dev, QFeedbackActuator::actuators()) { ui.actuators->addItem(dev->name()); }
// FIXME: #warning "Option for DIR_MUST_EXISTS...(this widget could be turned into a file selector too)" KviFileSelector::KviFileSelector(QWidget * par,const QString & txt,QString * pOption,bool bEnabled,unsigned int uFlags,const QString &szFilter) : QWidget(par), KviSelectorInterface() { m_Layout = new QGridLayout(this); m_uFlags = uFlags; m_szFilter = szFilter; m_pLabel = new QLabel(txt,this); if(uFlags & VerticalLayout) m_Layout->addWidget(m_pLabel,0,0,1,2); else m_Layout->addWidget(m_pLabel,0,0); m_pLineEdit = new QLineEdit(this); if(uFlags & VerticalLayout) m_Layout->addWidget(m_pLineEdit,1,0); else m_Layout->addWidget(m_pLineEdit,0,1); //m_pLineEdit->setMinimumWidth(200); m_pLineEdit->setText(*pOption); m_pButton = new QPushButton(__tr2qs("&Browse..."),this); connect(m_pButton,SIGNAL(clicked()),this,SLOT(browseClicked())); if(uFlags & VerticalLayout) m_Layout->addWidget(m_pButton,1,1); else m_Layout->addWidget(m_pButton,0,2); m_Layout->setSpacing(4); if(uFlags & VerticalLayout) m_Layout->setColumnStretch(0,1); else m_Layout->setColumnStretch(1,1); m_pOption = pOption; setEnabled(bEnabled); }
AddInvestigationWid::AddInvestigationWid(QString rootdir, QWidget *parent): QWidget(parent) { path=rootdir; g_layout = new QGridLayout(this); g_layout->setVerticalSpacing(10); datetime = new QLabel(tr("Date/Time")); type = new QLabel(tr("Type")); date_t = new QDateTimeEdit(); date_t->setDateTime(QDateTime::currentDateTime()); QStringList types; types << "Angiography" << "Biopsy" << "Blood Test" << "Colonoscopy" << "CT" << "ECG" << "Echo Cardiography" << "Electro Encephalography (EEG)" << "Endoscopy" << "FNAC" << "Funduscopy" << "Holter Test" << "MRI" << "Sputum Test" << "Stool Test" << "Throat Swab" << "Treadmill" << "Urine Test" << "Ultrasonography (USG)" << "X-Ray" << "Other"; dropdown = new QComboBox(); dropdown->addItems(types); detail_l= new QLabel(tr("Details")); details = new QTextEdit(); report = new QLabel(tr("Report")); imagepath = new QPushButton(tr("Capture image/video")); browse_b = new QPushButton(tr("Browse")); save = new QPushButton(tr("SAVE")); reset = new QPushButton(tr("RESET")); g_layout->addWidget(datetime,0,0); g_layout->addWidget(date_t,0,1,1,2); g_layout->addWidget(type,1,0); g_layout->addWidget(dropdown,1,1,1,2); g_layout->addWidget(detail_l,2,0); g_layout->addWidget(details,2,1,1,2); g_layout->addWidget(report,3,0); g_layout->addWidget(imagepath,3,1,1,1); g_layout->addWidget(browse_b,3,2,1,1); g_layout->addWidget(save,4,0); g_layout->addWidget(reset,4,1,1,2); connect(imagepath,SIGNAL(clicked()),this,SLOT(imagevideo())); connect(save,SIGNAL(clicked()),this,SLOT(perform_save())); connect(reset,SIGNAL(clicked()),this,SLOT(reset_function())); connect(browse_b,SIGNAL(clicked()),this,SLOT(browseClicked())); }