当前位置: 首页>>代码示例>>C++>>正文


C++ QScrollArea::adjustSize方法代码示例

本文整理汇总了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();
}
开发者ID:Jerdak,项目名称:meshlab,代码行数:50,代码来源:paintbox.cpp


注:本文中的QScrollArea::adjustSize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。