Seamly2D
Code documentation
VPE::VShortcutEditWidget Class Reference

#include <vshortcutpropertyeditor.h>

Inheritance diagram for VPE::VShortcutEditWidget:
Collaboration diagram for VPE::VShortcutEditWidget:

Public Slots

void setShortcut (const QString &shortcut, bool emit_signal)
 Sets the shortcut. More...
 
void setShortcut (const QKeySequence &shortcut, bool emit_signal)
 Sets the shortcut. More...
 

Signals

void dataChangedByUser (const QKeySequence &sequence, VShortcutEditWidget *editor)
 This signal is emitted when the user changed the current shortcut. More...
 
void commitData (QWidget *editor)
 This signal is emitted whenever dataChangedByUser() gets emmitted and is connected to the delegate's commitData() signal. More...
 

Public Member Functions

 VShortcutEditWidget (QWidget *parent)
 
virtual ~VShortcutEditWidget () Q_DECL_OVERRIDE
 
virtual bool eventFilter (QObject *obj, QEvent *event) Q_DECL_OVERRIDE
 Needed for proper event handling. More...
 
QString getShortcutAsString () const
 Returns the currently set shortcut. More...
 
QKeySequence getShortcut ()
 Returns the currently set shortcut. More...
 

Protected Attributes

QKeySequence CurrentKeySequence
 The current key sequence. More...
 
QLineEdit * LineEdit
 The line to display and edit the key sequence. More...
 

Private Slots

void onTextEdited (const QString &text)
 This slot is called when the user edits the line edit (e.g. by removing or pasting text using the mouse) More...
 

Detailed Description

Definition at line 39 of file vshortcutpropertyeditor.h.

Constructor & Destructor Documentation

◆ VShortcutEditWidget()

VPE::VShortcutEditWidget::VShortcutEditWidget ( QWidget *  parent)
explicit

Definition at line 30 of file vshortcutpropertyeditor.cpp.

References LineEdit, and onTextEdited().

◆ ~VShortcutEditWidget()

VPE::VShortcutEditWidget::~VShortcutEditWidget ( )
virtual

Definition at line 49 of file vshortcutpropertyeditor.cpp.

Member Function Documentation

◆ commitData

void VPE::VShortcutEditWidget::commitData ( QWidget *  editor)
signal

This signal is emitted whenever dataChangedByUser() gets emmitted and is connected to the delegate's commitData() signal.

◆ dataChangedByUser

void VPE::VShortcutEditWidget::dataChangedByUser ( const QKeySequence &  sequence,
VShortcutEditWidget editor 
)
signal

This signal is emitted when the user changed the current shortcut.

◆ eventFilter()

bool VPE::VShortcutEditWidget::eventFilter ( QObject *  obj,
QEvent *  event 
)
virtual

Needed for proper event handling.

Definition at line 54 of file vshortcutpropertyeditor.cpp.

◆ getShortcut()

QKeySequence VPE::VShortcutEditWidget::getShortcut ( )

Returns the currently set shortcut.

Definition at line 86 of file vshortcutpropertyeditor.cpp.

◆ getShortcutAsString()

QString VPE::VShortcutEditWidget::getShortcutAsString ( ) const

Returns the currently set shortcut.

Definition at line 80 of file vshortcutpropertyeditor.cpp.

Referenced by VPE::VShortcutProperty::getEditorData().

◆ onTextEdited

void VPE::VShortcutEditWidget::onTextEdited ( const QString &  text)
privateslot

This slot is called when the user edits the line edit (e.g. by removing or pasting text using the mouse)

Definition at line 109 of file vshortcutpropertyeditor.cpp.

Referenced by VShortcutEditWidget().

◆ setShortcut [1/2]

void VPE::VShortcutEditWidget::setShortcut ( const QKeySequence &  shortcut,
bool  emit_signal 
)
slot

Sets the shortcut.

Parameters
shortcutThe new shortcut \emit_signal If true, this will emit the dataChangedByUser()-signal

Definition at line 96 of file vshortcutpropertyeditor.cpp.

◆ setShortcut [2/2]

void VPE::VShortcutEditWidget::setShortcut ( const QString &  shortcut,
bool  emit_signal 
)
slot

Sets the shortcut.

Parameters
shortcutThe new shortcut \emit_signal If true, this will emit the dataChangedByUser()-signal

Definition at line 91 of file vshortcutpropertyeditor.cpp.

Referenced by VPE::VShortcutProperty::setEditorData().

Member Data Documentation

◆ CurrentKeySequence

QKeySequence VPE::VShortcutEditWidget::CurrentKeySequence
protected

The current key sequence.

Definition at line 81 of file vshortcutpropertyeditor.h.

◆ LineEdit

QLineEdit* VPE::VShortcutEditWidget::LineEdit
protected

The line to display and edit the key sequence.

Definition at line 84 of file vshortcutpropertyeditor.h.

Referenced by VShortcutEditWidget().


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