commandline.h
来自「c++的guiQt做的开发」· C头文件 代码 · 共 46 行
H
46 行
#ifndef __COMMANDLINE_H__#define __COMMANDLINE_H__#include <qwidget.h>class QTextEdit;class QLineEdit;class QComboBox;namespace gui {/** Class representing command window<br> The window allow editation of command and show output of previously executed commands*/class CommandLine : public QWidget { Q_OBJECTpublic: CommandLine(QWidget *parent=0); void setAutoCompleter(const QStringList &words); ~CommandLine();public slots: void addCommand(const QString &command); void addError(const QString &message); void addString(const QString &str); void addStringHtml(const QString &str); void clearWindow(); void execute();signals: /** Signal emitted when command is executed from this command window */ void commandExecuted(QString);private: void moveCursorToEnd();private: /** Console widget */ QTextEdit *out; /** Commandline widget */ QLineEdit *cmd; /** History widget */ QComboBox *history;};} // namespace gui#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?