Require Qt 5.9 or later

Increase the minimum required version of Qt from 5.6 to the next
LTS version, 5.9. The various Linux distributions that have not
released an update to 5.9 or later (SLES 12, Debian stretch) are
nearing end of support, and can be supported by the Wireshark 3.6 LTS
release.

Qt 5.9 requires macOS 10.0, so make that the minimum macOS version
as well.

Remove unneeded version checks (except from QCustomPlot).
This commit is contained in:
John Thacker 2022-04-20 18:59:32 -04:00
parent e16b1629dc
commit 13075b4ff0
5 changed files with 3 additions and 35 deletions

View File

@ -606,7 +606,7 @@ else() # ! MSVC
if(APPLE)
# MIN_MACOS_VERSION is used to set LSMinimumSystemVersion
# in Info.plist, so start with something low.
set(MIN_MACOS_VERSION 10.8)
set(MIN_MACOS_VERSION 10.10)
if(CMAKE_OSX_DEPLOYMENT_TARGET)
if(CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS MIN_MACOS_VERSION)
message(FATAL_ERROR "We don't support building for macOS < ${MIN_MACOS_VERSION}")
@ -1379,8 +1379,8 @@ if(GNUTLS_FOUND AND NOT GNUTLS_VERSION VERSION_LESS "3.4.0")
endif()
if (QT_FOUND)
if (Qt${qtver}Widgets_VERSION VERSION_LESS 5.6)
message(FATAL_ERROR "Qt 5.6 or later is required.")
if (Qt${qtver}Widgets_VERSION VERSION_LESS 5.9)
message(FATAL_ERROR "Qt 5.9 or later is required.")
endif()
if(NOT DEFINED MOC_OPTIONS)
# Squelch moc verbose "nothing to do" output
@ -1424,10 +1424,6 @@ if (QT_FOUND)
set(MIN_MACOS_VERSION 10.12)
elseif(Qt5Widgets_VERSION VERSION_GREATER "5.9.999")
set(MIN_MACOS_VERSION 10.11)
elseif(Qt5Widgets_VERSION VERSION_GREATER "5.8.999")
set(MIN_MACOS_VERSION 10.10)
elseif(Qt5Widgets_VERSION VERSION_GREATER "5.7.999")
set(MIN_MACOS_VERSION 10.9)
endif()
if(CMAKE_OSX_DEPLOYMENT_TARGET AND CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS MIN_MACOS_VERSION)
message(FATAL_ERROR "Qt version ${Qt${qtver}Widgets_VERSION} requires CMAKE_OSX_DEPLOYMENT_TARGET (${CMAKE_OSX_DEPLOYMENT_TARGET}) >= ${MIN_MACOS_VERSION}")

View File

@ -58,11 +58,7 @@ QWidget * ExtArgTimestamp::createEditor(QWidget * parent)
text = storeValue.trimmed();
}
#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)
ts = QDateTime::fromSecsSinceEpoch(text.toInt());
#else
ts = QDateTime::fromTime_t(text.toInt());
#endif
tsBox = new QDateTimeEdit(ts, parent);
tsBox->setDisplayFormat(QLocale::system().dateTimeFormat());
tsBox->setCalendarPopup(true);
@ -84,11 +80,7 @@ void ExtArgTimestamp::onDateTimeChanged(QDateTime t)
QString ExtArgTimestamp::defaultValue()
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)
return QString::number(QDateTime::currentDateTime().toSecsSinceEpoch());
#else
return QString::number(QDateTime::currentDateTime().toTime_t());
#endif
}
bool ExtArgTimestamp::isValid()
@ -103,11 +95,7 @@ bool ExtArgTimestamp::isValid()
QString ExtArgTimestamp::value()
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)
return QString::number(ts.toSecsSinceEpoch());
#else
return QString::number(ts.toTime_t());
#endif
}
QString ExtArgTimestamp::prefValue()
@ -124,11 +112,7 @@ void ExtArgTimestamp::setDefaultValue()
{
QDateTime t;
#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)
t = QDateTime::fromSecsSinceEpoch(defaultValue().toInt());
#else
t = QDateTime::fromTime_t(defaultValue().toInt());
#endif
tsBox->setDateTime(t);
}

View File

@ -176,11 +176,7 @@ void FollowStreamDialog::addCodecs(const QMap<QString, QTextCodec *> &codecMap)
// Make the combobox respect max visible items?
//ui->cbCharset->setStyleSheet("QComboBox { combobox-popup: 0;}");
ui->cbCharset->insertSeparator(ui->cbCharset->count());
#if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
for (const auto &codec : qAsConst(codecMap)) {
#else
foreach (const QTextCodec *codec, codecMap) {
#endif
// This is already in the menu and handled separately
if (codec->name() != "US-ASCII" && codec->name() != "UTF-8")
ui->cbCharset->addItem(tr(codec->name()), SHOW_CODEC);

View File

@ -112,11 +112,7 @@ void ShowPacketBytesDialog::addCodecs(const QMap<QString, QTextCodec *> &codecMa
// Make the combobox respect max visible items?
//ui->cbShowAs->setStyleSheet("QComboBox { combobox-popup: 0;}");
ui->cbShowAs->insertSeparator(ui->cbShowAs->count());
#if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
for (const auto &codec : qAsConst(codecMap)) {
#else
foreach (const QTextCodec *codec, codecMap) {
#endif
// This is already placed in the menu and handled separately
if (codec->name() != "US-ASCII" && codec->name() != "UTF-8")
ui->cbShowAs->addItem(tr(codec->name()), ShowAsCodec);

View File

@ -152,11 +152,7 @@ const QString file_size_to_qstring(const gint64 size)
const QString time_t_to_qstring(time_t ti_time)
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)
QDateTime date_time = QDateTime::fromSecsSinceEpoch(qint64(ti_time));
#else
QDateTime date_time = QDateTime::fromTime_t(uint(ti_time));
#endif
QString time_str = date_time.toLocalTime().toString("yyyy-MM-dd hh:mm:ss");
return time_str;
}