13、Qt学习笔记--QScrollArea

一、介绍

1、The QScrollArea class provides a scrolling view onto another widget.

2、A scroll area is used to display the contents of a child widget within a frame. If the widget exceeds the size of the frame, the view can provide scroll bars so that the entire area of the child widget can be viewed. 


二、示例

1、代码

//
QScrollArea  *sa_div;   /* 画面滑动创建 
 /* 滑动区域 */
sa_div = new QScrollArea(wd_preview);
sa_div->setWidget(wd_previewDiv);
sa_div->resize(wdMainWidth * 4/5, wdMainHeight);
sa_div->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);    /* 隐藏滑动条 */
sa_div->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
//


致谢

1、Qt help文档

2、Qt 之 QScrollArea--一去、二三里



猜你喜欢

转载自blog.csdn.net/qq_38880380/article/details/80689386
今日推荐