Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QML/3D: how to get a frameless window and transparent background
QtWS25 Last Chance

QML/3D: how to get a frameless window and transparent background

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 6.6k 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.
  • C Offline
    C Offline
    Charlie Hsin
    wrote on 11 Jan 2011, 00:30 last edited by
    #1

    Hi,
    I am trying to developing a stereo 3D application. I have successfully showing stereo 3D via Qt/3D on my Nvidia Quadro. I am on Window 7. However, I got issues when I tried to make the window frameless or make the window background transparent.

    1. I can successfully get a frameless window if I use the "hellogl" example in the regular Qt codes and use the "FramelessWindowHint". However, if I use the "teapot" example in the Qt/3D codes and use "FramelessWindowHint", the whole application does not show at all.
    2. I am also trying to make the window background transparent.

    Can someone help me on these 2 tasks?

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Charlie Hsin
      wrote on 11 Jan 2011, 00:37 last edited by
      #2

      Hi,
      I am trying to developing a stereo 3D application. I have successfully showing stereo 3D via QML/3D on my Nvidia Quadro. I am on Window 7. Currently, I am trying to make my window framelss and with a transparent background. Can some one give me some hint about how to do this on QML/3D?

      1 Reply Last reply
      0
      • F Offline
        F Offline
        Franzk
        wrote on 11 Jan 2011, 07:45 last edited by
        #3

        [quote author="Charlie Hsin" date="1294705858"]

        1. I can successfully get a frameless window if I use the "hellogl" example in the regular Qt codes and use the "FramelessWindowHint". However, if I use the "teapot" example in the Qt/3D codes and use "FramelessWindowHint", the whole application does not show at all. [/quote]What's the difference between those two?

        [quote author="Charlie Hsin" date="1294705858"]2. I am also trying to make the window background transparent.[/quote]What have you tried so far?

        "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

        http://www.catb.org/~esr/faqs/smart-questions.html

        1 Reply Last reply
        0
        • C Offline
          C Offline
          Charlie Hsin
          wrote on 11 Jan 2011, 16:05 last edited by
          #4
          1. For the FramelessWindowHint task, the "hellogl" is just a example codes from Qt 4.7 release which does not use the Qt/3D. It uses QGLWidget. The "Teapot" example is from Qt/3D latest release, which uses QGLView. I added SetWindowFlags(...FramelessWindowHint) in the constructor. For hellogl example, it works. For Teapot example, the application exits immediately after I run it. If I take out the SetWindowFlags, it works.

          2. For the transparent background, I used Qt/3D teapot example and tried

          1. setStyleSheet("background:transparent;") and setAttribute(Qt::WA_TranslucentBackground): They do not result in any transparent effect at all. The background is still black.
          2. setWindowOpacity(0.5): This makes the whole window transparent, which is not what I want. Also, this makes the stereo effect not working. (The teapot is not stereo anymore.)

          BTW, I changed the format to use stereobuffers in main.cpp to enable hardware stereo effect for Teapot example.

          1 Reply Last reply
          0
          • C Offline
            C Offline
            Charlie Hsin
            wrote on 11 Jan 2011, 18:17 last edited by
            #5

            I figured out the frameless window issue. If I do the following in TeapotView constructor, it works.

            Qt::WindowFlags flags = this->windowFlags();
            flags |= Qt::SplashScreen;
            this->setWindowFlags(flags);

            I didn't get the current flags before, and I guess that violates some QGLView operations. Also, "FramelessWindowHint" does not work in QGLView. I have to use "SplashScreen".

            I still haven't figured out the transparent window background part. Can anyone help me on that?

            1 Reply Last reply
            0

            3/5

            11 Jan 2011, 07:45

            • Login

            • Login or register to search.
            3 out of 5
            • First post
              3/5
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved