Promoting inside code.
-
wrote on 27 Jan 2014, 13:16 last edited by
Hi All,
I have a lot of QLineEdit which I need to promote to a subclass of QLineEdit that I wrote myself.
How can I promote without using the user interface of QtCreator? I want to do it in the code.
Thanks
-
If you want to write code, how about using your sub-class which is inherited from QLineEdit. This is lot better.
-
wrote on 27 Jan 2014, 13:34 last edited by
Yes... I want to use my sub-class.... but how to do it?
I do not want to go and promote each single QLineEdit manually.
-
You write an new class and inherit from QLineEdit. You add the new functionality to new class or modify the existing functionality.
@class mylineedit : public QLineEdit {
}@
I'm confident you are aware of this.
-
What "promote" feature actually does is replacing the name of the original class with the promoted one, so if you want it in code the equivalent is find/replace. There's really not much more to it.
-
wrote on 27 Jan 2014, 20:31 last edited by
Yes I was aware of that.
On the other end.. I used qt creator to put the QlineEdit.. so I cannot edit the text. I clicked each one and promoted them .. it did not took that long.
Thanks for your help.
1/6