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