c++ - How to remove this space(margin) from a QWidget form -
i have qwidget form
, have added qtextedit
on form, there space(margin) in top.
i tried utilize following:
qwidget *widget = new qwidget(this); widget->layout()->setcontentsmargins(0,0,0,0);
but unfortunately, did not want.
how remove space(margin) left
, right
, down
side ?
full code
qwidget *widget = new qwidget(this); qtextedit *textedit = new qtextedit(widget); qmdisubwindow *mdiwindows = ui->mdiarea->addsubwindow(widget); mdiwindows->setgeometry(5, 5, 300, 250); mdiwindows->setwindowtitle(finfo.basename()); mdiwindows->setwindowstate(qt::windowmaximized); mdiwindows->layout()->addwidget(textedit); mdiwindows->layout()->setcontentsmargins(0,0,0,0); textedit->settext(cache); widget->setmaximumheight(0); mdiwindows->show();
try addding
widget->layout()->setspacing(0);
c++ qt margin qt5
No comments:
Post a Comment