mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-12 23:35:33 +08:00
Suppress Qt 5.15 deprecation warnings
This commit is contained in:
@@ -265,7 +265,7 @@ namespace BlackCore
|
||||
{
|
||||
// ; !CLIENTS section
|
||||
const int i = currentLine.lastIndexOf(' ');
|
||||
const QVector<QStringRef> attributes = currentLine.midRef(i).trimmed().split(':', QString::SkipEmptyParts);
|
||||
const QVector<QStringRef> attributes = currentLine.midRef(i).trimmed().split(':', Qt::SkipEmptyParts);
|
||||
for (const QStringRef &attr : attributes) { clientSectionAttributes.push_back(attr.toString().trimmed().toLower()); }
|
||||
section = SectionNone; // reset
|
||||
|
||||
|
||||
@@ -388,7 +388,7 @@ namespace BlackGui
|
||||
void CHotkeyDialog::selectAction()
|
||||
{
|
||||
if (m_actionHotkey.getAction().isEmpty()) { return; }
|
||||
const QStringList tokens = m_actionHotkey.getAction().split("/", QString::SkipEmptyParts);
|
||||
const QStringList tokens = m_actionHotkey.getAction().split("/", Qt::SkipEmptyParts);
|
||||
QModelIndex parentIndex = QModelIndex();
|
||||
|
||||
for (const QString &token : tokens)
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
</size>
|
||||
</property>
|
||||
<property name="features">
|
||||
<set>QDockWidget::AllDockWidgetFeatures</set>
|
||||
<set>QDockWidget::DockWidgetClosable|QDockWidget::DockWidgetMovable|QDockWidget::DockWidgetFloatable</set>
|
||||
</property>
|
||||
<property name="allowedAreas">
|
||||
<set>Qt::NoDockWidgetArea</set>
|
||||
@@ -96,7 +96,7 @@
|
||||
</size>
|
||||
</property>
|
||||
<property name="features">
|
||||
<set>QDockWidget::AllDockWidgetFeatures</set>
|
||||
<set>QDockWidget::DockWidgetClosable|QDockWidget::DockWidgetMovable|QDockWidget::DockWidgetFloatable</set>
|
||||
</property>
|
||||
<property name="allowedAreas">
|
||||
<set>Qt::NoDockWidgetArea</set>
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
<item row="0" column="1" colspan="7">
|
||||
<widget class="QFontComboBox" name="cb_SettingsGuiFont">
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QComboBox::AdjustToMinimumContentsLength</enum>
|
||||
<enum>QComboBox::AdjustToContents</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -109,7 +109,7 @@ namespace BlackGui
|
||||
for (const QString &actionPath : as_const(keys))
|
||||
{
|
||||
QString currentPath;
|
||||
const QStringList tokens = actionPath.split("/", QString::SkipEmptyParts);
|
||||
const QStringList tokens = actionPath.split("/", Qt::SkipEmptyParts);
|
||||
CActionItem *parentItem = m_rootItem.data();
|
||||
for (const auto &token : tokens)
|
||||
{
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace BlackMisc
|
||||
|
||||
CLogCategoryList CLogCategoryList::fromQString(const QString &string)
|
||||
{
|
||||
return fromQStringList(string.split("|", QString::SkipEmptyParts));
|
||||
return fromQStringList(string.split("|", Qt::SkipEmptyParts));
|
||||
}
|
||||
|
||||
bool CLogCategoryList::anyStartWith(const QString &prefix) const
|
||||
|
||||
@@ -435,7 +435,7 @@ namespace BlackMisc
|
||||
QFileInfo fileInfo(fullPath);
|
||||
|
||||
QStringList dirNames;
|
||||
dirNames.append(relativePath.split('/', QString::SkipEmptyParts));
|
||||
dirNames.append(relativePath.split('/', Qt::SkipEmptyParts));
|
||||
// Replace the first one being the package name with the package root dir
|
||||
QString packageRootDir = package.path.mid(package.path.lastIndexOf('/') + 1);
|
||||
dirNames.replace(0, packageRootDir);
|
||||
@@ -540,7 +540,7 @@ namespace BlackMisc
|
||||
}
|
||||
|
||||
QStringList dirNames;
|
||||
dirNames.append(relativePath.split('/', QString::SkipEmptyParts));
|
||||
dirNames.append(relativePath.split('/', Qt::SkipEmptyParts));
|
||||
// Replace the first one being the package name with the package root dir
|
||||
QString packageRootDir = package.path.mid(package.path.lastIndexOf('/') + 1);
|
||||
dirNames.replace(0, packageRootDir);
|
||||
|
||||
@@ -295,6 +295,15 @@ namespace BlackMisc
|
||||
return dt;
|
||||
}
|
||||
|
||||
QDateTime fromStringUtc(const QString& dateTimeString, const QLocale& locale, QLocale::FormatType format)
|
||||
{
|
||||
if (dateTimeString.isEmpty()) { return QDateTime(); }
|
||||
QDateTime dt = locale.toDateTime(dateTimeString, format);
|
||||
if (!dt.isValid()) { return dt; }
|
||||
dt.setOffsetFromUtc(0); // must only be applied to valid timestamps
|
||||
return dt;
|
||||
}
|
||||
|
||||
QDateTime parseMultipleDateTimeFormats(const QString &dateTimeString)
|
||||
{
|
||||
if (dateTimeString.isEmpty()) { return QDateTime(); }
|
||||
@@ -325,10 +334,10 @@ namespace BlackMisc
|
||||
ts = fromStringUtc(dateTimeString, Qt::TextDate);
|
||||
if (ts.isValid()) return ts;
|
||||
|
||||
ts = fromStringUtc(dateTimeString, Qt::DefaultLocaleLongDate);
|
||||
ts = fromStringUtc(dateTimeString, QLocale(), QLocale::LongFormat);
|
||||
if (ts.isValid()) return ts;
|
||||
|
||||
ts = fromStringUtc(dateTimeString, Qt::DefaultLocaleShortDate);
|
||||
ts = fromStringUtc(dateTimeString, QLocale(), QLocale::ShortFormat);
|
||||
if (ts.isValid()) return ts;
|
||||
|
||||
// SystemLocaleShortDate,
|
||||
|
||||
@@ -286,6 +286,10 @@ namespace BlackMisc
|
||||
//! \remark potentially slow, so only to be used when format is unknown
|
||||
BLACKMISC_EXPORT QDateTime fromStringUtc(const QString &dateTimeString, Qt::DateFormat format = Qt::TextDate);
|
||||
|
||||
//! Same as QDateTime::fromString but QDateTime will be set to UTC
|
||||
//! \remark potentially slow, so only to be used when format is unknown
|
||||
BLACKMISC_EXPORT QDateTime fromStringUtc(const QString &dateTimeString, const QLocale &locale, QLocale::FormatType format);
|
||||
|
||||
//! Parse multiple date time formats
|
||||
//! \remark potentially slow, so only to be used when format is unknown
|
||||
//! \remark TZ is UTC
|
||||
|
||||
@@ -394,7 +394,7 @@ namespace BlackMisc
|
||||
if (!equal)
|
||||
{
|
||||
errors++;
|
||||
if (verbose) { ts << "I: " << in.toQString() << endl << "O: " << out.toQString() << Qt::endl; }
|
||||
if (verbose) { ts << "I: " << in.toQString() << Qt::endl << "O: " << out.toQString() << Qt::endl; }
|
||||
}
|
||||
return equal;
|
||||
}
|
||||
|
||||
@@ -304,7 +304,7 @@
|
||||
</widget>
|
||||
<widget class="BlackGui::CDockWidgetInfoBar" name="dw_InfoBarStatus">
|
||||
<property name="features">
|
||||
<set>QDockWidget::AllDockWidgetFeatures</set>
|
||||
<set>QDockWidget::DockWidgetClosable|QDockWidget::DockWidgetMovable|QDockWidget::DockWidgetFloatable</set>
|
||||
</property>
|
||||
<property name="allowedAreas">
|
||||
<set>Qt::TopDockWidgetArea</set>
|
||||
|
||||
Reference in New Issue
Block a user