QWindow and QMenuBar
-
-
@SPlatten
For the other part. There is void QLayout::setMenuBar(QWidget *widget)Tells the geometry manager to place the menu bar widget at the top of parentWidget(), outside QWidget::contentsMargins(). All child widgets are placed below the bottom edge of the menu bar.
So can't you use that to put a
QMenuBar
on anyQWidget
. But aQWindow
is a native window, not a widget, so not directly on that. Not sure you meantQWindow
? You cannot replace aQWindow
by aQMainWindow
. -
@SPlatten said in QWindow and QMenuBar:
and the compiler doesn't complain either, yet its just a QWindow.
Then its not a QWindow ...
-
@SPlatten said in QWindow and QMenuBar:
and the compiler doesn't complain either, yet its just a QWindow.
- Show your code rather than asserting this.
- From List of All Members for QWindow where is the
setMenuBar()
method?
It's best to check your facts when (several) others say something cannot be the case. :)
-
@SPlatten
:) [And I have appended a friendly smiley to my previous post.]
AQWindow
is a wrapper for a ("low-level") native window on the platform. It is not aQWidget
and cannot have something like a menubar or anything like that which a widget can have. -
@SPlatten
I did answer that: there is nothing special aboutQMainWindow
, it is just a widget with the style/behaviour documented at https://doc.qt.io/qt-6/qmainwindow.html#details. You can have a hundred of them if you wish. Though personally I never understand why an application would want more than one main window, but never mind. -
@JonB , the application I'm working on is not a specific application to do a job at all, its an engine that when finished will allow anyone to create a Qt application in JavaScript. The engine provides the Qt functionality, JavaScript and XML are used to create the application and subscriptions.