Questions tagged [qwindow]

The QWindow class represents a window in the underlying windowing system.

A window that is supplied a parent becomes a native child window of their parent window.

An application will typically use QWidget or QQuickView for its UI, and not QWindow directly. Still, it is possible to render directly to a QWindow with QBackingStore or QOpenGLContext, when wanting to keep dependencies to a minimum or when wanting to use OpenGL directly. The Raster Window Example and OpenGL Window Example are useful reference examples for how to render to a QWindow using either approach.

See More

24 questions
29
votes
5 answers

How do I set a background color for the whole window of a Qt application?

Does anyone know how one would be able to set a background color for the whole window of a Qt application? So far I am using stylesheets but can only figure out how to assign a background color to a widget such as QGroupBox or QPushButton.…
bryce
  • 403
  • 1
  • 5
  • 14
15
votes
1 answer

How can I intercept and cancel the minimizing of a Window?

I have a Window subclass in my project, and at runtime the instance is created and shown entirely on the QML side. I know that I can prevent the window from being minimized by not including the WindowMinimizeButtonHint in the flags:, but I actually…
MusiGenesis
  • 74,184
  • 40
  • 190
  • 334
5
votes
1 answer

What is the performance difference between QOpenGLWindow and QOpenGLWidget?

I have been looking into the two classes QOpenGLWindow and QOpenGLWidget. And in the documentation of QOpenGLWindow it states: "Unlike QOpenGLWidget, QOpenGLWindow has no dependency on the widgets module and offers better performance." In my current…
Sailanarmo
  • 1,139
  • 15
  • 41
3
votes
1 answer

How to create a translucent/transparent `QOpenGLWindow`

As is widely known that, to make a QWidget/QOpenGLWidget translucent/transparent, one only needs to: widget->setAttribute(Qt::WA_TranslucentBackground) However, since QWindow/QOpenGLWindow is not a widget and doesn't have setAttribute, I don't know…
3
votes
1 answer

Unable to paint on Qt Widget, shows error "paintEngine: Should no longer be called"

I have created a widget using Qt Creator such a way that it has two sub windows inside a main window and some push buttons to load, save images, set pen width and color to paint on the window. But when i start to paint it gives me error saying …
beginMyCoding
  • 31
  • 1
  • 3
3
votes
2 answers

Show Qt3D stuff inside QWidget in Qt5

So I felt all warm and fuzzy inside after reading that Qt3D has re-emerged in a v2.0 and is in fact becoming a part of Qt5 soon and that parts of it is already available for testing as a tech preview. I set out with a simple plan, I would have Qt3D…
Mr. Developerdude
  • 9,118
  • 10
  • 57
  • 95
2
votes
0 answers

Qt frameless window with translucent background without error "UpdateLayeredWindowIndirect failed"

Since some time I get an error like UpdateLayeredWindowIndirect failed for ptDst=... for my frameless window with rounded corners: I set my main window frameless and draw an inner widget with rounded corners. There is a discussion at Qt here and the…
Horst Walter
  • 13,663
  • 32
  • 126
  • 228
2
votes
1 answer

Releasing and restoring an embedded window in Qt

In my Qt application, I need to embed a native window. I start by obtaining it's WinId. After that, I create the embedded widget in the following way: QWindow * window = new QWindow::fromWinId(winid); QWidget * widget =…
blomm444
  • 113
  • 1
  • 8
1
vote
1 answer

How to detect when a foreign window embedded with QWidget.createWindowContainer closes itself?

I'm embedding another window into a Qt widget using PySide2.QtGui.QWindow.fromWinId(windowId). It works well, but it does not fire an event when the the original X11 window destroys it. If I run the file below with mousepad & python3 embed.py and…
Suzanne Soy
  • 3,027
  • 6
  • 38
  • 56
1
vote
1 answer

Remove icon from window

I've discovered that if I remove all flags from a QDialog, and set Windows flags to QtCore.Qt.CustomizeWindowHint and QtCore.Qt.WindowTitleHint, the icon disappears, but also the close button. Unfortunately, if I add the flag of…
Lavínia Beghini
  • 165
  • 1
  • 11
1
vote
1 answer

Can't show() QWindow when it was hidden with cmd + h on MacOS

I have an issue that I cannot raise my app Window when it got hidden with MacOS shortcut. It work correctly in all other cases. In my app i have 1 main qWindow called QWindow* mMainWindow; and following code added to tray button …
1
vote
1 answer

Why Setting Qt::SplashScreen flag prevent closing

I have QMainWindow which embed a QQuickWidget. The QQuickWidget display two differents qml (splash.qml and main.qml) according to the state of the app (initialized or not). I want my window to be in splashScreen mode when the splash.qml is…
grunk
  • 14,718
  • 15
  • 67
  • 108
1
vote
1 answer

Using QFileDialog with QWindow

I try to implement an application with OpenGL, so as the following example suggested, I used an QWindow to create an OpenGL context. http://doc.qt.io/qt-5/qtgui-openglwindow-example.html In this application, I want to create a file dialog when I…
perimasu
  • 1,025
  • 1
  • 8
  • 16
1
vote
1 answer

Recognize set/lose Focus-Event in QWindow

I´ve created a Qt-Quick Combo-Box that, when it will be pressed, opens a QWindow, in which I show the content within a TableView. The problem is, the focus on the TableView can´t be set. So first question is: How can I set the Focus on my TableView…
RefMa77
  • 283
  • 2
  • 14
1
vote
1 answer

How to destroy derived from QWindow object immediately after constructor done?

I need to destroy derived from QWindow object immediately after constructor done if some conditions in constructor will be true. There is member variable which I want to set in constructor and check in window initializing function. But I don't know…
Ufx
  • 2,595
  • 12
  • 44
  • 83
1
2