MenuDefinition
import bb.cascades 1.3 TabbedPane { showTabsOnActionBar: true Menu.definition: MenuDefinition { // Add a Help action helpAction: HelpActionItem { } } Tab { title: qsTr("Home") {
Hi guys I would like to enter in "helpaction" when you click on it, a page with a red background, is it possibile?
You can set the color of the container on the Page.
Tags: BlackBerry Developers
Similar Questions
-
Problem with MenuDefinition and sheet
I'm having a problem with the Menu and leaves, if I use the Menu to open the sheet of more than twice the leaf is not open and the Menu do not reappear. If I use the button on the page, it works as expected.
import bb.cascades 1.0 Page { Menu.definition: MenuDefinition { settingsAction: SettingsActionItem { onTriggered : { settingsSheet.open(); } } } attachedObjects: [ Sheet { id: settingsSheet content: Page { Button { text: "Close" onClicked: { settingsSheet.close() } } } } ] Container { layout: DockLayout {} Button { text: qsTr("Open") onClicked: settingsSheet.open(); } } }
To hear that it is a known problem that was corrected in the next update, I have also just heard is expected by Friday-ish (a firmware of the device and an SDK Update).
-
Unresolved inclusion <; cascades/bb/MenuDefinition >;
Goal: Create a menu low blow in C++ native instead of stunts.
Error: Unresolved inclusion
in #include Location:
When I check Includes/.../bb/cascades/controls/, not MenuDefinition.h in the path.
Question: How do I solve the problem?
or
Where do I add MenuDefinition.h and c?
Thank you for your attention,
In fact, you would look
#include
For example:
Menu *myAppMenu = Menu::create() .help(HelpActionItem::create().onTriggered(this, SLOT(menuHelpPage()))) .settings(SettingsActionItem::create().onTriggered(this, SLOT(menuSettingsPage()))); app->setMenu(myAppMenu);
-
While the investigation into the issue of images do not hit any fly/scrolling in a Webview (http://supportforums.blackberry.com/t5/Native-Development/Issue-With-Scrolling-Images-In-Webview/m-p...) I came across the question if a user buys my in-app purchase then removes the application and reinstall the in-app purchase did not work.
First of all, in-app purchase is to remove the ads - it does that very well, but when the application is removed and reinstalled ads appear once more and I don't want to force consumers to pay twice, so I really need to get this fixed number as it is preventing me to release an update of my application.
I'm working out of this example: http://supportforums.blackberry.com/t5/Native-Development/Sample-Removing-In-App-Ads/m-p/2783323/hig... and have used it to create buying app for my application.
Here's my source, my main.qml of my application file code:
import bb.cascades 1.0 import bb.platform 1.0 import com.sample.payment 1.0 TabbedPane { id: tabbedPane property variant payment Menu.definition: MenuDefinition { id: appMenu actions: [ ActionItem { title: "About" imageSource: "asset:///IMG/ic_info.png" onTriggered: { aboutSheet.open() } }, ActionItem { title: "Contact Us" imageSource: "asset:///IMG/ic_email.png" onTriggered: { emailInvocation.query.uri = "mailto:[email protected]?subject=Shopping For eBay App: Contact" emailInvocation.query.updateQuery(); } }, ActionItem { id: upgradeAction title: "Remove Ads" imageSource: "asset:///IMG/ic_clear_list.png" onTriggered: { if (tabbedPane.payment) { /* replace the values in quotes "" below with the values from * your vendor account for this application's add-on. */ payment.mPaymentControl.pid = "{REMOVED}" payment.mPaymentControl.sku = "{REMOVED}" payment.mPaymentControl.name = "Remove Ads" payment.mPaymentControl.metadata = "Purchasing this will remove the adverts!" payment.mPaymentControl.getPrice(payment.mPaymentControl.pid, payment.mPaymentControl.sku); payment.mPaymentControl.purchase(payment.mPaymentControl.pid, payment.mPaymentControl.sku, payment.mPaymentControl.name, payment.mPaymentControl.metadata) } } attachedObjects: [ // Definition to hold the PaymentControl so it is only created when neccesary ComponentDefinition { id: paymentdef Container { id: payContainer onCreationCompleted: { console.log("Payment Definition Created - Checking for Existing Purchases") paymentControl.getExisting(true); } property alias mPaymentControl: paymentControl attachedObjects: [ PaymentServiceControl { id: paymentControl property string pid property string sku property string name property string metadata // Play receipt animation on purchase response onPurchaseResponseSuccess: { cpp.saveValueFor("removedAds", "23"); root.removedAds = 23; console.log("purchaseResponse - " + receiptString) } onInfoResponseError: { console.log("Purchase Error - " + errorCode + " - " + errorText) } onExistingPurchasesResponseSuccess: { if (receiptsString == "(No purchases)") { console.log("existing unable to find receipt") } else { console.log("existing receiptString - " + receiptsString) cpp.saveValueFor("removedAds", "23"); root.removedAds = 23; } console.log("existingPurchaseResponse Success - " + receiptsString) } } ] } } ] }, ActionItem { title: "Share App" imageSource: "asset:///IMG/ic_share.png" onTriggered: { invokeShare.trigger("bb.action.SHARE") } }, ActionItem { title: "More Apps" imageSource: "asset:///IMG/ic_buy.png" onTriggered: { invokebb.trigger("bb.action.OPEN") } } ] attachedObjects: [ Sheet { id: aboutSheet About { } }, Invocation { id: invokeShare query { mimeType: "text/plain" data: qsTr("Get your shopping done easily on your #BlackBerry10 with 'Shopping For eBay'; check it out in @BlackBerry World: http://appworld.blackberry.com/webstore/content/35964888/") invokeActionId: "bb.action.SHARE" } }, Invocation { id: invokebb query { mimeType: "text/html" uri: "appworld://vendor/64825/" invokeActionId: "bb.action.OPEN" } }, Invocation { id: emailInvocation query.mimeType: "text/plain" query.invokeTargetId: "sys.pim.uib.email.hybridcomposer" query.invokeActionId: "bb.action.SENDEMAIL" onArmed: { emailInvocation.trigger(emailInvocation.query.invokeActionId); } } ] } showTabsOnActionBar: false Tab { title: qsTr("Home") + Retranslate.onLocaleOrLanguageChanged imageSource: "IMG/101.Home.png" NavigationPane { id: navigationPane0 Page { onCreationCompleted: { root.removedAds = parseInt(cpp.getValueFor("removedAds", "")) if (root.removedAds != 23) { tabbedPane.payment = paymentdef.createObject(navigationPane0); } else { console.log("Not Creating Payment Definition, User has Already Paid To Remove Ads") } } id: page1 //actionBar actions //Title bar Container { id: root property int removedAds onRemovedAdsChanged: { if (removedAds == 23) { myAds.visible = false myAds2.visible = false appMenu.removeAction(upgradeAction) } } Container { id: myAds horizontalAlignment: HorizontalAlignment.Center layout: StackLayout { } MyAds { horizontalAlignment: HorizontalAlignment.Center topPadding: 15.0 } } Container { layout: DockLayout { } // To enable scrolling in the WebView, it is put inside a ScrollView. ScrollView { id: scrollView scrollViewProperties.overScrollEffectMode: OverScrollEffectMode.None // We let the scroll view scroll in both x and y and enable zooming, // max and min content zoom property is set in the WebViews onMinContentScaleChanged // and onMaxContentScaleChanged signal handlers. scrollViewProperties { scrollMode: ScrollMode.Vertical pinchToZoomEnabled: true } //Webview } // ScrollView// A progress indicator that is used to show the loading status Container { bottomPadding: 25 horizontalAlignment: HorizontalAlignment.Center verticalAlignment: VerticalAlignment.Bottom ProgressIndicator { id: progressIndicator opacity: 0.0 } } } } // End of container } } } //End of first tab } //End of tabbedPane
Any help and advice in this regard would be greatly appricated.
Thanks in advance!
If you test using a sandbox past purchases account cannot be restored. Purchases made with a sandbox account did not get connected to the server, so if you try to restore (ex after you remove and then re - install the app even) then no purchase will be returned.
You can test your rollback logic with purchases in the same session of the app: open the app, make a purchase, try a restore, all this without closing the application.
The only other option would be to remove your account from the sandbox and try buying using real $$
-
Connection to the canal of BBM
Is there a way to connect directly to / open a channel of BBM?
I don't want the application to you subscribe to the channel, but just open BBM to the channel so that the user can see the channel and decide for themselves.
I know that I can open the url PIN, but it was through the web browser by using code c ++ for opening a URL.
I couldn't add it to the MenuDefinition, so I've added it to the Actions
InvokeActionItem { ActionBar.placement: ActionBarPlacement.OnBar query { invokeTargetId: "sys.bbm.channels.card.previewer" invokeActionId: "bb.action.OPENBBMCHANNEL" uri: "bbmc:C004DD717" } }
The only problem with this is that it opens the BBM channel on top of the application.
-
Structure of good app to make high-level navpane on pane tabs?
What is the structure of the correct application for objectives menu navigation, slide-top like for example 'settings' and 'About' pop on top an application with a tabbed pane as its structure of high level, in a navpane - like fashion?
See for example the menu of top-parameters for the BB10 calendar application. At the top of the structure nav app we have tabs views for the month, day, week, agenda, etc., but no matter what the tab showing, we are on, settings page invoked since the application slide-top menu appears on top of the active tab.
When I try to place a TabbedPane inside a NavigationPane, QML editor gives the error message:
"'FirstPage' default property value type mismatch. Waiting for Page and found TabbedPane. »
I guess I could put a navpane within each tab, but first of all, it's bad code factoring for slide-top action menu (it should be set in one place), and secondly, it would require me to determine the active tab in the menu slide-top manager and push the target page navigation - from the active tab calculated.
Conceptually, I'm trying to do something like this:
import bb.cascades 1.3 NavigationPane { id: navigationPane attachedObjects: [ ComponentDefinition { id: infoPageDefinition source: "asset:///infoPage.qml" } ] Menu.definition: MenuDefinition { actions: [ ActionItem { title: "Info" imageSource: "asset:///images/ic_info.png" onTriggered: { var infoPage = infoPageDefinition.createObject(); navigationPane.push(infoPage); } } ] } TabbedPane { tabs: [ Tab { // Tab 1 stuff }, Tab { // Tab 2 stuff } ] } onPopTransitionEnded: { // Destroy the popped Page once the back transition has ended. page.destroy(); } }
in order to have a similar structure to the calendar app nav app.
You don't need to have the specific content of the tab inside the tab itself. You can use a NavigationPane + Page with tab specific containers, move that visible on the signal of onTrigger tab. Then, you can push everything you need on top of the NavigationPane.
-
Beginner question - sheet opens only once when opened via the app bar
I have a spreadsheet component very simply defined in my main.qml like that
{Sheet
ID: mainPageSheet
content: Page {}
Button {}
text: "close map".
onClicked: {mainPageSheet.close ()}
}
}
}I open app bar using settingsActionItem
Menu.Definition: MenuDefinition {}
settingsAction: {SettingsActionItem}
Title: qsTr ("Settings")
onTriggered: {}
mainPageSheet.setContent (settingsSheetComp.createObject ());
mainPageSheet.open)
}
}}
Now my problem is that it doesn't open that only once, the next time he shows nothing and gesture swipe to lower the bar of application stops responding also. because I do not have much that I am little confused what wrong here
I use the Simulator on SDK Gold
The Simulator today update fixed
-
How to create the application menu?
Hello
I want to add to the settings page for my application.
I created the application menu in the Navigation pane.
See my coding:
NavigationPane { id: navigationPane Page { id: mainpage Menu.definition: MenuDefinition { actions: [ ActionItem { title: "Action" imageSource: "asset:///images/setting.png" onTriggered: { navigationPane.push(settings.createObject()) } attachedObjects: [ ComponentDefinition { id: settings source: "setting.qml" } ] } ActionItem { title: "help" imageSource: "asset:///images/help.png" } ] } titleBar: TitleBar { title: "Main Bar" } } }
and on settings.qml
Page { id: settings titleBar: TitleBar { title: "Settings" } Container { background: Color.Yellow Label { text: "Want [Dark or White] theme selet below" } DropDown { title: "Select Theme" Option { text: "Dark" onSelectedChanged: { if (Application.themeSupport.theme.colorTheme.style == VisualStyle.Bright) { Application.themeSupport.setVisualStyle(VisualStyle.Dark); } else { Application.themeSupport.setVisualStyle(VisualStyle.Bright); } } } Option { text: "white" selected: true onSelectedChanged: { if (Application.themeSupport.theme.colorTheme.style == VisualStyle.Bright) { Application.themeSupport.setVisualStyle(VisualStyle.Dark); } } } } } }
and I see not the menu look at this picture
now, I want the solution please can someone help.
-shaishad
the definition of menu on the navigationpane
-
How to display the menu?
After I added the definition of menu, everything I used the screen with the menu, the menu may not shown. Can someone get me noticed? Thank you.
TabbedPane { Menu.definition: MenuDefinition { // Specify the actions that should be included in the menu actions: [ ActionItem { title: "Action 1" onTriggered: { console.log("Menu - Action1Triggered()") } }, ActionItem { title: "Action 2" onTriggered: { console.log("Menu - Action2Triggered()") } }, ActionItem { title: "Action 3" onTriggered: { console.log("Menu - Action3Triggered()") } } ] // end of actions list } ...
or
NavigationPane { id: nav Menu.definition: MenuDefinition { // Specify the actions that should be included in the menu actions: [ ActionItem { title: "Action 1" // imageSource: "" onTriggered: { console.log("Menu - Action1Triggered()") } }, ActionItem { title: "Action 2" // imageSource: "" onTriggered: { console.log("Menu - Action2Triggered()") } }, ActionItem { title: "Action 3" onTriggered: { console.log("Menu - Action3Triggered()") } } ] // end of actions list }
Your code is fine. Just slide down from the top of the screen to display the Menu.
-
Make a tab of the ActionItem Menu TabbedPane
Hello! I'm creating an application with three tabs. I want the fourth tab at ActionItem Menu which will stocks based on which tab user is in. Is there a way I can code it. My current code is given below
import bb.cascades 1.2
TabbedPane {}
showTabsOnActionBar: true
First tab
Tab {}
{Page}
{Of container
topPadding: 30.0
leftPadding: 20.0
rightPadding: 20.0
TextField {}
onTextChanging: {}
}
}
TextArea {}
}
}
}
}
End of the first tab
Second tab
Tab {}
{Page}
{Of container
}
}
}
End of the second tab
Third tab
Tab {}
{Page}
{Of container
}
}
}
End of the third tab
/ * Fourth tab * /.
Tab {}
Title: "Action Menu".
imageSource: "asset:///icons/ic_overflow_action.png."
{Page}
Menu.Definition: MenuDefinition {}
settingsAction: {SettingsActionItem}
onTriggered: {}
}
actions:]
{ActionItem}
ID: action1
Title: "myActionTitle".
ActionBar.placement: ActionBarPlacement.OnBar
}
]
}
}
}
/ * End of fourth tab * /.
}
Got the answer. So instead of having the fourth tab, I have stock in the tab page... The code will be
import bb.cascades 1.2
TabbedPane {}
showTabsOnActionBar: true
First tab
Tab {}
{Page}
actions:]
{ActionItem}
Title: "Action 1".
ActionBar.placement: ActionBarPlacement.OnBar
onTriggered: {}
MyLabel.set_Text = "Selected 1 Action!"
}
},
{ActionItem}
Title: 'Action 2 '.
ActionBar.placement: ActionBarPlacement.OnBar
onTriggered: {}
MyLabel.set_Text = "Action selected 2!"
}
}
]
{Of container
topPadding: 30.0
leftPadding: 20.0
rightPadding: 20.0
TextField {}
onTextChanging: {}
}
}
TextArea {}
}
}
}
}
End of the first tab
Second tab
Tab {}
{Page}
{Of container
}
}
}
End of the second tab
Third tab
Tab {}
{Page}
{Of container
}
}
}
End of the third tab
}
-
In the root of TabbedPane NavigationPane
Hi all
I have a TabbedPane and then a menu with a SettingsActionItem. When this settings button fires I want to push a page that contains the parameters to this subject, and then I can click back to return to tabs.
import bb.cascades 1.0 TabbedPane { Menu.definition: MenuDefinition { settingsAction: SettingsActionItem { onTriggered: { var page = setingsView.createObject(); navigationPane.push(page); } attachedObjects: ComponentDefinition { id: settingsView source: "SettingsView.qml" } } } Tab { tite: "Tab1" NavigationPane { id: navigationPane Page { //etc..... } } }}
However, the problem is that there is no navigation pane to push the new page. We cannot put a NavigationPane under the TabbedPane, but we can put it in a tab of a TabbedPane.
So, how can I go all by pushing a new page?
Thank you!
[UPDATED ABOVE CODE]
I got it work using files separated such as:
hand. QML
TabbedPane { id: newsPane Tab{ title: "" TabOne { } } Tab{ title: "" TabTwo { } } Tab{ title: "" TabThree { } } Tab{ title: "" TabFour { } } }
Then, he...
TabOne.qml, TabTwo.qml, TabThree.qml and TabFour.qml:
NavigationPane { Page { .... } }
And it has an a NavigationPane feel TabbedPane when I can push to a page within the NavigationPane and action bar has more tabs, rather it changes the back button. Can be illustrated in this app: http://appworld.blackberry.com/webstore/content/20197455/?lang=en (I wrote the application for OnlineTobago)
So as much as your page 'Settings', why not use a spreadsheet? This is exactly what a spreadsheet is intended, something that breaks the normal flow of navigation. And it can be accessed via the system menu of any tab, if defined in the main.qml and using the property alias you can control the id defined in TabOne.qml, TabTwo.qml, etc. I have a sample where I do it too: http://bbcascades.com/index.php/tutorial-list/50-persistence-of-cascades-memory
I hope this helps.
-
Plug as a defintion of component
Hello
I created the application menus in my application under the root TabbedPane. Follow-up of the online documentation.
I realized that I need to create a spreadsheet and cannot create a Page. Which is very good. I expected a back-button-esque page.
For NavPanes, I know we can create Pages as a definition of the element, so they can be loaded only when necessary. I can't do the same for the leaves. It is a known limit?
I did the following, but it does not work:
mainTabPane.qml
TabbedPane { id: mainTabPage Menu.definition: MenuDefinition { actions: [ ActionItem { title: "About" onTriggered: { aboutSheetDefinition.open(); } } ] } // end of Menu defintion attachedObjects: [ ComponentDefinition { id: aboutSheetDefinition source: "about.qml" } ] Tab { ... } }
And then in the about.qml
import bb.cascades 1.0 Sheet { id: aboutSheet content: Page { id: aboutPage Container { Label { text: "This is the ABOUT page" } } } }
However, if I do the following, it works. But I want it to work the way I showed you above-^ ^ ^ (mainTabPane.qml)
TabbedPane { id: mainTabPage // Application Menu Menu.definition: MenuDefinition { actions: [ ActionItem { title: "About" onTriggered: { aboutSheet.open(); } } ] } // end of Menu defintion attachedObjects: [ Sheet { id: aboutSheet content: Page { id: aboutPage Container { Label { text: "This is the ABOUT page" } } } } ] Tab { ... } }
Never mind. Found my solution.
In onTriggered of the ActionItem, must do the following, that is to create the object variable aboutSheet, and THEN open it.
onTriggered: { var aboutSheet = aboutSheetDefinition.createObject(); aboutSheet.open(); }
The object attached, remains the same.
attachedObjects: [ ComponentDefinition { id: aboutSheetDefinition source: "about.qml" } ]
-
How to stop pushing him to a QML Page when already in this Page
Hello
Main.qml I have the following question of action menu that displays SettingsPage.qml.
hand. QML:
NavigationPane { id: nav ... Menu.definition: MenuDefinition { actions: [ ... ActionItem { title: "Settings" onTriggered: { console.log("entering settings page"); var settingsPage = settingspagedef.createObject(); Qt.nav.push(settingsPage); } }, ... ] // end of actions list } // end of MenuDefinition .... Page { .... }
And the SettingsPage.qml is a QML file that contains only the item page (and not in a NavigationPane). Thus, in settings page, another page of settings is pushed on top of the current page of settings when you click the action item "Settings." How can I prevent pushing to SettingsPage.qml one another when there is already a settings page? Thanks in advance.
I prefer to remove the knob to Settngs completely rather than turn it off when I do not want my user to have access to it. My application says the menu of application as follows:
MenuDefinition { id: appMenu settingsAction: _settingsAction helpAction: _helpAction attachedObjects: [ SettingsActionItem { id: _settingsAction onTriggered: { } }, HelpActionItem { id: _helpAction onTriggered: { } } ] actions: [ ] function restoreSettingsAction() { settingsAction = _settingsAction; } function restoreHelpAction() { helpAction = _helpAction; } }
Now of QML, you can do this:
// ---Remove the application menu Settings button appMenu.settingsAction = null; // ---Restore the application menu Settings button appMenu.restoreSettingsAction();
... and you can do the same thing with the help button if you wish. Note that if you have any other button in your menu of the application they will probably move in the menu if you delete/restore buttons settings or help.
burakk wrote:
Yes, I mean the menu of the Application.
Your code turns off the entire menu. What happens if I don't only want the settings menu option? I guess I have to disable the part of the action of the main.qml. Is there another way to achieve the QML (main.qml) other action element other than Qt object implementation?
onCreationCompleted: {}
QT.nav = nav;
Qt.catList = categoriesList;}
-
How to send data from c ++ to qml to an another qml.
Hello
I'm quite confused about a simple problem, I'm sure. Let me put some of my code and then I'll ask my question
hand. QML
// Default empty project template import bb.cascades 1.0 import bb.data 1.0 // creates one page with a label TabbedPane { Menu.definition: MenuDefinition { actions: [ ActionItem { title: "Refresh" } ] } showTabsOnActionBar: true Tab { title: qsTr("Employee") NavigationPane { id: everyonePane Page { id: everyoneFeed ListView { objectName: "FeedView" id: FeedView layout: StackListLayout { headerMode: ListHeaderMode.Sticky } listItemComponents: [ ListItemComponent { type: "item" DetailFeed { } } ] } } attachedObjects: [ ActivityIndicator { objectName: "indicator" verticalAlignment: VerticalAlignment.Center horizontalAlignment: HorizontalAlignment.Center preferredHeight: 200 preferredWidth: 200 } ] onCreationCompleted: { } } } Tab { title: qsTr("TimeSheet") Page { } } Tab { title: qsTr("Calendar") Page { } } }
detailView
import bb.cascades 1.0 Container { layout: StackLayout { orientation: LayoutOrientation.TopToBottom // this line stacks everything below } bottomPadding: 20 Container { // single row id: row1 // individual row container layout: DockLayout { } preferredWidth: maxWidth Container { // container for image preferredWidth: 150 //size of image if known preferredHeight: 150 topPadding: 10 leftPadding: 20 horizontalAlignment: HorizontalAlignment.Left verticalAlignment: VerticalAlignment.Center ImageView { preferredWidth: 150 //size of image if known preferredHeight: 150 imageSource: "asset:///images/person.jpg" // some image } } // stack labels Container { // container for labels horizontalAlignment: HorizontalAlignment.Left // align this container to the left translationX: 200 verticalAlignment: VerticalAlignment.Center layout: StackLayout { orientation: LayoutOrientation.TopToBottom // this stacks the labels } Label { objectName: "firstname" text: "first label" } Label { text: "second label" } } } Divider { } }
Employee.cpp
// Default empty project template #include "Employee.hpp" #include
#include #include #include #include #include #include #include using namespace bb::cascades; QString mQueryUri; Employee::Employee(bb::cascades::Application *app) : QObject(app) { // create scene document from main.qml asset // set parent to created document to ensure it exists for the whole application lifetime mQml = QmlDocument::create("asset:///main.qml").parent(this); // create root object for the UI mRoot = mQml->createRootObject (); // Retrieving my activity indicator //mActivityIndicator = mRoot->findChild ("indicator"); //mActivityIndicator->start(); // Retrieving my list from QML mListView = mRoot->findChild ("dribbbleFeedView"); GetFeed("everyone"); // set created root object as a scene app->setScene(mRoot); } void Employee::GetFeed(QString feedType) { // First off we initialize our NetworkManager QNetworkAccessManager* netManager = new QNetworkAccessManager(); if (!netManager) { qDebug() << "Unable to create QNetworkAccessManager!"; emit complete("Unable to create QNetworkAccessManager!", false); return; } // First off we initialize our NetworkManager netManager = new QNetworkAccessManager(); if (!netManager) { qDebug() << "Unable to create QNetworkAccessManager!"; emit complete("Unable to create QNetworkAccessManager!", false); return; } mQueryUri = "http://mycompany" + feedType; // We setup our url QUrl url(mQueryUri); QNetworkRequest req(url); // Setup the reply and connect to the reply function QNetworkReply* ipReply = netManager->get(req); connect(ipReply, SIGNAL(finished()), this, SLOT(onReply())); } void Employee::onReply() { QNetworkReply* reply = qobject_cast (sender()); QString response; bool success = false; if (reply) { if (reply->error() == QNetworkReply::NoError) { int available = reply->bytesAvailable(); if (available > 0) { int bufSize = sizeof(char) * available + sizeof(char); QByteArray buffer(bufSize, 0); int read = reply->read(buffer.data(), available); response = QString(buffer); success = true; Q_UNUSED(read); } } else { response = QString("Error: ") + reply->errorString() + QString(" status:") + reply->attribute( QNetworkRequest::HttpStatusCodeAttribute).toString(); qDebug() << response; } reply->deleteLater(); } if (response.trimmed().isEmpty()) { response = "Request failed. Check internet connection"; qDebug() << response; } bb::cascades::GroupDataModel* dm = new bb::cascades::GroupDataModel( QStringList() << "id"); dm->setGrouping(bb::cascades::ItemGrouping::None); // parse the json response with JsonDataAccess bb::data::JsonDataAccess ja; QVariant jsonva = ja.loadFromBuffer(response); QVariantList feed = jsonva.toMap()["employee"].toList(); QVariantMap player; foreach (QVariant v, feed) { QVariantMap feedData = v.toMap(); dm->insert(feedData); } mListView->setDataModel(dm); mListView->setVisible(true); } OK so here is my question. I load a listview, in my hand, calling another qml, detailview. Given that my PPC is load my json file how can I send what I receive in my datamodel in my detailfeed can I change we tell the label with objectName: "firstname" to change the text for datamodel.name?
Hope I am clear enough.
Thank you
I think that you can access ListItemData in detailView.qml. Say ListItemData.id.
Why do you add only a mapping in groupdata. I think you need to add all the necessary fields such as firstname and so on. Right?
bb::cascades::GroupDataModel* dm = new bb::cascades::GroupDataModel( QStringList() << "id");
-
navigationPane, application menu problem
Hello
I'm trying to add a topic page to my application. The only thing is that when I write the code that I think that what is good, it won't.
Here is the code:
import bb.cascades 1.0 import bb.data 1.0 NavigationPane { id: navPane Menu.definition: MenuDefinition { actions: [ ActionItem { title: "About" imageSource: "images/ic_info.png" onTriggered: { navPane.push(infoDS.createObject()) } } ] }
... later on in attachedObjects:
ComponentDefinition { id: infoDS source: "aboutDutchscene.qml" }
When I remove these codes that the app works fine, when I have this code the application will load only the splash screen.
Anyone who is familiar with that? I'm hoping to find a solution!
Thanks in advance for your help,
Stanley
You try to put a NavigationPane in a NavigationPane. It does not work.
Your main.qml page takes the NavigationPane and your first information Page.
NavigationPane { id: mainNavPane Page { id:mainPage Container { // Info page components } actions: [ ActionItem { id: aiAboutButton imageSource: "asset:///images/ic_info.png" title:"About" onTriggered: { navPane.push(infoDS.createObject()); } attachedObjects: [ ComponentDefinition { id: infoDS AboutDutchscene { } } ] } ] } onPopTransitionEnded: { // Destroy the popped Page once the back transition has ended. page.destroy(); } }
Then push page should just be a Page
Page { id:aboutDutchscenePage Container { layout: DockLayout {} ImageView { horizontalAlignment: HorizontalAlignment.Fill verticalAlignment: VerticalAlignment.Fill imageSource: "asset:///images/background.png" } Container { horizontalAlignment: HorizontalAlignment.Fill verticalAlignment: VerticalAlignment.Fill Container { horizontalAlignment: HorizontalAlignment.Center layout: DockLayout {} ImageView { horizontalAlignment: HorizontalAlignment.Fill verticalAlignment: VerticalAlignment.Fill imageSource: "asset:///images/header_background.png" } Label { horizontalAlignment: HorizontalAlignment.Center text: qsTr ("About") textStyle.base: SystemDefaults.TextStyles.BigText textStyle.color: Color.create("#bb0099CC") } } } } }
You can probably push a NavigationPane in a NavigationPane, but you must first a Page, and then click a container to push in.
Maybe you are looking for
-
I uninstalled Java from my pc but still nags to Mozilla. How to stop them?
Java is completely uninstalled from my computer. I can't completely remove the plugin to add it to the page. It is disabled. I don't have the option in Firefox to remove 15. It is "gray". How can I block these horrible nag messages coming from Mozill
-
I can't get my Satellite L70C - 13 c, connected to the internet.
I can not connect to Internet on my Toshiba brand new. There are three likely causes:(1) on my BT Home hub (modem-router) settings are wrong.(2) on my Toshiba drivers must be updated, in particular the VPN software supported.(3) it is a matter of Mic
-
before trigger with four cards PXI-6115
Hello I have a PXI-1010 chassis with four cards PXI-6115, labeled boards 3, 4, 5, 6, installed in it. Each of these cards has 4 analog inputs (BNC inputs). In my current system, all four boards fire off the coast of the entrance on first 3 analog.
-
graphical representation of the partial circles
Hello I create a vi that graphic a circle for a while, so, like pi/3 to 2pi. I use the sin and cos function. How would I graph these partial circles? Thank you CHOD
-
y at - it a code of universal key for windows xp professional?
I have the disc for my drive of windows xp professional, but I can't find the key code to install it on my computer. is there such thing as a universal code that could be used?