本文整理汇总了C++中ProjectInfo类的典型用法代码示例。如果您正苦于以下问题:C++ ProjectInfo类的具体用法?C++ ProjectInfo怎么用?C++ ProjectInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ProjectInfo类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: temporaryDir
void GenericProjectPlugin::test_mixed2()
{
Tests::VerifyCleanCppModelManager verify;
TemporaryCopiedDir temporaryDir(sourceProjectPath(_("testdata_mixedproject2/")));
QVERIFY(temporaryDir.isValid());
const QString projectFile = temporaryDir.absolutePath("mixedproject2.creator");
ProjectOpenerAndCloser projects;
const ProjectInfo pInfo = projects.open(projectFile);
QVERIFY(pInfo.isValid());
QCOMPARE(pInfo.projectParts().size(), 2);
QList<ProjectPart::Ptr> parts = pInfo.projectParts();
std::sort(parts.begin(), parts.end(), [](const ProjectPart::Ptr &p1,
const ProjectPart::Ptr &p2) {
return p1->displayName < p2->displayName;
});
const QString dirPathWithSlash = temporaryDir.path() + QLatin1Char('/');
const QStringList part0files = simplify(parts[0]->files, dirPathWithSlash);
const QStringList part1files = simplify(parts[1]->files, dirPathWithSlash);
QCOMPARE(parts[0]->displayName, _("mixedproject2 (C++11)"));
QCOMPARE(parts[0]->files.size(), 2);
QVERIFY(part0files.contains(_("main.cpp")));
QVERIFY(part0files.contains(_("header.hpp")));
QCOMPARE(parts[1]->displayName, _("mixedproject2 (C11)"));
QCOMPARE(parts[1]->files.size(), 1);
QVERIFY(part1files.contains(_("impl.c")));
}
示例2: KDialogBase
//BEGIN class LinkerOptionsDlg
LinkerOptionsDlg::LinkerOptionsDlg( LinkerOptions * linkingOptions, QWidget *parent )
: KDialogBase( parent, "Linker Options Dialog", true, "Linker Options", KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, true )
{
m_pLinkerOptions = linkingOptions;
m_pWidget = new LinkerOptionsWidget(this);
ProjectInfo * pi = ProjectManager::self()->currentProject();
assert(pi);
//BEGIN Update gplink options
m_pWidget->m_pHexFormat->setCurrentItem( m_pLinkerOptions->hexFormat() );
m_pWidget->m_pOutputMap->setChecked( m_pLinkerOptions->outputMapFile() );
m_pWidget->m_pLibraryDir->setText( m_pLinkerOptions->libraryDir() );
m_pWidget->m_pLinkerScript->setText( m_pLinkerOptions->linkerScript() );
m_pWidget->m_pOther->setText( m_pLinkerOptions->linkerOther() );
//END Update gplink options
//BEGIN Update library widgets
const KURL::List availableInternal = pi->childOutputURLs( ProjectItem::LibraryType );
const QStringList linkedInternal = m_pLinkerOptions->linkedInternal();
KURL::List::const_iterator end = availableInternal.end();
for ( KURL::List::const_iterator it = availableInternal.begin(); it != end; ++it )
{
QString relativeURL = KURL::relativeURL( pi->url(), *it );
QCheckListItem * item = new QCheckListItem( m_pWidget->m_pInternalLibraries, relativeURL, QCheckListItem::CheckBox );
item->setOn( linkedInternal.contains(relativeURL) );
}
m_pExternalLibraryRequester = new KURLRequester( 0l );
m_pExternalLibraryRequester->fileDialog()->setURL( "/usr/share/sdcc/lib" );
delete m_pWidget->m_pExternalLibraries;
m_pWidget->m_pExternalLibraries = new KEditListBox( i18n("Link libraries outside project"), m_pExternalLibraryRequester->customEditor(), m_pWidget );
m_pWidget->m_pExternalLibraries->layout()->setMargin(11);
(dynamic_cast<QGridLayout*>(m_pWidget->layout()))->addMultiCellWidget( m_pWidget->m_pExternalLibraries, 7, 7, 0, 1 );
#if defined(KDE_MAKE_VERSION)
# if KDE_VERSION >= KDE_MAKE_VERSION(3,4,0)
m_pWidget->m_pExternalLibraries->setButtons( KEditListBox::Add | KEditListBox::Remove );
# endif
#endif
m_pWidget->m_pExternalLibraries->insertStringList( m_pLinkerOptions->linkedExternal() );
//END Update library widgets
setMainWidget( m_pWidget );
setInitialSize( m_pWidget->rect().size() );
}
示例3: it
QStringList CppModelManager::internalProjectFiles() const
{
QStringList files;
QMapIterator<ProjectExplorer::Project *, ProjectInfo> it(d->m_projectToProjectsInfo);
while (it.hasNext()) {
it.next();
const ProjectInfo pinfo = it.value();
foreach (const ProjectPart::Ptr &part, pinfo.projectParts()) {
foreach (const ProjectFile &file, part->files)
files += file.path;
}
}
files.removeDuplicates();
return files;
}
示例4: deleteProject
bool deleteProject ( const string& user, const string& project )
{
bool calProject = project.rfind ( ".cal." ) != string::npos;
if ( MySQLPPSDDBase::instance ().projectHasQueuedOrRunningJobs ( user, project ) ) {
return false;
}
StringVector resultsList = MySQLPPSDDBase::instance ().getResultsList ( user, project ); // Delete all the results
for ( StringVectorSizeType i = 0 ; i < resultsList.size () ; i++ ) {
deleteResults ( user, project, resultsList [i] );
}
ProjectInfo* pi = MySQLPPSDDBase::instance ().getProjectInfo ( user, project );
string projectPath = pi->getProjectFullPath ();
if ( genFileExists ( projectPath + ".7z" ) ) { // Check that the project isn't compressed
gen7zaUncompress ( projectPath + ".7z" );
}
if ( !calProject ) {
ProjectFile pf ( projectPath );
if ( pf.isUploadProject () ) {
string dataPath = pf.getUploadDirectory ();
if ( genFileExists ( dataPath ) ) genUnlinkDirectory ( dataPath ); // Delete the data
genRmdir ( genDirectoryFromPath ( dataPath ) ); // Try to delete the data date directory. This will fail if the directory isn't empty.
}
}
genUnlink ( projectPath ); // Delete the project file.
if ( !calProject ) {
FileList f1 ( pi->getProjectDirectory (), pi->getProjectName () + ".exp.", "", false ); // Delete the .exp files.
f1.unlink ();
}
MySQLPPSDDBase::instance ().deleteProjectID ( pi->getProjectID () ); // Delete the database entry.
if ( !calProject ) { // Delete the calibrated projects.
StringVector sv = MySQLPPSDDBase::instance ().getProjectList ( user, true );
for ( StringVectorSizeType j = 0 ; j < sv.size () ; j++ ) {
if ( isPrefix ( sv [j], project + ".cal." ) ) {
deleteProject ( user, sv [j] );
}
}
}
genRmdir ( genDirectoryFromPath ( projectPath ) ); // Try to delete the project date directory. This will fail if the directory isn't empty.
delete pi;
return true;
}
示例5:
BaseProjectPartBuilder::BaseProjectPartBuilder(ProjectInterface *project,
ProjectInfo &projectInfo)
: m_project(project)
, m_projectInfo(projectInfo)
, m_templatePart(new ProjectPart)
{
QTC_CHECK(m_project);
m_templatePart->project = projectInfo.project();
m_templatePart->displayName = m_project->displayName();
m_templatePart->projectFile = m_project->projectFilePath();
}
示例6: main
int main( int argc, char * argv[] )
{
int i = 0;
string sProRataCombineFilename = "ProRataCombine.xml";
string sTABOutputFilename = "ProRata_Combine_Measurements.txt";
string sArgument = "";
while( i < argc )
{
sArgument = argv[i];
if( sArgument == "-c" )
{
i = i + 1;
sProRataCombineFilename = argv[i];
}
if( sArgument == "-o" )
{
i = i + 1;
sTABOutputFilename = argv[i];
}
i = i + 1;
}
ProjectInfo mainProjectInfo;
if( !mainProjectInfo.process(sProRataCombineFilename) )
{
cout << "cannot process " << sProRataCombineFilename << endl;
}
mainProjectInfo.writeFileTAB( sTABOutputFilename );
cout << "ProRataCombine Done." << endl;
return 0;
}
示例7: initSlaves
void MPIWorkerMaster::initSlaves(ProjectInfo projectInfo)
{
int numworkers = mMpi->getCommSize();
echo(MakeString() << "Number of slaves: " << (numworkers - 1));
if (numworkers > 1) {
std::vector<int> initData = projectInfo.serialize();
for (int id=1; id<numworkers; id++) {
mMpi->sendIntArray(id, initData);
mSlaveQueue.push(id);
}
}
}
示例8:
void UITransform::transformObject2Form(ProjectInfo& info, Form& form)
{
form.setText("Client",info.getClient());
form.setText("Start Date",info.getStartDate());
form.setText("End Date",info.getEndDate());
form.setText("Project Description",info.getProjectDescription());
form.setText("Project Name",info.getProjectName());
form.setText("Project Status",info.getStatus());
}
示例9: getFormattedOutput
std::string Formatter::getFormattedOutput(ProjectInfo& info)
{
std::ostringstream out;
out << "\tId\t\t" << info.getProjectId() << "\n\n";
out << "\tName\t\t" << info.getProjectName() << "\n\n";
out << "\tDescription\t" << info.getProjectDescription() << "\n\n";
out << "\tStart Date\t" << info.getStartDate() << "\n\n";
out << "\tEnd Date\t" << info.getEndDate() << "\n\n";
out << "\tClient Name\t" << info.getClient() << "\n\n";
out << "\tStatus\t\t" << info.getStatus() << "\n\n";
clear();
attron(A_BOLD);
printw("\t\tProject Details\n\n");
attroff(A_BOLD);
printw(out.str().c_str());
printw("\nPress any key to continue...");
getch();
return out.str();
}
示例10: QMenu
void MainWindow::showProjectContextMenu(const QPoint &pos) {
QPoint globalPos = projectsTree->mapToGlobal(pos);
QMenu* menu = new QMenu(this);
Project* proj;
Task* t;
QString selectedProject = projectsTree->indexAt(pos).data(Qt::DisplayRole).toString();
if (!(projectsTreeView->isHidden()))
selectedProject = projectsTreeView->indexAt(pos).data(Qt::DisplayRole).toString();
try {
proj = &(ProjectFactory::getInstance().getProject(selectedProject));
menu->addAction("add tasks");
menu->addAction("infos");
menu->addAction("show tree");
menu->addAction("remove");
QAction* selectedItem = menu->exec(globalPos);
if (selectedItem && selectedItem->text()=="add tasks") {
AddTaskToProjectForm* form = new AddTaskToProjectForm(proj,this);
form->show();
}
if (selectedItem && selectedItem->text()=="remove") {
ProjectFactory::getInstance().removeProject(proj);
refreshProjectsModel();
refreshIndependentTasksModel();
}
if (selectedItem && selectedItem->text()=="infos") {
ProjectInfo* projectinfo = new ProjectInfo(proj,this);
projectinfo->show();
}
if (selectedItem && selectedItem->text()=="show tree") {
treeScene->clear();
if (projectsTreeView->isHidden()) {
itemTypeSelector->setCurrentIndex(2);
drawProjectTree(projectsTreeView->indexAt(pos)); // called from the projectsTreeView
}
else {
drawProjectTree(projectsTreeView->indexAt(pos)); // called from the projectsTree
}
calendarTable->hide();
treeView->show();
}
}
catch (CalendarException e) {
QString selectedTask = projectsTree->indexAt(pos).data(Qt::DisplayRole).toString();
if (!(projectsTreeView->isHidden()))
selectedTask = projectsTreeView->indexAt(pos).data(Qt::DisplayRole).toString();
try {
t = &(NonPreemptiveFactory::getInstance().getTask(selectedTask));
if (t->getTaskType()==COMPOSITE) menu->addAction("add subtasks");
else {
UnitaryTask* ut = &(NonPreemptiveFactory::getInstance().getTypedTask(selectedTask));
menu->addAction("schedule programmation");
}
menu->addAction("edit constraints");
menu->addAction("infos");
menu->addAction("remove");
QAction* selectedItem = menu->exec(globalPos);
if (selectedItem && selectedItem->text()=="add subtasks") {
AddTaskToCompositeTaskForm* form = new AddTaskToCompositeTaskForm(dynamic_cast<CompositeTask*>(t),this);
form->show();
}
if (selectedItem && selectedItem->text()=="remove") {
NonPreemptiveFactory::getInstance().removeTask(t);
refreshProjectsModel();
refreshIndependentTasksModel();
}
if (selectedItem && selectedItem->text()=="infos") {
TaskInfo* taskinfo = new TaskInfo(t,this);
taskinfo->show();
}
if (selectedItem && selectedItem->text()=="edit constraints") {
EditAssociationConstraint* editc = new EditAssociationConstraint(t,this);
editc->show();
}
}
catch (CalendarException e) {return;}
}
}
示例11: reader
void MPIWorkerMaster::run()
{
Profiler::getInstance().setEnabled(true);
CriticalDegree degree;
//FlightDataReader reader("c:\\basic1.txt");
FlightDataReader reader("c:\\basic2.txt");
//FlightDataReader reader("c:\\big1.txt");
//FlightDataReader reader("c:\\big2.txt");
echo(MakeString() << "Load data... (" << reader.getFileName() << ")");
reader.open();
reader.readHeader();
Profiler::getInstance().start("1. Read flights data");
// 1. Read flights data
std::vector<Flight> flights = reader.readFlights();
Profiler::getInstance().finish();
ProjectInfo projectInfo = reader.getProjectInfo();
echo(MakeString() << "Project info: " << projectInfo.dump().str());
//Init available slaves (if any) with project info (mSlaveQueue)
initSlaves(projectInfo);
// 2. Build flight paths
// OpenMP splitted by number of flights ()
buildFlightsPathsParallel(projectInfo, flights);
// Calculate total number of project spaces to be processed
int numOfTasks = calcNumberOfTasks(projectInfo);
echo(MakeString() << "Max number of threads: " << omp_get_max_threads());
echo(MakeString() << "Total number of tasks: " << numOfTasks);
echo("Processing...");
int progress = 1;
Profiler::getInstance().start("Process project spaces");
ProjectSpaceBuilder builder(projectInfo, flights);
// 3. Calculate Critical Degree
while(builder.nextTime()) {
ProjectSpace projectSpace = builder.build();
// LB - Have free workers send more tasks
if (mSlaveQueue.size() > 0) {
sendTask(projectSpace);
} else {
CriticalLevel level = executeTask(projectSpace);
degree.addCriticalLevel(level);
}
collectSlaveResults(degree);
if (progress % 10000 == 0) {
echo (MakeString() << " Progress: " << progress);
}
progress++;
}
Profiler::getInstance().finish();
echo("Collect results from still running slaves.");
while(mSlaveRunningTasks > 0) {
collectSlaveResults(degree);
}
sendSlavesFinishSignal();
printResult(degree);
}
示例12: KDialog
//BEGIN class LinkerOptionsDlg
LinkerOptionsDlg::LinkerOptionsDlg( LinkerOptions * linkingOptions, QWidget *parent )
: // KDialog( parent, "Linker Options Dialog", true, "Linker Options", KDialog::Ok|KDialog::Cancel, KDialog::Ok, true )
KDialog( parent) //, "Linker Options Dialog", true, "Linker Options", KDialog::Ok|KDialog::Cancel, KDialog::Ok, true )
{
setObjectName("Linker Options Dialog");
setModal(true);
setCaption(i18n("Linker Options"));
setButtons(KDialog::Ok|KDialog::Cancel);
setDefaultButton(KDialog::Ok);
showButtonSeparator(true);
m_pLinkerOptions = linkingOptions;
m_pWidget = new LinkerOptionsWidget(this);
ProjectInfo * pi = ProjectManager::self()->currentProject();
assert(pi);
//BEGIN Update gplink options
m_pWidget->m_pHexFormat->setCurrentIndex( m_pLinkerOptions->hexFormat() );
m_pWidget->m_pOutputMap->setChecked( m_pLinkerOptions->outputMapFile() );
m_pWidget->m_pLibraryDir->setText( m_pLinkerOptions->libraryDir() );
m_pWidget->m_pLinkerScript->setText( m_pLinkerOptions->linkerScript() );
m_pWidget->m_pOther->setText( m_pLinkerOptions->linkerOther() );
//END Update gplink options
//BEGIN Update library widgets
const KUrl::List availableInternal = pi->childOutputURLs( ProjectItem::LibraryType );
const QStringList linkedInternal = m_pLinkerOptions->linkedInternal();
KUrl::List::const_iterator end = availableInternal.end();
for ( KUrl::List::const_iterator it = availableInternal.begin(); it != end; ++it )
{
QString relativeURL = KUrl::relativeUrl( pi->url(), *it );
// 2017.12.1 - convert to QListWidgetItem
//Q3CheckListItem * item = new Q3CheckListItem( m_pWidget->m_pInternalLibraries, relativeURL, Q3CheckListItem::CheckBox );
QListWidgetItem * item = new QListWidgetItem( relativeURL, m_pWidget->m_pInternalLibraries );
item->setCheckState( (linkedInternal.contains(relativeURL)) ? Qt::Checked : Qt::Unchecked );
//item->setOn( linkedInternal.contains(relativeURL) ); // 2017.12.1 - convert to QListWidgetItem
}
m_pExternalLibraryRequester = new KUrlRequester( 0l );
m_pExternalLibraryRequester->fileDialog()->setUrl( KUrl( "/usr/share/sdcc/lib" ) );
delete m_pWidget->m_pExternalLibraries;
m_pWidget->m_pExternalLibraries = new KEditListBox( i18n("Link libraries outside project"), m_pExternalLibraryRequester->customEditor(), m_pWidget );
m_pWidget->m_pExternalLibraries->layout()->setMargin(11);
{
QGridLayout* grLayout = (dynamic_cast<QGridLayout*>(m_pWidget->layout()));
//grLayout->addMultiCellWidget( m_pWidget->m_pExternalLibraries, 7, 7, 0, 1 ); // 2018.12.02
grLayout->addWidget( m_pWidget->m_pExternalLibraries, 7, 0, 1, 2);
}
m_pWidget->m_pExternalLibraries->setButtons( KEditListBox::Add | KEditListBox::Remove );
m_pWidget->m_pExternalLibraries->insertStringList( m_pLinkerOptions->linkedExternal() );
//END Update library widgets
setMainWidget( m_pWidget );
setInitialSize( m_pWidget->rect().size() );
}