本文整理汇总了C++中QScrollArea::adjustSize方法的典型用法代码示例。如果您正苦于以下问题:C++ QScrollArea::adjustSize方法的具体用法?C++ QScrollArea::adjustSize怎么用?C++ QScrollArea::adjustSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QScrollArea
的用法示例。
在下文中一共展示了QScrollArea::adjustSize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QWidget
Paintbox::Paintbox(QWidget * parent, Qt::WindowFlags flags) : QWidget(parent, flags)
{
setupUi(this);
stacks = new QUndoGroup(this);
QIcon undo = undo_button->icon();
undo_button->setDefaultAction(stacks->createUndoAction(undo_button));
undo_button->defaultAction()->setIcon(undo);
QIcon redo = redo_button->icon();
redo_button->setDefaultAction(stacks->createRedoAction(redo_button));
redo_button->defaultAction()->setIcon(redo);
setUndoStack(parent);
active = COLOR_PAINT;
gradient_frame->setHidden(true);
pick_frame->setHidden(true);
smooth_frame->setHidden(true);
mesh_displacement_frame->setHidden(true);
clone_source_frame->setHidden(true);
noise_frame->setHidden(true);
brush_viewer->setScene(new QGraphicsScene());
clone_source_view->setScene(new QGraphicsScene());
clone_source_view->centerOn(0, 0);
item = NULL;
pixmap_available = false;
//******QT 4.3 Workaround**********
QScrollArea * scrollArea = new QScrollArea(this);
gridLayout->removeWidget(widget);
scrollArea->setWidget(widget);
static_cast<QGridLayout * >(widget->layout())->addItem(new QSpacerItem(0, 20, QSizePolicy::Minimum, QSizePolicy::Expanding), 11, 0, 1, 2);
widget->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Expanding));
scrollArea->setFrameStyle(QFrame::NoFrame);
scrollArea->setWidgetResizable(true);
scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
scrollArea->adjustSize();
gridLayout->addWidget(scrollArea, 2, 1, 1, 1);
//**********************************
QObject::connect(clone_source_view, SIGNAL(positionChanged(double, double)), this, SLOT(movePixmapDelta(double, double)));
QObject::connect(clone_source_view, SIGNAL(positionReset()), this, SLOT(resetPixmapDelta()));
refreshBrushPreview();
}