org.kde.koala
public class KRegExpEditorInterface extends Object implements QtSupport
boolean installed=!KTrader.self().query("KRegExpEditor/KRegExpEditor").isEmpty();The following is a template for what you need to do to create an instance of the regular expression dialog:
QDialog editorDialog = KParts.ComponentFactory.createInstanceFromQueryNote: signals and slots must be connected to the editorDialog object, not to the editor object:( "KRegExpEditor/KRegExpEditor" ); if ( editorDialog ) { // kdeutils was installed, so the dialog was found fetch the editor interface KRegExpEditorInterface editor = (KRegExpEditorInterface)( editorDialog.qt_cast( "KRegExpEditorInterface" ) ); Q_ASSERT( editor ); // This should not fail! // now use the editor. editor.setRegExp("^kde$"); // Finally exec the dialog editorDialog.exec(); } else { // Don't offer the dialog. }
connect( editorDialog, SIGNAL("canUndo( boolean )"), undoBut, SLOT("setEnabled( boolean )") );If you want to create an instance of the editor widget, i.e. not the dialog, then you must do it in the following way:
QWidget editorWidget = KParts.ComponentFactory.createInstanceFromQuery( "KRegExpEditor/KRegExpEditor", null, parent ); if ( editorWidget ) { // kdeutils was installed, so the widget was found fetch the editor interface KRegExpEditorInterface editor = (KRegExpEditorInterface)( editorWidget.qt_cast( "KRegExpEditorInterface" ) ); Q_ASSERT( editor ); // This should not fail! // now use the editor. editor.setRegExp("^kde$"); // Finally insert the widget into the layout of its parent layout.addWidget( editorWidget ); } else { // Don't offer the editor widget. }
UNKNOWN: A graphical editor for regular expressions.
Constructor Summary | |
---|---|
protected | KRegExpEditorInterface(Class dummy) |
Method Summary | |
---|---|
void | redo() |
String | regExp()
returns the regular expression of the editor in Qt3 QRegExp
syntax. |
void | setMatchText(String arg1)
Set text to use when showing matches. |
void | setRegExp(String regexp)
Set the regular expression for the editor. |
void | undo() |
UNKNOWN: returns the regular expression of the editor in Qt3 QRegExp syntax.
UNKNOWN: Set text to use when showing matches.
UNKNOWN: Set the regular expression for the editor.