本文整理汇总了C++中QScrollView::setFrameStyle方法的典型用法代码示例。如果您正苦于以下问题:C++ QScrollView::setFrameStyle方法的具体用法?C++ QScrollView::setFrameStyle怎么用?C++ QScrollView::setFrameStyle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QScrollView
的用法示例。
在下文中一共展示了QScrollView::setFrameStyle方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: slotViewCleared
void RenderFrame::slotViewCleared()
{
if(element() && m_widget->inherits("QScrollView")) {
#ifdef DEBUG_LAYOUT
kdDebug(6031) << "frame is a scrollview!" << endl;
#endif
QScrollView *view = static_cast<QScrollView *>(m_widget);
if(!element()->frameBorder || !((static_cast<HTMLFrameSetElementImpl *>(element()->parentNode()))->frameBorder()))
view->setFrameStyle(QFrame::NoFrame);
#if APPLE_CHANGES
// Qt creates QScrollView w/ a default style of QFrame::StyledPanel | QFrame::Sunken.
else
view->setFrameStyle( QFrame::StyledPanel | QFrame::Sunken );
#else
view->setHScrollBarMode(element()->scrolling );
view->setVScrollBarMode(element()->scrolling );
#endif
if(view->inherits("KHTMLView")) {
#ifdef DEBUG_LAYOUT
kdDebug(6031) << "frame is a KHTMLview!" << endl;
#endif
KHTMLView *htmlView = static_cast<KHTMLView *>(view);
if(element()->marginWidth != -1) htmlView->setMarginWidth(element()->marginWidth);
if(element()->marginHeight != -1) htmlView->setMarginHeight(element()->marginHeight);
}
}
}
示例2: showDialog
bool DateEntryEditor::showDialog( QString caption, OPimEvent& event ) {
QDialog newDlg( m_parent, 0, TRUE );
newDlg.setCaption( caption );
QVBoxLayout *vb = new QVBoxLayout( &newDlg );
QScrollView *sv = new QScrollView( &newDlg );
sv->setResizePolicy( QScrollView::AutoOneFit );
sv->setFrameStyle( QFrame::NoFrame );
sv->setHScrollBarMode( QScrollView::AlwaysOff );
vb->addWidget( sv );
DateEntry *de = new DateEntry( weekStartOnMonday(), isAP(), &newDlg );
de->comboLocation->clear();
de->comboLocation->insertItem("");
de->comboLocation->insertStringList( locations().names() );
de->comboDescription->clear();
de->comboDescription->insertItem("");
de->comboDescription->insertStringList( descriptions().names() );
de->setEvent( event );
sv->addChild( de );
while ( QPEApplication::execDialog( &newDlg ) ) {
de->getEvent( event );
QString error = checkEvent( event );
if ( !error.isNull() ) {
if ( QMessageBox::warning( m_parent, QObject::tr("Error!"), error, QObject::tr("Fix it"), QObject::tr("Continue"), 0, 0, 1 ) == 0 )
continue;
}
return true;
}
return false;
}
示例3: QScrollView
ZLDialogContent &ZLQtOptionsDialog::createTab(const ZLResourceKey &key) {
QScrollView *sv = new QScrollView(myTabWidget);
sv->setResizePolicy(QScrollView::AutoOneFit);
sv->setFrameStyle(QFrame::NoFrame);
ZLQtDialogContent *tab = new ZLQtDialogContent(sv->viewport(), tabResource(key));
sv->addChild(tab->widget());
myMenu->insertItem(::qtString(tab->displayName()), -1, myTabs.size());
myTabWidget->addWidget(sv, myTabs.size());
myTabs.push_back(tab);
if(myTabs.size() == 1) {
raiseTab(0);
}
return *tab;
}
示例4: QDialog
FilterDlg::FilterDlg( QWidget *parent, OPackageManager *pm, const QString &name,
const QString &server, const QString &destination,
OPackageManager::Status status, const QString &category )
: QDialog( parent, QString::null, true, WStyle_ContextHelp )
{
setCaption( tr( "Filter packages" ) );
QVBoxLayout *layout = new QVBoxLayout( this );
QScrollView *sv = new QScrollView( this );
layout->addWidget( sv, 0, 0 );
sv->setResizePolicy( QScrollView::AutoOneFit );
sv->setFrameStyle( QFrame::NoFrame );
QWidget *container = new QWidget( sv->viewport() );
sv->addChild( container );
layout = new QVBoxLayout( container, 4, 4 );
// Category
m_categoryCB = new QCheckBox( tr( "Category:" ), container );
QWhatsThis::add( m_categoryCB, tr( "Tap here to filter package list by application category." ) );
connect( m_categoryCB, SIGNAL(toggled(bool)), this, SLOT(slotCategorySelected(bool)) );
m_category = new QComboBox( container );
QWhatsThis::add( m_category, tr( "Select the application category to filter by here." ) );
m_category->insertStringList( pm->categories() );
initItem( m_category, m_categoryCB, category );
layout->addWidget( m_categoryCB );
layout->addWidget( m_category );
// Package name
m_nameCB = new QCheckBox( tr( "Names containing:" ), container );
QWhatsThis::add( m_nameCB, tr( "Tap here to filter package list by package name." ) );
connect( m_nameCB, SIGNAL(toggled(bool)), this, SLOT(slotNameSelected(bool)) );
m_name = new QLineEdit( name, container );
QWhatsThis::add( m_name, tr( "Enter the package name to filter by here." ) );
if ( !name.isNull() )
m_nameCB->setChecked( true );
m_name->setEnabled( !name.isNull() );
layout->addWidget( m_nameCB );
layout->addWidget( m_name );
// Status
m_statusCB = new QCheckBox( tr( "With the status:" ), container );
QWhatsThis::add( m_statusCB, tr( "Tap here to filter package list by the package status." ) );
connect( m_statusCB, SIGNAL(toggled(bool)), this, SLOT(slotStatusSelected(bool)) );
m_status = new QComboBox( container );
QWhatsThis::add( m_status, tr( "Select the package status to filter by here." ) );
connect( m_status, SIGNAL(activated(const QString&)), this, SLOT(slotStatusChanged(const QString&)) );
QString currStatus;
switch ( status )
{
case OPackageManager::All : currStatus = tr( "All" );
break;
case OPackageManager::Installed : currStatus = tr( "Installed" );
break;
case OPackageManager::NotInstalled : currStatus = tr( "Not installed" );
break;
case OPackageManager::Updated : currStatus = tr( "Updated" );
break;
default : currStatus = QString::null;
};
m_status->insertItem( tr( "All" ) );
m_status->insertItem( tr( "Installed" ) );
m_status->insertItem( tr( "Not installed" ) );
m_status->insertItem( tr( "Updated" ) );
initItem( m_status, m_statusCB, currStatus );
layout->addWidget( m_statusCB );
layout->addWidget( m_status );
// Server
m_serverCB = new QCheckBox( tr( "Available from the following server:" ), container );
QWhatsThis::add( m_serverCB, tr( "Tap here to filter package list by source server." ) );
connect( m_serverCB, SIGNAL(toggled(bool)), this, SLOT(slotServerSelected(bool)) );
m_server = new QComboBox( container );
QWhatsThis::add( m_server, tr( "Select the source server to filter by here." ) );
m_server->insertStringList( pm->servers() );
initItem( m_server, m_serverCB, server );
layout->addWidget( m_serverCB );
layout->addWidget( m_server );
// Destination
m_destCB = new QCheckBox( tr( "Installed on device at:" ), container );
QWhatsThis::add( m_destCB, tr( "Tap here to filter package list by destination where the package is installed to on this device." ) );
connect( m_destCB, SIGNAL(toggled(bool)), this, SLOT(slotDestSelected(bool)) );
m_destination = new QComboBox( container );
QWhatsThis::add( m_destination, tr( "Select the destination location to filter by here." ) );
m_destination->insertStringList( pm->destinations() );
initItem( m_destination, m_destCB, destination );
layout->addWidget( m_destCB );
layout->addWidget( m_destination );
}
示例5: QDialog
IRCSettings::IRCSettings(QWidget* parent, const char* name, bool modal, WFlags) : QDialog(parent, name, modal, WStyle_ContextHelp)
{
setCaption(tr("Settings") );
m_config = new Config("OpieIRC");
m_config->setGroup("OpieIRC");
QHBoxLayout *l = new QHBoxLayout(this, 2, 2);
OTabWidget *tw = new OTabWidget(this);
l->addWidget(tw);
/* General Configuration */
QWidget *genwidget = new QWidget(tw);
QGridLayout *layout = new QGridLayout(genwidget, 1, 4, 5, 0);
QLabel *label = new QLabel(tr("Lines displayed :"), genwidget);
layout->addWidget(label, 0, 0);
m_lines = new QLineEdit(m_config->readEntry("Lines", "100"), genwidget);
QWhatsThis::add(m_lines, tr("Amount of lines to be displayed in chats before old lines get deleted - this is necessary to restrain memory consumption. Set to 0 if you don't need this"));
QIntValidator *validator = new QIntValidator(this);
validator->setTop(10000);
validator->setBottom(0);
m_lines->setValidator(validator);
layout->addWidget(m_lines, 0, 1);
/*
* include timestamp
*/
m_displayTime = new QCheckBox( tr("Display time in chat log"), genwidget );
m_displayTime->setChecked( m_config->readBoolEntry("DisplayTime", false) );
layout->addMultiCellWidget(m_displayTime, 1, 1, 0, 4 );
// add a spacer
layout->addItem( new QSpacerItem(1,1, QSizePolicy::Minimum,
QSizePolicy::MinimumExpanding),
2, 0 );
tw->addTab(genwidget, "opieirc/settings", tr("General"));
/* Color configuration */
QScrollView *view = new QScrollView(this);
view->setResizePolicy(QScrollView::AutoOneFit);
view->setFrameStyle( QFrame::NoFrame );
QWidget *widget = new QWidget(view->viewport());
view->addChild(widget);
layout = new QGridLayout(widget, 7, 2, 5, 0);
label = new QLabel(tr("Background color :"), widget);
layout->addWidget(label, 0, 0);
m_background = new OColorButton(widget, m_config->readEntry("BackgroundColor", "#FFFFFF"));
QWhatsThis::add(m_background, tr("Background color to be used in chats"));
layout->addWidget(m_background, 0, 1);
label = new QLabel(tr("Normal text color :"), widget);
layout->addWidget(label, 1, 0);
m_text = new OColorButton(widget, m_config->readEntry("TextColor", "#000000"));
QWhatsThis::add(m_text, tr("Text color to be used in chats"));
layout->addWidget(m_text, 1, 1);
label = new QLabel(tr("Error color :"), widget);
layout->addWidget(label, 2, 0);
m_error = new OColorButton(widget, m_config->readEntry("ErrorColor", "#FF0000"));
QWhatsThis::add(m_error, tr("Text color to be used to display errors"));
layout->addWidget(m_error, 2, 1);
label = new QLabel(tr("Text written by yourself :"), widget);
layout->addWidget(label, 3, 0);
m_self = new OColorButton(widget, m_config->readEntry("SelfColor", "#CC0000"));
QWhatsThis::add(m_self, tr("Text color to be used to identify text written by yourself"));
layout->addWidget(m_self, 3, 1);
label = new QLabel(tr("Text written by others :"), widget);
layout->addWidget(label, 4, 0);
m_other = new OColorButton(widget, m_config->readEntry("OtherColor", "#0000BB"));
QWhatsThis::add(m_other, tr("Text color to be used to identify text written by others"));
layout->addWidget(m_other, 4, 1);
label = new QLabel(tr("Text written by the server :"), widget);
layout->addWidget(label, 5, 0);
m_server = new OColorButton(widget, m_config->readEntry("ServerColor", "#0000FF"));
QWhatsThis::add(m_server, tr("Text color to be used to identify text written by the server"));
layout->addWidget(m_server, 5, 1);
label = new QLabel(tr("Notifications :"), widget);
layout->addWidget(label, 6, 0);
m_notification = new OColorButton(widget, m_config->readEntry("NotificationColor", "#006400"));
QWhatsThis::add(m_notification, tr("Text color to be used to display notifications"));
layout->addWidget(m_notification, 6, 1);
tw->addTab(view, "opieirc/colors", tr("Colors"));
/*
* IRC EditLine KeyConfiguration
*/
m_keyConf = new Opie::Ui::OKeyConfigWidget(tw, "KEyConfig GUI" );
m_keyConf->setChangeMode( OKeyConfigWidget::Queue );
m_keyConf->insert( tr("Keyboard Shortcuts"),
IRCHistoryLineEdit::keyConfigInstance() );
m_keyConf->load();
tw->addTab(m_keyConf, "SettingsIcon", tr("Keyboard Shortcuts") );
tw->setCurrentTab( genwidget );
QPEApplication::showDialog( this );
}
示例6: QWidget
// ---- initSettings ----------------------------------------------------------
QWidget *Configuration::initSettings(Cfg &cfg)
{
QWidget *control = new QWidget( _mainWidget );
QFontMetrics fm = fontMetrics();
int fh = fm.height();
QVBoxLayout *vb = new QVBoxLayout( control );
QScrollView *sv = new QScrollView( control );
vb->addWidget( sv, 0, 0 );
sv->setResizePolicy( QScrollView::AutoOneFit );
sv->setFrameStyle( QFrame::NoFrame );
QWidget *container = new QWidget( sv->viewport() );
sv->addChild( container );
QGridLayout *layout = new QGridLayout( container );
layout->setSpacing( 4 );
layout->setMargin( 4 );
QLabel *label = new QLabel( tr( "Enter currency symbol:" ), container );
QWhatsThis::add( label, tr( "Enter your local currency symbol here." ) );
label->setMaximumHeight( fh + 3 );
layout->addWidget( label, 0, 0 );
symbolEdit = new QLineEdit( cfg.getCurrencySymbol(), container );
QWhatsThis::add( symbolEdit, tr( "Enter your local currency symbol here." ) );
symbolEdit->setMaximumHeight( fh + 5 );
symbolEdit->setFocus();
layout->addWidget( symbolEdit, 0, 1 );
lockCB = new QCheckBox( tr( "Show whether checkbook is password\nprotected" ), container );
QWhatsThis::add( lockCB, tr( "Click here to select whether or not the main window will display that the checkbook is protected with a password." ) );
lockCB->setChecked( cfg.getShowLocks() );
layout->addMultiCellWidget( lockCB, 1, 1, 0, 1 );
balCB = new QCheckBox( tr( "Show checkbook balances" ), container );
QWhatsThis::add( balCB, tr( "Click here to select whether or not the main window will display the current balance for each checkbook." ) );
balCB->setMaximumHeight( fh + 5 );
balCB->setChecked( cfg.getShowBalances() );
layout->addMultiCellWidget( balCB, 2, 2, 0, 1 );
openLastBookCB = new QCheckBox( tr("Open last checkbook" ), container );
QWhatsThis::add( openLastBookCB, tr("Click here to select whether the last open checkbook will be opened at startup.") );
openLastBookCB->setMaximumHeight(fh+5);
openLastBookCB->setChecked( cfg.isOpenLastBook() );
layout->addMultiCellWidget( openLastBookCB, 3, 3, 0, 1 );
lastTabCB = new QCheckBox( tr("Show last checkbook tab" ), container );
QWhatsThis::add( lastTabCB, tr("Click here to select whether the last tab in a checkbook should be displayed.") );
lastTabCB->setMaximumHeight(fh+5);
lastTabCB->setChecked( cfg.isShowLastTab() );
layout->addMultiCellWidget( lastTabCB, 4, 4, 0, 1 );
savePayees = new QCheckBox( tr("Save new description as payee"), container );
QWhatsThis::add( savePayees, tr("Click here to save new descriptions in the list of payess.") );
savePayees->setMaximumHeight(fh+5);
savePayees->setChecked( cfg.getSavePayees() );
layout->addMultiCellWidget( savePayees, 5, 5, 0, 1 );
smallFontCB = new QCheckBox( tr( "Use smaller font for list" ), container );
QWhatsThis::add( smallFontCB, tr( "Click here to select smaller font for transactions." ) );
smallFontCB->setChecked( cfg.getUseSmallFont() );
layout->addMultiCellWidget( smallFontCB, 6, 6, 0, 1 );
return(control);
}