Qt 动态插入窗口到布局,左对齐

m_pMainLayout->addStretch();
m_pMainLayout->addWiget(0,btn,0,Qt::AlignLeft);   //插入到下标为0的位置(插入到弹簧的左边)
原文地址:https://www.cnblogs.com/tingtaishou/p/15047295.html