Commit 7d40ce84 authored by Alessandro Portale's avatar Alessandro Portale

Remove QHeaderView::setDefaultSectionSize calls

Do not set the row height in pixels, since that
will break in High DPI situations. We do that for
some QTableViews, apparently as an obsolete
workaround.

QTableView does the right thing by default,
therefore we don't need to set that value at all.

Task-Number: QTCREATORBUG-11179
Change-Id: Id90f01316f8359207796a4060cb43b0aba93d441
Reviewed-by: default avatarOswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
Reviewed-by: default avatarEike Ziller <eike.ziller@digia.com>
parent e84b999a
......@@ -304,7 +304,6 @@ void MimeTypeSettingsPrivate::configureTable(QTableView *tableView)
tableView->setSelectionBehavior(QAbstractItemView::SelectRows);
tableView->setSelectionMode(QAbstractItemView::SingleSelection);
tableView->verticalHeader()->setVisible(false);
tableView->verticalHeader()->setDefaultSectionSize(20);
tableView->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
tableView->horizontalHeader()->setResizeMode(0, QHeaderView::Interactive);
tableView->horizontalHeader()->resizeSection(
......
......@@ -96,8 +96,6 @@ RemoteDialog::RemoteDialog(QWidget *parent) :
m_ui->remoteView->setModel(m_remoteModel);
m_ui->remoteView->horizontalHeader()->setStretchLastSection(true);
m_ui->remoteView->horizontalHeader()->setResizeMode(0, QHeaderView::ResizeToContents);
QFontMetrics fm(font());
m_ui->remoteView->verticalHeader()->setDefaultSectionSize(qMax(static_cast<int>(fm.height() * 1.2), fm.height() + 4));
connect(m_ui->addButton, SIGNAL(clicked()), this, SLOT(addRemote()));
connect(m_ui->fetchButton, SIGNAL(clicked()), this, SLOT(fetchFromRemote()));
......
......@@ -100,8 +100,6 @@ EnvironmentWidget::EnvironmentWidget(QWidget *parent, QWidget *additionalDetails
d->m_environmentView->horizontalHeader()->setHighlightSections(false);
new Utils::HeaderViewStretcher(d->m_environmentView->horizontalHeader(), 1);
d->m_environmentView->verticalHeader()->hide();
QFontMetrics fm(font());
d->m_environmentView->verticalHeader()->setDefaultSectionSize(qMax(static_cast<int>(fm.height() * 1.2), fm.height() + 4));
d->m_environmentView->setSelectionMode(QAbstractItemView::SingleSelection);
horizontalLayout->addWidget(d->m_environmentView);
......
......@@ -346,7 +346,6 @@ void SnippetsSettingsPagePrivate::configureUi(QWidget *w)
m_ui.snippetsTable->horizontalHeader()->setStretchLastSection(true);
m_ui.snippetsTable->horizontalHeader()->setHighlightSections(false);
m_ui.snippetsTable->verticalHeader()->setVisible(false);
m_ui.snippetsTable->verticalHeader()->setDefaultSectionSize(20);
m_ui.snippetsTable->setModel(m_model);
m_ui.revertButton->setEnabled(false);
......
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