[commonqt-devel] No applicable method setData
Stas Boukarev
stassats at gmail.com
Tue Mar 22 23:23:20 UTC 2011
Olaf Merkert <olaf at m-merkert.de> writes:
> Hi,
>
> I sort of ported one of the Qt4 Tutorials on Models to commonqt, because I
> want to get to know both Qt4 MVC stuff and commonqt a bit. I more or less just
> wrote the C++ Code in Lisp syntax.
> However, there is an error with the bit of code that calls setData (I attached
> the relevant code):
>
> No applicable method setData found on #<QStandardItemModel 0x00886620> with
> arguments (#<QModelIndex 0x007817A0>
> #<QDateTime
> 0x00889540>)
> [Condition of type SIMPLE-ERROR]
>
> I tried wrapping the QDateTime object in a QVariant, but that doesn't help, I
> get a similar error:
>
> No applicable method setData found on #<QStandardItemModel 0x008894D0> with
> arguments (#<QModelIndex 0x0088A130>
> #<QVariant
> 0x0088A2E0>)
> [Condition of type SIMPLE-ERROR]
>
>
> Qt Documentation says setData expects a QVariant& as the last parameter, but I
> have no clue how to make one of these. Also, setData works fine with strings.
>
> I use sbcl 1.0.40.0.debian on Debian Squeeze, amd64 and the latest commonqt
> installed via quicklisp (20110320-git).
>
> Can anybody help me? I'd like to understand where this problem comes from.
Marshalling of DateTimes into QVariant isn't implemented yet, but
(#_new QVariant DateTime) should work with the following patch:
https://github.com/stassats/commonqt/commit/96daa6894111090ff0a52648fd1a730d41a0c209
--
With best regards, Stas.
More information about the commonqt-devel
mailing list