Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
QWidget幅の設定方法は?私はそれを行う関数を知っsetGeometry(QRect& rect)ていますが、その場合はgeometry()関数を使用して以前のパラメーターを取得しQWidget、次に幅をインクリメントしてsetGeometry(..)を使用する必要があります。それを直接行う方法はありますか?
QWidget
setGeometry(QRect& rect)
geometry()
QWidget aa; aa.setWidth(165); //something like this?
resize()使用する方が良いかもしれません。
resize()
使用例:
widget->resize(165, widget->height());
QWidget リファレンス。
利用可能なすべての「yyysize」メソッドを調べてみてください(Qt ウィジェットにはさまざまなサイズ変更ポリシーがあり、何か特別なものが必要になる場合があるため)。
基本的に、そうresize(...)です。
resize(...)