void AudioTest::initializeWindow() { QScopedPointer<QWidget> window(new QWidget); QScopedPointer<QVBoxLayout> layout(new QVBoxLayout); m_deviceBox = new QComboBox(this); foreach (const QAudioDeviceInfo &deviceInfo, QAudioDeviceInfo::availableDevices(QAudio::AudioOutput)) m_deviceBox->addItem(deviceInfo.deviceName(), QVariant::fromValue(deviceInfo)); connect(m_deviceBox,SIGNAL(activated(int)),SLOT(deviceChanged(int))); layout->addWidget(m_deviceBox); m_modeButton = new QPushButton(this); m_modeButton->setText(PushModeLabel); connect(m_modeButton, SIGNAL(clicked()), SLOT(toggleMode())); layout->addWidget(m_modeButton); m_suspendResumeButton = new QPushButton(this); m_suspendResumeButton->setText(SuspendLabel); connect(m_suspendResumeButton, SIGNAL(clicked()), SLOT(toggleSuspendResume())); layout->addWidget(m_suspendResumeButton); window->setLayout(layout.data()); layout.take(); // ownership transferred setCentralWidget(window.data()); QWidget *const windowPtr = window.take(); // ownership transferred windowPtr->show(); }
void AudioTest::initializeWindow() { QScopedPointer<QWidget> window(new QWidget); QScopedPointer<QVBoxLayout> layout(new QVBoxLayout); m_deviceBox = new QComboBox(this); const QAudioDeviceInfo &defaultDeviceInfo = QAudioDeviceInfo::defaultOutputDevice(); m_deviceBox->addItem(defaultDeviceInfo.deviceName(), qVariantFromValue(defaultDeviceInfo)); foreach (const QAudioDeviceInfo &deviceInfo, QAudioDeviceInfo::availableDevices(QAudio::AudioOutput)) { if (deviceInfo != defaultDeviceInfo) m_deviceBox->addItem(deviceInfo.deviceName(), qVariantFromValue(deviceInfo)); } connect(m_deviceBox,SIGNAL(activated(int)),SLOT(deviceChanged(int))); layout->addWidget(m_deviceBox); m_modeButton = new QPushButton(this); m_modeButton->setText(tr(PUSH_MODE_LABEL)); connect(m_modeButton, SIGNAL(clicked()), SLOT(toggleMode())); layout->addWidget(m_modeButton); m_suspendResumeButton = new QPushButton(this); m_suspendResumeButton->setText(tr(SUSPEND_LABEL)); connect(m_suspendResumeButton, SIGNAL(clicked()), SLOT(toggleSuspendResume())); layout->addWidget(m_suspendResumeButton); QHBoxLayout *volumeBox = new QHBoxLayout; m_volumeLabel = new QLabel; m_volumeLabel->setText(tr(VOLUME_LABEL)); m_volumeSlider = new QSlider(Qt::Horizontal); m_volumeSlider->setMinimum(0); m_volumeSlider->setMaximum(100); m_volumeSlider->setSingleStep(10); connect(m_volumeSlider, SIGNAL(valueChanged(int)), this, SLOT(volumeChanged(int))); volumeBox->addWidget(m_volumeLabel); volumeBox->addWidget(m_volumeSlider); layout->addLayout(volumeBox); window->setLayout(layout.data()); layout.take(); // ownership transferred setCentralWidget(window.data()); QWidget *const windowPtr = window.take(); // ownership transferred windowPtr->show(); }
ChannelListDlg::ChannelListDlg(QWidget *parent) : QDialog(parent), _listFinished(true), _ircListModel(this), _sortFilter(this), _simpleModeSpacer(0), _advancedMode(false) { _sortFilter.setSourceModel(&_ircListModel); _sortFilter.setFilterCaseSensitivity(Qt::CaseInsensitive); _sortFilter.setFilterKeyColumn(-1); ui.setupUi(this); ui.advancedModeLabel->setPixmap(QIcon::fromTheme("edit-rename").pixmap(22)); ui.channelListView->setSelectionBehavior(QAbstractItemView::SelectRows); ui.channelListView->setSelectionMode(QAbstractItemView::SingleSelection); ui.channelListView->setAlternatingRowColors(true); ui.channelListView->setTabKeyNavigation(false); ui.channelListView->setModel(&_sortFilter); ui.channelListView->setSortingEnabled(true); ui.channelListView->verticalHeader()->hide(); ui.channelListView->horizontalHeader()->setStretchLastSection(true); ui.searchChannelsButton->setAutoDefault(false); setWindowIcon(QIcon::fromTheme("format-list-unordered")); connect(ui.advancedModeLabel, SIGNAL(clicked()), this, SLOT(toggleMode())); connect(ui.searchChannelsButton, SIGNAL(clicked()), this, SLOT(requestSearch())); connect(ui.channelNameLineEdit, SIGNAL(returnPressed()), this, SLOT(requestSearch())); connect(ui.filterLineEdit, SIGNAL(textChanged(QString)), &_sortFilter, SLOT(setFilterFixedString(QString))); connect(Client::ircListHelper(), SIGNAL(channelListReceived(const NetworkId &, const QStringList &, QList<IrcListHelper::ChannelDescription> )), this, SLOT(receiveChannelList(NetworkId, QStringList, QList<IrcListHelper::ChannelDescription> ))); connect(Client::ircListHelper(), SIGNAL(finishedListReported(const NetworkId &)), this, SLOT(reportFinishedList())); connect(Client::ircListHelper(), SIGNAL(errorReported(const QString &)), this, SLOT(showError(const QString &))); connect(ui.channelListView, SIGNAL(activated(QModelIndex)), this, SLOT(joinChannel(QModelIndex))); setAdvancedMode(false); enableQuery(true); showFilterLine(false); showErrors(false); }
void ProxySettings::load() { QSettings s; s.beginGroup(NetworkProxyFactory::constSettingsGroup); int mode=s.value("mode", NetworkProxyFactory::Mode_System).toInt(); for (int i=0; i<proxyMode->count(); ++i) { if (proxyMode->itemData(i).toInt()==mode) { proxyMode->setCurrentIndex(i); break; } } proxyType->setCurrentIndex(QNetworkProxy::HttpProxy==s.value("type", QNetworkProxy::HttpProxy).toInt() ? 0 : 1); proxyHost->setText(s.value("hostname").toString()); proxyPort->setValue(s.value("port", 8080).toInt()); proxyUsername->setText(s.value("username").toString()); proxyPassword->setText(s.value("password").toString()); s.endGroup(); toggleMode(); }
RoutingWidget::RoutingWidget(QWidget *parent, const char *name, WFlags f) : QWidget(parent, name, f) { structure = NULL; setFocusPolicy(QWidget::StrongFocus); RoutingWidgetLayout = new QVBoxLayout(this); createButtons(); drawing = new RoutingDrawWidget(this); RoutingWidgetLayout->addWidget(drawing/*, 1, 1*/); drawing->setUpdatesEnabled(TRUE); widgetMode = Normal; toggleMode(widgetMode); setZoomLevel(1.00); updateZoomLevelCtrl(100); }
void ResourceView::animationModeSelected() { toggleMode(animationMode); }
void ResourceView::effectModeSelected() { toggleMode(effectMode); }
void ResourceView::colorModeSelected() { toggleMode(colorMode); }
void ResourceView::iconModeSelected() { toggleMode(iconMode); }
void triggerToggleMode() { Poco::EventArgs args; toggleMode(this, args); }
void RoutingWidget::modeEffectStackClicked() { widgetMode = EffectStack; toggleMode(widgetMode); untoggleMode(widgetMode); }
void RoutingWidget::modeRouteClicked() { widgetMode = Route; toggleMode(widgetMode); untoggleMode(widgetMode); }
void RoutingWidget::modeOutClicked() { widgetMode = Out; toggleMode(widgetMode); untoggleMode(widgetMode); }
void RoutingWidget::modeInClicked() { widgetMode = In; toggleMode(widgetMode); untoggleMode(widgetMode); }
void RoutingWidget::modeFxClicked() { widgetMode = FX; toggleMode(widgetMode); untoggleMode(widgetMode); }
void RoutingWidget::modeNormalClicked() { widgetMode = Normal; toggleMode(widgetMode); untoggleMode(widgetMode); }