Browse Source

Fix crash due to findFunctionsButton not being found. Add FIXME for less hackish solution which requires the new QToolBar.

git-svn-id: file:///var/svn/tigccpp/trunk@1000 9552661e-59e3-4036-b4f2-dbe53926924f
kevinkofler 17 years ago
parent
commit
7c405fa774
1 changed files with 9 additions and 2 deletions
  1. 9 2
      ktigcc/mainform.cpp

+ 9 - 2
ktigcc/mainform.cpp

@@ -1184,8 +1184,15 @@ void MainForm::init()
     toolsConfigureAction->setIcon(KIcon("configure"));
     debugResetAction->setIcon(KIcon("player_stop"));
   }
-  QToolButton *findFunctionsButton=static_cast<QToolButton *>(toolBar
-    ->child("findFunctionsAction_action_button","QToolButton",FALSE));
+// FIXME: Use this once I move from Q3ToolBar to QToolBar
+//  QToolButton *findFunctionsButton=static_cast<QToolButton *>(toolBar
+//    ->widgetForAction(findFunctionsAction));
+  QToolButton *findFunctionsButton=NULL;
+  QList<QToolButton *> allToolButtons=toolBar->findChildren<QToolButton *>();
+  Q_FOREACH(QToolButton *toolButton, allToolButtons) {
+    if (toolButton->defaultAction()==findFunctionsAction)
+      findFunctionsButton=toolButton;
+  }
   findFunctionsPopup=new Q3PopupMenu(findFunctionsButton);
   connect(findFunctionsPopup,SIGNAL(aboutToShow()),
           this,SLOT(findFunctionsPopup_aboutToShow()));