Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
logviewer.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 Tasuku Suzuki <stasuku@gmail.com>
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
4#include "logviewer.h"
5
6#include <QtGui/QContextMenuEvent>
7#include <QtWidgets/QMenu>
8
9LogViewer::LogViewer(QWidget *parent)
10 : QTextBrowser(parent)
11{
12}
13
14void LogViewer::contextMenuEvent(QContextMenuEvent *event)
15{
16 QMenu *menu = createStandardContextMenu();
17 QAction *action = menu->addAction(tr("Clear"));
18 connect(action, &QAction::triggered, this, &QTextEdit::clear);
19 menu->exec(event->globalPos());
20 delete menu;
21}
void contextMenuEvent(QContextMenuEvent *event) override
Shows the standard context menu created with createStandardContextMenu().
Definition logviewer.cpp:14