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. Rectangle smooth: doesn't work when radius is specified

Rectangle smooth: doesn't work when radius is specified

Scheduled Pinned Locked Moved QML and Qt Quick
9 Posts 5 Posters 5.5k 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.
  • S Offline
    S Offline
    strekazoid
    wrote on last edited by
    #1

    Found interesting thing about Rectangle. I have rotation angle specified, and to avoid aliasing I have enabled smooth: true. But if there is also radius: property specified for the rectangle, smooth doesn't work anymore, and aliasing is again there. Is there any way to avoid aliasing when Rectangle is rotated and radius is specified?

    @ Rectangle {
    id: frame
    x: image1.x-5
    y: image1.y-5
    radius: 5
    smooth: true
    height: image1.height + 10
    width: image1.width + 10
    color: "lightgray"
    scale: image1.scale
    rotation: image1.rotation
    }@

    1 Reply Last reply
    0
    • A Offline
      A Offline
      alexander
      wrote on last edited by
      #2

      I've tried and it's work well. But I have last version from gitorious.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        strekazoid
        wrote on last edited by
        #3

        I'll attach couple of screenshots here.

        No radius specified:
        !http://www.stereofinland.com/wp-content/uploads/2010/11/rectangle_smooth01.jpg!

        Radius 5 specified:
        !http://www.stereofinland.com/wp-content/uploads/2010/11/rectangle_smooth02.jpg!

        1 Reply Last reply
        0
        • S Offline
          S Offline
          strekazoid
          wrote on last edited by
          #4

          [quote author="Alexander Kuchumov" date="1290074507"]I've tried and it's work well. But I have last version from gitorious.[/quote]

          Should probably also update mine, this sounds like a bug that could be fixed already.

          1 Reply Last reply
          0
          • S Offline
            S Offline
            strekazoid
            wrote on last edited by
            #5

            [quote author="Alexander Kuchumov" date="1290074507"]I've tried and it's work well. But I have last version from gitorious.[/quote]

            Alexander, would you mind telling what is the repository on gitorious for QML?

            1 Reply Last reply
            0
            • M Offline
              M Offline
              mbrasser
              wrote on last edited by
              #6

              The latest QML is in the main Qt repository (http://qt.gitorious.org/qt/qt), in the 4.7 branch.

              It's possible this is a graphics system issue -- what platform and graphics system are you running with? Do you use QGLWidget for the QDeclarativeView's viewport?

              1 Reply Last reply
              0
              • S Offline
                S Offline
                strekazoid
                wrote on last edited by
                #7

                bq. what platform and graphics system are you running with? Do you use QGLViewport?

                Windows XP, using qmlviewer with default settings.

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  micha4fun
                  wrote on last edited by
                  #8

                  Any news regarding this topic? Have the same effect with Qt 4.7.2 and standard Qmlviewer.

                  @
                  import QtQuick 1.0

                  Rectangle
                  {
                  width: 360
                  height: 360

                  Rectangle
                  {
                      x: 50
                      y: 50
                  
                      radius: 10
                      width: 100
                      height: 100
                      rotation: 20
                  
                      color: "#ff0000"
                      opacity: 0.5
                      smooth: true
                  }
                  

                  }@

                  1 Reply Last reply
                  0
                  • J Offline
                    J Offline
                    jdavet
                    wrote on last edited by
                    #9

                    I'm experiencing the same issue with Qt 4.8.1 and QtQuick 1.1 on Linux:

                    @import QtQuick 1.1

                    Item {
                    width: 150; height: 150

                    Rectangle {
                    width: 100; height: 100
                    smooth: true; color: "red"; rotation: 10
                    // radius: 5
                    anchors.centerIn: parent
                    }
                    }@
                    Without the radius: !http://img849.imageshack.us/img849/1858/qmlrectnoradius.png(screenshot of rectangle without rounded corners)! With the radius: !http://img84.imageshack.us/img84/9077/qmlrectradius.png(screenshot of rectangle without rounded corners)!

                    It is like this both when opening the qml file with qmlviewer, and when manually opening it with a QDeclarativeView like this:
                    @#include <QtGui/QApplication>
                    #include <QtDeclarative/QDeclarativeView>

                    int main(int argc, char *argv[])
                    {
                    QApplication app(argc, argv);

                    QDeclarativeView view;
                    view.setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform);
                    view.setResizeMode( QDeclarativeView::SizeRootObjectToView );
                    view.setSource(QUrl("rect.qml"));
                    view.show();

                    return app.exec();
                    }
                    @

                    Also, switching between "native" and "raster" graphics system does not seem to have an effect.

                    Any idea what could be causing this?

                    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