Qt之旅---05 状态栏设置

 前提 :必须没有删除状态栏ui

//显示一段时间 状态栏文本google

// ui->statusBar->showMessage(tr("welcom to notepad"),20000);orm

 

//永久显示状态栏文本
    statulab=new QLabel;
    statulab->setMinimumSize(160,30);
    statulab->setFrameShape(QFrame::WinPanel);
    statulab->setFrameShadow(QFrame::Sunken);
    ui->statusBar->addWidget(statulab);
    statulab->setText("Welcome to use notepad");get

 

//状态栏超连接
    QLabel *permanent=new QLabel;
    permanent->setFrameStyle(QFrame::Box|QFrame::Sunken);
    permanent->setText(tr("<a href=\"https://google.com\">google.com</a>"));
    permanent->setTextFormat(Qt::RichText);
    permanent->setOpenExternalLinks(true);
    ui->statusBar->addPermanentWidget(permanent);im

相关文章
相关标签/搜索