[Jahshaka-cvs] jah/jahwidgets/src/qt3/python list_view.cpp, 1.3, 1.4 icon_view.cpp, 1.2, 1.3
Status: Beta
Brought to you by:
jahshaka
From: John B. <ok_...@us...> - 2007-03-27 20:16:28
|
Update of /cvsroot/jahshaka/jah/jahwidgets/src/qt3/python In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv25498/jahwidgets/src/qt3/python Modified Files: list_view.cpp icon_view.cpp Log Message: Icon/Listview improvements and delegate changes. Index: icon_view.cpp =================================================================== RCS file: /cvsroot/jahshaka/jah/jahwidgets/src/qt3/python/icon_view.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- icon_view.cpp 17 Jan 2007 14:52:35 -0000 1.2 +++ icon_view.cpp 27 Mar 2007 20:16:22 -0000 1.3 @@ -48,19 +48,6 @@ return WStringToQString::convert( path_for_item( index ) ); } - /// Return the data representing the pixmap - QByteArray dataForItem( int index ) const { - QByteArray bytes; - - std::string data = data_for_item( index ); - if ( data.size() ) { - // deep copy - bytes.duplicate( data.data(), data.size() ); - } - - return bytes; - } - virtual il::image_type_ptr imageForItem( int index ) const { return image_for_item( index ); } @@ -92,19 +79,6 @@ } } - virtual std::string data_for_item( int index ) const { - if ( py::override o = get_override( "data_for_item" ) ) { -#if defined (_WIN32) - return py::call<std::string>(o.ptr(), index); -#else - return o( index ); -#endif - } - else { - return std::string(); - } - } - virtual il::image_type_ptr image_for_item( int index ) const { if ( py::override o = get_override( "image_for_item" ) ) { #if defined (_WIN32) @@ -126,19 +100,19 @@ { // The control py::scope scope = py::class_< qt3::iconview, boost::noncopyable >( - "icon_view", py::init< qt3::widget_handle* >( ) ) + "icon_view", py::init< qt3::widget_handle >( ) ) .def( "valid", &qt3::iconview::valid ) .def( "update", &qt3::iconview::update ) + .def( "item_updated", &qt3::iconview::itemUpdated ) .def( "handle", &qt3::iconview::handle ) .def( "register_delegate", &qt3::iconview::setDelegate ) ; // The delegate - scoped by icon_view py::class_< qt3::icon_view_delegate, boost::noncopyable >( "delegate", py::init< >( ) ) - .def( "count", pure_virtual(&qt3::icon_view_delegate::count) ) + .def( "count", py::pure_virtual(&qt3::icon_view_delegate::count) ) .def( "label_for_item", &qt3::icon_view_delegate::label_for_item ) .def( "path_for_item", &qt3::icon_view_delegate::path_for_item ) - .def( "data_for_item", &qt3::icon_view_delegate::data_for_item ) .def( "image_for_item", &qt3::icon_view_delegate::image_for_item ) ; } Index: list_view.cpp =================================================================== RCS file: /cvsroot/jahshaka/jah/jahwidgets/src/qt3/python/list_view.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- list_view.cpp 21 Mar 2007 10:47:08 -0000 1.3 +++ list_view.cpp 27 Mar 2007 20:16:22 -0000 1.4 @@ -38,9 +38,9 @@ ); } - QString labelForItem( int index, const QString& parentId ) const { + QString labelForItem( int index, int col, const QString& parentId ) const { return WStringToQString::convert( - label_for_item( index, QStringToWString::convert( parentId ) ) + label_for_item( index, col, QStringToWString::convert( parentId ) ) ); } @@ -66,8 +66,8 @@ } - virtual opl::wstring label_for_item( int index, const opl::wstring& parentId ) const { - return py::call<opl::wstring>(get_override( "label_for_item" ).ptr( ), index, parentId ); + virtual opl::wstring label_for_item( int index, int col, const opl::wstring& parentId ) const { + return py::call<opl::wstring>(get_override( "label_for_item" ).ptr( ), index, col, parentId ); } virtual bool item_is_branch( int index, const opl::wstring& parentId ) const { @@ -86,7 +86,7 @@ { // The control py::scope scope = py::class_< qt3::listview, boost::noncopyable >( - "list_view", py::init< qt3::widget_handle* >( ) ) + "list_view", py::init< qt3::widget_handle >( ) ) .def( "valid", &qt3::listview::valid ) .def( "update", &qt3::listview::update ) .def( "handle", &qt3::listview::handle ) @@ -95,10 +95,10 @@ // The delegate - scoped by list_view py::class_< qt3::list_view_delegate, boost::noncopyable >( "delegate", py::init< >( ) ) - .def( "child_count_of_item", &qt3::list_view_delegate::child_count_of_item ) - .def( "identifier_for_item", &qt3::list_view_delegate::identifier_for_item ) - .def( "label_for_item", &qt3::list_view_delegate::label_for_item ) - .def( "columns", &qt3::list_view_delegate::columns ) - .def( "column_label", &qt3::list_view_delegate::column_label ) + .def( "child_count_of_item", py::pure_virtual(&qt3::list_view_delegate::child_count_of_item) ) + .def( "identifier_for_item", py::pure_virtual(&qt3::list_view_delegate::identifier_for_item) ) + .def( "label_for_item", py::pure_virtual(&qt3::list_view_delegate::label_for_item) ) + .def( "columns", py::pure_virtual(&qt3::list_view_delegate::columns) ) + .def( "column_label", py::pure_virtual(&qt3::list_view_delegate::column_label) ) ; } |