Bug 117973 - KDualColorButton does not have parent
Summary: KDualColorButton does not have parent
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: general (show other bugs)
Version: 1.x
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-09 01:11 UTC by Andrew Walker
Modified: 2005-12-19 17:30 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Walker 2005-12-09 01:11:37 UTC
Version:           HEAD (using KDE KDE 3.4.0)
Installed from:    Compiled From Sources
OS:                Linux

When the user clicks on a KDualColoarButton the color selector that is launched is not parented, and so can disappear behind the dialog that it was launched from.

There are currently five KDualColorButton widgets in use in Kst.

The problem is that in the constructor of the KDualColorButton there are seperate parameters for the parent of the widget itself and the parent of the color selector when it is launched from the widget. The latter is always NULL as the KDualColorButton's are created in Qt Designer generated code, which omits the second parent parameter value.

Either we should generate these widgets in our own code or modify KDualColorButton to use the same parent for itself and the color selector.
Comment 1 George Staikos 2005-12-19 17:30:12 UTC
SVN commit 489731 by staikos:

try hard to set a parent for the dialog so it doesn't fall behind when created
by designer.
BUG: 117973


 M  +5 -1      kdualcolorbutton.cpp  
 M  +2 -0      kdualcolorbutton.h  


--- branches/KDE/3.5/kdelibs/kdeui/kdualcolorbutton.cpp #489730:489731
@@ -36,7 +36,11 @@
   : QWidget(parent, name),
     d (new KDualColorPrivate)
 {
-    d->dialogParent = dialogParent;
+    if (!dialogParent && parent) {
+	d->dialogParent = parent;
+    } else {
+	d->dialogParent = dialogParent;
+    }
 
     arrowBitmap = new QBitmap(dcolorarrow_width, dcolorarrow_height,
                               (const unsigned char *)dcolorarrow_bits, true);
--- branches/KDE/3.5/kdelibs/kdeui/kdualcolorbutton.h #489730:489731
@@ -61,6 +61,8 @@
      * Constructs a new KDualColorButton using the default black and white
      * colors.
      *
+     * As of KDE 3.5, sets the dialog parent to the same as "parent" if that
+     * argument is non-null.
      */
     KDualColorButton(QWidget *parent=0, const char *name=0, QWidget* dialogParent=0);