Ref T166, command input uses history line edit

* tooltip handling
* emit commandEntered
This commit is contained in:
Klaus Basan
2017-09-28 04:30:33 +02:00
parent 3ca352a2a1
commit 92bb17364a
3 changed files with 44 additions and 15 deletions

View File

@@ -12,6 +12,7 @@
#ifndef BLACKGUI_COMPONENTS_COMMANDINPUT_H
#define BLACKGUI_COMPONENTS_COMMANDINPUT_H
#include "blackgui/lineedithistory.h"
#include "blackgui/blackguiexport.h"
#include "blackmisc/identifiable.h"
#include "blackmisc/identifier.h"
@@ -26,9 +27,9 @@ namespace BlackGui
{
namespace Components
{
//! Specialized LineEdit for command inputs
//! Specialized line edit for command inputs
class BLACKGUI_EXPORT CCommandInput :
public QLineEdit,
public BlackGui::CLineEditHistory,
public BlackMisc::CIdentifiable
{
Q_OBJECT
@@ -38,15 +39,18 @@ namespace BlackGui
CCommandInput(QWidget *parent = nullptr);
//! Destructor
~CCommandInput() {}
virtual ~CCommandInput() {}
signals:
//! Command was entered
void commandEntered(const QString &command, const BlackMisc::CIdentifier &originator);
private slots:
private:
//! Basic command validation
void ps_validateCommand();
void validateCommand();
//! Command tooltip
void setCommandTooltip();
};
} // ns
} // ns