ImageTypeEditor::ImageTypeEditor(QWidget *parent) : QWidget(parent), m_currentFileId(0) { //init m_browseButton = new QPushButton(tr("Select"), this); QFrame *backgroundFrame = new QFrame(this); QVBoxLayout *frameLayout = new QVBoxLayout(backgroundFrame); frameLayout->addWidget(m_browseButton); frameLayout->setContentsMargins(0, 0, 0, 0); frameLayout->setSpacing(0); QVBoxLayout *mainLayout = new QVBoxLayout(this); mainLayout->addWidget(backgroundFrame); mainLayout->setContentsMargins(0, 0, 0, 0); mainLayout->setSpacing(0); //style backgroundFrame->setStyleSheet("QFrame { background-color: palette(base); }"); //focus proxy setFocusProxy(m_browseButton); //connections connect(m_browseButton, SIGNAL(clicked()), this, SLOT(browseButtonClicked())); }
GetFileNameWidget::GetFileNameWidget (QWidget *parent, FileType mode, const QString &label, const QString &caption, const QString &initial) : QWidget (parent) { RK_TRACE (MISC); QVBoxLayout *vbox = new QVBoxLayout (this); vbox->setResizeMode (QLayout::Minimum); vbox->addWidget (new QLabel (label, this)); QHBoxLayout *hbox = new QHBoxLayout (vbox, 6); location_edit = new QLineEdit (this); location_edit->setText (initial); connect (location_edit, SIGNAL (textChanged (const QString &)), this, SLOT (locationEditChanged (const QString &))); hbox->addWidget (location_edit); browse_button = new QPushButton (i18n ("Browse"), this); connect (browse_button, SIGNAL (clicked ()), this, SLOT (browseButtonClicked ())); hbox->addWidget (browse_button); GetFileNameWidget::mode = mode; if (caption.isEmpty ()) { GetFileNameWidget::caption = label; } else { GetFileNameWidget::caption = caption; } }
/** Constructor */ SoundPage::SoundPage(QWidget * parent, Qt::WFlags flags) : ConfigPage(parent, flags) { /* Invoke the Qt Designer generated object setup routine */ ui.setupUi(this); connect(ui.eventTreeWidget, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)), this, SLOT(eventChanged(QTreeWidgetItem*, QTreeWidgetItem*))); connect(ui.filenameEdit, SIGNAL(textChanged(QString)), this, SLOT(filenameChanged(QString))); connect(ui.browseButton, SIGNAL(clicked()), this, SLOT(browseButtonClicked())); connect(ui.playButton, SIGNAL(clicked()), this, SLOT(playButtonClicked())); ui.eventTreeWidget->setColumnCount(COLUMN_COUNT); QTreeWidgetItem *headerItem = ui.eventTreeWidget->headerItem(); headerItem->setText(COLUMN_NAME, tr("Event")); headerItem->setText(COLUMN_FILENAME, tr("Filename")); ui.eventTreeWidget->header()->setResizeMode(QHeaderView::Fixed); ui.eventTreeWidget->setTextElideMode(Qt::ElideMiddle); /* Hide platform specific features */ #ifdef Q_WS_WIN #endif }
CaptureInterfacesDialog::CaptureInterfacesDialog(QWidget *parent) : GeometryStateDialog(parent), ui(new Ui::CaptureInterfacesDialog) { ui->setupUi(this); loadGeometry(); setWindowTitle(wsApp->windowTitleString(tr("Capture Interfaces"))); stat_timer_ = NULL; stat_cache_ = NULL; // XXX - Enable / disable as needed ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Start")); ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled((global_capture_opts.num_selected > 0)? true: false); // Start out with the list *not* sorted, so they show up in the order // in which they were provided ui->interfaceTree->sortByColumn(-1, Qt::AscendingOrder); ui->interfaceTree->setItemDelegateForColumn(col_interface_, &interface_item_delegate_); ui->interfaceTree->setItemDelegateForColumn(col_traffic_, new SparkLineDelegate()); ui->interfaceTree->setItemDelegateForColumn(col_link_, &interface_item_delegate_); ui->interfaceTree->setItemDelegateForColumn(col_snaplen_, &interface_item_delegate_); #ifdef SHOW_BUFFER_COLUMN ui->interfaceTree->setItemDelegateForColumn(col_buffer_, &interface_item_delegate_); #else ui->interfaceTree->setColumnHidden(col_buffer_, true); #endif #ifndef SHOW_MONITOR_COLUMN ui->interfaceTree->setColumnHidden(col_monitor_, true); #endif ui->interfaceTree->setItemDelegateForColumn(col_filter_, &interface_item_delegate_); interface_item_delegate_.setTree(ui->interfaceTree); #if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0) ui->filenameLineEdit->setPlaceholderText(tr("Leave blank to use a temporary file")); #endif // Changes in interface selections or capture filters should be propagated // to the main welcome screen where they will be applied to the global // capture options. connect(this, SIGNAL(interfacesChanged()), ui->captureFilterComboBox, SIGNAL(interfacesChanged())); connect(ui->captureFilterComboBox, SIGNAL(captureFilterSyntaxChanged(bool)), this, SLOT(updateWidgets())); connect(ui->captureFilterComboBox->lineEdit(), SIGNAL(textEdited(QString)), this, SLOT(filterEdited())); connect(ui->captureFilterComboBox->lineEdit(), SIGNAL(textEdited(QString)), this, SIGNAL(captureFilterTextEdited(QString))); connect(&interface_item_delegate_, SIGNAL(filterChanged(QString)), ui->captureFilterComboBox->lineEdit(), SLOT(setText(QString))); connect(&interface_item_delegate_, SIGNAL(filterChanged(QString)), this, SIGNAL(captureFilterTextEdited(QString))); connect(this, SIGNAL(ifsChanged()), this, SLOT(refreshInterfaceList())); connect(wsApp, SIGNAL(localInterfaceListChanged()), this, SLOT(updateLocalInterfaces())); connect(ui->browseButton, SIGNAL(clicked()), this, SLOT(browseButtonClicked())); }
ImageLoaderSettingsDialog::ImageLoaderSettingsDialog(QWidget *parent) : QDialog(parent), ui(new Ui::ImageLoaderSettingsDialog) { ui->setupUi(this); setWindowFlags(Qt::WindowStaysOnTopHint); connect(ui->browseButton, SIGNAL(clicked()), this, SLOT(browseButtonClicked())); }
CaptureInterfacesDialog::CaptureInterfacesDialog(QWidget *parent) : QDialog(parent), ui(new Ui::CaptureInterfacesDialog) { ui->setupUi(this); setWindowTitle(wsApp->windowTitleString(tr("Capture Interfaces"))); stat_timer_ = NULL; stat_cache_ = NULL; // XXX - Enable / disable as needed start_bt_ = ui->buttonBox->addButton(tr("Start"), QDialogButtonBox::YesRole); start_bt_->setEnabled((global_capture_opts.num_selected > 0)? true: false); connect(start_bt_, SIGNAL(clicked(bool)), this, SLOT(start_button_clicked())); ui->interfaceTree->sortByColumn(col_interface_, Qt::AscendingOrder); ui->interfaceTree->setItemDelegateForColumn(col_interface_, &interface_item_delegate_); ui->interfaceTree->setItemDelegateForColumn(col_traffic_, new SparkLineDelegate()); ui->interfaceTree->setItemDelegateForColumn(col_link_, &interface_item_delegate_); ui->interfaceTree->setItemDelegateForColumn(col_pmode_, &interface_item_delegate_); ui->interfaceTree->setItemDelegateForColumn(col_snaplen_, &interface_item_delegate_); #ifdef SHOW_BUFFER_COLUMN ui->interfaceTree->setItemDelegateForColumn(col_buffer_, &interface_item_delegate_); #else ui->interfaceTree->setColumnHidden(col_buffer_, true); #endif #ifdef SHOW_MONITOR_COLUMN ui->interfaceTree->setItemDelegateForColumn(col_monitor_, &interface_item_delegate_); #else ui->interfaceTree->setColumnHidden(col_monitor_, true); #endif ui->interfaceTree->setItemDelegateForColumn(col_filter_, &interface_item_delegate_); interface_item_delegate_.setTree(ui->interfaceTree); ui->interfaceTree->setColumnWidth(col_link_, 100); connect(ui->interfaceTree,SIGNAL(itemClicked(QTreeWidgetItem*,int)),this,SLOT(interfaceClicked(QTreeWidgetItem*,int))); connect(ui->interfaceTree, SIGNAL(itemSelectionChanged()), this, SLOT(interfaceSelected())); connect(ui->allFilterComboBox, SIGNAL(captureFilterSyntaxChanged(bool)), this, SLOT(allFilterChanged())); connect(this, SIGNAL(interfacesChanged()), ui->allFilterComboBox, SIGNAL(interfacesChanged())); connect(this, SIGNAL(ifsChanged()), this, SLOT(refreshInterfaceList())); connect(wsApp, SIGNAL(localInterfaceListChanged()), this, SLOT(updateLocalInterfaces())); connect(ui->browseButton, SIGNAL(clicked()), this, SLOT(browseButtonClicked())); }
bool KStreamRipper::qt_invoke( int _id, QUObject* _o ) { switch ( _id - staticMetaObject()->slotOffset() ) { case 0: browseButtonClicked(); break; case 1: addStreamButtonClicked(); break; case 2: deleteStreamButtonClicked(); break; case 3: tuneInButtonClicked(); break; case 4: ripButtonClicked(); break; case 5: stopRipButtonClicked(); break; case 6: addStreamFinished((AddNewStreamImpl*)static_QUType_ptr.get(_o+1)); break; case 7: readStdout(); break; case 8: setEmptyText(); break; case 9: quitButtonClicked(); break; case 10: aboutButtonClicked(); break; default: return KStreamRipperBase::qt_invoke( _id, _o ); } return TRUE; }
void SubmitFieldWidget::slotBrowseButtonClicked() { const int pos = d->findSender(sender()); emit browseButtonClicked(pos, d->fieldText(pos)); }
AddJobDialog::AddJobDialog(QWidget *parent, OptionsModel *const options, RecentlyUsed *const recentlyUsed, const SysinfoModel *const sysinfo, const PreferencesModel *const preferences) : QDialog(parent), m_options(options), m_recentlyUsed(recentlyUsed), m_sysinfo(sysinfo), m_preferences(preferences), m_defaults(new OptionsModel(sysinfo)), ui(new Ui::AddJobDialog()), m_monitorConfigChanges(true) { //Init the dialog, from the .ui file ui->setupUi(this); setWindowFlags(windowFlags() & (~Qt::WindowContextHelpButtonHint)); //Fix dialog size ui->buttonSaveTemplate->setMaximumHeight(20); ui->buttonDeleteTemplate->setMaximumHeight(20); resize(width(), minimumHeight()); setMinimumSize(size()); setMaximumHeight(height()); //Init combobox items ui->cbxTuning ->addItem(QString::fromLatin1(OptionsModel::TUNING_UNSPECIFIED)); ui->cbxProfile->addItem(QString::fromLatin1(OptionsModel::PROFILE_UNRESTRICTED)); //Hide optional controls ui->checkBoxApplyToAll->setVisible(false); //Monitor combobox changes connect(ui->cbxEncoderType, SIGNAL(currentIndexChanged(int)), this, SLOT(encoderIndexChanged(int))); connect(ui->cbxEncoderVariant, SIGNAL(currentIndexChanged(int)), this, SLOT(variantIndexChanged(int))); connect(ui->cbxRateControlMode, SIGNAL(currentIndexChanged(int)), this, SLOT(modeIndexChanged(int))); //Activate buttons connect(ui->buttonBrowseSource, SIGNAL(clicked()), this, SLOT(browseButtonClicked())); connect(ui->buttonBrowseOutput, SIGNAL(clicked()), this, SLOT(browseButtonClicked())); connect(ui->buttonSaveTemplate, SIGNAL(clicked()), this, SLOT(saveTemplateButtonClicked())); connect(ui->buttonDeleteTemplate, SIGNAL(clicked()), this, SLOT(deleteTemplateButtonClicked())); //Setup validator ui->editCustomX264Params->installEventFilter(this); ui->editCustomX264Params->setValidator(new StringValidatorX264(ui->labelNotificationX264, ui->iconNotificationX264)); ui->editCustomX264Params->clear(); ui->editCustomAvs2YUVParams->installEventFilter(this); ui->editCustomAvs2YUVParams->setValidator(new StringValidatorAvs2YUV(ui->labelNotificationAvs2YUV, ui->iconNotificationAvs2YUV)); ui->editCustomAvs2YUVParams->clear(); //Install event filter ui->labelHelpScreenX264->installEventFilter(this); ui->labelHelpScreenAvs2YUV->installEventFilter(this); //Monitor for options changes connect(ui->cbxEncoderType, SIGNAL(currentIndexChanged(int)), this, SLOT(configurationChanged())); connect(ui->cbxEncoderArch, SIGNAL(currentIndexChanged(int)), this, SLOT(configurationChanged())); connect(ui->cbxEncoderVariant, SIGNAL(currentIndexChanged(int)), this, SLOT(configurationChanged())); connect(ui->cbxRateControlMode, SIGNAL(currentIndexChanged(int)), this, SLOT(configurationChanged())); connect(ui->spinQuantizer, SIGNAL(valueChanged(double)), this, SLOT(configurationChanged())); connect(ui->spinBitrate, SIGNAL(valueChanged(int)), this, SLOT(configurationChanged())); connect(ui->cbxPreset, SIGNAL(currentIndexChanged(int)), this, SLOT(configurationChanged())); connect(ui->cbxTuning, SIGNAL(currentIndexChanged(int)), this, SLOT(configurationChanged())); connect(ui->cbxProfile, SIGNAL(currentIndexChanged(int)), this, SLOT(configurationChanged())); connect(ui->editCustomX264Params, SIGNAL(textChanged(QString)), this, SLOT(configurationChanged())); connect(ui->editCustomAvs2YUVParams, SIGNAL(textChanged(QString)), this, SLOT(configurationChanged())); //Create context menus ADD_CONTEXTMENU_ACTION(ui->editCustomX264Params, QIcon(":/buttons/page_edit.png"), tr("Open the Text-Editor"), editorActionTriggered); ADD_CONTEXTMENU_ACTION(ui->editCustomAvs2YUVParams, QIcon(":/buttons/page_edit.png"), tr("Open the Text-Editor"), editorActionTriggered); ADD_CONTEXTMENU_SEPARATOR(ui->editCustomX264Params); ADD_CONTEXTMENU_SEPARATOR(ui->editCustomAvs2YUVParams); ADD_CONTEXTMENU_ACTION(ui->editCustomX264Params, QIcon(":/buttons/page_copy.png"), tr("Copy to Clipboard"), copyActionTriggered); ADD_CONTEXTMENU_ACTION(ui->editCustomAvs2YUVParams, QIcon(":/buttons/page_copy.png"), tr("Copy to Clipboard"), copyActionTriggered); ADD_CONTEXTMENU_ACTION(ui->editCustomX264Params, QIcon(":/buttons/page_paste.png"), tr("Paste from Clipboard"), pasteActionTriggered); ADD_CONTEXTMENU_ACTION(ui->editCustomAvs2YUVParams, QIcon(":/buttons/page_paste.png"), tr("Paste from Clipboard"), pasteActionTriggered); //Setup template selector loadTemplateList(); connect(ui->cbxTemplate, SIGNAL(currentIndexChanged(int)), this, SLOT(templateSelected())); }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { ui.setupUi(this); connect(ui.browsePushButton,SIGNAL(clicked()),this,SLOT(browseButtonClicked())); connect(ui.startPushButton,SIGNAL(clicked()),this,SLOT(startButtonClicked())); }