Git Product home page Git Product logo

qcommandedit's Introduction

QCommandEdit

A Qt widget, subclass of QLineEdit, for entering commands, with features common in modern shells such as TAB-completion, history, history-search.

Demo application included.

Use the widget just like a QLineEdit widget.

Screenshot

Signals:

  • execute(const QString &cmd) emitted when Return is pressed with some text typed in;
  • askCompletion(const QString &cmd, int cursorPos) emitted when Tab is pressed;
  • escape() emitted when Esc is pressed and the field is empty.

Slots:

  • setHistory(const QStringList &history) for setting the history (the history is not managed by the widget, it must be maintained by the host application, e.g.: in reaction to the execute(const QString &cmd) signal, the command is executed, it is also appended to the history list, and setHistory(const QStringList &history) is called to sync the widget's history);
  • setCompletion(const QStringList &completion) for setting the list of completion (in reaction to askCompletion(const QString &cmd, int cursorPos) signal);
  • acceptCompletion() accepts the current completion (selected text); bound to Return key;
  • cancelCompletion() discards the current completion (selected text); bound to Esc key;
  • setToolTipAtCursor(const QString &tip) show a tooltip placed at cursor position (useful for implementing calltips).

Contribute

If you want to contribute with development, fork and make a pull requests. PRs are very welcome!

If you want to donate, use one of the following methods:

  • BTC: 34RqXSKCgPrVJ8Q266ahiWx3TfV2xAdNKv
  • BCH: 1PwoEfCk7cjjYiC3B9y5JQkCAtZsaZwfxn
  • ETH: 0x3a1Fe92C19609835De3975F64fca4c4aA9B0BDf3
  • LTC: LYTUr4xiMjwii88J8sZ44wWu8GCaCQVx3W
  • XMR: 4GdoN7NCTi8a5gZug7PrwZNKjvHFmKeV11L6pNJPgj5QNEHsN6eeX3DaAQFwZ1ufD4LYCZKArktt113W7QjWvQ7CWCSnRSymAvuG1vvpqi

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.