QHBoxLayout not working properly
Unsolved
General and Desktop
-
I have a very simple code:
m_HBoxLayout = new QHBoxLayout(parent); m_VBoxLayout = new QVBoxLayout(parent); m_ProfilePicture = new QLabel("PFP", parent); m_SlabName = new QLabel("Name", parent); m_StatusMessage = new QLabel("Status", parent); m_HBoxLayout->addWidget(m_ProfilePicture); m_VBoxLayout->addWidget(m_SlabName); m_VBoxLayout->addWidget(m_StatusMessage); m_HBoxLayout->addLayout(m_VBoxLayout);
This is how it looks like after i run it:
Can somebody tell me what have I missed?
I want it to look like something like this:
-
@Batyu said in QHBoxLayout not working properly:
Can somebody tell me what have I missed?
topLevelWidget->setLayout(m_HBoxLayout)
-
Hi,
@Batyu said in QHBoxLayout not working properly:
m_HBoxLayout = new QHBoxLayout(parent);
m_VBoxLayout = new QVBoxLayout(parent);Passing a parent to a layout automatically applies the layout to the parent.