1 #include "CutterTreeWidget.h" 2 #include "core/MainWindow.h" 3 CutterTreeWidget(QObject * parent)4CutterTreeWidget::CutterTreeWidget(QObject *parent) : 5 QObject(parent), 6 bar(nullptr) 7 {} 8 addStatusBar(QVBoxLayout * pos)9void CutterTreeWidget::addStatusBar(QVBoxLayout *pos) 10 { 11 if(!bar) { 12 bar = new QStatusBar; 13 QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum); 14 bar->setSizePolicy(sizePolicy); 15 pos->addWidget(bar); 16 } 17 } 18 showItemsNumber(int count)19void CutterTreeWidget::showItemsNumber(int count) 20 { 21 if(bar){ 22 bar->showMessage(tr("%1 Items").arg(count)); 23 } 24 } 25 showStatusBar(bool show)26void CutterTreeWidget::showStatusBar(bool show) 27 { 28 bar->setVisible(show); 29 } 30 ~CutterTreeWidget()31CutterTreeWidget::~CutterTreeWidget() {} 32