Back to index
Handles TeXmacs commands in the QT way. More...
|Queues the object's command into the main queue. |
|QTMCommand (command _cmd)|
Handles TeXmacs commands in the QT way.
Most TeXmacs widgets accept one command_rep as an argument. This is a scheme closure which will usually be executed when the widget is closed, in the case of dialogs, or activated in the case of checkboxes, combo boxes, etc. This means connecting them to signals emmitted by our QWidgets and that's the purpose of this wrapping class. Furthermore, this commands must be processed in a separate queue. The slot apply() takes care of that.
To use this class, one typically takes some given command "cmd" and does the following:
QTMCommand* qtmcmd = new QTMCommand(cmd); theQWidget->setParent(qtmcmd); QObject::connect(theQWidget, SIGNAL(somethingHappened()), qtmcmd, SLOT(apply()));
Since the slot in this class accepts no arguments, commands which require access to the QWidget must be subclassed from command_rep to accept the particular QWidget as a parameter. Then their invocation (which apply() will call) must access it.