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,50 +1,51 @@
/*
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 HISTORYVIEW_H
#define HISTORYVIEW_H
#include <QListWidget>
#include <QDebug>
#include "qad_application_export.h"
#include <QDebug>
#include <QListWidget>
class QAD_APPLICATION_EXPORT HistoryView: public QListWidget
{
class QAD_APPLICATION_EXPORT HistoryView: public QListWidget {
Q_OBJECT
Q_PROPERTY(bool active READ isActive WRITE setActive)
Q_PROPERTY(bool duplicatesEnabled READ isDuplicatesEnabled WRITE setDuplicatesEnabled)
Q_PROPERTY(int limit READ limit WRITE setLimit)
Q_PROPERTY(QColor historyColor READ historyColor WRITE setHistoryColor)
public:
explicit HistoryView(QWidget * parent = 0);
~HistoryView();
bool isActive() const {return active_;}
bool isDuplicatesEnabled() const {return duplicates_;}
int limit() const {return limit_;}
QColor historyColor() const {return color_;}
bool isActive() const { return active_; }
bool isDuplicatesEnabled() const { return duplicates_; }
int limit() const { return limit_; }
QColor historyColor() const { return color_; }
QByteArray current() const;
void addEntry(int action, int count = 0, const QString & suffix = QString());
void registerAction(int action, const QString & text, const QImage & icon = QImage());
private:
struct QAD_APPLICATION_EXPORT Action {
Action(int i = -1, const QString & t = QString(), const QImage & c = QImage()): id(i), text(t) {
@@ -63,31 +64,31 @@ private:
int action;
QByteArray command;
};
void checkLimit();
void changeEvent(QEvent * e);
QString actionText(int action, int count_);
QMap<int, Action> actions_;
QVector<Entry> history_;
QColor color_;
bool active_, duplicates_;
int index, limit_;
public slots:
void setActive(bool yes) {active_ = yes;}
void setDuplicatesEnabled(bool yes) {duplicates_ = yes;}
void setActive(bool yes) { active_ = yes; }
void setDuplicatesEnabled(bool yes) { duplicates_ = yes; }
void setLimit(int l);
void setHistoryColor(const QColor & c);
void clear(bool silent);
void clear() {clear(false);}
void clear() { clear(false); }
void undo();
void redo();
private slots:
void itemClicked(QListWidgetItem * item);
void itemSelectionChanged();
signals:
void undoAvailable(bool);
void redoAvailable(bool);
@@ -95,7 +96,6 @@ signals:
void commandRequest(QByteArray & s);
void commandExecute(const QByteArray & s);
void changed();
};
#endif // HISTORYVIEW_H