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. QtQuick antialiasing

QtQuick antialiasing

Scheduled Pinned Locked Moved QML and Qt Quick
8 Posts 4 Posters 9.2k Views
  • 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.
  • D Offline
    D Offline
    danilo2
    wrote on last edited by
    #1

    Hi!
    I'm new to qtquick 2.0 and I'm playing with some examples.
    Lets look into the example shipped with qt - how to draw bezeir curve. The curve is drawnm but it is not antialiased.

    Is it possible (if yes, how?) to antialias thinks drawn with qtquick?

    1 Reply Last reply
    0
    • D Offline
      D Offline
      danilo2
      wrote on last edited by
      #2

      Hi!
      I've found the solution.
      In the shipped example QSurfaceFormat is not used. If you use it like this:
      @
      QQuickView view;
      QSurfaceFormat format;
      format.setSamples(16);
      view.setFormat(format);
      ...@

      The picture is antialiased

      1 Reply Last reply
      0
      • J Offline
        J Offline
        Jens
        wrote on last edited by
        #3

        You can set the "antialiasing" property to true on any item, including the Canvas. From the documentation:

        "Primarily used in Rectangle and image based elements to decide if the item should use antialiasing or not. Items with antialiasing enabled require more memory and are potentially slower to render.

        The default is false"

        I think the default should really be true for some items like the Canvas at least.

        1 Reply Last reply
        0
        • D Offline
          D Offline
          danilo2
          wrote on last edited by
          #4

          I tested the Rectagle item with antialiasung property set to true and it was not antialiased until I used the QSurfaceFormat.
          Additional - there is no info about how this antialiasing will be created - using this property, it would be (theoretically) multisampled? With how many samples?

          1 Reply Last reply
          0
          • C Offline
            C Offline
            capisce
            wrote on last edited by
            #5

            The Rectangle item should get antialiased without changing the QSurfaceFormat, it doesn't use multisampling. Of course it will only be antialiased if it has a rounded corner (a radius set), otherwise there's nothing to antialias.

            A bezier curve however is a custom item and will probably need multisampling to be antialiased, it all depends on how it is being rendered.

            1 Reply Last reply
            0
            • D Offline
              D Offline
              danilo2
              wrote on last edited by
              #6

              @capisce: the ROTADED box without radius is not being antialiased.

              1 Reply Last reply
              0
              • C Offline
                C Offline
                capisce
                wrote on last edited by
                #7

                It should be, if you do "antialiasing: true" in the Rectangle. Here's an example, run it with qmlscene:

                @
                import QtQuick 2.0

                Rectangle {
                width: 800
                height: 600

                Rectangle {
                    x: 200
                    y: 200
                    width: 400
                    height: 200
                    rotation: 20
                    antialiasing: true
                    color: "red"
                
                    MouseArea {
                        anchors.fill: parent
                        onPressed: { parent.antialiasing = !parent.antialiasing }
                    }
                }
                

                }
                @

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  alizadeh91
                  wrote on last edited by
                  #8

                  but there is a problem with antialiasing property in qtquick2.0. It usage high CPU in animating objects. For resolving that i have changed my graphic card settings instead of antialiasing property.

                  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