Solved how to solve name clash emit?
-
@Marek said in how to solve name clash emit?:
there will be a lot of this :(
Don't blame Qt but the other library - emit, signals and slots as macro are used by Qt since ages.
-
@Christian-Ehrlicher I don't, this was easy, but library does not do what I want.
Some recommended way to convert pdf to doc via lib or web api ?Best,
Marek -
If the only problem is with the word "emit", then you can just not use "emit" when you call your signals.
This works the same:
emit somethingChanged(); somethingChanged();
At least I can say for sure on the Linux desktop platform in Qt 5.14, "emit" expands to empty space:
include/QtCore/qobjectdefs.h:97:# define emit
-
@KH-219Design said in how to solve name clash emit?:
qobjectdefs.h
Looking in that same file (qobjectdefs.h), it seems you might also be able to rebuild Qt with preprocessor def "QT_NO_EMIT" set? (I have not tried it)
#ifndef QT_NO_EMIT # define emit #endif
-
@KH-219Design said in how to solve name clash emit?:
be able to rebuild Qt with preprocessor def "QT_NO_EMIT" set? (I have not tried it)
It's in a header - why should you need to rebuild the whole Qt? "CONFIG += no_keywords" does simply define QT_NO_KEYWORDS which then defines QT_NO_EMIT (see line 85)
-
@Christian-Ehrlicher said in how to solve name clash emit?:
It's in a header - why should you need to rebuild the whole Qt?
I'm not sure whether you do or do not need to rebuild.
However, there is certainly a case where you would need to.
If certain lines in a header file are conditionally "in" or "out" due to being gated by "#ifdef CPP_VAR", then everything in your application that "sees" that header needs to agree on which lines are in and which are out. So if Qt libraries were built one way (for example with CPP_VAR unset) and those Qt libraries contain binary code based on that version of the header, and then you build your executable with a different setting (for example setting CPP_VAR), then your code will see different lines of that header, meaning you are using a header ("the api") that does not match up with the Qt libs (the "the aBi"). (api = app programming interface; abi = app binary interface)
-
@KH-219Design said in how to solve name clash emit?:
I'm not sure whether you do or do not need to rebuild.
You don't have to rebuild Qt for this define.
-
Hi
Thanks all for help, I have added keyword to pro file and replaces all emit, signals, slots and it works.
"If the only problem is with the word "emit", then you can just not use "emit" when you call your signals."
The problem was in compiling 3rd part library into my program and "emit" was used in this third part library.Anyway, I'm marking this as solved.
Thanks
Marek -
Regarding Aspose.PDF for C++, The common library asposecpplib has MulticastDelegate::emit() function and 'emit' is QT keyword as well. This is the main reason for the conflict and error you were facing. So yes, your assumptions were correct. We are working over resolving the conflict and as soon as it is resolved, we will surely inform you. Please spare us some time.
PS: I am Asad Ali and I work at Aspose as Developer Evangelist.
-
We are excited to share that QT Support has been added to the Aspose.PDF for C++. You can now download and use Aspose.PDF for C++ 20.6 with QT Project. Please let us know about your feedback in case you face any issue.
-
@asad-ali thanks for your effort ;)