code format

This commit is contained in:
2022-12-14 14:14:33 +03:00
parent 09e5342956
commit cdb02fc9be
278 changed files with 15371 additions and 12176 deletions

View File

@@ -1,34 +1,34 @@
/*
QAD - Qt ADvanced
QAD - Qt ADvanced
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LOGVIEW_H
#define LOGVIEW_H
#include <QWidget>
#include <QIcon>
#include <QImage>
#include <QTextBlockFormat>
#include <QWidget>
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
# include <QRegularExpression>
#else
# include <QRegExp>
typedef QRegExp QRegularExpression;
typedef QRegExp QRegularExpression;
#endif
#include "qad_application_export.h"
@@ -37,19 +37,19 @@ class QTextBlock;
class QAction;
namespace Ui {
class LogView;
class LogView;
}
class QAD_APPLICATION_EXPORT LogView: public QWidget
{
class QAD_APPLICATION_EXPORT LogView: public QWidget {
Q_OBJECT
Q_PROPERTY(bool filterVisible READ isFilterVisible WRITE setFilterVisible)
Q_PROPERTY(int linesLimit READ linesLimit WRITE setLinesLimit)
Q_PROPERTY(QFont logFont READ logFont WRITE setLogFont)
public:
explicit LogView(QWidget * parent = 0);
~LogView();
const QTextEdit * textEdit() const;
void setLogFont(QFont f);
QFont logFont() const;
@@ -58,25 +58,25 @@ public:
int linesLimit() const;
void registerCategory(const QString & label,
QString keyword = QString(),
const QImage & icon = QImage(),
QBrush text_brush = Qt::NoBrush,
QBrush background = Qt::NoBrush,
bool bold = false);
QString keyword = QString(),
const QImage & icon = QImage(),
QBrush text_brush = Qt::NoBrush,
QBrush background = Qt::NoBrush,
bool bold = false);
void registerCategory(const QString & label,
QRegularExpression regexp,
const QImage & icon = QImage(),
QBrush text_brush = Qt::NoBrush,
QBrush background = Qt::NoBrush,
bool bold = false);
QRegularExpression regexp,
const QImage & icon = QImage(),
QBrush text_brush = Qt::NoBrush,
QBrush background = Qt::NoBrush,
bool bold = false);
void removeCategory(QString keyword);
void removeCategory(QRegularExpression regexp);
void clearCategories();
void addText(const QString & text, bool insert_newline = true);
void addText(const QString & text, const QString & keyword, bool insert_newline = true);
private:
struct QAD_APPLICATION_EXPORT Category {
Category();
@@ -88,31 +88,30 @@ private:
QBrush text_brush;
QBrush background;
bool bold;
inline bool operator ==(const Category & it) const {return (regexp.pattern() == it.regexp.pattern());}
inline bool operator==(const Category & it) const { return (regexp.pattern() == it.regexp.pattern()); }
};
void changeEvent(QEvent * e);
void newLine(const QString & keyword);
QSize iconImageSize();
void filterBlock(QTextBlock block, const QString & fs, const QRegularExpression & regexp);
Ui::LogView * ui;
QList<Category> categories;
QTextCharFormat def_cf;
QTextBlockFormat def_bf;
QAction * actionLogSelectAll, * actionLogCopy, * actionLogClear;
QAction *actionLogSelectAll, *actionLogCopy, *actionLogClear;
public slots:
void setFilterVisible(bool yes);
void setLinesLimit(int l);
void clear();
private slots:
void scrollToBottom();
void filter();
signals:
};