当前位置: 代码迷 >> 综合 >> Qt--QScrollArea
  详细解决方案

Qt--QScrollArea

热度:67   发布时间:2023-12-28 15:12:47.0

一、介绍

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--一去、二三里