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. With QQuickView,how can i draw a rounded rectangle Window
Qt 6.11 is out! See what's new in the release blog

With QQuickView,how can i draw a rounded rectangle Window

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 2 Posters 3.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.
  • I Offline
    I Offline
    itviewer
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

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

      (Z(:^

      1 Reply Last reply
      0
      • I Offline
        I Offline
        itviewer
        wrote on last edited by
        #3

        [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...
        
        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          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.

          (Z(:^

          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