26 #include <QStringList> 28 #include <QMouseEvent> 33 #include <QListWidget> 65 virtual void showEvent(QShowEvent*);
68 void onItemActivated(QListWidgetItem*);
84 QConsole(QWidget *parent = NULL,
const QString &welcomeText =
"");
86 void setPrompt(
const QString &prompt,
bool display =
true);
88 bool execCommand(
const QString &command,
bool writeCommand =
true,
89 bool showPrompt =
true, QString *result = NULL);
91 void reset(
const QString &welcomeText =
"");
116 void setFont(
const QFont& f);
117 QFont
font()
const {
return currentFont(); }
123 void setFormat(QColor color,
bool bold=
false,
bool italic=
false);
124 void setFormat(
bool bold=
false,
bool italic=
false);
125 void println(
const QString& s);
126 void println(
const std::string& s);
127 void println(
const char* s);
131 void keyPressEvent(QKeyEvent * e);
132 void contextMenuEvent( QContextMenuEvent * event);
135 virtual bool isCommandComplete(
const QString &command);
137 QString getCurrentCommand();
140 void replaceCurrentCommand(
const QString &newCommand);
143 bool isInEditionZone();
144 bool isInEditionZone(
int pos);
147 bool isSelectionInEditionZone();
149 void insertFromMimeData(
const QMimeData *);
155 QColor cmdColor_, errColor_,
outColor_, completionColor;
170 virtual void dragEnterEvent(QDragEnterEvent *e);
171 virtual void dragLeaveEvent(QDragLeaveEvent *e);
172 virtual void dragMoveEvent(QDragMoveEvent *e);
173 virtual void dropEvent(QDropEvent *e);
175 void mousePressEvent(QMouseEvent*);
176 void mouseReleaseEvent(QMouseEvent*);
181 virtual QString interpretCommand(
const QString &command,
int *res);
186 virtual QStringList suggestCommand(
const QString &cmd, QString &prefix);
194 void displayPrompt();
196 void onCursorPositionChanged();
200 void commandExecuted(
const QString &command);
203 void handleTabKeyPress();
204 void handleReturnKeyPress();
205 void handleUpKeyPress();
206 void handleDownKeyPress();
212 SEARCH_NONE, SEARCH_HISTORY)
215 virtual const SearchMode& searchModeCommand(QKeyEvent* event);
216 virtual void enterSearchMode(
const SearchMode& mode);
217 virtual QString getSearchModeDescriptor();
218 virtual QStringList getSearchList();
220 virtual std::multimap<QString, QString> getExtendedSearchList();
226 bool handleSearchKeyEvent(QKeyEvent* event);
228 void overwriteCommand(QString command);
229 void clearCurrentLine();
230 void setCursorToEditZone();
233 void updateSearchMatches();
234 void updateSearchCursor(QString query, QString result,
int index,
int numResults);
236 void handleSearch(
const SearchMode& mode);
237 void handleSearchInput(QKeyEvent* event);
238 void handleSearchReturnKey();
239 void handleSearchEscapeKey();
243 QStringList searchMatches;
244 int searchMatchIndex;
247 QString previousPrompt;
A replacement for enum that can be extended in subclasses.
int historyIndex
Definition: QConsole.h:165
void setCmdColor(QColor c)
Definition: QConsole.h:98
An abstract Qt console.
Definition: QConsole.h:79
specialize cv::DataType for our ImgPixel and inherit from cv::DataType<Vec>
Definition: IOService.h:67
QStringList history
Definition: QConsole.h:163
int promptPosition
Definition: QConsole.h:167
QColor cmdColor() const
get/set command color
Definition: QConsole.h:97
#define MIRA_EXTENSIBLE_ENUM_DECLARE(NAME, BASE, VALUES...)
Definition: ExtensibleEnum.h:331
SearchMode currentSearchMode
Definition: QConsole.h:223
int oldPosition
Definition: QConsole.h:157
QColor errColor() const
get/set error color
Definition: QConsole.h:103
QColor outColor_
Definition: QConsole.h:155
void setOutColor(QColor c)
Definition: QConsole.h:110
ExtensibleEnum is a base for derived classes that can be extensible 'replacements' for enum types...
Definition: ExtensibleEnum.h:285
QString prompt
Definition: QConsole.h:161
void setCompletionColor(QColor c)
Definition: QConsole.h:112
QFont font() const
Definition: QConsole.h:117
QColor outColor() const
get/set output color
Definition: QConsole.h:109
int promptLength
Definition: QConsole.h:159
void setErrColor(QColor c)
Definition: QConsole.h:104