|
List Info
Thread: krita bug
|
|
| krita bug |
  Netherlands |
2007-02-21 09:46:34 |
I changed the KoInputDevice class to no longer be 1 integer
as its
implementation. The direct result of that is that
implementing operator<
would be rather silly and its something I'd rather not do.
Krita uses
typedef std::map<KoInputDevice, KoID>
InputDevicePaintopMap;
InputDevicePaintopMap m_currentID;
in its kis_paintop_box.h
and it stopped compiling because of the above mentioned
change.
Can a krita guy please take a look? I'm thinking that
changing it to QMap wil
fix the problem.
Cheers!
--
Thomas Zander
_______________________________________________
koffice-devel mailing list
koffice-devel kde.org
h
ttps://mail.kde.org/mailman/listinfo/koffice-devel
|
|
| Re: krita bug |
  Netherlands |
2007-02-21 10:25:54 |
On Wednesday 21 February 2007, Thomas Zander wrote:
> I changed the KoInputDevice class to no longer be 1
integer as its
> implementation. The direct result of that is that
implementing operator<
> would be rather silly and its something I'd rather not
do.
>
> Krita uses
> typedef std::map<KoInputDevice, KoID>
InputDevicePaintopMap;
> InputDevicePaintopMap m_currentID;
> in its kis_paintop_box.h
> and it stopped compiling because of the above mentioned
change.
> Can a krita guy please take a look? I'm thinking that
changing it to QMap
> wil fix the problem.
Will do as soon as I get everything to compile again.
--
Boudewijn Rempt
http://www.va
ldyas.org/fading/index.cgi
_______________________________________________
koffice-devel mailing list
koffice-devel kde.org
h
ttps://mail.kde.org/mailman/listinfo/koffice-devel
|
|
| Re: krita bug |
  Netherlands |
2007-02-21 11:27:00 |
On Wednesday 21 February 2007, Thomas Zander wrote:
> I changed the KoInputDevice class to no longer be 1
integer as its
> implementation. The direct result of that is that
implementing operator<
> would be rather silly and its something I'd rather not
do.
>
> Krita uses
> typedef std::map<KoInputDevice, KoID>
InputDevicePaintopMap;
> InputDevicePaintopMap m_currentID;
> in its kis_paintop_box.h
> and it stopped compiling because of the above mentioned
change.
> Can a krita guy please take a look? I'm thinking that
changing it to QMap
> wil fix the problem.
Well, the key of a QMap needs operator<, too. Making it a
QMap<KoInputDevice*,
KoID> fixes the compile issue but means taking the
address of the input
device whenever it arrives in KisPaintopBox. I'll commit
that for now, but it
isn't exactly clean...
Oh, and somewhere, I fear, the signal
inputDeviceChanged(const KoInputDevice
&) signal disappeared from KoToolManager. Am I right, or
have I missed
something?
--
Boudewijn Rempt
http://www.va
ldyas.org/fading/index.cgi
_______________________________________________
koffice-devel mailing list
koffice-devel kde.org
h
ttps://mail.kde.org/mailman/listinfo/koffice-devel
|
|
| Re: krita bug |
  Netherlands |
2007-02-21 12:21:35 |
On Wednesday 21 February 2007 18:27, Boudewijn Rempt wrote:
> Well, the key of a QMap needs operator<, too. Making
it a
> QMap<KoInputDevice*, KoID> fixes the compile
issue but means taking the
> address of the input device whenever it arrives in
KisPaintopBox. I'll
> commit that for now, but it isn't exactly clean...
Can you use QHash instead?
I kind of doubt you really need the ordering...
--
Thomas Zander
_______________________________________________
koffice-devel mailing list
koffice-devel kde.org
h
ttps://mail.kde.org/mailman/listinfo/koffice-devel
|
|
| Re: krita bug |
  Netherlands |
2007-02-21 13:43:51 |
On Wednesday 21 February 2007, Thomas Zander wrote:
> On Wednesday 21 February 2007 18:27, Boudewijn Rempt
wrote:
> > Well, the key of a QMap needs operator<, too.
Making it a
> > QMap<KoInputDevice*, KoID> fixes the compile
issue but means taking the
> > address of the input device whenever it arrives in
KisPaintopBox. I'll
> > commit that for now, but it isn't exactly
clean...
>
> Can you use QHash instead?
> I kind of doubt you really need the ordering...
True. QHash would fit the bill, too. And I guess it would be
easy enough to
add a qHash function to KoInputDevice.
--
Boudewijn Rempt
http://www.va
ldyas.org/fading/index.cgi
_______________________________________________
koffice-devel mailing list
koffice-devel kde.org
h
ttps://mail.kde.org/mailman/listinfo/koffice-devel
|
|
| Re: krita bug |
  Netherlands |
2007-02-21 14:21:11 |
On Wednesday 21 February 2007 20:43, Boudewijn Rempt wrote:
> > Can you use QHash instead?
> > I kind of doubt you really need the ordering...
>
> True. QHash would fit the bill, too. And I guess it
would be easy enough to
> add a qHash function to KoInputDevice.
That function is optional, but sure, you can.
--
Thomas Zander
_______________________________________________
koffice-devel mailing list
koffice-devel kde.org
h
ttps://mail.kde.org/mailman/listinfo/koffice-devel
|
|
| Re: krita bug |
  Netherlands |
2007-02-21 14:43:12 |
On Wednesday 21 February 2007, Thomas Zander wrote:
> On Wednesday 21 February 2007 20:43, Boudewijn Rempt
wrote:
> > > Can you use QHash instead?
> > > I kind of doubt you really need the
ordering...
> >
> > True. QHash would fit the bill, too. And I guess
it would be easy enough
> > to add a qHash function to KoInputDevice.
>
> That function is optional, but sure, you can.
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."
--
Boudewijn Rempt
http://www.va
ldyas.org/fading/index.cgi
_______________________________________________
koffice-devel mailing list
koffice-devel kde.org
h
ttps://mail.kde.org/mailman/listinfo/koffice-devel
|
|
| Re: krita bug |
  Netherlands |
2007-02-22 04:09:32 |
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/qh
ash.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/qh
ash.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/qh
ash.h:803: error: no matching function for call to
‘qHash(const KoInputDevice&)’
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qh
ash.h:40: note: candidates are: uint qHash(char)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qh
ash.h:41: note: uint qHash(uchar)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qh
ash.h:42: note: uint qHash(signed char)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qh
ash.h:43: note: uint qHash(ushort)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qh
ash.h:44: note: uint qHash(short int)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qh
ash.h:45: note: uint qHash(uint)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qh
ash.h:46: note: uint qHash(int)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qh
ash.h:47: note: uint qHash(ulong)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qh
ash.h:55: note: uint qHash(long int)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qh
ash.h:56: note: uint qHash(quint64)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qh
ash.h:64: note: uint qHash(qint64)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qh
ash.h:65: note: uint qHash(QChar)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qh
ash.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/q
abstractitemmodel.h:350: note: uint
qHash(const QModelIndex&)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qh
ash.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/qh
ash.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/qh
ash.h:803: error: no matching function for call to
‘qHash(const KoInputDevice&)’
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qh
ash.h:40: note: candidates are: uint qHash(char)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qh
ash.h:41: note: uint qHash(uchar)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qh
ash.h:42: note: uint qHash(signed char)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qh
ash.h:43: note: uint qHash(ushort)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qh
ash.h:44: note: uint qHash(short int)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qh
ash.h:45: note: uint qHash(uint)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qh
ash.h:46: note: uint qHash(int)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qh
ash.h:47: note: uint qHash(ulong)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qh
ash.h:55: note: uint qHash(long int)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qh
ash.h:56: note: uint qHash(quint64)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qh
ash.h:64: note: uint qHash(qint64)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qh
ash.h:65: note: uint qHash(QChar)
/home/kde4/qt-copy/include/QtCore/../../src/corelib/tools/qh
ash.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/q
abstractitemmodel.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.va
ldyas.org/fading/index.cgi
_______________________________________________
koffice-devel mailing list
koffice-devel kde.org
h
ttps://mail.kde.org/mailman/listinfo/koffice-devel
|
|
| Re: krita bug |
  Netherlands |
2007-02-22 01:52:25 |
On Wednesday 21 February 2007 21:43, Boudewijn Rempt wrote:
> > That function is optional, but sure, you can.
>
> 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.
--
Thomas Zander
_______________________________________________
koffice-devel mailing list
koffice-devel kde.org
h
ttps://mail.kde.org/mailman/listinfo/koffice-devel
|
|
| Re: krita bug |
  France |
2007-02-22 02:13:13 |
> > 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)
--
Cyrille Berger
_______________________________________________
koffice-devel mailing list
koffice-devel kde.org
h
ttps://mail.kde.org/mailman/listinfo/koffice-devel
|
|
[1-10]
|
|