本文整理汇总了C++中QBoxLayout::addLayout方法的典型用法代码示例。如果您正苦于以下问题:C++ QBoxLayout::addLayout方法的具体用法?C++ QBoxLayout::addLayout怎么用?C++ QBoxLayout::addLayout使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QBoxLayout
的用法示例。
在下文中一共展示了QBoxLayout::addLayout方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QWidget
NewGameView::NewGameView( QWidget *parent )
: QWidget( parent )
{
QBoxLayout *topLayout = new QVBoxLayout( this );
topLayout->setSpacing( 8 );
topLayout->setMargin( 8 );
topLayout->addStretch( 1 );
m_timesTableCheck = new QCheckBox( i18n("Times Table"), this );
topLayout->addWidget( m_timesTableCheck );
m_timesTableCheck->setChecked( true );
topLayout->addLayout( createRowChecks( m_multiplicationRowChecks ) );
m_divisionCheck = new QCheckBox( i18n("Division"), this );
topLayout->addWidget( m_divisionCheck );
topLayout->addLayout( createRowChecks( m_divisionRowChecks ) );
m_squareNumbersCheck = new QCheckBox( i18n("Square Numbers"), this );
topLayout->addWidget( m_squareNumbersCheck );
m_cubicNumbersCheck = new QCheckBox( i18n("Cubic Numbers"), this );
topLayout->addWidget( m_cubicNumbersCheck );
topLayout->addStretch( 1 );
QPushButton *startButton = new QPushButton( i18n("Start"), this );
topLayout->addWidget( startButton );
connect( startButton, SIGNAL( clicked() ), SLOT( slotStartClicked() ) );
topLayout->addStretch( 1 );
}
示例2: PopulateDeviceWidget
void GNumericalExpression::PopulateDeviceWidget(GDeviceWidget* theDeviceWidget)
{
QBoxLayout* pDeviceLayout = new QVBoxLayout();
theDeviceWidget->AddSubLayout(pDeviceLayout);
pDeviceLayout->setContentsMargins(1, 1, 1, 1);
pDeviceLayout->setSpacing(1);
QBoxLayout* pVariablesAndValueLayout = new QHBoxLayout();
QBoxLayout* pExpressionLayout = new QVBoxLayout();
pExpressionLayout->addWidget(m_Expression.ProvideNewParamLineEdit(theDeviceWidget));
pExpressionLayout->addWidget(m_Expression.ProvideNewLabel(theDeviceWidget));
pVariablesAndValueLayout->addWidget(m_VariableBucket.ProvideNewParamWidget(theDeviceWidget));
pVariablesAndValueLayout->addWidget(m_ValueBucket.ProvideNewParamWidget(theDeviceWidget));
// QPushButton* pSettingsButton = new QPushButton("Settings");
// GNumericalExpressionSettingsWidget* pSettingsWindow = new GNumericalExpressionSettingsWidget(this);
// connect(pSettingsButton, SIGNAL(clicked(bool)), pSettingsWindow, SLOT(show()));
// pVariablesAndValueLayout->insertWidget(1, pSettingsButton);
pDeviceLayout->addLayout(pExpressionLayout);
pDeviceLayout->addLayout(pVariablesAndValueLayout);
pDeviceLayout->addStretch();
}
示例3: QDialog
OdtDialog::OdtDialog(bool update, bool prefix, bool pack) : QDialog(0)
{
setModal(true);
setWindowIcon(QIcon(IconManager::instance()->loadIcon ( "AppIcon.png" )));
setWindowTitle( tr("OpenDocument Importer Options"));
QBoxLayout* layout = new QVBoxLayout(this);
layout->setMargin(0);
layout->setSpacing(0);
QBoxLayout* hlayout = new QHBoxLayout;
hlayout->setMargin(5);
hlayout->setSpacing(5);
updateCheck = new QCheckBox( tr("Overwrite Paragraph Styles"), this);
updateCheck->setChecked(update);
updateCheck->setToolTip( "<qt>" + tr("Enabling this will overwrite existing styles in the current Scribus document") + "</qt>");
hlayout->addWidget(updateCheck);
layout->addLayout(hlayout);
QBoxLayout* palayout = new QHBoxLayout;
palayout->setMargin(5);
palayout->setSpacing(5);
packCheck = new QCheckBox( tr("Merge Paragraph Styles"), this);
packCheck->setChecked(pack);
packCheck->setToolTip( "<qt>" + tr("Merge paragraph styles by attributes. This will result in fewer similar paragraph styles, will retain style attributes, even if the original document's styles are named differently.") +"</qt>");
palayout->addWidget(packCheck);
layout->addLayout(palayout);
QBoxLayout* playout = new QHBoxLayout;
playout->setMargin(5);
playout->setSpacing(5);
prefixCheck = new QCheckBox( tr("Use document name as a prefix for paragraph styles"), this);
prefixCheck->setChecked(prefix);
prefixCheck->setToolTip( "<qt>" + tr("Prepend the document name to the paragraph style name in Scribus") +"</qt>");
playout->addWidget(prefixCheck);
layout->addLayout(playout);
QBoxLayout* dlayout = new QHBoxLayout;
dlayout->setMargin(5);
dlayout->setSpacing(5);
doNotAskCheck = new QCheckBox( tr("Do not ask again"), this);
doNotAskCheck->setChecked(false);
doNotAskCheck->setToolTip( "<qt>" + tr("Make these settings the default and do not prompt again when importing an OASIS OpenDocument") +"</qt>");
//dlayout->addStretch(10);
dlayout->addWidget(doNotAskCheck);
layout->addLayout(dlayout);
QBoxLayout* blayout = new QHBoxLayout;
blayout->setMargin(5);
blayout->setSpacing(5);
blayout->addStretch(10);
okButton = new QPushButton( tr("OK"), this);
blayout->addWidget(okButton);
cancelButton = new QPushButton( tr("Cancel"), this);
blayout->addWidget(cancelButton);
layout->addLayout(blayout);
connect(okButton, SIGNAL(clicked()), this, SLOT(accept()));
connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
}
示例4: QVBoxLayout
QtContactEditWindow::QtContactEditWindow() : contactEditWidget_(NULL) {
resize(300,300);
setWindowTitle(tr("Edit contact"));
setContentsMargins(0,0,0,0);
QBoxLayout* layout = new QVBoxLayout(this);
jidLabel_ = new QLabel(this);
jidLabel_->setAlignment(Qt::AlignHCenter);
layout->addWidget(jidLabel_);
groupsLayout_ = new QVBoxLayout();
groupsLayout_->setContentsMargins(0,0,0,0);
layout->addLayout(groupsLayout_);
QHBoxLayout* buttonLayout = new QHBoxLayout();
layout->addLayout(buttonLayout);
QPushButton* removeButton = new QPushButton(tr("Remove contact"), this);
connect(removeButton, SIGNAL(clicked()), this, SLOT(handleRemoveContact()));
buttonLayout->addWidget(removeButton);
QPushButton* okButton = new QPushButton(tr("OK"), this);
connect(okButton, SIGNAL(clicked()), this, SLOT(handleUpdateContact()));
buttonLayout->addStretch();
buttonLayout->addWidget(okButton);
}
示例5: selectedOrgan
QmitkNewSegmentationDialog::QmitkNewSegmentationDialog(QWidget* parent)
:QDialog(parent), // true, modal
selectedOrgan("undefined"),
newOrganEntry(false)
{
QDialog::setFixedSize(250, 105);
QBoxLayout * verticalLayout = new QVBoxLayout( this );
verticalLayout->setMargin(5);
verticalLayout->setSpacing(5);
mitk::OrganTypeProperty::Pointer organTypes = mitk::OrganTypeProperty::New();
// to enter a name for the segmentation
lblPrompt = new QLabel( "Name and color of the segmentation", this );
verticalLayout->addWidget( lblPrompt );
// to choose a color
btnColor = new QPushButton( "", this );
btnColor->setFixedWidth(25);
btnColor->setAutoFillBackground(true);
btnColor->setStyleSheet("background-color:rgb(255,0,0)");
connect( btnColor, SIGNAL(clicked()), this, SLOT(onColorBtnClicked()) );
edtName = new QLineEdit( "", this );
QStringList completionList;
completionList << "";
completer = new QCompleter(completionList);
completer->setCaseSensitivity(Qt::CaseInsensitive);
edtName->setCompleter(completer);
connect( completer, SIGNAL(activated(const QString&)), this, SLOT(onColorChange(const QString&)) );
QBoxLayout * horizontalLayout2 = new QHBoxLayout();
verticalLayout->addLayout(horizontalLayout2);
horizontalLayout2->addWidget( btnColor );
horizontalLayout2->addWidget( edtName );
//buttons for closing the dialog
btnOk = new QPushButton( tr("Ok"), this );
btnOk->setDefault(true);
connect( btnOk, SIGNAL(clicked()), this, SLOT(onAcceptClicked()) );
QPushButton* btnCancel = new QPushButton( tr("Cancel"), this );
connect( btnCancel, SIGNAL(clicked()), this, SLOT(reject()) );
QBoxLayout * horizontalLayout = new QHBoxLayout();
verticalLayout->addLayout(horizontalLayout);
horizontalLayout->setSpacing(5);
horizontalLayout->addStretch();
horizontalLayout->addWidget( btnOk );
horizontalLayout->addWidget( btnCancel );
edtName->setFocus();
}
示例6: KDialogBase
AddresseeDialog::AddresseeDialog(QWidget *parent, bool multiple)
: KDialogBase(KDialogBase::Plain, i18n("Select Addressee"), Ok | Cancel, Ok, parent), mMultiple(multiple)
{
QWidget *topWidget = plainPage();
QBoxLayout *topLayout = new QHBoxLayout(topWidget);
QBoxLayout *listLayout = new QVBoxLayout;
topLayout->addLayout(listLayout);
mAddresseeList = new KListView(topWidget);
mAddresseeList->addColumn(i18n("Name"));
mAddresseeList->addColumn(i18n("Email"));
mAddresseeList->setAllColumnsShowFocus(true);
mAddresseeList->setFullWidth(true);
listLayout->addWidget(mAddresseeList);
connect(mAddresseeList, SIGNAL(doubleClicked(QListViewItem *)), SLOT(slotOk()));
connect(mAddresseeList, SIGNAL(selectionChanged(QListViewItem *)), SLOT(updateEdit(QListViewItem *)));
mAddresseeEdit = new KLineEdit(topWidget);
mAddresseeEdit->setCompletionMode(KGlobalSettings::CompletionAuto);
connect(mAddresseeEdit->completionObject(), SIGNAL(match(const QString &)), SLOT(selectItem(const QString &)));
mAddresseeEdit->setFocus();
mAddresseeEdit->completionObject()->setIgnoreCase(true);
listLayout->addWidget(mAddresseeEdit);
setInitialSize(QSize(450, 300));
if(mMultiple)
{
QBoxLayout *selectedLayout = new QVBoxLayout;
topLayout->addLayout(selectedLayout);
topLayout->setSpacing(spacingHint());
QGroupBox *selectedGroup = new QGroupBox(1, Horizontal, i18n("Selected"), topWidget);
selectedLayout->addWidget(selectedGroup);
mSelectedList = new KListView(selectedGroup);
mSelectedList->addColumn(i18n("Name"));
mSelectedList->addColumn(i18n("Email"));
mSelectedList->setAllColumnsShowFocus(true);
mSelectedList->setFullWidth(true);
connect(mSelectedList, SIGNAL(doubleClicked(QListViewItem *)), SLOT(removeSelected()));
QPushButton *unselectButton = new QPushButton(i18n("Unselect"), selectedGroup);
connect(unselectButton, SIGNAL(clicked()), SLOT(removeSelected()));
connect(mAddresseeList, SIGNAL(clicked(QListViewItem *)), SLOT(addSelected(QListViewItem *)));
setInitialSize(QSize(650, 350));
}
mAddressBook = StdAddressBook::self(true);
connect(mAddressBook, SIGNAL(addressBookChanged(AddressBook *)), SLOT(addressBookChanged()));
connect(mAddressBook, SIGNAL(loadingFinished(Resource *)), SLOT(addressBookChanged()));
loadAddressBook();
}
示例7: setLayout
BuildProgress::BuildProgress(TaskWindow *taskWindow, Qt::Orientation orientation)
: m_contentWidget(new QWidget),
m_errorIcon(new QLabel),
m_warningIcon(new QLabel),
m_errorLabel(new QLabel),
m_warningLabel(new QLabel),
m_taskWindow(taskWindow)
{
QHBoxLayout *contentLayout = new QHBoxLayout;
contentLayout->setContentsMargins(0, 0, 0, 0);
contentLayout->setSpacing(0);
setLayout(contentLayout);
contentLayout->addWidget(m_contentWidget);
QBoxLayout *layout;
if (orientation == Qt::Horizontal)
layout = new QHBoxLayout;
else
layout = new QVBoxLayout;
layout->setContentsMargins(8, 2, 0, 2);
layout->setSpacing(2);
m_contentWidget->setLayout(layout);
QHBoxLayout *errorLayout = new QHBoxLayout;
errorLayout->setSpacing(2);
layout->addLayout(errorLayout);
errorLayout->addWidget(m_errorIcon);
errorLayout->addWidget(m_errorLabel);
QHBoxLayout *warningLayout = new QHBoxLayout;
warningLayout->setSpacing(2);
layout->addLayout(warningLayout);
warningLayout->addWidget(m_warningIcon);
warningLayout->addWidget(m_warningLabel);
// ### TODO this setup should be done by style
QFont f = this->font();
f.setPointSizeF(Utils::StyleHelper::sidebarFontSize());
f.setBold(true);
m_errorLabel->setFont(f);
m_warningLabel->setFont(f);
m_errorLabel->setPalette(Utils::StyleHelper::sidebarFontPalette(m_errorLabel->palette()));
m_warningLabel->setPalette(Utils::StyleHelper::sidebarFontPalette(m_warningLabel->palette()));
m_errorIcon->setAlignment(Qt::AlignRight);
m_warningIcon->setAlignment(Qt::AlignRight);
m_errorIcon->setPixmap(QPixmap(Utils::StyleHelper::dpiSpecificImageFile(
QLatin1String(Core::Constants::ICON_ERROR))));
m_warningIcon->setPixmap(QPixmap(Utils::StyleHelper::dpiSpecificImageFile(
QLatin1String(Core::Constants::ICON_WARNING))));
m_contentWidget->hide();
connect(m_taskWindow, SIGNAL(tasksChanged()), this, SLOT(updateState()));
}
示例8: setLayout
BuildProgress::BuildProgress(TaskWindow *taskWindow, Qt::Orientation orientation) :
m_contentWidget(new QWidget),
m_errorIcon(new QLabel),
m_warningIcon(new QLabel),
m_errorLabel(new QLabel),
m_warningLabel(new QLabel),
m_taskWindow(taskWindow)
{
auto contentLayout = new QHBoxLayout;
contentLayout->setContentsMargins(0, 0, 0, 0);
contentLayout->setSpacing(0);
setLayout(contentLayout);
contentLayout->addWidget(m_contentWidget);
QBoxLayout *layout;
if (orientation == Qt::Horizontal)
layout = new QHBoxLayout;
else
layout = new QVBoxLayout;
layout->setContentsMargins(8, 2, 0, 2);
layout->setSpacing(2);
m_contentWidget->setLayout(layout);
auto errorLayout = new QHBoxLayout;
errorLayout->setSpacing(2);
layout->addLayout(errorLayout);
errorLayout->addWidget(m_errorIcon);
errorLayout->addWidget(m_errorLabel);
auto warningLayout = new QHBoxLayout;
warningLayout->setSpacing(2);
layout->addLayout(warningLayout);
warningLayout->addWidget(m_warningIcon);
warningLayout->addWidget(m_warningLabel);
// ### TODO this setup should be done by style
QFont f = this->font();
f.setPointSizeF(Utils::StyleHelper::sidebarFontSize());
f.setBold(true);
m_errorLabel->setFont(f);
m_warningLabel->setFont(f);
m_errorLabel->setPalette(Utils::StyleHelper::sidebarFontPalette(m_errorLabel->palette()));
m_warningLabel->setPalette(Utils::StyleHelper::sidebarFontPalette(m_warningLabel->palette()));
m_errorLabel->setProperty("_q_custom_style_disabled", QVariant(true));
m_warningLabel->setProperty("_q_custom_style_disabled", QVariant(true));
m_errorIcon->setAlignment(Qt::AlignRight);
m_warningIcon->setAlignment(Qt::AlignRight);
m_errorIcon->setPixmap(Utils::Icons::CRITICAL_TOOLBAR.pixmap());
m_warningIcon->setPixmap(Utils::Icons::WARNING_TOOLBAR.pixmap());
m_contentWidget->hide();
connect(m_taskWindow.data(), &TaskWindow::tasksChanged, this, &BuildProgress::updateState);
}
示例9: QWidget
NHypersurfaceCreator::NHypersurfaceCreator() {
// Set up the basic layout.
ui = new QWidget();
QBoxLayout* layout = new QVBoxLayout(ui);
QBoxLayout* coordArea = new QHBoxLayout();
layout->addLayout(coordArea);
QString expln = ui->tr("Specifies the coordinate system in which the "
"normal hypersurfaces will be enumerated.");
QLabel* label = new QLabel(ui->tr("Coordinate system:"), ui);
label->setWhatsThis(expln);
coordArea->addWidget(label);
coords = new HyperCoordinateChooser();
coords->insertAllCreators();
coords->setCurrentSystem(
ReginaPrefSet::global().hypersurfacesCreationCoords);
coords->setWhatsThis(expln);
coordArea->addWidget(coords, 1);
QBoxLayout* basisArea = new QHBoxLayout();
layout->addLayout(basisArea);
expln = ui->tr("<qt>Specifies whether to enumerate only "
"vertex hypersurfaces (at extremal rays of the normal hypersurface "
"solution cone), or all fundamental surfaces (which form a Hilbert "
"basis for the solution cone).<p>Fundamental surfaces are "
"more numerous, and can be significantly slower to enumerate.</qt>");
label = new QLabel(ui->tr("Enumerate:"), ui);
label->setWhatsThis(expln);
basisArea->addWidget(label);
basis = new QComboBox(ui);
// These insertions MUST happen in the same order in which the
// BASIS_... constants are defined at the top of this file.
basis->insertItem(BASIS_VERTEX, ui->tr("Vertex hypersurfaces"));
basis->insertItem(BASIS_FUND, ui->tr("Fundamental hypersurfaces"));
basis->setCurrentIndex(
ReginaPrefSet::global().hypersurfacesCreationList.has(
regina::HS_FUNDAMENTAL) ? BASIS_FUND : BASIS_VERTEX);
basis->setWhatsThis(expln);
basisArea->addWidget(basis, 1);
embedded = new QCheckBox(ui->tr("Embedded hypersurfaces only"), ui);
embedded->setChecked(
! ReginaPrefSet::global().hypersurfacesCreationList.has(
regina::HS_IMMERSED_SINGULAR));
embedded->setWhatsThis(ui->tr("Specifies whether only embedded "
"normal hypersurfaces should be enumerated, or whether all normal "
"hypersurfaces (embedded, immersed and singular) should be "
"enumerated."));
layout->addWidget(embedded);
}
示例10: QDialog
setTransformDialog::setTransformDialog(QWidget *parent)
: QDialog(parent)
{
QBoxLayout *layout = new QVBoxLayout;
QBoxLayout *layout1 = new QHBoxLayout;
QBoxLayout *layout2 = new QHBoxLayout;
QBoxLayout *layout3 = new QHBoxLayout;
QBoxLayout *layout4 = new QHBoxLayout;
label_Root = new QLabel("Root Tile:");
label_Width = new QLabel("Image Width:");
label_Height = new QLabel("Image Height:");
Edit_Root = new QLineEdit;
Edit_Width = new QLineEdit;
Edit_Height = new QLineEdit;
Edit_Root->setValidator(new QDoubleValidator(0.0,
10000.0, 3, Edit_Root));
Edit_Width->setValidator(new QDoubleValidator(0.0,
10000.0, 3, Edit_Width));
Edit_Height->setValidator(new QDoubleValidator(0.0,
10000.0, 3, Edit_Height));
okButton = new QPushButton("Ok", this);
cancelButton = new QPushButton("Cancel", this);
connect(okButton, SIGNAL(clicked()), this, SLOT(accept()));
connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
layout1->addWidget(label_Root);
layout1->addWidget(Edit_Root);
layout2->addWidget(label_Width);
layout2->addWidget(Edit_Width);
layout3->addWidget(label_Height);
layout3->addWidget(Edit_Height);
layout4->addWidget(okButton);
layout4->addWidget(cancelButton);
layout->addLayout(layout1);
layout->addLayout(layout2);
layout->addLayout(layout3);
layout->addLayout(layout4);
Root = 0;
Width = 0;
Height = 0;
setLayout(layout);
}
示例11: tr
gtImporterDialog::gtImporterDialog(const QStringList& importers, int currentSelection)
{
setWindowTitle( tr("Choose the importer to use"));
setWindowIcon(IconManager::instance()->loadIcon("AppIcon.png"));
QBoxLayout* layout = new QVBoxLayout(this);
QBoxLayout* llayout = new QHBoxLayout;
llayout->setMargin(5);
llayout->setSpacing(5);
QLabel* label = new QLabel( tr("Choose the importer to use"), this);
llayout->addWidget(label);
layout->addLayout(llayout);
QBoxLayout* ilayout = new QHBoxLayout;
ilayout->setMargin(5);
ilayout->setSpacing(5);
importerCombo = new ScComboBox(this);
importerCombo->setMinimumSize(QSize(150, 0));
importerCombo->setToolTip( tr("Choose the importer to use"));
importerCombo->addItems(importers);
if (static_cast<int>(importers.count()) > currentSelection)
importerCombo->setCurrentIndex(currentSelection);
else
importerCombo->setCurrentIndex(0);
ilayout->addWidget(importerCombo);
layout->addLayout(ilayout);
QBoxLayout* dlayout = new QHBoxLayout;
dlayout->setMargin(5);
dlayout->setSpacing(5);
rememberCheck = new QCheckBox( tr("Remember association"), this);
rememberCheck->setChecked(false);
rememberCheck->setToolTip( "<qt>" + tr("Remember the file extension - importer association and do not ask again to select an importer for files of this type.") + "</qt>" );
dlayout->addStretch(10);
dlayout->addWidget(rememberCheck);
layout->addLayout(dlayout);
QBoxLayout* blayout = new QHBoxLayout;
blayout->setMargin(5);
blayout->setSpacing(5);
blayout->addStretch(10);
okButton = new QPushButton( CommonStrings::tr_OK, this);
blayout->addWidget(okButton);
layout->addLayout(blayout);
connect(okButton, SIGNAL(clicked()), this, SLOT(accept()));
}
示例12: setupUi
void SurveyEditorGeneratorPage::setupUi()
{
QBoxLayout * vlayout = new QVBoxLayout();
QBoxLayout * infolayout = new QVBoxLayout();
QBoxLayout * hlayout = new QHBoxLayout();
QToolBar * toolbar = new QToolBar(this);
toolbar->setIconSize( QSize(48,48) );
toolbar->addAction(QIcon(global::R.getValue("icon/scripteditorrun")),
tr("Run Script"),
this,SLOT(onActionRunScript()));
Overlay * o =mScriptView->overlay();
o->setMovie( new QMovie( global::R.getValue("animation/loading") ));
o->movie()->start();
o->hide();
mDescriptionEdit = new PlainTextEdit(this);
mDescriptionEdit->overlay()->setText( tr("Description") );
mDescriptionEdit->setToolTip( mDescriptionEdit->overlay()->text() );
mDescriptionEdit->setReadOnly(true);
mAuthorEdit = new LineEdit(this);
mAuthorEdit->overlay()->setText( tr("Author") );
mAuthorEdit->setToolTip( mAuthorEdit->overlay()->text() );
mAuthorEdit->setReadOnly(true);
mVersionEdit = new LineEdit(this);
mVersionEdit->overlay()->setText( tr("Version") );
mVersionEdit->setToolTip( mVersionEdit->overlay()->text() );
mVersionEdit->setReadOnly(true);
vlayout->addWidget(toolbar);
hlayout->addWidget(mScriptView);
infolayout->addWidget(mDescriptionEdit);
infolayout->addWidget(mAuthorEdit);
infolayout->addWidget(mVersionEdit);
infolayout->addStretch();
hlayout->addLayout(infolayout);
vlayout->addLayout(hlayout);
setLayout(vlayout);
updateScriptList();
}
示例13: QDialog
KarmadromeConfigDialog::KarmadromeConfigDialog( QWidget *parent, Qt::WindowFlags flags )
: QDialog( parent, flags )
, mpGlobalConfigWidget( new GlobalConfigWidget( this ) )
, mpNumColumnsLabel( new QLabel( tr("Number Of Columns"), this ) )
, mpNumColumns( new QSpinBox( this ) )
, mpClearBeforeImport( new QCheckBox( tr("Clear Group Before Import"), this ) )
, mpExportAsRelative( new QCheckBox( tr("Export m3u With Relative Entries"), this ) )
, mpRandomizeExport( new QCheckBox( tr("Randomize Output Of Export m3u"), this ) )
, mpUseCheckBoxes( new QCheckBox( tr("Use Checkboxes Instead Of Buttons For Groups"), this ) )
{
setWindowTitle( QApplication::applicationName() + ": " + tr("Settings") );
setWindowIcon( QIcon( ":/Karmadrome/Icon.png" ) );
mpNumColumns->setRange( 1, 9 );
AboutWidget *about = new AboutWidget( this );
mpGlobalConfigWidget->showClipboard();
QWidget *kmdTab = new QWidget( this );
QGridLayout *kmdLayout = new QGridLayout( kmdTab );
kmdLayout->addWidget( mpNumColumnsLabel, 0, 0 );
kmdLayout->addWidget( mpNumColumns, 0, 1 );
kmdLayout->addWidget( mpClearBeforeImport, 1, 0, 1, 2 );
kmdLayout->addWidget( mpExportAsRelative, 2, 0, 1, 2 );
kmdLayout->addWidget( mpRandomizeExport, 3, 0, 1, 2 );
kmdLayout->addWidget( mpUseCheckBoxes, 4, 0, 1, 2 );
kmdLayout->setRowStretch( 5, 1 );
kmdTab->setLayout( kmdLayout );
QPushButton *okButton = new QPushButton( tr("OK"), this );
QPushButton *cancelButton = new QPushButton( tr("Cancel"), this );
QHBoxLayout *buttonLayout = new QHBoxLayout;
buttonLayout->addWidget( okButton );
buttonLayout->addWidget( cancelButton );
QBoxLayout *mainLayout = new QVBoxLayout( this );
QTabWidget *tabs = new QTabWidget( this );
tabs->addTab( kmdTab, tr("Karmadrome") );
tabs->addTab( mpGlobalConfigWidget, tr("Global") );
mainLayout->addWidget( about );
mainLayout->addWidget( tabs );
mainLayout->addLayout( buttonLayout );
setLayout( mainLayout );
connect( okButton, SIGNAL(clicked()),
this, SLOT(accept()) );
connect( cancelButton, SIGNAL(clicked()),
this, SLOT(reject()) );
connect( this, SIGNAL(accepted()),
this, SLOT(writeSettings()) );
connect( this, SIGNAL(rejected()),
this, SLOT(readSettings()) );
readSettings();
WidgetShot::addWidget( "Config", this );
}
示例14: QWidget
SettingsWidget::SettingsWidget( MainModel *model, QWidget *parent)
: QWidget( parent ), m_model( model )
{
QBoxLayout *topLayout = new QVBoxLayout( this );
QBoxLayout *controlLayout = new QHBoxLayout;
topLayout->addLayout( controlLayout );
m_syncingCheck = new QCheckBox( i18n("Syncing enabled") );
controlLayout->addWidget( m_syncingCheck );
connect( m_syncingCheck, SIGNAL( stateChanged( int ) ),
SLOT( slotSyncingCheckChanged() ) );
QLabel *label = new QLabel;
controlLayout->addWidget( label );
connect( m_model, SIGNAL( syncingStatusChanged( const QString & ) ),
label, SLOT( setText( const QString & ) ) );
controlLayout->addStretch( 1 );
QPushButton *button = new QPushButton( i18n("Hide Settings") );
controlLayout->addWidget( button );
connect( button, SIGNAL( clicked() ), SLOT( hide() ) );
readConfig();
}
示例15: QWidget
RedditBrowser::RedditBrowser(RedditStory story_, QVariantHash& history_)
: QWidget(NULL),
story(story_),
showingComments(false),
firstShow(true),
history(history_),
loading(false),
frame(-1)
{
webview = new QWebView(this);
url = new QLineEdit(this);
toggle = new QPushButton("Show Comments", this);
openInBrowser = new QPushButton("Open In Browser", this);
QBoxLayout* topLayout = new QBoxLayout(QBoxLayout::LeftToRight);
topLayout->addWidget(url);
topLayout->addWidget(toggle);
topLayout->addWidget(openInBrowser);
QBoxLayout* mainLayout = new QBoxLayout(QBoxLayout::TopToBottom, this);
mainLayout->addLayout(topLayout);
mainLayout->addWidget(webview);
setLayout(mainLayout);
connect(toggle, SIGNAL(clicked()), this, SLOT(switchView()));
connect(openInBrowser, SIGNAL(clicked()), this, SLOT(openBrowser()));
connect(webview, SIGNAL(loadFinished(bool)), this, SLOT(loadFinishedInt(bool)));
connect(webview, SIGNAL(loadStarted()), this, SLOT(loadStartedInt()));
connect(webview, SIGNAL(urlChanged(const QUrl&)), this, SLOT(urlChanged(const QUrl&)));
webview->load(QUrl(story.link));
url->setText(story.link);
}