<commit_before>#include <sequanto/QtWidgetNode.h>
#include <sequanto/QtWrapper.h>
#include <sequanto/QtUnnamedObjectStore.h>
#include <sequanto/QtUiTypeProperty.h>
#include <sequanto/ui.h>
#include <cassert>

using namespace sequanto::automation;

QtWidgetNode::QtWidgetNode( QWidget * _widget )
    : ListNode(QtWrapper::GetObjectName(_widget) ),
      m_widget(_widget)
{
   m_eventFilter = new QtWidgetAutomationEventFilter(this);
   m_widget->installEventFilter( m_eventFilter );
}

SQWidgetType QtWidgetNode::type () const
{
   QtUiTypeProperty * typeProperty = dynamic_cast<QtUiTypeProperty*>(FindChild(SQ_UI_WIDGET_TYPE));
   if ( typeProperty != NULL )
   {
      return typeProperty->type();
   }
   else
   {
      return SQ_WIDGET_TYPE_UNKNOWN;
   }
}

void QtWidgetNode::SendChildrenUpdate ()
{
   ListNode * childrenNode = dynamic_cast<ListNode*>(this->FindChild ( SQ_UI_COMMON_BASE_CHILDREN ) );
   if ( childrenNode != NULL )
   {
      childrenNode->SendUpdate ();
   }
}

void QtWidgetNode::SendPositionUpdateForAllChildren()
{
   PropertyNode * xNode = dynamic_cast<PropertyNode*>( this->FindChild ( SQ_UI_WIDGET_X ) );
   if( xNode != NULL )
   {
      xNode->SendUpdate();
   }
   
   PropertyNode * yNode = dynamic_cast<PropertyNode*>( this->FindChild ( SQ_UI_WIDGET_Y ) );
   if( yNode != NULL )
   {
      yNode->SendUpdate();
   }
   
   ListNode * childrenNode = dynamic_cast<ListNode*>( this->FindChild ( SQ_UI_COMMON_BASE_CHILDREN ) );
   if ( childrenNode != NULL )
   {
      ListNode::Iterator * it = childrenNode->ListChildren();
      for ( ; it->HasNext(); it->Next() )
      {
         QtWidgetNode * node = dynamic_cast<QtWidgetNode*>(it->GetCurrent());
         if ( node != NULL )
         {
            node->SendPositionUpdateForAllChildren();
         }
      }
      delete it;
   }
}

void QtWidgetNode::SendUpdateForAllChildren()
{
   qDebug() << "SendUpdateForAllChildren " << this->GetFullName().c_str();
   
   ListNode::Iterator * it = ListChildren();
   for ( ; it->HasNext(); it->Next() )
   {
       PropertyNode * node = dynamic_cast<PropertyNode*>( it->GetCurrent() );
       if ( node != NULL )<commit_msg>Remove qDebug output.<commit_after>#include <sequanto/QtWidgetNode.h>
#include <sequanto/QtWrapper.h>
#include <sequanto/QtUnnamedObjectStore.h>
#include <sequanto/QtUiTypeProperty.h>
#include <sequanto/ui.h>
#include <cassert>

using namespace sequanto::automation;

QtWidgetNode::QtWidgetNode( QWidget * _widget )
    : ListNode(QtWrapper::GetObjectName(_widget) ),
      m_widget(_widget)
{
   m_eventFilter = new QtWidgetAutomationEventFilter(this);
   m_widget->installEventFilter( m_eventFilter );
}

SQWidgetType QtWidgetNode::type () const
{
   QtUiTypeProperty * typeProperty = dynamic_cast<QtUiTypeProperty*>(FindChild(SQ_UI_WIDGET_TYPE));
   if ( typeProperty != NULL )
   {
      return typeProperty->type();
   }
   else
   {
      return SQ_WIDGET_TYPE_UNKNOWN;
   }
}

void QtWidgetNode::SendChildrenUpdate ()
{
   ListNode * childrenNode = dynamic_cast<ListNode*>(this->FindChild ( SQ_UI_COMMON_BASE_CHILDREN ) );
   if ( childrenNode != NULL )
   {
      childrenNode->SendUpdate ();
   }
}

void QtWidgetNode::SendPositionUpdateForAllChildren()
{
   PropertyNode * xNode = dynamic_cast<PropertyNode*>( this->FindChild ( SQ_UI_WIDGET_X ) );
   if( xNode != NULL )
   {
      xNode->SendUpdate();
   }
   
   PropertyNode * yNode = dynamic_cast<PropertyNode*>( this->FindChild ( SQ_UI_WIDGET_Y ) );
   if( yNode != NULL )
   {
      yNode->SendUpdate();
   }
   
   ListNode * childrenNode = dynamic_cast<ListNode*>( this->FindChild ( SQ_UI_COMMON_BASE_CHILDREN ) );
   if ( childrenNode != NULL )
   {
      ListNode::Iterator * it = childrenNode->ListChildren();
      for ( ; it->HasNext(); it->Next() )
      {
         QtWidgetNode * node = dynamic_cast<QtWidgetNode*>(it->GetCurrent());
         if ( node != NULL )
         {
            node->SendPositionUpdateForAllChildren();
         }
      }
      delete it;
   }
}

void QtWidgetNode::SendUpdateForAllChildren()
{
   ListNode::Iterator * it = ListChildren();
   for ( ; it->HasNext(); it->Next() )
   {
       PropertyNode * node = dynamic_cast<PropertyNode*>( it->GetCurrent() );
       if ( node != NULL )
{'fraction_non_alphanumeric': 0.13444784553802686, 'fraction_numerical': 0.0, 'mean_word_length': 3.5825242718446604, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 64, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7635021', 'n_tokens_mistral': 1378, 'n_tokens_neox': 1383, 'n_words': 219}