×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Dec 2010
    Posts
    5

    Virtual Keyboard not working on Nokia N8

    Hi guys,

    Yes, I have searched this forum looking an answers and I found it.
    However, the provide solutions doesn't work.

    I am using Qt 4.6 on Nokia N8 and would like to invoke virtual keyboard when a QPushButton is clicked and get the text from VK
    and set it as text for the QPushButton.

    I am using off screen QLineEdit, setFocus and post request to show "RequestSoftwareInputPanel", but
    the keyboard is not being displayed.

    Thanks for any suggestions.

    Kacper

  2. #2
    Registered User
    Join Date
    May 2009
    Location
    Rome
    Posts
    268

    Re: Virtual Keyboard not working on Nokia N8

    that lines works for me on N8
    searchEdit->setFocus(Qt::OtherFocusReason);
    QApplication:ostEvent(searchEdit, new QEvent(QEvent::RequestSoftwareInputPanel));
    the problem is that still i m able to receive notification as text changes

    connect(searchEdit, SIGNAL(textChanged(const QString &)), this, SLOT(searchChangeEvent(const QString &)));

    void HeaderBar::searchChangeEvent(const QString &text){
    qDebug()<<text<<"change";
    }
    but not when the vk get closed as well
    Keep it simple, stupid
    borg - http://store.ovi.com/content/116105

  3. #3
    Registered User
    Join Date
    Dec 2010
    Posts
    5

    Re: Virtual Keyboard not working on Nokia N8

    Hi,

    Can you show me the code where you create QLineEdit?

    Kacper

  4. #4
    Registered User
    Join Date
    May 2009
    Location
    Rome
    Posts
    268

    Re: Virtual Keyboard not working on Nokia N8

    try change sendEvent to postEvent ,

    nothing special in QLineEdit creation....
    searchEdit = new QLineEdit(this);
    Keep it simple, stupid
    borg - http://store.ovi.com/content/116105

  5. #5
    Registered User
    Join Date
    Dec 2010
    Posts
    5

    Re: Virtual Keyboard not working on Nokia N8

    Hi,

    Changed to postEvent and still not keyboard is displayed.

  6. #6
    Registered User
    Join Date
    May 2009
    Location
    Rome
    Posts
    268

    Re: Virtual Keyboard not working on Nokia N8

    maybe a 1 pixel wide QLineEdit (your code) can not get focus ...i can not imagine something better to explain why it does not work for you , let's try ....

    or maybe something related to permissions....
    TARGET.CAPABILITY="Location NetworkServices ReadUserData WriteUserData LocalServices UserEnvironment "
    that is in my .pro

    here also is more code if you want to compare and spot the difference

    #include "headerbar.h"
    #include <QLabel>
    #include <QPainter>
    #include <QPushButton>
    #include <QLineEdit>
    #include <QApplication>

    #include <qmobilityglobal.h>

    #include <QValueSpaceSubscriber>

    QTM_USE_NAMESPACE
    HeaderBar*HeaderBar::headerbar=0;
    HeaderBar::HeaderBar(QWidget *parent) : QWidget(parent){
    headerbar=this;
    pattern.load(":/images/header.png");
    searchEdit = new QLineEdit(this);
    //searchEdit->hide();
    searchButton = new QPushButton(this);
    searchButton->setObjectName("greenButton");
    searchButton->setText(tr("CERCA"));
    //searchButton->hide();
    connect(searchButton, SIGNAL(clicked()), this, SLOT(search()),Qt::QueuedConnection);
    connect(searchEdit, SIGNAL(textChanged(const QString &)), this, SLOT(searchChangeEvent(const QString &)));
    //connect(searchEdit, SIGNAL(editingFinished()), this, SLOT(searchReturnEvent()));
    //QValueSpaceSubscriber* vkbState = new QValueSpaceSubscriber("/vkb/state", this);
    //QObject::connect(vkbState, SIGNAL(contentsChanged()), this, SLOT(searchReturnEvent()));
    }

    HeaderBar* HeaderBar::instance(){
    return headerbar;
    }

    int HeaderBar::height(){
    return headerbar ? headerbar->size().height():0;
    }

    void HeaderBar::search(){
    qDebug()<<"search";
    searchEdit->setFocus(Qt::OtherFocusReason);
    QApplication:ostEvent(searchEdit, new QEvent(QEvent::RequestSoftwareInputPanel));
    }

    void HeaderBar::searchChangeEvent(const QString &text){
    qDebug()<<text<<"change";
    }

    void HeaderBar::searchReturnEvent(){
    qDebug()<<searchEdit->text()<<"return";
    }

    void HeaderBar::resizeEvent(QResizeEvent *){
    int h=size().height();
    int w=size().width();
    int pad=5;
    int bh=h-(pad*2);
    int bw=70;
    int l=w-pad-bw;
    searchButton->setGeometry(l,pad,bw,bh);
    searchEdit->setGeometry(l,-100,bw,20);
    }
    Last edited by lucarocchi; 2011-01-03 at 18:08.
    Keep it simple, stupid
    borg - http://store.ovi.com/content/116105

Similar Threads

  1. virtual keyboard
    By mohamed shaheen in forum Symbian
    Replies: 0
    Last Post: 2009-12-13, 10:05
  2. Nokia 5800 virtual keyboard
    By eyalmnm in forum Mobile Java General
    Replies: 1
    Last Post: 2009-05-05, 13:52

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×