Commit b3a15819 authored by L. E. Segovia's avatar L. E. Segovia

Fix remaining warnings in GCC 9

parent b32674aa
......@@ -279,7 +279,7 @@ ExprCurve::ExprCurve(QWidget *parent, QString pLabel, QString vLabel, QString iL
_selPosEdit = new QLineEdit;
QDoubleValidator *posValidator = new QDoubleValidator(0.0, 1.0, 6, _selPosEdit);
_selPosEdit->setValidator(posValidator);
int editwidth = QFontMetrics(font()).width("9.999") + 8;
int editwidth = QFontMetrics(font()).boundingRect("9.999").width() + 8;
_selPosEdit->setFixedWidth(editwidth);
_selPosEdit->setFixedHeight(20);
selPosLayout->addStretch(50);
......
......@@ -177,7 +177,7 @@ ExprDeepWater::ExprDeepWater(QWidget *parent)
editsLayout->setMargin(0);
edits->setLayout(editsLayout);
int editWidth = QFontMetrics(font()).width("[0,0,0]") + 8;
int editWidth = QFontMetrics(font()).boundingRect("[0,0,0]").width() + 8;
QWidget *resolution = new QWidget;
QHBoxLayout *resolutionLayout = new QHBoxLayout;
......
......@@ -113,10 +113,11 @@ ExprEditor::ExprEditor(QWidget* parent, ExprControlCollection* controls)
// calibrate the font size
int fontsize = 12;
while (QFontMetrics(QFont("Liberation Sans", fontsize)).width("abcdef") < 38 && fontsize < 20) fontsize++;
while (QFontMetrics(QFont("Liberation Sans", fontsize)).width("abcdef") > 44 && fontsize > 3) fontsize--;
QFont font("Liberation Sans", fontsize);
while (QFontMetrics(font).boundingRect("abcdef").width() < 38 && fontsize < 20) fontsize++;
while (QFontMetrics(font).boundingRect("abcdef").width() > 44 && fontsize > 3) fontsize--;
exprTe->setFont(QFont("Liberation Sans", fontsize));
exprTe->setFont(font);
exprAndErrors->addWidget(exprTe);
......
......@@ -80,7 +80,7 @@ ExprFileDialog::ExprFileDialog(QWidget* parent) : QFileDialog(parent) {
_okButton = 0;
// disconnect broken return press handling (mishandles new directory names)
QList<QLineEdit*> lineedits = findChildren<QLineEdit*>(QRegExp());
QList<QLineEdit*> lineedits = findChildren<QLineEdit*>();
if (lineedits.size()) _nameEdit = (QLineEdit*)lineedits.at(0);
if (_nameEdit) {
_nameEdit->disconnect(SIGNAL(returnPressed()));
......@@ -88,7 +88,7 @@ ExprFileDialog::ExprFileDialog(QWidget* parent) : QFileDialog(parent) {
}
// connect custom ok clicked handler
QList<QPushButton*> myWidgets = findChildren<QPushButton*>(QRegExp());
QList<QPushButton*> myWidgets = findChildren<QPushButton*>();
for (int w = 0; w < myWidgets.size(); w++) {
QPushButton* item = (QPushButton*)myWidgets.at(w);
if (item->text().contains("Open")) _okButton = item;
......
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