mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-21 17:51:03 +00:00
Compare commits
No commits in common. "c5d6f2eae94241d44a1c82ce117486b80586788a" and "cc2c3e648a620d70d638dca9a65e8137e04fb5fc" have entirely different histories.
c5d6f2eae9
...
cc2c3e648a
@ -77,7 +77,7 @@ if(NOT help AND NOT HELP)
|
||||
# 'project' triggers the searching for a compiler
|
||||
project(${LYX_PROJECT})
|
||||
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})
|
||||
message(STATUS "Gnu CXX compiler version = ${CMAKE_CXX_COMPILER_VERSION}")
|
||||
message(STATUS "is too old, should be >= ${MIN_GCC_VERSION}")
|
||||
@ -659,7 +659,7 @@ else()
|
||||
set(LYX_DEBUG ON)
|
||||
endif()
|
||||
|
||||
set(min_qt5_version "5.9.4")
|
||||
set(min_qt5_version "5.12")
|
||||
if(LYX_USE_QT MATCHES "AUTO")
|
||||
# try qt6 first
|
||||
foreach(_mod Core Gui Widgets Concurrent Svg)
|
||||
|
2
INSTALL
2
INSTALL
@ -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
|
||||
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
|
||||
that both LyX and the Qt libraries are compiled with the same C++
|
||||
compiler.
|
||||
|
2
README
2
README
@ -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
|
||||
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.
|
||||
|
||||
Read the file "INSTALL" for more information on compiling.
|
||||
|
@ -232,8 +232,7 @@ AC_REQUIRE([AC_PROG_CXXCPP])
|
||||
### We might want to force the C++ standard.
|
||||
AC_ARG_ENABLE(cxx-mode,
|
||||
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++)
|
||||
|
@ -147,7 +147,7 @@ AC_CHECK_HEADERS(magic.h,
|
||||
### setup the qt frontend.
|
||||
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.
|
||||
QT_DO_IT_ALL([5.9.4])
|
||||
QT_DO_IT_ALL([5.12.0])
|
||||
AC_SUBST([FRONTENDS_SUBDIRS], [qt])
|
||||
FRONTEND_INFO="${FRONTEND_INFO}\
|
||||
Qt Frontend:\n\
|
||||
|
@ -129,9 +129,3 @@ Report : https://github.com/schlcht/microtype/issues/21
|
||||
upstream: https://github.com/latex3/latex2e/issues/880
|
||||
Fix : none yet
|
||||
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)
|
||||
|
@ -14,6 +14,6 @@ AddToPreamble
|
||||
EndPreamble
|
||||
|
||||
Float
|
||||
Type table
|
||||
Type figure
|
||||
NumberWithin section
|
||||
End
|
||||
|
@ -1044,10 +1044,9 @@ def revert_mathml_version(document):
|
||||
# nothing to do
|
||||
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]:
|
||||
document.header[i] = "\\html_math_output 0"
|
||||
break
|
||||
|
||||
while True:
|
||||
i = find_token(document.header, "\\docbook_mathml_version", 0)
|
||||
|
@ -287,11 +287,7 @@ void CategorizedCombo::Private::setFilter(QString const & s)
|
||||
lastSel_ = filterModel_->mapToSource(filterModel_->index(sel, 0)).row();
|
||||
|
||||
filter_ = s;
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 12, 0)
|
||||
filterModel_->setFilterRegExp(charFilterRegExp(filter_));
|
||||
#else
|
||||
filterModel_->setFilterRegularExpression(charFilterRegExp(filter_));
|
||||
#endif
|
||||
countCategories();
|
||||
|
||||
// restore old selection
|
||||
|
@ -106,9 +106,7 @@
|
||||
#include <QObject>
|
||||
#include <QPainter>
|
||||
#include <QPixmap>
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
|
||||
#include <QRandomGenerator>
|
||||
#endif
|
||||
#include <QScreen>
|
||||
#include <QSessionManager>
|
||||
#include <QSettings>
|
||||
@ -1138,12 +1136,7 @@ GuiApplication::GuiApplication(int & argc, char ** argv)
|
||||
#endif
|
||||
|
||||
setDesktopFileName(lyx_package);
|
||||
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
|
||||
QRandomGenerator(QDateTime::currentDateTime().toSecsSinceEpoch());
|
||||
#else
|
||||
qsrand(QDateTime::currentDateTime().toTime_t());
|
||||
#endif
|
||||
|
||||
// Install LyX translator for missing Qt translations
|
||||
installTranslator(&d->gui_trans_);
|
||||
|
@ -494,13 +494,7 @@ PreambleModule::PreambleModule(QWidget * parent)
|
||||
checkFindButton();
|
||||
int const tabStop = 4;
|
||||
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(' '));
|
||||
#else
|
||||
preambleTE->setTabStopWidth(tabStop * metrics.width(' '));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@ -646,13 +640,7 @@ LocalLayout::LocalLayout(QWidget * parent)
|
||||
connect(editPB, SIGNAL(clicked()), this, SLOT(editExternal()));
|
||||
int const tabStop = 4;
|
||||
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(' '));
|
||||
#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) {
|
||||
langModule->quoteStyleCO->setItemData(i, QVariant(comboFont), Qt::FontRole);
|
||||
QString str = langModule->quoteStyleCO->itemText(i);
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
|
||||
qswidth = max(qswidth, fm.horizontalAdvance(str));
|
||||
#else
|
||||
qswidth = max(qswidth, fm.width(str));
|
||||
#endif
|
||||
}
|
||||
// add scrollbar width and margin to width
|
||||
qswidth += langModule->quoteStyleCO->style()->pixelMetric(QStyle::PM_ScrollBarExtent);
|
||||
|
@ -283,11 +283,7 @@ int GuiFontMetrics::width(docstring const & s) const
|
||||
if (math_char) {
|
||||
QString const qs = toqstr(s);
|
||||
int br_width = rbearing(s[0]);
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
|
||||
int s_width = metrics_.horizontalAdvance(qs);
|
||||
#else
|
||||
int s_width = metrics_.width(qs);
|
||||
#endif
|
||||
// keep value 0 for math chars with width 0
|
||||
if (s_width != 0)
|
||||
w = max(br_width, s_width);
|
||||
@ -667,17 +663,10 @@ int GuiFontMetrics::width(char_type c) const
|
||||
if (value != outOfLimitMetric)
|
||||
return value;
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
|
||||
if (is_utf16(c))
|
||||
value = metrics_.horizontalAdvance(ucs4_to_qchar(c));
|
||||
else
|
||||
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);
|
||||
|
||||
|
@ -845,25 +845,15 @@ bool KeySymbol::operator==(KeySymbol const & ks) const
|
||||
KeyModifier q_key_state(Qt::KeyboardModifiers state)
|
||||
{
|
||||
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;
|
||||
if (state & Qt::ShiftModifier)
|
||||
k |= ShiftModifier;
|
||||
if (state & Qt::AltModifier)
|
||||
k |= AltModifier;
|
||||
#if defined(USE_MACOSX_PACKAGING) || defined(USE_META_KEYBINDING)
|
||||
if (state & (dontSwapCtrlAndMeta ? Qt::ControlModifier : Qt::MetaModifier))
|
||||
if (state & Qt::MetaModifier)
|
||||
k |= MetaModifier;
|
||||
#else
|
||||
if (state & Qt::MetaModifier)
|
||||
|
@ -665,11 +665,7 @@ GuiView::GuiView(int id)
|
||||
connect(stat_counts_, SIGNAL(clicked()), this, SLOT(statsPressed()));
|
||||
|
||||
zoom_slider_ = new QSlider(Qt::Horizontal, statusBar());
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
|
||||
zoom_slider_->setFixedWidth(fm.horizontalAdvance('x') * 15);
|
||||
#else
|
||||
zoom_slider_->setFixedWidth(fm.width('x') * 15);
|
||||
#endif
|
||||
// Make the defaultZoom center
|
||||
zoom_slider_->setRange(10, (lyxrc.defaultZoom * 2) - 10);
|
||||
// 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."));
|
||||
|
||||
// Buttons to change zoom stepwise
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
|
||||
QSize s(fm.horizontalAdvance('+'), fm.height());
|
||||
#else
|
||||
QSize s(fm.width('+'), fm.height());
|
||||
#endif
|
||||
zoom_in_ = new GuiClickableLabel(statusBar());
|
||||
zoom_in_->setText("+");
|
||||
zoom_in_->setFixedSize(s);
|
||||
@ -726,11 +718,7 @@ GuiView::GuiView(int id)
|
||||
// zoom_value_->setPalette(palette);
|
||||
zoom_value_->setForegroundRole(statusBar()->foregroundRole());
|
||||
zoom_value_->setFixedHeight(fm.height());
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
|
||||
zoom_value_->setMinimumWidth(fm.horizontalAdvance("444\%"));
|
||||
#else
|
||||
zoom_value_->setMinimumWidth(fm.width("444\%"));
|
||||
#endif
|
||||
zoom_value_->setAlignment(Qt::AlignCenter);
|
||||
zoom_value_->setText(toqstr(bformat(_("[[ZOOM]]%1$d%"), zoom)));
|
||||
statusBar()->addPermanentWidget(zoom_value_);
|
||||
|
@ -774,8 +774,7 @@ void GuiWorkArea::mouseReleaseEvent(QMouseEvent * e)
|
||||
FuncRequest const cmd(LFUN_MOUSE_RELEASE, e->x(), e->y(),
|
||||
#endif
|
||||
q_button_state(e->button()), q_key_state(e->modifiers()));
|
||||
#if (QT_VERSION > QT_VERSION_CHECK(5,10,1) && \
|
||||
QT_VERSION < QT_VERSION_CHECK(5,15,1))
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5,15,1)
|
||||
d->synthetic_mouse_event_.cmd = cmd; // QtBug QAbstractScrollArea::mouseMoveEvent
|
||||
#endif
|
||||
d->dispatch(cmd);
|
||||
@ -785,8 +784,7 @@ void GuiWorkArea::mouseReleaseEvent(QMouseEvent * e)
|
||||
|
||||
void GuiWorkArea::mouseMoveEvent(QMouseEvent * e)
|
||||
{
|
||||
#if (QT_VERSION > QT_VERSION_CHECK(5,10,1) && \
|
||||
QT_VERSION < QT_VERSION_CHECK(5,15,1))
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5,15,1)
|
||||
// cancel the event if the coordinates didn't change, this is due to QtBug
|
||||
// QAbstractScrollArea::mouseMoveEvent, the event is triggered falsely when quickly
|
||||
// double tapping a touchpad. To test: try to select a word by quickly double tapping
|
||||
|
@ -16,10 +16,12 @@
|
||||
#include <QObject>
|
||||
#include <QWaitCondition>
|
||||
|
||||
#include <functional>
|
||||
|
||||
namespace lyx {
|
||||
|
||||
using std::function;
|
||||
using std::ref;
|
||||
using std::bind;
|
||||
|
||||
namespace frontend {
|
||||
|
||||
|
||||
@ -66,25 +68,25 @@ public:
|
||||
template<class F, class 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>
|
||||
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>
|
||||
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>
|
||||
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>
|
||||
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),
|
||||
std::ref(p5), std::ref(p6), std::ref(p7), std::ref(p8)));
|
||||
return call(lyx::bind(f, lyx::ref(p1), lyx::ref(p2), lyx::ref(p3), lyx::ref(p4),
|
||||
lyx::ref(p5), lyx::ref(p6), lyx::ref(p7), lyx::ref(p8)));
|
||||
}
|
||||
|
||||
private:
|
||||
@ -107,7 +109,7 @@ private:
|
||||
|
||||
private:
|
||||
R return_value_;
|
||||
std::function<R()> func_;
|
||||
function<R()> func_;
|
||||
};
|
||||
|
||||
|
||||
@ -129,25 +131,25 @@ public:
|
||||
template<class F, class 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>
|
||||
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>
|
||||
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>
|
||||
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>
|
||||
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),
|
||||
std::ref(p6), std::ref(p7), std::ref(p8)));
|
||||
call(bind(f, lyx::ref(p1), lyx::ref(p2), lyx::ref(p3), lyx::ref(p4), lyx::ref(p5),
|
||||
lyx::ref(p6), lyx::ref(p7), lyx::ref(p8)));
|
||||
}
|
||||
|
||||
private:
|
||||
@ -169,7 +171,7 @@ private:
|
||||
}
|
||||
|
||||
private:
|
||||
std::function<void()> func_;
|
||||
function<void()> func_;
|
||||
};
|
||||
|
||||
|
||||
|
@ -320,11 +320,7 @@ void LayoutBox::Private::setFilter(QString const & s)
|
||||
lastSel_ = filterModel_->mapToSource(filterModel_->index(sel, 0)).row();
|
||||
|
||||
filter_ = s;
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 12, 0)
|
||||
filterModel_->setFilterRegExp(charFilterRegExp(filter_));
|
||||
#else
|
||||
filterModel_->setFilterRegularExpression(charFilterRegExp(filter_));
|
||||
#endif
|
||||
countCategories();
|
||||
|
||||
// restore old selection
|
||||
|
@ -769,11 +769,7 @@ QString formatToolTip(QString text, int width)
|
||||
text = Qt::convertFromPlainText(text, Qt::WhiteSpaceNormal);
|
||||
// Compute desired width in pixels
|
||||
QFont const font = QToolTip::font();
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
|
||||
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
|
||||
QTextDocument td("");
|
||||
td.setHtml(text);
|
||||
|
@ -16,9 +16,7 @@
|
||||
#include <QCoreApplication>
|
||||
#include <QDateTime>
|
||||
#include <QTimer>
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
|
||||
#include <QRandomGenerator>
|
||||
#endif
|
||||
|
||||
#include <string>
|
||||
|
||||
@ -41,11 +39,7 @@ public:
|
||||
setOrganizationDomain("lyx.org");
|
||||
setApplicationName(toqstr(app));
|
||||
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
|
||||
QRandomGenerator(QDateTime::currentDateTime().toSecsSinceEpoch());
|
||||
#else
|
||||
qsrand(QDateTime::currentDateTime().toTime_t());
|
||||
#endif
|
||||
}
|
||||
int execute()
|
||||
{
|
||||
|
@ -13,7 +13,7 @@
|
||||
#ifndef 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
|
||||
* relevant in a given block.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user