本文整理汇总了C++中QVBox::setMargin方法的典型用法代码示例。如果您正苦于以下问题:C++ QVBox::setMargin方法的具体用法?C++ QVBox::setMargin怎么用?C++ QVBox::setMargin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QVBox
的用法示例。
在下文中一共展示了QVBox::setMargin方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: end
XineConfig::XineConfig(const xine_t* const xine) :
KDialogBase(KDialogBase::IconList, i18n("xine Engine Parameters"),
KDialogBase::Ok|KDialogBase::Apply|KDialogBase::Cancel, KDialogBase::Cancel)
{
setInitialSize(QSize(650,500), true);
m_xine = (xine_t*)xine;
QStringList cats = getCategories();
QTabWidget* tabWidget = NULL;
QFrame* xineFrame = NULL;
QVBoxLayout* xineLayout = NULL;
QVBox* xineBeginnerPage = NULL;
QVBox* xineExpertPage = NULL;
QString icon;
QStringList::ConstIterator end ( cats.end());
for (QStringList::ConstIterator it = cats.begin(); it != end; ++it)
{
// kdDebug() << "XineConfig: add page: " << *it << endl;
if (*it == "audio")
icon = "sound";
else if (*it == "video")
icon = "video";
else if (*it == "vcd")
icon = "cdrom_unmount";
else if (*it == "input")
icon = "connect_established";
else if (*it == "effects")
icon = "wizard";
else if (*it == "media")
icon = "cdrom_unmount";
else if (*it == "subtitles")
icon = "font_bitmap";
else if (*it == "osd")
icon = "font_bitmap";
else if (*it == "engine")
icon = "exec";
else
icon = "edit";
xineFrame = addPage(*it, i18n("%1 Options").arg(*it), KGlobal::iconLoader()->loadIcon(icon, KIcon::Panel,
KIcon::SizeMedium));
xineLayout = new QVBoxLayout(xineFrame, marginHint(), spacingHint());
tabWidget = new QTabWidget(xineFrame);
xineLayout->addWidget(tabWidget);
xineBeginnerPage = new QVBox(tabWidget);
xineBeginnerPage->setMargin(5);
tabWidget->addTab(xineBeginnerPage, i18n("Beginner Options"));
createPage(*it, false, xineBeginnerPage);
xineExpertPage = new QVBox(tabWidget);
xineExpertPage->setMargin(5);
tabWidget->addTab(xineExpertPage, i18n("Expert Options"));
createPage(*it, true, xineExpertPage);
}
connect(this, SIGNAL(okClicked()), SLOT(slotOkPressed()));
connect(this, SIGNAL(applyClicked()), SLOT(slotApplyPressed()));
}
示例2: KSeparator
KHLogin::KHLogin(QWidget *parent ) : KDialogBase(parent, "KHLogin", true, i18n("Log in"), User1 |KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, true)
{
QVBox *page = makeVBoxMainWidget();
page->setMargin(5);
page->setLineWidth(4);
page->setMidLineWidth(4);
page->setFrameStyle (QFrame::Box | QFrame::Raised );
QVGroupBox *m_container = new QVGroupBox(i18n("Select your player"),page);
m_selector = new KHSelectUser(m_container);
m_selector->readPlayers(true);
connect(m_selector, SIGNAL(playerSelected()), this, SLOT(setPlayerInformation()));
QVBox *m_infoBox = new QVBox(m_container);
m_labelName = new QLabel(i18n("Name: "), m_container);
m_labelElo = new QLabel(i18n("Elo: "), m_container);
m_labelType = new QLabel(i18n("Type: "), m_container);
new KSeparator(m_container);
new QLabel(i18n("Login"), m_container);
m_login = new KLineEdit(m_container);
new QLabel(i18n("Password"), m_container);
m_password = new KLineEdit(m_container);
setModal(true);
setButtonGuiItem (KDialogBase::User1, KGuiItem( i18n("Create a new user"), SmallIcon("penguin"), i18n("Click to create new user"), i18n("Clicking this button you can create a new user") ));
hide();
}
示例3: KDialogBase
ConfigDlg::ConfigDlg(QWidget *parent, const char *name)
: KDialogBase(KDialogBase::TreeList, WStyle_DialogBorder, parent, name, true, "Settings", KDialogBase::Ok|KDialogBase::Cancel)
{
setShowIconsInTreeList(true);
setMinimumSize(600,400);
enableButtonSeparator(true);
unfoldTreeList();
QVBox *frame;
QStringList path;
path << i18n("Languages");
setFolderIcon(path, BarIcon("protoeditor", KIcon::SizeSmall));
QValueList<LanguageSettings*> llist = Protoeditor::self()->settings()->languageSettingsList();
QValueList<LanguageSettings*>::iterator it;
for(it = llist.begin(); it != llist.end(); ++it)
{
path.clear();
path << i18n("Languages") << (*it)->languageName();
frame = addVBoxPage(path, (*it)->languageName(), BarIcon((*it)->iconName(), KIcon::SizeSmall));
frame->setSpacing(0);
frame->setMargin(0);
m_langSettingsWidgets.append((*it)->createSettingsWidget(frame));
}
path.clear();
path << i18n("Sites");
frame= addVBoxPage(path, i18n("Sites"), BarIcon("package_network", KIcon::SizeSmall));
frame->setSpacing(0);
frame->setMargin(0);
m_siteSettingsWidget = new SiteSettingsWidget(frame);//->reparent(((QWidget*)frame), 0, QPoint());
path.clear();
path << i18n("External Applications");
frame = addVBoxPage(path, i18n("External Applications"), BarIcon("gear", KIcon::SizeSmall));
frame->setSpacing(0);
frame->setMargin(0);
m_extAppSettingsWidget = new ExtAppSettingsWidget(frame, i18n("External Applications"));//->reparent(((QWidget*)frame), 0, QPoint());
resize(QSize(590, 300).expandedTo(minimumSizeHint()));
}
示例4: QDialog
KReferDialog::KReferDialog( KPhoneView * phv,int kcwn,QString uPrefix,QWidget *parent, const char *name )
: QDialog( parent, name, true )
{
phoneView=phv;
kcwNumber= kcwn;
userPrefix=uPrefix;
phoneBook = 0;
QVBox *vbox = new QVBox( this );
vbox->setMargin( 3 );
vbox->setSpacing( 3 );
QVBoxLayout *vboxl = new QVBoxLayout( this, 5 );
vboxl->addWidget( vbox );
(void) new QLabel( tr("Refer-to URI:"), vbox );
touri = new QLineEdit( vbox );
touri->setMinimumWidth( fontMetrics().maxWidth() * 20 );
QHBoxLayout *buttonBox;
buttonBox = new QHBoxLayout( vboxl, 6 );
loadUri = new QPushButton( "", this );
QIconSet icon;
icon.setPixmap(SHARE_DIR "/icons/phonebook.png", QIconSet::Automatic );
loadUri->setIconSet( icon );
loadUri->setFixedWidth( loadUri->fontMetrics().maxWidth() * 2 );
buttonBox->addWidget( loadUri );
helpPushButton = new QPushButton( this, tr("help button") );
helpPushButton->setText( tr("&help...") );
helpPushButton->setEnabled( FALSE );
buttonBox->addWidget( helpPushButton );
QSpacerItem *spacer = new QSpacerItem(
0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
buttonBox->addItem( spacer );
okPushButton = new QPushButton( this, tr("ok button") );
okPushButton->setText( "OK" );
okPushButton->setDefault( TRUE );
buttonBox->addWidget( okPushButton );
cancelPushButton = new QPushButton( this,tr( "cancel button") );
cancelPushButton->setText( tr("Cancel") );
cancelPushButton->setAccel( Key_Escape );
buttonBox->addWidget( cancelPushButton );
connect( loadUri, SIGNAL( clicked() ),
this, SLOT( getUri() ) );
connect( okPushButton, SIGNAL( clicked() ),
this, SLOT( slotOk() ) );
connect( cancelPushButton, SIGNAL( clicked() ),
this, SLOT( slotCancel() ) );
}
示例5: cfg
NotesControl::NotesControl( QWidget *, const char * )
: QVBox( 0, "NotesControl",/* WDestructiveClose | */WStyle_StaysOnTop )
// : QFrame( parent, name, WDestructiveClose | WStyle_StaysOnTop | WType_Popup )
{
Config cfg("Notes");
cfg.setGroup("Options");
m_showMax = cfg.readBoolEntry("ShowMax", false);
setFrameStyle( QFrame::PopupPanel | QFrame::Raised );
m_loaded = false;
m_edited = false;
QVBox *vbox = new QVBox( this, "Vlayout" );
QHBox *hbox = new QHBox( this, "HLayout" );
m_editArea = new QMultiLineEdit( vbox, "OpieNotesView" );
m_notesList = new QListBox( vbox, "OpieNotesBox" );
QPEApplication::setStylusOperation( m_notesList->viewport(), QPEApplication::RightOnHold );
m_notesList->setFixedHeight( 50 );
vbox->setMargin( 6 );
vbox->setSpacing( 3 );
setFocusPolicy(QWidget::StrongFocus);
newButton = new QPushButton( hbox, "newButton" );
newButton->setText(tr("New"));
saveButton = new QPushButton( hbox, "saveButton" );
saveButton->setText(tr("Save"));
deleteButton = new QPushButton( hbox, "deleteButton" );
deleteButton->setText(tr("Delete"));
connect( m_notesList, SIGNAL( mouseButtonPressed(int,QListBoxItem*,const QPoint&)),
this,SLOT( boxPressed(int,QListBoxItem*,const QPoint&)) );
connect( m_notesList, SIGNAL(highlighted(const QString&)), this, SLOT(slotBoxSelected(const QString&)));
connect( &menuTimer, SIGNAL( timeout() ), SLOT( showMenu() ) );
connect( m_editArea,SIGNAL( textChanged() ), this, SLOT(slotViewEdited() ) );
connect( newButton, SIGNAL(clicked()), this, SLOT(slotNewButton()) );
connect( saveButton, SIGNAL(clicked()), this, SLOT(slotSaveButton()) );
connect( deleteButton, SIGNAL(clicked()), this, SLOT(slotDeleteButton()) );
m_selected = -1;
setCaption("Notes");
}
示例6: QVBox
QWidget * DataRecorderChannelBoolean::getPropertyWidget(QWidget * parent, const char * name)
{
if (!m_propertyWidget)
{
// Setup widget
QVBox * widget = new QVBox(parent,name);
Q_CHECK_PTR(widget);
widget->setMargin(KDialog::marginHint());
widget->setSpacing(KDialog::spacingHint());
QLabel * lab;
lab = new QLabel(i18n("DataRecorder", "Channel:"), widget);
Q_CHECK_PTR(lab);
KSimLineEdit * conName;
conName = new KSimLineEdit(widget);
Q_CHECK_PTR(conName);
conName->setText(getConnector()->getName());
connect(getConnector(), SIGNAL(signalSetName(const QString &)), conName, SLOT(setText(const QString &)));
connect(conName, SIGNAL(changed(const QString &)), SLOT(setChannelName(const QString &)));
lab->setBuddy(conName);
// TODO add ToolTip
ChannelPositionWidget * pos;
pos = new ChannelPositionWidget(this, widget);
Q_CHECK_PTR(pos);
pos->setGainValue(getVerticalGain());
pos->setOffsetValue(getVerticalOffset());
connect(pos, SIGNAL(gainChanged(double)), SLOT(setVerticalGain(double)));
connect(pos, SIGNAL(offsetChanged(double)), SLOT(setVerticalOffset(double)));
KColorButton * color = new KColorButton(widget);
Q_CHECK_PTR(color);
color->setColor(getLineColor());
connect(color, SIGNAL(changed(const QColor &)), SLOT(setLineColor(const QColor &)));
m_propertyWidget = widget;
}
else
{
if (parent)
{
KSIMDEBUG("Only one widget allowed");
}
}
return m_propertyWidget;
}
示例7: showTryLaterMessageBox
void KBabelView::showTryLaterMessageBox()
{
if( !_showTryLaterBox ) return;
KDialogBase *dialog= new KDialogBase(
i18n("Information"),
KDialogBase::Yes,
KDialogBase::Yes, KDialogBase::Yes,
this, "information", true, true,
KStdGuiItem::ok() );
QVBox *topcontents = new QVBox (dialog);
topcontents->setSpacing(KDialog::spacingHint()*2);
topcontents->setMargin(KDialog::marginHint()*2);
QWidget *contents = new QWidget(topcontents);
QHBoxLayout * lay = new QHBoxLayout(contents);
lay->setSpacing(KDialog::spacingHint()*2);
lay->addStretch(1);
QLabel *label1 = new QLabel( contents);
label1->setPixmap(QMessageBox::standardIcon(QMessageBox::Information));
lay->add( label1 );
QLabel *label2 = new QLabel( i18n("The search string has not been found yet.\n"
"However, the string might be found "
"in the files being searched at the moment.\n"
"Please try later."), contents);
label2->setAlignment( Qt::AlignAuto | Qt::AlignVCenter | Qt::ExpandTabs | Qt::WordBreak );
label2->setMinimumSize(label2->sizeHint());
lay->add( label2 );
lay->addStretch(1);
QCheckBox *checkbox = new QCheckBox(i18n("Do not show in this find/replace session again"), topcontents);
dialog->setMainWidget(topcontents);
dialog->enableButtonSeparator(false);
dialog->incInitialSize( QSize(50,0) );
dialog->exec();
_showTryLaterBox = !checkbox->isChecked();
delete dialog;
}
示例8: sizePolicy
GeneralSettingsPage::GeneralSettingsPage(QWidget* parent) :
SettingsPageBase(parent),
m_homeURL(0),
m_startSplit(0),
m_startEditable(0)
{
QVBoxLayout* topLayout = new QVBoxLayout(parent, 2, KDialog::spacingHint());
const int spacing = KDialog::spacingHint();
const int margin = KDialog::marginHint();
const QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
DolphinSettings& settings = DolphinSettings::instance();
QVBox* vBox = new QVBox(parent);
vBox->setSizePolicy(sizePolicy);
vBox->setSpacing(spacing);
vBox->setMargin(margin);
vBox->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Ignored);
// create 'Home URL' editor
QGroupBox* homeGroup = new QGroupBox(1, Qt::Horizontal, i18n("Home URL"), vBox);
homeGroup->setSizePolicy(sizePolicy);
homeGroup->setMargin(margin);
QHBox* homeURLBox = new QHBox(homeGroup);
homeURLBox->setSizePolicy(sizePolicy);
homeURLBox->setSpacing(spacing);
new QLabel(i18n("Location:"), homeURLBox);
m_homeURL = new QLineEdit(settings.homeURL().prettyURL(), homeURLBox);
QPushButton* selectHomeURLButton = new QPushButton(SmallIcon("folder"), QString::null, homeURLBox);
connect(selectHomeURLButton, SIGNAL(clicked()),
this, SLOT(selectHomeURL()));
QHBox* buttonBox = new QHBox(homeGroup);
buttonBox->setSizePolicy(sizePolicy);
buttonBox->setSpacing(spacing);
QPushButton* useCurrentButton = new QPushButton(i18n("Use current location"), buttonBox);
connect(useCurrentButton, SIGNAL(clicked()),
this, SLOT(useCurrentLocation()));
QPushButton* useDefaultButton = new QPushButton(i18n("Use default location"), buttonBox);
connect(useDefaultButton, SIGNAL(clicked()),
this, SLOT(useDefaulLocation()));
// create 'Default View Mode' group
QButtonGroup* buttonGroup = new QButtonGroup(3, Qt::Vertical, i18n("Default View Mode"), vBox);
buttonGroup->setSizePolicy(sizePolicy);
buttonGroup->setMargin(margin);
m_iconsView = new QRadioButton(i18n("Icons"), buttonGroup);
m_detailsView = new QRadioButton(i18n("Details"), buttonGroup);
m_previewsView = new QRadioButton(i18n("Previews"), buttonGroup);
switch (settings.defaultViewMode()) {
case DolphinView::IconsView: m_iconsView->setChecked(true); break;
case DolphinView::DetailsView: m_detailsView->setChecked(true); break;
case DolphinView::PreviewsView: m_previewsView->setChecked(true); break;
}
// create 'Start with split view' checkbox
m_startSplit = new QCheckBox(i18n("Start with split view"), vBox);
m_startSplit->setChecked(settings.isViewSplit());
// create 'Start with editable navigation bar' checkbox
m_startEditable = new QCheckBox(i18n("Start with editable navigation bar"), vBox);
m_startEditable->setChecked(settings.isURLEditable());
// create 'Save view properties for each folder' checkbox
m_saveView = new QCheckBox(i18n("Save view properties for each folder"), vBox);
m_saveView->setChecked(settings.isSaveView());
// Add a dummy widget with no restriction regarding
// a vertical resizing. This assures that the dialog layout
// is not stretched vertically.
new QWidget(vBox);
topLayout->addWidget(vBox);
}
示例9: setupCentralWidget
void SimpleUI::setupCentralWidget()
{
QVBox *npWidget = new QVBox( this );
npWidget->setMargin( 0 );
npWidget->setSpacing( 0 );
positionLabel = new QLabel( statusBar() );
positionLabel->setAlignment( AlignVCenter | AlignCenter );
positionLabel->setFixedSize( fontMetrics().size( 0, " 00:00/00:00 " ) );
statusBar()->addWidget( positionLabel, 0, true );
video = new VideoFrame( npWidget );
connect( video, SIGNAL(adaptSize(int,int)),
SLOT(slotAdaptSize(int,int)) );
connect( video, SIGNAL(rightButtonPressed(const QPoint &)),
SLOT(slotContextMenu(const QPoint &)) );
QHBox *ctlFrame = new QHBox( npWidget );
ctlFrame->setFixedHeight( 38 );
ctlFrame->setFrameShape( QFrame::StyledPanel );
ctlFrame->setFrameShadow( QFrame::Raised );
ctlFrame->setMargin( 6 );
ctlFrame->setSpacing( 6 );
QPushButton *backButton = new QPushButton( ctlFrame );
backButton->setFixedSize( 24, 24 );
backButton->setPixmap( QPixmap( back_xpm ) );
QToolTip::add( backButton, i18n("Back") );
connect( backButton, SIGNAL(clicked()), napp->player(), SLOT(back()) );
stopButton = new QPushButton( ctlFrame );
stopButton->setFixedSize( 24, 24 );
stopButton->setPixmap( QPixmap( stop_xpm ) );
QToolTip::add( stopButton, i18n("Stop") );
connect( stopButton, SIGNAL(clicked()), napp->player(), SLOT(stop()) );
playButton = new QPushButton( ctlFrame );
playButton->setFixedSize( 24, 24 );
playButton->setPixmap( QPixmap( play_xpm ) );
QToolTip::add( playButton, i18n("Play / Pause") );
connect( playButton, SIGNAL(clicked()), napp->player(), SLOT(playpause()) );
QPushButton *forwButton = new QPushButton( ctlFrame );
forwButton->setFixedSize( 24, 24 );
forwButton->setPixmap( QPixmap( forward_xpm ) );
QToolTip::add( forwButton, i18n("Forward") );
connect( forwButton, SIGNAL(clicked()), napp->player(), SLOT(forward()) );
slider = new L33tSlider( 0, 1000, 10, 0, L33tSlider::Horizontal, ctlFrame );
slider->setFixedHeight( 24 );
slider->setMinimumWidth( 100 );
slider->setTickmarks( QSlider::NoMarks );
connect( slider, SIGNAL(userChanged(int)), SLOT(slotSkipTo(int)) );
connect( slider, SIGNAL(sliderMoved(int)), SLOT(slotSliderMoved(int)) );
QPushButton *playlistButton = new QPushButton( ctlFrame );
playlistButton->setFixedSize( 24, 24 );
playlistButton->setPixmap( QPixmap( playlist_xpm ) );
QToolTip::add( playlistButton, i18n("Playlist") );
connect( playlistButton, SIGNAL(clicked()), napp->player(), SLOT(toggleListView()) );
volumeButton = new QPushButton( ctlFrame );
volumeButton->setFixedSize( 24, 24 );
volumeButton->setPixmap( QPixmap( volume_xpm ) );
QToolTip::add( volumeButton, i18n("Volume") );
volumeFrame = new QVBox( this, "Volume", WStyle_Customize | WType_Popup );
volumeFrame->setFrameStyle( QFrame::PopupPanel );
volumeFrame->setMargin( 4 );
volumeLabel = new QLabel( volumeFrame );
volumeLabel->setText( "100%" );
volumeLabel->setAlignment( AlignCenter );
volumeLabel->setFixedSize( volumeLabel->sizeHint() );
QHBox *volumeSubFrame = new QHBox( volumeFrame );
volumeSlider = new L33tSlider( 0, 100, 10, 0, Vertical, volumeSubFrame );
volumeSlider->setValue( 100 - napp->player()->volume() );
volumeSlider->setFixedSize( volumeSlider->sizeHint() );
volumeFrame->resize( volumeFrame->sizeHint() );
connect( volumeSlider, SIGNAL(sliderMoved(int)), SLOT(slotVolumeSliderMoved(int)) );
connect( volumeSlider, SIGNAL(userChanged(int)), SLOT(slotVolumeSliderMoved(int)) );
connect( volumeButton, SIGNAL(clicked()), SLOT(slotVolumeFrame()) );
setCentralWidget( npWidget );
video->setMinimumSize( minimumSizeHint().width(), 1 );
// Create properties dialog
propertiesDialog = new PropertiesDialog( this );
propertiesDialog->resize( 375, 285 );
}
示例10: KBookmarkHandler
FileBrowser::FileBrowser( const char * name, Medium * medium )
: QVBox( 0, name )
{
KActionCollection *actionCollection;
SearchPane *searchPane;
KURL *location;
// Try to keep filebrowser working even if not in a medium context
// so if a medium object not passed in, keep earlier behavior
if (!medium) {
m_medium = 0;
location = new KURL( Pana::config( "Filebrowser" )->readPathEntry( "Location", QDir::homeDirPath() ) );
KFileItem *currentFolder = new KFileItem( KFileItem::Unknown, KFileItem::Unknown, *location );
//KIO sucks, NetAccess::exists puts up a dialog and has annoying error message boxes
//if there is a problem so there is no point in using it anyways.
//so... setting the diroperator to ~ is the least sucky option
if ( !location->isLocalFile() || !currentFolder->isReadable() ) {
delete location;
location = new KURL( QDir::homeDirPath() ) ;
}
}
else{
m_medium = medium;
location = new KURL( m_medium->mountPoint() );
}
KActionCollection* ac = new KActionCollection( this );
KStdAction::selectAll( this, SLOT( selectAll() ), ac, "filebrowser_select_all" );
KToolBar *toolbar = new Browser::ToolBar( this );
{ //Filter LineEdit
KToolBar* searchToolBar = new Browser::ToolBar( this );
KToolBarButton *button = new KToolBarButton( "locationbar_erase", 0, searchToolBar );
m_filter = new ClickLineEdit( i18n( "Enter search terms here" ), searchToolBar );
searchToolBar->setStretchableWidget( m_filter );
connect( button, SIGNAL(clicked()), m_filter, SLOT(clear()) );
QToolTip::add( button, i18n( "Clear search field" ) );
QToolTip::add( m_filter, i18n( "Enter space-separated terms to search in the directory-listing" ) );
}
{ //Directory Listing
QVBox *container; QHBox *box;
container = new QVBox( this );
container->setFrameStyle( m_filter->frameStyle() );
container->setMargin( 3 );
container->setSpacing( 2 );
container->setBackgroundMode( Qt::PaletteBase );
box = new QHBox( container );
box->setMargin( 3 );
box->setBackgroundMode( Qt::PaletteBase );
//folder selection combo box
m_combo = new KURLComboBox( KURLComboBox::Directories, true, box, "path combo" );
if (!m_medium){
m_combo->setCompletionObject( new KURLCompletion( KURLCompletion::DirCompletion ) );
m_combo->setAutoDeleteCompletionObject( true );
}
m_combo->setMaxItems( 9 );
m_combo->setURLs( Pana::config( "Filebrowser" )->readPathListEntry( "Dir History" ) );
if (!m_medium)
m_combo->lineEdit()->setText( location->path() );
else
m_combo->lineEdit()->setText( "/" );
//The main widget with file listings and that
m_dir = new MyDirOperator( *location, container, m_medium );
m_dir->setEnableDirHighlighting( true );
m_dir->setMode( KFile::Mode((int)KFile::Files | (int)KFile::Directory) ); //allow selection of multiple files + dirs
m_dir->setOnlyDoubleClickSelectsFiles( true ); //Pana type settings
m_dir->readConfig( Pana::config( "Filebrowser" ) );
m_dir->setView( KFile::Default ); //will set userconfigured view, will load URL
m_dir->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Expanding );
m_dir->setAcceptDrops( true );
//Automatically open folder after hovering above it...probably a good thing
//but easily disabled by commenting this line out
//Disabled for now because can't show . and .. folders.
//TODO: Find out a way to fix this?
//m_dir->setDropOptions( KFileView::AutoOpenDirs );
static_cast<QFrame*>(m_dir->viewWidget())->setFrameStyle( QFrame::NoFrame );
static_cast<QIconView*>(m_dir->viewWidget())->setSpacing( 1 );
actionCollection = m_dir->actionCollection();
searchPane = new SearchPane( this );
setStretchFactor( container, 2 );
}
{
QPopupMenu* const menu = static_cast<KActionMenu*>(actionCollection->action("popupMenu"))->popupMenu();
//.........这里部分代码省略.........
示例11: QLabel
layerDialog::layerDialog( QWidget* parent, const char* name, bool modal, WFlags fl )
: QDialog( parent, name, modal, fl )
{
if ( !name )
setName( "layerDialog" );
setSizeGripEnabled( true );
generalDialog = new QTabWidget( this, "generalDialog" );
layout = new QWidget( generalDialog, "layout" );
QButtonGroup *box = new QButtonGroup(2,QGroupBox::Horizontal,QString::null,layout);
box->setFlat (true);
box->setLineWidth (0);
box->setInsideMargin (0);
QVBox *vbox = new QVBox(box);
vbox->setMargin(5);
vbox->setSpacing(5);
QHBox *hbox1 = new QHBox(vbox);
hbox1->setSpacing(5);
new QLabel( tr( "Number of Layers" ), hbox1);
layersBox = new QSpinBox(0,100,1,hbox1);
fitBox=new QCheckBox(vbox);
fitBox->setChecked(FALSE);
QButtonGroup *groupAlign = new QButtonGroup(2,QGroupBox::Horizontal,tr("Alignement"),box);
new QLabel( tr("Horizontal" ), groupAlign, 0,0 );
alignHorBox = new QComboBox( FALSE, groupAlign, 0 );
alignHorBox->insertItem( tr( "Center" ) );
alignHorBox->insertItem( tr( "Left" ) );
alignHorBox->insertItem( tr( "Right" ) );
new QLabel( tr( "Vertical" ), groupAlign, 0,0 );
alignVertBox = new QComboBox( FALSE, groupAlign, 0 );
alignVertBox->insertItem( tr( "Center" ) );
alignVertBox->insertItem( tr( "Top" ) );
alignVertBox->insertItem( tr( "Bottom" ) );
QVBox *vbox2 = new QVBox(box);
vbox2->setSpacing(5);
GroupBox1 = new QButtonGroup( 2,QGroupBox::Horizontal,tr("Grid"),vbox2);
new QLabel( tr( "Columns" ), GroupBox1, "TextLabel1",0 );
boxX = new QSpinBox(1,100,1,GroupBox1, "boxX" );
new QLabel( tr( "Rows" ), GroupBox1, "TextLabel2",0 );
boxY = new QSpinBox(1,100,1,GroupBox1, "boxY" );
GroupCanvasSize = new QButtonGroup(2,QGroupBox::Horizontal,tr("&Layer Canvas Size"),vbox2);
GroupCanvasSize->setCheckable(true);
GroupCanvasSize->setChecked(false);
new QLabel( tr("Width" ), GroupCanvasSize, "TextLabel1",0 );
boxCanvasWidth = new QSpinBox(0,10000,50,GroupCanvasSize, "boxCanvasWidth" );
boxCanvasWidth->setSuffix(tr(" pixels"));
new QLabel( tr( "Height" ), GroupCanvasSize, "TextLabel2",0 );
boxCanvasHeight = new QSpinBox(0,10000,50,GroupCanvasSize, "boxCanvasHeight" );
boxCanvasHeight->setSuffix(tr(" pixels"));
GroupBox4 = new QButtonGroup( 2,QGroupBox::Horizontal,tr("Spacing"),box);
new QLabel( tr( "Columns gap" ), GroupBox4, "TextLabel4",0 );
boxColsGap = new QSpinBox(0,100,5,GroupBox4, "boxColsGap" );
boxColsGap->setSuffix(tr(" pixels"));
new QLabel( tr( "Rows gap" ), GroupBox4, "TextLabel5",0 );
boxRowsGap = new QSpinBox(0,100,5,GroupBox4, "boxRowsGap" );
boxRowsGap->setSuffix(tr(" pixels"));
new QLabel( tr( "Left margin" ), GroupBox4, "TextLabel7",0 );
boxLeftSpace = new QSpinBox(0,1000,5,GroupBox4, "boxLeftSpace" );
boxLeftSpace->setSuffix(tr(" pixels"));
new QLabel( tr( "Right margin" ), GroupBox4, "TextLabel6",0 );
boxRightSpace = new QSpinBox(0,1000,5,GroupBox4, "boxRightSpace" );
boxRightSpace->setSuffix(tr(" pixels"));
new QLabel( tr( "Top margin" ), GroupBox4, "TextLabel8",0 );
boxTopSpace = new QSpinBox(0,1000,5,GroupBox4, "boxTopSpace" );
boxTopSpace->setSuffix(tr(" pixels"));
new QLabel( tr( "Bottom margin" ), GroupBox4, "TextLabel9",0 );
boxBottomSpace = new QSpinBox(0,1000,5,GroupBox4, "boxBottomSpace" );
boxBottomSpace->setSuffix(tr(" pixels"));
QVBoxLayout* hlayout1 = new QVBoxLayout(layout,5,5, "hlayout1");
hlayout1->addWidget(box);
generalDialog->insertTab(layout, tr( "Layout" ) );
fonts = new QWidget( generalDialog, "fonts" );
GroupBox2 = new QButtonGroup( 1,QGroupBox::Horizontal, QString::null,fonts,"GroupBox2" );
//.........这里部分代码省略.........
示例12: QLabel
FFTDialog::FFTDialog(int type, QWidget* parent, const char* name, bool modal, WFlags fl )
: QDialog( parent, name, modal, fl )
{
setCaption(tr("QtiPlot - FFT Options"));
d_table = 0;
graph = 0;
d_type = type;
QVBox *box = new QVBox (this);
box->setSpacing(5);
box->setMargin(5);
QButtonGroup *GroupFFT = new QButtonGroup(2,QGroupBox::Horizontal,tr(""), box, "GroupBox3" );
GroupFFT->setRadioButtonExclusive ( TRUE );
forwardBtn = new QRadioButton(GroupFFT, "forwardBtn" );
forwardBtn->setChecked( TRUE );
backwardBtn = new QRadioButton(GroupFFT, "backwardBtn" );
QButtonGroup *GroupBox1 = new QButtonGroup( 2,QGroupBox::Horizontal,tr(""), box,"GroupBox1" );
if (d_type == onGraph)
new QLabel( tr("Curve"), GroupBox1, "TextLabel1",0 );
else
new QLabel( tr("Sampling"), GroupBox1, "TextLabel1",0 );
boxName = new QComboBox(GroupBox1, "boxShow" );
if (d_type == onTable)
{
new QLabel( tr("Real"), GroupBox1, "TextLabel11",0 );
boxReal = new QComboBox(GroupBox1, "boxReal" );
new QLabel( tr("Imaginary"), GroupBox1, "TextLabel111",0 );
boxImaginary = new QComboBox(GroupBox1, "Imaginary" );
}
new QLabel( tr("Sampling Interval"), GroupBox1, "TextLabel4",0 );
boxSampling = new QLineEdit(GroupBox1, "boxStart" );
boxNormalize = new QCheckBox(box, "boxNorm" );
boxNormalize->setChecked(true);
boxOrder = new QCheckBox(box, "boxOrder" );
boxOrder->setChecked(true);
QButtonGroup *GroupBox2 = new QButtonGroup(1,QGroupBox::Horizontal,tr(""),this,"GroupBox2" );
GroupBox2->setFlat (TRUE);
GroupBox2->setLineWidth (0);
buttonOK = new QPushButton(GroupBox2, "buttonFit" );
buttonOK->setDefault( TRUE );
buttonCancel = new QPushButton(GroupBox2, "buttonCancel" );
QHBoxLayout* hlayout = new QHBoxLayout(this,5,5, "hlayout");
hlayout->addWidget(box);
hlayout->addWidget(GroupBox2);
languageChange();
setFocusProxy(boxName);
// signals and slots connections
connect( boxName, SIGNAL( activated(int) ), this, SLOT( activateCurve(int) ) );
connect( buttonOK, SIGNAL( clicked() ), this, SLOT( accept() ) );
connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
}