[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: krita bug
From:       Boudewijn Rempt <boud () valdyas ! org>
Date:       2007-02-22 10:09:32
Message-ID: 200702221109.34664.boud () valdyas ! org
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


On Thursday 22 February 2007, Cyrille Berger wrote:
> > > I thought it was obligatory for QHash keys because the dox say "The \
> > > key type of a QHash must provide operator==() and a global qHash(Key)
> > > function."
> > 
> > It compiles and works fine without, as far as I can see.
> 
> Qt provides quiet a few usual qHash ;) (and there is one for pointers)

Pointers is what we don't want to use in this class. Qt only has qHash \
methods for any integer type (char, unsigned long, etc.), any pointer type, \
QChar,  QString, and QByteArray. Just using QHash on KoInputDevices
given a compile error. I've added a very stupid & simple qHash function to 
KoInputDevice which I'll commit in a moment.

/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qhash.h: In \
member function ‘typename QHash<Key, T>::Node** QHash<Key, \
T>::findNode(const Key&, uint*) const [with Key = KoInputDevice, T = \
                KoID]':
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qhash.h:789:   \
instantiated from ‘typename QHash<Key, T>::iterator QHash<Key, \
                T>::find(const Key&) [with Key = KoInputDevice, T = KoID]'
/home/kde4/koffice/krita/ui/kis_paintop_box.cc:163:   instantiated from \
                here
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qhash.h:803: \
                error: no matching function for call to ‘qHash(const \
                KoInputDevice&)'
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qhash.h:40: note: \
                candidates are: uint qHash(char)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qhash.h:41: note: \
                uint qHash(uchar)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qhash.h:42: note: \
                uint qHash(signed char)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qhash.h:43: note: \
                uint qHash(ushort)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qhash.h:44: note: \
                uint qHash(short int)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qhash.h:45: note: \
                uint qHash(uint)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qhash.h:46: note: \
                uint qHash(int)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qhash.h:47: note: \
                uint qHash(ulong)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qhash.h:55: note: \
                uint qHash(long int)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qhash.h:56: note: \
                uint qHash(quint64)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qhash.h:64: note: \
                uint qHash(qint64)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qhash.h:65: note: \
                uint qHash(QChar)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qhash.h:66: note: \
                uint qHash(const QByteArray&)
/home/kde4/kde4/include/kurl.h:1020: note:                 uint qHash(const \
                QString&)
/home/kde4/kde4/include/kshortcut.h:159: note:                 uint \
                qHash(const QKeySequence&)
/home/kde4/kde4/include/kshortcut.h:154: note:                 uint \
                qHash(const KShortcut&)
/home/kde4/kde4/include/kurl.h:1021: note:                 uint qHash(const \
                KUrl&)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/kernel/qabstractitemmodel.h:350: \
                note:                 uint qHash(const QModelIndex&)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qhash.h: In \
member function ‘typename QHash<Key, T>::Node** QHash<Key, \
T>::findNode(const Key&, uint*) const [with Key = KoInputDevice, T = \
                QList<KisPaintOpSettings*>]':
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qhash.h:789:   \
instantiated from ‘typename QHash<Key, T>::iterator QHash<Key, \
T>::find(const Key&) [with Key = KoInputDevice, T = \
                QList<KisPaintOpSettings*>]'
/home/kde4/koffice/krita/ui/kis_paintop_box.cc:230:   instantiated from \
                here
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qhash.h:803: \
                error: no matching function for call to ‘qHash(const \
                KoInputDevice&)'
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qhash.h:40: note: \
                candidates are: uint qHash(char)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qhash.h:41: note: \
                uint qHash(uchar)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qhash.h:42: note: \
                uint qHash(signed char)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qhash.h:43: note: \
                uint qHash(ushort)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qhash.h:44: note: \
                uint qHash(short int)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qhash.h:45: note: \
                uint qHash(uint)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qhash.h:46: note: \
                uint qHash(int)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qhash.h:47: note: \
                uint qHash(ulong)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qhash.h:55: note: \
                uint qHash(long int)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qhash.h:56: note: \
                uint qHash(quint64)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qhash.h:64: note: \
                uint qHash(qint64)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qhash.h:65: note: \
                uint qHash(QChar)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qhash.h:66: note: \
                uint qHash(const QByteArray&)
/home/kde4/kde4/include/kurl.h:1020: note:                 uint qHash(const \
                QString&)
/home/kde4/kde4/include/kshortcut.h:159: note:                 uint \
                qHash(const QKeySequence&)
/home/kde4/kde4/include/kshortcut.h:154: note:                 uint \
                qHash(const KShortcut&)
/home/kde4/kde4/include/kurl.h:1021: note:                 uint qHash(const \
                KUrl&)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/kernel/qabstractitemmodel.h:350: \
note:                 uint qHash(const QModelIndex&) make[2]: *** \
[krita/ui/CMakeFiles/kritaui.dir/kis_paintop_box.o] Error 1 make[1]: *** \
[krita/ui/CMakeFiles/kritaui.dir/all] Error 2


-- 
Boudewijn Rempt 
http://www.valdyas.org/fading/index.cgi


[Attachment #5 (application/pgp-signature)]

_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic