Set QPlaiTextEdit as central widget in QT Designer
Hi all
Just finished to search into the forum for similar problem but not found satisfying reply. I need to create a SDI like application. I'm creating the main window using QT Designer but I still didin't find a way for set a QPlainTextEdit control as central widget. For similar request someone suggested to drop the text widget over central widget, set the central widget layout vertical or horizontal mode and set text widget as expanding. This work but not complitely. I mean, using this way the text widget is automatically centered and resized based to the main window size but doesn't fill all the central widget area. Borders still appears around the text widget and doesn't look like a real SDI application where the text control fill all the entire area of the central window part.
Someone have a solution for this problem?
Thank you
Re: Set QPlaiTextEdit as central widget in QT Designer
Hi,
You can set contents margin layout with 0 like this :
Code:
centralwidget
= new QWidget(MainWindow
);
gridLayout->setSpacing(0);
gridLayout->setContentsMargins(0, 0, 0, 0);
And set QPlainTextEdit frameShape to QFrame::NoFrame.
Code:
plainTextEdit
->setFrameShape
(QFrame::NoFrame);
plainTextEdit->setLineWidth(0);
Are this metod solve your problem?
Thank you.
Best regards,
Toto
Re: Set QPlaiTextEdit as central widget in QT Designer
Hi Toto
Thank you very much for your suggestion.
Basically the problem was not in QT Designer but in my mind since I'm an idiot and I should to check better the available widgets properties before annoy other users in the forum. :o
I didn't use your coding solution since, thanks to your input, I found the layour margins properties in QT Designed that allow me to set the text control inside central widget to fill the entire area of the window (setting all the left, right, top and bottom margin values of central widget as zero).
Thank you very much again for your help