mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
Wrap booleans in QVariant when updating the qml context
This commit is contained in:
parent
768d7ee73c
commit
b841aff4a3
@ -90,7 +90,7 @@ GridComicsView::GridComicsView(QWidget *parent)
|
|||||||
ctxt->setContextProperty("borderColor", "#121212");
|
ctxt->setContextProperty("borderColor", "#121212");
|
||||||
ctxt->setContextProperty("titleColor", "#FFFFFF");
|
ctxt->setContextProperty("titleColor", "#FFFFFF");
|
||||||
ctxt->setContextProperty("textColor", "#A8A8A8");
|
ctxt->setContextProperty("textColor", "#A8A8A8");
|
||||||
ctxt->setContextProperty("dropShadow", false);
|
ctxt->setContextProperty("dropShadow", QVariant(false));
|
||||||
// fonts settings
|
// fonts settings
|
||||||
int fontSize = QApplication::font().pointSize();
|
int fontSize = QApplication::font().pointSize();
|
||||||
if (fontSize == -1)
|
if (fontSize == -1)
|
||||||
@ -127,7 +127,7 @@ GridComicsView::GridComicsView(QWidget *parent)
|
|||||||
ctxt->setContextProperty("backgroundImage", QUrl());
|
ctxt->setContextProperty("backgroundImage", QUrl());
|
||||||
ctxt->setContextProperty("backgroundBlurOpacity", 0.0);
|
ctxt->setContextProperty("backgroundBlurOpacity", 0.0);
|
||||||
ctxt->setContextProperty("backgroundBlurRadius", 0.0);
|
ctxt->setContextProperty("backgroundBlurRadius", 0.0);
|
||||||
ctxt->setContextProperty("backgroundBlurVisible", false);
|
ctxt->setContextProperty("backgroundBlurVisible", QVariant(false));
|
||||||
|
|
||||||
auto model = new ComicModel();
|
auto model = new ComicModel();
|
||||||
selectionHelper->setModel(model);
|
selectionHelper->setModel(model);
|
||||||
@ -290,7 +290,7 @@ void GridComicsView::updateBackgroundConfig()
|
|||||||
ctxt->setContextProperty("backgroundImage", QUrl());
|
ctxt->setContextProperty("backgroundImage", QUrl());
|
||||||
ctxt->setContextProperty("backgroundBlurOpacity", 0.0);
|
ctxt->setContextProperty("backgroundBlurOpacity", 0.0);
|
||||||
ctxt->setContextProperty("backgroundBlurRadius", 0.0);
|
ctxt->setContextProperty("backgroundBlurRadius", 0.0);
|
||||||
ctxt->setContextProperty("backgroundBlurVisible", false);
|
ctxt->setContextProperty("backgroundBlurVisible", QVariant(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
@ -365,7 +365,7 @@ void GridComicsView::enableFilterMode(bool enabled)
|
|||||||
QQmlContext *ctxt = view->rootContext();
|
QQmlContext *ctxt = view->rootContext();
|
||||||
|
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
ctxt->setContextProperty("showCurrentComic", false);
|
ctxt->setContextProperty("showCurrentComic", QVariant(false));
|
||||||
ctxt->setContextProperty("currentComic", nullptr);
|
ctxt->setContextProperty("currentComic", nullptr);
|
||||||
} else {
|
} else {
|
||||||
setCurrentComicIfNeeded();
|
setCurrentComicIfNeeded();
|
||||||
@ -448,11 +448,11 @@ void GridComicsView::setCurrentComicIfNeeded()
|
|||||||
if (showCurrentComic) {
|
if (showCurrentComic) {
|
||||||
ctxt->setContextProperty("currentComic", ¤tComic);
|
ctxt->setContextProperty("currentComic", ¤tComic);
|
||||||
ctxt->setContextProperty("currentComicInfo", &(currentComic.info));
|
ctxt->setContextProperty("currentComicInfo", &(currentComic.info));
|
||||||
ctxt->setContextProperty("showCurrentComic", true);
|
ctxt->setContextProperty("showCurrentComic", QVariant(true));
|
||||||
} else {
|
} else {
|
||||||
ctxt->setContextProperty("currentComic", ¤tComic);
|
ctxt->setContextProperty("currentComic", ¤tComic);
|
||||||
ctxt->setContextProperty("currentComicInfo", &(currentComic.info));
|
ctxt->setContextProperty("currentComicInfo", &(currentComic.info));
|
||||||
ctxt->setContextProperty("showCurrentComic", false);
|
ctxt->setContextProperty("showCurrentComic", QVariant(false));
|
||||||
// ctxt->setContextProperty("currentComic", nullptr);
|
// ctxt->setContextProperty("currentComic", nullptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user