39 setAcceptDrops(
true );
80 QString QgsFileDropEdit::acceptableFilePath( QDropEvent *event )
const
83 if ( event->mimeData()->hasUrls() )
85 QFileInfo
file( event->mimeData()->urls().first().toLocalFile() );
86 if ( !(( mFileOnly && !
file.isFile() ) ||
87 ( mDirOnly && !
file.isDir() ) ||
88 ( !mSuffix.isEmpty() && mSuffix.compare(
file.suffix(), Qt::CaseInsensitive ) ) ) )
89 path =
file.filePath();
100 QString filePath = acceptableFilePath( event );
101 if ( !filePath.isEmpty() )
103 event->acceptProposedAction();
129 QString filePath = acceptableFilePath( event );
130 if ( !filePath.isEmpty() )
134 setFocus( Qt::MouseFocusReason );
135 event->acceptProposedAction();
155 p.setPen( QPen( palette().highlight(), width ) );
156 QRect r = rect().adjusted( width, width, -width, -width );