c++ - 什么是树形小部件的视口(viewport)?

标签 c++ qt

我正在尝试定位树形小部件的项目。
在文档中查找,我得到:

QTreeWidgetItem * QTreeWidget::itemAt ( const QPoint & p ) const

Returns a pointer to the item at the coordinates p. The coordinates are relative to the tree widget's viewport().

viewport() 函数也没有给出关于viewport 的定义。
那么什么是树形小部件的视口(viewport)?

最佳答案

QTreeWidget 继承自QAbstractScrollArea ,这是定义视口(viewport)的地方:

QAbstractScrollArea is a low-level abstraction of a scrolling area. The area provides a central widget called the viewport, in which the contents of the area is to be scrolled (i.e, the visible parts of the contents are rendered in the viewport).

视口(viewport)本质上是树的可见部分。

关于c++ - 什么是树形小部件的视口(viewport)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16759088/

相关文章:

c++ - QThread moveToThread 不起作用

qt - 尝试在 Debian 上针对 win32 交叉编译 Qt 4.8.3 时构建失败

c++ - 如何使用 LD_LIBRARY_PATH 和链接使其真正正确?

c++ - boost move 编译错误

c++ - 如何使用动画将 3ds max 模型导入 C++/Open GL

c++ - Qt:Qt 应用程序中的键盘快捷键分配(使用 "&")是否不适用于 Mac OSX?

c++ - Qt Visual Studio 插件影子构建

c++ - 将粒子排列成矩形

c++ - Qt中的毫米纸

c++ - 创建 Qt 插件并使用非虚函数