14#include "../../bibletime.h"
17#include <QGuiApplication>
25#include "../../../backend/drivers/cswordmoduleinfo.h"
26#include "../../../backend/managers/cswordbackend.h"
27#include "../../../util/btassert.h"
28#include "../../BtMimeData.h"
41 engine()->addImportPath(QStringLiteral(
"qrc:/qt/qml"));
42 setSource(QUrl(QStringLiteral(
"qrc:/qt/qml/DisplayView.qml")));
48 int y = mapFromGlobal(QCursor::pos()).y();
49 if ((y >= 0) & (y-height() < 0))
64 if (
auto const *
const btmimedata =
65 qobject_cast<BTMimeData const *>(e->mimeData()))
67 auto const & item = btmimedata->bookmarks().first();
78 e->acceptProposedAction();
80 QQuickWidget::dragEnterEvent(e);
86 if (
auto const *
const btmimedata =
87 qobject_cast<BTMimeData const *>(e->mimeData()))
91 e->acceptProposedAction();
98 if (e->mimeData()->hasFormat(QStringLiteral(
"BibleTime/Bookmark"))) {
99 e->acceptProposedAction();
121 if (e->type() == QEvent::Leave)
123 return QQuickWidget::event(e);
132 if (
event->button() == Qt::LeftButton) {
133 auto const position =
event->position().toPoint();
134 callQml(
"leftMousePress", position.x(), position.y());
138 QQuickWidget::mousePressEvent(
event);
142 if ((
event->buttons() & Qt::LeftButton) == Qt::LeftButton) {
143 auto const position =
event->position().toPoint();
144 auto const y = position.y();
145 if (y < 0 || y > height()) {
152 callQml(
"leftMouseMove", position.x(), y);
156 return QQuickWidget::mouseMoveEvent(
event);
160 if (
event->button() == Qt::LeftButton) {
162 auto const position =
event->position().toPoint();
163 callQml(
"leftMouseRelease", position.x(), position.y());
167 return QQuickWidget::mouseReleaseEvent(
event);
172 QQuickWidget::wheelEvent(
event);
static BibleTime * instance() noexcept
QString const & key() const noexcept
CSwordKey * getMouseClickedKey() const
bool isBibleOrCommentary()
CSwordModuleInfo * findModuleByName(const QString &name) const
Searches for a module with the given name.
static CSwordBackend & instance() noexcept