diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-01-31 06:26:14 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-01-31 06:26:14 +0000 |
commit | f007f85c4dc9ed297291c2a209bba73663ecd37b (patch) | |
tree | af24a01bffa79a5d2006320aed4a3aab0895a8f2 /interfaces | |
parent | c6ea5f2c665bbc4b9c512d3d1fee3a7b58040f5d (diff) | |
download | tdelibs-f007f85c4dc9ed297291c2a209bba73663ecd37b.tar.gz tdelibs-f007f85c4dc9ed297291c2a209bba73663ecd37b.zip |
Convert qt_cast() to ::qt_cast<>
This should fix some random segfaults
It needs to be tested to make sure that interfaces still work,
e.g. kate/kwrite interfaces in interface/ktexteditor
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1218078 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'interfaces')
35 files changed, 45 insertions, 45 deletions
diff --git a/interfaces/khexedit/byteseditinterface.h b/interfaces/khexedit/byteseditinterface.h index a34e70e42..57d1dd6f3 100644 --- a/interfaces/khexedit/byteseditinterface.h +++ b/interfaces/khexedit/byteseditinterface.h @@ -159,7 +159,7 @@ inline BytesEditInterface *bytesEditInterface( T *t ) if( !t ) return 0; - return static_cast<BytesEditInterface*>( t->qt_cast("KHE::BytesEditInterface") ); + return ::tqqt_cast<KHE::BytesEditInterface*>( t ); } /** tries to create an instance of a hexedit widget for arrays of chars (char[]) diff --git a/interfaces/khexedit/charcolumninterface.h b/interfaces/khexedit/charcolumninterface.h index 4221de0c4..38e4ae29b 100644 --- a/interfaces/khexedit/charcolumninterface.h +++ b/interfaces/khexedit/charcolumninterface.h @@ -97,7 +97,7 @@ CharColumnInterface *charColumnInterface( T *t ) if( !t ) return 0; - return static_cast<CharColumnInterface*>( t->qt_cast("KHE::CharColumnInterface") ); + return ::tqqt_cast<KHE::CharColumnInterface*>( t ); } } diff --git a/interfaces/khexedit/clipboardinterface.h b/interfaces/khexedit/clipboardinterface.h index 6b5f4fab2..c63c5a88e 100644 --- a/interfaces/khexedit/clipboardinterface.h +++ b/interfaces/khexedit/clipboardinterface.h @@ -78,7 +78,7 @@ ClipboardInterface *clipboardInterface( T *t ) if( !t ) return 0; - return static_cast<ClipboardInterface*>( t->qt_cast("KHE::ClipboardInterface") ); + return ::tqqt_cast<KHE::ClipboardInterface*>( t ); } } diff --git a/interfaces/khexedit/valuecolumninterface.h b/interfaces/khexedit/valuecolumninterface.h index 7dafa7d42..78378f1d4 100644 --- a/interfaces/khexedit/valuecolumninterface.h +++ b/interfaces/khexedit/valuecolumninterface.h @@ -162,7 +162,7 @@ ValueColumnInterface *valueColumnInterface( T *t ) if( !t ) return 0; - return static_cast<ValueColumnInterface*>( t->qt_cast("KHE::ValueColumnInterface") ); + return ::tqqt_cast<KHE::ValueColumnInterface*>( t ); } } diff --git a/interfaces/khexedit/zoominterface.h b/interfaces/khexedit/zoominterface.h index 494fbfd86..9c6f0f677 100644 --- a/interfaces/khexedit/zoominterface.h +++ b/interfaces/khexedit/zoominterface.h @@ -71,7 +71,7 @@ ZoomInterface *zoomInterface( T *t ) if( !t ) return 0; - return static_cast<ZoomInterface*>( t->qt_cast("KHE::ZoomInterface") ); + return ::tqqt_cast<KHE::ZoomInterface*>( t ); } } diff --git a/interfaces/kregexpeditor/kregexpeditorinterface.h b/interfaces/kregexpeditor/kregexpeditorinterface.h index 01fab0fdf..6995c3982 100644 --- a/interfaces/kregexpeditor/kregexpeditorinterface.h +++ b/interfaces/kregexpeditor/kregexpeditorinterface.h @@ -25,7 +25,7 @@ * TQDialog *editorDialog = KParts::ComponentFactory::createInstanceFromQuery<TQDialog>( "KRegExpEditor/KRegExpEditor" ); * if ( editorDialog ) { * // kdeutils was installed, so the dialog was found fetch the editor interface - * KRegExpEditorInterface *editor = static_cast<KRegExpEditorInterface *>( editorDialog->qt_cast( "KRegExpEditorInterface" ) ); + * KRegExpEditorInterface *editor = ::tqqt_cast<KRegExpEditorInterface *>( editorDialog ); * Q_ASSERT( editor ); // This should not fail! * * // now use the editor. @@ -53,7 +53,7 @@ * "KRegExpEditor/KRegExpEditor", TQString::null, parent ); * if ( editorWidget ) { * // kdeutils was installed, so the widget was found fetch the editor interface - * KRegExpEditorInterface *editor = static_cast<KRegExpEditorInterface *>( editorWidget->qt_cast( "KRegExpEditorInterface" ) ); + * KRegExpEditorInterface *editor = ::tqqt_cast<KRegExpEditorInterface *>( editorWidget ); * Q_ASSERT( editor ); // This should not fail! * * // now use the editor. diff --git a/interfaces/ktexteditor/blockselectioninterface.cpp b/interfaces/ktexteditor/blockselectioninterface.cpp index c1af4a6ed..6d562a43e 100644 --- a/interfaces/ktexteditor/blockselectioninterface.cpp +++ b/interfaces/ktexteditor/blockselectioninterface.cpp @@ -70,5 +70,5 @@ BlockSelectionInterface *KTextEditor::blockSelectionInterface (Document *doc) if (!doc) return 0; - return static_cast<BlockSelectionInterface*>(doc->qt_cast("KTextEditor::BlockSelectionInterface")); + return dynamic_cast<KTextEditor::BlockSelectionInterface*>(doc); } diff --git a/interfaces/ktexteditor/clipboardinterface.cpp b/interfaces/ktexteditor/clipboardinterface.cpp index 4401b29de..89f92d089 100644 --- a/interfaces/ktexteditor/clipboardinterface.cpp +++ b/interfaces/ktexteditor/clipboardinterface.cpp @@ -52,5 +52,5 @@ ClipboardInterface *KTextEditor::clipboardInterface (View *view) if (!view) return 0; - return static_cast<ClipboardInterface*>(view->qt_cast("KTextEditor::ClipboardInterface")); + return dynamic_cast<KTextEditor::ClipboardInterface*>(view); } diff --git a/interfaces/ktexteditor/codecompletioninterface.cpp b/interfaces/ktexteditor/codecompletioninterface.cpp index ae60b2162..416dd593a 100644 --- a/interfaces/ktexteditor/codecompletioninterface.cpp +++ b/interfaces/ktexteditor/codecompletioninterface.cpp @@ -45,7 +45,7 @@ CodeCompletionInterface *KTextEditor::codeCompletionInterface (View *view) if (!view) return 0; - return static_cast<CodeCompletionInterface*>(view->qt_cast("KTextEditor::CodeCompletionInterface")); + return dynamic_cast<KTextEditor::CodeCompletionInterface*>(view); } diff --git a/interfaces/ktexteditor/configinterface.cpp b/interfaces/ktexteditor/configinterface.cpp index 2ca2e4b12..63bf086e0 100644 --- a/interfaces/ktexteditor/configinterface.cpp +++ b/interfaces/ktexteditor/configinterface.cpp @@ -67,7 +67,7 @@ ConfigInterface *KTextEditor::configInterface (Document *doc) if (!doc) return 0; - return static_cast<ConfigInterface*>(doc->qt_cast("KTextEditor::ConfigInterface")); + return dynamic_cast<KTextEditor::ConfigInterface*>(doc); } ConfigInterface *KTextEditor::configInterface (Plugin *plugin) @@ -75,5 +75,5 @@ ConfigInterface *KTextEditor::configInterface (Plugin *plugin) if (!plugin) return 0; - return static_cast<ConfigInterface*>(plugin->qt_cast("KTextEditor::ConfigInterface")); + return dynamic_cast<KTextEditor::ConfigInterface*>(plugin); } diff --git a/interfaces/ktexteditor/configinterfaceextension.cpp b/interfaces/ktexteditor/configinterfaceextension.cpp index 8557c422f..460d930a4 100644 --- a/interfaces/ktexteditor/configinterfaceextension.cpp +++ b/interfaces/ktexteditor/configinterfaceextension.cpp @@ -72,7 +72,7 @@ ConfigInterfaceExtension *KTextEditor::configInterfaceExtension (Document *doc) if (!doc) return 0; - return static_cast<ConfigInterfaceExtension*>(doc->qt_cast("KTextEditor::ConfigInterfaceExtension")); + return dynamic_cast<KTextEditor::ConfigInterfaceExtension*>(doc); } ConfigInterfaceExtension *KTextEditor::configInterfaceExtension (Plugin *plugin) @@ -80,5 +80,5 @@ ConfigInterfaceExtension *KTextEditor::configInterfaceExtension (Plugin *plugin) if (!plugin) return 0; - return static_cast<ConfigInterfaceExtension*>(plugin->qt_cast("KTextEditor::ConfigInterfaceExtension")); + return dynamic_cast<KTextEditor::ConfigInterfaceExtension*>(plugin); } diff --git a/interfaces/ktexteditor/cursorinterface.cpp b/interfaces/ktexteditor/cursorinterface.cpp index 91a14b06a..96d00290e 100644 --- a/interfaces/ktexteditor/cursorinterface.cpp +++ b/interfaces/ktexteditor/cursorinterface.cpp @@ -65,5 +65,5 @@ CursorInterface *KTextEditor::cursorInterface (Document *doc) if (!doc) return 0; - return static_cast<CursorInterface*>(doc->qt_cast("KTextEditor::CursorInterface")); + return dynamic_cast<KTextEditor::CursorInterface*>(doc); } diff --git a/interfaces/ktexteditor/dynwordwrapinterface.cpp b/interfaces/ktexteditor/dynwordwrapinterface.cpp index 49d4060c0..9c1da6d4b 100644 --- a/interfaces/ktexteditor/dynwordwrapinterface.cpp +++ b/interfaces/ktexteditor/dynwordwrapinterface.cpp @@ -65,5 +65,5 @@ DynWordWrapInterface *KTextEditor::dynWordWrapInterface (View *view) if (!view) return 0; - return static_cast<DynWordWrapInterface*>(view->qt_cast("KTextEditor::DynWordWrapInterface")); + return dynamic_cast<KTextEditor::DynWordWrapInterface*>(view); } diff --git a/interfaces/ktexteditor/editinterface.cpp b/interfaces/ktexteditor/editinterface.cpp index 6722fc555..cfa0b67bc 100644 --- a/interfaces/ktexteditor/editinterface.cpp +++ b/interfaces/ktexteditor/editinterface.cpp @@ -52,6 +52,6 @@ EditInterface *KTextEditor::editInterface (Document *doc) if (!doc) return 0; - return static_cast<EditInterface*>(doc->qt_cast("KTextEditor::EditInterface")); + return dynamic_cast<KTextEditor::EditInterface*>(doc); } diff --git a/interfaces/ktexteditor/editinterfaceext.cpp b/interfaces/ktexteditor/editinterfaceext.cpp index 7d4acf55f..008fa488d 100644 --- a/interfaces/ktexteditor/editinterfaceext.cpp +++ b/interfaces/ktexteditor/editinterfaceext.cpp @@ -45,6 +45,6 @@ EditInterfaceExt *KTextEditor::editInterfaceExt (Document *doc) if (!doc) return 0; - return static_cast<EditInterfaceExt*>(doc->qt_cast("KTextEditor::EditInterfaceExt")); + return dynamic_cast<KTextEditor::EditInterfaceExt*>(doc); } diff --git a/interfaces/ktexteditor/encodinginterface.cpp b/interfaces/ktexteditor/encodinginterface.cpp index 341847fb7..a0ef1ad22 100644 --- a/interfaces/ktexteditor/encodinginterface.cpp +++ b/interfaces/ktexteditor/encodinginterface.cpp @@ -72,5 +72,5 @@ EncodingInterface *KTextEditor::encodingInterface (Document *doc) if (!doc) return 0; - return static_cast<EncodingInterface*>(doc->qt_cast("KTextEditor::EncodingInterface")); + return dynamic_cast<KTextEditor::EncodingInterface*>(doc); } diff --git a/interfaces/ktexteditor/highlightinginterface.cpp b/interfaces/ktexteditor/highlightinginterface.cpp index f606ab5c0..1677ca87c 100644 --- a/interfaces/ktexteditor/highlightinginterface.cpp +++ b/interfaces/ktexteditor/highlightinginterface.cpp @@ -65,5 +65,5 @@ HighlightingInterface *KTextEditor::highlightingInterface (Document *doc) if (!doc) return 0; - return static_cast<HighlightingInterface*>(doc->qt_cast("KTextEditor::HighlightingInterface")); + return dynamic_cast<KTextEditor::HighlightingInterface*>(doc); } diff --git a/interfaces/ktexteditor/ktexteditor.cpp b/interfaces/ktexteditor/ktexteditor.cpp index ef199c819..c334dd990 100644 --- a/interfaces/ktexteditor/ktexteditor.cpp +++ b/interfaces/ktexteditor/ktexteditor.cpp @@ -226,6 +226,6 @@ PluginViewInterface *KTextEditor::pluginViewInterface (Plugin *plugin) if (!plugin) return 0; - return static_cast<PluginViewInterface*>(plugin->qt_cast("KTextEditor::PluginViewInterface")); + return dynamic_cast<KTextEditor::PluginViewInterface*>(plugin); } diff --git a/interfaces/ktexteditor/markinterface.cpp b/interfaces/ktexteditor/markinterface.cpp index d711b5245..024db35c4 100644 --- a/interfaces/ktexteditor/markinterface.cpp +++ b/interfaces/ktexteditor/markinterface.cpp @@ -65,7 +65,7 @@ MarkInterface *KTextEditor::markInterface (Document *doc) if (!doc) return 0; - return static_cast<MarkInterface*>(doc->qt_cast("KTextEditor::MarkInterface")); + return dynamic_cast<KTextEditor::MarkInterface*>(doc); } int MarkInterface::reservedMarkersCount() diff --git a/interfaces/ktexteditor/markinterfaceextension.cpp b/interfaces/ktexteditor/markinterfaceextension.cpp index 57c981421..86538abfc 100644 --- a/interfaces/ktexteditor/markinterfaceextension.cpp +++ b/interfaces/ktexteditor/markinterfaceextension.cpp @@ -65,5 +65,5 @@ MarkInterfaceExtension *KTextEditor::markInterfaceExtension (Document *doc) if (!doc) return 0; - return static_cast<MarkInterfaceExtension*>(doc->qt_cast("KTextEditor::MarkInterfaceExtension")); + return dynamic_cast<KTextEditor::MarkInterfaceExtension*>(doc); } diff --git a/interfaces/ktexteditor/popupmenuinterface.cpp b/interfaces/ktexteditor/popupmenuinterface.cpp index d2d51e4af..350fa138b 100644 --- a/interfaces/ktexteditor/popupmenuinterface.cpp +++ b/interfaces/ktexteditor/popupmenuinterface.cpp @@ -65,5 +65,5 @@ PopupMenuInterface *KTextEditor::popupMenuInterface (View *view) if (!view) return 0; - return static_cast<PopupMenuInterface*>(view->qt_cast("KTextEditor::PopupMenuInterface")); + return dynamic_cast<KTextEditor::PopupMenuInterface*>(view); } diff --git a/interfaces/ktexteditor/printinterface.cpp b/interfaces/ktexteditor/printinterface.cpp index 936e803ea..5a4011eb4 100644 --- a/interfaces/ktexteditor/printinterface.cpp +++ b/interfaces/ktexteditor/printinterface.cpp @@ -70,5 +70,5 @@ PrintInterface *KTextEditor::printInterface (Document *doc) if (!doc) return 0; - return static_cast<PrintInterface*>(doc->qt_cast("KTextEditor::PrintInterface")); + return dynamic_cast<KTextEditor::PrintInterface*>(doc); } diff --git a/interfaces/ktexteditor/searchinterface.cpp b/interfaces/ktexteditor/searchinterface.cpp index d23a25e31..6ea021e0d 100644 --- a/interfaces/ktexteditor/searchinterface.cpp +++ b/interfaces/ktexteditor/searchinterface.cpp @@ -51,5 +51,5 @@ SearchInterface *KTextEditor::searchInterface (Document *doc) if (!doc) return 0; - return static_cast<SearchInterface*>(doc->qt_cast("KTextEditor::SearchInterface")); + return dynamic_cast<KTextEditor::SearchInterface*>(doc); } diff --git a/interfaces/ktexteditor/selectioninterface.cpp b/interfaces/ktexteditor/selectioninterface.cpp index 2e9ae5204..0a8dc6b00 100644 --- a/interfaces/ktexteditor/selectioninterface.cpp +++ b/interfaces/ktexteditor/selectioninterface.cpp @@ -52,7 +52,7 @@ SelectionInterface *KTextEditor::selectionInterface (Document *doc) if (!doc) return 0; - return static_cast<SelectionInterface*>(doc->qt_cast("KTextEditor::SelectionInterface")); + return dynamic_cast<KTextEditor::SelectionInterface*>(doc); } SelectionInterface *KTextEditor::selectionInterface (View *view) @@ -60,6 +60,6 @@ SelectionInterface *KTextEditor::selectionInterface (View *view) if (!view) return 0; - return static_cast<SelectionInterface*>(view->qt_cast("KTextEditor::SelectionInterface")); + return dynamic_cast<KTextEditor::SelectionInterface*>(view); } diff --git a/interfaces/ktexteditor/selectioninterfaceext.cpp b/interfaces/ktexteditor/selectioninterfaceext.cpp index f59468c17..3034f33a5 100644 --- a/interfaces/ktexteditor/selectioninterfaceext.cpp +++ b/interfaces/ktexteditor/selectioninterfaceext.cpp @@ -68,7 +68,7 @@ SelectionInterfaceExt *KTextEditor::selectionInterfaceExt (Document *doc) if (!doc) return 0; - return static_cast<SelectionInterfaceExt*>(doc->qt_cast("KTextEditor::SelectionInterfaceExt")); + return dynamic_cast<KTextEditor::SelectionInterfaceExt*>(doc); } SelectionInterfaceExt *KTextEditor::selectionInterfaceExt (View *view) @@ -76,7 +76,7 @@ SelectionInterfaceExt *KTextEditor::selectionInterfaceExt (View *view) if (!view) return 0; - return static_cast<SelectionInterfaceExt*>(view->qt_cast("KTextEditor::SelectionInterfaceExt")); + return dynamic_cast<KTextEditor::SelectionInterfaceExt*>(view); } //END KTextEditor::SelectionInterfaceExt diff --git a/interfaces/ktexteditor/sessionconfiginterface.cpp b/interfaces/ktexteditor/sessionconfiginterface.cpp index 7180aae38..def7bf0a5 100644 --- a/interfaces/ktexteditor/sessionconfiginterface.cpp +++ b/interfaces/ktexteditor/sessionconfiginterface.cpp @@ -68,7 +68,7 @@ SessionConfigInterface *KTextEditor::sessionConfigInterface (Document *doc) if (!doc) return 0; - return static_cast<SessionConfigInterface*>(doc->qt_cast("KTextEditor::SessionConfigInterface")); + return dynamic_cast<KTextEditor::SessionConfigInterface*>(doc); } SessionConfigInterface *KTextEditor::sessionConfigInterface (View *view) @@ -76,7 +76,7 @@ SessionConfigInterface *KTextEditor::sessionConfigInterface (View *view) if (!view) return 0; - return static_cast<SessionConfigInterface*>(view->qt_cast("KTextEditor::SessionConfigInterface")); + return dynamic_cast<KTextEditor::SessionConfigInterface*>(view); } SessionConfigInterface *KTextEditor::sessionConfigInterface (Plugin *plugin) @@ -84,5 +84,5 @@ SessionConfigInterface *KTextEditor::sessionConfigInterface (Plugin *plugin) if (!plugin) return 0; - return static_cast<SessionConfigInterface*>(plugin->qt_cast("KTextEditor::SessionConfigInterface")); + return dynamic_cast<KTextEditor::SessionConfigInterface*>(plugin); } diff --git a/interfaces/ktexteditor/templateinterface.cpp b/interfaces/ktexteditor/templateinterface.cpp index 126747260..a22e5edce 100644 --- a/interfaces/ktexteditor/templateinterface.cpp +++ b/interfaces/ktexteditor/templateinterface.cpp @@ -192,6 +192,6 @@ TemplateInterface *KTextEditor::templateInterface ( KTextEditor::Document *doc ) if ( !doc ) return 0; - return static_cast<TemplateInterface*>( doc->qt_cast( "KTextEditor::TemplateInterface" ) ); + return dynamic_cast<KTextEditor::TemplateInterface*>( doc ); } diff --git a/interfaces/ktexteditor/texthintinterface.cpp b/interfaces/ktexteditor/texthintinterface.cpp index 079a1edda..f6aa4f0b3 100644 --- a/interfaces/ktexteditor/texthintinterface.cpp +++ b/interfaces/ktexteditor/texthintinterface.cpp @@ -58,7 +58,7 @@ TextHintInterface *textHintInterface (View *view) if (!view) return 0; - return static_cast<TextHintInterface*>(view->qt_cast("KTextEditor::TextHintInterface")); + return dynamic_cast<KTextEditor::TextHintInterface*>(view); } diff --git a/interfaces/ktexteditor/undointerface.cpp b/interfaces/ktexteditor/undointerface.cpp index d19a56deb..30a1dd292 100644 --- a/interfaces/ktexteditor/undointerface.cpp +++ b/interfaces/ktexteditor/undointerface.cpp @@ -70,5 +70,5 @@ UndoInterface *KTextEditor::undoInterface (Document *doc) if (!doc) return 0; - return static_cast<UndoInterface*>(doc->qt_cast("KTextEditor::UndoInterface")); + return dynamic_cast<KTextEditor::UndoInterface*>(doc); } diff --git a/interfaces/ktexteditor/variableinterface.cpp b/interfaces/ktexteditor/variableinterface.cpp index 0ac55167e..616e0beab 100644 --- a/interfaces/ktexteditor/variableinterface.cpp +++ b/interfaces/ktexteditor/variableinterface.cpp @@ -44,5 +44,5 @@ VariableInterface *KTextEditor::variableInterface( Document *doc ) if ( ! doc ) return 0; - return static_cast<VariableInterface*>(doc->qt_cast("KTextEditor::VariableInterface")); + return dynamic_cast<KTextEditor::VariableInterface*>(doc); } diff --git a/interfaces/ktexteditor/viewcursorinterface.cpp b/interfaces/ktexteditor/viewcursorinterface.cpp index 0c834be42..58cea6289 100644 --- a/interfaces/ktexteditor/viewcursorinterface.cpp +++ b/interfaces/ktexteditor/viewcursorinterface.cpp @@ -70,5 +70,5 @@ ViewCursorInterface *KTextEditor::viewCursorInterface (View *view) if (!view) return 0; - return static_cast<ViewCursorInterface*>(view->qt_cast("KTextEditor::ViewCursorInterface")); + return dynamic_cast<KTextEditor::ViewCursorInterface*>(view); } diff --git a/interfaces/ktexteditor/viewstatusmsginterface.cpp b/interfaces/ktexteditor/viewstatusmsginterface.cpp index ff0815c89..af8870c80 100644 --- a/interfaces/ktexteditor/viewstatusmsginterface.cpp +++ b/interfaces/ktexteditor/viewstatusmsginterface.cpp @@ -72,5 +72,5 @@ ViewStatusMsgInterface *KTextEditor::viewStatusMsgInterface (View *view) if (!view) return 0; - return static_cast<ViewStatusMsgInterface*>(view->qt_cast("KTextEditor::ViewStatusMsgInterface")); + return dynamic_cast<KTextEditor::ViewStatusMsgInterface*>(view); } diff --git a/interfaces/ktexteditor/wordwrapinterface.cpp b/interfaces/ktexteditor/wordwrapinterface.cpp index 3afe5c230..6be76120b 100644 --- a/interfaces/ktexteditor/wordwrapinterface.cpp +++ b/interfaces/ktexteditor/wordwrapinterface.cpp @@ -66,5 +66,5 @@ WordWrapInterface *KTextEditor::wordWrapInterface (Document *doc) if (!doc) return 0; - return static_cast<WordWrapInterface*>(doc->qt_cast("KTextEditor::WordWrapInterface")); + return dynamic_cast<KTextEditor::WordWrapInterface*>(doc); } diff --git a/interfaces/terminal/kde_terminal_interface.h b/interfaces/terminal/kde_terminal_interface.h index 450d1e27d..c1fc2b9b5 100644 --- a/interfaces/terminal/kde_terminal_interface.h +++ b/interfaces/terminal/kde_terminal_interface.h @@ -1,4 +1,4 @@ -// interface.h -*- C++ -*- +// // interface.h -*- C++ -*- // Copyright (C) 2002 Dominique Devriese <devriese@kde.org> // Copyright (C) 2005 Peter Rockai <me@mornfall.net> @@ -60,7 +60,7 @@ class TQStrList; * setCentralWidget( p->widget() ); * * // cast the part to the TerminalInterface.. - * TerminalInterface* t = static_cast<TerminalInterface*>( p->qt_cast( "TerminalInterface" ) ); + * TerminalInterface* t = ::tqqt_cast<TerminalInterface*>( p ); * if( ! t ) * { * // This probably happens because the konsole that is installed diff --git a/interfaces/terminal/test/main.cc b/interfaces/terminal/test/main.cc index be3f4165e..6161ffc09 100644 --- a/interfaces/terminal/test/main.cc +++ b/interfaces/terminal/test/main.cc @@ -20,7 +20,7 @@ Win::Win() KParts::Part* p = static_cast<KParts::Part*>( factory->create( this, "tralala", "TQObject", "KParts::ReadOnlyPart" ) ); setCentralWidget( p->widget() ); - TerminalInterface* t = static_cast<TerminalInterface*>( p->qt_cast( "TerminalInterface" ) ); + TerminalInterface* t = ::tqqt_cast<TerminalInterface*>( p ); t->showShellInDir( TQDir::home().path() ); // TQStrList l; // l.append( "python" ); @@ -46,11 +46,11 @@ int main( int argc, char** argv ) void Win::pythonExited() { std::cerr << "hee, " << p << std::endl; - std::cerr << ( p->qt_cast( "TerminalInterface" ) ) << std::endl; + std::cerr << ( ::tqqt_cast<TerminalInterface>(p) ) << std::endl; // KMessageBox::sorry( this, TQString::fromUtf8( "Exited, status was %1" ).arg( status ) ); disconnect(p, TQT_SIGNAL( processExited() ), this, TQT_SLOT( pythonExited() )); - TerminalInterface* t = static_cast<TerminalInterface*>( p->qt_cast( "TerminalInterface" ) ); + TerminalInterface* t = ::tqqt_cast<TerminalInterface*>( p ); TQStrList l; l.append( "echo" ); l.append( "hello world" ); |