Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

With QQuickView,how can i draw a rounded rectangle Window



  • for QWidget ,I can use
    @ setFlags( Qt::FramelessWindowHint )

    QBitmap objBitmap(size());
    QPainter painter(&objBitmap);
    
    painter.fillRect(rect(),Qt::white);
    painter.setBrush(QColor(0,0,0));
    painter.drawRoundedRect(rect(),10,10);
    setMask(objBitmap);@
    

    make a Frameless and RoundedRect Window, but QQuickView has no setMask() method,so how can I ahieve the same effect:Frameless and RoundedRect Window?

    Any pointers whatsoever would be highly appreciated.
    thanks


  • Moderators

    I think "this thread":http://qt-project.org/forums/viewthread/22492/#109042 might help you a bit.



  • [quote author="sierdzio" date="1357565419"]I think "this thread":http://qt-project.org/forums/viewthread/22492/#109042 might help you a bit.[/quote]

    There is a problem with that solution in Windows(msvc2010 Qt5), when setting:

    format.setRenderableType(QSurfaceFormat::OpenGL);
    

    Which results in the output:

    Cant find EGLConfig, returning null config
    QQuickWindow: makeCurrent() failed...
    

  • Moderators

    Might be a problem of Angle. Can you consider compiling Qt 5 yourself without ANGLE (configure flag -desktop opengl)? Bare in mind that it's a shot in the dark from my side, no guarantee it would work. You might try installing OpenGL drivers before that, too.


Log in to reply