mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-16 21:10:26 +00:00
635a7d77dd
This commit allows compiling LyX with Qt6 when using autotools. For a successful compilation the following 2 conditions must be met. 1) The Qt6 qmake has to come first in PATH, so that the command "qmake -v | grep -o 'Qt version .'" returns "Qt version 6". 2) The --enable-qt6 switch has to be passed to the configure command. If --enable-qt6 is used but Qt6 is not found, Qt5 is tried as a fallback. If also Qt5 is not found, configuring for Qt4 is attempted. If --enable-qt6 is not used, then things go as usual. This means that Qt5 is tried first and then Qt4, unless --disable-qt5 is used, in which case Qt4 is directly attempted. This means that existing scripts should continue working unmodified. LyX should compile with Qt6 on windows and linux, and possibly also on mac, but I could not test that. However, it is not guaranteed that it works as it should. In particular I am not sure that I got right the conversion from QRegExp to QRegularExpression. For sure, the syntax highlighting seems to not work right. Someone in the know should take a look at that. I am able to load documents and compile them but some thourough testing is needed. However, when compiling for Qt5 or Qt4, I tried to make sure that the functionality is preserved.
100 lines
1.7 KiB
C++
100 lines
1.7 KiB
C++
// -*- C++ -*-
|
|
/**
|
|
* \file IconPalette.h
|
|
* This file is part of LyX, the document processor.
|
|
* Licence details can be found in the file COPYING.
|
|
*
|
|
* \author Edwin Leuven
|
|
*
|
|
* Full author contact details are available in file CREDITS.
|
|
*/
|
|
|
|
#ifndef ICONPALETTE_H
|
|
#define ICONPALETTE_H
|
|
|
|
#include <QWidget>
|
|
#include <QMenu>
|
|
|
|
class QGridLayout;
|
|
|
|
namespace lyx {
|
|
namespace frontend {
|
|
|
|
/**
|
|
* tear-off widget
|
|
*/
|
|
class TearOff : public QWidget {
|
|
Q_OBJECT
|
|
public:
|
|
TearOff(QWidget * parent);
|
|
#if QT_VERSION < 0x060000
|
|
void enterEvent(QEvent *) override;
|
|
#else
|
|
void enterEvent(QEvent *);
|
|
#endif
|
|
void leaveEvent(QEvent *) override;
|
|
void mouseReleaseEvent (QMouseEvent *) override;
|
|
Q_SIGNALS:
|
|
void tearOff();
|
|
protected:
|
|
void paintEvent(QPaintEvent *) override;
|
|
private:
|
|
bool highlighted_;
|
|
};
|
|
|
|
|
|
/**
|
|
* For holding an arbitrary set of icons.
|
|
*/
|
|
class IconPalette : public QWidget {
|
|
Q_OBJECT
|
|
public:
|
|
IconPalette(QWidget * parent);
|
|
void addButton(QAction *);
|
|
|
|
Q_SIGNALS:
|
|
void triggered(QAction *);
|
|
void visible(bool);
|
|
|
|
protected:
|
|
void showEvent(QShowEvent * event) override;
|
|
void hideEvent(QHideEvent * event) override;
|
|
void paintEvent(QPaintEvent * event) override;
|
|
|
|
private Q_SLOTS:
|
|
void tearOff();
|
|
virtual void clicked(QAction *);
|
|
|
|
private:
|
|
QGridLayout * layout_;
|
|
QList<QAction *> actions_;
|
|
bool tornoff_;
|
|
TearOff * tearoffwidget_;
|
|
};
|
|
|
|
|
|
/**
|
|
* Popup menu for a toolbutton.
|
|
* We need this to keep track whether
|
|
* it is necessary to enable/disable
|
|
* the toolbutton
|
|
*/
|
|
class ButtonMenu : public QMenu {
|
|
Q_OBJECT
|
|
public:
|
|
ButtonMenu(const QString & title, QWidget * parent);
|
|
void add(QAction *);
|
|
|
|
public Q_SLOTS:
|
|
void updateParent();
|
|
|
|
private:
|
|
QList<QAction *> actions_;
|
|
};
|
|
|
|
|
|
} // namespace frontend
|
|
} // namespace lyx
|
|
|
|
#endif // ICONPALETTE_H
|