- Timestamp:
- Apr 20, 2010, 5:51:04 PM (15 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/mainwindow.cpp
r104 r105 38 38 loadLanguage(); 39 39 setupUi(); 40 setAcceptDrops(true); 40 41 41 42 initDocStyleSheet(); … … 734 735 } 735 736 737 void MainWindow::dragEnterEvent(QDragEnterEvent *ev) 738 { 739 if (ev->mimeData()->hasUrls() && (ev->mimeData()->urls().count() == 1)) { 740 QFileInfo fi(ev->mimeData()->urls().first().toLocalFile()); 741 if ((fi.suffix() == "tspt") || (fi.suffix() == "zkt")) 742 ev->acceptProposedAction(); 743 } 744 } 745 746 void MainWindow::dropEvent(QDropEvent *ev) 747 { 748 if (maybeSave() && tspmodel->loadTask(ev->mimeData()->urls().first().toLocalFile())) { 749 setFileName(ev->mimeData()->urls().first().toLocalFile()); 750 tabWidget->setCurrentIndex(0); 751 setWindowModified(false); 752 solutionText->clear(); 753 toggleSolutionActions(false); 754 755 ev->acceptProposedAction(); 756 } 757 } 758 736 759 bool MainWindow::hasUpdater() const 737 760 { -
trunk/src/mainwindow.h
r104 r105 111 111 112 112 void closeEvent(QCloseEvent *ev); 113 void dragEnterEvent(QDragEnterEvent *ev); 114 void dropEvent(QDropEvent *ev); 113 115 bool hasUpdater() const; 114 116 void initDocStyleSheet();
Note: See TracChangeset
for help on using the changeset viewer.