General and Desktop
2020.02.05 22:43

QOpenGLWidget 을 투명하게 적용

조회 수 3774 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄 첨부
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄 첨부

다른 위젯을 아래에두고 QOpenGLWidget 을 투명하게 만들면 예상 한 결과가 나오지 않는다. 아래 화면의 경우처럼 아래의 위젯은 보이지 않는다.

b.png

 

실제로 QOpenGLWidget 은 OpenGL이 아닌 다른 모든 일반 위젯보다 먼저 작성되므로 투명 위젯 유형의 렌더링을 실행할 수 없기 때문이다. QOpenGLWidget 위에 위젯을 배치하는 것과 같은 경우는 예상대로 작동한다.

 

절대적으로 필요한 경우, QOpenGLWidget에서 Qt::WA_AlwaysStackOnTop 속성을 설정하여이 제한 사항을 극복 할 수 있다.

a.png

 

그러나 이것은 렌더링 스택 순서를 깨뜨린다. 예를 들어 QOpenGLWidget 위에 다른 위젯을 가질 수는 없다. 따라서 다른 위젯을 볼 수있는 반투명 QOpenGLWidget 이 필요한 상황에서만 사용해야한다.

 

아래에 다른 위젯이없고 반투명 창이있는 경우에는 적용되지 않는다. 이 경우 최상위 창에서 Qt::WA_TranslucentBackground 를 설정하는 전통적인 접근 방식으로 충분하다.

 

투명 영역이 QOpenGLWidget 에서만 필요한 경우 Qt::WA_TranslucentBackground 를 활성화 한 후 Qt::WA_NoSystemBackground 를 false로 다시 설정해야한다. 또한 시스템에 따라 setFormat() 을 통해 QOpenGLWidget 의 컨텍스트에 대한 알파 채널을 요청해야 할 수도 있다.


  1. No Image notice

    Qt프로그래밍(QtQuick) Beginner를 위한 글 읽는 순서

    Date2019.01.05 CategoryQML and Qt Quick By운영자 Views110094
    read more
  2. UI 폼(Form)작성 시 탭 순서(Tab Order) 설정

    Date2020.08.24 CategoryGeneral and Desktop Bymakersweb Views7196
    Read More
  3. No Image

    Qt로 데이터를 직렬화(serialization)하는 방법

    Date2020.08.04 CategoryC++ Class Bymakersweb Views5187
    Read More
  4. 최초의 Qt 6.0 스냅샷 제공 (First Qt 6.0 Snapshot Available)

    Date2020.06.21 CategoryQt 6 Byj2doll Views3410
    Read More
  5. Qt MQTT 에 대해서

    Date2020.06.02 CategoryMobile and Embedded Bymakersweb Views3086
    Read More
  6. Embedded Linux 에서 Qt 및 Graphics Stack

    Date2020.05.27 By운영자 Views2883
    Read More
  7. ShaderEffect QML Type을 이용한 버튼 클릭 효과

    Date2020.05.22 CategoryQML and Qt Quick Bymakersweb Views3568
    Read More
  8. Qt기반의 서버와 클라이언트간 SOAP(Simple Object Access Protocol)

    Date2020.05.11 CategoryGeneral and Desktop Bymakersweb Views3193
    Read More
  9. No Image

    재진입(Reentrancy) 및 스레드 안전성(Thread-Safety)

    Date2020.04.19 CategoryC++ Class Bymakersweb Views4294
    Read More
  10. No Image

    Qt 5.15 및 Qt 6의 출시 일정

    Date2020.04.09 CategoryQt 6 Bymakersweb Views3186
    Read More
  11. 콘솔에서 사용자 입력받기

    Date2020.03.22 CategoryGeneral and Desktop Bymakersweb Views55263
    Read More
  12. No Image

    컨테이너 클래스 - QVector

    Date2020.03.17 CategoryC++ Class Bymakersweb Views5516
    Read More
  13. Qt로 작성된 안드로이드 APP에 Splash Screen을 추가

    Date2020.03.10 CategoryMobile and Embedded Bymakersweb Views3188
    Read More
  14. No Image

    QLabel의 텍스트 색과 배경색을 변경

    Date2020.02.25 CategoryC++ Class Bymakersweb Views10103
    Read More
  15. 라즈베리파이4에 대한 Qt 5.14.1 크로스컴파일

    Date2020.02.12 CategoryMobile and Embedded Bymakersweb Views7025
    Read More
  16. QOpenGLWidget 을 투명하게 적용

    Date2020.02.05 CategoryGeneral and Desktop Bymakersweb Views3774
    Read More
  17. No Image

    2020년에 변경되는 Qt 오퍼 (Qt offering changes 2020)

    Date2020.01.31 CategoryGeneral and Desktop Byj2doll Views3086
    Read More
  18. No Image

    Qt로 XML 파싱 : Qt 6에서 업데이트된 (Parsing XML with Qt: Updates for Qt 6)

    Date2020.01.16 CategoryQt 6 Byj2doll Views3590
    Read More
  19. No Image

    Qt 멀티 스레드 프로그래밍 시 유의해야 할 몇 가지

    Date2020.01.13 CategoryGeneral and Desktop Bymakersweb Views7917
    Read More
  20. ApplicationWindow 와 메뉴바(MenuBar)구성

    Date2020.01.04 CategoryQML and Qt Quick Bymakersweb Views3576
    Read More
  21. No Image

    QThread 소개 및 예제

    Date2019.12.25 CategoryC++ Class Bymakersweb Views24540
    Read More
Board Pagination Prev 1 2 3 4 5 6 9 Next
/ 9