Commit ee524eb1 authored by con's avatar con
Browse files

Beautify general build configuration.

parent a9f81ab3
......@@ -138,6 +138,11 @@ void PathChooser::addButton(const QString &text, QObject *receiver, const char *
m_d->m_hLayout->addWidget(button);
}
QAbstractButton *PathChooser::buttonAtIndex(int index) const
{
return findChildren<QAbstractButton*>().at(index);
}
QString PathChooser::path() const
{
return m_d->m_lineEdit->text();
......
......@@ -33,6 +33,7 @@
#include "utils_global.h"
#include <QtGui/QWidget>
#include <QtGui/QAbstractButton>
namespace Core {
namespace Utils {
......@@ -91,6 +92,7 @@ public:
static QString homePath();
void addButton(const QString &text, QObject *receiver, const char *slotFunc);
QAbstractButton *buttonAtIndex(int index) const;
private:
// Returns overridden title or the one from <title>
......
......@@ -56,6 +56,19 @@ Qt4ProjectConfigWidget::Qt4ProjectConfigWidget(Qt4Project *project)
{
m_ui = new Ui::Qt4ProjectConfigWidget();
m_ui->setupUi(this);
// fix the layout
QAbstractButton *browseButton = m_ui->shadowBuildDirEdit->buttonAtIndex(0);
m_ui->gridLayout->addWidget(browseButton, 4, 2);
int minimumHeight = qMax(m_ui->qtVersionComboBox->sizeHint().height(), m_ui->manageQtVersionPushButtons->sizeHint().height());
Qt::Alignment labelAlignment = Qt::Alignment(style()->styleHint(QStyle::SH_FormLayoutLabelAlignment));
for (int i = 0; i < m_ui->gridLayout->rowCount(); ++i) {
m_ui->gridLayout->setRowMinimumHeight(i, minimumHeight);
QLayoutItem *item = m_ui->gridLayout->itemAtPosition(i, 0);
if (item)
item->setAlignment(labelAlignment);
}
m_ui->shadowBuildDirEdit->setPromptDialogTitle(tr("Shadow Build Directory"));
m_ui->shadowBuildDirEdit->setExpectedKind(Core::Utils::PathChooser::Directory);
m_ui->invalidQtWarningLabel->setVisible(false);
......
......@@ -10,11 +10,20 @@
<height>247</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<layout class="QGridLayout" name="gridLayout">
<property name="horizontalSpacing">
<number>8</number>
</property>
<property name="verticalSpacing">
<number>4</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="nameLabel">
......@@ -47,46 +56,52 @@
</widget>
</item>
<item row="1" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>4</number>
</property>
<item>
<widget class="QComboBox" name="qtVersionComboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="manageQtVersionPushButtons">
<property name="text">
<string>Manage Qt Versions</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="invalidQtWarningLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>This Qt-Version is invalid.</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="1" column="2">
<widget class="QPushButton" name="manageQtVersionPushButtons">
<property name="text">
<string>Manage</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Tool Chain:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="toolChainComboBox"/>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label">
<property name="text">
......@@ -114,18 +129,8 @@
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLabel" name="importLabel">
<property name="text">
<string>&lt;a href=&quot;import&quot;&gt;Import existing build&lt;/a&gt;</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="Core::Utils::PathChooser" name="shadowBuildDirEdit" native="true">
<widget class="Core::Utils::PathChooser" name="shadowBuildDirEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
......@@ -134,35 +139,19 @@
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="toolChainComboBox"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_2">
<item row="5" column="1">
<widget class="QLabel" name="importLabel">
<property name="text">
<string>Tool Chain:</string>
<string>&lt;a href=&quot;import&quot;&gt;Import existing build&lt;/a&gt;</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="1">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0">
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment