fix: crash when switching view
This commit is contained in:
parent
c026d3a844
commit
3dd4433645
3 changed files with 9 additions and 4 deletions
|
@ -32,13 +32,14 @@ ShortCut::ShortCut(QObject *parent)
|
||||||
|
|
||||||
void ShortCut::install(QObject *target)
|
void ShortCut::install(QObject *target)
|
||||||
{
|
{
|
||||||
if (m_object) {
|
// No need to remove, because memory space is automatically freed in qml.
|
||||||
m_object->removeEventFilter(this);
|
// if (m_object) {
|
||||||
}
|
// m_object->removeEventFilter(this);
|
||||||
|
// }
|
||||||
|
|
||||||
if (target) {
|
if (target) {
|
||||||
target->installEventFilter(this);
|
target->installEventFilter(this);
|
||||||
m_object = target;
|
// m_object = target;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,8 @@ import FishUI 1.0 as FishUI
|
||||||
GridView {
|
GridView {
|
||||||
id: control
|
id: control
|
||||||
|
|
||||||
|
objectName: "FolderGridView"
|
||||||
|
|
||||||
property bool isDesktopView: false
|
property bool isDesktopView: false
|
||||||
|
|
||||||
property Item rubberBand: null
|
property Item rubberBand: null
|
||||||
|
|
|
@ -26,6 +26,8 @@ import Cutefish.DragDrop 1.0 as DragDrop
|
||||||
ListView {
|
ListView {
|
||||||
id: control
|
id: control
|
||||||
|
|
||||||
|
objectName: "FolderListView"
|
||||||
|
|
||||||
property Item rubberBand: null
|
property Item rubberBand: null
|
||||||
property Item hoveredItem: null
|
property Item hoveredItem: null
|
||||||
property Item pressedItem: null
|
property Item pressedItem: null
|
||||||
|
|
Loading…
Reference in a new issue