Geometrize  1.0
An application for geometrizing images into geometric primitives
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
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
< CommandLineEditImpl
d
 

Detailed Description

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

Constructor & Destructor Documentation

geometrize::dialog::CommandLineEdit::CommandLineEdit ( QWidget *  parent = nullptr)
explicit
148  : QWidget(parent), d{std::make_unique<CommandLineEdit::CommandLineEditImpl>(this)}
149 {
150 }
std::unique_ptr< CommandLineEditImpl > d
Definition: commandlineedit.h:74
geometrize::dialog::CommandLineEdit::~CommandLineEdit ( )
virtual
153 {
154 }

Member Function Documentation

void geometrize::dialog::CommandLineEdit::changeEvent ( QEvent *  event)
overrideprotected
192 {
193  if (event->type() == QEvent::LanguageChange) {
194  d->onLanguageChange();
195  }
196  QWidget::changeEvent(event);
197 }
std::unique_ptr< CommandLineEditImpl > d
Definition: commandlineedit.h:74
void geometrize::dialog::CommandLineEdit::clearHistory ( )

clearHistory Wipe the history of commands entered this session.

162 {
163  d->clearHistory();
164 }
std::unique_ptr< CommandLineEditImpl > d
Definition: commandlineedit.h:74
bool geometrize::dialog::CommandLineEdit::focusNextPrevChild ( bool  next)
overrideprivatevirtual
182 {
183  return false; // This ensures tab keypresses do not cause the widget to lose focus
184 }
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.
167 {
168  return d->getHistory();
169 }
std::unique_ptr< CommandLineEditImpl > d
Definition: commandlineedit.h:74
void geometrize::dialog::CommandLineEdit::keyPressEvent ( QKeyEvent *  e)
overrideprivatevirtual
157 {
158  d->keyPressEvent(e->key());
159 }
std::unique_ptr< CommandLineEditImpl > d
Definition: commandlineedit.h:74
void geometrize::dialog::CommandLineEdit::mouseDoubleClickEvent ( QMouseEvent *  event)
overrideprivatevirtual
187 {
188  d->mouseDoubleClickEvent();
189 }
std::unique_ptr< CommandLineEditImpl > d
Definition: commandlineedit.h:74
void geometrize::dialog::CommandLineEdit::setCompletionList ( const std::vector< std::string > &  completionList)

setCompletionList Sets the autocomplete list of commands.

Parameters
completionListThe completion list to use.
177 {
178  d->setCompletionList(completionList);
179 }
std::unique_ptr< CommandLineEditImpl > d
Definition: commandlineedit.h:74
void geometrize::dialog::CommandLineEdit::setHistory ( const std::vector< std::string > &  history)

setHistory Sets the history of commands.

Parameters
historyThe command history to use.
172 {
173  d->setHistory(history);
174 }
std::unique_ptr< CommandLineEditImpl > d
Definition: commandlineedit.h:74
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:

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

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

The documentation for this class was generated from the following files: