millionSec::millionSec() { // Obtain a QMLDocument and load it into the qml variable, using build patterns. QmlDocument *qml = QmlDocument::create("asset:///second.qml"); qml->setParent(this); NavigationPane *nav = qml->createRootObject<NavigationPane>(); // If the QML document is valid, we process it. if (!qml->hasErrors()) { // Create the application Page from QMLDocument. //Page *appPage = qml->createRootObject<Page>(); if (nav) { // Set the main scene for the application to the Page. Application::instance()->setScene(nav); DropDown *day = DropDown::create(); int date = day->selectedIndex(); DropDown *month = DropDown::create(); month->add(Option::create().text("Jan")); month->add(Option::create().text("Feb")); } } }
void App::handleInvokeButtonClick() { Button *button = dynamic_cast<Button*>(QObject::sender()); DropDown* qddAction = root->findChild<DropDown*>("qddAction"); QString action; if(qddAction->selectedIndex() != 5){ action = qddAction->at(qddAction->selectedIndex())->text(); } else{ action = root->findChild<QObject*>("qtaAction")->property("text").toString(); } QString mime = root->findChild<QObject*>("qtaMimeType")->property("text").toString(); QString uri = root->findChild<QObject*>("qtaURI")->property("text").toString(); QString data = root->findChild<QObject*>("qtaData")->property("text").toString(); QString target = button->text(); invoke(0, action, mime, uri, data, target); }