相关疑难解决方法(0)

QWidget报告错误的宽度值

我想查询小部件的宽度来执行一些自定义布局管理.不幸的是,无论小部件实际有多大或多小,以下代码都会返回640

int myWidth = this->rect().size().width();  // "this" is my class derived from QWidget
// myWidth is set to 640
Run Code Online (Sandbox Code Playgroud)

编辑:

int myWidth = this->width() 返回相同的640

qt qwidget

3
推荐指数
1
解决办法
3760
查看次数

标签 统计

qt ×1

qwidget ×1