Exemplo n.º 1
0
bool JForm::eventFilter(QObject *watched, QEvent *event)
{
  if (watched==w_scroller->viewport() && event->type()==QEvent::Resize)
  {
    QResizeEvent *rev = static_cast<QResizeEvent *>(event);
    qDebug("Form viewport resized to (%d[%d: -%d] x %d)", 
                 rev->size().width(), w_scroller->verticalScrollBar()->isVisible(), w_scroller->verticalScrollBar()->width(),
                 rev->size().height());
                 
    int v_w = rev->size().width();
    if (w_scroller->verticalScrollBar()->isVisible())
      v_w -= w_scroller->verticalScrollBar()->width();
    int v_h = rev->size().height();
    JDisplay::current()->setDisplayWidth(v_w);
    JDisplay::current()->setDisplayHeight(v_h); 
    requestInvalidate();
  }
  return false;
}
Exemplo n.º 2
0
 void componentConnected()
 {     
    CPPUNIT_ASSERT(!isAnotherIntAttrValid());   
    CPPUNIT_ASSERT(!isMyIntAttrValid());
    
    if (mMode & CAttributesTest::MaskAnotherIntAttribute)
    {        
       notifyOnAnotherIntAttr();      
    }
    else
    {        
       notifyOnMyIntAttr();      
    }
    
    if (mMode == CAttributesTest::InitializeAttributeAfterStartup)          
    {
       requestInit();
    }
    
    if (mMode & CAttributesTest::UpdateEventsCount)
    {
       // five times so the event may be sent 5 times back (with 'always' notification type)
       requestInit();
       requestInit();
       requestInit();
       requestInit();
       requestInit();
    }
    
    if (mMode & CAttributesTest::Invalidate)
    {
       requestInit();
       requestInvalidate();
    }
          
    requestStop();            
 }