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

List:       kde-bindings
Subject:    [Kde-bindings] qtruby QAbstractListModel::setRoleNames -> ArgumentError
From:       Florian Staudacher <florian_staudacher () yahoo ! de>
Date:       2012-07-07 11:11:54
Message-ID: 4FF8197A.70201 () yahoo ! de
[Download RAW message or body]

Hi again!

Sorry to bombard you with my messages,
but I ran into another problem. It seems like the type used by
ItemModels to handle role name mappings for QML cannot be used from
ruby. I am getting this error when trying to call setRoleNames (or
set_role_names) on my subclass of QAbstractListModel:


   classname    == QAbstractListModel
   :: method == setRoleNames
   -> methodIds == [#<Qt::Internal::ModuleIndex:0x000000012d6800
   @smoke=0, @index=282>]
   candidate list:
           void QAbstractItemModel::setRoleNames(const
      QHash<int,QByteArray>&)  (smoke: 0 index: 282)
   matching => smoke: 0 index: 282
         const QHash<int,QByteArray>& (U)
   match => 282 score: 1
   Resolved to id: 282
   setCurrentMethod(smokeList index: 0, meth index: 282)
   test.rb:282:in `method_missing': Cannot handle 'const
   QHash<int,QByteArray>&' as argument of
   QAbstractItemModel::setRoleNames (ArgumentError)


I have tried setting it to:

   { 1 => "something" }  # or
   { 1 => Qt::ByteArray.new("something") }  # or
   [ 1 => "something" ]  # or
   [ 1 => Qt::ByteArray.new("something") ]

but they all produced the same message. Also, reading the roleNames
property of that object results in a similar message:


   ArgumentError: Cannot handle 'const QHash<int,QByteArray>&' as
   return-type of QAbstractItemModel::roleNames


This can be reproduced always with the following snippet:

   require 'Qt4'
   model = Qt::AbstractListModel.new
   model.role_names

Thank you for your help!

- Florian


P.S: would you prefer those kind of messages here on the mailing list or
on the kde bugtracker?
_______________________________________________
Kde-bindings mailing list
Kde-bindings@kde.org
https://mail.kde.org/mailman/listinfo/kde-bindings
[prev in list] [next in list] [prev in thread] [next in thread] 

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