Skip to content

Commit

Permalink
“修复win下路径错误”
Browse files Browse the repository at this point in the history
  • Loading branch information
wx1183618058 committed Dec 25, 2017
1 parent a19b28d commit 6d430cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions huawei/huawei.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ HuaWei::HuaWei(QWidget *parent) :
void HuaWei::dragEnterEvent(QDragEnterEvent *event)
{
if (event->mimeData()->hasUrls()) {
QString path = event->mimeData()->urls()[0].path();
QString path = event->mimeData()->urls()[0].toLocalFile();
if (path.right(3) == "xml" || path.right(3) == "cfg")
event->acceptProposedAction();
} else if(event->mimeData()->hasHtml()) {
Expand All @@ -56,7 +56,7 @@ void HuaWei::dragEnterEvent(QDragEnterEvent *event)
void HuaWei::dropEvent(QDropEvent *event)
{
if (event->mimeData()->hasUrls()) {
QString path = event->mimeData()->urls()[0].path();
QString path = event->mimeData()->urls()[0].toLocalFile();
if (path.right(3) == "xml") {
ui->xml_line_edit_->setText(path);
} else {
Expand Down

0 comments on commit 6d430cd

Please sign in to comment.