4

Is there a QML widget which behaves like an interactive console? (Or have I to build it manually somehow)

I want to built such console into my qml application - it should behave simmilar to standard unix terminals.

Wojciech Danilo
  • 11,573
  • 17
  • 66
  • 132
  • You have to build it yourself. See this question: http://stackoverflow.com/questions/15945926/implementing-a-gui-shell-in-qt –  Jul 24 '13 at 12:11
  • @Roku Your answer is related to QT not QTQuick, but I suppose in QTQuick I've got to build it manually also. – Wojciech Danilo Jul 24 '13 at 12:17
  • Yes, I know. The easiest way to create this kind of console is still the same (at least in my opinion). I have created and used that kind of console (created from QTextEdit and QLineEdit) and it works really well, even if it is a bit different from common unix terminal. –  Jul 24 '13 at 12:40

1 Answers1

2

There is indeed! Check out https://github.com/Swordfish90/qmltermwidget/ or https://github.com/jorgen/yat.

Here's a short example of how to use QMLTermWidget:

QMLTermWidget {
    id: terminal

    font.family: "Monospace"
    font.pointSize: 12
    colorScheme: "cool-retro-term"

    session: QMLTermSession {
        id: mainsession
        initialWorkingDirectory: "$HOME"
    }

    Component.onCompleted: mainsession.startShellProgram();
}

We're using QMLTermWidget in the Terminal app for Papyros if you're looking for an larger/more complete example of how to use it.

iBelieve
  • 1,502
  • 17
  • 32