AlignmentView(Gui::Document* pcDocument, QWidget* parent, Qt::WFlags wflags=0) : AbstractSplitView(pcDocument, parent, wflags) { QSplitter* mainSplitter=0; mainSplitter = new QSplitter(Qt::Horizontal, this); _viewer.push_back(new View3DInventorViewer(mainSplitter)); _viewer.push_back(new View3DInventorViewer(mainSplitter)); QFrame* vbox = new QFrame(this); QVBoxLayout* layout = new QVBoxLayout(); layout->setMargin(0); layout->setSpacing(0); vbox->setLayout(layout); myLabel = new QLabel(this); myLabel->setAutoFillBackground(true); QPalette pal = myLabel->palette(); pal.setColor(QPalette::Window, Qt::darkGray); pal.setColor(QPalette::WindowText, Qt::white); myLabel->setPalette(pal); mainSplitter->setPalette(pal); myLabel->setAlignment(Qt::AlignCenter); myLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); QFont font = myLabel->font(); font.setPointSize(14); myLabel->setFont(font); layout->addWidget(myLabel); layout->addWidget(mainSplitter); vbox->show(); setCentralWidget(vbox); // apply the user settings setupSettings(); static_cast<SoGroup*>(getViewer(0)->getSceneManager()->getSceneGraph())-> addChild(setupHeadUpDisplay(tr("Movable object"))); static_cast<SoGroup*>(getViewer(1)->getSceneManager()->getSceneGraph())-> addChild(setupHeadUpDisplay(tr("Fixed object"))); }
RSSWidget::RSSWidget(const QMap< KUrl, QString > &map, QWidget *parent) : QMenu(parent) , m_map(map) { setAttribute(Qt::WA_DeleteOnClose); setFixedWidth(350); QFormLayout *layout = new QFormLayout(this); // Title QLabel *title = new QLabel(this); title->setText(i18n("Subscribe to RSS Feeds")); QFont f = title->font(); f.setBold(true); title->setFont(f); layout->addRow(title); // Agregators QLabel *agregator = new QLabel(this); agregator->setText(i18n("Aggregator:")); m_agregators = new KComboBox(this); m_agregators->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); m_agregators->addItem(KIcon("akregator"), QString("Akregator")); m_agregators->addItem(rApp->iconManager()->iconForUrl(KUrl("http://google.com/reader")), i18n("Google Reader")); layout->addRow(agregator, m_agregators); // Feeds List QLabel *feed = new QLabel(this); feed->setText(i18n("Feed:")); m_feeds = new KComboBox(this); m_feeds->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); Q_FOREACH(const QString & title, m_map) { m_feeds->addItem(title); }
pluginBrowser::pluginBrowser( QWidget * _parent ) : SideBarWidget( tr( "Instrument plugins" ), embed::getIconPixmap( "plugins" ).transformed( QTransform().rotate( 90 ) ), _parent ) { setWindowTitle( tr( "Instrument browser" ) ); m_view = new QWidget( contentParent() ); //m_view->setFrameShape( QFrame::NoFrame ); addContentWidget( m_view ); QVBoxLayout * view_layout = new QVBoxLayout( m_view ); view_layout->setMargin( 5 ); view_layout->setSpacing( 5 ); QLabel * hint = new QLabel( tr( "Drag an instrument " "into either the Song-Editor, the " "Beat+Bassline Editor or into an " "existing instrument track." ), m_view ); hint->setFont( pointSize<8>( hint->font() ) ); hint->setWordWrap( true ); view_layout->addWidget( hint ); Plugin::getDescriptorsOfAvailPlugins( m_pluginDescriptors ); qSort( m_pluginDescriptors.begin(), m_pluginDescriptors.end(), pluginBefore ); for( Plugin::DescriptorList::ConstIterator it = m_pluginDescriptors.begin(); it != m_pluginDescriptors.end(); ++it ) { if( it->type == Plugin::Instrument ) { pluginDescWidget * p = new pluginDescWidget( *it, m_view ); p->show(); view_layout->addWidget( p ); } } view_layout->addStretch(); show(); }
void PanelsWidget::addPanel( PanelData *panel ) { const int headerRow = layout_->rowCount(); // icon: if (!panel->icon().isNull()) { QLabel *iconLabel = new QLabel(root_); iconLabel->setPixmap( panel->icon().pixmap( Constants::ICON_SIZE, Constants::ICON_SIZE ) ); iconLabel->setContentsMargins( 0, Constants::ABOVE_HEADING_MARGIN, 0, 0 ); layout_->addWidget( iconLabel, headerRow, 0, /*rowSpan=*/3, /*colSpan=*/1, Qt::AlignTop | Qt::AlignHCenter ); } // name: QLabel *nameLabel = new QLabel(root_); nameLabel->setText( panel->displayName() ); QPalette palette = nameLabel->palette(); for (int i = QPalette::Active; i < QPalette::NColorGroups; ++i ) { QColor foregroundColor = palette.color(QPalette::ColorGroup(i), QPalette::Foreground); foregroundColor.setAlpha(110); palette.setBrush(QPalette::ColorGroup(i), QPalette::Foreground, foregroundColor); } nameLabel->setPalette(palette); nameLabel->setContentsMargins(0, Constants::ABOVE_HEADING_MARGIN, 0, 0); QFont f = nameLabel->font(); f.setBold(true); f.setPointSizeF(f.pointSizeF() * 1.6); nameLabel->setFont(f); layout_->addWidget(nameLabel, headerRow, 1, 1, 1, Qt::AlignVCenter | Qt::AlignLeft); // line: const int lineRow(headerRow + 1); QWidget *line = new OnePixelBlackLine(root_); layout_->addWidget(line, lineRow, 1, 1, -1, Qt::AlignTop); // add the widget: const int widgetRow(lineRow + 1); addPanelWidget(panel, widgetRow); layout_->setRowStretch( lineRow + 1, 100 ); }
CodeStyleEditor::CodeStyleEditor(ICodeStylePreferencesFactory *factory, ICodeStylePreferences *codeStyle, QWidget *parent) : QWidget(parent), m_factory(factory), m_codeStyle(codeStyle) { m_layout = new QVBoxLayout(this); CodeStyleSelectorWidget *selector = new CodeStyleSelectorWidget(factory, this); selector->setCodeStyle(codeStyle); m_preview = new SnippetEditorWidget(this); TextEditor::TextEditorSettings *settings = TextEditorSettings::instance(); m_preview->setFontSettings(settings->fontSettings()); DisplaySettings displaySettings = m_preview->displaySettings(); displaySettings.m_visualizeWhitespace = true; m_preview->setDisplaySettings(displaySettings); ISnippetProvider *provider = factory->snippetProvider(); if (provider) provider->decorateEditor(m_preview); QLabel *label = new QLabel( tr("Edit preview contents to see how the current settings " "are applied to custom code snippets. Changes in the preview " "do not affect the current settings."), this); QFont font = label->font(); font.setItalic(true); label->setFont(font); label->setWordWrap(true); m_layout->addWidget(selector); m_layout->addWidget(m_preview); m_layout->addWidget(label); connect(codeStyle, SIGNAL(currentTabSettingsChanged(TextEditor::TabSettings)), this, SLOT(updatePreview())); connect(codeStyle, SIGNAL(currentValueChanged(QVariant)), this, SLOT(updatePreview())); connect(codeStyle, SIGNAL(currentPreferencesChanged(TextEditor::ICodeStylePreferences*)), this, SLOT(updatePreview())); m_preview->setCodeStyle(m_codeStyle); m_preview->setPlainText(factory->previewText()); updatePreview(); }
QmitkPaintbrushToolGUI::QmitkPaintbrushToolGUI() :QmitkToolGUI(), m_Slider(NULL) { // create the visible widgets QBoxLayout* layout = new QHBoxLayout( this ); this->setContentsMargins( 0, 0, 0, 0 ); QLabel* label = new QLabel( "Size ", this ); QFont f = label->font(); f.setBold(false); label->setFont( f ); layout->addWidget(label); m_SizeLabel = new QLabel( " 10", this ); f = m_SizeLabel->font(); f.setBold(false); m_SizeLabel->setFont( f ); layout->addWidget(m_SizeLabel); //m_Slider = new QSlider( 1, 50, 1, 10, Qt::Horizontal, this ); m_Slider = new QSlider( Qt::Horizontal, this ); m_Slider->setMinimum(1); m_Slider->setMaximum(50); m_Slider->setPageStep(1); m_Slider->setValue(10); connect( m_Slider, SIGNAL(valueChanged(int)), this, SLOT(OnSliderValueChanged(int))); layout->addWidget( m_Slider ); /* m_Frame = new QFrame( this ); m_Frame->setMinimumSize( QSize(50, 50) ); m_Frame->setFrameStyle( QFrame::Box || QFrame::Plain ); m_Frame->show(); layout->addWidget( m_Frame ); */ connect( this, SIGNAL(NewToolAssociated(mitk::Tool*)), this, SLOT(OnNewToolAssociated(mitk::Tool*)) ); }
AboutDialog::AboutDialog(QWidget *parent) : QDialog(parent) { setWindowTitle(tr("Bluecherry Client - About")); setFixedSize(500, 400); setModal(true); QGridLayout *layout = new QGridLayout(this); QLabel *logo = new QLabel; logo->setPixmap(QPixmap(QLatin1String(":/images/logo.png")) .scaled(130, 130, Qt::KeepAspectRatio, Qt::SmoothTransformation)); logo->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); layout->addWidget(logo, 0, 0); QLabel *text = new QLabel; text->setText(tr("Bluecherry DVR Client<br>Version %1").arg(QApplication::applicationVersion())); text->setAlignment(Qt::AlignHCenter | Qt::AlignTop); QFont font = text->font(); font.setPixelSize(15); text->setFont(font); layout->addWidget(text, 0, 1); layout->setColumnStretch(1, 1); QTextBrowser *license = new QTextBrowser; license->setHtml(getLicenseText()); license->setStyleSheet(QLatin1String("font-size: 12px")); license->setReadOnly(true); license->setOpenExternalLinks(true); license->setTabChangesFocus(true); layout->addWidget(license, 1, 0, 1, 2); font = QFont(); font.setStyleHint(QFont::SansSerif); font.setPixelSize(13); license->setFont(font); }
LineEditDialog::LineEditDialog(QString title, QWidget* parent) : QDialog(parent, Qt::Popup) { QLabel* label = new QLabel(title); edit = new QLineEdit(this); // edit->setGeometry(1, 1, 150, 23); connect(edit, SIGNAL(editingFinished()), this, SLOT(accept())); QVBoxLayout* layout = new QVBoxLayout(this); layout->setMargin(4); layout->addWidget(label); layout->addWidget(edit); QFrame* frame = new QFrame(); frame->setFrameStyle(QFrame::Panel | QFrame::Raised); frame->setLineWidth(2); frame->setLayout(layout); QVBoxLayout* mainLayout = new QVBoxLayout(); mainLayout->setMargin(0); mainLayout->addWidget(frame); setLayout(mainLayout); QFontMetrics fontMetrics(label->font()); const int width = std::max(200, fontMetrics.boundingRect(title).width() + 20), height = 50; QDesktopWidget desk; int screenWidth = 0, screenHeight = 0; for (int iScreen = 0; iScreen <= desk.screenNumber(QCursor::pos()); ++iScreen) { screenWidth += desk.screenGeometry(iScreen).width(); screenHeight += desk.screenGeometry(iScreen).height(); } setGeometry(std::min(screenWidth - width - 10, QCursor::pos().x()), std::min(screenHeight - height - 10, QCursor::pos().y()), width, height); edit->setFocus(); }
CodeStyleEditor::CodeStyleEditor(ICodeStylePreferencesFactory *factory, ICodeStylePreferences *codeStyle, QWidget *parent) : CodeStyleEditorWidget(parent), m_factory(factory), m_codeStyle(codeStyle) { m_layout = new QVBoxLayout(this); auto selector = new CodeStyleSelectorWidget(factory, this); selector->setCodeStyle(codeStyle); m_preview = new SnippetEditorWidget(this); DisplaySettings displaySettings = m_preview->displaySettings(); displaySettings.m_visualizeWhitespace = true; m_preview->setDisplaySettings(displaySettings); QString groupId = factory->snippetProviderGroupId(); SnippetProvider::decorateEditor(m_preview, groupId); QLabel *label = new QLabel( tr("Edit preview contents to see how the current settings " "are applied to custom code snippets. Changes in the preview " "do not affect the current settings."), this); QFont font = label->font(); font.setItalic(true); label->setFont(font); label->setWordWrap(true); m_layout->addWidget(selector); m_layout->addWidget(m_preview); m_layout->addWidget(label); connect(codeStyle, &ICodeStylePreferences::currentTabSettingsChanged, this, &CodeStyleEditor::updatePreview); connect(codeStyle, &ICodeStylePreferences::currentValueChanged, this, &CodeStyleEditor::updatePreview); connect(codeStyle, &ICodeStylePreferences::currentPreferencesChanged, this, &CodeStyleEditor::updatePreview); m_preview->setCodeStyle(m_codeStyle); m_preview->setPlainText(factory->previewText()); updatePreview(); }
static void addLibraries(QGridLayout *layout, const std::string &name, const std::list<RsLibraryInfo> &libraries) { int row = layout->rowCount(); QLabel *label = new QLabel(QString::fromUtf8(name.c_str())); label->setTextInteractionFlags(label->textInteractionFlags() | Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard); layout->addWidget(label, row++, 0, 1, 3); QFont font = label->font(); font.setBold(true); label->setFont(font); std::list<RsLibraryInfo>::const_iterator libraryIt; for (libraryIt = libraries.begin(); libraryIt != libraries.end(); ++libraryIt) { label = new QLabel(QString::fromUtf8(libraryIt->mName.c_str())); label->setTextInteractionFlags(label->textInteractionFlags() | Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard); layout->addWidget(label, row, 0); label->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred); label = new QLabel(QString::fromUtf8(libraryIt->mVersion.c_str())); label->setTextInteractionFlags(label->textInteractionFlags() | Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard); layout->addWidget(label, row++, 1); } }
void OBSPropertiesView::AddFont(obs_property_t *prop, QFormLayout *layout, QLabel *&label) { const char *name = obs_property_name(prop); obs_data_t *font_obj = obs_data_get_obj(settings, name); const char *face = obs_data_get_string(font_obj, "face"); const char *style = obs_data_get_string(font_obj, "style"); QPushButton *button = new QPushButton; QLabel *fontLabel = new QLabel; QFont font; font = fontLabel->font(); MakeQFont(font_obj, font); button->setText(QTStr("Basic.PropertiesWindow.SelectFont")); fontLabel->setFrameStyle(QFrame::Sunken | QFrame::Panel); fontLabel->setFont(font); fontLabel->setText(QString("%1 %2").arg(face, style)); fontLabel->setAlignment(Qt::AlignCenter); QHBoxLayout *subLayout = new QHBoxLayout; subLayout->setContentsMargins(0, 0, 0, 0); subLayout->addWidget(fontLabel); subLayout->addWidget(button); WidgetInfo *info = new WidgetInfo(this, prop, fontLabel); connect(button, SIGNAL(clicked()), info, SLOT(ControlChanged())); children.emplace_back(info); label = new QLabel(QT_UTF8(obs_property_description(prop))); layout->addRow(label, subLayout); obs_data_release(font_obj); }
void ParamWidget::SetPrecision(const QString& name, int digits, int decimal_places) { QWidget* widget = GetWidget(name); QSlider* slider = dynamic_cast<QSlider*>(widget); if (slider) { QLabel* label = slider->property("param_widget_label").value<QLabel*>(); if (label) { const QFont& font = label->font(); QFontMetrics font_metrics(font); QString sample_text; for (int i = 0; i < digits; ++i) { sample_text.append('9'); } if (decimal_places) { sample_text.append('.'); } const int width = font_metrics.width(sample_text); QString format_str; format_str.sprintf("%%%d.%df", digits, decimal_places); label->setProperty("format_str", format_str); label->setFixedWidth(width); } } }
InspectorNote::InspectorNote(QWidget* parent) : InspectorBase(parent) { b.setupUi(addWidget()); s.setupUi(addWidget()); c.setupUi(addWidget()); n.setupUi(addWidget()); static const NoteHead::Group heads[] = { NoteHead::Group::HEAD_NORMAL, NoteHead::Group::HEAD_CROSS, NoteHead::Group::HEAD_DIAMOND, NoteHead::Group::HEAD_TRIANGLE, NoteHead::Group::HEAD_SLASH, NoteHead::Group::HEAD_XCIRCLE, NoteHead::Group::HEAD_DO, NoteHead::Group::HEAD_RE, NoteHead::Group::HEAD_MI, NoteHead::Group::HEAD_FA, NoteHead::Group::HEAD_SOL, NoteHead::Group::HEAD_LA, NoteHead::Group::HEAD_TI, NoteHead::Group::HEAD_BREVIS_ALT }; // // fix order of note heads // for (unsigned i = 0; i < sizeof(heads)/sizeof(*heads); ++i) { n.noteHeadGroup->addItem(qApp->translate("noteheadnames", NoteHead::groupToGroupName(heads[i]))); n.noteHeadGroup->setItemData(i, QVariant(int(heads[i]))); } // noteHeadType starts at -1: correct values and count one item more (HEAD_AUTO) for (int i = 0; i <= int(NoteHead::Type::HEAD_TYPES); ++i) n.noteHeadType->setItemData(i, i-1); iList = { { P_ID::COLOR, 0, 0, b.color, b.resetColor }, { P_ID::VISIBLE, 0, 0, b.visible, b.resetVisible }, { P_ID::USER_OFF, 0, 0, b.offsetX, b.resetX }, { P_ID::USER_OFF, 1, 0, b.offsetY, b.resetY }, { P_ID::SMALL, 0, 0, n.small, n.resetSmall }, { P_ID::HEAD_GROUP, 0, 0, n.noteHeadGroup, n.resetNoteHeadGroup }, { P_ID::HEAD_TYPE, 0, 0, n.noteHeadType, n.resetNoteHeadType }, { P_ID::MIRROR_HEAD, 0, 0, n.mirrorHead, n.resetMirrorHead }, { P_ID::DOT_POSITION, 0, 0, n.dotPosition, n.resetDotPosition }, { P_ID::PLAY, 0, 0, n.play, n.resetPlay }, { P_ID::TUNING, 0, 0, n.tuning, n.resetTuning }, { P_ID::VELO_TYPE, 0, 0, n.velocityType, n.resetVelocityType }, { P_ID::VELO_OFFSET, 0, 0, n.velocity, n.resetVelocity }, { P_ID::FIXED, 0, 0, n.fixed, n.resetFixed }, { P_ID::FIXED_LINE, 0, 0, n.fixedLine, n.resetFixedLine }, { P_ID::USER_OFF, 0, 1, c.offsetX, c.resetX }, { P_ID::USER_OFF, 1, 1, c.offsetY, c.resetY }, { P_ID::SMALL, 0, 1, c.small, c.resetSmall }, { P_ID::NO_STEM, 0, 1, c.stemless, c.resetStemless }, { P_ID::STEM_DIRECTION, 0, 1, c.stemDirection, c.resetStemDirection }, { P_ID::LEADING_SPACE, 0, 2, s.leadingSpace, s.resetLeadingSpace }, }; mapSignals(); // // Select // QLabel* l = new QLabel; l->setText(tr("Select")); QFont font(l->font()); font.setBold(true); l->setFont(font); l->setAlignment(Qt::AlignHCenter); _layout->addWidget(l); QFrame* f = new QFrame; f->setFrameStyle(QFrame::HLine | QFrame::Raised); f->setLineWidth(2); _layout->addWidget(f); QHBoxLayout* hbox = new QHBoxLayout; dot1 = new QToolButton(this); dot1->setText(tr("Dot1")); dot1->setEnabled(false); hbox->addWidget(dot1); dot2 = new QToolButton(this); dot2->setText(tr("Dot2")); dot2->setEnabled(false); hbox->addWidget(dot2); dot3 = new QToolButton(this); dot3->setText(tr("Dot3")); dot3->setEnabled(false); hbox->addWidget(dot3); _layout->addLayout(hbox); hbox = new QHBoxLayout; hook = new QToolButton(this); hook->setText(tr("Hook")); hook->setEnabled(false); hbox->addWidget(hook); stem = new QToolButton(this); stem->setText(tr("Stem")); stem->setEnabled(false); hbox->addWidget(stem); beam = new QToolButton(this); beam->setText(tr("Beam")); beam->setEnabled(false); hbox->addWidget(beam); _layout->addLayout(hbox); hbox = new QHBoxLayout; tuplet = new QToolButton(this); tuplet->setText(tr("Tuplet")); tuplet->setEnabled(false); hbox->addWidget(tuplet); _layout->addLayout(hbox); connect(dot1, SIGNAL(clicked()), SLOT(dot1Clicked())); connect(dot2, SIGNAL(clicked()), SLOT(dot2Clicked())); connect(dot3, SIGNAL(clicked()), SLOT(dot3Clicked())); connect(hook, SIGNAL(clicked()), SLOT(hookClicked())); connect(stem, SIGNAL(clicked()), SLOT(stemClicked())); connect(beam, SIGNAL(clicked()), SLOT(beamClicked())); connect(tuplet, SIGNAL(clicked()), SLOT(tupletClicked())); }
InDevelopmentWarning::InDevelopmentWarning(QWidget* parent) : QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint) { QWidget* container = new QWidget(this); QDialogButtonBox* std_buttons = new QDialogButtonBox(QDialogButtonBox::Cancel, Qt::Horizontal, this); QLabel* heading = new QLabel(container); QLabel* icon = new QLabel(container); QLabel* body = new QLabel(container); QCommandLinkButton* btn_dolphinwx = new QCommandLinkButton( tr("Run DolphinWX Instead"), tr("Recommended for normal users"), container); QCommandLinkButton* btn_run = new QCommandLinkButton(tr("Use DolphinQt Anyway"), container); container->setForegroundRole(QPalette::Text); container->setBackgroundRole(QPalette::Base); container->setAutoFillBackground(true); std_buttons->setContentsMargins(10, 0, 10, 0); QFont heading_font{heading->font()}; heading_font.setPointSizeF(heading_font.pointSizeF() * 1.5); heading->setFont(heading_font); heading->setText(tr("DolphinQt Experimental GUI")); heading->setForegroundRole(QPalette::Text); heading->setAlignment(Qt::AlignTop | Qt::AlignLeft); icon->setPixmap(style()->standardPixmap(QStyle::SP_MessageBoxWarning, nullptr, this)); icon->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); QString body_text = tr( "<p>DolphinQt is a new experimental GUI that is eventually intended to replace " "the current GUI based on wxWidgets. The implementation is <b>very " "incomplete</b>, even basic functionality like changing settings and " "attaching gamepads may be missing or not work at all.</p>\n" "<p>Only developers working on the DolphinQt implementation should use it at " "the present time; normal users are recommended to continue using the " "older DolphinWX GUI for the time being.</p>\n" "<p><big><b>Bug Reports:</b></big> At the current time there is no point making bug reports " "about the DolphinQt GUI as the list of what is broken is much longer " "than the list of things that work.</p>\n"); body->setText(body_text); body->setWordWrap(true); body->setForegroundRole(QPalette::Text); body->setAlignment(Qt::AlignTop | Qt::AlignLeft); body->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); btn_dolphinwx->setDefault(true); connect(btn_dolphinwx, &QCommandLinkButton::clicked, this, [this](bool) { if (!LaunchDolphinWX()) QMessageBox::critical( this, tr("Failed to launch"), tr("Could not start DolphinWX. Check for dolphin.exe in the installation directory.")); reject(); }); connect(btn_run, &QCommandLinkButton::clicked, this, [this](bool) { accept(); }); connect(std_buttons->button(QDialogButtonBox::Cancel), &QPushButton::clicked, this, [this](bool) { reject(); }); QVBoxLayout* body_column = new QVBoxLayout(); body_column->addWidget(heading); body_column->addSpacing(10); body_column->addWidget(body); body_column->addWidget(btn_dolphinwx); body_column->addSpacing(10); body_column->addWidget(btn_run); body_column->setMargin(0); body_column->setSpacing(0); QHBoxLayout* icon_layout = new QHBoxLayout(container); icon_layout->addWidget(icon, 0, Qt::AlignTop); icon_layout->addLayout(body_column); icon_layout->setContentsMargins(15, 10, 10, 10); icon_layout->setSpacing(15); QVBoxLayout* top_layout = new QVBoxLayout(this); top_layout->addWidget(container); top_layout->addWidget(std_buttons); top_layout->setSpacing(10); top_layout->setContentsMargins(0, 0, 0, 10); setWindowIcon(Resources::GetMisc(Resources::LOGO_SMALL)); setWindowTitle(tr("DolphinQt2 Experimental GUI")); setMinimumSize(460, 320); resize(minimumSizeHint()); }
void ScoreBrowser::setScores(QFileInfoList& s) { qDeleteAll(scoreLists); scoreLists.clear(); QVBoxLayout* l = static_cast<QVBoxLayout*>(scoreList->layout()); while (l->count()) l->removeItem(l->itemAt(0)); ScoreListWidget* sl = 0; QStringList filter = { "*.mscz" }; if (_showCustomCategory) std::sort(s.begin(), s.end(), [](QFileInfo a, QFileInfo b)->bool { return a.fileName() < b.fileName(); }); QSet<QString> entries; //to avoid duplicates for (const QFileInfo& fi : s) { if (fi.isDir()) { QString s(fi.fileName()); if (!s.isEmpty() && s[0].isNumber() && _stripNumbers) s = s.mid(3); s = s.replace('_', ' '); QLabel* label = new QLabel(s); QFont f = label->font(); f.setBold(true); label->setFont(f); static_cast<QVBoxLayout*>(l)->addWidget(label); QDir dir(fi.filePath()); sl = createScoreList(); l->addWidget(sl); unsigned count = 0; //nbr of entries added for (const QFileInfo& fi : dir.entryInfoList(filter, QDir::Files, QDir::Name)){ if (entries.contains(fi.filePath())) continue; sl->addItem(genScoreItem(fi, sl)); count++; entries.insert(fi.filePath()); } if (count == 0) { delete label; delete sl; } sl = 0; } } for (const QFileInfo& fi : s) { if (fi.isFile()) { QString s = fi.filePath(); if (entries.contains(s)) continue; if (s.endsWith(".mscz") || s.endsWith(".mscx")) { if (!sl) { if (_showCustomCategory) { QLabel* label = new QLabel(tr("Custom Templates")); QFont f = label->font(); f.setBold(true); label->setFont(f); l->insertWidget(2,label); } sl = createScoreList(); l->insertWidget(3,sl); } sl->addItem(genScoreItem(fi, sl)); entries.insert(s); } } } }
tSonarTestDigital::tSonarTestDigital( tHAL& hal, tSonarMaster& SonarMaster, tSonarClient& SonarClient, tSonarSettings& SonarSettings, QWidget* p ) : tTestModule( p, "Sonar Test, Digital" ) , m_HAL( hal ) , m_SonarMaster( SonarMaster ) , m_SonarClient( SonarClient ) , m_SonarSettings( SonarSettings ) { m_Depth = 0.0f; m_Temp = 0.0f; m_WaterSpeed = 0.0f; m_Voltage = 0.0f; m_DepthValid = false; m_TempValid = false; m_WaterSpeedValid = false; m_VoltageValid = false; m_pLayout = new QGridLayout(); m_pDigitalDepth = new QLineEdit( QString( "----" ) ); m_pTemp1 = new QLineEdit( QString( "----" ) ); m_pWaterSpeed = new QLineEdit( QString( "----" ) ); m_pVoltage = new QLineEdit( QString( "----" ) ); m_pDigitalDepth->setFocusPolicy( Qt::NoFocus ); m_pTemp1->setFocusPolicy( Qt::NoFocus ); m_pWaterSpeed->setFocusPolicy( Qt::NoFocus ); m_pVoltage->setFocusPolicy( Qt::NoFocus ); QString toggleBtnStr = m_HAL.PlatformId() == ePlatformStingray2 ? "Power" : "Down Arrow"; QLabel* pLabelInstructions = new QLabel( QString( "Enter to start test\n" + toggleBtnStr + " to toggle temperature" ) ); long fontheight = QFontMetrics( pLabelInstructions->font() ).height(); pLabelInstructions->setMaximumHeight( fontheight * 4 ); QLabel* pLabelDigitalDepth = new QLabel( QString( "Digital Depth (49ft to 51ft)" ) ); m_pLabelTemp1 = new QLabel( QString( "Temp 1 (9 F to 11 F)" ) ); // QLabel* pLabelTemp2 = new QLabel(QString("Temp 2:")); QLabel* pLabelWaterSpeed = new QLabel( QString( "Water speed (59mph to 61mph)" ) ); QLabel* pLabelVoltage = new QLabel( QString( "Voltage (12.85V to 14.15V)" ) ); // m_pLayout->addWidget( pLabelInstructions, 0, 0 ); m_pLayout->addWidget( pLabelDigitalDepth, 1, 0 ); m_pLayout->addWidget( m_pDigitalDepth, 1, 1 ); m_pLayout->addWidget( m_pLabelTemp1, 3, 0 ); m_pLayout->addWidget( m_pTemp1, 3, 1 ); m_pLayout->addWidget( pLabelWaterSpeed, 5, 0 ); m_pLayout->addWidget( m_pWaterSpeed, 5, 1 ); m_pLayout->addWidget( pLabelVoltage, 7, 0 ); m_pLayout->addWidget( m_pVoltage, 7, 1 ); setLayout( m_pLayout ); Connect( &m_SonarClient, SIGNAL( NewDepth( float, bool, float, bool ) ), this, SLOT( NewDepth( float, bool, float, bool ) ) ); #if defined(_WIN32) //Only turn this on for debugging, not on a real unit Connect( &m_SonarSettings, SIGNAL( NewTemperature( float, bool, bool, SonarCommon::eWaterTemperatureInstance ) ), this, SLOT( NewTemperature( float, bool ) ) ); Connect( &m_SonarSettings, SIGNAL( NewSpeed( float, bool, bool ) ), this, SLOT( NewSpeed( float, bool ) ) ); #endif Connect( &m_SonarMaster, SIGNAL( NewTemperature( float, bool, SonarCommon::eWaterTemperatureInstance ) ), this, SLOT( NewTemperature( float, bool ) ) ); Connect( &m_SonarMaster, SIGNAL( NewSpeed( float, bool ) ), this, SLOT( NewSpeed( float, bool ) ) ); m_ShowError = false; m_TimerCount = 0; m_TempTestIndex = 0; startTimer( 100 ); }
MessageComposer::MessageComposer(QWidget *parent) : QWidget(parent), _statusComboBox(new QComboBox(this)), _channelComboBox(new QComboBox(this)), _pitchSpinBox(new QSpinBox(this)), _velocitySpinBox(new QSpinBox(this)), _controlSpinBox(new QSpinBox(this)), _valueSpinBox(new QSpinBox(this)) { _statuses << "Note off" << "Note on" << "Control change" << "Program change" << "Pitch bend" << "Aftertouch" << "Poly Aftertouch" << "Sysex" << "Time code" << "Song pos pointer" << "Song select" << "Sysex end" << "Time clock" << "Start" << "Continue" << "Stop" << "Active sensing" << "System reset"; QGridLayout *mainLayout = new QGridLayout(this); QLabel *heading = new QLabel("Compose Message"); QFont headingFont = heading->font(); headingFont.setBold(true); headingFont.setPointSize(14); heading->setFont(headingFont); mainLayout->addWidget(heading,0,0); mainLayout->addWidget(new QLabel(tr("Channel")), 1,0); QStringList channels; for(int i = 1; i <= 16; i++) { channels << QString::number(i); } _channelComboBox->addItems(channels); mainLayout->addWidget(_channelComboBox,1,1,1,2); mainLayout->addWidget(new QLabel(tr("Status")),2,0); _statusComboBox->addItems(_statuses); connect(_statusComboBox, SIGNAL(currentTextChanged(QString)), this, SLOT(onStatusChange(QString))); mainLayout->addWidget(_statusComboBox, 2,1,1,2); mainLayout->addWidget(new QLabel(tr("Pitch")),3,0); _pitchSpinBox->setRange(0,127); mainLayout->addWidget(_pitchSpinBox, 3,1,1,2); mainLayout->addWidget(new QLabel(tr("Velocity")),4,0); _velocitySpinBox->setRange(0,127); mainLayout->addWidget(_velocitySpinBox, 4,1,1,2); mainLayout->addWidget(new QLabel(tr("Control")),5,0); _controlSpinBox->setRange(0,127); mainLayout->addWidget(_controlSpinBox, 5,1,1,2); mainLayout->addWidget(new QLabel(tr("Value")),6,0); _valueSpinBox->setRange(0,127); mainLayout->addWidget(_valueSpinBox, 6,1,1,2); mainLayout->setSpacing(0); mainLayout->setMargin(0); setLayout(mainLayout); onStatusChange(_statusComboBox->currentText()); }
QBalloonTip::QBalloonTip(QSystemTrayIcon::MessageIcon icon, const QString& title, const QString& message, QSystemTrayIcon *ti) : QWidget(0, Qt::ToolTip), trayIcon(ti), timerId(-1) { setAttribute(Qt::WA_DeleteOnClose); QObject::connect(ti, SIGNAL(destroyed()), this, SLOT(close())); QLabel *titleLabel = new QLabel; titleLabel->installEventFilter(this); titleLabel->setText(title); QFont f = titleLabel->font(); f.setBold(true); #ifdef Q_WS_WINCE f.setPointSize(f.pointSize() - 2); #endif titleLabel->setFont(f); titleLabel->setTextFormat(Qt::PlainText); // to maintain compat with windows #ifdef Q_WS_WINCE const int iconSize = style()->pixelMetric(QStyle::PM_SmallIconSize); const int closeButtonSize = style()->pixelMetric(QStyle::PM_SmallIconSize) - 2; #else const int iconSize = 18; const int closeButtonSize = 15; #endif QPushButton *closeButton = new QPushButton; closeButton->setIcon(style()->standardIcon(QStyle::SP_TitleBarCloseButton)); closeButton->setIconSize(QSize(closeButtonSize, closeButtonSize)); closeButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); closeButton->setFixedSize(closeButtonSize, closeButtonSize); QObject::connect(closeButton, SIGNAL(clicked()), this, SLOT(close())); QLabel *msgLabel = new QLabel; #ifdef Q_WS_WINCE f.setBold(false); msgLabel->setFont(f); #endif msgLabel->installEventFilter(this); msgLabel->setText(message); msgLabel->setTextFormat(Qt::PlainText); msgLabel->setAlignment(Qt::AlignTop | Qt::AlignLeft); // smart size for the message label #ifdef Q_WS_WINCE int limit = QApplication::desktop()->availableGeometry(msgLabel).size().width() / 2; #else int limit = QApplication::desktop()->availableGeometry(msgLabel).size().width() / 3; #endif if (msgLabel->sizeHint().width() > limit) { msgLabel->setWordWrap(true); if (msgLabel->sizeHint().width() > limit) { msgLabel->d_func()->ensureTextControl(); if (QTextControl *control = msgLabel->d_func()->control) { QTextOption opt = control->document()->defaultTextOption(); opt.setWrapMode(QTextOption::WrapAnywhere); control->document()->setDefaultTextOption(opt); } } #ifdef Q_WS_WINCE // Make sure that the text isn't wrapped "somewhere" in the balloon widget // in the case that we have a long title label. setMaximumWidth(limit); #else // Here we allow the text being much smaller than the balloon widget // to emulate the weird standard windows behavior. msgLabel->setFixedSize(limit, msgLabel->heightForWidth(limit)); #endif } QIcon si; switch (icon) { case QSystemTrayIcon::Warning: si = style()->standardIcon(QStyle::SP_MessageBoxWarning); break; case QSystemTrayIcon::Critical: si = style()->standardIcon(QStyle::SP_MessageBoxCritical); break; case QSystemTrayIcon::Information: si = style()->standardIcon(QStyle::SP_MessageBoxInformation); break; case QSystemTrayIcon::NoIcon: default: break; } QGridLayout *layout = new QGridLayout; if (!si.isNull()) { QLabel *iconLabel = new QLabel; iconLabel->setPixmap(si.pixmap(iconSize, iconSize)); iconLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); iconLabel->setMargin(2); layout->addWidget(iconLabel, 0, 0); layout->addWidget(titleLabel, 0, 1); } else { layout->addWidget(titleLabel, 0, 0, 1, 2); } layout->addWidget(closeButton, 0, 2); layout->addWidget(msgLabel, 1, 0, 1, 3); layout->setSizeConstraint(QLayout::SetFixedSize); layout->setMargin(3); setLayout(layout); QPalette pal = palette(); pal.setColor(QPalette::Window, QColor(0xff, 0xff, 0xe1)); pal.setColor(QPalette::WindowText, Qt::black); setPalette(pal); }
void MainBottomFirstWidget::initUI() { m_safeButton = new StaticButton(":/main/safe_check"); QLabel *safeLabel = new QLabel(QStringLiteral("查杀修复")); safeLabel->setObjectName("mainBottomLabel"); QVBoxLayout *safeLayout = new QVBoxLayout; safeLayout->addWidget(m_safeButton, 0, Qt::AlignCenter); safeLayout->addWidget(safeLabel, 0, Qt::AlignCenter); m_cleanButton = new StaticButton(":/main/clean"); QLabel *cleanLabel = new QLabel(QStringLiteral("电脑清理")); cleanLabel->setObjectName("mainBottomLabel"); QVBoxLayout *cleanLayout = new QVBoxLayout; cleanLayout->addWidget(m_cleanButton, 0, Qt::AlignCenter); cleanLayout->addWidget(cleanLabel, 0, Qt::AlignCenter); m_youhuaButton = new StaticButton(":/main/youhua"); QLabel *youhuaLabel = new QLabel(QStringLiteral("优化加速")); youhuaLabel->setObjectName("mainBottomLabel"); QVBoxLayout *youhuaLayout = new QVBoxLayout; youhuaLayout->addWidget(m_youhuaButton, 0, Qt::AlignCenter); youhuaLayout->addWidget(youhuaLabel, 0, Qt::AlignCenter); QHBoxLayout *staticLayout = new QHBoxLayout; staticLayout->addLayout(safeLayout); staticLayout->addLayout(cleanLayout); staticLayout->addLayout(youhuaLayout); staticLayout->setContentsMargins(10, 20, 10, 10); QLabel *routerTitle = new QLabel(QStringLiteral("路由器卫士")); QFont font = routerTitle->font(); font.setBold(true); font.setPixelSize(15); routerTitle->setFont(font); QLabel *routerDes = new QLabel(QStringLiteral("帮您免费升级为智能路由器")); QVBoxLayout *routerTextLayout = new QVBoxLayout; routerTextLayout->addWidget(routerTitle, 0, Qt::AlignRight); routerTextLayout->addWidget(routerDes, 0, Qt::AlignRight); routerTextLayout->setContentsMargins(10, 10, 5, 15); StaticButton *routerButton = new StaticButton(":/main/routerdefender"); QHBoxLayout *routerLayout = new QHBoxLayout; routerLayout->addLayout(routerTextLayout); routerLayout->addWidget(routerButton); QStringList advIconList, advNameList; advIconList << "360SoftManger" << "360JiShi" << "360MobileMgr" << "NetSpeed"; advNameList << QStringLiteral("软件管家") << QStringLiteral("人工服务") << QStringLiteral("手机助手") << QStringLiteral("宽带测速器") ; QHBoxLayout *advLayout = new QHBoxLayout; for(int i=0; i<advIconList.size(); i++) { BackgroundButton *backButton = new BackgroundButton; backButton->setIconsInfo(":/main/" + advIconList.at(i), ":/main/all_tool_bk", 1); backButton->setText(advNameList.at(i)); advLayout->addWidget(backButton); } m_advtoolMore = new StaticButton(":/main/advtool_more"); ButtonLabel *advLabel = new ButtonLabel; advLabel->setStyleSheet("QLabel{color:blue;}"); advLabel->setText(QStringLiteral("更多")); QVBoxLayout *moreLayout = new QVBoxLayout; moreLayout->addStretch(); moreLayout->addWidget(m_advtoolMore, 0, Qt::AlignCenter); moreLayout->addSpacing(5); moreLayout->addWidget(advLabel, 0, Qt::AlignCenter); moreLayout->addStretch(); advLayout->addLayout(moreLayout); QVBoxLayout *rightLayout = new QVBoxLayout; rightLayout->addLayout(routerLayout); rightLayout->addLayout(advLayout); QHBoxLayout *mainLayout = new QHBoxLayout; mainLayout->addLayout(staticLayout); mainLayout->addStretch(); mainLayout->addLayout(rightLayout); this->setLayout(mainLayout); }
void RecipeWidget::init(HeadcookerWindow *win) { ui->setupUi(this); this->win = win; ui->bodyWidget->setObjectName("body"); ui->instructions->setObjectName("instructions"); ui->instructions->verticalScrollBar()->setObjectName("scrollbar"); ui->backButton->setObjectName("backButton"); ui->tagWidget->setObjectName("tagBox"); ui->ingredientBox->setObjectName("ingredientBox"); ui->instructionBox->setObjectName("instructionBox"); ui->recipeName->setObjectName("headline"); ui->subtitle->setObjectName("subtitle"); ui->servingsText->setObjectName("metaInfo"); ui->servingsEdit->setObjectName("inputArea"); connect(ui->backButton, SIGNAL(clicked()), this, SLOT(back())); ui->recipeName->setText(recipe->getTitle()); ui->subtitle->setText(recipe->getSubtitle()); ui->instructions->setText(recipe->getInstructions()); updateIngredients(); //Metainformations ui->servingsEdit->setText(QString::number(recipe->getServings())); if (ui->metaInfoWidget->layout() != NULL) delete ui->metaInfoWidget->layout(); FlowLayout *metaInfoLayout = new FlowLayout; ui->metaInfoWidget->setLayout(metaInfoLayout); for (QPair<QString, QString> metaInfo : recipe->getMetaInfo()) { QLabel *name = new QLabel(metaInfo.first); name->setObjectName("metaInfo"); QFont font = name->font(); font.setBold(true); name->setFont(font); QLabel *value = new QLabel(metaInfo.second); value->setObjectName("text"); metaInfoLayout->addWidget(name); metaInfoLayout->addWidget(value); } //Tags if (ui->tagWidget->layout()) { delete ui->tagWidget->layout(); } tagLayout = new FlowLayout; ui->tagWidget->setLayout(tagLayout); for (QString tag : recipe->getTags()) { addTag(tag); } ui->servingsEdit->setValidator(new QDoubleValidator); addAddTagButton(); connect(&leftClickMapper, SIGNAL(mapped(QString)), this, SLOT(leftClick(QString))); connect(&rightClickMapper, SIGNAL(mapped(QString)), this, SLOT(rightClick(QString))); connect(Options::ptr(), SIGNAL(updated()), this, SLOT(updateStylesheet())); connect(ui->servingsEdit, SIGNAL(textChanged(QString)), this, SLOT(updateIngredients(QString))); updateStylesheet(); }
// The following two functions are very big. Lots of code is necessay for // dynamically build guis. void DisplayArea::setupChannels() { this->labelConnect->setClickable(false); QSettings settings; settings.beginGroup(setcon::DEVICE_GROUP); settings.beginGroup(settings.value(setcon::DEVICE_ACTIVE).toString()); if (settings.contains(setcon::DEVICE_PORT)) { // if there is a device we must enable the connect button. this->labelConnect->setClickable(true); // TODO: One could make this more intelligent and only create / delete // channels that are (no longer) needed. // remove all channels from the frame if there are any. Happens if the // user changes the device specs or chooses another one. for (auto f : this->channelFramesVec) { utils::clearLayout(f->layout()); this->frameChannels->layout()->removeWidget(f); delete (f); } // clear the vector this->channelFramesVec.clear(); this->chanwVector.clear(); // create the frames that control one channel for (int i = 1; i <= settings.value(setcon::DEVICE_CHANNELS).toInt(); i++) { std::shared_ptr<ChannelWidgets> chanw = std::make_shared<ChannelWidgets>(); QFrame *channelFrameContainer = new QFrame(); channelFrameContainer->setLayout(new QVBoxLayout()); channelFrameContainer->setObjectName("ch" + QString::number(i) + "Container"); // this is the container frame QString frameQss = QString("QFrame#%1 {border: 1px solid ") + globcon::GREENCOLOR + ";}"; channelFrameContainer->setStyleSheet( frameQss.arg(channelFrameContainer->objectName())); channelFrameContainer->layout()->setSpacing(0); channelFrameContainer->layout()->setContentsMargins(QMargins()); this->frameChannels->layout()->addWidget(channelFrameContainer); // now the frame for the electrical values V, A, W. QFrame *vawFrame = new QFrame(); vawFrame->setObjectName("ch" + QString::number(i) + "vawFrame"); QString vawFrameQss = QString("QFrame#%1 {border-bottom: 1px solid ") + globcon::GREENCOLOR + ";}"; vawFrame->setStyleSheet(vawFrameQss.arg(vawFrame->objectName())); QGridLayout *vawLayout = new QGridLayout(); vawFrame->setLayout(vawLayout); channelFrameContainer->layout()->addWidget(vawFrame); vawLayout->addWidget(new QLabel("CH" + QString::number(i)), 0, 0, 1, 0, Qt::AlignLeft); chanw->voltageActual = new QLabel("0.00"); QFont actualFont = chanw->voltageActual->font(); actualFont.setPointSize(20); chanw->voltageActual->setAlignment(Qt::AlignRight | Qt::AlignVCenter); chanw->voltageActual->setStyleSheet( QString("QLabel {padding-right: 0.5em;}")); chanw->voltageActual->setFont(actualFont); chanw->currentActual = new QLabel("0.000"); chanw->currentActual->setAlignment(Qt::AlignRight | Qt::AlignVCenter); chanw->currentActual->setStyleSheet( QString("QLabel {padding-right: 0.5em;}")); chanw->currentActual->setFont(actualFont); chanw->wattageActual = new QLabel("0.000"); chanw->wattageActual->setAlignment(Qt::AlignRight | Qt::AlignVCenter); chanw->wattageActual->setStyleSheet( QString("QLabel {padding-right: 0.5em;}")); chanw->wattageActual->setFont(actualFont); vawLayout->addWidget(chanw->voltageActual, 1, 0); vawLayout->addWidget(chanw->currentActual, 2, 0); vawLayout->addWidget(chanw->wattageActual, 3, 0); QLabel *vActualUnit = new QLabel("V"); vActualUnit->setSizePolicy(QSizePolicy::Policy::Fixed, QSizePolicy::Policy::Preferred); vActualUnit->setAlignment(Qt::AlignTop); QLabel *aActualUnit = new QLabel("A"); aActualUnit->setSizePolicy(QSizePolicy::Policy::Fixed, QSizePolicy::Policy::Preferred); aActualUnit->setAlignment(Qt::AlignTop); QLabel *wActualUnit = new QLabel("W"); wActualUnit->setSizePolicy(QSizePolicy::Policy::Fixed, QSizePolicy::Policy::Preferred); wActualUnit->setAlignment(Qt::AlignTop); vawLayout->addWidget(vActualUnit, 1, 1); vawLayout->addWidget(aActualUnit, 2, 1); vawLayout->addWidget(wActualUnit, 3, 1); QFrame *bottomContainer = new QFrame(); bottomContainer->setLayout(new QHBoxLayout()); channelFrameContainer->layout()->addWidget(bottomContainer); bottomContainer->layout()->setSpacing(0); bottomContainer->layout()->setContentsMargins(QMargins()); QFrame *setContainer = new QFrame(); setContainer->setObjectName("ch" + QString::number(i) + "setContainer"); QGridLayout *setContLayout = new QGridLayout(); setContainer->setLayout(setContLayout); QString setContainerQss = QString("QFrame#%1 {border-right: 1px solid ") + globcon::GREENCOLOR + ";}"; setContainer->setStyleSheet( setContainerQss.arg(setContainer->objectName())); chanw->voltageSet = new ClickableLabel("0.00"); chanw->currentSet = new ClickableLabel("0.000"); chanw->voltageSet->setAlignment(Qt::AlignRight | Qt::AlignVCenter); chanw->currentSet->setAlignment(Qt::AlignRight | Qt::AlignVCenter); // Now the lambdas for the set widgets QObject::connect( chanw->voltageSet, &ClickableLabel::doubleClick, [this, chanw, i](QPoint pos, double value) { this->controlValuesDialog( std::move(pos), chanw->voltageSet, global_constants::LPQ_DATATYPE::SETVOLTAGE, value); if (this->valuesDialog->exec()) { emit this->doubleValueChanged( this->valuesDialogData->voltage, static_cast<int>( global_constants::LPQ_DATATYPE::SETVOLTAGE), i); } }); QObject::connect( chanw->currentSet, &ClickableLabel::doubleClick, [this, chanw, i](QPoint pos, double value) { this->controlValuesDialog( std::move(pos), chanw->currentSet, global_constants::LPQ_DATATYPE::SETCURRENT, value); if (this->valuesDialog->exec()) { emit this->doubleValueChanged( this->valuesDialogData->current, static_cast<int>( global_constants::LPQ_DATATYPE::SETCURRENT), i); } }); QLabel *setLabel = new QLabel("Set"); setLabel->setAlignment(Qt::AlignCenter); QLabel *voltageSetUnit = new QLabel("V"); QFont bottomUnitFont = voltageSetUnit->font(); bottomUnitFont.setPointSize(8); voltageSetUnit->setFont(bottomUnitFont); voltageSetUnit->setSizePolicy(QSizePolicy::Policy::Fixed, QSizePolicy::Policy::Preferred); voltageSetUnit->setAlignment(Qt::AlignTop); QLabel *currentSetUnit = new QLabel("A"); currentSetUnit->setFont(bottomUnitFont); currentSetUnit->setSizePolicy(QSizePolicy::Policy::Fixed, QSizePolicy::Policy::Preferred); currentSetUnit->setAlignment(Qt::AlignTop); setContLayout->addWidget(setLabel, 0, 0, 1, 0); setContLayout->addWidget(chanw->voltageSet, 1, 0); setContLayout->addWidget(voltageSetUnit, 1, 1); setContLayout->addWidget(chanw->currentSet, 2, 0); setContLayout->addWidget(currentSetUnit, 2, 1); QFrame *modeOutputContainer = new QFrame(); modeOutputContainer->setLayout(new QVBoxLayout()); modeOutputContainer->layout()->setSpacing(0); modeOutputContainer->layout()->setContentsMargins(QMargins()); QFrame *modeContainer = new QFrame(); modeContainer->setLayout(new QHBoxLayout()); modeContainer->setObjectName("ch" + QString::number(i) + "modeContainer"); QString modeContainerQss = QString("QFrame#%1 {border-bottom: 1px solid ") + globcon::GREENCOLOR + ";}"; modeContainer->setStyleSheet( modeContainerQss.arg(modeContainer->objectName())); QLabel *modeLabel = new QLabel("Mode"); chanw->modeActual = new QLabel("CV"); modeContainer->layout()->addWidget(modeLabel); modeContainer->layout()->addWidget(chanw->modeActual); QFrame *outputContainer = new QFrame(); outputContainer->setLayout(new QHBoxLayout()); QLabel *outputLabel = new QLabel("Output"); chanw->outputSet = new ClickableLabel("Off"); chanw->outputSet->setNoReturnValue(true); QObject::connect( chanw->outputSet, &ClickableLabel::doubleClickNoValue, [this, chanw, i]() { emit this->deviceControlValueChanged( static_cast<int>(global_constants::LPQ_CONTROL::OUTPUT), i); }); outputContainer->layout()->addWidget(outputLabel); outputContainer->layout()->addWidget(chanw->outputSet); modeOutputContainer->layout()->addWidget(modeContainer); modeOutputContainer->layout()->addWidget(outputContainer); bottomContainer->layout()->addWidget(setContainer); bottomContainer->layout()->addWidget(modeOutputContainer); this->channelFramesVec.push_back(channelFrameContainer); // move semantics are needed here because unique_ptr does not allow // copying what push_back actually does. this->chanwVector.push_back(std::move(chanw)); } } }
void JointManager::initFrames(std::vector<std::string> jointList) { // Clear layout for (unsigned i = 0; i < jointViews.size(); i++) delete jointViews[i]; jointViews.clear(); // Init labels for joints QLabel *jointsLabel = new QLabel("Joint"); jointsLabel->setAlignment(Qt::AlignCenter); QFont font = jointsLabel->font(); font.setBold(true); jointsLabel->setFont(font); jointsLayout->addWidget(jointsLabel, 0, 1); this->createHeaderLabels(PosVelEffView::LEFT, 0); this->createHeaderLabels(PosVelEffView::RIGHT, 0); // Init joints int row = 1; int id = 0; findAndPutView(jointList, "head_pitch", "Head Pitch", row++, PosVelEffView::NO_PAIR, id++, false); findAndPutView(jointList, "neck_yaw", "Head Yaw", row++, PosVelEffView::NO_PAIR, id++, false); for(int i = 0; i < 3; i++) // gap between blocks jointsLayout->addWidget(createLine(), row, i); row++; findAndPutView(jointList, "left_shoulder_pitch", "Shoulder Pitch", row, PosVelEffView::LEFT, id++, false); findAndPutView(jointList, "right_shoulder_pitch", "Shoulder Pitch", row++, PosVelEffView::RIGHT, id++, false); findAndPutView(jointList, "left_shoulder_roll", "Shoulder Roll", row, PosVelEffView::LEFT, id++, true); findAndPutView(jointList, "right_shoulder_roll", "Shoulder Roll", row++, PosVelEffView::RIGHT, id++, true); findAndPutView(jointList, "left_elbow_pitch", "Elbow Pitch", row, PosVelEffView::LEFT, id++, false); findAndPutView(jointList, "right_elbow_pitch", "Elbow Pitch",row++, PosVelEffView::RIGHT, id++, false); for(int i = 0; i < 3; i++) // gap between blocks jointsLayout->addWidget(createLine(), row, i); row++; findAndPutView(jointList, "left_hip_yaw", "Hip Yaw", row, PosVelEffView::LEFT, id++, true); findAndPutView(jointList, "right_hip_yaw", "Hip Yaw", row++, PosVelEffView::RIGHT, id++, true); findAndPutView(jointList, "left_hip_roll", "Hip Roll", row, PosVelEffView::LEFT, id++, true); findAndPutView(jointList, "right_hip_roll", "Hip Roll", row++, PosVelEffView::RIGHT, id++, true); findAndPutView(jointList, "left_hip_pitch", "Hip Pitch", row, PosVelEffView::LEFT, id++, false); findAndPutView(jointList, "right_hip_pitch", "Hip Pitch", row++, PosVelEffView::RIGHT, id++, false); for(int i = 0; i < 3; i++) // gap between blocks jointsLayout->addWidget(createLine(), row, i); row++; findAndPutView(jointList, "left_knee_pitch", "Knee Pitch", row, PosVelEffView::LEFT, id++, false); findAndPutView(jointList, "right_knee_pitch", "Knee Pitch",row++, PosVelEffView::RIGHT, id++, false); findAndPutView(jointList, "left_ankle_pitch", "Ankle Pitch", row, PosVelEffView::LEFT, id++, false); findAndPutView(jointList, "right_ankle_pitch", "Ankle Pitch", row++, PosVelEffView::RIGHT, id++, false); findAndPutView(jointList, "left_ankle_roll", "Ankle Roll", row, PosVelEffView::LEFT, id++, true); findAndPutView(jointList, "right_ankle_roll", "Ankle Roll", row++, PosVelEffView::RIGHT, id++, true); jointsLayout->setMargin(0); jointsLayout->setSpacing(0); jointsLayout->setContentsMargins(0,0,0,0); }
ConverterConfigurationEditDialog::ConverterConfigurationEditDialog(QWidget *parent) : QDialog(parent), showToolTips(true) { // layouts auto mainLayout = new QVBoxLayout; auto fileExtenstionsLayout = new QHBoxLayout; auto inputFileExtLayout = new QVBoxLayout; auto outputFileExtLayout = new QVBoxLayout; auto executablePathLayout = new QHBoxLayout; auto downloadLocationLayout = new QHBoxLayout; // Widgets enabledCheckbox = new QCheckBox(tr("Enabled")); priorityEdit = new QLineEdit; nameEdit = new QLineEdit; commentEdit = new QTextEdit; downloadLocationEdit = new QLineEdit; openURLButton = new QPushButton(tr("Launch")); inputFileExtEdit = new QLineEdit; outputFileExtEdit = new QLineEdit; executableEdit = new QLineEdit; executablePathEdit = new FancyLineEdit; executablePathBrowseButton = new QPushButton(tr("Browse ...")); commandLineEdit = new QLineEdit; dialogButtonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); // labels executablePathLabel = new QLabel(tr("Path of Executable")); QLabel* heading = new QLabel(tr("Edit External Converter Settings")); QLabel* priorityLabel = new QLabel(tr("Priority")); QLabel* nameLabel = new QLabel(tr("Name")); QLabel* commentLabel = new QLabel(tr("Comments")); QLabel* downloadLocationLabel = new QLabel(tr("Link to Download / Information")); QLabel* inputFileExtLabel = new QLabel(tr("Input File Extension")); QLabel* outputFileExtLabel = new QLabel(tr("Output File Extension")); QLabel* executableLabel = new QLabel(tr("Executable")); QLabel* commandLineLabel = new QLabel(tr("Command Line Arguments")); // set fonts QFont f = heading->font(); QFont headingFont{f}; headingFont.setPointSize(f.pointSize() + 2); heading->setFont(headingFont); // configure widgets heading->setAlignment(Qt::AlignHCenter); executablePathEdit->hideEditButton(); QFontMetrics m(commentEdit->font()); commentEdit->setMaximumHeight(10 * m.lineSpacing()); // set tooltips executablePathEdit->setToolTip(tr("Filename of actual converter program")); openURLButton->setToolTip(tr("Open link in Browser")); commandLineEdit->setToolTip(tr("Use {i} for Input File and {o} for Output File")); // hide things priorityLabel->setHidden(true); priorityEdit->setHidden(true); executableLabel->setHidden(true); executableEdit->setHidden(true); // attach mainLayout->addWidget(heading); mainLayout->addSpacing(12); mainLayout->addWidget(enabledCheckbox); mainLayout->addSpacing(6); mainLayout->addWidget(nameLabel); mainLayout->addWidget(nameEdit); mainLayout->addWidget(priorityLabel); mainLayout->addWidget(priorityEdit); inputFileExtLayout->addWidget(inputFileExtLabel); inputFileExtLayout->addWidget(inputFileExtEdit); outputFileExtLayout->addWidget(outputFileExtLabel); outputFileExtLayout->addWidget(outputFileExtEdit); fileExtenstionsLayout->addLayout(inputFileExtLayout); fileExtenstionsLayout->addLayout(outputFileExtLayout); mainLayout->addLayout(fileExtenstionsLayout); mainLayout->addWidget(executableLabel); mainLayout->addWidget(executableEdit); mainLayout->addWidget(executablePathLabel); executablePathLayout->addWidget(executablePathEdit); executablePathLayout->addWidget(executablePathBrowseButton); mainLayout->addLayout(executablePathLayout); mainLayout->addWidget(commandLineLabel); mainLayout->addWidget(commandLineEdit); mainLayout->addWidget(commentLabel); mainLayout->addWidget(commentEdit); mainLayout->addWidget(downloadLocationLabel); downloadLocationLayout->addWidget(downloadLocationEdit); downloadLocationLayout->addWidget(openURLButton); mainLayout->addLayout(downloadLocationLayout); mainLayout->addSpacing(12); mainLayout->addStretch(); mainLayout->addWidget(dialogButtonBox); // set main Layout this->setLayout(mainLayout); setContentsMargins(12, 12, 12, 12); // connect signals / slots connect(executablePathBrowseButton, &QPushButton::clicked, this, [this] { promptForExecutableLocation(); }); connect(openURLButton, &QPushButton::clicked, this, [this] { QDesktopServices::openUrl(QUrl(downloadLocationEdit->text())); }); connect(dialogButtonBox, &QDialogButtonBox::accepted, this, &QDialog::accept); connect(dialogButtonBox, &QDialogButtonBox::rejected, this, &QDialog::reject); }
SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) : m_bufferSize( ConfigManager::inst()->value( "mixer", "framesperaudiobuffer" ).toInt() ), m_toolTips( !ConfigManager::inst()->value( "tooltips", "disabled" ).toInt() ), m_warnAfterSetup( !ConfigManager::inst()->value( "app", "nomsgaftersetup" ).toInt() ), m_displaydBV( ConfigManager::inst()->value( "app", "displaydbv" ).toInt() ), m_MMPZ( !ConfigManager::inst()->value( "app", "nommpz" ).toInt() ), m_disableBackup( !ConfigManager::inst()->value( "app", "disablebackup" ).toInt() ), m_hqAudioDev( ConfigManager::inst()->value( "mixer", "hqaudio" ).toInt() ), m_lang( ConfigManager::inst()->value( "app", "language" ) ), m_workingDir( QDir::toNativeSeparators( ConfigManager::inst()->workingDir() ) ), m_vstDir( QDir::toNativeSeparators( ConfigManager::inst()->vstDir() ) ), m_artworkDir( QDir::toNativeSeparators( ConfigManager::inst()->artworkDir() ) ), m_flDir( QDir::toNativeSeparators( ConfigManager::inst()->flDir() ) ), m_ladDir( QDir::toNativeSeparators( ConfigManager::inst()->ladspaDir() ) ), m_gigDir( QDir::toNativeSeparators( ConfigManager::inst()->gigDir() ) ), m_sf2Dir( QDir::toNativeSeparators( ConfigManager::inst()->sf2Dir() ) ), #ifdef LMMS_HAVE_FLUIDSYNTH m_defaultSoundfont( QDir::toNativeSeparators( ConfigManager::inst()->defaultSoundfont() ) ), #endif #ifdef LMMS_HAVE_STK m_stkDir( QDir::toNativeSeparators( ConfigManager::inst()->stkDir() ) ), #endif m_backgroundArtwork( QDir::toNativeSeparators( ConfigManager::inst()->backgroundArtwork() ) ), m_smoothScroll( ConfigManager::inst()->value( "ui", "smoothscroll" ).toInt() ), m_enableAutoSave( ConfigManager::inst()->value( "ui", "enableautosave" ).toInt() ), m_oneInstrumentTrackWindow( ConfigManager::inst()->value( "ui", "oneinstrumenttrackwindow" ).toInt() ), m_compactTrackButtons( ConfigManager::inst()->value( "ui", "compacttrackbuttons" ).toInt() ), m_syncVSTPlugins( ConfigManager::inst()->value( "ui", "syncvstplugins" ).toInt() ), m_animateAFP(ConfigManager::inst()->value( "ui", "animateafp").toInt() ), m_printNoteLabels(ConfigManager::inst()->value( "ui", "printnotelabels").toInt() ), m_displayWaveform(ConfigManager::inst()->value( "ui", "displaywaveform").toInt() ), m_disableAutoQuit(ConfigManager::inst()->value( "ui", "disableautoquit").toInt() ) { setWindowIcon( embed::getIconPixmap( "setup_general" ) ); setWindowTitle( tr( "Setup LMMS" ) ); setModal( true ); Engine::projectJournal()->setJournalling( false ); QVBoxLayout * vlayout = new QVBoxLayout( this ); vlayout->setSpacing( 0 ); vlayout->setMargin( 0 ); QWidget * settings = new QWidget( this ); QHBoxLayout * hlayout = new QHBoxLayout( settings ); hlayout->setSpacing( 0 ); hlayout->setMargin( 0 ); m_tabBar = new TabBar( settings, QBoxLayout::TopToBottom ); m_tabBar->setExclusive( true ); m_tabBar->setFixedWidth( 72 ); QWidget * ws = new QWidget( settings ); int wsHeight = 370; #ifdef LMMS_HAVE_STK wsHeight += 50; #endif #ifdef LMMS_HAVE_FLUIDSYNTH wsHeight += 50; #endif ws->setFixedSize( 360, wsHeight ); QWidget * general = new QWidget( ws ); general->setFixedSize( 360, 240 ); QVBoxLayout * gen_layout = new QVBoxLayout( general ); gen_layout->setSpacing( 0 ); gen_layout->setMargin( 0 ); labelWidget( general, tr( "General settings" ) ); TabWidget * bufsize_tw = new TabWidget( tr( "BUFFER SIZE" ), general ); bufsize_tw->setFixedHeight( 80 ); m_bufSizeSlider = new QSlider( Qt::Horizontal, bufsize_tw ); m_bufSizeSlider->setRange( 1, 256 ); m_bufSizeSlider->setTickPosition( QSlider::TicksBelow ); m_bufSizeSlider->setPageStep( 8 ); m_bufSizeSlider->setTickInterval( 8 ); m_bufSizeSlider->setGeometry( 10, 16, 340, 18 ); m_bufSizeSlider->setValue( m_bufferSize / 64 ); connect( m_bufSizeSlider, SIGNAL( valueChanged( int ) ), this, SLOT( setBufferSize( int ) ) ); m_bufSizeLbl = new QLabel( bufsize_tw ); m_bufSizeLbl->setGeometry( 10, 40, 200, 24 ); setBufferSize( m_bufSizeSlider->value() ); QPushButton * bufsize_reset_btn = new QPushButton( embed::getIconPixmap( "reload" ), "", bufsize_tw ); bufsize_reset_btn->setGeometry( 290, 40, 28, 28 ); connect( bufsize_reset_btn, SIGNAL( clicked() ), this, SLOT( resetBufSize() ) ); ToolTip::add( bufsize_reset_btn, tr( "Reset to default-value" ) ); QPushButton * bufsize_help_btn = new QPushButton( embed::getIconPixmap( "help" ), "", bufsize_tw ); bufsize_help_btn->setGeometry( 320, 40, 28, 28 ); connect( bufsize_help_btn, SIGNAL( clicked() ), this, SLOT( displayBufSizeHelp() ) ); TabWidget * misc_tw = new TabWidget( tr( "MISC" ), general ); const int XDelta = 10; const int YDelta = 18; const int HeaderSize = 30; int labelNumber = 0; LedCheckBox * enable_tooltips = new LedCheckBox( tr( "Enable tooltips" ), misc_tw ); labelNumber++; enable_tooltips->move( XDelta, YDelta*labelNumber ); enable_tooltips->setChecked( m_toolTips ); connect( enable_tooltips, SIGNAL( toggled( bool ) ), this, SLOT( toggleToolTips( bool ) ) ); LedCheckBox * restart_msg = new LedCheckBox( tr( "Show restart warning after changing settings" ), misc_tw ); labelNumber++; restart_msg->move( XDelta, YDelta*labelNumber ); restart_msg->setChecked( m_warnAfterSetup ); connect( restart_msg, SIGNAL( toggled( bool ) ), this, SLOT( toggleWarnAfterSetup( bool ) ) ); LedCheckBox * dbv = new LedCheckBox( tr( "Display volume as dBV " ), misc_tw ); labelNumber++; dbv->move( XDelta, YDelta*labelNumber ); dbv->setChecked( m_displaydBV ); connect( dbv, SIGNAL( toggled( bool ) ), this, SLOT( toggleDisplaydBV( bool ) ) ); LedCheckBox * mmpz = new LedCheckBox( tr( "Compress project files per default" ), misc_tw ); labelNumber++; mmpz->move( XDelta, YDelta*labelNumber ); mmpz->setChecked( m_MMPZ ); connect( mmpz, SIGNAL( toggled( bool ) ), this, SLOT( toggleMMPZ( bool ) ) ); LedCheckBox * oneitw = new LedCheckBox( tr( "One instrument track window mode" ), misc_tw ); labelNumber++; oneitw->move( XDelta, YDelta*labelNumber ); oneitw->setChecked( m_oneInstrumentTrackWindow ); connect( oneitw, SIGNAL( toggled( bool ) ), this, SLOT( toggleOneInstrumentTrackWindow( bool ) ) ); LedCheckBox * hqaudio = new LedCheckBox( tr( "HQ-mode for output audio-device" ), misc_tw ); labelNumber++; hqaudio->move( XDelta, YDelta*labelNumber ); hqaudio->setChecked( m_hqAudioDev ); connect( hqaudio, SIGNAL( toggled( bool ) ), this, SLOT( toggleHQAudioDev( bool ) ) ); LedCheckBox * compacttracks = new LedCheckBox( tr( "Compact track buttons" ), misc_tw ); labelNumber++; compacttracks->move( XDelta, YDelta*labelNumber ); compacttracks->setChecked( m_compactTrackButtons ); connect( compacttracks, SIGNAL( toggled( bool ) ), this, SLOT( toggleCompactTrackButtons( bool ) ) ); LedCheckBox * syncVST = new LedCheckBox( tr( "Sync VST plugins to host playback" ), misc_tw ); labelNumber++; syncVST->move( XDelta, YDelta*labelNumber ); syncVST->setChecked( m_syncVSTPlugins ); connect( syncVST, SIGNAL( toggled( bool ) ), this, SLOT( toggleSyncVSTPlugins( bool ) ) ); LedCheckBox * noteLabels = new LedCheckBox( tr( "Enable note labels in piano roll" ), misc_tw ); labelNumber++; noteLabels->move( XDelta, YDelta*labelNumber ); noteLabels->setChecked( m_printNoteLabels ); connect( noteLabels, SIGNAL( toggled( bool ) ), this, SLOT( toggleNoteLabels( bool ) ) ); LedCheckBox * displayWaveform = new LedCheckBox( tr( "Enable waveform display by default" ), misc_tw ); labelNumber++; displayWaveform->move( XDelta, YDelta*labelNumber ); displayWaveform->setChecked( m_displayWaveform ); connect( displayWaveform, SIGNAL( toggled( bool ) ), this, SLOT( toggleDisplayWaveform( bool ) ) ); LedCheckBox * disableAutoquit = new LedCheckBox( tr( "Keep effects running even without input" ), misc_tw ); labelNumber++; disableAutoquit->move( XDelta, YDelta*labelNumber ); disableAutoquit->setChecked( m_disableAutoQuit ); connect( disableAutoquit, SIGNAL( toggled( bool ) ), this, SLOT( toggleDisableAutoquit( bool ) ) ); LedCheckBox * disableBackup = new LedCheckBox( tr( "Create backup file when saving a project" ), misc_tw ); labelNumber++; disableBackup->move( XDelta, YDelta*labelNumber ); disableBackup->setChecked( m_disableBackup ); connect( disableBackup, SIGNAL( toggled( bool ) ), this, SLOT( toggleDisableBackup( bool ) ) ); misc_tw->setFixedHeight( YDelta*labelNumber + HeaderSize ); TabWidget * lang_tw = new TabWidget( tr( "LANGUAGE" ), general ); lang_tw->setFixedHeight( 48 ); QComboBox * changeLang = new QComboBox( lang_tw ); changeLang->move( XDelta, YDelta ); QDir dir( ConfigManager::inst()->localeDir() ); QStringList fileNames = dir.entryList( QStringList( "*.qm" ) ); for( int i = 0; i < fileNames.size(); ++i ) { // get locale extracted by filename fileNames[i].truncate( fileNames[i].lastIndexOf( '.' ) ); m_languages.append( fileNames[i] ); QString lang = QLocale( m_languages.last() ).nativeLanguageName(); changeLang->addItem( lang ); } connect( changeLang, SIGNAL( currentIndexChanged( int ) ), this, SLOT( setLanguage( int ) ) ); //If language unset, fallback to system language when available if( m_lang == "" ) { QString tmp = QLocale::system().name().left( 2 ); if( m_languages.contains( tmp ) ) { m_lang = tmp; } else { m_lang = "en"; } } for( int i = 0; i < changeLang->count(); ++i ) { if( m_lang == m_languages.at( i ) ) { changeLang->setCurrentIndex( i ); break; } } gen_layout->addWidget( bufsize_tw ); gen_layout->addSpacing( 10 ); gen_layout->addWidget( misc_tw ); gen_layout->addSpacing( 10 ); gen_layout->addWidget( lang_tw ); gen_layout->addStretch(); QWidget * paths = new QWidget( ws ); int pathsHeight = 370; #ifdef LMMS_HAVE_STK pathsHeight += 55; #endif #ifdef LMMS_HAVE_FLUIDSYNTH pathsHeight += 55; #endif paths->setFixedSize( 360, pathsHeight ); QVBoxLayout * dir_layout = new QVBoxLayout( paths ); dir_layout->setSpacing( 0 ); dir_layout->setMargin( 0 ); labelWidget( paths, tr( "Paths" ) ); QLabel * title = new QLabel( tr( "Directories" ), paths ); QFont f = title->font(); f.setBold( true ); title->setFont( pointSize<12>( f ) ); QScrollArea *pathScroll = new QScrollArea( paths ); QWidget *pathSelectors = new QWidget( ws ); QVBoxLayout *pathSelectorLayout = new QVBoxLayout; pathScroll->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOn ); pathScroll->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); pathScroll->resize( 362, pathsHeight - 50 ); pathScroll->move( 0, 30 ); pathSelectors->resize( 360, pathsHeight - 50 ); const int txtLength = 285; const int btnStart = 305; // working-dir TabWidget * lmms_wd_tw = new TabWidget( tr( "LMMS working directory" ).toUpper(), pathSelectors ); lmms_wd_tw->setFixedHeight( 48 ); m_wdLineEdit = new QLineEdit( m_workingDir, lmms_wd_tw ); m_wdLineEdit->setGeometry( 10, 20, txtLength, 16 ); connect( m_wdLineEdit, SIGNAL( textChanged( const QString & ) ), this, SLOT( setWorkingDir( const QString & ) ) ); QPushButton * workingdir_select_btn = new QPushButton( embed::getIconPixmap( "project_open", 16, 16 ), "", lmms_wd_tw ); workingdir_select_btn->setFixedSize( 24, 24 ); workingdir_select_btn->move( btnStart, 16 ); connect( workingdir_select_btn, SIGNAL( clicked() ), this, SLOT( openWorkingDir() ) ); // artwork-dir TabWidget * artwork_tw = new TabWidget( tr( "Themes directory" ).toUpper(), pathSelectors ); artwork_tw->setFixedHeight( 48 ); m_adLineEdit = new QLineEdit( m_artworkDir, artwork_tw ); m_adLineEdit->setGeometry( 10, 20, txtLength, 16 ); connect( m_adLineEdit, SIGNAL( textChanged( const QString & ) ), this, SLOT( setArtworkDir( const QString & ) ) ); QPushButton * artworkdir_select_btn = new QPushButton( embed::getIconPixmap( "project_open", 16, 16 ), "", artwork_tw ); artworkdir_select_btn->setFixedSize( 24, 24 ); artworkdir_select_btn->move( btnStart, 16 ); connect( artworkdir_select_btn, SIGNAL( clicked() ), this, SLOT( openArtworkDir() ) ); // background artwork file TabWidget * backgroundArtwork_tw = new TabWidget( tr( "Background artwork" ).toUpper(), paths ); backgroundArtwork_tw->setFixedHeight( 48 ); m_baLineEdit = new QLineEdit( m_backgroundArtwork, backgroundArtwork_tw ); m_baLineEdit->setGeometry( 10, 20, txtLength, 16 ); connect( m_baLineEdit, SIGNAL( textChanged( const QString & ) ), this, SLOT( setBackgroundArtwork( const QString & ) ) ); QPushButton * backgroundartworkdir_select_btn = new QPushButton( embed::getIconPixmap( "project_open", 16, 16 ), "", backgroundArtwork_tw ); backgroundartworkdir_select_btn->setFixedSize( 24, 24 ); backgroundartworkdir_select_btn->move( btnStart, 16 ); connect( backgroundartworkdir_select_btn, SIGNAL( clicked() ), this, SLOT( openBackgroundArtwork() ) ); // FL Studio-dir TabWidget * fl_tw = new TabWidget( tr( "FL Studio installation directory" ).toUpper(), paths ); fl_tw->setFixedHeight( 48 ); m_fdLineEdit = new QLineEdit( m_flDir, fl_tw ); m_fdLineEdit->setGeometry( 10, 20, txtLength, 16 ); connect( m_fdLineEdit, SIGNAL( textChanged( const QString & ) ), this, SLOT( setFLDir( const QString & ) ) ); QPushButton * fldir_select_btn = new QPushButton( embed::getIconPixmap( "project_open", 16, 16 ), "", fl_tw ); fldir_select_btn->setFixedSize( 24, 24 ); fldir_select_btn->move( btnStart, 16 ); connect( fldir_select_btn, SIGNAL( clicked() ), this, SLOT( openFLDir() ) ); // vst-dir TabWidget * vst_tw = new TabWidget( tr( "VST-plugin directory" ).toUpper(), pathSelectors ); vst_tw->setFixedHeight( 48 ); m_vdLineEdit = new QLineEdit( m_vstDir, vst_tw ); m_vdLineEdit->setGeometry( 10, 20, txtLength, 16 ); connect( m_vdLineEdit, SIGNAL( textChanged( const QString & ) ), this, SLOT( setVSTDir( const QString & ) ) ); QPushButton * vstdir_select_btn = new QPushButton( embed::getIconPixmap( "project_open", 16, 16 ), "", vst_tw ); vstdir_select_btn->setFixedSize( 24, 24 ); vstdir_select_btn->move( btnStart, 16 ); connect( vstdir_select_btn, SIGNAL( clicked() ), this, SLOT( openVSTDir() ) ); // gig-dir TabWidget * gig_tw = new TabWidget( tr( "GIG directory" ).toUpper(), pathSelectors ); gig_tw->setFixedHeight( 48 ); m_gigLineEdit = new QLineEdit( m_gigDir, gig_tw ); m_gigLineEdit->setGeometry( 10, 20, txtLength, 16 ); connect( m_gigLineEdit, SIGNAL( textChanged( const QString & ) ), this, SLOT( setGIGDir( const QString & ) ) ); QPushButton * gigdir_select_btn = new QPushButton( embed::getIconPixmap( "project_open", 16, 16 ), "", gig_tw ); gigdir_select_btn->setFixedSize( 24, 24 ); gigdir_select_btn->move( btnStart, 16 ); connect( gigdir_select_btn, SIGNAL( clicked() ), this, SLOT( openGIGDir() ) ); // sf2-dir TabWidget * sf2_tw = new TabWidget( tr( "SF2 directory" ).toUpper(), pathSelectors ); sf2_tw->setFixedHeight( 48 ); m_sf2LineEdit = new QLineEdit( m_sf2Dir, sf2_tw ); m_sf2LineEdit->setGeometry( 10, 20, txtLength, 16 ); connect( m_sf2LineEdit, SIGNAL( textChanged( const QString & ) ), this, SLOT( setSF2Dir( const QString & ) ) ); QPushButton * sf2dir_select_btn = new QPushButton( embed::getIconPixmap( "project_open", 16, 16 ), "", sf2_tw ); sf2dir_select_btn->setFixedSize( 24, 24 ); sf2dir_select_btn->move( btnStart, 16 ); connect( sf2dir_select_btn, SIGNAL( clicked() ), this, SLOT( openSF2Dir() ) ); // LADSPA-dir TabWidget * lad_tw = new TabWidget( tr( "LADSPA plugin directories" ).toUpper(), paths ); lad_tw->setFixedHeight( 48 ); m_ladLineEdit = new QLineEdit( m_ladDir, lad_tw ); m_ladLineEdit->setGeometry( 10, 20, txtLength, 16 ); connect( m_ladLineEdit, SIGNAL( textChanged( const QString & ) ), this, SLOT( setLADSPADir( const QString & ) ) ); QPushButton * laddir_select_btn = new QPushButton( embed::getIconPixmap( "add_folder", 16, 16 ), "", lad_tw ); laddir_select_btn->setFixedSize( 24, 24 ); laddir_select_btn->move( btnStart, 16 ); connect( laddir_select_btn, SIGNAL( clicked() ), this, SLOT( openLADSPADir() ) ); #ifdef LMMS_HAVE_STK // STK-dir TabWidget * stk_tw = new TabWidget( tr( "STK rawwave directory" ).toUpper(), paths ); stk_tw->setFixedHeight( 48 ); m_stkLineEdit = new QLineEdit( m_stkDir, stk_tw ); m_stkLineEdit->setGeometry( 10, 20, txtLength, 16 ); connect( m_stkLineEdit, SIGNAL( textChanged( const QString & ) ), this, SLOT( setSTKDir( const QString & ) ) ); QPushButton * stkdir_select_btn = new QPushButton( embed::getIconPixmap( "project_open", 16, 16 ), "", stk_tw ); stkdir_select_btn->setFixedSize( 24, 24 ); stkdir_select_btn->move( btnStart, 16 ); connect( stkdir_select_btn, SIGNAL( clicked() ), this, SLOT( openSTKDir() ) ); #endif #ifdef LMMS_HAVE_FLUIDSYNTH // Soundfont TabWidget * sf_tw = new TabWidget( tr( "Default Soundfont File" ).toUpper(), paths ); sf_tw->setFixedHeight( 48 ); m_sfLineEdit = new QLineEdit( m_defaultSoundfont, sf_tw ); m_sfLineEdit->setGeometry( 10, 20, txtLength, 16 ); connect( m_sfLineEdit, SIGNAL( textChanged( const QString & ) ), this, SLOT( setDefaultSoundfont( const QString & ) ) ); QPushButton * sf_select_btn = new QPushButton( embed::getIconPixmap( "project_open", 16, 16 ), "", sf_tw ); sf_select_btn->setFixedSize( 24, 24 ); sf_select_btn->move( btnStart, 16 ); connect( sf_select_btn, SIGNAL( clicked() ), this, SLOT( openDefaultSoundfont() ) ); #endif pathSelectors->setLayout( pathSelectorLayout ); pathSelectorLayout->addWidget( lmms_wd_tw ); pathSelectorLayout->addSpacing( 10 ); pathSelectorLayout->addWidget( gig_tw ); pathSelectorLayout->addSpacing( 10 ); pathSelectorLayout->addWidget( sf2_tw ); pathSelectorLayout->addSpacing( 10 ); pathSelectorLayout->addWidget( vst_tw ); pathSelectorLayout->addSpacing( 10 ); pathSelectorLayout->addWidget( lad_tw ); #ifdef LMMS_HAVE_STK pathSelectorLayout->addSpacing( 10 ); pathSelectorLayout->addWidget( stk_tw ); #endif #ifdef LMMS_HAVE_FLUIDSYNTH pathSelectorLayout->addSpacing( 10 ); pathSelectorLayout->addWidget( sf_tw ); #endif pathSelectorLayout->addWidget( fl_tw ); pathSelectorLayout->addSpacing( 10 ); pathSelectorLayout->addWidget( artwork_tw ); pathSelectorLayout->addSpacing( 10 ); pathSelectorLayout->addStretch(); pathSelectorLayout->addWidget( backgroundArtwork_tw ); pathSelectorLayout->addSpacing( 10 ); dir_layout->addWidget( pathSelectors ); pathScroll->setWidget( pathSelectors ); pathScroll->setWidgetResizable( true ); QWidget * performance = new QWidget( ws ); performance->setFixedSize( 360, 240 ); QVBoxLayout * perf_layout = new QVBoxLayout( performance ); perf_layout->setSpacing( 0 ); perf_layout->setMargin( 0 ); labelWidget( performance, tr( "Performance settings" ) ); TabWidget * ui_fx_tw = new TabWidget( tr( "UI effects vs. " "performance" ).toUpper(), performance ); ui_fx_tw->setFixedHeight( 80 ); LedCheckBox * smoothScroll = new LedCheckBox( tr( "Smooth scroll in Song Editor" ), ui_fx_tw ); smoothScroll->move( 10, 20 ); smoothScroll->setChecked( m_smoothScroll ); connect( smoothScroll, SIGNAL( toggled( bool ) ), this, SLOT( toggleSmoothScroll( bool ) ) ); LedCheckBox * autoSave = new LedCheckBox( tr( "Enable auto save feature" ), ui_fx_tw ); autoSave->move( 10, 40 ); autoSave->setChecked( m_enableAutoSave ); connect( autoSave, SIGNAL( toggled( bool ) ), this, SLOT( toggleAutoSave( bool ) ) ); LedCheckBox * animAFP = new LedCheckBox( tr( "Show playback cursor in AudioFileProcessor" ), ui_fx_tw ); animAFP->move( 10, 60 ); animAFP->setChecked( m_animateAFP ); connect( animAFP, SIGNAL( toggled( bool ) ), this, SLOT( toggleAnimateAFP( bool ) ) ); perf_layout->addWidget( ui_fx_tw ); perf_layout->addStretch(); QWidget * audio = new QWidget( ws ); audio->setFixedSize( 360, 200 ); QVBoxLayout * audio_layout = new QVBoxLayout( audio ); audio_layout->setSpacing( 0 ); audio_layout->setMargin( 0 ); labelWidget( audio, tr( "Audio settings" ) ); TabWidget * audioiface_tw = new TabWidget( tr( "AUDIO INTERFACE" ), audio ); audioiface_tw->setFixedHeight( 60 ); m_audioInterfaces = new QComboBox( audioiface_tw ); m_audioInterfaces->setGeometry( 10, 20, 240, 22 ); QPushButton * audio_help_btn = new QPushButton( embed::getIconPixmap( "help" ), "", audioiface_tw ); audio_help_btn->setGeometry( 320, 20, 28, 28 ); connect( audio_help_btn, SIGNAL( clicked() ), this, SLOT( displayAudioHelp() ) ); // create ifaces-settings-widget QWidget * asw = new QWidget( audio ); asw->setFixedHeight( 60 ); QHBoxLayout * asw_layout = new QHBoxLayout( asw ); asw_layout->setSpacing( 0 ); asw_layout->setMargin( 0 ); //asw_layout->setAutoAdd( true ); #ifdef LMMS_HAVE_JACK m_audioIfaceSetupWidgets[AudioJack::name()] = new AudioJack::setupWidget( asw ); #endif #ifdef LMMS_HAVE_ALSA m_audioIfaceSetupWidgets[AudioAlsa::name()] = new AudioAlsaSetupWidget( asw ); #endif #ifdef LMMS_HAVE_PULSEAUDIO m_audioIfaceSetupWidgets[AudioPulseAudio::name()] = new AudioPulseAudio::setupWidget( asw ); #endif #ifdef LMMS_HAVE_PORTAUDIO m_audioIfaceSetupWidgets[AudioPortAudio::name()] = new AudioPortAudio::setupWidget( asw ); #endif #ifdef LMMS_HAVE_SDL m_audioIfaceSetupWidgets[AudioSdl::name()] = new AudioSdl::setupWidget( asw ); #endif #ifdef LMMS_HAVE_OSS m_audioIfaceSetupWidgets[AudioOss::name()] = new AudioOss::setupWidget( asw ); #endif m_audioIfaceSetupWidgets[AudioDummy::name()] = new AudioDummy::setupWidget( asw ); for( AswMap::iterator it = m_audioIfaceSetupWidgets.begin(); it != m_audioIfaceSetupWidgets.end(); ++it ) { m_audioIfaceNames[tr( it.key().toLatin1())] = it.key(); } for( trMap::iterator it = m_audioIfaceNames.begin(); it != m_audioIfaceNames.end(); ++it ) { QWidget * audioWidget = m_audioIfaceSetupWidgets[it.value()]; audioWidget->hide(); asw_layout->addWidget( audioWidget ); m_audioInterfaces->addItem( it.key() ); } QString audioDevName = ConfigManager::inst()->value( "mixer", "audiodev" ); if( audioDevName.length() == 0 ) { audioDevName = Engine::mixer()->audioDevName(); ConfigManager::inst()->setValue( "mixer", "audiodev", audioDevName ); } m_audioInterfaces-> setCurrentIndex( m_audioInterfaces->findText( audioDevName ) ); m_audioIfaceSetupWidgets[audioDevName]->show(); connect( m_audioInterfaces, SIGNAL( activated( const QString & ) ), this, SLOT( audioInterfaceChanged( const QString & ) ) ); audio_layout->addWidget( audioiface_tw ); audio_layout->addSpacing( 20 ); audio_layout->addWidget( asw ); audio_layout->addStretch(); QWidget * midi = new QWidget( ws ); QVBoxLayout * midi_layout = new QVBoxLayout( midi ); midi_layout->setSpacing( 0 ); midi_layout->setMargin( 0 ); labelWidget( midi, tr( "MIDI settings" ) ); TabWidget * midiiface_tw = new TabWidget( tr( "MIDI INTERFACE" ), midi ); midiiface_tw->setFixedHeight( 60 ); m_midiInterfaces = new QComboBox( midiiface_tw ); m_midiInterfaces->setGeometry( 10, 20, 240, 22 ); QPushButton * midi_help_btn = new QPushButton( embed::getIconPixmap( "help" ), "", midiiface_tw ); midi_help_btn->setGeometry( 320, 20, 28, 28 ); connect( midi_help_btn, SIGNAL( clicked() ), this, SLOT( displayMIDIHelp() ) ); // create ifaces-settings-widget QWidget * msw = new QWidget( midi ); msw->setFixedHeight( 60 ); QHBoxLayout * msw_layout = new QHBoxLayout( msw ); msw_layout->setSpacing( 0 ); msw_layout->setMargin( 0 ); //msw_layout->setAutoAdd( true ); #ifdef LMMS_HAVE_ALSA m_midiIfaceSetupWidgets[MidiAlsaSeq::name()] = MidiSetupWidget::create<MidiAlsaSeq>( msw ); m_midiIfaceSetupWidgets[MidiAlsaRaw::name()] = MidiSetupWidget::create<MidiAlsaRaw>( msw ); #endif #ifdef LMMS_HAVE_OSS m_midiIfaceSetupWidgets[MidiOss::name()] = MidiSetupWidget::create<MidiOss>( msw ); #endif #ifdef LMMS_BUILD_WIN32 m_midiIfaceSetupWidgets[MidiWinMM::name()] = MidiSetupWidget::create<MidiWinMM>( msw ); #endif #ifdef LMMS_BUILD_APPLE m_midiIfaceSetupWidgets[MidiApple::name()] = MidiSetupWidget::create<MidiApple>( msw ); #endif m_midiIfaceSetupWidgets[MidiDummy::name()] = MidiSetupWidget::create<MidiDummy>( msw ); for( MswMap::iterator it = m_midiIfaceSetupWidgets.begin(); it != m_midiIfaceSetupWidgets.end(); ++it ) { m_midiIfaceNames[tr( it.key().toLatin1())] = it.key(); } for( trMap::iterator it = m_midiIfaceNames.begin(); it != m_midiIfaceNames.end(); ++it ) { QWidget * midiWidget = m_midiIfaceSetupWidgets[it.value()]; midiWidget->hide(); msw_layout->addWidget( midiWidget ); m_midiInterfaces->addItem( it.key() ); } QString midiDevName = ConfigManager::inst()->value( "mixer", "mididev" ); if( midiDevName.length() == 0 ) { midiDevName = Engine::mixer()->midiClientName(); ConfigManager::inst()->setValue( "mixer", "mididev", midiDevName ); } m_midiInterfaces->setCurrentIndex( m_midiInterfaces->findText( midiDevName ) ); m_midiIfaceSetupWidgets[midiDevName]->show(); connect( m_midiInterfaces, SIGNAL( activated( const QString & ) ), this, SLOT( midiInterfaceChanged( const QString & ) ) ); midi_layout->addWidget( midiiface_tw ); midi_layout->addSpacing( 20 ); midi_layout->addWidget( msw ); midi_layout->addStretch(); m_tabBar->addTab( general, tr( "General settings" ), 0, false, true )->setIcon( embed::getIconPixmap( "setup_general" ) ); m_tabBar->addTab( paths, tr( "Paths" ), 1, false, true )->setIcon( embed::getIconPixmap( "setup_directories" ) ); m_tabBar->addTab( performance, tr( "Performance settings" ), 2, false, true )->setIcon( embed::getIconPixmap( "setup_performance" ) ); m_tabBar->addTab( audio, tr( "Audio settings" ), 3, false, true )->setIcon( embed::getIconPixmap( "setup_audio" ) ); m_tabBar->addTab( midi, tr( "MIDI settings" ), 4, true, true )->setIcon( embed::getIconPixmap( "setup_midi" ) ); m_tabBar->setActiveTab( _tab_to_open ); hlayout->addWidget( m_tabBar ); hlayout->addSpacing( 10 ); hlayout->addWidget( ws ); hlayout->addSpacing( 10 ); hlayout->addStretch(); QWidget * buttons = new QWidget( this ); QHBoxLayout * btn_layout = new QHBoxLayout( buttons ); btn_layout->setSpacing( 0 ); btn_layout->setMargin( 0 ); QPushButton * ok_btn = new QPushButton( embed::getIconPixmap( "apply" ), tr( "OK" ), buttons ); connect( ok_btn, SIGNAL( clicked() ), this, SLOT( accept() ) ); QPushButton * cancel_btn = new QPushButton( embed::getIconPixmap( "cancel" ), tr( "Cancel" ), buttons ); connect( cancel_btn, SIGNAL( clicked() ), this, SLOT( reject() ) ); btn_layout->addStretch(); btn_layout->addSpacing( 10 ); btn_layout->addWidget( ok_btn ); btn_layout->addSpacing( 10 ); btn_layout->addWidget( cancel_btn ); btn_layout->addSpacing( 10 ); vlayout->addWidget( settings ); vlayout->addSpacing( 10 ); vlayout->addWidget( buttons ); vlayout->addSpacing( 10 ); vlayout->addStretch(); show(); }
void PlotDataFitFunctionWidget::initialize() { QProcessorWidget::initialize(); QGridLayout* mainLayout = new QGridLayout(this); QLabel* label = new QLabel(this); label->setText(QString(tr("Fitting Function",0))); label->setAlignment(Qt::AlignHCenter); QFont font = label->font(); font.setBold(true); font.setPointSize(14); label->setFont(font); mainLayout->addWidget(label,0,0,1,3); widgetVector_.push_back(label); label = new QLabel(this); label->setText(QString(tr("Function:",0))); label->setFixedWidth(100); mainLayout->addWidget(label,1,0,1,1); widgetVector_.push_back(label); QTextEdit* textedit = new QTextEdit(QString(tr("No FitFunction Selected",0)),this); textedit->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); textedit->setReadOnly(true); textedit->setMaximumHeight(200); textedit->setMinimumHeight(20); mainLayout->addWidget(textedit,1,1,1,2); widgetVector_.push_back(textedit); label = new QLabel(this); label->setText(QString(tr("Fittingcolumn:",0))); label->setFixedWidth(100); mainLayout->addWidget(label,2,0,1,1); widgetVector_.push_back(label); label = new QLabel(this); label->setText(QString(tr("Column-Value",0))); mainLayout->addWidget(label,2,1,1,1); widgetVector_.push_back(label); label = new QLabel(this); label->setText(QString(tr("MSE:",0))); label->setFixedWidth(100); mainLayout->addWidget(label,3,0,1,1); widgetVector_.push_back(label); label = new QLabel(this); label->setText(QString(tr("MSE-Value",0))); mainLayout->addWidget(label,3,1,1,1); widgetVector_.push_back(label); delete proxyModel_; proxyModel_ = new PlotDataExtendedTableModel(NULL, std::vector<std::pair<int,std::string> >(0), this); table_ = new ExtendedTable(this); table_->setModel(proxyModel_); table_->setSortingEnabled(false); table_->verticalHeader()->hide(); table_->resizeColumnsToContents(); table_->setMinimumHeight(150); mainLayout->addWidget(table_, 4, 0, 1, 3); table_->setContextMenuPolicy(Qt::CustomContextMenu); table_->horizontalHeader()->setContextMenuPolicy(Qt::CustomContextMenu); QObject::connect(table_,SIGNAL(customContextMenuRequested(const QPoint&)),this,SLOT(tableContextMenu(const QPoint&))); QObject::connect(table_->horizontalHeader(),SIGNAL(customContextMenuRequested(const QPoint&)),this,SLOT(tableContextMenu(const QPoint&))); setLayout(mainLayout); for (size_t i = 1; i < widgetVector_.size(); ++i) { widgetVector_[i]->setVisible(false); } //show(); initialized_ = true; }
QmitkMoveROIToolGUI::QmitkMoveROIToolGUI() :QmitkToolGUI() { //std::cout << "hi from " << __FUNCSIG__ << std::endl; // create the visible widgets QBoxLayout* verticalLayout = new QVBoxLayout( this ); QBoxLayout* horizontalLayout = new QHBoxLayout(); verticalLayout->addLayout(horizontalLayout); QBoxLayout* horizontalLayout1 = new QHBoxLayout(); verticalLayout->addLayout(horizontalLayout1); QBoxLayout* horizontalLayout2 = new QHBoxLayout(); verticalLayout->addLayout(horizontalLayout2); QBoxLayout* horizontalLayout3 = new QHBoxLayout(); verticalLayout->addLayout(horizontalLayout3); QBoxLayout* horizontalLayout4 = new QHBoxLayout(); verticalLayout->addLayout(horizontalLayout4); QBoxLayout* horizontalLayout5 = new QHBoxLayout(); verticalLayout->addLayout(horizontalLayout5); QBoxLayout* horizontalLayout6 = new QHBoxLayout(); verticalLayout->addLayout(horizontalLayout6); m_SelectSurfaceBox = new QComboBox(); horizontalLayout->addWidget(m_SelectSurfaceBox); connect(m_SelectSurfaceBox, SIGNAL(activated(int)), this, SLOT(SelectSurface(int))); QPushButton* pbtn_JumpToPosition = new QPushButton(); pbtn_JumpToPosition->setText("Jump to Position"); horizontalLayout->addWidget(pbtn_JumpToPosition); connect(pbtn_JumpToPosition, SIGNAL(clicked()), this, SLOT(JumpToPosition())); QLabel* label = new QLabel( "Radius", this ); QFont f = label->font(); f.setBold(false); label->setFont( f ); horizontalLayout1->addWidget(label); m_RadiusSlider = new QSlider(Qt::Horizontal); m_RadiusSlider->setSliderPosition(20); horizontalLayout1->addWidget(m_RadiusSlider); QObject::connect(m_RadiusSlider, SIGNAL(sliderMoved(int)), this, SLOT(RadiusChanged(int))); QPushButton* pbtn_CreateSurface = new QPushButton(); pbtn_CreateSurface->setText("Create Surface"); horizontalLayout2->addWidget(pbtn_CreateSurface); connect(pbtn_CreateSurface, SIGNAL(clicked()), this, SLOT(CombineSurfaces())); QPushButton* pbtn_Bulging = new QPushButton(); pbtn_Bulging->setText("Bulging"); horizontalLayout2->addWidget(pbtn_Bulging); connect(pbtn_Bulging, SIGNAL(clicked()), this, SLOT(Bulging())); QPushButton* pbtn_PatchHoles = new QPushButton(); pbtn_PatchHoles->setText("Patch Holes"); horizontalLayout3->addWidget(pbtn_PatchHoles); connect(pbtn_PatchHoles, SIGNAL(clicked()), this, SLOT(PatchHoles())); QPushButton* pbtn_SmoothROI = new QPushButton(); pbtn_SmoothROI->setText("Smooth ROI"); horizontalLayout3->addWidget(pbtn_SmoothROI); connect(pbtn_SmoothROI, SIGNAL(clicked()), this, SLOT(SmoothROI())); QLabel* label2 = new QLabel( "Smooth Iterations", this ); QFont f2 = label2->font(); f2.setBold(false); label2->setFont( f2 ); horizontalLayout4->addWidget(label2); QSlider* smoothSlider = new QSlider(Qt::Horizontal); smoothSlider->setSliderPosition(5); horizontalLayout4->addWidget(smoothSlider); QObject::connect(smoothSlider, SIGNAL(sliderMoved(int)), this, SLOT(SmoothChanged(int))); QPushButton* pbtn_Subdivide = new QPushButton(); pbtn_Subdivide->setText("Subdivide Surface"); horizontalLayout5->addWidget(pbtn_Subdivide); connect(pbtn_Subdivide, SIGNAL(clicked()), this, SLOT(Subdivide())); QPushButton* pbtn_SubdivideVOI = new QPushButton(); pbtn_SubdivideVOI->setText("Subdivide VOI"); horizontalLayout5->addWidget(pbtn_SubdivideVOI); connect(pbtn_SubdivideVOI, SIGNAL(clicked()), this, SLOT(SubdivideVOI())); QPushButton* pbtn_ColorSurface = new QPushButton(); pbtn_ColorSurface->setText("Color Surface"); horizontalLayout6->addWidget(pbtn_ColorSurface); connect(pbtn_ColorSurface, SIGNAL(clicked()), this, SLOT(ColorSurface())); connect( this, SIGNAL(NewToolAssociated(mitk::Tool*)), this, SLOT(OnNewToolAssociated(mitk::Tool*)) ); //std::cout << "ciao from " << __FUNCSIG__ << std::endl; }
//-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- void AboutDialog::create() { // Only allowed to call once assert(!m_isCreated); // Only show app info if app name is non-empty bool showAppInfo = !m_appName.isEmpty(); // Do an initial resize, dialog will resize itself later based on the widgets we have added resize(10, 10); // Set caption, different text depending on whether we're showing app info or not QString dlgCaption = "Version Information Details"; if (showAppInfo) { dlgCaption = "About " + m_appName; if (m_isDebugBuild) dlgCaption += " (DEBUG)"; } setWindowTitle(dlgCaption); // Create the dialog's main layout QVBoxLayout* dlgMainLayout = new QVBoxLayout(this); // The the top layout QVBoxLayout* topLayout = new QVBoxLayout; topLayout->setSpacing(3); // Possibly create and set text for widgets with app info if (showAppInfo) { QVBoxLayout* appInfoLayout = new QVBoxLayout; appInfoLayout->setSpacing(3); // Always do app name assert(!m_appName.isEmpty()); QLabel* appNameLabel = new QLabel(this); QFont appNameFont(appNameLabel->font()); appNameFont.setPointSize(14); appNameFont.setBold(true); appNameLabel->setFont(appNameFont); appNameLabel->setText(m_appName); appInfoLayout->addWidget(appNameLabel); // Application version if specified if (!m_appVersion.isEmpty()) { QString appVer = m_appVersion; // appVer += cvf::System::is64Bit() ? " (64-bit)" : " (32-bit)"; QLabel* appVersionLabel = new QLabel(this); QFont appVersionFont(appVersionLabel->font()); appVersionFont.setPointSize(8); appVersionFont.setBold(TRUE); appVersionLabel->setFont(appVersionFont); appVersionLabel->setText(appVer); appInfoLayout->addWidget(appVersionLabel); } // Application copyright if specified if (!m_appCopyright.isEmpty()) { QLabel* appCopyrightLabel = new QLabel(this); QFont appCopyrightFont(appCopyrightLabel->font()); appCopyrightFont.setPointSize(8); appCopyrightFont.setBold(TRUE); appCopyrightLabel->setFont(appCopyrightFont); appCopyrightLabel->setText(m_appCopyright); appInfoLayout->addWidget(appCopyrightLabel); } QFrame* line = new QFrame(this); line->setProperty("frameShape", (int)QFrame::HLine); line->setFrameShadow(QFrame::Sunken); line->setFrameShape(QFrame::HLine); appInfoLayout->addWidget(line); topLayout->addLayout(appInfoLayout); } // Possibly show extend version info if (m_showQtVersion || m_verLabels.size() > 0) { QGridLayout* verInfoLayout = new QGridLayout; verInfoLayout->setSpacing(0); int insertRow = 0; // Qt version if (m_showQtVersion) { addStringPairToVerInfoLayout("Qt ver.: ", qVersion(), verInfoLayout, insertRow++); } // Custom specified labels if (m_verLabels.size() > 0) { assert(m_verLabels.size() == m_verTexts.size()); int i; for (i = 0; i < m_verLabels.size(); i++) { addStringPairToVerInfoLayout(m_verLabels[i], m_verTexts[i], verInfoLayout, insertRow++); } } topLayout->addLayout(verInfoLayout); } dlgMainLayout->addLayout(topLayout); QSpacerItem* spacer1 = new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding); dlgMainLayout->addItem(spacer1); // The bottom part with the OK button and // possibly text label indicating that we're running a debug build QHBoxLayout* bottomLayout = new QHBoxLayout; // Indicate that this is a debug build if (m_isDebugBuild) { QLabel* debugLabel = new QLabel(this); debugLabel->setText("<font color='brown'><b>This is a DEBUG build...</b></font>"); bottomLayout->addWidget(debugLabel); } // Add OK button QSpacerItem* spacer2 = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum); bottomLayout->addItem(spacer2); QPushButton* buttonOk = new QPushButton("&OK", this); buttonOk->setAutoDefault(TRUE); buttonOk->setDefault(TRUE); buttonOk->setFocus(); connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept()) ); bottomLayout->addWidget(buttonOk); dlgMainLayout->addLayout(bottomLayout); m_isCreated = true; }
InstrumentMidiIOView::InstrumentMidiIOView( QWidget* parent ) : QWidget( parent ), ModelView( NULL, this ), m_rpBtn( NULL ), m_wpBtn( NULL ) { QVBoxLayout* layout = new QVBoxLayout( this ); layout->setMargin( 5 ); m_midiInputGroupBox = new GroupBox( tr( "ENABLE MIDI INPUT" ) ); layout->addWidget( m_midiInputGroupBox ); QHBoxLayout* midiInputLayout = new QHBoxLayout( m_midiInputGroupBox ); midiInputLayout->setContentsMargins( 8, 18, 8, 8 ); midiInputLayout->setSpacing( 6 ); m_inputChannelSpinBox = new LcdSpinBox( 2, m_midiInputGroupBox ); m_inputChannelSpinBox->addTextForValue( 0, "--" ); m_inputChannelSpinBox->setLabel( tr( "CHANNEL" ) ); m_inputChannelSpinBox->setEnabled( false ); midiInputLayout->addWidget( m_inputChannelSpinBox ); m_fixedInputVelocitySpinBox = new LcdSpinBox( 3, m_midiInputGroupBox ); m_fixedInputVelocitySpinBox->setDisplayOffset( 1 ); m_fixedInputVelocitySpinBox->addTextForValue( 0, "---" ); m_fixedInputVelocitySpinBox->setLabel( tr( "VELOCITY" ) ); m_fixedInputVelocitySpinBox->setEnabled( false ); midiInputLayout->addWidget( m_fixedInputVelocitySpinBox ); midiInputLayout->addStretch(); connect( m_midiInputGroupBox->ledButton(), SIGNAL( toggled( bool ) ), m_inputChannelSpinBox, SLOT( setEnabled( bool ) ) ); connect( m_midiInputGroupBox->ledButton(), SIGNAL( toggled( bool ) ), m_fixedInputVelocitySpinBox, SLOT( setEnabled( bool ) ) ); m_midiOutputGroupBox = new GroupBox( tr( "ENABLE MIDI OUTPUT" ) ); layout->addWidget( m_midiOutputGroupBox ); QHBoxLayout* midiOutputLayout = new QHBoxLayout( m_midiOutputGroupBox ); midiOutputLayout->setContentsMargins( 8, 18, 8, 8 ); midiOutputLayout->setSpacing( 6 ); m_outputChannelSpinBox = new LcdSpinBox( 2, m_midiOutputGroupBox ); m_outputChannelSpinBox->setLabel( tr( "CHANNEL" ) ); m_outputChannelSpinBox->setEnabled( false ); midiOutputLayout->addWidget( m_outputChannelSpinBox ); m_fixedOutputVelocitySpinBox = new LcdSpinBox( 3, m_midiOutputGroupBox ); m_fixedOutputVelocitySpinBox->setDisplayOffset( 1 ); m_fixedOutputVelocitySpinBox->addTextForValue( 0, "---" ); m_fixedOutputVelocitySpinBox->setLabel( tr( "VELOCITY" ) ); m_fixedOutputVelocitySpinBox->setEnabled( false ); midiOutputLayout->addWidget( m_fixedOutputVelocitySpinBox ); m_outputProgramSpinBox = new LcdSpinBox( 3, m_midiOutputGroupBox ); m_outputProgramSpinBox->setLabel( tr( "PROGRAM" ) ); m_outputProgramSpinBox->setEnabled( false ); midiOutputLayout->addWidget( m_outputProgramSpinBox ); m_fixedOutputNoteSpinBox = new LcdSpinBox( 3, m_midiOutputGroupBox ); m_fixedOutputNoteSpinBox->setDisplayOffset( 1 ); m_fixedOutputNoteSpinBox->addTextForValue( 0, "---" ); m_fixedOutputNoteSpinBox->setLabel( tr( "NOTE" ) ); m_fixedOutputNoteSpinBox->setEnabled( false ); midiOutputLayout->addWidget( m_fixedOutputNoteSpinBox ); midiOutputLayout->addStretch(); connect( m_midiOutputGroupBox->ledButton(), SIGNAL( toggled( bool ) ), m_outputChannelSpinBox, SLOT( setEnabled( bool ) ) ); connect( m_midiOutputGroupBox->ledButton(), SIGNAL( toggled( bool ) ), m_fixedOutputVelocitySpinBox, SLOT( setEnabled( bool ) ) ); connect( m_midiOutputGroupBox->ledButton(), SIGNAL( toggled( bool ) ), m_outputProgramSpinBox, SLOT( setEnabled( bool ) ) ); connect( m_midiOutputGroupBox->ledButton(), SIGNAL( toggled( bool ) ), m_fixedOutputNoteSpinBox, SLOT( setEnabled( bool ) ) ); if( !Engine::mixer()->midiClient()->isRaw() ) { m_rpBtn = new QToolButton; m_rpBtn->setMinimumSize( 32, 32 ); m_rpBtn->setText( tr( "MIDI devices to receive MIDI events from" ) ); m_rpBtn->setIcon( embed::getIconPixmap( "piano" ) ); m_rpBtn->setPopupMode( QToolButton::InstantPopup ); midiInputLayout->insertSpacing( 0, 4 ); midiInputLayout->insertWidget( 0, m_rpBtn ); m_wpBtn = new QToolButton; m_wpBtn->setMinimumSize( 32, 32 ); m_wpBtn->setText( tr( "MIDI devices to send MIDI events to" ) ); m_wpBtn->setIcon( embed::getIconPixmap( "piano" ) ); m_wpBtn->setPopupMode( QToolButton::InstantPopup ); midiOutputLayout->insertSpacing( 0, 4 ); midiOutputLayout->insertWidget( 0, m_wpBtn ); } #define PROVIDE_CUSTOM_BASE_VELOCITY_UI #ifdef PROVIDE_CUSTOM_BASE_VELOCITY_UI GroupBox* baseVelocityGroupBox = new GroupBox( tr( "CUSTOM BASE VELOCITY" ) ); layout->addWidget( baseVelocityGroupBox ); QVBoxLayout* baseVelocityLayout = new QVBoxLayout( baseVelocityGroupBox ); baseVelocityLayout->setContentsMargins( 8, 18, 8, 8 ); baseVelocityLayout->setSpacing( 6 ); QLabel* baseVelocityHelp = new QLabel( tr( "Specify the velocity normalization base for MIDI-based instruments at 100% note velocity" ) ); baseVelocityHelp->setWordWrap( true ); baseVelocityHelp->setFont( pointSize<8>( baseVelocityHelp->font() ) ); baseVelocityLayout->addWidget( baseVelocityHelp ); m_baseVelocitySpinBox = new LcdSpinBox( 3, baseVelocityGroupBox ); m_baseVelocitySpinBox->setLabel( tr( "BASE VELOCITY" ) ); m_baseVelocitySpinBox->setEnabled( false ); baseVelocityLayout->addWidget( m_baseVelocitySpinBox ); connect( baseVelocityGroupBox->ledButton(), SIGNAL( toggled( bool ) ), m_baseVelocitySpinBox, SLOT( setEnabled( bool ) ) ); #endif layout->addStretch(); }
VisualizationsEditor::VisualizationsEditor(const QString ¤tSelection, MythMainWindow *parent, const char *name) : MythDialog(parent, name) { Q3VBoxLayout *vbox = new Q3VBoxLayout(this, (int)(20 * wmult)); Q3HBoxLayout *hbox = new Q3HBoxLayout(vbox, (int)(10 * wmult)); // Window title QString message = tr("Visualizations"); QLabel *label = new QLabel(message, this); label->setBackgroundOrigin(WindowOrigin); QFont font = label->font(); font.setPointSize(int (font.pointSize() * 1.5)); font.setBold(true); label->setFont(font); label->setPaletteForegroundColor(QColor("yellow")); label->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); hbox->addWidget(label); hbox = new Q3HBoxLayout(vbox, (int)(10 * wmult)); label = new QLabel(tr("Selected Visualizations"), this); label->setBackgroundOrigin(WindowOrigin); label->setAlignment(Qt::AlignLeft | Qt::AlignBottom); hbox->addWidget(label); label = new QLabel(tr("Available Visualizations"), this); label->setBackgroundOrigin(WindowOrigin); label->setAlignment(Qt::AlignLeft | Qt::AlignBottom); hbox->addWidget(label); // selected listview hbox = new Q3HBoxLayout(vbox, (int)(10 * wmult)); selectedList = new Q3MythListView(this); selectedList->addColumn(tr("Name")); selectedList->addColumn(tr("Provider")); selectedList->setSorting(-1); // disable sorting selectedList->setSelectionMode(Q3ListView::Single); connect(selectedList, SIGNAL(currentChanged(Q3ListViewItem *)), this, SLOT(selectedChanged(Q3ListViewItem *))); connect(selectedList, SIGNAL(spacePressed(Q3ListViewItem *)), this, SLOT(selectedOnSelect(Q3ListViewItem *))); connect(selectedList, SIGNAL(returnPressed(Q3ListViewItem *)), this, SLOT(selectedOnSelect(Q3ListViewItem *))); selectedList->installEventFilter(this); hbox->addWidget(selectedList); // available listview availableList = new Q3MythListView(this); availableList->addColumn(tr("Name")); availableList->addColumn(tr("Provider")); availableList->setSorting(0); connect(availableList, SIGNAL(currentChanged(Q3ListViewItem *)), this, SLOT(availableChanged(Q3ListViewItem *))); connect(availableList, SIGNAL(spacePressed(Q3ListViewItem *)), this, SLOT(availableOnSelect(Q3ListViewItem *))); connect(availableList, SIGNAL(returnPressed(Q3ListViewItem *)), this, SLOT(availableOnSelect(Q3ListViewItem *))); availableList->installEventFilter(this); hbox->addWidget(availableList); hbox = new Q3HBoxLayout(vbox, (int)(10 * wmult)); MythPushButton *button = new MythPushButton( this, "Program" ); button->setBackgroundOrigin(WindowOrigin); button->setText( tr( "Move Up" ) ); button->setEnabled(true); connect(button, SIGNAL(clicked()), this, SLOT(upClicked())); hbox->addWidget(button); button = new MythPushButton( this, "Program" ); button->setBackgroundOrigin(WindowOrigin); button->setText( tr( "Move Down" ) ); button->setEnabled(true); connect(button, SIGNAL(clicked()), this, SLOT(downClicked())); hbox->addWidget(button); // fake labels used as spacers label = new QLabel(" ", this); label->setBackgroundOrigin(WindowOrigin); hbox->addWidget(label); label = new QLabel(" ", this); label->setBackgroundOrigin(WindowOrigin); hbox->addWidget(label); //OK Button hbox = new Q3HBoxLayout(vbox, (int)(10 * wmult)); button = new MythPushButton( this, "Program" ); button->setBackgroundOrigin(WindowOrigin); button->setText( tr( "OK" ) ); button->setEnabled(true); hbox->addWidget(button); connect(button, SIGNAL(clicked()), this, SLOT(okClicked())); //Cancel Button button = new MythPushButton( this, "Program" ); button->setBackgroundOrigin(WindowOrigin); button->setText( tr( "Cancel" ) ); button->setEnabled(true); hbox->addWidget(button); connect(button, SIGNAL(clicked()), this, SLOT(cancelClicked())); availableList->setFocus(); fillWidgets(currentSelection); }
AboutDialog::AboutDialog(bool showAtStartup) { QString websiteText = tr("<a href=\"http://www.vpaint.org\">http://www.vpaint.org</a>"); QString aboutText = tr( "VPaint is an experimental vector graphics editor based on the Vector Animation" " Complex (VAC), a technology developed by a collaboration of researchers at" " Inria and the University of British Columbia, featured at SIGGRAPH 2015. It" " allows you to create resolution-independent illustrations and animations using" " innovative techniques.<br><br>" " " "<b>DISCLAIMER:</b> VPaint 1.5, or any upcoming 1.x release, is considered BETA. It" " lacks plenty of useful features commonly found in other editors, and you" " should expect glitches and crashes once in a while. <b>It is distributed" " primarily for research purposes, and for curious artists interested in early" " testing of cutting-edge but unstable technology.</b><br><br>" " " "New VPaint 1.x versions (1.6, 1.7, etc.) are expected every two months, with" " new features and increased stability. VPaint 2.0, full-featured and stable, is" " expected for 2017. <b>If you want to be notified when a new version is released," " just enter your email address below.</b>"); QString licenseText = tr( "Copyright (C) 2012-2015 Boris Dalstein.<br><br>" " " "Permission is hereby granted, free of charge, to any person obtaining a copy" " of this software and associated documentation files (the \"Software\"), to deal" " in the Software without restriction, including without limitation the rights" " to use, copy, modify, merge, publish, distribute, sublicense, and/or sell" " copies of the Software, and to permit persons to whom the Software is" " furnished to do so, subject to the following conditions:<br><br>" " " "The above copyright notice and this permission notice shall be included in" " all copies or substantial portions of the Software.<br><br>" " " "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR" " IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY," " FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE" " AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER" " LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM," " OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN" " THE SOFTWARE."); // Window title setWindowTitle(tr("About")); setMinimumSize(500, 500); // About widget QWidget * aboutWidget = new QWidget(); QLabel * logoLabel = new QLabel(); logoLabel->setPixmap(QPixmap(":/images/logo_1-5.png")); logoLabel->setAlignment(Qt::AlignTop | Qt::AlignHCenter); QLabel * websiteLabel = new QLabel(websiteText); websiteLabel->setTextFormat(Qt::RichText); websiteLabel->setAlignment(Qt::AlignTop | Qt::AlignHCenter); websiteLabel->setOpenExternalLinks(true); QFont websiteFont = websiteLabel->font(); websiteFont.setPointSize(15); websiteLabel->setFont(websiteFont); QLabel * aboutLabel = new QLabel(aboutText); aboutLabel->setWordWrap(true); aboutLabel->setTextFormat(Qt::RichText); aboutLabel->setAlignment(Qt::AlignTop | Qt::AlignLeft); subscribeLineEdit_ = new QLineEdit(); subscribeLineEdit_->setPlaceholderText(tr("Your email address")); networkManager_ = new QNetworkAccessManager(this); QPushButton * subscribeButton = new QPushButton(tr("Subscribe")); connect(subscribeButton, SIGNAL(clicked(bool)), this, SLOT(processSubscribe_())); QHBoxLayout * subscribeLayout = new QHBoxLayout(); subscribeLayout->addWidget(subscribeLineEdit_); subscribeLayout->addWidget(subscribeButton); QVBoxLayout * aboutWidgetLayout = new QVBoxLayout(); aboutWidgetLayout->addWidget(logoLabel); aboutWidgetLayout->addSpacing(10); aboutWidgetLayout->addWidget(websiteLabel); aboutWidgetLayout->addSpacing(10); aboutWidgetLayout->addWidget(aboutLabel); aboutWidgetLayout->addSpacing(10); aboutWidgetLayout->addLayout(subscribeLayout); aboutWidgetLayout->addStretch(); aboutWidget->setLayout(aboutWidgetLayout); // License widget QWidget * licenseWidget = new QWidget(); QLabel * licenseLabel = new QLabel(licenseText); licenseLabel->setWordWrap(true); licenseLabel->setTextFormat(Qt::RichText); licenseLabel->setAlignment(Qt::AlignTop | Qt::AlignLeft); QVBoxLayout * licenseWidgetLayout = new QVBoxLayout(); licenseWidgetLayout->addWidget(licenseLabel); aboutWidgetLayout->addStretch(); licenseWidget->setLayout(licenseWidgetLayout); // Tab widget QTabWidget * tabWidget = new QTabWidget(); tabWidget->addTab(aboutWidget, tr("About")); tabWidget->addTab(licenseWidget, tr("License")); // Show at startup checkbox showAtStartupCheckBox_ = new QCheckBox(tr("Show this message at startup")); showAtStartupCheckBox_->setChecked(showAtStartup); // Dialog button box QDialogButtonBox * buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok); connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); // Main layout QVBoxLayout * layout = new QVBoxLayout(); layout->addWidget(tabWidget); layout->addWidget(showAtStartupCheckBox_); layout->addWidget(buttonBox); setLayout(layout); }