Reading The documentation on Qt signals and slots , it seems that the only reason for the failure of the new style is: "If there is already a duplicate (the same signal for the same slot on the same objects), the connection will fail and the connection will return false"
This means that the connection was already successful for the first time and does not allow multiple connections when using Qt :: UniqueConnection.
Does this mean that the Qt-5 style mix will always succeed? Are there any other reasons for refusing?
The new style connectmay still work at runtime for various reasons:
connect
sender
receiver
PMF, , . ++, , , , - .
, : signals: . moc , , , . , , connect, , connect , ( ).
signals:
moc
-. , TU:
moc_class.cpp
connect(sender, &Sender::signal, ...)
TU , , , , , , ..; ABI .
, 1., , 2; , (. , , GNU ld ARM , ).
Qt / , , , . , Qt 5.9 -Bsymbolic* GCC x86 x86-64.
-Bsymbolic*
, , . , connect return false, .
, , (, nullptr)
QObject* obj1 = new QObject(); QObject* obj2 = new QObject(); // Will succeed connect(obj1, &QObject::destroyed, obj2, &QObject::deleteLater); delete obj1; obj1 = nullptr; // Will fail even if it compiles connect(obj1, &QObject::destroyed, obj2, &QObject::deleteLater);
No, this is not always successful. The docs give an example here where it connectreturns false, because the signal should not contain variable names.
// WRONG QObject::connect(scrollBar, SIGNAL(valueChanged(int value)), label, SLOT(setNum(int value)));
Source: https://habr.com/ru/post/1675120/More articles:Hiding the middle view first in terms of the coordinator - androidHow lazily interpreted in a recursive context? - scala.Poliline to draw the path to the graphs from the values โโof the database? - jqueryWriting binary data using node.js fs.writeFile to create an image file - javascriptShow percentage by column on stacked histogram - rhow to make f-string dictionary format in python 3.6? - pythonHow to set backarrow instead of hamburger icon for only one single fragment? - androidHow to print a long line in breakpoint actions in Visual Studio? - c ++to detect when the request window is closed for Google recaptcha - javascripthttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1675125/confluent-maven-repository-not-working&usg=ALkJrhgfvyoBPhAYV94nnargJK09k6sbeAAll Articles