I have created qml/test.qml file as:
import QtQuick 1.0
Rectangle
{
id: pahe
width: 200; height: 50
color: "#55aaee"
TextInput
{
id: editor
anchors
{
left: parent.left; right: parent.right; leftMargin: 10; rightMargin: 10
verticalCenter: parent.verticalCenter
}
cursorVisible: true;
font.bold: true
color: "#151515";
selectionColor: "Green"
focus: true
}
}
and One qml/main.cpp file as:
#include <QApplication>
#include <QtDeclarative>
#include <QDeclarativeView>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QDeclarativeView view;
view.setSource(QUrl::fromLocalFile("test.qml"));
view.setResizeMode(QDeclarativeView::SizeRootObjectToView);
view.show();
return app.exec();
}
I am compiling this main.cpp file using commands like:
#qmake -project
#qmake
#make
and I am running the exe as:
./qml
So problem is that I am not able to see any text on TextInput even after entering text using key board. If i print the TextInput.text of element it shows entered text on console log but can not see on screen.
What could be the reason?
If i run same test.qml file using qmlviewer it works fine.
Any hint or comment in this would be helpful.
Thanks,
KBalar
The problem was with virtual Linux machine running on Windows PC. So If i run same example on Real Linux machine The problem wont be there.