GUI: Fix a few Wdeprecated warnings

This commit is contained in:
Daniel Marjamäki 2019-07-22 22:40:11 +02:00
parent 70e0c66c35
commit 896d953aa3
3 changed files with 4 additions and 4 deletions

View File

@ -265,7 +265,7 @@ int CodeEditor::lineNumberAreaWidth()
++digits; ++digits;
} }
int space = 3 + fontMetrics().width(QLatin1Char('9')) * digits; int space = 3 + fontMetrics().horizontalAdvance(QLatin1Char('9')) * digits;
return space; return space;
} }

View File

@ -118,7 +118,7 @@ StyleEditDialog::StyleEditDialog(const CodeEditorStyle& newStyle,
mSampleEditor = new CodeEditor(this); mSampleEditor = new CodeEditor(this);
QFont sampleFont("Monospace"); QFont sampleFont("Monospace");
QFontMetrics fm(sampleFont); QFontMetrics fm(sampleFont);
mSampleEditor->setMinimumWidth(fm.width(QString(40, 'W'))); mSampleEditor->setMinimumWidth(fm.horizontalAdvance(QString(40, 'W')));
// designate highlight, errors, and symbols // designate highlight, errors, and symbols
mSampleEditor->setError(mSampleDocument, mErrLineNum, mErrSymbolsList); mSampleEditor->setError(mSampleDocument, mErrLineNum, mErrSymbolsList);
// End Controls // End Controls

View File

@ -139,7 +139,7 @@ ProjectFileDialog::ProjectFileDialog(ProjectFile *projectFile, QWidget *parent)
libs << library; libs << library;
} }
} }
qSort(libs); libs.sort();
mUI.mLibraries->clear(); mUI.mLibraries->clear();
for (const QString &lib : libs) { for (const QString &lib : libs) {
QListWidgetItem* item = new QListWidgetItem(lib, mUI.mLibraries); QListWidgetItem* item = new QListWidgetItem(lib, mUI.mLibraries);
@ -170,7 +170,7 @@ ProjectFileDialog::ProjectFileDialog(ProjectFile *projectFile, QWidget *parent)
platformFiles << platformFile; platformFiles << platformFile;
} }
} }
qSort(platformFiles); platformFiles.sort();
mUI.mComboBoxPlatform->addItems(platformFiles); mUI.mComboBoxPlatform->addItems(platformFiles);
mUI.mEditTags->setValidator(new QRegExpValidator(QRegExp("[a-zA-Z0-9 ;]*"),this)); mUI.mEditTags->setValidator(new QRegExpValidator(QRegExp("[a-zA-Z0-9 ;]*"),this));