Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-2833

QRadiobutton in Q3ButtonGroup does not emit clicked()

    XMLWordPrintable

Details

    Description

      The first radio button in the cole below does not emit the clicked() signal. A Qt 3 version of the same code works perfectly.

      // ----------------------------------------------------
      #include <Qt3Support>
      #include <QtGui>

      class Button : public Q3ButtonGroup
      {
      Q_OBJECT

      public:
      Button( QWidget * parent ) : Q3ButtonGroup( parent, "dd" )

      { QHBoxLayout * l = new QHBoxLayout( this ); b1 = new QRadioButton( "I don't work", this ); b2 = new QRadioButton( "I work", this ); b3 = new QRadioButton( "I work", this ); l->addWidget( b1 ); l->addWidget( b2 ); l->addWidget( b3 ); connect( b1, SIGNAL( clicked() ), this, SLOT( btnClicked() ) ); connect( b2, SIGNAL( clicked() ), this, SLOT( btnClicked() ) ); connect( b3, SIGNAL( clicked() ), this, SLOT( btnClicked() ) ); }

      public slots:
      void btnClicked()

      { qDebug() << "Clicked!"; }

      private:
      QAbstractButton * b1, * b2, * b3;
      };

      class Test : public Q3MainWindow
      {
      public:
      Test( QWidget * parent = 0, const char * name = 0 )
      : Q3MainWindow( parent, name, 0 )

      { Button * b = new Button( this ); setCentralWidget( b ); }

      };

      int main( int argc, char * argv[] )
      {
      QApplication app( argc, argv );
      Test test;
      test.show();
      return app.exec();
      }

      #include "main.moc"
      // ----------------------------------------------------

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            bjnilsen Bjørn Erik Nilsen
            admin Administrator
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes