Updated qml connection syntax

This commit is contained in:
FalsinSoft 2020-06-05 21:31:50 +02:00
parent fab160274e
commit 3d69f5abca
7 changed files with 31 additions and 18 deletions

View File

@ -50,7 +50,7 @@ Q_DECLARE_METATYPE(QAndroidGoogleAccountInfo)
class QAndroidGoogleAccount : public QObject, public QAndroidActivityResultReceiver class QAndroidGoogleAccount : public QObject, public QAndroidActivityResultReceiver
{ {
Q_PROPERTY(QAndroidGoogleAccountInfo signedInAccount READ getSignedInAccountInfo NOTIFY signedInAccountInfoChanged) Q_PROPERTY(QAndroidGoogleAccountInfo signedInAccountInfo READ getSignedInAccountInfo NOTIFY signedInAccountInfoChanged)
Q_DISABLE_COPY(QAndroidGoogleAccount) Q_DISABLE_COPY(QAndroidGoogleAccount)
Q_OBJECT Q_OBJECT

View File

@ -57,7 +57,8 @@ Page {
Connections { Connections {
target: QtAndroidApkExpansionFiles target: QtAndroidApkExpansionFiles
onDownloadStateChanged: { function onDownloadStateChanged(newState)
{
switch(newState) switch(newState)
{ {
case QtAndroidApkExpansionFiles.STATE_COMPLETED: case QtAndroidApkExpansionFiles.STATE_COMPLETED:
@ -76,7 +77,8 @@ Page {
} }
downloadStateLabel.text = QtAndroidApkExpansionFiles.getString(newState-1); downloadStateLabel.text = QtAndroidApkExpansionFiles.getString(newState-1);
} }
onDownloadProgress: { function onDownloadProgress(overallTotal, overallProgress, timeRemaining, currentSpeed)
{
var time = new Date(timeRemaining); var time = new Date(timeRemaining);
downloadProgressBar.to = overallTotal; downloadProgressBar.to = overallTotal;
downloadProgressBar.value = overallProgress; downloadProgressBar.value = overallProgress;

View File

@ -24,7 +24,8 @@ Page {
Connections { Connections {
target: QtAndroidAppPermissions target: QtAndroidAppPermissions
onRequestPermissionsResults: { function onRequestPermissionsResults(results)
{
for(var i = 0; i < results.length; i++) for(var i = 0; i < results.length; i++)
{ {
if(results[i].granted === true) if(results[i].granted === true)

View File

@ -10,16 +10,19 @@ Page {
Connections { Connections {
target: QtAndroidGoogleAccount target: QtAndroidGoogleAccount
onSignedInAccountChanged: { function onSignedInAccountInfoChanged()
QtAndroidTools.insertImage("AccountPhoto", QtAndroidGoogleAccount.signedInAccount.photo); {
QtAndroidTools.insertImage("AccountPhoto", QtAndroidGoogleAccount.signedInAccountInfo.photo);
accountPhoto.source = "image://QtAndroidTools/AccountPhoto"; accountPhoto.source = "image://QtAndroidTools/AccountPhoto";
} }
onSignedIn: { function onSignedIn(signInSuccessfully)
{
if(signInSuccessfully === true) if(signInSuccessfully === true)
{ {
} }
} }
onSignedOut: { function onSignedOut()
{
QtAndroidTools.removeImage("AccountPhoto"); QtAndroidTools.removeImage("AccountPhoto");
accountPhoto.source = ""; accountPhoto.source = "";
} }
@ -33,27 +36,27 @@ Page {
Label { Label {
font.pixelSize: 15 font.pixelSize: 15
text: "<b>Id:</b> " + QtAndroidGoogleAccount.signedInAccount.id text: "<b>Id:</b> " + QtAndroidGoogleAccount.signedInAccountInfo.id
} }
Label { Label {
font.pixelSize: 15 font.pixelSize: 15
text: "<b>DisplayName:</b> " + QtAndroidGoogleAccount.signedInAccount.displayName text: "<b>DisplayName:</b> " + QtAndroidGoogleAccount.signedInAccountInfo.displayName
} }
Label { Label {
font.pixelSize: 15 font.pixelSize: 15
text: "<b>Email:</b> " + QtAndroidGoogleAccount.signedInAccount.email text: "<b>Email:</b> " + QtAndroidGoogleAccount.signedInAccountInfo.email
} }
Label { Label {
font.pixelSize: 15 font.pixelSize: 15
text: "<b>FamilyName:</b> " + QtAndroidGoogleAccount.signedInAccount.familyName text: "<b>FamilyName:</b> " + QtAndroidGoogleAccount.signedInAccountInfo.familyName
} }
Label { Label {
font.pixelSize: 15 font.pixelSize: 15
text: "<b>GivenName:</b> " + QtAndroidGoogleAccount.signedInAccount.givenName text: "<b>GivenName:</b> " + QtAndroidGoogleAccount.signedInAccountInfo.givenName
} }
Label { Label {

View File

@ -10,7 +10,8 @@ Page {
Connections { Connections {
target: QtAndroidGoogleDrive target: QtAndroidGoogleDrive
onDownloadProgressChanged: { function onDownloadProgressChanged(state, progress)
{
switch(state) switch(state)
{ {
case QtAndroidGoogleDrive.STATE_MEDIA_IN_PROGRESS: case QtAndroidGoogleDrive.STATE_MEDIA_IN_PROGRESS:
@ -20,7 +21,8 @@ Page {
break; break;
} }
} }
onUploadProgressChanged: { function onUploadProgressChanged(state, progress)
{
switch(state) switch(state)
{ {
case QtAndroidGoogleDrive.STATE_INITIATION_STARTED: case QtAndroidGoogleDrive.STATE_INITIATION_STARTED:

View File

@ -30,12 +30,14 @@ Page {
Connections { Connections {
target: QtAndroidSharing target: QtAndroidSharing
onRequestedSharedFileReadyToSave: { function onRequestedSharedFileReadyToSave(mimeType, name, size)
{
requestedSharedFile.text = "Name: " + name + "\nSize: " + size + "\nMimeType: " + mimeType; requestedSharedFile.text = "Name: " + name + "\nSize: " + size + "\nMimeType: " + mimeType;
requestedSharedFile.fileName = name; requestedSharedFile.fileName = name;
requestedSharedFile.open(); requestedSharedFile.open();
} }
onRequestedSharedFileNotAvailable: { function onRequestedSharedFileNotAvailable()
{
} }
} }

View File

@ -33,7 +33,10 @@ Page {
Connections { Connections {
target: QtAndroidSignalStrength target: QtAndroidSignalStrength
onSignalLevelChanged: updateSignalLevel() function onSignalLevelChanged()
{
updateSignalLevel();
}
} }
Column { Column {