QGIS API Documentation 3.99.0-Master (c22de0620c0)
Loading...
Searching...
No Matches
qgsmessagelogviewer.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsmessagelogviewer.h - description
3 -------------------
4 begin : October 2011
5 copyright : (C) 2011 by Juergen E. Fischer
6 email : jef at norbit dot de
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17#ifndef QGSMESSAGELOGVIEWER_H
18#define QGSMESSAGELOGVIEWER_H
19
20#include "ui_qgsmessagelogviewer.h"
21
22#include "qgis_gui.h"
23#include "qgis_sip.h"
24#include "qgsguiutils.h"
25#include "qgsmessagelog.h"
26
27#include <QMenu>
28#include <QString>
29
30class QStatusBar;
31class QCloseEvent;
32
37class GUI_EXPORT QgsMessageLogViewer : public QDialog, private Ui::QgsMessageLogViewer
38{
39 Q_OBJECT
40 public:
45 QgsMessageLogViewer( QWidget *parent SIP_TRANSFERTHIS = nullptr, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags );
46
47 public slots:
48
54 void logMessage( const QString &message, const QString &tag, Qgis::MessageLevel level, Qgis::StringFormat format = Qgis::StringFormat::PlainText );
55
61 void showTab( const QString &tag );
62
63 protected:
64 void closeEvent( QCloseEvent *e ) override;
65 void reject() override;
66 bool eventFilter( QObject *obj, QEvent *ev ) override;
67
68 private slots:
69 void showContextMenuForTabBar( QPoint point );
70 void closeTab( int index );
71
72 private:
73 QString mClickedAnchor;
74 QMenu *mTabBarContextMenu = nullptr;
75 int mMessageLoggedCount = 0;
76};
77
78#endif
MessageLevel
Level for messages This will be used both for message log and message bar in application.
Definition qgis.h:158
StringFormat
Format of log message.
Definition qgis.h:173
@ PlainText
Text message.
Definition qgis.h:174
void closeEvent(QCloseEvent *e) override
bool eventFilter(QObject *obj, QEvent *ev) override
void logMessage(const QString &message, const QString &tag, Qgis::MessageLevel level, Qgis::StringFormat format=Qgis::StringFormat::PlainText)
Logs a message to the viewer.
void showTab(const QString &tag)
Activates the tab whose title matches the given tag, if any.
QgsMessageLogViewer(QWidget *parent=nullptr, Qt::WindowFlags fl=QgsGuiUtils::ModalDialogFlags)
Create a new message log viewer.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:52