Own sorting func in KTabListBox
Frank Werner
FrankWerner at t-online.de
Tue Nov 2 22:03:59 GMT 1999
Hi guys,
i want to implement an own function whitch sorts a row in KTabListBox,
because the sorting order is wrong when the data is a date coming from
QDate.toString().
This is a part from my actual project:
kccview.h:
----- snip ---------------------------------------
class KccView : public KTabListBox
{
Q_OBJECT
public:
KccView(KApplication* a=0,QWidget *parent = 0);
~KccView();
public slots:
void slotViewUpdate(void);
private:
int cmpDate(char *, char *);
};
----- snip ---------------------------------------
kccview.cpp:
----- snip ---------------------------------------
KccView::KccView(KApplication* a,QWidget *parent):KTabListBox(parent)
{
setNumCols( 4 );
setSeparator('\t');
setColumn( 0, i18n("Type"), 100, TextColumn, SimpleOrder);
setColumn( 1, i18n("Line"), 100, TextColumn, SimpleOrder);
setColumn( 2, i18n("Sender"), 100, TextColumn, SimpleOrder);
setColumn( 3, i18n("Date"), 100, TextColumn, SimpleOrder, \
Descending, false, cmpDate);
changeMode(3);
}
----- snip ---------------------------------------
The compiler/linker acts with the following message:
ccview.cpp:18: no matching function for call to `KccView::setColumn (int, const char *, int, KTabListBox::ColumnType, KTabListBox::OrderType, KTabListBox::OrderMode, bool, int (KccView::)(char *, char *))'
/opt/kde/include/ktablistbox.h:273: candidates are: KTabListBox::setColumn(int, const char *, int, KTabListBox::ColumnType, KTabListBox::OrderType, KTabListBox::OrderMode, bool, int (*)(const char *, const char *))
make[1]: Leaving directory `/home/frank/projects/kcc/kcc'
make[1]: *** [kccview.o] Error 1
Whats wrong?
Thanks for any suggestions.
Frank
More information about the KDevelop
mailing list