File indexing completed on 2024-11-17 04:40:42

0001 /*
0002     This file is part of Akonadi Contact.
0003     SPDX-FileCopyrightText: 2012-2024 Laurent Montel <montel@kde.org>
0004 
0005     SPDX-FileCopyrightText: 2009 Tobias Koenig <tokoe@kde.org>
0006 
0007     SPDX-License-Identifier: LGPL-2.0-or-later
0008 */
0009 
0010 #pragma once
0011 
0012 #include <QTextBrowser>
0013 
0014 namespace Akonadi
0015 {
0016 /**
0017  * A convenience class to remove the 'Copy Link Location' action
0018  * from the context menu of QTextBrowser.
0019  */
0020 class TextBrowser : public QTextBrowser
0021 {
0022     Q_OBJECT
0023 public:
0024     explicit TextBrowser(QWidget *parent = nullptr);
0025 
0026 protected:
0027 #ifndef QT_NO_CONTEXTMENU
0028     void contextMenuEvent(QContextMenuEvent *event) override;
0029 #endif
0030 private:
0031     void slotCopyData();
0032     QVariant mDataToCopy;
0033 };
0034 }