void MyQObjectBasedClass::valueChanged( QDateTime dt ) { qDebug() << "value:" << &dt;}
value: 0x0
QDateTimeEdit * edit = new QDateTimeEdit;...MyQObjectBasedClass * myobject = new MyQObjectBasedClass;...connect( edit, SIGNAL( dateTimeChanged(QDateTime) ), myobject, SLOT( valueChanged(QDateTime) ) );
edit->setDateTime( .../*тут например QDateTime::currentDateTime(), хотя писал и константы*/ );
connect( edit, SIGNAL( dateTimeChanged(QDateTime) ), myobject, SLOT( valueChanged(QDateTime) ) );
connect( edit, SIGNAL( dateTimeChanged ( const QDateTime &) ), myobject, SLOT( valueChanged ( const QDateTime &) ) );
connect(dateTimeEdit, SIGNAL(dateTimeChanged(QDateTime)), this, SLOT(valueChanged1(QDateTime)));connect(dateTimeEdit, SIGNAL(dateTimeChanged(const QDateTime &)), this, SLOT( valueChanged2(const QDateTime &)));.....void Test::valueChanged1(QDateTime dt){ qDebug() << "valueChanged1:" << &dt;}void Test::valueChanged2( const QDateTime &dt ){ qDebug() << "valueChanged2:" << &dt;}
void MyQObjectBasedClass::valueChanged( QDateTime dt ) { qDebug() << "value:" << dt;}
QDateTimeEdit * edit = new QDateTimeEdit;MyQObjectBasedClass * myobject = new MyQObjectBasedClass;
if( QDateTimeEdit * editor = qobject_cast<QDateTimeEdit*>(sender()) ) qDebug() << "sender value:" << editor->dateTime();
void f(int i) { cout<<&i<<endl;}void ff(const int& i) { f(i);}void fff(const int* i) { ff(*i);}int main() { fff(0);}
struct test_t { int i[12];};void f(test_t i) { cout<<i.i<<" "<<&i<<endl;}void ff(const test_t& i) { cout<<&i<<endl;}typedef void (*FF)(const test_t&);void fff(const test_t* i, FF f) { f(*i);}int main() { fff(0, (FF)f); fff(0, (FF)ff);}