mirror of
https://github.com/fralx/LimeReport.git
synced 2025-11-25 00:18:06 +03:00
Define code style and format all source file using clang-format-14
except those placed in 3rdparty directories.
This commit is contained in:
@@ -1,15 +1,16 @@
|
||||
#ifndef LRSCRIPTEDITOR_H
|
||||
#define LRSCRIPTEDITOR_H
|
||||
|
||||
#include <QWidget>
|
||||
#include "lrcompletermodel.h"
|
||||
|
||||
#include <QCompleter>
|
||||
#include <QTextEdit>
|
||||
#include <QKeyEvent>
|
||||
#include <QScrollBar>
|
||||
#include <QStandardItemModel>
|
||||
#include "lrcompletermodel.h"
|
||||
#include <QTextEdit>
|
||||
#include <QWidget>
|
||||
|
||||
namespace LimeReport{
|
||||
namespace LimeReport {
|
||||
|
||||
class ReportEnginePrivateInterface;
|
||||
class BaseDesignIntf;
|
||||
@@ -18,7 +19,7 @@ class BandDesignIntf;
|
||||
class DataSourceManager;
|
||||
|
||||
namespace Ui {
|
||||
class ScriptEditor;
|
||||
class ScriptEditor;
|
||||
}
|
||||
|
||||
struct CacheItem {
|
||||
@@ -26,34 +27,42 @@ struct CacheItem {
|
||||
QList<QSharedPointer<CompleterItem>> slotsItems;
|
||||
};
|
||||
|
||||
class ReportStructureCompleater : public QCompleter{
|
||||
class ReportStructureCompleater: public QCompleter {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ReportStructureCompleater(QObject* parent = 0): QCompleter(parent){ setModel(&m_newModel);}
|
||||
explicit ReportStructureCompleater(QAbstractItemModel* model, QObject* parent = 0)
|
||||
:QCompleter(model, parent){ setModel(&m_newModel);}
|
||||
explicit ReportStructureCompleater(QObject* parent = 0): QCompleter(parent)
|
||||
{
|
||||
setModel(&m_newModel);
|
||||
}
|
||||
explicit ReportStructureCompleater(QAbstractItemModel* model, QObject* parent = 0):
|
||||
QCompleter(model, parent)
|
||||
{
|
||||
setModel(&m_newModel);
|
||||
}
|
||||
|
||||
public:
|
||||
// QCompleter interface
|
||||
QString pathFromIndex(const QModelIndex& index) const;
|
||||
QStringList splitPath(const QString& path) const;
|
||||
void updateCompleaterModel(ReportEnginePrivateInterface* report);
|
||||
void updateCompleaterModel(DataSourceManager* dataManager);
|
||||
|
||||
protected:
|
||||
QStringList extractSignalNames(BaseDesignIntf* item);
|
||||
QStringList extractProperties(BaseDesignIntf* item);
|
||||
void addChildItem(BaseDesignIntf *item, const QString &pageName, CompleterItem *parent);
|
||||
void addAdditionalDatawords(CompleterModel *model, DataSourceManager *dataManager);
|
||||
void addChildItem(BaseDesignIntf* item, const QString& pageName, CompleterItem* parent);
|
||||
void addAdditionalDatawords(CompleterModel* model, DataSourceManager* dataManager);
|
||||
|
||||
private:
|
||||
CompleterModel m_newModel;
|
||||
QMap<QString, QStringList> m_properties;
|
||||
QMap<QString, QStringList> m_signals;
|
||||
};
|
||||
|
||||
class ScriptEditor : public QWidget
|
||||
{
|
||||
class ScriptEditor: public QWidget {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ScriptEditor(QWidget *parent = 0);
|
||||
explicit ScriptEditor(QWidget* parent = 0);
|
||||
~ScriptEditor();
|
||||
void setReportEngine(LimeReport::ReportEnginePrivateInterface* reportEngine);
|
||||
void setReportPage(PageDesignIntf* page);
|
||||
@@ -62,7 +71,7 @@ public:
|
||||
void initCompleter();
|
||||
QByteArray saveState();
|
||||
void restoreState(QByteArray state);
|
||||
void setPlainText(const QString &text);
|
||||
void setPlainText(const QString& text);
|
||||
void setEditorFont(QFont font);
|
||||
QFont editorFont();
|
||||
QString toPlainText();
|
||||
@@ -71,16 +80,17 @@ public:
|
||||
signals:
|
||||
void splitterMoved(int, int);
|
||||
void textChanged();
|
||||
|
||||
protected:
|
||||
void initEditor(DataSourceManager* dm);
|
||||
|
||||
private slots:
|
||||
void on_twData_doubleClicked(const QModelIndex &index);
|
||||
void on_twScriptEngine_doubleClicked(const QModelIndex &index);
|
||||
void on_twData_doubleClicked(const QModelIndex& index);
|
||||
void on_twScriptEngine_doubleClicked(const QModelIndex& index);
|
||||
void slotOnCurrentChanged(const QModelIndex& to, const QModelIndex&);
|
||||
|
||||
private:
|
||||
Ui::ScriptEditor *ui;
|
||||
Ui::ScriptEditor* ui;
|
||||
ReportEnginePrivateInterface* m_reportEngine;
|
||||
PageDesignIntf* m_page;
|
||||
ReportStructureCompleater* m_completer;
|
||||
|
||||
Reference in New Issue
Block a user