From 350ea98430a1e092e3e9ea98206dfecd8d527716 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Tue, 27 Oct 2015 11:03:30 -0200 Subject: [PATCH] Do not dynamic_cast QObject, use qobject_cast, it's faster. qobject_cast doesn't use RTTI to figure out the type, it uses an internally stored relationship, wich is much faster than RTTI. I grepped the code for dynamic_cast and there are lots besides this one, so I'll later try to figure out wich ones are QObject inheritances and change acordingly. Signed-off-by: Tomaz Canabrava --- src/ui/MainWindow.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/MainWindow.cc b/src/ui/MainWindow.cc index cf5e46b73..1017ac73b 100644 --- a/src/ui/MainWindow.cc +++ b/src/ui/MainWindow.cc @@ -399,7 +399,7 @@ void MainWindow::_hideAllDockWidgets(void) void MainWindow::_showDockWidgetAction(bool show) { - QAction* action = dynamic_cast(QObject::sender()); + QAction* action = qobject_cast(QObject::sender()); Q_ASSERT(action); _showDockWidget(action->text(), show); } -- 2.22.0