⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 statusbar.cc

📁 c++的guiQt做的开发
💻 CC
字号:
/** @file StatusBar - class representing Status bar @author Martin Petricek*/#include "statusbar.h"#include <QColor>#include <qlabel.h>#include <qtimer.h>#include <qlayout.h>namespace gui {using namespace std;/** Constructor of StatusBar @param parent Parent window of this dialog*/StatusBar::StatusBar(QWidget *parent/*=0*/) : QStatusBar(parent) { //Seelction coords coords=new QLabel(" ",this); coords->setMargin(2); coords->setTextFormat(Qt::PlainText); addPermanentWidget(coords,0); //Add informational label to right info=new QLabel(" ",this); info->setMargin(2); info->setTextFormat(Qt::PlainText); addPermanentWidget(info,0); //Add label to right with zoom level zoom=new QLabel(" ",this); zoom->setMargin(2); zoom->setTextFormat(Qt::PlainText); addPermanentWidget(zoom,0); //Add message label to left msgLabel=new QLabel(" ",this); msgLabel->setMargin(2);// msgLabel->setWordWrap(true) msgLabel->setTextFormat(Qt::PlainText); addWidget(msgLabel,8);}/** Set text shown in informational label @param theMessage new text*/void StatusBar::receiveInfoText(const QString &theMessage) { info->setText(" "+theMessage+" ");}/** Set text shown as zoom level @param theMessage new text*/void StatusBar::receiveZoomText(const QString &theMessage) { zoom->setText(" "+theMessage+" ");}/** Set text shown as coords @param theMessage new text*/void StatusBar::receiveCoordsText(const QString &theMessage) { coords->setText(" "+theMessage+" ");}/** Set text shown in message label @param theMessage new text*/void StatusBar::message(const QString &theMessage) { msgLabel->setText(theMessage);}/** default destructor */StatusBar::~StatusBar() {}} // namespace gui

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -