void TabBar::dragEnterEvent(QDragEnterEvent *event) { if ( canDropToTab(*event) ) acceptDrag(event); else QTabBar::dragEnterEvent(event); }
void TabBar::dragMoveEvent(QDragMoveEvent *event) { if ( dropItemsTabIndex(*event, *this) != -1 ) acceptDrag(event); else QTabBar::dragMoveEvent(event); }
void KFileDetailView::contentsDropEvent( TQDropEvent *e ) { d->dropItem = 0; d->autoOpenTimer.stop(); if ( ! acceptDrag( e ) ) { // can we decode this ? e->ignore(); // No return; } e->acceptAction(); // Yes KFileListViewItem *item = dynamic_cast<KFileListViewItem*>(itemAt( contentsToViewport( e->pos() ) )); KFileItem * fileItem = 0; if (item) fileItem = item->fileInfo(); emit dropped(e, fileItem); KURL::List urls; if (KURLDrag::decode( e, urls ) && !urls.isEmpty()) { emit dropped(e, urls, fileItem ? fileItem->url() : KURL()); sig->dropURLs(fileItem, e, urls); } }
void KFileDetailView::contentsDragMoveEvent( TQDragMoveEvent *e ) { if ( ! acceptDrag( e ) ) { // can we decode this ? e->ignore(); // No return; } e->acceptAction(); // Yes if ((dropOptions() & AutoOpenDirs) == 0) return; KFileListViewItem *item = dynamic_cast<KFileListViewItem*>(itemAt( contentsToViewport( e->pos() ) )); if ( item ) { // are we over an item ? if (d->dropItem != item) { d->dropItem = item; d->autoOpenTimer.start( autoOpenDelay() ); // restart timer } } else { d->dropItem = 0; d->autoOpenTimer.stop(); } }
void KNCollectionView::contentsDropEvent(QDropEvent *e) { cleanItemHighlighter(); // necessary since we overwrite KListView::contentsDropEvent() QListViewItem *item = itemAt(contentsToViewport(e->pos())); KNCollectionViewItem *fti = static_cast<KNCollectionViewItem *>(item); if(fti && (fti->coll) && acceptDrag(e)) { emit folderDrop(e, fti); e->accept(true); } else e->accept(false); }
void LibraryTreeWidget::dragEnterEvent(QDragEnterEvent *event) { if (acceptDrag(event)) { event->accept(); m_currentItem = currentItem(); m_dropItem = itemAt(event->pos()); if (m_dropItem) { m_openBranchTimer->start(AUTO_EXPAND_DELAY); } } else { event->ignore(); } }
//----------------------------------------------- void KFileDnDDetailView::contentsDragEnterEvent( QDragEnterEvent *e ) { kdDebug (9020) << "KFileDnDDetailView::contentsDragEnterEvent" << endl; if ( ! acceptDrag( e ) ) { e->accept( false ); return; } e->acceptAction(); QListViewItem *i = itemAt( contentsToViewport( e->pos() ) ); if ( i && m_useAutoOpenTimer ) { m_dropItem = i; m_autoOpenTimer.start( m_autoOpenTime ); } }
//----------------------------------------------- void KFileDnDDetailView::contentsDropEvent( QDropEvent* e ) { kdDebug (9020) << "KFileDndDetailView::contentsDropEvent" << endl; if( m_useAutoOpenTimer ) { m_autoOpenTimer.stop(); m_dropItem = 0L; } if( ! acceptDrag( e ) ) { e->acceptAction( false ); return; } e->acceptAction(); // the drop was accepted so lets emit this to the outside world KURL::List urls; KURLDrag::decode( e, urls ); emit dropped( e ); emit dropped( this, e ); emit dropped( this, urls ); }
void LibraryTreeWidget::dragMoveEvent(QDragMoveEvent *event) { m_openBranchTimer->stop(); if (acceptDrag(event)) { event->accept(); m_dropItem = itemAt(event->pos()); if (m_dropItem && m_dropItem == m_currentItem) { // tring to drop on same Library QToolTip::showText(mapToGlobal(event->pos() + QPoint(10, 0)), i18n("existing library")); } else { QToolTip::hideText(); } if (m_dropItem) { setCurrentItem(m_dropItem); m_openBranchTimer->start(AUTO_EXPAND_DELAY); } } else { event->ignore(); } }