void MainWindow::dragEnterEvent(QDragEnterEvent *e)
{
if(e->mimeData()->hasFormat("text/uri-list")) { //只能打開文本檔案
e->acceptProposedAction(); //可以在這個視窗部件上拖放物件
}
}
各位大佬,為啥加上這個,除文本檔案型別外的程式及檔案依然會被識別處理?
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/48853.html
標籤:Qt
