Guarantee the display of the current tool's options widget on startup.
Works around a Qt 3.0 bug but it is safe to apply this patch for Qt > 3.0.

2004/12/11

Clarence Dang
For support: <kolourpaint-support@lists.sourceforge.net>

--- kolourpaint-1.2.2_kde3/kolourpaint/widgets/kptooltoolbar.cpp	2004-08-14 15:40:09.000000000 +1000
+++ kolourpaint-1.2.2_kde3/kolourpaint/widgets/kptooltoolbar.cpp	2004-12-11 17:46:23.000000000 +1100
@@ -152,6 +152,36 @@
 }
 
 
+// public virtual [base KToolBar]
+void kpToolToolBar::show ()
+{
+#if DEBUG_KP_TOOL_TOOL_BAR
+    kdDebug () << "kpToolToolBar::show()" << endl;
+#endif
+    
+    KToolBar::show ();
+
+
+    // HACK: Qt 3.0: If a dialog (e.g. colour depth not high enough) is
+    //       displayed before the mainWindow (and this toolbar) is
+    //       shown, even if we call show() for one or more of the tool
+    //       widgets, they are hidden even when the mainWindow (and this
+    //       toolbar) is shown.  Force show them now.
+    for (QValueVector <kpToolWidgetBase *>::const_iterator it = m_toolWidgets.begin ();
+         it != m_toolWidgets.end ();
+         it++)
+    {
+        // if ((*it)->isShown ())  <-- not there in Qt 3.0
+        // COMPAT: this seems to work - using undocumented, internal Qt flag :(
+        if (!(*it)->testWState (Qt::WState_ForceHide))
+        {
+            (*it)->hide ();
+            (*it)->show ();
+        }
+    }
+}
+
+
 // public
 void kpToolToolBar::registerTool (kpTool *tool)
 {
--- kolourpaint-1.2.2_kde3/kolourpaint/widgets/kptooltoolbar.h	2004-07-10 21:17:10.000000000 +1000
+++ kolourpaint-1.2.2_kde3/kolourpaint/widgets/kptooltoolbar.h	2004-12-11 16:46:08.000000000 +1100
@@ -57,6 +57,8 @@
     kpToolToolBar (kpMainWindow *mainWindow, int colsOrRows = 2, const char *name = 0);
     virtual ~kpToolToolBar ();
 
+    virtual void show ();
+
     void registerTool (kpTool *tool);
     void unregisterTool (kpTool *tool);
     void unregisterAllTools ();
