Qt Creator's Designer plugin “Go to slot" working fine only at first create code
-
Here is the code:
mainwindow.h
mainwindow.cpp
When I press the "go to slot" button in the "Upload log" button right-click menu, I expect it to go to the code that it automatically connects to, but it doesn't work.
When I press the "go to slot" button in the "Run diagnostics" button right-click menu, I expect it automatically create the code and go to the code, it works fine. It auto create code and turn to the code file's line.
But when i press it second time. It not working too like Upload log.
I decided to come here to try my luck. This problem has troubled me for a long time, especially when I want to maintain some old code. I have done some searches on this problem, but it has not been solved.
Qt creator version: 4.15.0 on windows
Designer plugin version: 4.15.0 -
I still has the same problem since Qt Creator 4.15, despite updating to the recent version of Qt Creator.
have you found a solution?
-
It works as designed I think. It's more of a poor marketing problem really. This thing is an " automatic code generator that creates a method which name matches that needed for an autoconnect feature", but that would obviously be a terrible name, so they called it "go to slot". Maybe "create a slot" would be a better fit? Basically it only works once because you can't have two methods named the same and opening the generated code is not the center part of this feature. Creating it is.
The whole autoconnect stuff is not a very good feature to be honest and I would discourage you from using it. I think it was created in the Delphi/Visual C++ popularity times to make Qt more familiar to the users of those tools, but it doesn't really fit.
The designer is that way for at least a decade now and widgets are not really the center stage feature now, so I highly doubt anything will change here on its own.If you want that behavior to change you can always make a feature request on https://bugreports.qt.io/. I guess it shouldn't be that much work to modify it, but I don't know that code so can't say for sure.
-
This post is deleted!
-
I am very happy to see someone try to explain this problem, thank you very much Chris Kawa.
@Chris-Kawa For this Issue. I used that feature about 3 years ago, maybe 5... I know that "go to slot" button do the same things like that describe, at least before. I agree with your suggestion, using automatic connection signal is not a good way. I will connect action manually in the future. thanks for your adviced.
@AhmedBedier I have bad luck for that Issue. But I have good news for you. Currently I am using QtCreator 5.0.3 and designer plugin 5.0.3 on Ubuntu 1804. This problem did not occur on that platform and version I used. Hope this message is useful to you.