forked from qt-creator/qt-creator
		
	Add uncheck all button to targetsetuppage
Task-number: QTCREATORBUG-1290
This commit is contained in:
		@@ -68,6 +68,8 @@ TargetSetupPage::TargetSetupPage(QWidget *parent) :
 | 
			
		||||
 | 
			
		||||
    connect(m_ui->importButton, SIGNAL(clicked()),
 | 
			
		||||
            this, SLOT(addShadowBuildLocation()));
 | 
			
		||||
    connect(m_ui->uncheckButton, SIGNAL(clicked()),
 | 
			
		||||
            this, SLOT(uncheckAll()));
 | 
			
		||||
    connect(m_ui->versionTree, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)),
 | 
			
		||||
            this, SLOT(handleDoubleClicks(QTreeWidgetItem*,int)));
 | 
			
		||||
}
 | 
			
		||||
@@ -286,7 +288,7 @@ void TargetSetupPage::setProFilePath(const QString &path)
 | 
			
		||||
{
 | 
			
		||||
    m_proFilePath = path;
 | 
			
		||||
    if (!m_proFilePath.isEmpty()) {
 | 
			
		||||
        m_ui->descriptionLabel->setText(tr("Qt Creator can set up the following targets for project <b>%1</b>:",
 | 
			
		||||
        m_ui->descriptionLabel->setText(tr("Qt Creator can set up the following targets for<br>project <b>%1</b>:",
 | 
			
		||||
                                           "%1: Project name").arg(QFileInfo(m_proFilePath).baseName()));
 | 
			
		||||
    }
 | 
			
		||||
    // Force regeneration of tree widget contents:
 | 
			
		||||
@@ -411,6 +413,17 @@ void TargetSetupPage::addShadowBuildLocation()
 | 
			
		||||
    setImportInfos(tmp);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void TargetSetupPage::uncheckAll()
 | 
			
		||||
{
 | 
			
		||||
    for (int i = 0; i < m_ui->versionTree->topLevelItemCount(); ++i) {
 | 
			
		||||
        QTreeWidgetItem *current = m_ui->versionTree->topLevelItem(i);
 | 
			
		||||
        for (int j = 0; j < current->childCount(); ++j) {
 | 
			
		||||
            QTreeWidgetItem *child = current->child(j);
 | 
			
		||||
            child->setCheckState(0, Qt::Unchecked);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void TargetSetupPage::handleDoubleClicks(QTreeWidgetItem *item, int column)
 | 
			
		||||
{
 | 
			
		||||
    int idx = item->data(NAME_COLUMN, Qt::UserRole).toInt();
 | 
			
		||||
 
 | 
			
		||||
@@ -119,6 +119,7 @@ public slots:
 | 
			
		||||
private slots:
 | 
			
		||||
    void itemWasChanged();
 | 
			
		||||
    void addShadowBuildLocation();
 | 
			
		||||
    void uncheckAll();
 | 
			
		||||
    void handleDoubleClicks(QTreeWidgetItem *, int);
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
 
 | 
			
		||||
@@ -6,7 +6,7 @@
 | 
			
		||||
   <rect>
 | 
			
		||||
    <x>0</x>
 | 
			
		||||
    <y>0</y>
 | 
			
		||||
    <width>550</width>
 | 
			
		||||
    <width>555</width>
 | 
			
		||||
    <height>450</height>
 | 
			
		||||
   </rect>
 | 
			
		||||
  </property>
 | 
			
		||||
@@ -15,17 +15,53 @@
 | 
			
		||||
  </property>
 | 
			
		||||
  <layout class="QVBoxLayout" name="verticalLayout">
 | 
			
		||||
   <item>
 | 
			
		||||
    <widget class="QLabel" name="descriptionLabel">
 | 
			
		||||
     <property name="text">
 | 
			
		||||
      <string>Qt Creator can set up the following targets:</string>
 | 
			
		||||
     </property>
 | 
			
		||||
     <property name="wordWrap">
 | 
			
		||||
      <bool>true</bool>
 | 
			
		||||
     </property>
 | 
			
		||||
     <property name="textInteractionFlags">
 | 
			
		||||
      <set>Qt::NoTextInteraction</set>
 | 
			
		||||
     </property>
 | 
			
		||||
    </widget>
 | 
			
		||||
    <layout class="QHBoxLayout" name="horizontalLayout_2">
 | 
			
		||||
     <item>
 | 
			
		||||
      <widget class="QLabel" name="descriptionLabel">
 | 
			
		||||
       <property name="sizePolicy">
 | 
			
		||||
        <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
 | 
			
		||||
         <horstretch>0</horstretch>
 | 
			
		||||
         <verstretch>0</verstretch>
 | 
			
		||||
        </sizepolicy>
 | 
			
		||||
       </property>
 | 
			
		||||
       <property name="text">
 | 
			
		||||
        <string>Qt Creator can set up the following targets:</string>
 | 
			
		||||
       </property>
 | 
			
		||||
       <property name="wordWrap">
 | 
			
		||||
        <bool>false</bool>
 | 
			
		||||
       </property>
 | 
			
		||||
       <property name="textInteractionFlags">
 | 
			
		||||
        <set>Qt::NoTextInteraction</set>
 | 
			
		||||
       </property>
 | 
			
		||||
      </widget>
 | 
			
		||||
     </item>
 | 
			
		||||
     <item>
 | 
			
		||||
      <spacer name="horizontalSpacer_2">
 | 
			
		||||
       <property name="orientation">
 | 
			
		||||
        <enum>Qt::Horizontal</enum>
 | 
			
		||||
       </property>
 | 
			
		||||
       <property name="sizeType">
 | 
			
		||||
        <enum>QSizePolicy::MinimumExpanding</enum>
 | 
			
		||||
       </property>
 | 
			
		||||
       <property name="sizeHint" stdset="0">
 | 
			
		||||
        <size>
 | 
			
		||||
         <width>13</width>
 | 
			
		||||
         <height>13</height>
 | 
			
		||||
        </size>
 | 
			
		||||
       </property>
 | 
			
		||||
      </spacer>
 | 
			
		||||
     </item>
 | 
			
		||||
     <item>
 | 
			
		||||
      <widget class="QPushButton" name="uncheckButton">
 | 
			
		||||
       <property name="toolTip">
 | 
			
		||||
        <string>Uncheck all Qt versions</string>
 | 
			
		||||
       </property>
 | 
			
		||||
       <property name="text">
 | 
			
		||||
        <string>uncheck all</string>
 | 
			
		||||
       </property>
 | 
			
		||||
      </widget>
 | 
			
		||||
     </item>
 | 
			
		||||
    </layout>
 | 
			
		||||
   </item>
 | 
			
		||||
   <item>
 | 
			
		||||
    <widget class="QTreeWidget" name="versionTree">
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user