Qt-interest Archive, June 2007
Embedded QMainWindow
Message 1 in thread
Hi,
I am trying to build something like an "embedded" QMainWindow, which can
be layouted into an existing widget. The Widget is supposed to have a
ToolBar and a Statusbar. The latter is no problem with QWidget and
QStatusBar, but I despair of creating nice movable QToolBars. I can't get
it to work without a QMainWindow.
If you could change the widget-flags from Qt::Window to Qt::Widget for
QMainWindow it would probably give what I need. But unfortunately
Qt::Window is OR'ed in in the constructor of QMainWindow. I don't even see
a chance by subclassing QMainWindow, since it is using the
QMainWindowPrivate class in it's constructor, so I cannot replace it ...
Can anyone think of a basic approach to solve this Problem?
Big thanks in advance,
Malte
--
[ signature omitted ]
Message 2 in thread
Malte,
I should be thanking you instead of the other way around. Your question
finally pointed me in the correct direction to fix this problem in my own
code. You should be able to call setAttributes() after constructing the
QMainWindow to change it from Qt::Window to Qt::Widget.
Thanks for the insight, and let me know if that solved your problem,
Tom
On 6/27/07, Malte Witt <malte.witt@xxxxxxxxxxxxx> wrote:
>
> Hi,
>
> I am trying to build something like an "embedded" QMainWindow, which can
> be layouted into an existing widget. The Widget is supposed to have a
> ToolBar and a Statusbar. The latter is no problem with QWidget and
> QStatusBar, but I despair of creating nice movable QToolBars. I can't get
> it to work without a QMainWindow.
>
> If you could change the widget-flags from Qt::Window to Qt::Widget for
> QMainWindow it would probably give what I need. But unfortunately
> Qt::Window is OR'ed in in the constructor of QMainWindow. I don't even see
> a chance by subclassing QMainWindow, since it is using the
> QMainWindowPrivate class in it's constructor, so I cannot replace it ...
>
> Can anyone think of a basic approach to solve this Problem?
>
> Big thanks in advance,
>
> Malte
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
>
Message 3 in thread
> problem in my own code. You should be able to call setAttributes()
> after constructing the QMainWindow to change it from Qt::Window to
Qt::Widget.
Hey Tom,
thanks for the hint :-) Using QMainWindow::setWindowFlags(Qt::Widget)
right after construction works like a charme :-)
Thanks for pointing me into the right direction :-)
Regards,
Malte
--
[ signature omitted ]