KTabBar::KTabBar( QWidget *parent ) : QTabBar( parent ), d( new Private ) { setAcceptDrops( true ); setMouseTracking( true ); d->mActivateDragSwitchTabTimer = new QTimer( this ); d->mActivateDragSwitchTabTimer->setSingleShot( true ); connect( d->mActivateDragSwitchTabTimer, SIGNAL(timeout()), SLOT(activateDragSwitchTab()) ); #ifndef KDE_NO_DEPRECATED connect( this, SIGNAL(tabCloseRequested(int)), this, SIGNAL(closeRequest(int))); // just for backward compatibility, KDE5 remove #endif //connect( this, SIGNAL(layoutChanged()), SLOT(onLayoutChange()) ); }
KTabBar::KTabBar( QWidget *parent, const char *name ) : QTabBar( parent, name ), mReorderStartTab( -1 ), mReorderPreviousTab( -1 ), mHoverCloseButtonTab( 0 ), mDragSwitchTab( 0 ), mHoverCloseButton( 0 ), mHoverCloseButtonEnabled( false ), mHoverCloseButtonDelayed( true ), mTabReorderingEnabled( false ) { setAcceptDrops( true ); setMouseTracking( true ); mEnableCloseButtonTimer = new QTimer( this ); connect( mEnableCloseButtonTimer, SIGNAL( timeout() ), SLOT( enableCloseButton() ) ); mActivateDragSwitchTabTimer = new QTimer( this ); connect( mActivateDragSwitchTabTimer, SIGNAL( timeout() ), SLOT( activateDragSwitchTab() ) ); #if QT_VERSION >= 0x030200 connect(this, SIGNAL(layoutChanged()), SLOT(onLayoutChange())); #endif }