mirror of
https://github.com/YACReader/yacreader
synced 2025-07-18 21:14:33 -04:00
QMacToolBar is not available in Qt6
This commit adds new qt pure versions of the mac toolbar to be used in qt6.
This commit is contained in:
committed by
Luis Ángel San Martín
parent
450d3c18b2
commit
e026f25617
@ -1,8 +1,11 @@
|
||||
#ifndef YACREADER_MACOSX_TOOLBAR_H
|
||||
#define YACREADER_MACOSX_TOOLBAR_H
|
||||
|
||||
#include <QtGlobal>
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
#include <QMacToolBar>
|
||||
#include <QtWidgets>
|
||||
#include <QMainWindow>
|
||||
|
||||
#include "yacreader_global.h"
|
||||
|
||||
@ -70,6 +73,8 @@ public:
|
||||
// convenience method for switching the icon of the view selector
|
||||
void updateViewSelectorIcon(const QIcon &icon);
|
||||
|
||||
void attachToWindow(QMainWindow *window);
|
||||
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
@ -80,5 +85,48 @@ protected:
|
||||
bool yosemite;
|
||||
QMacToolBarItem *viewSelector;
|
||||
};
|
||||
#else
|
||||
|
||||
#ifdef YACREADER_LIBRARY
|
||||
|
||||
#include "yacreader_main_toolbar.h"
|
||||
#include "yacreader_search_line_edit.h"
|
||||
#include <QMainWindow>
|
||||
|
||||
class YACReaderMacOSXSearchLineEdit : public YACReaderSearchLineEdit
|
||||
{
|
||||
};
|
||||
|
||||
class YACReaderMacOSXToolbar : public YACReaderMainToolBar
|
||||
{
|
||||
public:
|
||||
explicit YACReaderMacOSXToolbar(QWidget *parent = 0);
|
||||
QSize sizeHint() const override;
|
||||
void addAction(QAction *action);
|
||||
void addSpace(int size); // size in points
|
||||
void addStretch();
|
||||
YACReaderMacOSXSearchLineEdit *addSearchEdit();
|
||||
void updateViewSelectorIcon(const QIcon &icon);
|
||||
void attachToWindow(QMainWindow *window);
|
||||
|
||||
private:
|
||||
void paintEvent(QPaintEvent *) override;
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
#include <QtWidgets>
|
||||
|
||||
class YACReaderMacOSXToolbar : public QToolBar
|
||||
{
|
||||
public:
|
||||
explicit YACReaderMacOSXToolbar(QWidget *parent = 0);
|
||||
void attachToWindow(QMainWindow *window);
|
||||
void addStretch();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif // YACREADER_MACOSX_TOOLBAR_H
|
||||
|
Reference in New Issue
Block a user