コード例 #1
0
ファイル: kasaboutdlg.cpp プロジェクト: Fat-Zer/tdebase
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 );
}