コード例 #1
0
ファイル: passwordpage.cpp プロジェクト: serghei/kde3-kdepim
PasswordPage::PasswordPage(QWidget *parent)
    : QWidget(parent), mJob(0)
{
    QGridLayout *layout = new QGridLayout(this, 2, 3, 11, 6);

    QLabel *label = new QLabel(i18n("New password:"******"Retype new password:"******"Change"), this);
    mButton->setEnabled(false);
    layout->addWidget(mButton, 2, 1);

    layout->setRowSpacing(3, 1);

    connect(mPassword, SIGNAL(textChanged(const QString &)), this, SLOT(textChanged()));
    connect(mPasswordRetype, SIGNAL(textChanged(const QString &)), this, SLOT(textChanged()));
    connect(mButton, SIGNAL(clicked()), this, SLOT(buttonClicked()));
}
コード例 #2
0
TesterTestPage::TesterTestPage (QWidget *p) : QWidget (p)
{
  fieldList.append(tr("Open"));
  fieldList.append(tr("Close"));
  fieldList.append(tr("Mid Point"));

  QHBoxLayout *hbox = new QHBoxLayout(this);
  hbox->setMargin(5);
  hbox->setSpacing(10);

  // left side grid

  QGridLayout *grid = new QGridLayout(hbox);
  grid->setColStretch(1, 1);
  grid->setSpacing(5);

  // trades area  

  tradeLong = new QCheckBox(tr("Long"), this);
  grid->addWidget(tradeLong, 0, 0);

  tradeShort = new QCheckBox(tr("Short"), this);
  grid->addWidget(tradeShort, 1, 0);

  QLabel *label = new QLabel(tr("Trade Delay"), this);
  grid->addWidget(label, 2, 0);
    
  tradeDelay = new QSpinBox(1, 999999, 1, this);
  tradeDelay->setValue(1);
  grid->addWidget(tradeDelay, 2, 1);

  grid->setRowSpacing(grid->numRows(), 25);

  // account area

  label = new QLabel(tr("Account Balance"), this);
  grid->addWidget(label, 4, 0);

  account = new QSpinBox(0, 999999, 1, this);
  account->setValue(10000);
  grid->addWidget(account, 4, 1);
  
  label = new QLabel(tr("Futures Margin"), this);
  grid->addWidget(label, 5, 0);

  margin = new QSpinBox(0, 999999, 1, this);
  grid->addWidget(margin, 5, 1);
  
  label = new QLabel(tr("Volume %"), this);
  grid->addWidget(label, 6, 0);

  volumePercent = new QSpinBox(0, 100, 1, this);
  grid->addWidget(volumePercent, 6, 1);

  grid->setRowSpacing(grid->numRows(), 25);

  // commission area

  commissionType = new QCheckBox(tr("Use Commission %"), this);
  grid->addWidget(commissionType, 8, 0);

  label = new QLabel(tr("Entry"), this);
  grid->addWidget(label, 9, 0);

  QDoubleValidator *dv = new QDoubleValidator(0, 99999999.0, 4, this, 0);
  entryCom = new QLineEdit(QString::number(10), this);
  entryCom->setValidator(dv);
  grid->addWidget(entryCom, 9, 1);

  label = new QLabel(tr("Exit"), this);
  grid->addWidget(label, 10, 0);

  QDoubleValidator *dv2 = new QDoubleValidator(0, 99999999.0, 4, this, 0);
  exitCom = new QLineEdit(QString::number(10), this);
  exitCom->setValidator(dv2);
  grid->addWidget(exitCom, 10, 1);

  grid->setRowStretch(grid->numRows() + 1, 1);

  // vline sperarator
  
  QFrame *line = new QFrame(this);
  line->setFrameStyle(QFrame::VLine | QFrame::Plain);
  hbox->addWidget(line);

  // right side grid

  grid = new QGridLayout(hbox);
  grid->setColStretch(1, 1);
  grid->setSpacing(5);

  // test area

  label = new QLabel(tr("Symbol"), this);
  grid->addWidget(label, 0, 0);

  Config config;
  QString s, s2;
  config.getData(Config::DataPath, s);
  symbolButton = new SymbolButton(this, s, s2);
  connect(symbolButton, SIGNAL(symbolChanged()), this, SLOT(symbolButtonPressed()));
  grid->addWidget(symbolButton, 0, 1);
  
  label = new QLabel(tr("Bar Length"), this);
  grid->addWidget(label, 1, 0);
  
  BarData bd(s);
  barLength = new QComboBox(this);
  bd.getBarLengthList(barLengthList);
  barLength->insertStringList(barLengthList, -1);
  barLength->setCurrentItem(6);
  grid->addWidget(barLength, 1, 1);

  label = new QLabel(tr("Bars"), this);
  grid->addWidget(label, 2, 0);
  
  bars = new QSpinBox(1, 99999999, 1, this);
  bars->setValue(275);
  grid->addWidget(bars, 2, 1);

  label = new QLabel(tr("Entry/Exit Price"), this);
  grid->addWidget(label, 3, 0);
  
  priceField = new QComboBox(this);
  priceField->insertStringList(fieldList,-1);
  grid->addWidget(priceField, 3, 1);

  grid->setRowStretch(grid->numRows() + 1, 1);
}
コード例 #3
0
DialogCreateTag::DialogCreateTag(QWidget *parent, TagTreeNode* parentNode, const char *name)
    : KDialogBase(parent, name, true, "", KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, false )
    , m_parentNode(parentNode) {

    if (parentNode) {
        this->setCaption(i18n("Create tag"));
    } else {
        this->setCaption(i18n("Create toplevel tag"));
    }

    QWidget* mainPanel = new QWidget(this, "mainPanel");
    setMainWidget(mainPanel);
    QVBoxLayout* mainPanelLayout = new QVBoxLayout(mainPanel, 0, 5, "mainPanelLayout");
    mainPanelLayout->setAutoAdd(true);

    // parent
    if (parentNode) {
        // newTagGroup
        QGroupBox* parentTagGroup = new QGroupBox(i18n("Parent tag"), mainPanel, "parentTagGroup");
        QGridLayout* parentTagGroupLayout = new QGridLayout(parentTagGroup, 4, 4, 20, 5, "parentTagGroupLayout");

        parentTagGroupLayout->setRowSpacing(0, 10);

        // type
        QLabel* typeLabel = new QLabel(i18n("Type"), parentTagGroup, "typeLabel");
        parentTagGroupLayout->addWidget(typeLabel, 1, 0);

        KComboBox* typeComboBox = new KComboBox(false, parentTagGroup, "typeComboBox");
        typeComboBox->insertItem(parentNode->tagNode()->typeName());
        typeComboBox->setEnabled(false);
        parentTagGroupLayout->addMultiCellWidget(typeComboBox, 1, 1, 1, 2);

        // name
        QLabel* nameLabel = new QLabel(i18n("Name"), parentTagGroup, "nameLabel");
        parentTagGroupLayout->addWidget(nameLabel, 2, 0);

        KLineEdit* nameLineEdit = new KLineEdit(parentTagGroup, "nameLineEdit");
        nameLineEdit->setText(*parentNode->tagNode()->text());
        nameLineEdit->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
        nameLineEdit->setReadOnly(true);
        parentTagGroupLayout->addMultiCellWidget(nameLineEdit, 2, 2, 1, 2);

        // icon
        QLabel* iconLabel = new QLabel(i18n("Icon"), parentTagGroup, "iconLabel");
        parentTagGroupLayout->addWidget(iconLabel, 3, 0);

        KLineEdit* iconLineEdit = new KLineEdit(parentTagGroup, "iconLineEdit");
        iconLineEdit->setText(*parentNode->tagNode()->iconName());
        iconLineEdit->setMinimumWidth(300);
        iconLineEdit->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
        iconLineEdit->setReadOnly(true);
        parentTagGroupLayout->addWidget(iconLineEdit, 3, 1);

        QPushButton* iconButton = new QPushButton(i18n("Icon"), parentTagGroup, "iconButton");
        QIconSet iconSet = KGlobal::iconLoader()->loadIconSet(iconLineEdit->text(), KIcon::Small, Configuration::getInstance()->tagtreeIconSize(), true);
        iconButton->setIconSet(iconSet);
        iconButton->setText(QString::null);
        iconButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
        iconButton->setEnabled(true);
        parentTagGroupLayout->addWidget(iconButton, 3, 2);
    }

    // newTagGroup
    QGroupBox* newTagGroup = new QGroupBox(i18n("New tag"), mainPanel, "newTagGroup");
    QGridLayout* newTagGroupLayout = new QGridLayout(newTagGroup, 4, 4, 20, 5, "newTagGroupLayout");

    newTagGroupLayout->setRowSpacing(0, 10);

    // type
    QLabel* typeLabel = new QLabel(i18n("Type"), newTagGroup, "typeLabel");
    newTagGroupLayout->addWidget(typeLabel, 1, 0);

    m_typeComboBox = new KComboBox(false, newTagGroup, "typeComboBox");
    m_typeComboBoxEntries = new QValueList<int>;
    if (!parentNode) {
        m_typeComboBox->insertItem(TagNode::tagNodeTypeName(TagNode::TYPE_TITLE));
        m_typeComboBoxEntries->append(TagNode::tagNodeTypeId(TagNode::TYPE_TITLE));
    }
    m_typeComboBox->insertItem(TagNode::tagNodeTypeName(TagNode::TYPE_BOOLEAN));
    m_typeComboBoxEntries->append(TagNode::tagNodeTypeId(TagNode::TYPE_BOOLEAN));
    newTagGroupLayout->addMultiCellWidget(m_typeComboBox, 1, 1, 1, 2);

    // name
    QLabel* nameLabel = new QLabel(i18n("Name"), newTagGroup, "nameLabel");
    newTagGroupLayout->addWidget(nameLabel, 2, 0);

    m_nameLineEdit = new KLineEdit(newTagGroup, "nameLineEdit");
    m_nameLineEdit->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
    QObject::connect(m_nameLineEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotNameChanged(const QString&)));
    newTagGroupLayout->addMultiCellWidget(m_nameLineEdit, 2, 2, 1, 2);

    // icon
    QLabel* iconLabel = new QLabel(i18n("Icon"), newTagGroup, "iconLabel");
    newTagGroupLayout->addWidget(iconLabel, 3, 0);

    m_iconLineEdit = new KLineEdit(newTagGroup, "iconLineEdit");
    m_iconLineEdit->setMinimumWidth(300);
    m_iconLineEdit->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
    QObject::connect(m_iconLineEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotIconTextChanged(const QString&)));
    newTagGroupLayout->addWidget(m_iconLineEdit, 3, 1);

    m_iconButton = new QPushButton(i18n("Icon"), newTagGroup, "iconButton");
    m_iconButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    newTagGroupLayout->addWidget(m_iconButton, 3, 2);

    QObject::connect(m_iconButton, SIGNAL(clicked()), this, SLOT(slotIconButtonClicked()));

    // spacer
    QWidget* spacer = new QWidget(mainPanel, "spacer");
    spacer->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);

    // disable ok button
    validate();

    // set the focus
    m_nameLineEdit->setFocus();
}
コード例 #4
0
ファイル: kmplayerbroadcast.cpp プロジェクト: KDE/kmplayer
KDE_NO_CDTOR_EXPORT KMPlayerPrefBroadcastFormatPage::KMPlayerPrefBroadcastFormatPage (QWidget *parent, FFServerSettingList & ffs) : QFrame (parent, "BroadcastPage"), profiles (ffs)
{
    QHBoxLayout *layout = new QHBoxLayout (this, 5);
    QGridLayout *formatlayout = new QGridLayout (11, 2, 2);
    formatlayout->setAlignment (Qt::AlignTop);
    QVBoxLayout *leftlayout = new QVBoxLayout (15);
    QHBoxLayout *ledlayout = new QHBoxLayout (5);
    format = new QComboBox (this);
    QLabel * label = new QLabel (format, i18n ("Format:"), this);
    format->clear ();
    format->insertItem (QString ("asf"));
    format->insertItem (QString ("avi"));
    format->insertItem (QString ("mpjpeg"));
    format->insertItem (QString ("mpeg"));
    format->insertItem (QString ("rm"));
    format->insertItem (QString ("swf"));
    QWhatsThis::add (format, i18n ("Only avi, mpeg and rm work for mplayer playback"));
    formatlayout->addWidget (label, 0, 0);
    formatlayout->addWidget (format, 0, 1);
    ADDPROPERTY (i18n ("Audio codec:"), audiocodec, formatlayout, 1, this);
    ADDPROPERTY (i18n ("Audio bit rate (kbit):"), audiobitrate, formatlayout, 2, this);
    ADDPROPERTY (i18n ("Audio sample rate (Hz):"), audiosamplerate, formatlayout, 3, this);
    ADDPROPERTY (i18n ("Video codec:"), videocodec, formatlayout, 4, this);
    ADDPROPERTY (i18n ("Video bit rate (kbit):"), videobitrate, formatlayout, 5, this);
    ADDPROPERTY (i18n ("Quality (1-31):"), quality, formatlayout, 6, this);
    ADDPROPERTY (i18n ("Frame rate (Hz):"), framerate, formatlayout, 7, this);
    ADDPROPERTY (i18n ("Gop size:"), gopsize, formatlayout, 8, this);
    ADDPROPERTY (i18n ("Width (pixels):"), moviewidth, formatlayout, 9, this);
    ADDPROPERTY (i18n ("Height (pixels):"), movieheight, formatlayout, 10, this);
    label = new QLabel (i18n ("Allow access from:"), this);
    accesslist = new QTable (40, 1, this);
    accesslist->verticalHeader ()->hide ();
    accesslist->setLeftMargin (0);
    accesslist->setColumnWidth (0, 250);
    QWhatsThis::add (accesslist, i18n ("'Single IP' or 'start-IP end-IP' for IP ranges"));
    QHeader *header = accesslist->horizontalHeader ();
    header->setLabel (0, i18n ("Host/IP or IP Range"));
    QFrame *profileframe = new QFrame (this);
    QGridLayout *profileslayout = new QGridLayout (profileframe, 5, 2, 2);
    profile = new QLineEdit ("", profileframe);
    connect (profile, SIGNAL(textChanged (const QString &)),
             this, SLOT (slotTextChanged (const QString &)));
    profilelist = new QListBox (profileframe);
    for (int i = 0; i < (int) profiles.size (); i++)
        profilelist->insertItem (profiles[i]->name, i);
    connect (profilelist, SIGNAL (selected (int)),
             this, SLOT (slotIndexChanged (int)));
    connect (profilelist, SIGNAL (highlighted (int)),
             this, SLOT (slotItemHighlighted (int)));
    load = new QPushButton (i18n ("Load"), profileframe);
    save = new QPushButton (i18n ("Save"), profileframe);
    del = new QPushButton (i18n ("Delete"), profileframe);
    load->setEnabled (false);
    save->setEnabled (false);
    del->setEnabled (false);
    connect (load, SIGNAL (clicked ()), this, SLOT (slotLoad ()));
    connect (save, SIGNAL (clicked ()), this, SLOT (slotSave ()));
    connect (del, SIGNAL (clicked ()), this, SLOT (slotDelete ()));
    profileslayout->addWidget (profile, 0, 0);
#if (QT_VERSION < 0x030200)
    profileslayout->addRowSpacing (4, 60);
#else
    profileslayout->setRowSpacing (4, 60);
#endif
    profileslayout->addMultiCellWidget (profilelist, 1, 4, 0, 0);
    profileslayout->addWidget (load, 1, 1);
    profileslayout->addWidget (save, 2, 1);
    profileslayout->addWidget (del, 3, 1);
    leftlayout->addWidget (profileframe);
    startbutton = new QPushButton (i18n ("Start"), this);
    serverled = new KLed (Qt::green, KLed::Off, KLed::Raised, KLed::Circular, this);
    feedled = new KLed (Qt::green, KLed::Off, KLed::Raised, KLed::Circular, this);
    ledlayout->addWidget (startbutton);
    ledlayout->addItem (new QSpacerItem (0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum));
    ledlayout->addWidget (serverled);
    ledlayout->addWidget (feedled);
    leftlayout->addLayout (ledlayout);
    QFrame * line = new QFrame (this);
    line->setFrameShape (QFrame::HLine);
    leftlayout->addWidget (line);
    leftlayout->addWidget (label);
    leftlayout->addWidget (accesslist);
    leftlayout->addItem (new QSpacerItem (0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding));
    layout->addLayout (leftlayout);
    line = new QFrame (this);
    line->setFrameShape (QFrame::VLine);
    layout->addWidget (line);
    layout->addLayout (formatlayout);
    layout->addItem (new QSpacerItem (0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding));
}
コード例 #5
0
KileWidgetPreviewConfig::KileWidgetPreviewConfig(KConfig *config, KileTool::QuickPreview *preview, QWidget *parent, const char *name )
	: QWidget(parent,name),
	  m_config(config),
	  m_preview(preview)
{
	// Layout
	QVBoxLayout *vbox = new QVBoxLayout(this, 5,5 );

	QGroupBox *groupbox = new QGroupBox( i18n("Quick Preview in a separate window"), this, "groupbox" );
	groupbox->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)1, 0, 0, groupbox->sizePolicy().hasHeightForWidth() ) );
	groupbox->setColumnLayout(0, Qt::Vertical ); 
	groupbox->layout()->setSpacing( 6 ); 
	groupbox->layout()->setMargin( 11 );
	QGridLayout *groupboxLayout = new QGridLayout( groupbox->layout() );
	groupboxLayout->setAlignment( Qt::AlignTop );
   
	QLabel *label = new QLabel( i18n("Select a configuration:"), groupbox, "label");
	m_combobox = new KComboBox(false,groupbox,"combobox" );

	groupboxLayout->addWidget(label,0,0);
	groupboxLayout->addWidget(m_combobox,0,2);
	groupboxLayout->setColSpacing(1,8);
	groupboxLayout->setColStretch(3,1);
	
	QGroupBox *gbResolution = new QGroupBox( i18n("Quick Preview in bottom bar"), this, "gbresolution" );
	gbResolution->setColumnLayout(0, Qt::Vertical );
	gbResolution->layout()->setSpacing( 6 );
	gbResolution->layout()->setMargin( 11 );
	QGridLayout *resLayout = new QGridLayout( gbResolution->layout() );
	resLayout->setAlignment( Qt::AlignTop );

	QLabel *resLabel = new QLabel( i18n("&Resolution:"), gbResolution );
	m_leDvipngResolution = new KLineEdit( gbResolution, "DvipngResolution" );
	QLabel *resDpi = new QLabel( i18n("dpi"), gbResolution );
	QLabel *resAllowed = new QLabel( i18n("(allowed values: 30-1000 dpi)"), gbResolution );
	
	// set validator
	QValidator* validator = new QIntValidator(30,1000,this);
	m_leDvipngResolution->setValidator(validator);
	resLabel->setBuddy(m_leDvipngResolution);

	QString sep = "&nbsp;&nbsp;&nbsp;&nbsp;";
	QString title = i18n("Kile supports three kinds of conversion to png images");
	QString tool1 = i18n("dvi --> png") + sep + i18n("(uses dvipng)");
	QString tool2 = i18n("dvi --> ps --> png") + sep + i18n("(uses dvips/convert)");
	QString tool3 = i18n("pdf --> png") + sep + i18n("(uses convert)");
	QString description = QString("%1:<ul><li>%2<li>%3<li>%4</ul>").arg(title).arg(tool1).arg(tool2).arg(tool3);

	QLabel *labelDescription = new QLabel(description, gbResolution);
	QLabel *labelDvipng = new QLabel(i18n("dvipng:"), gbResolution);
	QLabel *labelConvert = new QLabel(i18n("convert:"), gbResolution);
	m_lbDvipng = new QLabel(gbResolution);
	m_lbConvert = new QLabel(gbResolution);
	
	resLayout->addWidget(resLabel,0,0);
	resLayout->addWidget(m_leDvipngResolution,0,2);
	resLayout->addWidget(resDpi,0,3);
	resLayout->addWidget(resAllowed,0,5,Qt::AlignLeft);
	resLayout->addMultiCellWidget(labelDescription,1,1,0,5);
	resLayout->addWidget(labelDvipng,2,0);
	resLayout->addWidget(m_lbDvipng,2,2);
	resLayout->addWidget(labelConvert,3,0);
	resLayout->addWidget(m_lbConvert,3,2);
	resLayout->setColSpacing(1,8);
	resLayout->setColSpacing(4,24);
	resLayout->setColStretch(5,1);

	m_gbPreview = new QGroupBox( i18n("Properties"), this, "gbpreview" );
	m_gbPreview->setColumnLayout(0, Qt::Vertical );
	m_gbPreview->layout()->setSpacing( 6 );
	m_gbPreview->layout()->setMargin( 11 );
	QGridLayout *previewLayout = new QGridLayout( m_gbPreview->layout() );
	previewLayout->setAlignment( Qt::AlignTop );

	QLabel *labelPreviewWidget = new QLabel(i18n("Show preview in bottom bar:"), m_gbPreview);
	QLabel *labelPreviewType = new QLabel(i18n("Conversion to image:"), m_gbPreview);
	QLabel *labelSelection = new QLabel(i18n("Selection:"), m_gbPreview);
	QLabel *labelEnvironment = new QLabel(i18n("Environment:"), m_gbPreview);
	QLabel *labelMathgroup = new QLabel(i18n("Mathgroup:"), m_gbPreview);
	QLabel *labelSubdocument1 = new QLabel(i18n("Subdocument:"), m_gbPreview);
	QLabel *labelSubdocument2 = new QLabel(i18n("Not available, opens always in a separate window."), m_gbPreview);
	m_cbSelection = new QCheckBox(m_gbPreview);
	m_cbEnvironment = new QCheckBox(m_gbPreview);
	m_cbMathgroup = new QCheckBox(m_gbPreview);
	m_coSelection = new KComboBox(false,m_gbPreview);
	m_coEnvironment = new KComboBox(false,m_gbPreview);
	m_lbMathgroup = new QLabel(i18n("Preview uses always 'dvipng'."), m_gbPreview);

	previewLayout->addMultiCellWidget(labelPreviewWidget,0,0,0,2);
	previewLayout->addWidget(labelPreviewType,0,4);
	previewLayout->addWidget(labelSelection,1,0);
	previewLayout->addWidget(m_cbSelection,1,2);
	previewLayout->addWidget(m_coSelection,1,4);
	previewLayout->addWidget(labelEnvironment,2,0);
	previewLayout->addWidget(m_cbEnvironment,2,2);
	previewLayout->addWidget(m_coEnvironment,2,4);
	previewLayout->addWidget(labelMathgroup,3,0);
	previewLayout->addWidget(m_cbMathgroup,3,2);
	previewLayout->addMultiCellWidget(m_lbMathgroup,3,3,4,5,Qt::AlignLeft);
	previewLayout->addWidget(labelSubdocument1,4,0);
	previewLayout->addMultiCellWidget(labelSubdocument2,4,4,2,5,Qt::AlignLeft);
	previewLayout->setRowSpacing(0,3*labelPreviewWidget->sizeHint().height()/2);
	previewLayout->setRowSpacing(3,m_coEnvironment->sizeHint().height());
	previewLayout->setColSpacing(1,12);
	previewLayout->setColSpacing(3,40);
	previewLayout->setColStretch(5,1);

	vbox->addWidget(groupbox);
	vbox->addWidget(gbResolution);
	vbox->addWidget(m_gbPreview);
	vbox->addStretch();

	connect(m_cbEnvironment,SIGNAL(clicked()),this,SLOT(updateConversionTools()));
	connect(m_cbSelection,SIGNAL(clicked()),this,SLOT(updateConversionTools()));
	connect(m_cbMathgroup,SIGNAL(clicked()),this,SLOT(updateConversionTools()));
}