forked from qt-creator/qt-creator
introduce new helper class Core::Utils::TreeWidgetColumnStretcher
and use it for some options dialogs. The class fixes QTreeWidget to resize all columns to contents, except one stretching column. As opposed to standard QTreeWidget, all columns are still interactively resizable.
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include "qt4projectmanagerconstants.h"
|
||||
#include "qtversionmanager.h"
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <utils/treewidgetcolumnstretcher.h>
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QDir>
|
||||
@@ -60,6 +61,8 @@ void QtOptionsPage::apply()
|
||||
}
|
||||
|
||||
//-----------------------------------------------------
|
||||
|
||||
|
||||
QtOptionsPageWidget::QtOptionsPageWidget(QWidget *parent, QList<QtVersion *> versions, QtVersion *defaultVersion)
|
||||
: QWidget(parent)
|
||||
, m_defaultVersion(versions.indexOf(defaultVersion))
|
||||
@@ -82,6 +85,8 @@ QtOptionsPageWidget::QtOptionsPageWidget(QWidget *parent, QList<QtVersion *> ver
|
||||
m_ui->addButton->setIcon(QIcon(Core::Constants::ICON_PLUS));
|
||||
m_ui->delButton->setIcon(QIcon(Core::Constants::ICON_MINUS));
|
||||
|
||||
new Core::Utils::TreeWidgetColumnStretcher(m_ui->qtdirList, 1);
|
||||
|
||||
for (int i = 0; i < m_versions.count(); ++i) {
|
||||
const QtVersion * const version = m_versions.at(i);
|
||||
QTreeWidgetItem *item = new QTreeWidgetItem(m_ui->qtdirList);
|
||||
|
||||
Reference in New Issue
Block a user