Geometrize  1.0
An application for geometrizing images into geometric primitives
Classes | Signals | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
geometrize::dialog::CommandLineEdit Class Reference

The CommandLineEdit class models the UI for the command line in a graphical script console. More...

#include <commandlineedit.h>

Inheritance diagram for geometrize::dialog::CommandLineEdit:
Inheritance graph
[legend]
Collaboration diagram for geometrize::dialog::CommandLineEdit:
Collaboration graph
[legend]

Classes

class  CommandLineEditImpl
 

Signals

void signal_commandSubmitted (const std::string &)
 signal_commandSubmitted is fired when a command is submitted by the user (e.g. after pressing return). More...
 
void signal_historyStepped (const std::string &)
 signal_historyStepped is fired when the user steps through the command line history (e.g. when pressing the up arrow). More...
 

Public Member Functions

 CommandLineEdit (QWidget *parent=nullptr)
 
virtual ~CommandLineEdit ()
 
void clearHistory ()
 clearHistory Wipe the history of commands entered this session. More...
 
std::vector< std::string > getHistory () const
 getHistory Gets the history of commands entered this session, oldest first. More...
 
void setHistory (const std::vector< std::string > &history)
 setHistory Sets the history of commands. More...
 
void setCompletionList (const std::vector< std::string > &completionList)
 setCompletionList Sets the autocomplete list of commands. More...
 

Protected Member Functions

void changeEvent (QEvent *) override
 

Private Member Functions

virtual void keyPressEvent (QKeyEvent *e) override
 
virtual bool focusNextPrevChild (bool next) override
 
virtual void mouseDoubleClickEvent (QMouseEvent *event) override
 

Private Attributes

std::unique_ptr< CommandLineEditImpld
 

Detailed Description

The CommandLineEdit class models the UI for the command line in a graphical script console.

Constructor & Destructor Documentation

◆ CommandLineEdit()

geometrize::dialog::CommandLineEdit::CommandLineEdit ( QWidget *  parent = nullptr)
explicit
149  : QWidget(parent), d{std::make_unique<CommandLineEdit::CommandLineEditImpl>(this)}
150 {
151 }

◆ ~CommandLineEdit()

geometrize::dialog::CommandLineEdit::~CommandLineEdit ( )
virtual
154 {
155 }

Member Function Documentation

◆ changeEvent()

void geometrize::dialog::CommandLineEdit::changeEvent ( QEvent *  event)
overrideprotected
193 {
194  if (event->type() == QEvent::LanguageChange) {
195  d->onLanguageChange();
196  }
197  QWidget::changeEvent(event);
198 }

◆ clearHistory()

void geometrize::dialog::CommandLineEdit::clearHistory ( )

clearHistory Wipe the history of commands entered this session.

163 {
164  d->clearHistory();
165 }

◆ focusNextPrevChild()

bool geometrize::dialog::CommandLineEdit::focusNextPrevChild ( bool  next)
overrideprivatevirtual
183 {
184  return false; // This ensures tab keypresses do not cause the widget to lose focus
185 }

◆ getHistory()

std::vector< std::string > geometrize::dialog::CommandLineEdit::getHistory ( ) const

getHistory Gets the history of commands entered this session, oldest first.

Returns
The history of commands entered this session.
168 {
169  return d->getHistory();
170 }

◆ keyPressEvent()

void geometrize::dialog::CommandLineEdit::keyPressEvent ( QKeyEvent *  e)
overrideprivatevirtual
158 {
159  d->keyPressEvent(e->key());
160 }

◆ mouseDoubleClickEvent()

void geometrize::dialog::CommandLineEdit::mouseDoubleClickEvent ( QMouseEvent *  event)
overrideprivatevirtual
188 {
189  d->mouseDoubleClickEvent();
190 }

◆ setCompletionList()

void geometrize::dialog::CommandLineEdit::setCompletionList ( const std::vector< std::string > &  completionList)

setCompletionList Sets the autocomplete list of commands.

Parameters
completionListThe completion list to use.
178 {
179  d->setCompletionList(completionList);
180 }

◆ setHistory()

void geometrize::dialog::CommandLineEdit::setHistory ( const std::vector< std::string > &  history)

setHistory Sets the history of commands.

Parameters
historyThe command history to use.
173 {
174  d->setHistory(history);
175 }

◆ signal_commandSubmitted

void geometrize::dialog::CommandLineEdit::signal_commandSubmitted ( const std::string &  )
signal

signal_commandSubmitted is fired when a command is submitted by the user (e.g. after pressing return).

Here is the caller graph for this function:

◆ signal_historyStepped

void geometrize::dialog::CommandLineEdit::signal_historyStepped ( const std::string &  )
signal

signal_historyStepped is fired when the user steps through the command line history (e.g. when pressing the up arrow).

Here is the caller graph for this function:

Member Data Documentation

◆ d

std::unique_ptr<CommandLineEditImpl> geometrize::dialog::CommandLineEdit::d
private

The documentation for this class was generated from the following files:
geometrize::dialog::CommandLineEdit::d
std::unique_ptr< CommandLineEditImpl > d
Definition: commandlineedit.h:74