mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
Move connections to happen later
Otherwise QQuickItem(s) don't work properly in Qt6. I couldn't find the root cause.
This commit is contained in:
parent
f48201fb91
commit
72670ea6c8
@ -68,14 +68,6 @@ InfoComicsView::InfoComicsView(QWidget *parent)
|
|||||||
|
|
||||||
view->setSource(QUrl("qrc:/qml/InfoComicsView.qml"));
|
view->setSource(QUrl("qrc:/qml/InfoComicsView.qml"));
|
||||||
|
|
||||||
auto rootObject = dynamic_cast<QObject *>(view->rootObject());
|
|
||||||
flow = rootObject->findChild<QObject *>("flow");
|
|
||||||
list = rootObject->findChild<QObject *>("list");
|
|
||||||
|
|
||||||
// QML signals only work with old style signal slot syntax
|
|
||||||
connect(flow, SIGNAL(currentCoverChanged(int)), this, SLOT(updateInfoForIndex(int))); // clazy:exclude=old-style-connect
|
|
||||||
connect(flow, SIGNAL(currentCoverChanged(int)), this, SLOT(setCurrentIndex(int))); // clazy:exclude=old-style-connect
|
|
||||||
|
|
||||||
selectionHelper = new YACReaderComicsSelectionHelper(this);
|
selectionHelper = new YACReaderComicsSelectionHelper(this);
|
||||||
comicInfoHelper = new YACReaderComicInfoHelper(this);
|
comicInfoHelper = new YACReaderComicInfoHelper(this);
|
||||||
|
|
||||||
@ -138,6 +130,22 @@ void InfoComicsView::setModel(ComicModel *model)
|
|||||||
setCurrentIndex(model->index(0, 0));
|
setCurrentIndex(model->index(0, 0));
|
||||||
updateInfoForIndex(0);
|
updateInfoForIndex(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (flow != nullptr) {
|
||||||
|
flow->disconnect();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (list != nullptr) {
|
||||||
|
list->disconnect();
|
||||||
|
}
|
||||||
|
|
||||||
|
auto rootObject = dynamic_cast<QQuickItem *>(view->rootObject());
|
||||||
|
flow = rootObject->findChild<QQuickItem *>("flow", Qt::FindChildrenRecursively);
|
||||||
|
list = rootObject->findChild<QQuickItem *>("list", Qt::FindChildrenRecursively);
|
||||||
|
|
||||||
|
// QML signals only work with old style signal slot syntax
|
||||||
|
connect(flow, SIGNAL(currentCoverChanged(int)), this, SLOT(updateInfoForIndex(int))); // clazy:exclude=old-style-connect
|
||||||
|
connect(flow, SIGNAL(currentCoverChanged(int)), this, SLOT(setCurrentIndex(int))); // clazy:exclude=old-style-connect
|
||||||
}
|
}
|
||||||
|
|
||||||
void InfoComicsView::setCurrentIndex(const QModelIndex &index)
|
void InfoComicsView::setCurrentIndex(const QModelIndex &index)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user