#include "xstatusbar.h" XStatusBar::XStatusBar(QWidget *parent) : QWidget(parent) { createWidget(); createLayout(); } XStatusBar::~XStatusBar() { delete m_pLabelAppVersion; delete m_pLabelSegVersion; delete m_pLabelNetState; delete m_pBtnUpdate; delete m_pLabel; delete m_pLayout; } void XStatusBar::createWidget() { m_pLabelAppVersion = new QLabel("主程序版本",this); m_pLabelSegVersion = new QLabel("号段版本",this); m_pLabelNetState = new QLabel("网络状态",this); m_pBtnUpdate = new XTextButton("检查更新",this); m_pLabel = new XLabel(this); m_pLabel->setText("test"); m_pLabel->setPixmap(QPixmap(":/images/toolbar/toolbar1.png")); } void XStatusBar::createLayout() { m_pLayout = new QHBoxLayout(this); m_pLayout->addWidget(m_pLabelAppVersion); m_pLayout->addWidget(m_pLabelSegVersion); m_pLayout->addWidget(m_pBtnUpdate); m_pLayout->addStretch(1); m_pLayout->addWidget(m_pLabelNetState); m_pLayout->addStretch(2); m_pLayout->addWidget(m_pLabel); setLayout(m_pLayout); setMouseTracking(true); }