findChildren - komische Warnung
Verfasst: 8. Februar 2007 10:00
Moin,
folgender Quellcode:
liefert mir beim Compilieren folgende Ausgabe:
Ich weiß, ist nur ne Warnung, aber trotzdem würde ich gerne verstehen, was er bemängelt, denn aus der Warnung werde ich nicht schlau. Irgendwer ne Idee?
Viele Grüße,
Flachkoepper
folgender Quellcode:
Code: Alles auswählen
QList<QLineEdit* > allLineEdits = findChildren<QLineEdit *>();
for( int i=0; i< allLineEdits.size(); ++i){
connect( allLineEdits.at(i), SIGNAL(textEdited(const QString&)), this, SLOT( setDirty() ) );
}
QList<QComboBox* > allComboBoxes = this->findChildren<QComboBox *>();
for( int i=0; i< allComboBoxes.size(); ++i){
connect( allComboBoxes.at(i), SIGNAL(currentIndexChanged(int) ), this, SLOT( setDirty() ) );
}Code: Alles auswählen
/usr/local/Trolltech/Qt-4.2.2/include/QtCore/qobject.h: In function ‘QList<T> qFindChildren(const QObject*, const QString&) [with T = QLineEdit*]’:
/usr/local/Trolltech/Qt-4.2.2/include/QtCore/qobject.h:148: instantiated from ‘QList<T> QObject::findChildren(const QString&) const [with T = QLineEdit*]’
editHeader.cpp:988: instantiated from here
/usr/local/Trolltech/Qt-4.2.2/include/QtCore/qobject.h:378: warning: type-punning to incomplete type might break strict-aliasing rules
/usr/local/Trolltech/Qt-4.2.2/include/QtCore/qobject.h: In function ‘QList<T> qFindChildren(const QObject*, const QString&) [with T = QComboBox*]’:
/usr/local/Trolltech/Qt-4.2.2/include/QtCore/qobject.h:148: instantiated from ‘QList<T> QObject::findChildren(const QString&) const [with T = QComboBox*]’
editHeader.cpp:993: instantiated from here
/usr/local/Trolltech/Qt-4.2.2/include/QtCore/qobject.h:378: warning: type-punning to incomplete type might break strict-aliasing rulesViele Grüße,
Flachkoepper