Hi.
I haveWhat would the code be if I didn't use the Signal/Slot procedure to accomplish the same thing?Qt Code:
To copy to clipboard, switch view to plain text mode
Thanks
Note: my email has changed to "edperry26@gmail.com"
Hi.
I haveWhat would the code be if I didn't use the Signal/Slot procedure to accomplish the same thing?Qt Code:
To copy to clipboard, switch view to plain text mode
Thanks
Note: my email has changed to "edperry26@gmail.com"
newProject would have to contain a class pointer to existProject and call the function directly, just as a standard C++ method call. Yeuck.
Thanks Yeuck, but that is what I'm looking for. In my 84 years there are a lot things I've forgoteen. I started programming in 1970. long btfore C, C++, windows Etc. Since 2000, I've been using Linux, and Qt since I heard of it. (I can't remember when). I am having trouble and/or patience in relearning a language I haven't used in ten years or so and thought this might be a simple way getting a translation from Singnal/Slots to C++.
Thanks again for you reply
pete Perry
Pete - also being an old timer and not used to OOP, when all else fails, I just use a global variable. Not elegant, but it works.
What I need is the actual C++ code to do what I showed in my Signal/Slots. I did a lot o programming in C++ when I was programming in "XP" and before MS, but I think seeing the actual C++ version of my Qt sample will be most helpful in triggering my old weary mind.
Thanks
Well, the connect call doesn't translate to much, but if we add a signal emit also, you'll get something like this:
Qt Code:
CLASS B; CLASS A { public: B *bptr; void somefunc(); }; CLASS B { public: }; void A::somefunc() { bptr->slotReturnUserInput("sometext","sometext"); } { some code }To copy to clipboard, switch view to plain text mode
Personally however, if your going along that route, I'd use "getUserInput" in class A and get class B to call it, rather than having class A call back class B, which is just nasty and not self-contained.
impeteperry (10th January 2010)
Bookmarks