Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Developer
Posts: 324
Registered: ‎03-10-2010
My Device: Bold 9780, DevAlpha
My Carrier: Vodafone CZ
Accepted Solution

Application menu unavailable twice after Sheet closed

void MyApp::feedbackTriggered() {
	Sheet *s = Application::instance()->scene()->findChild<Sheet*>(
			"menuUserSheet");
	if (s) {
		qDebug() << "feedback triggered and Feedback Sheet found";
		s->open();
	} else {
		qDebug() << "feedback triggered, but no Feedback Sheet found";
	}
}

It works only once. When i'm trying to open at second time - ApplicationMenu crashed and no available anymore to use. What is a problem? 

Developer
Posts: 1,749
Registered: ‎04-08-2010
My Device: Passport Silver, PRIV
My Carrier: Telekom.de, O2, Vodafone

Re: Application menu unavailable twice after Sheet closed

this is a know bug from Beta4 and Gold

 

but I got info that its fixed in the meantime and will work with next OS Update

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development native Mobile Business Apps
BlackBerry 10 | Qt Mobile (Android, iOS)
Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org
mobile-development: http://appbus.org Twitter: @ekkescorner
Developer
Posts: 324
Registered: ‎03-10-2010
My Device: Bold 9780, DevAlpha
My Carrier: Vodafone CZ

Re: Application menu unavailable twice after Sheet closed

Thanks! I've lost about hour to find 'where i'm wrong' Smiley Sad

Developer
Posts: 1,524
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

Re: Application menu unavailable twice after Sheet closed

Hi! Recreate the Sheet before showing it as a workaround.

 


Andrey Fidrya, @zmeyc on twitter
Developer
Posts: 324
Registered: ‎03-10-2010
My Device: Bold 9780, DevAlpha
My Carrier: Vodafone CZ

Re: Application menu unavailable twice after Sheet closed

Can you post the sample code?

Developer
Posts: 1,524
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

Re: Application menu unavailable twice after Sheet closed

[ Edited ]

I do this in C++:

	Sheet *sheet = Sheet::create()
			.content(new SettingsPage);
	QObject::connect(sheet, SIGNAL(closed()), sheet, SLOT(deleteLater()));
	sheet->open();

 


Andrey Fidrya, @zmeyc on twitter
Developer
Posts: 324
Registered: ‎03-10-2010
My Device: Bold 9780, DevAlpha
My Carrier: Vodafone CZ

Re: Application menu unavailable twice after Sheet closed

Great... but how to do this in QML?

Developer
Posts: 324
Registered: ‎03-10-2010
My Device: Bold 9780, DevAlpha
My Carrier: Vodafone CZ

Re: Application menu unavailable twice after Sheet closed

var sheet = sheetObj.createObject();
sheetObj.getContent().signalfunc.connect(...)

 ?

Developer
Posts: 1,524
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

Re: Application menu unavailable twice after Sheet closed

I think it's not possible with QML only. Call the C++ function from QML:

 

1) Set QML context to point to your class:

QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);
...
qml->setContextProperty("myClass",this);

2) Declare the function in header file as Q_INVOKABLE:

 

 Q_INVOKABLE void showSettings();

 3) Call it from QML:

myClass.showSettings();

 

 

 

 

 

 


Andrey Fidrya, @zmeyc on twitter
Highlighted
Developer
Posts: 293
Registered: ‎10-15-2012
My Device: bb10 developer
My Carrier: Orange

Re: Application menu unavailable twice after Sheet closed

It is possible with QML

 

Put the Sheet as ComponentDefinition and then use createObject in QML to create the sheet