mirror of
https://github.com/QuasarApp/QtAndroidTools.git
synced 2025-05-02 23:49:34 +00:00
Updated qml connection syntax
This commit is contained in:
parent
fab160274e
commit
3d69f5abca
@ -50,7 +50,7 @@ Q_DECLARE_METATYPE(QAndroidGoogleAccountInfo)
|
||||
|
||||
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_OBJECT
|
||||
|
||||
|
@ -57,7 +57,8 @@ Page {
|
||||
|
||||
Connections {
|
||||
target: QtAndroidApkExpansionFiles
|
||||
onDownloadStateChanged: {
|
||||
function onDownloadStateChanged(newState)
|
||||
{
|
||||
switch(newState)
|
||||
{
|
||||
case QtAndroidApkExpansionFiles.STATE_COMPLETED:
|
||||
@ -76,7 +77,8 @@ Page {
|
||||
}
|
||||
downloadStateLabel.text = QtAndroidApkExpansionFiles.getString(newState-1);
|
||||
}
|
||||
onDownloadProgress: {
|
||||
function onDownloadProgress(overallTotal, overallProgress, timeRemaining, currentSpeed)
|
||||
{
|
||||
var time = new Date(timeRemaining);
|
||||
downloadProgressBar.to = overallTotal;
|
||||
downloadProgressBar.value = overallProgress;
|
||||
|
@ -24,7 +24,8 @@ Page {
|
||||
|
||||
Connections {
|
||||
target: QtAndroidAppPermissions
|
||||
onRequestPermissionsResults: {
|
||||
function onRequestPermissionsResults(results)
|
||||
{
|
||||
for(var i = 0; i < results.length; i++)
|
||||
{
|
||||
if(results[i].granted === true)
|
||||
|
@ -10,16 +10,19 @@ Page {
|
||||
|
||||
Connections {
|
||||
target: QtAndroidGoogleAccount
|
||||
onSignedInAccountChanged: {
|
||||
QtAndroidTools.insertImage("AccountPhoto", QtAndroidGoogleAccount.signedInAccount.photo);
|
||||
function onSignedInAccountInfoChanged()
|
||||
{
|
||||
QtAndroidTools.insertImage("AccountPhoto", QtAndroidGoogleAccount.signedInAccountInfo.photo);
|
||||
accountPhoto.source = "image://QtAndroidTools/AccountPhoto";
|
||||
}
|
||||
onSignedIn: {
|
||||
function onSignedIn(signInSuccessfully)
|
||||
{
|
||||
if(signInSuccessfully === true)
|
||||
{
|
||||
}
|
||||
}
|
||||
onSignedOut: {
|
||||
function onSignedOut()
|
||||
{
|
||||
QtAndroidTools.removeImage("AccountPhoto");
|
||||
accountPhoto.source = "";
|
||||
}
|
||||
@ -33,27 +36,27 @@ Page {
|
||||
|
||||
Label {
|
||||
font.pixelSize: 15
|
||||
text: "<b>Id:</b> " + QtAndroidGoogleAccount.signedInAccount.id
|
||||
text: "<b>Id:</b> " + QtAndroidGoogleAccount.signedInAccountInfo.id
|
||||
}
|
||||
|
||||
Label {
|
||||
font.pixelSize: 15
|
||||
text: "<b>DisplayName:</b> " + QtAndroidGoogleAccount.signedInAccount.displayName
|
||||
text: "<b>DisplayName:</b> " + QtAndroidGoogleAccount.signedInAccountInfo.displayName
|
||||
}
|
||||
|
||||
Label {
|
||||
font.pixelSize: 15
|
||||
text: "<b>Email:</b> " + QtAndroidGoogleAccount.signedInAccount.email
|
||||
text: "<b>Email:</b> " + QtAndroidGoogleAccount.signedInAccountInfo.email
|
||||
}
|
||||
|
||||
Label {
|
||||
font.pixelSize: 15
|
||||
text: "<b>FamilyName:</b> " + QtAndroidGoogleAccount.signedInAccount.familyName
|
||||
text: "<b>FamilyName:</b> " + QtAndroidGoogleAccount.signedInAccountInfo.familyName
|
||||
}
|
||||
|
||||
Label {
|
||||
font.pixelSize: 15
|
||||
text: "<b>GivenName:</b> " + QtAndroidGoogleAccount.signedInAccount.givenName
|
||||
text: "<b>GivenName:</b> " + QtAndroidGoogleAccount.signedInAccountInfo.givenName
|
||||
}
|
||||
|
||||
Label {
|
||||
|
@ -10,7 +10,8 @@ Page {
|
||||
|
||||
Connections {
|
||||
target: QtAndroidGoogleDrive
|
||||
onDownloadProgressChanged: {
|
||||
function onDownloadProgressChanged(state, progress)
|
||||
{
|
||||
switch(state)
|
||||
{
|
||||
case QtAndroidGoogleDrive.STATE_MEDIA_IN_PROGRESS:
|
||||
@ -20,7 +21,8 @@ Page {
|
||||
break;
|
||||
}
|
||||
}
|
||||
onUploadProgressChanged: {
|
||||
function onUploadProgressChanged(state, progress)
|
||||
{
|
||||
switch(state)
|
||||
{
|
||||
case QtAndroidGoogleDrive.STATE_INITIATION_STARTED:
|
||||
|
@ -30,12 +30,14 @@ Page {
|
||||
|
||||
Connections {
|
||||
target: QtAndroidSharing
|
||||
onRequestedSharedFileReadyToSave: {
|
||||
function onRequestedSharedFileReadyToSave(mimeType, name, size)
|
||||
{
|
||||
requestedSharedFile.text = "Name: " + name + "\nSize: " + size + "\nMimeType: " + mimeType;
|
||||
requestedSharedFile.fileName = name;
|
||||
requestedSharedFile.open();
|
||||
}
|
||||
onRequestedSharedFileNotAvailable: {
|
||||
function onRequestedSharedFileNotAvailable()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,10 @@ Page {
|
||||
|
||||
Connections {
|
||||
target: QtAndroidSignalStrength
|
||||
onSignalLevelChanged: updateSignalLevel()
|
||||
function onSignalLevelChanged()
|
||||
{
|
||||
updateSignalLevel();
|
||||
}
|
||||
}
|
||||
|
||||
Column {
|
||||
|
Loading…
x
Reference in New Issue
Block a user