@kas1e
Yes :).
@thread
Guys, I need help again. There is some obscure link problem along the lines of the discussion link i posted above. I have a hard time pinning down, what needs to be done, but basically it seems, that the template functions of parent classes in libQt6Gui.so and libQt6Widgtes.so are not linked to the meta objects in the classes of the app. For instance, in textedit.cpp we have
textEdit = new QTextEdit(this);
connect(textEdit, &QTextEdit::currentCharFormatChanged,
this, &TextEdit::currentCharFormatChanged);
This is done using QObject::connect(), which is defined like this :
template <typename Func1, typename Func2>
static inline QMetaObject::Connection connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal,
const typename QtPrivate::FunctionPointer<Func2>::Object *receiver, Func2 slot,
Qt::ConnectionType type = Qt::AutoConnection)
{
typedef QtPrivate::FunctionPointer<Func1> SignalType;
typedef QtPrivate::FunctionPointer<Func2> SlotType;
(... bla bla ...)
return connectImpl(sender, reinterpret_cast<void **>(&signal),
receiver, reinterpret_cast<void **>(&slot),
new QtPrivate::QSlotObject<Func2, typename QtPrivate::List_Left<typename SignalType::Arguments, SlotType::ArgumentCount>::Value,
typename SignalType::ReturnType>(slot),
type, types, &SignalType::Object::staticMetaObject);
}
Notice, that the staticMetaObject is located in the moc code of QTextEdit, which is part of libQt6Widgets.so. When linking statically ( - this is the hypothesis - ) the reference goes through, and the signal will be connected. When linking dynamically, this for some reason breaks.
The strange thing ( and now it gets really hairy ) is, that when you look at the symbol table of the textedit executable, you have this :
Quote:
01068f3c g O .bss 0000001c _ZN9QTextEdit16staticMetaObjectE@@Qt_6
And the symbol table of libQt6Widgets.so :
Quote:
107221a4 g O .data.rel.ro 0000001c _ZN9QTextEdit16staticMetaObjectE
This part, I don't understand. Please help me out! :)
EDIT : To abreviate - .bss is an empty, non-initialized line of data-bytes, whereas .data is a line of data-bytes initialized by set values in the data-segment of the object.
This is really strange, because what appears to be, is that an empty structure has been allocated for the staticMetaObject in the executable code, whereas it should have been linked to a set structure in the .data section of the libQt6Widgets.so shared object.
Could this be confirmed by anyone familiar with the concepts? Is this a strange compile bug, or is there some logical explanation/solution??
Edited by alfkil on 2021/11/26 13:41:30
Edited by alfkil on 2021/11/26 14:17:51
Edited by alfkil on 2021/11/26 14:21:19
Edited by alfkil on 2021/11/26 18:04:38
Edited by alfkil on 2021/11/28 2:13:10