2 Star 0 Fork 0

元谷/android tools for cocos2dx

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
getpath.cpp 1.29 KB
一键复制 编辑 原始数据 按行查看 历史
元谷 提交于 2013-10-07 10:34 . 支持C文件
#include "getpath.h"
#include <QDir>
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QFileDialog>
#include<QUrl>
#include <QDesktopServices>
GetPath::GetPath(Ui::MainWindow* ui )
{
uiPtr = ui;
QObject::connect(ui->selectFileButton, SIGNAL(clicked()), this, SLOT(getPathByTextLine()));
QObject::connect(ui->label,SIGNAL(linkActivated(QString)),this,SLOT(openUrl(QString)));
}
void GetPath::getPathByTextLine()
{
QString dir = QFileDialog::getExistingDirectory(this, tr("Open Directory"),
"/home",
QFileDialog::ShowDirsOnly
| QFileDialog::DontResolveSymlinks);
uiPtr->pathShowLine->setText(dir);
fileList(dir);
}
void GetPath::fileList(QString path)
{
QDir* dir = new QDir(path);
QStringList filters;
filters << "*.cpp" << "*.cxx" << "*.cc" << "*.c";
QFileInfo file;
QString prePath = uiPtr -> prePathShowLine ->text();
prePath.append("/");
foreach (file, dir->entryInfoList(filters)) {
uiPtr -> pathShowTextView->append(prePath + file.fileName() + " \\");
}
}
void GetPath::openUrl(QString url)
{
QUrl qurl;
qurl.setUrl(url);
QDesktopServices::openUrl(qurl);
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/yuangu/android-tools-for-cocos2dx.git
git@gitee.com:yuangu/android-tools-for-cocos2dx.git
yuangu
android-tools-for-cocos2dx
android tools for cocos2dx
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385