本文整理汇总了C++中QFileInfo::bundleName方法的典型用法代码示例。如果您正苦于以下问题:C++ QFileInfo::bundleName方法的具体用法?C++ QFileInfo::bundleName怎么用?C++ QFileInfo::bundleName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QFileInfo
的用法示例。
在下文中一共展示了QFileInfo::bundleName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: writebinarytochunkswithcolor
void beamtest::writebinarytochunkswithcolor()
{
QFileInfo fileInfo;
QString filename = QFileDialog::getOpenFileName ( this,tr("Import File"),
"",tr( "All point cloud formats (*.ptx);;"
"XYZ (*.xyz *XYZ);;"
"PTX (*.ptx *.PTX)"));
int chunk = 2000000;
//int numfiles = floor((double) shapecount / (double) chunk);
int shapecounter=0;
int filecounter = 0;
double chunksize= 2000000;
int count =0;
int debugcount = 0;
char buf[1024];
QFile file(filename);
qint64 lineLength=0;
QStringList linelist;
QString filename2 = QFileDialog::getSaveFileName(this, tr("SaveBinary"), " ",tr("dat (*.dat "));
QFile file2(filename2);
file2.open(QIODevice::WriteOnly);
QDataStream out(&file2); // we will serialize the data into the file
fileInfo.setFile(filename2);
QString dirname = fileInfo.absoluteDir().absolutePath();
filename = fileInfo.fileName();
QString basename = fileInfo.baseName();
QString bundlename = fileInfo.bundleName();
if (file.open(QFile::ReadOnly)) {
do {
lineLength = file.readLine(buf, sizeof(buf));
if (lineLength != -1) {
QString line(buf);
linelist = line.split(tr(" "));
if (linelist.size() == 4)
{
double x = linelist.at(0).toDouble();
double y = linelist.at(1).toDouble();
double z = linelist.at(2).toDouble();
double intensity= linelist.at(3).toDouble();
if(x != 0 && y != 0 && z != 0 )
{
count++;
shapecounter++;
if(shapecounter == chunk)
{
shapecounter = 0;
filecounter++;
QString curfilename = dirname + tr("/") + basename + QString::number(filecounter) + tr(".data");
file2.close();
file2.setFileName(curfilename);
file2.open(QFile::WriteOnly);
}
if (count % 100000 == 0) qDebug() << count;
out << x << y << z << intensity;
}
}
//if (count > 10000) break;
}
}while (lineLength != -1);
}
if(file2.isOpen()) file2.close();
}