Skip to content

Commit

Permalink
drag&drop细节
Browse files Browse the repository at this point in the history
  • Loading branch information
techblog committed May 18, 2012
1 parent bab26e2 commit 0981c06
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion widget/rytabwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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{
Expand Down

0 comments on commit 0981c06

Please sign in to comment.