mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 01:05:34 +08:00
Fixed most Qt 5.14 deprecation warnings
This commit is contained in:
@@ -156,8 +156,8 @@ namespace BlackGui
|
||||
const QFileSystemModel *sourceModel = qobject_cast<QFileSystemModel *>(ui->tv_Source->model());
|
||||
if (!sourceModel) { return; }
|
||||
|
||||
QStringList select = comp.missingInTarget.toList();
|
||||
select.append(comp.newerInSource.toList());
|
||||
QStringList select = comp.missingInTarget.values();
|
||||
select.append(comp.newerInSource.values());
|
||||
for (const QString &file : as_const(comp.missingInTarget))
|
||||
{
|
||||
const QModelIndex index = sourceModel->index(file);
|
||||
|
||||
@@ -1068,7 +1068,7 @@ namespace BlackGui
|
||||
void CFlightPlanComponent::initCompleters()
|
||||
{
|
||||
if (!sGui || !sGui->hasWebDataServices()) { return; }
|
||||
const QStringList aircraft(sGui->getWebDataServices()->getAircraftIcaoCodes().allDesignators().toList());
|
||||
const QStringList aircraft(sGui->getWebDataServices()->getAircraftIcaoCodes().allDesignators().values());
|
||||
QCompleter *aircraftCompleter = new QCompleter(aircraft, this);
|
||||
aircraftCompleter->setMaxVisibleItems(10);
|
||||
aircraftCompleter->popup()->setMinimumWidth(75);
|
||||
|
||||
@@ -128,11 +128,11 @@ namespace BlackGui
|
||||
if (sGui->getWebDataServices()->getAircraftIcaoCodesCount() < 1) { return; }
|
||||
m_hasCompleters = true;
|
||||
const CAircraftIcaoCodeList codes = sGui->getWebDataServices()->getAircraftIcaoCodes();
|
||||
const QStringList designators = codes.allDesignators().toList();
|
||||
const QStringList designators = codes.allDesignators().values();
|
||||
ui->le_Designator->setCompleter(new QCompleter(designators, ui->le_Designator));
|
||||
const QStringList families = codes.allFamilies().toList();
|
||||
const QStringList families = codes.allFamilies().values();
|
||||
ui->le_Family->setCompleter(new QCompleter(families, ui->le_Family));
|
||||
const QStringList manufacturers = codes.allManufacturers().toList();
|
||||
const QStringList manufacturers = codes.allManufacturers().values();
|
||||
ui->le_Manufacturer->setCompleter(new QCompleter(manufacturers, ui->le_Manufacturer));
|
||||
}
|
||||
} // ns
|
||||
|
||||
@@ -829,7 +829,7 @@ namespace BlackGui
|
||||
label->setToolTip(longText);
|
||||
const QFontMetrics metrics(label->font());
|
||||
const int width = qMax(label->width() - 2, 0);
|
||||
const int wl = metrics.width(longText);
|
||||
const int wl = metrics.horizontalAdvance(longText);
|
||||
if (wl >= width) { label->setText(longText); return; }
|
||||
if (qRound(wl * 0.85) > wl)
|
||||
{
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
#include <QColor>
|
||||
#include <QObject>
|
||||
#include <QTime>
|
||||
#include <QElapsedTimer>
|
||||
#include <QFrame>
|
||||
|
||||
class QPaintEvent;
|
||||
@@ -76,7 +76,7 @@ namespace BlackGui
|
||||
double m_peakLevel = 0.0;
|
||||
|
||||
//! Time at which m_peakLevel was last changed.
|
||||
QTime m_peakLevelChanged;
|
||||
QElapsedTimer m_peakLevelChanged;
|
||||
|
||||
static constexpr double High = 0.60;
|
||||
static constexpr double DecayValue = 0.10;
|
||||
|
||||
Reference in New Issue
Block a user