[SOLVED] How to use connect in a shared library?
-
Is the slot declared as a slot? Does live in a class that inherits from QObject, and is there Q_OBJECT macro there in the header?
-
@Mohammadsm
I have added markdown tags for code sections of post.
Please checkout the "markdown tags" at the end of thread. -
@Mohammadsm
You need to use three of ` at start and end of your code block.Check the end of the whole thread here. There is a short explanation.
Some keyboards do not support ` as a key. In this case you can go to the end of the thread and copy the three characters required and paste them where needed. -
Your class does not inherit from QObject. Try this:
class LIBRARY1SHARED_EXPORT Library1 : public QObject
Then remeber to rebuild and relink the library, and your project that uses it.
-
@SGaist said:
@sierdzio Indeed the back ticks are not mandatory, however it gives the forum engine a good hint of what is following
in the cheat sheet you can actually find:
Blocks of code are either fenced by lines with three back-ticks ```, or are indented with four spaces. I recommend only using the fenced code blocks -- they're easier and only they support syntax highlighting.The question is what is the syntax highlighting now?