Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Help...Image on Qt for Symbian is not showing
Forum Updated to NodeBB v4.3 + New Features

Help...Image on Qt for Symbian is not showing

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.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.
  • M Offline
    M Offline
    MagicCoder
    wrote on last edited by
    #1

    Guys, please help...I wrote this code

    @

        TextField {
            id: txtInput
            x: 3
            y: 92
            anchors.left: parent.left
            anchors.leftMargin: 3
            anchors.bottom: parent.bottom
            anchors.bottomMargin: 498
            anchors.top: parent.top
            anchors.topMargin: 92
            anchors.right: parent.right
            anchors.rightMargin: -3
            maximumLength: 10
            readOnly: false
            platformLeftMargin: 3
    
            Image {
                     anchors { top: parent.top; right: parent.right; margins: platformStyle.paddingMedium }
                     id: clearText
                     fillMode: Image.PreserveAspectFit
                     smooth: true; visible: clearable.text
                     source: "image://MyResources/equal.png"  //problem
                     height: parent.height - platformStyle.paddingMedium * 2
                     width: parent.height - platformStyle.paddingMedium * 2
    
                     MouseArea {
                         id: clear
                         anchors { horizontalCenter: parent.horizontalCenter; verticalCenter: parent.verticalCenter }
                         height: clearable.height; width: clearable.height
                         onClicked: {
                             clearable.text = ""
                             clearable.forceActiveFocus()
                         }
                     }
                 }
    

    @

    I am having problem with using my image "clear_left.png" I added to my Resources "myResources"
    !Libraries\Pictures\qt.png(image)!

    and also "onClicked:{}" is not working :(

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mlong
      wrote on last edited by
      #2

      Your sample image isn't visible. Check the path.

      What is clearable and where is it defined? When you say onClicked isn't working, what is happening?

      Also, your source for your image is wrong for a resource. Is "myResources" the name of your resource file? Or is a prefix in the resource file?
      try:
      @
      source: ":/someoptionalprefixintheqrcfile/equal.png"
      @
      or
      @
      source: "qrc:/someoptionalprefixintheqrcfile/equal.png"
      @
      (assuming the resource file path has a prefix. Otherwise just ":/equal.png" or "qrc:/equal.png")

      (Brain to terminal. YMMV)

      Software Engineer
      My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        MagicCoder
        wrote on last edited by
        #3

        Thanks for your reply.
        I just tried both of your given options, it is not still working. The following are what I am using
        @source: "://equal.png"@

        resource name is "myResource"
        prefix is "/"
        And the "onClicked" should clear a TextField

        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