[Qt-interest] Standard keys in menus
Scott Aron Bloom
Scott.Bloom at sabgroup.com
Mon Oct 19 00:25:58 CEST 2009
Well, the problem is how should the slot be implemented by Qt in a
generic way? And how should the action decide which widget to connect
to, for example if you have multiple text edits. This is part of your
job as app developer - to put the widgets together and connect them to
create a meaningful application.
Andreas
--
---------------
However, You could say the same thing about buttons for dialogs. And TT
created the approach of the QButtonBox, where you simply create the
object, and say what type of buttons you want, then connect to a
standard set of signals.
Its all done ontop of the QButtons/QLayout system, but it makes sure we
as app developers keep a consistent and compliant (WRT to order) button
layout
I would love to see a menu system created on top of QMenu/QMainWindow,
where you added standard "menu actions" to the object, and it
constructed the menubar, its child menus, and the actions...
Then we could either have a QSignalMapper type of response, or a simple
"menuItemActivated( enum QStandardMenuItem )" type of signal..
Something like
menuSystem()->addAction(QMenuSystem::FileOpen);
menuSystem()->addAction(QMenuSystem::FileSave);
menuSystem()->addAction(QMenuSystem::FileClose);
connect( menuSystem(), SIGNAL( menuItemActivated( QStandardMenuIte ) ),
this, SLOT( slotMenuItemActivated( QStanardMenuItem ) )
::slotMenuItemActivated( QStanardMenuItem item )
{
switch( item )
case FileOpen: this->fileOpen(); return
...
}
Scott
More information about the Qt-interest-old
mailing list