June 8, 2012

luke_dirtwalker luke_dirtwal..
Lab Rat
7 posts

QML Textfield & Virtual Keyboard & PageStack on Meego Harmattan

 

Hello I’m currently designing my app. I encountered a problem with TextField Element.
In the main page i have a TextField which is used to come to another page for the actual input (need space for completion suggestions)

  1.             TextField
  2.             {
  3.                 id : origin
  4.                 onActiveFocusChanged: {
  5.                     if(focus){
  6.                         var page = Qt.createComponent("SearchPage.qml")
  7.                         if(page.status == Component.Ready)
  8.                             pageStack.push(page,{title:qsTr("Origin"),already: origin.text});
  9.                     }
  10.                 }
  11.             }

The SearchPage roughly looks like this:

  1. Page{
  2.     id: searchPage
  3.  
  4.     property alias title: searchTitleBar.text
  5.     property alias already: searchField.text
  6.  
  7.     tools: searchTools
  8.  
  9.     TitleBar{
  10.         id: searchTitleBar
  11.     }
  12.  
  13.         TextField{
  14.             id: searchField
  15.             anchors.top: searchTitleBar.bottom
  16.             anchors.margins: 10
  17.             focus: true
  18.         }
  19.  
  20.  
  21.     ToolBarLayout{
  22.         id: searchTools
  23.         ToolIcon { iconId: "icon-m-toolbar-back"; onClicked: pageStack.pop(); }
  24.     }
  25. }

if I come to the SearchPage the VirtualKeyboard opens for a very short moment then disappears.
On the other hand i could leave away the focus:true but then i can’t properly pop() the page. (means it scrambles up the mainpage)

Can anyone give me a hint what to do to fix this issue?

0 replies

 
  ‹‹ How can I changed the default icon of desktop in symbian      QML signals/slots: can’t pass QObject* to slot ››

You must log in to post a reply. Not a member yet? Register here!