J
Jack
Dear all,
I'm using a commercial library that I cannot modify. There's this one
class in the library which is almost 90% usable. But unfortunately, I
have to reimplement 3 member functions. The problem is the original
class is not designed very well, because it is assumed to be the final
class. Because I have to modify some private members in the
reimplemented functions. What should I do? Design a new class or doing
something else?
Here is the detailed information:
I have to design a Label class which can show both bitmap and text.
I'm using QT as my base library. QT has a class named QLabel, but it
only supports either bitmap or text. QLabel has two virtual functions,
one is setText, and another is setPixmap, but they eliminate the other
one when being called. So I have to reimplement the two functions. But
the problem is the text and bitmap members are private in QT, and
there's no other functions to set the values other than setText and
setPixmap. So what should I do? Simply copy the code and design a new
class according to QLabel or else?
Thanks in advance!
Jack
I'm using a commercial library that I cannot modify. There's this one
class in the library which is almost 90% usable. But unfortunately, I
have to reimplement 3 member functions. The problem is the original
class is not designed very well, because it is assumed to be the final
class. Because I have to modify some private members in the
reimplemented functions. What should I do? Design a new class or doing
something else?
Here is the detailed information:
I have to design a Label class which can show both bitmap and text.
I'm using QT as my base library. QT has a class named QLabel, but it
only supports either bitmap or text. QLabel has two virtual functions,
one is setText, and another is setPixmap, but they eliminate the other
one when being called. So I have to reimplement the two functions. But
the problem is the text and bitmap members are private in QT, and
there's no other functions to set the values other than setText and
setPixmap. So what should I do? Simply copy the code and design a new
class according to QLabel or else?
Thanks in advance!
Jack