[Interest] QQuickWidget and TextInput or TextField not working in Qt 5.3.0 RC

G√ľnter Michel gm at mes-ia.de
Wed May 14 17:08:35 CEST 2014


Hello

I try to port a program from using 'createWindowContainer' to the new 
QQuickWidget in Qt 5.3.0 RC

In this widget i have a simple Rectangle with a TextInput. The 
'TextInput' shows no cursor when clicked and doesn't respond to 
keystrokes. Also TextField from the desktop controls doesn't work.

What do i miss, or is this a bug?

import  QtQuick  2.1
import  QtQuick.Controls  1.1;
import  QtQuick.Layouts  1.0;
import  QtQuick.Controls.Styles  1.1

Rectangle  {
     width:  400
     height:  400
     color:  "beige"

     TextInput  {
         id:  mytext
         x:  40
         y:40
         width:  100
         height:50
         focus:  true
     }
}

MainWindow::MainWindow(QWidget  *parent)  :
     QMainWindow(parent),
     ui(new  Ui::MainWindow)
{
     ui->setupUi(this);

     QQuickWidget  *w  =  new  QQuickWidget();
     w->setResizeMode(QQuickWidget::SizeRootObjectToView);
     w->setFocusPolicy(Qt::ClickFocus);
     w->setSource(QUrl("qrc:/test.qml"));

     this->setCentralWidget(w);
     w->show();
}

The version with QQuickView and createWindowContainer work as expected.

Thanks for yout hints


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20140514/e01262a3/attachment.html>


More information about the Interest mailing list