All: Reformat according to new standard
This commit is contained in:
committed by
Kacper Donat
parent
eafd18dac0
commit
25c3ba7338
@@ -31,7 +31,8 @@
|
||||
class QPlainTextEdit;
|
||||
class QPushButton;
|
||||
|
||||
namespace Gui {
|
||||
namespace Gui
|
||||
{
|
||||
|
||||
/**
|
||||
* This class implements an interactive Python interpreter.
|
||||
@@ -48,7 +49,7 @@ public:
|
||||
|
||||
bool push(const char*);
|
||||
int compileCommand(const char*) const;
|
||||
bool hasPendingInput( ) const;
|
||||
bool hasPendingInput() const;
|
||||
void setBuffer(const QStringList&);
|
||||
QStringList getBuffer() const;
|
||||
void clearBuffer();
|
||||
@@ -76,20 +77,20 @@ public:
|
||||
void first();
|
||||
bool more();
|
||||
bool next();
|
||||
bool prev(const QString &prefix = QString());
|
||||
bool prev(const QString& prefix = QString());
|
||||
bool isEmpty() const;
|
||||
const QString& value() const;
|
||||
void append(const QString &inputLine);
|
||||
void append(const QString& inputLine);
|
||||
const QStringList& values() const;
|
||||
void restart();
|
||||
void markScratch( );
|
||||
void doScratch( );
|
||||
void markScratch();
|
||||
void doScratch();
|
||||
|
||||
private:
|
||||
QStringList _history;
|
||||
QStringList _history;
|
||||
QStringList::ConstIterator _it;
|
||||
int _scratchBegin;
|
||||
QString _prefix;
|
||||
int _scratchBegin;
|
||||
QString _prefix;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -97,24 +98,25 @@ private:
|
||||
* @author Werner Mayer
|
||||
*/
|
||||
class PythonConsoleHighlighter;
|
||||
class GuiExport PythonConsole : public PythonTextEditor
|
||||
class GuiExport PythonConsole: public PythonTextEditor
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
enum Prompt {
|
||||
Complete = 0,
|
||||
enum Prompt
|
||||
{
|
||||
Complete = 0,
|
||||
Incomplete = 1,
|
||||
Flush = 2,
|
||||
Special = 3
|
||||
Flush = 2,
|
||||
Special = 3
|
||||
};
|
||||
|
||||
explicit PythonConsole(QWidget *parent = nullptr);
|
||||
explicit PythonConsole(QWidget* parent = nullptr);
|
||||
~PythonConsole() override;
|
||||
|
||||
void OnChange( Base::Subject<const char*> &rCaller,const char* rcReason ) override;
|
||||
void printStatement( const QString& cmd );
|
||||
QString readline( );
|
||||
void OnChange(Base::Subject<const char*>& rCaller, const char* rcReason) override;
|
||||
void printStatement(const QString& cmd);
|
||||
QString readline();
|
||||
int getInputStringPosition() override;
|
||||
QString getInputString() override;
|
||||
|
||||
@@ -127,32 +129,32 @@ public Q_SLOTS:
|
||||
void onFlush();
|
||||
|
||||
private Q_SLOTS:
|
||||
void visibilityChanged (bool visible);
|
||||
void visibilityChanged(bool visible);
|
||||
|
||||
protected:
|
||||
void keyPressEvent ( QKeyEvent * e ) override;
|
||||
void showEvent ( QShowEvent * e ) override;
|
||||
void dropEvent ( QDropEvent * e ) override;
|
||||
void dragEnterEvent ( QDragEnterEvent * e ) override;
|
||||
void dragMoveEvent ( QDragMoveEvent * e ) override;
|
||||
void changeEvent ( QEvent * e ) override;
|
||||
void mouseReleaseEvent( QMouseEvent * e ) override;
|
||||
void keyPressEvent(QKeyEvent* e) override;
|
||||
void showEvent(QShowEvent* e) override;
|
||||
void dropEvent(QDropEvent* e) override;
|
||||
void dragEnterEvent(QDragEnterEvent* e) override;
|
||||
void dragMoveEvent(QDragMoveEvent* e) override;
|
||||
void changeEvent(QEvent* e) override;
|
||||
void mouseReleaseEvent(QMouseEvent* e) override;
|
||||
|
||||
void overrideCursor(const QString& txt);
|
||||
|
||||
/** Pops up the context menu with some extensions */
|
||||
void contextMenuEvent ( QContextMenuEvent* e ) override;
|
||||
bool canInsertFromMimeData ( const QMimeData * source ) const override;
|
||||
QMimeData * createMimeDataFromSelection () const override;
|
||||
void insertFromMimeData ( const QMimeData * source ) override;
|
||||
QTextCursor inputBegin( ) const;
|
||||
void contextMenuEvent(QContextMenuEvent* e) override;
|
||||
bool canInsertFromMimeData(const QMimeData* source) const override;
|
||||
QMimeData* createMimeDataFromSelection() const override;
|
||||
void insertFromMimeData(const QMimeData* source) override;
|
||||
QTextCursor inputBegin() const;
|
||||
|
||||
private:
|
||||
void runSource(const QString&);
|
||||
bool isComment(const QString&) const;
|
||||
void printPrompt(Prompt);
|
||||
void insertPythonOutput(const QString&);
|
||||
void insertPythonError (const QString&);
|
||||
void insertPythonError(const QString&);
|
||||
void runSourceFromMimeData(const QString&);
|
||||
void appendOutput(const QString&, int);
|
||||
void loadHistory() const;
|
||||
@@ -160,15 +162,15 @@ private:
|
||||
void flushOutput();
|
||||
|
||||
Q_SIGNALS:
|
||||
void pendingSource( );
|
||||
void pendingSource();
|
||||
|
||||
private:
|
||||
struct PythonConsoleP* d;
|
||||
|
||||
PythonConsoleHighlighter* pythonSyntax{nullptr};
|
||||
QString *_sourceDrain{nullptr};
|
||||
PythonConsoleHighlighter* pythonSyntax {nullptr};
|
||||
QString* _sourceDrain {nullptr};
|
||||
QString _historyFile;
|
||||
QTimer *flusher{nullptr};
|
||||
QTimer* flusher {nullptr};
|
||||
|
||||
friend class PythonStdout;
|
||||
friend class PythonStderr;
|
||||
@@ -178,18 +180,18 @@ private:
|
||||
* Syntax highlighter for Python console.
|
||||
* @author Werner Mayer
|
||||
*/
|
||||
class GuiExport PythonConsoleHighlighter : public PythonSyntaxHighlighter
|
||||
class GuiExport PythonConsoleHighlighter: public PythonSyntaxHighlighter
|
||||
{
|
||||
public:
|
||||
explicit PythonConsoleHighlighter(QObject* parent);
|
||||
~PythonConsoleHighlighter() override;
|
||||
|
||||
void highlightBlock (const QString & text) override;
|
||||
void highlightBlock(const QString& text) override;
|
||||
|
||||
protected:
|
||||
void colorChanged(const QString& type, const QColor& col) override;
|
||||
};
|
||||
|
||||
} // namespace Gui
|
||||
} // namespace Gui
|
||||
|
||||
#endif // GUI_PYTHONCONSOLE_H
|
||||
#endif // GUI_PYTHONCONSOLE_H
|
||||
|
||||
Reference in New Issue
Block a user