mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Remove use of QFontMetrics width
This commit is contained in:
parent
a7e3cc154a
commit
1d62d3534c
@ -211,7 +211,7 @@ RiuTabbedTextDialog::RiuTabbedTextDialog( RiuTabbedTextProvider* textProvider, Q
|
||||
textEdit->setFont( font );
|
||||
textEdit->setContextMenuPolicy( Qt::NoContextMenu );
|
||||
|
||||
auto fontWidth = QFontMetrics( font ).width( "m" );
|
||||
auto fontWidth = QFontMetrics( font ).boundingRect( "m" ).width();
|
||||
textEdit->setTabStopWidth( fontWidth * 4 );
|
||||
|
||||
m_tabWidget->addTab( textEdit, tabTitle );
|
||||
|
@ -143,7 +143,7 @@ QWidget* PdmUiColorEditor::createEditorWidget(QWidget * parent)
|
||||
QFontMetrics fontMetrics = QApplication::fontMetrics();
|
||||
|
||||
buttonLayout->addWidget(m_colorPreviewLabel);
|
||||
m_colorSelectionButton->setMinimumWidth(fontMetrics.width(m_colorPreviewLabel->text()) + 15);
|
||||
m_colorSelectionButton->setMinimumWidth(fontMetrics.boundingRect(m_colorPreviewLabel->text()).width() + 15);
|
||||
|
||||
layout->addWidget(m_colorTextLabel);
|
||||
layout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Ignored));
|
||||
|
Loading…
Reference in New Issue
Block a user