📄 projectpropertieimpl.cpp
字号:
/** This file is part of QDevelop, an open-source cross-platform IDE* Copyright (C) 2006 Jean-Luc Biord** This program is free software; you can redistribute it and/or modify* it under the terms of the GNU General Public License as published by* the Free Software Foundation; either version 2 of the License, or* (at your option) any later version.** This program is distributed in the hope that it will be useful,* but WITHOUT ANY WARRANTY; without even the implied warranty of* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the* GNU General Public License for more details.** You should have received a copy of the GNU General Public License* along with this program; if not, write to the Free Software* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA** Contact e-mail: Jean-Luc Biord <jl.biord@free.fr>* Program URL : http://qdevelop.org**/#include "projectpropertieimpl.h"#include "projectmanager.h"#include "misc.h"#include <QLineEdit>#include <QComboBox>#include <QCheckBox>#include <QMessageBox>#include <QInputDialog>#include <QFileDialog>#include <QDebug>//ProjectPropertieImpl::ProjectPropertieImpl(ProjectManager * parent, QTreeWidget *tree, QTreeWidgetItem *itProject) : QDialog(0), m_projectManager(parent), m_itProject(itProject), m_treeFiles(tree){ setupUi(this); m_copyItProject = 0; m_copyTreeFiles = new QTreeWidget(this); m_copyTreeFiles->setColumnCount(1); m_copyTreeFiles->setHeaderLabels(QStringList("")); m_copyTreeFiles->setHidden( true ); m_projectName = itProject->text(0); srcDirectory->setText( m_projectManager->srcDirectory( itProject ) ); uiDirectory->setText( m_projectManager->uiDirectory( itProject ) ); new QTreeWidgetItem(m_copyTreeFiles); copyTreeWidget(m_treeFiles->topLevelItem(0), m_copyTreeFiles->topLevelItem(0)); while ( m_projectManager->toKey( m_copyItProject->data(0, Qt::UserRole) ) != "PROJECT" ) m_copyItProject = m_copyItProject->parent(); setWindowTitle( tr("Properties of %1").arg(m_projectName) ); populateComboScope(); resize(10,10);}//void ProjectPropertieImpl::clearFields(){ QList<QObject*> enfants; enfants = groupeDebug->children(); QListIterator<QObject*> iterator(enfants); while ( iterator.hasNext() ) { QObject *objet = iterator.next(); QString classe = objet->metaObject()->className(); if ( classe == "QCheckBox" ) ((QCheckBox *)objet)->setChecked(false); else if ( classe == "QRadioButton" ) ((QRadioButton *)objet)->setChecked(false); } // enfants = groupeWarn->children(); iterator = QListIterator<QObject*>(enfants); while ( iterator.hasNext() ) { QObject *objet = iterator.next(); QString classe = objet->metaObject()->className(); if ( classe == "QCheckBox" ) ((QCheckBox *)objet)->setChecked(false); else if ( classe == "QRadioButton" ) ((QRadioButton *)objet)->setChecked(false); } // enfants = groupeBibliotheques->children(); iterator = QListIterator<QObject*>(enfants); while ( iterator.hasNext() ) { QObject *objet = iterator.next(); QString classe = objet->metaObject()->className(); if ( classe == "QCheckBox" ) ((QCheckBox *)objet)->setChecked(false); else if ( classe == "QRadioButton" ) ((QRadioButton *)objet)->setChecked(false); } // enfants = groupeAvancees->children(); iterator = QListIterator<QObject*>(enfants); while ( iterator.hasNext() ) { QObject *objet = iterator.next(); QString classe = objet->metaObject()->className(); if ( classe == "QCheckBox" ) ((QCheckBox *)objet)->setChecked(false); else if ( classe == "QRadioButton" ) ((QRadioButton *)objet)->setChecked(false); } supplement->clear();}//void ProjectPropertieImpl::connections(){ connect(subdirs, SIGNAL(toggled(bool)), this, SLOT(slotSubdirs(bool)) ); connect(okButton, SIGNAL(clicked()), this, SLOT(slotAccept()) ); connect(comboScope, SIGNAL(activated(int)), this, SLOT(slotComboScope(int)) ); connect(variablesList, SIGNAL(currentItemChanged(QListWidgetItem *, QListWidgetItem *)), this, SLOT(slotCurrentItemChanged(QListWidgetItem *, QListWidgetItem *)) ); connect(valuesList, SIGNAL(doubleClicked ( const QModelIndex &)), this, SLOT(slotModifyValue()) ); // connect(addVariable, SIGNAL(clicked()), this, SLOT(slotAddVariable()) ); connect(deleteVariable, SIGNAL(clicked()), this, SLOT(slotDeleteVariable()) ); connect(addValue, SIGNAL(clicked()), this, SLOT(slotAddValue()) ); connect(deleteValue, SIGNAL(clicked()), this, SLOT(slotDeleteValue()) ); connect(modifyValue, SIGNAL(clicked()), this, SLOT(slotModifyValue()) ); // connect(debug, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); connect(release, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); connect(debug_and_release, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); connect(build_all, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); connect(warn_on, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); connect(warn_off, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); connect(app_bundle, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); connect(assistant, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); connect(console, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); connect(designer, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); connect(dll, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); connect(exceptions, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); connect(lib_bundle, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); connect(no_lflags_merge, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); connect(opengl, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); connect(plugin, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); connect(ppc, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); connect(qaxcontainer, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); connect(qaxserver, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); connect(qt, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); connect(qtestlib, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); connect(resources, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); connect(rtti, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); connect(staticlib, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); connect(stl, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); connect(Thread, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); connect(uic3, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); connect(uitools, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); connect(windows, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); connect(x11, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); connect(x86, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); connect(core, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); connect(network, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); connect(sql, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); connect(xml, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); connect(gui, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); connect(libopengl, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); connect(svg, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); connect(qt3support, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); connect(app, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); connect(lib, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); connect(subdirs, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); // connect(srcDirectoryButton, SIGNAL(clicked()), this, SLOT(slotSrcDirectory()) ); connect(uiDirectoryButton, SIGNAL(clicked()), this, SLOT(slotUiDirectory()) );}//void ProjectPropertieImpl::unconnections(){ disconnect(subdirs, SIGNAL(toggled(bool)), this, SLOT(slotSubdirs(bool)) ); disconnect(okButton, SIGNAL(clicked()), this, SLOT(slotAccept()) ); disconnect(comboScope, SIGNAL(activated(int)), this, SLOT(slotComboScope(int)) ); disconnect(variablesList, SIGNAL(currentItemChanged(QListWidgetItem *, QListWidgetItem *)), this, SLOT(slotCurrentItemChanged(QListWidgetItem *, QListWidgetItem *)) ); // disconnect(addVariable, SIGNAL(clicked()), this, SLOT(slotAddVariable()) ); disconnect(deleteVariable, SIGNAL(clicked()), this, SLOT(slotDeleteVariable()) ); disconnect(addValue, SIGNAL(clicked()), this, SLOT(slotAddValue()) ); disconnect(deleteValue, SIGNAL(clicked()), this, SLOT(slotDeleteValue()) ); disconnect(modifyValue, SIGNAL(clicked()), this, SLOT(slotModifyValue()) ); // disconnect(debug, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); disconnect(release, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); disconnect(debug_and_release, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); disconnect(build_all, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); disconnect(warn_on, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); disconnect(warn_off, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); disconnect(app_bundle, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); disconnect(assistant, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); disconnect(console, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); disconnect(designer, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); disconnect(dll, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); disconnect(exceptions, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); disconnect(lib_bundle, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); disconnect(no_lflags_merge, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); disconnect(opengl, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); disconnect(plugin, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); disconnect(ppc, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); disconnect(qaxcontainer, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); disconnect(qaxserver, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); disconnect(qt, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); disconnect(qtestlib, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); disconnect(resources, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); disconnect(rtti, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); disconnect(staticlib, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); disconnect(stl, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); disconnect(Thread, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); disconnect(uic3, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); disconnect(uitools, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); disconnect(windows, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); disconnect(x11, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); disconnect(x86, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); disconnect(core, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); disconnect(network, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); disconnect(sql, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); disconnect(xml, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); disconnect(gui, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); disconnect(libopengl, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); disconnect(svg, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); disconnect(qt3support, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); disconnect(app, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); disconnect(lib, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) ); disconnect(subdirs, SIGNAL(toggled(bool)), this, SLOT(slotCheck(bool)) );}//void ProjectPropertieImpl::slotCheck(bool activer){ QVariant variant = comboScope->itemData( comboScope->currentIndex() ); //QTreeWidgetItem *itCombo = reinterpret_cast<QTreeWidgetItem*>(variant.toUInt()); QTreeWidgetItem *itCombo = (QTreeWidgetItem*)variantToItem(variant); QObject *objet = sender(); QString classe = objet->metaObject()->className(); QString nomVariable; QTreeWidgetItem *it; nomVariable = objet->objectName().simplified(); nomVariable = nomVariable.toLower(); // some (actually, one) of the checkboxes have upper characters to avoid name conflicts if ( QString(":app:lib:subdirs:").contains( ":"+nomVariable+":" ) ) { QTreeWidgetItem *itTemplate = subItTemplate( itCombo ); if ( !itTemplate ) { itTemplate = new QTreeWidgetItem( itCombo ); itTemplate->setText(0, "TEMPLATE"); itTemplate->setData(0, Qt::UserRole, m_projectManager->toItem("TEMPLATE", "=")); m_copyTreeFiles->setItemHidden(itTemplate, true); } it = itTemplate; } else if ( QString(":core:gui:network:libopengl:sql:svg:xml:qt3support:").contains( ":"+nomVariable+":" ) ) { if (nomVariable == "libopengl") nomVariable = "opengl"; // There's both CONFIG += opengl and QT += opengl - the latter widget is called libopengl so the name must be manually replaced here QTreeWidgetItem *itQT = subItQT( itCombo ); if ( !itQT ) { itQT = new QTreeWidgetItem( itCombo ); itQT->setText(0, "QT"); itQT->setData(0, Qt::UserRole, m_projectManager->toItem("QT", "+=")); m_copyTreeFiles->setItemHidden(itQT, true); } it = itQT; }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -