How to grab events of QCheckbox inside a QWidget ?
Unsolved
General and Desktop
-
Hello,
I'm trying to make an application where the user can record a sequence of button clicks, checkbox checks, mouse move, ... And replay it later.
I heard the best is to use an event filter to record interesting events and then replay it later. So I'm trying to get the events of a QCheckbox click but unfortunatly, i can't get any event of it.
QWidget* centralWidget = new QWidget(); centralWidget->setLayout( m_mainLayout ); setCentralWidget( centralWidget ); m_recorder.setObj(centralWidget); // The event filter will be placed on it. addAction( m_console->action() ); statusBar()->addWidget( m_status ); statusBar()->layout()->setMargin( 9 ); QCheckBox *dynamic = new QCheckBox("check 1"); dynamic->setChecked (true); addWidgetToColumn(1,dynamic); // It's adding the QCheckbox in the centralWidget
Has anyone deal with this and can help me ?
Thank you. -
QCheckBox *dynamic = new QCheckBox("check 1"); dynamic->setChecked (true); // use connect(dynamic...) to capture the signal from the checkbox. can be a lambda as well. this is the spot you need to act on. addWidgetToColumn(1,dynamic); // It's adding the QCheckbox in the centralWidget
-
@artwaw Hello, I don't need to get the signal, i just need to get the event of click to replay it later. Here is the step :
- User start recording
- User click on Checkbox
- User stop recording"
- User click "Replay"
- Software send all events stored in the list of recorded event ( It click the checkbox again)