Thanks Zlatomir and others, that worked. I have to read and learn some more, thought that your answer wasn't necessary with Auto-Connect.
Thanks Zlatomir and others, that worked. I have to read and learn some more, thought that your answer wasn't necessary with Auto-Connect.
Auto-connect still needs a function to link to though, it can't guess what you want to do when you press that button![]()
Yes that's the part i understand. Btw i do my stuf up till now in visual basic.
What i don't understand is where do i declare a slot. From the textfinderexample i thought in textfinder.h witch i posted earlier but then i get the moc_textfinder.h error.
Now i declared them both in header and ccp, no errors now.
Also i am still figuring out the C++ approuch with main, header, source and preprocessing.
Thanks, Digidas.
A slot is the same as any other normal C++ method, the "slots:" part is just for MOC (the C++ preprocessor removes it before invoking the compiler)
Normally you would put the prototype of the function (the signature) in the class declaration, and then the body of the function in your .cpp file. For small functions, sometimes the body is included in the class declaration, but I always think it looks better to have a clear seperation - prototypes and class declarations in header file, code in cpp file.
Bookmarks