コード例 #1
0
void PropertiesDialog::createPublishingBox()
{
	publishingBox = new QWidget;
	
	QFormLayout *publishingLayout = new QFormLayout;

    publishingLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);

	QHBoxLayout * date = new QHBoxLayout;
	date->addWidget(new QLabel(tr("Day:")));
	date->addWidget(dayEdit = new YACReaderFieldEdit());
	dayValidator.setRange(1,31);
	dayEdit->setValidator(&dayValidator);
	date->addWidget(new QLabel(tr("Month:")));
	date->addWidget(monthEdit = new YACReaderFieldEdit());
	monthValidator.setRange(1,12);
	monthEdit->setValidator(&monthValidator);
	date->addWidget(new QLabel(tr("Year:")));
	date->addWidget(yearEdit = new YACReaderFieldEdit());
	yearValidator.setRange(1,9999);
	yearEdit->setValidator(&yearValidator);
	date->addStretch(1);

	publishingLayout->setRowWrapPolicy(QFormLayout::WrapAllRows);
	publishingLayout->addRow(date);
	publishingLayout->addRow(tr("Publisher:"), publisherEdit = new YACReaderFieldEdit());
	publishingLayout->addRow(tr("Format:"), formatEdit = new YACReaderFieldEdit());
	publishingLayout->addRow(tr("Color/BW:"), colorCheck = new QCheckBox());
	publishingLayout->addRow(tr("Age rating:"), ageRatingEdit = new YACReaderFieldEdit());

	publishingBox->setLayout(publishingLayout);
}
コード例 #2
0
void OBSPropertiesView::RefreshProperties()
{
	children.clear();
	if (widget)
		widget->deleteLater();

	widget = new QWidget();

	QFormLayout *layout = new QFormLayout;
	layout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
	widget->setLayout(layout);

	QSizePolicy mainPolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
	QSizePolicy policy(QSizePolicy::Preferred, QSizePolicy::Preferred);
	//widget->setSizePolicy(policy);
	layout->setSizeConstraint(QLayout::SetMaximumSize);
	layout->setLabelAlignment(Qt::AlignRight);

	obs_property_t property = obs_properties_first(properties);

	while (property) {
		AddProperty(property, layout);
		obs_property_next(&property);
	}

	setWidgetResizable(true);
	setWidget(widget);
	setSizePolicy(mainPolicy);

	lastFocused.clear();
	if (lastWidget) {
		lastWidget->setFocus(Qt::OtherFocusReason);
		lastWidget = nullptr;
	}
}
コード例 #3
0
CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc) : m_buildConfiguration(0)
{
    QFormLayout *fl = new QFormLayout(this);
    fl->setContentsMargins(20, -1, 0, -1);
    fl->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
    setLayout(fl);

    QPushButton *runCmakeButton = new QPushButton(tr("Run CMake..."));
    connect(runCmakeButton, SIGNAL(clicked()),
            this, SLOT(runCMake()));
    fl->addRow(tr("Reconfigure project:"), runCmakeButton);

    m_pathLineEdit = new QLineEdit(this);
    m_pathLineEdit->setReadOnly(true);

    QHBoxLayout *hbox = new QHBoxLayout();
    hbox->addWidget(m_pathLineEdit);

    m_changeButton = new QPushButton(this);
    m_changeButton->setText(tr("&Change"));
    connect(m_changeButton, SIGNAL(clicked()), this, SLOT(openChangeBuildDirectoryDialog()));
    hbox->addWidget(m_changeButton);

    fl->addRow(tr("Build directory:"), hbox);

    m_buildConfiguration = bc;
    m_pathLineEdit->setText(m_buildConfiguration->rawBuildDirectory().toString());
    if (m_buildConfiguration->buildDirectory() == bc->target()->project()->projectDirectory())
        m_changeButton->setEnabled(false);
    else
        m_changeButton->setEnabled(true);

    setDisplayName(tr("CMake"));
}
コード例 #4
0
BusIfInterfaceSystem::BusIfInterfaceSystem(General::InterfaceMode mode, 
										   BusIfGeneralTab* generalTab,
										   LibraryInterface* libHandler,
										   QSharedPointer<BusInterface> busif,
										   QSharedPointer<Component> component,
										   QWidget *parent):
BusIfInterfaceModeEditor(busif, component, tr("System"), parent),
mode_(mode),
monitor_(busif->getMonitor()),
generalTab_(generalTab), 
libHandler_(libHandler), 
group_(this)
{
	Q_ASSERT(mode == General::SYSTEM || mode == General::MIRROREDSYSTEM);

    if (mode == General::SYSTEM)
    {
        setTitle(tr("System"));
    }
    else if(mode == General::MIRROREDSYSTEM) 
    {
        setTitle(tr("Mirrored system"));
    }

	group_.setProperty("mandatoryField", true);

	connect(&group_, SIGNAL(currentIndexChanged(const QString&)),
		this, SLOT(onGroupChange(const QString&)), Qt::UniqueConnection);

    QFormLayout* groupLayout = new QFormLayout(this);
    groupLayout->addRow(tr("System group"), &group_);
    groupLayout->setFieldGrowthPolicy(QFormLayout::FieldsStayAtSizeHint);
}
コード例 #5
0
GerritOptionsWidget::GerritOptionsWidget(QWidget *parent)
    : QWidget(parent)
    , m_hostLineEdit(new QLineEdit(this))
    , m_userLineEdit(new QLineEdit(this))
    , m_sshChooser(new Utils::PathChooser)
    , m_portSpinBox(new QSpinBox(this))
    , m_additionalQueriesLineEdit(new QLineEdit(this))
    , m_httpsCheckBox(new QCheckBox(tr("HTTPS")))
{
    QFormLayout *formLayout = new QFormLayout(this);
    formLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
    formLayout->addRow(tr("&Host: "), m_hostLineEdit);
    formLayout->addRow(tr("&User: "******"-V")));
    formLayout->addRow(tr("&ssh: "), m_sshChooser);
    m_portSpinBox->setMinimum(1);
    m_portSpinBox->setMaximum(65535);
    formLayout->addRow(tr("&Port: "), m_portSpinBox);
    formLayout->addRow(tr("&Additional queries: "), m_additionalQueriesLineEdit);
    m_additionalQueriesLineEdit->setToolTip(tr(
    "A comma-separated list of additional queries.\n"
    "For example \"status:staged,status:integrating\""
    " can be used to show the status of the Continuous Integration\n"
    "of the Qt project."));
    formLayout->addRow(tr("P&rotocol:"), m_httpsCheckBox);
    m_httpsCheckBox->setToolTip(tr(
    "Determines the protocol used to form a URL in case\n"
    "\"canonicalWebUrl\" is not configured in the file\n"
    "\"gerrit.config\"."));
}
コード例 #6
0
AutotoolsBuildSettingsWidget::AutotoolsBuildSettingsWidget(AutotoolsTarget *target) :
    m_target(target),
    m_pathChooser(0),
    m_toolChainChooser(0),
    m_buildConfiguration(0)
{
    QFormLayout *fl = new QFormLayout(this);
    fl->setContentsMargins(0, 0, 0, 0);
    fl->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);

    m_pathChooser = new Utils::PathChooser(this);
    m_pathChooser->setEnabled(true);
    m_pathChooser->setExpectedKind(Utils::PathChooser::Directory);
    m_pathChooser->setBaseDirectory(m_target->autotoolsProject()->projectDirectory());
    fl->addRow(tr("Build directory:"), m_pathChooser);
    connect(m_pathChooser, SIGNAL(changed(QString)), this, SLOT(buildDirectoryChanged()));

    // tool chain
    m_toolChainChooser = new QComboBox;
    m_toolChainChooser->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
    updateToolChainList();

    fl->addRow(tr("Tool chain:"), m_toolChainChooser);
    connect(m_toolChainChooser, SIGNAL(activated(int)), this, SLOT(toolChainSelected(int)));
    connect(m_target->autotoolsProject(), SIGNAL(toolChainChanged(ProjectExplorer::ToolChain*)),
            this, SLOT(toolChainChanged(ProjectExplorer::ToolChain*)));
    connect(ProjectExplorer::ToolChainManager::instance(), SIGNAL(toolChainAdded(ProjectExplorer::ToolChain*)),
            this, SLOT(updateToolChainList()));
    connect(ProjectExplorer::ToolChainManager::instance(), SIGNAL(toolChainRemoved(ProjectExplorer::ToolChain*)),
            this, SLOT(updateToolChainList()));
}
コード例 #7
0
GerritOptionsWidget::GerritOptionsWidget(QWidget *parent)
    : QWidget(parent)
    , m_hostLineEdit(new QLineEdit(this))
    , m_userLineEdit(new QLineEdit(this))
    , m_sshChooser(new Utils::PathChooser)
    , m_portSpinBox(new QSpinBox(this))
    , m_httpsCheckBox(new QCheckBox(tr("HTTPS")))
{
    QFormLayout *formLayout = new QFormLayout(this);
    formLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
    formLayout->addRow(tr("&Host:"), m_hostLineEdit);
    formLayout->addRow(tr("&User:"******"-V")));
    m_sshChooser->setHistoryCompleter(QLatin1String("Git.SshCommand.History"));
    formLayout->addRow(tr("&ssh:"), m_sshChooser);
    m_portSpinBox->setMinimum(1);
    m_portSpinBox->setMaximum(65535);
    formLayout->addRow(tr("&Port:"), m_portSpinBox);
    formLayout->addRow(tr("P&rotocol:"), m_httpsCheckBox);
    m_httpsCheckBox->setToolTip(tr(
    "Determines the protocol used to form a URL in case\n"
    "\"canonicalWebUrl\" is not configured in the file\n"
    "\"gerrit.config\"."));
}
コード例 #8
0
void tst_QFormLayout::setFieldGrowthPolicy()
{
    QWidget window;
    QLineEdit fld1, fld2, fld3;
    fld1.setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    fld2.setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
    fld3.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);

    QFormLayout layout;
    layout.addRow("One:", &fld1);
    layout.addRow("Two:", &fld2);
    layout.addRow("Three:", &fld3);
    window.setLayout(&layout);
    window.resize(1000, 200);

    for (int i = 0; i < 3; ++i) {
        layout.setFieldGrowthPolicy(i == 0 ? QFormLayout::FieldsStayAtSizeHint :
                                    i == 1 ? QFormLayout::ExpandingFieldsGrow :
                                    QFormLayout::AllNonFixedFieldsGrow);
        layout.activate();

        if (i == 0) {
            QVERIFY(fld1.width() == fld2.width());
            QVERIFY(fld2.width() == fld3.width());
        } else if (i == 1) {
            QVERIFY(fld1.width() == fld2.width());
            QVERIFY(fld2.width() < fld3.width());
        } else {
            QVERIFY(fld1.width() < fld2.width());
            QVERIFY(fld2.width() == fld3.width());
        }
    }
}
コード例 #9
0
ファイル: Console.cpp プロジェクト: weilandetian/Yoyo
Console::Console(TeamSelector* teamSelector)
  : visualContext(new VisualContext(this)),
    teamSelector(teamSelector),
    scrollArea(new ScrollArea(this)),
    prompt(0),
    cmdLine(0)
{
  cmdLine = new CommandLineEdit(this);

  prompt = new QLabel("bush>", cmdLine);
  prompt->setAutoFillBackground(true);
  QPalette p = prompt->palette();
  p.setColor(QPalette::Background, p.color(QPalette::AlternateBase));
  prompt->setPalette(p);

  QGridLayout* layout = new QGridLayout();
  layout->setHorizontalSpacing(0);
  scrollArea->setWidget(visualContext);
  scrollArea->setWidgetResizable(true);
  scrollArea->setBackgroundRole(QPalette::AlternateBase);
  layout->addWidget(scrollArea, 0, 0);
  layout->setRowStretch(0, 1);
  QFormLayout* fl = new QFormLayout();
  fl->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
  fl->addRow(prompt, cmdLine);
  layout->addLayout(fl, 1, 0);
  setLayout(layout);

  connect(cmdLine, SIGNAL(returnPressed()), this, SLOT(returnPressed()));
}
コード例 #10
0
GerritOptionsWidget::GerritOptionsWidget(QWidget *parent)
    : QWidget(parent)
    , m_hostLineEdit(new QLineEdit(this))
    , m_userLineEdit(new QLineEdit(this))
    , m_sshChooser(new Utils::PathChooser)
    , m_repositoryChooser(new Utils::PathChooser)
    , m_portSpinBox(new QSpinBox(this))
    , m_httpsCheckBox(new QCheckBox(tr("HTTPS")))
    , m_promptPathCheckBox(new QCheckBox(tr("Always prompt for repository folder")))
{
    QFormLayout *formLayout = new QFormLayout(this);
    formLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
    formLayout->addRow(tr("&Host:"), m_hostLineEdit);
    formLayout->addRow(tr("&User:"******"-V")));
    formLayout->addRow(tr("&ssh:"), m_sshChooser);
    formLayout->addRow(tr("&Repository:"), m_repositoryChooser);
    m_repositoryChooser->setToolTip(tr("Default repository where patches will be applied."));
    formLayout->addRow(tr("Pr&ompt:"), m_promptPathCheckBox);
    m_promptPathCheckBox->setToolTip(tr("If checked, user will always be\n"
                                        "asked to confirm the repository path."));
    m_portSpinBox->setMinimum(1);
    m_portSpinBox->setMaximum(65535);
    formLayout->addRow(tr("&Port:"), m_portSpinBox);
    formLayout->addRow(tr("P&rotocol:"), m_httpsCheckBox);
    m_httpsCheckBox->setToolTip(tr(
    "Determines the protocol used to form a URL in case\n"
    "\"canonicalWebUrl\" is not configured in the file\n"
    "\"gerrit.config\"."));
}
コード例 #11
0
ファイル: makestep.cpp プロジェクト: pcacjr/qt-creator
MakeStepConfigWidget::MakeStepConfigWidget(MakeStep *makeStep)
    : m_makeStep(makeStep)
{
    QFormLayout *fl = new QFormLayout(this);
    fl->setMargin(0);
    fl->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
    setLayout(fl);

    m_additionalArguments = new QLineEdit(this);
    fl->addRow(tr("Additional arguments:"), m_additionalArguments);
    m_additionalArguments->setText(m_makeStep->additionalArguments());

    m_buildTargetsList = new QListWidget;
    m_buildTargetsList->setMinimumHeight(200);
    fl->addRow(tr("Targets:"), m_buildTargetsList);

    // TODO update this list also on rescans of the CMakeLists.txt
    // TODO shouldn't be accessing project
    CMakeProject *pro = m_makeStep->cmakeBuildConfiguration()->cmakeTarget()->cmakeProject();
    foreach(const QString& buildTarget, pro->buildTargetTitles()) {
        QListWidgetItem *item = new QListWidgetItem(buildTarget, m_buildTargetsList);
        item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
        item->setCheckState(m_makeStep->buildsBuildTarget(item->text()) ? Qt::Checked : Qt::Unchecked);
    }

    updateDetails();

    connect(m_additionalArguments, SIGNAL(textEdited(const QString &)), this, SLOT(additionalArgumentsEdited()));
    connect(m_buildTargetsList, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*)));
    connect(ProjectExplorer::ProjectExplorerPlugin::instance(), SIGNAL(settingsChanged()),
            this, SLOT(updateDetails()));

    connect(pro, SIGNAL(buildTargetsChanged()),
            this, SLOT(buildTargetsChanged()));
}
コード例 #12
0
ファイル: LoginDialog.cpp プロジェクト: eduffy/hpcvmmon
LoginDialog::LoginDialog(QWidget *parent)
   : QDialog(parent)
{
   QFormLayout *layout = new QFormLayout(this);
   layout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);

   wHost = new QLineEdit();
   wHost->resize(150, wHost->height());
   layout->addRow(tr("&Host: "), wHost);

   wUsername = new QLineEdit();
   layout->addRow(tr("&Username: "******"&Password: "******"&Connect", this);
   wConnect->setDefault(true);
   connect(wConnect, SIGNAL(clicked()), this, SLOT(authenticate()));
   bbox->addButton(wConnect, QDialogButtonBox::AcceptRole);

   setWindowTitle(tr("Connect to scheduler"));
   setFixedWidth(sizeHint().width() * 1.4);
   setModal(true);
   setLayout(layout);
}
コード例 #13
0
void AndroidGdbServerKitInformationWidget::showDialog()
{
    QDialog dialog;
    QVBoxLayout *layout = new QVBoxLayout(&dialog);
    QFormLayout *formLayout = new QFormLayout;
    formLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);

    QLabel *binaryLabel = new QLabel(tr("&Binary:"));
    PathChooser *chooser = new PathChooser;
    chooser->setExpectedKind(PathChooser::ExistingCommand);
    chooser->setPath(AndroidGdbServerKitInformation::gdbServer(m_kit).toString());
    binaryLabel->setBuddy(chooser);
    formLayout->addRow(binaryLabel, chooser);
    layout->addLayout(formLayout);

    QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, &dialog);
    connect(buttonBox, SIGNAL(accepted()), &dialog, SLOT(accept()));
    connect(buttonBox, SIGNAL(rejected()), &dialog, SLOT(reject()));
    layout->addWidget(buttonBox);

    dialog.setWindowTitle(tr("GDB Server for \"%1\"").arg(m_kit->displayName()));

    if (dialog.exec() == QDialog::Accepted)
        AndroidGdbServerKitInformation::setGdbSever(m_kit, chooser->fileName());
}
コード例 #14
0
// Configuration widget
CMakeRunConfigurationWidget::CMakeRunConfigurationWidget(CMakeRunConfiguration *cmakeRunConfiguration, QWidget *parent)
    : QWidget(parent), m_ignoreChange(false), m_cmakeRunConfiguration(cmakeRunConfiguration)
{
    QFormLayout *fl = new QFormLayout();
    fl->setMargin(0);
    fl->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);

    cmakeRunConfiguration->extraAspect<ArgumentsAspect>()->addToMainConfigurationWidget(this, fl);

    m_workingDirectoryEdit = new Utils::PathChooser();
    m_workingDirectoryEdit->setExpectedKind(Utils::PathChooser::Directory);
    m_workingDirectoryEdit->setBaseFileName(m_cmakeRunConfiguration->target()->project()->projectDirectory());
    m_workingDirectoryEdit->setPath(m_cmakeRunConfiguration->baseWorkingDirectory());
    m_workingDirectoryEdit->setHistoryCompleter(QLatin1String("CMake.WorkingDir.History"));
    EnvironmentAspect *aspect
            = m_cmakeRunConfiguration->extraAspect<EnvironmentAspect>();
    if (aspect) {
        connect(aspect, &EnvironmentAspect::environmentChanged,
                this, &CMakeRunConfigurationWidget::environmentWasChanged);
        environmentWasChanged();
    }
    m_workingDirectoryEdit->setPromptDialogTitle(tr("Select Working Directory"));

    QToolButton *resetButton = new QToolButton();
    resetButton->setToolTip(tr("Reset to default."));
    resetButton->setIcon(QIcon(QLatin1String(Core::Constants::ICON_RESET)));

    QHBoxLayout *boxlayout = new QHBoxLayout();
    boxlayout->addWidget(m_workingDirectoryEdit);
    boxlayout->addWidget(resetButton);

    fl->addRow(tr("Working directory:"), boxlayout);

    m_cmakeRunConfiguration->extraAspect<TerminalAspect>()->addToMainConfigurationWidget(this, fl);

    m_detailsContainer = new Utils::DetailsWidget(this);
    m_detailsContainer->setState(Utils::DetailsWidget::NoSummary);

    QWidget *m_details = new QWidget(m_detailsContainer);
    m_detailsContainer->setWidget(m_details);
    m_details->setLayout(fl);

    QVBoxLayout *vbx = new QVBoxLayout(this);
    vbx->setMargin(0);
    vbx->addWidget(m_detailsContainer);

    connect(m_workingDirectoryEdit, &Utils::PathChooser::changed,
            this, &CMakeRunConfigurationWidget::setWorkingDirectory);

    connect(resetButton, &QToolButton::clicked,
            this, &CMakeRunConfigurationWidget::resetWorkingDirectory);

    connect(m_cmakeRunConfiguration, &CMakeRunConfiguration::baseWorkingDirectoryChanged,
            this, &CMakeRunConfigurationWidget::workingDirectoryChanged);

    setEnabled(m_cmakeRunConfiguration->isEnabled());
}
コード例 #15
0
QWidget* AutoImportWindow::setupInputFolderContainer() {
    GroupContainer* container = new GroupContainer();
    container->setTitle("Import Folder");

    QFormLayout* layout = new QFormLayout;
    layout->setHorizontalSpacing(10);
    layout->setVerticalSpacing(0);
    layout->setRowWrapPolicy(QFormLayout::DontWrapRows);
    layout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
    layout->setFormAlignment(Qt::AlignHCenter | Qt::AlignTop);
    layout->setLabelAlignment(Qt::AlignLeft);

    BrowserWidget* filesDirBrowser_ = new BrowserWidget(BrowserWidget::BrowseType::DIRECTORY);
    ParametersConfiguration* conf  = projectData.projectParameterData();
    QString importImagesPath = conf->getValue("import_dir");
    filesDirBrowser_->setPath(importImagesPath);
    setupWatcherPaths();
    connect(filesDirBrowser_, &BrowserWidget::pathChanged, [ = ] (const QString & value){
        conf->set("import_dir", value);
        setupWatcherPaths();
        analyzeImport();
    });
    layout->addRow(filesDirBrowser_);

    QLabel* introLabel = new QLabel(introText());
    introLabel->setWordWrap(true);
    QPalette pal = introLabel->palette();
    pal.setColor(QPalette::WindowText, Qt::darkGray);
    introLabel->setPalette(pal);
    layout->addRow(introLabel);

    QCheckBox* restartCheck = new QCheckBox("Import new images in the import folder on start");
    restartCheck->setChecked(ProjectPreferences().importRestartCheck());
    connect(restartCheck, &QCheckBox::toggled, [ = ] (bool check){
        ProjectPreferences().setImportRestartCheck(check);
    });
    layout->addRow(restartCheck);

    
    layout->addRow(continuous);
    
    deleteCheck = new QCheckBox("DELETE the original images in import folder after importing them");
    deleteCheck->setChecked(ProjectPreferences().importDeleteCheck());
    deleteLabel_->setVisible(deleteCheck->isChecked());
    connect(deleteCheck, &QCheckBox::toggled, [ = ] (bool check){
        ProjectPreferences().setImportDeleteCheck(check);
        deleteLabel_->setVisible(check);
    });
    layout->addRow(deleteCheck);
    
    container->setContainerLayout(layout);

    return container;
}
コード例 #16
0
BareMetalGdbCommandsDeployStepWidget::BareMetalGdbCommandsDeployStepWidget(BareMetalGdbCommandsDeployStep &step)
    : m_step(step)
{
    QFormLayout *fl = new QFormLayout(this);
    fl->setMargin(0);
    fl->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
    setLayout(fl);
    m_commands = new QPlainTextEdit(this);
    fl->addRow(tr("GDB commands:"), m_commands);
    m_commands->setPlainText(m_step.gdbCommands());
    connect(m_commands, &QPlainTextEdit::textChanged, this, &BareMetalGdbCommandsDeployStepWidget::update);
}
コード例 #17
0
    //  NewPromotedClassPanel
    NewPromotedClassPanel::NewPromotedClassPanel(const QStringList &baseClasses,
                                                   int selectedBaseClass,
                                                   QWidget *parent) :
        QGroupBox(parent),
        m_baseClassCombo(new  QComboBox),
        m_classNameEdit(new QLineEdit),
        m_includeFileEdit(new QLineEdit),
        m_globalIncludeCheckBox(new QCheckBox),
        m_addButton(new QPushButton(tr("Add")))
    {
        setTitle(tr("New Promoted Class"));
        setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Maximum);
        QHBoxLayout *hboxLayout = new QHBoxLayout(this);

        m_classNameEdit->setValidator(new QRegExpValidator(QRegExp(QStringLiteral("[_a-zA-Z:][:_a-zA-Z0-9]*")), m_classNameEdit));
        connect(m_classNameEdit,   &QLineEdit::textChanged,
                this, &NewPromotedClassPanel::slotNameChanged);
        connect(m_includeFileEdit, &QLineEdit::textChanged,
                this, &NewPromotedClassPanel::slotIncludeFileChanged);

        m_baseClassCombo->setEditable(false);
        m_baseClassCombo->addItems(baseClasses);
        if (selectedBaseClass != -1)
            m_baseClassCombo->setCurrentIndex(selectedBaseClass);

        // Grid
        QFormLayout *formLayout = new QFormLayout();
        formLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow); // Mac
        formLayout->addRow(tr("Base class name:"),     m_baseClassCombo);
        formLayout->addRow(tr("Promoted class name:"), m_classNameEdit);
        formLayout->addRow(tr("Header file:"),         m_includeFileEdit);
        formLayout->addRow(tr("Global include"),       m_globalIncludeCheckBox);
        hboxLayout->addLayout(formLayout);
        hboxLayout->addItem(new QSpacerItem(15, 0, QSizePolicy::Fixed, QSizePolicy::Ignored));
        // Button box
        QVBoxLayout *buttonLayout = new QVBoxLayout();

        m_addButton->setAutoDefault(false);
        connect(m_addButton, &QAbstractButton::clicked, this, &NewPromotedClassPanel::slotAdd);
        m_addButton->setEnabled(false);
        buttonLayout->addWidget(m_addButton);

        QPushButton *resetButton = new QPushButton(tr("Reset"));
        resetButton->setAutoDefault(false);
        connect(resetButton, &QAbstractButton::clicked, this, &NewPromotedClassPanel::slotReset);

        buttonLayout->addWidget(resetButton);
        buttonLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Ignored, QSizePolicy::Expanding));
        hboxLayout->addLayout(buttonLayout);

        enableButtons();
    }
コード例 #18
0
AutotoolsBuildSettingsWidget::AutotoolsBuildSettingsWidget() :
    m_buildConfiguration(0)
{
    QFormLayout *fl = new QFormLayout(this);
    fl->setContentsMargins(0, 0, 0, 0);
    fl->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);

    m_pathChooser = new Utils::PathChooser(this);
    m_pathChooser->setEnabled(true);
    m_pathChooser->setExpectedKind(Utils::PathChooser::Directory);
    fl->addRow(tr("Build directory:"), m_pathChooser);
    connect(m_pathChooser, SIGNAL(changed(QString)), this, SLOT(buildDirectoryChanged()));
}
コード例 #19
0
QWidget* PreferencesDialog::getGeneralPage() {
    GroupContainer* widget = new GroupContainer();
    widget->setTitle("General");
    
    QFormLayout* mainLayout = new QFormLayout;
    mainLayout->setRowWrapPolicy(QFormLayout::WrapLongRows);
    mainLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
    mainLayout->setFormAlignment(Qt::AlignHCenter | Qt::AlignTop);
    mainLayout->setLabelAlignment(Qt::AlignRight);
    
    QCheckBox* autoSaveBox = new QCheckBox("Automatically save configurations when they are changed");
    autoSaveBox->setChecked(UserPreferences().autoSaveConfigs());
    connect(autoSaveBox, &QCheckBox::toggled, [=](bool check){
        UserPreferences().setAutoSaveConfigs(check);
        projectData.setAutoSave(check);
    });
    mainLayout->addRow(autoSaveBox);
    
    QCheckBox* advancedBox = new QCheckBox("Show advanced by default (valid on restart)");
    advancedBox->setChecked(UserPreferences().showAdvanced());
    connect(advancedBox, &QCheckBox::toggled, [=](bool check){
        UserPreferences().setShowAdvanced(check);
    });
    mainLayout->addRow(advancedBox);
     
    QSlider* outputVerbosityControl = new QSlider;
    outputVerbosityControl->setOrientation(Qt::Horizontal);
    outputVerbosityControl->setFixedSize(100, 20);
    outputVerbosityControl->setMinimum(0);
    outputVerbosityControl->setMaximum(3);
    outputVerbosityControl->setTickPosition(QSlider::TicksBothSides);
    outputVerbosityControl->setTickInterval(1);
    outputVerbosityControl->setSingleStep(1);
    outputVerbosityControl->setValue(UserPreferences().userLevel());
    connect(outputVerbosityControl, &QSlider::valueChanged, [=] (int level) {
        UserPreferences().setUserLevel(level);
    });
    mainLayout->addRow("Default verbosity level (valid on restart)", outputVerbosityControl);
    
    widget->setContainerLayout(mainLayout);
    
    QWidget* pageWid = new QWidget;
    QVBoxLayout *layout = new QVBoxLayout;
    layout->setMargin(0);
    layout->setSpacing(0);
    layout->addWidget(widget);
    layout->addStretch(1);
    pageWid->setLayout(layout);
    
    return pageWid;
}
コード例 #20
0
StartRemoteDialog::StartRemoteDialog(QWidget *parent)
    : QDialog(parent)
    , d(new Internal::StartRemoteDialogPrivate)
{
    setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
    setWindowTitle(tr("Start Remote Analysis"));

    d->kitChooser = new KitChooser(this);
    d->kitChooser->setKitPredicate([](const Kit *kit) {
        const IDevice::ConstPtr device = DeviceKitInformation::device(kit);
        return kit->isValid() && device && !device->sshParameters().host().isEmpty();
    });
    d->executable = new QLineEdit(this);
    d->arguments = new QLineEdit(this);
    d->workingDirectory = new QLineEdit(this);

    d->buttonBox = new QDialogButtonBox(this);
    d->buttonBox->setOrientation(Qt::Horizontal);
    d->buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);

    QFormLayout *formLayout = new QFormLayout;
    formLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
    formLayout->addRow(tr("Kit:"), d->kitChooser);
    formLayout->addRow(tr("Executable:"), d->executable);
    formLayout->addRow(tr("Arguments:"), d->arguments);
    formLayout->addRow(tr("Working directory:"), d->workingDirectory);

    QVBoxLayout *verticalLayout = new QVBoxLayout(this);
    verticalLayout->addLayout(formLayout);
    verticalLayout->addWidget(d->buttonBox);

    QSettings *settings = Core::ICore::settings();
    settings->beginGroup(QLatin1String("AnalyzerStartRemoteDialog"));
    d->kitChooser->populate();
    d->kitChooser->setCurrentKitId(Core::Id::fromSetting(settings->value(QLatin1String("profile"))));
    d->executable->setText(settings->value(QLatin1String("executable")).toString());
    d->workingDirectory->setText(settings->value(QLatin1String("workingDirectory")).toString());
    d->arguments->setText(settings->value(QLatin1String("arguments")).toString());
    settings->endGroup();

    connect(d->kitChooser, &KitChooser::activated, this, &StartRemoteDialog::validate);
    connect(d->executable, &QLineEdit::textChanged, this, &StartRemoteDialog::validate);
    connect(d->workingDirectory, &QLineEdit::textChanged, this, &StartRemoteDialog::validate);
    connect(d->arguments, &QLineEdit::textChanged, this, &StartRemoteDialog::validate);
    connect(d->buttonBox, &QDialogButtonBox::accepted, this, &StartRemoteDialog::accept);
    connect(d->buttonBox, &QDialogButtonBox::rejected, this, &StartRemoteDialog::reject);

    validate();
}
コード例 #21
0
void PropertiesDialog::createPlotBox()
{
	plotBox = new QWidget;

	QFormLayout *plotLayout = new QFormLayout;
    plotLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);

	plotLayout->setRowWrapPolicy(QFormLayout::WrapAllRows);
	plotLayout->addRow(tr("Synopsis:"), synopsis = new YACReaderFieldPlainTextEdit());
	plotLayout->addRow(tr("Characters:"), characters = new YACReaderFieldPlainTextEdit());
	plotLayout->addRow(tr("Notes:"), notes = new YACReaderFieldPlainTextEdit());

	plotBox->setLayout(plotLayout);

}
コード例 #22
0
ファイル: QxMiscPreferences.cpp プロジェクト: corelon/paco
QxMiscPreferences::QxMiscPreferences(QWidget* parent)
{
	QFormLayout* form = new QFormLayout;
	#ifdef Q_WS_X11
	// workaround HACK
	form->setFieldGrowthPolicy(QFormLayout::FieldsStayAtSizeHint);
	#endif
	
	kinematicScrolling_ = new QCheckBox(tr("Kinematic scrolling"), this);
	scrollingSpeed_ = new QSpinBox(this);
	form->addRow(tr("Scrolling Speed"), scrollingSpeed_);
	form->addRow(tr(" "), kinematicScrolling_);
	
	setLayout(form);
}
コード例 #23
0
void tst_QFormLayout::layoutAlone()
{
    QWidget w;
    QFormLayout layout;
    layout.setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
    w.setLayout(&layout);
    QLabel label("Here is a strange test case");
    layout.setWidget(0, QFormLayout::LabelRole, &label);
    QHBoxLayout hlay;
    layout.setLayout(1, QFormLayout::LabelRole, &hlay);
    QCOMPARE(layout.count(), 2);
    w.show();
    layout.activate();
    QTest::qWait(500);
}
コード例 #24
0
ファイル: makestep.cpp プロジェクト: MarianMMX/qt-creator
MakeStepConfigWidget::MakeStepConfigWidget(MakeStep *makeStep)
    : m_makeStep(makeStep)
{
    QFormLayout *fl = new QFormLayout(this);
    fl->setMargin(0);
    fl->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
    setLayout(fl);

    m_makePathChooser = new Utils::PathChooser(this);
    m_makePathChooser->setExpectedKind(Utils::PathChooser::ExistingCommand);
    m_makePathChooser->setBaseDirectory(Utils::PathChooser::homePath());
    m_makePathChooser->setHistoryCompleter(QLatin1String("PE.MakeCommand.History"));
    m_makePathChooser->setPath(m_makeStep->userMakeCommand());

    fl->addRow(tr("Override command:"), m_makePathChooser);

    m_additionalArguments = new QLineEdit(this);
    fl->addRow(tr("Additional arguments:"), m_additionalArguments);
    m_additionalArguments->setText(m_makeStep->additionalArguments());

    m_buildTargetsList = new QListWidget;
    m_buildTargetsList->setFrameStyle(QFrame::NoFrame);
    m_buildTargetsList->setMinimumHeight(200);

    QFrame *frame = new QFrame(this);
    frame->setFrameStyle(QFrame::StyledPanel);
    QVBoxLayout *frameLayout = new QVBoxLayout(frame);
    frameLayout->setMargin(0);
    frameLayout->addWidget(Core::ItemViewFind::createSearchableWrapper(m_buildTargetsList,
                                                                       Core::ItemViewFind::LightColored));

    fl->addRow(tr("Targets:"), frame);

    auto itemAddRunConfigurationArgument = new QListWidgetItem(tr(ADD_RUNCONFIGURATION_TEXT), m_buildTargetsList);
    itemAddRunConfigurationArgument->setFlags(itemAddRunConfigurationArgument->flags() | Qt::ItemIsUserCheckable);
    itemAddRunConfigurationArgument->setCheckState(m_makeStep->addRunConfigurationArgument() ? Qt::Checked : Qt::Unchecked);
    QFont f;
    f.setItalic(true);
    itemAddRunConfigurationArgument->setFont(f);

    CMakeProject *pro = static_cast<CMakeProject *>(m_makeStep->project());
    QStringList targetList = pro->buildTargetTitles();
    targetList.sort();
    foreach (const QString &buildTarget, targetList) {
        QListWidgetItem *item = new QListWidgetItem(buildTarget, m_buildTargetsList);
        item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
        item->setCheckState(m_makeStep->buildsBuildTarget(item->text()) ? Qt::Checked : Qt::Unchecked);
    }
コード例 #25
0
ファイル: personform.cpp プロジェクト: Tommekster/salut
void personForm::createForm()
{
    // Form
    lblName = new QLabel(tr("Name"),this);
    edtName = new QLineEdit(this);
    lblSurname = new QLabel(tr("Surname"),this);
    edtSurname = new QLineEdit(this);
    lblBirthDate = new QLabel(tr("Birth Date"),this);
    edtBirthDate = new QDateEdit(this);
    edtBirthDate->setCalendarPopup(true);
    lblAddress = new QLabel(tr("Address"));
    edtAddress = new QTextEdit(this);
    edtAddress->setMinimumHeight(75);
    lblEmail = new QLabel(tr("Email"),this);
    edtEmail = new QLineEdit(this);
    lblPhone = new QLabel(tr("Phone"),this);
    edtPhone = new QLineEdit(this);
    lblBank = new QLabel(tr("Bank"));
    edtBank = new QLineEdit(this);

    btnSubmit = new QPushButton(tr("Cre&ate"),this);
    btnCancel = new QPushButton(tr("&Cancel"),this);

    QHBoxLayout *lButtons = new QHBoxLayout;
    lButtons->addWidget(btnSubmit);
    lButtons->addWidget(btnCancel);

    QFormLayout *lForm = new QFormLayout;
    lForm->addRow(lblName,edtName);
    lForm->addRow(lblSurname,edtSurname);
    lForm->addRow(lblBirthDate,edtBirthDate);
    lForm->addRow(lblAddress,edtAddress);
    lForm->addRow(lblEmail,edtEmail);
    lForm->addRow(lblPhone,edtPhone);
    lForm->addRow(lblBank,edtBank);
    lForm->setFieldGrowthPolicy(lForm->ExpandingFieldsGrow);

    QVBoxLayout *lMain = new QVBoxLayout;
    lMain->addLayout(lForm);
    lMain->addStretch();
    lMain->addLayout(lButtons);

    setLayout(lMain);

    // Signals & slots
    connect(btnSubmit,SIGNAL(clicked(bool)),this,SLOT(on_submit()));
    connect(btnCancel,SIGNAL(clicked(bool)),this,SLOT(reject()));
}
コード例 #26
0
void PropertiesDialog::createGeneralInfoBox()
{
	generalInfoBox = new QWidget;

	QFormLayout *generalInfoLayout = new QFormLayout;

    generalInfoLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
	//generalInfoLayout->setRowWrapPolicy(QFormLayout::WrapAllRows);
	generalInfoLayout->addRow(tr("Title:"), title = new YACReaderFieldEdit());
	

	QHBoxLayout * number = new QHBoxLayout;
	number->addWidget(numberEdit = new YACReaderFieldEdit());
	numberValidator.setBottom(0);
	numberEdit->setValidator(&numberValidator);
	number->addWidget(new QLabel("Bis:"));
	number->addWidget(isBisCheck = new QCheckBox());
	number->addWidget(new QLabel("of:"));
	number->addWidget(countEdit = new YACReaderFieldEdit());
	countValidator.setBottom(0);
	countEdit->setValidator(&countValidator);
	number->addStretch(1);
	/*generalInfoLayout->addRow(tr("&Issue number:"), );
	generalInfoLayout->addRow(tr("&Bis:"), );*/
	generalInfoLayout->addRow(tr("Issue number:"), number);
	
	generalInfoLayout->addRow(tr("Volume:"), volumeEdit = new YACReaderFieldEdit());

	QHBoxLayout * arc = new QHBoxLayout;
	arc->addWidget(storyArcEdit = new YACReaderFieldEdit());
	arc->addWidget(new QLabel("Arc number:"));
	arc->addWidget(arcNumberEdit = new YACReaderFieldEdit());
	arcNumberValidator.setBottom(0);
	arcNumberEdit->setValidator(&arcNumberValidator);
	arc->addWidget(new QLabel("of:"));
	arc->addWidget(arcCountEdit = new YACReaderFieldEdit());
	arcCountValidator.setBottom(0);
	arcCountEdit->setValidator(&arcCountValidator);
	arc->addStretch(1);
	generalInfoLayout->addRow(tr("Story arc:"), arc);
	
	generalInfoLayout->addRow(tr("Genere:"),  genereEdit = new YACReaderFieldEdit());
	
	generalInfoLayout->addRow(tr("Size:"), size = new QLabel("size"));

	generalInfoBox->setLayout(generalInfoLayout);
}
コード例 #27
0
QWidget *CMakeSettingsPage::createPage(QWidget *parent)
{
    QWidget *outerWidget = new QWidget(parent);
    QFormLayout *formLayout = new QFormLayout(outerWidget);
    formLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
    m_pathchooser = new Utils::PathChooser;
    m_pathchooser->setExpectedKind(Utils::PathChooser::ExistingCommand);
    formLayout->addRow(tr("Executable:"), m_pathchooser);
    formLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Ignored, QSizePolicy::MinimumExpanding));
    m_pathchooser->setPath(m_cmakeValidatorForUser.cmakeExecutable());

    m_preferNinja = new QCheckBox(tr("Prefer Ninja generator (CMake 2.8.9 or higher required)"));
    m_preferNinja->setChecked(preferNinja());
    formLayout->addRow(m_preferNinja);

    return outerWidget;
}
コード例 #28
0
GenericBuildSettingsWidget::GenericBuildSettingsWidget(GenericBuildConfiguration *bc)
    : m_buildConfiguration(0)
{
    QFormLayout *fl = new QFormLayout(this);
    fl->setContentsMargins(0, -1, 0, -1);
    fl->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);

    // build directory
    m_pathChooser = new Utils::PathChooser(this);
    m_pathChooser->setEnabled(true);
    fl->addRow(tr("Build directory:"), m_pathChooser);
    connect(m_pathChooser, SIGNAL(changed(QString)), this, SLOT(buildDirectoryChanged()));

    m_buildConfiguration = bc;
    m_pathChooser->setBaseDirectory(bc->target()->project()->projectDirectory());
    m_pathChooser->setPath(m_buildConfiguration->rawBuildDirectory());
    setDisplayName(tr("Generic Manager"));
}
コード例 #29
0
QWidget* PreferencesDialog::getFontsPage() {
    QWidget* widget = new QWidget();

    //---------------------
    // Font
    //---------------------
    GroupContainer *fontGroup = new GroupContainer;
    fontGroup->setTitle("Font");

    //Font Size
    QSpinBox* fontSizeCombo = new QSpinBox;
    fontSizeCombo->setMinimum(8);
    fontSizeCombo->setMaximum(14);
    fontSizeCombo->setValue(QApplication::font().pointSize());

    connect(fontSizeCombo, static_cast<void(QSpinBox::*)(int)>(&QSpinBox::valueChanged), 
            [=] (int i){UserPreferences().setFontSize(i);});

    //Font Weight
    QComboBox *fontWeightCombo = new QComboBox;
    fontWeightCombo->addItems(QStringList() << "0" << "25" << "50" << "75");
    fontWeightCombo->setCurrentText(QString::number(QApplication::font().weight()));

    connect(fontWeightCombo, static_cast<void(QComboBox::*)(const QString&)> (&QComboBox::currentTextChanged),
            [ = ] (const QString & value){UserPreferences().setFontWeight(value);});

    QFormLayout *fontLayout = new QFormLayout;
    fontLayout->setRowWrapPolicy(QFormLayout::WrapLongRows);
    fontLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
    fontLayout->setFormAlignment(Qt::AlignHCenter | Qt::AlignTop);
    fontLayout->setLabelAlignment(Qt::AlignRight);
    fontLayout->addRow("Font Size", fontSizeCombo);
    fontLayout->addRow("Font Weight", fontWeightCombo);

    fontGroup->setContainerLayout(fontLayout);

    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->setMargin(0);
    mainLayout->setSpacing(0);
    mainLayout->addWidget(fontGroup);
    mainLayout->addStretch(1);
    widget->setLayout(mainLayout);
    return widget;
}
コード例 #30
0
ファイル: ConfigureDlg.cpp プロジェクト: charlesnw1/RTMQTT
void ConfigureDlg::layoutWindow()
{
    QSettings settings;

    setModal(true);

    QVBoxLayout *centralLayout = new QVBoxLayout(this);
    centralLayout->setSpacing(20);
    centralLayout->setContentsMargins(11, 11, 11, 11);

    QFormLayout *formLayout = new QFormLayout();
    formLayout->setSpacing(16);
    formLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);

    settings.beginGroup(RTMQTTCLIENT_PARAMS_GROUP);
    m_brokerAddress = new QLineEdit();
    m_brokerAddress->setText(settings.value(RTMQTTCLIENT_PARAMS_BROKERADDRESS).toString());
    m_brokerAddress->setToolTip("The MQTT broker address (e.g. tcp://localhost:1883");
    m_brokerAddress->setMinimumWidth(200);
    formLayout->addRow(tr("MQTT broker address:"), m_brokerAddress);

    m_clientID = new QLineEdit();
    m_clientID->setText(settings.value(RTMQTTCLIENT_PARAMS_CLIENTID).toString());
    m_clientID->setToolTip("The client ID is used to sign on to the NQTT broker");
    m_clientID->setMinimumWidth(200);
    formLayout->addRow(tr("MQTT client ID:"), m_clientID);

    m_clientSecret = new QLineEdit();
    m_clientSecret->setText(settings.value(RTMQTTCLIENT_PARAMS_CLIENTSECRET).toString());
    m_clientSecret->setToolTip("The client secret may be used to sign on to the NQTT broker");
    m_clientSecret->setMinimumWidth(200);
    m_clientSecret->setEchoMode(QLineEdit::Password);
    formLayout->addRow(tr("MQTT client secret:"), m_clientSecret);

    settings.endGroup();

    centralLayout->addLayout(formLayout);

    m_buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this);
    m_buttons->setCenterButtons(true);

    centralLayout->addWidget(m_buttons);
}