Width of QHBoxLayout is restricted in QDialog
-
Hello,
I'am using a
QDialog
window that opens if a user press a special key or interacts with the menu bar.I create a class that inherits
QDialog
and create a instance ofQHBoxLayout
. If I use the horizontal layout I can see that the width of the layout is cropped /restricted.m_hLayout->addWidget(m_one); m_hLayout->addWidget(m_two); m_hLayout->addWidget(m_three); m_hLayout->addWidget(m_four); //m_groupMag->setFixedSize(500, 700); //adding a fixed size shows the button with the full size. m_groupMag->setLayout(m_hLayout);
One way to correct this is to set the size of the
QWidget
that sets the layout to a fixed size. Nevertheless I think that is can not be the correct way.
If I use theQVBoxLayout
there is no problem with any restriction. The elements are shown with the full size vertically.The dialog window opens with the
showMaximized()
function.
Any idea what the problem is?Kind regards.
-
@makopo said in Width of QHBoxLayout is restricted in QDialog:
m_groupMag
Is this widget also in a layout?