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. Problem using SVGs in a BorderImage on the N950
Forum Updated to NodeBB v4.3 + New Features

Problem using SVGs in a BorderImage on the N950

Scheduled Pinned Locked Moved QML and Qt Quick
8 Posts 3 Posters 3.5k 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.
  • H Offline
    H Offline
    h3nk3
    wrote on last edited by
    #1

    Hi,

    I've been using SVGs in my BorderImages on Symbian like this:

    @
    BorderImage {
    source: "border.svg"
    sourceSize: Qt.size(10, 10)
    width: 100
    height: sourceSize.height
    border {
    top: 1.5
    right: 1.5
    bottom: 1.5
    left: 1
    }
    }
    @

    This rasterizes the SVG in the size I want and then uses the borders to stretch the image the way I want. Works perfectly.

    Now when taking my project over to Harmattan Meego. Which is using QtQuick 1.1 if I'm not mistaken the log tells me that:
    @
    Invalid property assignment: "sourceSize" is a read-only property
    @

    Why has this changed? Is there some other way I'm supposed to use my SVGs with BorderImage that I'm not aware of?

    1 Reply Last reply
    0
    • T Offline
      T Offline
      thisisbhaskar
      wrote on last edited by
      #2

      Very strange as sourceSize is not a read-only property according to the documentation

      http://library.developer.nokia.com/topic/MeeGo_1.2_Harmattan_API/html/qt4/qdeclarativeelements.html

      1 Reply Last reply
      0
      • H Offline
        H Offline
        h3nk3
        wrote on last edited by
        #3

        Actually the documentation for Harmattan states this for the BorderImage element:

        @
        sourceSize : QSize

        This property holds the actual width and height of the loaded image.

        In BorderImage, this property is read-only.

        See also Image::sourceSize.
        @

        But my question is why has this changed from previous versions of QtQuick?

        It's not backwards compatible either (I cannot just write import QtQuick 1.0 and everything works as before).

        1 Reply Last reply
        0
        • T Offline
          T Offline
          thisisbhaskar
          wrote on last edited by
          #4

          [quote author="h3nk3" date="1311760656"]Actually the documentation for Harmattan states this for the BorderImage element:
          @
          sourceSize : QSize
          @
          [/quote]

          What is interesting is that for all read-only properties.. the documentation standard is something like this

          @
          sourceSize : QSize read-only
          @

          Its confusing to see that its not followed though-out.

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

            You could possibly look into using a "QDeclarativeImageProvider":http://doc.qt.nokia.com/4.7/qdeclarativeimageprovider.html to rasterize your SVGs to a given size that could then be scaled.

            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
            • H Offline
              H Offline
              h3nk3
              wrote on last edited by
              #6

              Yes that's actually what I've been doing today.

              But still wondering why this limitation was introduced though.

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

                I'm wondering (pure speculation) if it wasn't so much of a recent introduction that it's read-only but rather it might have been designed to be read-only from the beginning, but was mistakenly allowed to be modified on Symbian.

                I don't have the code or docs for both side-by-side at the moment, though. So, like I said, it's just a thought right now.

                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
                • H Offline
                  H Offline
                  h3nk3
                  wrote on last edited by
                  #8

                  Yeah, maybe that's true. Thanks for the replies!

                  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