Compare commits

..

No commits in common. "c5d6f2eae94241d44a1c82ce117486b80586788a" and "cc2c3e648a620d70d638dca9a65e8137e04fb5fc" have entirely different histories.

20 changed files with 31 additions and 113 deletions

View File

@ -77,7 +77,7 @@ if(NOT help AND NOT HELP)
# 'project' triggers the searching for a compiler # 'project' triggers the searching for a compiler
project(${LYX_PROJECT}) project(${LYX_PROJECT})
if (CMAKE_COMPILER_IS_GNUCXX) if (CMAKE_COMPILER_IS_GNUCXX)
set(MIN_GCC_VERSION "7.1") set(MIN_GCC_VERSION "5.1")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${MIN_GCC_VERSION}) if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${MIN_GCC_VERSION})
message(STATUS "Gnu CXX compiler version = ${CMAKE_CXX_COMPILER_VERSION}") message(STATUS "Gnu CXX compiler version = ${CMAKE_CXX_COMPILER_VERSION}")
message(STATUS "is too old, should be >= ${MIN_GCC_VERSION}") message(STATUS "is too old, should be >= ${MIN_GCC_VERSION}")
@ -659,7 +659,7 @@ else()
set(LYX_DEBUG ON) set(LYX_DEBUG ON)
endif() endif()
set(min_qt5_version "5.9.4") set(min_qt5_version "5.12")
if(LYX_USE_QT MATCHES "AUTO") if(LYX_USE_QT MATCHES "AUTO")
# try qt6 first # try qt6 first
foreach(_mod Core Gui Widgets Concurrent Svg) foreach(_mod Core Gui Widgets Concurrent Svg)

View File

@ -59,7 +59,7 @@ LyX makes great use of the C++ Standard Library. This means that gcc
users will have to install the relevant libstdc++ library to be able users will have to install the relevant libstdc++ library to be able
to compile this version of LyX. to compile this version of LyX.
LyX requires Qt 5.9.4 or higher. It is also possible to compile LyX requires Qt 5.12 and higher. It is also possible to compile
against Qt 6. The only special point to make is that you must ensure against Qt 6. The only special point to make is that you must ensure
that both LyX and the Qt libraries are compiled with the same C++ that both LyX and the Qt libraries are compiled with the same C++
compiler. compiler.

2
README
View File

@ -90,7 +90,7 @@ What do I need to compile LyX from the source distribution?
but clang and MSVC are known to work too. As of LyX 2.5.0, you but clang and MSVC are known to work too. As of LyX 2.5.0, you
need at least gcc 8.0. need at least gcc 8.0.
* The Qt library, at least version 5.9.4. It is also possible to * The Qt library, at least version 5.12. It is also possible to
compile with Qt 6.x. compile with Qt 6.x.
Read the file "INSTALL" for more information on compiling. Read the file "INSTALL" for more information on compiling.

View File

@ -232,8 +232,7 @@ AC_REQUIRE([AC_PROG_CXXCPP])
### We might want to force the C++ standard. ### We might want to force the C++ standard.
AC_ARG_ENABLE(cxx-mode, AC_ARG_ENABLE(cxx-mode,
AS_HELP_STRING([--enable-cxx-mode],[choose C++ standard (default: 17)]),, AS_HELP_STRING([--enable-cxx-mode],[choose C++ standard (default: 17)]),,
dnl put modes in curly braces if there are several of them (ex. {20,17} [enable_cxx_mode={17}]
[enable_cxx_mode=17]
) )
AC_LANG_PUSH(C++) AC_LANG_PUSH(C++)

View File

@ -147,7 +147,7 @@ AC_CHECK_HEADERS(magic.h,
### setup the qt frontend. ### setup the qt frontend.
dnl The code below is not in a macro, because this would cause big dnl The code below is not in a macro, because this would cause big
dnl problems with the AC_REQUIRE contained in QT_DO_IT_ALL. dnl problems with the AC_REQUIRE contained in QT_DO_IT_ALL.
QT_DO_IT_ALL([5.9.4]) QT_DO_IT_ALL([5.12.0])
AC_SUBST([FRONTENDS_SUBDIRS], [qt]) AC_SUBST([FRONTENDS_SUBDIRS], [qt])
FRONTEND_INFO="${FRONTEND_INFO}\ FRONTEND_INFO="${FRONTEND_INFO}\
Qt Frontend:\n\ Qt Frontend:\n\

View File

@ -129,9 +129,3 @@ Report : https://github.com/schlcht/microtype/issues/21
upstream: https://github.com/latex3/latex2e/issues/880 upstream: https://github.com/latex3/latex2e/issues/880
Fix : none yet Fix : none yet
ctests : export/templates/Articles/Hebrew_Article_.*(dvi|pdf|pdf2|pdf3) ctests : export/templates/Articles/Hebrew_Article_.*(dvi|pdf|pdf2|pdf3)
Report : Message-ID:<vjwr5fehwvule6jvommt4apgtpvw2eu4ovynjocwa33vab2x7i@2lu5ialnxxzy>
Report : Message-ID:<iio6hf66ujaelhvnneqivhfp22xtty4fcgzswtrugu5gzwq2og@hcvqozvwou2l>
ctests : (export/export/WrongDfnTagHandling_lyx23|export/examples/Welcome_lyx23)

View File

@ -14,6 +14,6 @@ AddToPreamble
EndPreamble EndPreamble
Float Float
Type table Type figure
NumberWithin section NumberWithin section
End End

View File

@ -1044,10 +1044,9 @@ def revert_mathml_version(document):
# nothing to do # nothing to do
break break
# reset XHTML header if using the new value, leave alone otherwise. # remove XHTML header if using the new value, leave alone otherwise.
if "4" in document.header[i]: if "4" in document.header[i]:
document.header[i] = "\\html_math_output 0" document.header[i] = "\\html_math_output 0"
break
while True: while True:
i = find_token(document.header, "\\docbook_mathml_version", 0) i = find_token(document.header, "\\docbook_mathml_version", 0)

View File

@ -287,11 +287,7 @@ void CategorizedCombo::Private::setFilter(QString const & s)
lastSel_ = filterModel_->mapToSource(filterModel_->index(sel, 0)).row(); lastSel_ = filterModel_->mapToSource(filterModel_->index(sel, 0)).row();
filter_ = s; filter_ = s;
#if QT_VERSION < QT_VERSION_CHECK(5, 12, 0)
filterModel_->setFilterRegExp(charFilterRegExp(filter_));
#else
filterModel_->setFilterRegularExpression(charFilterRegExp(filter_)); filterModel_->setFilterRegularExpression(charFilterRegExp(filter_));
#endif
countCategories(); countCategories();
// restore old selection // restore old selection

View File

@ -106,9 +106,7 @@
#include <QObject> #include <QObject>
#include <QPainter> #include <QPainter>
#include <QPixmap> #include <QPixmap>
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
#include <QRandomGenerator> #include <QRandomGenerator>
#endif
#include <QScreen> #include <QScreen>
#include <QSessionManager> #include <QSessionManager>
#include <QSettings> #include <QSettings>
@ -1138,12 +1136,7 @@ GuiApplication::GuiApplication(int & argc, char ** argv)
#endif #endif
setDesktopFileName(lyx_package); setDesktopFileName(lyx_package);
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
QRandomGenerator(QDateTime::currentDateTime().toSecsSinceEpoch()); QRandomGenerator(QDateTime::currentDateTime().toSecsSinceEpoch());
#else
qsrand(QDateTime::currentDateTime().toTime_t());
#endif
// Install LyX translator for missing Qt translations // Install LyX translator for missing Qt translations
installTranslator(&d->gui_trans_); installTranslator(&d->gui_trans_);

View File

@ -494,13 +494,7 @@ PreambleModule::PreambleModule(QWidget * parent)
checkFindButton(); checkFindButton();
int const tabStop = 4; int const tabStop = 4;
QFontMetrics metrics(preambleTE->currentFont()); QFontMetrics metrics(preambleTE->currentFont());
#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
// horizontalAdvance() is available starting in 5.11.0
// setTabStopDistance() is available starting in 5.10.0
preambleTE->setTabStopDistance(tabStop * metrics.horizontalAdvance(' ')); preambleTE->setTabStopDistance(tabStop * metrics.horizontalAdvance(' '));
#else
preambleTE->setTabStopWidth(tabStop * metrics.width(' '));
#endif
} }
@ -646,13 +640,7 @@ LocalLayout::LocalLayout(QWidget * parent)
connect(editPB, SIGNAL(clicked()), this, SLOT(editExternal())); connect(editPB, SIGNAL(clicked()), this, SLOT(editExternal()));
int const tabStop = 4; int const tabStop = 4;
QFontMetrics metrics(locallayoutTE->currentFont()); QFontMetrics metrics(locallayoutTE->currentFont());
#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
// horizontalAdvance() is available starting in 5.11.0
// setTabStopDistance() is available starting in 5.10.0
locallayoutTE->setTabStopDistance(tabStop * metrics.horizontalAdvance(' ')); locallayoutTE->setTabStopDistance(tabStop * metrics.horizontalAdvance(' '));
#else
locallayoutTE->setTabStopWidth(tabStop * metrics.width(' '));
#endif
} }
@ -2524,11 +2512,7 @@ void GuiDocument::updateQuoteStyles(bool const set)
for (int i = 0; i < langModule->quoteStyleCO->count(); ++i) { for (int i = 0; i < langModule->quoteStyleCO->count(); ++i) {
langModule->quoteStyleCO->setItemData(i, QVariant(comboFont), Qt::FontRole); langModule->quoteStyleCO->setItemData(i, QVariant(comboFont), Qt::FontRole);
QString str = langModule->quoteStyleCO->itemText(i); QString str = langModule->quoteStyleCO->itemText(i);
#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
qswidth = max(qswidth, fm.horizontalAdvance(str)); qswidth = max(qswidth, fm.horizontalAdvance(str));
#else
qswidth = max(qswidth, fm.width(str));
#endif
} }
// add scrollbar width and margin to width // add scrollbar width and margin to width
qswidth += langModule->quoteStyleCO->style()->pixelMetric(QStyle::PM_ScrollBarExtent); qswidth += langModule->quoteStyleCO->style()->pixelMetric(QStyle::PM_ScrollBarExtent);

View File

@ -283,11 +283,7 @@ int GuiFontMetrics::width(docstring const & s) const
if (math_char) { if (math_char) {
QString const qs = toqstr(s); QString const qs = toqstr(s);
int br_width = rbearing(s[0]); int br_width = rbearing(s[0]);
#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
int s_width = metrics_.horizontalAdvance(qs); int s_width = metrics_.horizontalAdvance(qs);
#else
int s_width = metrics_.width(qs);
#endif
// keep value 0 for math chars with width 0 // keep value 0 for math chars with width 0
if (s_width != 0) if (s_width != 0)
w = max(br_width, s_width); w = max(br_width, s_width);
@ -667,17 +663,10 @@ int GuiFontMetrics::width(char_type c) const
if (value != outOfLimitMetric) if (value != outOfLimitMetric)
return value; return value;
#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
if (is_utf16(c)) if (is_utf16(c))
value = metrics_.horizontalAdvance(ucs4_to_qchar(c)); value = metrics_.horizontalAdvance(ucs4_to_qchar(c));
else else
value = metrics_.horizontalAdvance(toqstr(docstring(1, c))); value = metrics_.horizontalAdvance(toqstr(docstring(1, c)));
#else
if (is_utf16(c))
value = metrics_.width(ucs4_to_qchar(c));
else
value = metrics_.width(toqstr(docstring(1, c)));
#endif
width_cache_.insert(c, value); width_cache_.insert(c, value);

View File

@ -845,25 +845,15 @@ bool KeySymbol::operator==(KeySymbol const & ks) const
KeyModifier q_key_state(Qt::KeyboardModifiers state) KeyModifier q_key_state(Qt::KeyboardModifiers state)
{ {
KeyModifier k = NoModifier; KeyModifier k = NoModifier;
#if defined(Q_OS_MAC) && (QT_VERSION < QT_VERSION_CHECK(5, 12, 0))
/// Additional check for Control and Meta modifier swap state.
/// Starting with Qt 5 the modifiers aren't reported correctly.
/// Until this is fixed a correction is required.
/// AFAIK it is fixed at least with Qt 5.12.0
const bool dontSwapCtrlAndMeta =
frontend::theGuiApp()->testAttribute(Qt::AA_MacDontSwapCtrlAndMeta);
#else
const bool dontSwapCtrlAndMeta = false;
#endif
if (state & (dontSwapCtrlAndMeta ? Qt::MetaModifier : Qt::ControlModifier)) if (state & Qt::ControlModifier)
k |= ControlModifier; k |= ControlModifier;
if (state & Qt::ShiftModifier) if (state & Qt::ShiftModifier)
k |= ShiftModifier; k |= ShiftModifier;
if (state & Qt::AltModifier) if (state & Qt::AltModifier)
k |= AltModifier; k |= AltModifier;
#if defined(USE_MACOSX_PACKAGING) || defined(USE_META_KEYBINDING) #if defined(USE_MACOSX_PACKAGING) || defined(USE_META_KEYBINDING)
if (state & (dontSwapCtrlAndMeta ? Qt::ControlModifier : Qt::MetaModifier)) if (state & Qt::MetaModifier)
k |= MetaModifier; k |= MetaModifier;
#else #else
if (state & Qt::MetaModifier) if (state & Qt::MetaModifier)

View File

@ -665,11 +665,7 @@ GuiView::GuiView(int id)
connect(stat_counts_, SIGNAL(clicked()), this, SLOT(statsPressed())); connect(stat_counts_, SIGNAL(clicked()), this, SLOT(statsPressed()));
zoom_slider_ = new QSlider(Qt::Horizontal, statusBar()); zoom_slider_ = new QSlider(Qt::Horizontal, statusBar());
#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
zoom_slider_->setFixedWidth(fm.horizontalAdvance('x') * 15); zoom_slider_->setFixedWidth(fm.horizontalAdvance('x') * 15);
#else
zoom_slider_->setFixedWidth(fm.width('x') * 15);
#endif
// Make the defaultZoom center // Make the defaultZoom center
zoom_slider_->setRange(10, (lyxrc.defaultZoom * 2) - 10); zoom_slider_->setRange(10, (lyxrc.defaultZoom * 2) - 10);
// Initialize proper zoom value // Initialize proper zoom value
@ -682,11 +678,7 @@ GuiView::GuiView(int id)
zoom_slider_->setToolTip(qt_("Workarea zoom level. Drag, use Ctrl-+/- or Shift-Mousewheel to adjust.")); zoom_slider_->setToolTip(qt_("Workarea zoom level. Drag, use Ctrl-+/- or Shift-Mousewheel to adjust."));
// Buttons to change zoom stepwise // Buttons to change zoom stepwise
#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
QSize s(fm.horizontalAdvance('+'), fm.height()); QSize s(fm.horizontalAdvance('+'), fm.height());
#else
QSize s(fm.width('+'), fm.height());
#endif
zoom_in_ = new GuiClickableLabel(statusBar()); zoom_in_ = new GuiClickableLabel(statusBar());
zoom_in_->setText("+"); zoom_in_->setText("+");
zoom_in_->setFixedSize(s); zoom_in_->setFixedSize(s);
@ -726,11 +718,7 @@ GuiView::GuiView(int id)
// zoom_value_->setPalette(palette); // zoom_value_->setPalette(palette);
zoom_value_->setForegroundRole(statusBar()->foregroundRole()); zoom_value_->setForegroundRole(statusBar()->foregroundRole());
zoom_value_->setFixedHeight(fm.height()); zoom_value_->setFixedHeight(fm.height());
#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
zoom_value_->setMinimumWidth(fm.horizontalAdvance("444\%")); zoom_value_->setMinimumWidth(fm.horizontalAdvance("444\%"));
#else
zoom_value_->setMinimumWidth(fm.width("444\%"));
#endif
zoom_value_->setAlignment(Qt::AlignCenter); zoom_value_->setAlignment(Qt::AlignCenter);
zoom_value_->setText(toqstr(bformat(_("[[ZOOM]]%1$d%"), zoom))); zoom_value_->setText(toqstr(bformat(_("[[ZOOM]]%1$d%"), zoom)));
statusBar()->addPermanentWidget(zoom_value_); statusBar()->addPermanentWidget(zoom_value_);

View File

@ -774,8 +774,7 @@ void GuiWorkArea::mouseReleaseEvent(QMouseEvent * e)
FuncRequest const cmd(LFUN_MOUSE_RELEASE, e->x(), e->y(), FuncRequest const cmd(LFUN_MOUSE_RELEASE, e->x(), e->y(),
#endif #endif
q_button_state(e->button()), q_key_state(e->modifiers())); q_button_state(e->button()), q_key_state(e->modifiers()));
#if (QT_VERSION > QT_VERSION_CHECK(5,10,1) && \ #if QT_VERSION < QT_VERSION_CHECK(5,15,1)
QT_VERSION < QT_VERSION_CHECK(5,15,1))
d->synthetic_mouse_event_.cmd = cmd; // QtBug QAbstractScrollArea::mouseMoveEvent d->synthetic_mouse_event_.cmd = cmd; // QtBug QAbstractScrollArea::mouseMoveEvent
#endif #endif
d->dispatch(cmd); d->dispatch(cmd);
@ -785,8 +784,7 @@ void GuiWorkArea::mouseReleaseEvent(QMouseEvent * e)
void GuiWorkArea::mouseMoveEvent(QMouseEvent * e) void GuiWorkArea::mouseMoveEvent(QMouseEvent * e)
{ {
#if (QT_VERSION > QT_VERSION_CHECK(5,10,1) && \ #if QT_VERSION < QT_VERSION_CHECK(5,15,1)
QT_VERSION < QT_VERSION_CHECK(5,15,1))
// cancel the event if the coordinates didn't change, this is due to QtBug // cancel the event if the coordinates didn't change, this is due to QtBug
// QAbstractScrollArea::mouseMoveEvent, the event is triggered falsely when quickly // QAbstractScrollArea::mouseMoveEvent, the event is triggered falsely when quickly
// double tapping a touchpad. To test: try to select a word by quickly double tapping // double tapping a touchpad. To test: try to select a word by quickly double tapping

View File

@ -16,10 +16,12 @@
#include <QObject> #include <QObject>
#include <QWaitCondition> #include <QWaitCondition>
#include <functional>
namespace lyx { namespace lyx {
using std::function;
using std::ref;
using std::bind;
namespace frontend { namespace frontend {
@ -66,25 +68,25 @@ public:
template<class F, class P1> template<class F, class P1>
R call(F f, P1& p1) R call(F f, P1& p1)
{ {
return call(std::bind(f, std::ref(p1))); return call(lyx::bind(f, lyx::ref(p1)));
} }
template<class F, class P1, class P2> template<class F, class P1, class P2>
R call(F f, P1& p1, P2& p2) R call(F f, P1& p1, P2& p2)
{ {
return call(std::bind(f, std::ref(p1), std::ref(p2))); return call(lyx::bind(f, lyx::ref(p1), lyx::ref(p2)));
} }
template<class F, class P1, class P2, class P3> template<class F, class P1, class P2, class P3>
R call(F f, P1& p1, P2& p2, P3& p3) R call(F f, P1& p1, P2& p2, P3& p3)
{ {
return call(std::bind(f, std::ref(p1), std::ref(p2), std::ref(p3))); return call(lyx::bind(f, lyx::ref(p1), lyx::ref(p2), lyx::ref(p3)));
} }
template<class F, class P1, class P2, class P3, class P4> template<class F, class P1, class P2, class P3, class P4>
R call(F f, P1& p1, P2& p2, P3& p3, P4& p4) R call(F f, P1& p1, P2& p2, P3& p3, P4& p4)
{ {
return call(std::bind(f, std::ref(p1), std::ref(p2), std::ref(p3), std::ref(p4))); return call(lyx::bind(f, lyx::ref(p1), lyx::ref(p2), lyx::ref(p3), lyx::ref(p4)));
} }
/* /*
@ -94,8 +96,8 @@ public:
template<class F, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8> template<class F, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8>
R call(F f, P1& p1, P2& p2, P3& p3, P4& p4, P5& p5, P6& p6, P7& p7, P8& p8) R call(F f, P1& p1, P2& p2, P3& p3, P4& p4, P5& p5, P6& p6, P7& p7, P8& p8)
{ {
return call(std::bind(f, std::ref(p1), std::ref(p2), std::ref(p3), std::ref(p4), return call(lyx::bind(f, lyx::ref(p1), lyx::ref(p2), lyx::ref(p3), lyx::ref(p4),
std::ref(p5), std::ref(p6), std::ref(p7), std::ref(p8))); lyx::ref(p5), lyx::ref(p6), lyx::ref(p7), lyx::ref(p8)));
} }
private: private:
@ -107,7 +109,7 @@ private:
private: private:
R return_value_; R return_value_;
std::function<R()> func_; function<R()> func_;
}; };
@ -129,25 +131,25 @@ public:
template<class F, class P1> template<class F, class P1>
void call(F f, P1& p1) void call(F f, P1& p1)
{ {
call(std::bind(f, std::ref(p1))); call(lyx::bind(f, lyx::ref(p1)));
} }
template<class F, class P1, class P2> template<class F, class P1, class P2>
void call(F f, P1& p1, P2& p2) void call(F f, P1& p1, P2& p2)
{ {
call(std::bind(f, std::ref(p1), std::ref(p2))); call(lyx::bind(f, lyx::ref(p1), lyx::ref(p2)));
} }
template<class F, class P1, class P2, class P3> template<class F, class P1, class P2, class P3>
void call(F f, P1& p1, P2& p2, P3& p3) void call(F f, P1& p1, P2& p2, P3& p3)
{ {
call(std::bind(f, std::ref(p1), std::ref(p2), std::ref(p3))); call(lyx::bind(f, lyx::ref(p1), lyx::ref(p2), lyx::ref(p3)));
} }
template<class F, class P1, class P2, class P3, class P4> template<class F, class P1, class P2, class P3, class P4>
void call(F f, P1& p1, P2& p2, P3& p3, P4& p4) void call(F f, P1& p1, P2& p2, P3& p3, P4& p4)
{ {
call(std::bind(f, std::ref(p1), std::ref(p2), std::ref(p3), std::ref(p4))); call(lyx::bind(f, lyx::ref(p1), lyx::ref(p2), lyx::ref(p3), lyx::ref(p4)));
} }
/* /*
@ -157,8 +159,8 @@ public:
template<class F, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8> template<class F, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8>
void call(F f, P1& p1, P2& p2, P3& p3, P4& p4, P5& p5, P6& p6, P7& p7, P8& p8) void call(F f, P1& p1, P2& p2, P3& p3, P4& p4, P5& p5, P6& p6, P7& p7, P8& p8)
{ {
call(bind(f, std::ref(p1), std::ref(p2), std::ref(p3), std::ref(p4), std::ref(p5), call(bind(f, lyx::ref(p1), lyx::ref(p2), lyx::ref(p3), lyx::ref(p4), lyx::ref(p5),
std::ref(p6), std::ref(p7), std::ref(p8))); lyx::ref(p6), lyx::ref(p7), lyx::ref(p8)));
} }
private: private:
@ -169,7 +171,7 @@ private:
} }
private: private:
std::function<void()> func_; function<void()> func_;
}; };

View File

@ -320,11 +320,7 @@ void LayoutBox::Private::setFilter(QString const & s)
lastSel_ = filterModel_->mapToSource(filterModel_->index(sel, 0)).row(); lastSel_ = filterModel_->mapToSource(filterModel_->index(sel, 0)).row();
filter_ = s; filter_ = s;
#if QT_VERSION < QT_VERSION_CHECK(5, 12, 0)
filterModel_->setFilterRegExp(charFilterRegExp(filter_));
#else
filterModel_->setFilterRegularExpression(charFilterRegExp(filter_)); filterModel_->setFilterRegularExpression(charFilterRegExp(filter_));
#endif
countCategories(); countCategories();
// restore old selection // restore old selection

View File

@ -769,11 +769,7 @@ QString formatToolTip(QString text, int width)
text = Qt::convertFromPlainText(text, Qt::WhiteSpaceNormal); text = Qt::convertFromPlainText(text, Qt::WhiteSpaceNormal);
// Compute desired width in pixels // Compute desired width in pixels
QFont const font = QToolTip::font(); QFont const font = QToolTip::font();
#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
int const px_width = width * QFontMetrics(font).horizontalAdvance("M"); int const px_width = width * QFontMetrics(font).horizontalAdvance("M");
#else
int const px_width = width * QFontMetrics(font).width("M");
#endif
// Determine the ideal width of the tooltip // Determine the ideal width of the tooltip
QTextDocument td(""); QTextDocument td("");
td.setHtml(text); td.setHtml(text);

View File

@ -16,9 +16,7 @@
#include <QCoreApplication> #include <QCoreApplication>
#include <QDateTime> #include <QDateTime>
#include <QTimer> #include <QTimer>
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
#include <QRandomGenerator> #include <QRandomGenerator>
#endif
#include <string> #include <string>
@ -41,11 +39,7 @@ public:
setOrganizationDomain("lyx.org"); setOrganizationDomain("lyx.org");
setApplicationName(toqstr(app)); setApplicationName(toqstr(app));
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
QRandomGenerator(QDateTime::currentDateTime().toSecsSinceEpoch()); QRandomGenerator(QDateTime::currentDateTime().toSecsSinceEpoch());
#else
qsrand(QDateTime::currentDateTime().toTime_t());
#endif
} }
int execute() int execute()
{ {

View File

@ -13,7 +13,7 @@
#ifndef LYX_MUTE_WARNING_H #ifndef LYX_MUTE_WARNING_H
#define LYX_MUTE_WARNING_H #define LYX_MUTE_WARNING_H
#if defined(__GNUC__) && __GNUC__ > 7 && !defined(__clang__) #if defined(__GNUC__) && !defined(__clang__)
/* This macro can be used to stipulate that a given GCC warning is not /* This macro can be used to stipulate that a given GCC warning is not
* relevant in a given block. * relevant in a given block.
* *