QT狀態欄QStatusBar

狀態欄顯示的信息分3種
1. 一般信息,用QLabel 代表
2.  永久信息,文本會一直顯示在狀態欄的最右邊。

3. 臨時信息,指定信息現實的時間。時間到即信息消失

 

locationLabel_ = new QLabel("July");

//locationLabel_ = new QLabel;

locationLabel_->setAlignment(Qt::AlignCenter);  //水平居中(HCenter)。

//locationLabel->setMinimumSize(200,15);   //設置控件最小尺度

locationLabel_->setMinimumSize(locationLabel_->sizeHint());

 

aixLabel_ = new QLabel("\"CTRL + H\" for help");

//Optional

//statusBar()->setStyleSheet(QString("QStatusBar::item{border: 0px}")); // 設置不顯示label的邊框

statusBar()->setSizeGripEnabled(false); //設置是否顯示右邊的大小控制點

 

statusBar()->addWidget(locationLabel_);

//statusBar()->addWidget(aixLabel_, 1);

 

QLabel *per1 = new QLabel("Ready1", this);

QLabel *per2 = new QLabel("Ready2", this);

QLabel *per3 = new QLabel("Ready3", this);

statusBar()->addPermanentWidget(per1); //現實永

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章