本文整理汇总了C++中QScrollView::setVScrollBarMode方法的典型用法代码示例。如果您正苦于以下问题:C++ QScrollView::setVScrollBarMode方法的具体用法?C++ QScrollView::setVScrollBarMode怎么用?C++ QScrollView::setVScrollBarMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QScrollView
的用法示例。
在下文中一共展示了QScrollView::setVScrollBarMode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: QLabel
SequenceNumber::SequenceNumber(MainWindow* main)
: QuasarWindow(main, "SequenceNumber")
{
_helpSource = "seq_number.html";
QFrame* frame = new QFrame(this);
QScrollView* sv = new QScrollView(frame);
_nums = new QButtonGroup(4, Horizontal, tr("Seq Numbers"), sv->viewport());
new QLabel("Type", _nums);
new QLabel("Minimum", _nums);
new QLabel("Maximum", _nums);
new QLabel("Next", _nums);
addIdEdit(tr("Data Object:"), "data_object", "object_id");
addIdEdit(tr("Journal Entry:"), "gltx", "Journal Entry");
addIdEdit(tr("Ledger Transfer:"), "gltx", "Ledger Transfer");
addIdEdit(tr("Card Adjustment:"), "gltx", "Card Adjustment");
addIdEdit(tr("Customer Invoice:"), "gltx", "Customer Invoice");
addIdEdit(tr("Customer Return:"), "gltx", "Customer Return");
addIdEdit(tr("Customer Payment:"), "gltx", "Customer Payment");
addIdEdit(tr("Customer Quote:"), "quote", "number");
addIdEdit(tr("Vendor Invoice:"), "gltx", "Vendor Invoice");
addIdEdit(tr("Vendor Claim:"), "gltx", "Vendor Claim");
addIdEdit(tr("Purchase Order:"), "porder", "number");
addIdEdit(tr("Packing Slip:"), "slip", "number");
addIdEdit(tr("Nosale:"), "gltx", "Nosale");
addIdEdit(tr("Payout:"), "gltx", "Payout");
addIdEdit(tr("Withdraw:"), "gltx", "Withdraw");
addIdEdit(tr("Shift:"), "gltx", "Shift");
addIdEdit(tr("Item Adjustment:"), "gltx", "Item Adjustment");
addIdEdit(tr("Item Transfer:"), "gltx", "Item Transfer");
addIdEdit(tr("Physical Count:"), "pcount", "number");
addIdEdit(tr("Label Batch:"), "label_batch", "number");
addIdEdit(tr("Price Batch:"), "price_batch", "number");
addIdEdit(tr("Promo Batch:"), "promo_batch", "number");
addIdEdit(tr("Company Number:"), "company", "number");
addIdEdit(tr("Store Number:"), "store", "number");
addIdEdit(tr("Station Number:"), "station", "number");
addIdEdit(tr("Tender Count #:"), "tender_count", "number");
addIdEdit(tr("Tender Menu #:"), "tender", "menu_num");
QFrame* buttons = new QFrame(frame);
QPushButton* ok = new QPushButton(tr("&OK"), buttons);
QPushButton* quit = new QPushButton(tr("&Close"), buttons);
connect(ok, SIGNAL(clicked()), SLOT(slotOk()));
connect(quit, SIGNAL(clicked()), SLOT(close()));
QGridLayout* buttonGrid = new QGridLayout(buttons);
buttonGrid->setSpacing(3);
buttonGrid->setMargin(3);
buttonGrid->setColStretch(0, 1);
buttonGrid->addWidget(ok, 0, 1);
buttonGrid->addWidget(quit, 0, 2);
_nums->resize(_nums->sizeHint());
sv->setVScrollBarMode(QScrollView::AlwaysOn);
sv->resizeContents(_nums->width() + 20, _nums->height());
QGridLayout* grid = new QGridLayout(frame);
grid->setSpacing(6);
grid->setMargin(6);
grid->setRowStretch(0, 1);
grid->addWidget(sv, 0, 0);
grid->addWidget(buttons, 1, 0);
for (unsigned int i = 0; i < _ids.size(); ++i) {
IdInfo& info = _ids[i];
_quasar->db()->getSequence(info.seq);
info.minNum->setFixed(info.seq.minNumber());
info.maxNum->setFixed(info.seq.maxNumber());
info.nextNum->setFixed(info.seq.nextNumber());
}
statusBar()->hide();
setCentralWidget(frame);
setCaption(tr("Sequence Numbers"));
finalize();
if (!allowed("View")) {
QTimer::singleShot(50, this, SLOT(slotNotAllowed()));
return;
}
}
示例3: 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);
//.........这里部分代码省略.........