Skip to content

Commit

Permalink
feat: show tooltips for recent files (#662)
Browse files Browse the repository at this point in the history
  • Loading branch information
nowhszh committed Aug 8, 2023
1 parent 4b7f4c5 commit 24b475f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ui/src/mainwindow.cpp
Expand Up @@ -75,6 +75,7 @@
#include <QTemporaryFile>
#include <QTextBrowser>
#include <QToolBar>
#include <QToolTip>
#include <QUrl>
#include <QUrlQuery>
#include <QWindow>
Expand Down Expand Up @@ -493,6 +494,9 @@ void MainWindow::createActions()
connect( recentFilesGroup, &QActionGroup::triggered, this, &MainWindow::openFileFromRecent );
for ( auto i = 0u; i < recentFileActions.size(); ++i ) {
recentFileActions[ i ] = new QAction( this );
connect( recentFileActions[ i ], &QAction::hovered, [ this, a = recentFileActions[ i ] ]() {
QToolTip::showText( QCursor::pos(), a->toolTip(), this );
} );
recentFileActions[ i ]->setVisible( false );
recentFileActions[ i ]->setActionGroup( recentFilesGroup );
}
Expand Down

0 comments on commit 24b475f

Please sign in to comment.