Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 3

Qt-interest Archive, January 2008
One MenuBar, multiple windows


Message 1 in thread

Is there a way to assign one menu bar to multiple windows when  
building on Windows? On the mac I can just make a menuBar with no  
parent, and it'll apply to all open windows, but on Windows this  
doesn't work, and if I try to use the setMenuBar function on more than  
one window, it removes the menu bar from the first window when  
assigning it to the second. Is there any way I can get around this, or  
is this just one more reason to avoid windows as much as possible? ;)

-----------------------------------------------
Israel Brewster
Computer Support Technician
Frontier Flying Service Inc.
5245 Airport Industrial Rd
Fairbanks, AK 99709
(907) 450-7250 x293
-----------------------------------------------


--
 [ signature omitted ] 

Message 2 in thread

On fredag den 18. Januar 2008, Israel Brewster wrote:
> Is there a way to assign one menu bar to multiple windows when
> building on Windows?

No.

Bo.

-- 
 [ signature omitted ] 

Message 3 in thread

Why not just use QMainWindow and have all your windows be sub-windows?

Keith
**Please do not reply to me, reply to the list.**


On 01-18-2008 9:26 AM, "Israel Brewster" wrote:

> Is there a way to assign one menu bar to multiple windows when
> building on Windows? On the mac I can just make a menuBar with no
> parent, and it'll apply to all open windows, but on Windows this
> doesn't work, and if I try to use the setMenuBar function on more than
> one window, it removes the menu bar from the first window when
> assigning it to the second. Is there any way I can get around this, or
> is this just one more reason to avoid windows as much as possible? ;)
> 
> -----------------------------------------------
> Israel Brewster
> Computer Support Technician
> Frontier Flying Service Inc.
> 5245 Airport Industrial Rd
> Fairbanks, AK 99709
> (907) 450-7250 x293
> -----------------------------------------------


--
 [ signature omitted ] 

Message 4 in thread

hi!!

you can use a MDI form:
- 1 MainWindow
- 1 MenuBar
- 1 WorkSpace
- * Dialogs working in this workspace (workspace == parent).

you may use this menubar to alternate the dialogs (subwindows).

cheers!!

On Jan 21, 2008 4:39 PM, Keith Esau <keith.esau@xxxxxxx> wrote:

> Why not just use QMainWindow and have all your windows be sub-windows?
>
> Keith
> **Please do not reply to me, reply to the list.**
>
>
> On 01-18-2008 9:26 AM, "Israel Brewster" wrote:
>
> > Is there a way to assign one menu bar to multiple windows when
> > building on Windows? On the mac I can just make a menuBar with no
> > parent, and it'll apply to all open windows, but on Windows this
> > doesn't work, and if I try to use the setMenuBar function on more than
> > one window, it removes the menu bar from the first window when
> > assigning it to the second. Is there any way I can get around this, or
> > is this just one more reason to avoid windows as much as possible? ;)
> >
> > -----------------------------------------------
> > Israel Brewster
> > Computer Support Technician
> > Frontier Flying Service Inc.
> > 5245 Airport Industrial Rd
> > Fairbanks, AK 99709
> > (907) 450-7250 x293
> > -----------------------------------------------
>
>
> --
> 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/
>
>


-- 
 [ signature omitted ] 

Message 5 in thread



On Jan 21, 2008, at 7:04 AM, | pedro mateo || wrote:

> hi!!
>
> you can use a MDI form:
> - 1 MainWindow
> - 1 MenuBar
> - 1 WorkSpace
> - * Dialogs working in this workspace (workspace == parent).
>
> you may use this menubar to alternate the dialogs (subwindows).
>
> cheers!!

I'll look into that, see if I'm happy with the result. Thanks!

-----------------------------------------------
Israel Brewster
Computer Support Technician
Frontier Flying Service Inc.
5245 Airport Industrial Rd
Fairbanks, AK 99709
(907) 450-7250 x293
-----------------------------------------------

>
>
> On Jan 21, 2008 4:39 PM, Keith Esau <keith.esau@xxxxxxx> wrote:
> Why not just use QMainWindow and have all your windows be sub-windows?
>
> Keith
> **Please do not reply to me, reply to the list.**
>
>
> On 01-18-2008 9:26 AM, "Israel Brewster" wrote:
>
> > Is there a way to assign one menu bar to multiple windows when
> > building on Windows? On the mac I can just make a menuBar with no
> > parent, and it'll apply to all open windows, but on Windows this
> > doesn't work, and if I try to use the setMenuBar function on more  
> than
> > one window, it removes the menu bar from the first window when
> > assigning it to the second. Is there any way I can get around  
> this, or
> > is this just one more reason to avoid windows as much as  
> possible? ;)
> >
> > -----------------------------------------------
> > Israel Brewster
> > Computer Support Technician
> > Frontier Flying Service Inc.
> > 5245 Airport Industrial Rd
> > Fairbanks, AK 99709
> > (907) 450-7250 x293
> > -----------------------------------------------
>
>
> --
> 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/
>
>
>
>
> -- 
> Pedro Luis Mateo Navarro || pedrolmn@xxxxxxxxx _ pedromateo@xxxxxxxxx
>   > _phone: (+34) 626 14 29 33 or  (+34) 968 39 82 58
>   > _web: www.pedromana.com
>   > _msn: pedrolmn@xxxxxxxxxxx


Message 6 in thread

What I would do... is simply instantiate a QMenuBar, add the menu/menu
items as appropriate, and show the menubar as a normal widget (mb->show)

This little bit of code worked fine for me...

#include <QMenuBar>
#include <QApplication>

int main( int argc, char ** argv )
{
	QApplication appl( argc, argv );

	QMenuBar * mb = new QMenuBar;
	QMenu * menu = mb->addMenu( "File" );
	menu->addAction( "Exit", &appl, SLOT( quit() ) );
	mb->show();

	appl.exec();
}


> -----Original Message-----
> From: Israel Brewster [mailto:israel@xxxxxxxxxxxxxxxxxx]
> Sent: Friday, January 18, 2008 12:26 PM
> To: Qt Interest List
> Subject: One MenuBar, multiple windows
> 
> Is there a way to assign one menu bar to multiple windows when
> building on Windows? On the mac I can just make a menuBar with no
> parent, and it'll apply to all open windows, but on Windows this
> doesn't work, and if I try to use the setMenuBar function on more than
> one window, it removes the menu bar from the first window when
> assigning it to the second. Is there any way I can get around this, or
> is this just one more reason to avoid windows as much as possible? ;)
> 
> -----------------------------------------------
> Israel Brewster
> Computer Support Technician
> Frontier Flying Service Inc.
> 5245 Airport Industrial Rd
> Fairbanks, AK 99709
> (907) 450-7250 x293
> -----------------------------------------------
> 
> 
> --
> 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/

--
 [ signature omitted ] 

Message 7 in thread



On Jan 21, 2008, at 7:55 PM, Scott Aron Bloom wrote:

> What I would do... is simply instantiate a QMenuBar, add the menu/menu
> items as appropriate, and show the menubar as a normal widget (mb- 
> >show)

Which gives me a separate window for the menu bar. Could work, if it  
can be made to be a floating window, and still respond to keyboard  
shortcuts. Thanks!

-----------------------------------------------
Israel Brewster
Computer Support Technician
Frontier Flying Service Inc.
5245 Airport Industrial Rd
Fairbanks, AK 99709
(907) 450-7250 x293
-----------------------------------------------

>
>
> This little bit of code worked fine for me...
>
> #include <QMenuBar>
> #include <QApplication>
>
> int main( int argc, char ** argv )
> {
> 	QApplication appl( argc, argv );
>
> 	QMenuBar * mb = new QMenuBar;
> 	QMenu * menu = mb->addMenu( "File" );
> 	menu->addAction( "Exit", &appl, SLOT( quit() ) );
> 	mb->show();
>
> 	appl.exec();
> }
>
>
>> -----Original Message-----
>> From: Israel Brewster [mailto:israel@xxxxxxxxxxxxxxxxxx]
>> Sent: Friday, January 18, 2008 12:26 PM
>> To: Qt Interest List
>> Subject: One MenuBar, multiple windows
>>
>> Is there a way to assign one menu bar to multiple windows when
>> building on Windows? On the mac I can just make a menuBar with no
>> parent, and it'll apply to all open windows, but on Windows this
>> doesn't work, and if I try to use the setMenuBar function on more  
>> than
>> one window, it removes the menu bar from the first window when
>> assigning it to the second. Is there any way I can get around this,  
>> or
>> is this just one more reason to avoid windows as much as possible? ;)
>>
>> -----------------------------------------------
>> Israel Brewster
>> Computer Support Technician
>> Frontier Flying Service Inc.
>> 5245 Airport Industrial Rd
>> Fairbanks, AK 99709
>> (907) 450-7250 x293
>> -----------------------------------------------
>>
>>
>> --
>> 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/
>

--
 [ signature omitted ]