本文整理汇总了C++中QMakeProject::addStringListValue方法的典型用法代码示例。如果您正苦于以下问题:C++ QMakeProject::addStringListValue方法的具体用法?C++ QMakeProject::addStringListValue怎么用?C++ QMakeProject::addStringListValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QMakeProject
的用法示例。
在下文中一共展示了QMakeProject::addStringListValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: accept
void UISubclassWizard::accept()
{
QString path = QFileInfo( mFilePath ).path().append( "/" ).append( QFileInfo( mFilePath ).baseName() );
QMakeProject* project = UIMain::self()->currentProject();
//
QFile header( path.append( ".h" ) );
if ( header.open( QFile::WriteOnly | QFile::Text ) )
{
header.write( teHeader->toPlainText().toAscii() );
header.close();
project->addStringListValue( "HEADERS", cbGetWindowManager->currentText(), path );
UIMain::self()->createWindow( path, pHeader, project );
QFile source( path.replace( ".h", ".cpp") );
if ( source.open( QFile::WriteOnly | QFile::Text ) )
{
source.write( teSource->toPlainText().toAscii() );
source.close();
project->addStringListValue( "SOURCES", cbGetWindowManager->currentText(), path );
UIMain::self()->createWindow( path, pSource, project );
QDialog::accept();
}
else
{
QMessageBox::warning( this, _WARNING, tr( "Unable to create the files." ) );
QDialog::reject();
}
}
else
{
QMessageBox::warning( this, _WARNING, tr( "Unable to create the files." ) );
QDialog::reject();
}
}
示例2: accept
void UIAddExistingFiles::accept()
{
QStringList fileNames = selectedFiles();
if ( fileNames.isEmpty() )
return;
QString suffix;
QMakeProject* project = QMakeProject::getProjectByName( cbProjects->currentText(), projectParent );
foreach ( QString file, fileNames )
{
switch ( project->getFileTypeFromFilePath( file ) )
{
case pForm:
project->addStringListValue( "FORMS", cbPlatforms->currentText(), file );
break;
case pHeader:
project->addStringListValue( "HEADERS", cbPlatforms->currentText(), file );
break;
case pSource:
project->addStringListValue( "SOURCES", cbPlatforms->currentText(), file );
break;
/*
case pTranslation:
project->addStringListValue( "TRANSLATIONS", cbPlatforms->currentText(), file );
break;
*/
case pText:
project->addStringListValue( "TEXTS", cbPlatforms->currentText(), file );
break;
default:
break;
}
}
QDialog::accept();
}