コード例 #1
0
ファイル: resourcenetconfig.cpp プロジェクト: lenggi/kcalcore
ResourceNetConfig::ResourceNetConfig( QWidget *parent )
    : ConfigWidget( parent ), mInEditMode( false )
{
  QFormLayout *mainLayout = new QFormLayout( this );
  mainLayout->setMargin( 0 );

  mFormatBox = new KComboBox( this );

  mainLayout->addRow( i18n( "Format:" ), mFormatBox );

  mUrlEdit = new KUrlRequester( this );
  mUrlEdit->setMode( KFile::File );

  mainLayout->addRow( i18n( "Location:" ), mUrlEdit );

  FormatFactory *factory = FormatFactory::self();
  QStringList formats = factory->formats();
  QStringList::Iterator it;
  for ( it = formats.begin(); it != formats.end(); ++it ) {
    FormatInfo info = factory->info( *it );
    if ( !info.isNull() ) {
      mFormatTypes << ( *it );
      mFormatBox->addItem( info.nameLabel );
    }
  }
}
コード例 #2
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()));
}
コード例 #3
0
LabelParameterWidget::LabelParameterWidget(QWidget *parent) :
    QWidget(parent)
{
    m_order = new ManufactureOrder(this);
    m_edOrder = new ManufactureOrderEdit(this);
    m_cmbParty = new AdvComboBox(this);
    m_labItem = new QLabel(this);
    m_labContr = new QLabel(this);
    m_labDate = new QLabel(this);
    m_labStation = new QLabel(this);
    m_partyModel = new QSqlQueryModel(this);

    m_cmbParty->setMaximumWidth(60);


    QFormLayout *centrLay = new QFormLayout(this);

    centrLay->addRow(tr("Item:"), m_labItem);
    centrLay->addRow(tr("Contractor:"), m_labContr);
    centrLay->addRow(tr("Date:"), m_labDate);
    centrLay->addRow(tr("Station:"), m_labStation);
    centrLay->addRow(tr("Order:"), m_edOrder);
    centrLay->addRow(tr("Party:"), m_cmbParty);

    connect(m_edOrder, SIGNAL(returnPressed()), SLOT(loadCurrentOrder()));
    connect(m_edOrder, SIGNAL(editingFinished()), SLOT(loadCurrentOrder()));

    centrLay->setMargin(0);
}
コード例 #4
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());
}
ByteArraySourceCodeStreamEncoderConfigEditor::ByteArraySourceCodeStreamEncoderConfigEditor( ByteArraySourceCodeStreamEncoder* encoder, QWidget* parent )
 : AbstractModelStreamEncoderConfigEditor( parent ),
   mEncoder( encoder )
{
    mSettings = mEncoder->settings();

    QFormLayout* pageLayout = new QFormLayout( this );
    pageLayout->setMargin( 0 );

    // variable name
    const QString variableNameLabel =
        i18nc( "@label:textbox name of the created variable",
               "Name of variable:" );

    mVariableNameEdit = new KLineEdit( this );
    mVariableNameEdit->setText( mSettings.variableName );
    connect( mVariableNameEdit, SIGNAL(textChanged(QString)), SLOT(onSettingsChanged()) );
    pageLayout->addRow( variableNameLabel, mVariableNameEdit );

    // items per line
    const QString itemsPerLineLabel =
        i18nc( "@label:textbox to define after how many items the list is wrapped",
               "Items per line:" );

    mItemsPerLineEdit = new KIntNumInput( this );
    mItemsPerLineEdit->setMinimum( 1 );
    mItemsPerLineEdit->setValue( mSettings.elementsPerLine );
    connect( mItemsPerLineEdit, SIGNAL(valueChanged(int)), SLOT(onSettingsChanged()) );
    pageLayout->addRow( itemsPerLineLabel, mItemsPerLineEdit );

    // data type
    const QString dataTypeLabel =
        i18nc( "@label:listbox the type of the data: char, integer, etc.",
               "Data type:" );

    mDataTypeSelect = new KComboBox( this );
    const char* const* dataTypeNames = mEncoder->dataTypeNames();
    const int dataTypesCount = mEncoder->dataTypesCount();
    QStringList dataTypeNameStrings;
    for( int i=0; i<dataTypesCount; ++i )
        dataTypeNameStrings << QLatin1String(dataTypeNames[i]);
    mDataTypeSelect->addItems( dataTypeNameStrings );
    mDataTypeSelect->setCurrentIndex( mSettings.dataType );
    connect( mDataTypeSelect, SIGNAL(activated(int)), SLOT(onSettingsChanged()) );
    pageLayout->addRow( dataTypeLabel, mDataTypeSelect );

    // unsigned as hexadezimal
    const QString unsignedAsHexadecimalLabel =
        i18nc( "@option:check Encode the values in hexadecimal instead of decimal, "
               "if the datatype has the property Unsigned",
               "Unsigned as hexadecimal:" );

    mUnsignedAsHexadecimalCheck = new QCheckBox( this );
    mUnsignedAsHexadecimalCheck->setChecked( mSettings.unsignedAsHexadecimal );
    connect( mUnsignedAsHexadecimalCheck, SIGNAL(toggled(bool)), SLOT(onSettingsChanged()) );
    pageLayout->addRow( unsignedAsHexadecimalLabel, mUnsignedAsHexadecimalCheck );
}
コード例 #6
0
Qt4RunConfigurationWidget::Qt4RunConfigurationWidget(Qt4RunConfiguration *qt4RunConfiguration, QWidget *parent)
    : QWidget(parent),
    m_qt4RunConfiguration(qt4RunConfiguration),
    m_ignoreChange(false),
    m_usingDyldImageSuffix(0),
    m_isShown(false)
{
    QFormLayout *toplayout = new QFormLayout(this);
    toplayout->setMargin(0);

    QLabel *nameLabel = new QLabel(tr("Name:"));
    m_nameLineEdit = new QLineEdit(m_qt4RunConfiguration->name());
    nameLabel->setBuddy(m_nameLineEdit);
    toplayout->addRow(nameLabel, m_nameLineEdit);

    m_executableLabel = new QLabel(m_qt4RunConfiguration->executable());
    toplayout->addRow(tr("Executable:"), m_executableLabel);

    m_workingDirectoryLabel = new QLabel(m_qt4RunConfiguration->workingDirectory());
    toplayout->addRow(tr("Working Directory:"), m_workingDirectoryLabel);

    QLabel *argumentsLabel = new QLabel(tr("&Arguments:"));
    m_argumentsLineEdit = new QLineEdit(ProjectExplorer::Environment::joinArgumentList(qt4RunConfiguration->commandLineArguments()));
    argumentsLabel->setBuddy(m_argumentsLineEdit);
    toplayout->addRow(argumentsLabel, m_argumentsLineEdit);

    m_useTerminalCheck = new QCheckBox(tr("Run in &Terminal"));
    m_useTerminalCheck->setChecked(m_qt4RunConfiguration->runMode() == ProjectExplorer::ApplicationRunConfiguration::Console);
    toplayout->addRow(QString(), m_useTerminalCheck);

#ifdef Q_OS_MAC
    m_usingDyldImageSuffix = new QCheckBox(tr("Use debug version of frameworks (DYLD_IMAGE_SUFFIX=_debug)"));
    m_usingDyldImageSuffix->setChecked(m_qt4RunConfiguration->isUsingDyldImageSuffix());
    toplayout->addRow(QString(), m_usingDyldImageSuffix);
    connect(m_usingDyldImageSuffix, SIGNAL(toggled(bool)),
            this, SLOT(usingDyldImageSuffixToggled(bool)));
#endif

    connect(m_argumentsLineEdit, SIGNAL(textEdited(QString)),
            this, SLOT(setCommandLineArguments(QString)));
    connect(m_nameLineEdit, SIGNAL(textEdited(QString)),
            this, SLOT(nameEdited(QString)));
    connect(m_useTerminalCheck, SIGNAL(toggled(bool)),
            this, SLOT(termToggled(bool)));

    connect(qt4RunConfiguration, SIGNAL(commandLineArgumentsChanged(QString)),
            this, SLOT(commandLineArgumentsChanged(QString)));
    connect(qt4RunConfiguration, SIGNAL(nameChanged(QString)),
            this, SLOT(nameChanged(QString)));
    connect(qt4RunConfiguration, SIGNAL(runModeChanged(ProjectExplorer::ApplicationRunConfiguration::RunMode)),
            this, SLOT(runModeChanged(ProjectExplorer::ApplicationRunConfiguration::RunMode)));
    connect(qt4RunConfiguration, SIGNAL(usingDyldImageSuffixChanged(bool)),
            this, SLOT(usingDyldImageSuffixChanged(bool)));

    connect(qt4RunConfiguration, SIGNAL(effectiveTargetInformationChanged()),
            this, SLOT(effectiveTargetInformationChanged()), Qt::QueuedConnection);
}
コード例 #7
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);
}
コード例 #8
0
ファイル: onlinesearchgeneral.cpp プロジェクト: KDE/kbibtex
OnlineSearchQueryFormGeneral::OnlineSearchQueryFormGeneral(QWidget *parent)
        : OnlineSearchQueryFormAbstract(parent),
      configGroupName(QStringLiteral("Search Engine General"))
{
    QFormLayout *layout = new QFormLayout(this);
    layout->setMargin(0);

    QLabel *label = new QLabel(i18n("Free text:"), this);
    KLineEdit *lineEdit = new KLineEdit(this);
    layout->addRow(label, lineEdit);
    lineEdit->setClearButtonEnabled(true);
    lineEdit->setFocus(Qt::TabFocusReason);
    queryFields.insert(OnlineSearchAbstract::queryKeyFreeText, lineEdit);
    label->setBuddy(lineEdit);
    connect(lineEdit, &KLineEdit::returnPressed, this, &OnlineSearchQueryFormGeneral::returnPressed);

    label = new QLabel(i18n("Title:"), this);
    lineEdit = new KLineEdit(this);
    layout->addRow(label, lineEdit);
    lineEdit->setClearButtonEnabled(true);
    queryFields.insert(OnlineSearchAbstract::queryKeyTitle, lineEdit);
    label->setBuddy(lineEdit);
    connect(lineEdit, &KLineEdit::returnPressed, this, &OnlineSearchQueryFormGeneral::returnPressed);

    label = new QLabel(i18n("Author:"), this);
    lineEdit = new KLineEdit(this);
    layout->addRow(label, lineEdit);
    lineEdit->setClearButtonEnabled(true);
    queryFields.insert(OnlineSearchAbstract::queryKeyAuthor, lineEdit);
    label->setBuddy(lineEdit);
    connect(lineEdit, &KLineEdit::returnPressed, this, &OnlineSearchQueryFormGeneral::returnPressed);

    label = new QLabel(i18n("Year:"), this);
    lineEdit = new KLineEdit(this);
    layout->addRow(label, lineEdit);
    lineEdit->setClearButtonEnabled(true);
    queryFields.insert(OnlineSearchAbstract::queryKeyYear, lineEdit);
    label->setBuddy(lineEdit);
    connect(lineEdit, &KLineEdit::returnPressed, this, &OnlineSearchQueryFormGeneral::returnPressed);

    label = new QLabel(i18n("Number of Results:"), this);
    numResultsField = new QSpinBox(this);
    layout->addRow(label, numResultsField);
    numResultsField->setMinimum(3);
    numResultsField->setMaximum(100);
    numResultsField->setValue(20);
    label->setBuddy(numResultsField);

    loadState();
}
コード例 #9
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);
    }
コード例 #10
0
ファイル: alarmview.cpp プロジェクト: Camelek/qtmoko
void AlarmView::init()
{
    /* Create stuff! */
    QFormLayout *mainL = new QFormLayout();
    mainL->setSpacing(2);
    mainL->setMargin(2);

    mAlarmList = new QWrapListView();
    mAlarmList->setSelectionMode(QListView::SingleSelection);
    mAlarmList->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    //mAlarmList->setUniformItemSizes(true);
    mAlarmList->setAlternatingRowColors(true);
    mAlarmList->setItemDelegate(new TwoLevelDelegate(mAlarmList));
    mAlarmList->setResizeMode(QListView::Adjust);
    mAlarmList->setLayoutMode(QListView::Batched);
    QSizePolicy expando(QSizePolicy::Expanding, QSizePolicy::Expanding);
    expando.setVerticalStretch(1);
    mAlarmList->setSizePolicy(expando);

    mainL->addRow(mAlarmList);

    mSnoozeButton = new QPushButton(tr("Snooze"));
    mainL->addRow(mSnoozeButton);

    mSnoozeChoices = new QComboBox();

    mSnoozeChoices->clear();
    mSnoozeChoices->addItem(tr("5 minutes"));
    mSnoozeChoices->addItem(tr("10 minutes"));
    mSnoozeChoices->addItem(tr("15 minutes"));
    mSnoozeChoices->addItem(tr("30 minutes"));
    mSnoozeChoices->addItem(tr("1 hour"));
    mSnoozeChoices->addItem(tr("1 day"));
    mSnoozeChoices->addItem(tr("1 week"));
    mSnoozeChoices->addItem(tr("1 month"));

    mainL->addRow(tr("Snooze delay:"), mSnoozeChoices);
    setLayout(mainL);

    mStandardModel = new QStandardItemModel(this);
    mAlarmList->setModel(mStandardModel);
    connect(mAlarmList->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)),
            this, SLOT(currentAlarmChanged(QModelIndex)));
    connect(mAlarmList, SIGNAL(activated(QModelIndex)), this, SLOT(alarmSelected(QModelIndex)));

    connect(mSnoozeButton, SIGNAL(clicked()), this, SLOT(snoozeClicked()));
}
コード例 #11
0
SymbianQtConfigWidget::SymbianQtConfigWidget(SymbianQtVersion *version)
    : m_version(version)
{
    QFormLayout *fl = new QFormLayout();
    fl->setMargin(0);
    setLayout(fl);

    if (version->isBuildWithSymbianSbsV2()) {
        Utils::PathChooser *sbsV2Path = new Utils::PathChooser;
        sbsV2Path->setExpectedKind(Utils::PathChooser::ExistingDirectory);
        fl->addRow(tr("SBS v2 directory:"), sbsV2Path);
        sbsV2Path->setPath(QDir::toNativeSeparators(version->sbsV2Directory()));
        sbsV2Path->setEnabled(version->isBuildWithSymbianSbsV2());
        connect(sbsV2Path, SIGNAL(changed(QString)),
                this, SLOT(updateCurrentSbsV2Directory(QString)));
    }
}
コード例 #12
0
ファイル: lyricsdialog.cpp プロジェクト: pmattern/cantata
LyricsDialog::LyricsDialog(const Song &s, QWidget *parent)
    : Dialog(parent)
    , prev(s)
{
    QWidget *mw=new QWidget(this);
    QGridLayout *mainLayout=new QGridLayout(mw);
    QWidget *wid = new QWidget(mw);
    QFormLayout *layout = new QFormLayout(wid);
    int row=0;
    QLabel *lbl=new QLabel(i18n("If Cantata has failed to find lyrics, or has found the wrong ones, "
                                "use this dialog to enter new search details. For example, the current "
                                "song may actually be a cover-version - if so, then searching for "
                                "lyrics by the original artist might help.\n\nIf this search does find "
                                "new lyrics, these will still be associated with the original song title "
                                "and artist as displayed in Cantata."), mw);
    lbl->setWordWrap(true);
    QLabel *icn=new QLabel(mw);
    icn->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
    int iconSize=48;
    icn->setMinimumSize(iconSize, iconSize);
    icn->setMaximumSize(iconSize, iconSize);
    icn->setPixmap(Icon("dialog-information").pixmap(iconSize, iconSize));
    mainLayout->setMargin(0);
    layout->setMargin(0);
    mainLayout->addWidget(icn, 0, 0, 1, 1);
    mainLayout->addWidget(lbl, 0, 1, 1, 1);
    mainLayout->addItem(new QSpacerItem(8, 4, QSizePolicy::Fixed, QSizePolicy::Fixed), 1, 0);
    mainLayout->addWidget(wid, 2, 0, 1, 2);
    titleEntry = new LineEdit(wid);
    artistEntry = new LineEdit(wid);

    layout->setWidget(row, QFormLayout::LabelRole, new QLabel(i18n("Title:"), wid));
    layout->setWidget(row++, QFormLayout::FieldRole, titleEntry);
    layout->setWidget(row, QFormLayout::LabelRole, new QLabel(i18n("Artist:"), wid));
    layout->setWidget(row++, QFormLayout::FieldRole, artistEntry);
    setCaption(i18n("Search For Lyrics"));
    setMainWidget(mw);
    setButtons(Ok|Cancel);
    enableButton(Ok, false);
    connect(titleEntry, SIGNAL(textChanged(const QString &)), SLOT(changed()));
    connect(artistEntry, SIGNAL(textChanged(const QString &)), SLOT(changed()));
    titleEntry->setFocus();
    titleEntry->setText(s.title);
    artistEntry->setText(s.artist);
}
コード例 #13
0
QWidget* OperaNotesImporter::getOptionsWidget()
{
	if (!m_optionsWidget)
	{
		m_optionsWidget = new QWidget();

		QFormLayout *layout = new QFormLayout(m_optionsWidget);
		layout->setMargin(0);

		m_optionsWidget->setLayout(layout);

		m_folderComboBox = new BookmarksComboBoxWidget(m_optionsWidget);
		m_folderComboBox->setMode(BookmarksModel::NotesMode);

		layout->addRow(tr("Import into folder:"), m_folderComboBox);
	}

	return m_optionsWidget;
}
コード例 #14
0
ByteArrayXxencodingStreamEncoderConfigEditor::ByteArrayXxencodingStreamEncoderConfigEditor( ByteArrayXxencodingStreamEncoder* encoder, QWidget* parent )
 : AbstractModelStreamEncoderConfigEditor( parent ),
   mEncoder( encoder )
{
    mSettings = mEncoder->settings();

    QFormLayout* pageLayout = new QFormLayout( this );
    pageLayout->setMargin( 0 );

    // internal file name
    const QString fileNameLabel =
        i18nc( "@label:textbox file name internally given to the encoded data",
               "Internal name of file:" );

    mFileNameEdit = new KLineEdit( this );
    mFileNameEdit->setText( mSettings.fileName );
    connect( mFileNameEdit, &KLineEdit::textChanged, this, &ByteArrayXxencodingStreamEncoderConfigEditor::onSettingsChanged );
    pageLayout->addRow( fileNameLabel, mFileNameEdit );
}
コード例 #15
0
RotateByteArrayFilterParameterSetEdit::RotateByteArrayFilterParameterSetEdit( QWidget* parent )
    : AbstractByteArrayFilterParameterSetEdit( parent )
{
    QFormLayout* baseLayout = new QFormLayout( this );
    baseLayout->setMargin( 0 );

    mGroupSizeEdit = new KIntNumInput( this );
    mGroupSizeEdit->setRange( 1, INT_MAX );
    mGroupSizeEdit->setSuffix( ki18np(" byte"," bytes") );

    const QString groupSizeLabelText =
        i18nc( "@label:spinbox number of bytes the movement is done within",
               "&Group size:" );
    const QString groupSizeToolTip =
        i18nc( "@info:tooltip",
               "The number of bytes within which each movement is made." );
    mGroupSizeEdit->setToolTip( groupSizeToolTip );
    const QString groupSizeWhatsThis =
        i18nc( "@info:whatsthis",
               "Control the number of bytes within which each movement is made." );
    mGroupSizeEdit->setWhatsThis( groupSizeWhatsThis );

    baseLayout->addRow( groupSizeLabelText, mGroupSizeEdit );

    mMoveBitWidthEdit = new KIntNumInput( this );
    mMoveBitWidthEdit->setRange( INT_MIN, INT_MAX );
    mMoveBitWidthEdit->setSuffix( ki18np(" bit"," bits") );
    connect( mMoveBitWidthEdit, SIGNAL(valueChanged(int)), SLOT(onValueChanged(int)) );

    const QString moveBitWidthLabelText =
        i18nc( "@label:spinbox width (in number of bits) the bits are moved",
               "S&hift width:" );
    const QString moveBitWidthToolTip =
        i18nc( "@info:tooltip",
               "The width of the shift. Positive numbers move the bits to the right, negative to the left." );
    mMoveBitWidthEdit->setToolTip( moveBitWidthToolTip );
    const QString moveBitWidthWhatsThis =
        i18nc( "@info:whatsthis",
               "Control the width of the shift. Positive numbers move the bits to the right, negative to the left." );
    mMoveBitWidthEdit->setWhatsThis( moveBitWidthWhatsThis );

    baseLayout->addRow( moveBitWidthLabelText, mMoveBitWidthEdit );
}
コード例 #16
0
CustomExecutableConfigurationWidget::CustomExecutableConfigurationWidget(CustomExecutableRunConfiguration *rc)
    : m_ignoreChange(false)
{
    m_runConfiguration = rc;
    
    QFormLayout *layout = new QFormLayout();
    layout->setMargin(0);

    m_executableLineEdit = new QLineEdit;
    QToolButton *exectuableToolButton = new QToolButton();
    exectuableToolButton->setText("...");
    QHBoxLayout *hl = new QHBoxLayout;
    hl->addWidget(m_executableLineEdit);
    hl->addWidget(exectuableToolButton);
    layout->addRow("Executable", hl);

    m_commandLineArgumentsLineEdit = new QLineEdit;
    layout->addRow("Arguments", m_commandLineArgumentsLineEdit);

    m_workingDirectoryLineEdit = new QLineEdit();
    QToolButton *workingDirectoryToolButton = new QToolButton();
    workingDirectoryToolButton->setText("...");
    hl = new QHBoxLayout;
    hl->addWidget(m_workingDirectoryLineEdit);
    hl->addWidget(workingDirectoryToolButton);
    layout->addRow("Working Directory", hl);

    setLayout(layout);
    changed();
    
    connect(m_executableLineEdit, SIGNAL(textEdited(const QString&)),
            this, SLOT(setExecutable(const QString&)));
    connect(m_commandLineArgumentsLineEdit, SIGNAL(textEdited(const QString&)),
            this, SLOT(setCommandLineArguments(const QString&)));
    connect(m_workingDirectoryLineEdit, SIGNAL(textEdited(const QString&)),
            this, SLOT(setWorkingDirectory(const QString&)));
    connect(exectuableToolButton, SIGNAL(clicked(bool)),
            this, SLOT(executableToolButtonClicked()));
    connect(workingDirectoryToolButton, SIGNAL(clicked(bool)),
            this, SLOT(workingDirectoryToolButtonClicked()));
    
    connect(m_runConfiguration, SIGNAL(changed()), this, SLOT(changed()));
}
コード例 #17
0
CustomExecutableConfigurationWidget::CustomExecutableConfigurationWidget(CustomExecutableRunConfiguration *rc)
    : m_ignoreChange(false)
{
    m_runConfiguration = rc;
    
    QFormLayout *layout = new QFormLayout;
    layout->setMargin(0);

    m_userName = new QLineEdit(this);
    layout->addRow("Name:", m_userName);

    m_executableChooser = new Core::Utils::PathChooser(this);
    m_executableChooser->setExpectedKind(Core::Utils::PathChooser::Command);
    layout->addRow("Executable:", m_executableChooser);

    m_commandLineArgumentsLineEdit = new QLineEdit(this);
    m_commandLineArgumentsLineEdit->setMinimumWidth(200); // this shouldn't be fixed here...
    layout->addRow("Arguments:", m_commandLineArgumentsLineEdit);

    m_workingDirectory = new CustomDirectoryPathChooser(this);
    m_workingDirectory->setExpectedKind(Core::Utils::PathChooser::Directory);
    layout->addRow("Working Directory:", m_workingDirectory);

    m_useTerminalCheck = new QCheckBox(tr("Run in &Terminal"), this);
    layout->addRow(QString(), m_useTerminalCheck);

    setLayout(layout);
    changed();
    
    connect(m_userName, SIGNAL(textEdited(QString)),
            this, SLOT(setUserName(QString)));
    connect(m_executableChooser, SIGNAL(changed()),
            this, SLOT(setExecutable()));
    connect(m_commandLineArgumentsLineEdit, SIGNAL(textEdited(const QString&)),
            this, SLOT(setCommandLineArguments(const QString&)));
    connect(m_workingDirectory, SIGNAL(changed()),
            this, SLOT(setWorkingDirectory()));
    connect(m_useTerminalCheck, SIGNAL(toggled(bool)),
            this, SLOT(termToggled(bool)));

    connect(m_runConfiguration, SIGNAL(changed()), this, SLOT(changed()));
}
コード例 #18
0
S60EmulatorRunConfigurationWidget::S60EmulatorRunConfigurationWidget(S60EmulatorRunConfiguration *runConfiguration,
                                                                     QWidget *parent)
    : QWidget(parent),
    m_runConfiguration(runConfiguration),
    m_detailsWidget(new Utils::DetailsWidget),
    m_executableLabel(new QLabel(m_runConfiguration->executable()))
{
    m_detailsWidget->setState(Utils::DetailsWidget::NoSummary);
    QVBoxLayout *mainBoxLayout = new QVBoxLayout();
    mainBoxLayout->setMargin(0);

    QHBoxLayout *hl = new QHBoxLayout();
    hl->addStretch();
    m_disabledIcon = new QLabel(this);
    m_disabledIcon->setPixmap(QPixmap(QString::fromUtf8(":/projectexplorer/images/compile_warning.png")));
    hl->addWidget(m_disabledIcon);
    m_disabledReason = new QLabel(this);
    m_disabledReason->setVisible(false);
    hl->addWidget(m_disabledReason);
    hl->addStretch();
    mainBoxLayout->addLayout(hl);

    setLayout(mainBoxLayout);
    mainBoxLayout->addWidget(m_detailsWidget);
    QWidget *detailsContainer = new QWidget;
    m_detailsWidget->setWidget(detailsContainer);

    QFormLayout *detailsFormLayout = new QFormLayout();
    detailsFormLayout->setMargin(0);
    detailsContainer->setLayout(detailsFormLayout);

    detailsFormLayout->addRow(tr("Executable:"), m_executableLabel);

    connect(m_runConfiguration, SIGNAL(targetInformationChanged()),
            this, SLOT(updateTargetInformation()));

    connect(m_runConfiguration, SIGNAL(isEnabledChanged(bool)),
            this, SLOT(runConfigurationEnabledChange(bool)));

    runConfigurationEnabledChange(m_runConfiguration->isEnabled());
}
コード例 #19
0
ファイル: configurestep.cpp プロジェクト: DuinoDu/qt-creator
/////////////////////////////////////
// ConfigureStepConfigWidget class
/////////////////////////////////////
ConfigureStepConfigWidget::ConfigureStepConfigWidget(ConfigureStep *configureStep) :
    m_configureStep(configureStep),
    m_additionalArguments(new QLineEdit)
{
    QFormLayout *fl = new QFormLayout(this);
    fl->setMargin(0);
    fl->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
    setLayout(fl);

    fl->addRow(tr("Arguments:"), m_additionalArguments);
    m_additionalArguments->setText(m_configureStep->additionalArguments());

    updateDetails();

    connect(m_additionalArguments, &QLineEdit::textChanged,
            configureStep, &ConfigureStep::setAdditionalArguments);
    connect(configureStep, &ConfigureStep::additionalArgumentsChanged,
            this, &ConfigureStepConfigWidget::updateDetails);
    connect(configureStep, &ConfigureStep::buildDirectoryChanged,
            this, &ConfigureStepConfigWidget::updateDetails);
}
コード例 #20
0
//////////////////////////////////////
// AutoreconfStepConfigWidget class
//////////////////////////////////////
AutoreconfStepConfigWidget::AutoreconfStepConfigWidget(AutoreconfStep *autoreconfStep) :
    m_autoreconfStep(autoreconfStep),
    m_summaryText(),
    m_additionalArguments(0)
{
    QFormLayout *fl = new QFormLayout(this);
    fl->setMargin(0);
    fl->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
    setLayout(fl);

    m_additionalArguments = new QLineEdit(this);
    fl->addRow(tr("Arguments:"), m_additionalArguments);
    m_additionalArguments->setText(m_autoreconfStep->additionalArguments());

    updateDetails();

    connect(m_additionalArguments, SIGNAL(textChanged(QString)),
            autoreconfStep, SLOT(setAdditionalArguments(QString)));
    connect(autoreconfStep, SIGNAL(additionalArgumentsChanged(QString)),
            this, SLOT(updateDetails()));
}
コード例 #21
0
BytesPerLineDialog::BytesPerLineDialog( QWidget* parent )
  : KDialog( parent )
{
    QWidget* page = new QWidget( this );
    setMainWidget( page );

    QFormLayout* pageLayout = new QFormLayout( page );
    pageLayout->setMargin( 0 );

    mBytesPerLineEdit = new KIntNumInput( this );
    mBytesPerLineEdit->setRange( 1, INT_MAX );
    mBytesPerLineEdit->setSuffix( ki18np(" byte"," bytes") );
    const QString bytesPerLineLabel =
        i18nc( "@label:spinbox number of bytes which are shown per line",
                "Per Line:" );
    pageLayout->addRow( bytesPerLineLabel, mBytesPerLineEdit );

    const QString caption =
        i18nc("@title:window","Bytes per Line");
    setCaption( caption );
    setButtons( Ok | Cancel );
}
コード例 #22
0
Template_ByteArrayFilterParameterSetEdit::Template_ByteArrayFilterParameterSetEdit( QWidget* parent )
  : AbstractByteArrayFilterParameterSetEdit( parent )
{
//// ADAPT(start)
//// setup the widget with all edit fields needed for the parameter set
//// if there can be invalid states connect the change signals of the edit fields to some slots
//// where you check if the validity changed
    QFormLayout* baseLayout = new QFormLayout( this );
    // margin is provided by the container for this widget
    baseLayout->setMargin( 0 );

    mLevelEdit = new KIntNumInput( this );
    // For demonstration purpose we start at -1, not 0, to show handling of an invalid state
    // Otherwise the range should start at 0 and there is no need to connect to the valueChanged signal
    mLevelEdit->setRange( -1, 256 );
    // start with the invalid number
    mLevelEdit->setValue( -1 );
    connect( mLevelEdit, SIGNAL(valueChanged(int)), SLOT(onLevelChanged(int)) );

    const QString levelLabelText =
         i18nc( "@label:spinbox decimal value up to which bytes are set to 0",
                "Level:" );
    const QString levelToolTip =
        i18nc( "@info:tooltip",
               "The decimal value up to which the bytes are set to x00. Bytes above this value are set to x01." );
    mLevelEdit->setToolTip( levelToolTip );
    const QString levelWhatsThis =
        i18nc( "@info:whatsthis",
               "Control the value which decides how the bytes are ending up. And more explanation." );
    mLevelEdit->setWhatsThis( levelWhatsThis );

    baseLayout->addRow( levelLabelText, mLevelEdit );

    // note start state
    mIsValid = isValid();
//// ADAPT(end)
}
コード例 #23
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);
    QLineEdit *argumentsLineEdit = new QLineEdit();
    argumentsLineEdit->setText(cmakeRunConfiguration->commandLineArguments());
    connect(argumentsLineEdit, SIGNAL(textChanged(QString)),
            this, SLOT(setArguments(QString)));
    fl->addRow(tr("Arguments:"), argumentsLineEdit);

    m_workingDirectoryEdit = new Utils::PathChooser();
    m_workingDirectoryEdit->setExpectedKind(Utils::PathChooser::Directory);
    m_workingDirectoryEdit->setBaseDirectory(m_cmakeRunConfiguration->target()->project()->projectDirectory());
    m_workingDirectoryEdit->setPath(m_cmakeRunConfiguration->baseWorkingDirectory());
    ProjectExplorer::EnvironmentAspect *aspect
        = m_cmakeRunConfiguration->extraAspect<ProjectExplorer::EnvironmentAspect>();
    if (aspect) {
        connect(aspect, SIGNAL(environmentChanged()), this, SLOT(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);

    QCheckBox *runInTerminal = new QCheckBox;
    fl->addRow(tr("Run in Terminal"), runInTerminal);

    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, SIGNAL(changed(QString)),
            this, SLOT(setWorkingDirectory()));

    connect(resetButton, SIGNAL(clicked()),
            this, SLOT(resetWorkingDirectory()));

    connect(runInTerminal, SIGNAL(toggled(bool)),
            this, SLOT(runInTerminalToggled(bool)));

    connect(m_cmakeRunConfiguration, SIGNAL(baseWorkingDirectoryChanged(QString)),
            this, SLOT(workingDirectoryChanged(QString)));

    setEnabled(m_cmakeRunConfiguration->isEnabled());
}
コード例 #24
0
ファイル: GUIWidget.cpp プロジェクト: Fantasticer/qttrader
void
GUIWidget::createGUI ()
{
  QVBoxLayout *vbox = new QVBoxLayout;
  vbox->setSpacing(2);
  vbox->setMargin(5);
  setLayout(vbox);
  
  QFormLayout *form = new QFormLayout;
  form->setSpacing(2);
  form->setMargin(0);
  vbox->addLayout(form);
  
  // csv file
  _csvButton = new FileButton(0);
  connect(_csvButton, SIGNAL(signalSelectionChanged(QStringList)), this, SLOT(buttonStatus()));
//  _csvButton->setFiles(QStringList() << "/tmp/yahoo.csv");
  form->addRow (tr("CSV File"), _csvButton);

  // format
  _format = new QLineEdit;
  form->addRow (tr("Format"), _format);
  
  // date format
  _dateFormat = new QLineEdit;
  form->addRow (tr("Date Format"), _dateFormat);
  
  // delimiter
  Delimiter d;
  _delimiter = new QComboBox;
  _delimiter->addItems(d.list());
  _delimiter->setCurrentIndex(Delimiter::_SEMICOLON);
  form->addRow (tr("Delimiter"), _delimiter);
  
  // type
  Quote q;
  _type = new QComboBox;
  _type->addItems(q.list());
  _type->setCurrentIndex(Quote::_STOCK);
  form->addRow (tr("Quote Type"), _type);
  
  // exchange
  _exchange = new QLineEdit;
  form->addRow (tr("Exchange Override"), _exchange);
  
  // filename as symbol
  _filename = new QCheckBox;
  form->addRow (tr("Use Filename As Symbol"), _filename);

  // log
  _log = new QTextEdit;
  _log->setReadOnly(TRUE);
  vbox->addWidget(_log);

  // buttonbox
  QDialogButtonBox *bb = new QDialogButtonBox(QDialogButtonBox::Help);
  vbox->addWidget(bb);

  // ok button
  _okButton = bb->addButton(QDialogButtonBox::Ok);
  _okButton->setText(tr("&OK"));
  connect(_okButton, SIGNAL(clicked()), this, SLOT(importThread()));

  // cancel button
  _cancelButton = bb->addButton(QDialogButtonBox::Cancel);
  _cancelButton->setText(tr("&Cancel"));
  _cancelButton->setDefault(TRUE);
  _cancelButton->setFocus();
  _cancelButton->setEnabled(TRUE);

  // help button
  QPushButton *b = bb->button(QDialogButtonBox::Help);
  b->setText(tr("&Help"));
  connect(b, SIGNAL(clicked()), this, SIGNAL(signalHelp()));
}
コード例 #25
0
SVNCommitDialog::SVNCommitDialog(QWidget *parent, const QString &workingDir,
                                 const QStringList &files, bool folderOnly,
                                 int sceneIconAdded)
    : Dialog(TApp::instance()->getMainWindow(), true, false)
    , m_commitSceneContentsCheckBox(0)
    , m_workingDir(workingDir)
    , m_files(files)
    , m_folderOnly(folderOnly)
    , m_targetTempFile(0)
    , m_selectionCheckBox(0)
    , m_selectionLabel(0)
    , m_sceneIconAdded(sceneIconAdded)
    , m_folderAdded(0) {
  setModal(false);
  setAttribute(Qt::WA_DeleteOnClose, true);
  setWindowTitle(tr("Version Control: Put changes"));

  if (m_folderOnly)
    setMinimumSize(320, 320);
  else
    setMinimumSize(300, 180);

  QWidget *container = new QWidget;

  QVBoxLayout *mainLayout = new QVBoxLayout;
  mainLayout->setAlignment(Qt::AlignHCenter);
  mainLayout->setMargin(0);

  m_treeWidget = new QTreeWidget;
  m_treeWidget->header()->hide();
  m_treeWidget->hide();

  if (m_folderOnly) {
    m_treeWidget->setSelectionMode(QAbstractItemView::ExtendedSelection);
    m_treeWidget->setIconSize(QSize(21, 17));
  }
  m_treeWidget->setStyleSheet("QTreeWidget { border: 1px solid gray; }");

  if (m_folderOnly) {
    mainLayout->addWidget(m_treeWidget);

    QHBoxLayout *belowTreeLayout = new QHBoxLayout;
    belowTreeLayout->setMargin(0);

    m_selectionCheckBox = new QCheckBox(tr("Select / Deselect All"), 0);
    connect(m_selectionCheckBox, SIGNAL(clicked(bool)), this,
            SLOT(onSelectionCheckBoxClicked(bool)));

    m_selectionLabel = new QLabel;
    m_selectionLabel->setText(tr("0 Selected / 0 Total"));

    m_selectionCheckBox->hide();
    m_selectionLabel->hide();

    belowTreeLayout->addWidget(m_selectionCheckBox);
    belowTreeLayout->addStretch();
    belowTreeLayout->addWidget(m_selectionLabel);

    mainLayout->addLayout(belowTreeLayout);
  }

  QHBoxLayout *hLayout = new QHBoxLayout;

  m_waitingLabel      = new QLabel;
  QMovie *waitingMove = new QMovie(":Resources/waiting.gif");
  waitingMove->setParent(this);

  m_waitingLabel->setMovie(waitingMove);
  waitingMove->setCacheMode(QMovie::CacheAll);
  waitingMove->start();

  m_textLabel = new QLabel;
  m_textLabel->setText(tr("Getting repository status..."));

  hLayout->addStretch();
  hLayout->addWidget(m_waitingLabel);
  hLayout->addWidget(m_textLabel);
  hLayout->addStretch();

  mainLayout->addLayout(hLayout);

  if (!m_folderOnly)
    mainLayout->addWidget(m_treeWidget);
  else
    mainLayout->addSpacing(10);

  QFormLayout *formLayout = new QFormLayout;
  formLayout->setLabelAlignment(Qt::AlignRight);
  formLayout->setFormAlignment(Qt::AlignHCenter | Qt::AlignTop);
  formLayout->setSpacing(10);
  formLayout->setMargin(0);

  m_commentTextEdit = new QPlainTextEdit;
  m_commentTextEdit->setMaximumHeight(50);
  m_commentTextEdit->hide();

  m_commentLabel = new QLabel(tr("Comment:"));
  m_commentLabel->setFixedWidth(55);
  m_commentLabel->hide();

  formLayout->addRow(m_commentLabel, m_commentTextEdit);

  if (!m_folderOnly) {
    m_commitSceneContentsCheckBox = new QCheckBox(this);
    connect(m_commitSceneContentsCheckBox, SIGNAL(toggled(bool)), this,
            SLOT(onCommiSceneContentsToggled(bool)));
    m_commitSceneContentsCheckBox->setChecked(false);
    m_commitSceneContentsCheckBox->hide();
    m_commitSceneContentsCheckBox->setText(tr("Put Scene Contents"));
    formLayout->addRow("", m_commitSceneContentsCheckBox);
  }
コード例 #26
0
DesktopQmakeRunConfigurationWidget::DesktopQmakeRunConfigurationWidget(DesktopQmakeRunConfiguration *qmakeRunConfiguration, QWidget *parent)
    : QWidget(parent),
    m_qmakeRunConfiguration(qmakeRunConfiguration),
    m_ignoreChange(false),
    m_usingDyldImageSuffix(0),
    m_isShown(false)
{
    QVBoxLayout *vboxTopLayout = new QVBoxLayout(this);
    vboxTopLayout->setMargin(0);

    QHBoxLayout *hl = new QHBoxLayout();
    hl->addStretch();
    m_disabledIcon = new QLabel(this);
    m_disabledIcon->setPixmap(QPixmap(QLatin1String(":/projectexplorer/images/compile_warning.png")));
    hl->addWidget(m_disabledIcon);
    m_disabledReason = new QLabel(this);
    m_disabledReason->setVisible(false);
    hl->addWidget(m_disabledReason);
    hl->addStretch();
    vboxTopLayout->addLayout(hl);

    m_detailsContainer = new DetailsWidget(this);
    m_detailsContainer->setState(DetailsWidget::NoSummary);
    vboxTopLayout->addWidget(m_detailsContainer);
    QWidget *detailsWidget = new QWidget(m_detailsContainer);
    m_detailsContainer->setWidget(detailsWidget);
    QFormLayout *toplayout = new QFormLayout(detailsWidget);
    toplayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
    toplayout->setMargin(0);

    m_executableLineEdit = new QLineEdit(m_qmakeRunConfiguration->executable(), this);
    m_executableLineEdit->setEnabled(false);
    toplayout->addRow(tr("Executable:"), m_executableLineEdit);

    QLabel *argumentsLabel = new QLabel(tr("Arguments:"), this);
    m_argumentsLineEdit = new QLineEdit(qmakeRunConfiguration->rawCommandLineArguments(), this);
    argumentsLabel->setBuddy(m_argumentsLineEdit);
    toplayout->addRow(argumentsLabel, m_argumentsLineEdit);

    m_workingDirectoryEdit = new PathChooser(this);
    m_workingDirectoryEdit->setExpectedKind(PathChooser::Directory);
    m_workingDirectoryEdit->setPath(m_qmakeRunConfiguration->baseWorkingDirectory());
    m_workingDirectoryEdit->setBaseDirectory(m_qmakeRunConfiguration->target()->project()->projectDirectory());
    EnvironmentAspect *aspect = qmakeRunConfiguration->extraAspect<EnvironmentAspect>();
    if (aspect) {
        connect(aspect, SIGNAL(environmentChanged()), this, SLOT(environmentWasChanged()));
        environmentWasChanged();
    }
    m_workingDirectoryEdit->setPromptDialogTitle(tr("Select Working Directory"));

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

    QHBoxLayout *boxlayout = new QHBoxLayout();
    boxlayout->setMargin(0);
    boxlayout->addWidget(m_workingDirectoryEdit);
    boxlayout->addWidget(resetButton);
    toplayout->addRow(tr("Working directory:"), boxlayout);

    QHBoxLayout *innerBox = new QHBoxLayout();
    m_useTerminalCheck = new QCheckBox(tr("Run in terminal"), this);
    m_useTerminalCheck->setChecked(m_qmakeRunConfiguration->runMode() == LocalApplicationRunConfiguration::Console);
    m_useTerminalCheck->setVisible(!m_qmakeRunConfiguration->forcedGuiMode());
    innerBox->addWidget(m_useTerminalCheck);

    m_useQvfbCheck = new QCheckBox(tr("Run on QVFb"), this);
    m_useQvfbCheck->setToolTip(tr("Check this option to run the application on a Qt Virtual Framebuffer."));
    m_useQvfbCheck->setChecked(m_qmakeRunConfiguration->runMode() == LocalApplicationRunConfiguration::Console);
    m_useQvfbCheck->setVisible(false);
    innerBox->addWidget(m_useQvfbCheck);
    innerBox->addStretch();
    toplayout->addRow(QString(), innerBox);

    if (HostOsInfo::isMacHost()) {
        m_usingDyldImageSuffix = new QCheckBox(tr("Use debug version of frameworks (DYLD_IMAGE_SUFFIX=_debug)"), this);
        m_usingDyldImageSuffix->setChecked(m_qmakeRunConfiguration->isUsingDyldImageSuffix());
        toplayout->addRow(QString(), m_usingDyldImageSuffix);
        connect(m_usingDyldImageSuffix, SIGNAL(toggled(bool)),
                this, SLOT(usingDyldImageSuffixToggled(bool)));
    }

    runConfigurationEnabledChange();

    connect(m_workingDirectoryEdit, SIGNAL(changed(QString)),
            this, SLOT(workDirectoryEdited()));

    connect(resetButton, SIGNAL(clicked()),
            this, SLOT(workingDirectoryReseted()));

    connect(m_argumentsLineEdit, SIGNAL(textEdited(QString)),
            this, SLOT(argumentsEdited(QString)));
    connect(m_useTerminalCheck, SIGNAL(toggled(bool)),
            this, SLOT(termToggled(bool)));
    connect(m_useQvfbCheck, SIGNAL(toggled(bool)),
            this, SLOT(qvfbToggled(bool)));

    connect(qmakeRunConfiguration, SIGNAL(baseWorkingDirectoryChanged(QString)),
            this, SLOT(workingDirectoryChanged(QString)));

    connect(qmakeRunConfiguration, SIGNAL(commandLineArgumentsChanged(QString)),
            this, SLOT(commandLineArgumentsChanged(QString)));
    connect(qmakeRunConfiguration, SIGNAL(runModeChanged(ProjectExplorer::LocalApplicationRunConfiguration::RunMode)),
            this, SLOT(runModeChanged(ProjectExplorer::LocalApplicationRunConfiguration::RunMode)));
    connect(qmakeRunConfiguration, SIGNAL(usingDyldImageSuffixChanged(bool)),
            this, SLOT(usingDyldImageSuffixChanged(bool)));
    connect(qmakeRunConfiguration, SIGNAL(effectiveTargetInformationChanged()),
            this, SLOT(effectiveTargetInformationChanged()), Qt::QueuedConnection);

    connect(qmakeRunConfiguration, SIGNAL(enabledChanged()),
            this, SLOT(runConfigurationEnabledChange()));
}
コード例 #27
0
QbsRunConfigurationWidget::QbsRunConfigurationWidget(QbsRunConfiguration *rc, QWidget *parent)
    : QWidget(parent),
    m_rc(rc),
    m_ignoreChange(false),
    m_isShown(false)
{
    QVBoxLayout *vboxTopLayout = new QVBoxLayout(this);
    vboxTopLayout->setMargin(0);

    QHBoxLayout *hl = new QHBoxLayout();
    hl->addStretch();
    m_disabledIcon = new QLabel(this);
    m_disabledIcon->setPixmap(QPixmap(QLatin1String(":/projectexplorer/images/compile_warning.png")));
    hl->addWidget(m_disabledIcon);
    m_disabledReason = new QLabel(this);
    m_disabledReason->setVisible(false);
    hl->addWidget(m_disabledReason);
    hl->addStretch();
    vboxTopLayout->addLayout(hl);

    m_detailsContainer = new Utils::DetailsWidget(this);
    m_detailsContainer->setState(Utils::DetailsWidget::NoSummary);
    vboxTopLayout->addWidget(m_detailsContainer);
    QWidget *detailsWidget = new QWidget(m_detailsContainer);
    m_detailsContainer->setWidget(detailsWidget);
    QFormLayout *toplayout = new QFormLayout(detailsWidget);
    toplayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
    toplayout->setMargin(0);

    m_executableLineEdit = new QLineEdit(this);
    m_executableLineEdit->setEnabled(false);
    m_executableLineEdit->setPlaceholderText(tr("<unknown>"));
    toplayout->addRow(tr("Executable:"), m_executableLineEdit);

    QLabel *argumentsLabel = new QLabel(tr("Arguments:"), this);
    m_argumentsLineEdit = new QLineEdit(m_rc->rawCommandLineArguments(), this);
    argumentsLabel->setBuddy(m_argumentsLineEdit);
    toplayout->addRow(argumentsLabel, m_argumentsLineEdit);

    m_workingDirectoryEdit = new Utils::PathChooser(this);
    m_workingDirectoryEdit->setHistoryCompleter(QLatin1String("Qbs.WorkingDir.History"));
    m_workingDirectoryEdit->setExpectedKind(Utils::PathChooser::Directory);
    ProjectExplorer::EnvironmentAspect *aspect
            = m_rc->extraAspect<ProjectExplorer::EnvironmentAspect>();
    if (aspect) {
        connect(aspect, SIGNAL(environmentChanged()), this, SLOT(environmentWasChanged()));
        environmentWasChanged();
    }
    m_workingDirectoryEdit->setPromptDialogTitle(tr("Select Working Directory"));

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

    QHBoxLayout *boxlayout = new QHBoxLayout();
    boxlayout->setMargin(0);
    boxlayout->addWidget(m_workingDirectoryEdit);
    boxlayout->addWidget(resetButton);
    toplayout->addRow(tr("Working directory:"), boxlayout);

    QHBoxLayout *innerBox = new QHBoxLayout();
    m_useTerminalCheck = new QCheckBox(tr("Run in terminal"), this);
    innerBox->addWidget(m_useTerminalCheck);

    innerBox->addStretch();
    toplayout->addRow(QString(), innerBox);

    runConfigurationEnabledChange();

    connect(m_workingDirectoryEdit, SIGNAL(changed(QString)),
            this, SLOT(workDirectoryEdited()));

    connect(resetButton, SIGNAL(clicked()),
            this, SLOT(workingDirectoryWasReset()));

    connect(m_argumentsLineEdit, SIGNAL(textEdited(QString)),
            this, SLOT(argumentsEdited(QString)));
    connect(m_useTerminalCheck, SIGNAL(toggled(bool)),
            this, SLOT(termToggled(bool)));

    connect(m_rc, SIGNAL(baseWorkingDirectoryChanged(QString)),
            this, SLOT(workingDirectoryChanged(QString)));

    connect(m_rc, SIGNAL(commandLineArgumentsChanged(QString)),
            this, SLOT(commandLineArgumentsChanged(QString)));
    connect(m_rc, SIGNAL(runModeChanged(ProjectExplorer::LocalApplicationRunConfiguration::RunMode)),
            this, SLOT(runModeChanged(ProjectExplorer::LocalApplicationRunConfiguration::RunMode)));
    connect(m_rc, SIGNAL(targetInformationChanged()),
            this, SLOT(targetInformationHasChanged()), Qt::QueuedConnection);

    connect(m_rc, SIGNAL(enabledChanged()),
            this, SLOT(runConfigurationEnabledChange()));
}
コード例 #28
0
ファイル: smugalbum.cpp プロジェクト: UIKit0/digikam
SmugNewAlbum::SmugNewAlbum(QWidget* parent)
            : KDialog(parent)
{
    QString header(i18n("SmugMug New Album"));
    setWindowTitle(header);
    setButtons(Ok|Cancel);
    setDefaultButton(Cancel);
    setModal(false);

    QWidget *mainWidget = new QWidget(this);
    setMainWidget(mainWidget);
    mainWidget->setMinimumSize(400, 400);

    // ------------------------------------------------------------------------

    QGroupBox* albumBox = new QGroupBox(i18n("Album"), mainWidget);
    albumBox->setWhatsThis(
        i18n("These are basic settings for the new SmugMug album."));

    m_titleEdt          = new KLineEdit;
    m_titleEdt->setWhatsThis(
        i18n("Title of the album that will be created (required)."));

    m_categCoB          = new KComboBox;
    m_categCoB->setEditable(false);
    m_categCoB->setWhatsThis(
        i18n("Category of the album that will be created (required)."));

    m_subCategCoB       = new KComboBox;
    m_subCategCoB->setEditable(false);
    m_subCategCoB->setWhatsThis(
        i18n("Subcategory of the album that will be created (optional)."));

    m_descEdt           = new KTextEdit;
    m_descEdt->setWhatsThis(
        i18n("Description of the album that will be created (optional)."));

    m_templateCoB      = new KComboBox;
    m_templateCoB->setEditable(false);
    m_templateCoB->setWhatsThis(
        i18n("Album template for the new album (optional)."));

    QFormLayout* albumBoxLayout = new QFormLayout;
    albumBoxLayout->addRow(i18nc("new smug album dialog", "Title:"), m_titleEdt);
    albumBoxLayout->addRow(i18nc("new smug album dialog", "Category:"), m_categCoB);
    albumBoxLayout->addRow(i18nc("new smug album dialog", "Subcategory:"), m_subCategCoB);
    albumBoxLayout->addRow(i18nc("new smug album dialog", "Description:"), m_descEdt);
    albumBoxLayout->addRow(i18nc("new smug album dialog", "Template:"), m_templateCoB);
    albumBoxLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
    albumBoxLayout->setSpacing(KDialog::spacingHint());
    albumBoxLayout->setMargin(KDialog::spacingHint());
    albumBox->setLayout(albumBoxLayout);

    // ------------------------------------------------------------------------

    m_privBox = new QGroupBox(i18n("Security && Privacy"), mainWidget);
    m_privBox->setWhatsThis(
        i18n("These are security and privacy settings for the new SmugMug album."));

    m_publicRBtn        = new QRadioButton(i18nc("smug album privacy", "Public"));
    m_publicRBtn->setChecked(true);
    m_publicRBtn->setWhatsThis(
        i18n("Public album is listed on your public SmugMug page."));
    m_unlistedRBtn      = new QRadioButton(i18nc("smug album privacy", "Unlisted"));
    m_unlistedRBtn->setWhatsThis(
        i18n("Unlisted album is only accessible via URL."));

    QHBoxLayout* radioLayout = new QHBoxLayout;
    radioLayout->addWidget(m_publicRBtn);
    radioLayout->addWidget(m_unlistedRBtn);

    m_passwdEdt         = new KLineEdit;
    m_passwdEdt->setWhatsThis(
        i18n("Require password to access the album (optional)."));

    m_hintEdt           = new KLineEdit;
    m_hintEdt->setWhatsThis(
        i18n("Password hint to present to users in the password prompt (optional)."));

    QFormLayout* privBoxLayout = new QFormLayout;
    privBoxLayout->addRow(i18n("Privacy:"), radioLayout);
    privBoxLayout->addRow(i18n("Password:"******"Password Hint:"), m_hintEdt);
    privBoxLayout->setSpacing(KDialog::spacingHint());
    privBoxLayout->setMargin(KDialog::spacingHint());
    m_privBox->setLayout(privBoxLayout);

    // ------------------------------------------------------------------------
    QVBoxLayout* mainLayout = new QVBoxLayout(mainWidget);
    mainLayout->addWidget(albumBox);
    mainLayout->addWidget(m_privBox);
    mainLayout->setSpacing(KDialog::spacingHint());
    mainLayout->setMargin(0);
    mainWidget->setLayout(mainLayout);

    // ------------------------------------------------------------------------
}
コード例 #29
0
QHBoxLayout* StatusViewer::initializeLayout() {
    QHBoxLayout* mainLayout = new QHBoxLayout();
    mainLayout->setSpacing(0);
    mainLayout->setMargin(0);
    mainLayout->addStretch(0);
    
    //Initialize the mag and qval fields
    magLabel_ = new QLabel;
    qvalLabel_ = new QLabel;
    
    QFormLayout* rtlayout = new QFormLayout();
    rtlayout->setMargin(0);
    rtlayout->addRow("Calculated Mag: ", magLabel_);
    rtlayout->addRow("Last QVAL: ", qvalLabel_);
    
    phaseResLabel_ = new QLabel;
    numSpotsLabel_ = new QLabel;
    
    QFormLayout* ltlayout = new QFormLayout();
    ltlayout->setMargin(0);
    ltlayout->addRow("Sym. PhaRes: ", phaseResLabel_);
    ltlayout->addRow("# of spots: ", numSpotsLabel_);
    
    QHBoxLayout* layout = new QHBoxLayout();
    layout->setSpacing(5);
    layout->setMargin(0);
    layout->addLayout(rtlayout);
    layout->addLayout(ltlayout);
    
    //Initialize the bins table
    binsTable_ = prepareTable(2, 6);
    binsTable_->horizontalHeader()->hide();
    binsTable_->setVerticalHeaderLabels(QStringList() << "Resolution [A]" << "#");
    
    //Initialize the qval table
    qvalTable_ = prepareTable(4, 7);

    QStringList labels;
    labels << tr("IQ1") << tr("IQ2") << tr("IQ3") << tr("IQ4") << tr("IQ5") << tr("IQ6") << tr("QVAL");
    qvalTable_->setHorizontalHeaderLabels(labels);
    qvalTable_->setVerticalHeaderLabels(QStringList() << "Unbend I" << "Unbend II" << "Movie A" << "Movie B");
    
    //Initialize the tilt table
    tiltTable_ = prepareTable(4, 4);
    tiltTable_->setVerticalHeaderLabels(QStringList() << tr("Defocus") << tr("Lattice") << tr("Spot Split") << tr("Merge"));
    tiltTable_->setHorizontalHeaderLabels(QStringList() << "Grid TAxis" << "Grid TAngle" << "Xtal TAxis" << "Xtal TAngle");
    
    //Arrange everything in a layout
    QVBoxLayout* firstColLayout = new QVBoxLayout();
    firstColLayout->setMargin(0);
    firstColLayout->setSpacing(2);
    firstColLayout->addLayout(layout);
    firstColLayout->addStretch(1);
    firstColLayout->addWidget(new QLabel("Power Bins:"));
    firstColLayout->addWidget(binsTable_);
    QWidget* firstCol = new QWidget;
    firstCol->setLayout(firstColLayout);
    
    mainLayout->addWidget(firstCol, 1);
    mainLayout->addWidget(qvalTable_, 1);
    mainLayout->addWidget(tiltTable_, 1);
    
    return mainLayout;
}
コード例 #30
0
FilterOptionsDialog::FilterOptionsDialog(QWidget *parent, int FilterType)
                   : KDialog(parent)
{
    setCaption(i18n("Filter Options"));
    setModal(true);
    showButtonSeparator(true);
    setButtons(Ok | Cancel);
    setDefaultButton(Ok);
    QWidget* box       = new QWidget(this);
    QFormLayout *layout = new QFormLayout(box);
    layout->setSpacing(spacingHint());
    layout->setMargin(0);
    setMainWidget(box);

    if (FilterType == 0)
    { // Add noise
        m_noiseType = new KComboBox(false, box);
        m_noiseType->addItem(i18nc("image noise type", "Uniform"));
        m_noiseType->addItem(i18nc("image noise type", "Gaussian"));
        m_noiseType->addItem(i18nc("image noise type", "Multiplicative"));
        m_noiseType->addItem(i18nc("image noise type", "Impulse"));
        m_noiseType->addItem(i18nc("image noise type", "Laplacian"));
        m_noiseType->addItem(i18nc("image noise type", "Poisson"));
        m_noiseType->setWhatsThis(i18n("Select here the algorithm method which will used "
                                       "to add random noise to the images."));
        layout->addRow(i18n("Noise algorithm:"), m_noiseType);
    }
    else if (FilterType == 2)
    { // Blur
        m_blurRadius = new KIntNumInput(3, box);
        initInput(m_blurRadius, 0, 20, i18n("px"));
        m_blurRadius->setWhatsThis(i18n("Select here the blur radius of the Gaussian, "
                                        "not counting the center pixel. For reasonable results, the "
                                        "radius should be larger than deviation. If you use a radius of 0 "
                                        "the blur operation selects a suitable radius."));
        layout->addRow(i18n("Radius:"), m_blurRadius);

        m_blurDeviation = new KIntNumInput(1, box);
        initInput(m_blurDeviation, 0, 20, i18n("px"));
        m_blurDeviation->setWhatsThis(i18n("Select here the standard deviation of the blur Gaussian."));
        layout->addRow(i18n("Deviation:"), m_blurDeviation);
    }
    else if (FilterType == 5)
    { // Median
        m_medianRadius = new KIntNumInput(3, box);
        initInput(m_medianRadius, 0, 20, i18n("px"));
        m_medianRadius->setWhatsThis(i18n("Select here the median radius of the pixel neighborhood. "
                                          "The algorithm applies a digital filter that improves the quality "
                                          "of noisy images. Each pixel is replaced by the median in a "
                                          "set of neighboring pixels as defined by the radius."));
        layout->addRow(i18n("Radius:"), m_medianRadius);
    }
    else if (FilterType == 6)
    { // Noise reduction
        m_noiseRadius = new KIntNumInput(3, box);
        initInput(m_noiseRadius, 0, 20, i18n("px"));
        m_noiseRadius->setWhatsThis(i18n("Select here the noise reduction radius value. "
                                         "The algorithm smooths the contours of an image while still "
                                         "preserving edge information. The algorithm works by replacing "
                                         "each pixel with its neighbor closest in value. A neighbor is "
                                         "defined by the radius. If you use a radius of 0 the algorithm "
                                         "selects a suitable radius."));
        layout->addRow(i18n("Radius:"), m_noiseRadius);
    }
    else if (FilterType == 7)
    { // Sharpen
        m_sharpenRadius = new KIntNumInput(3, box);
        initInput(m_sharpenRadius, 0, 20, i18n("px"));
        m_sharpenRadius->setWhatsThis(i18n("Select here the radius of the sharpen Gaussian, "
                                           "not counting the center pixel. For reasonable "
                                           "results, the radius should be larger than deviation. "
                                           "If you use a radius of 0 the sharpen operation selects a "
                                           "suitable radius."));
        layout->addRow(i18n("Radius:"), m_sharpenRadius);

        m_sharpenDeviation = new KIntNumInput(1, box);
        initInput(m_sharpenDeviation, 0, 20, i18n("px"));
        m_sharpenDeviation->setWhatsThis(i18n("Select here the sharpen deviation value of the "
                                              "Laplacian."));
        layout->addRow(i18n("Deviation:"), m_sharpenDeviation);
    }
    else if (FilterType == 8)
    { // Unsharp
        m_unsharpenRadius = new KIntNumInput(3, box);
        initInput(m_unsharpenRadius, 0, 20, i18n("px"));
        m_unsharpenRadius->setWhatsThis(i18n("Select here the radius of the unsharpen Gaussian, "
                                             "not counting the center pixel. The algorithm "
                                             "convolve the image with a Gaussian operator of the given "
                                             "radius and standard deviation. For reasonable results, "
                                             "radius should be larger than sigma. If you use a radius of 0 "
                                             "the algorithm selects a suitable radius."));
        layout->addRow(i18n("Radius:"), m_unsharpenRadius);

        m_unsharpenDeviation = new KIntNumInput(1, box);
        initInput(m_unsharpenDeviation, 0, 20, i18n("px"));
        m_unsharpenDeviation->setWhatsThis(i18n("Select here the unsharpen deviation value of the "
                                                "Gaussian."));
        layout->addRow(i18n("Deviation:"), m_unsharpenDeviation);

        m_unsharpenPercent = new KIntNumInput(100, box);
        initInput(m_unsharpenPercent, 1, 200, i18n("%"));
        m_unsharpenPercent->setWhatsThis(i18n("Select here the percentage difference between original "
                                              "and blurred image which should be added to original."));
        layout->addRow(i18n("Amount:"), m_unsharpenPercent);

        m_unsharpenThreshold = new KIntNumInput(5, box);
        initInput(m_unsharpenThreshold, 1, 100, i18n("%"));
        m_unsharpenThreshold->setWhatsThis(i18n("Select here the unsharpen threshold value, "
                                                "as a percentage of the maximum color component value, "
                                                "needed to apply the difference amount."));
        layout->addRow(i18n("Threshold:"), m_unsharpenThreshold);
    }
}