Trolltech Home | Qt4-preview-feedback Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt4-preview-feedback Archive, March 2008
Regression in Q3ButtonGroup


Message 1 in thread

Hi Trolls,

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

-- 
 [ signature omitted ] 
#include <QApplication>
#include <Q3ButtonGroup>
#include <QRadioButton>
#include <QBoxLayout>
#include <QLabel>

QLabel *l;

class Object : public QObject
{
  Q_OBJECT
  public:
    Object() {}

  public slots:
    void changed(int value)
    {
      qDebug("changed: %d", value);
      l->setText(QString::number(value));
    }
};

int main(int argc, char **argv)
{
  QApplication app(argc, argv);

  Object o;

  QWidget w(0);
  new QBoxLayout(&w, QBoxLayout::TopToBottom);

  Q3ButtonGroup grp;
  grp.setRadioButtonExclusive(true);

  o.connect(&grp, SIGNAL(clicked(int)), &o, SLOT(changed(int)));

  for (int i = 0; i < 5; i++)
  {
    QRadioButton *r = new QRadioButton("xxxxx", &w);
    static_cast<QBoxLayout*>(w.layout())->insertWidget(i, r);
    grp.insert(r);
  }

  w.show();

  l = new QLabel;
  l->show();

  return app.exec();
}

#include "moc_radio.cxx"
TEMPLATE = app
TEMPLATE = app

CONFIG += qt
TARGET = radio

QT += qt3support

SOURCES = radio.cxx

Message 2 in thread

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.
Thanks
---------------------------------

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

-- 
 [ signature omitted ] 
#include <QApplication>
#include <Q3ButtonGroup>
#include <QRadioButton>
#include <QBoxLayout>
#include <QLabel>

QLabel *l;

class Object : public QObject
{
  Q_OBJECT
  public:
    Object() {}

  public slots:
    void changed(int value)
    {
      qDebug("changed: %d", value);
      l->setText(QString::number(value));
    }
};

int main(int argc, char **argv)
{
  QApplication app(argc, argv);

  Object o;

  QWidget w(0);
  new QBoxLayout(&w, QBoxLayout::TopToBottom);

  Q3ButtonGroup grp;
  grp.setRadioButtonExclusive(true);

  o.connect(&grp, SIGNAL(clicked(int)), &o, SLOT(changed(int)));

  for (int i = 0; i < 5; i++)
  {
    QRadioButton *r = new QRadioButton("xxxxx", &w);
    static_cast<QBoxLayout*>(w.layout())->insertWidget(i, r);
    grp.insert(r);
  }

  w.show();

  l = new QLabel;
  l->show();

  return app.exec();
}

#include "moc_radio.cxx"
TEMPLATE = app
TEMPLATE = app

CONFIG += qt
TARGET = radio

QT += qt3support

SOURCES = radio.cxx