当前位置: 首页>>代码示例>>C++>>正文


C++ QDir::currentPath方法代码示例

本文整理汇总了C++中QDir::currentPath方法的典型用法代码示例。如果您正苦于以下问题:C++ QDir::currentPath方法的具体用法?C++ QDir::currentPath怎么用?C++ QDir::currentPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QDir的用法示例。


在下文中一共展示了QDir::currentPath方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: fileShareContentChanged

void NfcSharing::fileShareContentChanged(QString paths) {
	NfcShareFilesContent request;
    QList<QUrl> urls;
    QDir dir;

    QStringList list = paths.split(",");

    qDebug() << "XXXX Current Path" << dir.currentPath() << endl;
    qDebug() << "XXXX Home    Path" << dir.homePath() << endl;
    qDebug() << "XXXX Temp    Path" << dir.tempPath() << endl;

      QString publicPath(dir.currentPath().append("/app/public/"));

    for (int i = 0; i < list.size(); ++i) {

    	QUrl url(QString("file://").append(publicPath).append(list.at(i)));
        urls.append(url);

        QFileInfo fi(url.toLocalFile());

        qDebug() << "XXXX To Local File" << url.toLocalFile() << endl;
        qDebug() << "XXXX File String" << list.at(i) << endl;
        qDebug() << "XXXX File URL" << url << endl;
        qDebug() << "XXXX Absolute File Path" << fi.absoluteFilePath() << endl;
        qDebug() << "XXXX Absolute Path" << fi.absolutePath() << endl;
    }

    request.setFileUrls(urls);

    NfcShareSetContentError::Type rc = _nfcShareManager->setShareContent(request);

    qDebug() << "XXXX File setShareContent rc=" << rc << endl;
}
开发者ID:jaydeepw,项目名称:Cascades-Community-Samples,代码行数:33,代码来源:NfcSharing.cpp

示例2: recorverCadFile

bool recorverCadFile()
{
	QDir lsDir;
	//QString cadPath = lsDir.homePath();
	//cadPath.append("/AppData/Roaming/Autodesk/AutoCAD 2010/R18.0/chs/Support");
	QString cadPath = getCADPath("RoamableRootFolder",CURRENT_USER);
	cadPath.append("/Support");
	lsDir.setPath(cadPath);

	//filepath == "C:\Users\Username\AppData\Roaming\Autodesk\AutoCAD 2010\R18.0\chs\Support"
	QString filepath = lsDir.filePath("acad.CUIX");
	//filepath == "C:\Users\Username\AppData\Roaming\Autodesk\AutoCAD 2010\R18.0\chs\Support\hd.txt"

	//获取当前程序(.exe)所在的路径
	QString CurrentPath = lsDir.currentPath();

	QString fromDir = CurrentPath;
	fromDir.append("/Datas/CAD/acad.CUIX");
	//文件来自:当前程序所在位置+"/Datas/JL/hd.txt"

	QString toDir = filepath;
	if(!copyFileToPath(fromDir,toDir,true)) return false;

	filepath = lsDir.filePath("acad.mnr");
	CurrentPath = lsDir.currentPath();
	fromDir = CurrentPath;
	fromDir.append("/Datas/CAD/acad.mnr");
	toDir = filepath;
	return copyFileToPath(fromDir,toDir,true);
}
开发者ID:yuechuanbingzhi163,项目名称:GDES,代码行数:30,代码来源:CADHelper.cpp

示例3: mouseReleaseEvent

void EditSelectPlugin::mouseReleaseEvent(QMouseEvent * event, MeshModel &m, GLArea * gla)
{
    qDebug()<<"mouseReleaseEvent";
	gla->update();
	prev=cur;
	cur=event->pos();
	isDragging = false;
	
	//output current selected faces and verts
    QDir dir;
    //ÉèÖÃÊä³öÎļþ
    std::string ofs=dir.currentPath().toStdString();
    ofs.append("/selected_faces.txt");
    ofstream oo(ofs.c_str());
    CMeshO& cm=m.cm;
    for (int i = 0; i < cm.fn; i++) {
        if(cm.face[i].IsS()){
            // oo<<i+1<<endl; //we output the index+1, so it can be directly used in matlab
            oo<<i<<endl; //we want to use it directly in meshlab now!
            qDebug()<<i;
        }
    }
    oo.close();
    ofs=dir.currentPath().toStdString();
    ofs.append("/selected_verts.txt");
    oo.open(ofs.c_str());
    for (int i = 0; i < cm.vn; i++) {
        if(cm.vert[i].IsS()){
            oo<<i<<endl; //we want to use it directly in meshlab now!
            qDebug()<<i;
        }
    }
    oo.close();
}
开发者ID:laiyinping,项目名称:meshlab,代码行数:34,代码来源:edit_select.cpp

示例4: on_pushButton_clicked

void RongHe::on_pushButton_clicked()
{
    QString path;
        QDir dir;
        path=dir.currentPath();

    //    QStringList files = QFileDialog::getOpenFileNames(
    //                            this,
    //                            "Select one or more files to open",
    //                            "/home",
    //                            tr("All Files (*);;HDF5 Files (*.h5)"));


        QDir::setCurrent(path+"\\SST");

        QProcess::startDetached("InverseDistance.exe",QStringList());
        QDir::setCurrent(path);

        /*//测试Demo窗体,解注释即可查看效果
        Demo *demoDlg = new Demo() ;
        QDesktopWidget* desktop = QApplication::desktop();
        int x,y;
        x=(desktop->width() - demoDlg->width())/2;
        y=(desktop->height() - demoDlg->height())/2-20;
        demoDlg->setGeometry(x,y,1,429);
        demoDlg->setModal(true);
        demoDlg->show();
        */

}
开发者ID:ice200117,项目名称:oceanrs,代码行数:30,代码来源:ronghe.cpp

示例5: send

void postoperation::send()   //连接到服务器,执行发送
{
    ui->pbsendfile->setEnabled(false);
    bytesWritten = 0;
    //初始化已发送字节为0

    QDir dir;
    QString path = dir.currentPath();
    path += "/setting";
    QDir dir2(path);
    QString settingname;
    if(dir2.exists())
    {
        dir2.setFilter(QDir::Files | QDir::Hidden | QDir::NoSymLinks);
        dir2.setSorting(QDir::Size | QDir::Reversed);
        QFileInfoList list = dir2.entryInfoList();
        QFileInfo fileInfo = list.at(0);
        settingname = fileInfo.fileName();
        qDebug()<<settingname;
    }
    QString filename = path + "/" +settingname;
    QFile file(filename);
    if(!file.open(QIODevice::ReadOnly | QIODevice::Text))
    {
        QMessageBox::information(this,tr("提示"),tr("无法打开文件"),QMessageBox::Ok);
        qDebug()<<"Can't open the file!"<<endl;
    }
    QTextStream  in(&file);
    QString ipaddress;
    ipaddress = in.readLine();
    qDebug()<<ipaddress;
    tcpClient->connectToHost(QHostAddress(ipaddress),6111);//连接
}
开发者ID:lingma1993,项目名称:Smart-Express-System,代码行数:33,代码来源:postoperation.cpp

示例6: Display

void Forecast::on_pushButton_2_clicked()
{
    // Open multi image.
    QString path;
    QDir dir;
    path=dir.currentPath();
    QStringList files = QFileDialog::getOpenFileNames(
                            this,
                            "Select one or more files to open",
                            path,
                            "Images (*.png *.png *.jpg *.bmp)");

    if(files.count()>0) {
        files.sort();
        //displayYuBao(files);
        Display *fc = new Display();
        fc->init(files);
        QDesktopWidget* desktop = QApplication::desktop();
        int x,y;
        x=(desktop->width() - fc->width())/2;
        y=(desktop->height() - fc->height())/2-20;
        fc->setGeometry(x,y,fc->width(),fc->height());
        fc->setModal(true);
        fc->show();

        mw->m_display_windows_list.append(fc);
    }

}
开发者ID:ice200117,项目名称:oceanrs,代码行数:29,代码来源:forecast.cpp

示例7: on_pushButton_clicked

void Forecast::on_pushButton_clicked()
{
    QString path;
    QDir dir;
    path=dir.currentPath();

    //Show file select Dialog.
    if(select_window!=NULL) {
        delete select_window;
    }
    select_window = new SelectFile();
    select_window->init(SWWYL);

    QDesktopWidget* desktop = QApplication::desktop();
    int x,y;
    x=(desktop->width() - select_window->width())/2;
    y=(desktop->height() - select_window->height())/2;
    select_window->setGeometry(x,y,1,429);
//    select_window->setModal(true);
    select_window->show();

    // MPlayer 播放视频
//    QProcess::execute("C:\\MPlayer_Windows\\mplayer\\MPlayer.exe "+path+"\\yubao\\wenyanliu\\nwp_3dvar.mp4");
//    QProcess::execute("C:\\wmplayer\\wmplayer.exe "+path+"\\yubao\\wenyanliu\\nwp_3dvar.mp4");


}
开发者ID:ice200117,项目名称:oceanrs,代码行数:27,代码来源:forecast.cpp

示例8: onNewFrame

void Dialog::onNewFrame(QImage qImg, vector<Rect_<int> > faces)
{
    //QList<QImage>::iterator it = qImg.begin();
    QSize labelSize = QSize(ui->label->geometry().width(),ui->label->geometry().height());
    //qDebug() << labelSize << "\n";
    if(qImg.isNull())
    {
        qDebug() << "qImg is null\n";
    }
    else
    {
        if(faces.size() > 0 && is_detect){
            // Get current working path
            emit SetProcessFlag(false);
            QString path;
            QDir dir;
            path=dir.currentPath();
            QDateTime date_time = QDateTime::currentDateTime();
            QString str = date_time.toString("yyyyMMddhhmmss");
            QString fileName = path+"/FaceImages/"+str+".png";
            qImg.save(fileName,"png");
            is_detect = false;
            mts.doWrite("FaceDetect#"+this->receiverName+"#doFaceDetect#"+fileName);
            emit closeCamera();
            //this->showMinimized();
            move(1920,1080);

        }
        if(!is_detect){
            qImg.fill(QColor(0,0,0,0));
        }
        ui->label->setPixmap(QPixmap::fromImage(qImg).scaled(labelSize,Qt::KeepAspectRatio, Qt::FastTransformation));

    }
}
开发者ID:hkutangyu,项目名称:QTDemo,代码行数:35,代码来源:dialog.cpp

示例9:

cacic_hardware::cacic_hardware()
{
    QDir dir;
    logManager = QLogger::QLoggerManager::getInstance();
    logManager->addDestination(dir.currentPath() + "/Logs/cacicLog.log","Gercols (hardware)",QLogger::InfoLevel);
    logManager->addDestination(dir.currentPath() + "/Logs/cacicLog.log","Gercols (hardware)",QLogger::ErrorLevel);
}
开发者ID:maurosantos,项目名称:cacic-agente,代码行数:7,代码来源:cacic_hardware.cpp

示例10: fl_procPC_adjust_preference

void fl_procPC_adjust_preference()
{
	atlasConfig cfginfo;
//	QString fileName = "atlas_config.txt";
//    QString fileName = "/Users/longf/work/v3d_internal/long_fuhui/atlas_builder/pointcloud_atlas_builder_plugin/atlas_config.txt";	
    
    QDir curdir; 
//    v3d_msg(curdir.currentPath());
//    
//    printf("%s", curdir.currentPath().toStdString().c_str());
    
//    QString fileName = curdir.currentPath() + "/plugins/atlas_builder/atlas_config.txt";
    QString fileName = curdir.currentPath() + V3DFOLDER;
    
    
	if (!loadPointCloudAtlasConfigFile(qPrintable(fileName.trimmed()), cfginfo))
	{
		v3d_msg("Fail to load the configuration file atlas_config.txt");
		return;
	}
	
	fl_func_procIO_adjust_preference(fileName, cfginfo);
    

}
开发者ID:Vaa3D,项目名称:vaa3d_tools,代码行数:25,代码来源:pointcloud_atlas_builder.cpp

示例11: QWidget

BaiduMap::BaiduMap(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::BaiduMap)
{
    ui->setupUi(this);
    mWebView = ui->webView;
    QDir dir;
    mWebView->load(QUrl(QString("file:///"+dir.currentPath()+"/BaiduMap.html")));
}
开发者ID:xtliuke,项目名称:XTFly,代码行数:9,代码来源:baidumap.cpp

示例12:

void RongHe::on_pushButton_3_clicked()
{
        QString path;
        QDir dir;
        path=dir.currentPath();
        QDir::setCurrent(path+"\\rain");

        QProcess::execute("rain.exe");
        QDir::setCurrent(path);
}
开发者ID:ice200117,项目名称:oceanrs,代码行数:10,代码来源:ronghe.cpp

示例13: QSettings

CCfgFile::CCfgFile()
{
    QString strPath;
    QDir dir;
    strPath = dir.currentPath();

    m_setting = new QSettings(strPath + CONFIG_FILE_NAME, QSettings::IniFormat);
    ReadFile();
    VerifyData();
}
开发者ID:lctagnes,项目名称:gitpro,代码行数:10,代码来源:configfile.cpp

示例14: densePointCloudReconstruction

//===============================================densePointCloudReconstruction============================================//
bool TextureGenrator::densePointCloudReconstruction(){

	int start = 0; 
	int end = 0;

	m_parent->textEditConsole->append("正在进行稠密点云重建,请稍候...");
	 //run PMVS for dense reconstruction
	QString path = "TempData" + tr(".nvm.cmvs/00/");
	start = clock();
	// find all the files
	QDir dir;
	dir.setPath(path);
	dir.setFilter(QDir::Files | QDir::NoSymLinks | QDir::NoDotAndDotDot);
	QStringList filter;
	filter<<"option-*";
	QFileInfoList fileList = dir.entryInfoList(filter);
	int nOpts = fileList.size();
	m_parent->progressBar->setRange(0,nOpts);
	m_parent->progressBar->setValue(0);

	for(int i=0; i< nOpts; i++){
		// option files
		QString optFile = fileList.at(i).filePath();
		QStringList fields= optFile.split("/");

		// commad line arguments
		QString cmdArgu = path +" " + fields.takeLast();
		m_parent->textEditConsole->append( QString("%1 th reconstruction ").arg(i));
		m_parent->textEditConsole->append( dir.currentPath()+ "/"  + optFile);
		if(!shellExecute("pmvs2.exe", cmdArgu.toStdString().c_str()))return false;

		m_parent->progressBar->setValue(i+1);
		QApplication::processEvents();
	} 
	end = clock();
	m_parent->textEditConsole->append(QString("稠密重建完成,用时 %1 s\n").arg((double)(end-start)/CLOCKS_PER_SEC));
	m_parent->textEditConsole->append("重建结果保存在 " + dir.currentPath()+ "/" + path);
	update();

	return true;
}
开发者ID:JloveU,项目名称:IGITLandscapeViewer,代码行数:42,代码来源:PointCloudGenProgressDlg.cpp

示例15: QObject

Sqldb::Sqldb(QObject *parent) :
    QObject(parent)
{
    db=QSqlDatabase::addDatabase("QSQLITE");
    QDir dir;
    QString path=QString("%1/database.db").arg(dir.currentPath());
    qDebug()<<path;
    db.setDatabaseName(path);
    if(!db.open())
    {
        QMessageBox::critical(NULL,tr("Tips"),tr("connect error"));
    }
}
开发者ID:xiangzhuanglujy,项目名称:Recoder,代码行数:13,代码来源:sqldb.cpp


注:本文中的QDir::currentPath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。