forked from qt-creator/qt-creator
ToolChain: Add scrollbar to config widget
This is necessary for the custom tool chain that has its widgets squashed together. Task-number: QTCREATORBUG-10329 Change-Id: I53f125721c1e018bca07503049f412fec3725c22 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
#include "toolchainconfigwidget.h"
|
||||
#include "toolchain.h"
|
||||
|
||||
#include <utils/detailswidget.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QString>
|
||||
@@ -38,6 +39,8 @@
|
||||
#include <QFormLayout>
|
||||
#include <QLineEdit>
|
||||
#include <QLabel>
|
||||
#include <QScrollArea>
|
||||
#include <QPainter>
|
||||
|
||||
namespace ProjectExplorer {
|
||||
|
||||
@@ -46,10 +49,26 @@ ToolChainConfigWidget::ToolChainConfigWidget(ToolChain *tc) :
|
||||
{
|
||||
Q_ASSERT(tc);
|
||||
|
||||
m_nameLineEdit = new QLineEdit(this);
|
||||
m_mainLayout = new QFormLayout(this);
|
||||
m_nameLineEdit->setText(tc->displayName());
|
||||
Utils::DetailsWidget *centralWidget = new Utils::DetailsWidget;
|
||||
centralWidget->setState(Utils::DetailsWidget::NoSummary);
|
||||
|
||||
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
setFrameShape(QFrame::NoFrame);
|
||||
setWidgetResizable(true);
|
||||
setFocusPolicy(Qt::NoFocus);
|
||||
|
||||
setWidget(centralWidget);
|
||||
|
||||
QWidget *detailsBox = new QWidget();
|
||||
|
||||
m_mainLayout = new QFormLayout(detailsBox);
|
||||
m_mainLayout->setContentsMargins(0, 0, 0, 0);
|
||||
centralWidget->setWidget(detailsBox);
|
||||
m_mainLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow); // for the Macs...
|
||||
|
||||
m_nameLineEdit = new QLineEdit;
|
||||
m_nameLineEdit->setText(tc->displayName());
|
||||
|
||||
m_mainLayout->addRow(tr("Name:"), m_nameLineEdit);
|
||||
|
||||
connect(m_nameLineEdit, SIGNAL(textChanged(QString)), SIGNAL(dirty()));
|
||||
|
@@ -33,7 +33,7 @@
|
||||
|
||||
#include "projectexplorer_export.h"
|
||||
|
||||
#include <QWidget>
|
||||
#include <QScrollArea>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QFormLayout;
|
||||
@@ -50,7 +50,7 @@ class ToolChain;
|
||||
// ToolChainConfigWidget
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
class PROJECTEXPLORER_EXPORT ToolChainConfigWidget : public QWidget
|
||||
class PROJECTEXPLORER_EXPORT ToolChainConfigWidget : public QScrollArea
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
Reference in New Issue
Block a user