Cover action (Solved)
Hi all,
I'm having problems making a cover action work. Here's my current code; Code:
import QtQuick 2.4 file hierarchy; CoverPage - /usr/share/harbour-nationalrail/qml/cover/CoverPage.qml Other pages - /usr/share/harbour-nationalrail/qml/pages/Search.qml Thanks, p.s. courteous answers only please :D |
Re: Cover action
It's been a while since I did this and there might be better ways nowadays, but here I go:
Since you didn't describe you actual situation (except it doesn't work) and atm I can't test the sample, have some pointers: If you don't see your coveraction, CoverActionList has an enabled property (boolean). onTriggered is called/executed when you touch the action, calling the resolved string of your qml file ofc won't do anything. Instead call a function that does all the heavy lifting of changing application state, so basically: Code:
import QtQuick 2.4 |
Re: Cover action
Okay, progress!, I now have a working shortcut on my cover, with extended thanks to Merlin1991, as initially, I couldn't make his code work at all, that is until I moved CoverPage.qml into the pages directory and removed cover directory completely, then with one minor change to Merlin's code ('appWindow' to 'window') and now I have a basic cover action, but......
A few little problems with the now working shortcut, firstly, I get a glimpse of the first page of the app as the Search page is spawned from cover and if I minimise the spawned search page and go back to the cover, tap the search icon, then another search page is spawned on to the stack, making 2 search pages.....? So, how to stop the glimpse of the first page as Search page spawns and how to prevent the stacking up of search pages with each tap on the cover shortcut? Here's the working code; Code:
import QtQuick 2.4 Code:
|
Re: Cover action (Solved)
Sorted, I now have 2 cover actions working as expected. While it may not be the most eloquent way of doing it, it works nonetheless. Only a single instance of each cover action now occurs :)
The working code is as follows; Code:
import QtQuick 2.0 |
Re: Cover action (Solved)
hey man. I can't seem to reply to your DM shoot me over your email if you don't mind and I'll message you there :)
|
All times are GMT. The time now is 22:23. |
vBulletin® Version 3.8.8