KComboBox in designer WAS Re: kartesio

Albert Astals Cid aacid at kde.org
Wed May 8 17:29:19 UTC 2013


El Dimecres, 8 de maig de 2013, a les 14:18:43, Orestes Mas va escriure:
> El Dimarts 07 Maig 2013, a les 23:57:32, Albert Astals Cid va escriure:
> > El Dimarts, 7 de maig de 2013, a les 23:54:58, LucaTringali va escriure:
> > > Hello,just wanted to tell you that I fixed the CMakeLists file to
> > > consider
> > > as required libzorbaneural, and also wrote a basic documentation.I'm
> > > going
> > > to find out how to use krazy code checker, so the program will be ready
> > > for
> > > going out of playground. Luca Tringali
> > 
> > Just use the englishbreakfastnetwork
> > 
> > http://www.englishbreakfastnetwork.org/krazy/reports/playground/edu/kartes
> > io /index.html
> 
> I learned about Krazy in this thread. Interesting thing, didn't know it
> before.
> 
> I'm applying it to my program, and I've followed its suggestions to fix most
> issues, but it remain an issue in the "c++" module I don't know how to
> resolve:
> 
> This is an issue related to using Qt classes instead of KDE equivalents.
> Here is the output of Krazy:
> 
> 25. Check for Qt classes that should not be used [qclasses]... 2 issues
> found ./src/myaudiocombo.h: Use KComboBox instead of QComboBox line#42
> ./src/myaudiocombo.cpp: Use KComboBox instead of QComboBox line#126
> 
> These 2 issues are the same one: I'm using a QComboBox in Qt Designer
> instead of using KComboBox.
> 
> To fix it it's enough to use a KComboBox in designer, but the point is I
> cannot do that because I want this combo act as an own-derived class
> (myaudiocombo) and to do that I've to *promote* the standard combo in
> designer to my combo class, but designer only allows me to promote Qt
> classes, not KDE ones.
> 
> Do you know which is the proper way to handle this (pretty common, I
> presume) situation?

My suggestion, don't inherit from Q/KComboBox, don't think you really need it.

I've looked at your class the only think i can see is you hijacking the polish 
event, but you can totally do that with an eventFilter if you need to. The 
rest just seems like would totally work with "have a KComboBox" instead of "is 
a KComboBox".

Cheers,
  Albert



More information about the kde-edu mailing list