Qconsolewidget
A lightweight Qt console widget
Install / Use
/learn @gapost/QconsolewidgetREADME
QConsoleWidget
part of QDaq (https://gitlab.com/qdaq/qdaq) - Qt-based Data Acquisition
A lightweight Qt5 console widget based on QPlainTextEdit providing also a QIODevice interface.
It can be used as an interactive scripting terminal or a log window. Features include standard console-like editing, command history, formatted input, output & error streams.
TODO: syntax highlighting
Usage
Instantiate the widget and set it to input mode. Connect a QObject slot to the consoleCommand signal to receive the user input.
QConsoleWidget w;
w.writeStdOut("enter command> ");
w.setMode(QConsoleWidget::Input);
QObject::connect(&w,SIGNAL(consoleCommand(QString)),MyQObject,SLOT(evalCommand(QString)))
...
MyQObjet::evalCommand(const QString& code)
{
...
}
Alternatively you can use a QTextStream to interact with QConsoleWidget:
QConsoleWidget w;
w.device()->open(QIODevice::ReadWrite); // open the console's QIODevice
QTextStream stream(w.device());
stream << "Hello World!" << endl; // output goes to the widget
The stream can also be used for input
stream << "Enter an integer n = " << flush;
int n;
stream.device()->waitForReadyRead();
stream >> n;
The call to waitForReadyRead() enters a local loop waiting for
the user to enter a command and hit return.
Example
The included example implements a graphical scripting console for QtScript.

Related Skills
node-connect
345.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
104.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
345.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
345.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
