refactor: KeySequenceWidget, remove protected copy of public method
This commit is contained in:
parent
3572bd28b6
commit
0944d918b7
2 changed files with 5 additions and 13 deletions
|
|
@ -37,8 +37,8 @@ KeySequenceWidget::KeySequenceWidget(QWidget *parent, const KeySequence &seq)
|
||||||
|
|
||||||
void KeySequenceWidget::setKeySequence(const KeySequence &seq)
|
void KeySequenceWidget::setKeySequence(const KeySequence &seq)
|
||||||
{
|
{
|
||||||
keySequence() = seq;
|
m_KeySequence = seq;
|
||||||
backupSequence() = seq;
|
m_BackupSequence = seq;
|
||||||
|
|
||||||
setStatus(Stopped);
|
setStatus(Stopped);
|
||||||
updateOutput();
|
updateOutput();
|
||||||
|
|
@ -61,7 +61,7 @@ void KeySequenceWidget::mousePressEvent(QMouseEvent *event)
|
||||||
|
|
||||||
void KeySequenceWidget::startRecording()
|
void KeySequenceWidget::startRecording()
|
||||||
{
|
{
|
||||||
keySequence() = KeySequence();
|
m_KeySequence = KeySequence();
|
||||||
setDown(true);
|
setDown(true);
|
||||||
setFocus();
|
setFocus();
|
||||||
grabKeyboard();
|
grabKeyboard();
|
||||||
|
|
@ -71,7 +71,7 @@ void KeySequenceWidget::startRecording()
|
||||||
void KeySequenceWidget::stopRecording()
|
void KeySequenceWidget::stopRecording()
|
||||||
{
|
{
|
||||||
if (!keySequence().valid()) {
|
if (!keySequence().valid()) {
|
||||||
keySequence() = backupSequence();
|
m_KeySequence = backupSequence();
|
||||||
updateOutput();
|
updateOutput();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -101,7 +101,7 @@ bool KeySequenceWidget::event(QEvent *event)
|
||||||
case QEvent::FocusOut:
|
case QEvent::FocusOut:
|
||||||
stopRecording();
|
stopRecording();
|
||||||
if (!valid()) {
|
if (!valid()) {
|
||||||
keySequence() = backupSequence();
|
m_KeySequence = backupSequence();
|
||||||
updateOutput();
|
updateOutput();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -89,14 +89,6 @@ protected:
|
||||||
void updateOutput();
|
void updateOutput();
|
||||||
void startRecording();
|
void startRecording();
|
||||||
void stopRecording();
|
void stopRecording();
|
||||||
KeySequence &keySequence()
|
|
||||||
{
|
|
||||||
return m_KeySequence;
|
|
||||||
}
|
|
||||||
KeySequence &backupSequence()
|
|
||||||
{
|
|
||||||
return m_BackupSequence;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum Status
|
enum Status
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue