]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Merge branch 'Applications/19.08'
authorNate Graham <nate@kde.org>
Sun, 25 Aug 2019 16:36:26 +0000 (10:36 -0600)
committerNate Graham <nate@kde.org>
Sun, 25 Aug 2019 16:36:26 +0000 (10:36 -0600)
16 files changed:
.gitignore
CMakeLists.txt
src/dolphinmainwindow.cpp
src/dolphintabwidget.cpp
src/dolphinui.rc
src/global.cpp
src/kitemviews/kfileitemmodel.cpp
src/kitemviews/kstandarditemlistwidget.cpp
src/panels/terminal/terminalpanel.cpp
src/settings/general/behaviorsettingspage.cpp
src/settings/services/servicemenuinstaller/servicemenuinstaller.cpp
src/views/dolphinview.cpp
src/views/dolphinview.h
src/views/dolphinviewactionhandler.cpp
src/views/tooltips/tooltipmanager.cpp
src/views/tooltips/tooltipmanager.h

index 59d534347018d8fb0ac9e9aa70cc0901741e9057..c48f92390db5edc685e822fdc67e9900d4765815 100644 (file)
@@ -3,3 +3,4 @@ doxygen.log
 CMakeLists.txt.user
 .directory
 *.kdev4
+/build*/
index 3237a03a28a87de7f9f87901c3c44328a8539ec2..91ce0dfa01a1b1136c42b588b2d03aafc9e1880b 100644 (file)
@@ -2,13 +2,13 @@ cmake_minimum_required(VERSION 3.0)
 
 # KDE Application Version, managed by release script
 set (KDE_APPLICATIONS_VERSION_MAJOR "19")
-set (KDE_APPLICATIONS_VERSION_MINOR "08")
-set (KDE_APPLICATIONS_VERSION_MICRO "0")
+set (KDE_APPLICATIONS_VERSION_MINOR "11")
+set (KDE_APPLICATIONS_VERSION_MICRO "70")
 set (KDE_APPLICATIONS_VERSION "${KDE_APPLICATIONS_VERSION_MAJOR}.${KDE_APPLICATIONS_VERSION_MINOR}.${KDE_APPLICATIONS_VERSION_MICRO}")
 project(Dolphin VERSION ${KDE_APPLICATIONS_VERSION})
 
 set(QT_MIN_VERSION "5.8.0")
-set(KF5_MIN_VERSION "5.57.0")
+set(KF5_MIN_VERSION "5.61.0")
 
 # ECM setup
 find_package(ECM ${KF5_MIN_VERSION} CONFIG REQUIRED)
index 19f7906629ad75dd2145c15d2ea0b37b8c5d93e9..bdf5dbac5298ce4b8acbf7264312a2bb543b4036 100644 (file)
@@ -751,7 +751,7 @@ void DolphinMainWindow::togglePanelLockState()
 
 void DolphinMainWindow::slotTerminalPanelVisibilityChanged()
 {
-    if (m_terminalPanel->isHiddenInVisibleWindow()) {
+    if (m_terminalPanel->isHiddenInVisibleWindow() && m_activeViewContainer) {
         m_activeViewContainer->view()->setFocus();
     }
 }
@@ -1156,6 +1156,7 @@ void DolphinMainWindow::setupActions()
 
     QAction* newWindow = KStandardAction::openNew(this, &DolphinMainWindow::openNewMainWindow, actionCollection());
     newWindow->setText(i18nc("@action:inmenu File", "New &Window"));
+    newWindow->setToolTip(i18nc("@info", "Open a new Dolphin window"));
     newWindow->setWhatsThis(xi18nc("@info:whatsthis", "This opens a new "
         "window just like this one with the current location and view."
         "<nl/>You can drag and drop items between windows."));
@@ -1727,10 +1728,9 @@ void DolphinMainWindow::createControlButton()
 
     m_controlButton = new QToolButton(this);
     m_controlButton->setIcon(QIcon::fromTheme(QStringLiteral("application-menu")));
-    m_controlButton->setText(i18nc("@action", "Control"));
+    m_controlButton->setToolTip(i18nc("@action", "Show menu"));
     m_controlButton->setAttribute(Qt::WidgetAttribute::WA_CustomWhatsThis);
     m_controlButton->setPopupMode(QToolButton::InstantPopup);
-    m_controlButton->setToolButtonStyle(toolBar()->toolButtonStyle());
 
     QMenu* controlMenu = new QMenu(m_controlButton);
     connect(controlMenu, &QMenu::aboutToShow, this, &DolphinMainWindow::updateControlMenu);
@@ -1741,8 +1741,6 @@ void DolphinMainWindow::createControlButton()
     toolBar()->addWidget(m_controlButton);
     connect(toolBar(), &KToolBar::iconSizeChanged,
             m_controlButton, &QToolButton::setIconSize);
-    connect(toolBar(), &KToolBar::toolButtonStyleChanged,
-            m_controlButton, &QToolButton::setToolButtonStyle);
 
     // The added widgets are owned by the toolbar and may get deleted when e.g. the toolbar
     // gets edited. In this case we must add them again. The adding is done asynchronously by
index defd089c16075cf48e1ca31e0a3779eb0aba7faf..afb5462e1ad4fcdc9cff9fdd12a1b705d0c23ca4 100644 (file)
@@ -161,6 +161,7 @@ void DolphinTabWidget::openNewTab(const QUrl& primaryUrl, const QUrl& secondaryU
     QWidget* focusWidget = QApplication::focusWidget();
 
     DolphinTabPage* tabPage = new DolphinTabPage(primaryUrl, secondaryUrl, this);
+    tabPage->setActive(false);
     tabPage->setPlacesSelectorVisible(m_placesSelectorVisible);
     connect(tabPage, &DolphinTabPage::activeViewChanged,
             this, &DolphinTabWidget::activeViewChanged);
index b90321d0592e19d6e1beb3d818b8e4fc180336d9..207c5d4c2d2750c76f2edcba6ed6bf804368cc4d 100644 (file)
@@ -1,5 +1,5 @@
 <!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
-<kpartgui name="dolphin" version="22">
+<kpartgui name="dolphin" version="23">
     <MenuBar>
         <Menu name="file">
             <Action name="new_menu" />
         <Action name="compact" />
         <Action name="details" />
         <Separator name="separator_0" />
-        <Action name="edit_find"/>
-        <Action name="show_preview" />
+        <Action name="sort" />
+        <Spacer name="spacer_0" />
         <Action name="split_view" />
         <Action name="split_stash" />
+        <Action name="edit_find" />
     </ToolBar>
     <ActionProperties scheme="Default">
         <Action priority="0" name="go_back"/>
         <Action priority="0" name="edit_cut"/>
         <Action priority="0" name="edit_copy"/>
         <Action priority="0" name="edit_paste"/>
+        <Action priority="0" name="edit_find"/>
     </ActionProperties>
 </kpartgui>
index 21660a8281a66311216c0a0e41cd314720027b36..12f86a2f369ace55f2dc082acdee69a09f6e479c 100644 (file)
@@ -77,12 +77,6 @@ bool Dolphin::attachToExistingInstance(const QList<QUrl>& inputUrls, bool openFi
         return false;
     }
 
-    const QStringList services = QDBusConnection::sessionBus().interface()->registeredServiceNames().value();
-
-    // Don't match the service without trailing "-" (unique instance)
-    const QString pattern = QStringLiteral("org.kde.dolphin-");
-    // Don't match the pid without leading "-"
-    const QString myPid = QStringLiteral("-") + QString::number(QCoreApplication::applicationPid());
     QVector<QPair<QSharedPointer<QDBusInterface>, QStringList>> dolphinServices;
     if (!preferredService.isEmpty()) {
         QSharedPointer<QDBusInterface> preferred(
@@ -91,11 +85,16 @@ bool Dolphin::attachToExistingInstance(const QList<QUrl>& inputUrls, bool openFi
             QStringLiteral("org.kde.dolphin.MainWindow"))
         );
         if (preferred->isValid() && !preferred->lastError().isValid()) {
-            dolphinServices.append(qMakePair(preferred, QStringList() ));
+            dolphinServices.append(qMakePair(preferred, QStringList()));
         }
     }
 
     // find all dolphin instances
+    const QStringList services = QDBusConnection::sessionBus().interface()->registeredServiceNames().value();
+    // Don't match the service without trailing "-" (unique instance)
+    const QString pattern = QStringLiteral("org.kde.dolphin-");
+    // Don't match the pid without leading "-"
+    const QString myPid = QStringLiteral("-") + QString::number(QCoreApplication::applicationPid());
     for (const QString& service : services) {
         if (service.startsWith(pattern) && !service.endsWith(myPid)) {
             // Check if instance can handle our URLs
@@ -104,10 +103,9 @@ bool Dolphin::attachToExistingInstance(const QList<QUrl>& inputUrls, bool openFi
                 QStringLiteral("/dolphin/Dolphin_1"),
                 QStringLiteral("org.kde.dolphin.MainWindow"))
             );
-            if (!instance->isValid() || instance->lastError().isValid()) {
-                continue;
+            if (instance->isValid() && !instance->lastError().isValid()) {
+                dolphinServices.append(qMakePair(instance, QStringList()));
             }
-            dolphinServices.append(qMakePair(instance, QStringList()));
         }
     }
 
@@ -124,9 +122,9 @@ bool Dolphin::attachToExistingInstance(const QList<QUrl>& inputUrls, bool openFi
         for (auto& service: dolphinServices) {
             QDBusReply<bool> isUrlOpen = service.first->call(QStringLiteral("isUrlOpen"), url);
             if (isUrlOpen.isValid() && isUrlOpen.value()) {
-                    service.second.append(url);
-                    urlFound = true;
-                    break;
+                service.second.append(url);
+                urlFound = true;
+                break;
             }
         }
         if (!urlFound) {
index 8145a00f11ba1f2fc22bd9f7aca0679c3ddfdfdb..de974e7e9726e9795615fa29e171c85892f52bca 100644 (file)
@@ -1905,28 +1905,35 @@ QList<QPair<int, QVariant> > KFileItemModel::nameRoleGroups() const
         if (firstChar != newFirstChar) {
             QString newGroupValue;
             if (newFirstChar.isLetter()) {
-                // Try to find a matching group in the range 'A' to 'Z'.
-                static std::vector<QChar> lettersAtoZ;
-                lettersAtoZ.reserve('Z' - 'A' + 1);
-                if (lettersAtoZ.empty()) {
-                    for (char c = 'A'; c <= 'Z'; ++c) {
-                        lettersAtoZ.push_back(QLatin1Char(c));
+
+                if (m_collator.compare(newFirstChar, QChar(QLatin1Char('A'))) >= 0 && m_collator.compare(newFirstChar, QChar(QLatin1Char('Z'))) <= 0) {
+                    // WARNING! Symbols based on latin 'Z' like 'Z' with acute are treated wrong as non Latin and put in a new group.
+
+                    // Try to find a matching group in the range 'A' to 'Z'.
+                    static std::vector<QChar> lettersAtoZ;
+                    lettersAtoZ.reserve('Z' - 'A' + 1);
+                    if (lettersAtoZ.empty()) {
+                        for (char c = 'A'; c <= 'Z'; ++c) {
+                            lettersAtoZ.push_back(QLatin1Char(c));
+                        }
                     }
-                }
 
-                auto localeAwareLessThan = [this](QChar c1, QChar c2) -> bool {
-                    return m_collator.compare(c1, c2) < 0;
-                };
+                    auto localeAwareLessThan = [this](QChar c1, QChar c2) -> bool {
+                        return m_collator.compare(c1, c2) < 0;
+                    };
 
-                std::vector<QChar>::iterator it = std::lower_bound(lettersAtoZ.begin(), lettersAtoZ.end(), newFirstChar, localeAwareLessThan);
-                if (it != lettersAtoZ.end()) {
-                    if (localeAwareLessThan(newFirstChar, *it) && it != lettersAtoZ.begin()) {
-                        // newFirstChar belongs to the group preceding *it.
-                        // Example: for an umlaut 'A' in the German locale, *it would be 'B' now.
-                        --it;
+                    std::vector<QChar>::iterator it = std::lower_bound(lettersAtoZ.begin(), lettersAtoZ.end(), newFirstChar, localeAwareLessThan);
+                    if (it != lettersAtoZ.end()) {
+                        if (localeAwareLessThan(newFirstChar, *it)) {
+                            // newFirstChar belongs to the group preceding *it.
+                            // Example: for an umlaut 'A' in the German locale, *it would be 'B' now.
+                            --it;
+                        }
+                        newGroupValue = *it;
                     }
-                    newGroupValue = *it;
+
                 } else {
+                    // Symbols from non Latin-based scripts
                     newGroupValue = newFirstChar;
                 }
             } else if (newFirstChar >= QLatin1Char('0') && newFirstChar <= QLatin1Char('9')) {
index 15c01726fa8b972775d71880bee0ca4cc7298f2d..296cd9bbbfbbbfabce6d14436d914c37411ae103 100644 (file)
@@ -1165,7 +1165,7 @@ void KStandardItemListWidget::updateIconsLayoutTextCache()
                 do {
                     QString lastTextLine = nameText.mid(line.textStart());
                     lastTextLine = m_customizedFontMetrics.elidedText(lastTextLine,
-                                                                      Qt::ElideRight,
+                                                                      Qt::ElideMiddle,
                                                                       elidingWidth);
                     const QString elidedText = nameText.left(line.textStart()) + lastTextLine;
                     nameTextInfo->staticText.setText(elidedText);
@@ -1221,7 +1221,7 @@ void KStandardItemListWidget::updateIconsLayoutTextCache()
             textLine.setLineWidth(maxWidth);
             requiredWidth = textLine.naturalTextWidth();
             if (requiredWidth > maxWidth) {
-                const QString elidedText = m_customizedFontMetrics.elidedText(text, Qt::ElideRight, maxWidth);
+                const QString elidedText = m_customizedFontMetrics.elidedText(text, Qt::ElideMiddle, maxWidth);
                 textInfo->staticText.setText(elidedText);
                 requiredWidth = m_customizedFontMetrics.width(elidedText);
             } else if (role == "rating") {
@@ -1270,7 +1270,7 @@ void KStandardItemListWidget::updateCompactLayoutTextCache()
         qreal requiredWidth = m_customizedFontMetrics.width(text);
         if (requiredWidth > maxWidth) {
             requiredWidth = maxWidth;
-            const QString elidedText = m_customizedFontMetrics.elidedText(text, Qt::ElideRight, maxWidth);
+            const QString elidedText = m_customizedFontMetrics.elidedText(text, Qt::ElideMiddle, maxWidth);
             textInfo->staticText.setText(elidedText);
         }
 
@@ -1327,7 +1327,7 @@ void KStandardItemListWidget::updateDetailsLayoutTextCache()
         }
 
         if (requiredWidth > availableTextWidth) {
-            text = m_customizedFontMetrics.elidedText(text, Qt::ElideRight, availableTextWidth);
+            text = m_customizedFontMetrics.elidedText(text, Qt::ElideMiddle, availableTextWidth);
             requiredWidth = m_customizedFontMetrics.width(text);
         }
 
index 52d2a77df7a31dd08b8a26c76f49080e88789388..86974d200e4d23190222367c07b86d226037e813 100644 (file)
@@ -82,16 +82,14 @@ void TerminalPanel::terminalExited()
 bool TerminalPanel::isHiddenInVisibleWindow() const
 {
     return parentWidget()
-        && parentWidget()->isHidden()
-        && m_terminal
-        && !hasProgramRunning();
+        && parentWidget()->isHidden();
 }
 
 void TerminalPanel::dockVisibilityChanged()
 {
     // Only react when the DockWidget itself (not some parent) is hidden. This way we don't
     // respond when e.g. Dolphin is minimized.
-    if (isHiddenInVisibleWindow()) {
+    if (isHiddenInVisibleWindow() && m_terminal && !hasProgramRunning()) {
         // Make sure that the following "cd /" command will not affect the view.
         disconnect(m_konsolePart, SIGNAL(currentDirectoryChanged(QString)),
                    this, SLOT(slotKonsolePartCurrentDirectoryChanged(QString)));
index c7a909ecaafcb0cae16323dff12976dcd40edf77..df7ea21135f62b55e6d224ab3d0ad9bd5f610d36 100644 (file)
@@ -50,7 +50,7 @@ BehaviorSettingsPage::BehaviorSettingsPage(const QUrl& url, QWidget* parent) :
     // View properties
     m_globalViewProps = new QRadioButton(i18nc("@option:radio", "Use common properties for all folders"));
     m_localViewProps = new QRadioButton(i18nc("@option:radio", "Remember properties for each folder"));
-    m_localViewProps->setToolTip(i18nc("@info", "Dolphin will create an hidden .directory file in each folder you change view properties for."));
+    m_localViewProps->setToolTip(i18nc("@info", "Dolphin will create a hidden .directory file in each folder you change view properties for."));
 
     QButtonGroup* viewGroup = new QButtonGroup(this);
     viewGroup->addButton(m_globalViewProps);
index 037874539d76d3b2f53be877765fd582ddedc752..1144a50b88cfa8ab2c9a9a99237f419e6d2b1966 100644 (file)
@@ -24,6 +24,7 @@
 #include <QDir>
 #include <QDirIterator>
 #include <QCommandLineParser>
+#include <QMimeDatabase>
 
 #include <KLocalizedString>
 
@@ -42,41 +43,6 @@ Q_NORETURN void fail(const QString &str)
     exit(1);
 }
 
-bool evaluateShell(const QString &program, const QStringList &arguments, QString &output, QString &errorText)
-{
-    QProcess process;
-    process.start(program, arguments, QIODevice::ReadOnly);
-    if (!process.waitForStarted()) {
-        fail(i18n("Failed to run process: %1 %2", program, arguments.join(" ")));
-    }
-
-    if (!process.waitForFinished()) {
-        fail(i18n("Process did not finish in reasonable time: %1 %2", program, arguments.join(" ")));
-    }
-
-    const auto stdoutResult = QString::fromUtf8(process.readAllStandardOutput()).trimmed();
-    const auto stderrResult = QString::fromUtf8(process.readAllStandardError()).trimmed();
-
-    if (process.exitStatus() == QProcess::NormalExit && process.exitCode() == 0) {
-        output = stdoutResult;
-        return true;
-    } else {
-        errorText = stderrResult + stdoutResult;
-        return false;
-    }
-}
-
-QString mimeType(const QString &path)
-{
-    QString result;
-    QString errorText;
-    if (evaluateShell("xdg-mime", QStringList{"query", "filetype", path}, result, errorText)) {
-        return result;
-    } else {
-        fail(i18n("Failed to run xdg-mime %1: %2", path, errorText));
-    }
-}
-
 QString getServiceMenusDir()
 {
     const QString dataLocation = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation);
@@ -114,7 +80,7 @@ void runUncompress(const QString &inputPath, const QString &outputPath) {
                                           "multipart/x-zip"},
                               UncompressCommand{"unzip", QStringList{}, QStringList{"-d"}}});
 
-    const auto mime = mimeType(inputPath);
+    const auto mime = QMimeDatabase().mimeTypeForFile(inputPath).name();
 
     UncompressCommand command{};
     for (const auto &pair : mimeTypeToCommand) {
index 5b00fa36dcceefb6ca1b35f350e16512d1281f77..e6b232dcc14ed1d0f7a153f2bffa9d369b485a98 100644 (file)
@@ -128,8 +128,8 @@ DolphinView::DolphinView(const QUrl& url, QWidget* parent) :
     m_container = new KItemListContainer(controller, this);
     m_container->installEventFilter(this);
     setFocusProxy(m_container);
-    connect(m_container->horizontalScrollBar(), &QScrollBar::valueChanged, this, &DolphinView::hideToolTip);
-    connect(m_container->verticalScrollBar(), &QScrollBar::valueChanged, this, &DolphinView::hideToolTip);
+    connect(m_container->horizontalScrollBar(), &QScrollBar::valueChanged, this, [=] { hideToolTip(); });
+    connect(m_container->verticalScrollBar(), &QScrollBar::valueChanged, this, [=] { hideToolTip(); });
 
     controller->setSelectionBehavior(KItemListController::MultiSelection);
     connect(controller, &KItemListController::itemActivated, this, &DolphinView::slotItemActivated);
@@ -744,6 +744,7 @@ bool DolphinView::eventFilter(QObject* watched, QEvent* event)
         break;
 
     case QEvent::KeyPress:
+        hideToolTip(ToolTipManager::HideBehavior::Instantly);
         if (GeneralSettings::useTabForSwitchingSplitView()) {
             QKeyEvent* keyEvent = static_cast<QKeyEvent*>(event);
             if (keyEvent->key() == Qt::Key_Tab && keyEvent->modifiers() == Qt::NoModifier) {
@@ -1414,11 +1415,11 @@ void DolphinView::updateViewState()
     }
 }
 
-void DolphinView::hideToolTip()
+void DolphinView::hideToolTip(const ToolTipManager::HideBehavior behavior)
 {
 #ifdef HAVE_BALOO
     if (GeneralSettings::showToolTips()) {
-        m_toolTipManager->hideToolTip();
+        m_toolTipManager->hideToolTip(behavior);
     }
 #endif
 }
index 7be2eed2d41ca36bb454b2d0602df0ec060d13b4..a4da92f2db317250dbe81b368781a2d78a3a6999 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "dolphintabwidget.h"
 #include "dolphin_export.h"
+#include "tooltips/tooltipmanager.h"
 
 #include <KFileItem>
 #include <KIO/Job>
@@ -697,8 +698,6 @@ private slots:
      */
     void updateViewState();
 
-    void hideToolTip();
-
     /**
      * Calculates the number of currently shown files into
      * \a fileCount and the number of folders into \a folderCount.
@@ -733,6 +732,11 @@ private:
      */
     void applyModeToView();
 
+    /**
+     * Hides tooltip displayed over element.
+     */
+    void hideToolTip(const ToolTipManager::HideBehavior behavior = ToolTipManager::HideBehavior::Later);
+
     /**
      * Helper method for DolphinView::paste() and DolphinView::pasteIntoFolder().
      * Pastes the clipboard data into the URL \a url.
index 41752e4f158e1f6c20695f635a6debc627a9b2e5..5746bb7cf76c7f6c4dfe9e5850c411104062301f 100644 (file)
@@ -163,7 +163,7 @@ void DolphinViewActionHandler::createActions()
         "</interface> option is enabled.</para>"));
     compactAction->setWhatsThis(xi18nc("@info:whatsthis Compact view mode",
         "<para>This switches to a compact view mode that lists the folders "
-        "and files in columns with the names beside the icons. <para></para>"
+        "and files in columns with the names beside the icons.</para><para>"
         "This helps to keep the overview in folders with many items.</para>"));
     detailsAction->setWhatsThis(xi18nc("@info:whatsthis Details view mode",
         "<para>This switches to a list view mode that focuses on folder "
@@ -191,7 +191,7 @@ void DolphinViewActionHandler::createActions()
     QAction* zoomOutAction = KStandardAction::zoomOut(this,
                              &DolphinViewActionHandler::zoomOut,
                              m_actionCollection);
-    zoomOutAction->setWhatsThis(i18nc("@info:whatsthis zoom in", "This reduces the icon size."));
+    zoomOutAction->setWhatsThis(i18nc("@info:whatsthis zoom out", "This reduces the icon size."));
 
     KToggleAction* showPreview = m_actionCollection->add<KToggleAction>(QStringLiteral("show_preview"));
     showPreview->setText(i18nc("@action:intoolbar", "Preview"));
@@ -280,7 +280,7 @@ void DolphinViewActionHandler::createActions()
 QActionGroup* DolphinViewActionHandler::createFileItemRolesActionGroup(const QString& groupPrefix)
 {
     const bool isSortGroup = (groupPrefix == QLatin1String("sort_by_"));
-    Q_ASSERT(isSortGroup || (!isSortGroup && groupPrefix == QLatin1String("show_")));
+    Q_ASSERT(isSortGroup || groupPrefix == QLatin1String("show_"));
 
     QActionGroup* rolesActionGroup = new QActionGroup(m_actionCollection);
     rolesActionGroup->setExclusive(isSortGroup);
index aae97458cfd6bbadfb606840366fec6b7765da7e..eaa78598732c12ba966181146535ad8e8e6939d4 100644 (file)
@@ -104,7 +104,7 @@ void ToolTipManager::showToolTip(const KFileItem& item, const QRectF& itemRect,
     Q_ASSERT(!m_metaDataRequested);
 }
 
-void ToolTipManager::hideToolTip()
+void ToolTipManager::hideToolTip(const HideBehavior behavior)
 {
     if (m_appliedWaitCursor) {
         QApplication::restoreOverrideCursor();
@@ -116,7 +116,14 @@ void ToolTipManager::hideToolTip()
     m_showToolTipTimer->stop();
     m_contentRetrievalTimer->stop();
     if (m_tooltipWidget) {
-        m_tooltipWidget->hideLater();
+        switch (behavior) {
+        case HideBehavior::Instantly:
+            m_tooltipWidget->hide();
+            break;
+        case HideBehavior::Later:
+            m_tooltipWidget->hideLater();
+            break;
+        }
     }
 }
 
index 10f88ad76e6cad0dc9a2ad96118bb925d6780bff..c09a40d31c9a84df777758aacce68cba4a72cf29 100644 (file)
@@ -42,6 +42,11 @@ class ToolTipManager : public QObject
     Q_OBJECT
 
 public:
+    enum class HideBehavior {
+        Instantly,
+        Later
+    };
+
     explicit ToolTipManager(QWidget* parent);
     ~ToolTipManager() override;
 
@@ -56,7 +61,7 @@ public:
     /**
      * Hides the currently shown tooltip.
      */
-    void hideToolTip();
+    void hideToolTip(const HideBehavior behavior = HideBehavior::Later);
 
 signals:
     /**