Add Widgets in a Tab to a layout with qt designer
-
Hi,
I am trying to add a TextEdit widget to a Tab Widget. This works as expected.
But when I do resize the MainWindow widget at runtime, though the tabs themselves do resize, the TextEdit does not.Tried my best to add the TextEdit to a layout, but that seemed futile to me ?
Any idea, how to resolve this ?
Thanks
-
Hi,
Your QTextEdit is just "dropped" in your tab widget, you need to put it in a layout.
-
@SGaist said in Add Widgets in a Tab to a layout with qt designer:
Hi,
Your QTextEdit is just "dropped" in your tab widget, you need to put it in a layout.
I agree to what you said. But, the problem is the Layout options for textEdit all "appear to be" disabled.
If I do a right click on the textEdit->Layout, there exists Adjust Size alone.
Same is the situation with the Toolbar.Maybe I am missing something obvious ?
Thanks
-
The layout should be applied to the widget you have "under" your QTextEdit.
-
@SGaist said in Add Widgets in a Tab to a layout with qt designer:
The layout should be applied to the widget you have "under" your QTextEdit.
I dont follow how to put it in a layout "with the options appeared to be disabled ?"
Any thoughts, why it looks thus ?
Thanks
-
You have layouts available on the top left corner of the editor.
-
@SGaist said in Add Widgets in a Tab to a layout with qt designer:
You have layouts available on the top left corner of the editor.
I tried your suggestion, Dragged the QHboxLayout into the Tab, Added plainTextEdit to the layout. That was what you intended ?
Hmm.. That did not seem to work either... Maybe I did something wrong ?
-
Just right click the QTabWidget from the right panel and set layout on it. That will apply the layout to the current page, not to the QTabWidget itself.
You should also be able to set the layout by right clicking in the blank part oftab_1
from the center. -
@Bonnie said in Add Widgets in a Tab to a layout with qt designer:
Just right click the QTabWidget from the right panel and set layout on it. That will apply the layout to the current page, not to the QTabWidget itself.
You should also be able to set the layout by right clicking in the blank part oftab_1
from the center.That fixed the issue.
Thanks!