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

Qt-interest Archive, April 2007
setApproriate() in Qt4.


Message 1 in thread

Hello,

 

Is there any function in Qt4 replacing the QMainWindow::setApproriate() function of Qt3? What I want to accomplish is to remove the possibility for the user to hide/show dock windows using the popup menu that is shown when the user right click on the toolbar. In Qt3 it was just the matter of calling setAppropriate() with the dock window and false as the arguments.

 

Any suggestions would be much appreciated.

 

Best Regards,

Daniel Hedberg

 

-----

Daniel Hedberg, M.Sc., Software Engineer

MathCore Engineering AB

Teknikringen 1B, SE-583 30 Linköping, Sweden

Phone: +46 13 32 85 05, Fax: +46 13 21 27 01

http://www.mathcore.com <http://www.mathcore.com/>  

 


Message 2 in thread

Daniel Hedberg wrote:
> Hello,
> 
>  
> 
> Is there any function in Qt4 replacing the QMainWindow::setApproriate()
> function of Qt3? What I want to accomplish is to remove the possibility
> for the user to hide/show dock windows using the popup menu that is
> shown when the user right click on the toolbar. In Qt3 it was just the
> matter of calling setAppropriate() with the dock window and false as the
> arguments.
> 
>  
> 
> Any suggestions would be much appreciated.

My 'any suggestion': subclass QMainWindow and override createPopupMenu
so that it returns null. That's far from convenient and I would love to
see an alternative, but haven't found one.

hth
M

--
 [ signature omitted ] 

Message 3 in thread

On Wednesday 18 April 2007 13:31, QMartin wrote:
> Daniel Hedberg wrote:
> > Hello,
> >
> >
> >
> > Is there any function in Qt4 replacing the QMainWindow::setApproriate()
> > function of Qt3? What I want to accomplish is to remove the possibility
> > for the user to hide/show dock windows using the popup menu that is
> > shown when the user right click on the toolbar. In Qt3 it was just the
> > matter of calling setAppropriate() with the dock window and false as the
> > arguments.
> >
> >
> >
> > Any suggestions would be much appreciated.
>
> My 'any suggestion': subclass QMainWindow and override createPopupMenu
> so that it returns null. That's far from convenient and I would love to
> see an alternative, but haven't found one.

Perhaps setting the contextMenuPolicy property to Qt::NoContextMenu might 
work? :) See http://doc.trolltech.com/4.2/qwidget.html#contextMenuPolicy-prop

-- 
 [ signature omitted ] 

Message 4 in thread

Bradley T Hughes wrote:
> On Wednesday 18 April 2007 13:31, QMartin wrote:
>> Daniel Hedberg wrote:
>>> Hello,
>>>
>>>
>>>
>>> Is there any function in Qt4 replacing the QMainWindow::setApproriate()
>>> function of Qt3? What I want to accomplish is to remove the possibility
>>> for the user to hide/show dock windows using the popup menu that is
>>> shown when the user right click on the toolbar. In Qt3 it was just the
>>> matter of calling setAppropriate() with the dock window and false as the
>>> arguments.
>>>
>>>
>>>
>>> Any suggestions would be much appreciated.
>> My 'any suggestion': subclass QMainWindow and override createPopupMenu
>> so that it returns null. That's far from convenient and I would love to
>> see an alternative, but haven't found one.
> 
> Perhaps setting the contextMenuPolicy property to Qt::NoContextMenu might 
> work? :) See http://doc.trolltech.com/4.2/qwidget.html#contextMenuPolicy-prop

Indeed, that's much better than having to subclass. Thanks for the hint
:) Would be nice though if this would be mentioned in the doc of
QMainWindow::createPopupMenu (a "see also" would be enough).

M

--
 [ signature omitted ] 

Message 5 in thread

Hello,

> > Is there any function in Qt4 replacing the
QMainWindow::setApproriate()
> > function of Qt3? What I want to accomplish is to remove the
possibility
> > for the user to hide/show dock windows using the popup menu that is
> > shown when the user right click on the toolbar. In Qt3 it was just
the
> > matter of calling setAppropriate() with the dock window and false as
the
> > arguments.
>
> My 'any suggestion': subclass QMainWindow and override createPopupMenu
> so that it returns null. That's far from convenient and I would love
to
> see an alternative, but haven't found one.
>
> Perhaps setting the contextMenuPolicy property to Qt::NoContextMenu
might 
> work? :) See
> http://doc.trolltech.com/4.2/qwidget.html#contextMenuPolicy-prop

Problem is that I still want to display the toolbars in the context
menu. I solved it by overriding the QMainWindow::createPopupMenu() and
in my implementation I inserted only the part of the code that extracts
the toolbars from QMainWindow.

Best Regards,
Daniel Hedberg

--
 [ signature omitted ]