10-15-2012 11:33 PM
I'm trying to capture the event when the orientation changes. But it seems the onOrientationAboutToChange signal does not exist in OrientationHandler.
The documentation provides an example that uses onOrientationAboutToChange.
https://developer.blackberry.com/cascades/referenc
But the document says "Only has inherited QML signals". It does not list onOrientationAboutToChange as a signal.
I'm using SDK 10.0.9.386 and the qml editor says Unknown signal when I try to attach an OrientationHandler..
Is OrientationHandler completely implemented??
10-16-2012 12:01 AM
i haven't tried it but this may help (copied from the beta3 migration document):
The signals, uiOrientationChanging() and uiOrientationChanged(), which were previously in OrientationHandler, have moved to the OrientationSupport class and changed names. The uiOrientationChanging() signal is now orientationAboutToChange(), and theuiOrientationChanged() signal is now orientationChanged().
10-16-2012 10:38 PM
Worked thanks.
10-23-2012 08:52 PM
I also have this issue.
I tried what you mentioned here but didn't work.
Please help
10-24-2012 03:21 AM
Tested: even though it still have "Unknow signal", the app run OK.
I think this is the IDE bug.
11-02-2012 10:32 AM
So, are you using something like the following?
Page {
Container {
onCreationCompleted: {
console.log("Created")
OrientationSupport.supportedDisplayOrientation = SupportedDisplayOrientation.All;
}
attachedObjects: [
OrientationSupport {
onOrientationChanged: {
console.log("Testing orientation");
}
}
]
}
}
This doesn't work for me. I am attaching this page to a sheet, if that makes any difference. I've tried many combinations including using OrientationHandler and orientationChanged.
11-02-2012 10:40 AM
it should work this way:
attachedObjects: [
// application supports changing the Orientation
OrientationHandler {
onOrientationAboutToChange: {
if (orientation == UIOrientation.Landscape) {
itemBackground.preferredWidth = 1280
highlightContainer.preferredWidth = 1272
} else {
itemBackground.preferredWidth = 768
highlightContainer.preferredWidth = 760
}
}
}
]
if your controls hav set the protrait values as default,
don't forget to test if the Page was opened in Landscape:
onCreationCompleted: {
// set to Landscape if aklready in landscape while staring up
if (OrientationSupport.orientation == UIOrientation.Landscape) {
itemBackground.preferredWidth = 1280
highlightContainer.preferredWidth = 1272
}
}
and of course your bar-descriptor.xml must have set Auto-Orientation
and your main.qml must set:
OrientationSupport.supportedDisplayOrientation = SupportedDisplayOrientation.All;
you'll find all of this in my OpenDataSpace OSS App at github.
11-02-2012 10:53 AM
11-02-2012 10:58 AM
bit-brad wrote:
Ah awesome, thanks for the quick reply. I was missing the bar-descriptor property too. I also see that the IDE reports an unknown signal.
this is already reported by me some time ago:
https://www.blackberry.com/jira/browse/BBTEN-310
and will be fixed in next versions
12-10-2012 02:03 PM
I have followed the above code and even the sample app and yet my app won't receive the orientation changes.
Is there something that I have missed?