Hi, Martin,

Martin Koller wrote:
> Hi Trolls,
> I sent this mail 10 days ago to the preview list, as someone from your
> support said I should do so, as this list is read by the developers.
> Until now I got no repsonse - even though this regression makes
> Q3ButtonGroup with radio buttons stop working !
> I tried again with the latest snapshot I found - which interestingly is
> already 5 days old: qt-x11-commercial-src-4.4.0-snapshot-20080325
> The problem still persists and this is a major bug!
> Please forward the following to the appropriate developers.
> using the 4.4 snapshot of today on Linux I found that Q3ButtonGroup does
> no longer work!
> It does not emit the clicked() signal for any button except for the
> last.
> See attached example

We apologize for the delay; your report was not lost, it just fell into an
unfortunate time pit as the responsible Trolls were on easter holiday. You
can find a fix for this regression below. Thanks for reporting it.

--- q3buttongroup.cpp  2008/03/05 14:08:50.000000000
+++ q3buttongroup.cpp  2008/04/01 07:41:15.000000000

@@ -200,15 +200,6 @@
     if (isExclusive() || !qobject_cast<QRadioButton*>(button))
         group.addButton(button);

-    // synchronize buttonIds and group.buttons()
-    QList<QAbstractButton *> buttons = group.buttons();
-    QMutableMapIterator<int, QAbstractButton *> i(buttonIds);
-    while (i.hasNext()) {
-        i.next();
-        if (!buttons.contains(i.value()))
-            i.remove();
-    }
-
     static int seq_no = -2;
     if (id < -1)
         id = seq_no--;
@@ -218,6 +209,7 @@
     connect(button, SIGNAL(pressed()) , SLOT(buttonPressed()));
     connect(button, SIGNAL(released()), SLOT(buttonReleased()));
     connect(button, SIGNAL(clicked()) , SLOT(buttonClicked()));
+    connect(button, SIGNAL(destroyed()) , SLOT(buttonDestroyed()));
     return id;
 }

@@ -340,6 +332,16 @@
         emit clicked(senderId);
 }

+/*!
+  \internal
+*/
+void Q3ButtonGroup::buttonDestroyed()
+{
+    int id = buttonIds.key(static_cast<QAbstractButton *>(sender()), -1);
+    if (id != -1)
+        buttonIds.remove(id);
+}
+
 void Q3ButtonGroup::setButton(int id)
 {
     QAbstractButton *b = find(id);


--- q3buttongroup.h  2007/12/07 18:06:34.000000000
+++ q3buttongroup.h  2008/04/01 07:41:15.000000000

@@ -73,6 +73,9 @@
 protected:
     bool event(QEvent * e);

+private Q_SLOTS:
+    void buttonDestroyed();
+
 private:
     Q_DISABLE_COPY(Q3ButtonGroup)

-- 
Andreas Aardal Hanssen
Senior Software Engineer, Team Lead / Widgets
Trolltech ASA - Sandakerveien 116, NO-0484 Oslo, Norway

To unsubscribe - send "unsubscribe" in the subject to [EMAIL PROTECTED]

Reply via email to