Label for tooltip.

This commit is contained in:
Roman Telezhynskyi 2021-05-21 12:03:26 +03:00
parent 9c05894dac
commit 67fc4b7539
2 changed files with 15 additions and 1 deletions

View File

@ -59,7 +59,8 @@ QT_WARNING_POP
VPMainWindow::VPMainWindow(const VPCommandLinePtr &cmd, QWidget *parent) :
VAbstractMainWindow(parent),
ui(new Ui::VPMainWindow),
m_cmd(cmd)
m_cmd(cmd),
m_statusLabel(new QLabel(this))
{
// create a standard sheet
auto *sheet = new VPSheet(m_layout);
@ -90,6 +91,9 @@ VPMainWindow::VPMainWindow(const VPCommandLinePtr &cmd, QWidget *parent) :
m_tileFactory = new VPTileFactory(m_layout, VPApplication::VApp()->Settings());
m_tileFactory->refreshTileInfos();
// init status bar
statusBar()->addPermanentWidget(m_statusLabel, 1);
SetupMenu();
InitProperties();
InitCarrousel();
@ -948,6 +952,12 @@ void VPMainWindow::on_actionNew_triggered()
VPApplication::VApp()->NewMainWindow();
}
//---------------------------------------------------------------------------------------------------------------------
void VPMainWindow::ShowToolTip(const QString &toolTip)
{
m_statusLabel->setText(toolTip);
}
//---------------------------------------------------------------------------------------------------------------------
void VPMainWindow::closeEvent(QCloseEvent *event)
{

View File

@ -90,6 +90,8 @@ public slots:
*/
void on_actionNew_triggered();
virtual void ShowToolTip(const QString &toolTip) override;
protected:
virtual void closeEvent(QCloseEvent *event) override;
virtual void changeEvent(QEvent* event) override;
@ -415,6 +417,8 @@ private:
*/
QLabel* m_mouseCoordinate{nullptr};
QLabel* m_statusLabel{nullptr};
QString curFile{};
bool isInitialized{false};