Qt 动态插入窗口到布局,左对齐 m_pMainLayout->addStretch(); m_pMainLayout->addWiget(0,btn,0,Qt::AlignLeft); //插入到下标为0的位置(插入到弹簧的左边)