/**
 *   Sets up the dialog
 */
void UMLCheckConstraintDialog::setupDialog()
{
    QFrame *frame = new QFrame(this);
    setMainWidget(frame);

    //main layout contains the name fields, the text field
    QVBoxLayout* mainLayout = new QVBoxLayout(frame);
    mainLayout->setSpacing(15);

    // layout to hold the name label and line edit
    QHBoxLayout* nameLayout = new QHBoxLayout();
    mainLayout->addItem(nameLayout);

    // name label
    m_pNameL = new QLabel(i18nc("name label", "Name"), this);
    nameLayout->addWidget(m_pNameL);
    // name lineEdit
    m_pNameLE = new KLineEdit(this);
    nameLayout->addWidget(m_pNameLE);

    QVBoxLayout* checkConditionLayout = new QVBoxLayout();
    mainLayout->addItem(checkConditionLayout);

    m_pCheckConditionL = new QLabel(i18n("Check Condition :"), frame);
    checkConditionLayout->addWidget(m_pCheckConditionL);

    m_pCheckConditionTE = new KTextEdit(frame);
    checkConditionLayout->addWidget(m_pCheckConditionTE);

    // set text of text edit
    m_pCheckConditionTE->setText(m_pCheckConstraint->getCheckCondition());

    // set text of label
    m_pNameLE->setText(m_pCheckConstraint->name());
}
예제 #2
0
QT_BEGIN_NAMESPACE

QVFbRateDialog::QVFbRateDialog(int rate, QWidget *parent)
    : QDialog(parent)
{
    oldRate = rate;

    QVBoxLayout *tl = new QVBoxLayout(this);
    tl->setMargin(5);

    QLabel *label = new QLabel(tr("Target frame rate:"), this);
    tl->addWidget(label);

    QHBoxLayout *hl = new QHBoxLayout();
    tl->addItem(hl);
    rateSlider = new QSlider(Qt::Horizontal);
    rateSlider->setMinimum(1);
    rateSlider->setMaximum(100);
    rateSlider->setPageStep(10);
    rateSlider->setValue(rate);
    hl->addWidget(rateSlider);
    connect(rateSlider, SIGNAL(valueChanged(int)), this, SLOT(rateChanged(int)));
    rateLabel = new QLabel(tr("%1fps").arg(rate), this);
    hl->addWidget(rateLabel);

    hl = new QHBoxLayout();
    tl->addItem(hl);
    QPushButton *pb = new QPushButton(tr("OK"), this);
    connect(pb, SIGNAL(clicked()), this, SLOT(ok()));
    hl->addWidget(pb);
    pb = new QPushButton(tr("Cancel"), this);
    connect(pb, SIGNAL(clicked()), this, SLOT(cancel()));
    hl->addWidget(pb);
}
예제 #3
0
VirtualInfo::VirtualInfo(QWidget* pParent, Qt::WindowFlags pFlags) :
    QDialog(pParent, pFlags)
{
    setAttribute(Qt::WA_DeleteOnClose);
    setWindowModality(Qt::WindowModal);
    _parent = (VirtualClusterLineEdit*)(pParent);
    setObjectName("virtualInfo");
    setCaption(_parent->_titleSingular);
    _id = _parent->_id;
    
    _titleLit	= new QLabel(_parent->_titleSingular, this, "_titleLit");
    _numberLit	= new QLabel(tr("Number:"), this, "_numberLit");
    _number	= new QLabel(this, "_number");
    _nameLit	= new QLabel(tr("Name:"), this, "_nameLit");
    _name	= new QLabel(this, "_name");
    _descripLit	= new QLabel(tr("Description:"), this, "_descripLit");
    _descrip	= new QLabel(this, "_descrip");

    _titleLit->setAlignment(Qt::AlignVCenter | Qt::AlignLeft);
    _numberLit->setAlignment(Qt::AlignVCenter | Qt::AlignRight);
    _nameLit->setAlignment(Qt::AlignVCenter | Qt::AlignRight);

    _close	= new QPushButton(tr("&Close"), this, "_close");
    _close->setDefault(true);

    QHBoxLayout* dialogLyt = new QHBoxLayout(this, 5, -1, "dialogLyt");
    QVBoxLayout* titleLyt  = new QVBoxLayout(dialogLyt, -1, "titleLyt");
    titleLyt->addWidget(_titleLit);
    QHBoxLayout* dataLyt   = new QHBoxLayout(titleLyt,  -1, "mainLyt");
    QVBoxLayout* litLyt	   = new QVBoxLayout(dataLyt,   -1, "litLyt");
    litLyt->addWidget(_numberLit);
    litLyt->addWidget(_nameLit);
    litLyt->addWidget(_descripLit);
    QVBoxLayout* infoLyt   = new QVBoxLayout(dataLyt,   -1, "infoLyt");
    infoLyt->addWidget(_number);
    infoLyt->addWidget(_name);
    infoLyt->addWidget(_descrip);
    QSpacerItem* dataHtSpacer = new QSpacerItem(0, 0, QSizePolicy::Minimum,
						QSizePolicy::Expanding);
    titleLyt->addItem(dataHtSpacer);
    QHBoxLayout* buttonLyt = new QHBoxLayout(dialogLyt, -1, "buttonLyt");
    QSpacerItem* wdSpacer  = new QSpacerItem(20, 20, QSizePolicy::Minimum,
					     QSizePolicy::Expanding);
    buttonLyt->addItem(wdSpacer);
    QVBoxLayout* buttonColLyt = new QVBoxLayout(buttonLyt, -1, "buttonColLyt");

    buttonColLyt->addWidget(_close);
    QSpacerItem* htSpacer  = new QSpacerItem(20, 20, QSizePolicy::Minimum,
					     QSizePolicy::Expanding);
    buttonColLyt->addItem(htSpacer);

    connect(_close, SIGNAL(clicked()), this, SLOT(close()));

    _nameLit->setHidden(!_parent->_hasName);
    _name->setHidden(!_parent->_hasName);
    _descripLit->setHidden(!_parent->_hasDescription);
    _descrip->setHidden(!_parent->_hasDescription);

    sPopulate();
}
예제 #4
0
FilesPage::FilesPage(QWidget *parent) :
    QWizardPage(parent),
    m_newClassWidget(new Utils::NewClassWidget)
{
    m_newClassWidget->setPathInputVisible(false);
    setTitle(tr("Class Information"));

    QLabel *label = new QLabel(tr("Specify basic information about the classes "
        "for which you want to generate skeleton source code files."));
    label->setWordWrap(true);

    QVBoxLayout *vlayout = new QVBoxLayout;
    vlayout->addWidget(label);
    vlayout->addItem(new QSpacerItem(0, 20));

    vlayout->addWidget(m_newClassWidget);

    vlayout->addItem(new QSpacerItem(0, 20));
    m_errorLabel = new QLabel;
    m_errorLabel->setStyleSheet(QLatin1String("color: red;"));
    vlayout->addWidget(m_errorLabel);
    setLayout(vlayout);

    connect(m_newClassWidget, SIGNAL(validChanged()), this, SIGNAL(completeChanged()));
}
예제 #5
0
KnowitLinkDialog::KnowitLinkDialog()
   : KDialogBase(Plain, i18n("Modify link"), Ok|Cancel, Ok)
{
   QVBoxLayout* layout = new QVBoxLayout(plainPage());

   QHBox* typeBox = new QHBox(plainPage());
   layout->addWidget(typeBox);
   new QLabel(i18n("Referenced item:"), typeBox);
   linkType = new KComboBox(typeBox, "LinkType");
   linkType->insertItem(i18n("File or URL"));
   linkType->insertItem(i18n("KnowIt note"));

   layout->addItem(new QSpacerItem(0, 5));       
   QHBox* editBox = new QHBox(plainPage());
   layout->addWidget(editBox);
   linkValue = new KLineEdit("Link text", editBox);
   linkValue->setMinimumWidth(300);
   browse = new QToolButton(editBox, "Browse");
   browse->setIconSet(QIconSet(KGlobal::iconLoader()->loadIcon("fileopen",
      KIcon::Toolbar, KIcon::SizeSmall)));
   
   layout->addItem(new QSpacerItem(0, 5));
   layout->addWidget(new QLabel(i18n("Link description:"), plainPage()));
   layout->addWidget(linkDescription = new KLineEdit("Link description", plainPage()));

   connect(browse, SIGNAL(clicked()), this, SLOT(slotBrowse()));
   connect(linkType, SIGNAL(activated(int)), this, SLOT(slotTypeChanged(int)));
}
예제 #6
0
Dashboard::Dashboard(QWidget *parent)
    : QMainWindow(parent)
    , d_ptr(new DashboardPrivate(this))
{
    setWindowTitle("Maliit Keyboard Viewer");
    resize(854, 480);

    QGraphicsView *v = new QGraphicsView;
    v->setScene(new QGraphicsScene(v));
    v->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    v->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    setCentralWidget(v);
    v->show();
    QWidget *w = 0;
    d_ptr->proxy_widget = v->scene()->addWidget(w = new QWidget);
    d_ptr->proxy_widget->setTransformOriginPoint(d_ptr->proxy_widget->geometry().center());
    w->resize(size());

    QVBoxLayout *vbox = d_ptr->vbox;
    w->setLayout(vbox);

    QSpacerItem *top_spacer = d_ptr->top;
    vbox->addItem(top_spacer);

    QWidget *buttons = d_ptr->buttons;
    buttons->show();
    vbox->addWidget(buttons);
    QHBoxLayout *hbox = new QHBoxLayout;
    buttons->setLayout(hbox);

    QPushButton *show = new QPushButton("Show virtual keyboard");
    connect(show, SIGNAL(clicked()),
            this, SLOT(onShow()));
    hbox->addWidget(show);
    show->show();

    QPushButton *orientation_changed = new QPushButton("Change orientation");
    connect(orientation_changed, SIGNAL(clicked()),
            this, SLOT(onOrientationChangeClicked()));
    hbox->addWidget(orientation_changed);
    orientation_changed->show();

    QPushButton *close = new QPushButton("Close application");
    connect(close, SIGNAL(clicked()),
            qApp,  SLOT(quit()));
    hbox->addWidget(close);
    close->show();

    QTextEdit *te = d_ptr->text_entry;
    vbox->addWidget(te);
    te->show();
    te->setFocus();

    QSpacerItem *bottom_spacer = d_ptr->bottom;
    vbox->addItem(bottom_spacer);

    onShow();
}
예제 #7
0
QWidget *dSettingWindow::createWidget()
{
    QWidget * widget =  new QWidget();
    
    QVBoxLayout *layout = new QVBoxLayout;
    layout->setMargin(1);
    layout->setSpacing(5);
    layout->addWidget( new QLabel("Непрозрачноть окна (заначения от 0 до 100).<br>Прозрачные окна имеют проблемы с прорисовкой!") ); 

        QSpinBox *opacitySpinBox = new QSpinBox;
        opacitySpinBox->setRange(30, 100);
        opacitySpinBox->setSingleStep(1);
        opacitySpinBox->setValue(int(window->windowOpacity()*100));
        connect(opacitySpinBox, SIGNAL(valueChanged(int)), this, SLOT(opacityValueChanged(int)));
        
        QSlider *opacitySlider = new QSlider(Qt::Horizontal);
        opacitySlider->setFocusPolicy(Qt::StrongFocus);
        opacitySlider->setTickPosition(QSlider::TicksBothSides);
        opacitySlider->setTickInterval(10);
        opacitySlider->setSingleStep(1);
        opacitySlider->setMaximum ( 100 );
        opacitySlider->setMinimum ( 30 );
        opacitySlider->setValue(opacitySpinBox->value());
        connect(opacitySlider, SIGNAL(valueChanged(int)), opacitySpinBox, SLOT(setValue(int)));
        connect(opacitySpinBox, SIGNAL(valueChanged(int)), opacitySlider, SLOT(setValue(int)));
    
        QHBoxLayout *opacityLayout = new QHBoxLayout;
        opacityLayout->setSpacing(15);
        opacityLayout->addWidget( opacitySpinBox );   
        opacityLayout->addWidget( opacitySlider );   
    
    layout->addItem( opacityLayout );   

        layout->addWidget( new QLabel("Изменение рамки окна. Есть возможность использовать стандартное окно,<br> но тогда пропадет эффект \"магнетизма\" окон.") );     
        QHBoxLayout *skinLayout = new QHBoxLayout;
        skinLayout->setSpacing(15);
        skinPushButton = new QPushButton(tr("Load skin"));
        skinPushButton->setDefault(true);
        skinPushButton->setIcon(QIcon(tr("pic/open32x32.png")));
        connect(skinPushButton, SIGNAL(clicked(bool)), this, SLOT(clickedSkinButton(bool)));
        skinLayout->addWidget( skinPushButton );
    
    
        QCheckBox *standartFrameCheckBox = new QCheckBox(tr("Стандартная рамка окна"));    
        connect(standartFrameCheckBox, SIGNAL(stateChanged(int)), this, SLOT(stateChanged(int)));
        skinLayout->addWidget( standartFrameCheckBox );
        skinLayout->addStretch ( 1 );

    layout->addItem(skinLayout);

    widget->setLayout(layout); 

    return widget; 
};
예제 #8
0
void LoginDialog::createUI()
{
    setWindowTitle(u8"欢迎登录");

	auto * nameLabel = new QLabel;
    nameLabel->setText(tr(u8"用户名: "));

	auto* passwordLabel = new QLabel;
	passwordLabel->setText(tr(u8"密  码: "));

	nameText_ = new QLineEdit;
	nameText_->setPlaceholderText(tr(u8"请输入用户名"));
	nameText_->setText("zhn");

	passwordText_ = new QLineEdit;
	passwordText_->setEchoMode(QLineEdit::Password);
	passwordText_->setPlaceholderText(tr(u8"请输入密码"));
	passwordText_->setText("1123");

	QHBoxLayout* name = new QHBoxLayout();
	name->addWidget(nameLabel);
	name->addWidget(nameText_);

	QHBoxLayout* password = new QHBoxLayout();
	password->addWidget(passwordLabel);
	password->addWidget(passwordText_);

    // initialize buttons
    //auto buttons = new QDialogButtonBox(this);
    //buttons->addButton(QDialogButtonBox::Ok);
    //buttons->addButton(QDialogButtonBox::Cancel);
    //buttons->button(QDialogButtonBox::Ok)->setText(tr(u8"登录"));
    //buttons->button(QDialogButtonBox::Cancel)->setText(tr(u8"注册"));
	auto* btnLogin = new QPushButton(tr(u8"登录"));
	auto* btnSignup = new QPushButton(tr(u8"注册"));
	auto* btnExit = new QPushButton(tr(u8"退出"));
	QHBoxLayout* buttons = new QHBoxLayout();
	buttons->addWidget(btnLogin);
	buttons->addWidget(btnSignup);
	buttons->addWidget(btnExit);

    // connects slots
	connect(btnExit, SIGNAL(clicked()), this, SLOT(reject())); // 退出
	connect(btnSignup, SIGNAL(clicked()), this, SLOT(slotSignUp())); // 注册
	connect(btnLogin, SIGNAL(clicked()), this, SLOT(slotAcceptLogin())); // 登陆

	QVBoxLayout* layout = new QVBoxLayout();
	layout->addItem(name);
	layout->addItem(password);
    layout->addItem(buttons);
    layout->setSizeConstraint(QLayout::SetFixedSize);

	setLayout(layout);
}
예제 #9
0
파일: BTGame.cpp 프로젝트: Forkast/BTech
GameVersionChoiceDialog::GameVersionChoiceDialog(const QList <BTech::GameVersion> &allowedVersions)
	: QDialog()
{
	setFixedSize(200, 300);

	QVBoxLayout *checkBoxLayout = new QVBoxLayout;
	checkBoxLayout->setAlignment(Qt::AlignTop);

	QVector <QCheckBox *> checkBox;
	group = new QButtonGroup;
	group->setExclusive(true);
	for (BTech::GameVersion version : allowedVersions) {
		checkBox << new QCheckBox(BTech::gameVersionStringChange[version]);
		group->addButton(checkBox.last());
		checkBoxLayout->addWidget(checkBox.last());
	}
	checkBox.first()->setChecked(true);

	QVBoxLayout *layout = new QVBoxLayout;

	layout->addItem(checkBoxLayout);

	confirmButton = new QPushButton(BTech::Strings::ButtonConfirm);
	connect(confirmButton, &QPushButton::pressed, this, &GameVersionChoiceDialog::accept);
	layout->addWidget(confirmButton);

	setLayout(layout);
}
예제 #10
0
Control :: Control(QWidget *parent) : QDialog(parent) {
	port = 0;
	toPort = 0;
	ipAddress = "";
	labelLives = new QLabel;
	state = new State();
	stateHandler = new SaxHandler(state);

	moveLeftButton = new QPushButton("<");
	moveRightButton = new QPushButton(">");
	restartButton = new QPushButton("Restart");
	moveLeftButton->setEnabled(false);
	moveRightButton->setEnabled(false);
	restartButton->setEnabled(true);
	
	QHBoxLayout *topLayout = new QHBoxLayout();
	topLayout->addWidget(moveLeftButton);
	topLayout->addWidget(moveRightButton);
	topLayout->addWidget(restartButton);
	
	QVBoxLayout *mainLayout = new QVBoxLayout;
	mainLayout->addWidget(labelLives);
	mainLayout->addItem(topLayout);
	setLayout(mainLayout);

	setFocusPolicy(Qt::StrongFocus);

	connect(moveLeftButton, SIGNAL(clicked()), this, SLOT(moveLeft()));
	connect(moveRightButton, SIGNAL(clicked()), this, SLOT(moveRight()));
	connect(restartButton, SIGNAL(clicked()), this, SLOT(restart()));

	setSettingsSocket();
	setToPort();
}
예제 #11
0
KACLEditWidget::KACLEditWidget( QWidget *parent )
    : QWidget(parent), d(new KACLEditWidgetPrivate)
{
    QHBoxLayout *hbox = new QHBoxLayout( this );
    hbox->setMargin( 0 );
    d->m_listView = new KACLListView(this);
    hbox->addWidget(d->m_listView);
    connect(d->m_listView->selectionModel(),
            SIGNAL(selectionChanged(const QItemSelection&, const QItemSelection& )),
            this,
            SLOT(_k_slotUpdateButtons()));
    QVBoxLayout *vbox = new QVBoxLayout();
    hbox->addLayout( vbox );
    d->m_AddBtn = new QPushButton(i18n("Add Entry..."), this);
    vbox->addWidget(d->m_AddBtn);
    d->m_AddBtn->setObjectName(QLatin1String("add_entry_button"));
    connect(d->m_AddBtn, SIGNAL(clicked()), d->m_listView, SLOT(slotAddEntry()));
    d->m_EditBtn = new QPushButton(i18n("Edit Entry..."), this);
    vbox->addWidget(d->m_EditBtn);
    d->m_EditBtn->setObjectName(QLatin1String("edit_entry_button"));
    connect(d->m_EditBtn, SIGNAL(clicked()), d->m_listView, SLOT(slotEditEntry()));
    d->m_DelBtn = new QPushButton(i18n("Delete Entry"), this);
    vbox->addWidget(d->m_DelBtn);
    d->m_DelBtn->setObjectName(QLatin1String("delete_entry_button"));
    connect(d->m_DelBtn, SIGNAL(clicked()), d->m_listView, SLOT(slotRemoveEntry()));
    vbox->addItem( new QSpacerItem( 10, 10, QSizePolicy::Fixed, QSizePolicy::Expanding ) );
    d->_k_slotUpdateButtons();
}
예제 #12
0
MailSelectionPage::MailSelectionPage(QWidget* parent) : QWizardPage(parent)
{
    QVBoxLayout* mainLayout = new QVBoxLayout(this);
    mainLayout->setSpacing( 6 );
    mainLayout->setMargin( 2 );
    mainLayout->addWidget(new QLabel(tr("Cleanup Messages"), this));

    QFrame *line = new QFrame( this);
    line->setFrameStyle(QFrame::HLine | QFrame::Sunken );
    mainLayout->addWidget(line);

    QGridLayout *grid = new QGridLayout();
    grid->addWidget(new QLabel(tr("Older than"), this), 0, 0);
    QDate date;
    dp = new QDateEdit(date.currentDate(),this);
    grid->addWidget( dp, 0, 1 );

    grid->addWidget(new QLabel(tr("Larger than"), this), 1, 0);
    sizeBox = new QSpinBox(this);
    sizeBox->setButtonSymbols(QSpinBox::UpDownArrows);
    sizeBox->setSuffix(' ' + tr("kB", "kilobyte"));
    sizeBox->setMinimum( 0 );
    sizeBox->setMaximum( 100000 );
    sizeBox->setValue( 10 );
    sizeBox->setSingleStep( 10 );
    grid->addWidget(sizeBox, 1, 1);
    QSpacerItem *spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum,QSizePolicy::Expanding);
    mainLayout->addLayout(grid);
    mainLayout->addItem(spacer);
    registerField("MailSelectionPage_sizeBox",sizeBox);
    registerField("MailSelectionPage_dateBox",dp);
}
예제 #13
0
PreselectionPage::PreselectionPage(QWidget* parent) : QWizardPage(parent)
{
    QVBoxLayout* vb = new QVBoxLayout(this);
    QLabel* title = new QLabel(tr("What would you like to cleanup?"));
    title->setWordWrap(true);
    vb->addWidget(title);
    QFrame *line = new QFrame( this);
    line->setFrameStyle(QFrame::HLine | QFrame::Sunken );
    vb->addWidget(line);
    mailCheckBox     = new QCheckBox(tr("Messages"));
    vb->addWidget(mailCheckBox);
    eventCheckBox    = new QCheckBox(tr("Events"));
    vb->addWidget(eventCheckBox);
    documentCheckBox = new QCheckBox(tr("Documents"));
    vb->addWidget(documentCheckBox);
    QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum,
    QSizePolicy::Expanding);
    vb->addItem(spacer);
    registerField("documentToCleanup", documentCheckBox);
    registerField("mailToCleanup",mailCheckBox);
    registerField("eventToCleanup",eventCheckBox);

    connect(mailCheckBox,SIGNAL(clicked()),this,SIGNAL(completeChanged()));
    connect(eventCheckBox,SIGNAL(clicked()),this,SIGNAL(completeChanged()));
    connect(documentCheckBox,SIGNAL(clicked()),this,SIGNAL(completeChanged()));
}
예제 #14
0
purchaseOrderList::purchaseOrderList(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) :
  QDialog(parent, name, modal, fl)
{
  if (!name)
    setName("purchaseOrderList");

  _poheadid = -1;
  _type = (cPOUnposted | cPOOpen | cPOClosed);

  setCaption(tr("Purchase Orders"));

  QHBoxLayout *purchaseOrderListLayout = new QHBoxLayout(this);
  QVBoxLayout *tableLayout = new QVBoxLayout(purchaseOrderListLayout);
  QVBoxLayout *buttonLayout = new QVBoxLayout(purchaseOrderListLayout);

  QHBoxLayout *vendLayout = new QHBoxLayout(tableLayout);
  _vend = new VendorCluster(this, "_vend");
  vendLayout->addWidget(_vend);
  vendLayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding,
				      QSizePolicy::Minimum));

  QLabel *_poheadLit = new QLabel(tr("&Purchase Orders:"), this, "_poheadLit");
  tableLayout->addWidget( _poheadLit );

  _pohead = new XTreeWidget(this);
  _pohead->setName("_pohead");
  _poheadLit->setBuddy(_pohead);
  tableLayout->addWidget(_pohead);

  _close = new QPushButton(tr("&Cancel"), this, "_close");
  buttonLayout->addWidget( _close );

  _select = new QPushButton(tr("&Select"), this, "_select");
  _select->setEnabled( FALSE );
  _select->setDefault( TRUE );
  buttonLayout->addWidget( _select );

  QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
  buttonLayout->addItem( spacer );

  resize( QSize(550, 350).expandedTo(minimumSizeHint()) );
  //clearWState( WState_Polished );

    // signals and slots connections
  connect(_close,  SIGNAL(clicked()),		this,	SLOT(sClose()	     ));
  connect(_pohead, SIGNAL(itemSelected(int)), _select,	SLOT(animateClick()  ));
  connect(_pohead, SIGNAL(valid(bool)),       _select,	SLOT(setEnabled(bool)));
  connect(_select, SIGNAL(clicked()),		this,	SLOT(sSelect()	     ));
  connect(_vend,   SIGNAL(newId(int)),		this,	SLOT(sFillList()     ));

  _type = 0;

  _pohead->addColumn(tr("Number"), _orderColumn, Qt::AlignRight  );
  _pohead->addColumn(tr("Vendor"), -1,           Qt::AlignLeft   );
  _pohead->addColumn(tr("Agent"),  _itemColumn,  Qt::AlignCenter );
  _pohead->addColumn(tr("Order Date"),	_dateColumn,	Qt::AlignLeft  );
  _pohead->addColumn(tr("First Item"),	_itemColumn,	Qt::AlignLeft  );

  _pohead->setFocus();
}
예제 #15
0
KDE_NO_CDTOR_EXPORT KMPlayerPrefBroadcastPage::KMPlayerPrefBroadcastPage (QWidget *parent) : QFrame (parent) {
    QVBoxLayout *layout = new QVBoxLayout (this, 5);
    QGridLayout *gridlayout = new QGridLayout (layout, 6, 2, 2);
    QLabel *label = new QLabel (i18n ("Bind address:"), this);
    bindaddress = new QLineEdit ("", this);
    QWhatsThis::add (bindaddress, i18n ("If you have multiple network devices, you can limit access"));
    gridlayout->addWidget (label, 0, 0);
    gridlayout->addWidget (bindaddress, 0, 1);
    label = new QLabel (i18n ("Listen port:"), this);
    port = new QLineEdit ("", this);
    gridlayout->addWidget (label, 1, 0);
    gridlayout->addWidget (port, 1, 1);
    label = new QLabel (i18n ("Maximum connections:"), this);
    maxclients = new QLineEdit ("", this);
    gridlayout->addWidget (label, 2, 0);
    gridlayout->addWidget (maxclients, 2, 1);
    label = new QLabel (i18n ("Maximum bandwidth (kbit):"), this);
    maxbandwidth = new QLineEdit ("", this);
    gridlayout->addWidget (label, 3, 0);
    gridlayout->addWidget (maxbandwidth, 3, 1);
    label = new QLabel (i18n ("Temporary feed file:"), this);
    feedfile = new QLineEdit ("", this);
    gridlayout->addWidget (label, 4, 0);
    gridlayout->addWidget (feedfile, 4, 1);
    label = new QLabel (i18n ("Feed file size (kB):"), this);
    feedfilesize = new QLineEdit ("", this);
    gridlayout->addWidget (label, 5, 0);
    gridlayout->addWidget (feedfilesize, 5, 1);
    layout->addItem (new QSpacerItem (0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding));
}
예제 #16
0
XDSettingsWidget::XDSettingsWidget(XDSettings* settings, QWidget *parent, const char *name)
    : DebuggerTab(parent, name), m_settings(settings)
{

  QVBoxLayout *mainLayout = new QVBoxLayout(this, 10, 16);

  QHBoxLayout* portbox = new QHBoxLayout(0, -1, 16);

  QLabel* lblistenPort = new QLabel(this);
  lblistenPort->setText("Listen on port:");
  portbox->addWidget(lblistenPort);

  m_spListenPort = new QSpinBox(this);
  m_spListenPort->setMaxValue(99999);
  portbox->addWidget(m_spListenPort);
  portbox->addItem(new QSpacerItem( 40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ));

  mainLayout->addLayout(portbox);

  QHBoxLayout* jitbox = new QHBoxLayout(0, -1, 16);

  m_ckEnableJIT = new QCheckBox(this);
  m_ckEnableJIT->setText("Enable JIT");
  jitbox->addWidget(m_ckEnableJIT);
  jitbox->addItem(new QSpacerItem( 324, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ));

  mainLayout->addLayout(jitbox);

  mainLayout->addItem(new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding));
}
예제 #17
0
ModulesPage::ModulesPage(QWidget *parent)
    : QWizardPage(parent)
{
    setTitle(tr("Select Required Modules"));
    QLabel *label = new QLabel(tr("Select the modules you want to include in your "
        "project. The recommended modules for this project are selected by default."));
    label->setWordWrap(true);

    QVBoxLayout *vlayout = new QVBoxLayout();
    vlayout->addWidget(label);
    vlayout->addItem(new QSpacerItem(0, 20));

    QGridLayout *layout = new QGridLayout;

    const QStringList &modulesList = QtModulesInfo::modules();
    int moduleId = 0;
    int rowsCount = (modulesList.count() + 1) / 2;
    foreach (const QString &module, modulesList) {
        QCheckBox *moduleCheckBox = new QCheckBox(QtModulesInfo::moduleName(module));
        moduleCheckBox->setToolTip(QtModulesInfo::moduleDescription(module));
        moduleCheckBox->setWhatsThis(QtModulesInfo::moduleDescription(module));
        registerField(module, moduleCheckBox);
        int row = moduleId % rowsCount;
        int column = moduleId / rowsCount;
        layout->addWidget(moduleCheckBox, row, column);
        m_moduleCheckBoxMap[module] = moduleCheckBox;
        moduleId++;
    }
unsigned StManagerStudyListComp::getSeriesIndex( const SerieInfoVector info )
{
  // no resize, just exit button - reject, result code is 0 -> returned value will be 0
  QDialog *seriesSelectorDialog = new QDialog( this, Qt::WindowTitleHint | Qt::WindowSystemMenuHint| Qt::MSWindowsFixedSizeDialogHint );
  seriesSelectorDialog->setWindowTitle( tr( "Series Selector" ) );

  QVBoxLayout *mainLayout = new QVBoxLayout;

  QLabel *seriesLabel = new QLabel( tr( "Series in selected study:\n(their descriptions)" ) );
  mainLayout->addWidget( seriesLabel );

  QSpacerItem *verticalSpacer = new QSpacerItem( 2, 10, QSizePolicy::Minimum, 
                                                 QSizePolicy::Minimum );
  mainLayout->addItem( verticalSpacer );

  QTableWidget *seriesTable = createSeriesSelectionTable();
  seriesTable->setRowCount( info.size() );
  for ( unsigned i = 0; i < info.size(); i++ ) {
    seriesTable->setItem( i, 0, new QTableWidgetItem( QString( info[i].description.c_str() ) ) );
  }
  connect( seriesTable, SIGNAL(cellClicked( int, int )), seriesSelectorDialog, SLOT(done( int )) );
  mainLayout->addWidget( seriesTable );

  seriesSelectorDialog->setLayout( mainLayout );

  return seriesSelectorDialog->exec();
}
    toSGATracePrefs(toTool *tool, QWidget* parent = 0, const char* name = 0)
            : QGroupBox(parent), toSettingTab("trace.html"), Tool(tool)
    {
        if (name)
            setObjectName(name);

        QVBoxLayout *vbox = new QVBoxLayout;
        vbox->setSpacing(6);
        vbox->setContentsMargins(11, 11, 11, 11);

        setLayout(vbox);

        setTitle(qApp->translate("toSGATracePrefs", "SGA Trace"));

        AutoUpdate = new QCheckBox(this);
        AutoUpdate->setText(qApp->translate("toSGATracePrefs", "&Auto update"));
        AutoUpdate->setToolTip(qApp->translate("toSGATracePrefs",
                                               "Update automatically after change of schema."));
        vbox->addWidget(AutoUpdate);

        QSpacerItem *spacer = new QSpacerItem(
            20,
            20,
            QSizePolicy::Minimum,
            QSizePolicy::Expanding);
        vbox->addItem(spacer);

//         if (!Tool->config(CONF_AUTO_UPDATE, "Yes").isEmpty())
//             AutoUpdate->setChecked(true);
        AutoUpdate->setChecked(toConfigurationSingle::Instance().autoUpdate());
    }
예제 #20
0
dTopicTextEditEx::dTopicTextEditEx( QWidget * _parent):
        QTextEdit(_parent)
{
    application = qobject_cast<dChatApplication*>(QApplication::instance());
   
    topicEditor = new QWidget();
    topicEditor->setWindowTitle(tr("Редактор заголовка"));
    topicEditor->setWindowIcon(QIcon(tr("pic/book64x64.png")));
    QVBoxLayout *layout = new QVBoxLayout;
    layout->setMargin(1);
    layout->setSpacing(5);
    
    topicEditorTextEdit = new QTextEdit();
    layout->addWidget(topicEditorTextEdit); 
    
        QHBoxLayout *layoutButton = new QHBoxLayout;
        layoutButton->setSpacing(5);
        QPushButton *sendButton = new QPushButton(tr("Отправить"));
        sendButton->setDefault(true);
    //   skinPushButton->setIcon(QIcon(tr("pic/open32x32.png")));
        connect(sendButton, SIGNAL(clicked()), this, SLOT(clickedSendButton()));
        layoutButton->addWidget(sendButton); 
        QPushButton *closeButton = new QPushButton(tr("Закрыть"));
        connect(closeButton, SIGNAL(clicked()), topicEditor, SLOT(close()));
        layoutButton->addWidget( closeButton ); 
        layoutButton->addStretch ( 1 );
    
    layout->addItem(layoutButton);
    topicEditor->resize(size());    
    topicEditor->setLayout(layout);

};
예제 #21
0
void PluginsCenter::refreshFilter() {
  _currentItem = nullptr;

  if (_categoryFilters.isEmpty())
    _categoryFilters.push_back("");

  QVBoxLayout *lyt = new QVBoxLayout();

  for (const QString &cf : _categoryFilters) {
    for (const PluginInformation &info : PluginManager::listPlugins(
             PluginManager::Remote | PluginManager::Local, _nameFilter, cf)) {
      PluginInformationListItem *item = new PluginInformationListItem(info);
      connect(item, SIGNAL(focused()), this, SLOT(itemFocused()));
      lyt->addWidget(item);
    }
  }

  lyt->addItem(new QSpacerItem(0, 0, QSizePolicy::Maximum, QSizePolicy::Expanding));

  QString oldObjName = _ui->pluginsSearchListContent->objectName();
  _ui->pluginsSearchList->setWidget(nullptr);
  _ui->pluginsSearchListContent = new QWidget();
  _ui->pluginsSearchListContent->setObjectName(oldObjName);
  _ui->pluginsSearchListContent->setLayout(lyt);
  _ui->pluginsSearchList->setWidget(_ui->pluginsSearchListContent);
  _ui->pluginsContent->setCurrentWidget(_ui->pluginsListPage);
}
예제 #22
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    occView = new OccView(this);

    pushButtonDrawBox = new QPushButton("Draw box");
    pushButtonDrawCone = new QPushButton("Draw cone");
    pushButtonDrawSphere = new QPushButton("Draw sphere");

    QWidget *w = new QWidget();

    QHBoxLayout *horizontalLayout = new QHBoxLayout();
    QVBoxLayout *verticalLayout = new QVBoxLayout();

    horizontalLayout->addWidget(pushButtonDrawBox);
    horizontalLayout->addWidget(pushButtonDrawCone);
    horizontalLayout->addWidget(pushButtonDrawSphere);

    verticalLayout->addWidget(occView);
    verticalLayout->addItem(horizontalLayout);

    w->setLayout(verticalLayout);

    setCentralWidget(w);

    connect(pushButtonDrawBox, SIGNAL(clicked(bool)), this, SLOT(on_drawBox()));
    connect(pushButtonDrawCone, SIGNAL(clicked(bool)), this, SLOT(on_drawCone()));
    connect(pushButtonDrawSphere, SIGNAL(clicked(bool)), this, SLOT(on_drawSphere()));
}
예제 #23
0
QWidget * OptionsPanelWidget::initGroupsLayout() {
    groupsLayout = new QVBoxLayout();
    groupsLayout->setContentsMargins(0, 60, 0, 0);
    groupsLayout->setSpacing(0);

    // External groups layout is used to add a spacer below the image headers
    QVBoxLayout *externalGroupsLayout = new QVBoxLayout();
    externalGroupsLayout->setContentsMargins(0, 0, 0, 0);
    externalGroupsLayout->setSpacing(0);
    externalGroupsLayout->addLayout(groupsLayout);
    externalGroupsLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding));

    // The widget is used to add additional decoration to the groups panel
    QWidget *groupsWidget = new QWidget();
    groupsWidget->setLayout(externalGroupsLayout);
    groupsWidget->setStyleSheet(
        "background: palette(mid);"
        "border-style: solid;"
        "border-left-width: 1px;"
        "border-top-width: 0px;"
        "border-right-width: 1px;"
        "border-bottom-width: 0px;"
        "border-color: palette(shadow);");
    return groupsWidget;
}
FolderSelectionWidget::FolderSelectionWidget(QWidget* parent, Qt::WindowFlags f)
    : QWidget(parent, f)
{
    m_listWidget = new QListWidget(this);
    m_listWidget->setAlternatingRowColors(true);

    m_messageWidget = new KMessageWidget(this);
    m_messageWidget->hide();

    QVBoxLayout* layout = new QVBoxLayout(this);
    layout->addWidget(m_messageWidget);
    layout->addWidget(m_listWidget);

    QHBoxLayout* hLayout = new QHBoxLayout;
    QSpacerItem* spacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
    hLayout->addItem(spacer);

    m_addButton = new QPushButton(this);
    m_addButton->setIcon(QIcon::fromTheme(QLatin1String("list-add")));
    connect(m_addButton, &QPushButton::clicked, this, &FolderSelectionWidget::slotAddButtonClicked);

    m_removeButton = new QPushButton(this);
    m_removeButton->setIcon(QIcon::fromTheme(QLatin1String("list-remove")));
    m_removeButton->setEnabled(false);
    connect(m_removeButton, &QPushButton::clicked, this, &FolderSelectionWidget::slotRemoveButtonClicked);

    connect(m_listWidget, &QListWidget::currentItemChanged, this, &FolderSelectionWidget::slotCurrentItemChanged);

    hLayout->addWidget(m_addButton);
    hLayout->addWidget(m_removeButton);
    layout->addItem(hLayout);
}
예제 #25
0
ClassNamePage::ClassNamePage(QWidget *parent) :
    QWizardPage(parent),
    m_isValid(false)
{
    setTitle(tr("Enter Class Name"));
    setSubTitle(tr("The header and source file names will be derived from the class name"));

    m_newClassWidget = new Utils::NewClassWidget;
    // Order, set extensions first before suggested name is derived
    m_newClassWidget->setBaseClassInputVisible(true);
    m_newClassWidget->setBaseClassChoices(QStringList() << QString()
                                          << QLatin1String("QObject")
                                          << QLatin1String("QWidget")
                                          << QLatin1String("QMainWindow")
                                          << QLatin1String("QDeclarativeItem")
                                          << QLatin1String("QQuickItem"));
    m_newClassWidget->setBaseClassEditable(true);
    m_newClassWidget->setFormInputVisible(false);
    m_newClassWidget->setNamespacesEnabled(true);
    m_newClassWidget->setAllowDirectories(true);
    m_newClassWidget->setBaseClassInputVisible(true);

    connect(m_newClassWidget, SIGNAL(validChanged()), this, SLOT(slotValidChanged()));

    QVBoxLayout *pageLayout = new QVBoxLayout(this);
    pageLayout->addWidget(m_newClassWidget);
    QSpacerItem *vSpacer = new QSpacerItem(0, 0, QSizePolicy::Ignored, QSizePolicy::Expanding);
    pageLayout->addItem(vSpacer);

    initParameters();
}
예제 #26
0
void YourAccounts::createGui()
{
	QVBoxLayout *mainLayout = new QVBoxLayout(this);

	QHBoxLayout *contentLayout = new QHBoxLayout();
	mainLayout->addItem(contentLayout);

	AccountsView = new QListView(this);
	AccountsView->setMinimumWidth(150);
	contentLayout->addWidget(AccountsView);
	MyAccountsModel = m_injectedFactory->makeInjected<AccountsModel>(m_accountManager, AccountsView);
	auto *chain = new ModelChain{this};
	auto accountProxyModel = new AccountsProxyModel(chain);
	chain->setBaseModel(MyAccountsModel);
	accountProxyModel->addFilter(new HaveProtocolFilter(accountProxyModel));
	chain->addProxyModel(accountProxyModel);

	QAction *separator = new QAction(this);
	separator->setSeparator(true);

	AddExistingAccountAction = new QAction(m_iconsManager->iconByPath(KaduIcon("contact-new")), tr("Add existing account"), this);
	CreateNewAccountAction = new QAction(m_iconsManager->iconByPath(KaduIcon("system-users")), tr("Create new account"), this);

	ActionListModel *actionsModel = new ActionListModel(this);
	actionsModel->appendAction(separator);
	actionsModel->appendAction(AddExistingAccountAction);
	actionsModel->appendAction(CreateNewAccountAction);

	QList<QAbstractItemModel *> models;
	models.append(chain->lastModel());
	models.append(actionsModel);

	ActionFilterProxyModel *proxyModel = new ActionFilterProxyModel(this);
	proxyModel->setSourceModel(MergedProxyModelFactory::createInstance(models, this));
	proxyModel->setModel(chain->lastModel());
	proxyModel->addHideWhenModelEmpty(separator);

	AccountsView->setModel(proxyModel);
	AccountsView->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
	AccountsView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
	AccountsView->setIconSize(QSize(32, 32));
	connect(AccountsView->selectionModel(), SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)),
			this, SLOT(accountSelectionChanged(const QItemSelection &, const QItemSelection &)));

	QDialogButtonBox *buttons = new QDialogButtonBox(Qt::Horizontal, this);
	mainLayout->addWidget(buttons);

	QPushButton *cancelButton = new QPushButton(qApp->style()->standardIcon(QStyle::SP_DialogCloseButton), tr("Close"), this);

	connect(cancelButton, SIGNAL(clicked(bool)), this, SLOT(close()));
	buttons->addButton(cancelButton, QDialogButtonBox::RejectRole);

	MainStack = new QStackedWidget(this);

	contentLayout->addWidget(MainStack, 100);

	createAccountWidget();
	createEditAccountWidget();
}
예제 #27
0
KPrPenStyleWidget::KPrPenStyleWidget( QWidget *parent, const char *name, const KoPenCmd::Pen &pen, bool configureLineEnds )
: QWidget( parent, name )
, m_pen( pen )
{
    QVBoxLayout *layout = new QVBoxLayout( this );
    layout->addWidget( m_ui = new PenStyleUI( this ) );

    QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
    layout->addItem( spacer );

    connect( m_ui->colorChooser, SIGNAL( changed( const QColor& ) ),
             this, SLOT( slotPenChanged() ) );

    m_ui->styleCombo->insertItem( i18n( "No Outline" ) );
    m_ui->styleCombo->insertItem( "__________" );
    m_ui->styleCombo->insertItem( "__ __ __ __" );
    m_ui->styleCombo->insertItem( "_ _ _ _ _ _" );
    m_ui->styleCombo->insertItem( "__ _ __ _ __" );
    m_ui->styleCombo->insertItem( "__ _ _ __ _" );

    m_ui->widthInput->setRange( 1, 10,  1, false);

    connect( m_ui->styleCombo, SIGNAL( activated( int ) ),
             this, SLOT( slotPenChanged() ) );

    connect( m_ui->widthInput, SIGNAL( valueChanged( double ) ),
             this, SLOT( slotPenChanged() ) );

    m_ui->lineBeginCombo->insertItem( i18n("Normal") );
    m_ui->lineBeginCombo->insertItem( i18n("Arrow") );
    m_ui->lineBeginCombo->insertItem( i18n("Square") );
    m_ui->lineBeginCombo->insertItem( i18n("Circle") );
    m_ui->lineBeginCombo->insertItem( i18n("Line Arrow") );
    m_ui->lineBeginCombo->insertItem( i18n("Dimension Line") );
    m_ui->lineBeginCombo->insertItem( i18n("Double Arrow") );
    m_ui->lineBeginCombo->insertItem( i18n("Double Line Arrow") );

    connect( m_ui->lineBeginCombo, SIGNAL( activated( int ) ),
             this, SLOT( slotLineBeginChanged() ) );

    m_ui->lineEndCombo->insertItem( i18n("Normal") );
    m_ui->lineEndCombo->insertItem( i18n("Arrow") );
    m_ui->lineEndCombo->insertItem( i18n("Square") );
    m_ui->lineEndCombo->insertItem( i18n("Circle") );
    m_ui->lineEndCombo->insertItem( i18n("Line Arrow") );
    m_ui->lineEndCombo->insertItem( i18n("Dimension Line") );
    m_ui->lineEndCombo->insertItem( i18n("Double Arrow") );
    m_ui->lineEndCombo->insertItem( i18n("Double Line Arrow") );

    connect( m_ui->lineEndCombo, SIGNAL( activated( int ) ),
             this, SLOT( slotLineEndChanged() ) );

    if ( !configureLineEnds )
        m_ui->arrowGroup->hide();
    //m_ui->arrowGroup->setEnabled( configureLineEnds );

    slotReset();
}
QWidget *DebuggerOptionsPage::widget()
{
    if (!m_configWidget) {
        m_configWidget = new QWidget;

        m_addButton = new QPushButton(tr("Add"), m_configWidget);
        m_cloneButton = new QPushButton(tr("Clone"), m_configWidget);
        m_delButton = new QPushButton(tr("Remove"), m_configWidget);

        m_container = new DetailsWidget(m_configWidget);
        m_container->setState(DetailsWidget::NoSummary);
        m_container->setVisible(false);

        m_debuggerView = new QTreeView(m_configWidget);
        m_model = new DebuggerItemModel(m_debuggerView);
        m_debuggerView->setModel(m_model);
        m_debuggerView->setUniformRowHeights(true);
        m_debuggerView->setSelectionMode(QAbstractItemView::SingleSelection);
        m_debuggerView->setSelectionBehavior(QAbstractItemView::SelectRows);
        m_debuggerView->expandAll();

        QHeaderView *header = m_debuggerView->header();
        header->setStretchLastSection(false);
        header->setSectionResizeMode(0, QHeaderView::ResizeToContents);
        header->setSectionResizeMode(1, QHeaderView::ResizeToContents);
        header->setSectionResizeMode(2, QHeaderView::Stretch);

        QVBoxLayout *buttonLayout = new QVBoxLayout();
        buttonLayout->setSpacing(6);
        buttonLayout->setContentsMargins(0, 0, 0, 0);
        buttonLayout->addWidget(m_addButton);
        buttonLayout->addWidget(m_cloneButton);
        buttonLayout->addWidget(m_delButton);
        buttonLayout->addItem(new QSpacerItem(10, 40, QSizePolicy::Minimum, QSizePolicy::Expanding));

        QVBoxLayout *verticalLayout = new QVBoxLayout();
        verticalLayout->addWidget(m_debuggerView);
        verticalLayout->addWidget(m_container);

        QHBoxLayout *horizontalLayout = new QHBoxLayout(m_configWidget);
        horizontalLayout->addLayout(verticalLayout);
        horizontalLayout->addLayout(buttonLayout);

        connect(m_debuggerView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
                this, SLOT(debuggerSelectionChanged()));

        connect(m_addButton, SIGNAL(clicked()), this, SLOT(addDebugger()), Qt::QueuedConnection);
        connect(m_cloneButton, SIGNAL(clicked()), this, SLOT(cloneDebugger()), Qt::QueuedConnection);
        connect(m_delButton, SIGNAL(clicked()), this, SLOT(removeDebugger()), Qt::QueuedConnection);

        m_itemConfigWidget = new DebuggerItemConfigWidget(m_model);
        m_container->setWidget(m_itemConfigWidget);

        updateState();
    }
    return m_configWidget;
}
void insertTab(uint32_t index, diaElemTabs *tab, QTabWidget *wtab)
{

  QWidget *wid=new QWidget;  
  QSpacerItem *spacerItem = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
  int currentLayout = 0;
  QVBoxLayout *vboxLayout = new QVBoxLayout(wid);
  QLayout *layout = NULL;
  
  /* First compute the size of our window */
  int vsize=0;
  for(int i=0;i<tab->nbElems;i++)
  {
    ADM_assert(tab->dias[i]);
     vsize+=tab->dias[i]->getSize(); 
  }

        int  v=0;

        for(int i=0;i<tab->nbElems;i++)
        {
                ADM_assert(tab->dias[i]);

                if (tab->dias[i]->getRequiredLayout() != currentLayout)
                {
                        if (layout)
                                vboxLayout->addLayout(layout);

                        switch (tab->dias[i]->getRequiredLayout())
                        {
                                case FAC_QT_GRIDLAYOUT:
                                        layout = new QGridLayout();
                                        break;
                                case FAC_QT_VBOXLAYOUT:
                                        layout = new QVBoxLayout();
                                        break;
                        }

                        currentLayout = tab->dias[i]->getRequiredLayout();
                        v = 0;
                }

                tab->dias[i]->setMe( wid,layout,v); 
                v+=tab->dias[i]->getSize();
        }
  
  wtab->addTab(wid,QString::fromUtf8(tab->title));
  for(int i=0;i<tab->nbElems;i++)
  {
    tab->dias[i]->finalize(); 
  }

  if (layout)
          vboxLayout->addLayout(layout);

  vboxLayout->addItem(spacerItem);
}
예제 #30
0
InstallOptionsDlgImpl::InstallOptionsDlgImpl( int flags, int verb, QWidget * parent, const char* name, bool modal, WFlags fl )
        : QDialog( parent, name, modal, fl )
{
    setCaption( tr( "Options" ) );

    QVBoxLayout *layout = new QVBoxLayout( this );
    layout->setMargin( 2 );
    layout->setSpacing( 4 );

    QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "Options" ), this );
    grpbox->layout()->setSpacing( 2 );
    grpbox->layout()->setMargin( 4 );
    layout->addWidget( grpbox );

    QVBoxLayout *grplayout = new QVBoxLayout( grpbox->layout() );

    forceDepends = new QCheckBox( tr( "Force Depends" ), grpbox );
    grplayout->addWidget( forceDepends );

    forceReinstall = new QCheckBox( tr( "Force Reinstall" ), grpbox );
    grplayout->addWidget( forceReinstall );

    forceRemove = new QCheckBox( tr( "Force Remove" ), grpbox );
    grplayout->addWidget( forceRemove );

    forceOverwrite = new QCheckBox( tr( "Force Overwrite" ), grpbox );
    grplayout->addWidget( forceOverwrite );

    QLabel *l = new QLabel( tr( "Information Level" ), grpbox );
    grplayout->addWidget( l );

    verboseIpkg = new QComboBox( grpbox );
    verboseIpkg->insertItem( tr( "Errors only" ) );
    verboseIpkg->insertItem( tr( "Normal messages" ) );
    verboseIpkg->insertItem( tr( "Informative messages" ) );
    verboseIpkg->insertItem( tr( "Troubleshooting output" ) );
    verboseIpkg->setCurrentItem( verb );
    grplayout->addWidget( verboseIpkg );

    grplayout->addItem( new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding ) );

    if ( flags & FORCE_DEPENDS )
        forceDepends->setChecked( true );
    if ( flags & FORCE_REINSTALL )
        forceReinstall->setChecked( true );
    if ( flags & FORCE_REMOVE )
        forceRemove->setChecked( true );
    if ( flags & FORCE_OVERWRITE )
        forceOverwrite->setChecked( true );
    //    if ( flags & VERBOSE_WGET )
    //    	verboseWget->setChecked( true );
    //    if ( flags & MAKE_LINKS )
    //    	makeLinks->setChecked( true );

    QPEApplication::showDialog( this );

}