⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 projectpropertieimpl.cpp

📁 用Qt4编写的linux IDE开发环境
💻 CPP
📖 第 1 页 / 共 3 页
字号:
                                            tr("The spaces aren't correctly parsed by qmake")                                            +",\n"                                            +tr("delete spaces or put quotes."),                                            tr("Modify"), tr("Cancel") );            if ( corriger == 1 )                ok = false;        }    }    while ( ok && corriger==0 );    if (ok && !text.isEmpty())        nouvelleValeur = text;    else        return;    itemTree->setText(0, nouvelleValeur);    slotCurrentItemChanged(variablesList->currentItem(), 0);}//void ProjectPropertieImpl::slotComboScope(int index){    unconnections();    variablesList->clear();    valuesList->clear();    clearFields();    QVariant variant = comboScope->itemData( index );    //QTreeWidgetItem *item = reinterpret_cast<QTreeWidgetItem*>(variant.toUInt());    QTreeWidgetItem *item = (QTreeWidgetItem*)variantToItem(variant);    if ( m_projectManager->toKey( item->data(0, Qt::UserRole) ) != "PROJECT" )        projectTemplate->setDisabled( true );    else        projectTemplate->setDisabled( false );    parse( item );    QList<QTreeWidgetItem *> listeScope;    for (int nbScope=0; nbScope < item->childCount(); nbScope++)    {        QTreeWidgetItem *it = item->child( nbScope );        QString cle = m_projectManager->toKey( it->data(0, Qt::UserRole) );        QString donnee = it->text( 0 );        if ( !QString("CONFIG|FORMS|HEADERS|QT|RESOURCES|SOURCES|TRANSLATIONS|TEMPLATE|SCOPE|SUBDIRS|absoluteNameProjectFile|projectDirectory|subProjectName|qmake|srcDirectory|uiDirectory").contains( cle ) )        {            variablesList->addItem( cle );            //variablesList->item( variablesList->count()-1 )->setData(Qt::UserRole, QVariant(reinterpret_cast<uint>(it) ) );            variablesList->item( variablesList->count()-1 )->setData(Qt::UserRole, addressToVariant(it) );        }    }    if ( variablesList->count() )        slotCurrentItemChanged( variablesList->item( 0 ), 0);    connections();    if ( m_projectManager->toKey( item->data(0, Qt::UserRole) ) != "PROJECT" )        projectTemplate->setDisabled( true );    else        projectTemplate->setDisabled( false );}//void ProjectPropertieImpl::parse(QTreeWidgetItem *it){    for (int i=0; i<it->childCount(); i++)    {        QTreeWidgetItem *item = it->child( i );        QString cle = m_projectManager->toKey( item->data(0, Qt::UserRole) );        if ( cle == "TEMPLATE" )            parseTemplate(item);        else if ( cle == "QT" )            parseQT(item);        else if ( cle == "CONFIG" )            parseConfig(item);        //else if( cle == "SCOPE" )        //analyseScope(it);    }}//void ProjectPropertieImpl::parseConfig(QTreeWidgetItem *it){    for (int i=0; i<it->childCount(); i++)    {        QTreeWidgetItem *itemConfig = it->child( i );        QString donnee = itemConfig->text(0);        if ( donnee == "debug" )	debug->setChecked(true);        else if ( donnee == "release" )	release->setChecked(true);        else if ( donnee == "debug_and_release" )	debug_and_release->setChecked(true);        else if ( donnee == "build_all" )	build_all->setChecked(true);        else if ( donnee == "warn_on" )	warn_on->setChecked(true);        else if ( donnee == "warn_off" )	warn_off->setChecked(true);        else if ( donnee == "app_bundle" ) app_bundle->setChecked(true);        else if ( donnee == "assistant" )	assistant->setChecked(true);        else if ( donnee == "console" )	console->setChecked(true);        else if ( donnee == "designer" )	designer->setChecked(true);        else if ( donnee == "dll" )	dll->setChecked(true);        else if ( donnee == "exceptions" )	exceptions->setChecked(true);        else if ( donnee == "lib_bundle" )	lib_bundle->setChecked(true);        else if ( donnee == "no_lflags_merge" )	no_lflags_merge->setChecked(true);        else if ( donnee == "opengl" )	opengl->setChecked(true);        else if ( donnee == "plugin" ) plugin->setChecked(true);        else if ( donnee == "ppc" )	ppc->setChecked(true);        else if ( donnee == "qaxcontainer" )	qaxcontainer->setChecked(true);        else if ( donnee == "qaxserver" )qaxserver->setChecked(true);        else if ( donnee == "qt" )	qt->setChecked(true);        else if ( donnee == "qtestlib" )	qtestlib->setChecked(true);        else if ( donnee == "resources" )resources->setChecked(true);        else if ( donnee == "rtti" )	rtti->setChecked(true);        else if ( donnee == "staticlib" )	staticlib->setChecked(true);        else if ( donnee == "stl" )	stl->setChecked(true);        else if ( donnee == "thread" )	Thread->setChecked(true);        else if ( donnee == "uic3" )	uic3->setChecked(true);        else if ( donnee == "uitools" )	uitools->setChecked(true);        else if ( donnee == "windows" )	windows->setChecked(true);        else if ( donnee == "x11" )	x11->setChecked(true);        else if ( donnee == "x86" )	x86->setChecked(true);        else        {            supplement->setText( supplement->text() + " "+ donnee );            delete itemConfig;        }    }    supplement->setText( supplement->text().simplified() );}//void ProjectPropertieImpl::parseQT(QTreeWidgetItem *it){    for (int i=0; i<it->childCount(); i++)    {        QTreeWidgetItem *itemConfig = it->child( i );        QString donnee = itemConfig->text(0);        if ( donnee == "core" )	core->setChecked(true);        if ( donnee == "network" )	network->setChecked(true);        if ( donnee == "sql" )	sql->setChecked(true);        if ( donnee == "xml" )	xml->setChecked(true);        if ( donnee == "gui" )	gui->setChecked(true);        if ( donnee == "opengl" )	libopengl->setChecked(true);        if ( donnee == "svg" )	svg->setChecked(true);        if ( donnee == "qt3support" )	qt3support->setChecked(true);    }}//void ProjectPropertieImpl::parseTemplate(QTreeWidgetItem *it){    for (int i=0; i<it->childCount(); i++)    {        QTreeWidgetItem *itemTemplate = it->child( i );        QString donnee = itemTemplate->text(0);        if ( donnee == "app" )        {            app->setChecked( true );            subdirs->setDisabled( true );        }        else if ( donnee == "lib" )        {            lib->setChecked( true );            subdirs->setDisabled( true );        }        else if ( donnee == "subdirs" )        {            subdirs->setChecked( true );            lib->setDisabled (true );            app->setDisabled (true );            slotSubdirs( true );        }    }}//void ProjectPropertieImpl::populateComboScope(){    //comboScope->addItem(m_copyItProject->text(0) , QVariant(reinterpret_cast<uint>(m_copyItProject)));    comboScope->addItem(m_copyItProject->text(0) , addressToVariant(m_copyItProject));    QString projectName = m_projectManager->projectFilename( m_copyItProject );    QList<QTreeWidgetItem *> listeScope;    m_projectManager->childsList(m_copyItProject, "SCOPE", listeScope);    for (int nbScope=0; nbScope < listeScope.count(); nbScope++)    {        QString scopeName;        QTreeWidgetItem *tmp = listeScope.at(nbScope);        int nbEspace = 0;        while ( tmp )        {            QString cleTmp = m_projectManager->toKey( tmp->data(0,Qt::UserRole) );            QString indent;            for (int i=0; i<nbEspace; i++)                indent += "  ";            if ( cleTmp == "SCOPE" || cleTmp == "PROJECT" )                scopeName = indent + tmp->text(0) + ":" + scopeName.simplified();            if ( cleTmp == "PROJECT" )                break;            tmp = tmp->parent();            nbEspace++;        }        if ( m_projectManager->projectFilename( listeScope.at(nbScope) ) == projectName )            comboScope->addItem( scopeName, addressToVariant(listeScope.at(nbScope)));        //comboScope->addItem( scopeName, QVariant(reinterpret_cast<uint>(listeScope.at(nbScope))));    }    if ( comboScope->count() == 1 )        comboScope->setDisabled( true );    if ( comboScope->count() )    {        comboScope->setCurrentIndex( 0 );        slotComboScope( 0 );    }}//void ProjectPropertieImpl::slotSubdirs(bool coche){    tabConfig->setEnabled(!coche);}////void ProjectPropertieImpl::makeComboVariables( QComboBox *combo ){    combo->addItem("DEFINES: qmake adds the values of this variable as compiler C preprocessor macros (-D option).", QVariant( QString("DEFINES") ) );    combo->addItem("DEF_FILE: This is only used on Windows when using the app template.", QVariant( QString("DEF_FILE") ) );    combo->addItem("DEPENDPATH: This variable contains the list of all directories to look in to resolve dependencies. This will be used when crawling through included files. ", QVariant( QString("DEPENDPATH") ) );    combo->addItem("DESTDIR: Specifies where to put the target file.", QVariant( QString("DESTDIR") ) );    combo->addItem("DLLDESTDIR: Specifies where to copy the target dll. ", QVariant( QString("DLLDESTDIR") ) );    combo->addItem("DISTFILES: This variable contains a list of files to be included in the dist target.", QVariant( QString("DISTFILES") ) );    combo->addItem("INCLUDEPATH: This variable specifies the #include directories which should be searched when compiling the project.", QVariant( QString("INCLUDEPATH") ) );    combo->addItem("INSTALLS: This variable contains a list of resources that will be installed when make install is executed.", QVariant( QString("INSTALLS") ) );    combo->addItem("LEXSOURCES: This variable contains a list of lex source files.", QVariant( QString("LEXSOURCES") ) );    combo->addItem("LIBS: This variable contains a list of libraries to be linked into the project.", QVariant( QString("LIBS") ) );    combo->addItem("MAKEFILE: This variable specifies the name of the Makefile which qmake should use when outputting the dependency information for building a project.", QVariant( QString("MAKEFILE") ) );    combo->addItem("MOC_DIR: This variable specifies the directory where all intermediate moc files should be placed.", QVariant( QString("MOC_DIR") ) );    combo->addItem("OBJECTS_DIR: This variable specifies the directory where all intermediate objects should be placed.", QVariant( QString("OBJECTS_DIR") ) );    combo->addItem("QTPLUGIN: This variable contains a list of names of static plugins that are to be compiled with an application so that they are available as built-in resources. ", QVariant( QString("QTPLUGIN") ) );    combo->addItem("RCC_DIR: This variable specifies the directory where all intermediate resource files should be placed.", QVariant( QString("RCC_DIR") ) );    combo->addItem("TARGET: This specifies the name of the target file.", QVariant( QString("TARGET") ) );    combo->addItem("UI_DIR: This variable specifies the directory where all intermediate files from uic should be placed.", QVariant( QString("UI_DIR") ) );    combo->addItem("UI_HEADERS_DIR: This variable specifies the directory where all declaration files (as generated by uic) should be placed.", QVariant( QString("UI_HEADERS_DIR") ) );    combo->addItem("UI_SOURCES_DIR: This variable specifies the directory where all implementation files (as generated by uic) should be placed.", QVariant( QString("UI_SOURCES_DIR") ) );    combo->addItem("VERSION: This variable contains the version number of the library if the lib TEMPLATE is specified.", QVariant( QString("VERSION") ) );    combo->addItem("VER_MAJ: This variable contains the major version number of the library, if the lib template is specified. ", QVariant( QString("VER_MAJ") ) );    combo->addItem("VER_MIN: This variable contains the minor version number of the library, if the lib template is specified. ", QVariant( QString("VER_MIN") ) );    combo->addItem("VER_PAT: This variable tells qmake where to search for files it cannot open.", QVariant( QString("VER_PAT") ) );}//void ProjectPropertieImpl::slotSrcDirectory(){    QString s = QFileDialog::getExistingDirectory(                    this,                    tr("Choose the sources location"),                    srcDirectory->text(),                    QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks );    if ( s.isEmpty() )    {        return;    }    srcDirectory->setText( s );}//void ProjectPropertieImpl::slotUiDirectory(){    QString s = QFileDialog::getExistingDirectory(                    this,                    tr("Choose the dialogs location"),                    uiDirectory->text(),                    QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks );    if ( s.isEmpty() )    {        return;    }    uiDirectory->setText( s );}//

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -