Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ajust QVTKWidget to window

Tags:

qt

vtk

qvtkwidget

How can I make my QVTKwidget to adjust when I make my window expand or shrink?

I have more widgets in my layout. I want them to stay the same, just expand shrink the QvtkWidget. I found some things about the layout, but I can't use it on QVTKWidget.

like image 843
SamuelNLP Avatar asked Jan 29 '26 10:01

SamuelNLP


1 Answers

Assuming this is a reasonably well behaved widget, you could either use:

  • QMainWindow and set the widget as the central widget (setCentralWidget)
  • Use layouts such as QVBoxLayout and ensure you set the stretch parameter of your QVTKWidget widget to 1 and your other widgets to 0, see QBoxLayout::addWidget.
like image 172
Silas Parker Avatar answered Jan 31 '26 07:01

Silas Parker