void KasBar::addTestItems() { KasItem *i = new KasItem( this ); insert( 0, i ); i->setText( "Animated" ); i->setIcon( KGlobal::iconLoader()->loadIcon( "icons", KIconLoader::NoGroup, KIconLoader::SizeMedium ) ); i->setAnimation( resources()->startupAnimation() ); QTimer *aniTimer = new QTimer( i ); connect( aniTimer, SIGNAL( timeout() ), i, SLOT( advanceAnimation() ) ); aniTimer->start( 100 ); i->setShowAnimation( true ); updateLayout(); }
void KasAboutDialog::addDemoBar() { TQHBox *box = new TQHBox( this ); box->setLineWidth(2); box->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); box->setSpacing( spacingHint() ); box->setMargin( marginHint() ); KasBar *bar = new KasBar( Qt::Horizontal, box ); bar->setItemSize( KasBar::Large ); bar->setMasked( false ); KasItem *ci = new KasItem( bar ); ci->setIcon( LargeIcon( "icons" ) ); bar->append( ci ); KasPopup *pop = new KasPopup( ci ); ci->setPopup( pop ); ci->setCustomPopup( true ); connect( ci, TQT_SIGNAL(leftButtonClicked(TQMouseEvent *)), ci, TQT_SLOT(togglePopup()) ); KasBar *groupbar = bar->createChildBar( ( bar->orientation() == Qt::Horizontal ) ? Qt::Vertical : Qt::Horizontal, pop ); KasItem *i = 0; KasClockItem *clk = new KasClockItem( groupbar ); groupbar->append( clk ); i = new KasLoadItem( groupbar ); groupbar->append( i ); groupbar->addTestItems(); pop->resize( groupbar->size() ); bar->setFixedSize( bar->itemExtent(), bar->itemExtent() ); addWidgetBelowList( box ); }