Permalink
Browse files

drag&drop细节

  • Loading branch information...
1 parent bab26e2 commit 0981c0631676ece2a31308c3a7c20056a9403bf5 @techblog techblog committed May 18, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 widget/rytabwidget.cpp
View
@@ -10,7 +10,7 @@ RyTabWidget::RyTabWidget(QWidget *parent) :
void RyTabWidget::dragEnterEvent(QDragEnterEvent *event){
const RyMimeData* mime = dynamic_cast<const RyMimeData*>(event->mimeData());
if(mime){
- event->setDropAction(Qt::CopyAction);
+ event->setDropAction(Qt::IgnoreAction);
event->accept();
}else{
event->ignore();
@@ -27,6 +27,7 @@ void RyTabWidget::dragMoveEvent(QDragMoveEvent *event){
QPoint p2 = p-tabBar()->pos();
int index = tabBar()->tabAt(p2);
if(index != -1){
+ event->setDropAction(Qt::IgnoreAction);
event->accept();
tabBar()->setCurrentIndex(index);
}else{

0 comments on commit 0981c06

Please sign in to comment.