本文整理汇总了C++中QScrollView::setHScrollBarMode方法的典型用法代码示例。如果您正苦于以下问题:C++ QScrollView::setHScrollBarMode方法的具体用法?C++ QScrollView::setHScrollBarMode怎么用?C++ QScrollView::setHScrollBarMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QScrollView
的用法示例。
在下文中一共展示了QScrollView::setHScrollBarMode方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2: 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);
}
}
}
示例3: pageName
HelixConfigDialogBase::HelixConfigDialogBase( HelixEngine *engine, amaroK::PluginConfig *config, QWidget *p )
: QTabWidget( p )
, m_core(0)
, m_plugin(0)
, m_codec(0)
, m_device(0)
, m_engine( engine )
{
int row = 0;
QString currentPage;
QWidget *parent = 0;
QGridLayout *grid = 0;
QScrollView *sv = 0;
QString pageName( i18n("Main") );
addTab( sv = new QScrollView, pageName );
parent = new QWidget( sv->viewport() );
sv->setResizePolicy( QScrollView::AutoOneFit );
sv->setHScrollBarMode( QScrollView::AlwaysOff );
sv->setFrameShape( QFrame::NoFrame );
sv->addChild( parent );
grid = new QGridLayout( parent, /*rows*/20, /*cols*/2, /*margin*/10, /*spacing*/10 );
grid->setColStretch( 0, 1 );
grid->setColStretch( 1, 1 );
if( sv )
sv->setMinimumWidth( grid->sizeHint().width() + 20 );
engine->m_coredir = HelixConfig::coreDirectory();
m_core = new HelixConfigEntry( parent, engine->m_coredir,
config, row,
i18n("Helix/Realplay core directory"),
HelixConfig::coreDirectory().utf8(),
i18n("This is the directory where clntcore.so is located"));
++row;
engine->m_pluginsdir = HelixConfig::pluginDirectory();
m_plugin = new HelixConfigEntry( parent, engine->m_pluginsdir,
config, row,
i18n("Helix/Realplay plugins directory"),
HelixConfig::pluginDirectory().utf8(),
i18n("This is the directory where, for example, vorbisrend.so is located"));
++row;
engine->m_codecsdir = HelixConfig::codecsDirectory();
m_codec = new HelixConfigEntry( parent, engine->m_codecsdir,
config, row,
i18n("Helix/Realplay codecs directory"),
HelixConfig::codecsDirectory().utf8(),
i18n("This is the directory where, for example, cvt1.so is located"));
++row;
grid->addMultiCellWidget( new KSeparator( KSeparator::Horizontal, parent ), row, row, 0, 1 );
++row;
m_device = new HelixSoundDevice( parent, config, row, engine );
// lets find the logo if we can
QPixmap *pm = 0;
QString logo = HelixConfig::coreDirectory();
if (logo.isEmpty())
logo = HELIX_LIBS "/common";
logo.append("/../share/");
QString tmp = logo;
tmp.append("hxplay/logo.png");
if (QFileInfo(tmp).exists())
{
logo = tmp;
pm = new QPixmap(logo);
}
else
{
tmp = logo;
tmp.append("realplay/logo.png");
if (QFileInfo(tmp).exists())
{
logo = tmp;
pm = new QPixmap(logo);
}
}
if (pm)
{
QLabel *l = new QLabel(parent);
l->setPixmap(*pm);
grid->addMultiCellWidget( l, 20, 20, 1, 1, Qt::AlignRight );
}
entries.setAutoDelete( true );
pageName = i18n("Plugins");
addTab( sv = new QScrollView, pageName );
parent = new QWidget( sv->viewport() );
sv->setResizePolicy( QScrollView::AutoOneFit );
sv->addChild( parent );
//.........这里部分代码省略.........
示例4: if
// The constructor sets up the GUI, laying out the parameters on the left and
// the two plots on the right. There's nothing special here, it's just long.
// The code for the labels and text boxes for the parameters (on the left) is
// boilerplate ripped directly from default_gui_model, and should really be
// refactored out of here.
Istep::Istep(void) :
QWidget(MainWindow::getInstance()->centralWidget()),
Workspace::Instance("Istep", ::vars, ::num_vars),
period(1.0),
delay(0.0),
Amin(-100.0),
Amax(100.0),
Nsteps(20),
Ncycles(1),
duty(50),
offset(0.0),
factor(200.0),
periodsSincePlot(0)
{
setCaption(QString::number(getID()) + " Istep");
QBoxLayout *layout = new QHBoxLayout(this); // overall GUI layout
QBoxLayout *leftLayout = new QVBoxLayout();
QHBox *utilityBox = new QHBox(this);
pauseButton = new QPushButton("Pause", utilityBox);
pauseButton->setToggleButton(true);
QPushButton *modifyButton = new QPushButton("Modify", utilityBox);
QPushButton *unloadButton = new QPushButton("Unload", utilityBox);
QObject::connect(pauseButton, SIGNAL(toggled(bool)), this, SLOT(pause(bool)));
QObject::connect(modifyButton, SIGNAL(clicked(void)), this, SLOT(modify(void)));
QObject::connect(unloadButton, SIGNAL(clicked(void)), this, SLOT(exit(void)));
QObject::connect(pauseButton, SIGNAL(toggled(bool)), modifyButton, SLOT(setEnabled(bool)));
QToolTip::add(pauseButton, "Start/Stop Istep protocol");
QToolTip::add(modifyButton, "Commit changes to parameter values and reset");
QToolTip::add(unloadButton, "Close plug-in");
// create default_gui_model GUI DO NOT EDIT
QScrollView *sv = new QScrollView(this);
sv->setResizePolicy(QScrollView::AutoOneFit);
sv->setHScrollBarMode(QScrollView::AlwaysOff);
QWidget *viewport = new QWidget(sv->viewport());
sv->addChild(viewport);
QGridLayout *scrollLayout = new QGridLayout(viewport, 1, 2);
size_t nstate = 0, nparam = 0, nevent = 0, ncomment = 0;
for (size_t i = 0; i < num_vars; i++)
{
if (vars[i].flags & (PARAMETER | STATE | EVENT | COMMENT))
{
param_t param = {0};
param.label = new QLabel(vars[i].name, viewport);
scrollLayout->addWidget(param.label, parameter.size(), 0);
param.edit = new DefaultGUILineEdit(viewport);
scrollLayout->addWidget(param.edit, parameter.size(), 1);
QToolTip::add(param.label, vars[i].description);
QToolTip::add(param.edit, vars[i].description);
if (vars[i].flags & PARAMETER)
{
if (vars[i].flags & DOUBLE)
{
param.edit->setValidator(new QDoubleValidator(param.edit));
param.type = PARAMETER | DOUBLE;
}
else if (vars[i].flags & UINTEGER)
{
QIntValidator *validator = new QIntValidator(param.edit);
param.edit->setValidator(validator);
validator->setBottom(0);
param.type = PARAMETER | UINTEGER;
}
else if (vars[i].flags & INTEGER)
{
param.edit->setValidator(new QIntValidator(param.edit));
param.type = PARAMETER | INTEGER;
}
else
param.type = PARAMETER;
param.index = nparam++;
param.str_value = new QString;
}
else if (vars[i].flags & STATE)
{
param.edit->setReadOnly(true);
param.type = STATE;
param.index = nstate++;
}
else if (vars[i].flags & EVENT)
{
param.edit->setReadOnly(true);
param.type = EVENT;
param.index = nevent++;
}
else if (vars[i].flags & COMMENT)
{
//.........这里部分代码省略.........
示例5: toggle
Expert::Expert( QWidget *parent ) : QTabDialog( parent )
{
m_dependencies = new QDict< QList<IInput> >(257);
m_dependencies->setAutoDelete(TRUE);
m_inputWidgets = new QDict< IInput >;
m_switches = new QDict< QObject >;
m_changed = FALSE;
setHelpButton();
QListIterator<ConfigOption> options = Config::instance()->iterator();
QVBoxLayout *pageLayout = 0;
QFrame *page = 0;
ConfigOption *option = 0;
for (options.toFirst();(option=options.current());++options)
{
switch(option->kind())
{
case ConfigOption::O_Info:
{
if (pageLayout) pageLayout->addStretch(1);
QScrollView *view = new QScrollView(this);
view->setVScrollBarMode(QScrollView::Auto);
view->setHScrollBarMode(QScrollView::AlwaysOff);
view->setResizePolicy(QScrollView::AutoOneFit);
page = new QFrame( view->viewport(), option->name() );
pageLayout = new QVBoxLayout(page);
pageLayout->setMargin(10);
view->addChild(page);
addTab(view,option->name());
QWhatsThis::add(page, option->docs().simplifyWhiteSpace() );
QToolTip::add(page, option->docs() );
}
break;
case ConfigOption::O_String:
{
ASSERT(page!=0);
InputString::StringMode sm=InputString::StringFree;
switch(((ConfigString *)option)->widgetType())
{
case ConfigString::String: sm=InputString::StringFree; break;
case ConfigString::File: sm=InputString::StringFile; break;
case ConfigString::Dir: sm=InputString::StringDir; break;
}
InputString *inputString = new InputString(
option->name(), // name
page, // widget
*((ConfigString *)option)->valueRef(), // variable
sm // type
);
pageLayout->addWidget(inputString);
QWhatsThis::add(inputString, option->docs().simplifyWhiteSpace() );
QToolTip::add(inputString,option->docs());
connect(inputString,SIGNAL(changed()),SLOT(changed()));
m_inputWidgets->insert(option->name(),inputString);
addDependency(m_switches,option->dependsOn(),option->name());
}
break;
case ConfigOption::O_Enum:
{
ASSERT(page!=0);
InputString *inputString = new InputString(
option->name(), // name
page, // widget
*((ConfigEnum *)option)->valueRef(), // variable
InputString::StringFixed // type
);
pageLayout->addWidget(inputString);
QStrListIterator sli=((ConfigEnum *)option)->iterator();
for (sli.toFirst();sli.current();++sli)
{
inputString->addValue(sli.current());
}
inputString->init();
QWhatsThis::add(inputString, option->docs().simplifyWhiteSpace() );
QToolTip::add(inputString, option->docs());
connect(inputString,SIGNAL(changed()),SLOT(changed()));
m_inputWidgets->insert(option->name(),inputString);
addDependency(m_switches,option->dependsOn(),option->name());
}
break;
case ConfigOption::O_List:
{
ASSERT(page!=0);
InputStrList::ListMode lm=InputStrList::ListString;
switch(((ConfigList *)option)->widgetType())
{
case ConfigList::String: lm=InputStrList::ListString; break;
case ConfigList::File: lm=InputStrList::ListFile; break;
case ConfigList::Dir: lm=InputStrList::ListDir; break;
case ConfigList::FileAndDir: lm=InputStrList::ListFileDir; break;
}
InputStrList *inputStrList = new InputStrList(
option->name(), // name
page, // widget
*((ConfigList *)option)->valueRef(), // variable
lm // type
);
pageLayout->addWidget(inputStrList);
//.........这里部分代码省略.........