C++ (Qt)connect( ui.comboBox, SIGNAL( currentIndexChanged( const QString & ) ), this, SLOT( XXX() ) );
C++ (Qt)connect( ui.comboBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(XXX()));
C++ (Qt)void MainWindow::on_pushButton_clicked(){ qDebug() << &str; emit someSignal(str);}
C++ (Qt)void MainWindow::someSlot(const QString &str){ qDebug() << &str;}
C++ (Qt)QObject::connect(this, SIGNAL(someSignal(QString)), SLOT(someSlot(QString))/*, Qt::QueuedConnection*/);
C++ (Qt)private slots: void someSlot(QString);signals: void someSignal(QString str);
C++ (Qt)QObject::connect(this, SIGNAL(someSignal(QString)), SLOT(someSlot(QString)));
C++ (Qt)signals: void someSignal(const QString& str); void someSignal(QString str);
C++ (Qt)signals: void getData( QString &data ); ... void Obj::formData(){ QString str; emit getData( str ); if( !str.isEmpty() ) useData( str );}
C++ (Qt)А еще в некоторых случаях, я могу захотеть сделать следующее:
C++ (Qt)QObject::connect(this, SIGNAL(someSignal(QString&)), SLOT(someSlot(QString&))/*, Qt::QueuedConnection*/);
Object::connect: No such signal MainWindow::someSignal(QString)
QObject::connect: Cannot queue arguments of type 'QString&'(Make sure 'QString&' is registered using qRegisterMetaType().)