Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. [Moved] not able to see text on TextInput element of QML
Forum Updated to NodeBB v4.3 + New Features

[Moved] not able to see text on TextInput element of QML

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 2.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kbalar
    wrote on last edited by
    #1

    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&#40;"test.qml"&#41;&#41;;
    
    view.setResizeMode(QDeclarativeView::SizeRootObjectToView&#41;;
    
    view.show();
    return app.exec(&#41;;
    

    }
    @
    I am using qt-everywhere-opensource-src-4.7.2.tar.gz for qt source.
    I have configure and compileQT using command
    @
    ./configure -webkit -no-openssl -script -scripttools -declarative -prefix /usr/local/Trolltech/Qt-4.7.2
    make
    make install
    @
    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 cursor any text on TextInput element 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?
    I have tried different combination of font color and back grounds also but not useful.
    If i run same test.qml file using qmlviewer it works fine able to see text.
    Any hint or comment in this would be helpful.

    Thanks,
    KBalar

    Moved to Quick forum due to none-India specific content & language, more chance of a good answer here; Andre

    1 Reply Last reply
    0
    • C Offline
      C Offline
      CaCO3
      wrote on last edited by
      #2

      I had a similar problem with a TextField: It didn't get shown.
      I could solve it by defining its size:
      @width: parent.width
      height: 50@

      Maybe that helps you as well?

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kbalar
        wrote on last edited by
        #3

        In this case Defining size is not solving the problem :(

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved