fixed several qml warnings

This commit is contained in:
Luis Ángel San Martín 2016-01-13 21:24:23 +01:00
parent ac4772812a
commit 97c788203c
2 changed files with 24 additions and 6 deletions

View File

@ -39,7 +39,6 @@ GridComicsView::GridComicsView(QWidget *parent) :
container->setMinimumSize(200, 200);
container->setFocusPolicy(Qt::TabFocus);
view->setSource(QUrl("qrc:/qml/GridComicsView.qml"));
createCoverSizeSliderWidget();
@ -81,6 +80,25 @@ GridComicsView::GridComicsView(QWidget *parent) :
ctxt->setContextProperty("fontSpacing", 0.5);
#endif
ctxt->setContextProperty("backgroundImage", QUrl());
ctxt->setContextProperty("backgroundBlurOpacity", 0.0);
ctxt->setContextProperty("backgroundBlurRadius", 0.0);
ctxt->setContextProperty("backgroundBlurVisible", false);
ComicModel *model = new ComicModel();
QItemSelectionModel *selectionModel = new QItemSelectionModel(model);
ctxt->setContextProperty("comicsList", model);
ctxt->setContextProperty("comicsSelection", selectionModel);
ctxt->setContextProperty("contextMenuHelper",this);
ctxt->setContextProperty("comicsSelectionHelper", this);
ctxt->setContextProperty("comicRatingHelper", this);
ctxt->setContextProperty("dummyValue", true);
ctxt->setContextProperty("dragManager", this);
ctxt->setContextProperty("dropManager", this);
view->setSource(QUrl("qrc:/qml/GridComicsView.qml"));
setShowMarks(true);//TODO save this in settings
QVBoxLayout * l = new QVBoxLayout;
@ -188,9 +206,9 @@ void GridComicsView::updateBackgroundConfig()
}
else
{
ctxt->setContextProperty("backgroundImage", QVariant());
ctxt->setContextProperty("backgroundBlurOpacity", 0);
ctxt->setContextProperty("backgroundBlurRadius", 0);
ctxt->setContextProperty("backgroundImage", QUrl());
ctxt->setContextProperty("backgroundBlurOpacity", 0.0);
ctxt->setContextProperty("backgroundBlurRadius", 0.0);
ctxt->setContextProperty("backgroundBlurVisible", false);
}

View File

@ -373,7 +373,7 @@ Rectangle {
objectName: "grid"
anchors.fill: parent
cellHeight: cellCustomHeight
highlight: appHighlight
//highlight: appHighlight
focus: true
model: comicsList
delegate: appDelegate
@ -432,7 +432,7 @@ Rectangle {
var rest = width - (cWidth * wholeCells)
grid.cellWidth = cWidth + Math.floor(rest / wholeCells);
console.log("cWidth",cWidth,"wholeCells=",wholeCells,"rest=",rest,"cellWidth=",cellWidth,"width=",width);
//console.log("cWidth",cWidth,"wholeCells=",wholeCells,"rest=",rest,"cellWidth=",cellWidth,"width=",width);
}
}