refactor: KeySequenceWidget, remove protected copy of public method

This commit is contained in:
sithlord48
2025-01-04 19:44:04 -05:00
committed by Nick Bolton
parent 3572bd28b6
commit 0944d918b7
2 changed files with 5 additions and 13 deletions

View File

@ -37,8 +37,8 @@ KeySequenceWidget::KeySequenceWidget(QWidget *parent, const KeySequence &seq)
void KeySequenceWidget::setKeySequence(const KeySequence &seq)
{
keySequence() = seq;
backupSequence() = seq;
m_KeySequence = seq;
m_BackupSequence = seq;
setStatus(Stopped);
updateOutput();
@ -61,7 +61,7 @@ void KeySequenceWidget::mousePressEvent(QMouseEvent *event)
void KeySequenceWidget::startRecording()
{
keySequence() = KeySequence();
m_KeySequence = KeySequence();
setDown(true);
setFocus();
grabKeyboard();
@ -71,7 +71,7 @@ void KeySequenceWidget::startRecording()
void KeySequenceWidget::stopRecording()
{
if (!keySequence().valid()) {
keySequence() = backupSequence();
m_KeySequence = backupSequence();
updateOutput();
}
@ -101,7 +101,7 @@ bool KeySequenceWidget::event(QEvent *event)
case QEvent::FocusOut:
stopRecording();
if (!valid()) {
keySequence() = backupSequence();
m_KeySequence = backupSequence();
updateOutput();
}
break;

View File

@ -89,14 +89,6 @@ protected:
void updateOutput();
void startRecording();
void stopRecording();
KeySequence &keySequence()
{
return m_KeySequence;
}
KeySequence &backupSequence()
{
return m_BackupSequence;
}
private:
enum Status