Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to grab events of QCheckbox inside a QWidget ?

How to grab events of QCheckbox inside a QWidget ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 391 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    FCastle
    wrote on last edited by
    #1

    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.

    artwawA 1 Reply Last reply
    0
    • F FCastle

      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.

      artwawA Offline
      artwawA Offline
      artwaw
      wrote on last edited by
      #2

      @FCastle

      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

      For more information please re-read.

      Kind Regards,
      Artur

      F 1 Reply Last reply
      0
      • artwawA artwaw

        @FCastle

        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
        F Offline
        F Offline
        FCastle
        wrote on last edited by
        #3

        @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 :

        1. User start recording
        2. User click on Checkbox
        3. User stop recording"
        4. User click "Replay"
        5. Software send all events stored in the list of recorded event ( It click the checkbox again)
        artwawA 1 Reply Last reply
        0
        • F FCastle

          @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 :

          1. User start recording
          2. User click on Checkbox
          3. User stop recording"
          4. User click "Replay"
          5. Software send all events stored in the list of recorded event ( It click the checkbox again)
          artwawA Offline
          artwawA Offline
          artwaw
          wrote on last edited by
          #4

          @FCastle Well, good luck then!

          For more information please re-read.

          Kind Regards,
          Artur

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved