From ca1533509e52479e222710469d4eb2fd898f18b2 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Mon, 7 Jun 2010 10:08:47 -0300
Subject: [PATCH 0001/1129] Bump to version 0.3.3.
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6e7c708..4b26d1c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -41,7 +41,7 @@ find_package(Qt4 4.5.0 REQUIRED)
set(BINDING_NAME PySide)
set(BINDING_API_MAJOR_VERSION "0")
set(BINDING_API_MINOR_VERSION "3")
-set(BINDING_API_MICRO_VERSION "2")
+set(BINDING_API_MICRO_VERSION "3")
set(BINDING_API_VERSION "${BINDING_API_MAJOR_VERSION}.${BINDING_API_MINOR_VERSION}.${BINDING_API_MICRO_VERSION}")
set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" )
From 471486732b03cbb42b884158604a59d5a18e8a35 Mon Sep 17 00:00:00 2001
From: Marcelo Lira
Date: Mon, 7 Jun 2010 16:23:37 -0300
Subject: [PATCH 0002/1129] Removed an copy'n'paste error from the
documentation of new style signals/slots.
Reviewed by Hugo Parente
Reviewed by Luciano Wolf
---
doc/newsigslot.rst | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/doc/newsigslot.rst b/doc/newsigslot.rst
index b73a6b9..15e9fca 100644
--- a/doc/newsigslot.rst
+++ b/doc/newsigslot.rst
@@ -30,16 +30,12 @@ New way: Signal() and Slot()
The new-style uses a different syntax to create and to connect signals/slots. The previous example could be rewritten as:
::
-
+
...
def someFunc():
print "someFunc has been called!"
- ...
-
- clicked = QtCore.Signal()
-
button = QtGui.QPushButton("Call someFunc")
button.clicked.connect(someFunc)
From ab918abc1e103e0ca86939f7d057e8a44ac8a4ef Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Mon, 7 Jun 2010 14:43:45 -0300
Subject: [PATCH 0003/1129] Created new unittest model.
Separete unittest for module.
Only run unittest for compiled modules.
Reviewer: Marcelo Lira ,
Luciano Wolf
---
tests/CMakeLists.txt | 60 ++++++++++-----
tests/QtCore/CMakeLists.txt | 71 ++++++++++++++++++
.../blocking_signals_test.py | 0
tests/{qtcore => QtCore}/buffer_test.py | 0
tests/{qtcore => QtCore}/child_event_test.py | 0
tests/{qtcore => QtCore}/deletelater_test.py | 0
.../{qtcore => QtCore}/duck_punching_test.py | 0
.../missing_symbols_test.py | 0
tests/{qtcore => QtCore}/qabs_test.py | 0
.../qabstracttransition_test.py | 0
.../qanimationgroup_test.py | 0
tests/{qtcore => QtCore}/qbitarray_test.py | 0
.../qbytearray_buffer_protocol_test.py | 0
.../qbytearray_concatenation_operator_test.py | 0
.../qbytearray_operator_iadd_test.py | 0
.../qbytearray_operator_test.py | 0
tests/{qtcore => QtCore}/qbytearray_test.py | 0
tests/{qtcore => QtCore}/qchar_test.py | 0
.../qcoreapplication_instance_test.py | 0
tests/{qtcore => QtCore}/qdatastream_test.py | 0
tests/{qtcore => QtCore}/qdate_test.py | 0
tests/{qtcore => QtCore}/qenum_test.py | 0
tests/{qtcore => QtCore}/qevent_test.py | 0
tests/{qtcore => QtCore}/qfile_test.py | 0
tests/{qtcore => QtCore}/qfileinfo_test.py | 0
tests/{qtcore => QtCore}/qflags_test.py | 0
tests/{qtcore => QtCore}/qhandle_test.py | 0
.../{qtcore => QtCore}/qlatin1string_test.py | 0
tests/{qtcore => QtCore}/qlinef_test.py | 0
tests/{qtcore => QtCore}/qlocale_test.py | 0
tests/{qtcore => QtCore}/qmetaobject_test.py | 0
.../qmodelindex_internalpointer_test.py | 0
.../qobject_children_segfault_test.py | 0
.../qobject_connect_notify_test.py | 0
.../qobject_event_filter_test.py | 0
.../qobject_inherits_test.py | 0
.../{qtcore => QtCore}/qobject_parent_test.py | 0
.../qobject_property_test.py | 0
.../qobject_protected_methods_test.py | 0
tests/{qtcore => QtCore}/qobject_test.py | 0
.../qobject_timer_event_test.py | 0
.../qobject_tr_as_instance_test.py | 0
tests/{qtcore => QtCore}/qpoint_test.py | 0
tests/{qtcore => QtCore}/qprocess_test.py | 0
tests/{qtcore => QtCore}/qrect_test.py | 0
tests/{qtcore => QtCore}/qresource_test.py | 0
tests/{qtcore => QtCore}/qsize_test.py | 0
tests/{qtcore => QtCore}/qslot_object_test.py | 0
tests/{qtcore => QtCore}/qsrand_test.py | 0
tests/{qtcore => QtCore}/qstate_test.py | 0
.../{qtcore => QtCore}/qstatemachine_test.py | 0
.../qstring_buffer_protocol_test.py | 0
.../qstring_operator_test.py | 0
tests/{qtcore => QtCore}/qstring_test.py | 0
tests/{qtcore => QtCore}/qstringlist_test.py | 0
tests/{qtcore => QtCore}/qtext_codec_test.py | 0
tests/{qtcore => QtCore}/qtextstream_test.py | 0
.../qthread_prod_cons_test.py | 0
.../{qtcore => QtCore}/qthread_signal_test.py | 0
tests/{qtcore => QtCore}/qthread_test.py | 0
.../qtimer_singleshot_test.py | 0
.../{qtcore => QtCore}/qtimer_timeout_test.py | 0
tests/{qtcore => QtCore}/qtnamespace_test.py | 0
tests/{qtcore => QtCore}/quoteEnUS.txt | 0
tests/{qtcore => QtCore}/qurl_test.py | 0
.../qvariant_pyobject_test.py | 0
tests/{qtcore => QtCore}/qvariant_test.py | 0
tests/{qtcore => QtCore}/resources.qrc | 0
tests/{qtcore => QtCore}/resources_mc.py | 0
.../{qtcore => QtCore}/static_method_test.py | 0
.../static_protected_methods_test.py | 0
tests/{qtcore => QtCore}/thread_signals.py | 14 +---
tests/{qtcore => QtCore}/translation_test.py | 0
.../translations/trans_latin.ts | 0
.../translations/trans_russian.ts | 0
.../{qtcore => QtCore}/unaryoperator_test.py | 0
tests/{qtcore => QtCore}/unicode_test.py | 0
tests/QtDeclarative/CMakeLists.txt | 2 +
.../network.qml | 0
.../qdeclarativenetwork_test.py | 0
.../qdeclarativeview_test.py | 0
.../{qtdeclarative => QtDeclarative}/view.qml | 0
tests/QtGui/CMakeLists.txt | 58 ++++++++++++++
tests/{qtgui => QtGui}/add_action_test.py | 0
.../customproxywidget_test.py | 0
.../float_to_int_implicit_conversion_test.py | 0
.../grandparent_method_test.py | 0
tests/{qtgui => QtGui}/hashabletype_test.py | 0
tests/{qtgui => QtGui}/keep_reference_test.py | 0
.../{qtgui => QtGui}/missing_symbols_test.py | 0
tests/{qtgui => QtGui}/paint_event_test.py | 0
tests/{qtgui => QtGui}/parent_method_test.py | 0
.../python_properties_test.py | 0
tests/{qtgui => QtGui}/qapp_test.py | 0
.../qapplication_exit_segfault_test.py | 0
.../qapplication_singleton_test.py | 0
tests/{qtgui => QtGui}/qbrush_test.py | 0
tests/{qtgui => QtGui}/qcolor_test.py | 0
.../qdatastream_gui_operators_test.py | 0
tests/{qtgui => QtGui}/qfontdialog_test.py | 0
tests/{qtgui => QtGui}/qfontmetrics_test.py | 0
.../qgraphicsitem_isblocked_test.py | 0
tests/{qtgui => QtGui}/qgraphicsitem_test.py | 0
.../qgraphicsproxywidget_test.py | 0
tests/{qtgui => QtGui}/qgraphicsscene_test.py | 0
.../{qtgui => QtGui}/qinputdialog_get_test.py | 0
tests/{qtgui => QtGui}/qitemselection_test.py | 0
tests/{qtgui => QtGui}/qlayout_ref_test.py | 0
tests/{qtgui => QtGui}/qlayout_test.py | 0
tests/{qtgui => QtGui}/qlcdnumber_test.py | 0
.../{qtgui => QtGui}/qlistwidgetitem_test.py | 0
tests/{qtgui => QtGui}/qmainwindow_test.py | 0
tests/{qtgui => QtGui}/qmatrix_test.py | 0
tests/{qtgui => QtGui}/qmenu_test.py | 0
tests/{qtgui => QtGui}/qmenuadd_test.py | 0
tests/{qtgui => QtGui}/qobject_mi_test.py | 0
tests/{qtgui => QtGui}/qpainter_test.py | 0
tests/{qtgui => QtGui}/qpen_test.py | 0
tests/{qtgui => QtGui}/qpixmap_test.py | 0
tests/{qtgui => QtGui}/qpushbutton_test.py | 0
.../{qtgui => QtGui}/qradialgradient_test.py | 0
tests/{qtgui => QtGui}/qregion_test.py | 0
tests/{qtgui => QtGui}/qshortcut_test.py | 0
.../qstandarditemmodel_test.py | 0
.../qstring_qkeysequence_test.py | 0
tests/{qtgui => QtGui}/qstyle_test.py | 0
tests/{qtgui => QtGui}/qtableview_test.py | 0
tests/{qtgui => QtGui}/qtabwidget_test.py | 0
tests/{qtgui => QtGui}/qtextedit_test.py | 0
tests/{qtgui => QtGui}/qtoolbar_test.py | 0
tests/{qtgui => QtGui}/qtoolbox_test.py | 0
tests/{qtgui => QtGui}/qvariant_test.py | 0
.../qwidget_setlayout_test.py | 0
tests/{qtgui => QtGui}/qwidget_test.py | 0
.../{qtgui => QtGui}/reference_count_test.py | 0
tests/{qtgui => QtGui}/sample.png | Bin
tests/{qtgui => QtGui}/standardpixmap_test.py | 0
tests/{qtgui => QtGui}/timed_app_test.py | 0
.../virtual_protected_inheritance_test.py | 0
.../{qtgui => QtGui}/virtual_pure_override.py | 0
tests/{qtgui => QtGui}/wrong_return_test.py | 0
tests/{qtgui => QtGui}/x11_symbols.py | 0
tests/QtHelp/CMakeLists.txt | 1 +
tests/{qthelp => QtHelp}/help_test.py | 0
tests/QtMaemo5/CMakeLists.txt | 2 +
.../pickselector_test.py | 0
.../qmaemo5import_test.py | 0
tests/QtMultimedia/CMakeLists.txt | 1 +
.../audio_test.py | 0
tests/QtNetwork/CMakeLists.txt | 4 +
.../accessManager_test.py | 0
tests/{qtnetwork => QtNetwork}/http_test.py | 0
.../tcpserver_test.py | 0
.../udpsocket_test.py | 0
tests/QtOpenGL/CMakeLists.txt | 3 +
.../{qtopengl => QtOpenGL}/qglbuffer_test.py | 0
tests/QtScript/CMakeLists.txt | 3 +
tests/{qtscript => QtScript}/base_test.py | 0
tests/{qtscript => QtScript}/engine_test.py | 0
tests/{qtscript => QtScript}/test_base.py | 0
tests/QtScriptTools/CMakeLists.txt | 1 +
.../debugger_test.py | 0
tests/QtSql/CMakeLists.txt | 1 +
.../qsqldatabaseandqueries_test.py | 0
tests/QtSvg/CMakeLists.txt | 1 +
tests/{qtsvg => QtSvg}/qsvggenerator_test.py | 0
tests/QtTest/CMakeLists.txt | 2 +
tests/{qttest => QtTest}/click_test.py | 0
tests/{qttest => QtTest}/eventfilter_test.py | 0
tests/QtUiTools/CMakeLists.txt | 2 +
tests/{qtuitools => QtUiTools}/test.ui | 0
tests/{qtuitools => QtUiTools}/ui_test.py | 0
.../{qtuitools => QtUiTools}/uiloader_test.py | 0
tests/QtWebKit/CMakeLists.txt | 2 +
tests/{qtwebkit => QtWebKit}/fox.html | 0
tests/{qtwebkit => QtWebKit}/webpage_test.py | 0
tests/{qtwebkit => QtWebKit}/webview_test.py | 0
tests/QtXml/CMakeLists.txt | 2 +
tests/{qtxml => QtXml}/qdomdocument_test.py | 0
.../{qtxml => QtXml}/qxmlsimplereader_test.py | 0
tests/QtXmlPatterns/CMakeLists.txt | 1 +
.../import_test.py | 0
tests/phonon/CMakeLists.txt | 2 +
tests/qtgui/qlabel_pixmap_refcount.py | 46 ------------
tests/run_test.sh | 8 +-
tests/signals/CMakeLists.txt | 32 ++++++++
tests/signals/args_dont_match_test.py | 1 +
tests/signals/decorators_test.py | 0
tests/signals/invalid_callback_test.py | 0
tests/signals/lambda_gui_test.py | 0
tests/signals/lambda_test.py | 0
.../signals/multiple_connections_gui_test.py | 0
tests/signals/multiple_connections_test.py | 0
tests/signals/pysignal_test.py | 0
tests/signals/qobject_destroyed_test.py | 0
tests/signals/qobject_receivers_test.py | 0
tests/signals/segfault_proxyparent_test.py | 0
tests/signals/self_connect_test.py | 0
tests/signals/short_circuit_test.py | 0
tests/signals/signal2signal_connect_test.py | 0
tests/signals/signal_autoconnect_test.py | 0
.../signals/signal_connectiontype_support.py | 0
tests/signals/signal_emission_gui_test.py | 0
tests/signals/signal_emission_test.py | 0
tests/signals/signal_func_test.py | 0
tests/signals/signal_manager_refcount_test.py | 0
tests/signals/signal_object_test.py | 0
.../signal_with_primitive_type_test.py | 0
tests/signals/slot_reference_count_test.py | 0
tests/signals/static_metaobject_test.py | 0
tests/signals/upstream_segfault_test.py | 0
211 files changed, 241 insertions(+), 79 deletions(-)
create mode 100644 tests/QtCore/CMakeLists.txt
rename tests/{qtcore => QtCore}/blocking_signals_test.py (100%)
rename tests/{qtcore => QtCore}/buffer_test.py (100%)
rename tests/{qtcore => QtCore}/child_event_test.py (100%)
rename tests/{qtcore => QtCore}/deletelater_test.py (100%)
rename tests/{qtcore => QtCore}/duck_punching_test.py (100%)
rename tests/{qtcore => QtCore}/missing_symbols_test.py (100%)
rename tests/{qtcore => QtCore}/qabs_test.py (100%)
rename tests/{qtcore => QtCore}/qabstracttransition_test.py (100%)
rename tests/{qtcore => QtCore}/qanimationgroup_test.py (100%)
rename tests/{qtcore => QtCore}/qbitarray_test.py (100%)
rename tests/{qtcore => QtCore}/qbytearray_buffer_protocol_test.py (100%)
rename tests/{qtcore => QtCore}/qbytearray_concatenation_operator_test.py (100%)
rename tests/{qtcore => QtCore}/qbytearray_operator_iadd_test.py (100%)
rename tests/{qtcore => QtCore}/qbytearray_operator_test.py (100%)
rename tests/{qtcore => QtCore}/qbytearray_test.py (100%)
rename tests/{qtcore => QtCore}/qchar_test.py (100%)
rename tests/{qtcore => QtCore}/qcoreapplication_instance_test.py (100%)
rename tests/{qtcore => QtCore}/qdatastream_test.py (100%)
rename tests/{qtcore => QtCore}/qdate_test.py (100%)
rename tests/{qtcore => QtCore}/qenum_test.py (100%)
rename tests/{qtcore => QtCore}/qevent_test.py (100%)
rename tests/{qtcore => QtCore}/qfile_test.py (100%)
rename tests/{qtcore => QtCore}/qfileinfo_test.py (100%)
rename tests/{qtcore => QtCore}/qflags_test.py (100%)
rename tests/{qtcore => QtCore}/qhandle_test.py (100%)
rename tests/{qtcore => QtCore}/qlatin1string_test.py (100%)
rename tests/{qtcore => QtCore}/qlinef_test.py (100%)
rename tests/{qtcore => QtCore}/qlocale_test.py (100%)
rename tests/{qtcore => QtCore}/qmetaobject_test.py (100%)
rename tests/{qtcore => QtCore}/qmodelindex_internalpointer_test.py (100%)
rename tests/{qtcore => QtCore}/qobject_children_segfault_test.py (100%)
rename tests/{qtcore => QtCore}/qobject_connect_notify_test.py (100%)
rename tests/{qtcore => QtCore}/qobject_event_filter_test.py (100%)
rename tests/{qtcore => QtCore}/qobject_inherits_test.py (100%)
rename tests/{qtcore => QtCore}/qobject_parent_test.py (100%)
rename tests/{qtcore => QtCore}/qobject_property_test.py (100%)
rename tests/{qtcore => QtCore}/qobject_protected_methods_test.py (100%)
rename tests/{qtcore => QtCore}/qobject_test.py (100%)
rename tests/{qtcore => QtCore}/qobject_timer_event_test.py (100%)
rename tests/{qtcore => QtCore}/qobject_tr_as_instance_test.py (100%)
rename tests/{qtcore => QtCore}/qpoint_test.py (100%)
rename tests/{qtcore => QtCore}/qprocess_test.py (100%)
rename tests/{qtcore => QtCore}/qrect_test.py (100%)
rename tests/{qtcore => QtCore}/qresource_test.py (100%)
rename tests/{qtcore => QtCore}/qsize_test.py (100%)
rename tests/{qtcore => QtCore}/qslot_object_test.py (100%)
rename tests/{qtcore => QtCore}/qsrand_test.py (100%)
rename tests/{qtcore => QtCore}/qstate_test.py (100%)
rename tests/{qtcore => QtCore}/qstatemachine_test.py (100%)
rename tests/{qtcore => QtCore}/qstring_buffer_protocol_test.py (100%)
rename tests/{qtcore => QtCore}/qstring_operator_test.py (100%)
rename tests/{qtcore => QtCore}/qstring_test.py (100%)
rename tests/{qtcore => QtCore}/qstringlist_test.py (100%)
rename tests/{qtcore => QtCore}/qtext_codec_test.py (100%)
rename tests/{qtcore => QtCore}/qtextstream_test.py (100%)
rename tests/{qtcore => QtCore}/qthread_prod_cons_test.py (100%)
rename tests/{qtcore => QtCore}/qthread_signal_test.py (100%)
rename tests/{qtcore => QtCore}/qthread_test.py (100%)
rename tests/{qtcore => QtCore}/qtimer_singleshot_test.py (100%)
rename tests/{qtcore => QtCore}/qtimer_timeout_test.py (100%)
rename tests/{qtcore => QtCore}/qtnamespace_test.py (100%)
rename tests/{qtcore => QtCore}/quoteEnUS.txt (100%)
rename tests/{qtcore => QtCore}/qurl_test.py (100%)
rename tests/{qtcore => QtCore}/qvariant_pyobject_test.py (100%)
rename tests/{qtcore => QtCore}/qvariant_test.py (100%)
rename tests/{qtcore => QtCore}/resources.qrc (100%)
rename tests/{qtcore => QtCore}/resources_mc.py (100%)
rename tests/{qtcore => QtCore}/static_method_test.py (100%)
rename tests/{qtcore => QtCore}/static_protected_methods_test.py (100%)
rename tests/{qtcore => QtCore}/thread_signals.py (70%)
rename tests/{qtcore => QtCore}/translation_test.py (100%)
rename tests/{qtcore => QtCore}/translations/trans_latin.ts (100%)
rename tests/{qtcore => QtCore}/translations/trans_russian.ts (100%)
rename tests/{qtcore => QtCore}/unaryoperator_test.py (100%)
rename tests/{qtcore => QtCore}/unicode_test.py (100%)
create mode 100644 tests/QtDeclarative/CMakeLists.txt
rename tests/{qtdeclarative => QtDeclarative}/network.qml (100%)
rename tests/{qtdeclarative => QtDeclarative}/qdeclarativenetwork_test.py (100%)
rename tests/{qtdeclarative => QtDeclarative}/qdeclarativeview_test.py (100%)
rename tests/{qtdeclarative => QtDeclarative}/view.qml (100%)
create mode 100644 tests/QtGui/CMakeLists.txt
rename tests/{qtgui => QtGui}/add_action_test.py (100%)
rename tests/{qtgui => QtGui}/customproxywidget_test.py (100%)
rename tests/{qtgui => QtGui}/float_to_int_implicit_conversion_test.py (100%)
rename tests/{qtgui => QtGui}/grandparent_method_test.py (100%)
rename tests/{qtgui => QtGui}/hashabletype_test.py (100%)
rename tests/{qtgui => QtGui}/keep_reference_test.py (100%)
rename tests/{qtgui => QtGui}/missing_symbols_test.py (100%)
rename tests/{qtgui => QtGui}/paint_event_test.py (100%)
rename tests/{qtgui => QtGui}/parent_method_test.py (100%)
rename tests/{qtgui => QtGui}/python_properties_test.py (100%)
rename tests/{qtgui => QtGui}/qapp_test.py (100%)
rename tests/{qtgui => QtGui}/qapplication_exit_segfault_test.py (100%)
rename tests/{qtgui => QtGui}/qapplication_singleton_test.py (100%)
rename tests/{qtgui => QtGui}/qbrush_test.py (100%)
rename tests/{qtgui => QtGui}/qcolor_test.py (100%)
rename tests/{qtgui => QtGui}/qdatastream_gui_operators_test.py (100%)
rename tests/{qtgui => QtGui}/qfontdialog_test.py (100%)
rename tests/{qtgui => QtGui}/qfontmetrics_test.py (100%)
rename tests/{qtgui => QtGui}/qgraphicsitem_isblocked_test.py (100%)
rename tests/{qtgui => QtGui}/qgraphicsitem_test.py (100%)
rename tests/{qtgui => QtGui}/qgraphicsproxywidget_test.py (100%)
rename tests/{qtgui => QtGui}/qgraphicsscene_test.py (100%)
rename tests/{qtgui => QtGui}/qinputdialog_get_test.py (100%)
rename tests/{qtgui => QtGui}/qitemselection_test.py (100%)
rename tests/{qtgui => QtGui}/qlayout_ref_test.py (100%)
rename tests/{qtgui => QtGui}/qlayout_test.py (100%)
rename tests/{qtgui => QtGui}/qlcdnumber_test.py (100%)
rename tests/{qtgui => QtGui}/qlistwidgetitem_test.py (100%)
rename tests/{qtgui => QtGui}/qmainwindow_test.py (100%)
rename tests/{qtgui => QtGui}/qmatrix_test.py (100%)
rename tests/{qtgui => QtGui}/qmenu_test.py (100%)
rename tests/{qtgui => QtGui}/qmenuadd_test.py (100%)
rename tests/{qtgui => QtGui}/qobject_mi_test.py (100%)
rename tests/{qtgui => QtGui}/qpainter_test.py (100%)
rename tests/{qtgui => QtGui}/qpen_test.py (100%)
rename tests/{qtgui => QtGui}/qpixmap_test.py (100%)
rename tests/{qtgui => QtGui}/qpushbutton_test.py (100%)
rename tests/{qtgui => QtGui}/qradialgradient_test.py (100%)
rename tests/{qtgui => QtGui}/qregion_test.py (100%)
rename tests/{qtgui => QtGui}/qshortcut_test.py (100%)
rename tests/{qtgui => QtGui}/qstandarditemmodel_test.py (100%)
rename tests/{qtgui => QtGui}/qstring_qkeysequence_test.py (100%)
rename tests/{qtgui => QtGui}/qstyle_test.py (100%)
rename tests/{qtgui => QtGui}/qtableview_test.py (100%)
rename tests/{qtgui => QtGui}/qtabwidget_test.py (100%)
rename tests/{qtgui => QtGui}/qtextedit_test.py (100%)
rename tests/{qtgui => QtGui}/qtoolbar_test.py (100%)
rename tests/{qtgui => QtGui}/qtoolbox_test.py (100%)
rename tests/{qtgui => QtGui}/qvariant_test.py (100%)
rename tests/{qtgui => QtGui}/qwidget_setlayout_test.py (100%)
rename tests/{qtgui => QtGui}/qwidget_test.py (100%)
rename tests/{qtgui => QtGui}/reference_count_test.py (100%)
rename tests/{qtgui => QtGui}/sample.png (100%)
rename tests/{qtgui => QtGui}/standardpixmap_test.py (100%)
rename tests/{qtgui => QtGui}/timed_app_test.py (100%)
rename tests/{qtgui => QtGui}/virtual_protected_inheritance_test.py (100%)
rename tests/{qtgui => QtGui}/virtual_pure_override.py (100%)
rename tests/{qtgui => QtGui}/wrong_return_test.py (100%)
rename tests/{qtgui => QtGui}/x11_symbols.py (100%)
create mode 100644 tests/QtHelp/CMakeLists.txt
rename tests/{qthelp => QtHelp}/help_test.py (100%)
create mode 100644 tests/QtMaemo5/CMakeLists.txt
rename tests/{qtmaemo5 => QtMaemo5}/pickselector_test.py (100%)
rename tests/{qtmaemo5 => QtMaemo5}/qmaemo5import_test.py (100%)
create mode 100644 tests/QtMultimedia/CMakeLists.txt
rename tests/{qtmultimedia => QtMultimedia}/audio_test.py (100%)
create mode 100644 tests/QtNetwork/CMakeLists.txt
rename tests/{qtnetwork => QtNetwork}/accessManager_test.py (100%)
rename tests/{qtnetwork => QtNetwork}/http_test.py (100%)
rename tests/{qtnetwork => QtNetwork}/tcpserver_test.py (100%)
rename tests/{qtnetwork => QtNetwork}/udpsocket_test.py (100%)
create mode 100644 tests/QtOpenGL/CMakeLists.txt
rename tests/{qtopengl => QtOpenGL}/qglbuffer_test.py (100%)
create mode 100644 tests/QtScript/CMakeLists.txt
rename tests/{qtscript => QtScript}/base_test.py (100%)
rename tests/{qtscript => QtScript}/engine_test.py (100%)
rename tests/{qtscript => QtScript}/test_base.py (100%)
create mode 100644 tests/QtScriptTools/CMakeLists.txt
rename tests/{qtscripttools => QtScriptTools}/debugger_test.py (100%)
create mode 100644 tests/QtSql/CMakeLists.txt
rename tests/{qtsql => QtSql}/qsqldatabaseandqueries_test.py (100%)
create mode 100644 tests/QtSvg/CMakeLists.txt
rename tests/{qtsvg => QtSvg}/qsvggenerator_test.py (100%)
create mode 100644 tests/QtTest/CMakeLists.txt
rename tests/{qttest => QtTest}/click_test.py (100%)
rename tests/{qttest => QtTest}/eventfilter_test.py (100%)
create mode 100644 tests/QtUiTools/CMakeLists.txt
rename tests/{qtuitools => QtUiTools}/test.ui (100%)
rename tests/{qtuitools => QtUiTools}/ui_test.py (100%)
rename tests/{qtuitools => QtUiTools}/uiloader_test.py (100%)
create mode 100644 tests/QtWebKit/CMakeLists.txt
rename tests/{qtwebkit => QtWebKit}/fox.html (100%)
rename tests/{qtwebkit => QtWebKit}/webpage_test.py (100%)
rename tests/{qtwebkit => QtWebKit}/webview_test.py (100%)
create mode 100644 tests/QtXml/CMakeLists.txt
rename tests/{qtxml => QtXml}/qdomdocument_test.py (100%)
rename tests/{qtxml => QtXml}/qxmlsimplereader_test.py (100%)
create mode 100644 tests/QtXmlPatterns/CMakeLists.txt
rename tests/{qtxmlpatterns => QtXmlPatterns}/import_test.py (100%)
create mode 100644 tests/phonon/CMakeLists.txt
delete mode 100644 tests/qtgui/qlabel_pixmap_refcount.py
create mode 100644 tests/signals/CMakeLists.txt
mode change 100644 => 100755 tests/signals/args_dont_match_test.py
mode change 100644 => 100755 tests/signals/decorators_test.py
mode change 100644 => 100755 tests/signals/invalid_callback_test.py
mode change 100644 => 100755 tests/signals/lambda_gui_test.py
mode change 100644 => 100755 tests/signals/lambda_test.py
mode change 100644 => 100755 tests/signals/multiple_connections_gui_test.py
mode change 100644 => 100755 tests/signals/multiple_connections_test.py
mode change 100644 => 100755 tests/signals/pysignal_test.py
mode change 100644 => 100755 tests/signals/qobject_destroyed_test.py
mode change 100644 => 100755 tests/signals/qobject_receivers_test.py
mode change 100644 => 100755 tests/signals/segfault_proxyparent_test.py
mode change 100644 => 100755 tests/signals/self_connect_test.py
mode change 100644 => 100755 tests/signals/short_circuit_test.py
mode change 100644 => 100755 tests/signals/signal2signal_connect_test.py
mode change 100644 => 100755 tests/signals/signal_autoconnect_test.py
mode change 100644 => 100755 tests/signals/signal_connectiontype_support.py
mode change 100644 => 100755 tests/signals/signal_emission_gui_test.py
mode change 100644 => 100755 tests/signals/signal_emission_test.py
mode change 100644 => 100755 tests/signals/signal_func_test.py
mode change 100644 => 100755 tests/signals/signal_manager_refcount_test.py
mode change 100644 => 100755 tests/signals/signal_object_test.py
mode change 100644 => 100755 tests/signals/signal_with_primitive_type_test.py
mode change 100644 => 100755 tests/signals/slot_reference_count_test.py
mode change 100644 => 100755 tests/signals/static_metaobject_test.py
mode change 100644 => 100755 tests/signals/upstream_segfault_test.py
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index ada5b7a..d87414f 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -1,22 +1,44 @@
+set(PYSIDE_TIMEOUT 5)
-file(GLOB TEST_FILES */*_test.py)
+macro(TEST_QT_MODULE var name)
+ if(NOT DISABLE_${name} AND ${var})
+ add_subdirectory(${name})
+ endif()
+endmacro(TEST_QT_MODULE)
-set(test_blacklist )
+macro(PYSIDE_TEST)
+ set(TEST_NAME ${ARGV0})
+ if (${ARGC} EQUAL 1)
+ set(EXPECT_TO_FAIL 0)
+ elseif(${ARGC} EQUAL 2)
+ set(EXPECT_TO_FAIL ${ARGV1})
+ else()
+ message(WARNING "Ivalid call of macro PYSIDE_TEST")
+ endif()
+ set(TEST_CMD ${CMAKE_SOURCE_DIR}/tests/run_test.sh ${CMAKE_BINARY_DIR} "${CMAKE_BINARY_DIR}:${CMAKE_SOURCE_DIR}/tests/util" ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/${TEST_NAME}")
+ add_test(${TEST_NAME} ${TEST_CMD})
+ set_tests_properties(${TEST_NAME} PROPERTIES
+ TIMEOUT ${PYSIDE_TIMEOUT}
+ WILL_FAIL ${EXPECT_TO_FAIL})
+endmacro(PYSIDE_TEST)
-foreach(test_file ${TEST_FILES})
- string(REGEX MATCH "/([^/]+)//?([^/]+)_test.py" test_name ${test_file} )
- list(FIND test_blacklist ${CMAKE_MATCH_1}_${CMAKE_MATCH_2} expect_fail)
- add_test(${CMAKE_MATCH_1}_${CMAKE_MATCH_2} sh
- ${CMAKE_CURRENT_SOURCE_DIR}/run_test.sh
- "${pysidebase_BINARY_DIR}:${libpyside_BINARY_DIR}"
- "${CMAKE_BINARY_DIR}:${CMAKE_CURRENT_SOURCE_DIR}/util"
- ${PYTHON_EXECUTABLE}
- ${test_file})
- set_tests_properties(${CMAKE_MATCH_1}_${CMAKE_MATCH_2} PROPERTIES TIMEOUT 5)
- if (${expect_fail} GREATER -1)
- set_tests_properties(${CMAKE_MATCH_1}_${CMAKE_MATCH_2} PROPERTIES WILL_FAIL TRUE)
- endif(${expect_fail} GREATER -1)
-# Should set python path here
-# Looks like it's fixed in 2.8:
-# http://www.vtk.org/Bug/print_bug_page.php?bug_id=7885
-endforeach(test_file ${TEST_FILES})
+
+add_subdirectory(signals)
+TEST_QT_MODULE(QT_QTCORE_FOUND QtCore)
+TEST_QT_MODULE(QT_QTGUI_FOUND QtGui)
+TEST_QT_MODULE(QT_QTNETWORK_FOUND QtNetwork)
+TEST_QT_MODULE(QT_QTWEBKIT_FOUND QtWebKit)
+TEST_QT_MODULE(QT_QTSVG_FOUND QtSvg)
+TEST_QT_MODULE(QT_QTXML_FOUND QtXml)
+TEST_QT_MODULE(QT_QTTEST_FOUND QtTest)
+TEST_QT_MODULE(QT_QTOPENGL_FOUND QtOpenGL)
+TEST_QT_MODULE(QT_QTSQL_FOUND QtSql)
+TEST_QT_MODULE(QT_QTUITOOLS_FOUND QtUiTools)
+TEST_QT_MODULE(QT_QTHELP_FOUND QtHelp)
+TEST_QT_MODULE(QT_QTXMLPATTERNS_FOUND QtXmlPatterns)
+TEST_QT_MODULE(QT_QTMAEMO5_FOUND QtMaemo5)
+TEST_QT_MODULE(QT_QTSCRIPT_FOUND QtScript)
+TEST_QT_MODULE(QT_QTSCRIPTTOOLS_FOUND QtScriptTools)
+TEST_QT_MODULE(QT_QTMULTIMEDIA_FOUND QtMultimedia)
+TEST_QT_MODULE(QT_PHONON_FOUND phonon)
+TEST_QT_MODULE(QT_QTDECLARATIVE_FOUND QtDeclarative)
diff --git a/tests/QtCore/CMakeLists.txt b/tests/QtCore/CMakeLists.txt
new file mode 100644
index 0000000..536d408
--- /dev/null
+++ b/tests/QtCore/CMakeLists.txt
@@ -0,0 +1,71 @@
+PYSIDE_TEST(blocking_signals_test.py)
+PYSIDE_TEST(buffer_test.py)
+PYSIDE_TEST(child_event_test.py)
+PYSIDE_TEST(deletelater_test.py)
+PYSIDE_TEST(duck_punching_test.py)
+PYSIDE_TEST(missing_symbols_test.py)
+PYSIDE_TEST(qabs_test.py)
+PYSIDE_TEST(qabstracttransition_test.py)
+PYSIDE_TEST(qanimationgroup_test.py)
+PYSIDE_TEST(qbitarray_test.py)
+PYSIDE_TEST(qbytearray_buffer_protocol_test.py)
+PYSIDE_TEST(qbytearray_concatenation_operator_test.py)
+PYSIDE_TEST(qbytearray_operator_iadd_test.py)
+PYSIDE_TEST(qbytearray_operator_test.py)
+PYSIDE_TEST(qbytearray_test.py)
+PYSIDE_TEST(qchar_test.py)
+PYSIDE_TEST(qcoreapplication_instance_test.py)
+PYSIDE_TEST(qdatastream_test.py)
+PYSIDE_TEST(qdate_test.py)
+PYSIDE_TEST(qenum_test.py)
+PYSIDE_TEST(qevent_test.py)
+PYSIDE_TEST(qfileinfo_test.py)
+PYSIDE_TEST(qfile_test.py)
+PYSIDE_TEST(qflags_test.py)
+PYSIDE_TEST(qhandle_test.py)
+PYSIDE_TEST(qlatin1string_test.py)
+PYSIDE_TEST(qlinef_test.py)
+PYSIDE_TEST(qlocale_test.py)
+PYSIDE_TEST(qmetaobject_test.py)
+PYSIDE_TEST(qmodelindex_internalpointer_test.py)
+PYSIDE_TEST(qobject_children_segfault_test.py)
+PYSIDE_TEST(qobject_connect_notify_test.py)
+PYSIDE_TEST(qobject_event_filter_test.py)
+PYSIDE_TEST(qobject_inherits_test.py)
+PYSIDE_TEST(qobject_parent_test.py)
+PYSIDE_TEST(qobject_property_test.py)
+PYSIDE_TEST(qobject_protected_methods_test.py)
+PYSIDE_TEST(qobject_test.py)
+PYSIDE_TEST(qobject_timer_event_test.py)
+PYSIDE_TEST(qobject_tr_as_instance_test.py)
+PYSIDE_TEST(qpoint_test.py)
+PYSIDE_TEST(qprocess_test.py)
+PYSIDE_TEST(qrect_test.py)
+PYSIDE_TEST(qresource_test.py)
+PYSIDE_TEST(qsize_test.py)
+PYSIDE_TEST(qslot_object_test.py)
+PYSIDE_TEST(qsrand_test.py)
+PYSIDE_TEST(qstatemachine_test.py)
+PYSIDE_TEST(qstate_test.py)
+PYSIDE_TEST(qstring_buffer_protocol_test.py)
+PYSIDE_TEST(qstringlist_test.py)
+PYSIDE_TEST(qstring_operator_test.py)
+PYSIDE_TEST(qstring_test.py)
+PYSIDE_TEST(qtext_codec_test.py)
+PYSIDE_TEST(qtextstream_test.py)
+PYSIDE_TEST(qthread_prod_cons_test.py)
+PYSIDE_TEST(qthread_signal_test.py)
+PYSIDE_TEST(qthread_test.py)
+PYSIDE_TEST(qtimer_singleshot_test.py)
+PYSIDE_TEST(qtimer_timeout_test.py)
+PYSIDE_TEST(qtnamespace_test.py)
+PYSIDE_TEST(qurl_test.py)
+PYSIDE_TEST(qvariant_pyobject_test.py)
+PYSIDE_TEST(qvariant_test.py)
+PYSIDE_TEST(resources_mc.py)
+PYSIDE_TEST(static_method_test.py)
+PYSIDE_TEST(static_protected_methods_test.py)
+PYSIDE_TEST(thread_signals.py)
+PYSIDE_TEST(translation_test.py)
+PYSIDE_TEST(unaryoperator_test.py)
+PYSIDE_TEST(unicode_test.py)
diff --git a/tests/qtcore/blocking_signals_test.py b/tests/QtCore/blocking_signals_test.py
similarity index 100%
rename from tests/qtcore/blocking_signals_test.py
rename to tests/QtCore/blocking_signals_test.py
diff --git a/tests/qtcore/buffer_test.py b/tests/QtCore/buffer_test.py
similarity index 100%
rename from tests/qtcore/buffer_test.py
rename to tests/QtCore/buffer_test.py
diff --git a/tests/qtcore/child_event_test.py b/tests/QtCore/child_event_test.py
similarity index 100%
rename from tests/qtcore/child_event_test.py
rename to tests/QtCore/child_event_test.py
diff --git a/tests/qtcore/deletelater_test.py b/tests/QtCore/deletelater_test.py
similarity index 100%
rename from tests/qtcore/deletelater_test.py
rename to tests/QtCore/deletelater_test.py
diff --git a/tests/qtcore/duck_punching_test.py b/tests/QtCore/duck_punching_test.py
similarity index 100%
rename from tests/qtcore/duck_punching_test.py
rename to tests/QtCore/duck_punching_test.py
diff --git a/tests/qtcore/missing_symbols_test.py b/tests/QtCore/missing_symbols_test.py
similarity index 100%
rename from tests/qtcore/missing_symbols_test.py
rename to tests/QtCore/missing_symbols_test.py
diff --git a/tests/qtcore/qabs_test.py b/tests/QtCore/qabs_test.py
similarity index 100%
rename from tests/qtcore/qabs_test.py
rename to tests/QtCore/qabs_test.py
diff --git a/tests/qtcore/qabstracttransition_test.py b/tests/QtCore/qabstracttransition_test.py
similarity index 100%
rename from tests/qtcore/qabstracttransition_test.py
rename to tests/QtCore/qabstracttransition_test.py
diff --git a/tests/qtcore/qanimationgroup_test.py b/tests/QtCore/qanimationgroup_test.py
similarity index 100%
rename from tests/qtcore/qanimationgroup_test.py
rename to tests/QtCore/qanimationgroup_test.py
diff --git a/tests/qtcore/qbitarray_test.py b/tests/QtCore/qbitarray_test.py
similarity index 100%
rename from tests/qtcore/qbitarray_test.py
rename to tests/QtCore/qbitarray_test.py
diff --git a/tests/qtcore/qbytearray_buffer_protocol_test.py b/tests/QtCore/qbytearray_buffer_protocol_test.py
similarity index 100%
rename from tests/qtcore/qbytearray_buffer_protocol_test.py
rename to tests/QtCore/qbytearray_buffer_protocol_test.py
diff --git a/tests/qtcore/qbytearray_concatenation_operator_test.py b/tests/QtCore/qbytearray_concatenation_operator_test.py
similarity index 100%
rename from tests/qtcore/qbytearray_concatenation_operator_test.py
rename to tests/QtCore/qbytearray_concatenation_operator_test.py
diff --git a/tests/qtcore/qbytearray_operator_iadd_test.py b/tests/QtCore/qbytearray_operator_iadd_test.py
similarity index 100%
rename from tests/qtcore/qbytearray_operator_iadd_test.py
rename to tests/QtCore/qbytearray_operator_iadd_test.py
diff --git a/tests/qtcore/qbytearray_operator_test.py b/tests/QtCore/qbytearray_operator_test.py
similarity index 100%
rename from tests/qtcore/qbytearray_operator_test.py
rename to tests/QtCore/qbytearray_operator_test.py
diff --git a/tests/qtcore/qbytearray_test.py b/tests/QtCore/qbytearray_test.py
similarity index 100%
rename from tests/qtcore/qbytearray_test.py
rename to tests/QtCore/qbytearray_test.py
diff --git a/tests/qtcore/qchar_test.py b/tests/QtCore/qchar_test.py
similarity index 100%
rename from tests/qtcore/qchar_test.py
rename to tests/QtCore/qchar_test.py
diff --git a/tests/qtcore/qcoreapplication_instance_test.py b/tests/QtCore/qcoreapplication_instance_test.py
similarity index 100%
rename from tests/qtcore/qcoreapplication_instance_test.py
rename to tests/QtCore/qcoreapplication_instance_test.py
diff --git a/tests/qtcore/qdatastream_test.py b/tests/QtCore/qdatastream_test.py
similarity index 100%
rename from tests/qtcore/qdatastream_test.py
rename to tests/QtCore/qdatastream_test.py
diff --git a/tests/qtcore/qdate_test.py b/tests/QtCore/qdate_test.py
similarity index 100%
rename from tests/qtcore/qdate_test.py
rename to tests/QtCore/qdate_test.py
diff --git a/tests/qtcore/qenum_test.py b/tests/QtCore/qenum_test.py
similarity index 100%
rename from tests/qtcore/qenum_test.py
rename to tests/QtCore/qenum_test.py
diff --git a/tests/qtcore/qevent_test.py b/tests/QtCore/qevent_test.py
similarity index 100%
rename from tests/qtcore/qevent_test.py
rename to tests/QtCore/qevent_test.py
diff --git a/tests/qtcore/qfile_test.py b/tests/QtCore/qfile_test.py
similarity index 100%
rename from tests/qtcore/qfile_test.py
rename to tests/QtCore/qfile_test.py
diff --git a/tests/qtcore/qfileinfo_test.py b/tests/QtCore/qfileinfo_test.py
similarity index 100%
rename from tests/qtcore/qfileinfo_test.py
rename to tests/QtCore/qfileinfo_test.py
diff --git a/tests/qtcore/qflags_test.py b/tests/QtCore/qflags_test.py
similarity index 100%
rename from tests/qtcore/qflags_test.py
rename to tests/QtCore/qflags_test.py
diff --git a/tests/qtcore/qhandle_test.py b/tests/QtCore/qhandle_test.py
similarity index 100%
rename from tests/qtcore/qhandle_test.py
rename to tests/QtCore/qhandle_test.py
diff --git a/tests/qtcore/qlatin1string_test.py b/tests/QtCore/qlatin1string_test.py
similarity index 100%
rename from tests/qtcore/qlatin1string_test.py
rename to tests/QtCore/qlatin1string_test.py
diff --git a/tests/qtcore/qlinef_test.py b/tests/QtCore/qlinef_test.py
similarity index 100%
rename from tests/qtcore/qlinef_test.py
rename to tests/QtCore/qlinef_test.py
diff --git a/tests/qtcore/qlocale_test.py b/tests/QtCore/qlocale_test.py
similarity index 100%
rename from tests/qtcore/qlocale_test.py
rename to tests/QtCore/qlocale_test.py
diff --git a/tests/qtcore/qmetaobject_test.py b/tests/QtCore/qmetaobject_test.py
similarity index 100%
rename from tests/qtcore/qmetaobject_test.py
rename to tests/QtCore/qmetaobject_test.py
diff --git a/tests/qtcore/qmodelindex_internalpointer_test.py b/tests/QtCore/qmodelindex_internalpointer_test.py
similarity index 100%
rename from tests/qtcore/qmodelindex_internalpointer_test.py
rename to tests/QtCore/qmodelindex_internalpointer_test.py
diff --git a/tests/qtcore/qobject_children_segfault_test.py b/tests/QtCore/qobject_children_segfault_test.py
similarity index 100%
rename from tests/qtcore/qobject_children_segfault_test.py
rename to tests/QtCore/qobject_children_segfault_test.py
diff --git a/tests/qtcore/qobject_connect_notify_test.py b/tests/QtCore/qobject_connect_notify_test.py
similarity index 100%
rename from tests/qtcore/qobject_connect_notify_test.py
rename to tests/QtCore/qobject_connect_notify_test.py
diff --git a/tests/qtcore/qobject_event_filter_test.py b/tests/QtCore/qobject_event_filter_test.py
similarity index 100%
rename from tests/qtcore/qobject_event_filter_test.py
rename to tests/QtCore/qobject_event_filter_test.py
diff --git a/tests/qtcore/qobject_inherits_test.py b/tests/QtCore/qobject_inherits_test.py
similarity index 100%
rename from tests/qtcore/qobject_inherits_test.py
rename to tests/QtCore/qobject_inherits_test.py
diff --git a/tests/qtcore/qobject_parent_test.py b/tests/QtCore/qobject_parent_test.py
similarity index 100%
rename from tests/qtcore/qobject_parent_test.py
rename to tests/QtCore/qobject_parent_test.py
diff --git a/tests/qtcore/qobject_property_test.py b/tests/QtCore/qobject_property_test.py
similarity index 100%
rename from tests/qtcore/qobject_property_test.py
rename to tests/QtCore/qobject_property_test.py
diff --git a/tests/qtcore/qobject_protected_methods_test.py b/tests/QtCore/qobject_protected_methods_test.py
similarity index 100%
rename from tests/qtcore/qobject_protected_methods_test.py
rename to tests/QtCore/qobject_protected_methods_test.py
diff --git a/tests/qtcore/qobject_test.py b/tests/QtCore/qobject_test.py
similarity index 100%
rename from tests/qtcore/qobject_test.py
rename to tests/QtCore/qobject_test.py
diff --git a/tests/qtcore/qobject_timer_event_test.py b/tests/QtCore/qobject_timer_event_test.py
similarity index 100%
rename from tests/qtcore/qobject_timer_event_test.py
rename to tests/QtCore/qobject_timer_event_test.py
diff --git a/tests/qtcore/qobject_tr_as_instance_test.py b/tests/QtCore/qobject_tr_as_instance_test.py
similarity index 100%
rename from tests/qtcore/qobject_tr_as_instance_test.py
rename to tests/QtCore/qobject_tr_as_instance_test.py
diff --git a/tests/qtcore/qpoint_test.py b/tests/QtCore/qpoint_test.py
similarity index 100%
rename from tests/qtcore/qpoint_test.py
rename to tests/QtCore/qpoint_test.py
diff --git a/tests/qtcore/qprocess_test.py b/tests/QtCore/qprocess_test.py
similarity index 100%
rename from tests/qtcore/qprocess_test.py
rename to tests/QtCore/qprocess_test.py
diff --git a/tests/qtcore/qrect_test.py b/tests/QtCore/qrect_test.py
similarity index 100%
rename from tests/qtcore/qrect_test.py
rename to tests/QtCore/qrect_test.py
diff --git a/tests/qtcore/qresource_test.py b/tests/QtCore/qresource_test.py
similarity index 100%
rename from tests/qtcore/qresource_test.py
rename to tests/QtCore/qresource_test.py
diff --git a/tests/qtcore/qsize_test.py b/tests/QtCore/qsize_test.py
similarity index 100%
rename from tests/qtcore/qsize_test.py
rename to tests/QtCore/qsize_test.py
diff --git a/tests/qtcore/qslot_object_test.py b/tests/QtCore/qslot_object_test.py
similarity index 100%
rename from tests/qtcore/qslot_object_test.py
rename to tests/QtCore/qslot_object_test.py
diff --git a/tests/qtcore/qsrand_test.py b/tests/QtCore/qsrand_test.py
similarity index 100%
rename from tests/qtcore/qsrand_test.py
rename to tests/QtCore/qsrand_test.py
diff --git a/tests/qtcore/qstate_test.py b/tests/QtCore/qstate_test.py
similarity index 100%
rename from tests/qtcore/qstate_test.py
rename to tests/QtCore/qstate_test.py
diff --git a/tests/qtcore/qstatemachine_test.py b/tests/QtCore/qstatemachine_test.py
similarity index 100%
rename from tests/qtcore/qstatemachine_test.py
rename to tests/QtCore/qstatemachine_test.py
diff --git a/tests/qtcore/qstring_buffer_protocol_test.py b/tests/QtCore/qstring_buffer_protocol_test.py
similarity index 100%
rename from tests/qtcore/qstring_buffer_protocol_test.py
rename to tests/QtCore/qstring_buffer_protocol_test.py
diff --git a/tests/qtcore/qstring_operator_test.py b/tests/QtCore/qstring_operator_test.py
similarity index 100%
rename from tests/qtcore/qstring_operator_test.py
rename to tests/QtCore/qstring_operator_test.py
diff --git a/tests/qtcore/qstring_test.py b/tests/QtCore/qstring_test.py
similarity index 100%
rename from tests/qtcore/qstring_test.py
rename to tests/QtCore/qstring_test.py
diff --git a/tests/qtcore/qstringlist_test.py b/tests/QtCore/qstringlist_test.py
similarity index 100%
rename from tests/qtcore/qstringlist_test.py
rename to tests/QtCore/qstringlist_test.py
diff --git a/tests/qtcore/qtext_codec_test.py b/tests/QtCore/qtext_codec_test.py
similarity index 100%
rename from tests/qtcore/qtext_codec_test.py
rename to tests/QtCore/qtext_codec_test.py
diff --git a/tests/qtcore/qtextstream_test.py b/tests/QtCore/qtextstream_test.py
similarity index 100%
rename from tests/qtcore/qtextstream_test.py
rename to tests/QtCore/qtextstream_test.py
diff --git a/tests/qtcore/qthread_prod_cons_test.py b/tests/QtCore/qthread_prod_cons_test.py
similarity index 100%
rename from tests/qtcore/qthread_prod_cons_test.py
rename to tests/QtCore/qthread_prod_cons_test.py
diff --git a/tests/qtcore/qthread_signal_test.py b/tests/QtCore/qthread_signal_test.py
similarity index 100%
rename from tests/qtcore/qthread_signal_test.py
rename to tests/QtCore/qthread_signal_test.py
diff --git a/tests/qtcore/qthread_test.py b/tests/QtCore/qthread_test.py
similarity index 100%
rename from tests/qtcore/qthread_test.py
rename to tests/QtCore/qthread_test.py
diff --git a/tests/qtcore/qtimer_singleshot_test.py b/tests/QtCore/qtimer_singleshot_test.py
similarity index 100%
rename from tests/qtcore/qtimer_singleshot_test.py
rename to tests/QtCore/qtimer_singleshot_test.py
diff --git a/tests/qtcore/qtimer_timeout_test.py b/tests/QtCore/qtimer_timeout_test.py
similarity index 100%
rename from tests/qtcore/qtimer_timeout_test.py
rename to tests/QtCore/qtimer_timeout_test.py
diff --git a/tests/qtcore/qtnamespace_test.py b/tests/QtCore/qtnamespace_test.py
similarity index 100%
rename from tests/qtcore/qtnamespace_test.py
rename to tests/QtCore/qtnamespace_test.py
diff --git a/tests/qtcore/quoteEnUS.txt b/tests/QtCore/quoteEnUS.txt
similarity index 100%
rename from tests/qtcore/quoteEnUS.txt
rename to tests/QtCore/quoteEnUS.txt
diff --git a/tests/qtcore/qurl_test.py b/tests/QtCore/qurl_test.py
similarity index 100%
rename from tests/qtcore/qurl_test.py
rename to tests/QtCore/qurl_test.py
diff --git a/tests/qtcore/qvariant_pyobject_test.py b/tests/QtCore/qvariant_pyobject_test.py
similarity index 100%
rename from tests/qtcore/qvariant_pyobject_test.py
rename to tests/QtCore/qvariant_pyobject_test.py
diff --git a/tests/qtcore/qvariant_test.py b/tests/QtCore/qvariant_test.py
similarity index 100%
rename from tests/qtcore/qvariant_test.py
rename to tests/QtCore/qvariant_test.py
diff --git a/tests/qtcore/resources.qrc b/tests/QtCore/resources.qrc
similarity index 100%
rename from tests/qtcore/resources.qrc
rename to tests/QtCore/resources.qrc
diff --git a/tests/qtcore/resources_mc.py b/tests/QtCore/resources_mc.py
similarity index 100%
rename from tests/qtcore/resources_mc.py
rename to tests/QtCore/resources_mc.py
diff --git a/tests/qtcore/static_method_test.py b/tests/QtCore/static_method_test.py
similarity index 100%
rename from tests/qtcore/static_method_test.py
rename to tests/QtCore/static_method_test.py
diff --git a/tests/qtcore/static_protected_methods_test.py b/tests/QtCore/static_protected_methods_test.py
similarity index 100%
rename from tests/qtcore/static_protected_methods_test.py
rename to tests/QtCore/static_protected_methods_test.py
diff --git a/tests/qtcore/thread_signals.py b/tests/QtCore/thread_signals.py
similarity index 70%
rename from tests/qtcore/thread_signals.py
rename to tests/QtCore/thread_signals.py
index e2b6673..9eea829 100644
--- a/tests/qtcore/thread_signals.py
+++ b/tests/QtCore/thread_signals.py
@@ -5,14 +5,13 @@ import unittest
import os
from tempfile import mkstemp
-from PySide.QtCore import QObject, SIGNAL, QFile, QThread, QTimer
+from PySide.QtCore import QObject, SIGNAL, QFile, QThread, QTimer, Qt
from helper import UsesQCoreApplication
class MyThread(QThread):
def run(self):
- self.emit(SIGNAL("test(const QString&)"),
- "INdT - PySide");
+ self.emit(SIGNAL("test(const QString&)"), "INdT - PySide");
class TestThreadSignal(UsesQCoreApplication):
@@ -20,18 +19,13 @@ class TestThreadSignal(UsesQCoreApplication):
def _callback(self, msg):
self.assertEqual(msg, "INdT - PySide")
self.__called__ = True
- self._quit()
-
- def _quit(self):
self.app.quit()
def testThread(self):
t = MyThread()
- QObject.connect(t, SIGNAL("test(const QString&)"),
- self._callback);
-
+ QObject.connect(t, SIGNAL("test(const QString&)"), self._callback);
t.start()
- QTimer.singleShot(100, self._quit)
+
self.app.exec_()
self.assert_(self.__called__);
diff --git a/tests/qtcore/translation_test.py b/tests/QtCore/translation_test.py
similarity index 100%
rename from tests/qtcore/translation_test.py
rename to tests/QtCore/translation_test.py
diff --git a/tests/qtcore/translations/trans_latin.ts b/tests/QtCore/translations/trans_latin.ts
similarity index 100%
rename from tests/qtcore/translations/trans_latin.ts
rename to tests/QtCore/translations/trans_latin.ts
diff --git a/tests/qtcore/translations/trans_russian.ts b/tests/QtCore/translations/trans_russian.ts
similarity index 100%
rename from tests/qtcore/translations/trans_russian.ts
rename to tests/QtCore/translations/trans_russian.ts
diff --git a/tests/qtcore/unaryoperator_test.py b/tests/QtCore/unaryoperator_test.py
similarity index 100%
rename from tests/qtcore/unaryoperator_test.py
rename to tests/QtCore/unaryoperator_test.py
diff --git a/tests/qtcore/unicode_test.py b/tests/QtCore/unicode_test.py
similarity index 100%
rename from tests/qtcore/unicode_test.py
rename to tests/QtCore/unicode_test.py
diff --git a/tests/QtDeclarative/CMakeLists.txt b/tests/QtDeclarative/CMakeLists.txt
new file mode 100644
index 0000000..4896010
--- /dev/null
+++ b/tests/QtDeclarative/CMakeLists.txt
@@ -0,0 +1,2 @@
+PYSIDE_TEST(qdeclarativenetwork_test.py FALSE)
+PYSIDE_TEST(qdeclarativeview_test.py FALSE)
diff --git a/tests/qtdeclarative/network.qml b/tests/QtDeclarative/network.qml
similarity index 100%
rename from tests/qtdeclarative/network.qml
rename to tests/QtDeclarative/network.qml
diff --git a/tests/qtdeclarative/qdeclarativenetwork_test.py b/tests/QtDeclarative/qdeclarativenetwork_test.py
similarity index 100%
rename from tests/qtdeclarative/qdeclarativenetwork_test.py
rename to tests/QtDeclarative/qdeclarativenetwork_test.py
diff --git a/tests/qtdeclarative/qdeclarativeview_test.py b/tests/QtDeclarative/qdeclarativeview_test.py
similarity index 100%
rename from tests/qtdeclarative/qdeclarativeview_test.py
rename to tests/QtDeclarative/qdeclarativeview_test.py
diff --git a/tests/qtdeclarative/view.qml b/tests/QtDeclarative/view.qml
similarity index 100%
rename from tests/qtdeclarative/view.qml
rename to tests/QtDeclarative/view.qml
diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt
new file mode 100644
index 0000000..fb6d801
--- /dev/null
+++ b/tests/QtGui/CMakeLists.txt
@@ -0,0 +1,58 @@
+PYSIDE_TEST(add_action_test.py)
+PYSIDE_TEST(customproxywidget_test.py)
+PYSIDE_TEST(float_to_int_implicit_conversion_test.py)
+PYSIDE_TEST(grandparent_method_test.py)
+PYSIDE_TEST(hashabletype_test.py)
+PYSIDE_TEST(keep_reference_test.py)
+PYSIDE_TEST(missing_symbols_test.py)
+PYSIDE_TEST(paint_event_test.py)
+PYSIDE_TEST(parent_method_test.py)
+PYSIDE_TEST(python_properties_test.py)
+PYSIDE_TEST(qapplication_exit_segfault_test.py)
+PYSIDE_TEST(qapplication_singleton_test.py)
+PYSIDE_TEST(qapp_test.py)
+PYSIDE_TEST(qbrush_test.py)
+PYSIDE_TEST(qcolor_test.py)
+PYSIDE_TEST(qdatastream_gui_operators_test.py)
+PYSIDE_TEST(qfontdialog_test.py)
+PYSIDE_TEST(qfontmetrics_test.py)
+PYSIDE_TEST(qgraphicsitem_isblocked_test.py)
+PYSIDE_TEST(qgraphicsitem_test.py)
+PYSIDE_TEST(qgraphicsproxywidget_test.py)
+PYSIDE_TEST(qgraphicsscene_test.py)
+PYSIDE_TEST(qinputdialog_get_test.py)
+PYSIDE_TEST(qitemselection_test.py)
+PYSIDE_TEST(qlayout_ref_test.py)
+PYSIDE_TEST(qlayout_test.py)
+PYSIDE_TEST(qlcdnumber_test.py)
+PYSIDE_TEST(qlistwidgetitem_test.py)
+PYSIDE_TEST(qmainwindow_test.py)
+PYSIDE_TEST(qmatrix_test.py)
+PYSIDE_TEST(qmenuadd_test.py)
+PYSIDE_TEST(qmenu_test.py)
+PYSIDE_TEST(qobject_mi_test.py)
+PYSIDE_TEST(qpainter_test.py)
+PYSIDE_TEST(qpen_test.py)
+PYSIDE_TEST(qpixmap_test.py)
+PYSIDE_TEST(qpushbutton_test.py)
+PYSIDE_TEST(qradialgradient_test.py)
+PYSIDE_TEST(qregion_test.py)
+PYSIDE_TEST(qshortcut_test.py)
+PYSIDE_TEST(qstandarditemmodel_test.py)
+PYSIDE_TEST(qstring_qkeysequence_test.py)
+PYSIDE_TEST(qstyle_test.py)
+PYSIDE_TEST(qtableview_test.py)
+PYSIDE_TEST(qtabwidget_test.py)
+PYSIDE_TEST(qtextedit_test.py)
+PYSIDE_TEST(qtoolbar_test.py)
+PYSIDE_TEST(qtoolbox_test.py)
+PYSIDE_TEST(qvariant_test.py)
+PYSIDE_TEST(qwidget_setlayout_test.py)
+PYSIDE_TEST(qwidget_test.py TRUE) #Bug 237
+PYSIDE_TEST(reference_count_test.py)
+PYSIDE_TEST(standardpixmap_test.py)
+PYSIDE_TEST(timed_app_test.py)
+PYSIDE_TEST(virtual_protected_inheritance_test.py)
+PYSIDE_TEST(virtual_pure_override.py)
+PYSIDE_TEST(wrong_return_test.py)
+PYSIDE_TEST(x11_symbols.py)
diff --git a/tests/qtgui/add_action_test.py b/tests/QtGui/add_action_test.py
similarity index 100%
rename from tests/qtgui/add_action_test.py
rename to tests/QtGui/add_action_test.py
diff --git a/tests/qtgui/customproxywidget_test.py b/tests/QtGui/customproxywidget_test.py
similarity index 100%
rename from tests/qtgui/customproxywidget_test.py
rename to tests/QtGui/customproxywidget_test.py
diff --git a/tests/qtgui/float_to_int_implicit_conversion_test.py b/tests/QtGui/float_to_int_implicit_conversion_test.py
similarity index 100%
rename from tests/qtgui/float_to_int_implicit_conversion_test.py
rename to tests/QtGui/float_to_int_implicit_conversion_test.py
diff --git a/tests/qtgui/grandparent_method_test.py b/tests/QtGui/grandparent_method_test.py
similarity index 100%
rename from tests/qtgui/grandparent_method_test.py
rename to tests/QtGui/grandparent_method_test.py
diff --git a/tests/qtgui/hashabletype_test.py b/tests/QtGui/hashabletype_test.py
similarity index 100%
rename from tests/qtgui/hashabletype_test.py
rename to tests/QtGui/hashabletype_test.py
diff --git a/tests/qtgui/keep_reference_test.py b/tests/QtGui/keep_reference_test.py
similarity index 100%
rename from tests/qtgui/keep_reference_test.py
rename to tests/QtGui/keep_reference_test.py
diff --git a/tests/qtgui/missing_symbols_test.py b/tests/QtGui/missing_symbols_test.py
similarity index 100%
rename from tests/qtgui/missing_symbols_test.py
rename to tests/QtGui/missing_symbols_test.py
diff --git a/tests/qtgui/paint_event_test.py b/tests/QtGui/paint_event_test.py
similarity index 100%
rename from tests/qtgui/paint_event_test.py
rename to tests/QtGui/paint_event_test.py
diff --git a/tests/qtgui/parent_method_test.py b/tests/QtGui/parent_method_test.py
similarity index 100%
rename from tests/qtgui/parent_method_test.py
rename to tests/QtGui/parent_method_test.py
diff --git a/tests/qtgui/python_properties_test.py b/tests/QtGui/python_properties_test.py
similarity index 100%
rename from tests/qtgui/python_properties_test.py
rename to tests/QtGui/python_properties_test.py
diff --git a/tests/qtgui/qapp_test.py b/tests/QtGui/qapp_test.py
similarity index 100%
rename from tests/qtgui/qapp_test.py
rename to tests/QtGui/qapp_test.py
diff --git a/tests/qtgui/qapplication_exit_segfault_test.py b/tests/QtGui/qapplication_exit_segfault_test.py
similarity index 100%
rename from tests/qtgui/qapplication_exit_segfault_test.py
rename to tests/QtGui/qapplication_exit_segfault_test.py
diff --git a/tests/qtgui/qapplication_singleton_test.py b/tests/QtGui/qapplication_singleton_test.py
similarity index 100%
rename from tests/qtgui/qapplication_singleton_test.py
rename to tests/QtGui/qapplication_singleton_test.py
diff --git a/tests/qtgui/qbrush_test.py b/tests/QtGui/qbrush_test.py
similarity index 100%
rename from tests/qtgui/qbrush_test.py
rename to tests/QtGui/qbrush_test.py
diff --git a/tests/qtgui/qcolor_test.py b/tests/QtGui/qcolor_test.py
similarity index 100%
rename from tests/qtgui/qcolor_test.py
rename to tests/QtGui/qcolor_test.py
diff --git a/tests/qtgui/qdatastream_gui_operators_test.py b/tests/QtGui/qdatastream_gui_operators_test.py
similarity index 100%
rename from tests/qtgui/qdatastream_gui_operators_test.py
rename to tests/QtGui/qdatastream_gui_operators_test.py
diff --git a/tests/qtgui/qfontdialog_test.py b/tests/QtGui/qfontdialog_test.py
similarity index 100%
rename from tests/qtgui/qfontdialog_test.py
rename to tests/QtGui/qfontdialog_test.py
diff --git a/tests/qtgui/qfontmetrics_test.py b/tests/QtGui/qfontmetrics_test.py
similarity index 100%
rename from tests/qtgui/qfontmetrics_test.py
rename to tests/QtGui/qfontmetrics_test.py
diff --git a/tests/qtgui/qgraphicsitem_isblocked_test.py b/tests/QtGui/qgraphicsitem_isblocked_test.py
similarity index 100%
rename from tests/qtgui/qgraphicsitem_isblocked_test.py
rename to tests/QtGui/qgraphicsitem_isblocked_test.py
diff --git a/tests/qtgui/qgraphicsitem_test.py b/tests/QtGui/qgraphicsitem_test.py
similarity index 100%
rename from tests/qtgui/qgraphicsitem_test.py
rename to tests/QtGui/qgraphicsitem_test.py
diff --git a/tests/qtgui/qgraphicsproxywidget_test.py b/tests/QtGui/qgraphicsproxywidget_test.py
similarity index 100%
rename from tests/qtgui/qgraphicsproxywidget_test.py
rename to tests/QtGui/qgraphicsproxywidget_test.py
diff --git a/tests/qtgui/qgraphicsscene_test.py b/tests/QtGui/qgraphicsscene_test.py
similarity index 100%
rename from tests/qtgui/qgraphicsscene_test.py
rename to tests/QtGui/qgraphicsscene_test.py
diff --git a/tests/qtgui/qinputdialog_get_test.py b/tests/QtGui/qinputdialog_get_test.py
similarity index 100%
rename from tests/qtgui/qinputdialog_get_test.py
rename to tests/QtGui/qinputdialog_get_test.py
diff --git a/tests/qtgui/qitemselection_test.py b/tests/QtGui/qitemselection_test.py
similarity index 100%
rename from tests/qtgui/qitemselection_test.py
rename to tests/QtGui/qitemselection_test.py
diff --git a/tests/qtgui/qlayout_ref_test.py b/tests/QtGui/qlayout_ref_test.py
similarity index 100%
rename from tests/qtgui/qlayout_ref_test.py
rename to tests/QtGui/qlayout_ref_test.py
diff --git a/tests/qtgui/qlayout_test.py b/tests/QtGui/qlayout_test.py
similarity index 100%
rename from tests/qtgui/qlayout_test.py
rename to tests/QtGui/qlayout_test.py
diff --git a/tests/qtgui/qlcdnumber_test.py b/tests/QtGui/qlcdnumber_test.py
similarity index 100%
rename from tests/qtgui/qlcdnumber_test.py
rename to tests/QtGui/qlcdnumber_test.py
diff --git a/tests/qtgui/qlistwidgetitem_test.py b/tests/QtGui/qlistwidgetitem_test.py
similarity index 100%
rename from tests/qtgui/qlistwidgetitem_test.py
rename to tests/QtGui/qlistwidgetitem_test.py
diff --git a/tests/qtgui/qmainwindow_test.py b/tests/QtGui/qmainwindow_test.py
similarity index 100%
rename from tests/qtgui/qmainwindow_test.py
rename to tests/QtGui/qmainwindow_test.py
diff --git a/tests/qtgui/qmatrix_test.py b/tests/QtGui/qmatrix_test.py
similarity index 100%
rename from tests/qtgui/qmatrix_test.py
rename to tests/QtGui/qmatrix_test.py
diff --git a/tests/qtgui/qmenu_test.py b/tests/QtGui/qmenu_test.py
similarity index 100%
rename from tests/qtgui/qmenu_test.py
rename to tests/QtGui/qmenu_test.py
diff --git a/tests/qtgui/qmenuadd_test.py b/tests/QtGui/qmenuadd_test.py
similarity index 100%
rename from tests/qtgui/qmenuadd_test.py
rename to tests/QtGui/qmenuadd_test.py
diff --git a/tests/qtgui/qobject_mi_test.py b/tests/QtGui/qobject_mi_test.py
similarity index 100%
rename from tests/qtgui/qobject_mi_test.py
rename to tests/QtGui/qobject_mi_test.py
diff --git a/tests/qtgui/qpainter_test.py b/tests/QtGui/qpainter_test.py
similarity index 100%
rename from tests/qtgui/qpainter_test.py
rename to tests/QtGui/qpainter_test.py
diff --git a/tests/qtgui/qpen_test.py b/tests/QtGui/qpen_test.py
similarity index 100%
rename from tests/qtgui/qpen_test.py
rename to tests/QtGui/qpen_test.py
diff --git a/tests/qtgui/qpixmap_test.py b/tests/QtGui/qpixmap_test.py
similarity index 100%
rename from tests/qtgui/qpixmap_test.py
rename to tests/QtGui/qpixmap_test.py
diff --git a/tests/qtgui/qpushbutton_test.py b/tests/QtGui/qpushbutton_test.py
similarity index 100%
rename from tests/qtgui/qpushbutton_test.py
rename to tests/QtGui/qpushbutton_test.py
diff --git a/tests/qtgui/qradialgradient_test.py b/tests/QtGui/qradialgradient_test.py
similarity index 100%
rename from tests/qtgui/qradialgradient_test.py
rename to tests/QtGui/qradialgradient_test.py
diff --git a/tests/qtgui/qregion_test.py b/tests/QtGui/qregion_test.py
similarity index 100%
rename from tests/qtgui/qregion_test.py
rename to tests/QtGui/qregion_test.py
diff --git a/tests/qtgui/qshortcut_test.py b/tests/QtGui/qshortcut_test.py
similarity index 100%
rename from tests/qtgui/qshortcut_test.py
rename to tests/QtGui/qshortcut_test.py
diff --git a/tests/qtgui/qstandarditemmodel_test.py b/tests/QtGui/qstandarditemmodel_test.py
similarity index 100%
rename from tests/qtgui/qstandarditemmodel_test.py
rename to tests/QtGui/qstandarditemmodel_test.py
diff --git a/tests/qtgui/qstring_qkeysequence_test.py b/tests/QtGui/qstring_qkeysequence_test.py
similarity index 100%
rename from tests/qtgui/qstring_qkeysequence_test.py
rename to tests/QtGui/qstring_qkeysequence_test.py
diff --git a/tests/qtgui/qstyle_test.py b/tests/QtGui/qstyle_test.py
similarity index 100%
rename from tests/qtgui/qstyle_test.py
rename to tests/QtGui/qstyle_test.py
diff --git a/tests/qtgui/qtableview_test.py b/tests/QtGui/qtableview_test.py
similarity index 100%
rename from tests/qtgui/qtableview_test.py
rename to tests/QtGui/qtableview_test.py
diff --git a/tests/qtgui/qtabwidget_test.py b/tests/QtGui/qtabwidget_test.py
similarity index 100%
rename from tests/qtgui/qtabwidget_test.py
rename to tests/QtGui/qtabwidget_test.py
diff --git a/tests/qtgui/qtextedit_test.py b/tests/QtGui/qtextedit_test.py
similarity index 100%
rename from tests/qtgui/qtextedit_test.py
rename to tests/QtGui/qtextedit_test.py
diff --git a/tests/qtgui/qtoolbar_test.py b/tests/QtGui/qtoolbar_test.py
similarity index 100%
rename from tests/qtgui/qtoolbar_test.py
rename to tests/QtGui/qtoolbar_test.py
diff --git a/tests/qtgui/qtoolbox_test.py b/tests/QtGui/qtoolbox_test.py
similarity index 100%
rename from tests/qtgui/qtoolbox_test.py
rename to tests/QtGui/qtoolbox_test.py
diff --git a/tests/qtgui/qvariant_test.py b/tests/QtGui/qvariant_test.py
similarity index 100%
rename from tests/qtgui/qvariant_test.py
rename to tests/QtGui/qvariant_test.py
diff --git a/tests/qtgui/qwidget_setlayout_test.py b/tests/QtGui/qwidget_setlayout_test.py
similarity index 100%
rename from tests/qtgui/qwidget_setlayout_test.py
rename to tests/QtGui/qwidget_setlayout_test.py
diff --git a/tests/qtgui/qwidget_test.py b/tests/QtGui/qwidget_test.py
similarity index 100%
rename from tests/qtgui/qwidget_test.py
rename to tests/QtGui/qwidget_test.py
diff --git a/tests/qtgui/reference_count_test.py b/tests/QtGui/reference_count_test.py
similarity index 100%
rename from tests/qtgui/reference_count_test.py
rename to tests/QtGui/reference_count_test.py
diff --git a/tests/qtgui/sample.png b/tests/QtGui/sample.png
similarity index 100%
rename from tests/qtgui/sample.png
rename to tests/QtGui/sample.png
diff --git a/tests/qtgui/standardpixmap_test.py b/tests/QtGui/standardpixmap_test.py
similarity index 100%
rename from tests/qtgui/standardpixmap_test.py
rename to tests/QtGui/standardpixmap_test.py
diff --git a/tests/qtgui/timed_app_test.py b/tests/QtGui/timed_app_test.py
similarity index 100%
rename from tests/qtgui/timed_app_test.py
rename to tests/QtGui/timed_app_test.py
diff --git a/tests/qtgui/virtual_protected_inheritance_test.py b/tests/QtGui/virtual_protected_inheritance_test.py
similarity index 100%
rename from tests/qtgui/virtual_protected_inheritance_test.py
rename to tests/QtGui/virtual_protected_inheritance_test.py
diff --git a/tests/qtgui/virtual_pure_override.py b/tests/QtGui/virtual_pure_override.py
similarity index 100%
rename from tests/qtgui/virtual_pure_override.py
rename to tests/QtGui/virtual_pure_override.py
diff --git a/tests/qtgui/wrong_return_test.py b/tests/QtGui/wrong_return_test.py
similarity index 100%
rename from tests/qtgui/wrong_return_test.py
rename to tests/QtGui/wrong_return_test.py
diff --git a/tests/qtgui/x11_symbols.py b/tests/QtGui/x11_symbols.py
similarity index 100%
rename from tests/qtgui/x11_symbols.py
rename to tests/QtGui/x11_symbols.py
diff --git a/tests/QtHelp/CMakeLists.txt b/tests/QtHelp/CMakeLists.txt
new file mode 100644
index 0000000..d0ba2d8
--- /dev/null
+++ b/tests/QtHelp/CMakeLists.txt
@@ -0,0 +1 @@
+PYSIDE_TEST(help_test.py)
diff --git a/tests/qthelp/help_test.py b/tests/QtHelp/help_test.py
similarity index 100%
rename from tests/qthelp/help_test.py
rename to tests/QtHelp/help_test.py
diff --git a/tests/QtMaemo5/CMakeLists.txt b/tests/QtMaemo5/CMakeLists.txt
new file mode 100644
index 0000000..73bb316
--- /dev/null
+++ b/tests/QtMaemo5/CMakeLists.txt
@@ -0,0 +1,2 @@
+PYSIDE_TEST(pickselector_test.py)
+PYSIDE_TEST(qmaemo5import_test.py)
diff --git a/tests/qtmaemo5/pickselector_test.py b/tests/QtMaemo5/pickselector_test.py
similarity index 100%
rename from tests/qtmaemo5/pickselector_test.py
rename to tests/QtMaemo5/pickselector_test.py
diff --git a/tests/qtmaemo5/qmaemo5import_test.py b/tests/QtMaemo5/qmaemo5import_test.py
similarity index 100%
rename from tests/qtmaemo5/qmaemo5import_test.py
rename to tests/QtMaemo5/qmaemo5import_test.py
diff --git a/tests/QtMultimedia/CMakeLists.txt b/tests/QtMultimedia/CMakeLists.txt
new file mode 100644
index 0000000..62150eb
--- /dev/null
+++ b/tests/QtMultimedia/CMakeLists.txt
@@ -0,0 +1 @@
+PYSIDE_TEST(audio_test.py)
diff --git a/tests/qtmultimedia/audio_test.py b/tests/QtMultimedia/audio_test.py
similarity index 100%
rename from tests/qtmultimedia/audio_test.py
rename to tests/QtMultimedia/audio_test.py
diff --git a/tests/QtNetwork/CMakeLists.txt b/tests/QtNetwork/CMakeLists.txt
new file mode 100644
index 0000000..cae1470
--- /dev/null
+++ b/tests/QtNetwork/CMakeLists.txt
@@ -0,0 +1,4 @@
+PYSIDE_TEST(accessManager_test.py)
+PYSIDE_TEST(http_test.py)
+PYSIDE_TEST(tcpserver_test.py)
+PYSIDE_TEST(udpsocket_test.py)
diff --git a/tests/qtnetwork/accessManager_test.py b/tests/QtNetwork/accessManager_test.py
similarity index 100%
rename from tests/qtnetwork/accessManager_test.py
rename to tests/QtNetwork/accessManager_test.py
diff --git a/tests/qtnetwork/http_test.py b/tests/QtNetwork/http_test.py
similarity index 100%
rename from tests/qtnetwork/http_test.py
rename to tests/QtNetwork/http_test.py
diff --git a/tests/qtnetwork/tcpserver_test.py b/tests/QtNetwork/tcpserver_test.py
similarity index 100%
rename from tests/qtnetwork/tcpserver_test.py
rename to tests/QtNetwork/tcpserver_test.py
diff --git a/tests/qtnetwork/udpsocket_test.py b/tests/QtNetwork/udpsocket_test.py
similarity index 100%
rename from tests/qtnetwork/udpsocket_test.py
rename to tests/QtNetwork/udpsocket_test.py
diff --git a/tests/QtOpenGL/CMakeLists.txt b/tests/QtOpenGL/CMakeLists.txt
new file mode 100644
index 0000000..3064edf
--- /dev/null
+++ b/tests/QtOpenGL/CMakeLists.txt
@@ -0,0 +1,3 @@
+if(${QTVERSION} VERSION_GREATER 4.6.9)
+ PYSIDE_TEST(qglbuffer_test.py)
+endif()
diff --git a/tests/qtopengl/qglbuffer_test.py b/tests/QtOpenGL/qglbuffer_test.py
similarity index 100%
rename from tests/qtopengl/qglbuffer_test.py
rename to tests/QtOpenGL/qglbuffer_test.py
diff --git a/tests/QtScript/CMakeLists.txt b/tests/QtScript/CMakeLists.txt
new file mode 100644
index 0000000..b76a262
--- /dev/null
+++ b/tests/QtScript/CMakeLists.txt
@@ -0,0 +1,3 @@
+PYSIDE_TEST(base_test.py)
+PYSIDE_TEST(engine_test.py)
+PYSIDE_TEST(test_base.py)
diff --git a/tests/qtscript/base_test.py b/tests/QtScript/base_test.py
similarity index 100%
rename from tests/qtscript/base_test.py
rename to tests/QtScript/base_test.py
diff --git a/tests/qtscript/engine_test.py b/tests/QtScript/engine_test.py
similarity index 100%
rename from tests/qtscript/engine_test.py
rename to tests/QtScript/engine_test.py
diff --git a/tests/qtscript/test_base.py b/tests/QtScript/test_base.py
similarity index 100%
rename from tests/qtscript/test_base.py
rename to tests/QtScript/test_base.py
diff --git a/tests/QtScriptTools/CMakeLists.txt b/tests/QtScriptTools/CMakeLists.txt
new file mode 100644
index 0000000..ee22737
--- /dev/null
+++ b/tests/QtScriptTools/CMakeLists.txt
@@ -0,0 +1 @@
+PYSIDE_TEST(debugger_test.py)
diff --git a/tests/qtscripttools/debugger_test.py b/tests/QtScriptTools/debugger_test.py
similarity index 100%
rename from tests/qtscripttools/debugger_test.py
rename to tests/QtScriptTools/debugger_test.py
diff --git a/tests/QtSql/CMakeLists.txt b/tests/QtSql/CMakeLists.txt
new file mode 100644
index 0000000..a944691
--- /dev/null
+++ b/tests/QtSql/CMakeLists.txt
@@ -0,0 +1 @@
+PYSIDE_TEST(qsqldatabaseandqueries_test.py)
diff --git a/tests/qtsql/qsqldatabaseandqueries_test.py b/tests/QtSql/qsqldatabaseandqueries_test.py
similarity index 100%
rename from tests/qtsql/qsqldatabaseandqueries_test.py
rename to tests/QtSql/qsqldatabaseandqueries_test.py
diff --git a/tests/QtSvg/CMakeLists.txt b/tests/QtSvg/CMakeLists.txt
new file mode 100644
index 0000000..6a9c9d5
--- /dev/null
+++ b/tests/QtSvg/CMakeLists.txt
@@ -0,0 +1 @@
+PYSIDE_TEST(qsvggenerator_test.py)
diff --git a/tests/qtsvg/qsvggenerator_test.py b/tests/QtSvg/qsvggenerator_test.py
similarity index 100%
rename from tests/qtsvg/qsvggenerator_test.py
rename to tests/QtSvg/qsvggenerator_test.py
diff --git a/tests/QtTest/CMakeLists.txt b/tests/QtTest/CMakeLists.txt
new file mode 100644
index 0000000..b1bdac0
--- /dev/null
+++ b/tests/QtTest/CMakeLists.txt
@@ -0,0 +1,2 @@
+PYSIDE_TEST(click_test.py)
+PYSIDE_TEST(eventfilter_test.py)
diff --git a/tests/qttest/click_test.py b/tests/QtTest/click_test.py
similarity index 100%
rename from tests/qttest/click_test.py
rename to tests/QtTest/click_test.py
diff --git a/tests/qttest/eventfilter_test.py b/tests/QtTest/eventfilter_test.py
similarity index 100%
rename from tests/qttest/eventfilter_test.py
rename to tests/QtTest/eventfilter_test.py
diff --git a/tests/QtUiTools/CMakeLists.txt b/tests/QtUiTools/CMakeLists.txt
new file mode 100644
index 0000000..9118b5b
--- /dev/null
+++ b/tests/QtUiTools/CMakeLists.txt
@@ -0,0 +1,2 @@
+PYSIDE_TEST(uiloader_test.py)
+PYSIDE_TEST(ui_test.py)
diff --git a/tests/qtuitools/test.ui b/tests/QtUiTools/test.ui
similarity index 100%
rename from tests/qtuitools/test.ui
rename to tests/QtUiTools/test.ui
diff --git a/tests/qtuitools/ui_test.py b/tests/QtUiTools/ui_test.py
similarity index 100%
rename from tests/qtuitools/ui_test.py
rename to tests/QtUiTools/ui_test.py
diff --git a/tests/qtuitools/uiloader_test.py b/tests/QtUiTools/uiloader_test.py
similarity index 100%
rename from tests/qtuitools/uiloader_test.py
rename to tests/QtUiTools/uiloader_test.py
diff --git a/tests/QtWebKit/CMakeLists.txt b/tests/QtWebKit/CMakeLists.txt
new file mode 100644
index 0000000..5472865
--- /dev/null
+++ b/tests/QtWebKit/CMakeLists.txt
@@ -0,0 +1,2 @@
+PYSIDE_TEST(webpage_test.py)
+PYSIDE_TEST(webview_test.py)
diff --git a/tests/qtwebkit/fox.html b/tests/QtWebKit/fox.html
similarity index 100%
rename from tests/qtwebkit/fox.html
rename to tests/QtWebKit/fox.html
diff --git a/tests/qtwebkit/webpage_test.py b/tests/QtWebKit/webpage_test.py
similarity index 100%
rename from tests/qtwebkit/webpage_test.py
rename to tests/QtWebKit/webpage_test.py
diff --git a/tests/qtwebkit/webview_test.py b/tests/QtWebKit/webview_test.py
similarity index 100%
rename from tests/qtwebkit/webview_test.py
rename to tests/QtWebKit/webview_test.py
diff --git a/tests/QtXml/CMakeLists.txt b/tests/QtXml/CMakeLists.txt
new file mode 100644
index 0000000..2c21bf8
--- /dev/null
+++ b/tests/QtXml/CMakeLists.txt
@@ -0,0 +1,2 @@
+PYSIDE_TEST(qdomdocument_test.py)
+PYSIDE_TEST(qxmlsimplereader_test.py)
diff --git a/tests/qtxml/qdomdocument_test.py b/tests/QtXml/qdomdocument_test.py
similarity index 100%
rename from tests/qtxml/qdomdocument_test.py
rename to tests/QtXml/qdomdocument_test.py
diff --git a/tests/qtxml/qxmlsimplereader_test.py b/tests/QtXml/qxmlsimplereader_test.py
similarity index 100%
rename from tests/qtxml/qxmlsimplereader_test.py
rename to tests/QtXml/qxmlsimplereader_test.py
diff --git a/tests/QtXmlPatterns/CMakeLists.txt b/tests/QtXmlPatterns/CMakeLists.txt
new file mode 100644
index 0000000..7f570f1
--- /dev/null
+++ b/tests/QtXmlPatterns/CMakeLists.txt
@@ -0,0 +1 @@
+PYSIDE_TEST(import_test.py)
diff --git a/tests/qtxmlpatterns/import_test.py b/tests/QtXmlPatterns/import_test.py
similarity index 100%
rename from tests/qtxmlpatterns/import_test.py
rename to tests/QtXmlPatterns/import_test.py
diff --git a/tests/phonon/CMakeLists.txt b/tests/phonon/CMakeLists.txt
new file mode 100644
index 0000000..1174709
--- /dev/null
+++ b/tests/phonon/CMakeLists.txt
@@ -0,0 +1,2 @@
+PYSIDE_TEST(basic_playing_test.py)
+PYSIDE_TEST(capabilities_test.py)
diff --git a/tests/qtgui/qlabel_pixmap_refcount.py b/tests/qtgui/qlabel_pixmap_refcount.py
deleted file mode 100644
index db8783e..0000000
--- a/tests/qtgui/qlabel_pixmap_refcount.py
+++ /dev/null
@@ -1,46 +0,0 @@
-
-'''Test cases for QLabel->pixmap refcount control'''
-
-import unittest
-import sys
-
-
-from helper import UsesQApplication
-from PySide.QtGui import QApplication, QLabel, QPixmap
-
-class QLabelTest(UsesQApplication):
- '''Test case for constructor of QBrush'''
-
- def testDestroyOwner(self):
- p = QPixmap()
- l = QLabel()
- l.setPixmap(p)
-
- del p
-
- p1 = l.pixmap()
- self.assertEqual(sys.getrefcount(p1), 2)
- self.assertEqual(sys.getrefcount(l), 2)
-
- del l
- self.assertEqual(sys.getrefcount(p1), 2)
-
-
- def testRefCount(self):
- p = QPixmap()
- l = QLabel()
- l.setPixmap(p)
-
- del p
-
- p1 = l.pixmap()
- self.assertEqual(sys.getrefcount(p1), 2)
-
- p2 = l.pixmap()
- self.assertEqual(sys.getrefcount(p2), 3)
-
- p3 = l.pixmap()
- self.assertEqual(sys.getrefcount(p3), 4)
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/tests/run_test.sh b/tests/run_test.sh
index 8671ce3..363fae5 100755
--- a/tests/run_test.sh
+++ b/tests/run_test.sh
@@ -1,13 +1,13 @@
-#!/usr/bin/python
+#!/bin/sh
# This is a nasty workaround of a CTest limitation
# of setting the environment variables for the test.
# $1: LD_LIBRARY_PATH
-# $2: $PYTHON_PATH
+# $2: $PYTHONPATH
# $3: python executable
# $4: test file
-export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$1
-export PYTHONPATH=$PYTHONPATH:$2
+export LD_LIBRARY_PATH=$1:$LD_LIBRARY_PATH
+export PYTHONPATH=$2:$PYTHONPATH
$3 $4
diff --git a/tests/signals/CMakeLists.txt b/tests/signals/CMakeLists.txt
new file mode 100644
index 0000000..3e59684
--- /dev/null
+++ b/tests/signals/CMakeLists.txt
@@ -0,0 +1,32 @@
+PYSIDE_TEST(args_dont_match_test.py)
+PYSIDE_TEST(decorators_test.py)
+PYSIDE_TEST(invalid_callback_test.py)
+PYSIDE_TEST(lambda_gui_test.py)
+PYSIDE_TEST(lambda_test.py)
+PYSIDE_TEST(multiple_connections_gui_test.py)
+PYSIDE_TEST(multiple_connections_test.py)
+PYSIDE_TEST(pysignal_test.py)
+PYSIDE_TEST(qobject_destroyed_test.py)
+PYSIDE_TEST(qobject_receivers_test.py)
+PYSIDE_TEST(qobject_sender_test.py)
+PYSIDE_TEST(ref01_test.py)
+PYSIDE_TEST(ref02_test.py)
+PYSIDE_TEST(ref03_test.py)
+PYSIDE_TEST(ref04_test.py)
+PYSIDE_TEST(ref05_test.py)
+PYSIDE_TEST(ref06_test.py)
+PYSIDE_TEST(segfault_proxyparent_test.py)
+PYSIDE_TEST(self_connect_test.py)
+PYSIDE_TEST(short_circuit_test.py)
+PYSIDE_TEST(signal2signal_connect_test.py)
+PYSIDE_TEST(signal_autoconnect_test.py)
+PYSIDE_TEST(signal_connectiontype_support.py)
+PYSIDE_TEST(signal_emission_gui_test.py)
+PYSIDE_TEST(signal_emission_test.py)
+PYSIDE_TEST(signal_func_test.py)
+PYSIDE_TEST(signal_manager_refcount_test.py)
+PYSIDE_TEST(signal_object_test.py)
+PYSIDE_TEST(signal_with_primitive_type_test.py)
+PYSIDE_TEST(slot_reference_count_test.py)
+PYSIDE_TEST(static_metaobject_test.py)
+PYSIDE_TEST(upstream_segfault_test.py)
diff --git a/tests/signals/args_dont_match_test.py b/tests/signals/args_dont_match_test.py
old mode 100644
new mode 100755
index b81c568..2521167
--- a/tests/signals/args_dont_match_test.py
+++ b/tests/signals/args_dont_match_test.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
import unittest
from PySide.QtCore import *
diff --git a/tests/signals/decorators_test.py b/tests/signals/decorators_test.py
old mode 100644
new mode 100755
diff --git a/tests/signals/invalid_callback_test.py b/tests/signals/invalid_callback_test.py
old mode 100644
new mode 100755
diff --git a/tests/signals/lambda_gui_test.py b/tests/signals/lambda_gui_test.py
old mode 100644
new mode 100755
diff --git a/tests/signals/lambda_test.py b/tests/signals/lambda_test.py
old mode 100644
new mode 100755
diff --git a/tests/signals/multiple_connections_gui_test.py b/tests/signals/multiple_connections_gui_test.py
old mode 100644
new mode 100755
diff --git a/tests/signals/multiple_connections_test.py b/tests/signals/multiple_connections_test.py
old mode 100644
new mode 100755
diff --git a/tests/signals/pysignal_test.py b/tests/signals/pysignal_test.py
old mode 100644
new mode 100755
diff --git a/tests/signals/qobject_destroyed_test.py b/tests/signals/qobject_destroyed_test.py
old mode 100644
new mode 100755
diff --git a/tests/signals/qobject_receivers_test.py b/tests/signals/qobject_receivers_test.py
old mode 100644
new mode 100755
diff --git a/tests/signals/segfault_proxyparent_test.py b/tests/signals/segfault_proxyparent_test.py
old mode 100644
new mode 100755
diff --git a/tests/signals/self_connect_test.py b/tests/signals/self_connect_test.py
old mode 100644
new mode 100755
diff --git a/tests/signals/short_circuit_test.py b/tests/signals/short_circuit_test.py
old mode 100644
new mode 100755
diff --git a/tests/signals/signal2signal_connect_test.py b/tests/signals/signal2signal_connect_test.py
old mode 100644
new mode 100755
diff --git a/tests/signals/signal_autoconnect_test.py b/tests/signals/signal_autoconnect_test.py
old mode 100644
new mode 100755
diff --git a/tests/signals/signal_connectiontype_support.py b/tests/signals/signal_connectiontype_support.py
old mode 100644
new mode 100755
diff --git a/tests/signals/signal_emission_gui_test.py b/tests/signals/signal_emission_gui_test.py
old mode 100644
new mode 100755
diff --git a/tests/signals/signal_emission_test.py b/tests/signals/signal_emission_test.py
old mode 100644
new mode 100755
diff --git a/tests/signals/signal_func_test.py b/tests/signals/signal_func_test.py
old mode 100644
new mode 100755
diff --git a/tests/signals/signal_manager_refcount_test.py b/tests/signals/signal_manager_refcount_test.py
old mode 100644
new mode 100755
diff --git a/tests/signals/signal_object_test.py b/tests/signals/signal_object_test.py
old mode 100644
new mode 100755
diff --git a/tests/signals/signal_with_primitive_type_test.py b/tests/signals/signal_with_primitive_type_test.py
old mode 100644
new mode 100755
diff --git a/tests/signals/slot_reference_count_test.py b/tests/signals/slot_reference_count_test.py
old mode 100644
new mode 100755
diff --git a/tests/signals/static_metaobject_test.py b/tests/signals/static_metaobject_test.py
old mode 100644
new mode 100755
diff --git a/tests/signals/upstream_segfault_test.py b/tests/signals/upstream_segfault_test.py
old mode 100644
new mode 100755
From 0f33e1d3d84f9c1d8540a64ab9ba8dbc0c73d0d9 Mon Sep 17 00:00:00 2001
From: Luciano Wolf
Date: Tue, 8 Jun 2010 10:47:27 -0300
Subject: [PATCH 0004/1129] Updating QEasingCurve and QTest to compile for
ARMEL platforms.
---
PySide/QtCore/typesystem_core.xml | 9 ++++-----
PySide/QtTest/typesystem_test.xml | 2 ++
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 9711e2d..3b3a46b 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -2663,13 +2663,12 @@
+
+
-
-
-
diff --git a/PySide/QtTest/typesystem_test.xml b/PySide/QtTest/typesystem_test.xml
index cbf8add..d1057b2 100644
--- a/PySide/QtTest/typesystem_test.xml
+++ b/PySide/QtTest/typesystem_test.xml
@@ -6,6 +6,8 @@
+
+
From 1a698a7e954fbf005f46aadda2300f475bfec292 Mon Sep 17 00:00:00 2001
From: Luciano Wolf
Date: Tue, 8 Jun 2010 15:47:21 -0300
Subject: [PATCH 0005/1129] Updating QtMaemo5 dependecies inside CMakeLists
file.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Reviewer: Marcelo Lira ,
Renato Araújo
---
PySide/QtMaemo5/CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/PySide/QtMaemo5/CMakeLists.txt b/PySide/QtMaemo5/CMakeLists.txt
index ac85ea4..9251cc3 100644
--- a/PySide/QtMaemo5/CMakeLists.txt
+++ b/PySide/QtMaemo5/CMakeLists.txt
@@ -46,7 +46,7 @@ target_link_libraries(QtMaemo5
${QT_QTGUI_LIBRARY}
${QT_QTMAEMO5_LIBRARY})
-#add_dependencies(QtMaemo5)
+add_dependencies(QtMaemo5 QtGui)
# install
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/QtMaemo5${CMAKE_DEBUG_POSTFIX}.so
From cf6e5f16687a0b28677a5c4ff035eebc5424272d Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Tue, 8 Jun 2010 17:41:32 -0300
Subject: [PATCH 0006/1129] Created unit test for QDate, QTime, QDateTime, QUrl
hash function.
Reviewer: Marcelo Lira ,
Luciano Wolf
---
tests/QtCore/CMakeLists.txt | 1 +
tests/QtCore/hash_test.py | 25 +++++++++++++++++++++++++
2 files changed, 26 insertions(+)
create mode 100644 tests/QtCore/hash_test.py
diff --git a/tests/QtCore/CMakeLists.txt b/tests/QtCore/CMakeLists.txt
index 536d408..eef6ffe 100644
--- a/tests/QtCore/CMakeLists.txt
+++ b/tests/QtCore/CMakeLists.txt
@@ -3,6 +3,7 @@ PYSIDE_TEST(buffer_test.py)
PYSIDE_TEST(child_event_test.py)
PYSIDE_TEST(deletelater_test.py)
PYSIDE_TEST(duck_punching_test.py)
+PYSIDE_TEST(hash_test.py)
PYSIDE_TEST(missing_symbols_test.py)
PYSIDE_TEST(qabs_test.py)
PYSIDE_TEST(qabstracttransition_test.py)
diff --git a/tests/QtCore/hash_test.py b/tests/QtCore/hash_test.py
new file mode 100644
index 0000000..4fdecca
--- /dev/null
+++ b/tests/QtCore/hash_test.py
@@ -0,0 +1,25 @@
+#!/usr/bin/python
+import unittest
+from PySide.QtCore import QDate, QDateTime, QTime, QUrl
+
+class HashTest(unittest.TestCase):
+ def testInsert(self):
+ myHash = {}
+ qdate = QDate.currentDate()
+ qdatetime = QDateTime.currentDateTime()
+ qtime = QTime.currentTime()
+ qurl = QUrl("http://www.pyside.org")
+
+ myHash[qdate] = "QDate"
+ myHash[qdatetime] = "QDateTime"
+ myHash[qtime] = "QTime"
+ myHash[qurl] = "QUrl"
+
+ self.assertEqual(myHash[qdate], "QDate")
+ self.assertEqual(myHash[qdatetime], "QDateTime")
+ self.assertEqual(myHash[qtime], "QTime")
+ self.assertEqual(myHash[qurl], "QUrl")
+
+
+if __name__ == '__main__':
+ unittest.main()
From bf8a60db4cdbfc3e7c9c98778b219e9c83746d44 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Tue, 8 Jun 2010 17:42:43 -0300
Subject: [PATCH 0007/1129] Created support to hash objects with type QDate,
QTime, QDateTime, QUrl.
Reviewer: Marcelo Lira ,
Luciano Wolf
---
PySide/QtCore/typesystem_core.xml | 8 ++++----
libpyside/pyside.h | 9 +++++++++
2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 3b3a46b..d68addd 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -992,7 +992,7 @@
-
+
@@ -1024,7 +1024,7 @@
-
+
@@ -1063,7 +1063,7 @@
-
+
@@ -1681,7 +1681,7 @@
-
+
diff --git a/libpyside/pyside.h b/libpyside/pyside.h
index 2048265..52aeec1 100644
--- a/libpyside/pyside.h
+++ b/libpyside/pyside.h
@@ -44,6 +44,15 @@ namespace PySide
PYSIDE_API void init(PyObject *module);
+/**
+ * Hash function used to enable hash on objects not supported on native Qt library which has toString function.
+ */
+template
+inline uint hash(const T& value)
+{
+ return qHash(value.toString());
+}
+
/**
* If the type \p T was registered on Qt meta type system with Q_DECLARE_METATYPE macro, this class will initialize
* the meta type.
From 009b6a8e9a70db61ad4b9d1021dd2ee4f9cdb650 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Wed, 9 Jun 2010 14:01:51 -0300
Subject: [PATCH 0008/1129] Fix cmake detection of phonon on MacOSX.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Reviewer: Luciano Wolf
Renato Araújo
---
PySide/phonon/CMakeLists.txt | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/PySide/phonon/CMakeLists.txt b/PySide/phonon/CMakeLists.txt
index 01b1f6a..7392063 100644
--- a/PySide/phonon/CMakeLists.txt
+++ b/PySide/phonon/CMakeLists.txt
@@ -1,5 +1,10 @@
project(phonon)
+# workaround for a cmake bug under MacOSX, it finds phonon but not the include path
+if (NOT QT_PHONON_INCLUDE_DIR AND CMAKE_HOST_APPLE)
+ set(QT_PHONON_INCLUDE_DIR "${QT_LIBRARY_DIR}/phonon.framework/Headers")
+endif()
+
set(phonon_SRC
${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_abstractaudiooutput_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_abstractmediastream_wrapper.cpp
From 1a40cc79df157bec25a3439f8fb08c4809651146 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Wed, 9 Jun 2010 18:18:22 -0300
Subject: [PATCH 0009/1129] Fix compilation of QTest bindings on MacOSX.
Reviewer: Marcelo Lira
Luciano Wolf
---
PySide/QtTest/typesystem_test.xml | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/PySide/QtTest/typesystem_test.xml b/PySide/QtTest/typesystem_test.xml
index d1057b2..bc447ee 100644
--- a/PySide/QtTest/typesystem_test.xml
+++ b/PySide/QtTest/typesystem_test.xml
@@ -18,6 +18,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
From b2bf4f18cc7182384800914118dc66dd087cadf9 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Wed, 9 Jun 2010 18:13:23 -0300
Subject: [PATCH 0010/1129] Rename necessary arguments on QtCore typesystem.
Reviewer: Hugo Parente Lima ,
Luciano Wolf
---
PySide/QtCore/typesystem_core.xml | 31 ++++++++++++++++++++++++++++++-
1 file changed, 30 insertions(+), 1 deletion(-)
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index d68addd..8924fa4 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -1079,6 +1079,16 @@
+
+
+
+
+
+
+
+
+
+
@@ -1195,7 +1205,11 @@
-
+
+
+
+
+
@@ -1275,12 +1289,18 @@
+
+
+
// %FUNCTION_NAME() - disable generation of function call.
%PYARG_0 = %CONVERTTOPYTHON[bool](qobjectConnect(%1, %2, %CPPSELF, %3, %4));
+
+
+
// %FUNCTION_NAME() - disable generation of function call.
%PYARG_0 = %CONVERTTOPYTHON[bool](qobjectConnect(%1, %2, %3, %4, %5));
@@ -1289,6 +1309,7 @@
+
@@ -1299,6 +1320,7 @@
+
@@ -1308,6 +1330,7 @@
+
@@ -1433,6 +1456,12 @@
+
+
+
+
+
+
From 24a944590663582df72aefd1929ec19ba3c6414f Mon Sep 17 00:00:00 2001
From: Luciano Wolf
Date: Wed, 9 Jun 2010 19:34:40 -0300
Subject: [PATCH 0011/1129] Apply "rename to" tag to QtGui methods.
Reviewer: Hugo Parente Lima ,
Marcelo Lira
---
PySide/QtGui/typesystem_gui_common.xml | 53 ++++++++++++++++++++++++++
1 file changed, 53 insertions(+)
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index f971f25..fac9f56 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -516,6 +516,11 @@
+
+
+
+
+
@@ -780,6 +785,11 @@
+
+
+
+
+
@@ -818,6 +828,11 @@
+
+
+
+
+
@@ -2457,26 +2472,47 @@
+
+
+
addLayoutOwnership(%CPPSELF, %1);
+
+
+
addLayoutOwnership(%CPPSELF, %1);
+
+
+
addLayoutOwnership(%CPPSELF, %1);
+
+
+
addLayoutOwnership(%CPPSELF, %1);
+
+
+
+
+
+
+
+
+
addLayoutOwnership(%CPPSELF, %1);
@@ -3663,6 +3699,9 @@
+
+
+
@@ -4077,6 +4116,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -4628,4 +4680,5 @@
+
From e39bfefde9edda662f51eeaf9a482f209c7f1217 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Thu, 3 Jun 2010 15:34:17 -0300
Subject: [PATCH 0012/1129] Remove wrapper for classes: QString, QStringRef,
QLatin1String, QStringMatcher, QChar and QLatin1Char.
---
PySide/QtCore/CMakeLists.txt | 7 -
PySide/QtCore/glue/qstring_bufferprotocol.cpp | 43 --
PySide/QtCore/glue/qstring_hashfunc.cpp | 6 -
PySide/QtCore/qchar_conversions.h | 42 +-
PySide/QtCore/qstring_conversions.h | 128 +++---
PySide/QtCore/qstringlist_conversions.h | 16 +-
PySide/QtCore/qstringref_conversions.h | 19 +
PySide/QtCore/typesystem_core.xml | 371 ++----------------
tests/QtCore/CMakeLists.txt | 6 -
tests/QtCore/buffer_test.py | 13 -
tests/QtCore/qbytearray_operator_iadd_test.py | 11 +-
tests/QtCore/qbytearray_operator_test.py | 6 +-
tests/QtCore/qchar_test.py | 59 ---
tests/QtCore/qdatastream_test.py | 3 +-
tests/QtCore/qenum_test.py | 4 +-
tests/QtCore/qlatin1string_test.py | 21 -
tests/QtCore/qobject_property_test.py | 8 +-
tests/QtCore/qstring_buffer_protocol_test.py | 20 -
tests/QtCore/qstring_operator_test.py | 161 --------
tests/QtCore/qstring_test.py | 176 +--------
tests/QtCore/qstringlist_test.py | 171 --------
tests/QtCore/qtextstream_test.py | 16 +-
tests/QtCore/qvariant_pyobject_test.py | 7 +-
tests/QtCore/qvariant_test.py | 19 +-
tests/QtCore/translation_test.py | 4 +-
tests/QtGui/qinputdialog_get_test.py | 2 +-
tests/QtGui/qpixmap_test.py | 2 +-
tests/QtGui/qstring_qkeysequence_test.py | 15 +-
tests/QtSql/qsqldatabaseandqueries_test.py | 4 +-
tests/phonon/capabilities_test.py | 4 +-
tests/signals/decorators_test.py | 4 +-
tests/signals/signal_object_test.py | 8 +-
32 files changed, 187 insertions(+), 1189 deletions(-)
delete mode 100644 PySide/QtCore/glue/qstring_bufferprotocol.cpp
delete mode 100644 PySide/QtCore/glue/qstring_hashfunc.cpp
create mode 100644 PySide/QtCore/qstringref_conversions.h
delete mode 100644 tests/QtCore/buffer_test.py
delete mode 100644 tests/QtCore/qchar_test.py
delete mode 100644 tests/QtCore/qlatin1string_test.py
delete mode 100755 tests/QtCore/qstring_buffer_protocol_test.py
delete mode 100644 tests/QtCore/qstring_operator_test.py
delete mode 100644 tests/QtCore/qstringlist_test.py
diff --git a/PySide/QtCore/CMakeLists.txt b/PySide/QtCore/CMakeLists.txt
index 7572519..bbe8ba7 100644
--- a/PySide/QtCore/CMakeLists.txt
+++ b/PySide/QtCore/CMakeLists.txt
@@ -49,7 +49,6 @@ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qbitarray_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qbuffer_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qbytearray_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qbytearraymatcher_wrapper.cpp
-${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qchar_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qchildevent_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qcoreapplication_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qcryptographichash_wrapper.cpp
@@ -69,8 +68,6 @@ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qfsfileengine_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qgenericargument_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qgenericreturnargument_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qiodevice_wrapper.cpp
-${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qlatin1char_wrapper.cpp
-${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qlatin1string_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qlibraryinfo_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qline_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qlinef_wrapper.cpp
@@ -101,10 +98,6 @@ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qsignalmapper_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qsize_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qsizef_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qsocketnotifier_wrapper.cpp
-${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qstring_wrapper.cpp
-${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qstringlist_wrapper.cpp
-${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qstringmatcher_wrapper.cpp
-${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qstringref_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qsysinfo_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qsystemlocale_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qsystemsemaphore_wrapper.cpp
diff --git a/PySide/QtCore/glue/qstring_bufferprotocol.cpp b/PySide/QtCore/glue/qstring_bufferprotocol.cpp
deleted file mode 100644
index 02ca32c..0000000
--- a/PySide/QtCore/glue/qstring_bufferprotocol.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-
-#if PY_VERSION_HEX < 0x03000000
-
-// QByteArray buffer protocol functions
-// see: http://www.python.org/dev/peps/pep-3118/
-
-extern "C" {
-
-static Py_ssize_t SbkQString_segcountproc(PyObject* self, Py_ssize_t* lenp)
-{
- if (lenp)
- *lenp = self->ob_type->tp_as_sequence->sq_length(self);
- return 1;
-}
-
-static Py_ssize_t SbkQString_readbufferproc(PyObject* self, Py_ssize_t segment, char** ptrptr)
-{
- if (segment || Shiboken::cppObjectIsInvalid(self))
- return -1;
-
- QString* cppSelf = Converter::toCpp(self);
- QByteArray decodedData = cppSelf->toLocal8Bit();
- Shiboken::AutoDecRef decodedString(PyString_FromStringAndSize(decodedData.constData(), decodedData.size()));
-
- // delete __encodedStr attr if it exists
- Shiboken::AutoDecRef attrName(PyString_FromStringAndSize("__encodedStr", sizeof("__encodedStr")-1));
- if (PyObject_HasAttr(self, attrName))
- PyObject_DelAttr(self, attrName);
- PyObject_SetAttr(self, attrName, decodedString);
- *ptrptr = PyString_AS_STRING(decodedString.object());
- return decodedData.size();
-}
-
-PyBufferProcs SbkQStringBufferProc = {
- /*bf_getreadbuffer*/ 0,
- /*bf_getwritebuffer*/ 0,
- /*bf_getsegcount*/ &SbkQString_segcountproc,
- /*bf_getcharbuffer*/ &SbkQString_readbufferproc
-};
-
-}
-
-#endif
diff --git a/PySide/QtCore/glue/qstring_hashfunc.cpp b/PySide/QtCore/glue/qstring_hashfunc.cpp
deleted file mode 100644
index b2fb6a1..0000000
--- a/PySide/QtCore/glue/qstring_hashfunc.cpp
+++ /dev/null
@@ -1,6 +0,0 @@
-static long QStringCustomHashFunction(const QString& str)
-{
- QByteArray data = str.toUtf8();
- Shiboken::AutoDecRef unicodeObj(PyUnicode_DecodeUTF8(data.constData(), data.length(), 0));
- return unicodeObj->ob_type->tp_hash(unicodeObj);
-}
diff --git a/PySide/QtCore/qchar_conversions.h b/PySide/QtCore/qchar_conversions.h
index 6347c93..ab477ef 100644
--- a/PySide/QtCore/qchar_conversions.h
+++ b/PySide/QtCore/qchar_conversions.h
@@ -1,30 +1,30 @@
namespace Shiboken {
-inline bool Shiboken::Converter::isConvertible(PyObject* pyObj)
-{
- return PyObject_TypeCheck(pyObj, SbkType())
- || SbkPySide_QtCore_QChar_SpecialCharacter_Check(pyObj)
- || SbkQLatin1Char_Check(pyObj)
- || (PyString_Check(pyObj) && (PyString_Size(pyObj) == 1))
- || PyInt_Check(pyObj);
-}
-inline QChar Shiboken::Converter::toCpp(PyObject* pyObj)
+template<>
+class Converter
{
- if (!Shiboken_TypeCheck(pyObj, QChar)) {
- if (SbkPySide_QtCore_QChar_SpecialCharacter_Check(pyObj))
- return QChar(Shiboken::Converter::toCpp(pyObj));
- else if (SbkQLatin1Char_Check(pyObj))
- return QChar(Shiboken::Converter::toCpp(pyObj));
- else if (PyString_Check(pyObj) && PyString_Size(pyObj) == 1)
+public:
+ static bool isConvertible(PyObject* pyObj)
+ {
+ return (PyString_Check(pyObj) && (PyString_Size(pyObj) == 1))
+ || PyInt_Check(pyObj);
+ }
+
+ static QChar toCpp(PyObject* pyObj)
+ {
+ if (PyString_Check(pyObj) && PyString_Size(pyObj) == 1)
return QChar(Shiboken::Converter::toCpp(pyObj));
else if (PyInt_Check(pyObj))
return QChar(Shiboken::Converter::toCpp(pyObj));
+ return QChar();
}
- return *Converter::toCpp(pyObj);
-}
-inline PyObject* Converter::toPython(const QChar& cppObj)
-{
- return ValueTypeConverter::toPython(cppObj);
-}
+ static PyObject* toPython(void* cppObj) { return toPython(*reinterpret_cast(cppObj)); }
+ static PyObject* toPython(const QChar& cppObj)
+ {
+ wchar_t c = (wchar_t)cppObj.unicode();
+ PyObject* pyObj = PyUnicode_FromWideChar(&c, 1);
+ return pyObj;
+ }
+};
}
diff --git a/PySide/QtCore/qstring_conversions.h b/PySide/QtCore/qstring_conversions.h
index 2c59928..392f0e7 100644
--- a/PySide/QtCore/qstring_conversions.h
+++ b/PySide/QtCore/qstring_conversions.h
@@ -1,72 +1,70 @@
namespace Shiboken {
-inline bool Converter::isConvertible(PyObject* pyObj)
-{
- SbkBaseWrapperType* shiboType = reinterpret_cast(SbkType());
- return PyString_Check(pyObj)
- || PyObject_TypeCheck(pyObj, SbkType())
- || PyUnicode_Check(pyObj)
- || SbkQByteArray_Check(pyObj)
- || SbkQLatin1String_Check(pyObj)
- || pyObj == Py_None
-#if PY_VERSION_HEX < 0x03000000
- || (pyObj->ob_type->tp_as_buffer
- && PyType_HasFeature(pyObj->ob_type, Py_TPFLAGS_HAVE_GETCHARBUFFER)
- && pyObj->ob_type->tp_as_buffer->bf_getcharbuffer)
-#endif
- || SbkQChar_Check(pyObj)
- || (shiboType->ext_isconvertible && shiboType->ext_isconvertible(pyObj));
-}
-inline QString Converter::toCpp(PyObject* pyObj)
+template<>
+class Converter
{
- SbkBaseWrapperType* shiboType = reinterpret_cast(SbkType());
- if (SbkQChar_Check(pyObj)) {
- return QString(Converter< QChar >::toCpp(pyObj));
- } else if (SbkQByteArray_Check(pyObj)) {
- return QString(Converter< QByteArray >::toCpp(pyObj));
- } else if (SbkQLatin1String_Check(pyObj)) {
- return QString(Converter< QLatin1String >::toCpp(pyObj));
- } else if (PyUnicode_Check(pyObj)) {
- Py_UNICODE* unicode = PyUnicode_AS_UNICODE(pyObj);
-#if defined(Py_UNICODE_WIDE)
- // cast as Py_UNICODE can be a different type
- return QString::fromUcs4(reinterpret_cast(unicode));
-#else
- return QString::fromUtf16(unicode, PyUnicode_GET_SIZE(pyObj));
-#endif
- } else if (PyString_Check(pyObj)) {
- return QString(Converter< char * >::toCpp(pyObj));
- } else if (pyObj == Py_None) {
+public:
+ static bool isConvertible(PyObject* pyObj)
+ {
+ return PyString_Check(pyObj)
+ || PyUnicode_Check(pyObj)
+ || SbkQByteArray_Check(pyObj)
+ || pyObj == Py_None
+ #if PY_VERSION_HEX < 0x03000000
+ || (pyObj->ob_type->tp_as_buffer
+ && PyType_HasFeature(pyObj->ob_type, Py_TPFLAGS_HAVE_GETCHARBUFFER)
+ && pyObj->ob_type->tp_as_buffer->bf_getcharbuffer)
+ #endif
+ ;
+ }
+
+ static QString toCpp(PyObject* pyObj)
+ {
+ if (PyUnicode_Check(pyObj)) {
+ Py_UNICODE* unicode = PyUnicode_AS_UNICODE(pyObj);
+ #if defined(Py_UNICODE_WIDE)
+ // cast as Py_UNICODE can be a different type
+ return QString::fromUcs4(reinterpret_cast(unicode));
+ #else
+ return QString::fromUtf16(unicode, PyUnicode_GET_SIZE(pyObj));
+ #endif
+ } else if (PyString_Check(pyObj)) {
+ return QString(Converter< char * >::toCpp(pyObj));
+ } else if (pyObj == Py_None) {
+ return QString();
+ } else if (SbkQByteArray_Check(pyObj)) {
+ return QString(Converter< QByteArray >::toCpp(pyObj));
+ }
+#if PY_VERSION_HEX < 0x03000000
+ // Support for buffer objects on QString constructor
+ else if (pyObj->ob_type->tp_as_buffer
+ && PyType_HasFeature(pyObj->ob_type, Py_TPFLAGS_HAVE_GETCHARBUFFER)
+ && pyObj->ob_type->tp_as_buffer->bf_getcharbuffer) {
+ QByteArray data;
+ PyBufferProcs* bufferProcs = pyObj->ob_type->tp_as_buffer;
+ int segments = bufferProcs->bf_getsegcount(pyObj, 0);
+ for (int i = 0; i < segments; ++i) {
+ char* segmentData;
+ int length = bufferProcs->bf_getcharbuffer(pyObj, i, &segmentData);
+ if (length == -1)
+ break;
+ data.append(segmentData, length);
+ }
+ return QString(data);
+ }
+ #endif
return QString();
}
-#if PY_VERSION_HEX < 0x03000000
- // Support for buffer objects on QString constructor
- else if (pyObj->ob_type->tp_as_buffer
- && PyType_HasFeature(pyObj->ob_type, Py_TPFLAGS_HAVE_GETCHARBUFFER)
- && pyObj->ob_type->tp_as_buffer->bf_getcharbuffer) {
- QByteArray data;
- PyBufferProcs* bufferProcs = pyObj->ob_type->tp_as_buffer;
- int segments = bufferProcs->bf_getsegcount(pyObj, 0);
- for (int i = 0; i < segments; ++i) {
- char* segmentData;
- int length = bufferProcs->bf_getcharbuffer(pyObj, i, &segmentData);
- if (length == -1)
- break;
- data.append(segmentData, length);
- }
- return QString(data);
- }
-#endif
- else if (shiboType->ext_isconvertible && shiboType->ext_tocpp && shiboType->ext_isconvertible(pyObj)) {
- QString* cptr = reinterpret_cast(shiboType->ext_tocpp(pyObj));
- std::auto_ptr cptr_auto_ptr(cptr);
- return *cptr;
- }
- return *Converter::toCpp(pyObj);
-}
-inline PyObject* Converter::toPython(const QString& cppObj)
-{
- return ValueTypeConverter::toPython(cppObj);
-}
+ static PyObject* toPython(void* cppObj) { return toPython(*reinterpret_cast(cppObj)); }
+ static PyObject* toPython(const QString& cppObj)
+ {
+ const int N = cppObj.length();
+ wchar_t* str = new wchar_t[N];
+ cppObj.toWCharArray(str);
+ PyObject* pyObj = PyUnicode_FromWideChar(str, N);
+ delete[] str;
+ return pyObj;
+ }
+};
}
diff --git a/PySide/QtCore/qstringlist_conversions.h b/PySide/QtCore/qstringlist_conversions.h
index 9a5ec5f..6075c16 100644
--- a/PySide/QtCore/qstringlist_conversions.h
+++ b/PySide/QtCore/qstringlist_conversions.h
@@ -1,17 +1,5 @@
namespace Shiboken
{
-inline bool Converter::isConvertible(PyObject* pyObj)
-{
- return StdListConverter::isConvertible(pyObj);
-}
-
-inline QStringList Converter::toCpp(PyObject* pyObj)
-{
- return StdListConverter::toCpp(pyObj);
-}
-
-inline PyObject* Converter::toPython(const QStringList& cppObj)
-{
- return ValueTypeConverter::toPython(cppObj);
-}
+template<>
+struct Converter : StdListConverter {};
}
diff --git a/PySide/QtCore/qstringref_conversions.h b/PySide/QtCore/qstringref_conversions.h
new file mode 100644
index 0000000..11e1b9c
--- /dev/null
+++ b/PySide/QtCore/qstringref_conversions.h
@@ -0,0 +1,19 @@
+namespace Shiboken {
+
+template<>
+struct Converter : public Converter
+{
+ static PyObject* toPython(void* cppObj) { return toPython(*reinterpret_cast(cppObj)); }
+
+ static PyObject* toPython(const QStringRef& cppObj)
+ {
+ const QString* str = cppObj.string();
+ return Converter::toPython(*str);
+ }
+
+ static QStringRef toCpp(PyObject* pyObj)
+ {
+ return QStringRef();
+ }
+};
+}
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 8924fa4..56c8b30 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -39,8 +39,15 @@
+
+
+
+
+
+
+
@@ -66,15 +73,6 @@
-
-
-
-
-
-
-
-
-
@@ -111,8 +109,6 @@
-
-
@@ -134,8 +130,7 @@
-
-
+
@@ -145,9 +140,20 @@
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -242,7 +248,6 @@
-
@@ -542,20 +547,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -699,7 +690,6 @@
-
@@ -722,6 +712,8 @@
+ Shiboken::TypeResolver::createValueTypeResolver<QString>("unicode");
+ Shiboken::TypeResolver::createValueTypeResolver<QString>("str");
PySide::init(module);
@@ -772,224 +764,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
- #if PY_VERSION_HEX < 0x03000000
- Shiboken::SbkType<QString>()->tp_as_buffer = &SbkQStringBufferProc;
- Shiboken::SbkType<QString>()->tp_flags |= Py_TPFLAGS_HAVE_GETCHARBUFFER;
- #endif
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- QByteArray utf8 = %CPPSELF.toUtf8();
- %PYARG_0 = PyUnicode_DecodeUTF8(utf8.data(), utf8.count(), 0);
-
-
-
-
- return %CPPSELF.count();
-
-
-
-
- if (_i < 0 || _i >= %CPPSELF.size()) {
- PyErr_SetString(PyExc_IndexError, "index out of bounds");
- return 0;
- }
- return %CONVERTTOPYTHON[%TYPE](%CPPSELF.at(_i));
-
-
-
-
- %CPPSELF.remove(_i, 1);
- PyObject* args = Py_BuildValue("(nO)", _i, _value);
- PyObject* result = SbkQStringFunc_insert(self, args);
- Py_DECREF(args);
- Py_XDECREF(result);
- return !result ? -1 : 0;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Implementation note: This constructor is a replacement for
- QChar(char), as the char type check also catches numbers,
- conflicting with QChar(int).
-
-
- if (PyString_Size(%PYARG_1) == 1) {
- char value = %CONVERTTOCPP[char](%PYARG_1);
- %0 = new %TYPE(value);
- } else {
- PyErr_SetString(PyExc_TypeError, "expected string of size 1");
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1062,7 +836,6 @@
-
@@ -1493,7 +1266,6 @@
-
@@ -1635,75 +1407,6 @@
-
-
-
-
-
- return %CPPSELF.count();
-
-
-
-
- if (_i < 0 || _i >= %CPPSELF.size()) {
- PyErr_SetString(PyExc_IndexError, "index out of bounds");
- return 0;
- }
- return %CONVERTTOPYTHON[QString](%CPPSELF.at(_i));
-
-
-
-
- PyObject* args = Py_BuildValue("(nO)", _i, _value);
- PyObject* result = SbkQStringListFunc_replace(self, args);
- Py_DECREF(args);
- Py_XDECREF(result);
- return !result ? -1 : 0;
-
-
-
-
-
-
-
-
-
-
- return 0;
-
-
-
@@ -1759,9 +1462,7 @@
-
-
@@ -2134,15 +1835,12 @@
-
-
-
-
+
+
+
-
-
-
+
@@ -2506,7 +2204,10 @@
+
+
+
@@ -2526,6 +2227,11 @@
+
+
+
+
+
@@ -2553,10 +2259,6 @@
-
-
-
-
@@ -2566,6 +2268,7 @@
+
diff --git a/tests/QtCore/CMakeLists.txt b/tests/QtCore/CMakeLists.txt
index eef6ffe..4a78bf6 100644
--- a/tests/QtCore/CMakeLists.txt
+++ b/tests/QtCore/CMakeLists.txt
@@ -1,5 +1,4 @@
PYSIDE_TEST(blocking_signals_test.py)
-PYSIDE_TEST(buffer_test.py)
PYSIDE_TEST(child_event_test.py)
PYSIDE_TEST(deletelater_test.py)
PYSIDE_TEST(duck_punching_test.py)
@@ -14,7 +13,6 @@ PYSIDE_TEST(qbytearray_concatenation_operator_test.py)
PYSIDE_TEST(qbytearray_operator_iadd_test.py)
PYSIDE_TEST(qbytearray_operator_test.py)
PYSIDE_TEST(qbytearray_test.py)
-PYSIDE_TEST(qchar_test.py)
PYSIDE_TEST(qcoreapplication_instance_test.py)
PYSIDE_TEST(qdatastream_test.py)
PYSIDE_TEST(qdate_test.py)
@@ -24,7 +22,6 @@ PYSIDE_TEST(qfileinfo_test.py)
PYSIDE_TEST(qfile_test.py)
PYSIDE_TEST(qflags_test.py)
PYSIDE_TEST(qhandle_test.py)
-PYSIDE_TEST(qlatin1string_test.py)
PYSIDE_TEST(qlinef_test.py)
PYSIDE_TEST(qlocale_test.py)
PYSIDE_TEST(qmetaobject_test.py)
@@ -48,9 +45,6 @@ PYSIDE_TEST(qslot_object_test.py)
PYSIDE_TEST(qsrand_test.py)
PYSIDE_TEST(qstatemachine_test.py)
PYSIDE_TEST(qstate_test.py)
-PYSIDE_TEST(qstring_buffer_protocol_test.py)
-PYSIDE_TEST(qstringlist_test.py)
-PYSIDE_TEST(qstring_operator_test.py)
PYSIDE_TEST(qstring_test.py)
PYSIDE_TEST(qtext_codec_test.py)
PYSIDE_TEST(qtextstream_test.py)
diff --git a/tests/QtCore/buffer_test.py b/tests/QtCore/buffer_test.py
deleted file mode 100644
index 2917232..0000000
--- a/tests/QtCore/buffer_test.py
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/usr/bin/python
-
-import unittest
-from PySide.QtCore import QString
-
-class BufferTest(unittest.TestCase):
- def testQByteArray(self):
- data = buffer("PySide")
- str = QString(data)
- self.assertEqual(data, str)
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/tests/QtCore/qbytearray_operator_iadd_test.py b/tests/QtCore/qbytearray_operator_iadd_test.py
index 168f22d..f92fc19 100644
--- a/tests/QtCore/qbytearray_operator_iadd_test.py
+++ b/tests/QtCore/qbytearray_operator_iadd_test.py
@@ -2,12 +2,12 @@
import unittest
import new
-from PySide.QtCore import QByteArray, QString
+from PySide.QtCore import *
from helper.docmodifier import DocModifier
class BaseQByteArrayOperatorIAdd(object):
'''Base class for QByteArray += operator tests.
-
+
Implementing classes should inherit from unittest.TestCase and implement
setUp, setting self.obj and self.orig_obj to the target QByteArray and original
one, respectively'''
@@ -41,13 +41,6 @@ class BaseQByteArrayOperatorIAdd(object):
self.assertEqual(self.obj, self.orig_obj + s)
self.assertEqual(self.obj.size(), self.orig_obj.size() + 1)
- def testQString(self):
- '''QByteArray += QString'''
- s = QString('dummy')
- self.obj += s
- self.assertEqual(self.obj, self.orig_obj + s)
- self.assertEqual(self.obj.size(), self.orig_obj.size() + s.size())
-
class NullQByteArrayOperatorIAdd(unittest.TestCase, BaseQByteArrayOperatorIAdd):
'''Test case for operator QByteArray += on null QByteArrays'''
diff --git a/tests/QtCore/qbytearray_operator_test.py b/tests/QtCore/qbytearray_operator_test.py
index 4a20c04..662bc6e 100644
--- a/tests/QtCore/qbytearray_operator_test.py
+++ b/tests/QtCore/qbytearray_operator_test.py
@@ -4,7 +4,7 @@
import unittest
-from PySide.QtCore import QByteArray, QString
+from PySide.QtCore import *
class QByteArrayOperatorEqual(unittest.TestCase):
'''TestCase for operator QByteArray == QByteArray'''
@@ -26,9 +26,9 @@ class QByteArrayOperatorEqual(unittest.TestCase):
self.assertEqual(QByteArray(string), string)
def testQString(self):
- #QByteArray(string) == QString(string)
+ #QByteArray(string) == string
string = 'another test string'
- self.assertEqual(QByteArray(string), QString(string))
+ self.assertEqual(QByteArray(string), string)
class QByteArrayOperatorAt(unittest.TestCase):
'''TestCase for operator QByteArray[]'''
diff --git a/tests/QtCore/qchar_test.py b/tests/QtCore/qchar_test.py
deleted file mode 100644
index a40724b..0000000
--- a/tests/QtCore/qchar_test.py
+++ /dev/null
@@ -1,59 +0,0 @@
-
-'''Test cases for QChar'''
-
-import unittest
-
-from PySide.QtCore import QString, QChar, QTextStream, QLatin1Char
-
-
-class EqualTest(unittest.TestCase):
- '''Tests for '__equal__'''
-
- def testEqualQChar(self):
- '''QChar == QChar'''
- self.assertEqual(QChar('a'), QChar('a'))
-
- def testEqualPyString(self):
- '''QChar == Python string'''
- self.assertEqual(QChar('a'), 'a')
-
-
-class ImplicitConvQLatin1Char(unittest.TestCase):
- '''Tests for implicit conversion from QLatin1Char to QChar'''
-
- def testQLatin1CharToChar(self):
- '''QLatin1Char implicitly convertible to QChar'''
- stream = QTextStream()
- stream.setPadChar(QLatin1Char('-'))
- self.assertEqual(QChar('-'), stream.padChar())
-
-
-class QCharCtorBigNumber(unittest.TestCase):
- '''QChar constructors receiving ints'''
-
- def testInt(self):
- '''QChar(int)'''
- codepoint = 512
- qchar = QChar(codepoint)
- reference = unichr(codepoint)
- self.assertEqual(qchar.unicode(), codepoint)
-
-
-class QCharCtorString(unittest.TestCase):
- '''QChar constructor receiving strings'''
-
- def testBasic(self):
- '''QChar(char)'''
- reference = 'a'
- qchar = QChar(reference)
- self.assertEqual(ord(reference), ord(qchar.toAscii()))
-
- def testError(self):
- '''QChar(char)'''
- reference = 'aaaaaa'
- self.assertRaises(TypeError, QChar, reference)
-
-
-if __name__ == '__main__':
- unittest.main()
-
diff --git a/tests/QtCore/qdatastream_test.py b/tests/QtCore/qdatastream_test.py
index d71ed2f..e809185 100644
--- a/tests/QtCore/qdatastream_test.py
+++ b/tests/QtCore/qdatastream_test.py
@@ -3,8 +3,7 @@
import unittest
-from PySide.QtCore import QDataStream, QString, QIODevice, QByteArray
-from PySide.QtCore import QBitArray, QDate, QTime, QDateTime, QLine, QChar
+from PySide.QtCore import *
def create_bitarray(string):
array = QBitArray(len(string))
diff --git a/tests/QtCore/qenum_test.py b/tests/QtCore/qenum_test.py
index e3f9638..d896ae6 100644
--- a/tests/QtCore/qenum_test.py
+++ b/tests/QtCore/qenum_test.py
@@ -3,7 +3,7 @@
import unittest
-from PySide.QtCore import QIODevice, QString, Qt, QVariant
+from PySide.QtCore import *
class TestEnum(unittest.TestCase):
@@ -18,7 +18,7 @@ class TestEnum(unittest.TestCase):
self.assertEqual(QIODevice.Unbuffered, 32)
def testToIntInFunction(self):
- self.assertEqual(QString.number(QIODevice.WriteOnly), "2")
+ self.assertEqual(str(int(QIODevice.WriteOnly)), "2")
class TestQFlags(unittest.TestCase):
def testToItn(self):
diff --git a/tests/QtCore/qlatin1string_test.py b/tests/QtCore/qlatin1string_test.py
deleted file mode 100644
index fdcf6ec..0000000
--- a/tests/QtCore/qlatin1string_test.py
+++ /dev/null
@@ -1,21 +0,0 @@
-
-'''Test cases for QLatin1String'''
-
-import unittest
-
-from PySide.QtCore import QString, QLatin1String, QObject
-
-
-class ImplicitConvQLatin1String(unittest.TestCase):
- '''Tests for implicit conversion from QLatin1String to QString'''
-
- def testQLatin1String(self):
- '''QString implicit convertion from QLatin1String'''
- obj = QObject()
- obj.setObjectName(QLatin1String('dummy'))
-
- self.assertEqual(QString('dummy'), obj.objectName())
-
-if __name__ == '__main__':
- unittest.main()
-
diff --git a/tests/QtCore/qobject_property_test.py b/tests/QtCore/qobject_property_test.py
index 33df2ac..d1f12b3 100644
--- a/tests/QtCore/qobject_property_test.py
+++ b/tests/QtCore/qobject_property_test.py
@@ -3,7 +3,7 @@
import unittest
-from PySide.QtCore import QObject, QVariant, QString
+from PySide.QtCore import *
class PropertyCase(unittest.TestCase):
'''Test case for QObject properties'''
@@ -41,14 +41,14 @@ class PropertyCase(unittest.TestCase):
# QVariant.toInt has a bool* arg in C++, so returns a tuple
self.assertEqual(obj.property('dummy').toInt(), (42, True))
- def testQStringProperty(self):
+ def testStringProperty(self):
obj = QObject()
- self.assert_(not obj.setProperty('dummy', QString('data')))
+ self.assert_(not obj.setProperty('dummy', 'data'))
prop = obj.property('dummy')
self.assert_(isinstance(prop, QVariant))
self.assert_(prop.isValid())
- self.assertEqual(obj.property('dummy').toString(), QString('data'))
+ self.assertEqual(obj.property('dummy').toString(), 'data')
def testImplicitQVariantProperty(self):
obj = QObject()
diff --git a/tests/QtCore/qstring_buffer_protocol_test.py b/tests/QtCore/qstring_buffer_protocol_test.py
deleted file mode 100755
index f8475d0..0000000
--- a/tests/QtCore/qstring_buffer_protocol_test.py
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-'''Tests QString implementation of Python buffer protocol'''
-
-import unittest
-
-from os.path import isdir
-from PySide.QtCore import QString
-
-class QStringBufferProtocolTest(unittest.TestCase):
- '''Tests QString implementation of Python buffer protocol'''
-
- def testQStringBufferProtocol(self):
- #Tests QString implementation of Python buffer protocol using the os.path.isdir
- #function which an unicode object or other object implementing the Python buffer protocol
- isdir(QString('/tmp'))
-
-if __name__ == '__main__':
- unittest.main()
-
diff --git a/tests/QtCore/qstring_operator_test.py b/tests/QtCore/qstring_operator_test.py
deleted file mode 100644
index 6d7ae31..0000000
--- a/tests/QtCore/qstring_operator_test.py
+++ /dev/null
@@ -1,161 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-'''Test cases for QString operators'''
-
-import unittest
-
-from PySide.QtCore import QString, QByteArray
-
-class QStringOperatorEqual(unittest.TestCase):
- '''TestCase for operator QString == QString'''
-
- def testDefault(self):
- #QString() == QString()
- obj1 = QString()
- obj2 = QString()
- self.assertEqual(obj1, obj2)
-
- def testSimple(self):
- #QString(some_string) == QString(some_string)
- string = 'egg snakes'
- self.assertEqual(QString(string), QString(string))
-
- def testUnicode(self):
- #QString(unicode) == QString(unicode)
- string = u'à âãá'
- self.assertEqual(QString(string), QString(string))
-
- def testPyString(self):
- #QString(string) == string
- string = 'my test string'
- self.assertEqual(QString(string), string)
- self.assertEqual(string, QString(string))
-
- def testPyUnicodeString(self):
- #QString(unicode) == unicode
- string = u'à âãá'
- self.assertEqual(QString(string), string)
- self.assertEqual(string, unicode(QString(string)))
-
- def testQByteArray(self):
- #QString(string) == QByteArray(string)
- string = 'another test string'
- self.assertEqual(QString(string), QByteArray(string))
-
-
-class QStringOperatorAtSetter(unittest.TestCase):
- '''Test case for operator QString[] - __setitem__'''
-
- def testSetterString(self):
- '''QString[x] = pythonstring'''
- obj = QString('123456')
- obj[1] = '0'
- self.assertEqual(obj, QString('103456'))
-
- def testSetterStringLarge(self):
- '''QString[x] = pythonstring (larget than 1 char)'''
- obj = QString('123456')
- obj[3] = 'abba'
- self.assertEqual(obj, QString('123abba56'))
-
- def testSetterQString(self):
- '''QString[x] = QString'''
- obj = QString('123456')
- obj[3] = QString('string')
- self.assertEqual(obj, QString('123string56'))
-
- def testSetterQByteArray(self):
- '''QString[x] = qbytearray'''
- obj = QString('123456')
- obj[3] = QByteArray('array')
- self.assertEqual(obj, QString('123array56'))
-
-
-class QStringOperatorAtSetterNegativeIndex(unittest.TestCase):
- '''Test case for QString[] - __setitem__ - for negative index'''
-
- def testSetterNegativeIndex(self):
- '''QString[x] = string - negative index'''
- obj = QString('123456')
- obj[-3] = 'array'
- self.assertEqual(obj, QString('123array56'))
-
-
-class QStringOperatorAtSetterLargeIndex(unittest.TestCase):
- '''Test case for QString[] - __setitem__ - for 'overflown' index'''
-
- def testSetterLargeIndexEmpty(self):
- '''QString[x] = somestring - Overflow index on empty string'''
- # should pad with spaces if the index is larger
- obj = QString('')
- obj[2] = 'a'
- self.assertEqual(obj, QString(' a'))
-
- def testSetterLargeIndexNormal(self):
- '''QString[x] = somestring - Overflow index on normal string'''
- # should pad with spaces if the index is larger
- obj = QString('mystring')
- obj[10] = 'normal'
- self.assertEqual(obj, QString('mystring normal'))
-
-
-class QStringOperatorAt(unittest.TestCase):
- '''TestCase for operator QString[] - __getitem__'''
-
- def testInRange(self):
- #QString[x] where x is a valid index
- string = 'abcdefgh'
- obj = QString(string)
-
- for i in range(len(string)):
- self.assertEqual(obj[i], string[i])
-
- def testInRangeReverse(self):
- #QString[x] where x is a valid index (reverse order)
- string = 'abcdefgh'
- obj = QString(string)
-
- for i in range(len(string)-1, 0, -1):
- self.assertEqual(obj[i], string[i])
-
-
- def testInRangeUnicode(self):
- #QString[x] where x is a valid index (unicode)
- string = u'à âãá'
- obj = QString(string)
-
- for i in range(len(string)):
- self.assertEqual(obj[i], string[i])
-
- def testInRangeUnicodeReverse(self):
- #QString[x] where x is a valid index (unicode) (reverse order)
- string = u'à âãá'
- obj = QString(string)
-
- for i in range(len(string)-1, 0, -1):
- self.assertEqual(obj[i], string[i])
-
- def testOutOfRange(self):
- #QString[x] where x is out of index
- string = '1234567'
- obj = QString(string)
- self.assertRaises(IndexError, lambda :obj[len(string)])
-
- def testReturnQString(self):
- #QString[x] must return a QString
- string = QString('123456')
- data = string[0]
- self.assert_(isinstance(data, QString))
-
-class QStringOperatorAdd(unittest.TestCase):
- '''TestCase for operator QString[]'''
-
- def testOperatorAdd(self):
- str1 = '123'
- str2 = QString('456')
- self.assertEquals('123456', str1 + str2)
- self.assertEquals('456123', str2 + str1)
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/tests/QtCore/qstring_test.py b/tests/QtCore/qstring_test.py
index 3f0fb49..fbaa6d4 100644
--- a/tests/QtCore/qstring_test.py
+++ b/tests/QtCore/qstring_test.py
@@ -6,173 +6,19 @@ import unittest
import ctypes
import sys
-from PySide.QtCore import QString, QByteArray, QObject
-
-class QStringToNumber(unittest.TestCase):
- def testReturnValueTypes(self):
- obj = QString('37')
- val, ok = obj.toInt()
- self.assertEqual(type(val), int)
- self.assertEqual(type(ok), bool)
-
- def testToNumberInt(self):
- obj = QString('37')
- self.assertEqual((37, True), obj.toInt())
-
- def testToNumberLong(self):
- obj = QString('3700000')
- self.assertEqual((3700000, True), obj.toInt())
-
- def testToNumberShort(self):
- obj = QString('33')
- self.assertEqual((ctypes.c_short(33).value, True), obj.toShort())
-
- def testToNumberShortNegative(self):
- obj = QString('-4')
- self.assertEqual((ctypes.c_short(-4).value, True), obj.toShort())
-
- def testToNumberShortOverflow(self):
- obj = QString('1000000')
- self.assertEqual(False, obj.toShort()[1])
-
- def testToNumberUInt(self):
- obj = QString('33')
- self.assertEqual((ctypes.c_uint(33).value, True), obj.toUInt())
-
- def testToNumberUIntNegative(self):
- obj = QString('-4')
- self.assertEqual(False, obj.toUInt()[1])
-
- def testToNumberUIntOverflow(self):
- obj = QString('10000000000000')
- self.assertEqual(False, obj.toUInt()[1])
-
- def testToNumberULong(self):
- obj = QString('33')
- self.assertEqual((ctypes.c_ulong(33).value, True), obj.toULong())
-
- def testToNumberULongNegative(self):
- obj = QString('-4')
- self.assertEqual(False, obj.toULong()[1])
-
- def testToNumberUShort(self):
- obj = QString('33')
- self.assertEqual((ctypes.c_ushort(33).value, True), obj.toUShort())
-
- def testToNumberUShortLarge(self):
- obj = QString('128')
- self.assertEqual((ctypes.c_ushort(128).value, True), obj.toUShort())
-
- def testToNumberUShortOverflow(self):
- obj = QString('205000')
- self.assertEqual(False, obj.toUShort()[1])
-
- def testToNumberUShortNegative(self):
- obj = QString('-4')
- self.assertEqual(False, obj.toUShort()[1])
-
- def testToNumberIntUsingHex(self):
- obj = QString('2A')
- self.assertEquals((0, False), obj.toInt())
- self.assertEqual((int(str(obj), 16), True), obj.toInt(16))
-
- def testToNumberIntUsingHex(self):
- obj = QString('101010')
- self.assertEqual((int(str(obj), 2), True), obj.toInt(2))
-
- def testToNumberFloat(self):
- obj = QString('37.109')
- self.assertEqual(ctypes.c_float(37.109).value,
- obj.toFloat()[0])
-
- def testToNumberDouble(self):
- obj = QString('37.109')
- self.assertEqual(ctypes.c_double(37.109).value,
- obj.toDouble()[0])
-
- def testToULongLong(self):
- obj = QString('37109')
- self.assertEqual(ctypes.c_ulong(37109).value,
- obj.toULongLong()[0])
+from PySide.QtCore import *
class QStringConstructor(unittest.TestCase):
'''Test case for QString constructors'''
def testQStringDefault(self):
- #QString()
- obj1 = QString()
- obj2 = QString()
-
- self.assertEqual(obj1, obj2)
-
- def testNullQString(self):
- s = QString(None)
- self.assertTrue(s.isNull())
-
- def testQStringFromPy(self):
- #QString(const char*)
- sample = 'a new string'
- obj1 = QString(sample)
- obj2 = QString(sample)
- self.assertEqual(obj1, obj2)
-
- def testQStringFromUnicode(self):
- sample = u'áâãà '
- obj1 = QString(sample)
- obj2 = QString(sample)
- self.assertEqual(obj1, obj2)
- self.assertEqual(obj1, sample)
- self.assertEqual(obj2, sample)
-
- def testQStringFromByteArray(self):
- # QByteArray(const char *) must be working
- sample = QByteArray('foo')
- obj1 = QString(sample)
- obj2 = QString(sample)
- self.assertEqual(obj1, obj2)
-
- def testQStringArg(self):
- a = QString("%1 %2 %3").arg(1).arg("two").arg(3.14)
- self.assertEquals("1 two 3.14", str(a))
-
- def testQStringArgNegative(self):
- a = QString("%1").arg(-20)
- self.assertEquals("-20", str(a))
-
-
-class QStringComparison(unittest.TestCase):
- '''Test case for comparison to python strings'''
-
- def testComparePyString(self):
- #Compare QStrings and Python strings.
- py = ''
- qstr = QString()
- self.assertEqual(py, qstr)
-
- py = 'The quick brown fox jumps over the lazy dog'
- qstr = QString(py)
- self.assertEqual(py, qstr)
-
-class QStringRange(unittest.TestCase):
- '''Test case for ranges in python strings'''
-
- def testSimpleRange(self):
- #Test open start and open end intervals
- py = 'The quick brown fox jumps over the lazy dog'
- qstr = QString(py)
- self.assertEqual(py[5:], qstr[5:])
- self.assertEqual(py[:7], qstr[:7])
-
-class QStringIndexOf(unittest.TestCase):
- def testEmpty(self):
- string = QString()
- self.assertEqual(string.indexOf(QString("aaa")), -1)
- self.assertEqual(string.indexOf(QString()), 0)
-
- def testString(self):
- string = QString("the quick brown fox")
- self.assertEqual(string.indexOf("quick", 0), 4)
-
+ obj = QObject()
+ obj.setObjectName('foo')
+ self.assertEqual(obj.objectName(), u'foo')
+ obj.setObjectName(u'áâãà ')
+ self.assertEqual(obj.objectName(), u'áâãà ')
+ obj.setObjectName(None)
+ self.assertEqual(obj.objectName(), u'')
class QStringImplicitConvertion(unittest.TestCase):
'''Implicit conversions for QString'''
@@ -181,12 +27,8 @@ class QStringImplicitConvertion(unittest.TestCase):
'''QString implicitly conversion: QByteArray'''
obj = QObject()
obj.setObjectName(QByteArray('foobar'))
- self.assertEqual(obj.objectName(), QString('foobar'))
+ self.assertEqual(obj.objectName(), u'foobar')
-class QStringHash(unittest.TestCase):
- def testHash(self):
- self.assertEqual(hash("key"), hash(QString("key")))
- self.assertEqual(hash(u"aéióu"), hash(QString(u"aéióu")))
if __name__ == '__main__':
unittest.main()
diff --git a/tests/QtCore/qstringlist_test.py b/tests/QtCore/qstringlist_test.py
deleted file mode 100644
index 0310516..0000000
--- a/tests/QtCore/qstringlist_test.py
+++ /dev/null
@@ -1,171 +0,0 @@
-
-# -*- coding: utf-8 -*-
-
-'''Test cases for QStringList'''
-
-import unittest
-from random import shuffle
-
-from PySide.QtCore import QStringList, QString
-
-from helper import random_string
-
-class UsesManyStrings(unittest.TestCase):
- '''Helper class to setup a list of strings and QStrings'''
- def setUp(self):
- #Creates a list of strings and python strings
- self.size = 10
- # List of Python strings
- self.samples = [random_string() for x in range(self.size)]
- # List of QStrings
- self.strings = map(QString, self.samples)
-
- self.obj = QStringList(self.strings)
-
-
-class TestConstructorBasic(unittest.TestCase):
- '''Basic constructor test'''
-
- def testEmpty(self):
- #QStringList() - default constructor
- obj = QStringList()
- self.assert_(isinstance(obj, QStringList))
-
- def testQString(self):
- #QStringList(QString)
- qstr = QString('aaaa')
- obj = QStringList(qstr)
- self.assert_(isinstance(obj, QStringList))
-
- def testPyString(self):
- #QStringList(python_string) constructor
- string = 'forty two'
- obj = QStringList(string)
- self.assert_(isinstance(obj, QStringList))
-
- def testPyStringUnicode(self):
- #QStringList(unicode python_string) constructor
- string = 'Nação Zumbi'
- obj = QStringList(string)
- self.assert_(isinstance(obj, QStringList))
-
-
-class TestConstructorList(UsesManyStrings):
- '''Test case for QStringList(List) constructor'''
-
- def testListQString(self):
- #QStringList([QString]) constructor
- obj = QStringList(self.strings)
- self.assert_(isinstance(obj, QStringList))
-
- def testListPyString(self):
- #QStringList([python_string]) constructor
- obj = QStringList(self.samples)
- self.assert_(isinstance(obj, QStringList))
-
- def testListMixed(self):
- #QStringList([python_string and QString]) mixed constructor
- mixed = self.samples + self.strings
- shuffle(mixed)
- obj = QStringList(mixed)
- self.assert_(isinstance(obj, QStringList))
-
- def testCopyList(self):
- #QStringList(QStringList(list)) - copy constructor
- obj = QStringList(self.strings)
- obj2 = QStringList(obj)
- self.assert_(isinstance(obj2, QStringList))
- self.assertEqual(obj, obj2)
-
-
-class TestComparison(unittest.TestCase):
- '''Test case for comparison of QStringLists'''
-
- def testEqual(self):
- #QStringList == QStringList
- string = QString('aaaabvbbcccedde')
- obj1 = QStringList(string)
- obj2 = QStringList(string)
- self.assertEqual(obj1, obj2)
-
-
-class TestIndexing(unittest.TestCase):
- '''Test case for indexing through []'''
- def testInvalidIndexEmpty(self):
- #QStringList[x] for empty list
- obj = QStringList()
- self.assertRaises(IndexError, lambda:obj[0])
-
- def testInvalidIndexQString(self):
- #QStringList[1] raising IndexError for QStringList(QString)
- obj = QStringList(QString('aaaaa'))
- self.assertRaises(IndexError, lambda:obj[1])
-
- def testValidIndexQString(self):
- #QStringList[0] not raising IndexError for QStringList(QString)
- string = QString('abcdefg')
- obj = QStringList(string)
- self.assertEqual(obj[0], string)
-
- def testNegativeIndexing(self):
- #QStringList[-1] not raising IndexError for QStringList(QString)
- string = QString('abcdefg')
- obj = QStringList(string)
- self.assertEqual(obj[-1], string)
-
-
-class TestListIndexing(UsesManyStrings):
- '''Test case for indexing QStringList longer than 1 string'''
-
- def testValid(self):
- #QStringList[] for valid indexes
- for i in range(self.size):
- self.assertEqual(self.strings[i], self.obj[i])
-
- def testNegativeValid(self):
- #QStringList[] for valid indexes
- for i in range(-1, -self.size, -1):
- self.assertEqual(self.strings[i], self.obj[i])
-
- def testInvalid(self):
- #QStringList[] for invalid negative indexes
- self.assertRaises(IndexError, lambda : self.obj[self.size])
- self.assertRaises(IndexError, lambda : self.obj[-(self.size+1)])
-
-
-class TestSlicing(UsesManyStrings):
- '''Test case for slicing a QStringList'''
-
- def testSlicing(self):
- #QStringList slicing
- for i in range(self.size):
- self.assertEqual(self.obj[i:], self.strings[i:])
- self.assertEqual(self.obj[:i], self.strings[:i])
- for j in range(i):
- self.assertEqual(self.obj[j:i], self.strings[j:i])
-
- for i in range(-1, -self.size, -1):
- self.assertEqual(self.obj[:i], self.strings[:i])
-
-
-class TestShiftOperator(UsesManyStrings):
- '''Test case for QStringList lshift operator'''
-
- def testShiftOperator(self):
- #QStringList lshift
- a = QStringList()
- a << "a" << "b" << "c";
- self.assertEquals(3, a.count())
- b = ["1", "2", "3"]
- c = ["4", "5", "6"]
- a << b << c
- self.assertEquals(9, a.count())
-
- def testShiftOperator(self):
- #QStringList lshift
- a = QStringList()
- b = ["1", 2, "3"]
- self.assertRaises(TypeError, a.__lshift__, b)
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/tests/QtCore/qtextstream_test.py b/tests/QtCore/qtextstream_test.py
index 13dc651..a8f561c 100644
--- a/tests/QtCore/qtextstream_test.py
+++ b/tests/QtCore/qtextstream_test.py
@@ -3,8 +3,7 @@
import unittest
-from PySide.QtCore import QTextStream, QIODevice, QString, QByteArray
-from PySide.QtCore import QTextCodec, QFile
+from PySide.QtCore import *
class QTextStreamShiftTest(unittest.TestCase):
@@ -16,18 +15,11 @@ class QTextStreamShiftTest(unittest.TestCase):
def testNumber(self):
'''QTextStream << number'''
- self.write << QString('4')
+ self.write << '4'
self.write.flush()
res = self.read.readLine()
- self.assert_(isinstance(res, QString))
- self.assertEqual(res, QString('4'))
-
- def testString(self):
- self.write << QString('Test_it!')
- self.write.flush()
- res = QString()
- self.read >> res
- self.assertEqual(res, QString('Test_it!'))
+ self.assert_(isinstance(res, unicode))
+ self.assertEqual(res, '4')
class QTextStreamGetSet(unittest.TestCase):
diff --git a/tests/QtCore/qvariant_pyobject_test.py b/tests/QtCore/qvariant_pyobject_test.py
index 82da555..2000a01 100644
--- a/tests/QtCore/qvariant_pyobject_test.py
+++ b/tests/QtCore/qvariant_pyobject_test.py
@@ -3,19 +3,17 @@
import unittest
-from PySide.QtCore import QSize, QVariant, QString
+from PySide.QtCore import *
class Dummy(object):
'''Pure python sample class'''
pass
-
class MySize(QSize):
'''Extended class'''
pass
-
class QVariantPurePython(unittest.TestCase):
'''QVariant + pure python classes'''
@@ -26,7 +24,6 @@ class QVariantPurePython(unittest.TestCase):
# inherited type name from other binding
self.assertEqual('PyQt_PyObject', obj.typeName())
-
class QVariantInheritedPython(unittest.TestCase):
'''QVariant + classes inherited from C++'''
@@ -63,7 +60,7 @@ class QVariantToPyObject(unittest.TestCase):
'''QVariant(python string).toPyObject() return an equal QString'''
d = 'abc'
obj = QVariant('abc')
- self.assert_(isinstance(obj.toPyObject(), QString))
+ self.assert_(isinstance(obj.toPyObject(), unicode))
self.assertEqual(d, obj.toPyObject())
diff --git a/tests/QtCore/qvariant_test.py b/tests/QtCore/qvariant_test.py
index 5c23b40..6be7b81 100644
--- a/tests/QtCore/qvariant_test.py
+++ b/tests/QtCore/qvariant_test.py
@@ -5,7 +5,7 @@
import unittest
import sys
-from PySide.QtCore import QSize, QVariant, QByteArray, QStringList, QString
+from PySide.QtCore import *
class QVariantToNumber(unittest.TestCase):
@@ -50,11 +50,6 @@ class QVariantToNumber(unittest.TestCase):
class QVariantTypeName(unittest.TestCase):
'''QVariant.typeName()'''
- def testTypeNameQString(self):
- '''QVariant(QString).typeName()'''
- obj = QVariant(QString('aaaa'))
- self.assertEqual('QString', obj.typeName())
-
def testTypeNameString(self):
'''QVariant(PyString).typeName()'''
obj = QVariant('aaaa')
@@ -96,18 +91,6 @@ class QVariantTypeName(unittest.TestCase):
obj = QVariant(['aaa', 'bbb', 'ccc', 'dddd'])
self.assertEqual('QVariantList', obj.typeName())
- obj = QVariant([QString('aaa'), QString('bbb'),
- QString('ccc'), QString('dddd')])
- self.assertEqual('QVariantList', obj.typeName())
-
- def testTypeNameQStringList(self):
- '''QVariant(QStringList).typeName()'''
- obj = QVariant(QStringList())
- self.assertEqual('QStringList', obj.typeName())
- obj = QVariant(QStringList(['aaa', 'bbb', 'ccc']))
- self.assertEqual('QStringList', obj.typeName())
-
-
class QVariantConstructor(unittest.TestCase):
'''More qvariant constructions'''
diff --git a/tests/QtCore/translation_test.py b/tests/QtCore/translation_test.py
index 870c8c5..6b75bee 100644
--- a/tests/QtCore/translation_test.py
+++ b/tests/QtCore/translation_test.py
@@ -5,7 +5,7 @@
import os
import unittest
-from PySide.QtCore import QObject, QTranslator, QCoreApplication, QString
+from PySide.QtCore import *
from helper import UsesQCoreApplication
@@ -54,7 +54,7 @@ class TranslationTest(UsesQCoreApplication):
def testTranslateWithNoneDisambiguation(self):
value = 'String here'
obj = QCoreApplication.translate('context', value, None, QCoreApplication.UnicodeUTF8)
- self.assert_(isinstance(obj, QString))
+ self.assert_(isinstance(obj, unicode))
self.assertEqual(obj, value)
if __name__ == '__main__':
diff --git a/tests/QtGui/qinputdialog_get_test.py b/tests/QtGui/qinputdialog_get_test.py
index c75f712..ce3a60d 100644
--- a/tests/QtGui/qinputdialog_get_test.py
+++ b/tests/QtGui/qinputdialog_get_test.py
@@ -15,7 +15,7 @@ class TestInputDialog(TimedQApplication):
self.assertEquals(QtGui.QInputDialog.getInteger(None, "title", "label"), (0, False))
def testGetItem(self):
- (item, bool) = QtGui.QInputDialog.getItem(None, "title", "label", QtCore.QStringList(["1", "2", "3"]))
+ (item, bool) = QtGui.QInputDialog.getItem(None, "title", "label", ["1", "2", "3"])
self.assertEquals(str(item), "1")
def testGetText(self):
diff --git a/tests/QtGui/qpixmap_test.py b/tests/QtGui/qpixmap_test.py
index 4814094..7ba7454 100644
--- a/tests/QtGui/qpixmap_test.py
+++ b/tests/QtGui/qpixmap_test.py
@@ -16,7 +16,7 @@ class QPixmapTest(UsesQApplication):
self.assert_(pixmap.size().height(), 20)
def testQStringConstructor(self):
- pixmap = QPixmap(QString("Testing!"))
+ pixmap = QPixmap("Testing!")
def testQVariantConstructor2(self):
v = QVariant(QPixmap())
diff --git a/tests/QtGui/qstring_qkeysequence_test.py b/tests/QtGui/qstring_qkeysequence_test.py
index 1f435e6..15db935 100644
--- a/tests/QtGui/qstring_qkeysequence_test.py
+++ b/tests/QtGui/qstring_qkeysequence_test.py
@@ -5,7 +5,7 @@
import unittest
from helper import UsesQApplication
-from PySide.QtCore import QString
+from PySide.QtCore import *
from PySide.QtGui import QKeySequence, QAction
class QStringQKeySequenceTest(UsesQApplication):
@@ -14,21 +14,12 @@ class QStringQKeySequenceTest(UsesQApplication):
def testQStringFromQKeySequence(self):
'''Creates a QString from a QKeySequence.'''
keyseq = 'Ctrl+A'
- a = QString(QKeySequence(keyseq))
+ a = QKeySequence(keyseq)
self.assertEqual(a, keyseq)
- def testQStringAsQKeySequence(self):
- '''Passes a QString to an argument expecting a QKeySequence.'''
- keyseq = QString('Ctrl+A')
- action = QAction(None)
- action.setShortcut(keyseq)
- shortcut = action.shortcut()
- self.assert_(isinstance(shortcut, QKeySequence))
- self.assertEqual(shortcut.toString(), keyseq)
-
def testPythonStringAsQKeySequence(self):
'''Passes a Python string to an argument expecting a QKeySequence.'''
- keyseq = 'Ctrl+A'
+ keyseq = u'Ctrl+A'
action = QAction(None)
action.setShortcut(keyseq)
shortcut = action.shortcut()
diff --git a/tests/QtSql/qsqldatabaseandqueries_test.py b/tests/QtSql/qsqldatabaseandqueries_test.py
index 49f2209..2d5a0a3 100755
--- a/tests/QtSql/qsqldatabaseandqueries_test.py
+++ b/tests/QtSql/qsqldatabaseandqueries_test.py
@@ -5,14 +5,14 @@ import sys
import unittest
from PySide import QtSql
-from PySide.QtCore import QVariant, QString
+from PySide.QtCore import *
class SqlDatabaseCreationDestructionAndQueries(unittest.TestCase):
'''Test cases for QtSql database creation, destruction and queries'''
def setUp(self):
#Acquire resources
- self.assertFalse(QtSql.QSqlDatabase.drivers().isEmpty(), "installed Qt has no DB drivers")
+ self.assertFalse(not QtSql.QSqlDatabase.drivers(), "installed Qt has no DB drivers")
self.assertTrue("QSQLITE" in QtSql.QSqlDatabase.drivers(), "\"QSQLITE\" driver not available in this Qt version")
self.db = QtSql.QSqlDatabase.addDatabase("QSQLITE")
self.db.setDatabaseName(":memory:")
diff --git a/tests/phonon/capabilities_test.py b/tests/phonon/capabilities_test.py
index 5f4b7da..99c6473 100644
--- a/tests/phonon/capabilities_test.py
+++ b/tests/phonon/capabilities_test.py
@@ -1,7 +1,7 @@
import unittest
-from PySide.QtCore import QString
+from PySide.QtCore import *
from PySide import phonon
from helper import UsesQCoreApplication
@@ -36,7 +36,7 @@ class CapabilitiesTest(UsesQCoreApplication):
# TODO Improve this test
mimeTypes = phonon.Phonon.BackendCapabilities.availableMimeTypes()
for mime in mimeTypes:
- self.assert_(isinstance(mime, QString))
+ self.assert_(isinstance(mime, unicode))
def testAudioEffects(self):
# TODO Improve this test
diff --git a/tests/signals/decorators_test.py b/tests/signals/decorators_test.py
index db068d0..db32ec9 100755
--- a/tests/signals/decorators_test.py
+++ b/tests/signals/decorators_test.py
@@ -24,7 +24,7 @@ class MyObject(QObject):
def foo(self):
self._slotCalledCount = self._slotCalledCount + 1
- @Slot(QString, int)
+ @Slot(unicode, int)
def mySlot4(self, a, b):
self._slotCalledCount = self._slotCalledCount + 1
@@ -41,7 +41,7 @@ class StaticMetaObjectTest(unittest.TestCase):
self.assert_(m.indexOfSlot('mySlot2(int)') > 0)
self.assert_(m.indexOfSlot('mySlot2(QString)') > 0)
self.assert_(m.indexOfSlot('mySlot3()') > 0)
- self.assert_(m.indexOfSlot('mySlot4(QString,int)') > 0)
+ self.assert_(m.indexOfSlot('mySlot4(unicode,int)') > 0)
def testEmission(self):
o = MyObject()
diff --git a/tests/signals/signal_object_test.py b/tests/signals/signal_object_test.py
index 614c0e6..d36665c 100755
--- a/tests/signals/signal_object_test.py
+++ b/tests/signals/signal_object_test.py
@@ -11,8 +11,8 @@ class MyObject(QTimer):
sig1 = Signal()
sig2 = Signal(int, name='rangeChanged')
sig3 = Signal(int)
- sig4 = Signal((int,), (QString,))
- sig5 = Signal((QString,), (int,))
+ sig4 = Signal((int,), (unicode,))
+ sig5 = Signal((unicode,), (int,))
@Slot(int)
@@ -50,8 +50,8 @@ class SignalObjectTest(UsesQCoreApplication):
def testDictOperator(self):
o = MyObject()
- o.sig4[QString].connect(o.slotString)
- o.sig4[QString].emit("PySide")
+ o.sig4[unicode].connect(o.slotString)
+ o.sig4[unicode].emit("PySide")
self.assertEqual(o._s, "PySide")
def testGeneretedSignal(self):
From ccd189d30c284e9a67a802193ef05c4149108f9a Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Tue, 8 Jun 2010 09:57:21 -0300
Subject: [PATCH 0013/1129] Add checkType method to PySide custom converters.
---
PySide/QtCore/qchar_conversions.h | 9 +++++++--
PySide/QtCore/qstring_conversions.h | 8 ++++++--
PySide/QtCore/qstringref_conversions.h | 3 +--
PySide/QtCore/qvariant_conversions.h | 5 +++++
PySide/QtGui/qpixmap_conversion.h | 23 ++++++++++++++---------
libpyside/pysideconversions.h | 16 ++++++++++++++++
6 files changed, 49 insertions(+), 15 deletions(-)
diff --git a/PySide/QtCore/qchar_conversions.h b/PySide/QtCore/qchar_conversions.h
index ab477ef..1ebcb64 100644
--- a/PySide/QtCore/qchar_conversions.h
+++ b/PySide/QtCore/qchar_conversions.h
@@ -1,12 +1,17 @@
namespace Shiboken {
template<>
-class Converter
+struct Converter
{
-public:
+ static bool checkType(PyObject* pyObj)
+ {
+ return PyString_Check(pyObj) && (PyString_Size(pyObj) == 1);
+ }
+
static bool isConvertible(PyObject* pyObj)
{
return (PyString_Check(pyObj) && (PyString_Size(pyObj) == 1))
+ || pyObj == Py_None
|| PyInt_Check(pyObj);
}
diff --git a/PySide/QtCore/qstring_conversions.h b/PySide/QtCore/qstring_conversions.h
index 392f0e7..04b46f4 100644
--- a/PySide/QtCore/qstring_conversions.h
+++ b/PySide/QtCore/qstring_conversions.h
@@ -1,9 +1,13 @@
namespace Shiboken {
template<>
-class Converter
+struct Converter
{
-public:
+ static bool checkType(PyObject* pyObj)
+ {
+ return PyString_Check(pyObj) || PyUnicode_Check(pyObj);
+ }
+
static bool isConvertible(PyObject* pyObj)
{
return PyString_Check(pyObj)
diff --git a/PySide/QtCore/qstringref_conversions.h b/PySide/QtCore/qstringref_conversions.h
index 11e1b9c..db3eefc 100644
--- a/PySide/QtCore/qstringref_conversions.h
+++ b/PySide/QtCore/qstringref_conversions.h
@@ -7,8 +7,7 @@ struct Converter : public Converter
static PyObject* toPython(const QStringRef& cppObj)
{
- const QString* str = cppObj.string();
- return Converter::toPython(*str);
+ return Converter::toPython(cppObj.toString());
}
static QStringRef toCpp(PyObject* pyObj)
diff --git a/PySide/QtCore/qvariant_conversions.h b/PySide/QtCore/qvariant_conversions.h
index f0f78a0..aa6d521 100644
--- a/PySide/QtCore/qvariant_conversions.h
+++ b/PySide/QtCore/qvariant_conversions.h
@@ -12,6 +12,11 @@ Q_DECLARE_METATYPE(PyQt_PyObject)
namespace Shiboken {
+inline bool Converter::checkType(PyObject* pyObj)
+{
+ return ValueTypeConverter::checkType(pyObj);
+}
+
// all types are convertible to QVariant
inline bool Converter::isConvertible(PyObject* pyObj)
{
diff --git a/PySide/QtGui/qpixmap_conversion.h b/PySide/QtGui/qpixmap_conversion.h
index 10b4803..1423959 100644
--- a/PySide/QtGui/qpixmap_conversion.h
+++ b/PySide/QtGui/qpixmap_conversion.h
@@ -1,14 +1,19 @@
namespace Shiboken {
-inline bool Converter< QPixmap >::isConvertible(PyObject* pyobj)
+inline bool Converter::checkType(PyObject* pyObj)
+{
+ return ValueTypeConverter::checkType(pyObj);
+}
+
+inline bool Converter::isConvertible(PyObject* pyobj)
{
if (ValueTypeConverter::isConvertible(pyobj))
return true;
SbkBaseWrapperType* shiboType = reinterpret_cast(SbkType());
- bool isVariant = SbkQVariant_Check(pyobj);
+ bool isVariant = Converter::checkType(pyobj);
if (isVariant) {
QVariant var(Converter::toCpp(pyobj));
return var.type() == QVariant::Pixmap;
- } else if (SbkQSize_Check(pyobj) || SbkQString_Check(pyobj)) {
+ } else if (Converter::checkType(pyobj) || Converter::checkType(pyobj)) {
return true;
} else if (shiboType->ext_isconvertible) {
return shiboType->ext_isconvertible(pyobj);
@@ -17,17 +22,17 @@ inline bool Converter< QPixmap >::isConvertible(PyObject* pyobj)
}
-inline QPixmap Converter< QPixmap >::toCpp(PyObject* pyobj)
+inline QPixmap Converter::toCpp(PyObject* pyobj)
{
SbkBaseWrapperType* shiboType = reinterpret_cast(SbkType());
- bool isVariant = SbkQVariant_Check(pyobj);
+ bool isVariant = Converter::checkType(pyobj);
if (isVariant) {
QVariant var(Converter::toCpp(pyobj));
return var.value();
- } else if (SbkQSize_Check(pyobj)) {
- return QPixmap(Shiboken::Converter::toCpp(pyobj));
- } else if (SbkQString_Check(pyobj)) {
- return QPixmap(Shiboken::Converter::toCpp(pyobj));
+ } else if (Converter::checkType(pyobj)) {
+ return QPixmap(Shiboken::Converter::toCpp(pyobj));
+ } else if (Converter::checkType(pyobj)) {
+ return QPixmap(Shiboken::Converter::toCpp(pyobj));
} else if (shiboType->ext_isconvertible && shiboType->ext_tocpp && shiboType->ext_isconvertible(pyobj)) {
QPixmap* cptr = reinterpret_cast(shiboType->ext_tocpp(pyobj));
std::auto_ptr cptr_auto_ptr(cptr);
diff --git a/libpyside/pysideconversions.h b/libpyside/pysideconversions.h
index 9539b11..86f5003 100644
--- a/libpyside/pysideconversions.h
+++ b/libpyside/pysideconversions.h
@@ -41,6 +41,11 @@
template
struct QtDictConverter
{
+ static inline bool checkType(PyObject* pyObj)
+ {
+ return isConvertible(pyObj);
+ }
+
static inline bool isConvertible(PyObject* pyObj)
{
if (PyObject_TypeCheck(pyObj, Shiboken::SbkType()))
@@ -95,6 +100,11 @@ struct QtDictConverter
template
struct QtMultiMapConverter
{
+ static inline bool checkType(PyObject* pyObj)
+ {
+ return isConvertible(pyObj);
+ }
+
static inline bool isConvertible(PyObject* pyObj)
{
if (PyObject_TypeCheck(pyObj, Shiboken::SbkType()))
@@ -145,6 +155,7 @@ struct QtMultiMapConverter
return result;
}
+
static inline MultiMap toCpp(PyObject* pyObj)
{
if (PyObject_TypeCheck(pyObj, Shiboken::SbkType()))
@@ -165,6 +176,11 @@ struct QtMultiMapConverter
template
struct QSequenceConverter
{
+ static inline bool checkType(PyObject* pyObj)
+ {
+ return isConvertible(pyObj);
+ }
+
static inline bool isConvertible(PyObject* pyObj)
{
if (PyObject_TypeCheck(pyObj, Shiboken::SbkType()))
From 00918cb847dfa1b28acb791c66cb444bc2123f79 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Tue, 8 Jun 2010 09:59:01 -0300
Subject: [PATCH 0014/1129] Added QDataStream methods to read and write
QString, QChar and QStringList.
---
PySide/QtCore/typesystem_core.xml | 52 ++++++++++++++++++++++++++++++-
tests/QtCore/qdatastream_test.py | 46 +++++++++------------------
2 files changed, 66 insertions(+), 32 deletions(-)
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 56c8b30..6258861 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -2050,6 +2050,7 @@
+
@@ -2062,8 +2063,57 @@
-
+
+
+
+ *(%CPPSELF) << %1;
+
+
+
+
+ %RETURN_TYPE val;
+ *(%CPPSELF) >> val;
+ %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](val);
+
+
+
+
+ *(%CPPSELF) << %1;
+
+
+
+
+ %RETURN_TYPE val;
+ *(%CPPSELF) >> val;
+ %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](val);
+
+
+
+
+ *(%CPPSELF) << %1;
+
+
+
+
+ %RETURN_TYPE val;
+ *(%CPPSELF) >> val;
+ %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](val);
+
+
+
+
+ *(%CPPSELF) << %1;
+
+
+
+
+ %RETURN_TYPE val;
+ *(%CPPSELF) >> val;
+ %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](val);
+
+
+
diff --git a/tests/QtCore/qdatastream_test.py b/tests/QtCore/qdatastream_test.py
index e809185..b634a7e 100644
--- a/tests/QtCore/qdatastream_test.py
+++ b/tests/QtCore/qdatastream_test.py
@@ -76,22 +76,17 @@ class QDataStreamShift(unittest.TestCase):
def testQCharValid(self):
'''QDataStream <<>> QChar - valid'''
- self.stream << QChar(42)
+ self.stream.writeQChar(42)
- res = QChar()
-
- self.read_stream >> res
- self.assertEqual(res, QChar(42))
+ res = self.read_stream.readQChar()
+ self.assertEqual(res, unichr(42))
def testQCharNull(self):
'''QDataStream <<>> QChar - null'''
- self.stream << QChar()
+ self.stream.writeQChar(None)
- res = QChar()
-
- self.read_stream >> res
- self.assertEqual(res, QChar())
- self.assert_(res.isNull())
+ res = self.read_stream.readQChar()
+ self.assertEqual(res, u'\x00')
def testQByteArrayValid(self):
'''QDataStream <<>> QByteArray - valid'''
@@ -126,35 +121,24 @@ class QDataStreamShift(unittest.TestCase):
def testQStringValid(self):
'''QDataStream <<>> QString - valid'''
- self.stream << QString('Ka-boom')
+ self.stream.writeQString('Ka-boom')
- res = QString()
-
- self.read_stream >> res
- self.assertEqual(res, QString('Ka-boom'))
+ res = self.read_stream.readQString()
+ self.assertEqual(res, u'Ka-boom')
def testQStringEmpty(self):
'''QDataStream <<>> QString - empty'''
- self.stream << QString('')
+ self.stream.writeQString('')
- res = QString()
-
- self.read_stream >> res
- self.assertEqual(res, QString(""))
- self.assert_(res.isEmpty())
- self.assert_(not res.isNull())
+ res = self.read_stream.readQString()
+ self.assertEqual(res, u'')
def testQStringNull(self):
'''QDataStream <<>> QString - null'''
- self.stream << QString()
-
- res = QString()
-
- self.read_stream >> res
- self.assertEqual(res, QString())
- self.assert_(res.isEmpty())
- self.assert_(res.isNull())
+ self.stream.writeQString(None)
+ res = self.read_stream.readQString()
+ self.assertEqual(res, u'')
def testQBitArrayNull(self):
'''QDataStream <<>> QBitArray - null'''
From e47b49f86d63845fe214768838c4fc7c55e3012a Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Tue, 8 Jun 2010 11:17:48 -0300
Subject: [PATCH 0015/1129] Re-add the possibility to run tests by module.
---
tests/CMakeLists.txt | 5 +++--
tests/QtCore/CMakeLists.txt | 3 +--
tests/QtCore/{thread_signals.py => thread_signals_test.py} | 0
tests/QtGui/CMakeLists.txt | 4 ++--
...irtual_pure_override.py => virtual_pure_override_test.py} | 0
tests/QtGui/{x11_symbols.py => x11_symbols_test.py} | 0
tests/QtScript/CMakeLists.txt | 1 -
tests/QtScript/test_base.py | 4 ----
tests/signals/CMakeLists.txt | 2 +-
...type_support.py => signal_connectiontype_support_test.py} | 0
10 files changed, 7 insertions(+), 12 deletions(-)
rename tests/QtCore/{thread_signals.py => thread_signals_test.py} (100%)
rename tests/QtGui/{virtual_pure_override.py => virtual_pure_override_test.py} (100%)
rename tests/QtGui/{x11_symbols.py => x11_symbols_test.py} (100%)
delete mode 100644 tests/QtScript/test_base.py
rename tests/signals/{signal_connectiontype_support.py => signal_connectiontype_support_test.py} (100%)
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index d87414f..d446151 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -7,7 +7,8 @@ macro(TEST_QT_MODULE var name)
endmacro(TEST_QT_MODULE)
macro(PYSIDE_TEST)
- set(TEST_NAME ${ARGV0})
+ string(REGEX MATCH "/([^/]+)//?([^/]+)\\.py" foo "${CMAKE_CURRENT_SOURCE_DIR}/${ARGV0}" )
+ set(TEST_NAME "${CMAKE_MATCH_1}_${CMAKE_MATCH_2}")
if (${ARGC} EQUAL 1)
set(EXPECT_TO_FAIL 0)
elseif(${ARGC} EQUAL 2)
@@ -15,7 +16,7 @@ macro(PYSIDE_TEST)
else()
message(WARNING "Ivalid call of macro PYSIDE_TEST")
endif()
- set(TEST_CMD ${CMAKE_SOURCE_DIR}/tests/run_test.sh ${CMAKE_BINARY_DIR} "${CMAKE_BINARY_DIR}:${CMAKE_SOURCE_DIR}/tests/util" ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/${TEST_NAME}")
+ set(TEST_CMD ${CMAKE_SOURCE_DIR}/tests/run_test.sh ${CMAKE_BINARY_DIR} "${CMAKE_BINARY_DIR}:${CMAKE_SOURCE_DIR}/tests/util" ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/${ARGV0}")
add_test(${TEST_NAME} ${TEST_CMD})
set_tests_properties(${TEST_NAME} PROPERTIES
TIMEOUT ${PYSIDE_TIMEOUT}
diff --git a/tests/QtCore/CMakeLists.txt b/tests/QtCore/CMakeLists.txt
index 4a78bf6..cce1332 100644
--- a/tests/QtCore/CMakeLists.txt
+++ b/tests/QtCore/CMakeLists.txt
@@ -57,10 +57,9 @@ PYSIDE_TEST(qtnamespace_test.py)
PYSIDE_TEST(qurl_test.py)
PYSIDE_TEST(qvariant_pyobject_test.py)
PYSIDE_TEST(qvariant_test.py)
-PYSIDE_TEST(resources_mc.py)
PYSIDE_TEST(static_method_test.py)
PYSIDE_TEST(static_protected_methods_test.py)
-PYSIDE_TEST(thread_signals.py)
+PYSIDE_TEST(thread_signals_test.py)
PYSIDE_TEST(translation_test.py)
PYSIDE_TEST(unaryoperator_test.py)
PYSIDE_TEST(unicode_test.py)
diff --git a/tests/QtCore/thread_signals.py b/tests/QtCore/thread_signals_test.py
similarity index 100%
rename from tests/QtCore/thread_signals.py
rename to tests/QtCore/thread_signals_test.py
diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt
index fb6d801..fa5de4a 100644
--- a/tests/QtGui/CMakeLists.txt
+++ b/tests/QtGui/CMakeLists.txt
@@ -53,6 +53,6 @@ PYSIDE_TEST(reference_count_test.py)
PYSIDE_TEST(standardpixmap_test.py)
PYSIDE_TEST(timed_app_test.py)
PYSIDE_TEST(virtual_protected_inheritance_test.py)
-PYSIDE_TEST(virtual_pure_override.py)
+PYSIDE_TEST(virtual_pure_override_test.py)
PYSIDE_TEST(wrong_return_test.py)
-PYSIDE_TEST(x11_symbols.py)
+PYSIDE_TEST(x11_symbols_test.py)
diff --git a/tests/QtGui/virtual_pure_override.py b/tests/QtGui/virtual_pure_override_test.py
similarity index 100%
rename from tests/QtGui/virtual_pure_override.py
rename to tests/QtGui/virtual_pure_override_test.py
diff --git a/tests/QtGui/x11_symbols.py b/tests/QtGui/x11_symbols_test.py
similarity index 100%
rename from tests/QtGui/x11_symbols.py
rename to tests/QtGui/x11_symbols_test.py
diff --git a/tests/QtScript/CMakeLists.txt b/tests/QtScript/CMakeLists.txt
index b76a262..e496591 100644
--- a/tests/QtScript/CMakeLists.txt
+++ b/tests/QtScript/CMakeLists.txt
@@ -1,3 +1,2 @@
PYSIDE_TEST(base_test.py)
PYSIDE_TEST(engine_test.py)
-PYSIDE_TEST(test_base.py)
diff --git a/tests/QtScript/test_base.py b/tests/QtScript/test_base.py
deleted file mode 100644
index 6ad27e0..0000000
--- a/tests/QtScript/test_base.py
+++ /dev/null
@@ -1,4 +0,0 @@
-from PySide import QtScript
-
-
-#only test if the module import works fine bug #278
diff --git a/tests/signals/CMakeLists.txt b/tests/signals/CMakeLists.txt
index 3e59684..a6d564f 100644
--- a/tests/signals/CMakeLists.txt
+++ b/tests/signals/CMakeLists.txt
@@ -20,7 +20,7 @@ PYSIDE_TEST(self_connect_test.py)
PYSIDE_TEST(short_circuit_test.py)
PYSIDE_TEST(signal2signal_connect_test.py)
PYSIDE_TEST(signal_autoconnect_test.py)
-PYSIDE_TEST(signal_connectiontype_support.py)
+PYSIDE_TEST(signal_connectiontype_support_test.py)
PYSIDE_TEST(signal_emission_gui_test.py)
PYSIDE_TEST(signal_emission_test.py)
PYSIDE_TEST(signal_func_test.py)
diff --git a/tests/signals/signal_connectiontype_support.py b/tests/signals/signal_connectiontype_support_test.py
similarity index 100%
rename from tests/signals/signal_connectiontype_support.py
rename to tests/signals/signal_connectiontype_support_test.py
From f1327b5a5fe52ac41a96096f214c93c6a082195d Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Tue, 8 Jun 2010 11:23:56 -0300
Subject: [PATCH 0016/1129] chmod -x on some tests, because we need to follow a
pattern.
---
tests/QtCore/qbitarray_test.py | 0
tests/QtCore/qbytearray_buffer_protocol_test.py | 0
tests/QtCore/qbytearray_concatenation_operator_test.py | 0
tests/QtCore/qcoreapplication_instance_test.py | 0
tests/QtCore/qthread_signal_test.py | 0
tests/QtCore/static_method_test.py | 0
tests/QtCore/unaryoperator_test.py | 0
tests/QtGui/customproxywidget_test.py | 0
tests/QtGui/keep_reference_test.py | 0
tests/QtGui/qgraphicsitem_isblocked_test.py | 0
tests/QtGui/qgraphicsproxywidget_test.py | 0
tests/QtGui/qstyle_test.py | 0
tests/QtSql/qsqldatabaseandqueries_test.py | 0
tests/phonon/basic_playing_test.py | 0
tests/signals/args_dont_match_test.py | 0
tests/signals/decorators_test.py | 0
tests/signals/invalid_callback_test.py | 0
tests/signals/lambda_gui_test.py | 0
tests/signals/lambda_test.py | 0
tests/signals/multiple_connections_gui_test.py | 0
tests/signals/multiple_connections_test.py | 0
tests/signals/pysignal_test.py | 0
tests/signals/qobject_destroyed_test.py | 0
tests/signals/qobject_receivers_test.py | 0
tests/signals/qobject_sender_test.py | 0
tests/signals/ref01_test.py | 0
tests/signals/ref02_test.py | 0
tests/signals/ref03_test.py | 0
tests/signals/ref04_test.py | 0
tests/signals/ref05_test.py | 0
tests/signals/ref06_test.py | 0
tests/signals/segfault_proxyparent_test.py | 0
tests/signals/self_connect_test.py | 0
tests/signals/short_circuit_test.py | 0
tests/signals/signal2signal_connect_test.py | 0
tests/signals/signal_autoconnect_test.py | 0
tests/signals/signal_connectiontype_support_test.py | 0
tests/signals/signal_emission_gui_test.py | 0
tests/signals/signal_emission_test.py | 0
tests/signals/signal_func_test.py | 0
tests/signals/signal_manager_refcount_test.py | 0
tests/signals/signal_object_test.py | 0
tests/signals/signal_with_primitive_type_test.py | 0
tests/signals/slot_reference_count_test.py | 0
tests/signals/static_metaobject_test.py | 0
tests/signals/upstream_segfault_test.py | 0
tests/util/processtimer.py | 0
tests/util/pyqtcheck.py | 0
48 files changed, 0 insertions(+), 0 deletions(-)
mode change 100755 => 100644 tests/QtCore/qbitarray_test.py
mode change 100755 => 100644 tests/QtCore/qbytearray_buffer_protocol_test.py
mode change 100755 => 100644 tests/QtCore/qbytearray_concatenation_operator_test.py
mode change 100755 => 100644 tests/QtCore/qcoreapplication_instance_test.py
mode change 100755 => 100644 tests/QtCore/qthread_signal_test.py
mode change 100755 => 100644 tests/QtCore/static_method_test.py
mode change 100755 => 100644 tests/QtCore/unaryoperator_test.py
mode change 100755 => 100644 tests/QtGui/customproxywidget_test.py
mode change 100755 => 100644 tests/QtGui/keep_reference_test.py
mode change 100755 => 100644 tests/QtGui/qgraphicsitem_isblocked_test.py
mode change 100755 => 100644 tests/QtGui/qgraphicsproxywidget_test.py
mode change 100755 => 100644 tests/QtGui/qstyle_test.py
mode change 100755 => 100644 tests/QtSql/qsqldatabaseandqueries_test.py
mode change 100755 => 100644 tests/phonon/basic_playing_test.py
mode change 100755 => 100644 tests/signals/args_dont_match_test.py
mode change 100755 => 100644 tests/signals/decorators_test.py
mode change 100755 => 100644 tests/signals/invalid_callback_test.py
mode change 100755 => 100644 tests/signals/lambda_gui_test.py
mode change 100755 => 100644 tests/signals/lambda_test.py
mode change 100755 => 100644 tests/signals/multiple_connections_gui_test.py
mode change 100755 => 100644 tests/signals/multiple_connections_test.py
mode change 100755 => 100644 tests/signals/pysignal_test.py
mode change 100755 => 100644 tests/signals/qobject_destroyed_test.py
mode change 100755 => 100644 tests/signals/qobject_receivers_test.py
mode change 100755 => 100644 tests/signals/qobject_sender_test.py
mode change 100755 => 100644 tests/signals/ref01_test.py
mode change 100755 => 100644 tests/signals/ref02_test.py
mode change 100755 => 100644 tests/signals/ref03_test.py
mode change 100755 => 100644 tests/signals/ref04_test.py
mode change 100755 => 100644 tests/signals/ref05_test.py
mode change 100755 => 100644 tests/signals/ref06_test.py
mode change 100755 => 100644 tests/signals/segfault_proxyparent_test.py
mode change 100755 => 100644 tests/signals/self_connect_test.py
mode change 100755 => 100644 tests/signals/short_circuit_test.py
mode change 100755 => 100644 tests/signals/signal2signal_connect_test.py
mode change 100755 => 100644 tests/signals/signal_autoconnect_test.py
mode change 100755 => 100644 tests/signals/signal_connectiontype_support_test.py
mode change 100755 => 100644 tests/signals/signal_emission_gui_test.py
mode change 100755 => 100644 tests/signals/signal_emission_test.py
mode change 100755 => 100644 tests/signals/signal_func_test.py
mode change 100755 => 100644 tests/signals/signal_manager_refcount_test.py
mode change 100755 => 100644 tests/signals/signal_object_test.py
mode change 100755 => 100644 tests/signals/signal_with_primitive_type_test.py
mode change 100755 => 100644 tests/signals/slot_reference_count_test.py
mode change 100755 => 100644 tests/signals/static_metaobject_test.py
mode change 100755 => 100644 tests/signals/upstream_segfault_test.py
mode change 100755 => 100644 tests/util/processtimer.py
mode change 100755 => 100644 tests/util/pyqtcheck.py
diff --git a/tests/QtCore/qbitarray_test.py b/tests/QtCore/qbitarray_test.py
old mode 100755
new mode 100644
diff --git a/tests/QtCore/qbytearray_buffer_protocol_test.py b/tests/QtCore/qbytearray_buffer_protocol_test.py
old mode 100755
new mode 100644
diff --git a/tests/QtCore/qbytearray_concatenation_operator_test.py b/tests/QtCore/qbytearray_concatenation_operator_test.py
old mode 100755
new mode 100644
diff --git a/tests/QtCore/qcoreapplication_instance_test.py b/tests/QtCore/qcoreapplication_instance_test.py
old mode 100755
new mode 100644
diff --git a/tests/QtCore/qthread_signal_test.py b/tests/QtCore/qthread_signal_test.py
old mode 100755
new mode 100644
diff --git a/tests/QtCore/static_method_test.py b/tests/QtCore/static_method_test.py
old mode 100755
new mode 100644
diff --git a/tests/QtCore/unaryoperator_test.py b/tests/QtCore/unaryoperator_test.py
old mode 100755
new mode 100644
diff --git a/tests/QtGui/customproxywidget_test.py b/tests/QtGui/customproxywidget_test.py
old mode 100755
new mode 100644
diff --git a/tests/QtGui/keep_reference_test.py b/tests/QtGui/keep_reference_test.py
old mode 100755
new mode 100644
diff --git a/tests/QtGui/qgraphicsitem_isblocked_test.py b/tests/QtGui/qgraphicsitem_isblocked_test.py
old mode 100755
new mode 100644
diff --git a/tests/QtGui/qgraphicsproxywidget_test.py b/tests/QtGui/qgraphicsproxywidget_test.py
old mode 100755
new mode 100644
diff --git a/tests/QtGui/qstyle_test.py b/tests/QtGui/qstyle_test.py
old mode 100755
new mode 100644
diff --git a/tests/QtSql/qsqldatabaseandqueries_test.py b/tests/QtSql/qsqldatabaseandqueries_test.py
old mode 100755
new mode 100644
diff --git a/tests/phonon/basic_playing_test.py b/tests/phonon/basic_playing_test.py
old mode 100755
new mode 100644
diff --git a/tests/signals/args_dont_match_test.py b/tests/signals/args_dont_match_test.py
old mode 100755
new mode 100644
diff --git a/tests/signals/decorators_test.py b/tests/signals/decorators_test.py
old mode 100755
new mode 100644
diff --git a/tests/signals/invalid_callback_test.py b/tests/signals/invalid_callback_test.py
old mode 100755
new mode 100644
diff --git a/tests/signals/lambda_gui_test.py b/tests/signals/lambda_gui_test.py
old mode 100755
new mode 100644
diff --git a/tests/signals/lambda_test.py b/tests/signals/lambda_test.py
old mode 100755
new mode 100644
diff --git a/tests/signals/multiple_connections_gui_test.py b/tests/signals/multiple_connections_gui_test.py
old mode 100755
new mode 100644
diff --git a/tests/signals/multiple_connections_test.py b/tests/signals/multiple_connections_test.py
old mode 100755
new mode 100644
diff --git a/tests/signals/pysignal_test.py b/tests/signals/pysignal_test.py
old mode 100755
new mode 100644
diff --git a/tests/signals/qobject_destroyed_test.py b/tests/signals/qobject_destroyed_test.py
old mode 100755
new mode 100644
diff --git a/tests/signals/qobject_receivers_test.py b/tests/signals/qobject_receivers_test.py
old mode 100755
new mode 100644
diff --git a/tests/signals/qobject_sender_test.py b/tests/signals/qobject_sender_test.py
old mode 100755
new mode 100644
diff --git a/tests/signals/ref01_test.py b/tests/signals/ref01_test.py
old mode 100755
new mode 100644
diff --git a/tests/signals/ref02_test.py b/tests/signals/ref02_test.py
old mode 100755
new mode 100644
diff --git a/tests/signals/ref03_test.py b/tests/signals/ref03_test.py
old mode 100755
new mode 100644
diff --git a/tests/signals/ref04_test.py b/tests/signals/ref04_test.py
old mode 100755
new mode 100644
diff --git a/tests/signals/ref05_test.py b/tests/signals/ref05_test.py
old mode 100755
new mode 100644
diff --git a/tests/signals/ref06_test.py b/tests/signals/ref06_test.py
old mode 100755
new mode 100644
diff --git a/tests/signals/segfault_proxyparent_test.py b/tests/signals/segfault_proxyparent_test.py
old mode 100755
new mode 100644
diff --git a/tests/signals/self_connect_test.py b/tests/signals/self_connect_test.py
old mode 100755
new mode 100644
diff --git a/tests/signals/short_circuit_test.py b/tests/signals/short_circuit_test.py
old mode 100755
new mode 100644
diff --git a/tests/signals/signal2signal_connect_test.py b/tests/signals/signal2signal_connect_test.py
old mode 100755
new mode 100644
diff --git a/tests/signals/signal_autoconnect_test.py b/tests/signals/signal_autoconnect_test.py
old mode 100755
new mode 100644
diff --git a/tests/signals/signal_connectiontype_support_test.py b/tests/signals/signal_connectiontype_support_test.py
old mode 100755
new mode 100644
diff --git a/tests/signals/signal_emission_gui_test.py b/tests/signals/signal_emission_gui_test.py
old mode 100755
new mode 100644
diff --git a/tests/signals/signal_emission_test.py b/tests/signals/signal_emission_test.py
old mode 100755
new mode 100644
diff --git a/tests/signals/signal_func_test.py b/tests/signals/signal_func_test.py
old mode 100755
new mode 100644
diff --git a/tests/signals/signal_manager_refcount_test.py b/tests/signals/signal_manager_refcount_test.py
old mode 100755
new mode 100644
diff --git a/tests/signals/signal_object_test.py b/tests/signals/signal_object_test.py
old mode 100755
new mode 100644
diff --git a/tests/signals/signal_with_primitive_type_test.py b/tests/signals/signal_with_primitive_type_test.py
old mode 100755
new mode 100644
diff --git a/tests/signals/slot_reference_count_test.py b/tests/signals/slot_reference_count_test.py
old mode 100755
new mode 100644
diff --git a/tests/signals/static_metaobject_test.py b/tests/signals/static_metaobject_test.py
old mode 100755
new mode 100644
diff --git a/tests/signals/upstream_segfault_test.py b/tests/signals/upstream_segfault_test.py
old mode 100755
new mode 100644
diff --git a/tests/util/processtimer.py b/tests/util/processtimer.py
old mode 100755
new mode 100644
diff --git a/tests/util/pyqtcheck.py b/tests/util/pyqtcheck.py
old mode 100755
new mode 100644
From d8a192b5e14e996992a98766cd39ca2028e6474e Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Wed, 9 Jun 2010 16:45:24 -0300
Subject: [PATCH 0017/1129] Remove registration of PySide primitive types, the
generator do this automatically.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Reviewer: Luciano Wolf
Renato Araújo
---
libpyside/signalmanager.cpp | 17 -----------------
1 file changed, 17 deletions(-)
diff --git a/libpyside/signalmanager.cpp b/libpyside/signalmanager.cpp
index f1b39b9..80d7254 100644
--- a/libpyside/signalmanager.cpp
+++ b/libpyside/signalmanager.cpp
@@ -202,23 +202,6 @@ SignalManager::SignalManager() : m_d(new SignalManagerPrivate)
qRegisterMetaType(PYTHON_TYPE);
TypeResolver::createValueTypeResolver(PYTHON_TYPE);
- TypeResolver::createValueTypeResolver("qint8");
- TypeResolver::createValueTypeResolver("qint16");
- TypeResolver::createValueTypeResolver("qint32");
- TypeResolver::createValueTypeResolver("qint64");
- TypeResolver::createValueTypeResolver("qlonglong");
- TypeResolver::createValueTypeResolver("qptrdiff");
- TypeResolver::createValueTypeResolver("qreal");
- TypeResolver::createValueTypeResolver("quint8");
- TypeResolver::createValueTypeResolver("quint16");
- TypeResolver::createValueTypeResolver("quint32");
- TypeResolver::createValueTypeResolver("quint64");
- TypeResolver::createValueTypeResolver("quintptr");
- TypeResolver::createValueTypeResolver("qulonglong");
- TypeResolver::createValueTypeResolver("uchar");
- TypeResolver::createValueTypeResolver("uint");
- TypeResolver::createValueTypeResolver("ulong");
- TypeResolver::createValueTypeResolver("ushort");
}
void SignalManager::clear()
From 1b6337d8b4a65988dfbeb0eed67bc6584b25fdee Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Thu, 10 Jun 2010 19:57:18 -0300
Subject: [PATCH 0018/1129] Removed QVariant from PySide.
Reviewer: Luciano Wolf
Marcelo Lira
---
PySide/QtCore/CMakeLists.txt | 1 -
PySide/QtCore/qvariant_conversions.h | 155 +++++++++--------
PySide/QtCore/typesystem_core.xml | 187 +--------------------
libpyside/pyside.cpp | 3 +
libpyside/signalmanager.cpp | 25 +--
libpyside/signalmanager.h | 14 ++
tests/QtCore/CMakeLists.txt | 2 -
tests/QtCore/qabstracttransition_test.py | 7 +-
tests/QtCore/qanimationgroup_test.py | 2 +-
tests/QtCore/qobject_property_test.py | 66 +++++---
tests/QtCore/qstate_test.py | 8 +-
tests/QtCore/qvariant_pyobject_test.py | 68 --------
tests/QtCore/qvariant_test.py | 124 --------------
tests/QtGui/CMakeLists.txt | 1 -
tests/QtGui/keep_reference_test.py | 4 +-
tests/QtGui/qpixmap_test.py | 11 +-
tests/QtGui/qvariant_test.py | 85 ----------
tests/QtSql/qsqldatabaseandqueries_test.py | 8 +-
18 files changed, 170 insertions(+), 601 deletions(-)
delete mode 100644 tests/QtCore/qvariant_pyobject_test.py
delete mode 100644 tests/QtCore/qvariant_test.py
delete mode 100644 tests/QtGui/qvariant_test.py
diff --git a/PySide/QtCore/CMakeLists.txt b/PySide/QtCore/CMakeLists.txt
index bbe8ba7..12a2f4a 100644
--- a/PySide/QtCore/CMakeLists.txt
+++ b/PySide/QtCore/CMakeLists.txt
@@ -120,7 +120,6 @@ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qtimerevent_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qtranslator_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qurl_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/quuid_wrapper.cpp
-${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qvariant_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qwaitcondition_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qwritelocker_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qxmlstreamattribute_wrapper.cpp
diff --git a/PySide/QtCore/qvariant_conversions.h b/PySide/QtCore/qvariant_conversions.h
index aa6d521..076ed7f 100644
--- a/PySide/QtCore/qvariant_conversions.h
+++ b/PySide/QtCore/qvariant_conversions.h
@@ -1,86 +1,83 @@
-// We use this thin wrapper instead of the plain PyObject pointer to avoid conflicts with specializations of T*
-// in QVariant.
-struct PyQt_PyObject
-{
- PyObject* m_me;
- PyQt_PyObject(PyObject* me) : m_me(me) {}
- PyQt_PyObject() : m_me(Py_None) {}
- operator PyObject*() { return m_me; }
-};
-
-Q_DECLARE_METATYPE(PyQt_PyObject)
-
namespace Shiboken {
-inline bool Converter::checkType(PyObject* pyObj)
+template<>
+struct Converter
{
- return ValueTypeConverter::checkType(pyObj);
-}
-
-// all types are convertible to QVariant
-inline bool Converter::isConvertible(PyObject* pyObj)
-{
- return true;
-}
-
-inline QVariant Converter::toCpp(PyObject* pyObj)
-{
- if (SbkQVariant_Check(pyObj))
- return *Converter::toCpp(pyObj);
-
- // Primitive types
- if (PyBool_Check(pyObj)) {
- // QVariant(bool)
- return QVariant(Shiboken::Converter::toCpp(pyObj));
- } else if (PyString_CheckExact(pyObj)) {
- // QVariant(const char*)
- return QVariant(Shiboken::Converter::toCpp(pyObj));
- } else if (PyFloat_CheckExact(pyObj)) {
- // QVariant(double)
- return QVariant(Shiboken::Converter::toCpp(pyObj));
- } else if (PyInt_CheckExact(pyObj)) {
- // QVariant(int)
- return QVariant(Shiboken::Converter::toCpp(pyObj));
- } else if (PyLong_CheckExact(pyObj)) {
- // QVariant(qlonglong)
- return QVariant(Shiboken::Converter::toCpp(pyObj));
- } else if (Shiboken::isShibokenEnum(pyObj)) {
- // QVariant(enum)
- return QVariant(Shiboken::Converter::toCpp(pyObj));
- } else if (!Shiboken::isShibokenType(pyObj) || Shiboken::isUserType(pyObj)) {
- // QVariant(User class)
- Py_INCREF(pyObj);
- return QVariant::fromValue(pyObj);
- } else {
- // a class supported by QVariant?
- const char* typeName = pyObj->ob_type->tp_name;
- // check if the name starts with PySide.
- if (!strncmp("PySide.", typeName, 7)) {
- // get the type name
- const char* lastDot = typeName;
- for (int i = 8; typeName[i]; ++i) {
- if (typeName[i] == '.')
- lastDot = &typeName[i];
- }
- lastDot++;
- uint typeCode = QMetaType::type(lastDot);
- if (!typeCode) {// Try with star at end, for QObject*, QWidget* and QAbstractKinectScroller*
- QString typeName(lastDot);
- typeName += '*';
- typeCode = QMetaType::type(typeName.toAscii());
- }
- if (typeCode)
- return QVariant(typeCode, reinterpret_cast(pyObj)->cptr[0]);
- }
- // Is a shiboken type not known by Qt
- Py_INCREF(pyObj);
- return QVariant::fromValue(pyObj);
+ static bool checkType(PyObject* pyObj)
+ {
+ return false; // lets avoid the chaos
}
-}
-inline PyObject* Converter::toPython(const QVariant& cppObj)
-{
- return ValueTypeConverter::toPython(cppObj);
-}
+ // all types are convertible to QVariant
+ static bool isConvertible(PyObject* pyObj)
+ {
+ return true;
+ }
+ static QVariant toCpp(PyObject* pyObj)
+ {
+ using namespace Shiboken;
+
+ // Primitive types
+ if (Converter::checkType(pyObj)) {
+ // QVariant(bool)
+ return QVariant(Converter::toCpp(pyObj));
+ } else if (pyObj == Py_None) {
+ // QVariant()
+ return QVariant();
+ } else if (Converter::checkType(pyObj)) {
+ // QVariant(const char*)
+ return QVariant(Converter::toCpp(pyObj));
+ } else if (PyFloat_CheckExact(pyObj)) {
+ // QVariant(double)
+ return QVariant(Converter::toCpp(pyObj));
+ } else if (PyInt_CheckExact(pyObj)) {
+ // QVariant(int)
+ return QVariant(Converter::toCpp(pyObj));
+ } else if (PyLong_CheckExact(pyObj)) {
+ // QVariant(qlonglong)
+ return QVariant(Converter::toCpp(pyObj));
+ } else if (Shiboken::isShibokenEnum(pyObj)) {
+ // QVariant(enum)
+ return QVariant(Converter::toCpp(pyObj));
+ } else if (!isShibokenType(pyObj) || isUserType(pyObj)) {
+ // QVariant(User class)
+ return QVariant::fromValue(pyObj);
+ } else {
+ // a class supported by QVariant?
+ const char* typeName = pyObj->ob_type->tp_name;
+ // check if the name starts with PySide.
+ if (!strncmp("PySide.", typeName, 7)) {
+ // get the type name
+ const char* lastDot = typeName;
+ for (int i = 8; typeName[i]; ++i) {
+ if (typeName[i] == '.')
+ lastDot = &typeName[i];
+ }
+ lastDot++;
+ uint typeCode = QMetaType::type(lastDot);
+ if (!typeCode) {// Try with star at end, for QObject*, QWidget* and QAbstractKinectScroller*
+ QString typeName(lastDot);
+ typeName += '*';
+ typeCode = QMetaType::type(typeName.toAscii());
+ }
+ if (typeCode)
+ return QVariant(typeCode, reinterpret_cast(pyObj)->cptr[0]);
+ }
+ // Is a shiboken type not known by Qt
+ return QVariant::fromValue(pyObj);
+ }
+ }
+
+ static PyObject* toPython(void* cppObj) { return toPython(*reinterpret_cast(cppObj)); }
+ static PyObject* toPython(const QVariant& cppObj)
+ {
+ if (cppObj.isValid()) {
+ Shiboken::TypeResolver* tr = Shiboken::TypeResolver::get(cppObj.typeName());
+ if (tr)
+ return tr->toPython(const_cast(cppObj.data()));
+ }
+ Py_RETURN_NONE;
+ }
+};
}
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 6258861..85694e4 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -74,7 +74,6 @@
-
@@ -129,7 +128,10 @@
-
+
+
+
+
@@ -154,6 +156,10 @@
+
+
+
+
@@ -248,7 +254,6 @@
-
@@ -541,16 +546,6 @@
-
-
-
-
-
-
-
-
-
-
@@ -1241,172 +1236,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- >
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- %0 = new %TYPE(%CONVERTTOCPP[QVariant](%PYARG_1));
-
-
-
-
- uint typeId = %CPPSELF.userType();
- if (typeId == qMetaTypeId<PyQt_PyObject>()) {
- %PYARG_0 = %CPPSELF.value<PyQt_PyObject>();
- } else if (typeId == QVariant::String) {
- %PYARG_0 = %CONVERTTOPYTHON[QString](%CPPSELF.toString());
- } else {
- %PYARG_0 = Py_None;
- Py_INCREF(Py_None);
- }
-
-
-
-
- if (%CPPSELF.isNull()) {
- %PYARG_0 = Py_None;
- Py_INCREF(Py_None);
- } else if (%CPPSELF.userType() == qMetaTypeId<PyQt_PyObject>()) {
- // emulate PyQt4 behaviour
- PyObject* obj = %CPPSELF.value<PyQt_PyObject>();
- if (PySequence_Check(obj))
- %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE]("QVariantList");
- }
- if (!%PYARG_0)
- %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%CPPSELF.%FUNCTION_NAME());
-
-
-
-
- if (%CPPSELF.userType() == qMetaTypeId<PyQt_PyObject>()) {
- PyObject* val = %CPPSELF.value<PyQt_PyObject>();
- if (PySequence_Check(val)) {
- %PYARG_0 = val;
- Py_INCREF(val);
- } else {
- %PYARG_0 = Py_None;
- Py_INCREF(Py_None);
- }
- } else {
- %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%CPPSELF.%FUNCTION_NAME());
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/libpyside/pyside.cpp b/libpyside/pyside.cpp
index 3fa63a4..93271c8 100644
--- a/libpyside/pyside.cpp
+++ b/libpyside/pyside.cpp
@@ -34,6 +34,7 @@
#include "pyside.h"
+#include "signalmanager.h"
extern "C" void init_signal(PyObject* module);
extern "C" void init_slot(PyObject* module);
@@ -45,6 +46,8 @@ void init(PyObject *module)
{
init_signal(module);
init_slot(module);
+ // Init signal manager, so it will register some meta types used by QVariant.
+ SignalManager::instance();
}
} //namespace PySide
diff --git a/libpyside/signalmanager.cpp b/libpyside/signalmanager.cpp
index 80d7254..7ac3f30 100644
--- a/libpyside/signalmanager.cpp
+++ b/libpyside/signalmanager.cpp
@@ -54,35 +54,22 @@
#define PYTHON_TYPE "PyObject"
-
-// Use this to wrap PyObject during the Signal/Slot handling
-struct PyObjectWrapper
-{
- PyObject* m_me;
- PyObjectWrapper(const PyObjectWrapper &other) : m_me(other.m_me) {}
- PyObjectWrapper(PyObject* me) : m_me(me) { Py_INCREF(m_me); }
- PyObjectWrapper() : m_me(Py_None) {}
- operator PyObject*() const { return m_me; }
-};
-
-Q_DECLARE_METATYPE(PyObjectWrapper)
-
namespace Shiboken {
template<>
-struct Converter
+struct Converter
{
- static PyObjectWrapper toCpp(PyObject* obj)
+ static PySide::PyObjectWrapper toCpp(PyObject* obj)
{
- return PyObjectWrapper(obj);
+ return PySide::PyObjectWrapper(obj);
}
static PyObject* toPython(void* obj)
{
- return toPython(*reinterpret_cast(obj));
+ return toPython(*reinterpret_cast(obj));
}
- static PyObject* toPython(const PyObjectWrapper& obj)
+ static PyObject* toPython(const PySide::PyObjectWrapper& obj)
{
return obj;
}
@@ -202,6 +189,8 @@ SignalManager::SignalManager() : m_d(new SignalManagerPrivate)
qRegisterMetaType(PYTHON_TYPE);
TypeResolver::createValueTypeResolver(PYTHON_TYPE);
+ TypeResolver::createValueTypeResolver("object");
+ TypeResolver::createValueTypeResolver("PySide::PyObjectWrapper");
}
void SignalManager::clear()
diff --git a/libpyside/signalmanager.h b/libpyside/signalmanager.h
index 233adf1..9687dcc 100644
--- a/libpyside/signalmanager.h
+++ b/libpyside/signalmanager.h
@@ -46,6 +46,17 @@ class QObject;
namespace PySide
{
+/// Thin wrapper for PyObject which increases the reference count at the constructor but *NOT* at destructor.
+class PYSIDE_API PyObjectWrapper
+{
+public:
+ PyObjectWrapper(PyObject* me) : m_me(me) { Py_INCREF(m_me); }
+ PyObjectWrapper() : m_me(Py_None) { Py_INCREF(m_me); }
+ operator PyObject*() const { return m_me; }
+private:
+ PyObject* m_me;
+};
+
PYSIDE_API bool isSignal(const char* signal);
PYSIDE_API bool checkSignal(const char* signal);
PYSIDE_API QString getCallbackSignature(const char* signal, PyObject* callback, bool encodeName);
@@ -84,4 +95,7 @@ private:
};
}
+
+Q_DECLARE_METATYPE(PySide::PyObjectWrapper)
+
#endif
diff --git a/tests/QtCore/CMakeLists.txt b/tests/QtCore/CMakeLists.txt
index cce1332..35fa7b9 100644
--- a/tests/QtCore/CMakeLists.txt
+++ b/tests/QtCore/CMakeLists.txt
@@ -55,8 +55,6 @@ PYSIDE_TEST(qtimer_singleshot_test.py)
PYSIDE_TEST(qtimer_timeout_test.py)
PYSIDE_TEST(qtnamespace_test.py)
PYSIDE_TEST(qurl_test.py)
-PYSIDE_TEST(qvariant_pyobject_test.py)
-PYSIDE_TEST(qvariant_test.py)
PYSIDE_TEST(static_method_test.py)
PYSIDE_TEST(static_protected_methods_test.py)
PYSIDE_TEST(thread_signals_test.py)
diff --git a/tests/QtCore/qabstracttransition_test.py b/tests/QtCore/qabstracttransition_test.py
index 510b8ef..4ba6d83 100644
--- a/tests/QtCore/qabstracttransition_test.py
+++ b/tests/QtCore/qabstracttransition_test.py
@@ -1,8 +1,7 @@
#!/usr/bin/python
import unittest
from sys import getrefcount
-from PySide.QtCore import QObject, SIGNAL, QCoreApplication, QTimer, QVariant
-from PySide.QtCore import QState, QFinalState, QStateMachine, QParallelAnimationGroup, QEventTransition
+from PySide.QtCore import *
def addStates(transition):
sx = QState()
@@ -19,11 +18,11 @@ class QAbstractTransitionTest(unittest.TestCase):
app = QCoreApplication([])
o = QObject()
- o.setProperty("text", QVariant("INdT"))
+ o.setProperty("text", "INdT")
machine = QStateMachine()
s1 = QState()
- s1.assignProperty(o, "text", QVariant("Rocks"))
+ s1.assignProperty(o, "text", "Rocks")
s2 = QFinalState()
t = s1.addTransition(o, SIGNAL("change()"), s2)
diff --git a/tests/QtCore/qanimationgroup_test.py b/tests/QtCore/qanimationgroup_test.py
index 05bd81e..58886d1 100644
--- a/tests/QtCore/qanimationgroup_test.py
+++ b/tests/QtCore/qanimationgroup_test.py
@@ -1,6 +1,6 @@
#!/usr/bin/python
import unittest
-from PySide.QtCore import QObject, QState, QFinalState, SIGNAL, QCoreApplication, QTimer, QStateMachine, QSignalTransition, QVariant, QParallelAnimationGroup, QSequentialAnimationGroup, QAnimationGroup
+from PySide.QtCore import *
class QAnimationGroupTest(unittest.TestCase):
diff --git a/tests/QtCore/qobject_property_test.py b/tests/QtCore/qobject_property_test.py
index d1f12b3..e94562c 100644
--- a/tests/QtCore/qobject_property_test.py
+++ b/tests/QtCore/qobject_property_test.py
@@ -5,16 +5,24 @@ import unittest
from PySide.QtCore import *
+class Dummy(object):
+ '''Pure python sample class'''
+ pass
+
+class MySize(QSize):
+ '''Extended class'''
+ pass
+
class PropertyCase(unittest.TestCase):
'''Test case for QObject properties'''
def testObjectNameProperty(self):
#QObject.setProperty() for existing C++ property
obj = QObject()
- self.assert_(obj.setProperty('objectName', QVariant('dummy')))
+ self.assert_(obj.setProperty('objectName', 'dummy'))
self.assertEqual(obj.objectName(), 'dummy')
- self.assert_(obj.setProperty('objectName', QVariant('foobar')))
+ self.assert_(obj.setProperty('objectName', 'foobar'))
self.assertEqual(obj.objectName(), 'foobar')
def testDynamicProperty(self):
@@ -22,50 +30,66 @@ class PropertyCase(unittest.TestCase):
obj = QObject()
# Should return false when creating a new dynamic property
- self.assert_(not obj.setProperty('dummy', QVariant('mydata')))
+ self.assert_(not obj.setProperty('dummy', 'mydata'))
prop = obj.property('dummy')
- self.assert_(isinstance(prop, QVariant))
- self.assert_(prop.isValid())
- self.assertEqual(obj.property('dummy').toString(), 'mydata')
+ self.assert_(isinstance(prop, unicode))
+ self.assertEqual(obj.property('dummy'), 'mydata')
- self.assert_(not obj.setProperty('dummy', QVariant('zigzag')))
+ self.assert_(not obj.setProperty('dummy', 'zigzag'))
prop = obj.property('dummy')
- self.assert_(isinstance(prop, QVariant))
- self.assert_(prop.isValid())
- self.assertEqual(obj.property('dummy').toString(), 'zigzag')
+ self.assert_(isinstance(prop, unicode))
+ self.assertEqual(obj.property('dummy'), 'zigzag')
- self.assert_(not obj.setProperty('dummy', QVariant(42)))
+ self.assert_(not obj.setProperty('dummy', 42))
prop = obj.property('dummy')
- self.assert_(isinstance(prop, QVariant))
- self.assert_(prop.isValid())
+ self.assert_(isinstance(prop, int))
# QVariant.toInt has a bool* arg in C++, so returns a tuple
- self.assertEqual(obj.property('dummy').toInt(), (42, True))
+ self.assertEqual(obj.property('dummy'), 42)
def testStringProperty(self):
obj = QObject()
self.assert_(not obj.setProperty('dummy', 'data'))
prop = obj.property('dummy')
- self.assert_(isinstance(prop, QVariant))
- self.assert_(prop.isValid())
- self.assertEqual(obj.property('dummy').toString(), 'data')
+ self.assert_(isinstance(prop, unicode))
+ self.assertEqual(obj.property('dummy'), 'data')
def testImplicitQVariantProperty(self):
obj = QObject()
self.assert_(not obj.setProperty('dummy', 'data'))
prop = obj.property('dummy')
- self.assert_(isinstance(prop, QVariant))
- self.assert_(prop.isValid())
- self.assertEqual(obj.property('dummy').toString(), 'data')
+ self.assert_(isinstance(prop, unicode))
+ self.assertEqual(obj.property('dummy'), 'data')
def testInvalidProperty(self):
#QObject.property() for invalid properties
obj = QObject()
prop = obj.property('dummy')
- self.assert_(not prop.isValid())
+ self.assertEqual(prop, None)
+ def testTypeNamePythonClasses(self):
+ '''QVariant of pure python classes'''
+ d = Dummy()
+ obj = QObject()
+ obj.setProperty('foo', d)
+ # inherited type name from other binding
+ self.assertEqual(obj.property('foo'), d)
+
+ def testQVariantPyList(self):
+ '''QVariant(QVariantList).toPyObject() equals original list'''
+ obj = QObject()
+ obj.setProperty('foo', [1, 'two', 3])
+ self.assertEqual(obj.property('foo'), [1, 'two', 3])
+
+ def testSubClassConvertion(self):
+ '''QVariant(QSize subclass) type is UserType and returns same object'''
+ mysize = MySize(0, 0)
+ obj = QObject()
+ obj.setProperty('foo', mysize)
+
+ self.assertTrue(obj.property('foo') is mysize)
if __name__ == '__main__':
unittest.main()
diff --git a/tests/QtCore/qstate_test.py b/tests/QtCore/qstate_test.py
index d7c9a4c..bee73e4 100644
--- a/tests/QtCore/qstate_test.py
+++ b/tests/QtCore/qstate_test.py
@@ -1,6 +1,6 @@
#!/usr/bin/python
import unittest
-from PySide.QtCore import QObject, QState, QFinalState, SIGNAL, QCoreApplication, QTimer, QStateMachine, QSignalTransition, QVariant
+from PySide.QtCore import *
class QStateTest(unittest.TestCase):
@@ -8,11 +8,11 @@ class QStateTest(unittest.TestCase):
app = QCoreApplication([])
o = QObject()
- o.setProperty("text", QVariant("INdT"))
+ o.setProperty("text", "INdT")
machine = QStateMachine()
s1 = QState()
- s1.assignProperty(o, "text", QVariant("Rocks"));
+ s1.assignProperty(o, "text", "Rocks");
s2 = QFinalState()
t = s1.addTransition(o, SIGNAL("change()"), s2);
@@ -28,7 +28,7 @@ class QStateTest(unittest.TestCase):
QTimer.singleShot(100, app.quit)
app.exec_()
- txt = o.property("text").toString()
+ txt = o.property("text")
self.assert_(txt, "Rocks")
if __name__ == '__main__':
diff --git a/tests/QtCore/qvariant_pyobject_test.py b/tests/QtCore/qvariant_pyobject_test.py
deleted file mode 100644
index 2000a01..0000000
--- a/tests/QtCore/qvariant_pyobject_test.py
+++ /dev/null
@@ -1,68 +0,0 @@
-
-'''QVariant handling of PyObjects, including pure-python or derived from Qt'''
-
-import unittest
-
-from PySide.QtCore import *
-
-
-class Dummy(object):
- '''Pure python sample class'''
- pass
-
-class MySize(QSize):
- '''Extended class'''
- pass
-
-class QVariantPurePython(unittest.TestCase):
- '''QVariant + pure python classes'''
-
- def testTypeNamePythonClasses(self):
- '''QVariant of pure python classes'''
- d = Dummy()
- obj = QVariant(d)
- # inherited type name from other binding
- self.assertEqual('PyQt_PyObject', obj.typeName())
-
-class QVariantInheritedPython(unittest.TestCase):
- '''QVariant + classes inherited from C++'''
-
- # This works only on PyQt4 4.5.x, not on PyQt4 4.4.x or PySide
- def testSubClassConvertion(self):
- '''QVariant(QSize subclass) type is UserType and returns same object'''
- mysize = MySize(0, 0)
- variant = QVariant(mysize)
-
- self.assertEqual(variant.type(), QVariant.UserType)
- self.assertTrue(variant.toPyObject() is mysize)
-
-
-class QVariantToPyObject(unittest.TestCase):
- '''QVariant.toPyObject tests'''
-
- def testQVariantPyList(self):
- '''QVariant(QVariantList).toPyObject() equals original list'''
- obj = QVariant([1, 'two', 3])
- self.assertEqual(obj.toPyObject(), [1, 'two', 3])
-
- def testPyObject(self):
- '''QVariant(pure PyObject).toPyObject should return the same object'''
- d = Dummy()
- obj = QVariant(d)
- self.assert_(d is obj.toPyObject())
-
- def testNoneToPyObject(self):
- '''QVariant().toPyObject() should return None'''
- obj = QVariant()
- self.assertEqual(None, obj.toPyObject())
-
- def testQStringToPyObject(self):
- '''QVariant(python string).toPyObject() return an equal QString'''
- d = 'abc'
- obj = QVariant('abc')
- self.assert_(isinstance(obj.toPyObject(), unicode))
- self.assertEqual(d, obj.toPyObject())
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/tests/QtCore/qvariant_test.py b/tests/QtCore/qvariant_test.py
deleted file mode 100644
index 6be7b81..0000000
--- a/tests/QtCore/qvariant_test.py
+++ /dev/null
@@ -1,124 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-'''Test cases for QVariant'''
-
-import unittest
-import sys
-
-from PySide.QtCore import *
-
-
-class QVariantToNumber(unittest.TestCase):
- '''QVariant of number types'''
-
- def testToNumberInt(self):
- '''QVariant(int).toInt()'''
- obj = QVariant('37')
- self.assertEqual((37, True), obj.toInt())
-
- def testToNumberLongLong(self):
- '''QVariant(int).toLongLong()'''
- obj = QVariant('37')
- self.assertEqual((37, True), obj.toLongLong())
-
- def testToNumberUInt(self):
- '''QVariant(int).toUInt()'''
- obj = QVariant('37')
- self.assertEqual((37, True), obj.toUInt())
-
- def testToNumberUIntNegative(self):
- '''QVariant(negative int).toUInt()'''
- obj = QVariant('-37')
- self.assert_(not obj.toUInt()[1])
-
- def testToNumberULongLong(self):
- '''QVariant(int).toULongLong()'''
- obj = QVariant('37')
- self.assertEqual((37, True), obj.toULongLong())
-
- def testToNumberULongLongNegative(self):
- '''QVariant(negative int).toULongLong()'''
- obj = QVariant('-37')
- self.assert_(not obj.toULongLong()[1])
-
- def testToNumberFloat(self):
- '''QVariant(double).toFloat()'''
- obj = QVariant('37.109')
- self.assertEqual((37.109, True), obj.toDouble())
-
-
-class QVariantTypeName(unittest.TestCase):
- '''QVariant.typeName()'''
-
- def testTypeNameString(self):
- '''QVariant(PyString).typeName()'''
- obj = QVariant('aaaa')
- self.assertEqual('QString', obj.typeName())
-
- def testTypeNameInt(self):
- '''QVariant(int).typeName()'''
- obj = QVariant(34)
- self.assertEqual('int', obj.typeName())
-
- def testTypeNameDouble(self):
- '''QVariant(double).typeName()'''
- obj = QVariant(3.14)
- self.assertEqual('double', obj.typeName())
-
- def testTypeNameBool(self):
- '''QVariant(bool).typeName()'''
- obj = QVariant(True)
- self.assertEqual('bool', obj.typeName())
-
- def testTypeNameQByteArray(self):
- '''QVariant(QByteArray).typeName()'''
- obj = QVariant(QByteArray('aaaa'))
- self.assertEqual('QByteArray', obj.typeName())
-
- def testTypeNameNone(self):
- '''QVariant().typeName()'''
- obj = QVariant()
- self.assertEqual(None, obj.typeName())
-
- def testTypeNameQVariantList(self):
- '''QVariant(QVariantList).typeName()'''
- obj = QVariant([1, 2, 3, 4])
- self.assertEqual('QVariantList', obj.typeName())
-
- obj = QVariant([1.0, 2.2, 3.3, 4.2])
- self.assertEqual('QVariantList', obj.typeName())
-
- obj = QVariant(['aaa', 'bbb', 'ccc', 'dddd'])
- self.assertEqual('QVariantList', obj.typeName())
-
-class QVariantConstructor(unittest.TestCase):
- '''More qvariant constructions'''
-
- def testCopyConstructor(self):
- '''QVariant copy constructor'''
- obj = QVariant(1)
- cpy = QVariant(obj)
-
- self.assertEqual(obj.type(), cpy.type())
-
- def testQStringConstructor(self):
- '''QVariant(PyString).type == QVariant.string'''
- obj = QVariant("PySide")
- self.assertEqual(obj.type(), QVariant.String)
-
- def testQSizeConstructor(self):
- '''QVariant(QSize).type == QVariant.Size'''
- mysize = QSize(0, 0)
- variant = QVariant(mysize)
-
- self.assertEqual(variant.type(), QVariant.Size)
- self.assertEqual(variant.toSize(), mysize)
-
- def testToList(self):
- v = QVariant((1,2,3))
- self.assertEqual(v.toList(), (1, 2, 3))
- v = QVariant([0,1,2])
- self.assertEqual(v.toList(), [0, 1, 2])
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt
index fa5de4a..d2d89ee 100644
--- a/tests/QtGui/CMakeLists.txt
+++ b/tests/QtGui/CMakeLists.txt
@@ -46,7 +46,6 @@ PYSIDE_TEST(qtabwidget_test.py)
PYSIDE_TEST(qtextedit_test.py)
PYSIDE_TEST(qtoolbar_test.py)
PYSIDE_TEST(qtoolbox_test.py)
-PYSIDE_TEST(qvariant_test.py)
PYSIDE_TEST(qwidget_setlayout_test.py)
PYSIDE_TEST(qwidget_test.py TRUE) #Bug 237
PYSIDE_TEST(reference_count_test.py)
diff --git a/tests/QtGui/keep_reference_test.py b/tests/QtGui/keep_reference_test.py
index d0962d5..310361a 100644
--- a/tests/QtGui/keep_reference_test.py
+++ b/tests/QtGui/keep_reference_test.py
@@ -4,7 +4,7 @@ import unittest
from sys import getrefcount
from helper import UsesQApplication
-from PySide.QtCore import QAbstractTableModel, QVariant
+from PySide.QtCore import *
from PySide.QtGui import QTableView
class TestModel(QAbstractTableModel):
@@ -15,7 +15,7 @@ class TestModel(QAbstractTableModel):
def columnCount(self, parent):
return 0
def data(self, index, role):
- return QVariant()
+ return None
class KeepReferenceTest(UsesQApplication):
diff --git a/tests/QtGui/qpixmap_test.py b/tests/QtGui/qpixmap_test.py
index 7ba7454..1a0339f 100644
--- a/tests/QtGui/qpixmap_test.py
+++ b/tests/QtGui/qpixmap_test.py
@@ -7,9 +7,10 @@ from PySide.QtCore import *
class QPixmapTest(UsesQApplication):
def testQVariantConstructor(self):
+ obj = QObject()
pixmap = QPixmap()
- v = QVariant(pixmap)
- pixmap_copy = QPixmap(v)
+ obj.setProperty('foo', pixmap)
+ self.assertEqual(type(obj.property('foo')), QPixmap)
def testQSizeConstructor(self):
pixmap = QPixmap(QSize(10,20))
@@ -18,12 +19,6 @@ class QPixmapTest(UsesQApplication):
def testQStringConstructor(self):
pixmap = QPixmap("Testing!")
- def testQVariantConstructor2(self):
- v = QVariant(QPixmap())
- pixmap2 = QPixmap(v)
- v = QVariant(QImage())
- pixmap2 = QPixmap(v)
-
def testQPixmapLoadFromDataWithQFile(self):
f = QFile(os.path.join(os.path.dirname(__file__), 'sample.png'))
self.assert_(f.open(QIODevice.ReadOnly))
diff --git a/tests/QtGui/qvariant_test.py b/tests/QtGui/qvariant_test.py
deleted file mode 100644
index 138e432..0000000
--- a/tests/QtGui/qvariant_test.py
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-'''Test cases for QVariant with QtGui types'''
-
-import unittest
-
-from PySide.QtCore import *
-from PySide.QtGui import *
-
-from helper import UsesQApplication
-
-class Dummy(object):
- pass
-
-class QVariantTypeName(unittest.TestCase):
- def testQPen(self):
- obj = QVariant(QPen(Qt.red))
- self.assertEqual('QPen', obj.typeName())
-
- def testQColor(self):
- obj = QVariant(QColor(Qt.red))
- self.assertEqual('QColor', obj.typeName())
-
- def testGlobalColor(self):
- obj = QVariant(Qt.red)
- # XXX: PyQt4 returns int instead of QColor like the C++ version
- self.assertEqual('QColor', obj.typeName())
-
- def testEnums(self):
- obj = QVariant(Qt.SolidLine)
- self.assertEqual('int', obj.typeName())
-
-class QVariantQColorImplicitlyConvertion(unittest.TestCase):
- def testConversions(self):
- c1 = QColor(0, 0, 0)
- v = QVariant(c1)
- c2 = QColor(v)
- self.assertEqual(c1, c2)
-
-class QVariantQPixmap(UsesQApplication):
- '''QVariant(QPixmap)'''
-
- def testBasic(self):
- '''QVariant(QPixmap)'''
- pixmap = QPixmap(10,20)
- pixmap.fill(Qt.blue)
- variant = QVariant(pixmap)
-
- self.assertEqual(variant.typeName(), "QPixmap")
-
- def testQObject(self):
- obj = QObject()
- v = QVariant(obj)
- self.assertEqual(v.typeName(), 'QObject*')
-
- def testQWidget(self):
- obj = QWidget()
- v = QVariant(obj)
- self.assertEqual(v.typeName(), 'QWidget*')
-
-class MyColor(QColor):
- pass
-
-class MyPrimitive(int):
- pass
-
-class QVariantMess(unittest.TestCase):
- def testMyColor(self):
- c1 = MyColor()
- v = QVariant(c1)
- self.assertEqual(type(v.toPyObject()), MyColor)
-
- def testMyPrimitive(self):
- p = MyPrimitive(3)
- v = QVariant(p)
- self.assertNotEqual(v.type(), QVariant.Int)
- self.assertTrue(v.toPyObject() is p)
-
- def testMatrix2x2(self):
- m = QMatrix2x2()
- v = QVariant(m)
- self.assertEqual('QMatrix2x2', v.typeName())
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/tests/QtSql/qsqldatabaseandqueries_test.py b/tests/QtSql/qsqldatabaseandqueries_test.py
index 2d5a0a3..7a9d30a 100644
--- a/tests/QtSql/qsqldatabaseandqueries_test.py
+++ b/tests/QtSql/qsqldatabaseandqueries_test.py
@@ -39,16 +39,16 @@ class SqlDatabaseCreationDestructionAndQueries(unittest.TestCase):
query.exec_("INSERT INTO person VALUES(101, 'George', 'Harrison')")
query.prepare("INSERT INTO person (id, firstname, lastname) "
"VALUES (:id, :firstname, :lastname)")
- query.bindValue(":id", QVariant(102))
- query.bindValue(":firstname", QVariant("John"))
- query.bindValue(":lastname", QVariant("Lennon"))
+ query.bindValue(":id", 102)
+ query.bindValue(":firstname", "John")
+ query.bindValue(":lastname", "Lennon")
query.exec_()
lastname = ''
query.exec_("SELECT lastname FROM person where id=101")
self.assertTrue(query.isActive())
query.next()
- lastname = query.value(0).toString()
+ lastname = query.value(0)
self.assertEqual(lastname, 'Harrison')
if __name__ == '__main__':
From fc059316968e5bdc079a2ebd84800297ecce7d2a Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Mon, 14 Jun 2010 11:23:42 -0300
Subject: [PATCH 0019/1129] GENERATOR_EXTRA_FLAGS must be a cmake string, not a
cmake list.
Reviewer: Luciano Wolf
Marcelo Lira
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4b26d1c..ae254b2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -122,7 +122,7 @@ if (NOT SITE_PACKAGE)
message(FATAL_ERROR "Could not detect Python module installation directory.")
endif()
-set(GENERATOR_EXTRA_FLAGS --generatorSet=shiboken --enable-parent-ctor-heuristic --enable-pyside-extensions --enable-return-value-heuristic)
+set(GENERATOR_EXTRA_FLAGS "--generatorSet=shiboken --enable-parent-ctor-heuristic --enable-pyside-extensions --enable-return-value-heuristic")
enable_testing()
From 89167fa56ebef6e8d596495ad912196f274587da Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Mon, 14 Jun 2010 14:22:55 -0300
Subject: [PATCH 0020/1129] Revert "GENERATOR_EXTRA_FLAGS must be a cmake
string, not a cmake list."
This reverts commit fc059316968e5bdc079a2ebd84800297ecce7d2a.
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ae254b2..4b26d1c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -122,7 +122,7 @@ if (NOT SITE_PACKAGE)
message(FATAL_ERROR "Could not detect Python module installation directory.")
endif()
-set(GENERATOR_EXTRA_FLAGS "--generatorSet=shiboken --enable-parent-ctor-heuristic --enable-pyside-extensions --enable-return-value-heuristic")
+set(GENERATOR_EXTRA_FLAGS --generatorSet=shiboken --enable-parent-ctor-heuristic --enable-pyside-extensions --enable-return-value-heuristic)
enable_testing()
From 4284ae6cc69f6281140d960cfd6d62a94066bf36 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Thu, 10 Jun 2010 15:33:06 -0300
Subject: [PATCH 0021/1129] Fixed thread test to avoid memory leaks.
Reviewer: Hugo Parente Lima ,
Marcelo Lira
---
tests/QtCore/thread_signals_test.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/tests/QtCore/thread_signals_test.py b/tests/QtCore/thread_signals_test.py
index 9eea829..1d2f750 100644
--- a/tests/QtCore/thread_signals_test.py
+++ b/tests/QtCore/thread_signals_test.py
@@ -27,6 +27,7 @@ class TestThreadSignal(UsesQCoreApplication):
t.start()
self.app.exec_()
+ t.wait()
self.assert_(self.__called__);
if __name__ == '__main__':
From 569d1ab60e9b2227b2f4ed407718d17cc179d265 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Mon, 14 Jun 2010 14:59:26 -0300
Subject: [PATCH 0022/1129] Fixed parent function return ownership. Fixed
QMainWindow functions ownership.
Fixes #241.
Reviewer: Hugo Parente Lima ,
Marcelo Lira
---
PySide/QtCore/typesystem_core.xml | 3 ++
PySide/QtGui/typesystem_gui_common.xml | 56 +++++++++++++++++---------
PySide/typesystem_templates.xml | 9 +++++
tests/QtGui/qmainwindow_test.py | 42 +++++++++++++++++++
4 files changed, 92 insertions(+), 18 deletions(-)
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 85694e4..7249338 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -1049,6 +1049,9 @@
+
+
+
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index fac9f56..7509850 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -1260,12 +1260,12 @@
-
-
-
+
+
+
@@ -1689,26 +1689,46 @@
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/PySide/typesystem_templates.xml b/PySide/typesystem_templates.xml
index 3badcf2..46911fa 100644
--- a/PySide/typesystem_templates.xml
+++ b/PySide/typesystem_templates.xml
@@ -1,5 +1,14 @@
+
+ $CHILD_TYPE* oldChild = %CPPSELF.$FUNCTION_GET_OLD();
+ if (oldChild) {
+ Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[$CHILD_TYPE*](oldChild));
+ Shiboken::setParent(NULL, pyChild);
+ }
+ Shiboken::setParent(%PYSELF, $PYARG);
+
+
bool ok_;
diff --git a/tests/QtGui/qmainwindow_test.py b/tests/QtGui/qmainwindow_test.py
index fce145d..372018c 100644
--- a/tests/QtGui/qmainwindow_test.py
+++ b/tests/QtGui/qmainwindow_test.py
@@ -17,6 +17,14 @@ class MainWindow(QtGui.QMainWindow):
pointerToolbar = self.addToolBar("Pointer type")
pointerToolbar.addWidget(pointerButton)
+class MyButton(QtGui.QPushButton):
+ def __init__(self, parent=None):
+ QtGui.QPushButton.__init__(self)
+ self._called = False
+
+ def myCallback(self):
+ self._called = True
+
class TestMainWindow(UsesQApplication):
@@ -26,6 +34,40 @@ class TestMainWindow(UsesQApplication):
QtCore.QTimer.singleShot(1000, self.app.quit)
self.app.exec_()
+ def testRefCountToNull(self):
+ w = QtGui.QMainWindow()
+ c = QtGui.QWidget()
+ self.assertEqual(sys.getrefcount(c), 2)
+ w.setCentralWidget(c)
+ self.assertEqual(sys.getrefcount(c), 3)
+ w.setCentralWidget(None)
+ self.assertEqual(sys.getrefcount(c), 2)
+
+ def testRefCountToAnother(self):
+ w = QtGui.QMainWindow()
+ c = QtGui.QWidget()
+ self.assertEqual(sys.getrefcount(c), 2)
+ w.setCentralWidget(c)
+ self.assertEqual(sys.getrefcount(c), 3)
+
+ c2 = QtGui.QWidget()
+ w.setCentralWidget(c2)
+ self.assertEqual(sys.getrefcount(c), 2)
+ self.assertEqual(sys.getrefcount(c2), 3)
+
+ def testSignalDisconect(self):
+ w = QtGui.QMainWindow()
+ b = MyButton("button")
+ b.clicked.connect(b.myCallback)
+ w.setCentralWidget(b)
+
+ b = MyButton("button")
+ b.clicked.connect(b.myCallback)
+ w.setCentralWidget(b)
+
+ b.click()
+ self.assertEqual(b._called, True)
+
if __name__ == '__main__':
unittest.main()
From 4ace08b64b7165de46d3f774eb15b14d3f94f073 Mon Sep 17 00:00:00 2001
From: Marcelo Lira
Date: Mon, 14 Jun 2010 15:45:00 -0300
Subject: [PATCH 0023/1129] Fixes QString primitive type for Qt 4.7 adding a
default constructor.
Reviewed by Hugo Parente
Reviewed by Luciano Wolf
---
PySide/QtCore/typesystem_core.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 7249338..38f1f56 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -142,7 +142,7 @@
-
+
From 5c6eb8b91309ab5449bc9d0fa77394d393be19b1 Mon Sep 17 00:00:00 2001
From: Luciano Wolf
Date: Mon, 14 Jun 2010 16:59:58 -0300
Subject: [PATCH 0024/1129] Documentation about new API2.
---
doc/pysideapi2.rst | 104 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 104 insertions(+)
create mode 100644 doc/pysideapi2.rst
diff --git a/doc/pysideapi2.rst b/doc/pysideapi2.rst
new file mode 100644
index 0000000..2c111bd
--- /dev/null
+++ b/doc/pysideapi2.rst
@@ -0,0 +1,104 @@
+PySide API 2
+************
+
+Since the beginning one of the PySide goals was to be API compatible with PyQt4,
+but with some (documented) exceptions. For example, PySide will not export to
+Python components marked as deprecated on C++ Qt.
+
+The latest release of PyQt4 came with improvements on the pythonic front, being
+the extinction of QString a good example. PySide followed this change, except in
+one point: while PyQt4 has conserved the old behavior as optional, PySide
+bindings fully adopted the new API - completely removing QString. No turning
+back. Thus remember to update your source code to the new API, this will ensure
+your code will run on both bindings.
+
+
+Changes:
+
+- __hash__() function return value
+- QString
+- QTextStream
+- QVariant
+
+
+__hash__() function return value
+================================
+
+The hash value returned for the classes QDate, QDateTime, QTime, QUrl will be
+based on their string representations, thus objects with the same value will
+produce the same hash.
+
+
+QString
+=======
+
+Methods that change QString arguments
+-------------------------------------
+
+Methods and functions that change the contents of a QString argument were
+modified to receive an immutable Python unicode (or str) and return another
+Python unicode/str as the modified string.
+
+The following methods had their return types modified this way:
+
+**Classes:** QAbstractSpinBox, QDateTimeEdit, QDoubleSpinBox, QSpinBox, QValidator
+
+Method / Return type
+
+- *fixup(string)*: string
+- *validate(string, int)*: [QValidator.State, string, int]
+
+
+**Classes:** QDoubleValidator, QIntValidator, QRegExpValidator
+
+Method / Return type
+
+- *validate(string, int)*: [QValidator.State, string, int]
+
+**Class:** QClipboard
+
+Method / Return type
+
+- *text(string, QClipboard.Mode mode=QClipboard.Clipboard)*: [string, string]
+
+
+**Class:** QFileDialog
+
+Instead of *getOpenFileNameAndFilter()*, *getOpenFileNamesAndFilter()* and *getSaveFileNameAndFilter()* like PyQt4 does,
+PySide has modified the original methods to return a tuple.
+
+Method / Return type
+
+- *getOpenFileName(QWidget parent=None, str caption=None, str dir=None, str filter=None, QFileDialog.Options options=0)*: [string, filter]
+- *getOpenFileNames(QWidget parent=None, str caption=None, str dir=None, str filter=None, QFileDialog.Options options=0)*: [list(string), filter]
+- *getSaveFileName(QWidget parent=None, str caption=None, str dir=None, str filter=None, QFileDialog.Options options=0)*: [string, filter]
+
+**Class:** QWebPage
+
+Method / Return type
+
+- *javaScriptPrompt(QWebFrame, string, string)*: [bool, string]
+
+Other QString related changes
+-----------------------------
+
+**Classes:** QFontMetrics and QFontMetricsF
+
+They had two new methods added. Both take a string of one character and convert to a QChar (to call the C++ counterpart):
+
+- widthChar(string)
+- boundingRectChar(string)
+
+
+QTextStream
+===========
+
+Inside this class some renames were applied to avoid clashes with native Python functions. They are: *bin_()*, *hex_()* and *oct_()*.
+The only modification was the addition of '_' character.
+
+
+QVariant
+========
+
+As QVariant was removed, any function expecting it can receive any Python object (None is an invalid QVariant). The same rule is valid when returning something: the returned QVariant will be converted to the its original Python object type.
+
From 59d42297fd1eed28f9249a9c9a4c5b9fa33fc00f Mon Sep 17 00:00:00 2001
From: Luciano Wolf
Date: Tue, 15 Jun 2010 17:38:35 -0300
Subject: [PATCH 0025/1129] Updating API2 documentation.
---
doc/pysideapi2.rst | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/doc/pysideapi2.rst b/doc/pysideapi2.rst
index 2c111bd..3aaee45 100644
--- a/doc/pysideapi2.rst
+++ b/doc/pysideapi2.rst
@@ -3,9 +3,10 @@ PySide API 2
Since the beginning one of the PySide goals was to be API compatible with PyQt4,
but with some (documented) exceptions. For example, PySide will not export to
-Python components marked as deprecated on C++ Qt.
+Python components marked as deprecated on C++ Qt. All the modifications follow
+the `PSEP101 `_ as its guideline.
-The latest release of PyQt4 came with improvements on the pythonic front, being
+The release 4.7 of PyQt4 came with improvements on the pythonic front, being
the extinction of QString a good example. PySide followed this change, except in
one point: while PyQt4 has conserved the old behavior as optional, PySide
bindings fully adopted the new API - completely removing QString. No turning
@@ -43,22 +44,16 @@ The following methods had their return types modified this way:
**Classes:** QAbstractSpinBox, QDateTimeEdit, QDoubleSpinBox, QSpinBox, QValidator
-Method / Return type
-
- *fixup(string)*: string
- *validate(string, int)*: [QValidator.State, string, int]
**Classes:** QDoubleValidator, QIntValidator, QRegExpValidator
-Method / Return type
-
- *validate(string, int)*: [QValidator.State, string, int]
**Class:** QClipboard
-Method / Return type
-
- *text(string, QClipboard.Mode mode=QClipboard.Clipboard)*: [string, string]
@@ -67,16 +62,12 @@ Method / Return type
Instead of *getOpenFileNameAndFilter()*, *getOpenFileNamesAndFilter()* and *getSaveFileNameAndFilter()* like PyQt4 does,
PySide has modified the original methods to return a tuple.
-Method / Return type
-
- *getOpenFileName(QWidget parent=None, str caption=None, str dir=None, str filter=None, QFileDialog.Options options=0)*: [string, filter]
- *getOpenFileNames(QWidget parent=None, str caption=None, str dir=None, str filter=None, QFileDialog.Options options=0)*: [list(string), filter]
- *getSaveFileName(QWidget parent=None, str caption=None, str dir=None, str filter=None, QFileDialog.Options options=0)*: [string, filter]
**Class:** QWebPage
-Method / Return type
-
- *javaScriptPrompt(QWebFrame, string, string)*: [bool, string]
Other QString related changes
From ef291779fdb7f959efa26cde84e9ff251507399e Mon Sep 17 00:00:00 2001
From: Luciano Wolf
Date: Tue, 15 Jun 2010 18:30:10 -0300
Subject: [PATCH 0026/1129] Updating QVariant description inside API2 document.
---
doc/pysideapi2.rst | 1 +
1 file changed, 1 insertion(+)
diff --git a/doc/pysideapi2.rst b/doc/pysideapi2.rst
index 3aaee45..c7c5ac5 100644
--- a/doc/pysideapi2.rst
+++ b/doc/pysideapi2.rst
@@ -93,3 +93,4 @@ QVariant
As QVariant was removed, any function expecting it can receive any Python object (None is an invalid QVariant). The same rule is valid when returning something: the returned QVariant will be converted to the its original Python object type.
+When a method expects a *QVariant::Type* the programmer can use a string (the type name) or the type itself.
From a103f6bb83ca1664a093583daf5a6c658de19840 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Tue, 15 Jun 2010 20:15:22 -0300
Subject: [PATCH 0027/1129] Remove invalid function modifications from
typesystem.
---
PySide/QtCore/typesystem_core.xml | 2 --
1 file changed, 2 deletions(-)
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 38f1f56..1ba86e4 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -1882,7 +1882,6 @@
-
@@ -1895,7 +1894,6 @@
-
From 7fc3d5137ffa9a5df57ae84e739e4d4fbb6251b6 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Tue, 15 Jun 2010 20:15:56 -0300
Subject: [PATCH 0028/1129] Add suppress message for yet another weird message
from the C++ parser.
---
PySide/QtCore/typesystem_core.xml | 1 +
PySide/QtGui/typesystem_gui_common.xml | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 1ba86e4..8555f65 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -2478,4 +2478,5 @@
+
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index 7509850..4a9e955 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -4700,5 +4700,5 @@
-
+
From 13b61ca7e55f52b501de9e028d2d7048836979ba Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Tue, 15 Jun 2010 20:17:29 -0300
Subject: [PATCH 0029/1129] Rename error() method to avoid name clash with the
error signal.
---
PySide/QtNetwork/typesystem_network.xml | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/PySide/QtNetwork/typesystem_network.xml b/PySide/QtNetwork/typesystem_network.xml
index d3f330e..596aa2c 100644
--- a/PySide/QtNetwork/typesystem_network.xml
+++ b/PySide/QtNetwork/typesystem_network.xml
@@ -169,7 +169,11 @@
-
+
+
+
+
+
From 0eb8d670c240b5ea621dba6271139f30cc97790a Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Tue, 15 Jun 2010 20:26:24 -0300
Subject: [PATCH 0030/1129] Added QVariant::Type as a primitive type.
Reviewer: Marcelo Lira
Luciano Wolf
---
PySide/QtCore/qstring_conversions.h | 6 +++
PySide/QtCore/qvariant_type_conversions.h | 53 +++++++++++++++++++++++
PySide/QtCore/typesystem_core.xml | 3 ++
tests/QtSql/CMakeLists.txt | 1 +
tests/QtSql/qvarianttype_test.py | 36 +++++++++++++++
5 files changed, 99 insertions(+)
create mode 100644 PySide/QtCore/qvariant_type_conversions.h
create mode 100644 tests/QtSql/qvarianttype_test.py
diff --git a/PySide/QtCore/qstring_conversions.h b/PySide/QtCore/qstring_conversions.h
index 04b46f4..d0006b8 100644
--- a/PySide/QtCore/qstring_conversions.h
+++ b/PySide/QtCore/qstring_conversions.h
@@ -1,5 +1,11 @@
namespace Shiboken {
+template<>
+inline PyTypeObject* SbkType()
+{
+ return &PyUnicode_Type;
+}
+
template<>
struct Converter
{
diff --git a/PySide/QtCore/qvariant_type_conversions.h b/PySide/QtCore/qvariant_type_conversions.h
new file mode 100644
index 0000000..107fb42
--- /dev/null
+++ b/PySide/QtCore/qvariant_type_conversions.h
@@ -0,0 +1,53 @@
+namespace Shiboken {
+
+template<>
+struct Converter
+{
+ static bool checkType(PyObject* pyObj)
+ {
+ return pyObj == Py_None || PyType_Check(pyObj) || Converter::checkType(pyObj);
+ }
+
+ static bool isConvertible(PyObject* pyObj)
+ {
+ return checkType(pyObj);
+ }
+
+ static QVariant::Type toCpp(PyObject* pyObj)
+ {
+ const char* typeName;
+ if (pyObj == Py_None)
+ return QVariant::Invalid;
+
+ if (pyObj == reinterpret_cast(&PyString_Type) || pyObj == reinterpret_cast(&PyUnicode_Type))
+ typeName = "QString";
+ else if (pyObj == reinterpret_cast(&PyFloat_Type))
+ typeName = "double"; // float is a UserType in QVariant.
+ else if (pyObj == reinterpret_cast(&PyLong_Type))
+ typeName = "int"; // long is a UserType in QVariant.
+ else if (PyType_Check(pyObj))
+ typeName = reinterpret_cast(pyObj)->tp_name;
+ else if (PyString_Check(pyObj))
+ typeName = PyString_AS_STRING(pyObj);
+ else if (PyUnicode_Check(pyObj))
+ typeName = PyString_AsString(pyObj);
+
+ return QVariant::nameToType(typeName);
+ }
+
+ static PyObject* toPython(void* cppObj) { return toPython(*reinterpret_cast(cppObj)); }
+ static PyObject* toPython(const QVariant::Type& cppObj)
+ {
+ const char* typeName = QVariant::typeToName(cppObj);
+ PyObject* pyObj;
+ if (!typeName) {
+ pyObj = Py_None;
+ } else {
+ Shiboken::TypeResolver* tr = Shiboken::TypeResolver::get(typeName);
+ pyObj = tr ? reinterpret_cast(tr->pythonType()) : Py_None;
+ }
+ Py_INCREF(pyObj);
+ return pyObj;
+ }
+};
+}
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 8555f65..5331fa9 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -161,6 +161,9 @@
+
+
+
diff --git a/tests/QtSql/CMakeLists.txt b/tests/QtSql/CMakeLists.txt
index a944691..25fba44 100644
--- a/tests/QtSql/CMakeLists.txt
+++ b/tests/QtSql/CMakeLists.txt
@@ -1 +1,2 @@
PYSIDE_TEST(qsqldatabaseandqueries_test.py)
+PYSIDE_TEST(qvarianttype_test.py)
diff --git a/tests/QtSql/qvarianttype_test.py b/tests/QtSql/qvarianttype_test.py
new file mode 100644
index 0000000..7eae67f
--- /dev/null
+++ b/tests/QtSql/qvarianttype_test.py
@@ -0,0 +1,36 @@
+'''Test cases for QVariant::Type converter'''
+import unittest
+from PySide.QtCore import *
+from PySide.QtSql import *
+
+class QVariantTypeTest(unittest.TestCase):
+ def testQVariantType(self):
+ f = QSqlField("name", unicode)
+ self.assertEqual(f.type(), unicode)
+
+ f = QSqlField("name", str)
+ self.assertEqual(f.type(), unicode)
+
+ f = QSqlField("name", "QString")
+ self.assertEqual(f.type(), unicode)
+
+ f = QSqlField("name", "double")
+ self.assertEqual(f.type(), float)
+
+ f = QSqlField("name", float)
+ self.assertEqual(f.type(), float)
+
+ f = QSqlField("name", int)
+ self.assertEqual(f.type(), int)
+
+ f = QSqlField("name", long)
+ self.assertEqual(f.type(), int) # long isn't registered in QVariant:Type, just in QMetaType::Type
+
+ #f = QSqlField("name", QObject)
+ #self.assertEqual(f.type(), None)
+
+ f = QSqlField("name", None)
+ self.assertEqual(f.type(), None)
+
+if __name__ == '__main__':
+ unittest.main()
From e0c46d67613fe8c38c3bee6b99ae58260cb33260 Mon Sep 17 00:00:00 2001
From: Luciano Wolf
Date: Mon, 14 Jun 2010 16:56:36 -0300
Subject: [PATCH 0031/1129] Implementing API2 modifications.
Reviewer: Hugo Parente Lima ,
Marcelo Lira
---
PySide/QtGui/typesystem_gui_common.xml | 158 +++++++++++++++++++++++--
PySide/QtWebKit/typesystem_webkit.xml | 12 +-
PySide/typesystem_templates.xml | 14 +++
tests/QtGui/CMakeLists.txt | 1 +
tests/QtGui/api2_test.py | 60 ++++++++++
tests/QtGui/qobject_mi_test.py | 6 +-
6 files changed, 239 insertions(+), 12 deletions(-)
create mode 100644 tests/QtGui/api2_test.py
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index 4a9e955..92856d9 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -1507,7 +1507,16 @@
-
+
+
+
+
+
+
+
+
+
+
@@ -1633,7 +1642,16 @@
-
+
+
+
+
+
+
+
+
+
+
@@ -1950,7 +1968,16 @@
-
+
+
+
+
+
+
+
+
+
+
@@ -2214,7 +2241,24 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -3308,6 +3352,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -3460,6 +3520,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -3546,9 +3622,30 @@
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -3663,11 +3760,22 @@
-
+
-
+
+
+
+
+
+
+
+
+ %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, %2);
+ %PYARG_0 = Shiboken::makeTuple(retval_, %1);
+
+
@@ -3923,6 +4031,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -3933,6 +4057,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PySide/QtWebKit/typesystem_webkit.xml b/PySide/QtWebKit/typesystem_webkit.xml
index dd3b5ba..a08b183 100644
--- a/PySide/QtWebKit/typesystem_webkit.xml
+++ b/PySide/QtWebKit/typesystem_webkit.xml
@@ -46,7 +46,17 @@
-
+
+
+
+
+
+
+ %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, %4);
+ %PYARG_0 = Shiboken::makeTuple(retval_, %4);
+
+
+
diff --git a/PySide/typesystem_templates.xml b/PySide/typesystem_templates.xml
index 46911fa..8bc9eb5 100644
--- a/PySide/typesystem_templates.xml
+++ b/PySide/typesystem_templates.xml
@@ -148,5 +148,19 @@
_ret = %CPPSELF.%FUNCTION_NAME(%1, &a, &b);
%PYARG_0 = Shiboken::makeTuple(_ret, a, b);
+
+
+ %PYARG_0 = %CONVERTTOPYTHON[QString](%1);
+
+
+
+ %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, %2);
+ %PYARG_0 = Shiboken::makeTuple(retval_, %1, %2);
+
+
+
+ %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, %2);
+ %PYARG_0 = Shiboken::makeTuple(retval_, %1, %2);
+
diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt
index d2d89ee..5d1cec4 100644
--- a/tests/QtGui/CMakeLists.txt
+++ b/tests/QtGui/CMakeLists.txt
@@ -1,3 +1,4 @@
+PYSIDE_TEST(api2_test.py)
PYSIDE_TEST(add_action_test.py)
PYSIDE_TEST(customproxywidget_test.py)
PYSIDE_TEST(float_to_int_implicit_conversion_test.py)
diff --git a/tests/QtGui/api2_test.py b/tests/QtGui/api2_test.py
new file mode 100644
index 0000000..e458d8b
--- /dev/null
+++ b/tests/QtGui/api2_test.py
@@ -0,0 +1,60 @@
+'''Test cases for PySide API2 support'''
+
+
+import unittest
+
+from PySide.QtCore import QObject
+from PySide.QtGui import *
+
+from helper import UsesQApplication
+
+class WidgetValidatorQInt(QWidget, QIntValidator):
+ def __init__(self, parent=None):
+ QWidget.__init__(self, parent)
+ QIntValidator.__init__(self, parent)
+
+class WidgetValidatorQSpinBox(QSpinBox):
+ def __init__(self, parent=None):
+ QSpinBox.__init__(self, parent)
+
+ def fixup(self, text):
+ print "It was called!"
+
+class DoubleQObjectInheritanceTest(UsesQApplication):
+
+ def testDouble(self):
+ '''Double inheritance from QObject classes'''
+
+ obj = WidgetValidatorQInt()
+
+ #QIntValidator methods
+ state, string, number = obj.validate('Test', 0)
+ self.assertEqual(state, QValidator.Invalid)
+ state, string, number = obj.validate('33', 0)
+ self.assertEqual(state, QValidator.Acceptable)
+
+ def testQSpinBox(self):
+ obj = WidgetValidatorQSpinBox()
+
+ obj.setRange(1, 10)
+ obj.setValue(0)
+ print "Value:", obj.value()
+
+class QClipboardTest(UsesQApplication):
+
+ def testQClipboard(self):
+ clip = QClipboard()
+ clip.setText("Testing this thing!")
+
+ text, subtype = clip.text("")
+ self.assertEqual(subtype, "plain")
+ self.assertEqual(text, "Testing this thing!")
+
+#class QFileDialog(UsesQApplication):
+#
+# def testQFileDialog(self):
+# string, filtr = QFileDialog.getOpenFileName()
+# print string, filtr
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/tests/QtGui/qobject_mi_test.py b/tests/QtGui/qobject_mi_test.py
index 8ccc1d3..28b3cbd 100644
--- a/tests/QtGui/qobject_mi_test.py
+++ b/tests/QtGui/qobject_mi_test.py
@@ -29,8 +29,10 @@ class DoubleQObjectInheritanceTest(UsesQApplication):
self.assertFalse(obj.isVisible())
#QIntValidator methods
- self.assertEqual(obj.validate('aaaa', 0), QValidator.Invalid)
- self.assertEqual(obj.validate('33', 0), QValidator.Acceptable)
+ state, string, number = obj.validate('aaaa', 0)
+ self.assertEqual(state, QValidator.Invalid)
+ state, string, number = obj.validate('33', 0)
+ self.assertEqual(state, QValidator.Acceptable)
if __name__ == '__main__':
From ab40ddbb2f06ceaceda886d386583f25e03cd640 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Wed, 16 Jun 2010 14:55:26 -0300
Subject: [PATCH 0032/1129] Fix LD_LIBRARY_PATH variable to be possible to run
tests when using CMAKE_SKIP_RPATH=true
---
tests/CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index d446151..7938ea7 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -16,7 +16,7 @@ macro(PYSIDE_TEST)
else()
message(WARNING "Ivalid call of macro PYSIDE_TEST")
endif()
- set(TEST_CMD ${CMAKE_SOURCE_DIR}/tests/run_test.sh ${CMAKE_BINARY_DIR} "${CMAKE_BINARY_DIR}:${CMAKE_SOURCE_DIR}/tests/util" ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/${ARGV0}")
+ set(TEST_CMD ${CMAKE_SOURCE_DIR}/tests/run_test.sh ${libpyside_BINARY_DIR} "${CMAKE_BINARY_DIR}:${CMAKE_SOURCE_DIR}/tests/util" ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/${ARGV0}")
add_test(${TEST_NAME} ${TEST_CMD})
set_tests_properties(${TEST_NAME} PROPERTIES
TIMEOUT ${PYSIDE_TIMEOUT}
From cdde96f3a4c12c03ec8272d1e75c2f4a30e29cf6 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Wed, 16 Jun 2010 14:56:29 -0300
Subject: [PATCH 0033/1129] Add a default constructor value to QVariant::Type.
Reviewer: Marcelo Lira
Luciano Wolf
---
PySide/QtCore/typesystem_core.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 5331fa9..8b1bab6 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -161,7 +161,7 @@
-
+
From ef7eb0fca443ca1df624034c6e6ede597f2dab3c Mon Sep 17 00:00:00 2001
From: Luciano Wolf
Date: Wed, 16 Jun 2010 18:16:17 -0300
Subject: [PATCH 0034/1129] Fix the template used by QFileDialog methods.
Reviewer: Hugo Parente Lima ,
Marcelo Lira
---
PySide/typesystem_templates.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/PySide/typesystem_templates.xml b/PySide/typesystem_templates.xml
index 8bc9eb5..40e2345 100644
--- a/PySide/typesystem_templates.xml
+++ b/PySide/typesystem_templates.xml
@@ -159,8 +159,8 @@
- %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, %2);
- %PYARG_0 = Shiboken::makeTuple(retval_, %1, %2);
+ %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, %4, %5);
+ %PYARG_0 = Shiboken::makeTuple(retval_, %4);
From 4cca85f52585b17f53e26f81ca26504fe561e578 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Tue, 15 Jun 2010 13:34:42 -0300
Subject: [PATCH 0035/1129] Implement inject-code to functions using QChar in
QFontMetrics and QFontMetricsF
Reviewer: Luciano Wolf
Marcelo Lira
---
PySide/QtGui/typesystem_gui_common.xml | 48 ++++++++++++++++++++++++++
tests/QtGui/qfontmetrics_test.py | 10 ++++++
2 files changed, 58 insertions(+)
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index 92856d9..7a6f2b0 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -1,5 +1,16 @@
+
+ int size = PyString_GET_SIZE(%PYARG_1);
+ if (size == 1) {
+ char *str = PyString_AS_STRING(%PYARG_1);
+ QChar ch(str[0]);
+ %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%CPPSELF.%FUNCTION_NAME(ch));
+ } else {
+ PyErr_SetString(PyExc_TypeError, "String must have only one character");
+ }
+
+
@@ -1057,6 +1068,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1118,6 +1147,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/QtGui/qfontmetrics_test.py b/tests/QtGui/qfontmetrics_test.py
index 7964d91..96c022f 100644
--- a/tests/QtGui/qfontmetrics_test.py
+++ b/tests/QtGui/qfontmetrics_test.py
@@ -185,5 +185,15 @@ class FSizeTest(QFontMetricsFTest):
'PySide by INdT', 20, ['aaaa', 'ase'])
+class QCharTest(QFontMetricsFTest):
+
+ def testBoundingRect(self):
+ retCh = self.metrics.boundingRectChar('a')
+ self.assertEqual(type(retCh), QRectF)
+
+ def testWith(self):
+ retCh = self.metrics.widthChar('a')
+ self.assert_(retCh > 0)
+
if __name__ == '__main__':
unittest.main()
From 83cf37f609ca3adb343be090054188dc254b9741 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Wed, 16 Jun 2010 13:52:09 -0300
Subject: [PATCH 0036/1129] Create unit-test for signal with QObject.
Reviewer: Hugo Parente Lima ,
Luciano Wolf
---
libpyside/qsignal.cpp | 8 ++++++--
libpyside/signalmanager.cpp | 13 ++++++++++---
tests/signals/signal_object_test.py | 13 ++++++++++---
3 files changed, 26 insertions(+), 8 deletions(-)
diff --git a/libpyside/qsignal.cpp b/libpyside/qsignal.cpp
index 1edc13c..43c02f1 100644
--- a/libpyside/qsignal.cpp
+++ b/libpyside/qsignal.cpp
@@ -246,7 +246,12 @@ char* signal_get_type_name(PyObject* type)
if (PyType_Check(type)) {
//tp_name return the full name
Shiboken::AutoDecRef typeName(PyObject_GetAttrString(type, "__name__"));
- return strdup(PyString_AS_STRING(typeName.object()));
+ char *aux = strdup(PyString_AS_STRING(typeName.object()));
+ if (Shiboken::TypeResolver::getType(aux) == Shiboken::TypeResolver::ObjectType) {
+ aux = reinterpret_cast(realloc(aux, strlen(aux) + 1));
+ aux = strcat(aux, "*");
+ }
+ return aux;
} else if (PyString_Check(type)) {
return strdup(PyString_AS_STRING(type));
}
@@ -281,7 +286,6 @@ char* signal_parse_signature(PyObject *args)
}
}
}
-
return signature;
}
diff --git a/libpyside/signalmanager.cpp b/libpyside/signalmanager.cpp
index 7ac3f30..6ea05c9 100644
--- a/libpyside/signalmanager.cpp
+++ b/libpyside/signalmanager.cpp
@@ -253,7 +253,12 @@ static bool emitNormalSignal(QObject* source, int signalIndex, const char* signa
for (i = 0; i < argsGiven; ++i) {
Shiboken::TypeResolver* typeResolver = Shiboken::TypeResolver::get(qPrintable(argTypes[i]));
if (typeResolver) {
- signalArgs[i+1] = typeResolver->toCpp(PySequence_Fast_GET_ITEM(sequence.object(), i));
+ void *data = typeResolver->toCpp(PySequence_Fast_GET_ITEM(sequence.object(), i));
+ if (Shiboken::TypeResolver::getType(qPrintable(argTypes[i])) == Shiboken::TypeResolver::ObjectType) {
+ signalArgs[i+1] = &data;
+ } else {
+ signalArgs[i+1] = data;
+ }
} else {
PyErr_Format(PyExc_TypeError, "Unknown type used to emit a signal: %s", qPrintable(argTypes[i]));
break;
@@ -289,7 +294,6 @@ bool SignalManager::emitSignal(QObject* source, const char* signal, PyObject* ar
else
return emitNormalSignal(source, signalIndex, signal, args, argTypes);
}
- qDebug() << "Signal" << signal << "not found, probably a typo or you are emitting a dynamic signal that has never been used in a connection until now.";
return false;
}
@@ -316,7 +320,10 @@ int PySide::SignalManager::qt_metacall(QObject* object, QMetaObject::Call call,
Shiboken::AutoDecRef preparedArgs(PyTuple_New(paramTypes.count()));
for (int i = 0, max = paramTypes.count(); i < max; ++i) {
- PyObject* arg = Shiboken::TypeResolver::get(paramTypes[i].constData())->toPython(args[i+1]);
+ void* data = args[i+1];
+ const char* dataType = paramTypes[i].constData();
+
+ PyObject* arg = Shiboken::TypeResolver::get(dataType)->toPython(data);
PyTuple_SET_ITEM(preparedArgs.object(), i, arg);
}
diff --git a/tests/signals/signal_object_test.py b/tests/signals/signal_object_test.py
index d36665c..1b1f222 100644
--- a/tests/signals/signal_object_test.py
+++ b/tests/signals/signal_object_test.py
@@ -13,7 +13,7 @@ class MyObject(QTimer):
sig3 = Signal(int)
sig4 = Signal((int,), (unicode,))
sig5 = Signal((unicode,), (int,))
-
+ sig6 = Signal(QObject)
@Slot(int)
def myRange(self, r):
@@ -25,6 +25,9 @@ class MyObject(QTimer):
def slotString(self, s):
self._s = s
+ def slotObject(self, o):
+ self._o = o
+
class SignalObjectTest(UsesQCoreApplication):
def cb(self):
@@ -75,8 +78,12 @@ class SignalObjectTest(UsesQCoreApplication):
o.sig5[int].emit(10)
self.assertEqual(o._range, 10)
-
-
+ def testSignalWithObject(self):
+ o = MyObject()
+ o.sig6.connect(o.slotObject)
+ arg = QObject()
+ o.sig6.emit(arg)
+ self.assertEqual(arg, o._o)
if __name__ == '__main__':
unittest.main()
From cf90354ff99bc90ecfc6ea57e3cbddcad6bab9a1 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Wed, 16 Jun 2010 17:45:09 -0300
Subject: [PATCH 0037/1129] Create QAction signal test.
Reviewer: Hugo Parente Lima ,
Luciano Wolf
---
tests/QtGui/CMakeLists.txt | 3 +++
tests/QtGui/qaction_test.py | 22 ++++++++++++++++++++++
2 files changed, 25 insertions(+)
create mode 100644 tests/QtGui/qaction_test.py
diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt
index 5d1cec4..5ff4579 100644
--- a/tests/QtGui/CMakeLists.txt
+++ b/tests/QtGui/CMakeLists.txt
@@ -1,3 +1,5 @@
+#Keep this in alphabetical sort
+
PYSIDE_TEST(api2_test.py)
PYSIDE_TEST(add_action_test.py)
PYSIDE_TEST(customproxywidget_test.py)
@@ -14,6 +16,7 @@ PYSIDE_TEST(qapplication_singleton_test.py)
PYSIDE_TEST(qapp_test.py)
PYSIDE_TEST(qbrush_test.py)
PYSIDE_TEST(qcolor_test.py)
+PYSIDE_TEST(qaction_test.py)
PYSIDE_TEST(qdatastream_gui_operators_test.py)
PYSIDE_TEST(qfontdialog_test.py)
PYSIDE_TEST(qfontmetrics_test.py)
diff --git a/tests/QtGui/qaction_test.py b/tests/QtGui/qaction_test.py
new file mode 100644
index 0000000..b926ad6
--- /dev/null
+++ b/tests/QtGui/qaction_test.py
@@ -0,0 +1,22 @@
+import unittest
+
+from PySide.QtGui import QAction, QWidget
+from helper import UsesQApplication
+
+class QPainterDrawText(UsesQApplication):
+
+ def _cb(self, checked):
+ self._called = True
+
+ def testSignal(self):
+ o = QWidget()
+ act = QAction(o)
+ self._called = False
+ act.triggered.connect(self._cb)
+ act.trigger()
+ self.assert_(self._called)
+
+
+if __name__ == '__main__':
+ unittest.main()
+
From d699a3abedfe60e7146fad8381b03687ce476699 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Wed, 16 Jun 2010 18:03:07 -0300
Subject: [PATCH 0038/1129] Created test for Connection between new Signal API
and Slots
Reviewer: Hugo Parente Lima ,
Luciano Wolf
---
tests/QtGui/CMakeLists.txt | 1 +
tests/QtGui/qtextedit_signal_test.py | 37 ++++++++++++++++++++++++++++
2 files changed, 38 insertions(+)
create mode 100644 tests/QtGui/qtextedit_signal_test.py
diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt
index 5ff4579..5f50ea8 100644
--- a/tests/QtGui/CMakeLists.txt
+++ b/tests/QtGui/CMakeLists.txt
@@ -48,6 +48,7 @@ PYSIDE_TEST(qstyle_test.py)
PYSIDE_TEST(qtableview_test.py)
PYSIDE_TEST(qtabwidget_test.py)
PYSIDE_TEST(qtextedit_test.py)
+PYSIDE_TEST(qtextedit_signal_test.py)
PYSIDE_TEST(qtoolbar_test.py)
PYSIDE_TEST(qtoolbox_test.py)
PYSIDE_TEST(qwidget_setlayout_test.py)
diff --git a/tests/QtGui/qtextedit_signal_test.py b/tests/QtGui/qtextedit_signal_test.py
new file mode 100644
index 0000000..3195e0e
--- /dev/null
+++ b/tests/QtGui/qtextedit_signal_test.py
@@ -0,0 +1,37 @@
+from PySide import QtGui, QtCore
+from helper import UsesQApplication
+
+import unittest
+
+class MyWindow(QtGui.QMainWindow):
+ appendText = QtCore.Signal(str)
+
+ @QtCore.Slot()
+ def onButtonPressed(self):
+ self.appendText.emit("PySide")
+
+ def __init__(self, parent=None):
+ super(MyWindow, self).__init__(parent)
+
+ self.textEdit = QtGui.QTextEdit()
+ self.btn = QtGui.QPushButton("ClickMe")
+ self.btn.clicked.connect(self.onButtonPressed)
+ self.appendText.connect(self.textEdit.append)
+
+ def start(self):
+ self.btn.click()
+
+ def text(self):
+ return self.textEdit.toPlainText()
+
+
+class testSignalWithCPPSlot(UsesQApplication):
+
+ def testEmission(self):
+ w = MyWindow()
+ w.start()
+ self.assertEqual(w.text(), "PySide")
+
+if __name__ == '__main__':
+ unittest.main()
+
From 6b70a1362ccfd140617c610e52f2abbbbe08afc4 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Thu, 17 Jun 2010 14:02:29 -0300
Subject: [PATCH 0039/1129] Fixed signal connection with native slot.
Reviewer: Hugo Parente Lima ,
Luciano Wolf
---
PySide/QtCore/glue/qobject_connect.cpp | 4 +--
libpyside/signalmanager.cpp | 41 ++++++++++++++++++--------
libpyside/signalmanager.h | 2 +-
3 files changed, 31 insertions(+), 16 deletions(-)
diff --git a/PySide/QtCore/glue/qobject_connect.cpp b/PySide/QtCore/glue/qobject_connect.cpp
index 5b6f254..e9de411 100644
--- a/PySide/QtCore/glue/qobject_connect.cpp
+++ b/PySide/QtCore/glue/qobject_connect.cpp
@@ -56,7 +56,7 @@ static bool qobjectConnectCallback(QObject* source, const char* signal, PyObject
return false;
const QMetaObject* metaObject = receiver->metaObject();
- const QByteArray callbackSig = PySide::getCallbackSignature(signal, callback, usingGlobalReceiver).toAscii();
+ const QByteArray callbackSig = PySide::getCallbackSignature(signal, receiver, callback, usingGlobalReceiver).toAscii();
const char* slot = callbackSig.constData();
int slotIndex = metaObject->indexOfSlot(slot);
if (slotIndex == -1) {
@@ -103,7 +103,7 @@ static bool qobjectDisconnectCallback(QObject* source, const char* signal, PyObj
return false;
const QMetaObject* metaObject = receiver->metaObject();
- const QByteArray callbackSig = PySide::getCallbackSignature(signal, callback, usingGlobalReceiver).toAscii();
+ const QByteArray callbackSig = PySide::getCallbackSignature(signal, receiver, callback, usingGlobalReceiver).toAscii();
QByteArray qtSlotName(callbackSig);
qtSlotName = qtSlotName.prepend('1');
diff --git a/libpyside/signalmanager.cpp b/libpyside/signalmanager.cpp
index 6ea05c9..d44743c 100644
--- a/libpyside/signalmanager.cpp
+++ b/libpyside/signalmanager.cpp
@@ -104,12 +104,13 @@ static QString codeCallbackName(PyObject* callback, const QString& funcName)
return funcName+QString::number(quint64(callback), 16);
}
-QString PySide::getCallbackSignature(const char* signal, PyObject* callback, bool encodeName)
+QString PySide::getCallbackSignature(const char* signal, QObject* receiver, PyObject* callback, bool encodeName)
{
QString functionName;
+ QString signature;
+ QStringList args;
int numArgs = -1;
bool useSelf = false;
-
bool isMethod = PyMethod_Check(callback);
bool isFunction = PyFunction_Check(callback);
@@ -123,25 +124,41 @@ QString PySide::getCallbackSignature(const char* signal, PyObject* callback, boo
functionName = ((PyCFunctionObject*)callback)->m_ml->ml_name;
useSelf = ((PyCFunctionObject*)callback)->m_self;
int flags = ((PyCFunctionObject*)callback)->m_ml->ml_flags;
- if (flags & METH_O)
- numArgs = 1;
- else if (flags & METH_VARARGS)
- numArgs = -1;
- else if (flags & METH_NOARGS)
- numArgs = 0;
+
+ if (receiver) {
+ //Search for signature on metaobject
+ const QMetaObject *mo = receiver->metaObject();
+ for(int i=0; i < mo->methodCount(); i++) {
+ QMetaMethod me = mo->method(i);
+ if (QString(me.signature()).startsWith(functionName)) {
+ numArgs = me.parameterTypes().size()+1;
+ break;
+ }
+ }
+ }
+
+ if (numArgs == -1) {
+ if (flags & METH_O)
+ numArgs = 1;
+ else if (flags & METH_VARARGS)
+ numArgs = -1;
+ else if (flags & METH_NOARGS)
+ numArgs = 0;
+ }
} else if (PyCallable_Check(callback)) {
functionName = "__callback"+QString::number((size_t)callback);
}
+
Q_ASSERT(!functionName.isEmpty());
- QString signature;
+ bool isShortCircuit = false;
+
if (encodeName)
signature = codeCallbackName(callback, functionName);
else
signature = functionName;
- bool isShortCircuit;
- QStringList args = getArgsFromSignature(signal, &isShortCircuit);
+ args = getArgsFromSignature(signal, &isShortCircuit);
if (!isShortCircuit) {
signature.append('(');
@@ -313,10 +330,8 @@ int PySide::SignalManager::qt_metacall(QObject* object, QMetaObject::Call call,
} else {
// call python slot
Shiboken::GilState gil;
-
QList paramTypes = method.parameterTypes();
PyObject* self = Shiboken::BindingManager::instance().retrieveWrapper(object);
-
Shiboken::AutoDecRef preparedArgs(PyTuple_New(paramTypes.count()));
for (int i = 0, max = paramTypes.count(); i < max; ++i) {
diff --git a/libpyside/signalmanager.h b/libpyside/signalmanager.h
index 9687dcc..70d7f08 100644
--- a/libpyside/signalmanager.h
+++ b/libpyside/signalmanager.h
@@ -59,7 +59,7 @@ private:
PYSIDE_API bool isSignal(const char* signal);
PYSIDE_API bool checkSignal(const char* signal);
-PYSIDE_API QString getCallbackSignature(const char* signal, PyObject* callback, bool encodeName);
+PYSIDE_API QString getCallbackSignature(const char* signal, QObject* receiver, PyObject* callback, bool encodeName);
QStringList getArgsFromSignature(const char* signature, bool* isShortCircuit = 0);
class PYSIDE_API SignalManager
From e34105a7499fe1c2edd6fbee6dc2acb3993f5827 Mon Sep 17 00:00:00 2001
From: Luciano Wolf
Date: Thu, 17 Jun 2010 16:07:15 -0300
Subject: [PATCH 0040/1129] Fix phonon test
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Now it checks for ogg backend before playing. The timeout was moved
to 10s to avoid phonon timeout.
Reviewer: Marcelo Lira
Renato Araújo
---
tests/CMakeLists.txt | 2 +-
tests/phonon/basic_playing_test.py | 12 ++++++++----
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 7938ea7..c1a0376 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -1,4 +1,4 @@
-set(PYSIDE_TIMEOUT 5)
+set(PYSIDE_TIMEOUT 10)
macro(TEST_QT_MODULE var name)
if(NOT DISABLE_${name} AND ${var})
diff --git a/tests/phonon/basic_playing_test.py b/tests/phonon/basic_playing_test.py
index fe295e8..45f6c12 100644
--- a/tests/phonon/basic_playing_test.py
+++ b/tests/phonon/basic_playing_test.py
@@ -54,13 +54,17 @@ class TestSimplePlaying(UsesQCoreApplication):
self.called = True
def testStateChanged(self):
- QtCore.QObject.connect(self.media,
+ # Check for ogg support before playing it
+ if (phonon.Phonon.BackendCapabilities.isMimeTypeAvailable('audio/ogg')):
+ QtCore.QObject.connect(self.media,
QtCore.SIGNAL('stateChanged(Phonon::State, Phonon::State)'),
self.state_cb)
- self.media.play()
- self.app.exec_()
- self.assert_(self.called)
+ self.media.play()
+ self.app.exec_()
+ self.assert_(self.called)
+ else:
+ print 'Ogg format not supported! Playback test skipped!'
if __name__ == '__main__':
unittest.main()
From 33f7ff2b4d26cede665a087178ca444c6d0894dd Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Thu, 17 Jun 2010 17:25:00 -0300
Subject: [PATCH 0041/1129] Fix bug#242 - "PySide is installed into wrong path
on Mac OS X"
If the cmake variable SITE_PACKAGE is set, we wont try to detect the SITE_PACKAGES variable.
Reviewed: Marcelo Lira
Luciano Wolf
---
CMakeLists.txt | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4b26d1c..d0461bf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -113,13 +113,17 @@ add_custom_target(dist
echo "Source package created at ${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar.bz2.\n"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
-execute_process(
- COMMAND ${PYTHON_EXECUTABLE} -c "from distutils import sysconfig; \\
- print sysconfig.get_python_lib(1,0,prefix='${CMAKE_INSTALL_PREFIX}')"
- OUTPUT_VARIABLE SITE_PACKAGE
- OUTPUT_STRIP_TRAILING_WHITESPACE)
if (NOT SITE_PACKAGE)
- message(FATAL_ERROR "Could not detect Python module installation directory.")
+ execute_process(
+ COMMAND ${PYTHON_EXECUTABLE} -c "from distutils import sysconfig; \\
+ print sysconfig.get_python_lib(1,0,prefix='${CMAKE_INSTALL_PREFIX}')"
+ OUTPUT_VARIABLE SITE_PACKAGE
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ if (NOT SITE_PACKAGE)
+ message(FATAL_ERROR "Could not detect Python module installation directory.")
+ elseif (APPLE)
+ message(STATUS "!!! The generated bindings will be installed on ${SITE_PACKAGE}, is it right!?")
+ endif()
endif()
set(GENERATOR_EXTRA_FLAGS --generatorSet=shiboken --enable-parent-ctor-heuristic --enable-pyside-extensions --enable-return-value-heuristic)
From 5ce7c945367f1d673a25666c1cc3ab300b23df49 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Thu, 17 Jun 2010 18:49:12 -0300
Subject: [PATCH 0042/1129] Fixed udpsocket to work on offline computer.
Reviewed: Marcelo Lira
Luciano Wolf
---
tests/QtNetwork/udpsocket_test.py | 25 +++++++++++--------------
1 file changed, 11 insertions(+), 14 deletions(-)
diff --git a/tests/QtNetwork/udpsocket_test.py b/tests/QtNetwork/udpsocket_test.py
index 26cff7f..66f8920 100644
--- a/tests/QtNetwork/udpsocket_test.py
+++ b/tests/QtNetwork/udpsocket_test.py
@@ -14,16 +14,13 @@ class HttpSignalsCase(unittest.TestCase):
def setUp(self):
#Acquire resources
+ self.called = False
self.app = QCoreApplication([])
+
self.socket = QUdpSocket()
- self.socket.bind(45454)
+
self.server = QUdpSocket()
- self.timer = QTimer.singleShot(1000, self.app.quit)
- self.a = QTimer.singleShot(100, self.broadcast)
- #self.a = QTimer()
- #self.a.setInterval(100)
- #QObject.connect(self.a, SIGNAL('timeout()'), self.broadcast)
- #self.a.start()
+ self.server.bind(QHostAddress(QHostAddress.LocalHost), 45454)
def tearDown(self):
#Release resources
@@ -31,21 +28,21 @@ class HttpSignalsCase(unittest.TestCase):
del self.server
del self.app
- def broadcast(self):
- addr = QHostAddress(QHostAddress.Broadcast)
- self.server.writeDatagram('datagram', addr, 45454)
+ def sendPackage(self):
+ addr = QHostAddress(QHostAddress.LocalHost)
+ self.socket.writeDatagram('datagram', addr, 45454)
def callback(self):
- while self.socket.hasPendingDatagrams():
- datagram, host, port = self.socket.readDatagram(
- self.socket.pendingDatagramSize())
+ while self.server.hasPendingDatagrams():
+ datagram, host, port = self.server.readDatagram(self.server.pendingDatagramSize())
self.called = True
self.app.quit()
def testDefaultArgs(self):
#QUdpSocket.readDatagram pythonic return
# @bug 124
- QObject.connect(self.socket, SIGNAL('readyRead()'), self.callback)
+ QObject.connect(self.server, SIGNAL('readyRead()'), self.callback)
+ self.sendPackage()
self.app.exec_()
self.assert_(self.called)
From 88146cf500008c13912e03213dc98bab491b15a2 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Fri, 18 Jun 2010 16:11:54 -0300
Subject: [PATCH 0043/1129] Implemented a dummy http server to run unit-test on
a offline computer.
Reviewed: Marcelo Lira
Luciano Wolf
---
tests/QtNetwork/CMakeLists.txt | 2 +
tests/QtNetwork/basic_auth_test.py | 38 ++++++++++++++++
tests/QtNetwork/http_test.py | 39 +++-------------
tests/util/httpd.py | 71 ++++++++++++++++++++++++++++++
4 files changed, 118 insertions(+), 32 deletions(-)
create mode 100644 tests/QtNetwork/basic_auth_test.py
create mode 100644 tests/util/httpd.py
diff --git a/tests/QtNetwork/CMakeLists.txt b/tests/QtNetwork/CMakeLists.txt
index cae1470..0eb5037 100644
--- a/tests/QtNetwork/CMakeLists.txt
+++ b/tests/QtNetwork/CMakeLists.txt
@@ -1,3 +1,5 @@
+
+PYSIDE_TEST(basic_auth_test.py)
PYSIDE_TEST(accessManager_test.py)
PYSIDE_TEST(http_test.py)
PYSIDE_TEST(tcpserver_test.py)
diff --git a/tests/QtNetwork/basic_auth_test.py b/tests/QtNetwork/basic_auth_test.py
new file mode 100644
index 0000000..8087eed
--- /dev/null
+++ b/tests/QtNetwork/basic_auth_test.py
@@ -0,0 +1,38 @@
+import unittest
+
+from PySide.QtCore import *
+from PySide.QtNetwork import *
+
+from helper import UsesQApplication
+from httpd import TestServer
+
+class testAuthenticationSignal(UsesQApplication):
+
+ def setUp(self):
+ super(testAuthenticationSignal, self).setUp()
+ self.httpd = TestServer(secure=True)
+ self.httpd.start()
+ self._resultOk = False
+
+ def tearDown(self):
+ self.httpd.shutdown()
+ del self.httpd
+ super(testAuthenticationSignal, self).tearDown()
+
+ def onAuthRequest(self, hostname, port, auth):
+ self.assert_(isinstance(auth, QAuthenticator))
+ self._resultOk = True
+ self.app.quit()
+
+
+ def testwaitSignal(self):
+ http = QHttp()
+ http.setHost("localhost", self.httpd.port())
+ http.connect(SIGNAL("authenticationRequired(const QString&, quint16, QAuthenticator*)"), self.onAuthRequest)
+ path = QUrl.toPercentEncoding("/index.html", "!$&'()*+,;=:@/")
+ data = http.get(path)
+ self.app.exec_()
+ self.assert_(self._resultOk)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/tests/QtNetwork/http_test.py b/tests/QtNetwork/http_test.py
index 379ff5d..5d40405 100644
--- a/tests/QtNetwork/http_test.py
+++ b/tests/QtNetwork/http_test.py
@@ -7,24 +7,27 @@ from PySide.QtCore import *
from PySide.QtNetwork import *
from helper import UsesQApplication
+from httpd import TestServer
-"""
class HttpSignalsCase(UsesQApplication):
'''Test case for launching QHttp signals'''
def setUp(self):
super(HttpSignalsCase, self).setUp()
-
self.http = QHttp()
- self.url = QUrl('http://www.google.com')
- self.timer = QTimer.singleShot(250, self.app.quit)
+ self.httpd = TestServer()
+ self.httpd.start()
+ self.url = QUrl('localhost:' + str(self.httpd.port()))
+ self.called = False
def tearDown(self):
+ self.httpd.shutdown()
del self.http
super(HttpSignalsCase, self).tearDown()
def callback(self, ident):
self.called = True
+ self.app.quit()
def testDefaultArgs(self):
#QHttp signal requestStarted signal
@@ -35,33 +38,5 @@ class HttpSignalsCase(UsesQApplication):
self.app.exec_()
self.assert_(self.called)
-class testHttp(UsesQApplication):
- def testRead(self):
- header = QHttpRequestHeader("GET", QString(QUrl.toPercentEncoding("/index.html")))
- header.setValue("Host", "qtsoftware.com");
- http = QHttp()
- http.setHost("qtsoftware.com")
- http.request(header)
- data = http.read(100)
-"""
-
-class testAuthenticationSignal(UsesQApplication):
- def onAuthRequest(self, hostname, port, auth):
- self.assert_(isinstance(auth, QAuthenticator))
- print auth.realm()
- self._resultOk = True
- self.app.exit()
-
- def testwaitSignal(self):
- self._resultOk = False
- http = QHttp()
- http.setHost("projects.maemo.org", QHttp.ConnectionModeHttps, 0)
- http.connect(SIGNAL("authenticationRequired(const QString&, quint16, QAuthenticator*)"), self.onAuthRequest)
- path = QUrl.toPercentEncoding("/index.html", "!$&'()*+,;=:@/")
- print http.get(path)
- self.app.exec_()
- self.assert_(self._resultOk)
-
-
if __name__ == '__main__':
unittest.main()
diff --git a/tests/util/httpd.py b/tests/util/httpd.py
new file mode 100644
index 0000000..96750f0
--- /dev/null
+++ b/tests/util/httpd.py
@@ -0,0 +1,71 @@
+import SocketServer
+import BaseHTTPServer
+import random
+
+from threading import Thread
+
+
+class TestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
+ DATA = "PySide Server"
+
+ def do_GET(self):
+ self.send_head()
+ self.wfile.write(TestHandler.DATA)
+
+ def do_HEAD(self):
+ self.send_head()
+
+ def send_head(self):
+ self.send_response(200)
+ self.send_header("Content-type", "text/plain")
+ self.send_header("Content-Length", str(len(TestHandler.DATA)))
+ self.end_headers()
+
+class TestSecureHandler(BaseHTTPServer.BaseHTTPRequestHandler):
+ DATA = "PySide"
+
+ def do_GET(self):
+ self.send_head()
+ self.wfile.write(TestHandler.DATA)
+
+ def do_HEAD(self):
+ self.send_head()
+
+ def send_head(self):
+ try:
+ handler = self.marshall_handler()
+ handler.do_request(self)
+ except:
+ self.send_response(401)
+ self.send_header("WWW-Authenticate", "Basic realm='Secure Area'")
+ self.send_header("Content-type", "text/plain")
+ self.send_header("Content-Length", str(len(TestHandler.DATA)))
+ self.end_headers()
+
+
+class TestServer(Thread):
+
+ def __init__(self, secure=False):
+ Thread.__init__(self)
+
+ self._port = 8000 + random.randint(0, 100)
+ self.keep_running = True
+ server = SocketServer.TCPServer
+
+ if secure:
+ handle = TestSecureHandler
+ else:
+ handle = TestHandler
+
+ self.httpd = SocketServer.TCPServer(('' , self._port), handle)
+
+ def port(self):
+ return self._port
+
+ def run(self):
+ self.httpd.serve_forever()
+
+ def shutdown(self):
+ self.httpd.shutdown()
+ self.join()
+
From 143946435835163d750b08982a906834a575fa64 Mon Sep 17 00:00:00 2001
From: Marcelo Lira
Date: Fri, 18 Jun 2010 10:54:42 -0300
Subject: [PATCH 0044/1129] Small updates to the documentation.
Removed the doc about building BoostPythonGenerator and modified a
line about the generator used to create the bindings in the index.html
file.
---
doc/_templates/index.html | 2 +-
doc/howto-build/setup-boostpython.rst | 51 ---------------------------
2 files changed, 1 insertion(+), 52 deletions(-)
delete mode 100644 doc/howto-build/setup-boostpython.rst
diff --git a/doc/_templates/index.html b/doc/_templates/index.html
index e618231..bae2f7b 100644
--- a/doc/_templates/index.html
+++ b/doc/_templates/index.html
@@ -9,7 +9,7 @@
GUI package, allowing C++ developers to write their applications once and run them unmodified in different systems.
PySide aims to provide Python developers access to the Qt libraries in the most natural way.
- PySide is built using the BoostPythonGenerator.
+ PySide is built using the Shiboken binding generator.
Documentation
diff --git a/doc/howto-build/setup-boostpython.rst b/doc/howto-build/setup-boostpython.rst
deleted file mode 100644
index a70840a..0000000
--- a/doc/howto-build/setup-boostpython.rst
+++ /dev/null
@@ -1,51 +0,0 @@
-
-.. _boost-python-generator:
-
-**********************
-Boost.Python Generator
-**********************
-
-Overview
-=========================================
-
-The **Boost::Python Generator** (A.K.A. :program:`boostpythongenerator`) is
-the program that creates the Boost.Python bindings source files from Qt headers
-and auxiliary files (typesystems, ``global.h`` and glue files). It depends on
-:ref:`generator-runner` and :ref:`api-extractor` library.
-
-
-Getting the sources
-===================
-
-* Download URL: http://www.pyside.org/downloads/
-
-Build requirements
-==================
-
-+ CMake >= 2.6.0
-+ Qt4.5 libraries and development headers >= 4.5.0
-+ :ref:`api-extractor` + development headers
-+ :ref:`generator-runner` + development headers
-
-Building and installing
-=======================
-
-To build and install just follow the generic cmake instructions in
-section :ref:`cmake-primer`.
-
-Debian packaging
-================
-
-In order to compile this package in a debian environment, make sure the
-following packages are installed:
-
-* debhelper (>= 5)
-* cdbs
-* cmake (>= 2.6.0)
-* libqt4-dev (>= 4.5)
-* libapiextractor-dev (>= 0.3.2)
-* libgenrunner-dev (>= 0.3.2a1)
-
-And then you can build the package using::
-
- $ dpkg-buildpackage -rfakeroot
From e323cd90f7922ffa8d0121b87c3a00c6706e0dd0 Mon Sep 17 00:00:00 2001
From: Marcelo Lira
Date: Mon, 21 Jun 2010 15:21:25 -0300
Subject: [PATCH 0045/1129] PySide now installs its type system files.
The pyside.pc file now has a "typesystemdir" variable pointing to
the directory where the type system files are installed.
Example usage: pkg-config pyside --variable=typesystemdir
Also set the "PYSIDE_TYPESYSTEMS" CMake variable on
libpyside/PySideConfig.cmake.in to point to the same path
of pkg-config's "typesystemdir".
Reviewed by Hugo Parente
Reviewed by Luciano Wolf
---
PySide/CMakeLists.txt | 5 +++++
PySide/QtCore/CMakeLists.txt | 3 +++
PySide/QtDeclarative/CMakeLists.txt | 3 +++
PySide/QtGui/CMakeLists.txt | 7 +++++++
PySide/QtHelp/CMakeLists.txt | 3 ++-
PySide/QtMaemo5/CMakeLists.txt | 3 ++-
PySide/QtMultimedia/CMakeLists.txt | 3 +++
PySide/QtNetwork/CMakeLists.txt | 3 +++
PySide/QtOpenGL/CMakeLists.txt | 2 ++
PySide/QtScript/CMakeLists.txt | 3 +++
PySide/QtScriptTools/CMakeLists.txt | 2 ++
PySide/QtSql/CMakeLists.txt | 3 +++
PySide/QtSvg/CMakeLists.txt | 3 +++
PySide/QtTest/CMakeLists.txt | 3 +++
PySide/QtUiTools/CMakeLists.txt | 2 ++
PySide/QtWebKit/CMakeLists.txt | 3 +++
PySide/QtXml/CMakeLists.txt | 3 +++
PySide/QtXmlPatterns/CMakeLists.txt | 2 ++
PySide/phonon/CMakeLists.txt | 3 +++
libpyside/PySideConfig.cmake.in | 2 ++
libpyside/pyside.pc.in | 1 +
21 files changed, 60 insertions(+), 2 deletions(-)
diff --git a/PySide/CMakeLists.txt b/PySide/CMakeLists.txt
index 3162cbb..b1b3286 100644
--- a/PySide/CMakeLists.txt
+++ b/PySide/CMakeLists.txt
@@ -97,3 +97,8 @@ HAS_QT_MODULE(QT_QTSCRIPTTOOLS_FOUND QtScriptTools)
HAS_QT_MODULE(QT_QTMULTIMEDIA_FOUND QtMultimedia)
HAS_QT_MODULE(QT_PHONON_FOUND phonon)
HAS_QT_MODULE(QT_QTDECLARATIVE_FOUND QtDeclarative)
+
+# install
+install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_templates.xml
+ DESTINATION share/PySide/typesystems)
+
diff --git a/PySide/QtCore/CMakeLists.txt b/PySide/QtCore/CMakeLists.txt
index 12a2f4a..408451f 100644
--- a/PySide/QtCore/CMakeLists.txt
+++ b/PySide/QtCore/CMakeLists.txt
@@ -157,3 +157,6 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/QtCore${CMAKE_DEBUG_POSTFIX}.so
DESTINATION ${SITE_PACKAGE}/${BINDING_NAME})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/pyside_qtcore_python.h
DESTINATION include/PySide/QtCore/)
+install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_core.xml
+ DESTINATION share/PySide/typesystems)
+
diff --git a/PySide/QtDeclarative/CMakeLists.txt b/PySide/QtDeclarative/CMakeLists.txt
index 587e3b5..d61fbf9 100644
--- a/PySide/QtDeclarative/CMakeLists.txt
+++ b/PySide/QtDeclarative/CMakeLists.txt
@@ -56,4 +56,7 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/QtDeclarative${CMAKE_DEBUG_POSTFIX}.so
DESTINATION ${SITE_PACKAGE}/PySide)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtDeclarative/pyside_qtdeclarative_python.h
DESTINATION include/PySide/QtDeclarative/)
+install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_declarative.xml
+ DESTINATION share/PySide/typesystems)
+
diff --git a/PySide/QtGui/CMakeLists.txt b/PySide/QtGui/CMakeLists.txt
index e9f44d7..db0fd9e 100644
--- a/PySide/QtGui/CMakeLists.txt
+++ b/PySide/QtGui/CMakeLists.txt
@@ -494,3 +494,10 @@ add_dependencies(QtGui QtCore)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/QtGui${CMAKE_DEBUG_POSTFIX}.so DESTINATION "${SITE_PACKAGE}/PySide")
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/pyside_qtgui_python.h
DESTINATION include/PySide/QtGui/)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/typesystem_gui.xml
+ ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_gui_common.xml
+ ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_gui_mac.xml
+ ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_gui_maemo.xml
+ ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_gui_x11.xml
+ DESTINATION share/PySide/typesystems)
+
diff --git a/PySide/QtHelp/CMakeLists.txt b/PySide/QtHelp/CMakeLists.txt
index 219dfc3..0cc48db 100644
--- a/PySide/QtHelp/CMakeLists.txt
+++ b/PySide/QtHelp/CMakeLists.txt
@@ -44,5 +44,6 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/QtHelp${CMAKE_DEBUG_POSTFIX}.so
DESTINATION ${SITE_PACKAGE}/PySide)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtHelp/pyside_qthelp_python.h
DESTINATION include/PySide/QtHelp/)
-
+install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_help.xml
+ DESTINATION share/PySide/typesystems)
diff --git a/PySide/QtMaemo5/CMakeLists.txt b/PySide/QtMaemo5/CMakeLists.txt
index 9251cc3..4590e40 100644
--- a/PySide/QtMaemo5/CMakeLists.txt
+++ b/PySide/QtMaemo5/CMakeLists.txt
@@ -51,7 +51,8 @@ add_dependencies(QtMaemo5 QtGui)
# install
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/QtMaemo5${CMAKE_DEBUG_POSTFIX}.so
DESTINATION ${SITE_PACKAGE}/${BINDING_NAME})
-
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtMaemo5/pyside_qtmaemo5_python.h
DESTINATION include/${BINDING_NAME}/QtMaemo5/)
+install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_maemo5.xml
+ DESTINATION share/PySide/typesystems)
diff --git a/PySide/QtMultimedia/CMakeLists.txt b/PySide/QtMultimedia/CMakeLists.txt
index cbf0b6f..05f63b5 100644
--- a/PySide/QtMultimedia/CMakeLists.txt
+++ b/PySide/QtMultimedia/CMakeLists.txt
@@ -49,3 +49,6 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/QtMultimedia${CMAKE_DEBUG_POSTFIX}.so
DESTINATION ${SITE_PACKAGE}/PySide)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtMultimedia/pyside_qtmultimedia_python.h
DESTINATION include/PySide/QtMultimedia/)
+install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_multimedia.xml
+ DESTINATION share/PySide/typesystems)
+
diff --git a/PySide/QtNetwork/CMakeLists.txt b/PySide/QtNetwork/CMakeLists.txt
index e66fa37..7c8d17e 100644
--- a/PySide/QtNetwork/CMakeLists.txt
+++ b/PySide/QtNetwork/CMakeLists.txt
@@ -125,3 +125,6 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/QtNetwork${CMAKE_DEBUG_POSTFIX}.so
DESTINATION ${SITE_PACKAGE}/PySide)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/pyside_qtnetwork_python.h
DESTINATION include/PySide/QtNetwork/)
+install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_network.xml
+ DESTINATION share/PySide/typesystems)
+
diff --git a/PySide/QtOpenGL/CMakeLists.txt b/PySide/QtOpenGL/CMakeLists.txt
index 1d79e6c..5849c9a 100644
--- a/PySide/QtOpenGL/CMakeLists.txt
+++ b/PySide/QtOpenGL/CMakeLists.txt
@@ -59,4 +59,6 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/QtOpenGL${CMAKE_DEBUG_POSTFIX}.so
DESTINATION ${SITE_PACKAGE}/PySide)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtOpenGL/pyside_qtopengl_python.h
DESTINATION include/PySide/QtOpenGL/)
+install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_opengl.xml
+ DESTINATION share/PySide/typesystems)
diff --git a/PySide/QtScript/CMakeLists.txt b/PySide/QtScript/CMakeLists.txt
index 6419439..8b63447 100644
--- a/PySide/QtScript/CMakeLists.txt
+++ b/PySide/QtScript/CMakeLists.txt
@@ -51,4 +51,7 @@ add_dependencies(QtScript QtCore)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/QtScript${CMAKE_DEBUG_POSTFIX}.so DESTINATION ${SITE_PACKAGE}/PySide)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtScript/pyside_qtscript_python.h
DESTINATION include/PySide/QtScript/)
+install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_script.xml
+ DESTINATION share/PySide/typesystems)
+
diff --git a/PySide/QtScriptTools/CMakeLists.txt b/PySide/QtScriptTools/CMakeLists.txt
index 1d53ff7..d937d66 100644
--- a/PySide/QtScriptTools/CMakeLists.txt
+++ b/PySide/QtScriptTools/CMakeLists.txt
@@ -37,4 +37,6 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/QtScriptTools${CMAKE_DEBUG_POSTFIX}.so
DESTINATION ${SITE_PACKAGE}/PySide)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtScriptTools/pyside_qtscripttools_python.h
DESTINATION include/PySide/QtScriptTools/)
+install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_scripttools.xml
+ DESTINATION share/PySide/typesystems)
diff --git a/PySide/QtSql/CMakeLists.txt b/PySide/QtSql/CMakeLists.txt
index 8040f01..1cbe713 100644
--- a/PySide/QtSql/CMakeLists.txt
+++ b/PySide/QtSql/CMakeLists.txt
@@ -49,4 +49,7 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/QtSql${CMAKE_DEBUG_POSTFIX}.so
DESTINATION ${SITE_PACKAGE}/PySide)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSql/pyside_qtsql_python.h
DESTINATION include/PySide/QtSql/)
+install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_sql.xml
+ DESTINATION share/PySide/typesystems)
+
diff --git a/PySide/QtSvg/CMakeLists.txt b/PySide/QtSvg/CMakeLists.txt
index 42129c7..631131a 100644
--- a/PySide/QtSvg/CMakeLists.txt
+++ b/PySide/QtSvg/CMakeLists.txt
@@ -61,3 +61,6 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/QtSvg${CMAKE_DEBUG_POSTFIX}.so
DESTINATION ${SITE_PACKAGE}/PySide)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSvg/pyside_qtsvg_python.h
DESTINATION include/PySide/QtSvg/)
+install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_svg.xml
+ DESTINATION share/PySide/typesystems)
+
diff --git a/PySide/QtTest/CMakeLists.txt b/PySide/QtTest/CMakeLists.txt
index e6e2953..2d392e4 100644
--- a/PySide/QtTest/CMakeLists.txt
+++ b/PySide/QtTest/CMakeLists.txt
@@ -49,3 +49,6 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/QtTest${CMAKE_DEBUG_POSTFIX}.so
DESTINATION ${SITE_PACKAGE}/PySide)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtTest/pyside_qttest_python.h
DESTINATION include/PySide/QtTest/)
+install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_test.xml
+ DESTINATION share/PySide/typesystems)
+
diff --git a/PySide/QtUiTools/CMakeLists.txt b/PySide/QtUiTools/CMakeLists.txt
index eaea414..5809c3f 100644
--- a/PySide/QtUiTools/CMakeLists.txt
+++ b/PySide/QtUiTools/CMakeLists.txt
@@ -36,4 +36,6 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/QtUiTools${CMAKE_DEBUG_POSTFIX}.so
DESTINATION ${SITE_PACKAGE}/PySide)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtUiTools/pyside_qtuitools_python.h
DESTINATION include/PySide/QtUiTools/)
+install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_uitools.xml
+ DESTINATION share/PySide/typesystems)
diff --git a/PySide/QtWebKit/CMakeLists.txt b/PySide/QtWebKit/CMakeLists.txt
index 09f5bfa..7bdf6e0 100644
--- a/PySide/QtWebKit/CMakeLists.txt
+++ b/PySide/QtWebKit/CMakeLists.txt
@@ -79,3 +79,6 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/QtWebKit${CMAKE_DEBUG_POSTFIX}.so
DESTINATION ${SITE_PACKAGE}/PySide)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/pyside_qtwebkit_python.h
DESTINATION include/PySide/QtWebKit/)
+install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_webkit.xml
+ DESTINATION share/PySide/typesystems)
+
diff --git a/PySide/QtXml/CMakeLists.txt b/PySide/QtXml/CMakeLists.txt
index 6ee39d7..e6b4e80 100644
--- a/PySide/QtXml/CMakeLists.txt
+++ b/PySide/QtXml/CMakeLists.txt
@@ -62,4 +62,7 @@ add_dependencies(QtXml QtCore)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/QtXml${CMAKE_DEBUG_POSTFIX}.so DESTINATION ${SITE_PACKAGE}/PySide)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXml/pyside_qtxml_python.h
DESTINATION include/PySide/QtXml/)
+install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_xml.xml
+ DESTINATION share/PySide/typesystems)
+
diff --git a/PySide/QtXmlPatterns/CMakeLists.txt b/PySide/QtXmlPatterns/CMakeLists.txt
index 73c6e1d..df67372 100644
--- a/PySide/QtXmlPatterns/CMakeLists.txt
+++ b/PySide/QtXmlPatterns/CMakeLists.txt
@@ -50,4 +50,6 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/QtXmlPatterns${CMAKE_DEBUG_POSTFIX}.so
DESTINATION ${SITE_PACKAGE}/PySide)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXmlPatterns/pyside_qtxmlpatterns_python.h
DESTINATION include/PySide/QtXmlPatterns/)
+install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_xmlpatterns.xml
+ DESTINATION share/PySide/typesystems)
diff --git a/PySide/phonon/CMakeLists.txt b/PySide/phonon/CMakeLists.txt
index 7392063..1b2f05f 100644
--- a/PySide/phonon/CMakeLists.txt
+++ b/PySide/phonon/CMakeLists.txt
@@ -71,3 +71,6 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/phonon${CMAKE_DEBUG_POSTFIX}.so
DESTINATION ${SITE_PACKAGE}/PySide)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/pyside_phonon_python.h
DESTINATION include/PySide/phonon/)
+install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_phonon.xml
+ DESTINATION share/PySide/typesystems)
+
diff --git a/libpyside/PySideConfig.cmake.in b/libpyside/PySideConfig.cmake.in
index f302364..1d9c9ae 100644
--- a/libpyside/PySideConfig.cmake.in
+++ b/libpyside/PySideConfig.cmake.in
@@ -1,5 +1,7 @@
# PYSIDE_INCLUDE_DIR - Directories to include to use PySide
# PYSIDE_LIBRARIES - Files to link against to use PySide
+# PYSIDE_TYPESYSTEMS - Type system files that should be used by other bindings extending PySide
SET(PYSIDE_INCLUDE_DIR "@CMAKE_INSTALL_PREFIX@/include/PySide")
SET(PYSIDE_LIBRARY "@LIB_INSTALL_DIR@/@CMAKE_SHARED_LIBRARY_PREFIX@pyside@CMAKE_SHARED_LIBRARY_SUFFIX@")
+SET(PYSIDE_TYPESYSTEMS "@CMAKE_INSTALL_PREFIX@/shared/PySide/typesystems")
diff --git a/libpyside/pyside.pc.in b/libpyside/pyside.pc.in
index 61cb808..ca7a0a5 100644
--- a/libpyside/pyside.pc.in
+++ b/libpyside/pyside.pc.in
@@ -2,6 +2,7 @@ prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=@CMAKE_INSTALL_PREFIX@
libdir=@LIB_INSTALL_DIR@
includedir=@CMAKE_INSTALL_PREFIX@/include/PySide
+typesystemdir=@CMAKE_INSTALL_PREFIX@/share/PySide/typesystems
Name: PySide
Description: Support library for Python bindings of Qt-based libraries.
From 928e0b2795244d18a87764effe3d2a94504ac272 Mon Sep 17 00:00:00 2001
From: Catalin Iacob
Date: Sun, 16 May 2010 14:42:38 +0200
Subject: [PATCH 0046/1129] Fix libpyside install.
On Windows, if LIBRARY DESTINATION is given, ARCHIVE DESTINATION must also be
given otherwise CMake fails with 'install Library TARGETS given no DESTINATION!'
Reviewer: Marcelo Lira
Luciano Wolf
---
libpyside/CMakeLists.txt | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/libpyside/CMakeLists.txt b/libpyside/CMakeLists.txt
index 0597f16..463c013 100644
--- a/libpyside/CMakeLists.txt
+++ b/libpyside/CMakeLists.txt
@@ -46,7 +46,10 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/PySideVersion.cmake.in" "${CMAKE_CUR
install(FILES ${libpyside_HEADERS}
DESTINATION include/${BINDING_NAME})
-install(TARGETS pyside LIBRARY DESTINATION ${LIB_INSTALL_DIR})
+install(TARGETS pyside EXPORT pyside
+ LIBRARY DESTINATION "${LIB_INSTALL_DIR}"
+ ARCHIVE DESTINATION "${LIB_INSTALL_DIR}"
+ RUNTIME DESTINATION bin)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/pyside.pc" DESTINATION "${LIB_INSTALL_DIR}/pkgconfig")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/PySideConfig.cmake"
DESTINATION "${LIB_INSTALL_DIR}/cmake/PySide-${BINDING_API_VERSION}")
From 54b69c3595cadfbfa5f65849d4dd106718920976 Mon Sep 17 00:00:00 2001
From: Luciano Wolf
Date: Fri, 18 Jun 2010 19:37:21 -0300
Subject: [PATCH 0047/1129] Adding qInstallMsgHandler() method support.
Reviewer: Marcelo Lira
Hugo Parente Lima
---
PySide/QtCore/typesystem_core.xml | 32 +++++++++++++++
tests/QtCore/CMakeLists.txt | 1 +
tests/QtCore/qinstallmsghandler_test.py | 53 +++++++++++++++++++++++++
3 files changed, 86 insertions(+)
create mode 100644 tests/QtCore/qinstallmsghandler_test.py
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 8b1bab6..3376973 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -718,6 +718,38 @@
#include <pyside.h>
+
+ // Define a global variable to handle qInstallMsgHandler callback
+ static PyObject* qtmsghandler = 0;
+
+ void
+ msghandlercallback(QtMsgType type, const char* msg)
+ {
+ Shiboken::AutoDecRef arglist(Shiboken::makeTuple(type, msg));
+ Shiboken::AutoDecRef ret(PyObject_CallObject(qtmsghandler, arglist));
+ }
+
+
+
+ if (%PYARG_1 == Py_None) {
+ qInstallMsgHandler(0);
+ %PYARG_0 = qtmsghandler ? qtmsghandler : Py_None;
+ qtmsghandler = 0;
+ } else if (!PyCallable_Check(%PYARG_1)) {
+ PyErr_SetString(PyExc_TypeError, "parameter must be callable");
+ } else {
+ %PYARG_0 = qtmsghandler ? qtmsghandler : Py_None;
+ Py_INCREF(%PYARG_1);
+ qtmsghandler = %PYARG_1;
+ qInstallMsgHandler(msghandlercallback);
+ }
+
+ if (%PYARG_0 == Py_None)
+ Py_INCREF(%PYARG_0);
+
+
+
+
diff --git a/tests/QtCore/CMakeLists.txt b/tests/QtCore/CMakeLists.txt
index 35fa7b9..b5f59d4 100644
--- a/tests/QtCore/CMakeLists.txt
+++ b/tests/QtCore/CMakeLists.txt
@@ -22,6 +22,7 @@ PYSIDE_TEST(qfileinfo_test.py)
PYSIDE_TEST(qfile_test.py)
PYSIDE_TEST(qflags_test.py)
PYSIDE_TEST(qhandle_test.py)
+PYSIDE_TEST(qinstallmsghandler_test.py)
PYSIDE_TEST(qlinef_test.py)
PYSIDE_TEST(qlocale_test.py)
PYSIDE_TEST(qmetaobject_test.py)
diff --git a/tests/QtCore/qinstallmsghandler_test.py b/tests/QtCore/qinstallmsghandler_test.py
new file mode 100644
index 0000000..d76c6ce
--- /dev/null
+++ b/tests/QtCore/qinstallmsghandler_test.py
@@ -0,0 +1,53 @@
+
+'''Test cases for qInstallMsgHandler'''
+
+import unittest
+import sys
+
+from PySide.QtCore import *
+
+param = []
+
+def handler(msgt, msg):
+ global param
+ param = [msgt, msg]
+
+def handleruseless(msgt, msg):
+ pass
+
+class QInstallMsgHandlerTest(unittest.TestCase):
+
+ def tearDown(self):
+ # Ensure that next test will have a clear environment
+ qInstallMsgHandler(None)
+
+ def testNone(self):
+ ret = qInstallMsgHandler(None)
+ self.assertEqual(ret, None)
+
+ def testRet(self):
+ ret = qInstallMsgHandler(None)
+ self.assertEqual(ret, None)
+ refcount = sys.getrefcount(handleruseless)
+ retNone = qInstallMsgHandler(handleruseless)
+ self.assertEqual(sys.getrefcount(handleruseless), refcount + 1)
+ rethandler = qInstallMsgHandler(None)
+ self.assertEqual(rethandler, handleruseless)
+ del rethandler
+ self.assertEqual(sys.getrefcount(handleruseless), refcount)
+
+ def testHandler(self):
+ rethandler = qInstallMsgHandler(handler)
+ qDebug("Test Debug")
+ self.assertEqual(param[0], QtDebugMsg)
+ self.assertEqual(param[1], "Test Debug")
+ qWarning("Test Warning")
+ self.assertEqual(param[0], QtWarningMsg)
+ self.assertEqual(param[1], "Test Warning")
+ qCritical("Test Critical")
+ self.assertEqual(param[0], QtCriticalMsg)
+ self.assertEqual(param[1], "Test Critical")
+
+if __name__ == '__main__':
+ unittest.main()
+
From 86d0f6715ed282f7fecf789a85feb03d913ea7d9 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Mon, 21 Jun 2010 14:10:10 -0300
Subject: [PATCH 0048/1129] Fix bug: "Debug build fails to run the tests
(doesn't work) [_Py_AddToAllObjects: Assertion (...) failed]"
Reviewer: Marcelo Lira
Luciano Wolf
---
CMakeLists.txt | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d0461bf..3d57095 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -126,6 +126,16 @@ if (NOT SITE_PACKAGE)
endif()
endif()
+# Detect if the python libs were compiled in debug mode
+execute_process(
+ COMMAND ${PYTHON_EXECUTABLE} -c "from distutils import sysconfig; \\
+ print sysconfig.get_config_var('Py_DEBUG')"
+ OUTPUT_VARIABLE PY_DEBUG
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+if (PY_DEBUG)
+ add_definitions("-DPy_DEBUG")
+endif()
+
set(GENERATOR_EXTRA_FLAGS --generatorSet=shiboken --enable-parent-ctor-heuristic --enable-pyside-extensions --enable-return-value-heuristic)
enable_testing()
From 499d42a6f408ab64795b4c8a7ba507a682c7cb39 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Mon, 21 Jun 2010 19:37:30 -0300
Subject: [PATCH 0049/1129] Included qsinal.h in installed files.
---
libpyside/CMakeLists.txt | 1 +
1 file changed, 1 insertion(+)
diff --git a/libpyside/CMakeLists.txt b/libpyside/CMakeLists.txt
index 463c013..d775028 100644
--- a/libpyside/CMakeLists.txt
+++ b/libpyside/CMakeLists.txt
@@ -35,6 +35,7 @@ set(libpyside_HEADERS
pysidemacros.h
signalmanager.h
pyside.h
+ qsignal.h
)
# create pkg-config file
From 09cb758d9ecfa21f4b8c5b73a43ce05ca6ee0492 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Tue, 22 Jun 2010 18:08:05 -0300
Subject: [PATCH 0050/1129] Fixed layout policy.
Reviewer: Hugo Parente Lima ,
Luciano Wolf
---
PySide/QtGui/glue/qlayout_help_functions.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/PySide/QtGui/glue/qlayout_help_functions.h b/PySide/QtGui/glue/qlayout_help_functions.h
index 186e0ec..cea0b56 100644
--- a/PySide/QtGui/glue/qlayout_help_functions.h
+++ b/PySide/QtGui/glue/qlayout_help_functions.h
@@ -22,8 +22,8 @@ inline void addLayoutOwnership(QLayout *layout, QLayout *other)
if (!parent)
return;
- for (int i=0, i_max=layout->count(); i < i_max; i++) {
- addLayoutOwnership(layout, layout->itemAt(i));
+ for (int i=0, i_max=other->count(); i < i_max; i++) {
+ addLayoutOwnership(layout, other->itemAt(i));
}
Shiboken::AutoDecRef pyParent(Shiboken::Converter::toPython(layout));
From b1f7791a7257b0fb5a766cd1825fb32d52403bee Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Tue, 22 Jun 2010 18:08:25 -0300
Subject: [PATCH 0051/1129] Check for invalid signal or slot name.
Reviewer: Hugo Parente Lima ,
Luciano Wolf
---
PySide/QtCore/glue/qobject_connect.cpp | 5 ++++-
libpyside/signalmanager.cpp | 5 ++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/PySide/QtCore/glue/qobject_connect.cpp b/PySide/QtCore/glue/qobject_connect.cpp
index e9de411..535dd10 100644
--- a/PySide/QtCore/glue/qobject_connect.cpp
+++ b/PySide/QtCore/glue/qobject_connect.cpp
@@ -25,6 +25,9 @@ static bool getReceiver(PyObject *callback, QObject **receiver, PyObject **self)
static bool qobjectConnect(QObject* source, const char* signal, QObject* receiver, const char* slot, Qt::ConnectionType type)
{
+ if (!signal || !slot)
+ return false;
+
if (!PySide::checkSignal(signal))
return false;
signal++;
@@ -39,7 +42,7 @@ static bool qobjectConnect(QObject* source, const char* signal, QObject* receive
static bool qobjectConnectCallback(QObject* source, const char* signal, PyObject* callback, Qt::ConnectionType type)
{
- if (!PySide::checkSignal(signal))
+ if (!signal || !PySide::checkSignal(signal))
return false;
signal++;
diff --git a/libpyside/signalmanager.cpp b/libpyside/signalmanager.cpp
index d44743c..1115d24 100644
--- a/libpyside/signalmanager.cpp
+++ b/libpyside/signalmanager.cpp
@@ -82,11 +82,14 @@ using namespace PySide;
bool PySide::isSignal(const char* signal)
{
- return signal[0] == PYSIDE_SIGNAL;
+ return (signal && signal[0] == PYSIDE_SIGNAL);
}
bool PySide::checkSignal(const char* signal)
{
+ if (!signal)
+ return false;
+
if (signal[0] != PYSIDE_SIGNAL) {
PyErr_SetString(PyExc_TypeError, "Use the function PySide.QtCore.SIGNAL on signals");
return false;
From 174a3c2760cae01eb2276f88d1610c425ec29c70 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Tue, 22 Jun 2010 18:12:56 -0300
Subject: [PATCH 0052/1129] Fixed typo in typesystem install path.
Reviewer: Hugo Parente Lima ,
Luciano Wolf
---
libpyside/PySideConfig.cmake.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libpyside/PySideConfig.cmake.in b/libpyside/PySideConfig.cmake.in
index 1d9c9ae..6d618a5 100644
--- a/libpyside/PySideConfig.cmake.in
+++ b/libpyside/PySideConfig.cmake.in
@@ -4,4 +4,4 @@
SET(PYSIDE_INCLUDE_DIR "@CMAKE_INSTALL_PREFIX@/include/PySide")
SET(PYSIDE_LIBRARY "@LIB_INSTALL_DIR@/@CMAKE_SHARED_LIBRARY_PREFIX@pyside@CMAKE_SHARED_LIBRARY_SUFFIX@")
-SET(PYSIDE_TYPESYSTEMS "@CMAKE_INSTALL_PREFIX@/shared/PySide/typesystems")
+SET(PYSIDE_TYPESYSTEMS "@CMAKE_INSTALL_PREFIX@/share/PySide/typesystems")
From 7373ecb1c067f1f1c0156e88d1ed799ef8b02a24 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Tue, 22 Jun 2010 18:34:55 -0300
Subject: [PATCH 0053/1129] use original name on activated function.
Reviewer: Hugo Parente Lima ,
Luciano Wolf
---
PySide/QtGui/typesystem_gui_common.xml | 14 --------------
1 file changed, 14 deletions(-)
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index 7a6f2b0..bb59367 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -3065,12 +3065,6 @@
-
-
-
-
-
-
@@ -4236,14 +4230,6 @@
- >
-
-
-
-
-
-
-
From d1ee9643270fcdad8ab7db9f812194be2e2c9d94 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Tue, 22 Jun 2010 18:54:31 -0300
Subject: [PATCH 0054/1129] Fixed http test.
Reviewer: Hugo Parente Lima ,
Luciano Wolf
---
tests/QtNetwork/http_test.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/tests/QtNetwork/http_test.py b/tests/QtNetwork/http_test.py
index 5d40405..531316d 100644
--- a/tests/QtNetwork/http_test.py
+++ b/tests/QtNetwork/http_test.py
@@ -22,7 +22,8 @@ class HttpSignalsCase(UsesQApplication):
def tearDown(self):
self.httpd.shutdown()
- del self.http
+ self.http = None
+ self.httpd = None
super(HttpSignalsCase, self).tearDown()
def callback(self, ident):
@@ -32,7 +33,7 @@ class HttpSignalsCase(UsesQApplication):
def testDefaultArgs(self):
#QHttp signal requestStarted signal
# @bug 114
- QObject.connect(self.http, SIGNAL('requestStarted(int)'), self.callback)
+ self.http.requestStarted.connect(self.callback)
self.http.get(self.url.path())
self.app.exec_()
From 9a662a134c6d437edbdc795c00588a249557a0c2 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Fri, 25 Jun 2010 17:03:04 -0300
Subject: [PATCH 0055/1129] Used default constructor for primitive types with
complex name.
Reviewer: Marcelo Lira
Hugo Parente Lima
---
PySide/QtCore/typesystem_core.xml | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 3376973..5b9ea30 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -108,26 +108,26 @@
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
-
+
+
-
+
From ee00f28629745a7b615a0ce6e8c723605e0e1f35 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Fri, 25 Jun 2010 17:47:09 -0300
Subject: [PATCH 0056/1129] Fix cmake files used by other projects to detect
PySide.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Reviewer: Renato Araújo
Luciano Wolf
---
CMakeLists.txt | 2 +-
libpyside/CMakeLists.txt | 4 ++--
.../{PySideVersion.cmake.in => PySideConfigVersion.cmake.in} | 0
3 files changed, 3 insertions(+), 3 deletions(-)
rename libpyside/{PySideVersion.cmake.in => PySideConfigVersion.cmake.in} (100%)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3d57095..61a6116 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -35,7 +35,7 @@ endif()
find_package(PythonLibs REQUIRED)
find_package(PythonInterp REQUIRED)
-find_package(Shiboken REQUIRED)
+find_package(Shiboken 0.3.3 REQUIRED)
find_package(Qt4 4.5.0 REQUIRED)
set(BINDING_NAME PySide)
diff --git a/libpyside/CMakeLists.txt b/libpyside/CMakeLists.txt
index d775028..efbe1f2 100644
--- a/libpyside/CMakeLists.txt
+++ b/libpyside/CMakeLists.txt
@@ -43,7 +43,7 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/pyside.pc.in"
"${CMAKE_CURRENT_BINARY_DIR}/pyside.pc" @ONLY)
# create cmake-config files
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/PySideConfig.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/PySideConfig.cmake" @ONLY)
-configure_file("${CMAKE_CURRENT_SOURCE_DIR}/PySideVersion.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/PySideVersion.cmake" @ONLY)
+configure_file("${CMAKE_CURRENT_SOURCE_DIR}/PySideConfigVersion.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/PySideConfigVersion.cmake" @ONLY)
install(FILES ${libpyside_HEADERS}
DESTINATION include/${BINDING_NAME})
@@ -54,5 +54,5 @@ install(TARGETS pyside EXPORT pyside
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/pyside.pc" DESTINATION "${LIB_INSTALL_DIR}/pkgconfig")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/PySideConfig.cmake"
DESTINATION "${LIB_INSTALL_DIR}/cmake/PySide-${BINDING_API_VERSION}")
-install(FILES "${CMAKE_CURRENT_BINARY_DIR}/PySideVersion.cmake"
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/PySideConfigVersion.cmake"
DESTINATION "${LIB_INSTALL_DIR}/cmake/PySide-${BINDING_API_VERSION}")
diff --git a/libpyside/PySideVersion.cmake.in b/libpyside/PySideConfigVersion.cmake.in
similarity index 100%
rename from libpyside/PySideVersion.cmake.in
rename to libpyside/PySideConfigVersion.cmake.in
From b812f04d2481464d8a0c0e117bba9d9aaf727e8c Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Tue, 29 Jun 2010 10:04:15 -0300
Subject: [PATCH 0057/1129] Fix bug#256 - "PySide does not support signals with
containers."
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Reviewer: Marcelo Lira
Renato Araújo
---
libpyside/pysideconversions.h | 3 +++
tests/signals/CMakeLists.txt | 1 +
tests/signals/list_signal_test.py | 35 +++++++++++++++++++++++++++++++
3 files changed, 39 insertions(+)
create mode 100644 tests/signals/list_signal_test.py
diff --git a/libpyside/pysideconversions.h b/libpyside/pysideconversions.h
index 86f5003..32d5f34 100644
--- a/libpyside/pysideconversions.h
+++ b/libpyside/pysideconversions.h
@@ -67,6 +67,7 @@ struct QtDictConverter
return true;
}
+ static inline PyObject* toPython(void* cppObj) { return toPython(*reinterpret_cast(cppObj)); }
static inline PyObject* toPython(const QtDict& cppobj)
{
PyObject* result = PyDict_New();
@@ -133,6 +134,7 @@ struct QtMultiMapConverter
return true;
}
+ static inline PyObject* toPython(void* cppObj) { return toPython(*reinterpret_cast(cppObj)); }
static inline PyObject* toPython(const MultiMap& cppObj)
{
PyObject* result = PyDict_New();
@@ -194,6 +196,7 @@ struct QSequenceConverter
}
return true;
}
+ static inline PyObject* toPython(void* cppObj) { return toPython(*reinterpret_cast(cppObj)); }
static PyObject* toPython(const T& cppobj)
{
PyObject* result = PyList_New((int) cppobj.size());
diff --git a/tests/signals/CMakeLists.txt b/tests/signals/CMakeLists.txt
index a6d564f..e09be0e 100644
--- a/tests/signals/CMakeLists.txt
+++ b/tests/signals/CMakeLists.txt
@@ -30,3 +30,4 @@ PYSIDE_TEST(signal_with_primitive_type_test.py)
PYSIDE_TEST(slot_reference_count_test.py)
PYSIDE_TEST(static_metaobject_test.py)
PYSIDE_TEST(upstream_segfault_test.py)
+PYSIDE_TEST(list_signal_test.py)
diff --git a/tests/signals/list_signal_test.py b/tests/signals/list_signal_test.py
new file mode 100644
index 0000000..c65eb11
--- /dev/null
+++ b/tests/signals/list_signal_test.py
@@ -0,0 +1,35 @@
+# -*- coding: utf-8 -*-
+
+import unittest
+
+from PySide.QtCore import *
+from PySide.QtGui import *
+
+class ListConnectionTest(unittest.TestCase):
+
+ def modifyScene(self):
+ self.scene.addLine(0, 0, 10, 10)
+
+ def sceneChanged(self, rects):
+ # Qt isn't so cute and sends this signal with empty lists and null rects sometimes.
+ if len(rects) > 0 and not rects[0].isNull():
+ self.rects = rects
+ QApplication.quit()
+
+ def testConnection(self):
+ app = QApplication([])
+
+ self.scene = QGraphicsScene()
+ QTimer.singleShot(0, self.modifyScene)
+ self.scene.changed.connect(self.sceneChanged)
+
+ app.exec_()
+ self.assertEquals(len(self.rects), 1)
+ self.assertEquals(self.rects[0].x(), 0)
+ self.assertEquals(self.rects[0].y(), 0)
+ self.assertEquals(self.rects[0].width(), 10)
+ self.assertEquals(self.rects[0].height(), 10)
+
+if __name__ == '__main__':
+ unittest.main()
+
From 27530522a8b494874549f11bcdd2a56e685870ba Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Tue, 29 Jun 2010 10:43:37 -0300
Subject: [PATCH 0058/1129] Fix qwidget_test.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Reviewer: Renato Araújo
Marcelo Lira
---
tests/QtGui/CMakeLists.txt | 2 +-
tests/QtGui/qwidget_test.py | 5 +----
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt
index 5f50ea8..3c9c2c3 100644
--- a/tests/QtGui/CMakeLists.txt
+++ b/tests/QtGui/CMakeLists.txt
@@ -52,7 +52,7 @@ PYSIDE_TEST(qtextedit_signal_test.py)
PYSIDE_TEST(qtoolbar_test.py)
PYSIDE_TEST(qtoolbox_test.py)
PYSIDE_TEST(qwidget_setlayout_test.py)
-PYSIDE_TEST(qwidget_test.py TRUE) #Bug 237
+PYSIDE_TEST(qwidget_test.py)
PYSIDE_TEST(reference_count_test.py)
PYSIDE_TEST(standardpixmap_test.py)
PYSIDE_TEST(timed_app_test.py)
diff --git a/tests/QtGui/qwidget_test.py b/tests/QtGui/qwidget_test.py
index a14311c..70271a0 100644
--- a/tests/QtGui/qwidget_test.py
+++ b/tests/QtGui/qwidget_test.py
@@ -11,10 +11,7 @@ class QWidgetInherit(QMainWindow):
class QWidgetTest(UsesQApplication):
def testInheritance(self):
- newobj = QWidgetInherit()
- widget = QWidget()
- newobj.setCentralWidget(widget)
- self.assertEqual(widget, newobj.centralWidget())
+ self.assertRaises(TypeError, QWidgetInherit)
class QWidgetVisible(UsesQApplication):
From 4c6e35634c220a9bc64b33db41a80360a3bc6e18 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Tue, 29 Jun 2010 16:37:05 -0300
Subject: [PATCH 0059/1129] Created unit test to use signals in objects not
created on python.
Reviewer: Hugo Parente Lima
Marcelo Lira
---
tests/QtGui/CMakeLists.txt | 1 +
tests/QtGui/qdynamic_signal.py | 27 +++++++++++++++++++++++++++
2 files changed, 28 insertions(+)
create mode 100644 tests/QtGui/qdynamic_signal.py
diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt
index 3c9c2c3..02b7d43 100644
--- a/tests/QtGui/CMakeLists.txt
+++ b/tests/QtGui/CMakeLists.txt
@@ -18,6 +18,7 @@ PYSIDE_TEST(qbrush_test.py)
PYSIDE_TEST(qcolor_test.py)
PYSIDE_TEST(qaction_test.py)
PYSIDE_TEST(qdatastream_gui_operators_test.py)
+PYSIDE_TEST(qdynamic_signal.py)
PYSIDE_TEST(qfontdialog_test.py)
PYSIDE_TEST(qfontmetrics_test.py)
PYSIDE_TEST(qgraphicsitem_isblocked_test.py)
diff --git a/tests/QtGui/qdynamic_signal.py b/tests/QtGui/qdynamic_signal.py
new file mode 100644
index 0000000..db3218e
--- /dev/null
+++ b/tests/QtGui/qdynamic_signal.py
@@ -0,0 +1,27 @@
+
+import unittest
+
+from PySide.QtGui import QInputDialog
+
+from helper import UsesQApplication
+
+class DynamicSignalTest(UsesQApplication):
+
+ def cp(self, obj):
+ self._called = True
+
+ def testQDialog(self):
+ dlg = QInputDialog()
+ dlg.setInputMode(QInputDialog.TextInput)
+ lst = dlg.children()
+ self.assert_(len(lst))
+ obj = lst[0]
+ self._called = False
+ obj.destroyed.connect(self.cb)
+ obj = None
+ del dlg
+ self.assert_(self._called)
+
+
+if __name__ == '__main__':
+ unittest.main()
From 9ee7d00d11693fff3cebf6db0d3d5b18ed8666fb Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Tue, 29 Jun 2010 17:55:23 -0300
Subject: [PATCH 0060/1129] Fix reference leak in PySide::signalUpdateSource.
---
libpyside/qsignal.cpp | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/libpyside/qsignal.cpp b/libpyside/qsignal.cpp
index 43c02f1..aa211a7 100644
--- a/libpyside/qsignal.cpp
+++ b/libpyside/qsignal.cpp
@@ -228,16 +228,15 @@ PyObject* signal_instance_get_item(PyObject* self, PyObject* key)
void signalUpdateSource(PyObject* source)
{
- PyObject* attrs = PyObject_Dir(source);
- for(int i = 0, i_max = PyList_Size(attrs); i < i_max; i++) {
- PyObject *attrName = PyList_GET_ITEM(attrs, i);
- PyObject *attr = PyObject_GetAttr(source, attrName);
+ Shiboken::AutoDecRef attrs(PyObject_Dir(source));
+ for(int i = 0, i_max = PyList_GET_SIZE(attrs.object()); i < i_max; i++) {
+ PyObject *attrName = PyList_GET_ITEM(attrs.object(), i);
+ Shiboken::AutoDecRef attr(PyObject_GetAttr(source, attrName));
if (attr->ob_type == &Signal_Type) {
Shiboken::AutoDecRef signalInstance(reinterpret_cast(PyObject_New(SignalInstanceData, &SignalInstance_Type)));
- signal_instance_initialize(signalInstance, attrName, reinterpret_cast(attr), source, 0);
+ signal_instance_initialize(signalInstance, attrName, reinterpret_cast(attr.object()), source, 0);
PyObject_SetAttr(source, attrName, signalInstance);
}
- Py_DECREF(attr);
}
}
From c5b700a311f3558d1d33c2894dc3ba2583bd6c46 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Tue, 29 Jun 2010 17:55:59 -0300
Subject: [PATCH 0061/1129] Fix typo in tests/QtGui/qdynamic_signal.py
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Reviewer: Renato Araújo
Marcelo Lira
---
tests/QtGui/qdynamic_signal.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/QtGui/qdynamic_signal.py b/tests/QtGui/qdynamic_signal.py
index db3218e..d44ee79 100644
--- a/tests/QtGui/qdynamic_signal.py
+++ b/tests/QtGui/qdynamic_signal.py
@@ -7,7 +7,7 @@ from helper import UsesQApplication
class DynamicSignalTest(UsesQApplication):
- def cp(self, obj):
+ def cb(self, obj):
self._called = True
def testQDialog(self):
From bc4aa5ca947be692a6d016b349b1e2959a9bedf2 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Fri, 2 Jul 2010 15:56:01 -0300
Subject: [PATCH 0062/1129] Created QListWidget test.
Reviewer: Hugo Parente Lima ,
Luciano Wolf
---
tests/QtGui/CMakeLists.txt | 1 +
tests/QtGui/qlistwidgetitem_test.py | 1 +
2 files changed, 2 insertions(+)
diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt
index 02b7d43..cac4fc5 100644
--- a/tests/QtGui/CMakeLists.txt
+++ b/tests/QtGui/CMakeLists.txt
@@ -30,6 +30,7 @@ PYSIDE_TEST(qitemselection_test.py)
PYSIDE_TEST(qlayout_ref_test.py)
PYSIDE_TEST(qlayout_test.py)
PYSIDE_TEST(qlcdnumber_test.py)
+PYSIDE_TEST(qlistwidg_test.py)
PYSIDE_TEST(qlistwidgetitem_test.py)
PYSIDE_TEST(qmainwindow_test.py)
PYSIDE_TEST(qmatrix_test.py)
diff --git a/tests/QtGui/qlistwidgetitem_test.py b/tests/QtGui/qlistwidgetitem_test.py
index 8f96c51..159f38c 100644
--- a/tests/QtGui/qlistwidgetitem_test.py
+++ b/tests/QtGui/qlistwidgetitem_test.py
@@ -21,5 +21,6 @@ class QListWidgetItemConstructor(UsesQApplication):
item = self.widgetList.item(0)
self.assertEqual(item.listWidget(), self.widgetList)
+
if __name__ == '__main__':
unittest.main()
From 72235a6530831a13c940839c53e873740fad71b7 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Mon, 5 Jul 2010 14:18:43 -0300
Subject: [PATCH 0063/1129] Use original name on QVariant type lookup function.
Reviewer: Hugo Parente Lima ,
Luciano Wolf
---
PySide/QtCore/qvariant_conversions.h | 27 ++++++++++++---------------
1 file changed, 12 insertions(+), 15 deletions(-)
diff --git a/PySide/QtCore/qvariant_conversions.h b/PySide/QtCore/qvariant_conversions.h
index 076ed7f..613e523 100644
--- a/PySide/QtCore/qvariant_conversions.h
+++ b/PySide/QtCore/qvariant_conversions.h
@@ -45,21 +45,14 @@ struct Converter
return QVariant::fromValue(pyObj);
} else {
// a class supported by QVariant?
- const char* typeName = pyObj->ob_type->tp_name;
- // check if the name starts with PySide.
- if (!strncmp("PySide.", typeName, 7)) {
- // get the type name
- const char* lastDot = typeName;
- for (int i = 8; typeName[i]; ++i) {
- if (typeName[i] == '.')
- lastDot = &typeName[i];
- }
- lastDot++;
- uint typeCode = QMetaType::type(lastDot);
+ if (Shiboken::isShibokenType(pyObj)) {
+ Shiboken::SbkBaseWrapperType *objType = reinterpret_cast(pyObj->ob_type);
+ const char* typeName = objType->original_name;
+ uint typeCode = QMetaType::type(typeName);
if (!typeCode) {// Try with star at end, for QObject*, QWidget* and QAbstractKinectScroller*
- QString typeName(lastDot);
- typeName += '*';
- typeCode = QMetaType::type(typeName.toAscii());
+ QString stypeName(typeName);
+ stypeName += '*';
+ typeCode = QMetaType::type(stypeName.toAscii());
}
if (typeCode)
return QVariant(typeCode, reinterpret_cast(pyObj)->cptr[0]);
@@ -69,7 +62,11 @@ struct Converter
}
}
- static PyObject* toPython(void* cppObj) { return toPython(*reinterpret_cast(cppObj)); }
+ static PyObject* toPython(void* cppObj)
+ {
+ return toPython(*reinterpret_cast(cppObj));
+ }
+
static PyObject* toPython(const QVariant& cppObj)
{
if (cppObj.isValid()) {
From e64209b4d30253e11a22a5f2917953833880ba12 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Mon, 5 Jul 2010 14:19:28 -0300
Subject: [PATCH 0064/1129] Add unit test to QListWidget.
Reviewer: Hugo Parente Lima ,
Luciano Wolf
---
PySide/QtTest/CMakeLists.txt | 1 +
tests/QtGui/CMakeLists.txt | 2 +-
tests/QtGui/qlistwidget_test.py | 46 +++++++++++++++++++++++++++++++++
3 files changed, 48 insertions(+), 1 deletion(-)
create mode 100644 tests/QtGui/qlistwidget_test.py
diff --git a/PySide/QtTest/CMakeLists.txt b/PySide/QtTest/CMakeLists.txt
index 2d392e4..b447f79 100644
--- a/PySide/QtTest/CMakeLists.txt
+++ b/PySide/QtTest/CMakeLists.txt
@@ -36,6 +36,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}
add_library(QtTest MODULE ${QtTest_SRC})
set_property(TARGET QtTest PROPERTY PREFIX "")
target_link_libraries(QtTest
+ pyside
${PYTHON_LIBRARIES}
${SHIBOKEN_LIBRARY}
${QT_QTTEST_LIBRARY}
diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt
index cac4fc5..b875913 100644
--- a/tests/QtGui/CMakeLists.txt
+++ b/tests/QtGui/CMakeLists.txt
@@ -30,7 +30,7 @@ PYSIDE_TEST(qitemselection_test.py)
PYSIDE_TEST(qlayout_ref_test.py)
PYSIDE_TEST(qlayout_test.py)
PYSIDE_TEST(qlcdnumber_test.py)
-PYSIDE_TEST(qlistwidg_test.py)
+PYSIDE_TEST(qlistwidget_test.py)
PYSIDE_TEST(qlistwidgetitem_test.py)
PYSIDE_TEST(qmainwindow_test.py)
PYSIDE_TEST(qmatrix_test.py)
diff --git a/tests/QtGui/qlistwidget_test.py b/tests/QtGui/qlistwidget_test.py
new file mode 100644
index 0000000..b473c61
--- /dev/null
+++ b/tests/QtGui/qlistwidget_test.py
@@ -0,0 +1,46 @@
+
+import unittest
+
+import sys
+from PySide import QtGui, QtCore
+from helper import UsesQApplication
+
+class QListWidgetTest(UsesQApplication):
+
+ def populateList(self, lst):
+ o = QtCore.QObject()
+ o.setObjectName("obj")
+
+ item = QtGui.QListWidgetItem("item0")
+ item.setData(QtCore.Qt.UserRole, o)
+ #item._data = o
+ self.assert_(sys.getrefcount(o), 3)
+ self.assert_(sys.getrefcount(item), 2)
+ lst.addItem(item)
+ self.assert_(sys.getrefcount(item), 3)
+
+ def checkCurrentItem(self, lst):
+ item = lst.currentItem()
+ self.assert_(sys.getrefcount(item), 3)
+
+ def checkItemData(self, lst):
+ item = lst.currentItem()
+ o = item.data(QtCore.Qt.UserRole)
+ self.assert_(sys.getrefcount(o), 4)
+ self.assertEqual(o, item._data)
+ self.assert_(sys.getrefcount(o), 2)
+
+ def testConstructorWithParent(self):
+ lst = QtGui.QListWidget()
+ self.populateList(lst)
+ self.checkCurrentItem(lst)
+ i = lst.item(0)
+ self.assert_(sys.getrefcount(i), 3)
+
+ del lst
+ self.assert_(sys.getrefcount(i), 2)
+ del i
+
+
+if __name__ == '__main__':
+ unittest.main()
From 82d1d827557f7f9aadbc4fe1f526ce2162f03621 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Mon, 5 Jul 2010 14:22:08 -0300
Subject: [PATCH 0065/1129] Implemented copy constructor to PyObjectWrapper.
Reviewer: Hugo Parente Lima ,
Luciano Wolf
---
libpyside/signalmanager.cpp | 43 +++++++++++++++++++++++++++++++++++--
libpyside/signalmanager.h | 8 ++++---
2 files changed, 46 insertions(+), 5 deletions(-)
diff --git a/libpyside/signalmanager.cpp b/libpyside/signalmanager.cpp
index 1115d24..f173400 100644
--- a/libpyside/signalmanager.cpp
+++ b/libpyside/signalmanager.cpp
@@ -54,6 +54,39 @@
#define PYTHON_TYPE "PyObject"
+namespace PySide {
+
+PyObjectWrapper::PyObjectWrapper()
+ :m_me(Py_None)
+{
+ Py_INCREF(m_me);
+}
+
+PyObjectWrapper::PyObjectWrapper(PyObject* me)
+ : m_me(me)
+{
+ Py_INCREF(m_me);
+}
+
+PyObjectWrapper::PyObjectWrapper(const PyObjectWrapper &other)
+ : m_me(other.m_me)
+{
+ Py_INCREF(m_me);
+}
+
+PyObjectWrapper::~PyObjectWrapper()
+{
+ Py_DECREF(m_me);
+}
+
+
+PyObjectWrapper::operator PyObject*() const
+{
+ return m_me;
+}
+
+};
+
namespace Shiboken {
template<>
@@ -71,6 +104,7 @@ struct Converter
static PyObject* toPython(const PySide::PyObjectWrapper& obj)
{
+ Py_INCREF(obj);
return obj;
}
};
@@ -335,14 +369,18 @@ int PySide::SignalManager::qt_metacall(QObject* object, QMetaObject::Call call,
Shiboken::GilState gil;
QList paramTypes = method.parameterTypes();
PyObject* self = Shiboken::BindingManager::instance().retrieveWrapper(object);
- Shiboken::AutoDecRef preparedArgs(PyTuple_New(paramTypes.count()));
+ PyObject* preparedArgs = NULL;
+ Py_ssize_t args_size = paramTypes.count();
+
+ if (args_size)
+ preparedArgs = PyTuple_New(args_size);
for (int i = 0, max = paramTypes.count(); i < max; ++i) {
void* data = args[i+1];
const char* dataType = paramTypes[i].constData();
PyObject* arg = Shiboken::TypeResolver::get(dataType)->toPython(data);
- PyTuple_SET_ITEM(preparedArgs.object(), i, arg);
+ PyTuple_SET_ITEM(preparedArgs, i, arg);
}
QString methodName = method.signature();
@@ -358,6 +396,7 @@ int PySide::SignalManager::qt_metacall(QObject* object, QMetaObject::Call call,
} else {
qWarning() << "Dynamic slot" << methodName << "not found!";
}
+ Py_XDECREF(preparedArgs);
}
return -1;
}
diff --git a/libpyside/signalmanager.h b/libpyside/signalmanager.h
index 70d7f08..72acd1d 100644
--- a/libpyside/signalmanager.h
+++ b/libpyside/signalmanager.h
@@ -50,9 +50,11 @@ namespace PySide
class PYSIDE_API PyObjectWrapper
{
public:
- PyObjectWrapper(PyObject* me) : m_me(me) { Py_INCREF(m_me); }
- PyObjectWrapper() : m_me(Py_None) { Py_INCREF(m_me); }
- operator PyObject*() const { return m_me; }
+ PyObjectWrapper();
+ PyObjectWrapper(PyObject* me);
+ PyObjectWrapper(const PyObjectWrapper &other);
+ ~PyObjectWrapper();
+ operator PyObject*() const;
private:
PyObject* m_me;
};
From 2963909063e434936ba095ba9532782e7e3fd518 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Mon, 5 Jul 2010 14:23:09 -0300
Subject: [PATCH 0066/1129] Remove use of deprecated types.
Reviewer: Hugo Parente Lima ,
Luciano Wolf
---
tests/QtDeclarative/qdeclarativeview_test.py | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/tests/QtDeclarative/qdeclarativeview_test.py b/tests/QtDeclarative/qdeclarativeview_test.py
index 8101c5f..7a2b657 100644
--- a/tests/QtDeclarative/qdeclarativeview_test.py
+++ b/tests/QtDeclarative/qdeclarativeview_test.py
@@ -2,8 +2,7 @@
import unittest
-from PySide.QtCore import QUrl, QStringList, QVariant
-from PySide.QtGui import QPushButton
+from PySide.QtCore import QUrl
from PySide.QtDeclarative import QDeclarativeView
from helper import adjust_filename, TimedQApplication
@@ -14,7 +13,7 @@ class TestQDeclarativeView(TimedQApplication):
def testQDeclarativeViewList(self):
view = QDeclarativeView()
- dataList = QStringList(["Item 1", "Item 2", "Item 3", "Item 4"])
+ dataList = ["Item 1", "Item 2", "Item 3", "Item 4"]
ctxt = view.rootContext()
ctxt.setContextProperty("myModel", dataList)
From 01df78dfd8a2f0b6eac8ed4fae2faf1a6592e0c9 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Mon, 5 Jul 2010 10:14:04 -0300
Subject: [PATCH 0067/1129] Remove the removal of isSortignEnabled from QtGui
typesystem.
---
PySide/QtGui/typesystem_gui_common.xml | 4 ----
1 file changed, 4 deletions(-)
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index bb59367..349e078 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -2926,8 +2926,6 @@
-
-
@@ -3886,8 +3884,6 @@
-
-
From 56560943dfc2de0d1df5d2058bcf55ea3c9400ee Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Tue, 6 Jul 2010 10:49:53 -0300
Subject: [PATCH 0068/1129] Typesystem cleanup.
Reviewer: Marcelo Lira
Luciano Wolf
---
PySide/QtCore/typesystem_core.xml | 62 -------------
PySide/QtGui/typesystem_gui_common.xml | 116 ++++--------------------
PySide/QtNetwork/typesystem_network.xml | 47 ++--------
PySide/QtOpenGL/typesystem_opengl.xml | 6 +-
PySide/QtSql/typesystem_sql.xml | 15 +--
PySide/QtXml/typesystem_xml.xml | 29 +-----
6 files changed, 37 insertions(+), 238 deletions(-)
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 5b9ea30..5fe62ed 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -173,32 +173,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -221,12 +195,10 @@
-
-
@@ -446,40 +418,10 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -507,9 +449,6 @@
-
-
-
@@ -1328,7 +1267,6 @@
-
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index 349e078..36493e3 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -102,7 +102,6 @@
-
@@ -428,7 +427,6 @@
-
@@ -447,7 +445,6 @@
-
@@ -457,61 +454,36 @@
-
-
-
+
-
-
-
-
-
-
+
+
-
-
-
+
-
-
-
-
-
-
+
+
-
-
-
+
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
@@ -519,12 +491,8 @@
-
-
-
-
-
-
+
+
@@ -543,11 +511,8 @@
-
-
-
+
-
@@ -558,8 +523,6 @@
-
-
@@ -569,7 +532,6 @@
-
@@ -582,7 +544,6 @@
-
@@ -595,9 +556,7 @@
-
-
-
+
@@ -608,7 +567,6 @@
-
@@ -633,7 +591,6 @@
-
@@ -651,12 +608,10 @@
-
-
@@ -692,7 +647,6 @@
-
@@ -717,7 +671,6 @@
-
@@ -763,7 +716,6 @@
-
@@ -777,9 +729,7 @@
-
-
-
+
@@ -795,7 +745,6 @@
-
@@ -806,7 +755,6 @@
-
@@ -822,7 +770,6 @@
-
@@ -850,7 +797,6 @@
-
@@ -861,10 +807,8 @@
-
-
@@ -874,8 +818,6 @@
-
-
@@ -1141,9 +1083,6 @@
}
-
-
-
@@ -1250,14 +1189,10 @@
-
-
-
-
-
+
@@ -1567,8 +1502,6 @@
-
-
@@ -1581,10 +1514,7 @@
-
-
-
-
+
@@ -2059,7 +1989,6 @@
-
@@ -2071,7 +2000,6 @@
-
@@ -2987,7 +2915,6 @@
-
@@ -3008,7 +2935,6 @@
-
@@ -3036,7 +2962,6 @@
-
@@ -3048,7 +2973,6 @@
-
@@ -3090,7 +3014,6 @@
-
@@ -3167,7 +3090,6 @@
-
diff --git a/PySide/QtNetwork/typesystem_network.xml b/PySide/QtNetwork/typesystem_network.xml
index 596aa2c..9a56b74 100644
--- a/PySide/QtNetwork/typesystem_network.xml
+++ b/PySide/QtNetwork/typesystem_network.xml
@@ -137,8 +137,6 @@
-
-
@@ -177,61 +175,36 @@
-
-
-
-
-
-
+
-
-
-
+
-
-
-
+
-
-
-
+
-
-
-
+
-
-
-
+
-
-
-
-
-
-
+
+
-
-
-
+
-
-
-
-
-
+
diff --git a/PySide/QtOpenGL/typesystem_opengl.xml b/PySide/QtOpenGL/typesystem_opengl.xml
index c2f3ba3..202b115 100644
--- a/PySide/QtOpenGL/typesystem_opengl.xml
+++ b/PySide/QtOpenGL/typesystem_opengl.xml
@@ -18,16 +18,12 @@
-
-
-
-
-
+
diff --git a/PySide/QtSql/typesystem_sql.xml b/PySide/QtSql/typesystem_sql.xml
index 31cc8d3..7c15c69 100644
--- a/PySide/QtSql/typesystem_sql.xml
+++ b/PySide/QtSql/typesystem_sql.xml
@@ -21,7 +21,6 @@
-
@@ -44,7 +43,6 @@
-
@@ -59,24 +57,17 @@
-
-
-
-
+
-
-
-
+
-
-
-
+
diff --git a/PySide/QtXml/typesystem_xml.xml b/PySide/QtXml/typesystem_xml.xml
index 5c0811e..40b3879 100644
--- a/PySide/QtXml/typesystem_xml.xml
+++ b/PySide/QtXml/typesystem_xml.xml
@@ -16,23 +16,19 @@
-->
-
-
+
-
-
-
@@ -46,7 +42,6 @@
-
@@ -189,55 +184,41 @@
-
-
-
-
-
-
-
+
-
-
-
+
-
-
-
-
+
-
-
-
@@ -253,8 +234,6 @@
-
From 154831efcf8d07932389ef8149c397357a0939b4 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Tue, 6 Jul 2010 18:45:10 -0300
Subject: [PATCH 0069/1129] Fix typo.
Reviewer: Marcelo Lira
Luciano Wolf
---
PySide/QtXml/typesystem_xml.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/PySide/QtXml/typesystem_xml.xml b/PySide/QtXml/typesystem_xml.xml
index 40b3879..e31f808 100644
--- a/PySide/QtXml/typesystem_xml.xml
+++ b/PySide/QtXml/typesystem_xml.xml
@@ -16,7 +16,7 @@
-->
-
+
From c737f90c1ddbe19cbbe93cb3915e14df59f97444 Mon Sep 17 00:00:00 2001
From: Luciano Wolf
Date: Wed, 7 Jul 2010 13:52:55 -0300
Subject: [PATCH 0070/1129] Fix qApp macro implementation.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Reviewer: Renato Araújo
Hugo Lima
---
PySide/QtGui/glue/qapplication_init.cpp | 8 ++++----
tests/QtGui/qapp_test.py | 10 ++++++----
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/PySide/QtGui/glue/qapplication_init.cpp b/PySide/QtGui/glue/qapplication_init.cpp
index 112b8e0..5c87af3 100644
--- a/PySide/QtGui/glue/qapplication_init.cpp
+++ b/PySide/QtGui/glue/qapplication_init.cpp
@@ -41,11 +41,11 @@ int SbkQApplication_Init(PyObject* self, PyObject* args, PyObject*)
// Verify if qApp is in main module
const char QAPP_MACRO[] = "qApp";
- PyObject* localsDict = PyEval_GetLocals();
- if (localsDict) {
- PyObject* qAppObj = PyDict_GetItemString(localsDict, QAPP_MACRO);
+ PyObject* globalsDict = PyEval_GetGlobals();
+ if (globalsDict) {
+ PyObject* qAppObj = PyDict_GetItemString(globalsDict, QAPP_MACRO);
if (qAppObj)
- PyDict_SetItemString(localsDict, QAPP_MACRO, self);
+ PyDict_SetItemString(globalsDict, QAPP_MACRO, self);
}
PyObject_SetAttrString(moduleQtGui, QAPP_MACRO, self);
diff --git a/tests/QtGui/qapp_test.py b/tests/QtGui/qapp_test.py
index c371492..fd1d60f 100644
--- a/tests/QtGui/qapp_test.py
+++ b/tests/QtGui/qapp_test.py
@@ -3,15 +3,17 @@
import unittest
-from PySide import QtGui
+from PySide.QtGui import *
class QAppPresence(unittest.TestCase):
def testQApp(self):
#QtGui.qApp variable is instance of QApplication
- self.assert_(isinstance(QtGui.qApp, QtGui.QApplication))
+ self.assert_(isinstance(qApp, QApplication))
+def main():
+ app = QApplication([])
+ unittest.main()
if __name__ == '__main__':
- app = QtGui.QApplication([])
- unittest.main()
+ main()
From 83db5730319cc258e683a12567ba9362dbd07d45 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Mon, 5 Jul 2010 18:08:25 -0300
Subject: [PATCH 0071/1129] Use original name in type discovery during
signal/slot.
Reviewer: Hugo Parente Lima ,
Luciano Wolf
---
libpyside/qsignal.cpp | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/libpyside/qsignal.cpp b/libpyside/qsignal.cpp
index aa211a7..b19c565 100644
--- a/libpyside/qsignal.cpp
+++ b/libpyside/qsignal.cpp
@@ -243,14 +243,20 @@ void signalUpdateSource(PyObject* source)
char* signal_get_type_name(PyObject* type)
{
if (PyType_Check(type)) {
- //tp_name return the full name
- Shiboken::AutoDecRef typeName(PyObject_GetAttrString(type, "__name__"));
- char *aux = strdup(PyString_AS_STRING(typeName.object()));
- if (Shiboken::TypeResolver::getType(aux) == Shiboken::TypeResolver::ObjectType) {
- aux = reinterpret_cast(realloc(aux, strlen(aux) + 1));
- aux = strcat(aux, "*");
+ char *typeName = NULL;
+ if (type->ob_type == &Shiboken::SbkBaseWrapperType_Type) {
+ Shiboken::SbkBaseWrapperType *objType = reinterpret_cast(type);
+ typeName = strdup(objType->original_name);
+ } else {
+ //tp_name return the full name
+ Shiboken::AutoDecRef otypeName(PyObject_GetAttrString(type, "__name__"));
+ typeName = strdup(PyString_AS_STRING(otypeName.object()));
}
- return aux;
+ if (Shiboken::TypeResolver::getType(typeName) == Shiboken::TypeResolver::ObjectType) {
+ typeName = reinterpret_cast(realloc(typeName, strlen(typeName) + 1));
+ typeName = strcat(typeName, "*");
+ }
+ return typeName;
} else if (PyString_Check(type)) {
return strdup(PyString_AS_STRING(type));
}
From 693ae6d6c4073a483524af48e7a1a0ad1fba1131 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Thu, 8 Jul 2010 10:47:24 -0300
Subject: [PATCH 0072/1129] Modify multiple connections test to avoid use more
then 50 slots supported by PySide.
Reviewer: Hugo Parente Lima ,
Luciano Wolf
---
tests/signals/multiple_connections_gui_test.py | 16 +++++-----------
tests/signals/multiple_connections_test.py | 17 ++++-------------
2 files changed, 9 insertions(+), 24 deletions(-)
diff --git a/tests/signals/multiple_connections_gui_test.py b/tests/signals/multiple_connections_gui_test.py
index 72feac0..3bff7c3 100644
--- a/tests/signals/multiple_connections_gui_test.py
+++ b/tests/signals/multiple_connections_gui_test.py
@@ -12,11 +12,6 @@ except ImportError:
from helper import BasicPySlotCase, UsesQApplication
-def random_gen(count=100, largest=99, lowest=0):
- for i in range(count):
- yield random.randint(lowest, largest)
-
-
class MultipleSignalConnections(unittest.TestCase):
'''Base class for multiple signal connection testing'''
@@ -55,12 +50,11 @@ if hasQtGui:
def testSpinBoxValueChanged(self):
"""Multiple connections to QSpinBox.valueChanged(int)"""
- for test in random_gen(10):
- sender = QSpinBox()
- #FIXME if number of receivers if higher than 50, segfaults
- receivers = [BasicPySlotCase() for x in range(10)]
- self.run_many(sender, 'valueChanged(int)', sender.setValue,
- receivers, (test,))
+ sender = QSpinBox()
+ #FIXME if number of receivers if higher than 50, segfaults
+ receivers = [BasicPySlotCase() for x in range(10)]
+ self.run_many(sender, 'valueChanged(int)', sender.setValue,
+ receivers, (1,))
if __name__ == '__main__':
unittest.main()
diff --git a/tests/signals/multiple_connections_test.py b/tests/signals/multiple_connections_test.py
index 5daeaab..57ea898 100644
--- a/tests/signals/multiple_connections_test.py
+++ b/tests/signals/multiple_connections_test.py
@@ -1,7 +1,6 @@
import sys
import unittest
-import random
from functools import partial
from PySide.QtCore import QObject, SIGNAL, QProcess
@@ -9,11 +8,6 @@ from PySide.QtCore import QObject, SIGNAL, QProcess
from helper import BasicPySlotCase, UsesQCoreApplication
-def random_gen(count=50, largest=49, lowest=0):
- for i in range(count):
- yield random.randint(lowest, largest)
-
-
class MultipleSignalConnections(unittest.TestCase):
'''Base class for multiple signal connection testing'''
@@ -28,10 +22,9 @@ class MultipleSignalConnections(unittest.TestCase):
if args is None:
args = tuple()
-
for rec in receivers:
rec.setUp()
- QObject.connect(sender, SIGNAL(signal), rec.cb)
+ self.assert_(QObject.connect(sender, SIGNAL(signal), rec.cb))
rec.args = tuple(args)
emitter(*args)
@@ -49,11 +42,9 @@ class PythonMultipleSlots(UsesQCoreApplication, MultipleSignalConnections):
class Dummy(QObject):
pass
- for test in random_gen(20):
- sender = Dummy()
- receivers = [BasicPySlotCase() for x in range(10)]
- self.run_many(sender, 'foobar', partial(sender.emit,
- SIGNAL('foobar')), receivers, (test, ))
+ sender = Dummy()
+ receivers = [BasicPySlotCase() for x in range(10)]
+ self.run_many(sender, 'foobar', partial(sender.emit,SIGNAL('foobar')), receivers, (0, ))
class QProcessMultipleSlots(UsesQCoreApplication, MultipleSignalConnections):
From 1c4ee915c07daae9919e890072593b51e54c9aec Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Tue, 6 Jul 2010 18:44:00 -0300
Subject: [PATCH 0073/1129] Implemented support to properties on QMetaObject.
Reviewer: Hugo Parente Lima ,
Luciano Wolf
---
libpyside/CMakeLists.txt | 2 +
libpyside/dynamicqmetaobject.cpp | 242 ++++++++++++++++++++---
libpyside/dynamicqmetaobject.h | 21 ++
libpyside/pyside.cpp | 3 +
libpyside/qproperty.cpp | 318 +++++++++++++++++++++++++++++++
libpyside/qproperty.h | 187 ++++++++++++++++++
libpyside/qsignal.cpp | 5 +-
libpyside/signalmanager.cpp | 83 +++++++-
libpyside/signalmanager.h | 2 +
tests/QtScript/CMakeLists.txt | 1 +
tests/QtScript/property_test.py | 62 ++++++
11 files changed, 893 insertions(+), 33 deletions(-)
create mode 100644 libpyside/qproperty.cpp
create mode 100644 libpyside/qproperty.h
create mode 100644 tests/QtScript/property_test.py
diff --git a/libpyside/CMakeLists.txt b/libpyside/CMakeLists.txt
index efbe1f2..57ecb80 100644
--- a/libpyside/CMakeLists.txt
+++ b/libpyside/CMakeLists.txt
@@ -6,6 +6,7 @@ signalmanager.cpp
globalreceiver.cpp
qsignal.cpp
qslot.cpp
+qproperty.cpp
pyside.cpp
)
@@ -36,6 +37,7 @@ set(libpyside_HEADERS
signalmanager.h
pyside.h
qsignal.h
+ qproperty.h
)
# create pkg-config file
diff --git a/libpyside/dynamicqmetaobject.cpp b/libpyside/dynamicqmetaobject.cpp
index 562f2d4..8f97b56 100644
--- a/libpyside/dynamicqmetaobject.cpp
+++ b/libpyside/dynamicqmetaobject.cpp
@@ -43,11 +43,36 @@
#include
#include "qsignal.h"
+#include "qproperty.h"
#define MAX_SIGNALS_COUNT 50
+#define MAX_SLOTS_COUNT 50
using namespace PySide;
+enum PropertyFlags {
+ Invalid = 0x00000000,
+ Readable = 0x00000001,
+ Writable = 0x00000002,
+ Resettable = 0x00000004,
+ EnumOrFlag = 0x00000008,
+ StdCppSet = 0x00000100,
+// Override = 0x00000200,
+ Constant = 0x00000400,
+ Final = 0x00000800,
+ Designable = 0x00001000,
+ ResolveDesignable = 0x00002000,
+ Scriptable = 0x00004000,
+ ResolveScriptable = 0x00008000,
+ Stored = 0x00010000,
+ ResolveStored = 0x00020000,
+ Editable = 0x00040000,
+ ResolveEditable = 0x00080000,
+ User = 0x00100000,
+ ResolveUser = 0x00200000,
+ Notify = 0x00400000
+};
+
static int registerString(const QByteArray& s, QList* strings)
{
int idx = 0;
@@ -61,6 +86,89 @@ static int registerString(const QByteArray& s, QList* strings)
return idx;
}
+static int qvariant_nameToType(const char* name)
+{
+ if (!name)
+ return 0;
+
+ if (strcmp(name, "QVariant") == 0)
+ return 0xffffffff;
+ if (strcmp(name, "QCString") == 0)
+ return QMetaType::QByteArray;
+ if (strcmp(name, "Q_LLONG") == 0)
+ return QMetaType::LongLong;
+ if (strcmp(name, "Q_ULLONG") == 0)
+ return QMetaType::ULongLong;
+ if (strcmp(name, "QIconSet") == 0)
+ return QMetaType::QIcon;
+
+ uint tp = QMetaType::type(name);
+ return tp < QMetaType::User ? tp : 0;
+}
+
+/*
+ Returns true if the type is a QVariant types.
+*/
+static bool isVariantType(const char* type)
+{
+ return qvariant_nameToType(type) != 0;
+}
+
+/*!
+ Returns true if the type is qreal.
+*/
+static bool isQRealType(const char *type)
+{
+ return strcmp(type, "qreal") == 0;
+}
+
+uint PropertyData::flags() const
+{
+ const char* typeName = type().data();
+ uint flags = Invalid;
+ if (!isVariantType(typeName))
+ flags |= EnumOrFlag;
+ else if (!isQRealType(typeName))
+ flags |= qvariant_nameToType(typeName) << 24;
+
+ if (qproperty_is_readble(m_data))
+ flags |= Readable;
+
+ if (qproperty_is_writable(m_data))
+ flags |= Writable;
+
+ if (qproperty_has_reset(m_data))
+ flags |= Resettable;
+
+ if (!qproperty_is_designable(m_data))
+ flags |= ResolveDesignable;
+ else
+ flags |= Designable;
+
+ if (!qproperty_is_scriptable(m_data))
+ flags |= ResolveScriptable;
+ else
+ flags |= Scriptable;
+
+ if (!qproperty_is_stored(m_data))
+ flags |= ResolveStored;
+ else
+ flags |= Stored;
+
+ if (!qproperty_is_user(m_data))
+ flags |= ResolveUser;
+ else
+ flags |= User;
+
+ if (qproperty_is_constant(m_data))
+ flags |= Constant;
+
+ if (qproperty_is_final(m_data))
+ flags |= Final;
+
+ return flags;
+}
+
MethodData::MethodData(const char* signature, const char* type)
{
m_signature = QSharedPointer(new QByteArray(signature));
@@ -107,6 +215,39 @@ bool MethodData::isValid() const
return m_signature->size();
}
+
+PropertyData::PropertyData(const char* name, PyObject* data)
+ : m_name(name), m_data(data)
+{
+}
+
+QByteArray PropertyData::type() const
+{
+ return QByteArray(qproperty_get_type(m_data));
+}
+
+
+bool PropertyData::isValid() const
+{
+ return !m_name.isEmpty();
+}
+
+QByteArray PropertyData::name() const
+{
+ return m_name;
+}
+
+bool PropertyData::operator==(const PropertyData& other) const
+{
+ return m_data == other.m_data;
+}
+
+bool PropertyData::operator==(const char* name) const
+{
+ return m_name == QString(name);
+}
+
+
DynamicQMetaObject::DynamicQMetaObject(const char* className, const QMetaObject* metaObject)
{
d.superdata = metaObject;
@@ -153,6 +294,10 @@ void DynamicQMetaObject::addSlot(const char* slot, const char* type)
if (i != m_slots.end())
return;
+ if (m_slots.size() >= MAX_SLOTS_COUNT) {
+ qWarning() << "Fail to add dynamic slot to QObject. PySide support at most" << MAX_SLOTS_COUNT << "dynamic slots.";
+ return;
+ }
//search for a empty space
MethodData blank;
@@ -177,6 +322,24 @@ void DynamicQMetaObject::removeSlot(uint index)
}
}
+void DynamicQMetaObject::addProperty(const char* property, PyObject* data)
+{
+ QLinkedList::iterator i = qFind(m_properties.begin(), m_properties.end(), property);
+ if (i != m_properties.end())
+ return;
+
+ //search for a empty space
+ PropertyData blank;
+ i = qFind(m_properties.begin(), m_properties.end(), blank);
+ if (i != m_properties.end()) {
+ *i = PropertyData(property, data);
+ } else {
+ m_properties << PropertyData(property, data);
+ }
+ updateMetaObject();
+}
+
+
DynamicQMetaObject* DynamicQMetaObject::createBasedOn(PyObject* pyObj, PyTypeObject* type, const QMetaObject* base)
{
PyObject* key;
@@ -189,6 +352,11 @@ DynamicQMetaObject* DynamicQMetaObject::createBasedOn(PyObject* pyObj, PyTypeObj
while (PyDict_Next(type->tp_dict, &pos, &key, &value)) {
+ //Register properties
+ if (value->ob_type == &QProperty_Type) {
+ mo->addProperty(PyString_AsString(key), value);
+ }
+
//Register signals
if (value->ob_type == &Signal_Type) {
PyObject *attr = PyObject_GetAttr(pyObj, key);
@@ -234,6 +402,35 @@ void DynamicQMetaObject::removeSignal(uint index)
}
}
+void DynamicQMetaObject::writeMethodsData(QLinkedList& methods,
+ unsigned int **data,
+ QList *strings,
+ int *prtIndex,
+ int max_count,
+ int null_index,
+ int flags)
+{
+ int index = *prtIndex;
+
+ QLinkedList::iterator iMethod = methods.begin();
+ for(int i=0; i < max_count; i++) {
+ QByteArray mType;
+ if (iMethod != methods.end() && ((*iMethod).signature().size() > 0) ) {
+ (*data)[index++] = registerString((*iMethod).signature(), strings); // func name
+ mType = (*iMethod).type();
+ iMethod++;
+ } else {
+ (*data)[index++] = null_index; // func name
+ }
+ (*data)[index++] = null_index; // arguments
+ (*data)[index++] = (mType.size() > 0 ? registerString(mType, strings) : null_index); // normalized type
+ (*data)[index++] = null_index; // tags
+ (*data)[index++] = flags;
+ }
+
+ *prtIndex = index;
+}
+
void DynamicQMetaObject::updateMetaObject()
{
// these values are from moc source code, generator.cpp:66
@@ -251,22 +448,23 @@ void DynamicQMetaObject::updateMetaObject()
};
uint n_signals = MAX_SIGNALS_COUNT;
- uint n_methods = n_signals + m_slots.count();
+ uint n_methods = n_signals + MAX_SLOTS_COUNT;
+ uint n_properties = m_properties.size();
int header[] = {5, // revision
0, // class name index in m_metadata
0, 0, // classinfo and classinfo index, not used by us
n_methods, 0, // method count and method list index
- 0, 0, // prop count and prop indexes
+ n_properties, 0, // prop count and prop indexes
0, 0, // enum count and enum index
0, 0, // constructors
- MAX_SIGNALS_COUNT};
+ n_signals};
const int HEADER_LENGHT = sizeof(header)/sizeof(int);
header[5] = HEADER_LENGHT;
// header size + 5 indexes per method + an ending zero
delete[] d.data;
unsigned int* data;
- data = new unsigned int[HEADER_LENGHT + n_methods*5 + 1];
+ data = new unsigned int[HEADER_LENGHT + n_methods*5 + n_properties*3 + 1];
std::memcpy(data, header, sizeof(header));
QList strings;
@@ -275,35 +473,25 @@ void DynamicQMetaObject::updateMetaObject()
int index = HEADER_LENGHT;
//write signals
- QLinkedList::iterator iSignal = m_signals.begin();
- for(int i=0; i < MAX_SIGNALS_COUNT; i++) {
- QByteArray sigType;
- if (iSignal != m_signals.end() && ((*iSignal).signature().size() > 0) ) {
- data[index++] = registerString((*iSignal).signature(), &strings); // func name
- sigType = (*iSignal).type();
- iSignal++;
- } else {
- data[index++] = NULL_INDEX; // func name
- }
- data[index++] = NULL_INDEX; // arguments
- data[index++] = (sigType.size() > 0 ? registerString(sigType, &strings) : NULL_INDEX); // normalized type
- data[index++] = NULL_INDEX; // tags
- data[index++] = AccessPublic | MethodSignal; // flags
- }
-
+ writeMethodsData(m_signals, &data, &strings, &index, MAX_SIGNALS_COUNT, NULL_INDEX, AccessPublic | MethodSignal);
//write slots
- foreach(MethodData slot, m_slots) {
- if (slot.isValid())
- data[index++] = registerString(slot.signature(), &strings); // func name
+ writeMethodsData(m_slots, &data, &strings, &index, MAX_SLOTS_COUNT, NULL_INDEX, AccessPublic | MethodSlot);
+
+ if (m_properties.size())
+ data[7] = index;
+
+ //write properties
+ foreach(PropertyData pp, m_properties) {
+ if (pp.isValid())
+ data[index++] = registerString(pp.name(), &strings); // name
else
data[index++] = NULL_INDEX;
- data[index++] = NULL_INDEX; // arguments
- data[index++] = (slot.isValid() ? registerString(slot.type(), &strings) : NULL_INDEX); // normalized type
- data[index++] = NULL_INDEX; // tags
- data[index++] = AccessPublic | MethodSlot; // flags
+ data[index++] = (pp.isValid() ? registerString(pp.type(), &strings) : NULL_INDEX); // normalized type
+ data[index++] = pp.flags(); //pp.flags(); //TODO: flags
}
+
data[index++] = 0; // the end
// create the m_metadata string
diff --git a/libpyside/dynamicqmetaobject.h b/libpyside/dynamicqmetaobject.h
index 69027f2..23a69c9 100644
--- a/libpyside/dynamicqmetaobject.h
+++ b/libpyside/dynamicqmetaobject.h
@@ -66,6 +66,23 @@ private:
QSharedPointer m_type;
};
+class PropertyData
+{
+public:
+ PropertyData(){}
+ PropertyData(const char*name, PyObject *data);
+ QByteArray name() const;
+ QByteArray type() const;
+ uint flags() const;
+ bool isValid() const;
+ bool operator==(const PropertyData& other) const;
+ bool operator==(const char* name) const;
+
+private:
+ QByteArray m_name;
+ PyObject* m_data;
+};
+
class PYSIDE_API DynamicQMetaObject : public QMetaObject
{
public:
@@ -74,9 +91,11 @@ public:
void addSignal(const char* signal, const char* type=0);
void addSlot(const char* slot, const char* type=0);
+ void addProperty(const char* property, PyObject* data);
void removeSignal(uint idex);
void removeSlot(uint index);
+ void removeProperty(uint index);
//Retrieve Python metadata to create QMetaObject (class name, signals, slot)
static DynamicQMetaObject* createBasedOn(PyObject* obj, PyTypeObject* type, const QMetaObject* base);
@@ -84,9 +103,11 @@ public:
private:
QLinkedList m_signals;
QLinkedList m_slots;
+ QLinkedList m_properties;
QByteArray m_className;
void updateMetaObject();
+ void writeMethodsData(QLinkedList& methods, unsigned int **data, QList *strings, int *index, int max_count, int null_index, int flags);
};
PYSIDE_API inline void deleteDynamicQMetaObject(void* data)
diff --git a/libpyside/pyside.cpp b/libpyside/pyside.cpp
index 93271c8..744dfee 100644
--- a/libpyside/pyside.cpp
+++ b/libpyside/pyside.cpp
@@ -35,9 +35,11 @@
#include "pyside.h"
#include "signalmanager.h"
+#include "qproperty.h"
extern "C" void init_signal(PyObject* module);
extern "C" void init_slot(PyObject* module);
+extern "C" void init_qproperty(PyObject* module);
namespace PySide
{
@@ -46,6 +48,7 @@ void init(PyObject *module)
{
init_signal(module);
init_slot(module);
+ init_qproperty(module);
// Init signal manager, so it will register some meta types used by QVariant.
SignalManager::instance();
}
diff --git a/libpyside/qproperty.cpp b/libpyside/qproperty.cpp
new file mode 100644
index 0000000..781c8cf
--- /dev/null
+++ b/libpyside/qproperty.cpp
@@ -0,0 +1,318 @@
+/*
+ * This file is part of the Shiboken Python Bindings Generator project.
+ *
+ * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * Contact: PySide team
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation. Please
+ * review the following information to ensure the GNU Lesser General
+ * Public License version 2.1 requirements will be met:
+ * http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ *
+ * As a special exception to the GNU Lesser General Public License
+ * version 2.1, the object code form of a "work that uses the Library"
+ * may incorporate material from a header file that is part of the
+ * Library. You may distribute such object code under terms of your
+ * choice, provided that the incorporated material (i) does not exceed
+ * more than 5% of the total size of the Library; and (ii) is limited to
+ * numerical parameters, data structure layouts, accessors, macros,
+ * inline functions and templates.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include
+#include
+#include
+
+#include "qproperty.h"
+
+
+#define QPROPERTY_CLASS_NAME "QProperty"
+
+namespace PySide
+{
+
+extern "C"
+{
+
+typedef struct {
+ PyObject_HEAD
+ char* typeName;
+ PyObject* type;
+ PyObject* fget;
+ PyObject* fset;
+ PyObject* freset;
+ PyObject* fdel;
+ char* doc;
+ bool designable;
+ bool scriptable;
+ bool stored;
+ bool user;
+ bool constant;
+ bool final;
+} QPropertyData;
+
+static int qproperty_init(PyObject*, PyObject*, PyObject*);
+static void qproperty_free(void*);
+
+//aux
+static char* translate_type_name(PyObject*);
+
+PyTypeObject QProperty_Type = {
+ PyObject_HEAD_INIT(0)
+ 0, /*ob_size*/
+ QPROPERTY_CLASS_NAME, /*tp_name*/
+ sizeof(QPropertyData), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ 0, /*tp_dealloc*/
+ 0, /*tp_print*/
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ 0, /*tp_compare*/
+ 0, /*tp_repr*/
+ 0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash */
+ 0, /*tp_call*/
+ 0, /*tp_str*/
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ 0, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT, /*tp_flags*/
+ 0, /*tp_doc */
+ 0, /*tp_traverse */
+ 0, /*tp_clear */
+ 0, /*tp_richcompare */
+ 0, /*tp_weaklistoffset */
+ 0, /*tp_iter */
+ 0, /*tp_iternext */
+ 0, /*tp_methods */
+ 0, /*tp_members */
+ 0, /*tp_getset */
+ 0, /*tp_base */
+ 0, /*tp_dict */
+ 0, /*tp_descr_get */
+ 0, /*tp_descr_set */
+ 0, /*tp_dictoffset */
+ (initproc)qproperty_init, /*tp_init */
+ 0, /*tp_alloc */
+ PyType_GenericNew, /*tp_new */
+ qproperty_free, /*tp_free */
+ 0, /*tp_is_gc */
+ 0, /*tp_bases */
+ 0, /*tp_mro */
+ 0, /*tp_cache */
+ 0, /*tp_subclasses */
+ 0, /*tp_weaklist */
+ 0, /*tp_del */
+};
+
+void init_qproperty(PyObject* module)
+{
+ if (PyType_Ready(&QProperty_Type) < 0)
+ return;
+
+ Py_INCREF(&QProperty_Type);
+ PyModule_AddObject(module, QPROPERTY_CLASS_NAME, ((PyObject*)&QProperty_Type));
+}
+
+} // extern "C"
+
+int qproperty_init(PyObject* self, PyObject* args, PyObject* kwds)
+{
+ PyObject* type = 0;
+ QPropertyData *data = reinterpret_cast(self);
+ data->designable = true;
+ data->scriptable = true;
+ data->stored = true;
+
+ static const char *kwlist[] = {"fget", "fset", "freset", "fdel", "doc",
+ "designable", "scriptable", "stored", "user",
+ "constant", "final", 0};
+ if (!PyArg_ParseTupleAndKeywords(args, kwds,
+ "O|OOOOsbbbbbb:QtCore.QProperty", (char**) kwlist,
+ &type, &data->fget, &data->fset, &data->freset,
+ &data->fdel, &data->doc, &data->designable,
+ &data->scriptable, &data->stored, &data->user,
+ &data->constant, &data->final))
+ return 0;
+
+ if (!data->fset && data->fget)
+ data->constant = true;
+
+ data->typeName = translate_type_name(type);
+ return 1;
+}
+
+void qproperty_free(void *self)
+{
+ PyObject *pySelf = reinterpret_cast(self);
+ QPropertyData *data = reinterpret_cast(self);
+
+ free(data->typeName);
+ free(data->doc);
+
+ pySelf->ob_type->tp_base->tp_free(self);
+}
+
+bool isQPropertyType(PyObject* pyObj)
+{
+ if (pyObj) {
+ return pyObj->ob_type == &QProperty_Type;
+ }
+ return false;
+}
+
+int qproperty_set(PyObject* self, PyObject* source, PyObject* value)
+{
+ QPropertyData *data = reinterpret_cast(self);
+ if (data->fset) {
+ Shiboken::AutoDecRef args(PyTuple_New(2));
+ PyTuple_SET_ITEM(args, 0, source);
+ PyTuple_SET_ITEM(args, 1, value);
+ Py_INCREF(source);
+ Py_INCREF(value);
+ Shiboken::AutoDecRef result(PyObject_CallObject(data->fset, args));
+ return (result.isNull() ? -1 : 0);
+ }
+ return -1;
+}
+
+PyObject* qproperty_get(PyObject* self, PyObject* source)
+{
+ QPropertyData *data = reinterpret_cast(self);
+ if (data->fget) {
+ Shiboken::AutoDecRef args(PyTuple_New(1));
+ Py_INCREF(source);
+ PyTuple_SET_ITEM(args, 0, source);
+ PyObject *ret = PyObject_CallObject(data->fget, args);
+ if (!ret) {
+ PyErr_Print();
+ }
+ return ret;
+ }
+ return 0;
+}
+
+int qproperty_reset(PyObject* self, PyObject* source)
+{
+ QPropertyData *data = reinterpret_cast(self);
+ if (data->freset) {
+ Shiboken::AutoDecRef args(PyTuple_New(1));
+ Py_INCREF(source);
+ PyTuple_SET_ITEM(args, 0, source);
+ Shiboken::AutoDecRef result(PyObject_CallObject(data->freset, args));
+ return (result.isNull() ? -1 : 0);
+ }
+ return -1;
+}
+
+
+const char* qproperty_get_type(PyObject* self)
+{
+ QPropertyData *data = reinterpret_cast(self);
+ return data->typeName;
+}
+
+PyObject* qproperty_get_object(PyObject* source, PyObject* name)
+{
+ if (PyObject_HasAttr(source, name)) {
+ PyObject* attr = PyObject_GenericGetAttr(source, name);
+ if (isQPropertyType(attr))
+ return attr;
+ Py_DECREF(attr);
+ }
+ return 0;
+}
+
+char* translate_type_name(PyObject* type)
+{
+ if (PyType_Check(type)) {
+ char *typeName = NULL;
+ if (type->ob_type == &Shiboken::SbkBaseWrapperType_Type) {
+ Shiboken::SbkBaseWrapperType *objType = reinterpret_cast(type);
+ typeName = strdup(objType->original_name);
+ } else {
+ //tp_name return the full name
+ Shiboken::AutoDecRef otypeName(PyObject_GetAttrString(type, "__name__"));
+ typeName = strdup(PyString_AS_STRING(otypeName.object()));
+ }
+ if (Shiboken::TypeResolver::getType(typeName) == Shiboken::TypeResolver::ObjectType) {
+ typeName = reinterpret_cast(realloc(typeName, strlen(typeName) + 1));
+ typeName = strcat(typeName, "*");
+ }
+ return typeName;
+ } else if (PyString_Check(type)) {
+ return strdup(PyString_AS_STRING(type));
+ }
+ return 0;
+}
+
+bool qproperty_is_readble(PyObject* self)
+{
+ QPropertyData *data = reinterpret_cast(self);
+ return (data->fget != 0);
+}
+
+bool qproperty_is_writable(PyObject* self)
+{
+ QPropertyData *data = reinterpret_cast(self);
+ return (data->fset != 0);
+}
+
+bool qproperty_has_reset(PyObject* self)
+{
+ QPropertyData *data = reinterpret_cast(self);
+ return (data->freset != 0);
+}
+
+bool qproperty_is_designable(PyObject* self)
+{
+ QPropertyData *data = reinterpret_cast(self);
+ return data->designable;
+}
+
+bool qproperty_is_scriptable(PyObject* self)
+{
+ QPropertyData *data = reinterpret_cast(self);
+ return data->scriptable;
+}
+
+bool qproperty_is_stored(PyObject* self)
+{
+ QPropertyData *data = reinterpret_cast(self);
+ return data->stored;
+}
+
+bool qproperty_is_user(PyObject* self)
+{
+ QPropertyData *data = reinterpret_cast(self);
+ return data->user;
+}
+
+bool qproperty_is_constant(PyObject* self)
+{
+ QPropertyData *data = reinterpret_cast(self);
+ return data->constant;
+}
+
+bool qproperty_is_final(PyObject* self)
+{
+ QPropertyData *data = reinterpret_cast(self);
+ return data->final;
+}
+
+} //namespace PySide
diff --git a/libpyside/qproperty.h b/libpyside/qproperty.h
new file mode 100644
index 0000000..7e0e1bc
--- /dev/null
+++ b/libpyside/qproperty.h
@@ -0,0 +1,187 @@
+/*
+ * This file is part of the Shiboken Python Bindings Generator project.
+ *
+ * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * Contact: PySide team
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation. Please
+ * review the following information to ensure the GNU Lesser General
+ * Public License version 2.1 requirements will be met:
+ * http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ *
+ * As a special exception to the GNU Lesser General Public License
+ * version 2.1, the object code form of a "work that uses the Library"
+ * may incorporate material from a header file that is part of the
+ * Library. You may distribute such object code under terms of your
+ * choice, provided that the incorporated material (i) does not exceed
+ * more than 5% of the total size of the Library; and (ii) is limited to
+ * numerical parameters, data structure layouts, accessors, macros,
+ * inline functions and templates.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#ifndef PYSIDE_PROPERTY_H
+#define PYSIDE_PROPERTY_H
+
+#include
+#include
+#include
+
+namespace PySide
+{
+
+extern "C"
+{
+ PyAPI_DATA(PyTypeObject) QProperty_Type;
+}; //extern "C"
+
+PYSIDE_API bool isQPropertyType(PyObject* pyObj);
+
+/**
+ * This function call set property function and pass value as arg
+ * This function does not check the property object type
+ *
+ * @param self The property object
+ * @param source The QObject witch has the property
+ * @param value The value to set in property
+ * @return Return 0 if ok or -1 if this function fail
+ **/
+PYSIDE_API int qproperty_set(PyObject* self, PyObject* source, PyObject* value);
+
+/**
+ * This function call get property function
+ * This function does not check the property object type
+ *
+ * @param self The property object
+ * @param source The QObject witch has the property
+ * @return Return the result of property get function or 0 if this fail
+ **/
+PYSIDE_API PyObject* qproperty_get(PyObject* self, PyObject* source);
+
+/**
+ * This function call reset property function
+ * This function does not check the property object type
+ *
+ * @param self The property object
+ * @param source The QObject witch has the property
+ * @return Return 0 if ok or -1 if this function fail
+ **/
+PYSIDE_API int qproperty_reset(PyObject* self, PyObject* source);
+
+
+/**
+ * This function return the property type
+ * This function does not check the property object type
+ *
+ * @param self The property object
+ * @return Return the property type name
+ **/
+PYSIDE_API const char* qproperty_get_type(PyObject* self);
+
+/**
+ * This function search in the source object for desired property
+ *
+ * @param source The QObject object
+ * @param name The property name
+ * @return Return a new reference to property object
+ **/
+PYSIDE_API PyObject* qproperty_get_object(PyObject* source, PyObject* name);
+
+
+/**
+ * This function check if property has read function
+ * This function does not check the property object type
+ *
+ * @param self The property object
+ * @return Return a boolean value
+ **/
+PYSIDE_API bool qproperty_is_readble(PyObject* self);
+
+/**
+ * This function check if property has write function
+ * This function does not check the property object type
+ *
+ * @param self The property object
+ * @return Return a boolean value
+ **/
+PYSIDE_API bool qproperty_is_writable(PyObject* self);
+
+/**
+ * This function check if property has reset function
+ * This function does not check the property object type
+ *
+ * @param self The property object
+ * @return Return a boolean value
+ **/
+PYSIDE_API bool qproperty_has_reset(PyObject* self);
+
+/**
+ * This function check if property has the flag DESIGNABLE setted
+ * This function does not check the property object type
+ *
+ * @param self The property object
+ * @return Return a boolean value
+ **/
+PYSIDE_API bool qproperty_is_designable(PyObject* self);
+
+/**
+ * This function check if property has the flag SCRIPTABLE setted
+ * This function does not check the property object type
+ *
+ * @param self The property object
+ * @return Return a boolean value
+ **/
+PYSIDE_API bool qproperty_is_scriptable(PyObject* self);
+
+/**
+ * This function check if property has the flag STORED setted
+ * This function does not check the property object type
+ *
+ * @param self The property object
+ * @return Return a boolean value
+ **/
+PYSIDE_API bool qproperty_is_stored(PyObject* self);
+
+/**
+ * This function check if property has the flag USER setted
+ * This function does not check the property object type
+ *
+ * @param self The property object
+ * @return Return a boolean value
+ **/
+PYSIDE_API bool qproperty_is_user(PyObject* self);
+
+/**
+ * This function check if property has the flag CONSTANT setted
+ * This function does not check the property object type
+ *
+ * @param self The property object
+ * @return Return a boolean value
+ **/
+PYSIDE_API bool qproperty_is_constant(PyObject* self);
+
+/**
+ * This function check if property has the flag FINAL setted
+ * This function does not check the property object type
+ *
+ * @param self The property object
+ * @return Return a boolean value
+ **/
+PYSIDE_API bool qproperty_is_final(PyObject* self);
+
+
+} //namespace PySide
+
+#endif
diff --git a/libpyside/qsignal.cpp b/libpyside/qsignal.cpp
index b19c565..dff9cc1 100644
--- a/libpyside/qsignal.cpp
+++ b/libpyside/qsignal.cpp
@@ -229,10 +229,11 @@ PyObject* signal_instance_get_item(PyObject* self, PyObject* key)
void signalUpdateSource(PyObject* source)
{
Shiboken::AutoDecRef attrs(PyObject_Dir(source));
+
for(int i = 0, i_max = PyList_GET_SIZE(attrs.object()); i < i_max; i++) {
PyObject *attrName = PyList_GET_ITEM(attrs.object(), i);
- Shiboken::AutoDecRef attr(PyObject_GetAttr(source, attrName));
- if (attr->ob_type == &Signal_Type) {
+ Shiboken::AutoDecRef attr(PyObject_GetAttr((PyObject*)source->ob_type, attrName));
+ if (!attr.isNull() && (attr->ob_type == &Signal_Type)) {
Shiboken::AutoDecRef signalInstance(reinterpret_cast(PyObject_New(SignalInstanceData, &SignalInstance_Type)));
signal_instance_initialize(signalInstance, attrName, reinterpret_cast(attr.object()), source, 0);
PyObject_SetAttr(source, attrName, signalInstance);
diff --git a/libpyside/signalmanager.cpp b/libpyside/signalmanager.cpp
index f173400..de0de7d 100644
--- a/libpyside/signalmanager.cpp
+++ b/libpyside/signalmanager.cpp
@@ -33,6 +33,7 @@
*/
#include "signalmanager.h"
+#include "qproperty.h"
#include
#include
@@ -351,14 +352,87 @@ bool SignalManager::emitSignal(QObject* source, const char* signal, PyObject* ar
return false;
}
-int PySide::SignalManager::qt_metacall(QObject* object, QMetaObject::Call call, int id, void** args)
+int SignalManager::qt_metacall(QObject* object, QMetaObject::Call call, int id, void** args)
{
const QMetaObject* metaObject = object->metaObject();
- // only meta method invocation is supported right now.
+ PyObject* pp = 0;
+ PyObject* pp_name = 0;
+ QMetaProperty mp;
+ Shiboken::TypeResolver* typeResolver = 0;
+ PyObject* pySelf = Shiboken::BindingManager::instance().retrieveWrapper(object);
+
if (call != QMetaObject::InvokeMetaMethod) {
- qWarning("Only meta method invocation is supported right now by PySide.");
- return id - metaObject->methodCount();
+ mp = metaObject->property(id);
+ if (!mp.isValid())
+ return id - metaObject->methodCount();
+
+ pp_name = PyString_FromString(mp.name());
+ pp = qproperty_get_object(pySelf, pp_name);
+ if (!pp) {
+ qWarning("Invalid property.");
+ Py_XDECREF(pp_name);
+ return id - metaObject->methodCount();
+ }
+ printf("access to property: %s-%s\n", mp.name(), mp.typeName());
+ typeResolver = Shiboken::TypeResolver::get(mp.typeName());
}
+
+ switch(call) {
+#ifndef QT_NO_PROPERTIES
+ case QMetaObject::ReadProperty:
+ {
+ PyObject* value = qproperty_get(pp, pySelf);
+ if (value) {
+ void *data = typeResolver->toCpp(value);
+ if (Shiboken::TypeResolver::getType(mp.typeName()) == Shiboken::TypeResolver::ObjectType)
+ args[0] = &data;
+ else
+ args[0] = data;
+
+ Py_DECREF(value);
+ }
+ break;
+ }
+
+ case QMetaObject::WriteProperty:
+ {
+ Shiboken::AutoDecRef value(typeResolver->toPython(args[0]));
+ qproperty_set(pp, pySelf, value);
+ break;
+ }
+
+ case QMetaObject::ResetProperty:
+ qproperty_reset(pp, pp_name);
+ break;
+
+ case QMetaObject::QueryPropertyDesignable:
+ case QMetaObject::QueryPropertyScriptable:
+ case QMetaObject::QueryPropertyStored:
+ case QMetaObject::QueryPropertyEditable:
+ case QMetaObject::QueryPropertyUser:
+ break;
+#endif
+ case QMetaObject::InvokeMetaMethod:
+ id = call_method(object, id, args);
+ break;
+
+ default:
+ qWarning("Unsupported meta invocation type.");
+ }
+
+ if (call == QMetaObject::InvokeMetaMethod)
+ id = id - metaObject->methodCount();
+ else
+ id = id - metaObject->propertyCount();
+
+ Py_XDECREF(pp);
+ Py_XDECREF(pp_name);
+ return id;
+}
+
+int SignalManager::call_method(QObject* object, int id, void** args)
+{
+ const QMetaObject* metaObject = object->metaObject();
QMetaMethod method = metaObject->method(id);
if (method.methodType() == QMetaMethod::Signal) {
@@ -403,6 +477,7 @@ int PySide::SignalManager::qt_metacall(QObject* object, QMetaObject::Call call,
bool SignalManager::registerMetaMethod(QObject* source, const char* signature, QMetaMethod::MethodType type)
{
+ Q_ASSERT(source);
const QMetaObject* metaObject = source->metaObject();
int methodIndex = metaObject->indexOfMethod(signature);
// Create the dynamic signal is needed
diff --git a/libpyside/signalmanager.h b/libpyside/signalmanager.h
index 72acd1d..08160a5 100644
--- a/libpyside/signalmanager.h
+++ b/libpyside/signalmanager.h
@@ -94,6 +94,8 @@ private:
// disable copy
SignalManager(const SignalManager&);
SignalManager operator=(const SignalManager&);
+
+ static int call_method(QObject* object, int id, void** args);
};
}
diff --git a/tests/QtScript/CMakeLists.txt b/tests/QtScript/CMakeLists.txt
index e496591..41fc2c4 100644
--- a/tests/QtScript/CMakeLists.txt
+++ b/tests/QtScript/CMakeLists.txt
@@ -1,2 +1,3 @@
PYSIDE_TEST(base_test.py)
PYSIDE_TEST(engine_test.py)
+PYSIDE_TEST(property_test.py)
diff --git a/tests/QtScript/property_test.py b/tests/QtScript/property_test.py
new file mode 100644
index 0000000..6d20416
--- /dev/null
+++ b/tests/QtScript/property_test.py
@@ -0,0 +1,62 @@
+import unittest
+
+from PySide.QtCore import QObject, QProperty, QCoreApplication
+from PySide.QtScript import QScriptEngine
+
+class MyObject(QObject):
+ def __init__(self, parent = None):
+ QObject.__init__(self, parent)
+ self._p = 100
+
+ def setX(self, value):
+ self._p = value
+
+ def getX(self):
+ return self._p
+
+ def resetX(self):
+ self._p = 100
+
+ def delX(self):
+ self._p = 0
+
+ x = QProperty(int, getX, setX, resetX, delX)
+
+
+class QPropertyTest(unittest.TestCase):
+
+ def testSimple(self):
+ o = MyObject()
+ self.assertEqual(o.x, 100)
+ o.x = 42
+ self.assertEqual(o.x, 42)
+
+ def testHasProperty(self):
+ o = MyObject()
+ o.setProperty("x", 10)
+ self.assertEqual(o.x, 10)
+ self.assertEqual(o.property("x"), 10)
+
+ def testMetaProperty(self):
+ o = MyObject()
+ m = o.metaObject()
+ found = False
+ for i in range(m.propertyCount()):
+ mp = m.property(i)
+ if mp.name() == "x":
+ found = True
+ break
+ self.assert_(found)
+
+ def testScriptQProperty(self):
+ qapp = QCoreApplication([])
+ myEngine = QScriptEngine()
+ obj = MyObject()
+ scriptObj = myEngine.newQObject(obj)
+ myEngine.globalObject().setProperty("obj", scriptObj)
+ myEngine.evaluate("obj.x = 42")
+ self.assertEqual(scriptObj.property("x").toInt32(), 42)
+ self.assertEqual(obj.property("x"), 42)
+
+if __name__ == '__main__':
+ unittest.main()
From 7431ae12a45baffd2a365f9382ffaa8adeb66957 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Thu, 8 Jul 2010 10:49:50 -0300
Subject: [PATCH 0074/1129] Exported flags on enum in script typesystem.
Reviewer: Hugo Parente Lima ,
Luciano Wolf
---
PySide/QtScript/typesystem_script.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/PySide/QtScript/typesystem_script.xml b/PySide/QtScript/typesystem_script.xml
index 81ba5b3..822b3d5 100644
--- a/PySide/QtScript/typesystem_script.xml
+++ b/PySide/QtScript/typesystem_script.xml
@@ -8,8 +8,8 @@
-
-
+
+
From f1bbc25546b688e8a0766212a24f2d1eacc826c7 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Thu, 8 Jul 2010 13:52:29 -0300
Subject: [PATCH 0075/1129] Created QProperty documentation.
Reviewer: Hugo Parente Lima ,
Luciano Wolf
---
doc/_templates/index.html | 11 ++++++----
doc/property.rst | 44 +++++++++++++++++++++++++++++++++++++++
2 files changed, 51 insertions(+), 4 deletions(-)
create mode 100644 doc/property.rst
diff --git a/doc/_templates/index.html b/doc/_templates/index.html
index bae2f7b..d0bc1a6 100644
--- a/doc/_templates/index.html
+++ b/doc/_templates/index.html
@@ -16,17 +16,20 @@
|
PyQt Incompatibilities
PySide issues and specificities
+ DBus
+ DBus integration
How to build
building compiling and installing PySide
- New-style signal/slot
- using the new-style signal/slot scheme
|
Contents
for a complete overview
- DBus
- DBus integration
+ New-style signal/slot
+ using the new-style signal/slot scheme
+
+ Use of QPropery in PySide
+ QProperty
|
diff --git a/doc/property.rst b/doc/property.rst
new file mode 100644
index 0000000..0b9b35c
--- /dev/null
+++ b/doc/property.rst
@@ -0,0 +1,44 @@
+Use of QPropery in PySide
+*************************
+
+PySide implements the function 'QProperty' which allows to declare properties compatible with QMetaProperties.
+
+
+Using PySide.QProperty()
+------------------------
+
+The QProperty works like Q_PROPERTY macro, and uses the same arguments.
+
+QProperty(getFunction, [setFunction], [resetFunction], [Designable], [Scriptable], [Stored], [User])
+
+
+The example below uses QProperty function to export a property in QMetaObject data.
+
+::
+
+ ...
+ clas MyObject(QObject):
+ def getX(self):
+ ...
+
+ def setX(self, value):
+ ...
+
+ def resetX(self):
+ ...
+
+ X = QProperty(getX, setX, resetX, True, True, True, True)
+
+ ...
+
+
+The exported property works like native python property on python side. See the example below.
+
+::
+
+ ...
+ o = MyObject()
+ o.X = 10
+ print o.X
+ ...
+
From 4090ef81efcada5bd6f882e1c91cd3a699c9c034 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Fri, 9 Jul 2010 10:31:37 -0300
Subject: [PATCH 0076/1129] Restore missing function on QStandardItemModel.
Created unit test.
Fixes bug: #257.
Reviewer: Marcelo Lira
Luciano Wolf
---
PySide/QtGui/typesystem_gui_common.xml | 63 ++++++++++++++++++++++----
tests/QtGui/qstandarditemmodel_test.py | 41 ++++++++++++++++-
2 files changed, 92 insertions(+), 12 deletions(-)
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index 36493e3..7308f00 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -3617,7 +3617,6 @@
-
@@ -3703,15 +3702,59 @@
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ for(int r=0, r_max = %CPPSELF.rowCount(); r < r_max; r++) {
+ QList<QStandardItem *> ri = %CPPSELF.takeRow(0);
+
+ PyObject *pyResult = %CONVERTTOPYTHON[QList<QStandardItem * >](ri);
+ Shiboken::setParent(Py_None, pyResult);
+ Py_XDECREF(pyResult);
+ }
+
+
diff --git a/tests/QtGui/qstandarditemmodel_test.py b/tests/QtGui/qstandarditemmodel_test.py
index d83d856..6ab86dd 100644
--- a/tests/QtGui/qstandarditemmodel_test.py
+++ b/tests/QtGui/qstandarditemmodel_test.py
@@ -1,7 +1,7 @@
import unittest
+import sys
-from PySide.QtGui import *
-from PySide.QtCore import *
+from PySide.QtGui import QStandardItemModel, QWidget, QStandardItem
from helper import UsesQApplication
@@ -21,6 +21,43 @@ class QStandardItemModelTest(UsesQApplication):
# bug #227
self.model.insertRow(0)
+
+class QStandardItemModelRef(UsesQApplication):
+ def testRefCount(self):
+ model = QStandardItemModel(5, 5)
+ items = []
+ for r in range(5):
+ row = []
+ for c in range(5):
+ row.append(QStandardItem("%d,%d" % (r,c)) )
+ self.assertEqual(sys.getrefcount(row[c]), 2)
+
+ model.insertRow(r, row)
+
+ for c in range(5):
+ ref_after = sys.getrefcount(row[c])
+ # check if the ref count was incremented after insertRow
+ self.assertEqual(ref_after, 3)
+
+ items.append(row)
+ row = None
+
+ for r in range(3):
+ my_row = model.takeRow(0)
+ my_row = None
+ for c in range(5):
+ # only rest 1 reference
+ self.assertEqual(sys.getrefcount(items[r][c]), 2)
+
+ my_i = model.item(0,0)
+ # ref(my_i) + parent_ref + items list ref
+ self.assertEqual(sys.getrefcount(my_i), 4)
+
+ model.clear()
+ # ref(my_i)
+ self.assertEqual(sys.getrefcount(my_i), 3)
+
+
if __name__ == '__main__':
unittest.main()
From e50766012453a22e1f4ee37a1112bd8b03b97124 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Fri, 9 Jul 2010 10:33:09 -0300
Subject: [PATCH 0077/1129] Fixed memory leak on state machine classes.
Reviewer: Marcelo Lira
Luciano Wolf
---
PySide/QtCore/typesystem_core.xml | 24 +++++++++++++-----------
1 file changed, 13 insertions(+), 11 deletions(-)
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 5fe62ed..56c4f89 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -2191,22 +2191,24 @@
-
+
-
-
- // The normal here would be to use the 'reference-count' tag but this
- // method is strongly tied to 'setTargetState' since both affect the same
- // internal value in QAbstractTransition.
- Shiboken::keepReference(reinterpret_cast<SbkBaseWrapper*>(%PYSELF), "setTargetState(QAbstractState*)1", %PYARG_1);
-
+
+
+
+
+
+
+
+
+
+
+
+
-
From 1a5de6c46c0a7e74cd9d8d6460a1f2f125a86339 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Thu, 8 Jul 2010 17:06:14 -0300
Subject: [PATCH 0078/1129] Add a default value and argument name to
QUiLoader::file(str, QWidget)
Reviewer: Luciano Wolf
Marcelo Lira
---
PySide/QtUiTools/typesystem_uitools.xml | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/PySide/QtUiTools/typesystem_uitools.xml b/PySide/QtUiTools/typesystem_uitools.xml
index c155bff..664fbdf 100644
--- a/PySide/QtUiTools/typesystem_uitools.xml
+++ b/PySide/QtUiTools/typesystem_uitools.xml
@@ -36,6 +36,10 @@
+
+
+
+
From d351f6a015b7b1a7a6d89651f149d78ecd7f13d0 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Fri, 9 Jul 2010 15:22:53 -0300
Subject: [PATCH 0079/1129] Fix build on python2.5.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Doing the merge request for Hugo as he went on vacation today :)
Reviewer: Renato Araújo
Luciano Wolf
---
libpyside/signalmanager.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libpyside/signalmanager.cpp b/libpyside/signalmanager.cpp
index de0de7d..7482f01 100644
--- a/libpyside/signalmanager.cpp
+++ b/libpyside/signalmanager.cpp
@@ -105,7 +105,7 @@ struct Converter
static PyObject* toPython(const PySide::PyObjectWrapper& obj)
{
- Py_INCREF(obj);
+ Py_INCREF((PyObject*)obj);
return obj;
}
};
From 975edd5647f7fcebe9381ccf7d0524c736b1d069 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Fri, 9 Jul 2010 15:33:39 -0300
Subject: [PATCH 0080/1129] Fixed test ref count mistake.
---
tests/QtCore/qabstracttransition_test.py | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/tests/QtCore/qabstracttransition_test.py b/tests/QtCore/qabstracttransition_test.py
index 4ba6d83..fa1e355 100644
--- a/tests/QtCore/qabstracttransition_test.py
+++ b/tests/QtCore/qabstracttransition_test.py
@@ -89,8 +89,8 @@ class QAbstractTransitionTest(unittest.TestCase):
del states
del transition
- self.assertEqual(getrefcount(state1), refcount1)
- self.assertEqual(getrefcount(state2), refcount2)
+ self.assertEqual(getrefcount(state1), refcount1 - 1)
+ self.assertEqual(getrefcount(state2), refcount2 - 1)
def testRefCountOfTargetStatesAfterSingleTargetState(self):
transition = QEventTransition()
@@ -119,8 +119,8 @@ class QAbstractTransitionTest(unittest.TestCase):
del states
del transition
- self.assertEqual(getrefcount(state1), refcount1)
- self.assertEqual(getrefcount(state2), refcount2)
+ self.assertEqual(getrefcount(state1), refcount1 - 1)
+ self.assertEqual(getrefcount(state2), refcount2 - 1)
def testRefCountOfTargetStatesBeforeSingleTargetState(self):
transition = QEventTransition()
@@ -147,8 +147,8 @@ class QAbstractTransitionTest(unittest.TestCase):
del states
- self.assertEqual(getrefcount(state1), refcount1)
- self.assertEqual(getrefcount(state2), refcount2)
+ self.assertEqual(getrefcount(state1), refcount1 - 1)
+ self.assertEqual(getrefcount(state2), refcount2 - 1)
if __name__ == '__main__':
unittest.main()
From 5cc46f2f1342e085897eefd06eda453e2f28b5bc Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Fri, 9 Jul 2010 18:27:39 -0300
Subject: [PATCH 0081/1129] Fixed layout reference control on layouts.
Reviewer: Luciano Wolf
---
PySide/QtGui/glue/qlayout_help_functions.h | 28 ++++++++++++++-----
PySide/QtGui/glue/qwidget_glue.h | 10 +++++++
tests/QtGui/qlayout_ref_test.py | 2 +-
tests/QtGui/qlayout_test.py | 31 +++++++++++++++++++---
4 files changed, 60 insertions(+), 11 deletions(-)
diff --git a/PySide/QtGui/glue/qlayout_help_functions.h b/PySide/QtGui/glue/qlayout_help_functions.h
index cea0b56..9e07ff5 100644
--- a/PySide/QtGui/glue/qlayout_help_functions.h
+++ b/PySide/QtGui/glue/qlayout_help_functions.h
@@ -3,24 +3,40 @@
void addLayoutOwnership(QLayout *layout, QLayoutItem *item);
+inline QString retrieveObjectName(PyObject *obj)
+{
+ Shiboken::AutoDecRef objName(PyObject_Str(obj));
+ return QString(PyString_AsString(objName));
+}
+
inline void addLayoutOwnership(QLayout *layout, QWidget *widget)
{
//transfer ownership to parent widget
QWidget *parent = layout->parentWidget();
- if (!parent)
- return;
- Shiboken::AutoDecRef pyParent(Shiboken::Converter::toPython(parent));
- Shiboken::AutoDecRef pyChild(Shiboken::Converter::toPython(widget));
- Shiboken::setParent(pyParent, pyChild);
+ if (!parent) {
+ //keep the reference while the layout is orphan
+ Shiboken::AutoDecRef pyParent(Shiboken::Converter::toPython(layout));
+ Shiboken::AutoDecRef pyChild(Shiboken::Converter::toPython(widget));
+ Shiboken::keepReference(reinterpret_cast(pyParent.object()), qPrintable(retrieveObjectName(pyParent)), pyChild, true);
+ } else {
+ Shiboken::AutoDecRef pyParent(Shiboken::Converter::toPython(parent));
+ Shiboken::AutoDecRef pyChild(Shiboken::Converter::toPython(widget));
+ Shiboken::setParent(pyParent, pyChild);
+ }
}
inline void addLayoutOwnership(QLayout *layout, QLayout *other)
{
//transfer all children widgetes from other to layout parent widget
QWidget *parent = layout->parentWidget();
- if (!parent)
+ if (!parent) {
+ //keep the reference while the layout is orphan
+ Shiboken::AutoDecRef pyParent(Shiboken::Converter::toPython(layout));
+ Shiboken::AutoDecRef pyChild(Shiboken::Converter::toPython(other));
+ Shiboken::keepReference(reinterpret_cast(pyParent.object()), qPrintable(retrieveObjectName(pyParent)), pyChild, true);
return;
+ }
for (int i=0, i_max=other->count(); i < i_max; i++) {
addLayoutOwnership(layout, other->itemAt(i));
diff --git a/PySide/QtGui/glue/qwidget_glue.h b/PySide/QtGui/glue/qwidget_glue.h
index a6cd3b7..9488522 100644
--- a/PySide/QtGui/glue/qwidget_glue.h
+++ b/PySide/QtGui/glue/qwidget_glue.h
@@ -1,3 +1,10 @@
+static QString retrieveObjectName(PyObject *obj)
+{
+ Shiboken::AutoDecRef objName(PyObject_Str(obj));
+ return QString(PyString_AsString(objName));
+}
+
+
/**
* Tranfer objects ownership from layout to widget
**/
@@ -26,6 +33,9 @@ qwidgetReparentLayout(QWidget *parent, QLayout *layout)
Shiboken::AutoDecRef pyChild(Shiboken::Converter::toPython(layout));
Shiboken::setParent(pyParent, pyChild);
+
+ //remove previous references
+ Shiboken::keepReference(reinterpret_cast(pyChild.object()), qPrintable(retrieveObjectName(pyChild)), Py_None);
}
static inline void
diff --git a/tests/QtGui/qlayout_ref_test.py b/tests/QtGui/qlayout_ref_test.py
index a634271..27c599c 100644
--- a/tests/QtGui/qlayout_ref_test.py
+++ b/tests/QtGui/qlayout_ref_test.py
@@ -46,7 +46,7 @@ class SaveReference(UsesQApplication):
l = QHBoxLayout()
self.assertEqual(getrefcount(self.widget1), 2)
l.addWidget(self.widget1)
- self.assertEqual(getrefcount(self.widget1), 2)
+ self.assertEqual(getrefcount(self.widget1), 3)
w = QWidget()
w.setLayout(l)
diff --git a/tests/QtGui/qlayout_test.py b/tests/QtGui/qlayout_test.py
index ae773bb..88c37aa 100644
--- a/tests/QtGui/qlayout_test.py
+++ b/tests/QtGui/qlayout_test.py
@@ -2,7 +2,7 @@ import unittest
import sys
from helper import UsesQApplication
-from PySide.QtGui import QLayout, QWidget, QPushButton, QWidgetItem
+from PySide.QtGui import QLayout, QWidget, QPushButton, QWidgetItem, QHBoxLayout
class MyLayout(QLayout):
def __init__(self, parent=None):
@@ -29,24 +29,47 @@ class MyLayout(QLayout):
-#Test if a layout implemented in python, the QWidget.setLayout works
-#fine because this implement som layout functions used in glue code of
+#Test if a layout implemented in python, the QWidget.setLayout works
+#fine because this implement som layout functions used in glue code of
#QWidget, then in c++ when call a virtual function this need call the QLayout
#function implemented in python
class QLayoutTest(UsesQApplication):
-
def testOwnershipTransfer(self):
b = QPushButton("teste")
l = MyLayout()
+
l.addWidget(b)
self.assertEqual(sys.getrefcount(b), 2)
w = QWidget()
+
+ #transfer ref
w.setLayout(l)
self.assertEqual(sys.getrefcount(b), 3)
+
+ def testReferenceTransfer(self):
+ b = QPushButton("teste")
+ l = QHBoxLayout()
+
+ # keep ref
+ l.addWidget(b)
+ self.assertEqual(sys.getrefcount(b), 3)
+
+ w = QWidget()
+
+ # transfer ref
+ w.setLayout(l)
+
+ self.assertEqual(sys.getrefcount(b), 3)
+
+ # release ref
+ del w
+
+ self.assertEqual(sys.getrefcount(b), 2)
+
if __name__ == '__main__':
unittest.main()
From be1073e7728e31281a607313007e817d5e9db2af Mon Sep 17 00:00:00 2001
From: Luciano Wolf
Date: Fri, 9 Jul 2010 18:19:26 -0300
Subject: [PATCH 0082/1129] Fix warning on QString* parameter inside QtWebKit.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Reviewer: Renato Araújo
Marcelo Lira
---
PySide/QtWebKit/typesystem_webkit.xml | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/PySide/QtWebKit/typesystem_webkit.xml b/PySide/QtWebKit/typesystem_webkit.xml
index a08b183..845eeb4 100644
--- a/PySide/QtWebKit/typesystem_webkit.xml
+++ b/PySide/QtWebKit/typesystem_webkit.xml
@@ -51,9 +51,13 @@
+
+
+
- %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, %4);
- %PYARG_0 = Shiboken::makeTuple(retval_, %4);
+ QString str;
+ %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, &str);
+ %PYARG_0 = Shiboken::makeTuple(retval_, str);
From bac154b896b39c1e817742ce2213da3e0d346977 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Mon, 12 Jul 2010 18:45:19 -0300
Subject: [PATCH 0083/1129] Create support to QVariantList and QVariantMap.
Fixes bug: #263
Reviewer: Marcelo Lira
Luciano Wolf
---
PySide/QtCore/qvariant_conversions.h | 63 +++++++++++++++++++++++
PySide/QtCore/qvariant_type_conversions.h | 32 +++++++++++-
PySide/QtCore/typesystem_core.xml | 2 +
3 files changed, 96 insertions(+), 1 deletion(-)
diff --git a/PySide/QtCore/qvariant_conversions.h b/PySide/QtCore/qvariant_conversions.h
index 613e523..9178aa8 100644
--- a/PySide/QtCore/qvariant_conversions.h
+++ b/PySide/QtCore/qvariant_conversions.h
@@ -40,6 +40,10 @@ struct Converter
} else if (Shiboken::isShibokenEnum(pyObj)) {
// QVariant(enum)
return QVariant(Converter::toCpp(pyObj));
+ } else if (PyDict_Check(pyObj)) {
+ return convertToVariantMap(pyObj);
+ } else if (PySequence_Check(pyObj)) {
+ return convertToVariantList(pyObj);
} else if (!isShibokenType(pyObj) || isUserType(pyObj)) {
// QVariant(User class)
return QVariant::fromValue(pyObj);
@@ -70,11 +74,70 @@ struct Converter
static PyObject* toPython(const QVariant& cppObj)
{
if (cppObj.isValid()) {
+ if (qstrcmp(cppObj.typeName(), "QVariantList") == 0)
+ return Converter >::toPython(cppObj.value());
+
+ if (qstrcmp(cppObj.typeName(), "QStringList") == 0)
+ return Converter >::toPython(cppObj.value());
+
+ if (qstrcmp(cppObj.typeName(), "QVariantMap") == 0)
+ return Converter >::toPython(cppObj.value());
+
Shiboken::TypeResolver* tr = Shiboken::TypeResolver::get(cppObj.typeName());
if (tr)
return tr->toPython(const_cast(cppObj.data()));
}
Py_RETURN_NONE;
}
+
+ static QVariant convertToVariantMap(PyObject* map)
+ {
+ PyObject *key, *value;
+ Py_ssize_t pos = 0;
+ AutoDecRef keys(PyDict_Keys(map));
+ bool keysIsString = isStringList(keys);
+ if (keysIsString) {
+ QMap ret;
+ while (PyDict_Next(map, &pos, &key, &value))
+ ret.insert(Converter::toCpp(key), toCpp(value));
+ return QVariant(ret);
+ } else {
+ return toCpp(map);
+ }
+ }
+
+ static bool isStringList(PyObject *list)
+ {
+ bool allString = true;
+ AutoDecRef fast(PySequence_Fast(list, "Failed to convert QVariantList"));
+ Py_ssize_t size = PySequence_Fast_GET_SIZE(fast.object());
+ for(int i=0; i < size; i++) {
+ PyObject* item = PySequence_Fast_GET_ITEM(fast.object(), i);
+ if (!Converter::checkType(item)) {
+ allString = false;
+ break;
+ }
+ }
+ return allString;
+ }
+
+ static QVariant convertToVariantList(PyObject* list)
+ {
+ bool allString = isStringList(list);
+ if (allString) {
+ QStringList lst = Converter >::toCpp(list);
+ return QVariant(lst);
+ } else {
+ QList lst;
+ AutoDecRef fast(PySequence_Fast(list, "Failed to convert QVariantList"));
+ Py_ssize_t size = PySequence_Fast_GET_SIZE(fast.object());
+ for(int i=0; i < size; i++) {
+ PyObject* item = PySequence_Fast_GET_ITEM(fast.object(), i);
+ lst.append(toCpp(item));
+ }
+ return QVariant(lst);
+ }
+ Q_ASSERT(false);
+ }
};
}
diff --git a/PySide/QtCore/qvariant_type_conversions.h b/PySide/QtCore/qvariant_type_conversions.h
index 107fb42..d1cf9f0 100644
--- a/PySide/QtCore/qvariant_type_conversions.h
+++ b/PySide/QtCore/qvariant_type_conversions.h
@@ -15,7 +15,7 @@ struct Converter
static QVariant::Type toCpp(PyObject* pyObj)
{
- const char* typeName;
+ const char* typeName = 0;
if (pyObj == Py_None)
return QVariant::Invalid;
@@ -31,6 +31,15 @@ struct Converter
typeName = PyString_AS_STRING(pyObj);
else if (PyUnicode_Check(pyObj))
typeName = PyString_AsString(pyObj);
+ else if (PyDict_Check(pyObj) && checkAllStringKeys(pyObj))
+ typeName = "QVariantMap";
+ else if (PySequence_Check(pyObj))
+ if (isStringList(pyObj))
+ typeName = "QStringList";
+ else
+ typeName = "QVariantList";
+ else
+ Q_ASSERT(false);
return QVariant::nameToType(typeName);
}
@@ -49,5 +58,26 @@ struct Converter
Py_INCREF(pyObj);
return pyObj;
}
+
+ static bool isStringList(PyObject* list)
+ {
+ bool allString = true;
+ AutoDecRef fast(PySequence_Fast(list, "Failed to convert QVariantList"));
+ Py_ssize_t size = PySequence_Fast_GET_SIZE(fast.object());
+ for(int i=0; i < size; i++) {
+ PyObject* item = PySequence_Fast_GET_ITEM(fast.object(), i);
+ if (!Converter::checkType(item)) {
+ allString = false;
+ break;
+ }
+ }
+ return allString;
+ }
+
+ static bool checkAllStringKeys(PyObject* dict)
+ {
+ AutoDecRef keys(PyDict_Keys(dict));
+ return isStringList(keys);
+ }
};
}
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 56c4f89..133ece3 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -178,6 +178,8 @@
+
+
From e2056540d55033e8415246c2d17d9750bd30c1f0 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Tue, 13 Jul 2010 15:12:28 -0300
Subject: [PATCH 0084/1129] Uset 60 secs as default test timeout.
Reviewer: Marcelo Lira
Luciano Wolf
---
tests/CMakeLists.txt | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index c1a0376..adf4179 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -1,4 +1,6 @@
-set(PYSIDE_TIMEOUT 10)
+if(NOT CTEST_TESTING_TIMEOUT)
+ set(CTEST_TESTING_TIMEOUT 60)
+endif()
macro(TEST_QT_MODULE var name)
if(NOT DISABLE_${name} AND ${var})
@@ -19,7 +21,7 @@ macro(PYSIDE_TEST)
set(TEST_CMD ${CMAKE_SOURCE_DIR}/tests/run_test.sh ${libpyside_BINARY_DIR} "${CMAKE_BINARY_DIR}:${CMAKE_SOURCE_DIR}/tests/util" ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/${ARGV0}")
add_test(${TEST_NAME} ${TEST_CMD})
set_tests_properties(${TEST_NAME} PROPERTIES
- TIMEOUT ${PYSIDE_TIMEOUT}
+ TIMEOUT ${CTEST_TESTING_TIMEOUT}
WILL_FAIL ${EXPECT_TO_FAIL})
endmacro(PYSIDE_TEST)
From 95c7699ae37c0c4a10d606405230000cfae99bde Mon Sep 17 00:00:00 2001
From: Luciano Wolf
Date: Tue, 13 Jul 2010 14:15:35 -0300
Subject: [PATCH 0085/1129] Update tests to check native pointers (qchar *,
void *, ...).
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Reviewer: Renato Araújo
Marcelo Lira
---
tests/QtCore/qobject_connect_notify_test.py | 3 +++
tests/QtXml/qxmlsimplereader_test.py | 1 +
2 files changed, 4 insertions(+)
diff --git a/tests/QtCore/qobject_connect_notify_test.py b/tests/QtCore/qobject_connect_notify_test.py
index 4410375..b87dd4d 100644
--- a/tests/QtCore/qobject_connect_notify_test.py
+++ b/tests/QtCore/qobject_connect_notify_test.py
@@ -14,9 +14,11 @@ class Obj(QObject):
QObject.__init__(self)
self.con_notified = False
self.dis_notified = False
+ self.signal = ""
def connectNotify(self, signal):
self.con_notified = True
+ self.signal = signal
def disconnectNotify(self, signal):
self.dis_notified = True
@@ -39,6 +41,7 @@ class TestQObjectConnectNotify(UsesQCoreApplication):
receiver = QObject()
sender.connect(SIGNAL("destroyed()"), receiver, SLOT("deleteLater()"))
self.assert_(sender.con_notified)
+ self.assertEqual(sender.signal, SIGNAL("destroyed()"))
sender.disconnect(SIGNAL("destroyed()"), receiver, SLOT("deleteLater()"))
self.assert_(sender.dis_notified)
diff --git a/tests/QtXml/qxmlsimplereader_test.py b/tests/QtXml/qxmlsimplereader_test.py
index 6c4d3f4..aaaf45a 100644
--- a/tests/QtXml/qxmlsimplereader_test.py
+++ b/tests/QtXml/qxmlsimplereader_test.py
@@ -28,6 +28,7 @@ class QXmlSimpleReaderTest(unittest.TestCase):
reader = QXmlSimpleReader()
prop, ok = reader.property('foo')
self.assertEqual((prop, ok), (None, False))
+ reader.setProperty('foo', 'Something')
if __name__ == '__main__':
unittest.main()
From 28d0c480b15d566cabfb63dc6cc65697dc5b5edc Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Tue, 13 Jul 2010 17:53:59 -0300
Subject: [PATCH 0086/1129] Create unit test to bug 243.
Reviewer: Marcelo Lira
Luciano Wolf
---
tests/QtGui/CMakeLists.txt | 1 +
tests/QtGui/bug_243.py | 18 ++++++++++++++++++
2 files changed, 19 insertions(+)
create mode 100644 tests/QtGui/bug_243.py
diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt
index b875913..5ebd754 100644
--- a/tests/QtGui/CMakeLists.txt
+++ b/tests/QtGui/CMakeLists.txt
@@ -1,6 +1,7 @@
#Keep this in alphabetical sort
PYSIDE_TEST(api2_test.py)
+PYSIDE_TEST(bug_243.py)
PYSIDE_TEST(add_action_test.py)
PYSIDE_TEST(customproxywidget_test.py)
PYSIDE_TEST(float_to_int_implicit_conversion_test.py)
diff --git a/tests/QtGui/bug_243.py b/tests/QtGui/bug_243.py
new file mode 100644
index 0000000..eb9f9d6
--- /dev/null
+++ b/tests/QtGui/bug_243.py
@@ -0,0 +1,18 @@
+
+''' Test bug 243: http://bugs.openbossa.org/show_bug.cgi?id=243'''
+
+import unittest
+import sys
+
+from PySide.QtGui import QApplication, QMainWindow, QLayout
+
+class QAppPresence(unittest.TestCase):
+
+ def testBug(self):
+ app = QApplication(sys.argv)
+ window = QMainWindow()
+ l = window.layout()
+ self.assert_(isinstance(l, QLayout))
+
+if __name__ == '__main__':
+ unittest.main()
From c62c36a64dd4c0fc0cd586c5c2b3d4f97ba3f769 Mon Sep 17 00:00:00 2001
From: Luciano Wolf
Date: Wed, 14 Jul 2010 18:38:13 -0300
Subject: [PATCH 0087/1129] Fix CMakeLists to include QtMultimedia tests + fix
audio test.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Reviewer: Renato Araújo
Marcelo Lira
---
tests/CMakeLists.txt | 12 ++++++++++++
tests/QtMultimedia/audio_test.py | 2 ++
2 files changed, 14 insertions(+)
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index adf4179..904d106 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -25,6 +25,18 @@ macro(PYSIDE_TEST)
WILL_FAIL ${EXPECT_TO_FAIL})
endmacro(PYSIDE_TEST)
+# Try to find QtMultimedia
+# TODO: Remove this hack when cmake support QtMultimedia module
+if (NOT QT_QTMULTIMEDIA_FOUND AND ${QTVERSION} VERSION_GREATER 4.5.9)
+ find_path(QT_QTMULTIMEDIA_INCLUDE_DIR QtMultimedia
+ PATHS ${QT_HEADERS_DIR}/QtMultimedia
+ ${QT_LIBRARY_DIR}/QtMultimedia.framework/Headers
+ NO_DEFAULT_PATH)
+ find_library(QT_QTMULTIMEDIA_LIBRARY QtMultimedia PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ if (QT_QTMULTIMEDIA_INCLUDE_DIR AND QT_QTMULTIMEDIA_LIBRARY)
+ set(QT_QTMULTIMEDIA_FOUND ON)
+ endif()
+endif ()
add_subdirectory(signals)
TEST_QT_MODULE(QT_QTCORE_FOUND QtCore)
diff --git a/tests/QtMultimedia/audio_test.py b/tests/QtMultimedia/audio_test.py
index 04d0a1e..0d8813d 100644
--- a/tests/QtMultimedia/audio_test.py
+++ b/tests/QtMultimedia/audio_test.py
@@ -10,6 +10,8 @@ class testAudioDevices(unittest.TestCase):
def testListDevices(self):
for devInfo in QAudioDeviceInfo.availableDevices(QAudio.AudioOutput):
+ if devInfo.deviceName() == 'null':
+ continue
fmt = QAudioFormat()
for codec in devInfo.supportedCodecs():
fmt.setCodec(codec)
From cb7d3e95a27392e504f3b99deacddb3a3e0a8a56 Mon Sep 17 00:00:00 2001
From: Luciano Wolf
Date: Mon, 19 Jul 2010 16:30:11 -0300
Subject: [PATCH 0088/1129] Fix bug#252.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Reviewer: Renato Araújo
Marcelo Lira
---
PySide/QtGui/glue/qapplication_init.cpp | 2 +-
tests/QtSql/qsqldatabaseandqueries_test.py | 14 ++++++++++++++
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/PySide/QtGui/glue/qapplication_init.cpp b/PySide/QtGui/glue/qapplication_init.cpp
index 5c87af3..00e37b1 100644
--- a/PySide/QtGui/glue/qapplication_init.cpp
+++ b/PySide/QtGui/glue/qapplication_init.cpp
@@ -8,7 +8,7 @@ void DeleteQApplicationAtExit() {
if (QApplication::instance()) {
//disconnect and decref all widgets used on signals before destroy qApp
PySide::SignalManager::instance().clear();
- delete QApplication::instance();
+ QApplication::instance()->deleteLater();
for (int i = 0; i < QApplicationArgCount; ++i)
delete[] QApplicationArgValues[i];
}
diff --git a/tests/QtSql/qsqldatabaseandqueries_test.py b/tests/QtSql/qsqldatabaseandqueries_test.py
index 7a9d30a..41daccc 100644
--- a/tests/QtSql/qsqldatabaseandqueries_test.py
+++ b/tests/QtSql/qsqldatabaseandqueries_test.py
@@ -6,6 +6,12 @@ import unittest
from PySide import QtSql
from PySide.QtCore import *
+from PySide.QtGui import *
+
+class Foo(QWidget):
+ def __init__(self):
+ QWidget.__init__(self)
+ self.model = QtSql.QSqlTableModel()
class SqlDatabaseCreationDestructionAndQueries(unittest.TestCase):
'''Test cases for QtSql database creation, destruction and queries'''
@@ -51,6 +57,14 @@ class SqlDatabaseCreationDestructionAndQueries(unittest.TestCase):
lastname = query.value(0)
self.assertEqual(lastname, 'Harrison')
+ def testTableModelDeletion(self):
+ app = QApplication([])
+
+ bar = Foo()
+ model = bar.model
+ del bar
+ del app
+
if __name__ == '__main__':
unittest.main()
From e5042dc193bbcb4b1566594d832076adfef5fd94 Mon Sep 17 00:00:00 2001
From: Marcelo Lira
Date: Wed, 21 Jul 2010 17:10:48 -0300
Subject: [PATCH 0089/1129] Added a custom cmake file to help finding Python
debug provisions.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Reviewed by Luciano Wolf
Reviewed by Renato Araújo
---
CMakeLists.txt | 5 ++++-
cmake/Modules/FindPythonInterpWithDebug.cmake | 21 +++++++++++++++++++
2 files changed, 25 insertions(+), 1 deletion(-)
create mode 100644 cmake/Modules/FindPythonInterpWithDebug.cmake
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 61a6116..d601f84 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,6 +4,9 @@ project(pysidebindings)
cmake_minimum_required(VERSION 2.6)
+set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules/
+ ${CMAKE_MODULE_PATH})
+
if(CMAKE_HOST_UNIX)
option(ENABLE_GCC_OPTIMIZATION "Enable specific GCC flags to optimization library size and performance. Only available on Release Mode" 0)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fvisibility=hidden -Wno-strict-aliasing")
@@ -34,7 +37,7 @@ if(AVOID_PROTECTED_HACK OR WIN32)
endif()
find_package(PythonLibs REQUIRED)
-find_package(PythonInterp REQUIRED)
+find_package(PythonInterpWithDebug REQUIRED)
find_package(Shiboken 0.3.3 REQUIRED)
find_package(Qt4 4.5.0 REQUIRED)
diff --git a/cmake/Modules/FindPythonInterpWithDebug.cmake b/cmake/Modules/FindPythonInterpWithDebug.cmake
new file mode 100644
index 0000000..264dd5d
--- /dev/null
+++ b/cmake/Modules/FindPythonInterpWithDebug.cmake
@@ -0,0 +1,21 @@
+INCLUDE(FindPythonInterp)
+
+find_package(PythonInterp REQUIRED)
+
+#Fix missing variable on UNIX env
+if(NOT PYTHON_DEBUG_LIBRARIES AND UNIX)
+ set(PYTHON_DEBUG_LIBRARIES "${PYTHON_LIBRARIES}")
+endif()
+
+if(PYTHONINTERP_FOUND AND UNIX AND CMAKE_BUILD_TYPE STREQUAL "Debug")
+ # This is for Debian
+ set(PYTHON_EXECUTABLE_TMP "${PYTHON_EXECUTABLE}-dbg")
+
+ # Fall back to the standard interpreter.
+ if(NOT EXISTS "${PYTHON_EXECUTABLE_TMP}")
+ set(PYTHON_EXECUTABLE_TMP "${PYTHON_EXECUTABLE}")
+ endif()
+
+ set(PYTHON_EXECUTABLE "${PYTHON_EXECUTABLE_TMP}")
+endif()
+
From f7afa613cf4b4a7a587d29855465e1db577fcd06 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Thu, 15 Jul 2010 18:33:41 -0300
Subject: [PATCH 0090/1129] Update modules to work without protect hack.
Reviewer: Marcelo Lira
Luciano Wolf
---
PySide/QtCore/typesystem_core.xml | 3 +++
PySide/QtOpenGL/typesystem_opengl.xml | 1 +
PySide/typesystem_templates.xml | 2 +-
3 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 133ece3..8f30143 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -1222,6 +1222,9 @@
+
+ <para>URLs can be represented in two forms: encoded or unencoded. The unencoded representation is suitable for showing to users, but the encoded representation is typically what you would send to a web server. For example, the unencoded URL "http://bühler.example.com" would be sent to the server as "http://xn--bhler-kva.example.com/List%20of%20applicants.xml".</para>
+
diff --git a/PySide/QtOpenGL/typesystem_opengl.xml b/PySide/QtOpenGL/typesystem_opengl.xml
index 202b115..e1402f7 100644
--- a/PySide/QtOpenGL/typesystem_opengl.xml
+++ b/PySide/QtOpenGL/typesystem_opengl.xml
@@ -4,6 +4,7 @@
+
diff --git a/PySide/typesystem_templates.xml b/PySide/typesystem_templates.xml
index 40e2345..1de06a1 100644
--- a/PySide/typesystem_templates.xml
+++ b/PySide/typesystem_templates.xml
@@ -154,7 +154,7 @@
- %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, %2);
+ %RETURN_TYPE retval_ = %RETURN_TYPE(%CPPSELF.%FUNCTION_NAME(%1, %2));
%PYARG_0 = Shiboken::makeTuple(retval_, %1, %2);
From 8bde4b3800ca1c5c517fe382f6fdf78c212b9ad0 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Mon, 19 Jul 2010 15:19:45 -0300
Subject: [PATCH 0091/1129] Use correct python lib in debug mode.
Reviewer: Marcelo Lira
Luciano Wolf
---
CMakeLists.txt | 18 +++++++++++++++++-
PySide/QtCore/CMakeLists.txt | 2 +-
PySide/QtDeclarative/CMakeLists.txt | 2 +-
PySide/QtGui/CMakeLists.txt | 2 +-
PySide/QtHelp/CMakeLists.txt | 2 +-
PySide/QtMaemo5/CMakeLists.txt | 2 +-
PySide/QtMultimedia/CMakeLists.txt | 2 +-
PySide/QtNetwork/CMakeLists.txt | 2 +-
PySide/QtOpenGL/CMakeLists.txt | 2 +-
PySide/QtScript/CMakeLists.txt | 2 +-
PySide/QtScriptTools/CMakeLists.txt | 2 +-
PySide/QtSql/CMakeLists.txt | 2 +-
PySide/QtSvg/CMakeLists.txt | 2 +-
PySide/QtTest/CMakeLists.txt | 2 +-
PySide/QtUiTools/CMakeLists.txt | 2 +-
PySide/QtWebKit/CMakeLists.txt | 2 +-
PySide/QtXml/CMakeLists.txt | 2 +-
PySide/QtXmlPatterns/CMakeLists.txt | 2 +-
PySide/phonon/CMakeLists.txt | 2 +-
libpyside/CMakeLists.txt | 2 +-
20 files changed, 36 insertions(+), 20 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d601f84..e797457 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -41,6 +41,11 @@ find_package(PythonInterpWithDebug REQUIRED)
find_package(Shiboken 0.3.3 REQUIRED)
find_package(Qt4 4.5.0 REQUIRED)
+#Fix missing variable on UNIX env
+if(NOT PYTHON_DEBUG_LIBRARIES AND UNIX)
+ set(PYTHON_DEBUG_LIBRARIES "${PYTHON_LIBRARIES}")
+endif()
+
set(BINDING_NAME PySide)
set(BINDING_API_MAJOR_VERSION "0")
set(BINDING_API_MINOR_VERSION "3")
@@ -135,10 +140,21 @@ execute_process(
print sysconfig.get_config_var('Py_DEBUG')"
OUTPUT_VARIABLE PY_DEBUG
OUTPUT_STRIP_TRAILING_WHITESPACE)
-if (PY_DEBUG)
+
+if(CMAKE_BUILD_TYPE STREQUAL "Debug")
+ if(NOT PYTHON_DEBUG_LIBRARIES)
+ message(FATAL_ERROR "Python debug library not found. Try compile PySide with -DCMAKE_BUILD_TYPE=Release")
+ endif()
+ if(NOT PY_DEBUG)
+ message(WARNING "Compiling PySide with debug enabled, but the python executable was not compiled with debug support.")
+ endif()
add_definitions("-DPy_DEBUG")
+ set(PYSIDE_PYTHON_LIBRARIES ${PYTHON_DEBUG_LIBRARIES})
+else()
+ set(PYSIDE_PYTHON_LIBRARIES ${PYTHON_LIBRARIES})
endif()
+
set(GENERATOR_EXTRA_FLAGS --generatorSet=shiboken --enable-parent-ctor-heuristic --enable-pyside-extensions --enable-return-value-heuristic)
enable_testing()
diff --git a/PySide/QtCore/CMakeLists.txt b/PySide/QtCore/CMakeLists.txt
index 408451f..6300a4c 100644
--- a/PySide/QtCore/CMakeLists.txt
+++ b/PySide/QtCore/CMakeLists.txt
@@ -147,7 +147,7 @@ add_library(QtCore MODULE ${QtCore_SRC})
set_property(TARGET QtCore PROPERTY PREFIX "")
target_link_libraries(QtCore
pyside
- ${PYTHON_LIBRARIES}
+ ${PYSIDE_PYTHON_LIBRARIES}
${SHIBOKEN_LIBRARY}
${QT_QTCORE_LIBRARY}
)
diff --git a/PySide/QtDeclarative/CMakeLists.txt b/PySide/QtDeclarative/CMakeLists.txt
index d61fbf9..79b4b42 100644
--- a/PySide/QtDeclarative/CMakeLists.txt
+++ b/PySide/QtDeclarative/CMakeLists.txt
@@ -38,7 +38,7 @@ add_library(QtDeclarative MODULE ${QtDeclarative_SRC})
set_target_properties(QtDeclarative PROPERTIES PREFIX "")
target_link_libraries(QtDeclarative
pyside
- ${PYTHON_LIBRARIES}
+ ${PYSIDE_PYTHON_LIBRARIES}
${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY}
${QT_QTNETWORK_LIBRARY}
diff --git a/PySide/QtGui/CMakeLists.txt b/PySide/QtGui/CMakeLists.txt
index db0fd9e..fdc36b3 100644
--- a/PySide/QtGui/CMakeLists.txt
+++ b/PySide/QtGui/CMakeLists.txt
@@ -484,7 +484,7 @@ add_library(QtGui MODULE ${QtGui_SRC})
set_property(TARGET QtGui PROPERTY PREFIX "")
target_link_libraries(QtGui
pyside
- ${PYTHON_LIBRARIES}
+ ${PYSIDE_PYTHON_LIBRARIES}
${SHIBOKEN_LIBRARY}
${QT_QTGUI_LIBRARY}
)
diff --git a/PySide/QtHelp/CMakeLists.txt b/PySide/QtHelp/CMakeLists.txt
index 0cc48db..42b0737 100644
--- a/PySide/QtHelp/CMakeLists.txt
+++ b/PySide/QtHelp/CMakeLists.txt
@@ -33,7 +33,7 @@ set_target_properties(QtHelp PROPERTIES PREFIX "")
target_link_libraries(QtHelp
pyside
- ${PYTHON_LIBRARIES}
+ ${PYSIDE_PYTHON_LIBRARIES}
${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY}
${QT_QTHELP_LIBRARY})
diff --git a/PySide/QtMaemo5/CMakeLists.txt b/PySide/QtMaemo5/CMakeLists.txt
index 4590e40..5338b80 100644
--- a/PySide/QtMaemo5/CMakeLists.txt
+++ b/PySide/QtMaemo5/CMakeLists.txt
@@ -41,7 +41,7 @@ set_target_properties(QtMaemo5 PROPERTIES
target_link_libraries(QtMaemo5
pyside
- ${PYTHON_LIBRARIES}
+ ${PYSIDE_PYTHON_LIBRARIES}
${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY}
${QT_QTMAEMO5_LIBRARY})
diff --git a/PySide/QtMultimedia/CMakeLists.txt b/PySide/QtMultimedia/CMakeLists.txt
index 05f63b5..20707f7 100644
--- a/PySide/QtMultimedia/CMakeLists.txt
+++ b/PySide/QtMultimedia/CMakeLists.txt
@@ -37,7 +37,7 @@ add_library(QtMultimedia MODULE ${QtMultimedia_SRC})
set_property(TARGET QtMultimedia PROPERTY PREFIX "")
target_link_libraries(QtMultimedia
pyside
- ${PYTHON_LIBRARIES}
+ ${PYSIDE_PYTHON_LIBRARIES}
${SHIBOKEN_LIBRARY}
${QT_QTMULTIMEDIA_LIBRARY}
${QT_QTGUI_LIBRARY}
diff --git a/PySide/QtNetwork/CMakeLists.txt b/PySide/QtNetwork/CMakeLists.txt
index 7c8d17e..6afedbd 100644
--- a/PySide/QtNetwork/CMakeLists.txt
+++ b/PySide/QtNetwork/CMakeLists.txt
@@ -114,7 +114,7 @@ add_library(QtNetwork MODULE ${QtNetwork_SRC})
set_property(TARGET QtNetwork PROPERTY PREFIX "")
target_link_libraries(QtNetwork
pyside
- ${PYTHON_LIBRARIES}
+ ${PYSIDE_PYTHON_LIBRARIES}
${SHIBOKEN_LIBRARY}
${QT_QTNETWORK_LIBRARY}
)
diff --git a/PySide/QtOpenGL/CMakeLists.txt b/PySide/QtOpenGL/CMakeLists.txt
index 5849c9a..158f4be 100644
--- a/PySide/QtOpenGL/CMakeLists.txt
+++ b/PySide/QtOpenGL/CMakeLists.txt
@@ -48,7 +48,7 @@ add_library(QtOpenGL MODULE ${QtOpenGL_SRC})
set_target_properties(QtOpenGL PROPERTIES PREFIX "")
target_link_libraries(QtOpenGL
pyside
- ${PYTHON_LIBRARIES}
+ ${PYSIDE_PYTHON_LIBRARIES}
${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY}
${QT_QTOPENGL_LIBRARY})
diff --git a/PySide/QtScript/CMakeLists.txt b/PySide/QtScript/CMakeLists.txt
index 8b63447..af6ffd4 100644
--- a/PySide/QtScript/CMakeLists.txt
+++ b/PySide/QtScript/CMakeLists.txt
@@ -40,7 +40,7 @@ add_library(QtScript MODULE ${QtScript_SRC})
set_property(TARGET QtScript PROPERTY PREFIX "")
target_link_libraries(QtScript
pyside
- ${PYTHON_LIBRARIES}
+ ${PYSIDE_PYTHON_LIBRARIES}
${SHIBOKEN_LIBRARY}
${QT_QTCORE_LIBRARY}
${QT_QTSCRIPT_LIBRARY}
diff --git a/PySide/QtScriptTools/CMakeLists.txt b/PySide/QtScriptTools/CMakeLists.txt
index d937d66..22860b1 100644
--- a/PySide/QtScriptTools/CMakeLists.txt
+++ b/PySide/QtScriptTools/CMakeLists.txt
@@ -24,7 +24,7 @@ add_library(QtScriptTools MODULE ${QtScriptTools_SRC})
set_target_properties(QtScriptTools PROPERTIES PREFIX "")
target_link_libraries(QtScriptTools
pyside
- ${PYTHON_LIBRARIES}
+ ${PYSIDE_PYTHON_LIBRARIES}
${QT_QTCORE_LIBRARY}
${QT_GUI_LIBRARY}
${QT_QTSCRIPT_LIBRARY}
diff --git a/PySide/QtSql/CMakeLists.txt b/PySide/QtSql/CMakeLists.txt
index 1cbe713..1c45ac0 100644
--- a/PySide/QtSql/CMakeLists.txt
+++ b/PySide/QtSql/CMakeLists.txt
@@ -37,7 +37,7 @@ add_library(QtSql MODULE ${QtSql_SRC})
set_target_properties(QtSql PROPERTIES PREFIX "")
target_link_libraries(QtSql
pyside
- ${PYTHON_LIBRARIES}
+ ${PYSIDE_PYTHON_LIBRARIES}
${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY}
${QT_QTSQL_LIBRARY})
diff --git a/PySide/QtSvg/CMakeLists.txt b/PySide/QtSvg/CMakeLists.txt
index 631131a..33cdba5 100644
--- a/PySide/QtSvg/CMakeLists.txt
+++ b/PySide/QtSvg/CMakeLists.txt
@@ -49,7 +49,7 @@ add_library(QtSvg MODULE ${QtSvg_SRC})
set_property(TARGET QtSvg PROPERTY PREFIX "")
target_link_libraries(QtSvg
pyside
- ${PYTHON_LIBRARIES}
+ ${PYSIDE_PYTHON_LIBRARIES}
${SHIBOKEN_LIBRARY}
${QT_QTSVG_LIBRARY}
${QT_QTGUI_LIBRARY}
diff --git a/PySide/QtTest/CMakeLists.txt b/PySide/QtTest/CMakeLists.txt
index b447f79..3ac608f 100644
--- a/PySide/QtTest/CMakeLists.txt
+++ b/PySide/QtTest/CMakeLists.txt
@@ -37,7 +37,7 @@ add_library(QtTest MODULE ${QtTest_SRC})
set_property(TARGET QtTest PROPERTY PREFIX "")
target_link_libraries(QtTest
pyside
- ${PYTHON_LIBRARIES}
+ ${PYSIDE_PYTHON_LIBRARIES}
${SHIBOKEN_LIBRARY}
${QT_QTTEST_LIBRARY}
${QT_QTGUI_LIBRARY}
diff --git a/PySide/QtUiTools/CMakeLists.txt b/PySide/QtUiTools/CMakeLists.txt
index 5809c3f..320fc1a 100644
--- a/PySide/QtUiTools/CMakeLists.txt
+++ b/PySide/QtUiTools/CMakeLists.txt
@@ -24,7 +24,7 @@ add_library(QtUiTools MODULE ${QtUiTools_SRC})
set_target_properties(QtUiTools PROPERTIES PREFIX "")
target_link_libraries(QtUiTools
pyside
- ${PYTHON_LIBRARIES}
+ ${PYSIDE_PYTHON_LIBRARIES}
${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY}
${QT_QTUITOOLS_LIBRARY})
diff --git a/PySide/QtWebKit/CMakeLists.txt b/PySide/QtWebKit/CMakeLists.txt
index 7bdf6e0..464bc28 100644
--- a/PySide/QtWebKit/CMakeLists.txt
+++ b/PySide/QtWebKit/CMakeLists.txt
@@ -65,7 +65,7 @@ add_library(QtWebKit MODULE ${QtWebKit_SRC})
set_property(TARGET QtWebKit PROPERTY PREFIX "")
target_link_libraries(QtWebKit
pyside
- ${PYTHON_LIBRARIES}
+ ${PYSIDE_PYTHON_LIBRARIES}
${SHIBOKEN_LIBRARY}
${QT_QTWEBKIT_LIBRARY}
${QT_QTNETWORK_LIBRARY}
diff --git a/PySide/QtXml/CMakeLists.txt b/PySide/QtXml/CMakeLists.txt
index e6b4e80..fc7b0d0 100644
--- a/PySide/QtXml/CMakeLists.txt
+++ b/PySide/QtXml/CMakeLists.txt
@@ -52,7 +52,7 @@ add_library(QtXml MODULE ${QtXml_SRC})
set_property(TARGET QtXml PROPERTY PREFIX "")
target_link_libraries(QtXml
pyside
- ${PYTHON_LIBRARIES}
+ ${PYSIDE_PYTHON_LIBRARIES}
${SHIBOKEN_LIBRARY}
${QT_QTXML_LIBRARY}
)
diff --git a/PySide/QtXmlPatterns/CMakeLists.txt b/PySide/QtXmlPatterns/CMakeLists.txt
index df67372..825011f 100644
--- a/PySide/QtXmlPatterns/CMakeLists.txt
+++ b/PySide/QtXmlPatterns/CMakeLists.txt
@@ -41,7 +41,7 @@ add_library(QtXmlPatterns MODULE ${QtXmlPatterns_SRC})
set_target_properties(QtXmlPatterns PROPERTIES PREFIX "")
target_link_libraries(QtXmlPatterns
pyside
- ${PYTHON_LIBRARIES}
+ ${PYSIDE_PYTHON_LIBRARIES}
${QT_QTCORE_LIBRARY}
${QT_QTXMLPATTERNS_LIBRARY})
add_dependencies(QtXmlPatterns QtCore)
diff --git a/PySide/phonon/CMakeLists.txt b/PySide/phonon/CMakeLists.txt
index 1b2f05f..b46304a 100644
--- a/PySide/phonon/CMakeLists.txt
+++ b/PySide/phonon/CMakeLists.txt
@@ -60,7 +60,7 @@ add_library(phonon MODULE ${phonon_SRC})
set_target_properties(phonon PROPERTIES PREFIX "")
target_link_libraries(phonon
pyside
- ${PYTHON_LIBRARIES}
+ ${PYSIDE_PYTHON_LIBRARIES}
${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY}
${QT_PHONON_LIBRARY})
diff --git a/libpyside/CMakeLists.txt b/libpyside/CMakeLists.txt
index 57ecb80..9590a32 100644
--- a/libpyside/CMakeLists.txt
+++ b/libpyside/CMakeLists.txt
@@ -17,7 +17,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}
add_library(pyside SHARED ${libpyside_SRC})
target_link_libraries(pyside
- ${PYTHON_LIBRARIES}
+ ${PYSIDE_PYTHON_LIBRARIES}
${SHIBOKEN_LIBRARY}
${QT_QTCORE_LIBRARY})
From 3267accc9f8c96371302531fdb8d1c24271cfd44 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Fri, 23 Jul 2010 11:45:30 -0300
Subject: [PATCH 0092/1129] Fixed uninitialized value.
---
libpyside/dynamicqmetaobject.cpp | 4 ++++
libpyside/dynamicqmetaobject.h | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/libpyside/dynamicqmetaobject.cpp b/libpyside/dynamicqmetaobject.cpp
index 8f97b56..0e545fa 100644
--- a/libpyside/dynamicqmetaobject.cpp
+++ b/libpyside/dynamicqmetaobject.cpp
@@ -215,6 +215,10 @@ bool MethodData::isValid() const
return m_signature->size();
}
+PropertyData::PropertyData()
+ : m_data(0)
+{
+}
PropertyData::PropertyData(const char* name, PyObject* data)
: m_name(name), m_data(data)
diff --git a/libpyside/dynamicqmetaobject.h b/libpyside/dynamicqmetaobject.h
index 23a69c9..f8c120b 100644
--- a/libpyside/dynamicqmetaobject.h
+++ b/libpyside/dynamicqmetaobject.h
@@ -69,7 +69,7 @@ private:
class PropertyData
{
public:
- PropertyData(){}
+ PropertyData();
PropertyData(const char*name, PyObject *data);
QByteArray name() const;
QByteArray type() const;
From 078408b8c25d73b900955b87e92dc50e9b19eb33 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Fri, 23 Jul 2010 13:48:47 -0300
Subject: [PATCH 0093/1129] Avoid running x11 specific tests on others OS.
---
tests/QtCore/CMakeLists.txt | 5 ++++-
tests/QtGui/CMakeLists.txt | 6 +++++-
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/tests/QtCore/CMakeLists.txt b/tests/QtCore/CMakeLists.txt
index b5f59d4..518ff9d 100644
--- a/tests/QtCore/CMakeLists.txt
+++ b/tests/QtCore/CMakeLists.txt
@@ -21,7 +21,6 @@ PYSIDE_TEST(qevent_test.py)
PYSIDE_TEST(qfileinfo_test.py)
PYSIDE_TEST(qfile_test.py)
PYSIDE_TEST(qflags_test.py)
-PYSIDE_TEST(qhandle_test.py)
PYSIDE_TEST(qinstallmsghandler_test.py)
PYSIDE_TEST(qlinef_test.py)
PYSIDE_TEST(qlocale_test.py)
@@ -62,3 +61,7 @@ PYSIDE_TEST(thread_signals_test.py)
PYSIDE_TEST(translation_test.py)
PYSIDE_TEST(unaryoperator_test.py)
PYSIDE_TEST(unicode_test.py)
+
+if(X11)
+ PYSIDE_TEST(qhandle_test.py)
+endif()
diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt
index 5ebd754..077dd1a 100644
--- a/tests/QtGui/CMakeLists.txt
+++ b/tests/QtGui/CMakeLists.txt
@@ -62,4 +62,8 @@ PYSIDE_TEST(timed_app_test.py)
PYSIDE_TEST(virtual_protected_inheritance_test.py)
PYSIDE_TEST(virtual_pure_override_test.py)
PYSIDE_TEST(wrong_return_test.py)
-PYSIDE_TEST(x11_symbols_test.py)
+
+
+if(X11)
+ PYSIDE_TEST(x11_symbols_test.py)
+endif()
From e42133e8e715600a948831eb9c29a5437a5f4fa1 Mon Sep 17 00:00:00 2001
From: Luciano Wolf
Date: Fri, 23 Jul 2010 11:10:57 -0300
Subject: [PATCH 0094/1129] Fix elasticnodes segfault.
---
PySide/QtCore/qvariant_conversions.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/PySide/QtCore/qvariant_conversions.h b/PySide/QtCore/qvariant_conversions.h
index 9178aa8..7a799e1 100644
--- a/PySide/QtCore/qvariant_conversions.h
+++ b/PySide/QtCore/qvariant_conversions.h
@@ -57,6 +57,7 @@ struct Converter
QString stypeName(typeName);
stypeName += '*';
typeCode = QMetaType::type(stypeName.toAscii());
+ return QVariant(typeCode, reinterpret_cast(pyObj)->cptr);
}
if (typeCode)
return QVariant(typeCode, reinterpret_cast(pyObj)->cptr[0]);
From 505ba23a9d63e7c6d014f3c5bd5b1cdf778aac56 Mon Sep 17 00:00:00 2001
From: Marcelo Lira
Date: Tue, 27 Jul 2010 10:01:33 -0300
Subject: [PATCH 0095/1129] Fixed glue code for QApplication and
QCoreApplication.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The code for QApplication deletion should also invalidate the
wrapper for it. Also the similar code for QCoreApplication must
perform the same steps as QApplication.
Reviewed by Luciano Wolf
Reviewed by Renato Araújo
---
PySide/QtCore/glue/qcoreapplication_init.cpp | 4 +++-
PySide/QtGui/glue/qapplication_init.cpp | 1 +
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/PySide/QtCore/glue/qcoreapplication_init.cpp b/PySide/QtCore/glue/qcoreapplication_init.cpp
index f53db03..d9bc4cf 100644
--- a/PySide/QtCore/glue/qcoreapplication_init.cpp
+++ b/PySide/QtCore/glue/qcoreapplication_init.cpp
@@ -7,7 +7,9 @@ static char** QCoreApplicationArgValues;
*/
void DeleteQCoreApplicationAtExit() {
if (QCoreApplication::instance()) {
- delete QCoreApplication::instance();
+ PySide::SignalManager::instance().clear();
+ BindingManager::instance().invalidateWrapper(QCoreApplication::instance());
+ QCoreApplication::instance()->deleteLater();
for (int i = 0; i < QCoreApplicationArgCount; ++i)
delete[] QCoreApplicationArgValues[i];
}
diff --git a/PySide/QtGui/glue/qapplication_init.cpp b/PySide/QtGui/glue/qapplication_init.cpp
index 00e37b1..9911a11 100644
--- a/PySide/QtGui/glue/qapplication_init.cpp
+++ b/PySide/QtGui/glue/qapplication_init.cpp
@@ -8,6 +8,7 @@ void DeleteQApplicationAtExit() {
if (QApplication::instance()) {
//disconnect and decref all widgets used on signals before destroy qApp
PySide::SignalManager::instance().clear();
+ BindingManager::instance().invalidateWrapper(QApplication::instance());
QApplication::instance()->deleteLater();
for (int i = 0; i < QApplicationArgCount; ++i)
delete[] QApplicationArgValues[i];
From 4f51600e20b25f05eb9730c131ca3cd51eaa1774 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Wed, 28 Jul 2010 17:50:11 -0300
Subject: [PATCH 0096/1129] Created unit test to test shiboken objects
destructor.
Reviewer: Marcelo Lira
Luciano Wolf
---
tests/QtCore/CMakeLists.txt | 1 +
tests/QtCore/qobject_destructor.py | 19 +++++++++++++++++++
2 files changed, 20 insertions(+)
create mode 100644 tests/QtCore/qobject_destructor.py
diff --git a/tests/QtCore/CMakeLists.txt b/tests/QtCore/CMakeLists.txt
index 518ff9d..b8f7390 100644
--- a/tests/QtCore/CMakeLists.txt
+++ b/tests/QtCore/CMakeLists.txt
@@ -28,6 +28,7 @@ PYSIDE_TEST(qmetaobject_test.py)
PYSIDE_TEST(qmodelindex_internalpointer_test.py)
PYSIDE_TEST(qobject_children_segfault_test.py)
PYSIDE_TEST(qobject_connect_notify_test.py)
+PYSIDE_TEST(qobject_destructor.py)
PYSIDE_TEST(qobject_event_filter_test.py)
PYSIDE_TEST(qobject_inherits_test.py)
PYSIDE_TEST(qobject_parent_test.py)
diff --git a/tests/QtCore/qobject_destructor.py b/tests/QtCore/qobject_destructor.py
new file mode 100644
index 0000000..036bf1d
--- /dev/null
+++ b/tests/QtCore/qobject_destructor.py
@@ -0,0 +1,19 @@
+import sys
+import unittest
+from PySide import QtCore
+
+class MyObject(QtCore.QObject):
+ def __init__(self, other=None):
+ QtCore.QObject.__init__(self, None)
+ self._o = other
+
+class TestDestructor(unittest.TestCase):
+ def testReference(self):
+ o = QtCore.QObject()
+ m = MyObject(o)
+ self.assertEqual(sys.getrefcount(o), 3)
+ del m
+ self.assertEqual(sys.getrefcount(o), 2)
+
+if __name__ == '__main__':
+ unittest.main()
From f4668398e2c536f4ff191991af4fd992b044d196 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Thu, 29 Jul 2010 13:52:32 -0300
Subject: [PATCH 0097/1129] Call signalmanager clear during QtCore exit
function instead of QtCoreApplication destrcutor, to avoid memory leaks.
Reviewer: Marcelo Lira
Luciano Wolf
---
PySide/QtCore/glue/qcoreapplication_init.cpp | 1 -
PySide/QtCore/typesystem_core.xml | 6 ++++++
PySide/QtGui/glue/qapplication_init.cpp | 2 --
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/PySide/QtCore/glue/qcoreapplication_init.cpp b/PySide/QtCore/glue/qcoreapplication_init.cpp
index d9bc4cf..5fcd79a 100644
--- a/PySide/QtCore/glue/qcoreapplication_init.cpp
+++ b/PySide/QtCore/glue/qcoreapplication_init.cpp
@@ -7,7 +7,6 @@ static char** QCoreApplicationArgValues;
*/
void DeleteQCoreApplicationAtExit() {
if (QCoreApplication::instance()) {
- PySide::SignalManager::instance().clear();
BindingManager::instance().invalidateWrapper(QCoreApplication::instance());
QCoreApplication::instance()->deleteLater();
for (int i = 0; i < QCoreApplicationArgCount; ++i)
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 8f30143..db038e2 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -648,12 +648,14 @@
+
Shiboken::TypeResolver::createValueTypeResolver<QString>("unicode");
Shiboken::TypeResolver::createValueTypeResolver<QString>("str");
PySide::init(module);
+ Py_AtExit(QtCoreModuleExit);
#include <pyside.h>
@@ -669,6 +671,10 @@
Shiboken::AutoDecRef arglist(Shiboken::makeTuple(type, msg));
Shiboken::AutoDecRef ret(PyObject_CallObject(qtmsghandler, arglist));
}
+ void QtCoreModuleExit()
+ {
+ PySide::SignalManager::instance().clear();
+ }
diff --git a/PySide/QtGui/glue/qapplication_init.cpp b/PySide/QtGui/glue/qapplication_init.cpp
index 9911a11..da9e2dc 100644
--- a/PySide/QtGui/glue/qapplication_init.cpp
+++ b/PySide/QtGui/glue/qapplication_init.cpp
@@ -6,8 +6,6 @@ static char** QApplicationArgValues;
void DeleteQApplicationAtExit() {
if (QApplication::instance()) {
- //disconnect and decref all widgets used on signals before destroy qApp
- PySide::SignalManager::instance().clear();
BindingManager::instance().invalidateWrapper(QApplication::instance());
QApplication::instance()->deleteLater();
for (int i = 0; i < QApplicationArgCount; ++i)
From 1fe7baf787381775e845923872d78096153ab5e3 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Thu, 29 Jul 2010 13:53:47 -0300
Subject: [PATCH 0098/1129] Emit connectNotify with real signal name.
Reviewer: Marcelo Lira
Luciano Wolf
---
PySide/QtCore/glue/qobject_connect.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/PySide/QtCore/glue/qobject_connect.cpp b/PySide/QtCore/glue/qobject_connect.cpp
index 535dd10..8578bff 100644
--- a/PySide/QtCore/glue/qobject_connect.cpp
+++ b/PySide/QtCore/glue/qobject_connect.cpp
@@ -76,11 +76,11 @@ static bool qobjectConnectCallback(QObject* source, const char* signal, PyObject
}
if (QMetaObject::connect(source, signalIndex, receiver, slotIndex, type)) {
#ifndef AVOID_PROTECTED_HACK
- source->connectNotify(signal);
+ source->connectNotify(signal - 1);
#else
// Need to cast to QObjectWrapper* and call the public version of
// connectNotify when avoiding the protected hack.
- reinterpret_cast(source)->connectNotify(signal);
+ reinterpret_cast(source)->connectNotify(signal - 1);
#endif
if (usingGlobalReceiver)
signalManager.globalReceiverConnectNotify(source, slotIndex);
From 6a2df2daa4e1efc5b7e6e5946c96a528ec9b7248 Mon Sep 17 00:00:00 2001
From: Marcelo Lira
Date: Thu, 29 Jul 2010 15:02:48 -0300
Subject: [PATCH 0099/1129] Added test case for signal signature received by
QObject::connectNotify().
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Reviewed by Luciano Wolf
Reviewed by Renato Araújo
---
tests/signals/CMakeLists.txt | 3 +-
tests/signals/signal_signature_test.py | 41 ++++++++++++++++++++++++++
2 files changed, 43 insertions(+), 1 deletion(-)
create mode 100644 tests/signals/signal_signature_test.py
diff --git a/tests/signals/CMakeLists.txt b/tests/signals/CMakeLists.txt
index e09be0e..eda247d 100644
--- a/tests/signals/CMakeLists.txt
+++ b/tests/signals/CMakeLists.txt
@@ -3,6 +3,7 @@ PYSIDE_TEST(decorators_test.py)
PYSIDE_TEST(invalid_callback_test.py)
PYSIDE_TEST(lambda_gui_test.py)
PYSIDE_TEST(lambda_test.py)
+PYSIDE_TEST(list_signal_test.py)
PYSIDE_TEST(multiple_connections_gui_test.py)
PYSIDE_TEST(multiple_connections_test.py)
PYSIDE_TEST(pysignal_test.py)
@@ -26,8 +27,8 @@ PYSIDE_TEST(signal_emission_test.py)
PYSIDE_TEST(signal_func_test.py)
PYSIDE_TEST(signal_manager_refcount_test.py)
PYSIDE_TEST(signal_object_test.py)
+PYSIDE_TEST(signal_signature_test.py)
PYSIDE_TEST(signal_with_primitive_type_test.py)
PYSIDE_TEST(slot_reference_count_test.py)
PYSIDE_TEST(static_metaobject_test.py)
PYSIDE_TEST(upstream_segfault_test.py)
-PYSIDE_TEST(list_signal_test.py)
diff --git a/tests/signals/signal_signature_test.py b/tests/signals/signal_signature_test.py
new file mode 100644
index 0000000..785ebb8
--- /dev/null
+++ b/tests/signals/signal_signature_test.py
@@ -0,0 +1,41 @@
+# -*- coding: utf-8 -*-
+
+'''Test case for signal signature received by QObject::connectNotify().'''
+
+import unittest
+from PySide.QtCore import *
+from helper import UsesQCoreApplication
+
+class Obj(QObject):
+ def __init__(self):
+ QObject.__init__(self)
+ self.signal = ''
+
+ def connectNotify(self, signal):
+ self.signal = signal
+
+def callback():
+ pass
+
+class TestConnectNotifyWithNewStyleSignals(UsesQCoreApplication):
+ '''Test case for signal signature received by QObject::connectNotify().'''
+
+ def testOldStyle(self):
+ sender = Obj()
+ receiver = QObject()
+ sender.connect(SIGNAL('destroyed()'), receiver, SLOT('deleteLater()'))
+ self.assertEqual(sender.signal, SIGNAL('destroyed()'))
+
+ def testOldStyleWithPythonCallback(self):
+ sender = Obj()
+ sender.connect(SIGNAL('destroyed()'), callback)
+ self.assertEqual(sender.signal, SIGNAL('destroyed()'))
+
+ def testNewStyle(self):
+ sender = Obj()
+ sender.destroyed.connect(callback)
+ self.assertEqual(sender.signal, SIGNAL('destroyed(QObject*)'))
+
+if __name__ == '__main__':
+ unittest.main()
+
From ee7b4826c0f0e487b75a70812dbcdcab00a0afdd Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Thu, 29 Jul 2010 19:14:05 -0300
Subject: [PATCH 0100/1129] Fixed return policy on ItemList.
Fixed singleShot function to invalidate temporary object.
Reviewer: Marcelo Lira
Luciano Wolf
---
PySide/QtCore/typesystem_core.xml | 3 +++
PySide/QtGui/typesystem_gui_common.xml | 5 +++++
2 files changed, 8 insertions(+)
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index db038e2..84cf906 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -1697,6 +1697,8 @@
QTimer* timer = Converter<QTimer*>::toCpp(pyTimer);
PyObject* result = PyObject_CallMethod(pyTimer, const_cast<char*>("connect"), const_cast<char*>("OsOs"), pyTimer, SIGNAL(timeout()), %PYARG_2, %3);
Py_DECREF(result);
+ // invalidate to avoid use of python object
+ Shiboken::BindingManager::instance().invalidateWrapper((Shiboken::SbkBaseWrapper *)pyTimer);
timer->setSingleShot(true);
timer->connect(timer, SIGNAL("timeout()"), timer, SLOT("deleteLater()"));
timer->start(%1);
@@ -1713,6 +1715,7 @@
timer->connect(timer, SIGNAL(timeout()), timer, SLOT(deleteLater()));
PyObject* result = PyObject_CallMethod(pyTimer, const_cast<char*>("connect"), const_cast<char*>("OsO"), pyTimer, SIGNAL(timeout()), pyargs[1]);
Py_DECREF(result);
+ Shiboken::BindingManager::instance().invalidateWrapper((Shiboken::SbkBaseWrapper *)pyTimer);
timer->start(cpp_arg0);
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index 7308f00..eb0c3c8 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -2953,6 +2953,11 @@
+
+
+
+
+
From 1920130fc973f61b0e42f468df9576a917bf2b2e Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Thu, 29 Jul 2010 19:20:50 -0300
Subject: [PATCH 0101/1129] Fixed cyclic dependency on duck punching test.
Reviewer: Marcelo Lira
Luciano Wolf
---
tests/QtCore/duck_punching_test.py | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/tests/QtCore/duck_punching_test.py b/tests/QtCore/duck_punching_test.py
index e20c0c1..880a8e4 100644
--- a/tests/QtCore/duck_punching_test.py
+++ b/tests/QtCore/duck_punching_test.py
@@ -37,6 +37,12 @@ class TestDuckPunchingOnQObjectInstance(UsesQCoreApplication):
child = QObject()
child.setParent(parent)
self.assert_(self.duck_childEvent_called)
+ # This is done to decrease the refcount of the vm object
+ # allowing the object wrapper to be deleted before the
+ # BindingManager. This is useful when compiling Shiboken
+ # for debug, since the BindingManager destructor has an
+ # assert that checks if the wrapper mapper is empty.
+ parent.childEvent = None
def testChildEventMonkeyPatchWithInheritance(self):
#Test if the new childEvent injected on a QObject's extension class instance is called from C++
@@ -50,6 +56,12 @@ class TestDuckPunchingOnQObjectInstance(UsesQCoreApplication):
child = QObject()
child.setParent(parent)
self.assert_(self.duck_childEvent_called)
+ # This is done to decrease the refcount of the vm object
+ # allowing the object wrapper to be deleted before the
+ # BindingManager. This is useful when compiling Shiboken
+ # for debug, since the BindingManager destructor has an
+ # assert that checks if the wrapper mapper is empty.
+ parent.childEvent = None
if __name__ == '__main__':
unittest.main()
From 6c8c9c6391d55a02bb2369fa1c154e9a3a8013d2 Mon Sep 17 00:00:00 2001
From: Luciano Wolf
Date: Mon, 2 Aug 2010 11:15:19 -0300
Subject: [PATCH 0102/1129] Fix getOpenFileName/getSaveFileName signatures.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Reviewer: Renato Araújo
Marcelo Lira
---
PySide/QtGui/typesystem_gui_common.xml | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index eb0c3c8..58e233c 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -3596,6 +3596,9 @@
+
+
+
@@ -3604,6 +3607,9 @@
+
+
+
@@ -3612,6 +3618,9 @@
+
+
+
From a6440638302436156fb8441a64f24eb8b5208c62 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Fri, 30 Jul 2010 11:39:00 -0300
Subject: [PATCH 0103/1129] Fix compile on cmake 2.8 for mac users.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Reviewer: Renato Araújo
Marcelo Lira
---
CMakeLists.txt | 25 +++++++++++++++----------
1 file changed, 15 insertions(+), 10 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e797457..2e137bf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,9 +3,18 @@ include(icecc.cmake) # this must be the first line!
project(pysidebindings)
cmake_minimum_required(VERSION 2.6)
-
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules/
${CMAKE_MODULE_PATH})
+find_package(PythonLibs REQUIRED)
+find_package(PythonInterpWithDebug REQUIRED)
+find_package(Shiboken 0.3.3 REQUIRED)
+find_package(Qt4 4.5.0 REQUIRED)
+
+set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" )
+set(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" CACHE PATH "The subdirectory relative to the install prefix where libraries will be installed (default is /lib${LIB_SUFFIX})" FORCE)
+if(CMAKE_HOST_APPLE)
+ set(ALTERNATIVE_QT_INCLUDE_DIR "" CACHE PATH "The Alternative value to QT_INCLUDE_DIR. Necessary to fix bug on cmake 2.8 MACOS users")
+endif()
if(CMAKE_HOST_UNIX)
option(ENABLE_GCC_OPTIMIZATION "Enable specific GCC flags to optimization library size and performance. Only available on Release Mode" 0)
@@ -22,7 +31,11 @@ if(CMAKE_HOST_UNIX)
if(CMAKE_HOST_APPLE)
if (NOT QT_INCLUDE_DIR)
set(QT_INCLUDE_DIR "/Library/Frameworks")
- endif()
+ endif()
+ if(ALTERNATIVE_QT_INCLUDE_DIR)
+ set(QT_INCLUDE_DIR ${ALTERNATIVE_QT_INCLUDE_DIR})
+ endif()
+ string(REPLACE " " ":" QT_INCLUDE_DIR ${QT_INCLUDE_DIR})
endif()
endif()
@@ -36,11 +49,6 @@ if(AVOID_PROTECTED_HACK OR WIN32)
message(STATUS "Avoiding protected hack!")
endif()
-find_package(PythonLibs REQUIRED)
-find_package(PythonInterpWithDebug REQUIRED)
-find_package(Shiboken 0.3.3 REQUIRED)
-find_package(Qt4 4.5.0 REQUIRED)
-
#Fix missing variable on UNIX env
if(NOT PYTHON_DEBUG_LIBRARIES AND UNIX)
set(PYTHON_DEBUG_LIBRARIES "${PYTHON_LIBRARIES}")
@@ -52,9 +60,6 @@ set(BINDING_API_MINOR_VERSION "3")
set(BINDING_API_MICRO_VERSION "3")
set(BINDING_API_VERSION "${BINDING_API_MAJOR_VERSION}.${BINDING_API_MINOR_VERSION}.${BINDING_API_MICRO_VERSION}")
-set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" )
-set(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" CACHE PATH "The subdirectory relative to the install prefix where libraries will be installed (default is /lib${LIB_SUFFIX})" FORCE)
-
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
From d4f911f5b377b6847bd6309e3f6c5aa00a3690bd Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Mon, 2 Aug 2010 11:39:17 -0300
Subject: [PATCH 0104/1129] Raise a python error when signal not found on
object.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Reviewer: Renato Araújo
Marcelo Lira
---
libpyside/qsignal.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libpyside/qsignal.cpp b/libpyside/qsignal.cpp
index dff9cc1..ec0610b 100644
--- a/libpyside/qsignal.cpp
+++ b/libpyside/qsignal.cpp
@@ -212,6 +212,7 @@ PyObject* signal_instance_get_item(PyObject* self, PyObject* key)
char* sigKey = signal_parse_signature(key);
char* sig = signal_build_signature(data->signalName, sigKey);
free(sigKey);
+ const char* sigName = data->signalName;
while(data) {
if (strcmp(data->signature, sig) == 0) {
@@ -222,7 +223,9 @@ PyObject* signal_instance_get_item(PyObject* self, PyObject* key)
}
data = reinterpret_cast(data->next);
}
+ PyErr_Format(PyExc_IndexError, "Signature %s not found for signal: %s", sig, sigName);
free(sig);
+
return 0;
}
From 09876a43863e7846ce514ae94d2ad0056a32bc67 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Mon, 2 Aug 2010 14:53:01 -0300
Subject: [PATCH 0105/1129] Created unit test to bug #274.
Reviewer: Marcelo Lira
Luciano Wolf
---
tests/QtGui/qaction_test.py | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/tests/QtGui/qaction_test.py b/tests/QtGui/qaction_test.py
index b926ad6..0379d20 100644
--- a/tests/QtGui/qaction_test.py
+++ b/tests/QtGui/qaction_test.py
@@ -16,6 +16,14 @@ class QPainterDrawText(UsesQApplication):
act.trigger()
self.assert_(self._called)
+ def testNewCtor(self):
+ o = QWidget()
+ self._called = False
+ myAction = QAction("&Quit", o, triggered=self._cb)
+ myAction.trigger()
+ self.assert_(self._called)
+
+
if __name__ == '__main__':
unittest.main()
From efe8019eda0471baf99ed4372ceda4af06cbe3c1 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Mon, 2 Aug 2010 14:53:29 -0300
Subject: [PATCH 0106/1129] Created a pythonic constructor to QAction
Fixes bug #274.
Reviewer: Marcelo Lira
Luciano Wolf
---
PySide/QtGui/typesystem_gui_common.xml | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index 58e233c..64849ae 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -4251,6 +4251,24 @@
+
+
+
+
+
+
+
+
+
+
+ %0 = new QActionWrapper(%1, %2);
+
+
+
+ if (%PYARG_3 != Py_None)
+ Shiboken::AutoDecRef result(PyObject_CallMethod(%PYSELF, "connect", "OsO", %PYSELF, SIGNAL(triggered(bool)), %PYARG_3));
+
+
@@ -4366,7 +4384,6 @@
-
From 114bca41a21bf5504094b30d7c8735ac8483e50d Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Mon, 2 Aug 2010 14:55:03 -0300
Subject: [PATCH 0107/1129] Created unit test to layout ref leak.
Reviewer: Marcelo Lira
Luciano Wolf
---
tests/QtGui/qlayout_ref_test.py | 40 +++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
diff --git a/tests/QtGui/qlayout_ref_test.py b/tests/QtGui/qlayout_ref_test.py
index 27c599c..695e2f1 100644
--- a/tests/QtGui/qlayout_ref_test.py
+++ b/tests/QtGui/qlayout_ref_test.py
@@ -108,5 +108,45 @@ class MultipleAdd(UsesQApplication):
self.layout.addWidget(self.widget)
self.assertEqual(getrefcount(self.widget), 3)
+class InternalAdd(UsesQApplication):
+ def testInternalRef(self):
+ mw = QWidget()
+ w = QWidget()
+ ow = QWidget()
+
+ topLayout = QGridLayout()
+
+ # unique reference
+ self.assertEqual(getrefcount(w), 2)
+ self.assertEqual(getrefcount(ow), 2)
+
+ topLayout.addWidget(w, 0, 0)
+ topLayout.addWidget(ow, 1, 0)
+
+ # layout keep the referemce
+ self.assertEqual(getrefcount(w), 3)
+ self.assertEqual(getrefcount(ow), 3)
+
+ mainLayout = QGridLayout()
+
+ mainLayout.addLayout(topLayout, 1, 0, 1, 4)
+
+ # the same reference
+ self.assertEqual(getrefcount(w), 3)
+ self.assertEqual(getrefcount(ow), 3)
+
+ mw.setLayout(mainLayout)
+
+ # now trasfer the ownership to mw
+ self.assertEqual(getrefcount(w), 3)
+ self.assertEqual(getrefcount(ow), 3)
+
+ del mw
+
+ # remove the ref and invalidate the widget
+ self.assertEqual(getrefcount(w), 2)
+ self.assertEqual(getrefcount(ow), 2)
+
+
if __name__ == '__main__':
unittest.main()
From 630a4062ff9d837ae0f91056ab610183bf47370a Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Mon, 2 Aug 2010 14:55:50 -0300
Subject: [PATCH 0108/1129] Fixed ref leak on QMenu inject code.
Reviewer: Marcelo Lira
Luciano Wolf
---
PySide/QtGui/glue/qmenu_glue.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/PySide/QtGui/glue/qmenu_glue.h b/PySide/QtGui/glue/qmenu_glue.h
index 7f0475a..1a6cb19 100644
--- a/PySide/QtGui/glue/qmenu_glue.h
+++ b/PySide/QtGui/glue/qmenu_glue.h
@@ -13,8 +13,8 @@ addActionWithPyObject(QMenu *self, const QIcon& icon, const QString& text, PyObj
self->addAction(act);
PyObject *pyAct = Shiboken::Converter::toPython(act);
- PyObject* result = PyObject_CallMethod(pyAct, "connect", "OsO", pyAct, SIGNAL(triggered()), callback);
- if (result == 0) {
+ Shiboken::AutoDecRef result(PyObject_CallMethod(pyAct, "connect", "OsO", pyAct, SIGNAL(triggered()), callback));
+ if (result.isNull()) {
Py_DECREF(pyAct);
return 0;
}
From 34a06b8de43767cc206d2a200c84e5505516e111 Mon Sep 17 00:00:00 2001
From: Luciano Wolf
Date: Mon, 2 Aug 2010 17:12:18 -0300
Subject: [PATCH 0109/1129] Fix bug273 - QT_VERSION and QT_VERSION_STR
constants.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Reviewer: Renato Araújo
Marcelo Lira
---
PySide/QtCore/typesystem_core.xml | 6 ++++++
tests/QtCore/CMakeLists.txt | 1 +
tests/QtCore/qqtversion_test.py | 18 ++++++++++++++++++
3 files changed, 25 insertions(+)
create mode 100644 tests/QtCore/qqtversion_test.py
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 84cf906..9d38208 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -522,6 +522,12 @@
%PYARG_0 = %CONVERTTOPYTHON[long](qAbs(%1));
+
+
+ PyModule_AddIntConstant(module, "QT_VERSION", QT_VERSION);
+ PyModule_AddStringConstant(module, "QT_VERSION_STR", QT_VERSION_STR);
+
+
diff --git a/tests/QtCore/CMakeLists.txt b/tests/QtCore/CMakeLists.txt
index b8f7390..490f734 100644
--- a/tests/QtCore/CMakeLists.txt
+++ b/tests/QtCore/CMakeLists.txt
@@ -39,6 +39,7 @@ PYSIDE_TEST(qobject_timer_event_test.py)
PYSIDE_TEST(qobject_tr_as_instance_test.py)
PYSIDE_TEST(qpoint_test.py)
PYSIDE_TEST(qprocess_test.py)
+PYSIDE_TEST(qqtversion_test.py)
PYSIDE_TEST(qrect_test.py)
PYSIDE_TEST(qresource_test.py)
PYSIDE_TEST(qsize_test.py)
diff --git a/tests/QtCore/qqtversion_test.py b/tests/QtCore/qqtversion_test.py
new file mode 100644
index 0000000..344de69
--- /dev/null
+++ b/tests/QtCore/qqtversion_test.py
@@ -0,0 +1,18 @@
+
+import unittest
+
+from PySide import QtCore
+
+
+class QQtVersionTest(unittest.TestCase):
+ '''Tests for QtCore.QT_VERSION and QT_VERSION_STR'''
+
+ def testVersion(self):
+ self.assert_(hex(QtCore.QT_VERSION) > 0x40500)
+
+ def testVersionStr(self):
+ self.assert_(QtCore.QT_VERSION_STR)
+
+
+if __name__ == '__main__':
+ unittest.main()
From f098bb9f3ab5034d8fd04f5ea06e7128bee50d5a Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Mon, 2 Aug 2010 15:54:35 -0300
Subject: [PATCH 0110/1129] Included support to double values on qAbs.
Fixes bug #269.
Reviewer: Marcelo Lira
Luciano Wolf
---
PySide/QtCore/typesystem_core.xml | 4 ++--
tests/QtCore/qabs_test.py | 3 ++-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 9d38208..94a0a8c 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -517,9 +517,9 @@
-
+
- %PYARG_0 = %CONVERTTOPYTHON[long](qAbs(%1));
+ %PYARG_0 = %CONVERTTOPYTHON[double](qAbs(%1));
diff --git a/tests/QtCore/qabs_test.py b/tests/QtCore/qabs_test.py
index 1727ae6..37ff9c7 100644
--- a/tests/QtCore/qabs_test.py
+++ b/tests/QtCore/qabs_test.py
@@ -14,7 +14,8 @@ class QAbsTest(unittest.TestCase):
check(0)
check(-10)
check(10)
-
+ check(10.5)
+ check(-10.5)
if __name__ == '__main__':
unittest.main()
From 5ce8d05a089d0409b474be03eab1c7c4d5cfabb6 Mon Sep 17 00:00:00 2001
From: Lauro Neto
Date: Tue, 3 Aug 2010 09:07:34 -0300
Subject: [PATCH 0111/1129] Bump version to 0.4.0 and update shiboken version
Reviewer: Luciano Wolf
Reviewer: Renato Filho
---
CMakeLists.txt | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2e137bf..4f1ee85 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,7 +7,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules/
${CMAKE_MODULE_PATH})
find_package(PythonLibs REQUIRED)
find_package(PythonInterpWithDebug REQUIRED)
-find_package(Shiboken 0.3.3 REQUIRED)
+find_package(Shiboken 0.4.0 REQUIRED)
find_package(Qt4 4.5.0 REQUIRED)
set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" )
@@ -56,8 +56,8 @@ endif()
set(BINDING_NAME PySide)
set(BINDING_API_MAJOR_VERSION "0")
-set(BINDING_API_MINOR_VERSION "3")
-set(BINDING_API_MICRO_VERSION "3")
+set(BINDING_API_MINOR_VERSION "4")
+set(BINDING_API_MICRO_VERSION "0")
set(BINDING_API_VERSION "${BINDING_API_MAJOR_VERSION}.${BINDING_API_MINOR_VERSION}.${BINDING_API_MICRO_VERSION}")
if (NOT CMAKE_BUILD_TYPE)
From ee9e1f6155db49bbb46ecf6a4d264b5658a05e4a Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Tue, 3 Aug 2010 11:45:53 -0300
Subject: [PATCH 0112/1129] Added support to shortcut named arg on QAction
constructor.
Reviewer: Marcelo Lira
Luciano Wolf
---
PySide/QtGui/typesystem_gui_common.xml | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index 64849ae..e0341e0 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -4251,22 +4251,33 @@
-
+
+
+
+
+
+
+
+
+
+
%0 = new QActionWrapper(%1, %2);
+ %0->setShortcut(%3);
- if (%PYARG_3 != Py_None)
- Shiboken::AutoDecRef result(PyObject_CallMethod(%PYSELF, "connect", "OsO", %PYSELF, SIGNAL(triggered(bool)), %PYARG_3));
+ if (%PYARG_4 != Py_None)
+ Shiboken::AutoDecRef result(PyObject_CallMethod(%PYSELF, "connect", "OsO", %PYSELF, SIGNAL(triggered(bool)), %PYARG_4));
From f3a1585e6e2798aa105cb1f775afa75c21da0591 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Tue, 3 Aug 2010 19:47:23 -0300
Subject: [PATCH 0113/1129] Bump to version 0.4.1.
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4f1ee85..f12da82 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -57,7 +57,7 @@ endif()
set(BINDING_NAME PySide)
set(BINDING_API_MAJOR_VERSION "0")
set(BINDING_API_MINOR_VERSION "4")
-set(BINDING_API_MICRO_VERSION "0")
+set(BINDING_API_MICRO_VERSION "1")
set(BINDING_API_VERSION "${BINDING_API_MAJOR_VERSION}.${BINDING_API_MINOR_VERSION}.${BINDING_API_MICRO_VERSION}")
if (NOT CMAKE_BUILD_TYPE)
From 9e7369e4aec34ce42b92c5686d192e3bf93c3966 Mon Sep 17 00:00:00 2001
From: Marcelo Lira
Date: Wed, 4 Aug 2010 16:39:27 -0300
Subject: [PATCH 0114/1129] Fixes QAction code injection for constructor code.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Reviewed by Luciano Wolf
Reviewed by Renato Araújo
---
PySide/QtGui/typesystem_gui_common.xml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index e0341e0..1a98e7c 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -4251,6 +4251,7 @@
+
+
+
+
+
From 0cf8145d78125453723680135881d5424a9c6168 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Thu, 12 Aug 2010 09:59:48 -0300
Subject: [PATCH 0124/1129] Fix bug 295 - "QModelIndex::model() sets the
QModelIndex as parent of the model"
---
PySide/QtCore/typesystem_core.xml | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index b4f02ca..2a5be3d 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -657,7 +657,7 @@
-
+
@@ -2157,6 +2157,11 @@
Py_XINCREF(%PYARG_0);
+
+
+
+
+
From 26a48c4ed389cb619ee0109fb1a22a4699e8236a Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Thu, 12 Aug 2010 10:00:17 -0300
Subject: [PATCH 0125/1129] Fix ownership of value returned by
QItemDelegate::createEditor method.
Reviewer: Marcelo Lira
Luciano Wolf
---
PySide/QtGui/typesystem_gui_common.xml | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index 9afab40..0942331 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -2917,6 +2917,11 @@
+
+
+
+
+
From 5cbfffc005c90761af3ba97043ca728970a732b1 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Thu, 12 Aug 2010 11:59:48 -0300
Subject: [PATCH 0126/1129] Removed rename command from unecessary functions.
Fixes bug #287.
Reviewer: Marcelo Lira
Luciano Wolf
---
PySide/QtGui/typesystem_gui_common.xml | 38 ++------------------------
1 file changed, 2 insertions(+), 36 deletions(-)
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index 0942331..bc82377 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -572,7 +572,6 @@
-
@@ -2088,8 +2087,7 @@
-
-
+ emodify-function signature="isEmpty()const" remove="all"/>
@@ -2436,7 +2434,6 @@
-
addLayoutOwnership(%CPPSELF, %1);
@@ -3862,12 +3859,6 @@
-
-
-
-
-
-
@@ -4049,17 +4040,11 @@
-
-
-
-
-
-
@@ -4077,15 +4062,8 @@
-
-
-
-
-
+
-
-
-
@@ -4315,18 +4293,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
From 533cdcd07b61ffe7d578f0c54b923a1fdbff2ced Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Thu, 12 Aug 2010 14:56:25 -0300
Subject: [PATCH 0127/1129] Fix typo on typesystem.
---
PySide/QtGui/typesystem_gui_common.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index bc82377..326d830 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -2087,8 +2087,8 @@
- emodify-function signature="isEmpty()const" remove="all"/>
+
From 8ea5127ccbb0a5d84313041559769bc40fc2ad67 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Fri, 13 Aug 2010 11:22:02 -0300
Subject: [PATCH 0128/1129] Created unit test to QVariant converstion of
QStringList.
Reviewer: Marcelo Lira
Luciano Wolf
---
tests/QtCore/CMakeLists.txt | 1 +
tests/QtCore/bug_278_test.py | 24 ++++++++++++++++++++++++
2 files changed, 25 insertions(+)
create mode 100644 tests/QtCore/bug_278_test.py
diff --git a/tests/QtCore/CMakeLists.txt b/tests/QtCore/CMakeLists.txt
index 490f734..3b155df 100644
--- a/tests/QtCore/CMakeLists.txt
+++ b/tests/QtCore/CMakeLists.txt
@@ -1,3 +1,4 @@
+PYSIDE_TEST(bug_278_test.py)
PYSIDE_TEST(blocking_signals_test.py)
PYSIDE_TEST(child_event_test.py)
PYSIDE_TEST(deletelater_test.py)
diff --git a/tests/QtCore/bug_278_test.py b/tests/QtCore/bug_278_test.py
new file mode 100644
index 0000000..28d7b37
--- /dev/null
+++ b/tests/QtCore/bug_278_test.py
@@ -0,0 +1,24 @@
+#!/usr/bin/python
+
+import unittest
+
+from PySide import QtCore
+
+def setValue(o):
+ values = ['Name']
+ o.setProperty('test1', values)
+
+class QQtVersionTest(unittest.TestCase):
+ '''Tests for QVariant conversion of QStringList'''
+
+ def testGet(self):
+ o = QtCore.QObject()
+ setValue(o)
+ self.assertEqual(o.property('test1'), ['Name'])
+
+
+
+if __name__ == '__main__':
+ unittest.main()
+
+
From 2b21d79f5439d982de2495d3a190c4f82f51e458 Mon Sep 17 00:00:00 2001
From: Marcelo Lira
Date: Fri, 13 Aug 2010 14:15:52 -0300
Subject: [PATCH 0129/1129] All tests using GUI aren't shown if the host
machine has xvfb installed.
Unwanted graphical output from tests are redirected to a fake X server
on Unix system. This depends on the presence of the Xvfb server.
Reviewed by Hugo Parente
Reviewed by Luciano Wolf
---
CMakeLists.txt | 7 +++++++
tests/CMakeLists.txt | 2 +-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b75d1f9..dd6b863 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,6 +10,13 @@ find_package(PythonInterpWithDebug REQUIRED)
find_package(Shiboken 0.4.0 REQUIRED)
find_package(Qt4 4.5.0 REQUIRED)
+find_program(XVFB_RUN NAMES xvfb-run)
+set(XVFB_EXEC "")
+if (NOT ${XVFB_RUN} MATCHES "XVFB_RUN-NOTFOUND")
+ set(XVFB_EXEC ${XVFB_RUN})
+ message("Using xvfb-run to perform QtGui tests.")
+endif()
+
set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" )
set(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" CACHE PATH "The subdirectory relative to the install prefix where libraries will be installed (default is /lib${LIB_SUFFIX})" FORCE)
if(CMAKE_HOST_APPLE)
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 904d106..a3f5278 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -18,7 +18,7 @@ macro(PYSIDE_TEST)
else()
message(WARNING "Ivalid call of macro PYSIDE_TEST")
endif()
- set(TEST_CMD ${CMAKE_SOURCE_DIR}/tests/run_test.sh ${libpyside_BINARY_DIR} "${CMAKE_BINARY_DIR}:${CMAKE_SOURCE_DIR}/tests/util" ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/${ARGV0}")
+ set(TEST_CMD ${XVFB_EXEC} ${CMAKE_SOURCE_DIR}/tests/run_test.sh ${libpyside_BINARY_DIR} "${CMAKE_BINARY_DIR}:${CMAKE_SOURCE_DIR}/tests/util" ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/${ARGV0}")
add_test(${TEST_NAME} ${TEST_CMD})
set_tests_properties(${TEST_NAME} PROPERTIES
TIMEOUT ${CTEST_TESTING_TIMEOUT}
From 9a19bd26d2282743aae939c0497a9bc2d92ee8d9 Mon Sep 17 00:00:00 2001
From: Marcelo Lira
Date: Thu, 12 Aug 2010 14:44:36 -0300
Subject: [PATCH 0130/1129] Added tests for QObject properties being set with
named arguments on the constructor.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Reviewed by Luciano Wolf
Reviewed by Renato Araújo
---
tests/QtCore/qobject_property_test.py | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/tests/QtCore/qobject_property_test.py b/tests/QtCore/qobject_property_test.py
index e94562c..233d1e8 100644
--- a/tests/QtCore/qobject_property_test.py
+++ b/tests/QtCore/qobject_property_test.py
@@ -13,6 +13,10 @@ class MySize(QSize):
'''Extended class'''
pass
+class ExtQObject(QObject):
+ registeredproperty = QProperty(int)
+
+
class PropertyCase(unittest.TestCase):
'''Test case for QObject properties'''
@@ -91,5 +95,27 @@ class PropertyCase(unittest.TestCase):
self.assertTrue(obj.property('foo') is mysize)
+
+class PropertyWithConstructorCase(unittest.TestCase):
+ '''Test case for QObject properties set using named arguments in the constructor.'''
+
+ def testObjectNameProperty(self):
+ #QObject(property=value) for existing C++ property
+ obj = QObject(objectName='dummy')
+ self.assertEqual(obj.objectName(), 'dummy')
+
+ def testDynamicPropertyRaisesException(self):
+ self.assertRaises(AttributeError, QObject, dummy=42)
+
+ def testPythonDeclaredProperty(self):
+ obj = ExtQObject(registeredproperty=123)
+
+ def testConstructorPropertyInQObjectDerived(self):
+ #QTimer(property=value) for existing C++ property
+ obj = QTimer(objectName='dummy')
+ self.assertEqual(obj.objectName(), 'dummy')
+
+
if __name__ == '__main__':
unittest.main()
+
From c130273ee0fd41be0ed756a90ab8a24934ddb7e9 Mon Sep 17 00:00:00 2001
From: renato
Date: Fri, 13 Aug 2010 15:28:59 -0300
Subject: [PATCH 0131/1129] Fixed arguments parser on QProperty constructor.
Reviewer: Marcelo Lira
Luciano Wolf
---
libpyside/qproperty.cpp | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/libpyside/qproperty.cpp b/libpyside/qproperty.cpp
index 781c8cf..f20c387 100644
--- a/libpyside/qproperty.cpp
+++ b/libpyside/qproperty.cpp
@@ -139,15 +139,15 @@ int qproperty_init(PyObject* self, PyObject* args, PyObject* kwds)
data->scriptable = true;
data->stored = true;
- static const char *kwlist[] = {"fget", "fset", "freset", "fdel", "doc",
+ static const char *kwlist[] = {"type", "fget", "fset", "freset", "fdel", "doc",
"designable", "scriptable", "stored", "user",
"constant", "final", 0};
if (!PyArg_ParseTupleAndKeywords(args, kwds,
"O|OOOOsbbbbbb:QtCore.QProperty", (char**) kwlist,
- &type, &data->fget, &data->fset, &data->freset,
- &data->fdel, &data->doc, &data->designable,
- &data->scriptable, &data->stored, &data->user,
- &data->constant, &data->final))
+ /*O*/&type,
+ /*OOOO*/ &(data->fget), &(data->fset), &(data->freset), &(data->fdel),
+ /*s*/&(data->doc),
+ /*bbbbbb*/&(data->designable), &(data->scriptable), &(data->stored), &(data->user), &(data->constant), &(data->final)))
return 0;
if (!data->fset && data->fget)
From 1162a844bd689958205d10eeff549451ee8cb93b Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Fri, 13 Aug 2010 17:25:57 -0300
Subject: [PATCH 0132/1129] Fixed Http test to work with Qt 4.7.
Reviewer: Marcelo Lira
Luciano Wolf
---
tests/QtNetwork/http_test.py | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/tests/QtNetwork/http_test.py b/tests/QtNetwork/http_test.py
index 531316d..ee6eeea 100644
--- a/tests/QtNetwork/http_test.py
+++ b/tests/QtNetwork/http_test.py
@@ -6,18 +6,17 @@ import unittest
from PySide.QtCore import *
from PySide.QtNetwork import *
-from helper import UsesQApplication
+from helper import UsesQCoreApplication
from httpd import TestServer
-class HttpSignalsCase(UsesQApplication):
+class HttpSignalsCase(UsesQCoreApplication):
'''Test case for launching QHttp signals'''
def setUp(self):
super(HttpSignalsCase, self).setUp()
- self.http = QHttp()
self.httpd = TestServer()
self.httpd.start()
- self.url = QUrl('localhost:' + str(self.httpd.port()))
+ self.http = QHttp('localhost' , self.httpd.port())
self.called = False
def tearDown(self):
@@ -34,8 +33,7 @@ class HttpSignalsCase(UsesQApplication):
#QHttp signal requestStarted signal
# @bug 114
self.http.requestStarted.connect(self.callback)
- self.http.get(self.url.path())
-
+ self.http.get("index.html")
self.app.exec_()
self.assert_(self.called)
From 6bd528978cad1fe2c0e56cb35b270346da3fbbdd Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Fri, 13 Aug 2010 18:22:22 -0300
Subject: [PATCH 0133/1129] Raise a error when try to modify a read-only
property.
Add get function as mandatory in QProperty constructor.
Reviewer: Marcelo Lira
Luciano Wolf
---
libpyside/qproperty.cpp | 12 +++++++-----
libpyside/signalmanager.cpp | 1 -
tests/QtCore/qobject_property_test.py | 15 +++++++++++++++
3 files changed, 22 insertions(+), 6 deletions(-)
diff --git a/libpyside/qproperty.cpp b/libpyside/qproperty.cpp
index f20c387..b2d011e 100644
--- a/libpyside/qproperty.cpp
+++ b/libpyside/qproperty.cpp
@@ -143,11 +143,11 @@ int qproperty_init(PyObject* self, PyObject* args, PyObject* kwds)
"designable", "scriptable", "stored", "user",
"constant", "final", 0};
if (!PyArg_ParseTupleAndKeywords(args, kwds,
- "O|OOOOsbbbbbb:QtCore.QProperty", (char**) kwlist,
- /*O*/&type,
- /*OOOO*/ &(data->fget), &(data->fset), &(data->freset), &(data->fdel),
- /*s*/&(data->doc),
- /*bbbbbb*/&(data->designable), &(data->scriptable), &(data->stored), &(data->user), &(data->constant), &(data->final)))
+ "OO|OOOsbbbbbb:QtCore.QProperty", (char**) kwlist,
+ /*OO*/ &type, &(data->fget),
+ /*OOOO*/ &(data->fset), &(data->freset), &(data->fdel),
+ /*s*/ &(data->doc),
+ /*bbbbbb*/ &(data->designable), &(data->scriptable), &(data->stored), &(data->user), &(data->constant), &(data->final)))
return 0;
if (!data->fset && data->fget)
@@ -187,6 +187,8 @@ int qproperty_set(PyObject* self, PyObject* source, PyObject* value)
Py_INCREF(value);
Shiboken::AutoDecRef result(PyObject_CallObject(data->fset, args));
return (result.isNull() ? -1 : 0);
+ } else {
+ PyErr_SetString(PyExc_AttributeError, "Attibute read only");
}
return -1;
}
diff --git a/libpyside/signalmanager.cpp b/libpyside/signalmanager.cpp
index 7482f01..ed15732 100644
--- a/libpyside/signalmanager.cpp
+++ b/libpyside/signalmanager.cpp
@@ -373,7 +373,6 @@ int SignalManager::qt_metacall(QObject* object, QMetaObject::Call call, int id,
Py_XDECREF(pp_name);
return id - metaObject->methodCount();
}
- printf("access to property: %s-%s\n", mp.name(), mp.typeName());
typeResolver = Shiboken::TypeResolver::get(mp.typeName());
}
diff --git a/tests/QtCore/qobject_property_test.py b/tests/QtCore/qobject_property_test.py
index 233d1e8..7d53e0a 100644
--- a/tests/QtCore/qobject_property_test.py
+++ b/tests/QtCore/qobject_property_test.py
@@ -16,6 +16,16 @@ class MySize(QSize):
class ExtQObject(QObject):
registeredproperty = QProperty(int)
+class MyObject(QObject):
+ '''Test Property'''
+
+ def readPP(self):
+ return 42
+
+ def trySetPP(self):
+ self.pp = 0
+
+ pp = QProperty(int, readPP)
class PropertyCase(unittest.TestCase):
'''Test case for QObject properties'''
@@ -115,6 +125,11 @@ class PropertyWithConstructorCase(unittest.TestCase):
obj = QTimer(objectName='dummy')
self.assertEqual(obj.objectName(), 'dummy')
+ def testPythonProperty(self):
+ o = MyObject()
+ self.assertEqual(o.pp, 42)
+ o.pp = 0
+ self.assertRaises(AttributeError, o.trySetPP)
if __name__ == '__main__':
unittest.main()
From 2d24d300d8ef7e65489051f2f6d3d7d213d4a86a Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Mon, 16 Aug 2010 12:07:12 -0300
Subject: [PATCH 0134/1129] Avoid read the property in the QObject constructor.
Create unit test to verify if the python property is setted during the
constructor.
Reviewer: Hugo Parente
Luciano Wolf
---
libpyside/qproperty.cpp | 12 +++++++-----
tests/QtCore/qobject_property_test.py | 20 ++++++++++++++------
2 files changed, 21 insertions(+), 11 deletions(-)
diff --git a/libpyside/qproperty.cpp b/libpyside/qproperty.cpp
index b2d011e..c4b728a 100644
--- a/libpyside/qproperty.cpp
+++ b/libpyside/qproperty.cpp
@@ -231,12 +231,14 @@ const char* qproperty_get_type(PyObject* self)
PyObject* qproperty_get_object(PyObject* source, PyObject* name)
{
- if (PyObject_HasAttr(source, name)) {
- PyObject* attr = PyObject_GenericGetAttr(source, name);
- if (isQPropertyType(attr))
- return attr;
+ PyObject* attr = PyObject_GenericGetAttr(source, name);
+ if (attr && isQPropertyType(attr))
+ return attr;
+
+ if (!attr)
+ PyErr_Clear(); //Clear possible error caused by PyObject_GenericGetAttr
+ else
Py_DECREF(attr);
- }
return 0;
}
diff --git a/tests/QtCore/qobject_property_test.py b/tests/QtCore/qobject_property_test.py
index 7d53e0a..1d8a16c 100644
--- a/tests/QtCore/qobject_property_test.py
+++ b/tests/QtCore/qobject_property_test.py
@@ -13,8 +13,17 @@ class MySize(QSize):
'''Extended class'''
pass
-class ExtQObject(QObject):
- registeredproperty = QProperty(int)
+class ExQObject(QObject):
+ def __init__(self, *args, **kargs):
+ QObject.__init__(self, *args, **kargs)
+
+ def setProperty(self, value):
+ self._value = value
+
+ def getProperty(self):
+ return self._value
+
+ registeredproperty = QProperty(int, getProperty, setProperty)
class MyObject(QObject):
'''Test Property'''
@@ -105,7 +114,6 @@ class PropertyCase(unittest.TestCase):
self.assertTrue(obj.property('foo') is mysize)
-
class PropertyWithConstructorCase(unittest.TestCase):
'''Test case for QObject properties set using named arguments in the constructor.'''
@@ -118,17 +126,17 @@ class PropertyWithConstructorCase(unittest.TestCase):
self.assertRaises(AttributeError, QObject, dummy=42)
def testPythonDeclaredProperty(self):
- obj = ExtQObject(registeredproperty=123)
+ obj = ExQObject(registeredproperty=123)
+ self.assertEqual(obj.registeredproperty, 123)
def testConstructorPropertyInQObjectDerived(self):
#QTimer(property=value) for existing C++ property
obj = QTimer(objectName='dummy')
self.assertEqual(obj.objectName(), 'dummy')
- def testPythonProperty(self):
+ def testReadOnlyPythonProperty(self):
o = MyObject()
self.assertEqual(o.pp, 42)
- o.pp = 0
self.assertRaises(AttributeError, o.trySetPP)
if __name__ == '__main__':
From aedea32f131a553a9db0670cd89c43d171244951 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Mon, 16 Aug 2010 18:21:25 -0300
Subject: [PATCH 0135/1129] Implemented help function to connect signal with
python callback.
Updated QAction unittest to work with signal connection on constructor.
Reviewer: Hugo Parente
Luciano Wolf
---
libpyside/qsignal.cpp | 18 +++++++++++++++++-
libpyside/qsignal.h | 1 +
tests/QtGui/qaction_test.py | 2 +-
3 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/libpyside/qsignal.cpp b/libpyside/qsignal.cpp
index ec0610b..c6a8240 100644
--- a/libpyside/qsignal.cpp
+++ b/libpyside/qsignal.cpp
@@ -448,12 +448,28 @@ PyObject* signal_instance_connect(PyObject* self, PyObject* args, PyObject* kwds
if (match) {
Shiboken::AutoDecRef tupleArgs(PyList_AsTuple(pyArgs));
Shiboken::AutoDecRef pyMethod(PyObject_GetAttrString(source->source, "connect"));
- return PyObject_CallObject(pyMethod, tupleArgs);
+ return PyObject_CallObject(pyMethod, tupleArgs);
}
return 0;
}
+bool signal_connect(PyObject* source, const char* signal, PyObject* callback)
+{
+ Shiboken::AutoDecRef pyMethod(PyObject_GetAttrString(source, "connect"));
+ if (pyMethod.isNull())
+ return false;
+
+ Shiboken::AutoDecRef pyArgs(PyList_New(0));
+ Shiboken::AutoDecRef pySignature(PyString_FromString(signal));
+ PyList_Append(pyArgs, source);
+ PyList_Append(pyArgs, pySignature);
+ PyList_Append(pyArgs, callback);
+ Shiboken::AutoDecRef tupleArgs(PyList_AsTuple(pyArgs));
+
+ return PyObject_CallObject(pyMethod, tupleArgs);
+}
+
PyObject* signal_instance_disconnect(PyObject* self, PyObject* args)
{
SignalInstanceData *source = reinterpret_cast(self);
diff --git a/libpyside/qsignal.h b/libpyside/qsignal.h
index 63eded1..b208343 100644
--- a/libpyside/qsignal.h
+++ b/libpyside/qsignal.h
@@ -59,6 +59,7 @@ extern "C"
PYSIDE_API PyAPI_FUNC(PyObject*) signalNew(const char* name, ...);
PYSIDE_API void signalUpdateSource(PyObject* source);
+PYSIDE_API bool signal_connect(PyObject* source, const char* signal, PyObject* callback);
} //namespace PySide
diff --git a/tests/QtGui/qaction_test.py b/tests/QtGui/qaction_test.py
index ff7efbe..b6a45d1 100644
--- a/tests/QtGui/qaction_test.py
+++ b/tests/QtGui/qaction_test.py
@@ -5,7 +5,7 @@ from helper import UsesQApplication
class QPainterDrawText(UsesQApplication):
- def _cb(self, checked):
+ def _cb(self):
self._called = True
def testSignal(self):
From d686c687074708af1654131f603b767d52f611e6 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Mon, 16 Aug 2010 18:22:56 -0300
Subject: [PATCH 0136/1129] Fixed gui typesystem to avoid warnings.
Reviewer: Hugo Parente
Luciano Wolf
---
PySide/QtGui/typesystem_gui_common.xml | 41 +++-----------------------
libpyside/qsignal.cpp | 9 ++----
2 files changed, 6 insertions(+), 44 deletions(-)
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index 326d830..1110964 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -547,18 +547,13 @@
-
-
-
-
-
-
-
+
+
@@ -4241,36 +4236,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- %0 = new %TYPE(%1, %2);
- %0->setShortcut(%3);
-
-
-
- if (%PYARG_4 && %PYARG_4 != Py_None)
- Shiboken::AutoDecRef result(PyObject_CallMethod(%PYSELF, "connect", "OsO", %PYSELF, SIGNAL(triggered(bool)), %PYARG_4));
-
-
@@ -4857,4 +4822,6 @@
+
+
diff --git a/libpyside/qsignal.cpp b/libpyside/qsignal.cpp
index c6a8240..f465a7b 100644
--- a/libpyside/qsignal.cpp
+++ b/libpyside/qsignal.cpp
@@ -460,14 +460,9 @@ bool signal_connect(PyObject* source, const char* signal, PyObject* callback)
if (pyMethod.isNull())
return false;
- Shiboken::AutoDecRef pyArgs(PyList_New(0));
Shiboken::AutoDecRef pySignature(PyString_FromString(signal));
- PyList_Append(pyArgs, source);
- PyList_Append(pyArgs, pySignature);
- PyList_Append(pyArgs, callback);
- Shiboken::AutoDecRef tupleArgs(PyList_AsTuple(pyArgs));
-
- return PyObject_CallObject(pyMethod, tupleArgs);
+ Shiboken::AutoDecRef pyArgs(PyTuple_Pack(3, source, pySignature.object(), callback));
+ return PyObject_CallObject(pyMethod, pyArgs);
}
PyObject* signal_instance_disconnect(PyObject* self, PyObject* args)
From 9a969935ccc866804574480ac41ec004646f104c Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Tue, 17 Aug 2010 10:44:48 -0300
Subject: [PATCH 0137/1129] Fix bug 294 addind a converter specific for QFlags.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Reviewer: Luciano Wolf
Renato Araújo
---
libpyside/pysideconversions.h | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/libpyside/pysideconversions.h b/libpyside/pysideconversions.h
index 32d5f34..c7fdcb5 100644
--- a/libpyside/pysideconversions.h
+++ b/libpyside/pysideconversions.h
@@ -37,6 +37,7 @@
#include
#include
+#include
template
struct QtDictConverter
@@ -222,4 +223,34 @@ struct QSequenceConverter
}
};
+template
+struct QFlagsConverter
+{
+ static inline bool checkType(PyObject* pyObj)
+ {
+ return PyObject_TypeCheck(pyObj, Shiboken::SbkType());
+ }
+
+ static inline bool isConvertible(PyObject* pyObj)
+ {
+ return PyObject_TypeCheck(pyObj, Shiboken::SbkType())
+ || PyObject_TypeCheck(pyObj, Shiboken::SbkType());
+ }
+
+ static inline PyObject* toPython(void* cppobj)
+ {
+ return toPython(*reinterpret_cast(cppobj));
+ }
+
+ static inline PyObject* toPython(T cppenum)
+ {
+ return Shiboken::SbkEnumObject_New(Shiboken::SbkType(), (long) cppenum);
+ }
+
+ static inline T toCpp(PyObject* pyobj)
+ {
+ return T(QFlag(reinterpret_cast(pyobj)->ob_ival));
+ }
+};
+
#endif
From 23672770ea6fd79c38fed0695fc92ca193f0ece4 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Tue, 17 Aug 2010 15:49:55 -0300
Subject: [PATCH 0138/1129] Disable remove of QAbstractItemModel signals.
Fixes bug #300.
Reviewer: Luciano Wolf
Hugo Parente Lima
---
PySide/QtCore/typesystem_core.xml | 13 -------------
tests/QtCore/CMakeLists.txt | 1 +
tests/QtCore/bug_300_test.py | 17 +++++++++++++++++
3 files changed, 18 insertions(+), 13 deletions(-)
create mode 100644 tests/QtCore/bug_300_test.py
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 2a5be3d..571cc91 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -985,19 +985,6 @@
%PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%CPPSELF.%FUNCTION_NAME(%1, %2, %PYARG_3));
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tests/QtCore/CMakeLists.txt b/tests/QtCore/CMakeLists.txt
index 3b155df..cf7727f 100644
--- a/tests/QtCore/CMakeLists.txt
+++ b/tests/QtCore/CMakeLists.txt
@@ -1,4 +1,5 @@
PYSIDE_TEST(bug_278_test.py)
+PYSIDE_TEST(bug_300_test.py)
PYSIDE_TEST(blocking_signals_test.py)
PYSIDE_TEST(child_event_test.py)
PYSIDE_TEST(deletelater_test.py)
diff --git a/tests/QtCore/bug_300_test.py b/tests/QtCore/bug_300_test.py
new file mode 100644
index 0000000..ec02cdf
--- /dev/null
+++ b/tests/QtCore/bug_300_test.py
@@ -0,0 +1,17 @@
+from PySide.QtGui import QStringListModel
+from PySide.QtCore import QModelIndex
+import unittest
+
+class TestQAbstractItemModelSignals(unittest.TestCase):
+ def sigCallback(self, index, r, c):
+ self._called = True
+
+ def testSignals(self):
+ self._called = False
+ m = QStringListModel()
+ m.rowsAboutToBeInserted[QModelIndex,int,int].connect(self.sigCallback)
+ m.insertRows(0, 3)
+ self.assert_(self._called)
+
+if __name__ == '__main__':
+ unittest.main()
From 465649d73e552cfb1e74e343eea3341b2842ccd6 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Thu, 19 Aug 2010 17:48:08 -0300
Subject: [PATCH 0139/1129] created macro to compile pyside modules.
Reviewer: Luciano Wolf
Hugo Parente Lima
---
CMakeLists.txt | 10 +++--
PySide/CMakeLists.txt | 44 +++++++++++++-----
PySide/QtCore/CMakeLists.txt | 39 +++++++---------
PySide/QtDeclarative/CMakeLists.txt | 69 ++++++++++++++---------------
PySide/QtGui/CMakeLists.txt | 44 +++++++++---------
PySide/QtHelp/CMakeLists.txt | 47 +++++++++-----------
PySide/QtMaemo5/CMakeLists.txt | 48 +++++++++-----------
PySide/QtMultimedia/CMakeLists.txt | 56 +++++++++++------------
PySide/QtNetwork/CMakeLists.txt | 49 +++++++++-----------
PySide/QtOpenGL/CMakeLists.txt | 54 ++++++++++------------
PySide/QtScript/CMakeLists.txt | 52 +++++++++-------------
PySide/QtSql/CMakeLists.txt | 56 ++++++++++-------------
PySide/QtSvg/CMakeLists.txt | 59 +++++++++++-------------
PySide/QtTest/CMakeLists.txt | 61 +++++++++++--------------
PySide/QtUiTools/CMakeLists.txt | 60 +++++++++++--------------
PySide/QtWebKit/CMakeLists.txt | 65 ++++++++++++---------------
PySide/QtXml/CMakeLists.txt | 54 ++++++++++------------
PySide/QtXmlPatterns/CMakeLists.txt | 47 +++++++++-----------
PySide/phonon/CMakeLists.txt | 46 +++++++++----------
libpyside/CMakeLists.txt | 3 +-
libpyside/pysidemacros.h | 8 +++-
21 files changed, 442 insertions(+), 529 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index dd6b863..06b729e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -23,10 +23,14 @@ if(CMAKE_HOST_APPLE)
set(ALTERNATIVE_QT_INCLUDE_DIR "" CACHE PATH "The Alternative value to QT_INCLUDE_DIR. Necessary to fix bug on cmake 2.8 MACOS users")
endif()
-if(CMAKE_HOST_UNIX)
- option(ENABLE_GCC_OPTIMIZATION "Enable specific GCC flags to optimization library size and performance. Only available on Release Mode" 0)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fvisibility=hidden -Wno-strict-aliasing")
+if(MSVC)
+ set(CMAKE_CXX_FLAGS "/Zc:wchar_t- /GR /EHsc /DNOCOLOR /DWIN32 /D_WINDOWS /D_SCL_SECURE_NO_WARNINGS")
+else()
+ if(CMAKE_HOST_UNIX)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fvisibility=hidden -Wno-strict-aliasing")
+ endif()
set(CMAKE_CXX_FLAGS_DEBUG "-g")
+ option(ENABLE_GCC_OPTIMIZATION "Enable specific GCC flags to optimization library size and performance. Only available on Release Mode" 0)
if(ENABLE_GCC_OPTIMIZATION)
set(CMAKE_BUILD_TYPE Release)
set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -Os -Wl,-O1")
diff --git a/PySide/CMakeLists.txt b/PySide/CMakeLists.txt
index b1b3286..22ccde8 100644
--- a/PySide/CMakeLists.txt
+++ b/PySide/CMakeLists.txt
@@ -3,20 +3,40 @@ install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/__init__.py"
DESTINATION "${SITE_PACKAGE}/${BINDING_NAME}")
macro(execute_generator module sources typesystem_path)
-add_custom_command(OUTPUT ${${sources}}
-COMMAND ${GENERATOR} ${GENERATOR_EXTRA_FLAGS}
- ${CMAKE_BINARY_DIR}/PySide/global.h
- --include-paths=${pyside_SOURCE_DIR}:${QT_INCLUDE_DIR}
- --typesystem-paths=${pyside_SOURCE_DIR}:${typesystem_path}
- --output-directory=${CMAKE_CURRENT_BINARY_DIR}
- --license-file=${CMAKE_CURRENT_SOURCE_DIR}/../licensecomment.txt
- ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_${module}.xml
- --api-version=${SUPPORTED_QT_VERSION}
-WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-COMMENT "Running generator for ${module}..."
-)
+ message("Running generator for ${module}...")
endmacro(execute_generator)
+macro(create_pyside_module module_name typesystem_file module_include_dir module_libraries module_deps module_typesystem_path module_sources)
+ add_custom_command(OUTPUT ${${module_sources}}
+ COMMAND ${GENERATOR} ${GENERATOR_EXTRA_FLAGS}
+ ${CMAKE_BINARY_DIR}/PySide/global.h
+ --include-paths=${pyside_SOURCE_DIR}:${QT_INCLUDE_DIR}
+ --typesystem-paths=${pyside_SOURCE_DIR}:${${module_typesystem_path}}
+ --output-directory=${CMAKE_CURRENT_BINARY_DIR}
+ --license-file=${CMAKE_CURRENT_SOURCE_DIR}/../licensecomment.txt
+ ${typesystem_file}
+ --api-version=${SUPPORTED_QT_VERSION}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ COMMENT "Running generator for ${module_name}...")
+
+ include_directories(${module_name} ${${module_include_dir}})
+ add_library(${module_name} MODULE ${${module_sources}})
+ set_target_properties(${module_name} PROPERTIES PREFIX "")
+ target_link_libraries(${module_name} ${${module_libraries}})
+ if(${module_deps})
+ add_dependencies(${module_name} ${${module_deps}})
+ endif()
+
+ # install
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${module_name}${CMAKE_DEBUG_POSTFIX}.so
+ DESTINATION ${SITE_PACKAGE}/PySide)
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/${module_name}/pyside_${module_name}_python.h
+ DESTINATION include/PySide/${module_name}/)
+ install(FILES ${typesystem_file}
+ DESTINATION share/PySide/typesystems)
+endmacro(create_pyside_module)
+
+
# Configure include based on platform
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/global.h.in"
"${CMAKE_CURRENT_BINARY_DIR}/global.h" @ONLY)
diff --git a/PySide/QtCore/CMakeLists.txt b/PySide/QtCore/CMakeLists.txt
index 6300a4c..b6c7534 100644
--- a/PySide/QtCore/CMakeLists.txt
+++ b/PySide/QtCore/CMakeLists.txt
@@ -134,29 +134,22 @@ ${QtCore_46_SRC}
${QtCore_47_SRC}
)
-execute_generator(core QtCore_SRC "${CMAKE_CURRENT_BINARY_DIR}")
-
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_BINARY_DIR}/${BINDING_NAME}/QtCore/
- ${QT_INCLUDE_DIR}
- ${SHIBOKEN_INCLUDE_DIR}
- ${libpyside_SOURCE_DIR}
- ${PYTHON_INCLUDE_PATH}
- )
-add_library(QtCore MODULE ${QtCore_SRC})
-set_property(TARGET QtCore PROPERTY PREFIX "")
-target_link_libraries(QtCore
- pyside
+set(QtCore_typesystem_path ${CMAKE_CURRENT_BINARY_DIR})
+set(QtCore_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}/${BINDING_NAME}/QtCore/
+ ${QT_INCLUDE_DIR}
+ ${SHIBOKEN_INCLUDE_DIR}
+ ${libpyside_SOURCE_DIR}
+ ${PYTHON_INCLUDE_PATH})
+set(QtCore_libraries pyside
${PYSIDE_PYTHON_LIBRARIES}
${SHIBOKEN_LIBRARY}
- ${QT_QTCORE_LIBRARY}
- )
-
-# install
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/QtCore${CMAKE_DEBUG_POSTFIX}.so
- DESTINATION ${SITE_PACKAGE}/${BINDING_NAME})
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/pyside_qtcore_python.h
- DESTINATION include/PySide/QtCore/)
-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_core.xml
- DESTINATION share/PySide/typesystems)
+ ${QT_QTCORE_LIBRARY})
+create_pyside_module(QtCore
+ ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_core.xml
+ QtCore_include_dirs
+ QtCore_libraries
+ ""
+ QtCore_typesystem_path
+ QtCore_SRC)
diff --git a/PySide/QtDeclarative/CMakeLists.txt b/PySide/QtDeclarative/CMakeLists.txt
index 79b4b42..fc38103 100644
--- a/PySide/QtDeclarative/CMakeLists.txt
+++ b/PySide/QtDeclarative/CMakeLists.txt
@@ -20,43 +20,40 @@ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtDeclarative/qdeclarativeview_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtDeclarative/qtdeclarative_module_wrapper.cpp
)
-execute_generator(declarative QtDeclarative_SRC "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:${QtGui_BINARY_DIR}:${QtGui_SOURCE_DIR}:${QtDeclarative_SOURCE_DIR}:${QtNetwork_SOURCE_DIR}:${QtNetwork_BINARY_DIR}")
+set(QtDeclarative_typesystem_path "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:${QtGui_BINARY_DIR}:${QtGui_SOURCE_DIR}:${QtDeclarative_SOURCE_DIR}:${QtNetwork_SOURCE_DIR}:${QtNetwork_BINARY_DIR}")
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}
- ${QT_QTCORE_INCLUDE_DIR}
- ${QT_QTGUI_INCLUDE_DIR}
- ${QT_QTNETWORK_INCLUDE_DIR}
- ${QT_QTDECLARATIVE_INCLUDE_DIR}
- ${PYTHON_INCLUDE_PATH}
- ${SHIBOKEN_INCLUDE_DIR}
- ${libpyside_SOURCE_DIR}
- ${QtGui_BINARY_DIR}/PySide/QtGui/
- ${QtCore_BINARY_DIR}/PySide/QtCore/
- ${QtNetwork_BINARY_DIR}/PySide/QtNetwork/
- ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtDeclarative)
-add_library(QtDeclarative MODULE ${QtDeclarative_SRC})
-set_target_properties(QtDeclarative PROPERTIES PREFIX "")
-target_link_libraries(QtDeclarative
- pyside
- ${PYSIDE_PYTHON_LIBRARIES}
- ${QT_QTCORE_LIBRARY}
- ${QT_QTGUI_LIBRARY}
- ${QT_QTNETWORK_LIBRARY}
- ${QT_QTSCRIPT_LIBRARY}
- ${QT_QTSVG_LIBRARY}
- ${QT_QTSQL_LIBRARY}
- ${QT_QTXMLPATTERNS_LIBRARY}
- ${QT_QTOPENGL_LIBRARY}
- ${QT_QTDECLARATIVE_LIBRARY})
-add_dependencies(QtDeclarative QtGui)
-add_dependencies(QtDeclarative QtNetwork)
+set(QtDeclarative_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
+ ${QT_QTCORE_INCLUDE_DIR}
+ ${QT_QTGUI_INCLUDE_DIR}
+ ${QT_QTNETWORK_INCLUDE_DIR}
+ ${QT_QTDECLARATIVE_INCLUDE_DIR}
+ ${PYTHON_INCLUDE_PATH}
+ ${SHIBOKEN_INCLUDE_DIR}
+ ${libpyside_SOURCE_DIR}
+ ${QtGui_BINARY_DIR}/PySide/QtGui/
+ ${QtCore_BINARY_DIR}/PySide/QtCore/
+ ${QtNetwork_BINARY_DIR}/PySide/QtNetwork/
+ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtDeclarative)
-# install
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/QtDeclarative${CMAKE_DEBUG_POSTFIX}.so
- DESTINATION ${SITE_PACKAGE}/PySide)
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtDeclarative/pyside_qtdeclarative_python.h
- DESTINATION include/PySide/QtDeclarative/)
-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_declarative.xml
- DESTINATION share/PySide/typesystems)
+set(QtDeclarative_libraries pyside
+ ${PYSIDE_PYTHON_LIBRARIES}
+ ${QT_QTCORE_LIBRARY}
+ ${QT_QTGUI_LIBRARY}
+ ${QT_QTNETWORK_LIBRARY}
+ ${QT_QTSCRIPT_LIBRARY}
+ ${QT_QTSVG_LIBRARY}
+ ${QT_QTSQL_LIBRARY}
+ ${QT_QTXMLPATTERNS_LIBRARY}
+ ${QT_QTOPENGL_LIBRARY}
+ ${QT_QTDECLARATIVE_LIBRARY})
+set(QtDeclarative_deps QtGui QtNetwork)
+
+create_pyside_module(QtDeclarative
+ ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_declarative.xml
+ QtDeclarative_include_dirs
+ QtDeclarative_libraries
+ QtDeclarative_deps
+ QtDeclarative_typesystem_path
+ QtDeclarative_SRC)
diff --git a/PySide/QtGui/CMakeLists.txt b/PySide/QtGui/CMakeLists.txt
index fdc36b3..18ce256 100644
--- a/PySide/QtGui/CMakeLists.txt
+++ b/PySide/QtGui/CMakeLists.txt
@@ -470,34 +470,32 @@ CHECK_QT_GUI_MACRO("SessionManager Support" QT_NO_SESSIONMANAGER QT_SESSIONMANAG
configure_file(typesystem_gui.xml.in
"${CMAKE_CURRENT_BINARY_DIR}/typesystem_gui.xml" @ONLY)
-execute_generator(gui QtGui_SRC "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:${QtCore_BINARY_DIR}")
-
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/
- ${QT_INCLUDE_DIR}
- ${SHIBOKEN_INCLUDE_DIR}
- ${libpyside_SOURCE_DIR}
- ${PYTHON_INCLUDE_PATH}
- ${QtCore_BINARY_DIR}/PySide/QtCore/
- )
-add_library(QtGui MODULE ${QtGui_SRC})
-set_property(TARGET QtGui PROPERTY PREFIX "")
-target_link_libraries(QtGui
- pyside
+set(QtGui_typesystem_path "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:${QtCore_BINARY_DIR}")
+set(QtGui_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/
+ ${QT_INCLUDE_DIR}
+ ${SHIBOKEN_INCLUDE_DIR}
+ ${libpyside_SOURCE_DIR}
+ ${PYTHON_INCLUDE_PATH}
+ ${QtCore_BINARY_DIR}/PySide/QtCore/)
+set(QtGui_libraries pyside
${PYSIDE_PYTHON_LIBRARIES}
${SHIBOKEN_LIBRARY}
- ${QT_QTGUI_LIBRARY}
- )
-add_dependencies(QtGui QtCore)
+ ${QT_QTGUI_LIBRARY})
+set(QtGui_deps "QtCore")
-# install
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/QtGui${CMAKE_DEBUG_POSTFIX}.so DESTINATION "${SITE_PACKAGE}/PySide")
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/pyside_qtgui_python.h
- DESTINATION include/PySide/QtGui/)
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/typesystem_gui.xml
- ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_gui_common.xml
+# extra install
+install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_gui_common.xml
${CMAKE_CURRENT_SOURCE_DIR}/typesystem_gui_mac.xml
${CMAKE_CURRENT_SOURCE_DIR}/typesystem_gui_maemo.xml
${CMAKE_CURRENT_SOURCE_DIR}/typesystem_gui_x11.xml
DESTINATION share/PySide/typesystems)
+create_pyside_module(QtGui
+ ${CMAKE_CURRENT_BINARY_DIR}/typesystem_gui.xml
+ QtGui_include_dirs
+ QtGui_libraries
+ QtGui_deps
+ QtGui_typesystem_path
+ QtGui_SRC)
+
diff --git a/PySide/QtHelp/CMakeLists.txt b/PySide/QtHelp/CMakeLists.txt
index 42b0737..d5140c2 100644
--- a/PySide/QtHelp/CMakeLists.txt
+++ b/PySide/QtHelp/CMakeLists.txt
@@ -15,35 +15,28 @@ set(QtHelp_SRC
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtHelp/qthelp_module_wrapper.cpp
)
-execute_generator(help QtHelp_SRC "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:${QtGui_BINARY_DIR}:${QtGui_SOURCE_DIR}:${QtHelp_SOURCE_DIR}")
-
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}
- ${QT_QTCORE_INCLUDE_DIR}
- ${QT_QTGUI_INCLUDE_DIR}
- ${QT_QTHELP_INCLUDE_DIR}
- ${PYTHON_INCLUDE_PATH}
- ${SHIBOKEN_INCLUDE_DIR}
- ${libpyside_SOURCE_DIR}
- ${QtGui_BINARY_DIR}/PySide/QtGui/
- ${QtCore_BINARY_DIR}/PySide/QtCore/
- ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtHelp)
-add_library(QtHelp MODULE ${QtHelp_SRC})
-
-set_target_properties(QtHelp PROPERTIES PREFIX "")
-
-target_link_libraries(QtHelp
- pyside
+set(QtHelp_typesystem_path "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:${QtGui_BINARY_DIR}:${QtGui_SOURCE_DIR}:${QtHelp_SOURCE_DIR}")
+set(QtHelp_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
+ ${QT_QTCORE_INCLUDE_DIR}
+ ${QT_QTGUI_INCLUDE_DIR}
+ ${QT_QTHELP_INCLUDE_DIR}
+ ${PYTHON_INCLUDE_PATH}
+ ${SHIBOKEN_INCLUDE_DIR}
+ ${libpyside_SOURCE_DIR}
+ ${QtGui_BINARY_DIR}/PySide/QtGui/
+ ${QtCore_BINARY_DIR}/PySide/QtCore/
+ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtHelp)
+set(QtHelp_libraries pyside
${PYSIDE_PYTHON_LIBRARIES}
${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY}
${QT_QTHELP_LIBRARY})
-add_dependencies(QtHelp QtGui)
-
-# install
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/QtHelp${CMAKE_DEBUG_POSTFIX}.so
- DESTINATION ${SITE_PACKAGE}/PySide)
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtHelp/pyside_qthelp_python.h
- DESTINATION include/PySide/QtHelp/)
-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_help.xml
- DESTINATION share/PySide/typesystems)
+set(QtHelp_deps QtGui)
+create_pyside_module(QtHelp
+ ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_help.xml
+ QtHelp_include_dirs
+ QtHelp_libraries
+ QtHelp_deps
+ QtHelp_typesystem_path
+ QtHelp_SRC)
diff --git a/PySide/QtMaemo5/CMakeLists.txt b/PySide/QtMaemo5/CMakeLists.txt
index 5338b80..fbcf75f 100644
--- a/PySide/QtMaemo5/CMakeLists.txt
+++ b/PySide/QtMaemo5/CMakeLists.txt
@@ -11,8 +11,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/${BINDING_NAME}/QtMaemo5/qmaemo5valuebutton_wrapper.
${CMAKE_CURRENT_BINARY_DIR}/${BINDING_NAME}/QtMaemo5/qtmaemo5_module_wrapper.cpp
)
-execute_generator(maemo5 QtMaemo5_SRC
- "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:${QtGui_BINARY_DIR}:${QtGui_SOURCE_DIR}:${QtMaemo5_SOURCE_DIR}")
+set(QtMaemo5_typesystem_path "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:${QtGui_BINARY_DIR}:${QtGui_SOURCE_DIR}:${QtMaemo5_SOURCE_DIR}")
# QT_QTMAEMO5_* variables are not defined by CMake
if(NOT QT_QTMAEMO5_INCLUDE_DIR)
@@ -24,35 +23,28 @@ if(NOT QT_QTMAEMO5_LIBRARY)
PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
endif(NOT QT_QTMAEMO5_LIBRARY)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}
- ${QT_QTCORE_INCLUDE_DIR}
- ${QT_QTGUI_INCLUDE_DIR}
- ${QT_QTMAEMO5_INCLUDE_DIR}
- ${PYTHON_INCLUDE_PATH}
- ${SHIBOKEN_INCLUDE_DIR}
- ${libpyside_SOURCE_DIR}
- ${QtCore_BINARY_DIR}/${BINDING_NAME}/QtCore/
- ${QtGui_BINARY_DIR}/${BINDING_NAME}/QtGui/
- ${CMAKE_CURRENT_BINARY_DIR}/${BINDING_NAME}/QtMaemo5)
-add_library(QtMaemo5 MODULE ${QtMaemo5_SRC})
-
-set_target_properties(QtMaemo5 PROPERTIES
- PREFIX "")
-
-target_link_libraries(QtMaemo5
- pyside
+set(QtMaemo5_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
+ ${QT_QTCORE_INCLUDE_DIR}
+ ${QT_QTGUI_INCLUDE_DIR}
+ ${QT_QTMAEMO5_INCLUDE_DIR}
+ ${PYTHON_INCLUDE_PATH}
+ ${SHIBOKEN_INCLUDE_DIR}
+ ${libpyside_SOURCE_DIR}
+ ${QtCore_BINARY_DIR}/${BINDING_NAME}/QtCore/
+ ${QtGui_BINARY_DIR}/${BINDING_NAME}/QtGui/
+ ${CMAKE_CURRENT_BINARY_DIR}/${BINDING_NAME}/QtMaemo5)
+set(QtMaemo5_libraries pyside
${PYSIDE_PYTHON_LIBRARIES}
${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY}
${QT_QTMAEMO5_LIBRARY})
+set(QtMaemo5_deps QtGui)
-add_dependencies(QtMaemo5 QtGui)
-
-# install
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/QtMaemo5${CMAKE_DEBUG_POSTFIX}.so
- DESTINATION ${SITE_PACKAGE}/${BINDING_NAME})
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtMaemo5/pyside_qtmaemo5_python.h
- DESTINATION include/${BINDING_NAME}/QtMaemo5/)
-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_maemo5.xml
- DESTINATION share/PySide/typesystems)
+create_pyside_module(QtMaemo5
+ ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_maemo5.xml
+ QtMaemo5_include_dirs
+ QtMaemo5_libraries
+ QtMaemo5_deps
+ QtMaemo5_typesystem_path
+ QtMaemo5_SRC)
diff --git a/PySide/QtMultimedia/CMakeLists.txt b/PySide/QtMultimedia/CMakeLists.txt
index 20707f7..1829697 100644
--- a/PySide/QtMultimedia/CMakeLists.txt
+++ b/PySide/QtMultimedia/CMakeLists.txt
@@ -17,38 +17,32 @@ set(QtMultimedia_SRC
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtMultimedia/qvideoframe_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtMultimedia/qtmultimedia_module_wrapper.cpp
)
+set(QtMultimedia_typesystem_path "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtGui_BINARY_DIR}")
-execute_generator(multimedia QtMultimedia_SRC "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtGui_BINARY_DIR}")
+set(QtMultimedia_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtMultimedia/
+ ${QT_INCLUDE_DIR}
+ ${QT_QTCORE_INCLUDE_DIR}
+ ${QT_QTGUI_INCLUDE_DIR}
+ ${QT_QTMULTIMEDIA_INCLUDE_DIR}
+ ${SHIBOKEN_INCLUDE_DIR}
+ ${libpyside_SOURCE_DIR}
+ ${PYTHON_INCLUDE_PATH}
+ ${QtCore_BINARY_DIR}/PySide/QtCore/
+ ${QtGui_BINARY_DIR}/PySide/QtGui/)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtMultimedia/
- ${QT_INCLUDE_DIR}
- ${QT_QTCORE_INCLUDE_DIR}
- ${QT_QTGUI_INCLUDE_DIR}
- ${QT_QTMULTIMEDIA_INCLUDE_DIR}
- ${SHIBOKEN_INCLUDE_DIR}
- ${libpyside_SOURCE_DIR}
- ${PYTHON_INCLUDE_PATH}
- ${QtCore_BINARY_DIR}/PySide/QtCore/
- ${QtGui_BINARY_DIR}/PySide/QtGui/
- )
+set(QtMultimedia_libraries pyside
+ ${PYSIDE_PYTHON_LIBRARIES}
+ ${SHIBOKEN_LIBRARY}
+ ${QT_QTMULTIMEDIA_LIBRARY}
+ ${QT_QTGUI_LIBRARY})
-add_library(QtMultimedia MODULE ${QtMultimedia_SRC})
-set_property(TARGET QtMultimedia PROPERTY PREFIX "")
-target_link_libraries(QtMultimedia
- pyside
- ${PYSIDE_PYTHON_LIBRARIES}
- ${SHIBOKEN_LIBRARY}
- ${QT_QTMULTIMEDIA_LIBRARY}
- ${QT_QTGUI_LIBRARY}
- )
-add_dependencies(QtMultimedia QtGui)
-
-# install
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/QtMultimedia${CMAKE_DEBUG_POSTFIX}.so
- DESTINATION ${SITE_PACKAGE}/PySide)
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtMultimedia/pyside_qtmultimedia_python.h
- DESTINATION include/PySide/QtMultimedia/)
-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_multimedia.xml
- DESTINATION share/PySide/typesystems)
+set(QtMultimedia_deps QtGui)
+create_pyside_module(QtMultimedia
+ ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_multimedia.xml
+ QtMultimedia_include_dirs
+ QtMultimedia_libraries
+ QtMultimedia_deps
+ QtMultimedia_typesystem_path
+ QtMultimedia_SRC)
diff --git a/PySide/QtNetwork/CMakeLists.txt b/PySide/QtNetwork/CMakeLists.txt
index 6afedbd..df3c129 100644
--- a/PySide/QtNetwork/CMakeLists.txt
+++ b/PySide/QtNetwork/CMakeLists.txt
@@ -98,33 +98,26 @@ set(OPENSSL_SOURCES
CHECK_QT_NETWORK_MACRO("Network OPENSSL" QT_NO_OPENSSL OPENSSL_SOURCES QtNetwork_SRC)
-execute_generator(network QtNetwork_SRC "${CMAKE_CURRENT_SOURCE_DIR}:${QtCore_SOURCE_DIR}")
+set(QtNetwork_typesystem_path "${CMAKE_CURRENT_SOURCE_DIR}:${QtCore_SOURCE_DIR}")
+set(QtNetwork_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/
+ ${QT_INCLUDE_DIR}
+ ${QT_QTNETWORK_INCLUDE_DIR}
+ ${SHIBOKEN_INCLUDE_DIR}
+ ${libpyside_SOURCE_DIR}
+ ${PYTHON_INCLUDE_PATH}
+ ${QtCore_BINARY_DIR}/PySide/QtCore/)
+set(QtNetwork_libraries pyside
+ ${PYSIDE_PYTHON_LIBRARIES}
+ ${SHIBOKEN_LIBRARY}
+ ${QT_QTNETWORK_LIBRARY})
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/
- ${QT_INCLUDE_DIR}
- ${QT_QTNETWORK_INCLUDE_DIR}
- ${SHIBOKEN_INCLUDE_DIR}
- ${libpyside_SOURCE_DIR}
- ${PYTHON_INCLUDE_PATH}
- ${QtCore_BINARY_DIR}/PySide/QtCore/
- )
-
-add_library(QtNetwork MODULE ${QtNetwork_SRC})
-set_property(TARGET QtNetwork PROPERTY PREFIX "")
-target_link_libraries(QtNetwork
- pyside
- ${PYSIDE_PYTHON_LIBRARIES}
- ${SHIBOKEN_LIBRARY}
- ${QT_QTNETWORK_LIBRARY}
- )
-add_dependencies(QtNetwork QtCore)
-
-# install
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/QtNetwork${CMAKE_DEBUG_POSTFIX}.so
- DESTINATION ${SITE_PACKAGE}/PySide)
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/pyside_qtnetwork_python.h
- DESTINATION include/PySide/QtNetwork/)
-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_network.xml
- DESTINATION share/PySide/typesystems)
+set(QtNetwork_deps QtCore)
+create_pyside_module(QtNetwork
+ ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_network.xml
+ QtNetwork_include_dirs
+ QtNetwork_libraries
+ QtNetwork_deps
+ QtNetwork_typesystem_path
+ QtNetwork_SRC)
diff --git a/PySide/QtOpenGL/CMakeLists.txt b/PySide/QtOpenGL/CMakeLists.txt
index 158f4be..42173a4 100644
--- a/PySide/QtOpenGL/CMakeLists.txt
+++ b/PySide/QtOpenGL/CMakeLists.txt
@@ -32,33 +32,27 @@ set(QtOpenGL_SRC
${QtOpenGL_47_SRC}
)
-execute_generator(opengl QtOpenGL_SRC "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:${QtGui_BINARY_DIR}:${QtGui_SOURCE_DIR}:${QtOpenGL_SOURCE_DIR}")
-
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}
- ${QT_QTCORE_INCLUDE_DIR}
- ${QT_QTGUI_INCLUDE_DIR}
- ${QT_QTOPENGL_INCLUDE_DIR}
- ${PYTHON_INCLUDE_PATH}
- ${SHIBOKEN_INCLUDE_DIR}
- ${libpyside_SOURCE_DIR}
- ${QtGui_BINARY_DIR}/PySide/QtGui/
- ${QtCore_BINARY_DIR}/PySide/QtCore/
- ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtOpenGL)
-add_library(QtOpenGL MODULE ${QtOpenGL_SRC})
-set_target_properties(QtOpenGL PROPERTIES PREFIX "")
-target_link_libraries(QtOpenGL
- pyside
- ${PYSIDE_PYTHON_LIBRARIES}
- ${QT_QTCORE_LIBRARY}
- ${QT_QTGUI_LIBRARY}
- ${QT_QTOPENGL_LIBRARY})
-add_dependencies(QtOpenGL QtGui)
-
-# install
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/QtOpenGL${CMAKE_DEBUG_POSTFIX}.so
- DESTINATION ${SITE_PACKAGE}/PySide)
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtOpenGL/pyside_qtopengl_python.h
- DESTINATION include/PySide/QtOpenGL/)
-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_opengl.xml
- DESTINATION share/PySide/typesystems)
-
+set(QtOpenGL_typesystem_path "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:${QtGui_BINARY_DIR}:${QtGui_SOURCE_DIR}:${QtOpenGL_SOURCE_DIR}")
+set(QtOpenGL_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
+ ${QT_QTCORE_INCLUDE_DIR}
+ ${QT_QTGUI_INCLUDE_DIR}
+ ${QT_QTOPENGL_INCLUDE_DIR}
+ ${PYTHON_INCLUDE_PATH}
+ ${SHIBOKEN_INCLUDE_DIR}
+ ${libpyside_SOURCE_DIR}
+ ${QtGui_BINARY_DIR}/PySide/QtGui/
+ ${QtCore_BINARY_DIR}/PySide/QtCore/
+ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtOpenGL)
+set(QtOpenGL_libraries pyside
+ ${PYSIDE_PYTHON_LIBRARIES}
+ ${QT_QTCORE_LIBRARY}
+ ${QT_QTGUI_LIBRARY}
+ ${QT_QTOPENGL_LIBRARY})
+set(QtOpenGL_deps QtGui)
+create_pyside_module(QtOpenGL
+ ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_opengl.xml
+ QtOpenGL_include_dirs
+ QtOpenGL_libraries
+ QtOpenGL_deps
+ QtOpenGL_typesystem_path
+ QtOpenGL_SRC)
diff --git a/PySide/QtScript/CMakeLists.txt b/PySide/QtScript/CMakeLists.txt
index af6ffd4..d9e8264 100644
--- a/PySide/QtScript/CMakeLists.txt
+++ b/PySide/QtScript/CMakeLists.txt
@@ -25,33 +25,25 @@ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtScript/qscriptvalueiterator_wrapper.cpp
${QtScript_46_SRC}
)
-execute_generator(script QtScript_SRC "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}")
-
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtScript
- ${QT_INCLUDE_DIR}
- ${QT_QTSCRIPT_INCLUDE_DIR}
- ${SHIBOKEN_INCLUDE_DIR}
- ${libpyside_SOURCE_DIR}
- ${PYTHON_INCLUDE_PATH}
- ${QtCore_BINARY_DIR}/PySide/QtCore
- )
-add_library(QtScript MODULE ${QtScript_SRC})
-set_property(TARGET QtScript PROPERTY PREFIX "")
-target_link_libraries(QtScript
- pyside
- ${PYSIDE_PYTHON_LIBRARIES}
- ${SHIBOKEN_LIBRARY}
- ${QT_QTCORE_LIBRARY}
- ${QT_QTSCRIPT_LIBRARY}
- )
-add_dependencies(QtScript QtCore)
-
-# install
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/QtScript${CMAKE_DEBUG_POSTFIX}.so DESTINATION ${SITE_PACKAGE}/PySide)
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtScript/pyside_qtscript_python.h
- DESTINATION include/PySide/QtScript/)
-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_script.xml
- DESTINATION share/PySide/typesystems)
-
-
+set(QtScript_typesystem_path "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}")
+set(QtScript_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtScript
+ ${QT_INCLUDE_DIR}
+ ${QT_QTSCRIPT_INCLUDE_DIR}
+ ${SHIBOKEN_INCLUDE_DIR}
+ ${libpyside_SOURCE_DIR}
+ ${PYTHON_INCLUDE_PATH}
+ ${QtCore_BINARY_DIR}/PySide/QtCore )
+set(QtScript_libraries pyside
+ ${PYSIDE_PYTHON_LIBRARIES}
+ ${SHIBOKEN_LIBRARY}
+ ${QT_QTCORE_LIBRARY}
+ ${QT_QTSCRIPT_LIBRARY})
+set(QtScript_deps QtCore)
+create_pyside_module(QtScript
+ ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_script.xml
+ QtScript_include_dirs
+ QtScript_libraries
+ QtScript_deps
+ QtScript_typesystem_path
+ QtScript_SRC)
diff --git a/PySide/QtSql/CMakeLists.txt b/PySide/QtSql/CMakeLists.txt
index 1c45ac0..f8e105d 100644
--- a/PySide/QtSql/CMakeLists.txt
+++ b/PySide/QtSql/CMakeLists.txt
@@ -21,35 +21,27 @@ set(QtSql_SRC
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSql/qtsql_module_wrapper.cpp
)
-execute_generator(sql QtSql_SRC "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:${QtGui_BINARY_DIR}:${QtGui_SOURCE_DIR}:${QtSql_SOURCE_DIR}")
-
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}
- ${QT_QTCORE_INCLUDE_DIR}
- ${QT_QTGUI_INCLUDE_DIR}
- ${QT_QTSQL_INCLUDE_DIR}
- ${PYTHON_INCLUDE_PATH}
- ${SHIBOKEN_INCLUDE_DIR}
- ${libpyside_SOURCE_DIR}
- ${QtCore_BINARY_DIR}/PySide/QtCore/
- ${QtGui_BINARY_DIR}/PySide/QtGui/
- ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSql/)
-add_library(QtSql MODULE ${QtSql_SRC})
-set_target_properties(QtSql PROPERTIES PREFIX "")
-target_link_libraries(QtSql
- pyside
- ${PYSIDE_PYTHON_LIBRARIES}
- ${QT_QTCORE_LIBRARY}
- ${QT_QTGUI_LIBRARY}
- ${QT_QTSQL_LIBRARY})
-
-add_dependencies(QtSql QtGui)
-
-# install
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/QtSql${CMAKE_DEBUG_POSTFIX}.so
- DESTINATION ${SITE_PACKAGE}/PySide)
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSql/pyside_qtsql_python.h
- DESTINATION include/PySide/QtSql/)
-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_sql.xml
- DESTINATION share/PySide/typesystems)
-
-
+set(QtSql_typesystem_path "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:${QtGui_BINARY_DIR}:${QtGui_SOURCE_DIR}:${QtSql_SOURCE_DIR}")
+set(QtSql_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
+ ${QT_QTCORE_INCLUDE_DIR}
+ ${QT_QTGUI_INCLUDE_DIR}
+ ${QT_QTSQL_INCLUDE_DIR}
+ ${PYTHON_INCLUDE_PATH}
+ ${SHIBOKEN_INCLUDE_DIR}
+ ${libpyside_SOURCE_DIR}
+ ${QtCore_BINARY_DIR}/PySide/QtCore/
+ ${QtGui_BINARY_DIR}/PySide/QtGui/
+ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSql/)
+set(QtSql_libraries pyside
+ ${PYSIDE_PYTHON_LIBRARIES}
+ ${QT_QTCORE_LIBRARY}
+ ${QT_QTGUI_LIBRARY}
+ ${QT_QTSQL_LIBRARY})
+set(QtSql_deps QtGui)
+create_pyside_module(QtSql
+ ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_sql.xml
+ QtSql_include_dirs
+ QtSql_libraries
+ QtSql_deps
+ QtSql_typesystem_path
+ QtSql_SRC)
diff --git a/PySide/QtSvg/CMakeLists.txt b/PySide/QtSvg/CMakeLists.txt
index 33cdba5..4119512 100644
--- a/PySide/QtSvg/CMakeLists.txt
+++ b/PySide/QtSvg/CMakeLists.txt
@@ -30,37 +30,28 @@ ${SPECIFIC_OS_FILES}
${QtSvg_46_SRC}
)
-execute_generator(svg QtSvg_SRC "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtGui_BINARY_DIR}")
-
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSvg/
- ${QT_INCLUDE_DIR}
- ${QT_QTCORE_INCLUDE_DIR}
- ${QT_QTGUI_INCLUDE_DIR}
- ${QT_QTSVG_INCLUDE_DIR}
- ${SHIBOKEN_INCLUDE_DIR}
- ${libpyside_SOURCE_DIR}
- ${PYTHON_INCLUDE_PATH}
- ${QtCore_BINARY_DIR}/PySide/QtCore/
- ${QtGui_BINARY_DIR}/PySide/QtGui/
- )
-
-add_library(QtSvg MODULE ${QtSvg_SRC})
-set_property(TARGET QtSvg PROPERTY PREFIX "")
-target_link_libraries(QtSvg
- pyside
- ${PYSIDE_PYTHON_LIBRARIES}
- ${SHIBOKEN_LIBRARY}
- ${QT_QTSVG_LIBRARY}
- ${QT_QTGUI_LIBRARY}
- )
-add_dependencies(QtSvg QtGui)
-
-# install
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/QtSvg${CMAKE_DEBUG_POSTFIX}.so
- DESTINATION ${SITE_PACKAGE}/PySide)
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSvg/pyside_qtsvg_python.h
- DESTINATION include/PySide/QtSvg/)
-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_svg.xml
- DESTINATION share/PySide/typesystems)
-
+set(QtSvg_typesystem_path "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtGui_BINARY_DIR}")
+set(QtSvg_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSvg/
+ ${QT_INCLUDE_DIR}
+ ${QT_QTCORE_INCLUDE_DIR}
+ ${QT_QTGUI_INCLUDE_DIR}
+ ${QT_QTSVG_INCLUDE_DIR}
+ ${SHIBOKEN_INCLUDE_DIR}
+ ${libpyside_SOURCE_DIR}
+ ${PYTHON_INCLUDE_PATH}
+ ${QtCore_BINARY_DIR}/PySide/QtCore/
+ ${QtGui_BINARY_DIR}/PySide/QtGui/)
+set(QtSvg_libraries pyside
+ ${PYSIDE_PYTHON_LIBRARIES}
+ ${SHIBOKEN_LIBRARY}
+ ${QT_QTSVG_LIBRARY}
+ ${QT_QTGUI_LIBRARY})
+set(QtSvg_deps QtGui)
+create_pyside_module(QtSvg
+ ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_svg.xml
+ QtSvg_include_dirs
+ QtSvg_libraries
+ QtSvg_deps
+ QtSvg_typesystem_path
+ QtSvg_SRC)
diff --git a/PySide/QtTest/CMakeLists.txt b/PySide/QtTest/CMakeLists.txt
index 3ac608f..def84db 100644
--- a/PySide/QtTest/CMakeLists.txt
+++ b/PySide/QtTest/CMakeLists.txt
@@ -18,38 +18,29 @@ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtTest/qttest_module_wrapper.cpp
${SPECIFIC_OS_FILES}
)
-execute_generator(test QtTest_SRC "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtGui_BINARY_DIR}")
-
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtTest/
- ${QT_INCLUDE_DIR}
- ${QT_QTCORE_INCLUDE_DIR}
- ${QT_QTGUI_INCLUDE_DIR}
- ${QT_QTTEST_INCLUDE_DIR}
- ${SHIBOKEN_INCLUDE_DIR}
- ${libpyside_SOURCE_DIR}
- ${PYTHON_INCLUDE_PATH}
- ${QtCore_BINARY_DIR}/PySide/QtCore/
- ${QtGui_BINARY_DIR}/PySide/QtGui/
- )
-
-add_library(QtTest MODULE ${QtTest_SRC})
-set_property(TARGET QtTest PROPERTY PREFIX "")
-target_link_libraries(QtTest
- pyside
- ${PYSIDE_PYTHON_LIBRARIES}
- ${SHIBOKEN_LIBRARY}
- ${QT_QTTEST_LIBRARY}
- ${QT_QTGUI_LIBRARY}
- ${QT_QTCORE_LIBRARY}
- )
-add_dependencies(QtTest QtGui)
-
-# install
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/QtTest${CMAKE_DEBUG_POSTFIX}.so
- DESTINATION ${SITE_PACKAGE}/PySide)
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtTest/pyside_qttest_python.h
- DESTINATION include/PySide/QtTest/)
-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_test.xml
- DESTINATION share/PySide/typesystems)
-
+set(QtTest_typesystem_path "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtGui_BINARY_DIR}")
+set(QtTest_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtTest/
+ ${QT_INCLUDE_DIR}
+ ${QT_QTCORE_INCLUDE_DIR}
+ ${QT_QTGUI_INCLUDE_DIR}
+ ${QT_QTTEST_INCLUDE_DIR}
+ ${SHIBOKEN_INCLUDE_DIR}
+ ${libpyside_SOURCE_DIR}
+ ${PYTHON_INCLUDE_PATH}
+ ${QtCore_BINARY_DIR}/PySide/QtCore/
+ ${QtGui_BINARY_DIR}/PySide/QtGui/)
+set(QtTest_libraries pyside
+ ${PYSIDE_PYTHON_LIBRARIES}
+ ${SHIBOKEN_LIBRARY}
+ ${QT_QTTEST_LIBRARY}
+ ${QT_QTGUI_LIBRARY}
+ ${QT_QTCORE_LIBRARY})
+set(QtTest_deps QtGui)
+create_pyside_module(QtTest
+ ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_test.xml
+ QtTest_include_dirs
+ QtTest_libraries
+ QtTest_deps
+ QtTest_typesystem_path
+ QtTest_SRC)
diff --git a/PySide/QtUiTools/CMakeLists.txt b/PySide/QtUiTools/CMakeLists.txt
index 320fc1a..9af11fb 100644
--- a/PySide/QtUiTools/CMakeLists.txt
+++ b/PySide/QtUiTools/CMakeLists.txt
@@ -5,37 +5,29 @@ set(QtUiTools_SRC
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtUiTools/quiloader_wrapper.cpp
)
-execute_generator(uitools QtUiTools_SRC "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:${QtGui_BINARY_DIR}:${QtGui_SOURCE_DIR}:${QtXml_SOURCE_DIR}:${QtUiTools_SOURCE_DIR}")
-
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}
- ${QT_QTCORE_INCLUDE_DIR}
- ${QT_QTGUI_INCLUDE_DIR}
- ${QT_QTXML_INCLUDE_DIR}
- ${QT_QTUITOOLS_INCLUDE_DIR}
- ${PYTHON_INCLUDE_PATH}
- ${SHIBOKEN_INCLUDE_DIR}
- ${libpyside_SOURCE_DIR}
- ${QtCore_BINARY_DIR}/PySide/QtCore/
- ${QtXml_BINARY_DIR}/PySide/QtXml/
- ${QtGui_BINARY_DIR}/PySide/QtGui/
- ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtUiTools)
-
-add_library(QtUiTools MODULE ${QtUiTools_SRC})
-set_target_properties(QtUiTools PROPERTIES PREFIX "")
-target_link_libraries(QtUiTools
- pyside
- ${PYSIDE_PYTHON_LIBRARIES}
- ${QT_QTCORE_LIBRARY}
- ${QT_QTGUI_LIBRARY}
- ${QT_QTUITOOLS_LIBRARY})
-
-add_dependencies(QtUiTools QtGui QtXml)
-
-# install
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/QtUiTools${CMAKE_DEBUG_POSTFIX}.so
- DESTINATION ${SITE_PACKAGE}/PySide)
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtUiTools/pyside_qtuitools_python.h
- DESTINATION include/PySide/QtUiTools/)
-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_uitools.xml
- DESTINATION share/PySide/typesystems)
-
+set(QtUiTools_typesystem_path "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:${QtGui_BINARY_DIR}:${QtGui_SOURCE_DIR}:${QtXml_SOURCE_DIR}:${QtUiTools_SOURCE_DIR}")
+set(QtUiTools_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
+ ${QT_QTCORE_INCLUDE_DIR}
+ ${QT_QTGUI_INCLUDE_DIR}
+ ${QT_QTXML_INCLUDE_DIR}
+ ${QT_QTUITOOLS_INCLUDE_DIR}
+ ${PYTHON_INCLUDE_PATH}
+ ${SHIBOKEN_INCLUDE_DIR}
+ ${libpyside_SOURCE_DIR}
+ ${QtCore_BINARY_DIR}/PySide/QtCore/
+ ${QtXml_BINARY_DIR}/PySide/QtXml/
+ ${QtGui_BINARY_DIR}/PySide/QtGui/
+ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtUiTools)
+set(QtUiTools_libraries pyside
+ ${PYSIDE_PYTHON_LIBRARIES}
+ ${QT_QTCORE_LIBRARY}
+ ${QT_QTGUI_LIBRARY}
+ ${QT_QTUITOOLS_LIBRARY})
+set(QtUiTools_deps QtGui QtXml)
+create_pyside_module(QtUiTools
+ ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_uitools.xml
+ QtUiTools_include_dirs
+ QtUiTools_libraries
+ QtUiTools_deps
+ QtUiTools_typesystem_path
+ QtUiTools_SRC)
diff --git a/PySide/QtWebKit/CMakeLists.txt b/PySide/QtWebKit/CMakeLists.txt
index 464bc28..08e20be 100644
--- a/PySide/QtWebKit/CMakeLists.txt
+++ b/PySide/QtWebKit/CMakeLists.txt
@@ -44,41 +44,32 @@ ${SPECIFIC_OS_FILES}
${QtWebKit_46_SRC}
)
-execute_generator(webkit QtWebKit_SRC "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtGui_BINARY_DIR}:${QtNetwork_SOURCE_DIR}")
-
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebkit/
- ${QT_INCLUDE_DIR}
- ${QT_QTCORE_INCLUDE_DIR}
- ${QT_QTGUI_INCLUDE_DIR}
- ${QT_QTNETWORK_INCLUDE_DIR}
- ${QT_QTWEBKIT_INCLUDE_DIR}
- ${SHIBOKEN_INCLUDE_DIR}
- ${libpyside_SOURCE_DIR}
- ${PYTHON_INCLUDE_PATH}
- ${QtCore_BINARY_DIR}/PySide/QtCore/
- ${QtGui_BINARY_DIR}/PySide/QtGui/
- ${QtNetwork_BINARY_DIR}/PySide/QtNetwork/
- )
-
-add_library(QtWebKit MODULE ${QtWebKit_SRC})
-set_property(TARGET QtWebKit PROPERTY PREFIX "")
-target_link_libraries(QtWebKit
- pyside
- ${PYSIDE_PYTHON_LIBRARIES}
- ${SHIBOKEN_LIBRARY}
- ${QT_QTWEBKIT_LIBRARY}
- ${QT_QTNETWORK_LIBRARY}
- ${QT_QTGUI_LIBRARY}
- )
-add_dependencies(QtWebKit QtGui)
-add_dependencies(QtWebKit QtNetwork)
-
-# install
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/QtWebKit${CMAKE_DEBUG_POSTFIX}.so
- DESTINATION ${SITE_PACKAGE}/PySide)
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/pyside_qtwebkit_python.h
- DESTINATION include/PySide/QtWebKit/)
-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_webkit.xml
- DESTINATION share/PySide/typesystems)
+set(QtWebKit_typesystem_path "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtGui_BINARY_DIR}:${QtNetwork_SOURCE_DIR}")
+set(QtWebkit_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebkit/
+ ${QT_INCLUDE_DIR}
+ ${QT_QTCORE_INCLUDE_DIR}
+ ${QT_QTGUI_INCLUDE_DIR}
+ ${QT_QTNETWORK_INCLUDE_DIR}
+ ${QT_QTWEBKIT_INCLUDE_DIR}
+ ${SHIBOKEN_INCLUDE_DIR}
+ ${libpyside_SOURCE_DIR}
+ ${PYTHON_INCLUDE_PATH}
+ ${QtCore_BINARY_DIR}/PySide/QtCore/
+ ${QtGui_BINARY_DIR}/PySide/QtGui/
+ ${QtNetwork_BINARY_DIR}/PySide/QtNetwork/ )
+set(QtWebKit_libraries pyside
+ ${PYSIDE_PYTHON_LIBRARIES}
+ ${SHIBOKEN_LIBRARY}
+ ${QT_QTWEBKIT_LIBRARY}
+ ${QT_QTNETWORK_LIBRARY}
+ ${QT_QTGUI_LIBRARY})
+set(QtWebKit_deps QtGui QtNetwork)
+create_pyside_module(QtWebKit
+ ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_webkit.xml
+ QtWebkit_include_dirs
+ QtWebKit_libraries
+ QtWebKit_deps
+ QtWebKit_typesystem_path
+ QtWebKit_SRC)
diff --git a/PySide/QtXml/CMakeLists.txt b/PySide/QtXml/CMakeLists.txt
index fc7b0d0..c76cabd 100644
--- a/PySide/QtXml/CMakeLists.txt
+++ b/PySide/QtXml/CMakeLists.txt
@@ -35,34 +35,26 @@ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXml/qxmlreader_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXml/qxmlsimplereader_wrapper.cpp
)
-execute_generator(xml QtXml_SRC "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}")
-
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXml
- ${CMAKE_SOURCE_DIR}
- ${QT_INCLUDE_DIR}
- ${QT_QTCORE_INCLUDE_DIR}
- ${QT_QTXML_INCLUDE_DIR}
- ${SHIBOKEN_INCLUDE_DIR}
- ${libpyside_SOURCE_DIR}
- ${PYTHON_INCLUDE_PATH}
- ${QtCore_BINARY_DIR}/PySide/QtCore
- )
-add_library(QtXml MODULE ${QtXml_SRC})
-set_property(TARGET QtXml PROPERTY PREFIX "")
-target_link_libraries(QtXml
- pyside
- ${PYSIDE_PYTHON_LIBRARIES}
- ${SHIBOKEN_LIBRARY}
- ${QT_QTXML_LIBRARY}
- )
-add_dependencies(QtXml QtCore)
-
-# install
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/QtXml${CMAKE_DEBUG_POSTFIX}.so DESTINATION ${SITE_PACKAGE}/PySide)
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXml/pyside_qtxml_python.h
- DESTINATION include/PySide/QtXml/)
-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_xml.xml
- DESTINATION share/PySide/typesystems)
-
-
+set(QtXml_typesystem_path "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}")
+set(QtXml_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXml
+ ${CMAKE_SOURCE_DIR}
+ ${QT_INCLUDE_DIR}
+ ${QT_QTCORE_INCLUDE_DIR}
+ ${QT_QTXML_INCLUDE_DIR}
+ ${SHIBOKEN_INCLUDE_DIR}
+ ${libpyside_SOURCE_DIR}
+ ${PYTHON_INCLUDE_PATH}
+ ${QtCore_BINARY_DIR}/PySide/QtCore)
+set(QtXml_libraries pyside
+ ${PYSIDE_PYTHON_LIBRARIES}
+ ${SHIBOKEN_LIBRARY}
+ ${QT_QTXML_LIBRARY})
+set(QtXml_deps QtCore)
+create_pyside_module(QtXml
+ ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_xml.xml
+ QtXml_include_dirs
+ QtXml_libraries
+ QtXml_deps
+ QtXml_typesystem_path
+ QtXml_SRC)
diff --git a/PySide/QtXmlPatterns/CMakeLists.txt b/PySide/QtXmlPatterns/CMakeLists.txt
index 825011f..3456e9e 100644
--- a/PySide/QtXmlPatterns/CMakeLists.txt
+++ b/PySide/QtXmlPatterns/CMakeLists.txt
@@ -26,30 +26,25 @@ set(QtXmlPatterns_SRC
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXmlPatterns/qxmlserializer_wrapper.cpp
${QtXmlPatterns_46_SRC}
)
-
-execute_generator(xmlpatterns QtXmlPatterns_SRC "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}")
-
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}
- ${QT_QTCORE_INCLUDE_DIR}
- ${QT_QTXMLPATTERNS_INCLUDE_DIR}
- ${PYTHON_INCLUDE_PATH}
- ${SHIBOKEN_INCLUDE_DIR}
- ${libpyside_SOURCE_DIR}
- ${QtCore_BINARY_DIR}/PySide/QtCore/
- ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXmlPatterns)
-add_library(QtXmlPatterns MODULE ${QtXmlPatterns_SRC})
-set_target_properties(QtXmlPatterns PROPERTIES PREFIX "")
-target_link_libraries(QtXmlPatterns
- pyside
- ${PYSIDE_PYTHON_LIBRARIES}
- ${QT_QTCORE_LIBRARY}
- ${QT_QTXMLPATTERNS_LIBRARY})
-add_dependencies(QtXmlPatterns QtCore)
-# install
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/QtXmlPatterns${CMAKE_DEBUG_POSTFIX}.so
- DESTINATION ${SITE_PACKAGE}/PySide)
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXmlPatterns/pyside_qtxmlpatterns_python.h
- DESTINATION include/PySide/QtXmlPatterns/)
-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_xmlpatterns.xml
- DESTINATION share/PySide/typesystems)
+set(QtXmlPatterns_typesystem_path "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}")
+set(QtXmlPatterns_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
+ ${QT_QTCORE_INCLUDE_DIR}
+ ${QT_QTXMLPATTERNS_INCLUDE_DIR}
+ ${PYTHON_INCLUDE_PATH}
+ ${SHIBOKEN_INCLUDE_DIR}
+ ${libpyside_SOURCE_DIR}
+ ${QtCore_BINARY_DIR}/PySide/QtCore/
+ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXmlPatterns)
+set(QtXmlPatterns_libraries pyside
+ ${PYSIDE_PYTHON_LIBRARIES}
+ ${QT_QTCORE_LIBRARY}
+ ${QT_QTXMLPATTERNS_LIBRARY})
+set(QtXmlPatterns_deps QtCore)
+create_pyside_module(QtXmlPatterns
+ ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_xmlpatterns.xml
+ QtXmlPatterns_include_dirs
+ QtXmlPatterns_libraries
+ QtXmlPatterns_deps
+ QtXmlPatterns_typesystem_path
+ QtXmlPatterns_SRC)
diff --git a/PySide/phonon/CMakeLists.txt b/PySide/phonon/CMakeLists.txt
index b46304a..062f17d 100644
--- a/PySide/phonon/CMakeLists.txt
+++ b/PySide/phonon/CMakeLists.txt
@@ -43,34 +43,28 @@ ${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_volumeslider_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_backendcapabilities_notifierwrapper_wrapper.cpp
)
-
-execute_generator(phonon phonon_SRC "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:${QtGui_BINARY_DIR}:${QtGui_SOURCE_DIR}:${phonon_SOURCE_DIR}")
-
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}
- ${QT_QTCORE_INCLUDE_DIR}
- ${QT_QTGUI_INCLUDE_DIR}
- ${QT_PHONON_INCLUDE_DIR}
- ${PYTHON_INCLUDE_PATH}
- ${SHIBOKEN_INCLUDE_DIR}
- ${libpyside_SOURCE_DIR}
- ${QtGui_BINARY_DIR}/PySide/QtGui/
- ${QtCore_BINARY_DIR}/PySide/QtCore/
- ${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon)
-add_library(phonon MODULE ${phonon_SRC})
-set_target_properties(phonon PROPERTIES PREFIX "")
-target_link_libraries(phonon
- pyside
+set(phonon_typesystem_path "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:${QtGui_BINARY_DIR}:${QtGui_SOURCE_DIR}:${phonon_SOURCE_DIR}")
+set(phonon_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
+ ${QT_QTCORE_INCLUDE_DIR}
+ ${QT_QTGUI_INCLUDE_DIR}
+ ${QT_PHONON_INCLUDE_DIR}
+ ${PYTHON_INCLUDE_PATH}
+ ${SHIBOKEN_INCLUDE_DIR}
+ ${libpyside_SOURCE_DIR}
+ ${QtGui_BINARY_DIR}/PySide/QtGui/
+ ${QtCore_BINARY_DIR}/PySide/QtCore/
+ ${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon)
+set(phonon_libraries pyside
${PYSIDE_PYTHON_LIBRARIES}
${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY}
${QT_PHONON_LIBRARY})
-add_dependencies(phonon QtGui)
-
-# install
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/phonon${CMAKE_DEBUG_POSTFIX}.so
- DESTINATION ${SITE_PACKAGE}/PySide)
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/pyside_phonon_python.h
- DESTINATION include/PySide/phonon/)
-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_phonon.xml
- DESTINATION share/PySide/typesystems)
+set(phonon_deps QtGui)
+create_pyside_module(phonon
+ "typesystem_phonon.xml"
+ phonon_include_dirs
+ phonon_libraries
+ phonon_depend
+ phonon_typesystem_path
+ phonon_SRC)
diff --git a/libpyside/CMakeLists.txt b/libpyside/CMakeLists.txt
index 9590a32..284a384 100644
--- a/libpyside/CMakeLists.txt
+++ b/libpyside/CMakeLists.txt
@@ -23,7 +23,8 @@ target_link_libraries(pyside
set_target_properties(pyside PROPERTIES
VERSION ${BINDING_API_VERSION}
- SOVERSION "${BINDING_API_MAJOR_VERSION}.${BINDING_API_MINOR_VERSION}")
+ SOVERSION "${BINDING_API_MAJOR_VERSION}.${BINDING_API_MINOR_VERSION}"
+ DEFINE_SYMBOL PYSIDE_EXPORTS)
#
# install stuff
diff --git a/libpyside/pysidemacros.h b/libpyside/pysidemacros.h
index c9e1e11..ccf8e37 100644
--- a/libpyside/pysidemacros.h
+++ b/libpyside/pysidemacros.h
@@ -36,10 +36,14 @@
#define PYSIDEMACROS_H
#if defined _WIN32 || defined __CYGWIN__
- #if PYSIDE_BUILD
+ #if PYSIDE_EXPORTS
#define PYSIDE_API __declspec(dllexport)
#else
- #define PYSIDE_API __declspec(dllimport)
+ #if defined __MINGW32__
+ #define PYSIDE_API
+ #else
+ #define PYSIDE_API __declspec(dllimport)
+ #endif
#endif
#else
#if __GNUC__ >= 4
From 0fb81692e3804ff92e326566994c4e1d1255b737 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Thu, 19 Aug 2010 17:49:44 -0300
Subject: [PATCH 0140/1129] Use .pyd for modules on windows.
Reviewer: Luciano Wolf
Hugo Parente Lima
---
PySide/CMakeLists.txt | 3 +++
1 file changed, 3 insertions(+)
diff --git a/PySide/CMakeLists.txt b/PySide/CMakeLists.txt
index 22ccde8..25f267e 100644
--- a/PySide/CMakeLists.txt
+++ b/PySide/CMakeLists.txt
@@ -22,6 +22,9 @@ macro(create_pyside_module module_name typesystem_file module_include_dir module
include_directories(${module_name} ${${module_include_dir}})
add_library(${module_name} MODULE ${${module_sources}})
set_target_properties(${module_name} PROPERTIES PREFIX "")
+ if(WIN32)
+ set_target_properties(${module_name} PROPERTIES SUFFIX ".pyd")
+ endif()
target_link_libraries(${module_name} ${${module_libraries}})
if(${module_deps})
add_dependencies(${module_name} ${${module_deps}})
From 18d65457dc735543cfcead4a4cac427138b522bb Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Thu, 19 Aug 2010 18:24:20 -0300
Subject: [PATCH 0141/1129] Updated test to work with Cmake 2.8 in multiples
plataforms.
Reviewer: Luciano Wolf
Hugo Parente Lima
---
tests/CMakeLists.txt | 127 +++++++++++++++++++++++++------------------
1 file changed, 74 insertions(+), 53 deletions(-)
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index a3f5278..fe4f7ec 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -1,59 +1,80 @@
-if(NOT CTEST_TESTING_TIMEOUT)
- set(CTEST_TESTING_TIMEOUT 60)
-endif()
+if(CMAKE_VERSION VERSION_LESS 2.8)
+ message("CMake version greater than 2.8 necessary to run tests")
+else()
+ if(NOT CTEST_TESTING_TIMEOUT)
+ set(CTEST_TESTING_TIMEOUT 60)
+ endif()
-macro(TEST_QT_MODULE var name)
- if(NOT DISABLE_${name} AND ${var})
- add_subdirectory(${name})
- endif()
-endmacro(TEST_QT_MODULE)
+ if(WIN32)
+ set(TEST_PYTHONPATH "${CMAKE_BINARY_DIR};${CMAKE_SOURCE_DIR}/tests/util")
+ set(TEST_LIBRARY_PATH "$ENV{PATH};${libpyside_BINARY_DIR}")
+ set(LIBRARY_PATH_VAR "PATH")
+ string(REPLACE "\\" "/" TEST_PYTHONPATH "${TEST_PYTHONPATH}")
+ string(REPLACE "\\" "/" TEST_LIBRARY_PATH "${TEST_LIBRARY_PATH}")
-macro(PYSIDE_TEST)
- string(REGEX MATCH "/([^/]+)//?([^/]+)\\.py" foo "${CMAKE_CURRENT_SOURCE_DIR}/${ARGV0}" )
- set(TEST_NAME "${CMAKE_MATCH_1}_${CMAKE_MATCH_2}")
- if (${ARGC} EQUAL 1)
- set(EXPECT_TO_FAIL 0)
- elseif(${ARGC} EQUAL 2)
- set(EXPECT_TO_FAIL ${ARGV1})
+ string(REPLACE ";" "\\;" TEST_PYTHONPATH "${TEST_PYTHONPATH}")
+ string(REPLACE ";" "\\;" TEST_LIBRARY_PATH "${TEST_LIBRARY_PATH}")
else()
- message(WARNING "Ivalid call of macro PYSIDE_TEST")
+ set(TEST_PYTHONPATH "${CMAKE_BINARY_DIR}:${CMAKE_SOURCE_DIR}/tests/util")
+ set(TEST_LIBRARY_PATH "$ENV{LD_LIBRARY_PATH}:${libpyside_BINARY_DIR}")
+ set(LIBRARY_PATH_VAR "LD_LIBRARY_PATH")
endif()
- set(TEST_CMD ${XVFB_EXEC} ${CMAKE_SOURCE_DIR}/tests/run_test.sh ${libpyside_BINARY_DIR} "${CMAKE_BINARY_DIR}:${CMAKE_SOURCE_DIR}/tests/util" ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/${ARGV0}")
- add_test(${TEST_NAME} ${TEST_CMD})
- set_tests_properties(${TEST_NAME} PROPERTIES
- TIMEOUT ${CTEST_TESTING_TIMEOUT}
- WILL_FAIL ${EXPECT_TO_FAIL})
-endmacro(PYSIDE_TEST)
-# Try to find QtMultimedia
-# TODO: Remove this hack when cmake support QtMultimedia module
-if (NOT QT_QTMULTIMEDIA_FOUND AND ${QTVERSION} VERSION_GREATER 4.5.9)
- find_path(QT_QTMULTIMEDIA_INCLUDE_DIR QtMultimedia
- PATHS ${QT_HEADERS_DIR}/QtMultimedia
- ${QT_LIBRARY_DIR}/QtMultimedia.framework/Headers
- NO_DEFAULT_PATH)
- find_library(QT_QTMULTIMEDIA_LIBRARY QtMultimedia PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
- if (QT_QTMULTIMEDIA_INCLUDE_DIR AND QT_QTMULTIMEDIA_LIBRARY)
- set(QT_QTMULTIMEDIA_FOUND ON)
- endif()
-endif ()
-add_subdirectory(signals)
-TEST_QT_MODULE(QT_QTCORE_FOUND QtCore)
-TEST_QT_MODULE(QT_QTGUI_FOUND QtGui)
-TEST_QT_MODULE(QT_QTNETWORK_FOUND QtNetwork)
-TEST_QT_MODULE(QT_QTWEBKIT_FOUND QtWebKit)
-TEST_QT_MODULE(QT_QTSVG_FOUND QtSvg)
-TEST_QT_MODULE(QT_QTXML_FOUND QtXml)
-TEST_QT_MODULE(QT_QTTEST_FOUND QtTest)
-TEST_QT_MODULE(QT_QTOPENGL_FOUND QtOpenGL)
-TEST_QT_MODULE(QT_QTSQL_FOUND QtSql)
-TEST_QT_MODULE(QT_QTUITOOLS_FOUND QtUiTools)
-TEST_QT_MODULE(QT_QTHELP_FOUND QtHelp)
-TEST_QT_MODULE(QT_QTXMLPATTERNS_FOUND QtXmlPatterns)
-TEST_QT_MODULE(QT_QTMAEMO5_FOUND QtMaemo5)
-TEST_QT_MODULE(QT_QTSCRIPT_FOUND QtScript)
-TEST_QT_MODULE(QT_QTSCRIPTTOOLS_FOUND QtScriptTools)
-TEST_QT_MODULE(QT_QTMULTIMEDIA_FOUND QtMultimedia)
-TEST_QT_MODULE(QT_PHONON_FOUND phonon)
-TEST_QT_MODULE(QT_QTDECLARATIVE_FOUND QtDeclarative)
+ macro(TEST_QT_MODULE var name)
+ if(NOT DISABLE_${name} AND ${var})
+ add_subdirectory(${name})
+ endif()
+ endmacro(TEST_QT_MODULE)
+
+ macro(PYSIDE_TEST)
+ string(REGEX MATCH "/([^/]+)//?([^/]+)\\.py" foo "${CMAKE_CURRENT_SOURCE_DIR}/${ARGV0}" )
+ set(TEST_NAME "${CMAKE_MATCH_1}_${CMAKE_MATCH_2}")
+ if (${ARGC} EQUAL 1)
+ set(EXPECT_TO_FAIL 0)
+ elseif(${ARGC} EQUAL 2)
+ set(EXPECT_TO_FAIL ${ARGV1})
+ else()
+ message(WARNING "Ivalid call of macro PYSIDE_TEST")
+ endif()
+ set(TEST_CMD ${XVFB_EXEC} ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/${ARGV0}")
+ add_test(${TEST_NAME} ${TEST_CMD})
+ set_tests_properties(${TEST_NAME} PROPERTIES
+ TIMEOUT ${CTEST_TESTING_TIMEOUT}
+ WILL_FAIL ${EXPECT_TO_FAIL}
+ ENVIRONMENT "PYTHONPATH=${TEST_PYTHONPATH};${LIBRARY_PATH_VAR}=${TEST_LIBRARY_PATH}")
+ endmacro(PYSIDE_TEST)
+
+ # Try to find QtMultimedia
+ # TODO: Remove this hack when cmake support QtMultimedia module
+ if (NOT QT_QTMULTIMEDIA_FOUND AND ${QTVERSION} VERSION_GREATER 4.5.9)
+ find_path(QT_QTMULTIMEDIA_INCLUDE_DIR QtMultimedia
+ PATHS ${QT_HEADERS_DIR}/QtMultimedia
+ ${QT_LIBRARY_DIR}/QtMultimedia.framework/Headers
+ NO_DEFAULT_PATH)
+ find_library(QT_QTMULTIMEDIA_LIBRARY QtMultimedia PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ if (QT_QTMULTIMEDIA_INCLUDE_DIR AND QT_QTMULTIMEDIA_LIBRARY)
+ set(QT_QTMULTIMEDIA_FOUND ON)
+ endif()
+ endif ()
+
+ add_subdirectory(signals)
+ TEST_QT_MODULE(QT_QTCORE_FOUND QtCore)
+ TEST_QT_MODULE(QT_QTGUI_FOUND QtGui)
+ TEST_QT_MODULE(QT_QTNETWORK_FOUND QtNetwork)
+ TEST_QT_MODULE(QT_QTWEBKIT_FOUND QtWebKit)
+ TEST_QT_MODULE(QT_QTSVG_FOUND QtSvg)
+ TEST_QT_MODULE(QT_QTXML_FOUND QtXml)
+ TEST_QT_MODULE(QT_QTTEST_FOUND QtTest)
+ TEST_QT_MODULE(QT_QTOPENGL_FOUND QtOpenGL)
+ TEST_QT_MODULE(QT_QTSQL_FOUND QtSql)
+ TEST_QT_MODULE(QT_QTUITOOLS_FOUND QtUiTools)
+ TEST_QT_MODULE(QT_QTHELP_FOUND QtHelp)
+ TEST_QT_MODULE(QT_QTXMLPATTERNS_FOUND QtXmlPatterns)
+ TEST_QT_MODULE(QT_QTMAEMO5_FOUND QtMaemo5)
+ TEST_QT_MODULE(QT_QTSCRIPT_FOUND QtScript)
+ TEST_QT_MODULE(QT_QTSCRIPTTOOLS_FOUND QtScriptTools)
+ TEST_QT_MODULE(QT_QTMULTIMEDIA_FOUND QtMultimedia)
+ TEST_QT_MODULE(QT_PHONON_FOUND phonon)
+ TEST_QT_MODULE(QT_QTDECLARATIVE_FOUND QtDeclarative)
+endif()
From 4c7979877a2808a98cc60e234b8f2a0dc51acd4b Mon Sep 17 00:00:00 2001
From: Matti Airas
Date: Fri, 20 Aug 2010 12:42:25 +0300
Subject: [PATCH 0142/1129] fixed the newsigslot documentation to use API 2
---
doc/newsigslot.rst | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/doc/newsigslot.rst b/doc/newsigslot.rst
index 15e9fca..99db7e0 100644
--- a/doc/newsigslot.rst
+++ b/doc/newsigslot.rst
@@ -91,15 +91,15 @@ Nothing better than examples to show how to use the new-style. Here you can find
import sys
from PySide import QtCore
- # define a new slot that receives a QString and has
+ # define a new slot that receives a string and has
# 'saySomeWords' as its name
- @QtCore.Slot(QtCore.QString)
+ @QtCore.Slot(str)
def saySomeWords(words):
print words
class Communicate(QtCore.QObject):
# create a new signal on the fly and name it 'speak'
- speak = QtCore.Signal(QtCore.QString)
+ speak = QtCore.Signal(str)
someone = Communicate()
# connect signal and slot
@@ -114,18 +114,18 @@ Nothing better than examples to show how to use the new-style. Here you can find
import sys
from PySide import QtCore
- # define a new slot that receives a C 'int' or a 'QString'
+ # define a new slot that receives a C 'int' or a 'str'
# and has 'saySomething' as its name
@QtCore.Slot(int)
- @QtCore.Slot(QtCore.QString)
+ @QtCore.Slot(str)
def saySomething(stuff):
print stuff
class Communicate(QtCore.QObject):
# create two new signals on the fly: one will handle
- # int type, the other will handle QStrings
+ # int type, the other will handle strings
speakNumber = QtCore.Signal(int)
- speakWord = QtCore.Signal(QtCore.QString)
+ speakWord = QtCore.Signal(str)
someone = Communicate()
# connect signal and slot properly
@@ -143,29 +143,29 @@ Nothing better than examples to show how to use the new-style. Here you can find
import sys
from PySide import QtCore
- # define a new slot that receives an C 'int' or a 'QString'
+ # define a new slot that receives an C 'int' or a 'str'
# and has 'saySomething' as its name
@QtCore.Slot(int)
- @QtCore.Slot(QtCore.QString)
+ @QtCore.Slot(str)
def saySomething(stuff):
print stuff
class Communicate(QtCore.QObject):
# create two new signals on the fly: one will handle
- # int type, the other will handle QStrings
- speak = QtCore.Signal((int,), (QtCore.QString,))
+ # int type, the other will handle strings
+ speak = QtCore.Signal((int,), (str,))
someone = Communicate()
# connect signal and slot. As 'int' is the default
- # we have to inform the QString when connecting the
+ # we have to specify the str when connecting the
# second signal
someone.speak.connect(saySomething)
- someone.speak[QtCore.QString].connect(saySomething)
+ someone.speak[str].connect(saySomething)
# emit 'speak' signal with different arguments.
- # we have to inform the QString as int is the default
+ # we have to specify the str as int is the default
someone.speak.emit(10)
- someone.speak[QtCore.QString].emit("Hello everybody!")
+ someone.speak[str].emit("Hello everybody!")
PyQt compatibility
From 7b9ec90b4dffee089d3b1cbcbe5b933b3aa91c9b Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Fri, 20 Aug 2010 10:48:06 -0300
Subject: [PATCH 0143/1129] Fixed QtScriptTools CMake file and others files.
Reviewer: Luciano Wolf
Hugo Parente Lima
---
PySide/QtNetwork/CMakeLists.txt | 13 -------
PySide/QtScriptTools/CMakeLists.txt | 59 +++++++++++++----------------
PySide/QtSvg/CMakeLists.txt | 12 ------
PySide/QtTest/CMakeLists.txt | 12 ------
PySide/QtWebKit/CMakeLists.txt | 12 ------
5 files changed, 27 insertions(+), 81 deletions(-)
diff --git a/PySide/QtNetwork/CMakeLists.txt b/PySide/QtNetwork/CMakeLists.txt
index df3c129..1550499 100644
--- a/PySide/QtNetwork/CMakeLists.txt
+++ b/PySide/QtNetwork/CMakeLists.txt
@@ -34,19 +34,6 @@ macro(CHECK_QT_NETWORK_MACRO macro_display_name qt_macro module_sources global_s
endmacro(CHECK_QT_NETWORK_MACRO)
-if(Q_WS_X11)
- set(MODULE_NAME network_x11)
- set(SPECIFIC_OS_FILES
- )
-
-elseif(Q_WS_MAC)
- set(MODULE_NAME network_mac)
- set(SPECIFIC_OS_FILES
- )
-else()
- message(FATAL_ERROR "OS not supported")
-endif(Q_WS_X11)
-
if (${QT_VERSION_MAJOR} EQUAL 4 AND ${QT_VERSION_MINOR} GREATER 6)
set (QtNetwork_47_SRC
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qnetworkconfiguration_wrapper.cpp
diff --git a/PySide/QtScriptTools/CMakeLists.txt b/PySide/QtScriptTools/CMakeLists.txt
index 22860b1..39faee4 100644
--- a/PySide/QtScriptTools/CMakeLists.txt
+++ b/PySide/QtScriptTools/CMakeLists.txt
@@ -5,38 +5,33 @@ set(QtScriptTools_SRC
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtScriptTools/qscriptenginedebugger_wrapper.cpp
)
-execute_generator(scripttools QtScriptTools_SRC "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtGui_BINARY_DIR}:${QtScript_SOURCE_DIR}:${QtScriptTools_SOURCE_DIR}")
+set(QtScriptTools_typesystem_path "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtGui_BINARY_DIR}:${QtScript_SOURCE_DIR}:${QtScriptTools_SOURCE_DIR}")
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}
- ${QT_QTCORE_INCLUDE_DIR}
- ${QT_GUI_INCLUDE_DIR}
- ${QT_QTSCRIPT_INCLUDE_DIR}
- ${QT_QTSCRIPTTOOLS_INCLUDE_DIR}
- ${PYTHON_INCLUDE_PATH}
- ${SHIBOKEN_INCLUDE_DIR}
- ${libpyside_SOURCE_DIR}
- ${QtCore_BINARY_DIR}/PySide/QtCore/
- ${QtGui_BINARY_DIR}/PySide/QtGui/
- ${QtScript_BINARY_DIR}/PySide/QtScript/
- ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtScriptTools)
+set(QtScriptTools_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
+ ${QT_QTCORE_INCLUDE_DIR}
+ ${QT_GUI_INCLUDE_DIR}
+ ${QT_QTSCRIPT_INCLUDE_DIR}
+ ${QT_QTSCRIPTTOOLS_INCLUDE_DIR}
+ ${PYTHON_INCLUDE_PATH}
+ ${SHIBOKEN_INCLUDE_DIR}
+ ${libpyside_SOURCE_DIR}
+ ${QtCore_BINARY_DIR}/PySide/QtCore/
+ ${QtGui_BINARY_DIR}/PySide/QtGui/
+ ${QtScript_BINARY_DIR}/PySide/QtScript/
+ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtScriptTools)
-add_library(QtScriptTools MODULE ${QtScriptTools_SRC})
-set_target_properties(QtScriptTools PROPERTIES PREFIX "")
-target_link_libraries(QtScriptTools
- pyside
- ${PYSIDE_PYTHON_LIBRARIES}
- ${QT_QTCORE_LIBRARY}
- ${QT_GUI_LIBRARY}
- ${QT_QTSCRIPT_LIBRARY}
- ${QT_QTSCRIPTTOOLS_LIBRARY})
-
-add_dependencies(QtScriptTools QtCore QtScript QtGui)
-
-# install
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/QtScriptTools${CMAKE_DEBUG_POSTFIX}.so
- DESTINATION ${SITE_PACKAGE}/PySide)
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtScriptTools/pyside_qtscripttools_python.h
- DESTINATION include/PySide/QtScriptTools/)
-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_scripttools.xml
- DESTINATION share/PySide/typesystems)
+set(QtScriptTools_libraries pyside
+ ${PYSIDE_PYTHON_LIBRARIES}
+ ${QT_QTCORE_LIBRARY}
+ ${QT_GUI_LIBRARY}
+ ${QT_QTSCRIPT_LIBRARY}
+ ${QT_QTSCRIPTTOOLS_LIBRARY})
+set(QtScriptTools_deps QtCore QtScript QtGui)
+create_pyside_module(QtScriptTools
+ ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_scripttools.xml
+ QtScriptTools_include_dirs
+ QtScriptTools_libraries
+ QtScriptTools_deps
+ QtScriptTools_typesystem_path
+ QtScriptTools_SRC)
diff --git a/PySide/QtSvg/CMakeLists.txt b/PySide/QtSvg/CMakeLists.txt
index 4119512..a56ee33 100644
--- a/PySide/QtSvg/CMakeLists.txt
+++ b/PySide/QtSvg/CMakeLists.txt
@@ -1,17 +1,5 @@
project(QtSvg)
-if(Q_WS_X11)
- set(MODULE_NAME svg_x11)
- set(SPECIFIC_OS_FILES
- )
-elseif(Q_WS_MAC)
- set(MODULE_NAME svg_mac)
- set(SPECIFIC_OS_FILES
- )
-else()
- message(FATAL_ERROR "OS not supported")
-endif(Q_WS_X11)
-
if (${QT_VERSION_MAJOR} EQUAL 4 AND ${QT_VERSION_MINOR} LESS 6)
set (QtSvg_46_SRC )
else ()
diff --git a/PySide/QtTest/CMakeLists.txt b/PySide/QtTest/CMakeLists.txt
index def84db..4bf0bca 100644
--- a/PySide/QtTest/CMakeLists.txt
+++ b/PySide/QtTest/CMakeLists.txt
@@ -1,17 +1,5 @@
project(QtTest)
-if(Q_WS_X11)
- set(MODULE_NAME test_x11)
- set(SPECIFIC_OS_FILES
- )
-elseif(Q_WS_MAC)
- set(MODULE_NAME test_mac)
- set(SPECIFIC_OS_FILES
- )
-else()
- message(FATAL_ERROR "OS not supported")
-endif(Q_WS_X11)
-
set(QtTest_SRC
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtTest/qtest_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtTest/qttest_module_wrapper.cpp
diff --git a/PySide/QtWebKit/CMakeLists.txt b/PySide/QtWebKit/CMakeLists.txt
index 08e20be..9039835 100644
--- a/PySide/QtWebKit/CMakeLists.txt
+++ b/PySide/QtWebKit/CMakeLists.txt
@@ -1,17 +1,5 @@
project(QtWebKit)
-if(Q_WS_X11)
- set(MODULE_NAME webkit_x11)
- set(SPECIFIC_OS_FILES
- )
-elseif(Q_WS_MAC)
- set(MODULE_NAME webkit_mac)
- set(SPECIFIC_OS_FILES
- )
-else()
- message(FATAL_ERROR "OS not supported")
-endif(Q_WS_X11)
-
if (${QT_VERSION_MAJOR} EQUAL 4 AND ${QT_VERSION_MINOR} LESS 6)
set (QtWebKit_46_SRC )
else ()
From 2bdba4680c7ead9b3488a0dc01bf0945ae57c3a8 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Fri, 20 Aug 2010 11:33:28 -0300
Subject: [PATCH 0144/1129] Fixed libshiboken classes visibility.
Reviewer: Luciano Wolf
Hugo Parente Lima
---
libpyside/qsignal.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/libpyside/qsignal.h b/libpyside/qsignal.h
index b208343..fe4d5ff 100644
--- a/libpyside/qsignal.h
+++ b/libpyside/qsignal.h
@@ -53,11 +53,11 @@ typedef struct {
extern "C"
{
- PyAPI_DATA(PyTypeObject) Signal_Type;
- PyAPI_DATA(PyTypeObject) SignalInstance_Type;
+ extern PYSIDE_API PyTypeObject Signal_Type;
+ extern PYSIDE_API PyTypeObject SignalInstance_Type;
}; //extern "C"
-PYSIDE_API PyAPI_FUNC(PyObject*) signalNew(const char* name, ...);
+PYSIDE_API PyObject* signalNew(const char* name, ...);
PYSIDE_API void signalUpdateSource(PyObject* source);
PYSIDE_API bool signal_connect(PyObject* source, const char* signal, PyObject* callback);
From 7b9a4707ce9f178bb3122444b16d7ad1e05a515c Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Fri, 20 Aug 2010 13:20:34 -0300
Subject: [PATCH 0145/1129] Fixed typesystem for windows.
Reviewer: Luciano Wolf
Hugo Parente Lima
---
PySide/QtCore/typesystem_core.xml | 1 +
PySide/QtGui/CMakeLists.txt | 4 ++++
PySide/QtGui/typesystem_gui_win.xml | 6 ++++++
libpyside/qproperty.h | 2 +-
4 files changed, 12 insertions(+), 1 deletion(-)
create mode 100644 PySide/QtGui/typesystem_gui_win.xml
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 571cc91..c377c7f 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -36,6 +36,7 @@
+
diff --git a/PySide/QtGui/CMakeLists.txt b/PySide/QtGui/CMakeLists.txt
index 18ce256..9d2b897 100644
--- a/PySide/QtGui/CMakeLists.txt
+++ b/PySide/QtGui/CMakeLists.txt
@@ -52,6 +52,10 @@ elseif(ENABLE_MAC)
set(MODULE_NAME "mac")
set(SPECIFIC_OS_FILES
)
+elseif(ENABLE_WIN)
+ set(MODULE_NAME "win")
+ set(SPECIFIC_OS_FILES
+ )
endif(ENABLE_X11)
diff --git a/PySide/QtGui/typesystem_gui_win.xml b/PySide/QtGui/typesystem_gui_win.xml
new file mode 100644
index 0000000..0dfb504
--- /dev/null
+++ b/PySide/QtGui/typesystem_gui_win.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/libpyside/qproperty.h b/libpyside/qproperty.h
index 7e0e1bc..f561d47 100644
--- a/libpyside/qproperty.h
+++ b/libpyside/qproperty.h
@@ -44,7 +44,7 @@ namespace PySide
extern "C"
{
- PyAPI_DATA(PyTypeObject) QProperty_Type;
+ extern PYSIDE_API PyTypeObject QProperty_Type;
}; //extern "C"
PYSIDE_API bool isQPropertyType(PyObject* pyObj);
From af8bf30d0636285c7f3f4fb957b8d368d7ff596c Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Fri, 20 Aug 2010 13:36:02 -0300
Subject: [PATCH 0146/1129] Changed output dir for python modules to make the
tests run in others platafforms.
Reviewer: Luciano Wolf
Hugo Parente Lima
---
PySide/CMakeLists.txt | 10 ++++------
PySide/QtCore/typesystem_core.xml | 1 -
2 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/PySide/CMakeLists.txt b/PySide/CMakeLists.txt
index 25f267e..3e42c3c 100644
--- a/PySide/CMakeLists.txt
+++ b/PySide/CMakeLists.txt
@@ -21,7 +21,7 @@ macro(create_pyside_module module_name typesystem_file module_include_dir module
include_directories(${module_name} ${${module_include_dir}})
add_library(${module_name} MODULE ${${module_sources}})
- set_target_properties(${module_name} PROPERTIES PREFIX "")
+ set_target_properties(${module_name} PROPERTIES PREFIX "" LIBRARY_OUTPUT_DIRECTORY ${pyside_BINARY_DIR})
if(WIN32)
set_target_properties(${module_name} PROPERTIES SUFFIX ".pyd")
endif()
@@ -31,7 +31,7 @@ macro(create_pyside_module module_name typesystem_file module_include_dir module
endif()
# install
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${module_name}${CMAKE_DEBUG_POSTFIX}.so
+ install(FILES ${pyside_BINARY_DIR}/${module_name}${CMAKE_DEBUG_POSTFIX}.so
DESTINATION ${SITE_PACKAGE}/PySide)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/${module_name}/pyside_${module_name}_python.h
DESTINATION include/PySide/${module_name}/)
@@ -52,16 +52,14 @@ if (DISABLE_${name})
else()
if (${var})
add_subdirectory(${name})
- execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink "${CMAKE_CURRENT_BINARY_DIR}/${name}/${name}${CMAKE_DEBUG_POSTFIX}${CMAKE_SHARED_MODULE_SUFFIX}"
- "${CMAKE_BINARY_DIR}/PySide/${name}${CMAKE_SHARED_MODULE_SUFFIX}")
else()
message(STATUS "${name} NOT found. ${name} support disabled.")
endif()
endif()
endmacro(HAS_QT_MODULE)
-execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink "${CMAKE_CURRENT_SOURCE_DIR}/__init__.py"
- "${CMAKE_BINARY_DIR}/PySide/__init__.py")
+execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/__init__.py"
+ "${CMAKE_BINARY_DIR}/PySide/__init__.py")
# Try to find QtMultimedia
# TODO: Remove this hack when cmake support QtMultimedia module
if (NOT QT_QTMULTIMEDIA_FOUND AND ${QTVERSION} VERSION_GREATER 4.5.9)
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index c377c7f..571cc91 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -36,7 +36,6 @@
-
From 35a5bad950bfa5082268a0f52be4d6e310678f8f Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Fri, 20 Aug 2010 14:43:18 -0300
Subject: [PATCH 0147/1129] Fixed typestyste to windows.
Reviewer: Luciano Wolf
Hugo Parente Lima
---
PySide/QtCore/typesystem_core.xml | 7 ++-----
PySide/QtGui/typesystem_gui_win.xml | 2 +-
PySide/global.h.in | 2 +-
3 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 571cc91..f1c4cf2 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -128,13 +128,10 @@
-
-
-
-
-
+
+
diff --git a/PySide/QtGui/typesystem_gui_win.xml b/PySide/QtGui/typesystem_gui_win.xml
index 0dfb504..f44d3d4 100644
--- a/PySide/QtGui/typesystem_gui_win.xml
+++ b/PySide/QtGui/typesystem_gui_win.xml
@@ -1,6 +1,6 @@
-
+
diff --git a/PySide/global.h.in b/PySide/global.h.in
index c9c8ba8..cf21bd6 100644
--- a/PySide/global.h.in
+++ b/PySide/global.h.in
@@ -345,7 +345,7 @@ QT_END_HEADER
#define QT_NO_DEBUG
#include
-#if @ENABLE_MAC@
+#if @ENABLE_MAC@ || @ENABLE_WIN@
#undef qdoc
#endif
#include
From 0576d04403cd02e08bc6c8d71c30f4abc186f95e Mon Sep 17 00:00:00 2001
From: Lauro Neto
Date: Fri, 20 Aug 2010 14:22:39 -0300
Subject: [PATCH 0148/1129] Fix install command to correct module name.
Reviewer: Luciano Wolf
Hugo Parente Lima
---
PySide/CMakeLists.txt | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/PySide/CMakeLists.txt b/PySide/CMakeLists.txt
index 3e42c3c..8f50ed4 100644
--- a/PySide/CMakeLists.txt
+++ b/PySide/CMakeLists.txt
@@ -33,7 +33,8 @@ macro(create_pyside_module module_name typesystem_file module_include_dir module
# install
install(FILES ${pyside_BINARY_DIR}/${module_name}${CMAKE_DEBUG_POSTFIX}.so
DESTINATION ${SITE_PACKAGE}/PySide)
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/${module_name}/pyside_${module_name}_python.h
+ string(TOLOWER ${module_name} lower_module_name)
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/${module_name}/pyside_${lower_module_name}_python.h
DESTINATION include/PySide/${module_name}/)
install(FILES ${typesystem_file}
DESTINATION share/PySide/typesystems)
From 662800956b935bf344dfb8cbfb47f2c3b5717aec Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Fri, 20 Aug 2010 16:37:41 -0300
Subject: [PATCH 0149/1129] Use AutoPointerArray to dynamic array creation.
Reviewer: Luciano Wolf
Hugo Parente Lima
---
PySide/QtCore/typesystem_core.xml | 6 ++-
PySide/QtGui/typesystem_gui_common.xml | 9 ++--
libpyside/autoarraypointer.h | 58 ++++++++++++++++++++++++++
3 files changed, 68 insertions(+), 5 deletions(-)
create mode 100644 libpyside/autoarraypointer.h
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index f1c4cf2..1e371f0 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -127,10 +127,12 @@
-
-
+
+
+
+
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index 1110964..80122c2 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -2587,7 +2587,10 @@
-
+
+
+
+
@@ -2599,7 +2602,7 @@
int numItems = PySequence_Size(%PYARG_1);
- QGraphicsItem *%out[numItems];
+ PySide::AutoArrayPointer<QGraphicsItem*> %out(numItems);
for (int i=0; i < numItems; i++) {
%out[i] = %CONVERTTOCPP[QGraphicsItem*](PySequence_Fast_GET_ITEM(%PYARG_1, i));
}
@@ -2626,7 +2629,7 @@
int numOptions = PySequence_Size(%PYARG_2);
- QStyleOptionGraphicsItem %out[numOptions];
+ PySide::AutoArrayPointer<QStyleOptionGraphicsItem> %out(numOptions);
for (int i=0; i < numOptions; i++) {
%out[i] = %CONVERTTOCPP[QStyleOptionGraphicsItem](PySequence_Fast_GET_ITEM(%PYARG_1, i));
}
diff --git a/libpyside/autoarraypointer.h b/libpyside/autoarraypointer.h
new file mode 100644
index 0000000..433401c
--- /dev/null
+++ b/libpyside/autoarraypointer.h
@@ -0,0 +1,58 @@
+/*
+ * This file is part of the Shiboken Python Bindings Generator project.
+ *
+ * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * Contact: PySide team
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation. Please
+ * review the following information to ensure the GNU Lesser General
+ * Public License version 2.1 requirements will be met:
+ * http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ *
+ * As a special exception to the GNU Lesser General Public License
+ * version 2.1, the object code form of a "work that uses the Library"
+ * may incorporate material from a header file that is part of the
+ * Library. You may distribute such object code under terms of your
+ * choice, provided that the incorporated material (i) does not exceed
+ * more than 5% of the total size of the Library; and (ii) is limited to
+ * numerical parameters, data structure layouts, accessors, macros,
+ * inline functions and templates.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#ifndef AUTOARRAYPOINTER_H
+#define AUTOARRAYPOINTER_H
+
+
+namespace PySide
+{
+
+template
+class AutoArrayPointer
+{
+ public:
+ AutoArrayPointer(int size) { data = new T[size]; }
+ T& operator[](int pos) { return data[pos]; }
+ operator T*() const { return data; }
+ ~AutoArrayPointer() { delete[] data; }
+ private:
+ T* data;
+};
+
+} //namespace PySide
+
+
+#endif // AUTOARRAYPOINTER_H
+
From 5a06e6f135aae65e314ab4c2002a5923e221a8ac Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Fri, 20 Aug 2010 17:25:30 -0300
Subject: [PATCH 0150/1129] Fixed QtNetwork typesystem to work on windows.
Reviewer: Luciano Wolf
Hugo Parente Lima
---
.../glue/qudpsocket_read_datagram_glue.cpp | 2 +-
PySide/QtNetwork/typesystem_network.xml | 13 +++++++++++++
PySide/typesystem_templates.xml | 2 +-
3 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/PySide/QtNetwork/glue/qudpsocket_read_datagram_glue.cpp b/PySide/QtNetwork/glue/qudpsocket_read_datagram_glue.cpp
index 95ece51..db38f45 100644
--- a/PySide/QtNetwork/glue/qudpsocket_read_datagram_glue.cpp
+++ b/PySide/QtNetwork/glue/qudpsocket_read_datagram_glue.cpp
@@ -1,4 +1,4 @@
- char data[%ARGUMENT_NAMES];
+ PySide::AutoArrayPointer data(%ARGUMENT_NAMES);
QHostAddress ha;
quint16 port;
diff --git a/PySide/QtNetwork/typesystem_network.xml b/PySide/QtNetwork/typesystem_network.xml
index 9a56b74..80a62a4 100644
--- a/PySide/QtNetwork/typesystem_network.xml
+++ b/PySide/QtNetwork/typesystem_network.xml
@@ -10,6 +10,7 @@
+
@@ -53,6 +54,10 @@
+
+
+
+
@@ -81,6 +86,10 @@
+
+
+
+
@@ -115,6 +124,10 @@
+
+
+
+
diff --git a/PySide/typesystem_templates.xml b/PySide/typesystem_templates.xml
index 1de06a1..b8c43ee 100644
--- a/PySide/typesystem_templates.xml
+++ b/PySide/typesystem_templates.xml
@@ -121,7 +121,7 @@
%PYARG_0 = Shiboken::makeTuple(a, b, c, d, e);
- char _data[%2];
+ PySide::AutoArrayPointer<char> _data(%2);
qint64 _size = %CPPSELF.%FUNCTION_NAME(_data, %2);
if (_size > 0)
%PYARG_0 = %CONVERTTOPYTHON[QByteArray](QByteArray(_data, _size));
From d39b10d9ae0426e06d9117e78e4172a645916000 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Fri, 20 Aug 2010 18:08:24 -0300
Subject: [PATCH 0151/1129] Fixed Cmake for test on windows. Fixed install
modules on windows.
Reviewer: Luciano Wolf
Hugo Parente Lima
---
PySide/CMakeLists.txt | 6 +++++-
tests/CMakeLists.txt | 4 ++--
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/PySide/CMakeLists.txt b/PySide/CMakeLists.txt
index 8f50ed4..10e0bc7 100644
--- a/PySide/CMakeLists.txt
+++ b/PySide/CMakeLists.txt
@@ -24,14 +24,18 @@ macro(create_pyside_module module_name typesystem_file module_include_dir module
set_target_properties(${module_name} PROPERTIES PREFIX "" LIBRARY_OUTPUT_DIRECTORY ${pyside_BINARY_DIR})
if(WIN32)
set_target_properties(${module_name} PROPERTIES SUFFIX ".pyd")
+ set(${module_name}_suffix ".pyd")
+ else()
+ set(${module_name}_suffix ".so")
endif()
target_link_libraries(${module_name} ${${module_libraries}})
if(${module_deps})
add_dependencies(${module_name} ${${module_deps}})
endif()
+
# install
- install(FILES ${pyside_BINARY_DIR}/${module_name}${CMAKE_DEBUG_POSTFIX}.so
+ install(FILES ${pyside_BINARY_DIR}/${module_name}${CMAKE_DEBUG_POSTFIX}${${module_name}_suffix}
DESTINATION ${SITE_PACKAGE}/PySide)
string(TOLOWER ${module_name} lower_module_name)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/${module_name}/pyside_${lower_module_name}_python.h
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index fe4f7ec..ce45796 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -7,7 +7,7 @@ else()
if(WIN32)
set(TEST_PYTHONPATH "${CMAKE_BINARY_DIR};${CMAKE_SOURCE_DIR}/tests/util")
- set(TEST_LIBRARY_PATH "$ENV{PATH};${libpyside_BINARY_DIR}")
+ set(TEST_LIBRARY_PATH "${libpyside_BINARY_DIR};$ENV{PATH}")
set(LIBRARY_PATH_VAR "PATH")
string(REPLACE "\\" "/" TEST_PYTHONPATH "${TEST_PYTHONPATH}")
string(REPLACE "\\" "/" TEST_LIBRARY_PATH "${TEST_LIBRARY_PATH}")
@@ -16,7 +16,7 @@ else()
string(REPLACE ";" "\\;" TEST_LIBRARY_PATH "${TEST_LIBRARY_PATH}")
else()
set(TEST_PYTHONPATH "${CMAKE_BINARY_DIR}:${CMAKE_SOURCE_DIR}/tests/util")
- set(TEST_LIBRARY_PATH "$ENV{LD_LIBRARY_PATH}:${libpyside_BINARY_DIR}")
+ set(TEST_LIBRARY_PATH "${libpyside_BINARY_DIR}:$ENV{LD_LIBRARY_PATH}")
set(LIBRARY_PATH_VAR "LD_LIBRARY_PATH")
endif()
From 4dd52c399630cfaa6c1a660f4883478add0ce43b Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Fri, 20 Aug 2010 18:26:22 -0300
Subject: [PATCH 0152/1129] Changed test to avoid erros on slow machines.
Reviewer: Luciano Wolf
Hugo Parente Lima
---
tests/signals/ref05_test.py | 2 +-
tests/signals/ref06_test.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/signals/ref05_test.py b/tests/signals/ref05_test.py
index 7c53300..90766aa 100644
--- a/tests/signals/ref05_test.py
+++ b/tests/signals/ref05_test.py
@@ -38,7 +38,7 @@ class UserSlotTest(UsesQCoreApplication):
self.app.exec_()
- self.assertEqual(self.receiver.counter, 10)
+ self.assert_(self.receiver.counter > 1)
if __name__ == '__main__':
diff --git a/tests/signals/ref06_test.py b/tests/signals/ref06_test.py
index 05712b3..ef7098d 100644
--- a/tests/signals/ref06_test.py
+++ b/tests/signals/ref06_test.py
@@ -41,7 +41,7 @@ class SignaltoSignalTest(UsesQCoreApplication):
self.app.exec_()
- self.assertEqual(self.receiver.counter, 10)
+ self.assert_(self.receiver.counter > 1)
if __name__ == '__main__':
From e0fc2c6517981c1a03952eb4d039bd122a8e617d Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Fri, 20 Aug 2010 18:34:06 -0300
Subject: [PATCH 0153/1129] Fixed use of QFile to works on all plataforms.
Reviewer: Luciano Wolf
Hugo Parente Lima
---
tests/QtCore/qflags_test.py | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/tests/QtCore/qflags_test.py b/tests/QtCore/qflags_test.py
index 1346c11..8b3a488 100644
--- a/tests/QtCore/qflags_test.py
+++ b/tests/QtCore/qflags_test.py
@@ -2,13 +2,18 @@
'''Test cases for QFlags'''
import unittest
-from PySide.QtCore import QIODevice, Qt, QFile
+from PySide.QtCore import QIODevice, Qt, QFile, QTemporaryFile
class QFlagTest(unittest.TestCase):
'''Test case for usage of flags'''
def testCallFunction(self):
- f = QFile("/tmp/t0");
+ f = QTemporaryFile()
+ self.assert_(f.open())
+ fileName = f.fileName()
+ f.close()
+
+ f = QFile(fileName)
self.assertEqual(f.open(QIODevice.Truncate | QIODevice.Text | QIODevice.ReadWrite), True)
om = f.openMode()
self.assertEqual(om & QIODevice.Truncate, QIODevice.Truncate)
From 3cc4a66f2ec23757d11e296ebe755d8c2b72d43d Mon Sep 17 00:00:00 2001
From: Lauro Neto
Date: Mon, 23 Aug 2010 10:18:55 -0300
Subject: [PATCH 0154/1129] Fix variable name.
---
PySide/phonon/CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/PySide/phonon/CMakeLists.txt b/PySide/phonon/CMakeLists.txt
index 062f17d..a7a870f 100644
--- a/PySide/phonon/CMakeLists.txt
+++ b/PySide/phonon/CMakeLists.txt
@@ -65,6 +65,6 @@ create_pyside_module(phonon
"typesystem_phonon.xml"
phonon_include_dirs
phonon_libraries
- phonon_depend
+ phonon_deps
phonon_typesystem_path
phonon_SRC)
From 74e87b6728286b61560fe636a3ab66c746805630 Mon Sep 17 00:00:00 2001
From: Lauro Neto
Date: Mon, 23 Aug 2010 15:37:32 -0300
Subject: [PATCH 0155/1129] Add function qtTrId
Reviewer: Luciano Wolf
Reviewer: Renato Filho
---
PySide/QtCore/typesystem_core.xml | 1 +
1 file changed, 1 insertion(+)
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 1e371f0..dfc74c2 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -22,6 +22,7 @@
+
From f05cca8aae3211c2691e47c0740fc87ba988822b Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Tue, 24 Aug 2010 16:23:46 -0300
Subject: [PATCH 0156/1129] Write the pyside version variable on cmake cache.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
With the pyside version variable on cmake cache, the script used to
create the windows installer can discover the PySide version being
compiled.
Reviewer: Luciano Wolf
Renato Araújo
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 06b729e..3f5dc7e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -64,7 +64,7 @@ set(BINDING_NAME PySide)
set(BINDING_API_MAJOR_VERSION "0")
set(BINDING_API_MINOR_VERSION "4")
set(BINDING_API_MICRO_VERSION "1")
-set(BINDING_API_VERSION "${BINDING_API_MAJOR_VERSION}.${BINDING_API_MINOR_VERSION}.${BINDING_API_MICRO_VERSION}")
+set(BINDING_API_VERSION "${BINDING_API_MAJOR_VERSION}.${BINDING_API_MINOR_VERSION}.${BINDING_API_MICRO_VERSION}" CACHE STRING "PySide version" FORCE)
include(${QT_USE_FILE})
if (${QTVERSION} VERSION_LESS 4.5.0)
From 20e226bc663e88849cd269043ebc9b7e223d5c10 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Wed, 25 Aug 2010 12:08:03 -0300
Subject: [PATCH 0157/1129] Fix bug#303 - "Missing method:
QCoreApplication.arguments()"
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Reviewer: Luciano Wolf
Renato Araújo
---
PySide/QtCore/typesystem_core.xml | 1 -
1 file changed, 1 deletion(-)
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index dfc74c2..5355bf8 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -1807,7 +1807,6 @@
-
From 49ac670cfc106cccef0fac0681a92ea6db413a75 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Tue, 24 Aug 2010 17:11:55 -0300
Subject: [PATCH 0158/1129] Avoid cyclic dependency on test.
Reviewer: Luciano Wolf
Hugo Parente Lima
---
tests/signals/lambda_gui_test.py | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
diff --git a/tests/signals/lambda_gui_test.py b/tests/signals/lambda_gui_test.py
index e842ae2..ba10590 100644
--- a/tests/signals/lambda_gui_test.py
+++ b/tests/signals/lambda_gui_test.py
@@ -14,24 +14,33 @@ except ImportError:
from helper import UsesQApplication
if hasQtGui:
+ class Control:
+ def __init__(self):
+ self.arg = False
+
class QtGuiSigLambda(UsesQApplication):
def testButton(self):
#Connecting a lambda to a QPushButton.clicked()
obj = QPushButton('label')
- QObject.connect(obj, SIGNAL('clicked()'),
- lambda: setattr(obj, 'called', True))
+ ctr = Control()
+ func = lambda: setattr(ctr, 'arg', True)
+ QObject.connect(obj, SIGNAL('clicked()'), func)
obj.click()
- self.assert_(obj.called)
+ self.assert_(ctr.arg)
+ QObject.disconnect(obj, SIGNAL('clicked()'), func)
+
def testSpinButton(self):
#Connecting a lambda to a QPushButton.clicked()
obj = QSpinBox()
+ ctr = Control()
arg = 444
- QObject.connect(obj, SIGNAL('valueChanged(int)'),
- lambda x: setattr(obj, 'arg', 444))
+ func = lambda x: setattr(ctr, 'arg', 444)
+ QObject.connect(obj, SIGNAL('valueChanged(int)'), func)
obj.setValue(444)
- self.assertEqual(obj.arg, arg)
+ self.assertEqual(ctr.arg, arg)
+ QObject.disconnect(obj, SIGNAL('valueChanged(int)'), func)
if __name__ == '__main__':
unittest.main()
From 42d98f91c49774227b89373e44f0f6de20605c52 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Tue, 24 Aug 2010 17:14:40 -0300
Subject: [PATCH 0159/1129] Fixed Qt application cleanup.
Reviewer: Luciano Wolf
Hugo Parente Lima
---
PySide/QtCore/glue/qcoreapplication_init.cpp | 35 ++++++++++++++------
PySide/QtCore/typesystem_core.xml | 15 +++++++--
PySide/QtGui/glue/qapplication_init.cpp | 32 ++++++++++++------
PySide/QtGui/typesystem_gui_common.xml | 2 +-
4 files changed, 60 insertions(+), 24 deletions(-)
diff --git a/PySide/QtCore/glue/qcoreapplication_init.cpp b/PySide/QtCore/glue/qcoreapplication_init.cpp
index 5fcd79a..7601dbd 100644
--- a/PySide/QtCore/glue/qcoreapplication_init.cpp
+++ b/PySide/QtCore/glue/qcoreapplication_init.cpp
@@ -1,21 +1,30 @@
// Global variables used to store argc and argv values
static int QCoreApplicationArgCount;
static char** QCoreApplicationArgValues;
+static bool leavingPython = false;
/**
* Called at QtCore module exit
*/
-void DeleteQCoreApplicationAtExit() {
- if (QCoreApplication::instance()) {
- BindingManager::instance().invalidateWrapper(QCoreApplication::instance());
- QCoreApplication::instance()->deleteLater();
- for (int i = 0; i < QCoreApplicationArgCount; ++i)
- delete[] QCoreApplicationArgValues[i];
+void DeleteQCoreApplicationAtExit()
+{
+ leavingPython = true;
+ QCoreApplication *cpp = QCoreApplication::instance();
+ if (cpp) {
+ Shiboken::BindingManager &bmngr = Shiboken::BindingManager::instance();
+ PyObject* pySelf = bmngr.retrieveWrapper(cpp);
+ if (pySelf)
+ bmngr.invalidateWrapper(pySelf);
+ cpp->deleteLater();
}
}
int SbkQCoreApplication_Init(PyObject* self, PyObject* args, PyObject*)
{
+ if (Shiboken::isUserType(self) && !Shiboken::canCallConstructor(self->ob_type, Shiboken::SbkType()))
+ return -1;
+
+
if (QCoreApplication::instance()) {
PyErr_SetString(PyExc_RuntimeError, "A QCoreApplication instance already exists.");
return -1;
@@ -32,14 +41,20 @@ int SbkQCoreApplication_Init(PyObject* self, PyObject* args, PyObject*)
return -1;
}
- void* cptr = new QCoreApplication(QCoreApplicationArgCount, QCoreApplicationArgValues);
+ QCoreApplicationWrapper* cptr = new QCoreApplicationWrapper(QCoreApplicationArgCount, QCoreApplicationArgValues);
Shiboken::setCppPointer(reinterpret_cast(self),
Shiboken::SbkType(),
cptr);
- SbkBaseWrapper_setValidCppObject(self, 1);
- Shiboken::BindingManager::instance().registerWrapper(reinterpret_cast(self), cptr);
- Py_INCREF(self);
+ SbkBaseWrapper_setValidCppObject(self, 1);
+ SbkBaseWrapper *sbkSelf = reinterpret_cast(self);
+ sbkSelf->containsCppWrapper = 1;
+ sbkSelf->hasOwnership = 0;
+ Shiboken::BindingManager::instance().registerWrapper(sbkSelf, cptr);
+ PySide::signalUpdateSource(self);
+ cptr->metaObject();
+
Py_AtExit(DeleteQCoreApplicationAtExit);
+ Py_INCREF(self);
return 1;
}
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 5355bf8..2699128 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -1762,6 +1762,7 @@
+
@@ -1786,16 +1787,26 @@
+
+
+
+
+
-
+
+
+ Shiboken::ThreadStateSaver threadStateSaver;
+ if (!leavingPython)
+ threadStateSaver.save();
+
-
+
diff --git a/PySide/QtGui/glue/qapplication_init.cpp b/PySide/QtGui/glue/qapplication_init.cpp
index da9e2dc..afbd304 100644
--- a/PySide/QtGui/glue/qapplication_init.cpp
+++ b/PySide/QtGui/glue/qapplication_init.cpp
@@ -3,18 +3,25 @@ extern PyObject* moduleQtGui;
static int QApplicationArgCount;
static char** QApplicationArgValues;
+static const char QAPP_MACRO[] = "qApp";
void DeleteQApplicationAtExit() {
- if (QApplication::instance()) {
- BindingManager::instance().invalidateWrapper(QApplication::instance());
- QApplication::instance()->deleteLater();
- for (int i = 0; i < QApplicationArgCount; ++i)
- delete[] QApplicationArgValues[i];
+ PySide::SignalManager::instance().clear();
+ QCoreApplication* cpp = QApplication::instance();
+ if (cpp) {
+ Shiboken::BindingManager &bmngr = Shiboken::BindingManager::instance();
+ PyObject* pySelf = bmngr.retrieveWrapper(cpp);
+ if (pySelf)
+ bmngr.invalidateWrapper(pySelf);
+ cpp->deleteLater();
}
}
int SbkQApplication_Init(PyObject* self, PyObject* args, PyObject*)
{
+ if (Shiboken::isUserType(self) && !Shiboken::canCallConstructor(self->ob_type, Shiboken::SbkType()))
+ return -1;
+
if (QApplication::instance()) {
PyErr_SetString(PyExc_RuntimeError, "A QApplication instance already exists.");
return -1;
@@ -31,25 +38,28 @@ int SbkQApplication_Init(PyObject* self, PyObject* args, PyObject*)
return -1;
}
- void* cptr = new QApplication(QApplicationArgCount, QApplicationArgValues);
+ QApplicationWrapper* cptr = new QApplicationWrapper(QApplicationArgCount, QApplicationArgValues);
Shiboken::setCppPointer(reinterpret_cast(self),
Shiboken::SbkType(),
cptr);
SbkBaseWrapper_setValidCppObject(self, 1);
- Shiboken::BindingManager::instance().registerWrapper(reinterpret_cast(self), cptr);
+ SbkBaseWrapper *sbkSelf = reinterpret_cast(self);
+ sbkSelf->containsCppWrapper = 1;
+ sbkSelf->hasOwnership = 0;
+ Shiboken::BindingManager::instance().registerWrapper(sbkSelf, cptr);
+ PySide::signalUpdateSource(self);
+ cptr->metaObject();
// Verify if qApp is in main module
- const char QAPP_MACRO[] = "qApp";
PyObject* globalsDict = PyEval_GetGlobals();
if (globalsDict) {
PyObject* qAppObj = PyDict_GetItemString(globalsDict, QAPP_MACRO);
if (qAppObj)
PyDict_SetItemString(globalsDict, QAPP_MACRO, self);
}
+
PyObject_SetAttrString(moduleQtGui, QAPP_MACRO, self);
-
- Py_INCREF(self);
Py_AtExit(DeleteQApplicationAtExit);
-
+ Py_INCREF(self);
return 1;
}
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index 80122c2..b11ec9f 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -4358,7 +4358,7 @@
-
+
From df834e5bb1bc29f8b7b82b828a5824be7266965c Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Wed, 25 Aug 2010 17:07:53 -0300
Subject: [PATCH 0160/1129] Updated Declarative typesystem.
Reviewer: Luciano Wolf
Hugo Parente Lima
---
PySide/QtDeclarative/CMakeLists.txt | 1 +
PySide/QtDeclarative/typesystem_declarative.xml | 11 ++++++++++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/PySide/QtDeclarative/CMakeLists.txt b/PySide/QtDeclarative/CMakeLists.txt
index fc38103..940f4d1 100644
--- a/PySide/QtDeclarative/CMakeLists.txt
+++ b/PySide/QtDeclarative/CMakeLists.txt
@@ -6,6 +6,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtDeclarative/qdeclarativecontext_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtDeclarative/qdeclarativeengine_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtDeclarative/qdeclarativeerror_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtDeclarative/qdeclarativeexpression_wrapper.cpp
+${CMAKE_CURRENT_BINARY_DIR}/PySide/QtDeclarative/qdeclarativeextensioninterface_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtDeclarative/qdeclarativeextensionplugin_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtDeclarative/qdeclarativeimageprovider_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtDeclarative/qdeclarativeitem_wrapper.cpp
diff --git a/PySide/QtDeclarative/typesystem_declarative.xml b/PySide/QtDeclarative/typesystem_declarative.xml
index 30786e2..7a80e48 100644
--- a/PySide/QtDeclarative/typesystem_declarative.xml
+++ b/PySide/QtDeclarative/typesystem_declarative.xml
@@ -4,6 +4,8 @@
+
+
@@ -18,12 +20,19 @@
+
-
+
+
+
+
+
+
+
From e1d1a0cbd174976ed5e1634d0a9633499ea67dda Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Wed, 25 Aug 2010 17:09:40 -0300
Subject: [PATCH 0161/1129] Includded allow flags to some function on
QNetworkManager.
Reviewer: Luciano Wolf
Hugo Parente Lima
---
PySide/QtNetwork/typesystem_network.xml | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/PySide/QtNetwork/typesystem_network.xml b/PySide/QtNetwork/typesystem_network.xml
index 80a62a4..bfe9ad2 100644
--- a/PySide/QtNetwork/typesystem_network.xml
+++ b/PySide/QtNetwork/typesystem_network.xml
@@ -173,6 +173,15 @@
+
+
+
+
+
+
+
+
+
From 4e6d901bf8dd8e709fd00506679e7dad67c33ded Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Wed, 25 Aug 2010 17:12:46 -0300
Subject: [PATCH 0162/1129] Modifyed declarative test to avoi use of network.
Reviewer: Luciano Wolf
Hugo Parente Lima
---
tests/QtDeclarative/{network.qml => hw.qml} | 16 ++++++++++++----
tests/QtDeclarative/qdeclarativenetwork_test.py | 8 +-------
2 files changed, 13 insertions(+), 11 deletions(-)
rename tests/QtDeclarative/{network.qml => hw.qml} (88%)
diff --git a/tests/QtDeclarative/network.qml b/tests/QtDeclarative/hw.qml
similarity index 88%
rename from tests/QtDeclarative/network.qml
rename to tests/QtDeclarative/hw.qml
index 4b849e0..78c68ac 100644
--- a/tests/QtDeclarative/network.qml
+++ b/tests/QtDeclarative/hw.qml
@@ -40,8 +40,16 @@
import Qt 4.7
-Image {
- width: 100
- height: 100
- source: "http://qt.nokia.com/logo.png"
+Rectangle {
+ id: page
+ width: 500; height: 200
+ color: "lightgray"
+
+ Text {
+ id: helloText
+ text: "Hello world!"
+ y: 30
+ anchors.horizontalCenter: page.horizontalCenter
+ font.pointSize: 24; font.bold: true
+ }
}
diff --git a/tests/QtDeclarative/qdeclarativenetwork_test.py b/tests/QtDeclarative/qdeclarativenetwork_test.py
index a03a484..459c422 100644
--- a/tests/QtDeclarative/qdeclarativenetwork_test.py
+++ b/tests/QtDeclarative/qdeclarativenetwork_test.py
@@ -8,11 +8,6 @@ from PySide.QtNetwork import QNetworkAccessManager
from helper import adjust_filename, TimedQApplication
-class MyNetworkAccessManagerFactory(QDeclarativeNetworkAccessManagerFactory):
- def create(self, parent):
- nam = QNetworkAccessManager(parent)
- return nam
-
class TestQDeclarativeNetworkFactory(TimedQApplication):
def setUp(self):
@@ -21,9 +16,8 @@ class TestQDeclarativeNetworkFactory(TimedQApplication):
def testQDeclarativeNetworkFactory(self):
view = QDeclarativeView()
- url = QUrl.fromLocalFile(adjust_filename('network.qml', __file__))
+ url = QUrl.fromLocalFile(adjust_filename('hw.qml', __file__))
- view.engine().setNetworkAccessManagerFactory(MyNetworkAccessManagerFactory())
view.setSource(url)
view.show()
From 2593f9fccc71a200c5a802b2e05717910885e864 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Wed, 25 Aug 2010 17:45:02 -0300
Subject: [PATCH 0163/1129] Created unittest to bug 307.
---
tests/QtGui/CMakeLists.txt | 1 +
tests/QtGui/bug_307.py | 27 +++++++++++++++++++++++++++
2 files changed, 28 insertions(+)
create mode 100644 tests/QtGui/bug_307.py
diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt
index 077dd1a..5bccc20 100644
--- a/tests/QtGui/CMakeLists.txt
+++ b/tests/QtGui/CMakeLists.txt
@@ -2,6 +2,7 @@
PYSIDE_TEST(api2_test.py)
PYSIDE_TEST(bug_243.py)
+PYSIDE_TEST(bug_307.py)
PYSIDE_TEST(add_action_test.py)
PYSIDE_TEST(customproxywidget_test.py)
PYSIDE_TEST(float_to_int_implicit_conversion_test.py)
diff --git a/tests/QtGui/bug_307.py b/tests/QtGui/bug_307.py
new file mode 100644
index 0000000..1a4446b
--- /dev/null
+++ b/tests/QtGui/bug_307.py
@@ -0,0 +1,27 @@
+
+import unittest
+import colorsys
+
+from PySide.QtCore import SIGNAL
+from PySide.QtGui import QPushButton, QApplication
+
+
+class Test (QApplication) :
+ def __init__(self, argv) :
+ super(Test, self).__init__(argv)
+ self._called = False
+
+ def called(self):
+ self._called = True
+
+
+class QApplicationSignalsTest(unittest.TestCase):
+ def testQuit(self):
+ app = Test([])
+ button = QPushButton("BUTTON")
+ app.connect(button, SIGNAL("clicked()"), app.called)
+ button.click()
+ self.assert_(app._called)
+
+if __name__ == '__main__':
+ unittest.main()
From 3c36d444729ee9285bb4ab0252968057bf904a8d Mon Sep 17 00:00:00 2001
From: Anderson Lizardo
Date: Fri, 13 Aug 2010 22:32:07 -0400
Subject: [PATCH 0164/1129] Various cleanups to CMakeLists.txt files
* Simplify endmacro(), endif() and else() statements
* Remove unused and redundant code
* Use AUTO_OS for holding the typesystem suffix (instead of MODULE_NAME)
Reviewed-by: Luciano Wolf
Reviewed-by: Hugo Parente Lima
---
CMakeLists.txt | 17 +++++++----------
PySide/CMakeLists.txt | 6 +++---
PySide/QtGui/CMakeLists.txt | 20 ++++----------------
PySide/QtGui/typesystem_gui.xml.in | 2 +-
PySide/QtMaemo5/CMakeLists.txt | 4 ++--
PySide/QtNetwork/CMakeLists.txt | 5 ++---
PySide/QtSvg/CMakeLists.txt | 10 ----------
PySide/QtTest/CMakeLists.txt | 1 -
PySide/QtWebKit/CMakeLists.txt | 3 +--
doc/CMakeLists.txt | 10 +++++-----
tests/CMakeLists.txt | 4 ++--
11 files changed, 27 insertions(+), 55 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3f5dc7e..244e558 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -72,25 +72,22 @@ if (${QTVERSION} VERSION_LESS 4.5.0)
endif()
# Configure OS support
+set(ENABLE_X11 "0")
+set(ENABLE_MAC "0")
+set(ENABLE_WIN "0")
if(Q_WS_X11)
set(ENABLE_X11 "1")
- set(ENABLE_MAC "0")
- set(ENABLE_WIN "0")
if(Q_WS_MAEMO_5)
- set(AUTO_OS "MAEMO 5")
+ set(AUTO_OS "maemo")
else()
- set(AUTO_OS "X11")
+ set(AUTO_OS "x11")
endif()
elseif(Q_WS_MAC)
- set(ENABLE_X11 "0")
set(ENABLE_MAC "1")
- set(ENABLE_WIN "0")
- set(AUTO_OS "MAC")
+ set(AUTO_OS "mac")
elseif(Q_WS_WIN)
- set(ENABLE_X11 "0")
- set(ENABLE_MAC "0")
set(ENABLE_WIN "1")
- set(AUTO_OS "WIN")
+ set(AUTO_OS "win")
else()
message(FATAL_ERROR "OS not supported")
endif()
diff --git a/PySide/CMakeLists.txt b/PySide/CMakeLists.txt
index 10e0bc7..d823019 100644
--- a/PySide/CMakeLists.txt
+++ b/PySide/CMakeLists.txt
@@ -4,7 +4,7 @@ install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/__init__.py"
macro(execute_generator module sources typesystem_path)
message("Running generator for ${module}...")
-endmacro(execute_generator)
+endmacro()
macro(create_pyside_module module_name typesystem_file module_include_dir module_libraries module_deps module_typesystem_path module_sources)
add_custom_command(OUTPUT ${${module_sources}}
@@ -42,7 +42,7 @@ macro(create_pyside_module module_name typesystem_file module_include_dir module
DESTINATION include/PySide/${module_name}/)
install(FILES ${typesystem_file}
DESTINATION share/PySide/typesystems)
-endmacro(create_pyside_module)
+endmacro()
# Configure include based on platform
@@ -61,7 +61,7 @@ else()
message(STATUS "${name} NOT found. ${name} support disabled.")
endif()
endif()
-endmacro(HAS_QT_MODULE)
+endmacro()
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/__init__.py"
"${CMAKE_BINARY_DIR}/PySide/__init__.py")
diff --git a/PySide/QtGui/CMakeLists.txt b/PySide/QtGui/CMakeLists.txt
index 9d2b897..a848b65 100644
--- a/PySide/QtGui/CMakeLists.txt
+++ b/PySide/QtGui/CMakeLists.txt
@@ -31,32 +31,20 @@ macro(CHECK_QT_GUI_MACRO macro_display_name qt_macro module_sources global_sourc
message(STATUS "Testing support to ${macro_display_name} -- disabled")
endif()
endif()
-endmacro(CHECK_QT_GUI_MACRO)
+endmacro()
if(ENABLE_X11)
- set(MODULE_NAME "x11")
set(SPECIFIC_OS_FILES
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qx11info_wrapper.cpp
)
if(Q_WS_MAEMO_5)
- set(AUTO_OS "MAEMO 5")
- set(MODULE_NAME "maemo")
set(SPECIFIC_OS_FILES
${SPECIFIC_OS_FILES}
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qabstractkineticscroller_wrapper.cpp
)
- endif(Q_WS_MAEMO_5)
-
-elseif(ENABLE_MAC)
- set(MODULE_NAME "mac")
- set(SPECIFIC_OS_FILES
- )
-elseif(ENABLE_WIN)
- set(MODULE_NAME "win")
- set(SPECIFIC_OS_FILES
- )
-endif(ENABLE_X11)
+ endif()
+endif()
if (${QT_VERSION_MAJOR} EQUAL 4 AND ${QT_VERSION_MINOR} LESS 6)
@@ -98,7 +86,7 @@ else()
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qvector3d_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qvector4d_wrapper.cpp
)
-endif (${QT_VERSION_MAJOR} EQUAL 4 AND ${QT_VERSION_MINOR} LESS 6)
+endif ()
set(QtGui_SRC
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qabstractbutton_wrapper.cpp
diff --git a/PySide/QtGui/typesystem_gui.xml.in b/PySide/QtGui/typesystem_gui.xml.in
index 2dc9676..3ef63d9 100644
--- a/PySide/QtGui/typesystem_gui.xml.in
+++ b/PySide/QtGui/typesystem_gui.xml.in
@@ -1,5 +1,5 @@
-
+
diff --git a/PySide/QtMaemo5/CMakeLists.txt b/PySide/QtMaemo5/CMakeLists.txt
index fbcf75f..4eb2364 100644
--- a/PySide/QtMaemo5/CMakeLists.txt
+++ b/PySide/QtMaemo5/CMakeLists.txt
@@ -17,11 +17,11 @@ set(QtMaemo5_typesystem_path "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:$
if(NOT QT_QTMAEMO5_INCLUDE_DIR)
FIND_PATH(QT_QTMAEMO5_INCLUDE_DIR QtMaemo5
PATHS ${QT_HEADERS_DIR}/QtMaemo5 NO_DEFAULT_PATH)
-endif(NOT QT_QTMAEMO5_INCLUDE_DIR)
+endif()
if(NOT QT_QTMAEMO5_LIBRARY)
FIND_LIBRARY(QT_QTMAEMO5_LIBRARY QtMaemo5
PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
-endif(NOT QT_QTMAEMO5_LIBRARY)
+endif()
set(QtMaemo5_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
${QT_QTCORE_INCLUDE_DIR}
diff --git a/PySide/QtNetwork/CMakeLists.txt b/PySide/QtNetwork/CMakeLists.txt
index 1550499..0d89e28 100644
--- a/PySide/QtNetwork/CMakeLists.txt
+++ b/PySide/QtNetwork/CMakeLists.txt
@@ -31,8 +31,7 @@ macro(CHECK_QT_NETWORK_MACRO macro_display_name qt_macro module_sources global_s
message(STATUS "Testing support to ${macro_display_name} -- disabled")
endif()
endif()
-endmacro(CHECK_QT_NETWORK_MACRO)
-
+endmacro()
if (${QT_VERSION_MAJOR} EQUAL 4 AND ${QT_VERSION_MINOR} GREATER 6)
set (QtNetwork_47_SRC
@@ -71,7 +70,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qtcpsocket_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qtnetwork_module_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qudpsocket_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qurlinfo_wrapper.cpp
-${SPECIFIC_OS_FILES}
+
${QtNetwork_47_SRC}
)
diff --git a/PySide/QtSvg/CMakeLists.txt b/PySide/QtSvg/CMakeLists.txt
index a56ee33..bd67536 100644
--- a/PySide/QtSvg/CMakeLists.txt
+++ b/PySide/QtSvg/CMakeLists.txt
@@ -1,21 +1,11 @@
project(QtSvg)
-if (${QT_VERSION_MAJOR} EQUAL 4 AND ${QT_VERSION_MINOR} LESS 6)
- set (QtSvg_46_SRC )
-else ()
- set(QtSvg_46_SRC
- )
-endif (${QT_VERSION_MAJOR} EQUAL 4 AND ${QT_VERSION_MINOR} LESS 6)
-
set(QtSvg_SRC
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSvg/qgraphicssvgitem_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSvg/qsvggenerator_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSvg/qsvgrenderer_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSvg/qsvgwidget_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSvg/qtsvg_module_wrapper.cpp
-
-${SPECIFIC_OS_FILES}
-${QtSvg_46_SRC}
)
set(QtSvg_typesystem_path "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtGui_BINARY_DIR}")
diff --git a/PySide/QtTest/CMakeLists.txt b/PySide/QtTest/CMakeLists.txt
index 4bf0bca..cb9e4d5 100644
--- a/PySide/QtTest/CMakeLists.txt
+++ b/PySide/QtTest/CMakeLists.txt
@@ -3,7 +3,6 @@ project(QtTest)
set(QtTest_SRC
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtTest/qtest_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtTest/qttest_module_wrapper.cpp
-${SPECIFIC_OS_FILES}
)
set(QtTest_typesystem_path "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtGui_BINARY_DIR}")
diff --git a/PySide/QtWebKit/CMakeLists.txt b/PySide/QtWebKit/CMakeLists.txt
index 9039835..f2ca036 100644
--- a/PySide/QtWebKit/CMakeLists.txt
+++ b/PySide/QtWebKit/CMakeLists.txt
@@ -9,7 +9,7 @@ else ()
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qwebinspector_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qgraphicswebview_wrapper.cpp
)
-endif (${QT_VERSION_MAJOR} EQUAL 4 AND ${QT_VERSION_MINOR} LESS 6)
+endif ()
set(QtWebKit_SRC
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qtwebkit_module_wrapper.cpp
@@ -28,7 +28,6 @@ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qwebsettings_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qwebview_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/webcore_wrapper.cpp
-${SPECIFIC_OS_FILES}
${QtWebKit_46_SRC}
)
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index 7bad422..37dc8d6 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -43,7 +43,7 @@ COMMENT "Running generator to generate documentation of ${module}..."
)
add_dependencies("${module}-apidoc" qdoc3)
add_dependencies(apidoc "${module}-apidoc")
-endmacro(create_doc module)
+endmacro()
create_doc(QtCore "")
create_doc(QtGui "${QtCore_SOURCE_DIR}")
@@ -79,11 +79,11 @@ add_custom_target(apidocinstall
add_dependencies(apidocinstall apidevhelp)
-else (NOT ${graphviz_exec} STREQUAL graphviz_exec-NOTFOUND)
+else ()
message(STATUS "Missing graphviz tool (dot), apidoc generation targets disabled.")
-endif (NOT ${graphviz_exec} STREQUAL graphviz_exec-NOTFOUND)
+endif ()
-else (QT_SRC_DIR)
+else ()
message(STATUS "QT_SRC_DIR variable not set, apidoc generation targets disabled.")
-endif (QT_SRC_DIR)
+endif ()
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index ce45796..4cacd14 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -25,7 +25,7 @@ else()
if(NOT DISABLE_${name} AND ${var})
add_subdirectory(${name})
endif()
- endmacro(TEST_QT_MODULE)
+ endmacro()
macro(PYSIDE_TEST)
string(REGEX MATCH "/([^/]+)//?([^/]+)\\.py" foo "${CMAKE_CURRENT_SOURCE_DIR}/${ARGV0}" )
@@ -43,7 +43,7 @@ else()
TIMEOUT ${CTEST_TESTING_TIMEOUT}
WILL_FAIL ${EXPECT_TO_FAIL}
ENVIRONMENT "PYTHONPATH=${TEST_PYTHONPATH};${LIBRARY_PATH_VAR}=${TEST_LIBRARY_PATH}")
- endmacro(PYSIDE_TEST)
+ endmacro()
# Try to find QtMultimedia
# TODO: Remove this hack when cmake support QtMultimedia module
From d53f699751047b18e7c729de3cdcc7eb45b32dd1 Mon Sep 17 00:00:00 2001
From: Anderson Lizardo
Date: Mon, 16 Aug 2010 21:59:45 -0400
Subject: [PATCH 0165/1129] Simplify handling of typesystems for multiple OSes
* Factor out install() commands into PySide/CMakeLists.txt
* Drop typesystem__common.xml and typesystem_.xml.in,
and make typesystem__.xml (if exists) include
typesystem_.xml (which holds common data)
Reviewed-by: Luciano Wolf
Reviewed-by: Hugo Parente Lima
---
PySide/CMakeLists.txt | 15 +++++++++++----
PySide/QtCore/CMakeLists.txt | 3 +--
PySide/QtDeclarative/CMakeLists.txt | 3 +--
PySide/QtGui/CMakeLists.txt | 13 +------------
...pesystem_gui_common.xml => typesystem_gui.xml} | 2 ++
PySide/QtGui/typesystem_gui.xml.in | 5 -----
PySide/QtGui/typesystem_gui_mac.xml | 2 +-
PySide/QtGui/typesystem_gui_x11.xml | 2 +-
PySide/QtHelp/CMakeLists.txt | 3 +--
PySide/QtMaemo5/CMakeLists.txt | 3 +--
PySide/QtMultimedia/CMakeLists.txt | 3 +--
PySide/QtNetwork/CMakeLists.txt | 3 +--
PySide/QtOpenGL/CMakeLists.txt | 3 +--
PySide/QtScript/CMakeLists.txt | 3 +--
PySide/QtScriptTools/CMakeLists.txt | 3 +--
PySide/QtSql/CMakeLists.txt | 3 +--
PySide/QtSvg/CMakeLists.txt | 3 +--
PySide/QtTest/CMakeLists.txt | 3 +--
PySide/QtUiTools/CMakeLists.txt | 3 +--
PySide/QtWebKit/CMakeLists.txt | 3 +--
PySide/QtXml/CMakeLists.txt | 3 +--
PySide/QtXmlPatterns/CMakeLists.txt | 3 +--
PySide/phonon/CMakeLists.txt | 3 +--
23 files changed, 33 insertions(+), 57 deletions(-)
rename PySide/QtGui/{typesystem_gui_common.xml => typesystem_gui.xml} (99%)
delete mode 100644 PySide/QtGui/typesystem_gui.xml.in
diff --git a/PySide/CMakeLists.txt b/PySide/CMakeLists.txt
index d823019..01cd0ce 100644
--- a/PySide/CMakeLists.txt
+++ b/PySide/CMakeLists.txt
@@ -6,7 +6,14 @@ macro(execute_generator module sources typesystem_path)
message("Running generator for ${module}...")
endmacro()
-macro(create_pyside_module module_name typesystem_file module_include_dir module_libraries module_deps module_typesystem_path module_sources)
+macro(create_pyside_module module_name module_include_dir module_libraries module_deps module_typesystem_path module_sources)
+ string(TOLOWER ${module_name} _module)
+ string(REGEX REPLACE ^qt "" _module ${_module})
+ set(typesystem_prefix ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_${_module})
+ if(EXISTS ${typesystem_prefix}_${AUTO_OS}.xml)
+ set(typesystem_prefix ${typesystem_prefix}_${AUTO_OS})
+ endif()
+
add_custom_command(OUTPUT ${${module_sources}}
COMMAND ${GENERATOR} ${GENERATOR_EXTRA_FLAGS}
${CMAKE_BINARY_DIR}/PySide/global.h
@@ -14,7 +21,7 @@ macro(create_pyside_module module_name typesystem_file module_include_dir module
--typesystem-paths=${pyside_SOURCE_DIR}:${${module_typesystem_path}}
--output-directory=${CMAKE_CURRENT_BINARY_DIR}
--license-file=${CMAKE_CURRENT_SOURCE_DIR}/../licensecomment.txt
- ${typesystem_file}
+ ${typesystem_prefix}.xml
--api-version=${SUPPORTED_QT_VERSION}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Running generator for ${module_name}...")
@@ -40,8 +47,8 @@ macro(create_pyside_module module_name typesystem_file module_include_dir module
string(TOLOWER ${module_name} lower_module_name)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/${module_name}/pyside_${lower_module_name}_python.h
DESTINATION include/PySide/${module_name}/)
- install(FILES ${typesystem_file}
- DESTINATION share/PySide/typesystems)
+ file(GLOB typesystem_files ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_*.xml)
+ install(FILES ${typesystem_files} DESTINATION share/PySide/typesystems)
endmacro()
diff --git a/PySide/QtCore/CMakeLists.txt b/PySide/QtCore/CMakeLists.txt
index b6c7534..5a5951b 100644
--- a/PySide/QtCore/CMakeLists.txt
+++ b/PySide/QtCore/CMakeLists.txt
@@ -134,7 +134,7 @@ ${QtCore_46_SRC}
${QtCore_47_SRC}
)
-set(QtCore_typesystem_path ${CMAKE_CURRENT_BINARY_DIR})
+set(QtCore_typesystem_path "")
set(QtCore_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}/${BINDING_NAME}/QtCore/
${QT_INCLUDE_DIR}
@@ -147,7 +147,6 @@ set(QtCore_libraries pyside
${QT_QTCORE_LIBRARY})
create_pyside_module(QtCore
- ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_core.xml
QtCore_include_dirs
QtCore_libraries
""
diff --git a/PySide/QtDeclarative/CMakeLists.txt b/PySide/QtDeclarative/CMakeLists.txt
index 940f4d1..d2b7e29 100644
--- a/PySide/QtDeclarative/CMakeLists.txt
+++ b/PySide/QtDeclarative/CMakeLists.txt
@@ -21,7 +21,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtDeclarative/qdeclarativeview_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtDeclarative/qtdeclarative_module_wrapper.cpp
)
-set(QtDeclarative_typesystem_path "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:${QtGui_BINARY_DIR}:${QtGui_SOURCE_DIR}:${QtDeclarative_SOURCE_DIR}:${QtNetwork_SOURCE_DIR}:${QtNetwork_BINARY_DIR}")
+set(QtDeclarative_typesystem_path "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtNetwork_SOURCE_DIR}:${QtDeclarative_SOURCE_DIR}")
set(QtDeclarative_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
${QT_QTCORE_INCLUDE_DIR}
@@ -51,7 +51,6 @@ set(QtDeclarative_libraries pyside
set(QtDeclarative_deps QtGui QtNetwork)
create_pyside_module(QtDeclarative
- ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_declarative.xml
QtDeclarative_include_dirs
QtDeclarative_libraries
QtDeclarative_deps
diff --git a/PySide/QtGui/CMakeLists.txt b/PySide/QtGui/CMakeLists.txt
index a848b65..88ec191 100644
--- a/PySide/QtGui/CMakeLists.txt
+++ b/PySide/QtGui/CMakeLists.txt
@@ -459,10 +459,7 @@ set(QT_SESSIONMANAGER_SRCS
)
CHECK_QT_GUI_MACRO("SessionManager Support" QT_NO_SESSIONMANAGER QT_SESSIONMANAGER_SRCS QtGui_SRC)
-configure_file(typesystem_gui.xml.in
- "${CMAKE_CURRENT_BINARY_DIR}/typesystem_gui.xml" @ONLY)
-
-set(QtGui_typesystem_path "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:${QtCore_BINARY_DIR}")
+set(QtGui_typesystem_path "${QtCore_SOURCE_DIR}")
set(QtGui_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/
${QT_INCLUDE_DIR}
@@ -476,15 +473,7 @@ set(QtGui_libraries pyside
${QT_QTGUI_LIBRARY})
set(QtGui_deps "QtCore")
-# extra install
-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_gui_common.xml
- ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_gui_mac.xml
- ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_gui_maemo.xml
- ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_gui_x11.xml
- DESTINATION share/PySide/typesystems)
-
create_pyside_module(QtGui
- ${CMAKE_CURRENT_BINARY_DIR}/typesystem_gui.xml
QtGui_include_dirs
QtGui_libraries
QtGui_deps
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui.xml
similarity index 99%
rename from PySide/QtGui/typesystem_gui_common.xml
rename to PySide/QtGui/typesystem_gui.xml
index b11ec9f..a5dcfd9 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui.xml
@@ -1,5 +1,7 @@
+
+
int size = PyString_GET_SIZE(%PYARG_1);
if (size == 1) {
diff --git a/PySide/QtGui/typesystem_gui.xml.in b/PySide/QtGui/typesystem_gui.xml.in
deleted file mode 100644
index 3ef63d9..0000000
--- a/PySide/QtGui/typesystem_gui.xml.in
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
diff --git a/PySide/QtGui/typesystem_gui_mac.xml b/PySide/QtGui/typesystem_gui_mac.xml
index b27df0f..56f1f32 100644
--- a/PySide/QtGui/typesystem_gui_mac.xml
+++ b/PySide/QtGui/typesystem_gui_mac.xml
@@ -5,7 +5,7 @@
-
+
diff --git a/PySide/QtGui/typesystem_gui_x11.xml b/PySide/QtGui/typesystem_gui_x11.xml
index 7429874..36f25ae 100644
--- a/PySide/QtGui/typesystem_gui_x11.xml
+++ b/PySide/QtGui/typesystem_gui_x11.xml
@@ -10,5 +10,5 @@
-
+
diff --git a/PySide/QtHelp/CMakeLists.txt b/PySide/QtHelp/CMakeLists.txt
index d5140c2..0ffa400 100644
--- a/PySide/QtHelp/CMakeLists.txt
+++ b/PySide/QtHelp/CMakeLists.txt
@@ -15,7 +15,7 @@ set(QtHelp_SRC
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtHelp/qthelp_module_wrapper.cpp
)
-set(QtHelp_typesystem_path "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:${QtGui_BINARY_DIR}:${QtGui_SOURCE_DIR}:${QtHelp_SOURCE_DIR}")
+set(QtHelp_typesystem_path "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtHelp_SOURCE_DIR}")
set(QtHelp_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
${QT_QTCORE_INCLUDE_DIR}
${QT_QTGUI_INCLUDE_DIR}
@@ -34,7 +34,6 @@ set(QtHelp_libraries pyside
set(QtHelp_deps QtGui)
create_pyside_module(QtHelp
- ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_help.xml
QtHelp_include_dirs
QtHelp_libraries
QtHelp_deps
diff --git a/PySide/QtMaemo5/CMakeLists.txt b/PySide/QtMaemo5/CMakeLists.txt
index 4eb2364..74eaabd 100644
--- a/PySide/QtMaemo5/CMakeLists.txt
+++ b/PySide/QtMaemo5/CMakeLists.txt
@@ -11,7 +11,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/${BINDING_NAME}/QtMaemo5/qmaemo5valuebutton_wrapper.
${CMAKE_CURRENT_BINARY_DIR}/${BINDING_NAME}/QtMaemo5/qtmaemo5_module_wrapper.cpp
)
-set(QtMaemo5_typesystem_path "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:${QtGui_BINARY_DIR}:${QtGui_SOURCE_DIR}:${QtMaemo5_SOURCE_DIR}")
+set(QtMaemo5_typesystem_path "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtMaemo5_SOURCE_DIR}")
# QT_QTMAEMO5_* variables are not defined by CMake
if(NOT QT_QTMAEMO5_INCLUDE_DIR)
@@ -41,7 +41,6 @@ set(QtMaemo5_libraries pyside
set(QtMaemo5_deps QtGui)
create_pyside_module(QtMaemo5
- ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_maemo5.xml
QtMaemo5_include_dirs
QtMaemo5_libraries
QtMaemo5_deps
diff --git a/PySide/QtMultimedia/CMakeLists.txt b/PySide/QtMultimedia/CMakeLists.txt
index 1829697..3dd7abb 100644
--- a/PySide/QtMultimedia/CMakeLists.txt
+++ b/PySide/QtMultimedia/CMakeLists.txt
@@ -17,7 +17,7 @@ set(QtMultimedia_SRC
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtMultimedia/qvideoframe_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtMultimedia/qtmultimedia_module_wrapper.cpp
)
-set(QtMultimedia_typesystem_path "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtGui_BINARY_DIR}")
+set(QtMultimedia_typesystem_path "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}")
set(QtMultimedia_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtMultimedia/
@@ -40,7 +40,6 @@ set(QtMultimedia_libraries pyside
set(QtMultimedia_deps QtGui)
create_pyside_module(QtMultimedia
- ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_multimedia.xml
QtMultimedia_include_dirs
QtMultimedia_libraries
QtMultimedia_deps
diff --git a/PySide/QtNetwork/CMakeLists.txt b/PySide/QtNetwork/CMakeLists.txt
index 0d89e28..ca05993 100644
--- a/PySide/QtNetwork/CMakeLists.txt
+++ b/PySide/QtNetwork/CMakeLists.txt
@@ -84,7 +84,7 @@ set(OPENSSL_SOURCES
CHECK_QT_NETWORK_MACRO("Network OPENSSL" QT_NO_OPENSSL OPENSSL_SOURCES QtNetwork_SRC)
-set(QtNetwork_typesystem_path "${CMAKE_CURRENT_SOURCE_DIR}:${QtCore_SOURCE_DIR}")
+set(QtNetwork_typesystem_path "${QtCore_SOURCE_DIR}")
set(QtNetwork_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/
${QT_INCLUDE_DIR}
@@ -101,7 +101,6 @@ set(QtNetwork_libraries pyside
set(QtNetwork_deps QtCore)
create_pyside_module(QtNetwork
- ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_network.xml
QtNetwork_include_dirs
QtNetwork_libraries
QtNetwork_deps
diff --git a/PySide/QtOpenGL/CMakeLists.txt b/PySide/QtOpenGL/CMakeLists.txt
index 42173a4..6ca3777 100644
--- a/PySide/QtOpenGL/CMakeLists.txt
+++ b/PySide/QtOpenGL/CMakeLists.txt
@@ -32,7 +32,7 @@ set(QtOpenGL_SRC
${QtOpenGL_47_SRC}
)
-set(QtOpenGL_typesystem_path "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:${QtGui_BINARY_DIR}:${QtGui_SOURCE_DIR}:${QtOpenGL_SOURCE_DIR}")
+set(QtOpenGL_typesystem_path "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtOpenGL_SOURCE_DIR}")
set(QtOpenGL_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
${QT_QTCORE_INCLUDE_DIR}
${QT_QTGUI_INCLUDE_DIR}
@@ -50,7 +50,6 @@ set(QtOpenGL_libraries pyside
${QT_QTOPENGL_LIBRARY})
set(QtOpenGL_deps QtGui)
create_pyside_module(QtOpenGL
- ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_opengl.xml
QtOpenGL_include_dirs
QtOpenGL_libraries
QtOpenGL_deps
diff --git a/PySide/QtScript/CMakeLists.txt b/PySide/QtScript/CMakeLists.txt
index d9e8264..87f7e06 100644
--- a/PySide/QtScript/CMakeLists.txt
+++ b/PySide/QtScript/CMakeLists.txt
@@ -25,7 +25,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtScript/qscriptvalueiterator_wrapper.cpp
${QtScript_46_SRC}
)
-set(QtScript_typesystem_path "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}")
+set(QtScript_typesystem_path "${QtCore_SOURCE_DIR}")
set(QtScript_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtScript
${QT_INCLUDE_DIR}
@@ -41,7 +41,6 @@ set(QtScript_libraries pyside
${QT_QTSCRIPT_LIBRARY})
set(QtScript_deps QtCore)
create_pyside_module(QtScript
- ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_script.xml
QtScript_include_dirs
QtScript_libraries
QtScript_deps
diff --git a/PySide/QtScriptTools/CMakeLists.txt b/PySide/QtScriptTools/CMakeLists.txt
index 39faee4..c15dd7a 100644
--- a/PySide/QtScriptTools/CMakeLists.txt
+++ b/PySide/QtScriptTools/CMakeLists.txt
@@ -5,7 +5,7 @@ set(QtScriptTools_SRC
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtScriptTools/qscriptenginedebugger_wrapper.cpp
)
-set(QtScriptTools_typesystem_path "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtGui_BINARY_DIR}:${QtScript_SOURCE_DIR}:${QtScriptTools_SOURCE_DIR}")
+set(QtScriptTools_typesystem_path "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtScript_SOURCE_DIR}:${QtScriptTools_SOURCE_DIR}")
set(QtScriptTools_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
${QT_QTCORE_INCLUDE_DIR}
@@ -29,7 +29,6 @@ set(QtScriptTools_libraries pyside
set(QtScriptTools_deps QtCore QtScript QtGui)
create_pyside_module(QtScriptTools
- ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_scripttools.xml
QtScriptTools_include_dirs
QtScriptTools_libraries
QtScriptTools_deps
diff --git a/PySide/QtSql/CMakeLists.txt b/PySide/QtSql/CMakeLists.txt
index f8e105d..e58e0c2 100644
--- a/PySide/QtSql/CMakeLists.txt
+++ b/PySide/QtSql/CMakeLists.txt
@@ -21,7 +21,7 @@ set(QtSql_SRC
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSql/qtsql_module_wrapper.cpp
)
-set(QtSql_typesystem_path "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:${QtGui_BINARY_DIR}:${QtGui_SOURCE_DIR}:${QtSql_SOURCE_DIR}")
+set(QtSql_typesystem_path "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtSql_SOURCE_DIR}")
set(QtSql_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
${QT_QTCORE_INCLUDE_DIR}
${QT_QTGUI_INCLUDE_DIR}
@@ -39,7 +39,6 @@ set(QtSql_libraries pyside
${QT_QTSQL_LIBRARY})
set(QtSql_deps QtGui)
create_pyside_module(QtSql
- ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_sql.xml
QtSql_include_dirs
QtSql_libraries
QtSql_deps
diff --git a/PySide/QtSvg/CMakeLists.txt b/PySide/QtSvg/CMakeLists.txt
index bd67536..4517fc0 100644
--- a/PySide/QtSvg/CMakeLists.txt
+++ b/PySide/QtSvg/CMakeLists.txt
@@ -8,7 +8,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSvg/qsvgwidget_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSvg/qtsvg_module_wrapper.cpp
)
-set(QtSvg_typesystem_path "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtGui_BINARY_DIR}")
+set(QtSvg_typesystem_path "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}")
set(QtSvg_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSvg/
${QT_INCLUDE_DIR}
@@ -27,7 +27,6 @@ set(QtSvg_libraries pyside
${QT_QTGUI_LIBRARY})
set(QtSvg_deps QtGui)
create_pyside_module(QtSvg
- ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_svg.xml
QtSvg_include_dirs
QtSvg_libraries
QtSvg_deps
diff --git a/PySide/QtTest/CMakeLists.txt b/PySide/QtTest/CMakeLists.txt
index cb9e4d5..5fffb8e 100644
--- a/PySide/QtTest/CMakeLists.txt
+++ b/PySide/QtTest/CMakeLists.txt
@@ -5,7 +5,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtTest/qtest_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtTest/qttest_module_wrapper.cpp
)
-set(QtTest_typesystem_path "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtGui_BINARY_DIR}")
+set(QtTest_typesystem_path "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}")
set(QtTest_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtTest/
${QT_INCLUDE_DIR}
@@ -25,7 +25,6 @@ set(QtTest_libraries pyside
${QT_QTCORE_LIBRARY})
set(QtTest_deps QtGui)
create_pyside_module(QtTest
- ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_test.xml
QtTest_include_dirs
QtTest_libraries
QtTest_deps
diff --git a/PySide/QtUiTools/CMakeLists.txt b/PySide/QtUiTools/CMakeLists.txt
index 9af11fb..ed4c66c 100644
--- a/PySide/QtUiTools/CMakeLists.txt
+++ b/PySide/QtUiTools/CMakeLists.txt
@@ -5,7 +5,7 @@ set(QtUiTools_SRC
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtUiTools/quiloader_wrapper.cpp
)
-set(QtUiTools_typesystem_path "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:${QtGui_BINARY_DIR}:${QtGui_SOURCE_DIR}:${QtXml_SOURCE_DIR}:${QtUiTools_SOURCE_DIR}")
+set(QtUiTools_typesystem_path "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtXml_SOURCE_DIR}:${QtUiTools_SOURCE_DIR}")
set(QtUiTools_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
${QT_QTCORE_INCLUDE_DIR}
${QT_QTGUI_INCLUDE_DIR}
@@ -25,7 +25,6 @@ set(QtUiTools_libraries pyside
${QT_QTUITOOLS_LIBRARY})
set(QtUiTools_deps QtGui QtXml)
create_pyside_module(QtUiTools
- ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_uitools.xml
QtUiTools_include_dirs
QtUiTools_libraries
QtUiTools_deps
diff --git a/PySide/QtWebKit/CMakeLists.txt b/PySide/QtWebKit/CMakeLists.txt
index f2ca036..4a89360 100644
--- a/PySide/QtWebKit/CMakeLists.txt
+++ b/PySide/QtWebKit/CMakeLists.txt
@@ -31,7 +31,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/webcore_wrapper.cpp
${QtWebKit_46_SRC}
)
-set(QtWebKit_typesystem_path "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtGui_BINARY_DIR}:${QtNetwork_SOURCE_DIR}")
+set(QtWebKit_typesystem_path "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtNetwork_SOURCE_DIR}")
set(QtWebkit_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebkit/
${QT_INCLUDE_DIR}
@@ -53,7 +53,6 @@ set(QtWebKit_libraries pyside
${QT_QTGUI_LIBRARY})
set(QtWebKit_deps QtGui QtNetwork)
create_pyside_module(QtWebKit
- ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_webkit.xml
QtWebkit_include_dirs
QtWebKit_libraries
QtWebKit_deps
diff --git a/PySide/QtXml/CMakeLists.txt b/PySide/QtXml/CMakeLists.txt
index c76cabd..628dd00 100644
--- a/PySide/QtXml/CMakeLists.txt
+++ b/PySide/QtXml/CMakeLists.txt
@@ -35,7 +35,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXml/qxmlreader_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXml/qxmlsimplereader_wrapper.cpp
)
-set(QtXml_typesystem_path "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}")
+set(QtXml_typesystem_path "${QtCore_SOURCE_DIR}")
set(QtXml_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXml
${CMAKE_SOURCE_DIR}
@@ -52,7 +52,6 @@ set(QtXml_libraries pyside
${QT_QTXML_LIBRARY})
set(QtXml_deps QtCore)
create_pyside_module(QtXml
- ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_xml.xml
QtXml_include_dirs
QtXml_libraries
QtXml_deps
diff --git a/PySide/QtXmlPatterns/CMakeLists.txt b/PySide/QtXmlPatterns/CMakeLists.txt
index 3456e9e..4db6e9d 100644
--- a/PySide/QtXmlPatterns/CMakeLists.txt
+++ b/PySide/QtXmlPatterns/CMakeLists.txt
@@ -26,7 +26,7 @@ set(QtXmlPatterns_SRC
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXmlPatterns/qxmlserializer_wrapper.cpp
${QtXmlPatterns_46_SRC}
)
-set(QtXmlPatterns_typesystem_path "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}")
+set(QtXmlPatterns_typesystem_path "${QtCore_SOURCE_DIR}")
set(QtXmlPatterns_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
${QT_QTCORE_INCLUDE_DIR}
${QT_QTXMLPATTERNS_INCLUDE_DIR}
@@ -41,7 +41,6 @@ set(QtXmlPatterns_libraries pyside
${QT_QTXMLPATTERNS_LIBRARY})
set(QtXmlPatterns_deps QtCore)
create_pyside_module(QtXmlPatterns
- ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_xmlpatterns.xml
QtXmlPatterns_include_dirs
QtXmlPatterns_libraries
QtXmlPatterns_deps
diff --git a/PySide/phonon/CMakeLists.txt b/PySide/phonon/CMakeLists.txt
index a7a870f..948166a 100644
--- a/PySide/phonon/CMakeLists.txt
+++ b/PySide/phonon/CMakeLists.txt
@@ -43,7 +43,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_volumeslider_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_backendcapabilities_notifierwrapper_wrapper.cpp
)
-set(phonon_typesystem_path "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:${QtGui_BINARY_DIR}:${QtGui_SOURCE_DIR}:${phonon_SOURCE_DIR}")
+set(phonon_typesystem_path "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${phonon_SOURCE_DIR}")
set(phonon_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
${QT_QTCORE_INCLUDE_DIR}
${QT_QTGUI_INCLUDE_DIR}
@@ -62,7 +62,6 @@ set(phonon_libraries pyside
set(phonon_deps QtGui)
create_pyside_module(phonon
- "typesystem_phonon.xml"
phonon_include_dirs
phonon_libraries
phonon_deps
From e5e44b6465e2755c70c8e13060de4c2ca799fd64 Mon Sep 17 00:00:00 2001
From: Anderson Lizardo
Date: Sat, 14 Aug 2010 10:02:33 -0400
Subject: [PATCH 0166/1129] Replace macro checks with actual symbol checking
This increases a little more the check time, but is also more precise.
It is also required for cases where qfeatures.h incorrectly reports
support for a feature, but the actual class is not compiled (the case
for a couple of classes in Qt Simulator).
Additionally, the macro has been made more concise, and is reused for
both QtGui and QtNetwork.
Reviewed-by: Luciano Wolf
Reviewed-by: Hugo Parente Lima
---
PySide/CMakeLists.txt | 33 ++++++++++++
PySide/QtGui/CMakeLists.txt | 89 ++-------------------------------
PySide/QtNetwork/CMakeLists.txt | 47 ++---------------
3 files changed, 42 insertions(+), 127 deletions(-)
diff --git a/PySide/CMakeLists.txt b/PySide/CMakeLists.txt
index 01cd0ce..05dd4ff 100644
--- a/PySide/CMakeLists.txt
+++ b/PySide/CMakeLists.txt
@@ -51,6 +51,39 @@ macro(create_pyside_module module_name module_include_dir module_libraries modul
install(FILES ${typesystem_files} DESTINATION share/PySide/typesystems)
endmacro()
+macro(check_qt_class module class global_sources)
+ string(TOLOWER ${class} _class)
+ string(TOUPPER ${module} _module)
+ set(_cppfile ${CMAKE_CURRENT_BINARY_DIR}/PySide/${module}/${_class}_wrapper.cpp)
+ if (DEFINED PYSIDE_${class})
+ if (PYSIDE_${class})
+ list(APPEND ${global_sources} ${_cppfile})
+ endif()
+ else()
+ set(SRC_FILE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/test${class}.cxx)
+ file(WRITE ${SRC_FILE}
+ "#include <${module}>\n"
+ "#include \n"
+ "int main() { return (int) &typeid(${class}); }\n"
+ )
+ try_compile(Q_WORKS ${CMAKE_BINARY_DIR}
+ ${SRC_FILE}
+ CMAKE_FLAGS
+ "-DLINK_LIBRARIES=${QT_${_module}_LIBRARY}"
+ "-DLINK_DIRECTORIES=${QT_LIBRARY_DIR}"
+ "-DINCLUDE_DIRECTORIES=${QT_INCLUDE_DIR};${QT_${_module}_INCLUDE_DIR}"
+ OUTPUT_VARIABLE OUTPUT)
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCheckQtClassTest.log ${OUTPUT})
+
+ set("PYSIDE_${class}" ${Q_WORKS} CACHE STRING "Has this Qt class been found?")
+ if(Q_WORKS)
+ message(STATUS "Checking for ${class} in ${module} -- found")
+ list(APPEND ${global_sources} ${_cppfile})
+ else()
+ message(STATUS "Checking for ${class} in ${module} -- not found")
+ endif()
+ endif()
+endmacro()
# Configure include based on platform
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/global.h.in"
diff --git a/PySide/QtGui/CMakeLists.txt b/PySide/QtGui/CMakeLists.txt
index 88ec191..a6787cd 100644
--- a/PySide/QtGui/CMakeLists.txt
+++ b/PySide/QtGui/CMakeLists.txt
@@ -1,38 +1,5 @@
project(QtGui)
-# Check QtGui support
-macro(CHECK_QT_GUI_MACRO macro_display_name qt_macro module_sources global_sources)
- if (DEFINED PYSIDE_${qt_macro})
- if (PYSIDE_${qt_macro})
- list(APPEND ${global_sources} ${${module_sources}})
- endif()
- else()
- set(SRC_FILE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/test${qt_macro}.cxx)
- file(WRITE ${SRC_FILE}
- "#include \n"
- "int main() { \n"
- "#ifdef ${qt_macro}\n"
- "#error not supported.\n"
- "#endif\n"
- "}\n")
-
- try_compile(Q_WORKS ${CMAKE_BINARY_DIR}
- ${SRC_FILE}
- CMAKE_FLAGS
- -DINCLUDE_DIRECTORIES:STRING=${QT_QTGUI_INCLUDE_DIR}\;${QT_INCLUDE_DIR}
- -DLINK_LIBRARIES:PATH=${QT_QTGUI_LIBRARY_RELEASE}
- OUTPUT_VARIABLE OUTPUT)
-
- set("PYSIDE_${qt_macro}" ${Q_WORKS} CACHE STRING "Has this Qt module been found by pyside?")
- if(Q_WORKS)
- message(STATUS "Testing support to ${macro_display_name} -- enabled")
- list(APPEND ${global_sources} ${${module_sources}})
- else()
- message(STATUS "Testing support to ${macro_display_name} -- disabled")
- endif()
- endif()
-endmacro()
-
if(ENABLE_X11)
set(SPECIFIC_OS_FILES
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qx11info_wrapper.cpp
@@ -406,58 +373,10 @@ ${SPECIFIC_OS_FILES}
${QtGui_46_SRC}
)
-#Check GtkStyle
-set(QT_GTKSTYLE_SRCS
- ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgtkstyle_wrapper.cpp
-)
-CHECK_QT_GUI_MACRO("GtkStyle" QT_NO_STYLE_GTK QT_GTKSTYLE_SRCS QtGui_SRC)
-
-#Check SystemTray
-set(QT_SYSTEMTRAY_SRCS
- ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qsystemtrayicon_wrapper.cpp
-)
-CHECK_QT_GUI_MACRO("SystemTray" QT_NO_SYSTEMTRAYICON QT_SYSTEMTRAY_SRCS QtGui_SRC)
-
-#Check QT_PRINTDIALOG support
-set(QT_PRINTDIALOG_SRCS
- ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qabstractpagesetupdialog_wrapper.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qabstractprintdialog_wrapper.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qpagesetupdialog_wrapper.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qprintdialog_wrapper.cpp
-)
-CHECK_QT_GUI_MACRO("PrintDialog Support" QT_NO_PRINTDIALOG QT_PRINTDIALOG_SRCS QtGui_SRC)
-
-#Check QT_PRITPREVIEW support
-set(QT_PRINTPREVIEW_SRCS
- ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qprintpreviewwidget_wrapper.cpp
-)
-CHECK_QT_GUI_MACRO("PrintPreview Support" QT_NO_PRINTPREVIEWWIDGET QT_PRINTPREVIEW_SRCS QtGui_SRC)
-
-#Check QT_PRINTPREVIEWDIALOG support
-set(QT_PRINTPREVIEWDIALOG_SRCS
- ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qprintpreviewdialog_wrapper.cpp
-)
-CHECK_QT_GUI_MACRO("PrintPreviewDialog Support" QT_NO_PRINTPREVIEWDIALOG QT_PRINTPREVIEWDIALOG_SRCS QtGui_SRC)
-
-#Check QT_PRINTER
-set(QT_PRINTER_SRCS
- ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qprinter_wrapper.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qprinterinfo_wrapper.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qprintengine_wrapper.cpp
-)
-CHECK_QT_GUI_MACRO("Printer Support" QT_NO_PRINTER QT_PRINTER_SRCS QtGui_SRC)
-
-#Check QT_SIZEGRIP support
-set(QT_SIZEGRIP_SRCS
- ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qsizegrip_wrapper.cpp
-)
-CHECK_QT_GUI_MACRO("SizeGrip Support" QT_NO_SIZEGRIP QT_SIZEGRIP_SRCS QtGui_SRC)
-
-#Check QT_SESSIONMANAGER support
-set(QT_SESSIONMANAGER_SRCS
- ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qsessionmanager_wrapper.cpp
-)
-CHECK_QT_GUI_MACRO("SessionManager Support" QT_NO_SESSIONMANAGER QT_SESSIONMANAGER_SRCS QtGui_SRC)
+check_qt_class(QtGui QGtkStyle QtGui_SRC)
+check_qt_class(QtGui QSessionManager QtGui_SRC)
+check_qt_class(QtGui QSizeGrip QtGui_SRC)
+check_qt_class(QtGui QSystemTrayIcon QtGui_SRC)
set(QtGui_typesystem_path "${QtCore_SOURCE_DIR}")
set(QtGui_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
diff --git a/PySide/QtNetwork/CMakeLists.txt b/PySide/QtNetwork/CMakeLists.txt
index ca05993..691cf76 100644
--- a/PySide/QtNetwork/CMakeLists.txt
+++ b/PySide/QtNetwork/CMakeLists.txt
@@ -1,38 +1,5 @@
project(QtNetwork)
-# Check QtNetwork support
-macro(CHECK_QT_NETWORK_MACRO macro_display_name qt_macro module_sources global_sources)
- if (DEFINED PYSIDE_${qt_macro})
- if (PYSIDE_${qt_macro})
- list(APPEND ${global_sources} ${${module_sources}})
- endif()
- else()
- set(SRC_FILE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/test${qt_macro}.cxx)
- file(WRITE ${SRC_FILE}
- "#include \n"
- "int main() { \n"
- "#ifdef ${qt_macro}\n"
- "#error not supported.\n"
- "#endif\n"
- "}\n")
-
- try_compile(Q_WORKS ${CMAKE_BINARY_DIR}
- ${SRC_FILE}
- CMAKE_FLAGS
- -DINCLUDE_DIRECTORIES:STRING=${QT_QTNETWORK_INCLUDE_DIR}\;${QT_INCLUDE_DIR}
- -DLINK_LIBRARIES:PATH=${QT_QTNETWORK_LIBRARY_RELEASE}
- OUTPUT_VARIABLE OUTPUT)
-
- set("PYSIDE_${qt_macro}" ${Q_WORKS} CACHE STRING "Has this Qt module been found by pyside?")
- if(Q_WORKS)
- message(STATUS "Testing support to ${macro_display_name} -- enabled")
- list(APPEND ${global_sources} ${${module_sources}})
- else()
- message(STATUS "Testing support to ${macro_display_name} -- disabled")
- endif()
- endif()
-endmacro()
-
if (${QT_VERSION_MAJOR} EQUAL 4 AND ${QT_VERSION_MINOR} GREATER 6)
set (QtNetwork_47_SRC
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qnetworkconfiguration_wrapper.cpp
@@ -74,15 +41,11 @@ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qurlinfo_wrapper.cpp
${QtNetwork_47_SRC}
)
-set(OPENSSL_SOURCES
- ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qsslcipher_wrapper.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qsslkey_wrapper.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qsslconfiguration_wrapper.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qsslerror_wrapper.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qsslsocket_wrapper.cpp
-)
-
-CHECK_QT_NETWORK_MACRO("Network OPENSSL" QT_NO_OPENSSL OPENSSL_SOURCES QtNetwork_SRC)
+check_qt_class(QtNetwork QSslCipher QtNetwork_SRC)
+check_qt_class(QtNetwork QSslConfiguration QtNetwork_SRC)
+check_qt_class(QtNetwork QSslError QtNetwork_SRC)
+check_qt_class(QtNetwork QSslKey QtNetwork_SRC)
+check_qt_class(QtNetwork QSslSocket QtNetwork_SRC)
set(QtNetwork_typesystem_path "${QtCore_SOURCE_DIR}")
set(QtNetwork_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
From 6914f21603fa32727af0d419b6f438e88413ed7f Mon Sep 17 00:00:00 2001
From: Anderson Lizardo
Date: Fri, 13 Aug 2010 22:38:54 -0400
Subject: [PATCH 0167/1129] Add Qt Simulator support
Reviewed-by: Luciano Wolf
Reviewed-by: Hugo Parente Lima
---
CMakeLists.txt | 4 +++
PySide/QtGui/typesystem_gui_simulator.xml | 35 +++++++++++++++++++
.../QtWebKit/typesystem_webkit_simulator.xml | 11 ++++++
PySide/global.h.in | 2 ++
4 files changed, 52 insertions(+)
create mode 100644 PySide/QtGui/typesystem_gui_simulator.xml
create mode 100644 PySide/QtWebKit/typesystem_webkit_simulator.xml
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 244e558..c62fdf9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -75,6 +75,7 @@ endif()
set(ENABLE_X11 "0")
set(ENABLE_MAC "0")
set(ENABLE_WIN "0")
+set(ENABLE_SIMULATOR "0")
if(Q_WS_X11)
set(ENABLE_X11 "1")
if(Q_WS_MAEMO_5)
@@ -88,6 +89,9 @@ elseif(Q_WS_MAC)
elseif(Q_WS_WIN)
set(ENABLE_WIN "1")
set(AUTO_OS "win")
+elseif(Q_WS_SIMULATOR)
+ set(ENABLE_SIMULATOR "1")
+ set(AUTO_OS "simulator")
else()
message(FATAL_ERROR "OS not supported")
endif()
diff --git a/PySide/QtGui/typesystem_gui_simulator.xml b/PySide/QtGui/typesystem_gui_simulator.xml
new file mode 100644
index 0000000..1887349
--- /dev/null
+++ b/PySide/QtGui/typesystem_gui_simulator.xml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PySide/QtWebKit/typesystem_webkit_simulator.xml b/PySide/QtWebKit/typesystem_webkit_simulator.xml
new file mode 100644
index 0000000..f2a40f2
--- /dev/null
+++ b/PySide/QtWebKit/typesystem_webkit_simulator.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PySide/global.h.in b/PySide/global.h.in
index cf21bd6..ef85424 100644
--- a/PySide/global.h.in
+++ b/PySide/global.h.in
@@ -338,6 +338,8 @@ QT_END_HEADER
#define Q_WS_MAC
#elif @ENABLE_WIN@
#define Q_WS_WIN
+#elif @ENABLE_SIMULATOR@
+ #define Q_WS_SIMULATOR
#endif
// There are symbols in Qt that exist in Debug but
From 268bf7735b787d2310e18b3aed262bd27b9d24c6 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Thu, 26 Aug 2010 12:02:59 -0300
Subject: [PATCH 0168/1129] Fixed signal signature parser.
Fixes bug #311.
Reviewer: Luciano Wolf
Hugo Parente Lima
---
libpyside/qsignal.cpp | 21 +++++++++++-------
tests/signals/CMakeLists.txt | 1 +
tests/signals/bug_311.py | 42 ++++++++++++++++++++++++++++++++++++
3 files changed, 56 insertions(+), 8 deletions(-)
create mode 100644 tests/signals/bug_311.py
diff --git a/libpyside/qsignal.cpp b/libpyside/qsignal.cpp
index f465a7b..6c54203 100644
--- a/libpyside/qsignal.cpp
+++ b/libpyside/qsignal.cpp
@@ -250,15 +250,21 @@ char* signal_get_type_name(PyObject* type)
char *typeName = NULL;
if (type->ob_type == &Shiboken::SbkBaseWrapperType_Type) {
Shiboken::SbkBaseWrapperType *objType = reinterpret_cast(type);
+ Q_ASSERT(objType->original_name);
typeName = strdup(objType->original_name);
} else {
- //tp_name return the full name
- Shiboken::AutoDecRef otypeName(PyObject_GetAttrString(type, "__name__"));
- typeName = strdup(PyString_AS_STRING(otypeName.object()));
- }
- if (Shiboken::TypeResolver::getType(typeName) == Shiboken::TypeResolver::ObjectType) {
- typeName = reinterpret_cast(realloc(typeName, strlen(typeName) + 1));
- typeName = strcat(typeName, "*");
+ // Translate python types to Qt names
+ PyTypeObject *objType = reinterpret_cast(type);
+ if (objType == &PyString_Type)
+ typeName = strdup("QString");
+ else if (objType == &PyInt_Type)
+ typeName = strdup("int");
+ else if (objType == &PyLong_Type)
+ typeName = strdup("long");
+ else if (objType == &PyFloat_Type)
+ typeName = strdup("qreal");
+ else
+ typeName = strdup("object");
}
return typeName;
} else if (PyString_Check(type)) {
@@ -277,7 +283,6 @@ char* signal_build_signature(const char *name, const char *signature)
char* signal_parse_signature(PyObject *args)
{
char *signature = 0;
-
if (args && (PyString_Check(args) || (!PySequence_Check(args) && (args != Py_None))))
return signal_get_type_name(args);
diff --git a/tests/signals/CMakeLists.txt b/tests/signals/CMakeLists.txt
index eda247d..a69aa06 100644
--- a/tests/signals/CMakeLists.txt
+++ b/tests/signals/CMakeLists.txt
@@ -1,4 +1,5 @@
PYSIDE_TEST(args_dont_match_test.py)
+PYSIDE_TEST(bug_311.py)
PYSIDE_TEST(decorators_test.py)
PYSIDE_TEST(invalid_callback_test.py)
PYSIDE_TEST(lambda_gui_test.py)
diff --git a/tests/signals/bug_311.py b/tests/signals/bug_311.py
new file mode 100644
index 0000000..42ed5f3
--- /dev/null
+++ b/tests/signals/bug_311.py
@@ -0,0 +1,42 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+import unittest
+from PySide import QtCore
+from helper import UsesQCoreApplication
+
+class DerivedDate(QtCore.QDate):
+ def __init__(self,y,m,d):
+ super(DerivedDate,self).__init__(y,m,d)
+
+class Emitter(QtCore.QObject):
+ dateSignal1 = QtCore.Signal(QtCore.QDate)
+ dateSignal2 = QtCore.Signal(DerivedDate)
+ tupleSignal = QtCore.Signal(tuple)
+
+class SignaltoSignalTest(UsesQCoreApplication):
+ def myCb(self, dt):
+ self._dt = dt
+
+ def testBug(self):
+ e = Emitter()
+ d = DerivedDate(2010,8,24)
+ self._dt = None
+ e.dateSignal1.connect(self.myCb)
+ e.dateSignal1.emit(d)
+ self.assertEqual(self._dt, d)
+
+ self._dt = None
+ e.dateSignal2.connect(self.myCb)
+ e.dateSignal2.emit(d)
+ self.assertEqual(self._dt, d)
+
+ myTuple = (5, 6, 7)
+ self._dt = None
+ e.tupleSignal.connect(self.myCb)
+ e.tupleSignal.emit(myTuple)
+ self.assertEqual(myTuple, self._dt)
+
+if __name__ == '__main__':
+ unittest.main()
+
From a2f3e249bc0543b522c7d0e516dd07326e3ea7de Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Thu, 26 Aug 2010 15:23:23 -0300
Subject: [PATCH 0169/1129] Fixed slot singature parse function to keep
compatibility with QSignal.
Fixes bug #319
Reviewer: Luciano Wolf
Hugo Parente Lima
---
libpyside/qsignal.cpp | 11 ++++++-----
libpyside/qslot.cpp | 20 ++++----------------
tests/signals/CMakeLists.txt | 1 +
tests/signals/bug_319.py | 35 +++++++++++++++++++++++++++++++++++
4 files changed, 46 insertions(+), 21 deletions(-)
create mode 100644 tests/signals/bug_319.py
diff --git a/libpyside/qsignal.cpp b/libpyside/qsignal.cpp
index 6c54203..a4fda06 100644
--- a/libpyside/qsignal.cpp
+++ b/libpyside/qsignal.cpp
@@ -48,6 +48,8 @@ namespace PySide
extern "C"
{
+char* get_type_name(PyObject*);
+
typedef struct {
PyObject_HEAD
bool initialized;
@@ -68,7 +70,6 @@ static PyObject* signal_instance_get_item(PyObject*, PyObject*);
//aux
static char* signal_build_signature(const char*, const char*);
-static char* signal_get_type_name(PyObject*);
static void signal_append_signature(SignalData*, char*);
static void signal_instance_initialize(PyObject*, PyObject*, SignalData*, PyObject *, int);
static char* signal_parse_signature(PyObject*);
@@ -244,7 +245,7 @@ void signalUpdateSource(PyObject* source)
}
}
-char* signal_get_type_name(PyObject* type)
+char* get_type_name(PyObject* type)
{
if (PyType_Check(type)) {
char *typeName = NULL;
@@ -255,7 +256,7 @@ char* signal_get_type_name(PyObject* type)
} else {
// Translate python types to Qt names
PyTypeObject *objType = reinterpret_cast(type);
- if (objType == &PyString_Type)
+ if ((objType == &PyString_Type) || (objType == &PyUnicode_Type))
typeName = strdup("QString");
else if (objType == &PyInt_Type)
typeName = strdup("int");
@@ -284,11 +285,11 @@ char* signal_parse_signature(PyObject *args)
{
char *signature = 0;
if (args && (PyString_Check(args) || (!PySequence_Check(args) && (args != Py_None))))
- return signal_get_type_name(args);
+ return get_type_name(args);
for(Py_ssize_t i = 0, i_max = PySequence_Size(args); i < i_max; i++) {
Shiboken::AutoDecRef arg(PySequence_ITEM(args, i));
- char* typeName = signal_get_type_name(arg);
+ char* typeName = get_type_name(arg);
if (typeName) {
if (signature) {
signature = reinterpret_cast(realloc(signature, (strlen(signature) + 1 + strlen(typeName)) * sizeof(char*)));
diff --git a/libpyside/qslot.cpp b/libpyside/qslot.cpp
index e74838c..c471cbb 100644
--- a/libpyside/qslot.cpp
+++ b/libpyside/qslot.cpp
@@ -53,8 +53,8 @@ extern "C"
static int slot_init(PyObject*, PyObject*, PyObject*);
static PyObject* slot_call(PyObject*, PyObject*, PyObject*);
-//aux
-static char* slot_get_type_name(PyObject*);
+//external qsignal.cpp
+extern char* get_type_name(PyObject*);
// Class Definition -----------------------------------------------
@@ -120,18 +120,6 @@ void init_slot(PyObject *module)
} // extern "C"
-char* slot_get_type_name(PyObject *type)
-{
- if (PyType_Check(type)) {
- //tp_name return the full name
- Shiboken::AutoDecRef typeName(PyObject_GetAttrString(type, "__name__"));
- return strdup(PyString_AS_STRING(typeName.object()));
- } else if (PyString_Check(type)) {
- return strdup(PyString_AS_STRING(type));
- }
- return 0;
-}
-
int slot_init(PyObject *self, PyObject *args, PyObject *kw)
{
static PyObject *emptyTuple = 0;
@@ -148,7 +136,7 @@ int slot_init(PyObject *self, PyObject *args, PyObject *kw)
SlotData *data = reinterpret_cast(self);
for(Py_ssize_t i = 0, i_max = PyTuple_Size(args); i < i_max; i++) {
PyObject *argType = PyTuple_GET_ITEM(args, i);
- char *typeName = slot_get_type_name(argType);
+ char *typeName = get_type_name(argType);
if (typeName) {
if (data->args) {
data->args = reinterpret_cast(realloc(data->args, (strlen(data->args) + 1 + strlen(typeName)) * sizeof(char*)));
@@ -165,7 +153,7 @@ int slot_init(PyObject *self, PyObject *args, PyObject *kw)
data->slotName = strdup(argName);
if (argResult)
- data->resultType = slot_get_type_name(argResult);
+ data->resultType = get_type_name(argResult);
else
data->resultType = strdup("void");
diff --git a/tests/signals/CMakeLists.txt b/tests/signals/CMakeLists.txt
index a69aa06..5849dc5 100644
--- a/tests/signals/CMakeLists.txt
+++ b/tests/signals/CMakeLists.txt
@@ -1,5 +1,6 @@
PYSIDE_TEST(args_dont_match_test.py)
PYSIDE_TEST(bug_311.py)
+PYSIDE_TEST(bug_319.py)
PYSIDE_TEST(decorators_test.py)
PYSIDE_TEST(invalid_callback_test.py)
PYSIDE_TEST(lambda_gui_test.py)
diff --git a/tests/signals/bug_319.py b/tests/signals/bug_319.py
new file mode 100644
index 0000000..692b1bf
--- /dev/null
+++ b/tests/signals/bug_319.py
@@ -0,0 +1,35 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+import unittest
+from PySide import QtCore
+from helper import UsesQCoreApplication
+
+class Listener(QtCore.QObject):
+ def __init__(self):
+ QtCore.QObject.__init__(self, None)
+ self._phrase = []
+
+ @QtCore.Slot(tuple)
+ def listen(self, words):
+ for w in words:
+ self._phrase.append(w)
+
+class Communicate(QtCore.QObject):
+ # create a new signal on the fly and name it 'speak'
+ speak = QtCore.Signal(tuple)
+
+class SignaltoSignalTest(UsesQCoreApplication):
+ def testBug(self):
+ someone = Communicate()
+ someone2 = Listener()
+ # connect signal and slot
+ someone.speak.connect(someone2.listen)
+ # emit 'speak' signal
+ talk = ("one","two","three")
+ someone.speak.emit(talk)
+ self.assertEqual(someone2._phrase, list(talk))
+
+if __name__ == '__main__':
+ unittest.main()
+
From 653261e047871ae64d4e3bb97b7b24d05df06db3 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Thu, 26 Aug 2010 15:24:05 -0300
Subject: [PATCH 0170/1129] Now slots signatures in C++ use Qt notation.
Ex:
Slot(str, int) # Python
slot(QString, int) # C++
This allow the user create slots based on types, compatible with Qt Slots.
Reviewer: Luciano Wolf
Hugo Parente Lima
---
tests/signals/decorators_test.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/signals/decorators_test.py b/tests/signals/decorators_test.py
index db32ec9..c4497ab 100644
--- a/tests/signals/decorators_test.py
+++ b/tests/signals/decorators_test.py
@@ -41,7 +41,7 @@ class StaticMetaObjectTest(unittest.TestCase):
self.assert_(m.indexOfSlot('mySlot2(int)') > 0)
self.assert_(m.indexOfSlot('mySlot2(QString)') > 0)
self.assert_(m.indexOfSlot('mySlot3()') > 0)
- self.assert_(m.indexOfSlot('mySlot4(unicode,int)') > 0)
+ self.assert_(m.indexOfSlot('mySlot4(QString,int)') > 0)
def testEmission(self):
o = MyObject()
From c25215106caf093a02443059817f5ceb86457254 Mon Sep 17 00:00:00 2001
From: Anderson Lizardo
Date: Thu, 26 Aug 2010 15:10:12 -0400
Subject: [PATCH 0171/1129] Fix class checking for 64-bits
Reviewed-by: Lauro Neto
Reviewed-by: Bruno dos Santos de Araujo
---
PySide/CMakeLists.txt | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/PySide/CMakeLists.txt b/PySide/CMakeLists.txt
index 05dd4ff..cce0f4c 100644
--- a/PySide/CMakeLists.txt
+++ b/PySide/CMakeLists.txt
@@ -64,7 +64,8 @@ macro(check_qt_class module class global_sources)
file(WRITE ${SRC_FILE}
"#include <${module}>\n"
"#include \n"
- "int main() { return (int) &typeid(${class}); }\n"
+ "#include \n"
+ "int main() { return (intptr_t) &typeid(${class}); }\n"
)
try_compile(Q_WORKS ${CMAKE_BINARY_DIR}
${SRC_FILE}
From d552e6eba8a908b02dc032402f532245f672dad0 Mon Sep 17 00:00:00 2001
From: Anderson Lizardo
Date: Thu, 26 Aug 2010 15:11:25 -0400
Subject: [PATCH 0172/1129] Add missing checks for printing classes
Reviewed-by: Lauro Neto
Reviewed-by: Bruno dos Santos de Araujo
---
PySide/QtGui/CMakeLists.txt | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/PySide/QtGui/CMakeLists.txt b/PySide/QtGui/CMakeLists.txt
index a6787cd..f4ec6d3 100644
--- a/PySide/QtGui/CMakeLists.txt
+++ b/PySide/QtGui/CMakeLists.txt
@@ -378,6 +378,16 @@ check_qt_class(QtGui QSessionManager QtGui_SRC)
check_qt_class(QtGui QSizeGrip QtGui_SRC)
check_qt_class(QtGui QSystemTrayIcon QtGui_SRC)
+check_qt_class(QtGui QAbstractPageSetupDialog QtGui_SRC)
+check_qt_class(QtGui QAbstractPrintDialog QtGui_SRC)
+check_qt_class(QtGui QPageSetupDialog QtGui_SRC)
+check_qt_class(QtGui QPrintDialog QtGui_SRC)
+check_qt_class(QtGui QPrintPreviewWidget QtGui_SRC)
+check_qt_class(QtGui QPrintPreviewDialog QtGui_SRC)
+check_qt_class(QtGui QPrinter QtGui_SRC)
+check_qt_class(QtGui QPrinterInfo QtGui_SRC)
+check_qt_class(QtGui QPrintEngine QtGui_SRC)
+
set(QtGui_typesystem_path "${QtCore_SOURCE_DIR}")
set(QtGui_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/
From 2774fd8af75ad5a1f412d6e72493de438ce2b8ae Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Thu, 26 Aug 2010 18:12:45 -0300
Subject: [PATCH 0173/1129] Fixed Mac OS build
Fix parser of QApplication header.
Fixes bug #318
Reviewer: Luciano Wolf
Hugo Parente Lima
---
PySide/QtGui/typesystem_gui.xml | 2 ++
PySide/global.h.in | 2 ++
2 files changed, 4 insertions(+)
diff --git a/PySide/QtGui/typesystem_gui.xml b/PySide/QtGui/typesystem_gui.xml
index a5dcfd9..66c33d4 100644
--- a/PySide/QtGui/typesystem_gui.xml
+++ b/PySide/QtGui/typesystem_gui.xml
@@ -4361,6 +4361,8 @@
+
+
diff --git a/PySide/global.h.in b/PySide/global.h.in
index ef85424..402de4e 100644
--- a/PySide/global.h.in
+++ b/PySide/global.h.in
@@ -348,6 +348,8 @@ QT_END_HEADER
#include
#if @ENABLE_MAC@ || @ENABLE_WIN@
+ // Workaround to parse the QApplication header
+ #define Q_INTERNAL_QAPP_SRC
#undef qdoc
#endif
#include
From 7b2903ad21aba22798b4ceace38c34d29bf7b8cc Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Fri, 27 Aug 2010 12:12:19 -0300
Subject: [PATCH 0174/1129] Fix typesystem based on auto OS detection.
Reviewer: Luciano Wolf
Anderson Lizardo
---
PySide/CMakeLists.txt | 11 ++++++-----
PySide/QtCore/CMakeLists.txt | 3 ++-
PySide/QtCore/typesystem_core.xml | 1 +
PySide/QtDeclarative/CMakeLists.txt | 5 +++--
PySide/QtGui/CMakeLists.txt | 7 ++++++-
PySide/QtGui/typesystem_gui.xml.in | 6 ++++++
.../{typesystem_gui.xml => typesystem_gui_commom.xml} | 0
PySide/QtGui/typesystem_gui_mac.xml | 2 +-
PySide/QtGui/typesystem_gui_simulator.xml | 2 +-
PySide/QtGui/typesystem_gui_x11.xml | 2 +-
PySide/QtHelp/CMakeLists.txt | 5 +++--
PySide/QtMaemo5/CMakeLists.txt | 3 ++-
PySide/QtMultimedia/CMakeLists.txt | 5 +++--
PySide/QtNetwork/CMakeLists.txt | 3 ++-
PySide/QtOpenGL/CMakeLists.txt | 5 +++--
PySide/QtScript/CMakeLists.txt | 3 ++-
PySide/QtScriptTools/CMakeLists.txt | 5 +++--
PySide/QtSql/CMakeLists.txt | 5 +++--
PySide/QtSvg/CMakeLists.txt | 5 +++--
PySide/QtTest/CMakeLists.txt | 5 +++--
PySide/QtTest/typesystem_test.xml | 1 +
PySide/QtUiTools/CMakeLists.txt | 5 +++--
PySide/QtWebKit/CMakeLists.txt | 5 +++--
PySide/QtXml/CMakeLists.txt | 3 ++-
PySide/QtXmlPatterns/CMakeLists.txt | 3 ++-
PySide/phonon/CMakeLists.txt | 5 +++--
26 files changed, 68 insertions(+), 37 deletions(-)
create mode 100644 PySide/QtGui/typesystem_gui.xml.in
rename PySide/QtGui/{typesystem_gui.xml => typesystem_gui_commom.xml} (100%)
diff --git a/PySide/CMakeLists.txt b/PySide/CMakeLists.txt
index cce0f4c..d5368e3 100644
--- a/PySide/CMakeLists.txt
+++ b/PySide/CMakeLists.txt
@@ -6,12 +6,13 @@ macro(execute_generator module sources typesystem_path)
message("Running generator for ${module}...")
endmacro()
-macro(create_pyside_module module_name module_include_dir module_libraries module_deps module_typesystem_path module_sources)
+macro(create_pyside_module module_name module_include_dir module_libraries module_deps module_typesystem_path module_sources typesystem_name)
string(TOLOWER ${module_name} _module)
string(REGEX REPLACE ^qt "" _module ${_module})
- set(typesystem_prefix ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_${_module})
- if(EXISTS ${typesystem_prefix}_${AUTO_OS}.xml)
- set(typesystem_prefix ${typesystem_prefix}_${AUTO_OS})
+ if (NOT EXISTS ${typesystem_name})
+ set(typesystem_path ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_${_module}.xml)
+ else()
+ set(typesystem_path ${typesystem_name})
endif()
add_custom_command(OUTPUT ${${module_sources}}
@@ -21,7 +22,7 @@ macro(create_pyside_module module_name module_include_dir module_libraries modul
--typesystem-paths=${pyside_SOURCE_DIR}:${${module_typesystem_path}}
--output-directory=${CMAKE_CURRENT_BINARY_DIR}
--license-file=${CMAKE_CURRENT_SOURCE_DIR}/../licensecomment.txt
- ${typesystem_prefix}.xml
+ ${typesystem_path}
--api-version=${SUPPORTED_QT_VERSION}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Running generator for ${module_name}...")
diff --git a/PySide/QtCore/CMakeLists.txt b/PySide/QtCore/CMakeLists.txt
index 5a5951b..5bd295d 100644
--- a/PySide/QtCore/CMakeLists.txt
+++ b/PySide/QtCore/CMakeLists.txt
@@ -151,4 +151,5 @@ create_pyside_module(QtCore
QtCore_libraries
""
QtCore_typesystem_path
- QtCore_SRC)
+ QtCore_SRC
+ "")
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 2699128..f863386 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -2479,4 +2479,5 @@
+
diff --git a/PySide/QtDeclarative/CMakeLists.txt b/PySide/QtDeclarative/CMakeLists.txt
index d2b7e29..9b444b2 100644
--- a/PySide/QtDeclarative/CMakeLists.txt
+++ b/PySide/QtDeclarative/CMakeLists.txt
@@ -21,7 +21,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtDeclarative/qdeclarativeview_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtDeclarative/qtdeclarative_module_wrapper.cpp
)
-set(QtDeclarative_typesystem_path "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtNetwork_SOURCE_DIR}:${QtDeclarative_SOURCE_DIR}")
+set(QtDeclarative_typesystem_path "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtNetwork_SOURCE_DIR}:${QtDeclarative_SOURCE_DIR}:${QtGui_BINARY_DIR}")
set(QtDeclarative_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
${QT_QTCORE_INCLUDE_DIR}
@@ -55,5 +55,6 @@ create_pyside_module(QtDeclarative
QtDeclarative_libraries
QtDeclarative_deps
QtDeclarative_typesystem_path
- QtDeclarative_SRC)
+ QtDeclarative_SRC
+ "")
diff --git a/PySide/QtGui/CMakeLists.txt b/PySide/QtGui/CMakeLists.txt
index f4ec6d3..b2a5545 100644
--- a/PySide/QtGui/CMakeLists.txt
+++ b/PySide/QtGui/CMakeLists.txt
@@ -373,6 +373,10 @@ ${SPECIFIC_OS_FILES}
${QtGui_46_SRC}
)
+
+configure_file("${CMAKE_CURRENT_SOURCE_DIR}/typesystem_gui.xml.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/typesystem_gui.xml" @ONLY)
+
check_qt_class(QtGui QGtkStyle QtGui_SRC)
check_qt_class(QtGui QSessionManager QtGui_SRC)
check_qt_class(QtGui QSizeGrip QtGui_SRC)
@@ -407,5 +411,6 @@ create_pyside_module(QtGui
QtGui_libraries
QtGui_deps
QtGui_typesystem_path
- QtGui_SRC)
+ QtGui_SRC
+ "${CMAKE_CURRENT_BINARY_DIR}/typesystem_gui.xml")
diff --git a/PySide/QtGui/typesystem_gui.xml.in b/PySide/QtGui/typesystem_gui.xml.in
new file mode 100644
index 0000000..878f837
--- /dev/null
+++ b/PySide/QtGui/typesystem_gui.xml.in
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/PySide/QtGui/typesystem_gui.xml b/PySide/QtGui/typesystem_gui_commom.xml
similarity index 100%
rename from PySide/QtGui/typesystem_gui.xml
rename to PySide/QtGui/typesystem_gui_commom.xml
diff --git a/PySide/QtGui/typesystem_gui_mac.xml b/PySide/QtGui/typesystem_gui_mac.xml
index 56f1f32..a0c84c0 100644
--- a/PySide/QtGui/typesystem_gui_mac.xml
+++ b/PySide/QtGui/typesystem_gui_mac.xml
@@ -5,7 +5,7 @@
-
+
diff --git a/PySide/QtGui/typesystem_gui_simulator.xml b/PySide/QtGui/typesystem_gui_simulator.xml
index 1887349..5a122f0 100644
--- a/PySide/QtGui/typesystem_gui_simulator.xml
+++ b/PySide/QtGui/typesystem_gui_simulator.xml
@@ -31,5 +31,5 @@
-
+
diff --git a/PySide/QtGui/typesystem_gui_x11.xml b/PySide/QtGui/typesystem_gui_x11.xml
index 36f25ae..4275782 100644
--- a/PySide/QtGui/typesystem_gui_x11.xml
+++ b/PySide/QtGui/typesystem_gui_x11.xml
@@ -10,5 +10,5 @@
-
+
diff --git a/PySide/QtHelp/CMakeLists.txt b/PySide/QtHelp/CMakeLists.txt
index 0ffa400..e906072 100644
--- a/PySide/QtHelp/CMakeLists.txt
+++ b/PySide/QtHelp/CMakeLists.txt
@@ -15,7 +15,7 @@ set(QtHelp_SRC
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtHelp/qthelp_module_wrapper.cpp
)
-set(QtHelp_typesystem_path "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtHelp_SOURCE_DIR}")
+set(QtHelp_typesystem_path "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtHelp_SOURCE_DIR}:${QtGui_BINARY_DIR}")
set(QtHelp_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
${QT_QTCORE_INCLUDE_DIR}
${QT_QTGUI_INCLUDE_DIR}
@@ -38,4 +38,5 @@ create_pyside_module(QtHelp
QtHelp_libraries
QtHelp_deps
QtHelp_typesystem_path
- QtHelp_SRC)
+ QtHelp_SRC
+ "")
diff --git a/PySide/QtMaemo5/CMakeLists.txt b/PySide/QtMaemo5/CMakeLists.txt
index 74eaabd..5dae3d3 100644
--- a/PySide/QtMaemo5/CMakeLists.txt
+++ b/PySide/QtMaemo5/CMakeLists.txt
@@ -45,5 +45,6 @@ create_pyside_module(QtMaemo5
QtMaemo5_libraries
QtMaemo5_deps
QtMaemo5_typesystem_path
- QtMaemo5_SRC)
+ QtMaemo5_SRC
+ "")
diff --git a/PySide/QtMultimedia/CMakeLists.txt b/PySide/QtMultimedia/CMakeLists.txt
index 3dd7abb..d1e577c 100644
--- a/PySide/QtMultimedia/CMakeLists.txt
+++ b/PySide/QtMultimedia/CMakeLists.txt
@@ -17,7 +17,7 @@ set(QtMultimedia_SRC
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtMultimedia/qvideoframe_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtMultimedia/qtmultimedia_module_wrapper.cpp
)
-set(QtMultimedia_typesystem_path "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}")
+set(QtMultimedia_typesystem_path "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtGui_BINARY_DIR}")
set(QtMultimedia_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtMultimedia/
@@ -44,4 +44,5 @@ create_pyside_module(QtMultimedia
QtMultimedia_libraries
QtMultimedia_deps
QtMultimedia_typesystem_path
- QtMultimedia_SRC)
+ QtMultimedia_SRC
+ "")
diff --git a/PySide/QtNetwork/CMakeLists.txt b/PySide/QtNetwork/CMakeLists.txt
index 691cf76..768b80e 100644
--- a/PySide/QtNetwork/CMakeLists.txt
+++ b/PySide/QtNetwork/CMakeLists.txt
@@ -68,4 +68,5 @@ create_pyside_module(QtNetwork
QtNetwork_libraries
QtNetwork_deps
QtNetwork_typesystem_path
- QtNetwork_SRC)
+ QtNetwork_SRC
+ "")
diff --git a/PySide/QtOpenGL/CMakeLists.txt b/PySide/QtOpenGL/CMakeLists.txt
index 6ca3777..013d15f 100644
--- a/PySide/QtOpenGL/CMakeLists.txt
+++ b/PySide/QtOpenGL/CMakeLists.txt
@@ -32,7 +32,7 @@ set(QtOpenGL_SRC
${QtOpenGL_47_SRC}
)
-set(QtOpenGL_typesystem_path "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtOpenGL_SOURCE_DIR}")
+set(QtOpenGL_typesystem_path "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtOpenGL_SOURCE_DIR}:${QtGui_BINARY_DIR}")
set(QtOpenGL_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
${QT_QTCORE_INCLUDE_DIR}
${QT_QTGUI_INCLUDE_DIR}
@@ -54,4 +54,5 @@ create_pyside_module(QtOpenGL
QtOpenGL_libraries
QtOpenGL_deps
QtOpenGL_typesystem_path
- QtOpenGL_SRC)
+ QtOpenGL_SRC
+ "")
diff --git a/PySide/QtScript/CMakeLists.txt b/PySide/QtScript/CMakeLists.txt
index 87f7e06..af38768 100644
--- a/PySide/QtScript/CMakeLists.txt
+++ b/PySide/QtScript/CMakeLists.txt
@@ -45,4 +45,5 @@ create_pyside_module(QtScript
QtScript_libraries
QtScript_deps
QtScript_typesystem_path
- QtScript_SRC)
+ QtScript_SRC
+ "")
diff --git a/PySide/QtScriptTools/CMakeLists.txt b/PySide/QtScriptTools/CMakeLists.txt
index c15dd7a..21d3c7d 100644
--- a/PySide/QtScriptTools/CMakeLists.txt
+++ b/PySide/QtScriptTools/CMakeLists.txt
@@ -5,7 +5,7 @@ set(QtScriptTools_SRC
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtScriptTools/qscriptenginedebugger_wrapper.cpp
)
-set(QtScriptTools_typesystem_path "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtScript_SOURCE_DIR}:${QtScriptTools_SOURCE_DIR}")
+set(QtScriptTools_typesystem_path "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtScript_SOURCE_DIR}:${QtScriptTools_SOURCE_DIR}:${QtGui_BINARY_DIR}")
set(QtScriptTools_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
${QT_QTCORE_INCLUDE_DIR}
@@ -33,4 +33,5 @@ create_pyside_module(QtScriptTools
QtScriptTools_libraries
QtScriptTools_deps
QtScriptTools_typesystem_path
- QtScriptTools_SRC)
+ QtScriptTools_SRC
+ "")
diff --git a/PySide/QtSql/CMakeLists.txt b/PySide/QtSql/CMakeLists.txt
index e58e0c2..9e5587e 100644
--- a/PySide/QtSql/CMakeLists.txt
+++ b/PySide/QtSql/CMakeLists.txt
@@ -21,7 +21,7 @@ set(QtSql_SRC
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSql/qtsql_module_wrapper.cpp
)
-set(QtSql_typesystem_path "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtSql_SOURCE_DIR}")
+set(QtSql_typesystem_path "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtSql_SOURCE_DIR}:${QtGui_BINARY_DIR}")
set(QtSql_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
${QT_QTCORE_INCLUDE_DIR}
${QT_QTGUI_INCLUDE_DIR}
@@ -43,4 +43,5 @@ create_pyside_module(QtSql
QtSql_libraries
QtSql_deps
QtSql_typesystem_path
- QtSql_SRC)
+ QtSql_SRC
+ "")
diff --git a/PySide/QtSvg/CMakeLists.txt b/PySide/QtSvg/CMakeLists.txt
index 4517fc0..e9238c9 100644
--- a/PySide/QtSvg/CMakeLists.txt
+++ b/PySide/QtSvg/CMakeLists.txt
@@ -8,7 +8,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSvg/qsvgwidget_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSvg/qtsvg_module_wrapper.cpp
)
-set(QtSvg_typesystem_path "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}")
+set(QtSvg_typesystem_path "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtGui_BINARY_DIR}")
set(QtSvg_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSvg/
${QT_INCLUDE_DIR}
@@ -31,4 +31,5 @@ create_pyside_module(QtSvg
QtSvg_libraries
QtSvg_deps
QtSvg_typesystem_path
- QtSvg_SRC)
+ QtSvg_SRC
+ "")
diff --git a/PySide/QtTest/CMakeLists.txt b/PySide/QtTest/CMakeLists.txt
index 5fffb8e..34044da 100644
--- a/PySide/QtTest/CMakeLists.txt
+++ b/PySide/QtTest/CMakeLists.txt
@@ -5,7 +5,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtTest/qtest_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtTest/qttest_module_wrapper.cpp
)
-set(QtTest_typesystem_path "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}")
+set(QtTest_typesystem_path "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtGui_BINARY_DIR}")
set(QtTest_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtTest/
${QT_INCLUDE_DIR}
@@ -29,4 +29,5 @@ create_pyside_module(QtTest
QtTest_libraries
QtTest_deps
QtTest_typesystem_path
- QtTest_SRC)
+ QtTest_SRC
+ "")
diff --git a/PySide/QtTest/typesystem_test.xml b/PySide/QtTest/typesystem_test.xml
index bc447ee..734bbbb 100644
--- a/PySide/QtTest/typesystem_test.xml
+++ b/PySide/QtTest/typesystem_test.xml
@@ -48,6 +48,7 @@
+
diff --git a/PySide/QtUiTools/CMakeLists.txt b/PySide/QtUiTools/CMakeLists.txt
index ed4c66c..0120207 100644
--- a/PySide/QtUiTools/CMakeLists.txt
+++ b/PySide/QtUiTools/CMakeLists.txt
@@ -5,7 +5,7 @@ set(QtUiTools_SRC
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtUiTools/quiloader_wrapper.cpp
)
-set(QtUiTools_typesystem_path "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtXml_SOURCE_DIR}:${QtUiTools_SOURCE_DIR}")
+set(QtUiTools_typesystem_path "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtXml_SOURCE_DIR}:${QtUiTools_SOURCE_DIR}:${QtGui_BINARY_DIR}")
set(QtUiTools_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
${QT_QTCORE_INCLUDE_DIR}
${QT_QTGUI_INCLUDE_DIR}
@@ -29,4 +29,5 @@ create_pyside_module(QtUiTools
QtUiTools_libraries
QtUiTools_deps
QtUiTools_typesystem_path
- QtUiTools_SRC)
+ QtUiTools_SRC
+ "")
diff --git a/PySide/QtWebKit/CMakeLists.txt b/PySide/QtWebKit/CMakeLists.txt
index 4a89360..5387519 100644
--- a/PySide/QtWebKit/CMakeLists.txt
+++ b/PySide/QtWebKit/CMakeLists.txt
@@ -31,7 +31,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/webcore_wrapper.cpp
${QtWebKit_46_SRC}
)
-set(QtWebKit_typesystem_path "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtNetwork_SOURCE_DIR}")
+set(QtWebKit_typesystem_path "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtNetwork_SOURCE_DIR}:${QtGui_BINARY_DIR}")
set(QtWebkit_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebkit/
${QT_INCLUDE_DIR}
@@ -57,5 +57,6 @@ create_pyside_module(QtWebKit
QtWebKit_libraries
QtWebKit_deps
QtWebKit_typesystem_path
- QtWebKit_SRC)
+ QtWebKit_SRC
+ "")
diff --git a/PySide/QtXml/CMakeLists.txt b/PySide/QtXml/CMakeLists.txt
index 628dd00..f461a93 100644
--- a/PySide/QtXml/CMakeLists.txt
+++ b/PySide/QtXml/CMakeLists.txt
@@ -56,4 +56,5 @@ create_pyside_module(QtXml
QtXml_libraries
QtXml_deps
QtXml_typesystem_path
- QtXml_SRC)
+ QtXml_SRC
+ "")
diff --git a/PySide/QtXmlPatterns/CMakeLists.txt b/PySide/QtXmlPatterns/CMakeLists.txt
index 4db6e9d..6c11213 100644
--- a/PySide/QtXmlPatterns/CMakeLists.txt
+++ b/PySide/QtXmlPatterns/CMakeLists.txt
@@ -45,5 +45,6 @@ create_pyside_module(QtXmlPatterns
QtXmlPatterns_libraries
QtXmlPatterns_deps
QtXmlPatterns_typesystem_path
- QtXmlPatterns_SRC)
+ QtXmlPatterns_SRC
+ "")
diff --git a/PySide/phonon/CMakeLists.txt b/PySide/phonon/CMakeLists.txt
index 948166a..9fd1e35 100644
--- a/PySide/phonon/CMakeLists.txt
+++ b/PySide/phonon/CMakeLists.txt
@@ -43,7 +43,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_volumeslider_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_backendcapabilities_notifierwrapper_wrapper.cpp
)
-set(phonon_typesystem_path "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${phonon_SOURCE_DIR}")
+set(phonon_typesystem_path "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${phonon_SOURCE_DIR}:${QtGui_BINARY_DIR}")
set(phonon_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
${QT_QTCORE_INCLUDE_DIR}
${QT_QTGUI_INCLUDE_DIR}
@@ -66,4 +66,5 @@ create_pyside_module(phonon
phonon_libraries
phonon_deps
phonon_typesystem_path
- phonon_SRC)
+ phonon_SRC
+ "")
From d27d6958c07fdb2d452484ddda0b615c43c8db7b Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Mon, 30 Aug 2010 17:28:13 -0300
Subject: [PATCH 0175/1129] Fix bug#309 - "QtCore.QByteArray() or list from
QtCore.Qsettings.value() as default"
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Reviewer: Luciano Wolf
Renato Araújo
---
PySide/QtCore/qvariant_conversions.h | 3 +++
tests/QtCore/qbytearray_test.py | 8 +++++---
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/PySide/QtCore/qvariant_conversions.h b/PySide/QtCore/qvariant_conversions.h
index 7a799e1..a471ce6 100644
--- a/PySide/QtCore/qvariant_conversions.h
+++ b/PySide/QtCore/qvariant_conversions.h
@@ -28,6 +28,9 @@ struct Converter
} else if (Converter::checkType(pyObj)) {
// QVariant(const char*)
return QVariant(Converter::toCpp(pyObj));
+ } else if (Converter::checkType(pyObj)) {
+ // QVariant(QByteArray)
+ return QVariant(Converter::toCpp(pyObj));
} else if (PyFloat_CheckExact(pyObj)) {
// QVariant(double)
return QVariant(Converter::toCpp(pyObj));
diff --git a/tests/QtCore/qbytearray_test.py b/tests/QtCore/qbytearray_test.py
index 20bba14..1c425b8 100644
--- a/tests/QtCore/qbytearray_test.py
+++ b/tests/QtCore/qbytearray_test.py
@@ -5,7 +5,7 @@ import unittest
import ctypes
import sys
-from PySide.QtCore import QByteArray
+from PySide.QtCore import *
class QByteArrayTestToNumber(unittest.TestCase):
def testToNumberInt(self):
@@ -91,8 +91,10 @@ class QByteArrayOperatorAtSetterLargeIndex(unittest.TestCase):
obj[10] = 'normal'
self.assertEqual(obj, QByteArray('mystring normal'))
-
-
+class QByteArrayOnQVariant(unittest.TestCase):
+ def testQByteArrayOnQVariant(self):
+ a = QSettings().value("some_prop", QByteArray())
+ self.assertEqual(type(a), QByteArray)
if __name__ == '__main__':
unittest.main()
From a326f0ff296dfc0ce1f7457fdbe9ac04f3f11616 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Mon, 30 Aug 2010 18:08:14 -0300
Subject: [PATCH 0176/1129] Fixed args type parse for bool types on signal.
---
libpyside/qsignal.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libpyside/qsignal.cpp b/libpyside/qsignal.cpp
index a4fda06..41cc71d 100644
--- a/libpyside/qsignal.cpp
+++ b/libpyside/qsignal.cpp
@@ -264,6 +264,8 @@ char* get_type_name(PyObject* type)
typeName = strdup("long");
else if (objType == &PyFloat_Type)
typeName = strdup("qreal");
+ else if (objType == &PyBool_Type)
+ typeName = strdup("bool");
else
typeName = strdup("object");
}
From a44c2b9792b183819871617d04be24319721f77f Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Mon, 30 Aug 2010 19:21:14 -0300
Subject: [PATCH 0177/1129] Removed manually added function on QItemSelection
to use automatic code insertion base on container type.
Reviewer: Luciano Wolf
Hugo Parente Lima
---
PySide/QtGui/typesystem_gui_commom.xml | 5 -----
1 file changed, 5 deletions(-)
diff --git a/PySide/QtGui/typesystem_gui_commom.xml b/PySide/QtGui/typesystem_gui_commom.xml
index 66c33d4..686fc5f 100644
--- a/PySide/QtGui/typesystem_gui_commom.xml
+++ b/PySide/QtGui/typesystem_gui_commom.xml
@@ -704,11 +704,6 @@
-
-
- return %CPPSELF.count();
-
-
From b9bf521a93785ccd935cc4ce1464cb612c4fdbfe Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Tue, 31 Aug 2010 10:59:04 -0300
Subject: [PATCH 0178/1129] Unittest to bug #324.
Reviewer: Luciano Wolf
Hugo Parente Lima
---
tests/QtGui/qpushbutton_test.py | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/tests/QtGui/qpushbutton_test.py b/tests/QtGui/qpushbutton_test.py
index 9849608..e7f81e6 100644
--- a/tests/QtGui/qpushbutton_test.py
+++ b/tests/QtGui/qpushbutton_test.py
@@ -25,6 +25,17 @@ class QPushButtonTest(UsesQApplication):
timer = QTimer.singleShot(100, self.app.quit)
self.app.exec_()
+ def buttonCb(self, checked):
+ self._clicked = True
+
+ def testBoolinSignal(self):
+ b = QPushButton()
+ b.setCheckable(True)
+ self._clicked = False
+ b.toggled[bool].connect(self.buttonCb)
+ b.toggle()
+ self.assert_(self._clicked)
+
if __name__ == '__main__':
unittest.main()
From 28000755c2913851a3c7c339a8eabe6ece450c30 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Tue, 31 Aug 2010 11:35:43 -0300
Subject: [PATCH 0179/1129] Created unittest to bug #324.
Reviewer: Luciano Wolf
Hugo Parente Lima
---
tests/QtGui/CMakeLists.txt | 1 +
tests/QtGui/bug_324.py | 32 ++++++++++++++++++++++++++++++++
2 files changed, 33 insertions(+)
create mode 100644 tests/QtGui/bug_324.py
diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt
index 5bccc20..b73e1ce 100644
--- a/tests/QtGui/CMakeLists.txt
+++ b/tests/QtGui/CMakeLists.txt
@@ -3,6 +3,7 @@
PYSIDE_TEST(api2_test.py)
PYSIDE_TEST(bug_243.py)
PYSIDE_TEST(bug_307.py)
+PYSIDE_TEST(bug_324.py)
PYSIDE_TEST(add_action_test.py)
PYSIDE_TEST(customproxywidget_test.py)
PYSIDE_TEST(float_to_int_implicit_conversion_test.py)
diff --git a/tests/QtGui/bug_324.py b/tests/QtGui/bug_324.py
new file mode 100644
index 0000000..9777b73
--- /dev/null
+++ b/tests/QtGui/bug_324.py
@@ -0,0 +1,32 @@
+''' Test bug 324: http://bugs.openbossa.org/show_bug.cgi?id=324'''
+
+import unittest
+import sys
+import signal
+from PySide.QtCore import *
+from PySide.QtGui import *
+
+class QBug( QObject ):
+ def __init__(self, parent = None):
+ QObject.__init__(self, parent)
+
+ def check(self):
+ self.done.emit("abc")
+
+ done = Signal(str)
+
+class Bug324(unittest.TestCase):
+
+ def on_done(self, val):
+ self.value = val
+
+ def testBug(self):
+ app = QApplication([])
+ bug = QBug()
+ self.value = ''
+ bug.done.connect(self.on_done)
+ bug.check()
+ self.assertEqual(self.value, 'abc')
+
+if __name__ == '__main__':
+ unittest.main()
From dc1eef279e3b34f5e978e2e07a80969b07a112e8 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Tue, 31 Aug 2010 16:26:15 -0300
Subject: [PATCH 0180/1129] Fix Qt class detection on Windows.
---
PySide/CMakeLists.txt | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/PySide/CMakeLists.txt b/PySide/CMakeLists.txt
index d5368e3..4c01795 100644
--- a/PySide/CMakeLists.txt
+++ b/PySide/CMakeLists.txt
@@ -65,8 +65,7 @@ macro(check_qt_class module class global_sources)
file(WRITE ${SRC_FILE}
"#include <${module}>\n"
"#include \n"
- "#include \n"
- "int main() { return (intptr_t) &typeid(${class}); }\n"
+ "int main() { typeid(${class}); }\n"
)
try_compile(Q_WORKS ${CMAKE_BINARY_DIR}
${SRC_FILE}
From 7638112ea84ee3ed2b9a671179e46c81e694afd8 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Tue, 31 Aug 2010 16:30:04 -0300
Subject: [PATCH 0181/1129] Do not include QtGui common typesystem twice.
---
PySide/QtGui/typesystem_gui_mac.xml | 2 --
PySide/QtGui/typesystem_gui_simulator.xml | 2 --
PySide/QtGui/typesystem_gui_win.xml | 1 -
PySide/QtGui/typesystem_gui_x11.xml | 2 --
4 files changed, 7 deletions(-)
diff --git a/PySide/QtGui/typesystem_gui_mac.xml b/PySide/QtGui/typesystem_gui_mac.xml
index a0c84c0..3360323 100644
--- a/PySide/QtGui/typesystem_gui_mac.xml
+++ b/PySide/QtGui/typesystem_gui_mac.xml
@@ -5,8 +5,6 @@
-
-
diff --git a/PySide/QtGui/typesystem_gui_simulator.xml b/PySide/QtGui/typesystem_gui_simulator.xml
index 5a122f0..8b10c22 100644
--- a/PySide/QtGui/typesystem_gui_simulator.xml
+++ b/PySide/QtGui/typesystem_gui_simulator.xml
@@ -30,6 +30,4 @@
-
-
diff --git a/PySide/QtGui/typesystem_gui_win.xml b/PySide/QtGui/typesystem_gui_win.xml
index f44d3d4..f19521e 100644
--- a/PySide/QtGui/typesystem_gui_win.xml
+++ b/PySide/QtGui/typesystem_gui_win.xml
@@ -2,5 +2,4 @@
-
diff --git a/PySide/QtGui/typesystem_gui_x11.xml b/PySide/QtGui/typesystem_gui_x11.xml
index 4275782..0731045 100644
--- a/PySide/QtGui/typesystem_gui_x11.xml
+++ b/PySide/QtGui/typesystem_gui_x11.xml
@@ -9,6 +9,4 @@
-
-
From 60122d3709b1b66fc711b10c39cb3c75d17c4908 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Tue, 31 Aug 2010 16:31:10 -0300
Subject: [PATCH 0182/1129] Use the correct path separator when under Windows.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Reviewer: Luciano Wolf
Renato Araújo
---
CMakeLists.txt | 6 ++++++
PySide/CMakeLists.txt | 6 +++---
PySide/QtDeclarative/CMakeLists.txt | 2 +-
PySide/QtGui/CMakeLists.txt | 2 +-
PySide/QtHelp/CMakeLists.txt | 2 +-
PySide/QtMaemo5/CMakeLists.txt | 2 +-
PySide/QtMultimedia/CMakeLists.txt | 2 +-
PySide/QtOpenGL/CMakeLists.txt | 2 +-
PySide/QtScriptTools/CMakeLists.txt | 2 +-
PySide/QtSql/CMakeLists.txt | 2 +-
PySide/QtSvg/CMakeLists.txt | 2 +-
PySide/QtTest/CMakeLists.txt | 2 +-
PySide/QtUiTools/CMakeLists.txt | 2 +-
PySide/QtWebKit/CMakeLists.txt | 2 +-
PySide/phonon/CMakeLists.txt | 2 +-
15 files changed, 22 insertions(+), 16 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c62fdf9..9810f7c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -97,6 +97,12 @@ else()
endif()
message(STATUS "Detected OS: ${AUTO_OS}")
+if (WIN32)
+ set(PATH_SEP "\;")
+else()
+ set(PATH_SEP ":")
+endif()
+
# Define supported Qt Version
if(${QT_VERSION_MAJOR} EQUAL 4 AND ${QT_VERSION_MINOR} GREATER 6)
set(SUPPORTED_QT_VERSION 4.7)
diff --git a/PySide/CMakeLists.txt b/PySide/CMakeLists.txt
index 4c01795..09dd144 100644
--- a/PySide/CMakeLists.txt
+++ b/PySide/CMakeLists.txt
@@ -18,8 +18,8 @@ macro(create_pyside_module module_name module_include_dir module_libraries modul
add_custom_command(OUTPUT ${${module_sources}}
COMMAND ${GENERATOR} ${GENERATOR_EXTRA_FLAGS}
${CMAKE_BINARY_DIR}/PySide/global.h
- --include-paths=${pyside_SOURCE_DIR}:${QT_INCLUDE_DIR}
- --typesystem-paths=${pyside_SOURCE_DIR}:${${module_typesystem_path}}
+ --include-paths=${pyside_SOURCE_DIR}${PATH_SEP}${QT_INCLUDE_DIR}
+ --typesystem-paths=${pyside_SOURCE_DIR}${PATH_SEP}${${module_typesystem_path}}
--output-directory=${CMAKE_CURRENT_BINARY_DIR}
--license-file=${CMAKE_CURRENT_SOURCE_DIR}/../licensecomment.txt
${typesystem_path}
@@ -76,7 +76,7 @@ macro(check_qt_class module class global_sources)
OUTPUT_VARIABLE OUTPUT)
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCheckQtClassTest.log ${OUTPUT})
- set("PYSIDE_${class}" ${Q_WORKS} CACHE STRING "Has this Qt class been found?")
+ set("PYSIDE_${class}" ${Q_WORKS} CACHE STRING "Has ${class} class been found?")
if(Q_WORKS)
message(STATUS "Checking for ${class} in ${module} -- found")
list(APPEND ${global_sources} ${_cppfile})
diff --git a/PySide/QtDeclarative/CMakeLists.txt b/PySide/QtDeclarative/CMakeLists.txt
index 9b444b2..1966cab 100644
--- a/PySide/QtDeclarative/CMakeLists.txt
+++ b/PySide/QtDeclarative/CMakeLists.txt
@@ -21,7 +21,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtDeclarative/qdeclarativeview_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtDeclarative/qtdeclarative_module_wrapper.cpp
)
-set(QtDeclarative_typesystem_path "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtNetwork_SOURCE_DIR}:${QtDeclarative_SOURCE_DIR}:${QtGui_BINARY_DIR}")
+set(QtDeclarative_typesystem_path "${QtCore_SOURCE_DIR}${PATH_SEP}${QtGui_SOURCE_DIR}${PATH_SEP}${QtNetwork_SOURCE_DIR}${PATH_SEP}${QtDeclarative_SOURCE_DIR}${PATH_SEP}${QtGui_BINARY_DIR}")
set(QtDeclarative_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
${QT_QTCORE_INCLUDE_DIR}
diff --git a/PySide/QtGui/CMakeLists.txt b/PySide/QtGui/CMakeLists.txt
index b2a5545..902243b 100644
--- a/PySide/QtGui/CMakeLists.txt
+++ b/PySide/QtGui/CMakeLists.txt
@@ -392,7 +392,7 @@ check_qt_class(QtGui QPrinter QtGui_SRC)
check_qt_class(QtGui QPrinterInfo QtGui_SRC)
check_qt_class(QtGui QPrintEngine QtGui_SRC)
-set(QtGui_typesystem_path "${QtCore_SOURCE_DIR}")
+set(QtGui_typesystem_path "${QtCore_SOURCE_DIR}${PATH_SEP}${QtGui_SOURCE_DIR}")
set(QtGui_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/
${QT_INCLUDE_DIR}
diff --git a/PySide/QtHelp/CMakeLists.txt b/PySide/QtHelp/CMakeLists.txt
index e906072..1f7a3cd 100644
--- a/PySide/QtHelp/CMakeLists.txt
+++ b/PySide/QtHelp/CMakeLists.txt
@@ -15,7 +15,7 @@ set(QtHelp_SRC
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtHelp/qthelp_module_wrapper.cpp
)
-set(QtHelp_typesystem_path "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtHelp_SOURCE_DIR}:${QtGui_BINARY_DIR}")
+set(QtHelp_typesystem_path "${QtCore_SOURCE_DIR}${PATH_SEP}${QtGui_SOURCE_DIR}${PATH_SEP}${QtHelp_SOURCE_DIR}${PATH_SEP}${QtGui_BINARY_DIR}")
set(QtHelp_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
${QT_QTCORE_INCLUDE_DIR}
${QT_QTGUI_INCLUDE_DIR}
diff --git a/PySide/QtMaemo5/CMakeLists.txt b/PySide/QtMaemo5/CMakeLists.txt
index 5dae3d3..1d4b296 100644
--- a/PySide/QtMaemo5/CMakeLists.txt
+++ b/PySide/QtMaemo5/CMakeLists.txt
@@ -11,7 +11,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/${BINDING_NAME}/QtMaemo5/qmaemo5valuebutton_wrapper.
${CMAKE_CURRENT_BINARY_DIR}/${BINDING_NAME}/QtMaemo5/qtmaemo5_module_wrapper.cpp
)
-set(QtMaemo5_typesystem_path "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtMaemo5_SOURCE_DIR}")
+set(QtMaemo5_typesystem_path "${QtCore_SOURCE_DIR}${PATH_SEP}${QtGui_SOURCE_DIR}${PATH_SEP}${QtMaemo5_SOURCE_DIR}")
# QT_QTMAEMO5_* variables are not defined by CMake
if(NOT QT_QTMAEMO5_INCLUDE_DIR)
diff --git a/PySide/QtMultimedia/CMakeLists.txt b/PySide/QtMultimedia/CMakeLists.txt
index d1e577c..7db481e 100644
--- a/PySide/QtMultimedia/CMakeLists.txt
+++ b/PySide/QtMultimedia/CMakeLists.txt
@@ -17,7 +17,7 @@ set(QtMultimedia_SRC
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtMultimedia/qvideoframe_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtMultimedia/qtmultimedia_module_wrapper.cpp
)
-set(QtMultimedia_typesystem_path "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtGui_BINARY_DIR}")
+set(QtMultimedia_typesystem_path "${QtCore_SOURCE_DIR}${PATH_SEP}${QtGui_SOURCE_DIR}${PATH_SEP}${QtGui_BINARY_DIR}")
set(QtMultimedia_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtMultimedia/
diff --git a/PySide/QtOpenGL/CMakeLists.txt b/PySide/QtOpenGL/CMakeLists.txt
index 013d15f..8e72a6a 100644
--- a/PySide/QtOpenGL/CMakeLists.txt
+++ b/PySide/QtOpenGL/CMakeLists.txt
@@ -32,7 +32,7 @@ set(QtOpenGL_SRC
${QtOpenGL_47_SRC}
)
-set(QtOpenGL_typesystem_path "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtOpenGL_SOURCE_DIR}:${QtGui_BINARY_DIR}")
+set(QtOpenGL_typesystem_path "${QtCore_SOURCE_DIR}${PATH_SEP}${QtGui_SOURCE_DIR}${PATH_SEP}${QtOpenGL_SOURCE_DIR}${PATH_SEP}${QtGui_BINARY_DIR}")
set(QtOpenGL_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
${QT_QTCORE_INCLUDE_DIR}
${QT_QTGUI_INCLUDE_DIR}
diff --git a/PySide/QtScriptTools/CMakeLists.txt b/PySide/QtScriptTools/CMakeLists.txt
index 21d3c7d..246cb92 100644
--- a/PySide/QtScriptTools/CMakeLists.txt
+++ b/PySide/QtScriptTools/CMakeLists.txt
@@ -5,7 +5,7 @@ set(QtScriptTools_SRC
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtScriptTools/qscriptenginedebugger_wrapper.cpp
)
-set(QtScriptTools_typesystem_path "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtScript_SOURCE_DIR}:${QtScriptTools_SOURCE_DIR}:${QtGui_BINARY_DIR}")
+set(QtScriptTools_typesystem_path "${QtCore_SOURCE_DIR}${PATH_SEP}${QtGui_SOURCE_DIR}${PATH_SEP}${QtScript_SOURCE_DIR}${PATH_SEP}${QtScriptTools_SOURCE_DIR}${PATH_SEP}${QtGui_BINARY_DIR}")
set(QtScriptTools_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
${QT_QTCORE_INCLUDE_DIR}
diff --git a/PySide/QtSql/CMakeLists.txt b/PySide/QtSql/CMakeLists.txt
index 9e5587e..c5777dd 100644
--- a/PySide/QtSql/CMakeLists.txt
+++ b/PySide/QtSql/CMakeLists.txt
@@ -21,7 +21,7 @@ set(QtSql_SRC
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSql/qtsql_module_wrapper.cpp
)
-set(QtSql_typesystem_path "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtSql_SOURCE_DIR}:${QtGui_BINARY_DIR}")
+set(QtSql_typesystem_path "${QtCore_SOURCE_DIR}${PATH_SEP}${QtGui_SOURCE_DIR}${PATH_SEP}${QtSql_SOURCE_DIR}${PATH_SEP}${QtGui_BINARY_DIR}")
set(QtSql_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
${QT_QTCORE_INCLUDE_DIR}
${QT_QTGUI_INCLUDE_DIR}
diff --git a/PySide/QtSvg/CMakeLists.txt b/PySide/QtSvg/CMakeLists.txt
index e9238c9..0c31dbf 100644
--- a/PySide/QtSvg/CMakeLists.txt
+++ b/PySide/QtSvg/CMakeLists.txt
@@ -8,7 +8,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSvg/qsvgwidget_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSvg/qtsvg_module_wrapper.cpp
)
-set(QtSvg_typesystem_path "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtGui_BINARY_DIR}")
+set(QtSvg_typesystem_path "${QtCore_SOURCE_DIR}${PATH_SEP}${QtGui_SOURCE_DIR}${PATH_SEP}${QtGui_BINARY_DIR}")
set(QtSvg_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSvg/
${QT_INCLUDE_DIR}
diff --git a/PySide/QtTest/CMakeLists.txt b/PySide/QtTest/CMakeLists.txt
index 34044da..064e9a8 100644
--- a/PySide/QtTest/CMakeLists.txt
+++ b/PySide/QtTest/CMakeLists.txt
@@ -5,7 +5,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtTest/qtest_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtTest/qttest_module_wrapper.cpp
)
-set(QtTest_typesystem_path "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtGui_BINARY_DIR}")
+set(QtTest_typesystem_path "${QtCore_SOURCE_DIR}${PATH_SEP}${QtGui_SOURCE_DIR}${PATH_SEP}${QtGui_BINARY_DIR}")
set(QtTest_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtTest/
${QT_INCLUDE_DIR}
diff --git a/PySide/QtUiTools/CMakeLists.txt b/PySide/QtUiTools/CMakeLists.txt
index 0120207..9922e9d 100644
--- a/PySide/QtUiTools/CMakeLists.txt
+++ b/PySide/QtUiTools/CMakeLists.txt
@@ -5,7 +5,7 @@ set(QtUiTools_SRC
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtUiTools/quiloader_wrapper.cpp
)
-set(QtUiTools_typesystem_path "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtXml_SOURCE_DIR}:${QtUiTools_SOURCE_DIR}:${QtGui_BINARY_DIR}")
+set(QtUiTools_typesystem_path "${QtCore_SOURCE_DIR}${PATH_SEP}${QtGui_SOURCE_DIR}${PATH_SEP}${QtXml_SOURCE_DIR}${PATH_SEP}${QtUiTools_SOURCE_DIR}${PATH_SEP}${QtGui_BINARY_DIR}")
set(QtUiTools_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
${QT_QTCORE_INCLUDE_DIR}
${QT_QTGUI_INCLUDE_DIR}
diff --git a/PySide/QtWebKit/CMakeLists.txt b/PySide/QtWebKit/CMakeLists.txt
index 5387519..d23fa3e 100644
--- a/PySide/QtWebKit/CMakeLists.txt
+++ b/PySide/QtWebKit/CMakeLists.txt
@@ -31,7 +31,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/webcore_wrapper.cpp
${QtWebKit_46_SRC}
)
-set(QtWebKit_typesystem_path "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtNetwork_SOURCE_DIR}:${QtGui_BINARY_DIR}")
+set(QtWebKit_typesystem_path "${QtCore_SOURCE_DIR}${PATH_SEP}${QtGui_SOURCE_DIR}${PATH_SEP}${QtNetwork_SOURCE_DIR}${PATH_SEP}${QtGui_BINARY_DIR}")
set(QtWebkit_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebkit/
${QT_INCLUDE_DIR}
diff --git a/PySide/phonon/CMakeLists.txt b/PySide/phonon/CMakeLists.txt
index 9fd1e35..5961a9e 100644
--- a/PySide/phonon/CMakeLists.txt
+++ b/PySide/phonon/CMakeLists.txt
@@ -43,7 +43,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_volumeslider_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_backendcapabilities_notifierwrapper_wrapper.cpp
)
-set(phonon_typesystem_path "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${phonon_SOURCE_DIR}:${QtGui_BINARY_DIR}")
+set(phonon_typesystem_path "${QtCore_SOURCE_DIR}${PATH_SEP}${QtGui_SOURCE_DIR}${PATH_SEP}${phonon_SOURCE_DIR}${PATH_SEP}${QtGui_BINARY_DIR}")
set(phonon_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
${QT_QTCORE_INCLUDE_DIR}
${QT_QTGUI_INCLUDE_DIR}
From 36a73c0ecd1d1a71a331663697e485e2fbece8b0 Mon Sep 17 00:00:00 2001
From: Lauro Neto
Date: Tue, 31 Aug 2010 18:13:20 -0300
Subject: [PATCH 0183/1129] Also install the typesystem used during generation.
Installs the typesystem fed to the generator. This
fixes the install of modules like QtGui, with
run-time generated typesystems.
Reviewer: Hugo Lima
Reviewer: Renato Filho
---
PySide/CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/PySide/CMakeLists.txt b/PySide/CMakeLists.txt
index 09dd144..edd3b44 100644
--- a/PySide/CMakeLists.txt
+++ b/PySide/CMakeLists.txt
@@ -48,7 +48,7 @@ macro(create_pyside_module module_name module_include_dir module_libraries modul
string(TOLOWER ${module_name} lower_module_name)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/${module_name}/pyside_${lower_module_name}_python.h
DESTINATION include/PySide/${module_name}/)
- file(GLOB typesystem_files ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_*.xml)
+ file(GLOB typesystem_files ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_*.xml ${typesystem_path})
install(FILES ${typesystem_files} DESTINATION share/PySide/typesystems)
endmacro()
From 589c40a6d60b59d90cec180bb54f8fe08a4bee17 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Wed, 1 Sep 2010 10:29:33 -0300
Subject: [PATCH 0184/1129] Fixed function modifications.
Fixes bug #336.
Reviewer: Hugo Parente Lima
Lauro Neto
---
PySide/QtGui/glue/qapplication_init.cpp | 5 +-
PySide/QtGui/typesystem_gui_commom.xml | 139 ++----------------------
2 files changed, 15 insertions(+), 129 deletions(-)
diff --git a/PySide/QtGui/glue/qapplication_init.cpp b/PySide/QtGui/glue/qapplication_init.cpp
index afbd304..699633a 100644
--- a/PySide/QtGui/glue/qapplication_init.cpp
+++ b/PySide/QtGui/glue/qapplication_init.cpp
@@ -4,8 +4,11 @@ extern PyObject* moduleQtGui;
static int QApplicationArgCount;
static char** QApplicationArgValues;
static const char QAPP_MACRO[] = "qApp";
+static bool leavingPython = false;
-void DeleteQApplicationAtExit() {
+void DeleteQApplicationAtExit()
+{
+ leavingPython = true;
PySide::SignalManager::instance().clear();
QCoreApplication* cpp = QApplication::instance();
if (cpp) {
diff --git a/PySide/QtGui/typesystem_gui_commom.xml b/PySide/QtGui/typesystem_gui_commom.xml
index 686fc5f..48bad7a 100644
--- a/PySide/QtGui/typesystem_gui_commom.xml
+++ b/PySide/QtGui/typesystem_gui_commom.xml
@@ -1485,17 +1485,8 @@
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -2409,27 +2400,6 @@
-
-
-
- addLayoutOwnership(%CPPSELF, %1);
-
-
-
-
-
-
-
-
- addLayoutOwnership(%CPPSELF, %0);
-
-
-
-
-
- addLayoutOwnership(%CPPSELF, %1);
-
-
addLayoutOwnership(%CPPSELF, %2);
@@ -2440,33 +2410,20 @@
-
-
-
-
-
-
-
-
- addLayoutOwnership(%CPPSELF, %0);
-
-
+
addLayoutOwnership(%CPPSELF, %1);
+
addLayoutOwnership(%CPPSELF, %1);
-
-
- addLayoutOwnership(%CPPSELF, %1);
-
-
+
addLayoutOwnership(%CPPSELF, %2);
@@ -2498,12 +2455,6 @@
-
-
-
- addLayoutOwnership(%CPPSELF, %1);
-
-
@@ -2550,17 +2501,6 @@
addLayoutOwnership(%CPPSELF, %1);
-
-
-
-
-
-
-
- addLayoutOwnership(%CPPSELF, %0);
-
-
-
@@ -3491,22 +3431,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -4039,43 +3963,9 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -4394,6 +4284,10 @@
+
+
+
+
@@ -4483,16 +4377,6 @@
-
-
-
-
-
-
-
-
-
-
@@ -4820,7 +4704,6 @@
-
From 990f057b8d170509cb407f1fff3d382db6b4e9f5 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Wed, 1 Sep 2010 15:40:35 -0300
Subject: [PATCH 0185/1129] Use Cmake detected vars to generete global.h file.
This make PySide independent of Qt Macros in some cases these macros
return invalid value because the module can be compiled separated from
Qt.
Fixes bug #326.
Reviewer: Hugo Parente Lima
Lauro Neto
---
PySide/global.h.in | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/PySide/global.h.in b/PySide/global.h.in
index 402de4e..7bba836 100644
--- a/PySide/global.h.in
+++ b/PySide/global.h.in
@@ -371,15 +371,15 @@ QT_END_HEADER
#include
#include
-#ifndef QT_NO_XMLPATTERNS
+#ifdef @QT_QTXMLPATTERNS_FOUND@
# include
#endif
-#ifndef QT_NO_WEBKIT
+#ifdef @QT_QTWEBKIT_FOUND@
# include
#endif
-#ifndef QT_NO_TEST
+#ifdef @QT_QTTEST_FOUND@
# include
#endif
From e0a5ca517f60b24fed19ac406300be8d103730b4 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Wed, 1 Sep 2010 14:03:52 -0300
Subject: [PATCH 0186/1129] Fix bug#335 - "QT_TRANSLATE_NOOP has incorrect
signature"
---
PySide/QtCore/typesystem_core.xml | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index f863386..04bd5e0 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -2418,8 +2418,11 @@
(void)%1;%PYARG_0 = %PYARG_1;
-
- (void)%1;%PYARG_0 = %PYARG_1;
+
+ (void)%1;(void)%2;%PYARG_0 = %PYARG_2;
+
+
+ (void)%1;(void)%2;(void)%3;%PYARG_0 = %PYARG_2;
(void)%1;%PYARG_0 = %PYARG_1;
From 5c0d39b9dc18450364399f68ba0db3b19a9605c8 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Wed, 1 Sep 2010 15:06:17 -0300
Subject: [PATCH 0187/1129] Fix bug#316 - "QAbstractItemModel.createIndex is
broken"
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Reviewer: Luciano Wolf
Renato Araújo
---
PySide/QtCore/glue/qobject_connect.cpp | 4 ++--
PySide/QtCore/qstring_conversions.h | 4 ++--
tests/QtCore/CMakeLists.txt | 1 +
tests/QtCore/qabstractitemmodel_test.py | 21 +++++++++++++++++++++
4 files changed, 26 insertions(+), 4 deletions(-)
create mode 100644 tests/QtCore/qabstractitemmodel_test.py
diff --git a/PySide/QtCore/glue/qobject_connect.cpp b/PySide/QtCore/glue/qobject_connect.cpp
index 8578bff..b140374 100644
--- a/PySide/QtCore/glue/qobject_connect.cpp
+++ b/PySide/QtCore/glue/qobject_connect.cpp
@@ -2,11 +2,11 @@ static bool getReceiver(PyObject *callback, QObject **receiver, PyObject **self)
{
if (PyMethod_Check(callback)) {
*self = PyMethod_GET_SELF(callback);
- if (SbkQObject_Check(*self))
+ if (Shiboken::Converter::checkType(*self))
*receiver = Converter::toCpp(*self);
} else if (PyCFunction_Check(callback)) {
*self = PyCFunction_GET_SELF(callback);
- if (*self && SbkQObject_Check(*self))
+ if (*self && Shiboken::Converter::checkType(*self))
*receiver = Converter::toCpp(*self);
} else if (PyCallable_Check(callback)) {
// Ok, just a callable object
diff --git a/PySide/QtCore/qstring_conversions.h b/PySide/QtCore/qstring_conversions.h
index d0006b8..670c01f 100644
--- a/PySide/QtCore/qstring_conversions.h
+++ b/PySide/QtCore/qstring_conversions.h
@@ -18,7 +18,7 @@ struct Converter
{
return PyString_Check(pyObj)
|| PyUnicode_Check(pyObj)
- || SbkQByteArray_Check(pyObj)
+ || Converter::checkType(pyObj)
|| pyObj == Py_None
#if PY_VERSION_HEX < 0x03000000
|| (pyObj->ob_type->tp_as_buffer
@@ -42,7 +42,7 @@ struct Converter
return QString(Converter< char * >::toCpp(pyObj));
} else if (pyObj == Py_None) {
return QString();
- } else if (SbkQByteArray_Check(pyObj)) {
+ } else if (Converter::checkType(pyObj)) {
return QString(Converter< QByteArray >::toCpp(pyObj));
}
#if PY_VERSION_HEX < 0x03000000
diff --git a/tests/QtCore/CMakeLists.txt b/tests/QtCore/CMakeLists.txt
index cf7727f..4e7e8ec 100644
--- a/tests/QtCore/CMakeLists.txt
+++ b/tests/QtCore/CMakeLists.txt
@@ -7,6 +7,7 @@ PYSIDE_TEST(duck_punching_test.py)
PYSIDE_TEST(hash_test.py)
PYSIDE_TEST(missing_symbols_test.py)
PYSIDE_TEST(qabs_test.py)
+PYSIDE_TEST(qabstractitemmodel_test.py)
PYSIDE_TEST(qabstracttransition_test.py)
PYSIDE_TEST(qanimationgroup_test.py)
PYSIDE_TEST(qbitarray_test.py)
diff --git a/tests/QtCore/qabstractitemmodel_test.py b/tests/QtCore/qabstractitemmodel_test.py
new file mode 100644
index 0000000..93306ca
--- /dev/null
+++ b/tests/QtCore/qabstractitemmodel_test.py
@@ -0,0 +1,21 @@
+# -*- coding: utf-8 -*-
+
+import unittest
+from PySide.QtCore import *
+
+class MyModel (QAbstractListModel):
+ pass
+
+class Foo:
+ pass
+
+class TestQModelIndexInternalPointer(unittest.TestCase):
+
+ def testInternalPointer(self):
+ m = MyModel()
+ foo = Foo()
+ idx = m.createIndex(0,0, foo)
+
+if __name__ == '__main__':
+ unittest.main()
+
From 145fe577d2228d98db6d7703f8e95f1a1a4f5f79 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Wed, 1 Sep 2010 17:33:32 -0300
Subject: [PATCH 0188/1129] Fixed generated global.h.
---
PySide/global.h.in | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/PySide/global.h.in b/PySide/global.h.in
index 7bba836..1bec8bb 100644
--- a/PySide/global.h.in
+++ b/PySide/global.h.in
@@ -371,15 +371,15 @@ QT_END_HEADER
#include
#include
-#ifdef @QT_QTXMLPATTERNS_FOUND@
+#if @QT_QTXMLPATTERNS_FOUND@
# include
#endif
-#ifdef @QT_QTWEBKIT_FOUND@
+#if @QT_QTWEBKIT_FOUND@
# include
#endif
-#ifdef @QT_QTTEST_FOUND@
+#if @QT_QTTEST_FOUND@
# include
#endif
From cfcd31973d8af9db11a4f384c5d33481fd4711fd Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Wed, 1 Sep 2010 17:35:43 -0300
Subject: [PATCH 0189/1129] put back suppress warning for "Shadowing" message.
---
PySide/QtCore/typesystem_core.xml | 1 +
1 file changed, 1 insertion(+)
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 04bd5e0..2d424af 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -2483,4 +2483,5 @@
+
From c436fcd2aa27e38411f2dab8051116dac0996b49 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Wed, 1 Sep 2010 18:28:31 -0300
Subject: [PATCH 0190/1129] Fixed typo on typesystem.
---
PySide/QtCore/typesystem_core.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 2d424af..5ebb271 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -2483,5 +2483,5 @@
-
+
From ee0ab65aafd830ec85aeb58ca5b0add58e7131f6 Mon Sep 17 00:00:00 2001
From: Matti Airas
Date: Thu, 2 Sep 2010 13:09:05 +0300
Subject: [PATCH 0191/1129] fixed a typo in typesystem file name
---
PySide/QtGui/typesystem_gui.xml.in | 2 +-
.../{typesystem_gui_commom.xml => typesystem_gui_common.xml} | 0
2 files changed, 1 insertion(+), 1 deletion(-)
rename PySide/QtGui/{typesystem_gui_commom.xml => typesystem_gui_common.xml} (100%)
diff --git a/PySide/QtGui/typesystem_gui.xml.in b/PySide/QtGui/typesystem_gui.xml.in
index 878f837..88a6e99 100644
--- a/PySide/QtGui/typesystem_gui.xml.in
+++ b/PySide/QtGui/typesystem_gui.xml.in
@@ -2,5 +2,5 @@
-
+
diff --git a/PySide/QtGui/typesystem_gui_commom.xml b/PySide/QtGui/typesystem_gui_common.xml
similarity index 100%
rename from PySide/QtGui/typesystem_gui_commom.xml
rename to PySide/QtGui/typesystem_gui_common.xml
From 94ce2814e9a3709ab7d60f3acee6576fe9476b1d Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Wed, 1 Sep 2010 20:55:44 -0300
Subject: [PATCH 0192/1129] Remove warning about unused variable in
QTimer::singleShot code injection.
---
PySide/QtCore/typesystem_core.xml | 1 +
1 file changed, 1 insertion(+)
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 5ebb271..37c8d7a 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -1686,6 +1686,7 @@
// %FUNCTION_NAME() - disable generation of c++ function call
+ (void) %2; // remove warning about unused variable
Shiboken::AutoDecRef emptyTuple(PyTuple_New(0));
PyObject* pyTimer = Shiboken::SbkType<QTimer>()->tp_new(Shiboken::SbkType<QTimer>(), emptyTuple, 0);
Shiboken::SbkType<QTimer>()->tp_init(pyTimer, emptyTuple, 0);
From 8f4246a522aa02c9e1d7e44ab6a18d13075d53b9 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Wed, 1 Sep 2010 20:58:41 -0300
Subject: [PATCH 0193/1129] Fix bug#125 -
"QAbstractTextDocumentLayout.registerHandler apparently not working"
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Added class QPyTextObject which inherits from QObject and QTextObjectInterface to
solve the issue with registerHandler, the same approach used by PyQt.
Reviewer: Luciano Wolf
Renato Araújo
---
PySide/CMakeLists.txt | 4 +-
PySide/QtGui/CMakeLists.txt | 7 ++-
PySide/QtGui/typesystem_gui_common.xml | 3 +-
PySide/global.h.in | 1 +
PySide/qpytextobject.h | 16 +++++++
tests/QtGui/CMakeLists.txt | 1 +
.../QtGui/qabstracttextdocumentlayout_test.py | 46 +++++++++++++++++++
7 files changed, 74 insertions(+), 4 deletions(-)
create mode 100644 PySide/qpytextobject.h
create mode 100644 tests/QtGui/qabstracttextdocumentlayout_test.py
diff --git a/PySide/CMakeLists.txt b/PySide/CMakeLists.txt
index edd3b44..e4b6a1d 100644
--- a/PySide/CMakeLists.txt
+++ b/PySide/CMakeLists.txt
@@ -27,8 +27,8 @@ macro(create_pyside_module module_name module_include_dir module_libraries modul
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Running generator for ${module_name}...")
- include_directories(${module_name} ${${module_include_dir}})
- add_library(${module_name} MODULE ${${module_sources}})
+ include_directories(${module_name} ${${module_include_dir}} ${pyside_SOURCE_DIR})
+ add_library(${module_name} MODULE ${${module_sources}} ${${ARGN}})
set_target_properties(${module_name} PROPERTIES PREFIX "" LIBRARY_OUTPUT_DIRECTORY ${pyside_BINARY_DIR})
if(WIN32)
set_target_properties(${module_name} PROPERTIES SUFFIX ".pyd")
diff --git a/PySide/QtGui/CMakeLists.txt b/PySide/QtGui/CMakeLists.txt
index 902243b..64aa73f 100644
--- a/PySide/QtGui/CMakeLists.txt
+++ b/PySide/QtGui/CMakeLists.txt
@@ -55,6 +55,8 @@ else()
)
endif ()
+qt4_wrap_cpp(QPYTEXTOBJECT_MOC "${pyside_SOURCE_DIR}/qpytextobject.h")
+
set(QtGui_SRC
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qabstractbutton_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qabstractgraphicsshapeitem_wrapper.cpp
@@ -227,6 +229,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qpolygon_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qprogressbar_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qprogressdialog_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qproxymodel_wrapper.cpp
+${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qpytextobject_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qpushbutton_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qradialgradient_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qradiobutton_wrapper.cpp
@@ -395,6 +398,7 @@ check_qt_class(QtGui QPrintEngine QtGui_SRC)
set(QtGui_typesystem_path "${QtCore_SOURCE_DIR}${PATH_SEP}${QtGui_SOURCE_DIR}")
set(QtGui_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/
+ ${pyside_SOURCE_DIR}
${QT_INCLUDE_DIR}
${SHIBOKEN_INCLUDE_DIR}
${libpyside_SOURCE_DIR}
@@ -412,5 +416,6 @@ create_pyside_module(QtGui
QtGui_deps
QtGui_typesystem_path
QtGui_SRC
- "${CMAKE_CURRENT_BINARY_DIR}/typesystem_gui.xml")
+ "${CMAKE_CURRENT_BINARY_DIR}/typesystem_gui.xml"
+ QPYTEXTOBJECT_MOC)
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index 48bad7a..b217509 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -1388,6 +1388,7 @@
+
@@ -2527,7 +2528,7 @@
-
+
diff --git a/PySide/global.h.in b/PySide/global.h.in
index 1bec8bb..7a4c650 100644
--- a/PySide/global.h.in
+++ b/PySide/global.h.in
@@ -353,6 +353,7 @@ QT_END_HEADER
#undef qdoc
#endif
#include
+#include "qpytextobject.h"
#if @ENABLE_X11@
#include
#endif
diff --git a/PySide/qpytextobject.h b/PySide/qpytextobject.h
new file mode 100644
index 0000000..80c5b7e
--- /dev/null
+++ b/PySide/qpytextobject.h
@@ -0,0 +1,16 @@
+#ifndef QPYTEXTOBJECT
+#define QPYTEXTOBJECT
+
+#include
+#include
+
+class QPyTextObject : public QObject, public QTextObjectInterface
+{
+ Q_OBJECT
+ Q_INTERFACES(QTextObjectInterface)
+public:
+ QPyTextObject(QObject* parent = 0) : QObject(parent) {}
+ void drawObject(QPainter* painter, const QRectF& rect, QTextDocument* doc, int posInDocument, const QTextFormat& format ) = 0;
+ QSizeF intrinsicSize(QTextDocument* doc, int posInDocument, const QTextFormat& format ) = 0;
+};
+#endif
\ No newline at end of file
diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt
index b73e1ce..80d415a 100644
--- a/tests/QtGui/CMakeLists.txt
+++ b/tests/QtGui/CMakeLists.txt
@@ -14,6 +14,7 @@ PYSIDE_TEST(missing_symbols_test.py)
PYSIDE_TEST(paint_event_test.py)
PYSIDE_TEST(parent_method_test.py)
PYSIDE_TEST(python_properties_test.py)
+PYSIDE_TEST(qabstracttextdocumentlayout_test.py)
PYSIDE_TEST(qapplication_exit_segfault_test.py)
PYSIDE_TEST(qapplication_singleton_test.py)
PYSIDE_TEST(qapp_test.py)
diff --git a/tests/QtGui/qabstracttextdocumentlayout_test.py b/tests/QtGui/qabstracttextdocumentlayout_test.py
new file mode 100644
index 0000000..e3fe40e
--- /dev/null
+++ b/tests/QtGui/qabstracttextdocumentlayout_test.py
@@ -0,0 +1,46 @@
+import unittest
+import colorsys
+
+from PySide.QtCore import *
+from PySide.QtGui import *
+from helper import UsesQApplication
+
+class Foo(QPyTextObject):
+ called = False
+
+ def intrinsicSize(self, doc, posInDocument, format):
+ Foo.called = True
+ return QSizeF(10, 10)
+
+ def drawObject(self, painter, rect, doc, posInDocument, format):
+ pass
+
+class QAbstractTextDocumentLayoutTest(UsesQApplication):
+
+ objectType = QTextFormat.UserObject + 1
+
+ def foo(self):
+ fmt = QTextCharFormat()
+ fmt.setObjectType(QAbstractTextDocumentLayoutTest.objectType)
+
+ cursor = self.textEdit.textCursor()
+ cursor.insertText(unichr(0xfffc), fmt)
+ self.textEdit.setTextCursor(cursor)
+ self.textEdit.close()
+
+ def testIt(self):
+
+ self.textEdit = QTextEdit()
+ self.textEdit.show()
+
+ interface = Foo()
+ self.textEdit.document().documentLayout().registerHandler(QAbstractTextDocumentLayoutTest.objectType, interface)
+
+ QTimer.singleShot(0, self.foo)
+ self.app.exec_()
+
+ self.assertTrue(Foo.called)
+
+if __name__ == "__main__":
+ unittest.main()
+
From 94a402db7b479c9f33e6501aa670c5ed0d5f10e4 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Thu, 2 Sep 2010 17:14:09 -0300
Subject: [PATCH 0194/1129] Fixed return ownership on mimeData function for
QAbstractItemModel.
fixes bug #296.
Reviewer: Luciano Wolf
Hugo Parente Lima
---
PySide/QtCore/typesystem_core.xml | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 37c8d7a..1e7d183 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -985,6 +985,11 @@
%PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%CPPSELF.%FUNCTION_NAME(%1, %2, %PYARG_3));
+
+
+
+
+
From f024b0d8840b00da4f3a703db5b22c70cf8b26ee Mon Sep 17 00:00:00 2001
From: Lauro Neto
Date: Thu, 2 Sep 2010 18:53:04 -0300
Subject: [PATCH 0195/1129] Install qpytextobject.h
Reviewer: Hugo Lima
Reviewer: Luciano Wolf
---
PySide/QtGui/CMakeLists.txt | 2 ++
1 file changed, 2 insertions(+)
diff --git a/PySide/QtGui/CMakeLists.txt b/PySide/QtGui/CMakeLists.txt
index 64aa73f..9d50294 100644
--- a/PySide/QtGui/CMakeLists.txt
+++ b/PySide/QtGui/CMakeLists.txt
@@ -419,3 +419,5 @@ create_pyside_module(QtGui
"${CMAKE_CURRENT_BINARY_DIR}/typesystem_gui.xml"
QPYTEXTOBJECT_MOC)
+
+install(FILES ${pyside_SOURCE_DIR}/qpytextobject.h DESTINATION include/PySide/QtGui/)
From 823eec81c245f56cd2baf7c9fe0b1bf006500561 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Thu, 2 Sep 2010 20:33:00 -0300
Subject: [PATCH 0196/1129] Fix bug#320 - "OR'ing Qt alignments doesn't work;
adding them does"
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Reviewer: Luciano Wolf
Renato Araújo
---
PySide/QtCore/qvariant_conversions.h | 2 +-
libpyside/pysideconversions.h | 17 +++++++++++------
tests/QtCore/qflags_test.py | 15 ++++++++++-----
3 files changed, 22 insertions(+), 12 deletions(-)
diff --git a/PySide/QtCore/qvariant_conversions.h b/PySide/QtCore/qvariant_conversions.h
index a471ce6..1e1c705 100644
--- a/PySide/QtCore/qvariant_conversions.h
+++ b/PySide/QtCore/qvariant_conversions.h
@@ -34,7 +34,7 @@ struct Converter
} else if (PyFloat_CheckExact(pyObj)) {
// QVariant(double)
return QVariant(Converter::toCpp(pyObj));
- } else if (PyInt_CheckExact(pyObj)) {
+ } else if (PyInt_Check(pyObj)) {
// QVariant(int)
return QVariant(Converter::toCpp(pyObj));
} else if (PyLong_CheckExact(pyObj)) {
diff --git a/libpyside/pysideconversions.h b/libpyside/pysideconversions.h
index c7fdcb5..35fa687 100644
--- a/libpyside/pysideconversions.h
+++ b/libpyside/pysideconversions.h
@@ -237,19 +237,24 @@ struct QFlagsConverter
|| PyObject_TypeCheck(pyObj, Shiboken::SbkType());
}
- static inline PyObject* toPython(void* cppobj)
+ static inline PyObject* toPython(void* cppObj)
{
- return toPython(*reinterpret_cast(cppobj));
+ return toPython(*reinterpret_cast(cppObj));
}
- static inline PyObject* toPython(T cppenum)
+ static inline PyObject* toPython(const T& cppObj)
{
- return Shiboken::SbkEnumObject_New(Shiboken::SbkType(), (long) cppenum);
+ PyObject* qflags = Shiboken::SbkType()->tp_alloc(Shiboken::SbkType(), 0);
+ reinterpret_cast(qflags)->ob_ival = cppObj;
+ return qflags;
}
- static inline T toCpp(PyObject* pyobj)
+ static inline T toCpp(PyObject* pyObj)
{
- return T(QFlag(reinterpret_cast(pyobj)->ob_ival));
+ if (Shiboken::isShibokenEnum(pyObj))
+ return T(QFlag(reinterpret_cast(pyObj)->ob_ival));
+ else
+ return T(QFlag(reinterpret_cast(pyObj)->ob_ival));
}
};
diff --git a/tests/QtCore/qflags_test.py b/tests/QtCore/qflags_test.py
index 8b3a488..3ecaa2f 100644
--- a/tests/QtCore/qflags_test.py
+++ b/tests/QtCore/qflags_test.py
@@ -2,7 +2,7 @@
'''Test cases for QFlags'''
import unittest
-from PySide.QtCore import QIODevice, Qt, QFile, QTemporaryFile
+from PySide.QtCore import *
class QFlagTest(unittest.TestCase):
'''Test case for usage of flags'''
@@ -28,15 +28,15 @@ class QFlagOperatorTest(unittest.TestCase):
def testInvert(self):
'''QFlags ~ (invert) operator'''
- self.assert_(isinstance(~QIODevice.ReadOnly, QIODevice.OpenMode))
+ self.assertEqual(type(~QIODevice.ReadOnly), QIODevice.OpenMode)
def testOr(self):
'''QFlags | (or) operator'''
- self.assert_(isinstance(QIODevice.ReadOnly | QIODevice.WriteOnly, QIODevice.OpenMode))
+ self.assertEqual(type(QIODevice.ReadOnly | QIODevice.WriteOnly), QIODevice.OpenMode)
def testAnd(self):
'''QFlags & (and) operator'''
- self.assert_(isinstance(QIODevice.ReadOnly & QIODevice.WriteOnly, QIODevice.OpenMode))
+ self.assertEqual(type(QIODevice.ReadOnly & QIODevice.WriteOnly), QIODevice.OpenMode)
def testIOr(self):
'''QFlags |= (ior) operator'''
@@ -47,7 +47,7 @@ class QFlagOperatorTest(unittest.TestCase):
def testInvertOr(self):
'''QFlags ~ (invert) operator over the result of an | (or) operator'''
- self.assert_(isinstance(~(Qt.ItemIsSelectable | Qt.ItemIsEditable), Qt.ItemFlags))
+ self.assertEqual(type(~(Qt.ItemIsSelectable | Qt.ItemIsEditable)), Qt.ItemFlags)
def testEqual(self):
'''QFlags == operator'''
@@ -56,6 +56,11 @@ class QFlagOperatorTest(unittest.TestCase):
flag_type = (flags & Qt.WindowType_Mask)
self.assertEqual(flag_type, Qt.Window)
+class QFlagsOnQVariant(unittest.TestCase):
+ def testQFlagsOnQVariant(self):
+ o = QObject()
+ o.setProperty("foo", QIODevice.ReadOnly | QIODevice.WriteOnly)
+ self.assertEqual(type(o.property("foo")), int)
if __name__ == '__main__':
unittest.main()
From cb48464859110d4e6ebcf59d70a59804c55d4705 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Fri, 3 Sep 2010 15:36:04 -0300
Subject: [PATCH 0197/1129] Remove the dependecy of QtGui from a test located
in QtNetwork.
---
tests/QtNetwork/basic_auth_test.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/QtNetwork/basic_auth_test.py b/tests/QtNetwork/basic_auth_test.py
index 8087eed..ed58e58 100644
--- a/tests/QtNetwork/basic_auth_test.py
+++ b/tests/QtNetwork/basic_auth_test.py
@@ -3,10 +3,10 @@
from PySide.QtCore import *
from PySide.QtNetwork import *
-from helper import UsesQApplication
+from helper import UsesQCoreApplication
from httpd import TestServer
-class testAuthenticationSignal(UsesQApplication):
+class testAuthenticationSignal(UsesQCoreApplication):
def setUp(self):
super(testAuthenticationSignal, self).setUp()
From f1bc92a2dd0f9a19ac8dcf9699f65d4ee2d61945 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Fri, 3 Sep 2010 15:47:44 -0300
Subject: [PATCH 0198/1129] bug_300_test moved to QtGui, because it tests a
class from QtGui.
---
tests/QtCore/CMakeLists.txt | 1 -
tests/QtGui/CMakeLists.txt | 1 +
tests/{QtCore => QtGui}/bug_300_test.py | 0
3 files changed, 1 insertion(+), 1 deletion(-)
rename tests/{QtCore => QtGui}/bug_300_test.py (100%)
diff --git a/tests/QtCore/CMakeLists.txt b/tests/QtCore/CMakeLists.txt
index 4e7e8ec..f364f4c 100644
--- a/tests/QtCore/CMakeLists.txt
+++ b/tests/QtCore/CMakeLists.txt
@@ -1,5 +1,4 @@
PYSIDE_TEST(bug_278_test.py)
-PYSIDE_TEST(bug_300_test.py)
PYSIDE_TEST(blocking_signals_test.py)
PYSIDE_TEST(child_event_test.py)
PYSIDE_TEST(deletelater_test.py)
diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt
index 80d415a..39b3042 100644
--- a/tests/QtGui/CMakeLists.txt
+++ b/tests/QtGui/CMakeLists.txt
@@ -2,6 +2,7 @@
PYSIDE_TEST(api2_test.py)
PYSIDE_TEST(bug_243.py)
+PYSIDE_TEST(bug_300_test.py)
PYSIDE_TEST(bug_307.py)
PYSIDE_TEST(bug_324.py)
PYSIDE_TEST(add_action_test.py)
diff --git a/tests/QtCore/bug_300_test.py b/tests/QtGui/bug_300_test.py
similarity index 100%
rename from tests/QtCore/bug_300_test.py
rename to tests/QtGui/bug_300_test.py
From 6fc086e9f9a786521492593b92889c735697191e Mon Sep 17 00:00:00 2001
From: Carlos Goncalves
Date: Sat, 4 Sep 2010 02:10:33 +0100
Subject: [PATCH 0199/1129] Treat modules as library targets.
This fixes dynamic linking on Mac OS X. Previously modules were been linked to
libpyside in the build tree even when installed (ie. hardcoded).
---
PySide/CMakeLists.txt | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/PySide/CMakeLists.txt b/PySide/CMakeLists.txt
index e4b6a1d..522d1ec 100644
--- a/PySide/CMakeLists.txt
+++ b/PySide/CMakeLists.txt
@@ -43,8 +43,7 @@ macro(create_pyside_module module_name module_include_dir module_libraries modul
# install
- install(FILES ${pyside_BINARY_DIR}/${module_name}${CMAKE_DEBUG_POSTFIX}${${module_name}_suffix}
- DESTINATION ${SITE_PACKAGE}/PySide)
+ install(TARGETS ${module_name} LIBRARY DESTINATION ${SITE_PACKAGE}/PySide)
string(TOLOWER ${module_name} lower_module_name)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/${module_name}/pyside_${lower_module_name}_python.h
DESTINATION include/PySide/${module_name}/)
From 0ba776e27a8c17727fa883eed29f60bc6c0bb7be Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Wed, 8 Sep 2010 15:08:41 -0300
Subject: [PATCH 0200/1129] Fix bug#282 and bug#283.
---
tests/util/httpd.py | 84 ++++++++++++++++++++++++++++++++++++++++-----
1 file changed, 76 insertions(+), 8 deletions(-)
diff --git a/tests/util/httpd.py b/tests/util/httpd.py
index 96750f0..4d7dde9 100644
--- a/tests/util/httpd.py
+++ b/tests/util/httpd.py
@@ -1,10 +1,11 @@
import SocketServer
import BaseHTTPServer
+import os
+import sys
+import threading
+import select
import random
-from threading import Thread
-
-
class TestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
DATA = "PySide Server"
@@ -42,22 +43,89 @@ class TestSecureHandler(BaseHTTPServer.BaseHTTPRequestHandler):
self.send_header("Content-Length", str(len(TestHandler.DATA)))
self.end_headers()
+# Workaround for the missing shutdown method in python2.5
+class CompatTCPServer(SocketServer.TCPServer):
+ def __init__(self, server_address, RequestHandlerClass):
+ SocketServer.TCPServer.__init__(self, server_address, RequestHandlerClass)
-class TestServer(Thread):
+ self.isPy25 = sys.version_info[0] == 2 and sys.version_info[1] == 5
+ if self.isPy25:
+ self.__is_shut_down = threading.Event()
+ self.__serving = False
+
+ def serve_forever(self, poll_interval=0.5):
+ """Handle one request at a time until shutdown.
+
+ Polls for shutdown every poll_interval seconds. Ignores
+ self.timeout. If you need to do periodic tasks, do them in
+ another thread.
+ """
+ if self.isPy25:
+ self.__serving = True
+ self.__is_shut_down.clear()
+ while self.__serving:
+ # XXX: Consider using another file descriptor or
+ # connecting to the socket to wake this up instead of
+ # polling. Polling reduces our responsiveness to a
+ # shutdown request and wastes cpu at all other times.
+ r, w, e = select.select([self], [], [], poll_interval)
+ if r:
+ self.py25_handle_request_noblock()
+ self.__is_shut_down.set()
+ else:
+ SocketServer.TCPServer.serve_forever(self, poll_interval)
+
+ def py25_handle_request_noblock(self):
+ """Handle one request, without blocking.
+
+ I assume that select.select has returned that the socket is
+ readable before this function was called, so there should be
+ no risk of blocking in get_request().
+ """
+ if self.isPy25:
+ try:
+ request, client_address = self.get_request()
+ except socket.error:
+ return
+ if self.verify_request(request, client_address):
+ try:
+ self.process_request(request, client_address)
+ except:
+ self.handle_error(request, client_address)
+ self.close_request(request)
+
+ def shutdown(self):
+ """Stops the serve_forever loop.
+
+ Blocks until the loop has finished. This must be called while
+ serve_forever() is running in another thread, or it will
+ deadlock.
+ """
+ if self.isPy25:
+ self.__serving = False
+ if not self.__is_shut_down:
+ self.__is_shut_down.wait()
+ else:
+ SocketServer.TCPServer.shutdown(self)
+
+
+class TestServer(threading.Thread):
def __init__(self, secure=False):
- Thread.__init__(self)
+ threading.Thread.__init__(self)
- self._port = 8000 + random.randint(0, 100)
+ self._port = int(os.getenv("PYSIDE_TESTSERVER_PORT") or 12321)
self.keep_running = True
- server = SocketServer.TCPServer
if secure:
handle = TestSecureHandler
else:
handle = TestHandler
- self.httpd = SocketServer.TCPServer(('' , self._port), handle)
+ try:
+ self.httpd = CompatTCPServer(('' , self._port), handle)
+ except:
+ self.httpd = CompatTCPServer(('' , self._port + random.randint(1, 100)), handle)
def port(self):
return self._port
From 00208f2db1b257ea9354dc30655bc94799867e9c Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Wed, 8 Sep 2010 15:19:11 -0300
Subject: [PATCH 0201/1129] Remove unneeded casts that can hide errors.
---
libpyside/qsignal.cpp | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/libpyside/qsignal.cpp b/libpyside/qsignal.cpp
index 41cc71d..01daec6 100644
--- a/libpyside/qsignal.cpp
+++ b/libpyside/qsignal.cpp
@@ -112,7 +112,7 @@ PyTypeObject Signal_Type = {
0, /*tp_descr_get */
0, /*tp_descr_set */
0, /*tp_dictoffset */
- (initproc)signal_init, /*tp_init */
+ signal_init, /*tp_init */
0, /*tp_alloc */
PyType_GenericNew, /*tp_new */
signal_free, /*tp_free */
@@ -126,10 +126,10 @@ PyTypeObject Signal_Type = {
};
static PyMethodDef SignalInstance_methods[] = {
- {"connect", (PyCFunction)signal_instance_connect, METH_VARARGS|METH_KEYWORDS},
- {"disconnect", (PyCFunction)signal_instance_disconnect, METH_VARARGS},
- {"emit", (PyCFunction)signal_instance_emit, METH_VARARGS},
- {NULL} /* Sentinel */
+ {"connect", (PyCFunction)signal_instance_connect, METH_VARARGS|METH_KEYWORDS, 0},
+ {"disconnect", signal_instance_disconnect, METH_VARARGS, 0},
+ {"emit", signal_instance_emit, METH_VARARGS, 0},
+ {0} /* Sentinel */
};
static PyMappingMethods SignalInstance_as_mapping = {
@@ -234,11 +234,11 @@ void signalUpdateSource(PyObject* source)
{
Shiboken::AutoDecRef attrs(PyObject_Dir(source));
- for(int i = 0, i_max = PyList_GET_SIZE(attrs.object()); i < i_max; i++) {
+ for(int i = 0, iMax = PyList_GET_SIZE(attrs.object()); i < iMax; ++i) {
PyObject *attrName = PyList_GET_ITEM(attrs.object(), i);
- Shiboken::AutoDecRef attr(PyObject_GetAttr((PyObject*)source->ob_type, attrName));
- if (!attr.isNull() && (attr->ob_type == &Signal_Type)) {
- Shiboken::AutoDecRef signalInstance(reinterpret_cast(PyObject_New(SignalInstanceData, &SignalInstance_Type)));
+ Shiboken::AutoDecRef attr(PyObject_GetAttr(reinterpret_cast(source->ob_type), attrName));
+ if (attr->ob_type == &Signal_Type) {
+ Shiboken::AutoDecRef signalInstance(_PyObject_New(&SignalInstance_Type));
signal_instance_initialize(signalInstance, attrName, reinterpret_cast(attr.object()), source, 0);
PyObject_SetAttr(source, attrName, signalInstance);
}
From 19f7b20dd0644e50762d6a571c9403a317028d06 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Wed, 8 Sep 2010 15:27:04 -0300
Subject: [PATCH 0202/1129] Declare SignalInstanceData struct in the C++ way,
without ugly typedefs.
---
libpyside/qsignal.h | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/libpyside/qsignal.h b/libpyside/qsignal.h
index fe4d5ff..f57ac24 100644
--- a/libpyside/qsignal.h
+++ b/libpyside/qsignal.h
@@ -42,13 +42,14 @@
namespace PySide
{
-typedef struct {
+struct SignalInstanceData
+{
PyObject_HEAD
char* signalName;
char* signature;
PyObject* source;
PyObject* next;
-} SignalInstanceData;
+};
extern "C"
From e5348268a63a8fd15519c703c4e6e7feb34f4282 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Wed, 8 Sep 2010 15:31:41 -0300
Subject: [PATCH 0203/1129] Make accessManager test do not depend on internet
access.
---
tests/QtNetwork/accessManager_test.py | 21 ++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)
diff --git a/tests/QtNetwork/accessManager_test.py b/tests/QtNetwork/accessManager_test.py
index 9a00e7e..172dab8 100644
--- a/tests/QtNetwork/accessManager_test.py
+++ b/tests/QtNetwork/accessManager_test.py
@@ -6,18 +6,33 @@ import unittest
from PySide.QtCore import *
from PySide.QtNetwork import *
-from helper import UsesQApplication
+from helper import UsesQCoreApplication
+from httpd import TestServer
+
+class AccessManagerCase(UsesQCoreApplication):
+
+ def setUp(self):
+ super(AccessManagerCase, self).setUp()
+ self.httpd = TestServer()
+ self.httpd.start()
+ self.called = False
+
+ def tearDown(self):
+ super(AccessManagerCase, self).tearDown()
+ self.httpd.shutdown()
-class AccessManagerCase(UsesQApplication):
def slot_replyFinished(self, reply):
self.assertEqual(type(reply), QNetworkReply)
+ self.called = True
self.app.quit()
def testNetworkRequest(self):
manager = QNetworkAccessManager()
manager.finished.connect(self.slot_replyFinished)
- manager.get(QNetworkRequest(QUrl("http://qt.nokia.com")))
+ manager.get(QNetworkRequest(QUrl("http://localhost:%s" % self.httpd.port())))
self.app.exec_()
+ self.assert_(self.called)
+ self.httpd.shutdown()
if __name__ == '__main__':
unittest.main()
From 6fb0e698eeeb4eda86df2f59b833eada0543fdc4 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Wed, 8 Sep 2010 15:36:37 -0300
Subject: [PATCH 0204/1129] Repeat the same test, but using new style signals
to cause a segfault.
Reviewer: Luciano Wolf
Lauro Moura
---
tests/QtNetwork/basic_auth_test.py | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/tests/QtNetwork/basic_auth_test.py b/tests/QtNetwork/basic_auth_test.py
index ed58e58..3f1b87b 100644
--- a/tests/QtNetwork/basic_auth_test.py
+++ b/tests/QtNetwork/basic_auth_test.py
@@ -34,5 +34,15 @@ class testAuthenticationSignal(UsesQCoreApplication):
self.app.exec_()
self.assert_(self._resultOk)
+ def testwaitSignal2(self):
+ http = QHttp()
+ http.setHost("localhost", self.httpd.port())
+ # Using new signal slot syntax causes a segfault
+ http.authenticationRequired.connect(self.onAuthRequest)
+ path = QUrl.toPercentEncoding("/index.html", "!$&'()*+,;=:@/")
+ data = http.get(path)
+ self.app.exec_()
+ self.assert_(self._resultOk)
+
if __name__ == '__main__':
unittest.main()
From 6daa2edea54d10e761d0432137373f226f2613ca Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Wed, 8 Sep 2010 18:06:07 -0300
Subject: [PATCH 0205/1129] Store randon port after fail on first attempt.
Reviewer: Hugo Parente Lima
Lauro Moura
---
tests/util/httpd.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tests/util/httpd.py b/tests/util/httpd.py
index 4d7dde9..03b44d6 100644
--- a/tests/util/httpd.py
+++ b/tests/util/httpd.py
@@ -125,7 +125,8 @@ class TestServer(threading.Thread):
try:
self.httpd = CompatTCPServer(('' , self._port), handle)
except:
- self.httpd = CompatTCPServer(('' , self._port + random.randint(1, 100)), handle)
+ self._port = self._port + random.randint(1, 100)
+ self.httpd = CompatTCPServer(('' , self._port), handle)
def port(self):
return self._port
From 63cacc4411cd52e359e1867532524ee816248b61 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Wed, 8 Sep 2010 19:32:33 -0300
Subject: [PATCH 0206/1129] Created module shutdown function necessary to avoid
call python functions before module exit.
Reviewer: Luciano Wolf
Hugo Parente Lima
---
PySide/CMakeLists.txt | 6 +++++-
PySide/QtCore/typesystem_core.xml | 7 +++++++
PySide/__init__.py | 1 +
PySide/private.py | 4 ++++
4 files changed, 17 insertions(+), 1 deletion(-)
create mode 100644 PySide/private.py
diff --git a/PySide/CMakeLists.txt b/PySide/CMakeLists.txt
index e4b6a1d..66621be 100644
--- a/PySide/CMakeLists.txt
+++ b/PySide/CMakeLists.txt
@@ -1,5 +1,5 @@
project(pyside)
-install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/__init__.py"
+install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/__init__.py" "${CMAKE_CURRENT_SOURCE_DIR}/private.py"
DESTINATION "${SITE_PACKAGE}/${BINDING_NAME}")
macro(execute_generator module sources typesystem_path)
@@ -106,6 +106,10 @@ endmacro()
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/__init__.py"
"${CMAKE_BINARY_DIR}/PySide/__init__.py")
+
+execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/private.py"
+ "${CMAKE_BINARY_DIR}/PySide/private.py")
+#
# Try to find QtMultimedia
# TODO: Remove this hack when cmake support QtMultimedia module
if (NOT QT_QTMULTIMEDIA_FOUND AND ${QTVERSION} VERSION_GREATER 4.5.9)
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 1e7d183..8fdb0e5 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -520,6 +520,7 @@
+
%PYARG_0 = %CONVERTTOPYTHON[double](qAbs(%1));
@@ -531,6 +532,12 @@
PyModule_AddStringConstant(module, "QT_VERSION_STR", QT_VERSION_STR);
+
+
+ PySide::SignalManager::instance().clear();
+
+
+
diff --git a/PySide/__init__.py b/PySide/__init__.py
index d9db08e..c93c5df 100644
--- a/PySide/__init__.py
+++ b/PySide/__init__.py
@@ -1 +1,2 @@
__all__ = ['QtCore', 'QtGui', 'QtNetwork', 'QtOpenGL', 'QtSql', 'QtSvg', 'QtTest', 'QtWebKit', 'QtScript']
+import private
diff --git a/PySide/private.py b/PySide/private.py
new file mode 100644
index 0000000..0fe1c13
--- /dev/null
+++ b/PySide/private.py
@@ -0,0 +1,4 @@
+import atexit
+from QtCore import __moduleShutdown
+
+atexit.register(__moduleShutdown)
From f9daf01879d736a8c640fd3df603a22141b2ff74 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Wed, 8 Sep 2010 19:57:42 -0300
Subject: [PATCH 0207/1129] Change the license boiler plates of all LGPL files
removing the special exception.
---
PySide/global.h.in | 19 -------------------
PySide/qpytextobject.h | 22 ++++++++++++++++++++++
doc/pyhtml2devhelp.py | 9 ---------
libpyside/autoarraypointer.h | 30 +++++++++---------------------
libpyside/dynamicqmetaobject.cpp | 30 +++++++++---------------------
libpyside/dynamicqmetaobject.h | 30 +++++++++---------------------
libpyside/globalreceiver.cpp | 30 +++++++++---------------------
libpyside/globalreceiver.h | 30 +++++++++---------------------
libpyside/proxyslot.cpp | 30 +++++++++---------------------
libpyside/pyside.cpp | 30 +++++++++---------------------
libpyside/pyside.h | 30 +++++++++---------------------
libpyside/pysideconversions.h | 28 ++++++++--------------------
libpyside/pysidemacros.h | 30 +++++++++---------------------
libpyside/qproperty.cpp | 30 +++++++++---------------------
libpyside/qproperty.h | 30 +++++++++---------------------
libpyside/qsignal.cpp | 30 +++++++++---------------------
libpyside/qsignal.h | 30 +++++++++---------------------
libpyside/qslot.cpp | 30 +++++++++---------------------
libpyside/signalmanager.cpp | 30 +++++++++---------------------
libpyside/signalmanager.h | 30 +++++++++---------------------
20 files changed, 174 insertions(+), 384 deletions(-)
diff --git a/PySide/global.h.in b/PySide/global.h.in
index 7a4c650..7266fe1 100644
--- a/PySide/global.h.in
+++ b/PySide/global.h.in
@@ -5,12 +5,6 @@
** This file is part of the QtCore module of the Qt Toolkit, plus some
** modifications by PySide team.
**
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Commercial License Agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Nokia.
-**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
@@ -19,19 +13,6 @@
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at qt-sales@nokia.com.
**
diff --git a/PySide/qpytextobject.h b/PySide/qpytextobject.h
index 80c5b7e..93f246d 100644
--- a/PySide/qpytextobject.h
+++ b/PySide/qpytextobject.h
@@ -1,3 +1,25 @@
+/*
+ * This file is part of the PySide project.
+ *
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * Contact: PySide team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
#ifndef QPYTEXTOBJECT
#define QPYTEXTOBJECT
diff --git a/doc/pyhtml2devhelp.py b/doc/pyhtml2devhelp.py
index 895c7e7..60df329 100644
--- a/doc/pyhtml2devhelp.py
+++ b/doc/pyhtml2devhelp.py
@@ -10,15 +10,6 @@
Public License version 2.1 requirements will be met:
http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
- As a special exception to the GNU Lesser General Public License
- version 2.1, the object code form of a "work that uses the Library"
- may incorporate material from a header file that is part of the
- Library. You may distribute such object code under terms of your
- choice, provided that the incorporated material (i) does not exceed
- more than 5% of the total size of the Library; and (ii) is limited to
- numerical parameters, data structure layouts, accessors, macros,
- inline functions and templates.
-
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
diff --git a/libpyside/autoarraypointer.h b/libpyside/autoarraypointer.h
index 433401c..cec7e0c 100644
--- a/libpyside/autoarraypointer.h
+++ b/libpyside/autoarraypointer.h
@@ -1,35 +1,23 @@
/*
* This file is part of the Shiboken Python Bindings Generator project.
*
- * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
*
* Contact: PySide team
*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation. Please
- * review the following information to ensure the GNU Lesser General
- * Public License version 2.1 requirements will be met:
- * http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
*
- * As a special exception to the GNU Lesser General Public License
- * version 2.1, the object code form of a "work that uses the Library"
- * may incorporate material from a header file that is part of the
- * Library. You may distribute such object code under terms of your
- * choice, provided that the incorporated material (i) does not exceed
- * more than 5% of the total size of the Library; and (ii) is limited to
- * numerical parameters, data structure layouts, accessors, macros,
- * inline functions and templates.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AUTOARRAYPOINTER_H
diff --git a/libpyside/dynamicqmetaobject.cpp b/libpyside/dynamicqmetaobject.cpp
index 0e545fa..a779edd 100644
--- a/libpyside/dynamicqmetaobject.cpp
+++ b/libpyside/dynamicqmetaobject.cpp
@@ -1,35 +1,23 @@
/*
* This file is part of the Shiboken Python Bindings Generator project.
*
-* Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
*
* Contact: PySide team
*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU Lesser General Public License
-* version 2.1 as published by the Free Software Foundation. Please
-* review the following information to ensure the GNU Lesser General
-* Public License version 2.1 requirements will be met:
-* http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation; either
+* version 2.1 of the License, or (at your option) any later version.
*
-* As a special exception to the GNU Lesser General Public License
-* version 2.1, the object code form of a "work that uses the Library"
-* may incorporate material from a header file that is part of the
-* Library. You may distribute such object code under terms of your
-* choice, provided that the incorporated material (i) does not exceed
-* more than 5% of the total size of the Library; and (ii) is limited to
-* numerical parameters, data structure layouts, accessors, macros,
-* inline functions and templates.
-*
-* This program is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
-* License along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "dynamicqmetaobject.h"
diff --git a/libpyside/dynamicqmetaobject.h b/libpyside/dynamicqmetaobject.h
index f8c120b..9f66c1f 100644
--- a/libpyside/dynamicqmetaobject.h
+++ b/libpyside/dynamicqmetaobject.h
@@ -1,35 +1,23 @@
/*
* This file is part of the Shiboken Python Bindings Generator project.
*
-* Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
*
* Contact: PySide team
*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU Lesser General Public License
-* version 2.1 as published by the Free Software Foundation. Please
-* review the following information to ensure the GNU Lesser General
-* Public License version 2.1 requirements will be met:
-* http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation; either
+* version 2.1 of the License, or (at your option) any later version.
*
-* As a special exception to the GNU Lesser General Public License
-* version 2.1, the object code form of a "work that uses the Library"
-* may incorporate material from a header file that is part of the
-* Library. You may distribute such object code under terms of your
-* choice, provided that the incorporated material (i) does not exceed
-* more than 5% of the total size of the Library; and (ii) is limited to
-* numerical parameters, data structure layouts, accessors, macros,
-* inline functions and templates.
-*
-* This program is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
-* License along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef DYNAMICQMETAOBJECT_H
diff --git a/libpyside/globalreceiver.cpp b/libpyside/globalreceiver.cpp
index e37235d..e3dcf11 100644
--- a/libpyside/globalreceiver.cpp
+++ b/libpyside/globalreceiver.cpp
@@ -1,35 +1,23 @@
/*
* This file is part of the Shiboken Python Bindings Generator project.
*
-* Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
*
* Contact: PySide team
*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU Lesser General Public License
-* version 2.1 as published by the Free Software Foundation. Please
-* review the following information to ensure the GNU Lesser General
-* Public License version 2.1 requirements will be met:
-* http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation; either
+* version 2.1 of the License, or (at your option) any later version.
*
-* As a special exception to the GNU Lesser General Public License
-* version 2.1, the object code form of a "work that uses the Library"
-* may incorporate material from a header file that is part of the
-* Library. You may distribute such object code under terms of your
-* choice, provided that the incorporated material (i) does not exceed
-* more than 5% of the total size of the Library; and (ii) is limited to
-* numerical parameters, data structure layouts, accessors, macros,
-* inline functions and templates.
-*
-* This program is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
-* License along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "globalreceiver.h"
diff --git a/libpyside/globalreceiver.h b/libpyside/globalreceiver.h
index 6050036..1e67fde 100644
--- a/libpyside/globalreceiver.h
+++ b/libpyside/globalreceiver.h
@@ -1,35 +1,23 @@
/*
* This file is part of the Shiboken Python Bindings Generator project.
*
-* Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
*
* Contact: PySide team
*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU Lesser General Public License
-* version 2.1 as published by the Free Software Foundation. Please
-* review the following information to ensure the GNU Lesser General
-* Public License version 2.1 requirements will be met:
-* http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation; either
+* version 2.1 of the License, or (at your option) any later version.
*
-* As a special exception to the GNU Lesser General Public License
-* version 2.1, the object code form of a "work that uses the Library"
-* may incorporate material from a header file that is part of the
-* Library. You may distribute such object code under terms of your
-* choice, provided that the incorporated material (i) does not exceed
-* more than 5% of the total size of the Library; and (ii) is limited to
-* numerical parameters, data structure layouts, accessors, macros,
-* inline functions and templates.
-*
-* This program is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
-* License along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef GLOBALRECEIVER_H
diff --git a/libpyside/proxyslot.cpp b/libpyside/proxyslot.cpp
index 8852325..285f88b 100644
--- a/libpyside/proxyslot.cpp
+++ b/libpyside/proxyslot.cpp
@@ -1,35 +1,23 @@
/*
* This file is part of the Shiboken Python Bindings Generator project.
*
-* Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
*
* Contact: PySide team
*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU Lesser General Public License
-* version 2.1 as published by the Free Software Foundation. Please
-* review the following information to ensure the GNU Lesser General
-* Public License version 2.1 requirements will be met:
-* http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation; either
+* version 2.1 of the License, or (at your option) any later version.
*
-* As a special exception to the GNU Lesser General Public License
-* version 2.1, the object code form of a "work that uses the Library"
-* may incorporate material from a header file that is part of the
-* Library. You may distribute such object code under terms of your
-* choice, provided that the incorporated material (i) does not exceed
-* more than 5% of the total size of the Library; and (ii) is limited to
-* numerical parameters, data structure layouts, accessors, macros,
-* inline functions and templates.
-*
-* This program is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
-* License along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
diff --git a/libpyside/pyside.cpp b/libpyside/pyside.cpp
index 744dfee..a5996a4 100644
--- a/libpyside/pyside.cpp
+++ b/libpyside/pyside.cpp
@@ -1,35 +1,23 @@
/*
* This file is part of the Shiboken Python Bindings Generator project.
*
- * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
*
* Contact: PySide team
*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation. Please
- * review the following information to ensure the GNU Lesser General
- * Public License version 2.1 requirements will be met:
- * http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
*
- * As a special exception to the GNU Lesser General Public License
- * version 2.1, the object code form of a "work that uses the Library"
- * may incorporate material from a header file that is part of the
- * Library. You may distribute such object code under terms of your
- * choice, provided that the incorporated material (i) does not exceed
- * more than 5% of the total size of the Library; and (ii) is limited to
- * numerical parameters, data structure layouts, accessors, macros,
- * inline functions and templates.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
diff --git a/libpyside/pyside.h b/libpyside/pyside.h
index 52aeec1..5c5dc2e 100644
--- a/libpyside/pyside.h
+++ b/libpyside/pyside.h
@@ -1,35 +1,23 @@
/*
* This file is part of the Shiboken Python Bindings Generator project.
*
- * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
*
* Contact: PySide team
*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation. Please
- * review the following information to ensure the GNU Lesser General
- * Public License version 2.1 requirements will be met:
- * http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
*
- * As a special exception to the GNU Lesser General Public License
- * version 2.1, the object code form of a "work that uses the Library"
- * may incorporate material from a header file that is part of the
- * Library. You may distribute such object code under terms of your
- * choice, provided that the incorporated material (i) does not exceed
- * more than 5% of the total size of the Library; and (ii) is limited to
- * numerical parameters, data structure layouts, accessors, macros,
- * inline functions and templates.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef PYSIDE_H
diff --git a/libpyside/pysideconversions.h b/libpyside/pysideconversions.h
index 35fa687..f36496d 100644
--- a/libpyside/pysideconversions.h
+++ b/libpyside/pysideconversions.h
@@ -5,31 +5,19 @@
*
* Contact: PySide team
*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU Lesser General Public License
-* version 2.1 as published by the Free Software Foundation. Please
-* review the following information to ensure the GNU Lesser General
-* Public License version 2.1 requirements will be met:
-* http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation; either
+* version 2.1 of the License, or (at your option) any later version.
*
-* As a special exception to the GNU Lesser General Public License
-* version 2.1, the object code form of a "work that uses the Library"
-* may incorporate material from a header file that is part of the
-* Library. You may distribute such object code under terms of your
-* choice, provided that the incorporated material (i) does not exceed
-* more than 5% of the total size of the Library; and (ii) is limited to
-* numerical parameters, data structure layouts, accessors, macros,
-* inline functions and templates.
-*
-* This program is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
-* License along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef PYSIDECONVERSIONS_H
diff --git a/libpyside/pysidemacros.h b/libpyside/pysidemacros.h
index ccf8e37..fe475a3 100644
--- a/libpyside/pysidemacros.h
+++ b/libpyside/pysidemacros.h
@@ -1,35 +1,23 @@
/*
* This file is part of the Shiboken Python Bindings Generator project.
*
-* Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
*
* Contact: PySide team
*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU Lesser General Public License
-* version 2.1 as published by the Free Software Foundation. Please
-* review the following information to ensure the GNU Lesser General
-* Public License version 2.1 requirements will be met:
-* http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation; either
+* version 2.1 of the License, or (at your option) any later version.
*
-* As a special exception to the GNU Lesser General Public License
-* version 2.1, the object code form of a "work that uses the Library"
-* may incorporate material from a header file that is part of the
-* Library. You may distribute such object code under terms of your
-* choice, provided that the incorporated material (i) does not exceed
-* more than 5% of the total size of the Library; and (ii) is limited to
-* numerical parameters, data structure layouts, accessors, macros,
-* inline functions and templates.
-*
-* This program is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
-* License along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef PYSIDEMACROS_H
diff --git a/libpyside/qproperty.cpp b/libpyside/qproperty.cpp
index c4b728a..7f28923 100644
--- a/libpyside/qproperty.cpp
+++ b/libpyside/qproperty.cpp
@@ -1,35 +1,23 @@
/*
* This file is part of the Shiboken Python Bindings Generator project.
*
- * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
*
* Contact: PySide team
*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation. Please
- * review the following information to ensure the GNU Lesser General
- * Public License version 2.1 requirements will be met:
- * http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
*
- * As a special exception to the GNU Lesser General Public License
- * version 2.1, the object code form of a "work that uses the Library"
- * may incorporate material from a header file that is part of the
- * Library. You may distribute such object code under terms of your
- * choice, provided that the incorporated material (i) does not exceed
- * more than 5% of the total size of the Library; and (ii) is limited to
- * numerical parameters, data structure layouts, accessors, macros,
- * inline functions and templates.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
diff --git a/libpyside/qproperty.h b/libpyside/qproperty.h
index f561d47..a06d5ad 100644
--- a/libpyside/qproperty.h
+++ b/libpyside/qproperty.h
@@ -1,35 +1,23 @@
/*
* This file is part of the Shiboken Python Bindings Generator project.
*
- * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
*
* Contact: PySide team
*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation. Please
- * review the following information to ensure the GNU Lesser General
- * Public License version 2.1 requirements will be met:
- * http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
*
- * As a special exception to the GNU Lesser General Public License
- * version 2.1, the object code form of a "work that uses the Library"
- * may incorporate material from a header file that is part of the
- * Library. You may distribute such object code under terms of your
- * choice, provided that the incorporated material (i) does not exceed
- * more than 5% of the total size of the Library; and (ii) is limited to
- * numerical parameters, data structure layouts, accessors, macros,
- * inline functions and templates.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef PYSIDE_PROPERTY_H
diff --git a/libpyside/qsignal.cpp b/libpyside/qsignal.cpp
index 01daec6..d5e93cf 100644
--- a/libpyside/qsignal.cpp
+++ b/libpyside/qsignal.cpp
@@ -1,35 +1,23 @@
/*
* This file is part of the Shiboken Python Bindings Generator project.
*
- * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
*
* Contact: PySide team
*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation. Please
- * review the following information to ensure the GNU Lesser General
- * Public License version 2.1 requirements will be met:
- * http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
*
- * As a special exception to the GNU Lesser General Public License
- * version 2.1, the object code form of a "work that uses the Library"
- * may incorporate material from a header file that is part of the
- * Library. You may distribute such object code under terms of your
- * choice, provided that the incorporated material (i) does not exceed
- * more than 5% of the total size of the Library; and (ii) is limited to
- * numerical parameters, data structure layouts, accessors, macros,
- * inline functions and templates.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
diff --git a/libpyside/qsignal.h b/libpyside/qsignal.h
index f57ac24..2776d35 100644
--- a/libpyside/qsignal.h
+++ b/libpyside/qsignal.h
@@ -1,35 +1,23 @@
/*
* This file is part of the Shiboken Python Bindings Generator project.
*
- * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
*
* Contact: PySide team
*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation. Please
- * review the following information to ensure the GNU Lesser General
- * Public License version 2.1 requirements will be met:
- * http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
*
- * As a special exception to the GNU Lesser General Public License
- * version 2.1, the object code form of a "work that uses the Library"
- * may incorporate material from a header file that is part of the
- * Library. You may distribute such object code under terms of your
- * choice, provided that the incorporated material (i) does not exceed
- * more than 5% of the total size of the Library; and (ii) is limited to
- * numerical parameters, data structure layouts, accessors, macros,
- * inline functions and templates.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef PYSIDE_SIGNAL_H
diff --git a/libpyside/qslot.cpp b/libpyside/qslot.cpp
index c471cbb..bdb9c1a 100644
--- a/libpyside/qslot.cpp
+++ b/libpyside/qslot.cpp
@@ -1,35 +1,23 @@
/*
* This file is part of the Shiboken Python Bindings Generator project.
*
- * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
*
* Contact: PySide team
*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation. Please
- * review the following information to ensure the GNU Lesser General
- * Public License version 2.1 requirements will be met:
- * http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
*
- * As a special exception to the GNU Lesser General Public License
- * version 2.1, the object code form of a "work that uses the Library"
- * may incorporate material from a header file that is part of the
- * Library. You may distribute such object code under terms of your
- * choice, provided that the incorporated material (i) does not exceed
- * more than 5% of the total size of the Library; and (ii) is limited to
- * numerical parameters, data structure layouts, accessors, macros,
- * inline functions and templates.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
diff --git a/libpyside/signalmanager.cpp b/libpyside/signalmanager.cpp
index ed15732..de08829 100644
--- a/libpyside/signalmanager.cpp
+++ b/libpyside/signalmanager.cpp
@@ -1,35 +1,23 @@
/*
* This file is part of the Shiboken Python Bindings Generator project.
*
-* Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
*
* Contact: PySide team
*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU Lesser General Public License
-* version 2.1 as published by the Free Software Foundation. Please
-* review the following information to ensure the GNU Lesser General
-* Public License version 2.1 requirements will be met:
-* http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation; either
+* version 2.1 of the License, or (at your option) any later version.
*
-* As a special exception to the GNU Lesser General Public License
-* version 2.1, the object code form of a "work that uses the Library"
-* may incorporate material from a header file that is part of the
-* Library. You may distribute such object code under terms of your
-* choice, provided that the incorporated material (i) does not exceed
-* more than 5% of the total size of the Library; and (ii) is limited to
-* numerical parameters, data structure layouts, accessors, macros,
-* inline functions and templates.
-*
-* This program is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
-* License along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "signalmanager.h"
diff --git a/libpyside/signalmanager.h b/libpyside/signalmanager.h
index 08160a5..4c1c500 100644
--- a/libpyside/signalmanager.h
+++ b/libpyside/signalmanager.h
@@ -1,35 +1,23 @@
/*
* This file is part of the Shiboken Python Bindings Generator project.
*
-* Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
*
* Contact: PySide team
*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU Lesser General Public License
-* version 2.1 as published by the Free Software Foundation. Please
-* review the following information to ensure the GNU Lesser General
-* Public License version 2.1 requirements will be met:
-* http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation; either
+* version 2.1 of the License, or (at your option) any later version.
*
-* As a special exception to the GNU Lesser General Public License
-* version 2.1, the object code form of a "work that uses the Library"
-* may incorporate material from a header file that is part of the
-* Library. You may distribute such object code under terms of your
-* choice, provided that the incorporated material (i) does not exceed
-* more than 5% of the total size of the Library; and (ii) is limited to
-* numerical parameters, data structure layouts, accessors, macros,
-* inline functions and templates.
-*
-* This program is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
-* License along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef SIGNALMANAGER_H
From d1fa9599607c422c8db3d735338e0c2dc5a34b50 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Thu, 9 Sep 2010 11:03:11 -0300
Subject: [PATCH 0208/1129] Added license boilerplates to all typesystem files.
---
PySide/QtCore/typesystem_core.xml | 19 +++++++++++++++
.../QtDeclarative/typesystem_declarative.xml | 19 +++++++++++++++
PySide/QtGui/typesystem_gui.xml.in | 19 +++++++++++++++
PySide/QtGui/typesystem_gui_common.xml | 19 +++++++++++++++
PySide/QtGui/typesystem_gui_mac.xml | 19 +++++++++++++++
PySide/QtGui/typesystem_gui_maemo.xml | 19 +++++++++++++++
PySide/QtGui/typesystem_gui_simulator.xml | 19 +++++++++++++++
PySide/QtGui/typesystem_gui_win.xml | 19 +++++++++++++++
PySide/QtGui/typesystem_gui_x11.xml | 19 +++++++++++++++
PySide/QtHelp/typesystem_help.xml | 19 +++++++++++++++
PySide/QtMaemo5/typesystem_maemo5.xml | 23 +++++++++++++++++--
PySide/QtMultimedia/typesystem_multimedia.xml | 19 +++++++++++++++
PySide/QtNetwork/typesystem_network.xml | 19 +++++++++++++++
PySide/QtOpenGL/typesystem_opengl.xml | 19 +++++++++++++++
PySide/QtScript/typesystem_script.xml | 19 +++++++++++++++
.../QtScriptTools/typesystem_scripttools.xml | 19 +++++++++++++++
PySide/QtSql/typesystem_sql.xml | 19 +++++++++++++++
PySide/QtSvg/typesystem_svg.xml | 19 +++++++++++++++
PySide/QtTest/typesystem_test.xml | 19 +++++++++++++++
PySide/QtUiTools/typesystem_uitools.xml | 21 ++++++++++++++++-
PySide/QtWebKit/typesystem_webkit.xml | 19 +++++++++++++++
.../QtWebKit/typesystem_webkit_simulator.xml | 19 +++++++++++++++
PySide/QtXml/typesystem_xml.xml | 19 +++++++++++++++
.../QtXmlPatterns/typesystem_xmlpatterns.xml | 19 +++++++++++++++
PySide/phonon/typesystem_phonon.xml | 19 +++++++++++++++
PySide/typesystem_templates.xml | 19 +++++++++++++++
26 files changed, 497 insertions(+), 3 deletions(-)
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 8fdb0e5..5464ae0 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -1,4 +1,23 @@
+
diff --git a/PySide/QtDeclarative/typesystem_declarative.xml b/PySide/QtDeclarative/typesystem_declarative.xml
index 7a80e48..3d0f56c 100644
--- a/PySide/QtDeclarative/typesystem_declarative.xml
+++ b/PySide/QtDeclarative/typesystem_declarative.xml
@@ -1,4 +1,23 @@
+
diff --git a/PySide/QtGui/typesystem_gui.xml.in b/PySide/QtGui/typesystem_gui.xml.in
index 88a6e99..210b1dc 100644
--- a/PySide/QtGui/typesystem_gui.xml.in
+++ b/PySide/QtGui/typesystem_gui.xml.in
@@ -1,4 +1,23 @@
+
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index b217509..a3ed01d 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -1,4 +1,23 @@
+
diff --git a/PySide/QtGui/typesystem_gui_mac.xml b/PySide/QtGui/typesystem_gui_mac.xml
index 3360323..2f4ac4c 100644
--- a/PySide/QtGui/typesystem_gui_mac.xml
+++ b/PySide/QtGui/typesystem_gui_mac.xml
@@ -1,4 +1,23 @@
+
diff --git a/PySide/QtGui/typesystem_gui_maemo.xml b/PySide/QtGui/typesystem_gui_maemo.xml
index 0a06c77..99ccb2e 100644
--- a/PySide/QtGui/typesystem_gui_maemo.xml
+++ b/PySide/QtGui/typesystem_gui_maemo.xml
@@ -1,4 +1,23 @@
+
diff --git a/PySide/QtGui/typesystem_gui_simulator.xml b/PySide/QtGui/typesystem_gui_simulator.xml
index 8b10c22..065e44d 100644
--- a/PySide/QtGui/typesystem_gui_simulator.xml
+++ b/PySide/QtGui/typesystem_gui_simulator.xml
@@ -1,4 +1,23 @@
+
diff --git a/PySide/QtGui/typesystem_gui_win.xml b/PySide/QtGui/typesystem_gui_win.xml
index f19521e..bc46909 100644
--- a/PySide/QtGui/typesystem_gui_win.xml
+++ b/PySide/QtGui/typesystem_gui_win.xml
@@ -1,4 +1,23 @@
+
diff --git a/PySide/QtGui/typesystem_gui_x11.xml b/PySide/QtGui/typesystem_gui_x11.xml
index 0731045..0fd3628 100644
--- a/PySide/QtGui/typesystem_gui_x11.xml
+++ b/PySide/QtGui/typesystem_gui_x11.xml
@@ -1,4 +1,23 @@
+
diff --git a/PySide/QtHelp/typesystem_help.xml b/PySide/QtHelp/typesystem_help.xml
index e78153f..b853c04 100644
--- a/PySide/QtHelp/typesystem_help.xml
+++ b/PySide/QtHelp/typesystem_help.xml
@@ -1,4 +1,23 @@
+
diff --git a/PySide/QtMaemo5/typesystem_maemo5.xml b/PySide/QtMaemo5/typesystem_maemo5.xml
index 9f92793..94adaa1 100644
--- a/PySide/QtMaemo5/typesystem_maemo5.xml
+++ b/PySide/QtMaemo5/typesystem_maemo5.xml
@@ -1,4 +1,23 @@
+
@@ -13,7 +32,7 @@
-
+
@@ -67,5 +86,5 @@
-
+
diff --git a/PySide/QtMultimedia/typesystem_multimedia.xml b/PySide/QtMultimedia/typesystem_multimedia.xml
index 1786e70..bd0f6ad 100644
--- a/PySide/QtMultimedia/typesystem_multimedia.xml
+++ b/PySide/QtMultimedia/typesystem_multimedia.xml
@@ -1,4 +1,23 @@
+
diff --git a/PySide/QtNetwork/typesystem_network.xml b/PySide/QtNetwork/typesystem_network.xml
index bfe9ad2..89cea39 100644
--- a/PySide/QtNetwork/typesystem_network.xml
+++ b/PySide/QtNetwork/typesystem_network.xml
@@ -1,4 +1,23 @@
+
diff --git a/PySide/QtOpenGL/typesystem_opengl.xml b/PySide/QtOpenGL/typesystem_opengl.xml
index e1402f7..43e097f 100644
--- a/PySide/QtOpenGL/typesystem_opengl.xml
+++ b/PySide/QtOpenGL/typesystem_opengl.xml
@@ -1,4 +1,23 @@
+
diff --git a/PySide/QtScript/typesystem_script.xml b/PySide/QtScript/typesystem_script.xml
index 822b3d5..a37e6fb 100644
--- a/PySide/QtScript/typesystem_script.xml
+++ b/PySide/QtScript/typesystem_script.xml
@@ -1,4 +1,23 @@
+
diff --git a/PySide/QtScriptTools/typesystem_scripttools.xml b/PySide/QtScriptTools/typesystem_scripttools.xml
index 45bc04b..ad68aed 100644
--- a/PySide/QtScriptTools/typesystem_scripttools.xml
+++ b/PySide/QtScriptTools/typesystem_scripttools.xml
@@ -1,4 +1,23 @@
+
diff --git a/PySide/QtSql/typesystem_sql.xml b/PySide/QtSql/typesystem_sql.xml
index 7c15c69..40beff0 100644
--- a/PySide/QtSql/typesystem_sql.xml
+++ b/PySide/QtSql/typesystem_sql.xml
@@ -1,4 +1,23 @@
+
diff --git a/PySide/QtSvg/typesystem_svg.xml b/PySide/QtSvg/typesystem_svg.xml
index 5cc1b51..484864e 100644
--- a/PySide/QtSvg/typesystem_svg.xml
+++ b/PySide/QtSvg/typesystem_svg.xml
@@ -1,4 +1,23 @@
+
diff --git a/PySide/QtTest/typesystem_test.xml b/PySide/QtTest/typesystem_test.xml
index 734bbbb..a1dfa83 100644
--- a/PySide/QtTest/typesystem_test.xml
+++ b/PySide/QtTest/typesystem_test.xml
@@ -1,4 +1,23 @@
+
diff --git a/PySide/QtUiTools/typesystem_uitools.xml b/PySide/QtUiTools/typesystem_uitools.xml
index 664fbdf..7ea988b 100644
--- a/PySide/QtUiTools/typesystem_uitools.xml
+++ b/PySide/QtUiTools/typesystem_uitools.xml
@@ -1,5 +1,24 @@
-
+
+
+
diff --git a/PySide/QtWebKit/typesystem_webkit.xml b/PySide/QtWebKit/typesystem_webkit.xml
index 845eeb4..a303388 100644
--- a/PySide/QtWebKit/typesystem_webkit.xml
+++ b/PySide/QtWebKit/typesystem_webkit.xml
@@ -1,4 +1,23 @@
+
diff --git a/PySide/QtWebKit/typesystem_webkit_simulator.xml b/PySide/QtWebKit/typesystem_webkit_simulator.xml
index f2a40f2..ff195be 100644
--- a/PySide/QtWebKit/typesystem_webkit_simulator.xml
+++ b/PySide/QtWebKit/typesystem_webkit_simulator.xml
@@ -1,4 +1,23 @@
+
diff --git a/PySide/QtXml/typesystem_xml.xml b/PySide/QtXml/typesystem_xml.xml
index e31f808..3db64b5 100644
--- a/PySide/QtXml/typesystem_xml.xml
+++ b/PySide/QtXml/typesystem_xml.xml
@@ -1,4 +1,23 @@
+
diff --git a/PySide/QtXmlPatterns/typesystem_xmlpatterns.xml b/PySide/QtXmlPatterns/typesystem_xmlpatterns.xml
index 4f10bda..c2e2b52 100644
--- a/PySide/QtXmlPatterns/typesystem_xmlpatterns.xml
+++ b/PySide/QtXmlPatterns/typesystem_xmlpatterns.xml
@@ -1,4 +1,23 @@
+
diff --git a/PySide/phonon/typesystem_phonon.xml b/PySide/phonon/typesystem_phonon.xml
index 1a2a486..2bb9c20 100644
--- a/PySide/phonon/typesystem_phonon.xml
+++ b/PySide/phonon/typesystem_phonon.xml
@@ -1,4 +1,23 @@
+
diff --git a/PySide/typesystem_templates.xml b/PySide/typesystem_templates.xml
index b8c43ee..e2e6fc4 100644
--- a/PySide/typesystem_templates.xml
+++ b/PySide/typesystem_templates.xml
@@ -1,4 +1,23 @@
+
$CHILD_TYPE* oldChild = %CPPSELF.$FUNCTION_GET_OLD();
From 9fbf8b778ba4565ae9ba19943adf0816317edc0d Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Thu, 9 Sep 2010 11:13:31 -0300
Subject: [PATCH 0209/1129] Fix project name on license boilerplates.
---
libpyside/autoarraypointer.h | 2 +-
libpyside/dynamicqmetaobject.cpp | 2 +-
libpyside/dynamicqmetaobject.h | 2 +-
libpyside/globalreceiver.cpp | 2 +-
libpyside/globalreceiver.h | 2 +-
libpyside/proxyslot.cpp | 2 +-
libpyside/pyside.cpp | 2 +-
libpyside/pyside.h | 2 +-
libpyside/pysideconversions.h | 2 +-
libpyside/pysidemacros.h | 2 +-
libpyside/qproperty.cpp | 2 +-
libpyside/qproperty.h | 2 +-
libpyside/qsignal.cpp | 2 +-
libpyside/qsignal.h | 2 +-
libpyside/qslot.cpp | 2 +-
libpyside/signalmanager.cpp | 2 +-
libpyside/signalmanager.h | 2 +-
17 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/libpyside/autoarraypointer.h b/libpyside/autoarraypointer.h
index cec7e0c..47eda60 100644
--- a/libpyside/autoarraypointer.h
+++ b/libpyside/autoarraypointer.h
@@ -1,5 +1,5 @@
/*
- * This file is part of the Shiboken Python Bindings Generator project.
+ * This file is part of the PySide project.
*
* Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
*
diff --git a/libpyside/dynamicqmetaobject.cpp b/libpyside/dynamicqmetaobject.cpp
index a779edd..8ca983e 100644
--- a/libpyside/dynamicqmetaobject.cpp
+++ b/libpyside/dynamicqmetaobject.cpp
@@ -1,5 +1,5 @@
/*
-* This file is part of the Shiboken Python Bindings Generator project.
+* This file is part of the PySide project.
*
* Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
*
diff --git a/libpyside/dynamicqmetaobject.h b/libpyside/dynamicqmetaobject.h
index 9f66c1f..22387a6 100644
--- a/libpyside/dynamicqmetaobject.h
+++ b/libpyside/dynamicqmetaobject.h
@@ -1,5 +1,5 @@
/*
-* This file is part of the Shiboken Python Bindings Generator project.
+* This file is part of the PySide project.
*
* Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
*
diff --git a/libpyside/globalreceiver.cpp b/libpyside/globalreceiver.cpp
index e3dcf11..1b658e2 100644
--- a/libpyside/globalreceiver.cpp
+++ b/libpyside/globalreceiver.cpp
@@ -1,5 +1,5 @@
/*
-* This file is part of the Shiboken Python Bindings Generator project.
+* This file is part of the PySide project.
*
* Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
*
diff --git a/libpyside/globalreceiver.h b/libpyside/globalreceiver.h
index 1e67fde..616d8d3 100644
--- a/libpyside/globalreceiver.h
+++ b/libpyside/globalreceiver.h
@@ -1,5 +1,5 @@
/*
-* This file is part of the Shiboken Python Bindings Generator project.
+* This file is part of the PySide project.
*
* Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
*
diff --git a/libpyside/proxyslot.cpp b/libpyside/proxyslot.cpp
index 285f88b..e480f76 100644
--- a/libpyside/proxyslot.cpp
+++ b/libpyside/proxyslot.cpp
@@ -1,5 +1,5 @@
/*
-* This file is part of the Shiboken Python Bindings Generator project.
+* This file is part of the PySide project.
*
* Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
*
diff --git a/libpyside/pyside.cpp b/libpyside/pyside.cpp
index a5996a4..bfb9889 100644
--- a/libpyside/pyside.cpp
+++ b/libpyside/pyside.cpp
@@ -1,5 +1,5 @@
/*
- * This file is part of the Shiboken Python Bindings Generator project.
+ * This file is part of the PySide project.
*
* Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
*
diff --git a/libpyside/pyside.h b/libpyside/pyside.h
index 5c5dc2e..21515c8 100644
--- a/libpyside/pyside.h
+++ b/libpyside/pyside.h
@@ -1,5 +1,5 @@
/*
- * This file is part of the Shiboken Python Bindings Generator project.
+ * This file is part of the PySide project.
*
* Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
*
diff --git a/libpyside/pysideconversions.h b/libpyside/pysideconversions.h
index f36496d..e92828a 100644
--- a/libpyside/pysideconversions.h
+++ b/libpyside/pysideconversions.h
@@ -1,5 +1,5 @@
/*
-* This file is part of the Shiboken Python Bindings Generator project.
+* This file is part of the PySide project.
*
* Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
*
diff --git a/libpyside/pysidemacros.h b/libpyside/pysidemacros.h
index fe475a3..24c9496 100644
--- a/libpyside/pysidemacros.h
+++ b/libpyside/pysidemacros.h
@@ -1,5 +1,5 @@
/*
-* This file is part of the Shiboken Python Bindings Generator project.
+* This file is part of the PySide project.
*
* Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
*
diff --git a/libpyside/qproperty.cpp b/libpyside/qproperty.cpp
index 7f28923..dc36e3e 100644
--- a/libpyside/qproperty.cpp
+++ b/libpyside/qproperty.cpp
@@ -1,5 +1,5 @@
/*
- * This file is part of the Shiboken Python Bindings Generator project.
+ * This file is part of the PySide project.
*
* Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
*
diff --git a/libpyside/qproperty.h b/libpyside/qproperty.h
index a06d5ad..56ed32f 100644
--- a/libpyside/qproperty.h
+++ b/libpyside/qproperty.h
@@ -1,5 +1,5 @@
/*
- * This file is part of the Shiboken Python Bindings Generator project.
+ * This file is part of the PySide project.
*
* Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
*
diff --git a/libpyside/qsignal.cpp b/libpyside/qsignal.cpp
index d5e93cf..6d829e9 100644
--- a/libpyside/qsignal.cpp
+++ b/libpyside/qsignal.cpp
@@ -1,5 +1,5 @@
/*
- * This file is part of the Shiboken Python Bindings Generator project.
+ * This file is part of the PySide project.
*
* Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
*
diff --git a/libpyside/qsignal.h b/libpyside/qsignal.h
index 2776d35..54fa8f0 100644
--- a/libpyside/qsignal.h
+++ b/libpyside/qsignal.h
@@ -1,5 +1,5 @@
/*
- * This file is part of the Shiboken Python Bindings Generator project.
+ * This file is part of the PySide project.
*
* Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
*
diff --git a/libpyside/qslot.cpp b/libpyside/qslot.cpp
index bdb9c1a..c89f042 100644
--- a/libpyside/qslot.cpp
+++ b/libpyside/qslot.cpp
@@ -1,5 +1,5 @@
/*
- * This file is part of the Shiboken Python Bindings Generator project.
+ * This file is part of the PySide project.
*
* Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
*
diff --git a/libpyside/signalmanager.cpp b/libpyside/signalmanager.cpp
index de08829..f9c36ee 100644
--- a/libpyside/signalmanager.cpp
+++ b/libpyside/signalmanager.cpp
@@ -1,5 +1,5 @@
/*
-* This file is part of the Shiboken Python Bindings Generator project.
+* This file is part of the PySide project.
*
* Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
*
diff --git a/libpyside/signalmanager.h b/libpyside/signalmanager.h
index 4c1c500..53e5f6e 100644
--- a/libpyside/signalmanager.h
+++ b/libpyside/signalmanager.h
@@ -1,5 +1,5 @@
/*
-* This file is part of the Shiboken Python Bindings Generator project.
+* This file is part of the PySide project.
*
* Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
*
From 3ef0527eaf0a9cc296c899f67ec4821f1ad1f073 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Thu, 9 Sep 2010 11:25:00 -0300
Subject: [PATCH 0210/1129] Fix copyright year of generated files.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Reviewer: Luciano Wolf
Renato Araújo
---
PySide/licensecomment.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/PySide/licensecomment.txt b/PySide/licensecomment.txt
index fdf9745..cbfe04e 100644
--- a/PySide/licensecomment.txt
+++ b/PySide/licensecomment.txt
@@ -1,7 +1,7 @@
/*
* This file is part of PySide: Python for Qt
*
- * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
*
* Contact: PySide team
*
From 64663cdb4ef1c64b362c1693a3243df0e3818c1a Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Thu, 9 Sep 2010 14:26:20 -0300
Subject: [PATCH 0211/1129] Fixed QVariant conversion from Python object.
Fixes bug #346, #338
Reviewer: Luciano Wolf
Hugo Parente Lima
---
PySide/QtCore/qvariant_conversions.h | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/PySide/QtCore/qvariant_conversions.h b/PySide/QtCore/qvariant_conversions.h
index 1e1c705..06a8368 100644
--- a/PySide/QtCore/qvariant_conversions.h
+++ b/PySide/QtCore/qvariant_conversions.h
@@ -56,14 +56,13 @@ struct Converter
Shiboken::SbkBaseWrapperType *objType = reinterpret_cast(pyObj->ob_type);
const char* typeName = objType->original_name;
uint typeCode = QMetaType::type(typeName);
- if (!typeCode) {// Try with star at end, for QObject*, QWidget* and QAbstractKinectScroller*
- QString stypeName(typeName);
- stypeName += '*';
- typeCode = QMetaType::type(stypeName.toAscii());
- return QVariant(typeCode, reinterpret_cast(pyObj)->cptr);
+ if (typeCode) {
+ void** data = reinterpret_cast(pyObj)->cptr;
+ if (typeName[strlen(typeName)-1] == '*')
+ return QVariant(typeCode, data);
+ else
+ return QVariant(typeCode, data[0]);
}
- if (typeCode)
- return QVariant(typeCode, reinterpret_cast(pyObj)->cptr[0]);
}
// Is a shiboken type not known by Qt
return QVariant::fromValue(pyObj);
From ae435c55fc8bdc6b2c6456e0f4d00589d7b3bb2c Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Thu, 9 Sep 2010 15:24:51 -0300
Subject: [PATCH 0212/1129] Created unittest for bug #338.
Reviewer: Luciano Wolf
Hugo Parente Lima
---
tests/QtGui/CMakeLists.txt | 1 +
tests/QtGui/bug_338.py | 24 ++++++++++++++++++++++++
2 files changed, 25 insertions(+)
create mode 100644 tests/QtGui/bug_338.py
diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt
index 39b3042..887caa6 100644
--- a/tests/QtGui/CMakeLists.txt
+++ b/tests/QtGui/CMakeLists.txt
@@ -5,6 +5,7 @@ PYSIDE_TEST(bug_243.py)
PYSIDE_TEST(bug_300_test.py)
PYSIDE_TEST(bug_307.py)
PYSIDE_TEST(bug_324.py)
+PYSIDE_TEST(bug_338.py)
PYSIDE_TEST(add_action_test.py)
PYSIDE_TEST(customproxywidget_test.py)
PYSIDE_TEST(float_to_int_implicit_conversion_test.py)
diff --git a/tests/QtGui/bug_338.py b/tests/QtGui/bug_338.py
new file mode 100644
index 0000000..a419fdb
--- /dev/null
+++ b/tests/QtGui/bug_338.py
@@ -0,0 +1,24 @@
+''' Test bug 338: http://bugs.openbossa.org/show_bug.cgi?id=338'''
+
+import sys
+import unittest
+from PySide import QtCore,QtGui
+
+class DiagramItem(QtGui.QGraphicsPolygonItem):
+ def __init__(self, parent=None, scene=None):
+ super(DiagramItem, self).__init__(parent, scene)
+
+ def itemChange(self, change, value):
+ return value
+
+
+class BugTest(unittest.TestCase):
+ def test(self):
+ app = QtGui.QApplication(sys.argv)
+ scene = QtGui.QGraphicsScene()
+ item = DiagramItem()
+ item2 = DiagramItem()
+ #this cause segfault
+ scene.addItem(item)
+ scene.addItem(item2)
+
From a2cc5bd09b2c16d130ebe7f450872cb5fdc7a502 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Thu, 9 Sep 2010 15:56:55 -0300
Subject: [PATCH 0213/1129] Bump version required for Shiboken.
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9810f7c..bd2146a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,7 +7,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules/
${CMAKE_MODULE_PATH})
find_package(PythonLibs REQUIRED)
find_package(PythonInterpWithDebug REQUIRED)
-find_package(Shiboken 0.4.0 REQUIRED)
+find_package(Shiboken 0.5 REQUIRED)
find_package(Qt4 4.5.0 REQUIRED)
find_program(XVFB_RUN NAMES xvfb-run)
From b25a7e510c44db1cae0406b380d984e81676bb38 Mon Sep 17 00:00:00 2001
From: Bruno dos Santos de Araujo
Date: Thu, 9 Sep 2010 15:51:50 -0400
Subject: [PATCH 0214/1129] Add newline in the end of qpytextobject.h to avoid
compiler warnings
---
PySide/qpytextobject.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/PySide/qpytextobject.h b/PySide/qpytextobject.h
index 93f246d..6616270 100644
--- a/PySide/qpytextobject.h
+++ b/PySide/qpytextobject.h
@@ -35,4 +35,6 @@ public:
void drawObject(QPainter* painter, const QRectF& rect, QTextDocument* doc, int posInDocument, const QTextFormat& format ) = 0;
QSizeF intrinsicSize(QTextDocument* doc, int posInDocument, const QTextFormat& format ) = 0;
};
-#endif
\ No newline at end of file
+#endif
+
+
From be5bd91e7234409c88a7a5b57dbfea699ea77add Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Thu, 9 Sep 2010 18:09:28 -0300
Subject: [PATCH 0215/1129] Remove OS specific commands from translation test.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Reviewer: Lauro Moura
Bruno Araújo
---
tests/QtCore/translation_test.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/tests/QtCore/translation_test.py b/tests/QtCore/translation_test.py
index 6b75bee..7b5c5d6 100644
--- a/tests/QtCore/translation_test.py
+++ b/tests/QtCore/translation_test.py
@@ -4,6 +4,7 @@
'''Unit tests to test QTranslator and translation in general.'''
import os
+import glob
import unittest
from PySide.QtCore import *
@@ -16,10 +17,12 @@ class TranslationTest(UsesQCoreApplication):
super(TranslationTest, self).setUp()
self.trdir = os.path.join(os.path.dirname(__file__), 'translations')
# os.system is probably not the best way to do it
- os.system('lrelease %s/*.ts > /dev/null' % self.trdir)
+ for file in glob.glob('%s/*.ts' % self.trdir):
+ self.assertFalse(os.system('lrelease -silent %s' % file))
def tearDown(self):
- os.system('rm %s/*.qm > /dev/null' % self.trdir)
+ for file in glob.glob('%s/*.qm' % self.trdir):
+ os.remove(file)
super(TranslationTest, self).tearDown()
def testLatin(self):
From 95e6f790de7b67df1c68f6c492c9b4e338492d25 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Fri, 10 Sep 2010 10:17:53 -0300
Subject: [PATCH 0216/1129] Add PYSIDE_QT_VERSION to CMakeCache.txt.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This variable stores the Qt version used to compile PySide, so
installers and packages can guess the min Qt version required to run PySide.
Reviewer: Renato Araújo
Luciano Wolf
---
CMakeLists.txt | 1 +
1 file changed, 1 insertion(+)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bd2146a..1b99350 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -65,6 +65,7 @@ set(BINDING_API_MAJOR_VERSION "0")
set(BINDING_API_MINOR_VERSION "4")
set(BINDING_API_MICRO_VERSION "1")
set(BINDING_API_VERSION "${BINDING_API_MAJOR_VERSION}.${BINDING_API_MINOR_VERSION}.${BINDING_API_MICRO_VERSION}" CACHE STRING "PySide version" FORCE)
+set(PYSIDE_QT_VERSION "${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}" CACHE STRING "Qt version used to compile PySide" FORCE)
include(${QT_USE_FILE})
if (${QTVERSION} VERSION_LESS 4.5.0)
From 067b49c738bc147d6a706b6f5ac6336913cb14d5 Mon Sep 17 00:00:00 2001
From: Renato Filho
Date: Fri, 10 Sep 2010 10:25:56 -0300
Subject: [PATCH 0217/1129] Created cmake option 'ENABLE_VERSION_SUFFIX' to use
version on generated files to allow multiples version installed simultaneous.
Reviewer: Hugo Parente Lima
Luciano Wolf
---
CMakeLists.txt | 10 +++++-----
PySide/CMakeLists.txt | 16 ++++++----------
libpyside/CMakeLists.txt | 7 ++++---
libpyside/PySideConfig.cmake.in | 6 +++---
libpyside/pyside.pc.in | 8 ++++----
5 files changed, 22 insertions(+), 25 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1b99350..5ba7022 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,6 +7,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules/
${CMAKE_MODULE_PATH})
find_package(PythonLibs REQUIRED)
find_package(PythonInterpWithDebug REQUIRED)
+find_package(GeneratorRunner 0.6 REQUIRED)
find_package(Shiboken 0.5 REQUIRED)
find_package(Qt4 4.5.0 REQUIRED)
@@ -17,6 +18,7 @@ if (NOT ${XVFB_RUN} MATCHES "XVFB_RUN-NOTFOUND")
message("Using xvfb-run to perform QtGui tests.")
endif()
+option(ENABLE_VERSION_SUFFIX "Used to use current version in suffix to generated files. This is used to allow multiples versions installed simultaneous." FALSE)
set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" )
set(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" CACHE PATH "The subdirectory relative to the install prefix where libraries will be installed (default is /lib${LIB_SUFFIX})" FORCE)
if(CMAKE_HOST_APPLE)
@@ -66,6 +68,9 @@ set(BINDING_API_MINOR_VERSION "4")
set(BINDING_API_MICRO_VERSION "1")
set(BINDING_API_VERSION "${BINDING_API_MAJOR_VERSION}.${BINDING_API_MINOR_VERSION}.${BINDING_API_MICRO_VERSION}" CACHE STRING "PySide version" FORCE)
set(PYSIDE_QT_VERSION "${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}" CACHE STRING "Qt version used to compile PySide" FORCE)
+if(ENABLE_VERSION_SUFFIX)
+ set(pyside_SUFFIX "-${BINDING_API_MAJOR_VERSION}.${BINDING_API_MINOR_VERSION}")
+endif()
include(${QT_USE_FILE})
if (${QTVERSION} VERSION_LESS 4.5.0)
@@ -112,11 +117,6 @@ else()
endif()
set(BINDING_VERSION ${BINDING_API_VERSION}.${QT_VERSION_MAJOR}.${QT_VERSION_MINOR})
-find_program(GENERATOR generatorrunner REQUIRED)
-
-if (NOT GENERATOR)
- message(FATAL_ERROR "You need to specify GENERATOR variable (-DGENERATOR=value)")
-endif()
# uninstall target
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake"
diff --git a/PySide/CMakeLists.txt b/PySide/CMakeLists.txt
index 66621be..3114991 100644
--- a/PySide/CMakeLists.txt
+++ b/PySide/CMakeLists.txt
@@ -1,10 +1,6 @@
project(pyside)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/__init__.py" "${CMAKE_CURRENT_SOURCE_DIR}/private.py"
- DESTINATION "${SITE_PACKAGE}/${BINDING_NAME}")
-
-macro(execute_generator module sources typesystem_path)
- message("Running generator for ${module}...")
-endmacro()
+ DESTINATION "${SITE_PACKAGE}/${BINDING_NAME}${pyside_SUFFIX}")
macro(create_pyside_module module_name module_include_dir module_libraries module_deps module_typesystem_path module_sources typesystem_name)
string(TOLOWER ${module_name} _module)
@@ -16,7 +12,7 @@ macro(create_pyside_module module_name module_include_dir module_libraries modul
endif()
add_custom_command(OUTPUT ${${module_sources}}
- COMMAND ${GENERATOR} ${GENERATOR_EXTRA_FLAGS}
+ COMMAND ${GENERATORRUNNER_BINARY} ${GENERATOR_EXTRA_FLAGS}
${CMAKE_BINARY_DIR}/PySide/global.h
--include-paths=${pyside_SOURCE_DIR}${PATH_SEP}${QT_INCLUDE_DIR}
--typesystem-paths=${pyside_SOURCE_DIR}${PATH_SEP}${${module_typesystem_path}}
@@ -44,12 +40,12 @@ macro(create_pyside_module module_name module_include_dir module_libraries modul
# install
install(FILES ${pyside_BINARY_DIR}/${module_name}${CMAKE_DEBUG_POSTFIX}${${module_name}_suffix}
- DESTINATION ${SITE_PACKAGE}/PySide)
+ DESTINATION ${SITE_PACKAGE}/PySide${pyside_SUFFIX})
string(TOLOWER ${module_name} lower_module_name)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/${module_name}/pyside_${lower_module_name}_python.h
- DESTINATION include/PySide/${module_name}/)
+ DESTINATION include/PySide${pyside_SUFFIX}/${module_name}/)
file(GLOB typesystem_files ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_*.xml ${typesystem_path})
- install(FILES ${typesystem_files} DESTINATION share/PySide/typesystems)
+ install(FILES ${typesystem_files} DESTINATION share/PySide${pyside_SUFFIX}/typesystems)
endmacro()
macro(check_qt_class module class global_sources)
@@ -171,5 +167,5 @@ HAS_QT_MODULE(QT_QTDECLARATIVE_FOUND QtDeclarative)
# install
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_templates.xml
- DESTINATION share/PySide/typesystems)
+ DESTINATION share/PySide${pyside_SUFFIX}/typesystems)
diff --git a/libpyside/CMakeLists.txt b/libpyside/CMakeLists.txt
index 284a384..11196f8 100644
--- a/libpyside/CMakeLists.txt
+++ b/libpyside/CMakeLists.txt
@@ -24,6 +24,7 @@ target_link_libraries(pyside
set_target_properties(pyside PROPERTIES
VERSION ${BINDING_API_VERSION}
SOVERSION "${BINDING_API_MAJOR_VERSION}.${BINDING_API_MINOR_VERSION}"
+ OUTPUT_NAME "pyside${pyside_SUFFIX}"
DEFINE_SYMBOL PYSIDE_EXPORTS)
#
@@ -43,18 +44,18 @@ set(libpyside_HEADERS
# create pkg-config file
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/pyside.pc.in"
- "${CMAKE_CURRENT_BINARY_DIR}/pyside.pc" @ONLY)
+ "${CMAKE_CURRENT_BINARY_DIR}/pyside${pyside_SUFFIX}.pc" @ONLY)
# create cmake-config files
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/PySideConfig.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/PySideConfig.cmake" @ONLY)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/PySideConfigVersion.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/PySideConfigVersion.cmake" @ONLY)
install(FILES ${libpyside_HEADERS}
- DESTINATION include/${BINDING_NAME})
+ DESTINATION include/${BINDING_NAME}${pyside_SUFFIX})
install(TARGETS pyside EXPORT pyside
LIBRARY DESTINATION "${LIB_INSTALL_DIR}"
ARCHIVE DESTINATION "${LIB_INSTALL_DIR}"
RUNTIME DESTINATION bin)
-install(FILES "${CMAKE_CURRENT_BINARY_DIR}/pyside.pc" DESTINATION "${LIB_INSTALL_DIR}/pkgconfig")
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/pyside${pyside_SUFFIX}.pc" DESTINATION "${LIB_INSTALL_DIR}/pkgconfig")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/PySideConfig.cmake"
DESTINATION "${LIB_INSTALL_DIR}/cmake/PySide-${BINDING_API_VERSION}")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/PySideConfigVersion.cmake"
diff --git a/libpyside/PySideConfig.cmake.in b/libpyside/PySideConfig.cmake.in
index 6d618a5..9e0f42e 100644
--- a/libpyside/PySideConfig.cmake.in
+++ b/libpyside/PySideConfig.cmake.in
@@ -2,6 +2,6 @@
# PYSIDE_LIBRARIES - Files to link against to use PySide
# PYSIDE_TYPESYSTEMS - Type system files that should be used by other bindings extending PySide
-SET(PYSIDE_INCLUDE_DIR "@CMAKE_INSTALL_PREFIX@/include/PySide")
-SET(PYSIDE_LIBRARY "@LIB_INSTALL_DIR@/@CMAKE_SHARED_LIBRARY_PREFIX@pyside@CMAKE_SHARED_LIBRARY_SUFFIX@")
-SET(PYSIDE_TYPESYSTEMS "@CMAKE_INSTALL_PREFIX@/share/PySide/typesystems")
+SET(PYSIDE_INCLUDE_DIR "@CMAKE_INSTALL_PREFIX@/include/PySide@pyside_SUFFIX@")
+SET(PYSIDE_LIBRARY "@LIB_INSTALL_DIR@/@CMAKE_SHARED_LIBRARY_PREFIX@pyside@pyside_SUFFIX@@CMAKE_SHARED_LIBRARY_SUFFIX@")
+SET(PYSIDE_TYPESYSTEMS "@CMAKE_INSTALL_PREFIX@/share/PySide@pyside_SUFFFIX@/typesystems")
diff --git a/libpyside/pyside.pc.in b/libpyside/pyside.pc.in
index ca7a0a5..516f8e1 100644
--- a/libpyside/pyside.pc.in
+++ b/libpyside/pyside.pc.in
@@ -1,12 +1,12 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=@CMAKE_INSTALL_PREFIX@
libdir=@LIB_INSTALL_DIR@
-includedir=@CMAKE_INSTALL_PREFIX@/include/PySide
-typesystemdir=@CMAKE_INSTALL_PREFIX@/share/PySide/typesystems
+includedir=@CMAKE_INSTALL_PREFIX@/include/PySide@pyside_SUFFIX@
+typesystemdir=@CMAKE_INSTALL_PREFIX@/share/PySide@pyside_SUFFIX@/typesystems
-Name: PySide
+Name: PySide@pyside_SUFFIX@
Description: Support library for Python bindings of Qt-based libraries.
Version: @BINDING_API_VERSION@
-Libs: -L${libdir} -lpython -lpyside
+Libs: -L${libdir} -lpython -lpyside@pyside_SUFFIX@
Cflags: -I${includedir}
From cbf12bc3a010508081d59bdac832d3e2bb9e0c2a Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Fri, 10 Sep 2010 19:33:49 -0300
Subject: [PATCH 0218/1129] Fix bug#254 - "QWebView.setPage() does not seem to
work"
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Reviewer: Lauro Moura
Renato Araújo
---
PySide/QtWebKit/typesystem_webkit.xml | 7 ++++++-
tests/QtWebKit/webview_test.py | 24 +++++++++++++++++++++++-
2 files changed, 29 insertions(+), 2 deletions(-)
diff --git a/PySide/QtWebKit/typesystem_webkit.xml b/PySide/QtWebKit/typesystem_webkit.xml
index a303388..2ba3d8c 100644
--- a/PySide/QtWebKit/typesystem_webkit.xml
+++ b/PySide/QtWebKit/typesystem_webkit.xml
@@ -49,7 +49,12 @@
-
+
+
+
+
+
+
diff --git a/tests/QtWebKit/webview_test.py b/tests/QtWebKit/webview_test.py
index c06e437..a6a40fd 100644
--- a/tests/QtWebKit/webview_test.py
+++ b/tests/QtWebKit/webview_test.py
@@ -2,13 +2,18 @@
'''Test cases for QWebView'''
import unittest
+import sys
from PySide.QtCore import QObject, SIGNAL, QUrl
-from PySide.QtWebKit import QWebView
+from PySide.QtWebKit import *
from helper import adjust_filename, TimedQApplication
+class testWebPage(QWebPage):
+ def sayMyName(self):
+ return 'testWebPage'
+
class TestLoadFinished(TimedQApplication):
'''Test case for signal QWebView.loadFinished(bool)'''
@@ -33,6 +38,23 @@ class TestLoadFinished(TimedQApplication):
self.assert_(self.called)
+ def testSetPageAndGetPage(self):
+ twp = testWebPage()
+ self.view.setPage(twp)
+ del twp
+ p = self.view.page()
+ self.assertEqual(p.sayMyName(), 'testWebPage')
+
+ # Setting the same webpage should not incref the python obj
+ refCount = sys.getrefcount(p)
+ self.view.setPage(p)
+ self.assertEquals(sys.getrefcount(p), refCount)
+
+ # Changing the webpage obj should decref the old one
+ twp2 = testWebPage()
+ self.view.setPage(twp2)
+ self.assertEquals(sys.getrefcount(p), refCount - 1)
+
def load_finished(self, ok):
#Callback to check if load was successful
self.app.quit()
From b315368a1b8bd1af8fadca38d0356c85662ea3a7 Mon Sep 17 00:00:00 2001
From: renatofilho
Date: Mon, 13 Sep 2010 19:25:41 -0300
Subject: [PATCH 0219/1129] Fixed crash on qsignal destructor.
Reviewer: Hugo Parente Lima
Luciano Wolf
---
libpyside/qsignal.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/libpyside/qsignal.cpp b/libpyside/qsignal.cpp
index 6d829e9..67f58fa 100644
--- a/libpyside/qsignal.cpp
+++ b/libpyside/qsignal.cpp
@@ -226,7 +226,7 @@ void signalUpdateSource(PyObject* source)
PyObject *attrName = PyList_GET_ITEM(attrs.object(), i);
Shiboken::AutoDecRef attr(PyObject_GetAttr(reinterpret_cast(source->ob_type), attrName));
if (attr->ob_type == &Signal_Type) {
- Shiboken::AutoDecRef signalInstance(_PyObject_New(&SignalInstance_Type));
+ Shiboken::AutoDecRef signalInstance((PyObject*)PyObject_New(SignalInstanceData, &SignalInstance_Type));
signal_instance_initialize(signalInstance, attrName, reinterpret_cast(attr.object()), source, 0);
PyObject_SetAttr(source, attrName, signalInstance);
}
@@ -365,9 +365,9 @@ void signal_instance_free(void* self)
free(data->signalName);
free(data->signature);
- while(data) {
+ if (data->next) {
Py_XDECREF(data->next);
- data = reinterpret_cast(data->next);
+ data->next = 0;
}
pySelf->ob_type->tp_base->tp_free(self);
}
From 42f917666904f4eb93002eae2de70d1f225f438f Mon Sep 17 00:00:00 2001
From: renatofilho
Date: Tue, 14 Sep 2010 13:03:39 -0300
Subject: [PATCH 0220/1129] Increased global receiver maximun slots support.
Fixes bug #312.
Reviewer: Hugo Parente Lima
Luciano Wolf
---
libpyside/dynamicqmetaobject.cpp | 47 ++++++++++++++++++++++++++------
libpyside/globalreceiver.cpp | 3 +-
2 files changed, 41 insertions(+), 9 deletions(-)
diff --git a/libpyside/dynamicqmetaobject.cpp b/libpyside/dynamicqmetaobject.cpp
index 8ca983e..c2e7f04 100644
--- a/libpyside/dynamicqmetaobject.cpp
+++ b/libpyside/dynamicqmetaobject.cpp
@@ -36,6 +36,11 @@
#define MAX_SIGNALS_COUNT 50
#define MAX_SLOTS_COUNT 50
+#define MAX_GLOBAL_SIGNALS_COUNT 500
+#define MAX_GLOBAL_SLOTS_COUNT 500
+
+#define GLOBAL_RECEIVER_CLASS_NAME "__GlobalReceiver__"
+
using namespace PySide;
enum PropertyFlags {
@@ -110,6 +115,27 @@ static bool isQRealType(const char *type)
return strcmp(type, "qreal") == 0;
}
+
+
+/*
+ * Avoid API break keep this on cpp
+ */
+static int maxSlotsCount(const QString& className)
+{
+ int maxSlots = MAX_SLOTS_COUNT;
+ if (className == GLOBAL_RECEIVER_CLASS_NAME)
+ maxSlots = MAX_GLOBAL_SIGNALS_COUNT;
+ return maxSlots;
+}
+
+static int maxSignalsCount(const QString& className)
+{
+ int maxSignals = MAX_SIGNALS_COUNT;
+ if (className == GLOBAL_RECEIVER_CLASS_NAME)
+ maxSignals = MAX_GLOBAL_SIGNALS_COUNT;
+ return maxSignals;
+}
+
uint PropertyData::flags() const
{
const char* typeName = type().data();
@@ -271,8 +297,9 @@ void DynamicQMetaObject::addSignal(const char* signal, const char* type)
return;
}
- if (m_signals.size() >= MAX_SIGNALS_COUNT) {
- qWarning() << "Fail to add dynamic signal to QObject. PySide support at most" << MAX_SIGNALS_COUNT << "dynamic signals.";
+ int maxSignals = maxSignalsCount(m_className);
+ if (m_signals.size() >= maxSignals) {
+ qWarning() << "Fail to add dynamic signal to QObject. PySide support at most" << maxSignals << "dynamic signals.";
return;
}
@@ -286,8 +313,9 @@ void DynamicQMetaObject::addSlot(const char* slot, const char* type)
if (i != m_slots.end())
return;
- if (m_slots.size() >= MAX_SLOTS_COUNT) {
- qWarning() << "Fail to add dynamic slot to QObject. PySide support at most" << MAX_SLOTS_COUNT << "dynamic slots.";
+ int maxSlots = maxSlotsCount(m_className);
+ if (m_slots.size() >= maxSlots) {
+ qWarning() << "Fail to add dynamic slot to QObject. PySide support at most" << maxSlots << "dynamic slots.";
return;
}
@@ -439,8 +467,11 @@ void DynamicQMetaObject::updateMetaObject()
MethodScriptable = 0x40
};
- uint n_signals = MAX_SIGNALS_COUNT;
- uint n_methods = n_signals + MAX_SLOTS_COUNT;
+ int maxSignals = maxSignalsCount(m_className);
+ int maxSlots = maxSlotsCount(m_className);
+
+ uint n_signals = maxSignals;
+ uint n_methods = n_signals + maxSlots;
uint n_properties = m_properties.size();
int header[] = {5, // revision
0, // class name index in m_metadata
@@ -465,10 +496,10 @@ void DynamicQMetaObject::updateMetaObject()
int index = HEADER_LENGHT;
//write signals
- writeMethodsData(m_signals, &data, &strings, &index, MAX_SIGNALS_COUNT, NULL_INDEX, AccessPublic | MethodSignal);
+ writeMethodsData(m_signals, &data, &strings, &index, maxSignals, NULL_INDEX, AccessPublic | MethodSignal);
//write slots
- writeMethodsData(m_slots, &data, &strings, &index, MAX_SLOTS_COUNT, NULL_INDEX, AccessPublic | MethodSlot);
+ writeMethodsData(m_slots, &data, &strings, &index, maxSlots, NULL_INDEX, AccessPublic | MethodSlot);
if (m_properties.size())
data[7] = index;
diff --git a/libpyside/globalreceiver.cpp b/libpyside/globalreceiver.cpp
index 1b658e2..2dd82aa 100644
--- a/libpyside/globalreceiver.cpp
+++ b/libpyside/globalreceiver.cpp
@@ -32,6 +32,7 @@
#include "signalmanager.h"
#define RECEIVER_DESTROYED_SLOT_NAME "__receiverDestroyed__(QObject*)"
+#define GLOBAL_RECEIVER_CLASS_NAME "__GlobalReceiver__"
namespace PySide
{
@@ -108,7 +109,7 @@ DynamicSlotData::~DynamicSlotData()
GlobalReceiver::GlobalReceiver()
- : m_metaObject("GlobalReceiver", &QObject::staticMetaObject)
+ : m_metaObject(GLOBAL_RECEIVER_CLASS_NAME, &QObject::staticMetaObject)
{
//slot used to be notifyed of object destrouction
m_metaObject.addSlot(RECEIVER_DESTROYED_SLOT_NAME);
From 3edeee197ac061b3dbd861d63baf489f9031a96d Mon Sep 17 00:00:00 2001
From: renatofilho
Date: Tue, 14 Sep 2010 14:06:42 -0300
Subject: [PATCH 0221/1129] Created unit test for bug #312.
Reviewer: Hugo Parente Lima
Luciano Wolf
---
tests/signals/CMakeLists.txt | 1 +
tests/signals/bug_312.py | 23 +++++++++++++++++++++++
2 files changed, 24 insertions(+)
create mode 100644 tests/signals/bug_312.py
diff --git a/tests/signals/CMakeLists.txt b/tests/signals/CMakeLists.txt
index 5849dc5..eaa9a84 100644
--- a/tests/signals/CMakeLists.txt
+++ b/tests/signals/CMakeLists.txt
@@ -1,5 +1,6 @@
PYSIDE_TEST(args_dont_match_test.py)
PYSIDE_TEST(bug_311.py)
+PYSIDE_TEST(bug_312.py)
PYSIDE_TEST(bug_319.py)
PYSIDE_TEST(decorators_test.py)
PYSIDE_TEST(invalid_callback_test.py)
diff --git a/tests/signals/bug_312.py b/tests/signals/bug_312.py
new file mode 100644
index 0000000..223b4e1
--- /dev/null
+++ b/tests/signals/bug_312.py
@@ -0,0 +1,23 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+import unittest
+from PySide.QtCore import QObject, SIGNAL
+
+class MultipleSlots(unittest.TestCase):
+ def myCB(self):
+ self._count += 1
+
+ def testUnboundSignal(self):
+ o = QObject()
+ self._count = 0
+ for i in range(200):
+ QObject.connect(o, SIGNAL("fire()"), lambda: self.myCB())
+
+ o.emit(SIGNAL("fire()"))
+ self.assertEqual(self._count, 200)
+
+if __name__ == '__main__':
+ unittest.main()
+
+
From 2559ae50f05f5135f88361fdc60f558c382d0b80 Mon Sep 17 00:00:00 2001
From: renatofilho
Date: Tue, 14 Sep 2010 18:19:15 -0300
Subject: [PATCH 0222/1129] Created unittest for bug #332.
Reviewer: Hugo Parente Lima
Luciano Wolf
---
tests/QtCore/CMakeLists.txt | 1 +
tests/QtCore/bug_332.py | 16 ++++++++++++++++
2 files changed, 17 insertions(+)
create mode 100644 tests/QtCore/bug_332.py
diff --git a/tests/QtCore/CMakeLists.txt b/tests/QtCore/CMakeLists.txt
index f364f4c..e0624e0 100644
--- a/tests/QtCore/CMakeLists.txt
+++ b/tests/QtCore/CMakeLists.txt
@@ -1,4 +1,5 @@
PYSIDE_TEST(bug_278_test.py)
+PYSIDE_TEST(bug_332.py)
PYSIDE_TEST(blocking_signals_test.py)
PYSIDE_TEST(child_event_test.py)
PYSIDE_TEST(deletelater_test.py)
diff --git a/tests/QtCore/bug_332.py b/tests/QtCore/bug_332.py
new file mode 100644
index 0000000..ae08742
--- /dev/null
+++ b/tests/QtCore/bug_332.py
@@ -0,0 +1,16 @@
+#!/usr/bin/python
+
+import unittest
+from PySide import QtCore
+
+class Lock(QtCore.QMutex):
+ def tryLock(self,timeoutt=10):
+ return QtCore.QMutex.tryLock(self,timeoutt)
+
+class TestBug(unittest.TestCase):
+
+ def testCase(self):
+ l = Lock()
+ l.tryLock() # this cause a assertion
+
+
From 5ce6221efae57de30c04f1069d294f4e6275bf85 Mon Sep 17 00:00:00 2001
From: renatofilho
Date: Tue, 14 Sep 2010 18:19:59 -0300
Subject: [PATCH 0223/1129] Updated tryLock function to work in thread.
Reviewer: Hugo Parente Lima
Luciano Wolf
---
PySide/QtCore/typesystem_core.xml | 1 +
1 file changed, 1 insertion(+)
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 5464ae0..073da00 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -1640,6 +1640,7 @@
+
From cd7dac40f758f821514693c6d7d4c449a9f81240 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Wed, 15 Sep 2010 10:40:52 -0300
Subject: [PATCH 0224/1129] Don't ignore exceptions caused by property getters
and setters.
The exception is ignored only if the call was a meta call.
---
libpyside/qproperty.cpp | 6 +-----
libpyside/signalmanager.cpp | 2 ++
tests/QtCore/qobject_property_test.py | 7 +++++++
3 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/libpyside/qproperty.cpp b/libpyside/qproperty.cpp
index dc36e3e..e0f2574 100644
--- a/libpyside/qproperty.cpp
+++ b/libpyside/qproperty.cpp
@@ -188,11 +188,7 @@ PyObject* qproperty_get(PyObject* self, PyObject* source)
Shiboken::AutoDecRef args(PyTuple_New(1));
Py_INCREF(source);
PyTuple_SET_ITEM(args, 0, source);
- PyObject *ret = PyObject_CallObject(data->fget, args);
- if (!ret) {
- PyErr_Print();
- }
- return ret;
+ return PyObject_CallObject(data->fget, args);
}
return 0;
}
diff --git a/libpyside/signalmanager.cpp b/libpyside/signalmanager.cpp
index f9c36ee..8208796 100644
--- a/libpyside/signalmanager.cpp
+++ b/libpyside/signalmanager.cpp
@@ -377,6 +377,8 @@ int SignalManager::qt_metacall(QObject* object, QMetaObject::Call call, int id,
args[0] = data;
Py_DECREF(value);
+ } else if (PyErr_Occurred()) {
+ PyErr_Print(); // Clear any errors but print them to stderr
}
break;
}
diff --git a/tests/QtCore/qobject_property_test.py b/tests/QtCore/qobject_property_test.py
index 1d8a16c..fcf8e89 100644
--- a/tests/QtCore/qobject_property_test.py
+++ b/tests/QtCore/qobject_property_test.py
@@ -129,6 +129,13 @@ class PropertyWithConstructorCase(unittest.TestCase):
obj = ExQObject(registeredproperty=123)
self.assertEqual(obj.registeredproperty, 123)
+ def testPythonDeclaredPropertyNoSetted(self):
+ try:
+ obj = ExQObject()
+ a = obj.registeredproperty
+ except AttributeError:
+ pass
+
def testConstructorPropertyInQObjectDerived(self):
#QTimer(property=value) for existing C++ property
obj = QTimer(objectName='dummy')
From 87ea5d920c62eed3e9c1185fa66740c13c71f65b Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Wed, 15 Sep 2010 10:44:27 -0300
Subject: [PATCH 0225/1129] Fix bug#347 - "Setting properties in constructors
gives incorrect results"
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Added new function to libpyside: "fillQtProperties".
Reviewer: Luciano Wolf
Renato Araújo
---
libpyside/pyside.cpp | 41 ++++++++++++++++++++++++++++
libpyside/pyside.h | 13 +++++++++
tests/QtCore/CMakeLists.txt | 1 +
tests/QtCore/setprop_on_ctor_test.py | 12 ++++++++
4 files changed, 67 insertions(+)
create mode 100644 tests/QtCore/setprop_on_ctor_test.py
diff --git a/libpyside/pyside.cpp b/libpyside/pyside.cpp
index bfb9889..ddec198 100644
--- a/libpyside/pyside.cpp
+++ b/libpyside/pyside.cpp
@@ -24,6 +24,10 @@
#include "pyside.h"
#include "signalmanager.h"
#include "qproperty.h"
+#include
+#include
+#include
+#include "qsignal.h"
extern "C" void init_signal(PyObject* module);
extern "C" void init_slot(PyObject* module);
@@ -41,5 +45,42 @@ void init(PyObject *module)
SignalManager::instance();
}
+bool fillQtProperties(PyObject* qObj, const QMetaObject* metaObj, PyObject* kwds, const char** blackList, unsigned int blackListSize)
+{
+
+ PyObject *key, *value;
+ Py_ssize_t pos = 0;
+
+ while (PyDict_Next(kwds, &pos, &key, &value)) {
+ if (!blackListSize || !std::binary_search(blackList, blackList + blackListSize, std::string(PyString_AS_STRING(key)))) {
+ QByteArray propName(PyString_AS_STRING(key));
+ if (metaObj->indexOfProperty(propName) != -1) {
+ propName[0] = std::toupper(propName[0]);
+ propName.prepend("set");
+
+ Shiboken::AutoDecRef propSetter(PyObject_GetAttrString(qObj, propName.constData()));
+ if (!propSetter.isNull()) {
+ Shiboken::AutoDecRef args(PyTuple_Pack(1, value));
+ Shiboken::AutoDecRef retval(PyObject_CallObject(propSetter, args));
+ } else {
+ PyObject* attr = PyObject_GenericGetAttr(qObj, key);
+ if (isQPropertyType(attr))
+ PySide::qproperty_set(attr, qObj, value);
+ }
+ } else {
+ propName.append("()");
+ if (metaObj->indexOfSignal(propName) != -1) {
+ propName.prepend('2');
+ PySide::signal_connect(qObj, propName, value);
+ } else {
+ PyErr_Format(PyExc_AttributeError, "'%s' is not a Qt property or a signal", propName.constData());
+ return false;
+ };
+ }
+ }
+ }
+ return true;
+}
+
} //namespace PySide
diff --git a/libpyside/pyside.h b/libpyside/pyside.h
index 21515c8..cae050b 100644
--- a/libpyside/pyside.h
+++ b/libpyside/pyside.h
@@ -26,6 +26,8 @@
#include
#include
#include
+#include
+#include
namespace PySide
{
@@ -41,6 +43,17 @@ inline uint hash(const T& value)
return qHash(value.toString());
}
+/**
+ * Fill QObject properties and do signal connections using the values found in \p kwds dictonary.
+ * \param qObj PyObject fot the QObject.
+ * \param metaObj QMetaObject of \p qObj.
+ * \param blackList keys to be ignored in kwds dictionary, this string list MUST be sorted.
+ * \param blackListSize numbe rof elements in blackList.
+ * \param kwds key->value dictonary.
+ * \return True if everything goes well, false with a Python error setted otherwise.
+ */
+PYSIDE_API bool fillQtProperties(PyObject* qObj, const QMetaObject* metaObj, PyObject* kwds, const char** blackList, unsigned int blackListSize);
+
/**
* If the type \p T was registered on Qt meta type system with Q_DECLARE_METATYPE macro, this class will initialize
* the meta type.
diff --git a/tests/QtCore/CMakeLists.txt b/tests/QtCore/CMakeLists.txt
index e0624e0..76db54f 100644
--- a/tests/QtCore/CMakeLists.txt
+++ b/tests/QtCore/CMakeLists.txt
@@ -60,6 +60,7 @@ PYSIDE_TEST(qtimer_singleshot_test.py)
PYSIDE_TEST(qtimer_timeout_test.py)
PYSIDE_TEST(qtnamespace_test.py)
PYSIDE_TEST(qurl_test.py)
+PYSIDE_TEST(setprop_on_ctor_test.py)
PYSIDE_TEST(static_method_test.py)
PYSIDE_TEST(static_protected_methods_test.py)
PYSIDE_TEST(thread_signals_test.py)
diff --git a/tests/QtCore/setprop_on_ctor_test.py b/tests/QtCore/setprop_on_ctor_test.py
new file mode 100644
index 0000000..bd4426c
--- /dev/null
+++ b/tests/QtCore/setprop_on_ctor_test.py
@@ -0,0 +1,12 @@
+#!/usr/bin/python
+import unittest
+from PySide.QtCore import *
+
+
+class SetPropOnCtorTest(unittest.TestCase):
+ def testIt(self):
+ obj = QEventTransition(targetStates = [QState()])
+ self.assertEqual(len(obj.targetStates()), 1);
+
+if __name__ == '__main__':
+ unittest.main()
From 09e087f0bd9b38b59cc738589e216e95c5aa2211 Mon Sep 17 00:00:00 2001
From: renatofilho
Date: Wed, 15 Sep 2010 17:39:49 -0300
Subject: [PATCH 0226/1129] Included Notifier signals on genereted code.
Fixes bug: #328.
Reviewer: Hugo Parente Lima
Luciano Wolf
---
PySide/phonon/typesystem_phonon.xml | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/PySide/phonon/typesystem_phonon.xml b/PySide/phonon/typesystem_phonon.xml
index 2bb9c20..e326436 100644
--- a/PySide/phonon/typesystem_phonon.xml
+++ b/PySide/phonon/typesystem_phonon.xml
@@ -61,7 +61,18 @@
-
+
+
+ PyObject* signal_item;
+
+ signal_item = PySide::signalNew("capabilitiesChanged", "void", NULL);
+ PyDict_SetItemString(SbkPhonon_BackendCapabilities_NotifierWrapper_Type.super.ht_type.tp_dict, "capabilitiesChanged", signal_item);
+ Py_DECREF(signal_item);
+
+ signal_item = PySide::signalNew("availableAudioOutputDevicesChanged", "void", NULL);
+ PyDict_SetItemString( SbkPhonon_BackendCapabilities_NotifierWrapper_Type.super.ht_type.tp_dict, "availableAudioOutputDevicesChanged", signal_item);
+ Py_DECREF(signal_item);
+
From f92262928a6ac0463d4fb3fe52e8650fd484fbdc Mon Sep 17 00:00:00 2001
From: renatofilho
Date: Wed, 15 Sep 2010 17:40:29 -0300
Subject: [PATCH 0227/1129] Created unittest for bug 328.
Reviewer: Hugo Parente Lima
Luciano Wolf
---
tests/phonon/CMakeLists.txt | 1 +
tests/phonon/bug_328.py | 18 ++++++++++++++++++
2 files changed, 19 insertions(+)
create mode 100644 tests/phonon/bug_328.py
diff --git a/tests/phonon/CMakeLists.txt b/tests/phonon/CMakeLists.txt
index 1174709..c2b939e 100644
--- a/tests/phonon/CMakeLists.txt
+++ b/tests/phonon/CMakeLists.txt
@@ -1,2 +1,3 @@
PYSIDE_TEST(basic_playing_test.py)
+PYSIDE_TEST(bug_328.py)
PYSIDE_TEST(capabilities_test.py)
diff --git a/tests/phonon/bug_328.py b/tests/phonon/bug_328.py
new file mode 100644
index 0000000..4171b3f
--- /dev/null
+++ b/tests/phonon/bug_328.py
@@ -0,0 +1,18 @@
+#!/usr/bin/python
+
+from PySide import QtCore, QtGui
+from PySide.phonon import Phonon
+import unittest
+
+class TestBug(unittest.TestCase):
+ def myCB(self):
+ pass
+
+ def testForNotifierSignals(self):
+ # this test only check if the signals are present
+ notifier = Phonon.BackendCapabilities.Notifier()
+ notifier.capabilitiesChanged.connect(self.myCB)
+ notifier.availableAudioOutputDevicesChanged.connect(self.myCB)
+
+ self.assert_(True)
+
From c06110168c39e5c44b9b11ff13fd6f9795199df3 Mon Sep 17 00:00:00 2001
From: Marcelo Lira
Date: Thu, 16 Sep 2010 11:36:32 -0300
Subject: [PATCH 0228/1129] Fixes bug #348 adding the method
QState.addTransition(Signal, QAbstractTransition*).
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Reviewed by Luciano Wolf
Reviewed by Renato Araújo
---
PySide/QtCore/typesystem_core.xml | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 073da00..4d7e3e4 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -2380,6 +2380,26 @@
+
+
+
+
+
+
+ // Obviously the label used by the following goto is a very awkward solution,
+ // since it refers to a name very tied to the generator implementation.
+ // Check bug #362 for more information on this
+ // http://bugs.openbossa.org/show_bug.cgi?id=362
+ if (!PyObject_TypeCheck(%1, &PySide::SignalInstance_Type))
+ goto Sbk%TYPEFunc_%FUNCTION_NAME_TypeError;
+ PySide::SignalInstanceData* signalInstance = reinterpret_cast<PySide::SignalInstanceData*>(%1);
+ QObject* sender = %CONVERTTOCPP[QObject*](signalInstance->source);
+ %PYARG_0 = %CONVERTTOPYTHON[QSignalTransition*](%CPPSELF->%FUNCTION_NAME(sender, signalInstance->signature, %2));
+
+
+
From 551f6b9c7240d1f68e50edcec0fc41969beaef1d Mon Sep 17 00:00:00 2001
From: renatofilho
Date: Thu, 16 Sep 2010 14:14:45 -0300
Subject: [PATCH 0229/1129] Fixed connection cleanup function.
Reviewer: Hugo Parente Lima
Luciano Wolf
---
PySide/QtCore/glue/qobject_connect.cpp | 11 +++++++++--
PySide/QtCore/typesystem_core.xml | 6 ++++--
libpyside/dynamicqmetaobject.cpp | 8 ++++----
libpyside/globalreceiver.cpp | 26 +++++++++++++-------------
4 files changed, 30 insertions(+), 21 deletions(-)
diff --git a/PySide/QtCore/glue/qobject_connect.cpp b/PySide/QtCore/glue/qobject_connect.cpp
index b140374..cf78779 100644
--- a/PySide/QtCore/glue/qobject_connect.cpp
+++ b/PySide/QtCore/glue/qobject_connect.cpp
@@ -75,6 +75,8 @@ static bool qobjectConnectCallback(QObject* source, const char* signal, PyObject
slotIndex = metaObject->indexOfSlot(slot);
}
if (QMetaObject::connect(source, signalIndex, receiver, slotIndex, type)) {
+ if (usingGlobalReceiver)
+ signalManager.globalReceiverConnectNotify(source, slotIndex);
#ifndef AVOID_PROTECTED_HACK
source->connectNotify(signal - 1);
#else
@@ -82,8 +84,6 @@ static bool qobjectConnectCallback(QObject* source, const char* signal, PyObject
// connectNotify when avoiding the protected hack.
reinterpret_cast(source)->connectNotify(signal - 1);
#endif
- if (usingGlobalReceiver)
- signalManager.globalReceiverConnectNotify(source, slotIndex);
return true;
}
@@ -114,6 +114,13 @@ static bool qobjectDisconnectCallback(QObject* source, const char* signal, PyObj
if (usingGlobalReceiver) {
int slotIndex = metaObject->indexOfSlot(callbackSig.constData());
signalManager.globalReceiverDisconnectNotify(source, slotIndex);
+ #ifndef AVOID_PROTECTED_HACK
+ source->disconnectNotify(signal - 1);
+ #else
+ // Need to cast to QObjectWrapper* and call the public version of
+ // connectNotify when avoiding the protected hack.
+ reinterpret_cast(source)->disconnectNotify(signal - 1);
+ #endif
}
return true;
}
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 4d7e3e4..c0b333f 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -1230,8 +1230,10 @@
// Avoid return +1 because SignalManager connect to "destroyed()" signal to control object timelife
int ret = %CPPSELF.%FUNCTION_NAME(%1);
- if (ret > 0 && strcmp(%1, SIGNAL(destroyed())) == 0 && PySide::SignalManager::instance().hasConnectionWith(%CPPSELF))
- ret--;
+ if (ret > 0 && ((strcmp(%1, SIGNAL(destroyed())) == 0) || (strcmp(%1, SIGNAL(destroyed(QObject*))) == 0))) {
+ if (PySide::SignalManager::instance().hasConnectionWith(%CPPSELF))
+ ret--;
+ }
%PYARG_0 = %CONVERTTOPYTHON[int](ret);
diff --git a/libpyside/dynamicqmetaobject.cpp b/libpyside/dynamicqmetaobject.cpp
index c2e7f04..b97ae0d 100644
--- a/libpyside/dynamicqmetaobject.cpp
+++ b/libpyside/dynamicqmetaobject.cpp
@@ -322,11 +322,10 @@ void DynamicQMetaObject::addSlot(const char* slot, const char* type)
//search for a empty space
MethodData blank;
i = qFind(m_slots.begin(), m_slots.end(), blank);
- if (i != m_slots.end()) {
+ if (i != m_slots.end())
*i = MethodData(slot, type);
- } else {
+ else
m_slots << MethodData(slot, type);
- }
updateMetaObject();
}
@@ -438,7 +437,6 @@ void DynamicQMetaObject::writeMethodsData(QLinkedList& methods,
if (iMethod != methods.end() && ((*iMethod).signature().size() > 0) ) {
(*data)[index++] = registerString((*iMethod).signature(), strings); // func name
mType = (*iMethod).type();
- iMethod++;
} else {
(*data)[index++] = null_index; // func name
}
@@ -446,6 +444,8 @@ void DynamicQMetaObject::writeMethodsData(QLinkedList& methods,
(*data)[index++] = (mType.size() > 0 ? registerString(mType, strings) : null_index); // normalized type
(*data)[index++] = null_index; // tags
(*data)[index++] = flags;
+ if (iMethod != methods.end())
+ iMethod++;
}
*prtIndex = index;
diff --git a/libpyside/globalreceiver.cpp b/libpyside/globalreceiver.cpp
index 2dd82aa..2c12604 100644
--- a/libpyside/globalreceiver.cpp
+++ b/libpyside/globalreceiver.cpp
@@ -107,7 +107,6 @@ DynamicSlotData::~DynamicSlotData()
Py_DECREF(m_callback);
}
-
GlobalReceiver::GlobalReceiver()
: m_metaObject(GLOBAL_RECEIVER_CLASS_NAME, &QObject::staticMetaObject)
{
@@ -126,20 +125,23 @@ GlobalReceiver::~GlobalReceiver()
void GlobalReceiver::connectNotify(QObject* source, int slotId)
{
if (m_slotReceivers.contains(slotId)) {
- m_slotReceivers[slotId]->addRef(source);
+ DynamicSlotData* data = m_slotReceivers[slotId];
+ if (!data->hasRefTo(source))
+ QObject::connect(source, SIGNAL(destroyed(QObject*)), this, "1"RECEIVER_DESTROYED_SLOT_NAME);
+ data->addRef(source);
}
}
void GlobalReceiver::disconnectNotify(QObject* source, int slotId)
{
- if (m_slotReceivers.contains(slotId)) {
- QObject::disconnect(source, SIGNAL(destroyed(QObject*)), this, "1"RECEIVER_DESTROYED_SLOT_NAME);
-
+ if (m_slotReceivers.contains(slotId)) {
DynamicSlotData *data = m_slotReceivers[slotId];
data->decRef(source);
- if (data->refCount() == 0) {
+ if (data->refCount() == 0)
removeSlot(slotId);
- }
+
+ if (!hasConnectionWith(source))
+ QObject::disconnect(source, SIGNAL(destroyed(QObject*)), this, "1"RECEIVER_DESTROYED_SLOT_NAME);
}
}
@@ -152,9 +154,8 @@ void GlobalReceiver::addSlot(const char* slot, PyObject* callback)
{
m_metaObject.addSlot(slot);
int slotId = m_metaObject.indexOfSlot(slot);
- if (!m_slotReceivers.contains(slotId)) {
+ if (!m_slotReceivers.contains(slotId))
m_slotReceivers[slotId] = new DynamicSlotData(slotId, callback);
- }
bool isShortCircuit = true;
for (int i = 0; slot[i]; ++i) {
@@ -167,6 +168,7 @@ void GlobalReceiver::addSlot(const char* slot, PyObject* callback)
if (isShortCircuit)
m_shortCircuitSlots << slotId;
+
Q_ASSERT(slotId >= QObject::staticMetaObject.methodCount());
}
@@ -236,12 +238,10 @@ int GlobalReceiver::qt_metacall(QMetaObject::Call call, int id, void** args)
retval = PyObject_CallObject(callback, preparedArgs);
}
- if (!retval) {
- qDebug() << "Error calling slot" << m_metaObject.method(id).signature();
+ if (!retval)
PyErr_Print();
- } else {
+ else
Py_DECREF(retval);
- }
return -1;
}
From 1217b7df39a9040d0c579727fa9d15ebb78cff4a Mon Sep 17 00:00:00 2001
From: renatofilho
Date: Thu, 16 Sep 2010 14:15:12 -0300
Subject: [PATCH 0230/1129] Update unit test for bug 312.
Now the test verify if is possible connect more then 500 signals, if the signals was disconnected.
Reviewer: Hugo Parente Lima
Luciano Wolf
---
tests/signals/bug_312.py | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/tests/signals/bug_312.py b/tests/signals/bug_312.py
index 223b4e1..46b64fa 100644
--- a/tests/signals/bug_312.py
+++ b/tests/signals/bug_312.py
@@ -2,8 +2,16 @@
# -*- coding: utf-8 -*-
import unittest
+import sys
from PySide.QtCore import QObject, SIGNAL
+class Dummy(object):
+ def __init__(self, parent):
+ self._parent = parent
+
+ def callback(self):
+ self._called = True
+
class MultipleSlots(unittest.TestCase):
def myCB(self):
self._count += 1
@@ -17,6 +25,21 @@ class MultipleSlots(unittest.TestCase):
o.emit(SIGNAL("fire()"))
self.assertEqual(self._count, 200)
+ def testDisconnectCleanup(self):
+ for c in range(5):
+ self._count = 0
+ self._senders = []
+ for i in range(200):
+ o = QObject()
+ QObject.connect(o, SIGNAL("fire()"), lambda: self.myCB())
+ self._senders.append(o)
+ o.emit(SIGNAL("fire()"))
+
+ self.assertEqual(self._count, 200)
+
+ #delete all senders will disconnect the signals
+ self._senders = []
+
if __name__ == '__main__':
unittest.main()
From 40ccd1fe1f2d553ca25dc6cb10b4c6566879537c Mon Sep 17 00:00:00 2001
From: renatofilho
Date: Thu, 16 Sep 2010 16:56:24 -0300
Subject: [PATCH 0231/1129] Fixed test.
The anonymous connections will be considered on QObject.receivers function.
Reviewer: Hugo Parente Lima
Luciano Wolf
---
tests/QtCore/qobject_protected_methods_test.py | 4 ++--
tests/signals/qobject_receivers_test.py | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/tests/QtCore/qobject_protected_methods_test.py b/tests/QtCore/qobject_protected_methods_test.py
index 530b870..37bda37 100644
--- a/tests/QtCore/qobject_protected_methods_test.py
+++ b/tests/QtCore/qobject_protected_methods_test.py
@@ -23,7 +23,7 @@ class QObjectReceivers(unittest.TestCase):
self.assertEqual(obj.receivers(SIGNAL("destroyed()")), 0)
QObject.connect(obj, SIGNAL("destroyed()"), self.cb)
- self.assertEqual(obj.receivers(SIGNAL("destroyed()")), 0)
+ self.assertEqual(obj.receivers(SIGNAL("destroyed()")), 1)
def testQThreadReceiversExtern(self):
#QThread.receivers() - Inherited protected method
@@ -31,7 +31,7 @@ class QObjectReceivers(unittest.TestCase):
obj = QThread()
self.assertEqual(obj.receivers(SIGNAL('destroyed()')), 0)
QObject.connect(obj, SIGNAL("destroyed()"), self.cb)
- self.assertEqual(obj.receivers(SIGNAL("destroyed()")), 0)
+ self.assertEqual(obj.receivers(SIGNAL("destroyed()")), 1)
if __name__ == '__main__':
diff --git a/tests/signals/qobject_receivers_test.py b/tests/signals/qobject_receivers_test.py
index cb4c9ce..22ebb81 100644
--- a/tests/signals/qobject_receivers_test.py
+++ b/tests/signals/qobject_receivers_test.py
@@ -30,9 +30,9 @@ class TestQObjectReceivers(unittest.TestCase):
sender = QObject()
receiver = QObject()
sender.connect(sender, SIGNAL("destroyed()"), cute_slot)
- self.assertEqual(sender.receivers(SIGNAL("destroyed( )")), 0)
+ self.assertEqual(sender.receivers(SIGNAL("destroyed( )")), 1)
sender.connect(sender, SIGNAL("destroyed()"), receiver, SLOT("deleteLater()"))
- self.assertEqual(sender.receivers(SIGNAL("destroyed()")), 1)
+ self.assertEqual(sender.receivers(SIGNAL("destroyed()")), 2)
del sender
del receiver
From b47f82c498ff8dae8a418784026b40cc7ca41e31 Mon Sep 17 00:00:00 2001
From: Marcelo Lira
Date: Thu, 16 Sep 2010 14:48:57 -0300
Subject: [PATCH 0232/1129] Fixed the Python names for Signal and Slot objects.
In python the Signal object appears as "Signal" instead of
"PySide.QtCore.Signal", and the Slot object read as "QtCore.Slot"
instead of "PySide.QtCore.Slot".
---
libpyside/qsignal.cpp | 4 ++--
libpyside/qslot.cpp | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/libpyside/qsignal.cpp b/libpyside/qsignal.cpp
index 67f58fa..aa218ec 100644
--- a/libpyside/qsignal.cpp
+++ b/libpyside/qsignal.cpp
@@ -66,7 +66,7 @@ static PyObject* signal_build_qt_compatible(const char*);
PyTypeObject Signal_Type = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
- SIGNAL_CLASS_NAME, /*tp_name*/
+ "PySide.QtCore."SIGNAL_CLASS_NAME, /*tp_name*/
sizeof(SignalData), /*tp_basicsize*/
0, /*tp_itemsize*/
0, /*tp_dealloc*/
@@ -129,7 +129,7 @@ static PyMappingMethods SignalInstance_as_mapping = {
PyTypeObject SignalInstance_Type = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
- SIGNAL_CLASS_NAME, /*tp_name*/
+ "PySide.QtCore."SIGNAL_CLASS_NAME, /*tp_name*/
sizeof(SignalInstanceData),/*tp_basicsize*/
0, /*tp_itemsize*/
0, /*tp_dealloc*/
diff --git a/libpyside/qslot.cpp b/libpyside/qslot.cpp
index c89f042..3c7f4fc 100644
--- a/libpyside/qslot.cpp
+++ b/libpyside/qslot.cpp
@@ -49,7 +49,7 @@ extern char* get_type_name(PyObject*);
static PyTypeObject Slot_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "QtCore."SLOT_DEC_NAME, /*tp_name*/
+ "PySide.QtCore."SLOT_DEC_NAME, /*tp_name*/
sizeof(SlotData), /*tp_basicsize*/
0, /*tp_itemsize*/
0, /*tp_dealloc*/
From 562bb8a822a8ef24066d75b613d9c2d05fb2fdee Mon Sep 17 00:00:00 2001
From: Marcelo Lira
Date: Thu, 16 Sep 2010 14:56:01 -0300
Subject: [PATCH 0233/1129] Added test from Lauro's patch on bug #313.
http://bugs.openbossa.org/show_bug.cgi?id=313
---
tests/QtCore/qtimer_singleshot_test.py | 33 ++++++++++++++++++++++++--
1 file changed, 31 insertions(+), 2 deletions(-)
diff --git a/tests/QtCore/qtimer_singleshot_test.py b/tests/QtCore/qtimer_singleshot_test.py
index 96107ec..09c9ed6 100644
--- a/tests/QtCore/qtimer_singleshot_test.py
+++ b/tests/QtCore/qtimer_singleshot_test.py
@@ -4,7 +4,7 @@
import unittest
-from PySide.QtCore import QObject, QTimer, QCoreApplication, SIGNAL
+from PySide.QtCore import QObject, QTimer, QCoreApplication, Signal
from helper import UsesQCoreApplication
class WatchDog(QObject):
@@ -40,7 +40,36 @@ class TestSingleShot(UsesQCoreApplication):
self.app.quit()
def testSingleShot(self):
- timer = QTimer.singleShot(100, self.callback)
+ QTimer.singleShot(100, self.callback)
+ self.app.exec_()
+ self.assert_(self.called)
+
+class SigEmitter(QObject):
+
+ sig1 = Signal()
+
+
+class TestSingleShotSignal(UsesQCoreApplication):
+ '''Test case for QTimer.singleShot connecting to signals'''
+
+ def setUp(self):
+ UsesQCoreApplication.setUp(self)
+ self.watchdog = WatchDog(self)
+ self.called = False
+
+ def tearDown(self):
+ del self.watchdog
+ del self.called
+ UsesQCoreApplication.tearDown(self)
+
+ def callback(self):
+ self.called = True
+ self.app.quit()
+
+ def testSingleShotSignal(self):
+ emitter = SigEmitter()
+ emitter.sig1.connect(self.callback)
+ QTimer.singleShot(100, emitter.sig1)
self.app.exec_()
self.assert_(self.called)
From 75b44379d3e9e5f6dc4e6943b2f2229e32802892 Mon Sep 17 00:00:00 2001
From: Marcelo Lira
Date: Thu, 16 Sep 2010 16:47:30 -0300
Subject: [PATCH 0234/1129] Added the method signature QTimer.singleShot(int,
Signal).
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This fixes bug #313.
The implementation can be improved when bug #362 gets fixed.
Reviewed by Luciano Wolf
Reviewed by Renato Araújo
---
PySide/QtCore/typesystem_core.xml | 52 ++++++++++++++++++++++++++++---
1 file changed, 47 insertions(+), 5 deletions(-)
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index c0b333f..d7c5891 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -1726,8 +1726,15 @@
Shiboken::SbkType<QTimer>()->tp_init(pyTimer, emptyTuple, 0);
QTimer* timer = Converter<QTimer*>::toCpp(pyTimer);
- PyObject* result = PyObject_CallMethod(pyTimer, const_cast<char*>("connect"), const_cast<char*>("OsOs"), pyTimer, SIGNAL(timeout()), %PYARG_2, %3);
- Py_DECREF(result);
+ Shiboken::AutoDecRef result(
+ PyObject_CallMethod(pyTimer,
+ const_cast<char*>("connect"),
+ const_cast<char*>("OsOs"),
+ pyTimer,
+ SIGNAL(timeout()),
+ %PYARG_2,
+ %3)
+ );
// invalidate to avoid use of python object
Shiboken::BindingManager::instance().invalidateWrapper((Shiboken::SbkBaseWrapper *)pyTimer);
timer->setSingleShot(true);
@@ -1744,10 +1751,45 @@
QTimer* timer = Converter<QTimer*>::toCpp(pyTimer);
timer->setSingleShot(true);
timer->connect(timer, SIGNAL(timeout()), timer, SLOT(deleteLater()));
- PyObject* result = PyObject_CallMethod(pyTimer, const_cast<char*>("connect"), const_cast<char*>("OsO"), pyTimer, SIGNAL(timeout()), pyargs[1]);
- Py_DECREF(result);
+
+ Shiboken::AutoDecRef result(
+ PyObject_CallMethod(pyTimer,
+ const_cast<char*>("connect"),
+ const_cast<char*>("OsO"),
+ pyTimer,
+ SIGNAL(timeout()),
+ pyargs[1])
+ );
Shiboken::BindingManager::instance().invalidateWrapper((Shiboken::SbkBaseWrapper *)pyTimer);
- timer->start(cpp_arg0);
+ timer->start(%1);
+
+
+
+
+
+ if (!PyObject_TypeCheck(%2, &PySide::SignalInstance_Type))
+ goto Sbk%TYPEFunc_%FUNCTION_NAME_TypeError;
+
+ // %FUNCTION_NAME() - disable generation of c++ function call
+ Shiboken::AutoDecRef emptyTuple(PyTuple_New(0));
+ PyObject* pyTimer = Shiboken::SbkType<QTimer>()->tp_new(Shiboken::SbkType<QTimer>(), emptyTuple, 0);
+ Shiboken::SbkType<QTimer>()->tp_init(pyTimer, emptyTuple, 0);
+ QTimer* timer = Converter<QTimer*>::toCpp(pyTimer);
+ timer->setSingleShot(true);
+ timer->connect(timer, SIGNAL(timeout()), timer, SLOT(deleteLater()));
+ PySide::SignalInstanceData* signalInstance = reinterpret_cast<PySide::SignalInstanceData*>(%2);
+ Shiboken::AutoDecRef signalSignature(PyString_FromFormat("2%s", signalInstance->signature));
+ Shiboken::AutoDecRef result(
+ PyObject_CallMethod(pyTimer,
+ const_cast<char*>("connect"),
+ const_cast<char*>("OsOO"),
+ pyTimer,
+ SIGNAL(timeout()),
+ signalInstance->source,
+ signalSignature.object())
+ );
+ Shiboken::BindingManager::instance().invalidateWrapper((Shiboken::SbkBaseWrapper *)pyTimer);
+ timer->start(%1);
From b8436f6b1e1efb4da51c6bcc6c22d997541d10c6 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Thu, 16 Sep 2010 11:39:59 -0300
Subject: [PATCH 0235/1129] Fix doc generation and only generate docs for
QtDeclarative module when it was found.
Reviewer: Luciano Wolf
Marcelo Lira
---
doc/CMakeLists.txt | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index 37dc8d6..92389b9 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -27,7 +27,7 @@ macro(create_doc module typesystem_path)
string(REGEX REPLACE "^Qt" "" module_name ${module})
string(TOLOWER ${module_name} module_name)
add_custom_target("${module}-apidoc"
-COMMAND ${GENERATOR} --generatorSet=qtdoc
+COMMAND ${GENERATORRUNNER_BINARY} --generatorSet=qtdoc
${pyside_BINARY_DIR}/global.h
--include-paths=${QT_INCLUDE_DIR}:${QT_QTCORE_INCLUDE_DIR}
--typesystem-paths=${pyside_SOURCE_DIR}:${${module}_BINARY_DIR}:${typesystem_path}
@@ -61,7 +61,9 @@ create_doc(QtScriptTools "${QtCore_SOURCE_DIR}:${QtScript_SOURCE_DIR}:${QtGui_SO
create_doc(QtTest "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtGui_BINARY_DIR}")
create_doc(QtXmlPatterns "${QtCore_SOURCE_DIR}")
create_doc(phonon "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtGui_BINARY_DIR}")
-create_doc(QtDeclarative "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtGui_BINARY_DIR}:${QtNetwork_SOURCE_DIR}")
+if (QT_QTDECLARATIVE_FOUND)
+ create_doc(QtDeclarative "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtGui_BINARY_DIR}:${QtNetwork_SOURCE_DIR}")
+endif()
#create devhelp file
add_custom_target(apidevhelp
From 6974551674d72a828ff9ae19af510c90a62a09ec Mon Sep 17 00:00:00 2001
From: renatofilho
Date: Fri, 17 Sep 2010 17:03:01 -0300
Subject: [PATCH 0236/1129] Created PySide cleanup functions used to register
functions to be called before the python die.
Reviewer: Hugo Parente Lima
Luciano Wolf
---
PySide/QtCore/glue/qcoreapplication_init.cpp | 11 +++++-----
PySide/QtCore/typesystem_core.xml | 11 +++-------
PySide/QtGui/glue/qapplication_init.cpp | 20 ++++++++++++++-----
libpyside/pyside.cpp | 21 +++++++++++++++++++-
libpyside/pyside.h | 9 +++++++++
libpyside/signalmanager.cpp | 7 +++++++
6 files changed, 59 insertions(+), 20 deletions(-)
diff --git a/PySide/QtCore/glue/qcoreapplication_init.cpp b/PySide/QtCore/glue/qcoreapplication_init.cpp
index 7601dbd..14ccbb8 100644
--- a/PySide/QtCore/glue/qcoreapplication_init.cpp
+++ b/PySide/QtCore/glue/qcoreapplication_init.cpp
@@ -1,21 +1,20 @@
// Global variables used to store argc and argv values
static int QCoreApplicationArgCount;
static char** QCoreApplicationArgValues;
-static bool leavingPython = false;
/**
* Called at QtCore module exit
*/
void DeleteQCoreApplicationAtExit()
{
- leavingPython = true;
QCoreApplication *cpp = QCoreApplication::instance();
if (cpp) {
Shiboken::BindingManager &bmngr = Shiboken::BindingManager::instance();
PyObject* pySelf = bmngr.retrieveWrapper(cpp);
- if (pySelf)
- bmngr.invalidateWrapper(pySelf);
- cpp->deleteLater();
+ cpp->flush();
+ QCoreApplication::processEvents();
+ bmngr.invalidateWrapper(pySelf);
+ delete cpp;
}
}
@@ -54,7 +53,7 @@ int SbkQCoreApplication_Init(PyObject* self, PyObject* args, PyObject*)
PySide::signalUpdateSource(self);
cptr->metaObject();
- Py_AtExit(DeleteQCoreApplicationAtExit);
+ PySide::registerCleanupFunction(DeleteQCoreApplicationAtExit);
Py_INCREF(self);
return 1;
}
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index d7c5891..f10ed07 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -552,8 +552,8 @@
-
- PySide::SignalManager::instance().clear();
+
+ PySide::runCleanupFunctions();
@@ -1875,12 +1875,7 @@
-
-
- Shiboken::ThreadStateSaver threadStateSaver;
- if (!leavingPython)
- threadStateSaver.save();
-
+
diff --git a/PySide/QtGui/glue/qapplication_init.cpp b/PySide/QtGui/glue/qapplication_init.cpp
index 699633a..208d59a 100644
--- a/PySide/QtGui/glue/qapplication_init.cpp
+++ b/PySide/QtGui/glue/qapplication_init.cpp
@@ -4,19 +4,29 @@ extern PyObject* moduleQtGui;
static int QApplicationArgCount;
static char** QApplicationArgValues;
static const char QAPP_MACRO[] = "qApp";
-static bool leavingPython = false;
void DeleteQApplicationAtExit()
{
- leavingPython = true;
PySide::SignalManager::instance().clear();
QCoreApplication* cpp = QApplication::instance();
if (cpp) {
Shiboken::BindingManager &bmngr = Shiboken::BindingManager::instance();
- PyObject* pySelf = bmngr.retrieveWrapper(cpp);
- if (pySelf)
+ cpp->flush();
+
+ // Delete all widgets, this is slow but is necessary to avoid problems with python object
+ foreach(QWidget* w, QApplication::allWidgets()) {
+ PyObject* pySelf = bmngr.retrieveWrapper(w);
+
+ w->deleteLater();
+ //Make sure all events will send before invalidated the python object
+ QApplication::processEvents();
bmngr.invalidateWrapper(pySelf);
+ }
+
+ PyObject* pySelf = bmngr.retrieveWrapper(cpp);
cpp->deleteLater();
+ QApplication::processEvents();
+ bmngr.invalidateWrapper(pySelf);
}
}
@@ -62,7 +72,7 @@ int SbkQApplication_Init(PyObject* self, PyObject* args, PyObject*)
}
PyObject_SetAttrString(moduleQtGui, QAPP_MACRO, self);
- Py_AtExit(DeleteQApplicationAtExit);
+ PySide::registerCleanupFunction(DeleteQApplicationAtExit);
Py_INCREF(self);
return 1;
}
diff --git a/libpyside/pyside.cpp b/libpyside/pyside.cpp
index ddec198..bd4ab7c 100644
--- a/libpyside/pyside.cpp
+++ b/libpyside/pyside.cpp
@@ -24,18 +24,22 @@
#include "pyside.h"
#include "signalmanager.h"
#include "qproperty.h"
+#include "qsignal.h"
#include
#include
#include
-#include "qsignal.h"
+#include
extern "C" void init_signal(PyObject* module);
extern "C" void init_slot(PyObject* module);
extern "C" void init_qproperty(PyObject* module);
+static QStack cleanupFunctionList;
+
namespace PySide
{
+
void init(PyObject *module)
{
init_signal(module);
@@ -82,5 +86,20 @@ bool fillQtProperties(PyObject* qObj, const QMetaObject* metaObj, PyObject* kwds
return true;
}
+void registerCleanupFunction(CleanupFunction func)
+{
+ cleanupFunctionList.push(func);
+}
+
+void runCleanupFunctions()
+{
+ while (!cleanupFunctionList.isEmpty()) {
+ CleanupFunction f = cleanupFunctionList.pop();
+ f();
+ }
+}
+
+
+
} //namespace PySide
diff --git a/libpyside/pyside.h b/libpyside/pyside.h
index cae050b..2c5afb5 100644
--- a/libpyside/pyside.h
+++ b/libpyside/pyside.h
@@ -75,6 +75,15 @@ template
struct initQtMetaType {
};
+
+typedef void (*CleanupFunction)(void);
+
+/**
+ * Register a function to be called before python die
+ */
+PYSIDE_API void registerCleanupFunction(CleanupFunction func);
+PYSIDE_API void runCleanupFunctions();
+
} //namespace PySide
diff --git a/libpyside/signalmanager.cpp b/libpyside/signalmanager.cpp
index 8208796..3724500 100644
--- a/libpyside/signalmanager.cpp
+++ b/libpyside/signalmanager.cpp
@@ -22,6 +22,7 @@
#include "signalmanager.h"
#include "qproperty.h"
+#include "pyside.h"
#include
#include
@@ -223,6 +224,11 @@ struct SignalManager::SignalManagerPrivate
GlobalReceiver m_globalReceiver;
};
+static void clearSignalManager()
+{
+ PySide::SignalManager::instance().clear();
+}
+
SignalManager::SignalManager() : m_d(new SignalManagerPrivate)
{
// Register Qt primitive typedefs used on signals.
@@ -234,6 +240,7 @@ SignalManager::SignalManager() : m_d(new SignalManagerPrivate)
TypeResolver::createValueTypeResolver(PYTHON_TYPE);
TypeResolver::createValueTypeResolver("object");
TypeResolver::createValueTypeResolver("PySide::PyObjectWrapper");
+ PySide::registerCleanupFunction(clearSignalManager);
}
void SignalManager::clear()
From 5a86f845c2eabb71a3a19be32a2d34ad5b72bca9 Mon Sep 17 00:00:00 2001
From: renatofilho
Date: Mon, 20 Sep 2010 10:32:24 -0300
Subject: [PATCH 0237/1129] Renamed QProperty object to Property.
Reviewer: Luciano Wolf
Marcelo Lira
---
libpyside/pyside.cpp | 3 ---
libpyside/qproperty.cpp | 2 +-
2 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/libpyside/pyside.cpp b/libpyside/pyside.cpp
index bd4ab7c..d466458 100644
--- a/libpyside/pyside.cpp
+++ b/libpyside/pyside.cpp
@@ -39,7 +39,6 @@ static QStack cleanupFunctionList;
namespace PySide
{
-
void init(PyObject *module)
{
init_signal(module);
@@ -99,7 +98,5 @@ void runCleanupFunctions()
}
}
-
-
} //namespace PySide
diff --git a/libpyside/qproperty.cpp b/libpyside/qproperty.cpp
index e0f2574..7453876 100644
--- a/libpyside/qproperty.cpp
+++ b/libpyside/qproperty.cpp
@@ -27,7 +27,7 @@
#include "qproperty.h"
-#define QPROPERTY_CLASS_NAME "QProperty"
+#define QPROPERTY_CLASS_NAME "Property"
namespace PySide
{
From 67cb84debbd19bd47ee0281fd014bd77042f1e4c Mon Sep 17 00:00:00 2001
From: renatofilho
Date: Mon, 20 Sep 2010 11:12:47 -0300
Subject: [PATCH 0238/1129] Removed old comentary (not necessary anymore).
Reviewer: Luciano Wolf
Marcelo Lira
---
libpyside/dynamicqmetaobject.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libpyside/dynamicqmetaobject.cpp b/libpyside/dynamicqmetaobject.cpp
index b97ae0d..6c7710f 100644
--- a/libpyside/dynamicqmetaobject.cpp
+++ b/libpyside/dynamicqmetaobject.cpp
@@ -512,7 +512,7 @@ void DynamicQMetaObject::updateMetaObject()
data[index++] = NULL_INDEX;
data[index++] = (pp.isValid() ? registerString(pp.type(), &strings) : NULL_INDEX); // normalized type
- data[index++] = pp.flags(); //pp.flags(); //TODO: flags
+ data[index++] = pp.flags();
}
data[index++] = 0; // the end
From b476759ed077e45f6d9ec78cf367554f1f5114f3 Mon Sep 17 00:00:00 2001
From: renatofilho
Date: Mon, 20 Sep 2010 11:17:28 -0300
Subject: [PATCH 0239/1129] Updated test with new Property name.
Reviewer: Luciano Wolf
Marcelo Lira
---
tests/QtCore/qobject_property_test.py | 4 ++--
tests/QtScript/property_test.py | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/tests/QtCore/qobject_property_test.py b/tests/QtCore/qobject_property_test.py
index fcf8e89..7406894 100644
--- a/tests/QtCore/qobject_property_test.py
+++ b/tests/QtCore/qobject_property_test.py
@@ -23,7 +23,7 @@ class ExQObject(QObject):
def getProperty(self):
return self._value
- registeredproperty = QProperty(int, getProperty, setProperty)
+ registeredproperty = Property(int, getProperty, setProperty)
class MyObject(QObject):
'''Test Property'''
@@ -34,7 +34,7 @@ class MyObject(QObject):
def trySetPP(self):
self.pp = 0
- pp = QProperty(int, readPP)
+ pp = Property(int, readPP)
class PropertyCase(unittest.TestCase):
'''Test case for QObject properties'''
diff --git a/tests/QtScript/property_test.py b/tests/QtScript/property_test.py
index 6d20416..52c01f7 100644
--- a/tests/QtScript/property_test.py
+++ b/tests/QtScript/property_test.py
@@ -1,6 +1,6 @@
import unittest
-from PySide.QtCore import QObject, QProperty, QCoreApplication
+from PySide.QtCore import QObject, Property, QCoreApplication
from PySide.QtScript import QScriptEngine
class MyObject(QObject):
@@ -20,7 +20,7 @@ class MyObject(QObject):
def delX(self):
self._p = 0
- x = QProperty(int, getX, setX, resetX, delX)
+ x = Property(int, getX, setX, resetX, delX)
class QPropertyTest(unittest.TestCase):
From 80c2ebe62694815e2023b5fbafb9242fbdd1f2c9 Mon Sep 17 00:00:00 2001
From: renatofilho
Date: Mon, 20 Sep 2010 15:12:08 -0300
Subject: [PATCH 0240/1129] Created unit test for bug 363.
Reviewer: Luciano Wolf
Marcelo Lira
---
tests/QtGui/CMakeLists.txt | 1 +
tests/QtGui/bug_363.py | 25 +++++++++++++++++++++++++
2 files changed, 26 insertions(+)
create mode 100644 tests/QtGui/bug_363.py
diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt
index 887caa6..ea6b4a6 100644
--- a/tests/QtGui/CMakeLists.txt
+++ b/tests/QtGui/CMakeLists.txt
@@ -6,6 +6,7 @@ PYSIDE_TEST(bug_300_test.py)
PYSIDE_TEST(bug_307.py)
PYSIDE_TEST(bug_324.py)
PYSIDE_TEST(bug_338.py)
+PYSIDE_TEST(bug_363.py)
PYSIDE_TEST(add_action_test.py)
PYSIDE_TEST(customproxywidget_test.py)
PYSIDE_TEST(float_to_int_implicit_conversion_test.py)
diff --git a/tests/QtGui/bug_363.py b/tests/QtGui/bug_363.py
new file mode 100644
index 0000000..5ba5dee
--- /dev/null
+++ b/tests/QtGui/bug_363.py
@@ -0,0 +1,25 @@
+''' Test bug 363: http://bugs.openbossa.org/show_bug.cgi?id=363'''
+
+import sys
+import unittest
+from helper import UsesQApplication
+from PySide import QtCore,QtGui
+
+# Check for desktop object lifetime
+class BugTest(UsesQApplication):
+ def mySlot(self):
+ pass
+
+ # test if it is possible to connect with a desktop object after storing that on an auxiliar variable
+ def testCase1(self):
+ desktop = QtGui.QApplication.desktop()
+ desktop.resized[int].connect(self.mySlot)
+ self.assert_(True)
+
+ # test if it is possible to connect with a desktop object without storing that on an auxiliar variable
+ def testCase2(self):
+ QtGui.QApplication.desktop().resized[int].connect(self.mySlot)
+ self.assert_(True)
+
+if __name__ == '__main__':
+ unittest.main()
From 0c0a5c128dcccc54ce08f53faec480d5d51f3425 Mon Sep 17 00:00:00 2001
From: renatofilho
Date: Mon, 20 Sep 2010 15:12:23 -0300
Subject: [PATCH 0241/1129] Fixed QApplication static functions return policy.
Fixes bug #363.
Reviewer: Luciano Wolf
Marcelo Lira
---
PySide/QtGui/typesystem_gui_common.xml | 46 ++++++++++++++++++++++++--
PySide/typesystem_templates.xml | 6 ++++
2 files changed, 49 insertions(+), 3 deletions(-)
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index a3ed01d..2237278 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -4290,9 +4290,49 @@
-
- Shiboken::setParent(%CONVERTTOPYTHON[QApplication*](qApp), %PYARG_0);
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PySide/typesystem_templates.xml b/PySide/typesystem_templates.xml
index e2e6fc4..959fe7e 100644
--- a/PySide/typesystem_templates.xml
+++ b/PySide/typesystem_templates.xml
@@ -181,5 +181,11 @@
%RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, %4, %5);
%PYARG_0 = Shiboken::makeTuple(retval_, %4);
+
+
+ Shiboken::SbkBaseWrapper* _pySelf = reinterpret_cast<Shiboken::SbkBaseWrapper*>(%PYARG_0);
+ if (!_pySelf->parentInfo)
+ Shiboken::setParent(%CONVERTTOPYTHON[QApplication*](qApp), %PYARG_0);
+
From aa47ffd8956c0071f098fac296e9e081729b810a Mon Sep 17 00:00:00 2001
From: Marcelo Lira
Date: Mon, 20 Sep 2010 16:49:45 -0300
Subject: [PATCH 0242/1129] Added missing classes to QtNetwork module.
The missing classes are: QAbstractNetworkCache, QNetworkDiskCache
e QNetworkCacheMetaData.
Reviewed by Hugo Parente
Reviewed by Luciano Wolf
---
PySide/QtNetwork/CMakeLists.txt | 7 +++++--
PySide/QtNetwork/typesystem_network.xml | 4 ++++
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/PySide/QtNetwork/CMakeLists.txt b/PySide/QtNetwork/CMakeLists.txt
index 768b80e..faf5a1d 100644
--- a/PySide/QtNetwork/CMakeLists.txt
+++ b/PySide/QtNetwork/CMakeLists.txt
@@ -11,22 +11,25 @@ else()
endif ()
set(QtNetwork_SRC
+${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qabstractnetworkcache_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qabstractsocket_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qauthenticator_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qftp_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qhostaddress_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qhostinfo_wrapper.cpp
+${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qhttp_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qhttpheader_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qhttprequestheader_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qhttpresponseheader_wrapper.cpp
-${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qhttp_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qipv6address_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qlocalserver_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qlocalsocket_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qnetworkaccessmanager_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qnetworkaddressentry_wrapper.cpp
-${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qnetworkcookiejar_wrapper.cpp
+${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qnetworkcachemetadata_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qnetworkcookie_wrapper.cpp
+${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qnetworkcookiejar_wrapper.cpp
+${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qnetworkdiskcache_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qnetworkinterface_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qnetworkproxy_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qnetworkreply_wrapper.cpp
diff --git a/PySide/QtNetwork/typesystem_network.xml b/PySide/QtNetwork/typesystem_network.xml
index 89cea39..756f3ec 100644
--- a/PySide/QtNetwork/typesystem_network.xml
+++ b/PySide/QtNetwork/typesystem_network.xml
@@ -281,5 +281,9 @@
+
+
+
+
From ae44c27bb06c721b783a311111efd66465f681fd Mon Sep 17 00:00:00 2001
From: renatofilho
Date: Mon, 20 Sep 2010 18:31:29 -0300
Subject: [PATCH 0243/1129] Created unittest for bug 367.
---
tests/QtGui/CMakeLists.txt | 1 +
tests/QtGui/bug_367.py | 22 ++++++++++++++++++++++
2 files changed, 23 insertions(+)
create mode 100644 tests/QtGui/bug_367.py
diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt
index ea6b4a6..9b928ac 100644
--- a/tests/QtGui/CMakeLists.txt
+++ b/tests/QtGui/CMakeLists.txt
@@ -7,6 +7,7 @@ PYSIDE_TEST(bug_307.py)
PYSIDE_TEST(bug_324.py)
PYSIDE_TEST(bug_338.py)
PYSIDE_TEST(bug_363.py)
+PYSIDE_TEST(bug_367.py)
PYSIDE_TEST(add_action_test.py)
PYSIDE_TEST(customproxywidget_test.py)
PYSIDE_TEST(float_to_int_implicit_conversion_test.py)
diff --git a/tests/QtGui/bug_367.py b/tests/QtGui/bug_367.py
new file mode 100644
index 0000000..b27a552
--- /dev/null
+++ b/tests/QtGui/bug_367.py
@@ -0,0 +1,22 @@
+''' Test bug 367: http://bugs.openbossa.org/show_bug.cgi?id=367'''
+
+import sys
+import unittest
+from helper import UsesQApplication
+from PySide import QtCore,QtGui
+
+class BugTest(UsesQApplication):
+ def testCase(self):
+ model = QtGui.QStandardItemModel()
+ parentItem = model.invisibleRootItem()
+ for i in range(10):
+ item = QtGui.QStandardItem()
+ rcount = sys.getrefcount(item)
+ parentItem.appendRow(item)
+ self.assertEqual(rcount+1, sys.getrefcount(item))
+ parentItem = item
+
+ self.assert_(True)
+
+if __name__ == '__main__':
+ unittest.main()
From f8a12b7577773f6a02804e1e60920a964f5e01ca Mon Sep 17 00:00:00 2001
From: renatofilho
Date: Mon, 20 Sep 2010 18:31:49 -0300
Subject: [PATCH 0244/1129] Fixed ownership rules for QStandardItem functions.
Fixes bug #367.
Reviewer: Luciano Wolf
Marcelo Lira
---
PySide/QtGui/typesystem_gui_common.xml | 112 +++++++++++++++++++++++--
1 file changed, 105 insertions(+), 7 deletions(-)
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index 2237278..0ffdf90 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -2004,6 +2004,77 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ // Clear parent from the old child
+ QStandardItem* _i = %CPPSELF->child(%1, %2);
+ if (_i) {
+ PyObject* _pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
+ Shiboken::setParent(0, _pyI);
+ }
+
+
+
+
+
+
+
+ // Clear parent from the old child
+ QStandardItem* _i = %CPPSELF->child(%1);
+ if (_i) {
+ PyObject* _pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
+ Shiboken::setParent(0, _pyI);
+ }
+
+
+
+
+
+
+
+
+
+
+
+
@@ -3628,11 +3699,18 @@
-
+
+
+
+
+
+
+
+
@@ -3643,12 +3721,29 @@
+
+
+ // Clear parent from the old child
+ QStandardItem* _i = %CPPSELF->item(%1, %2);
+ if (_i) {
+ PyObject* _pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
+ Shiboken::setParent(0, _pyI);
+ }
+
+
+ // Clear parent from the old child
+ QStandardItem* _i = %CPPSELF->item(%1);
+ if (_i) {
+ PyObject* _pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
+ Shiboken::setParent(0, _pyI);
+ }
+
@@ -3658,7 +3753,16 @@
+
+
+ // Clear parent from the old child
+ QStandardItem* _i = %CPPSELF->verticalHeaderItem(%1);
+ if (_i) {
+ PyObject* _pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
+ Shiboken::setParent(0, _pyI);
+ }
+
@@ -3694,12 +3798,6 @@
-
-
-
-
-
-
From 2a225be9c770ccf774a97457ab409b6b3f60b467 Mon Sep 17 00:00:00 2001
From: renatofilho
Date: Mon, 20 Sep 2010 19:02:16 -0300
Subject: [PATCH 0245/1129] Use CMAKE__POSTFIX on config files, used
for cmake and pkgconfig.
Fixes bug #286.
Reviewer: Luciano Wolf
Marcelo Lira
---
libpyside/CMakeLists.txt | 6 ++++++
libpyside/PySideConfig.cmake.in | 2 +-
libpyside/pyside.pc.in | 2 +-
3 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/libpyside/CMakeLists.txt b/libpyside/CMakeLists.txt
index 11196f8..20bd03a 100644
--- a/libpyside/CMakeLists.txt
+++ b/libpyside/CMakeLists.txt
@@ -42,6 +42,12 @@ set(libpyside_HEADERS
qproperty.h
)
+if (CMAKE_BUILD_TYPE STREQUAL "Debug")
+ set(LIBRARY_OUTPUT_SUFFIX ${CMAKE_DEBUG_POSTFIX})
+else()
+ set(LIBRARY_OUTPUT_SUFFIX ${CMAKE_RELEASE_POSTFIX})
+endif()
+
# create pkg-config file
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/pyside.pc.in"
"${CMAKE_CURRENT_BINARY_DIR}/pyside${pyside_SUFFIX}.pc" @ONLY)
diff --git a/libpyside/PySideConfig.cmake.in b/libpyside/PySideConfig.cmake.in
index 9e0f42e..654e6a3 100644
--- a/libpyside/PySideConfig.cmake.in
+++ b/libpyside/PySideConfig.cmake.in
@@ -3,5 +3,5 @@
# PYSIDE_TYPESYSTEMS - Type system files that should be used by other bindings extending PySide
SET(PYSIDE_INCLUDE_DIR "@CMAKE_INSTALL_PREFIX@/include/PySide@pyside_SUFFIX@")
-SET(PYSIDE_LIBRARY "@LIB_INSTALL_DIR@/@CMAKE_SHARED_LIBRARY_PREFIX@pyside@pyside_SUFFIX@@CMAKE_SHARED_LIBRARY_SUFFIX@")
+SET(PYSIDE_LIBRARY "@LIB_INSTALL_DIR@/@CMAKE_SHARED_LIBRARY_PREFIX@pyside@pyside_SUFFIX@@LIBRARY_OUTPUT_SUFFIX@@CMAKE_SHARED_LIBRARY_SUFFIX@")
SET(PYSIDE_TYPESYSTEMS "@CMAKE_INSTALL_PREFIX@/share/PySide@pyside_SUFFFIX@/typesystems")
diff --git a/libpyside/pyside.pc.in b/libpyside/pyside.pc.in
index 516f8e1..f58c537 100644
--- a/libpyside/pyside.pc.in
+++ b/libpyside/pyside.pc.in
@@ -7,6 +7,6 @@ typesystemdir=@CMAKE_INSTALL_PREFIX@/share/PySide@pyside_SUFFIX@/typesystems
Name: PySide@pyside_SUFFIX@
Description: Support library for Python bindings of Qt-based libraries.
Version: @BINDING_API_VERSION@
-Libs: -L${libdir} -lpython -lpyside@pyside_SUFFIX@
+Libs: -L${libdir} -lpython -lpyside@pyside_SUFFIX@@LIBRARY_OUTPUT_SUFFIX@
Cflags: -I${includedir}
From 4229fa0082135c889094c6cea7baa970b5208587 Mon Sep 17 00:00:00 2001
From: renatofilho
Date: Tue, 21 Sep 2010 14:29:34 -0300
Subject: [PATCH 0246/1129] Created unit test for bug #360.
Reviewer: Luciano Wolf
Marcelo Lira
---
tests/QtUiTools/CMakeLists.txt | 1 +
tests/QtUiTools/bug_360.py | 36 ++++++++++++++++++++++++++++++++++
tests/QtUiTools/minimal.ui | 6 ++++++
3 files changed, 43 insertions(+)
create mode 100644 tests/QtUiTools/bug_360.py
create mode 100644 tests/QtUiTools/minimal.ui
diff --git a/tests/QtUiTools/CMakeLists.txt b/tests/QtUiTools/CMakeLists.txt
index 9118b5b..03ce768 100644
--- a/tests/QtUiTools/CMakeLists.txt
+++ b/tests/QtUiTools/CMakeLists.txt
@@ -1,2 +1,3 @@
+PYSIDE_TEST(bug_360.py)
PYSIDE_TEST(uiloader_test.py)
PYSIDE_TEST(ui_test.py)
diff --git a/tests/QtUiTools/bug_360.py b/tests/QtUiTools/bug_360.py
new file mode 100644
index 0000000..aefc422
--- /dev/null
+++ b/tests/QtUiTools/bug_360.py
@@ -0,0 +1,36 @@
+import unittest
+import os
+from helper import UsesQApplication
+
+from PySide import QtCore, QtGui
+from PySide.QtUiTools import QUiLoader
+
+class MyQUiLoader(QUiLoader):
+ def __init__(self, baseinstance):
+ QUiLoader.__init__(self)
+ self.baseinstance = baseinstance
+ self._widgets = []
+
+ def createWidget(self, className, parent=None, name=""):
+ widget = QUiLoader.createWidget(self, className, parent, name)
+ self._widgets.append(widget)
+ if parent is None:
+ return self.baseinstance
+ else:
+ setattr(self.baseinstance, name, widget)
+ return widget
+
+class ButTest(UsesQApplication):
+ def testCase(self):
+ w = QtGui.QWidget()
+ loader = MyQUiLoader(w)
+
+ filePath = os.path.join(os.path.dirname(__file__), 'minimal.ui')
+ ui = loader.load(filePath)
+
+ self.assertEqual(len(loader._widgets), 1)
+ self.assertEqual(type(loader._widgets[0]), QtGui.QFrame)
+
+if __name__ == '__main__':
+ unittest.main()
+
diff --git a/tests/QtUiTools/minimal.ui b/tests/QtUiTools/minimal.ui
new file mode 100644
index 0000000..c6bb70c
--- /dev/null
+++ b/tests/QtUiTools/minimal.ui
@@ -0,0 +1,6 @@
+
+
+ Form
+
+
+
From c41f0dc385335890cacdb830054e24d34acd0246 Mon Sep 17 00:00:00 2001
From: renatofilho
Date: Tue, 21 Sep 2010 15:46:39 -0300
Subject: [PATCH 0247/1129] The CMake configuration for PySide and Shiboken use
the PYTHON_LIBRARIES variable to link against Python. This is not the correct
way to link against Python on OS X. Instead of specifying a library or the
framework, one simply uses the flag "-undefined dynamic_lookup". The symbols
will be resolved at runtime when the extension module loads.
Fixes bug #352: Thanks to Robert Kern
Reviewer: Hugo Parente Lima
Luciano Wolf
---
CMakeLists.txt | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5ba7022..47ab784 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -169,7 +169,9 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug")
else()
set(PYSIDE_PYTHON_LIBRARIES ${PYTHON_LIBRARIES})
endif()
-
+if(APPLE)
+ set(PYSIDE_PYTHON_LIBRARIES "-undefined dynamic_lookup")
+endif()
set(GENERATOR_EXTRA_FLAGS --generatorSet=shiboken --enable-parent-ctor-heuristic --enable-pyside-extensions --enable-return-value-heuristic)
From fccfafe71fdf148fca9b6c0c9b09feccd57cf0ec Mon Sep 17 00:00:00 2001
From: Marcelo Lira
Date: Tue, 21 Sep 2010 17:18:33 -0300
Subject: [PATCH 0248/1129] Added enum QML_HAS_ATTACHED_PROPERTIES to QtCore
type system file.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Also suppressed warning about _ISalnum enum from ctypes.h
Reviewed by Luciano Wolf
Reviewed by Renato Araújo
---
PySide/QtCore/typesystem_core.xml | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index f10ed07..ced3194 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -115,6 +115,12 @@
+
+
+
+
+
+
@@ -2546,6 +2552,7 @@
+
From 3525b77d69937938aa285f84b995a3a2d8685cce Mon Sep 17 00:00:00 2001
From: renatofilho
Date: Wed, 22 Sep 2010 16:59:04 -0300
Subject: [PATCH 0249/1129] Created unit test for bug #376.
Reviewer: Luciano Wolf
Marcelo Lira
---
tests/QtUiTools/CMakeLists.txt | 1 +
tests/QtUiTools/bug_376.py | 19 +++++++++++++++++++
2 files changed, 20 insertions(+)
create mode 100644 tests/QtUiTools/bug_376.py
diff --git a/tests/QtUiTools/CMakeLists.txt b/tests/QtUiTools/CMakeLists.txt
index 03ce768..9ede81f 100644
--- a/tests/QtUiTools/CMakeLists.txt
+++ b/tests/QtUiTools/CMakeLists.txt
@@ -1,3 +1,4 @@
PYSIDE_TEST(bug_360.py)
+PYSIDE_TEST(bug_376.py)
PYSIDE_TEST(uiloader_test.py)
PYSIDE_TEST(ui_test.py)
diff --git a/tests/QtUiTools/bug_376.py b/tests/QtUiTools/bug_376.py
new file mode 100644
index 0000000..2bd6b5c
--- /dev/null
+++ b/tests/QtUiTools/bug_376.py
@@ -0,0 +1,19 @@
+import unittest
+import os
+from helper import UsesQApplication
+
+from PySide import QtCore, QtGui
+from PySide.QtUiTools import QUiLoader
+
+class BugTest(UsesQApplication):
+ def testCase(self):
+ w = QtGui.QWidget()
+ loader = QUiLoader()
+
+ filePath = os.path.join(os.path.dirname(__file__), 'test.ui')
+ result = loader.load(filePath, w)
+ self.assertEqual(type(result.child_object), QtGui.QFrame)
+
+if __name__ == '__main__':
+ unittest.main()
+
From bf4b2c7660adc99b6a8b83748787f0ea078ad13b Mon Sep 17 00:00:00 2001
From: renatofilho
Date: Wed, 22 Sep 2010 16:59:46 -0300
Subject: [PATCH 0250/1129] Port old boost code used in QtUiTools.
fixes bug #376.
Reviewer: Luciano Wolf
Marcelo Lira
---
PySide/QtUiTools/glue/uitools_loadui.h | 68 +++++++++++++++++++++++++
PySide/QtUiTools/typesystem_uitools.xml | 35 ++++++++-----
2 files changed, 91 insertions(+), 12 deletions(-)
create mode 100644 PySide/QtUiTools/glue/uitools_loadui.h
diff --git a/PySide/QtUiTools/glue/uitools_loadui.h b/PySide/QtUiTools/glue/uitools_loadui.h
new file mode 100644
index 0000000..da851c1
--- /dev/null
+++ b/PySide/QtUiTools/glue/uitools_loadui.h
@@ -0,0 +1,68 @@
+/*
+ * Based on code provided by:
+ * Antonio Valentino
+ * Frédéric
+ */
+
+#include
+
+static void
+_populate_parent(PyObject* pyParent, QWidget *parent)
+{
+ if (parent->children().isEmpty())
+ return;
+
+ foreach(QObject *child, parent->children()) {
+ QString name(child->objectName());
+ if (!name.isEmpty() && !name.startsWith("_") && !name.startsWith("qt_")) {
+ bool has_attr = PyObject_HasAttrString(pyParent, qPrintable(name));
+ Shiboken::AutoDecRef pyChild(Shiboken::Converter::toPython(child));
+ if (!has_attr)
+ PyObject_SetAttrString(pyParent, qPrintable(name), pyChild);
+
+ Shiboken::setParent(pyParent, pyChild);
+ _populate_parent(pyChild, qobject_cast(child));
+ }
+ }
+}
+
+static PyObject*
+quiloader_load_ui_from_device(QUiLoader* self, QIODevice* dev, QWidget *parent)
+{
+ QWidget *w = self->load(dev, parent);
+ if (w) {
+ if (parent && parent->layout())
+ parent->layout()->deleteLater();
+
+ PyObject* pyParent = Shiboken::Converter::toPython(w);
+ _populate_parent(pyParent, w);
+
+ return pyParent;
+ }
+
+ PyErr_SetString(PyExc_RuntimeError, "Unable to open ui file");
+ return 0;
+}
+
+static PyObject*
+quiloader_load_ui(QUiLoader* self, const QString &ui_file, QWidget *parent)
+{
+ QFile fd(ui_file);
+
+ if (fd.exists(ui_file) && fd.open(QFile::ReadOnly)) {
+ QWidget* w = self->load(&fd, parent);
+ fd.close();
+ if (w != 0) {
+ PyObject* pyParent = Shiboken::Converter::toPython(w);
+
+ if (parent && parent->layout())
+ parent->layout()->deleteLater();
+
+ _populate_parent(pyParent, w);
+
+ return pyParent;
+ }
+ }
+ PyErr_SetString(PyExc_RuntimeError, "Unable to open ui file");
+ return 0;
+}
diff --git a/PySide/QtUiTools/typesystem_uitools.xml b/PySide/QtUiTools/typesystem_uitools.xml
index 7ea988b..a188aa3 100644
--- a/PySide/QtUiTools/typesystem_uitools.xml
+++ b/PySide/QtUiTools/typesystem_uitools.xml
@@ -48,13 +48,9 @@
-
-
-
-
-
-
-
+
+
+
@@ -63,11 +59,26 @@
- QFile f(%1);
- if (f.open(QIODevice::ReadOnly | QIODevice::Text))
- %PYARG_0 = %CONVERTTOPYTHON[QWidget*](%CPPSELF.load(&f, %2));
- else
- PyErr_SetString(PyExc_RuntimeError, "Unable to open ui file");
+ //Avoid calling the original function: %CPPSELF.load
+ %PYARG_0 = quiloader_load_ui_from_device(%CPPSELF, %1, %2);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ //Avoid calling the original function: %CPPSELF.load
+ %PYARG_0 = quiloader_load_ui(%CPPSELF, %1, %2);
From 8048bd0c3bcdb1de33aa69d961402b355d6b07af Mon Sep 17 00:00:00 2001
From: Marcelo Lira
Date: Tue, 21 Sep 2010 09:32:02 -0300
Subject: [PATCH 0251/1129] Modified the type system files to make use of
nested type declarations.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Reviewed by Luciano Wolf
Reviewed by Renato Araújo
---
PySide/QtCore/typesystem_core.xml | 371 +++----
.../QtDeclarative/typesystem_declarative.xml | 31 +-
PySide/QtGui/typesystem_gui_common.xml | 928 ++++++++++--------
PySide/QtGui/typesystem_gui_maemo.xml | 9 +-
PySide/QtHelp/typesystem_help.xml | 6 +-
PySide/QtMaemo5/typesystem_maemo5.xml | 3 +-
PySide/QtMultimedia/typesystem_multimedia.xml | 39 +-
PySide/QtNetwork/typesystem_network.xml | 124 +--
PySide/QtOpenGL/typesystem_opengl.xml | 29 +-
PySide/QtScript/typesystem_script.xml | 41 +-
.../QtScriptTools/typesystem_scripttools.xml | 9 +-
PySide/QtSql/typesystem_sql.xml | 33 +-
PySide/QtTest/typesystem_test.xml | 15 +-
PySide/QtWebKit/typesystem_webkit.xml | 48 +-
PySide/QtXml/typesystem_xml.xml | 16 +-
.../QtXmlPatterns/typesystem_xmlpatterns.xml | 19 +-
PySide/phonon/typesystem_phonon.xml | 343 +++----
17 files changed, 1088 insertions(+), 976 deletions(-)
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index ced3194..ec78941 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -90,38 +90,19 @@
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
-
+
-
@@ -537,6 +518,79 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -563,134 +617,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Shiboken::TypeResolver::createValueTypeResolver<QString>("unicode");
@@ -738,7 +664,9 @@
-
+
+
+
@@ -748,6 +676,7 @@
+
@@ -785,6 +714,7 @@
+
@@ -818,6 +748,8 @@
+
+
@@ -860,10 +792,17 @@
+
+
+
+
+
+
+
@@ -977,6 +916,7 @@
+
@@ -988,8 +928,11 @@
-
+
+
+
+
@@ -1263,6 +1206,8 @@
+
+
<para>URLs can be represented in two forms: encoded or unencoded. The unencoded representation is suitable for showing to users, but the encoded representation is typically what you would send to a web server. For example, the unencoded URL "http://bühler.example.com" would be sent to the server as "http://xn--bhler-kva.example.com/List%20of%20applicants.xml".</para>
@@ -1271,6 +1216,8 @@
+
+
@@ -1571,6 +1518,8 @@
+
+
@@ -1581,11 +1530,15 @@
+
+
+
+
@@ -1607,6 +1560,7 @@
+
@@ -1632,9 +1586,12 @@
+
-
+
+
+
@@ -1646,6 +1603,7 @@
+
@@ -1654,9 +1612,16 @@
-
-
-
+
+
+
+
+
+
+
+
+
+
@@ -1670,6 +1635,17 @@
+
+
+
+
+
+
+
+
+
+
+
@@ -1694,7 +1670,11 @@
-
+
+
+
+
+
@@ -1709,14 +1689,6 @@
-
-
-
-
-
-
-
-
@@ -1804,6 +1776,11 @@
+
+
+
+
+
@@ -1823,6 +1800,11 @@
+
+
+
+
+
@@ -1847,6 +1829,7 @@
+
@@ -1898,6 +1881,9 @@
+
+
+
@@ -1908,7 +1894,9 @@
-
+
+
+
@@ -1931,6 +1919,9 @@
+
+
+
@@ -2155,6 +2146,10 @@
+
+
+
+
@@ -2189,8 +2184,12 @@
-
+
+
+
+
+
@@ -2215,6 +2214,9 @@
+
+
+
@@ -2247,9 +2249,12 @@
-
-
+
+
+
+
+
@@ -2263,7 +2268,11 @@
-
+
+
+
+
+
@@ -2358,6 +2367,7 @@
http://bugs.openbossa.org/show_bug.cgi?id=201 -->
+
@@ -2378,8 +2388,9 @@
-
-
+
+
+
@@ -2397,8 +2408,8 @@
-
+
@@ -2452,10 +2463,14 @@
-
-
-
+
+
+
+
+
+
+
@@ -2491,8 +2506,6 @@
-
-
diff --git a/PySide/QtDeclarative/typesystem_declarative.xml b/PySide/QtDeclarative/typesystem_declarative.xml
index 3d0f56c..888ca6f 100644
--- a/PySide/QtDeclarative/typesystem_declarative.xml
+++ b/PySide/QtDeclarative/typesystem_declarative.xml
@@ -25,24 +25,27 @@
-
-
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
@@ -54,14 +57,16 @@
-
-
-
+
+
+
+
-
-
-
+
+
+
+
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index 0ffdf90..76afecc 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -147,307 +147,8 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -462,47 +163,157 @@
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -510,11 +321,22 @@
-
+
+
+
+
+
-
+
+
+
+
+
+
+
+
@@ -525,15 +347,30 @@
+
+
-
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -544,6 +381,9 @@
+
+
+
@@ -565,6 +405,7 @@
+
@@ -576,10 +417,20 @@
-
+
+
+
+
+
+
+
+
+
+
+
@@ -587,9 +438,15 @@
+
+
+
+
-
+
+
+
@@ -610,6 +467,8 @@
+
+
@@ -623,14 +482,8 @@
-
-
-
-
-
-
-
+
@@ -639,17 +492,6 @@
-
-
-
-
-
-
-
-
-
-
-
@@ -690,6 +532,9 @@
+
+
+
@@ -707,15 +552,6 @@
-
-
-
-
-
-
-
-
-
@@ -745,17 +581,14 @@
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
@@ -771,6 +604,8 @@
+
+
@@ -816,6 +651,7 @@
+
@@ -828,6 +664,7 @@
+
@@ -1098,7 +935,6 @@
-
@@ -1204,7 +1040,12 @@
-
+
+
+
+
+
+
@@ -1228,8 +1069,15 @@
-
+
+
+
+
+
+
+
+
PyObject* userTypeConstant = PyInt_FromLong(QGraphicsItem::UserType);
PyDict_SetItemString(SbkQGraphicsItem_Type.super.ht_type.tp_dict, "UserType", userTypeConstant);
@@ -1359,6 +1207,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1498,6 +1370,7 @@
+
@@ -1505,9 +1378,17 @@
-
-
+
+
+
+
+
+
+
+
+
+
@@ -1528,8 +1409,11 @@
-
+
+
+
+
@@ -1584,12 +1468,15 @@
-
+
+
+
+
@@ -1605,6 +1492,7 @@
+
@@ -1614,6 +1502,7 @@
+
@@ -1670,8 +1559,16 @@
-
-
+
+
+
+
+
+
+
+
+
+
@@ -1690,6 +1587,7 @@
+
@@ -1775,6 +1673,9 @@
+
+
+
@@ -1785,6 +1686,7 @@
+
@@ -1949,8 +1851,12 @@
-
-
+
+
+
+
+
+
@@ -1972,6 +1878,7 @@
+
@@ -1994,6 +1901,7 @@
+
@@ -2109,9 +2017,19 @@
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -2126,6 +2044,8 @@
+
+
@@ -2159,7 +2079,9 @@
-
+
+
+
@@ -2203,6 +2125,7 @@
+
@@ -2294,6 +2217,7 @@
+
@@ -2331,6 +2255,7 @@
+
@@ -2340,7 +2265,9 @@
-
+
+
+
@@ -2356,7 +2283,9 @@
-
+
+
+
@@ -2374,7 +2303,16 @@
-
+
+
+
+
+
+
+
+
+
+
@@ -2385,7 +2323,10 @@
-
+
+
+
+
@@ -2399,6 +2340,17 @@
+
+
+
+
+
+
+
+
+
+
+
@@ -2422,6 +2374,7 @@
+
@@ -2433,6 +2386,8 @@
+
+
@@ -2491,6 +2446,7 @@
+
addLayoutOwnership(%CPPSELF, %2);
@@ -2501,7 +2457,9 @@
-
+
+
+
@@ -2600,6 +2558,11 @@
+
+
+
+
+
@@ -2666,6 +2629,8 @@
+
+
@@ -2716,6 +2681,8 @@
+
+
@@ -2866,6 +2833,9 @@
+
+
+
@@ -2932,6 +2902,7 @@
+
@@ -2947,6 +2918,7 @@
+
@@ -2970,6 +2942,7 @@
+
@@ -3024,6 +2997,8 @@
+
+
@@ -3041,6 +3016,8 @@
+
+
@@ -3168,6 +3145,8 @@
+
+
@@ -3304,6 +3283,9 @@
+
+
+
@@ -3346,6 +3328,9 @@
+
+
+
@@ -3372,11 +3357,19 @@
+
+
+
+
+
+
+
+
@@ -3407,6 +3400,7 @@
+
@@ -3423,6 +3417,8 @@
+
+
@@ -3432,9 +3428,12 @@
+
+
+
@@ -3517,6 +3516,7 @@
+
@@ -3541,11 +3541,13 @@
+
+
@@ -3593,6 +3595,11 @@
+
+
+
+
+
@@ -3648,6 +3655,9 @@
+
+
+
@@ -3823,6 +3833,7 @@
+
@@ -3888,6 +3899,7 @@
+
@@ -3901,6 +3913,10 @@
+
+
+
+
@@ -3968,6 +3984,10 @@
+
+
+
+
@@ -4031,6 +4051,7 @@
+
@@ -4043,7 +4064,10 @@
-
+
+
+
+
@@ -4051,6 +4075,7 @@
+
@@ -4075,7 +4100,11 @@
-
+
+
+
+
+
@@ -4150,6 +4179,10 @@
+
+
+
+
@@ -4166,6 +4199,8 @@
+
+
@@ -4208,6 +4243,11 @@
+
+
+
+
+
@@ -4224,6 +4264,17 @@
+
+
+
+
+
+
+
+
+
+
+
@@ -4239,6 +4290,10 @@
+
+
+
+
@@ -4251,6 +4306,9 @@
+
+
+
@@ -4354,6 +4412,8 @@
+
+
@@ -4435,6 +4495,7 @@
+
@@ -4446,6 +4507,10 @@
+
+
+
+
@@ -4683,6 +4748,7 @@
+
@@ -4695,7 +4761,10 @@
-
+
+
+
+
@@ -4714,18 +4783,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
@@ -4796,16 +4853,24 @@
-
-
+
+
+
+
+
+
-
+
+
+
-
-
+
+
+
+
-
-
+
+
+
-
-
-
+
+
+
+
diff --git a/PySide/QtGui/typesystem_gui_maemo.xml b/PySide/QtGui/typesystem_gui_maemo.xml
index 99ccb2e..f49da9d 100644
--- a/PySide/QtGui/typesystem_gui_maemo.xml
+++ b/PySide/QtGui/typesystem_gui_maemo.xml
@@ -20,10 +20,11 @@
-->
-
-
-
-
+
+
+
+
+
diff --git a/PySide/QtHelp/typesystem_help.xml b/PySide/QtHelp/typesystem_help.xml
index b853c04..bc58957 100644
--- a/PySide/QtHelp/typesystem_help.xml
+++ b/PySide/QtHelp/typesystem_help.xml
@@ -22,8 +22,6 @@
-
-
@@ -38,7 +36,9 @@
-
+
+
+
diff --git a/PySide/QtMaemo5/typesystem_maemo5.xml b/PySide/QtMaemo5/typesystem_maemo5.xml
index 94adaa1..74715ea 100644
--- a/PySide/QtMaemo5/typesystem_maemo5.xml
+++ b/PySide/QtMaemo5/typesystem_maemo5.xml
@@ -21,8 +21,6 @@
-
-
@@ -76,6 +74,7 @@
+
diff --git a/PySide/QtMultimedia/typesystem_multimedia.xml b/PySide/QtMultimedia/typesystem_multimedia.xml
index bd0f6ad..04e064b 100644
--- a/PySide/QtMultimedia/typesystem_multimedia.xml
+++ b/PySide/QtMultimedia/typesystem_multimedia.xml
@@ -24,22 +24,19 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
-
+
+
+
+
+
+
@@ -55,10 +52,18 @@
-
-
+
+
+
+
+
+
+
-
+
+
+
+
diff --git a/PySide/QtNetwork/typesystem_network.xml b/PySide/QtNetwork/typesystem_network.xml
index 756f3ec..5e09ab7 100644
--- a/PySide/QtNetwork/typesystem_network.xml
+++ b/PySide/QtNetwork/typesystem_network.xml
@@ -22,6 +22,11 @@
+
+
+
+
+
@@ -29,42 +34,13 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
@@ -73,6 +49,11 @@
+
+
+
+
+
@@ -105,6 +86,9 @@
+
+
+
@@ -143,6 +127,7 @@
+
@@ -190,8 +175,13 @@
-
+
+
+
+
+
+
@@ -209,16 +199,19 @@
+
+
+
@@ -228,11 +221,18 @@
-
+
+
+
-
+
+
+
+
-
+
+
+
@@ -241,45 +241,55 @@
+
-
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PySide/QtOpenGL/typesystem_opengl.xml b/PySide/QtOpenGL/typesystem_opengl.xml
index 43e097f..2a7557e 100644
--- a/PySide/QtOpenGL/typesystem_opengl.xml
+++ b/PySide/QtOpenGL/typesystem_opengl.xml
@@ -25,13 +25,8 @@
-
-
-
-
-
-
+
@@ -43,9 +38,13 @@
-
+
+
+
+
+
@@ -64,7 +63,9 @@
-
+
+
+
@@ -90,7 +91,9 @@
-
+
+
+
@@ -102,12 +105,10 @@
-
-
-
-
-
+
+
+
diff --git a/PySide/QtScript/typesystem_script.xml b/PySide/QtScript/typesystem_script.xml
index a37e6fb..c71a60f 100644
--- a/PySide/QtScript/typesystem_script.xml
+++ b/PySide/QtScript/typesystem_script.xml
@@ -21,30 +21,35 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
diff --git a/PySide/QtScriptTools/typesystem_scripttools.xml b/PySide/QtScriptTools/typesystem_scripttools.xml
index ad68aed..d223112 100644
--- a/PySide/QtScriptTools/typesystem_scripttools.xml
+++ b/PySide/QtScriptTools/typesystem_scripttools.xml
@@ -22,13 +22,10 @@
-
-
-
-
-
-
+
+
+
diff --git a/PySide/QtSql/typesystem_sql.xml b/PySide/QtSql/typesystem_sql.xml
index 40beff0..f7c5325 100644
--- a/PySide/QtSql/typesystem_sql.xml
+++ b/PySide/QtSql/typesystem_sql.xml
@@ -26,6 +26,10 @@
+
+
+
+
@@ -54,6 +58,7 @@
+
@@ -78,7 +83,9 @@
-
+
+
+
@@ -86,9 +93,14 @@
-
+
+
+
+
+
+
@@ -122,6 +134,8 @@
+
+
@@ -139,6 +153,7 @@
+
@@ -151,18 +166,4 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/PySide/QtTest/typesystem_test.xml b/PySide/QtTest/typesystem_test.xml
index a1dfa83..b7028eb 100644
--- a/PySide/QtTest/typesystem_test.xml
+++ b/PySide/QtTest/typesystem_test.xml
@@ -53,6 +53,13 @@
+
+
+
+
+
+
+
@@ -61,14 +68,6 @@
-
-
-
-
-
-
-
-
diff --git a/PySide/QtWebKit/typesystem_webkit.xml b/PySide/QtWebKit/typesystem_webkit.xml
index 2ba3d8c..1c39111 100644
--- a/PySide/QtWebKit/typesystem_webkit.xml
+++ b/PySide/QtWebKit/typesystem_webkit.xml
@@ -25,24 +25,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -60,6 +42,7 @@
+
@@ -69,8 +52,23 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -87,9 +85,11 @@
-
-
-
+
+
+
+
+
@@ -98,6 +98,8 @@
-
+
+
+
diff --git a/PySide/QtXml/typesystem_xml.xml b/PySide/QtXml/typesystem_xml.xml
index 3db64b5..4cccb8a 100644
--- a/PySide/QtXml/typesystem_xml.xml
+++ b/PySide/QtXml/typesystem_xml.xml
@@ -27,14 +27,6 @@
-
-
-
-
-
@@ -217,11 +209,15 @@
-
+
+
+
+
+
@@ -322,6 +318,8 @@
@@ -69,7 +68,9 @@
-
+
+
+
diff --git a/PySide/phonon/typesystem_phonon.xml b/PySide/phonon/typesystem_phonon.xml
index e326436..4c700bc 100644
--- a/PySide/phonon/typesystem_phonon.xml
+++ b/PySide/phonon/typesystem_phonon.xml
@@ -37,175 +37,180 @@
+
+
+
+ Phonon::BackendCapabilities::NotifierWrapper* Phonon::BackendCapabilities::NotifierWrapper::m_instance = 0;
+ Phonon::BackendCapabilities::Notifier* Phonon::BackendCapabilities::NotifierWrapper::m_notifier = 0;
+
+
+
+
+ Phonon::BackendCapabilities::NotifierWrapper *_notifierWrapper = Phonon::BackendCapabilities::NotifierWrapper::notifier();
+ %PYARG_0 = %CONVERTTOPYTHON[Phonon::BackendCapabilities::NotifierWrapper*](_notifierWrapper);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ PyObject* signal_item;
+
+ signal_item = PySide::signalNew("capabilitiesChanged", "void", NULL);
+ PyDict_SetItemString(SbkPhonon_BackendCapabilities_NotifierWrapper_Type.super.ht_type.tp_dict, "capabilitiesChanged", signal_item);
+ Py_DECREF(signal_item);
+
+ signal_item = PySide::signalNew("availableAudioOutputDevicesChanged", "void", NULL);
+ PyDict_SetItemString( SbkPhonon_BackendCapabilities_NotifierWrapper_Type.super.ht_type.tp_dict, "availableAudioOutputDevicesChanged", signal_item);
+ Py_DECREF(signal_item);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
- Phonon::BackendCapabilities::NotifierWrapper* Phonon::BackendCapabilities::NotifierWrapper::m_instance = 0;
- Phonon::BackendCapabilities::Notifier* Phonon::BackendCapabilities::NotifierWrapper::m_notifier = 0;
-
-
-
-
- Phonon::BackendCapabilities::NotifierWrapper *_notifierWrapper = Phonon::BackendCapabilities::NotifierWrapper::notifier();
- %PYARG_0 = %CONVERTTOPYTHON[Phonon::BackendCapabilities::NotifierWrapper*](_notifierWrapper);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PyObject* signal_item;
-
- signal_item = PySide::signalNew("capabilitiesChanged", "void", NULL);
- PyDict_SetItemString(SbkPhonon_BackendCapabilities_NotifierWrapper_Type.super.ht_type.tp_dict, "capabilitiesChanged", signal_item);
- Py_DECREF(signal_item);
-
- signal_item = PySide::signalNew("availableAudioOutputDevicesChanged", "void", NULL);
- PyDict_SetItemString( SbkPhonon_BackendCapabilities_NotifierWrapper_Type.super.ht_type.tp_dict, "availableAudioOutputDevicesChanged", signal_item);
- Py_DECREF(signal_item);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
From 16579322f177c1fde0336c2b255a4a696ed73e5d Mon Sep 17 00:00:00 2001
From: Matti Airas
Date: Thu, 23 Sep 2010 16:16:57 +0300
Subject: [PATCH 0252/1129] added a tool to compare class hierarchies
---
tests/tools/list-class-hierarchy.py | 95 +++++++++++++++++++++++++++++
1 file changed, 95 insertions(+)
create mode 100755 tests/tools/list-class-hierarchy.py
diff --git a/tests/tools/list-class-hierarchy.py b/tests/tools/list-class-hierarchy.py
new file mode 100755
index 0000000..381efee
--- /dev/null
+++ b/tests/tools/list-class-hierarchy.py
@@ -0,0 +1,95 @@
+#!/usr/bin/python
+
+# This file is part of PySide: Python for Qt
+#
+# Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+#
+# Contact: PySide team
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# version 2 as published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+# 02110-1301 USA
+
+
+# This is a small script printing out Qt binding class hierarchies
+# for comparison purposes.
+#
+# Usage:
+#
+# ./list-class-hierarchy.py PySide > pyside.list
+# ./list-class-hierarchy.py PyQt4 > pyqt4.list
+#
+# meld pyside.list pyqt4.list
+
+import sys
+import pdb
+from inspect import isclass
+
+ignore = ["staticMetaObject",
+ "pyqtConfigure",
+ "registerUserData",
+ "thread",
+ ]
+
+def recurse_into(el,obj):
+ #s = el.split('.')[-1]
+ #pdb.set_trace()
+ for item in sorted(dir(obj)):
+ if item[0]=='_':
+ continue
+ mel = el + '.' + item
+ try:
+ mobj = eval(mel)
+ except Exception:
+ continue
+ if item in ignore:
+ continue
+ print mel
+ if isclass(mobj):
+ recurse_into(mel,mobj)
+
+if __name__=='__main__':
+ top = sys.argv[1]
+
+ if top=="PyQt4":
+ import sip
+ sip.setapi('QDate',2)
+ sip.setapi('QDateTime',2)
+ sip.setapi('QString',2)
+ sip.setapi('QTextStream',2)
+ sip.setapi('QTime',2)
+ sip.setapi('QUrl',2)
+ sip.setapi('QVariant',2)
+
+ if len(sys.argv)>2:
+ modules = sys.argv[2:]
+ else:
+ modules = [ 'QtCore',
+ 'QtGui',
+ 'QtHelp',
+ #'QtMultimedia',
+ 'QtNetwork',
+ 'QtOpenGL',
+ 'QtScript',
+ 'QtScriptTools',
+ 'QtSql',
+ 'QtSvg',
+ 'QtTest',
+ #'QtUiTools',
+ 'QtWebKit',
+ 'QtXml',
+ 'QtXmlPatterns' ]
+
+ for m in modules:
+ exec "from %s import %s" % (top,m) in globals(), locals()
+ recurse_into(m,eval(m))
From dedc78b3fef25e04cf436ca462714ad8dc0329cd Mon Sep 17 00:00:00 2001
From: Marcelo Lira
Date: Fri, 24 Sep 2010 15:47:41 -0300
Subject: [PATCH 0253/1129] Fixed segmentation fault libpyside's
signalUpdateSource function.
This function is called when an object is instantiated, and it will
go through the class attributes looking for signals and what else
is relevant. If the user has set a new attribute in the constructor
before the call to its parent QObject-like __init__ method, a
segmentation fault would ensue.
This commit fixes this condition and also adds an unit test.
Reviewed by Hugo Parente
Reviewed by Luciano Wolf
---
libpyside/qsignal.cpp | 2 +-
tests/QtCore/CMakeLists.txt | 1 +
tests/QtCore/qobject_objectproperty_test.py | 29 +++++++++++++++++++++
3 files changed, 31 insertions(+), 1 deletion(-)
create mode 100644 tests/QtCore/qobject_objectproperty_test.py
diff --git a/libpyside/qsignal.cpp b/libpyside/qsignal.cpp
index aa218ec..95fc251 100644
--- a/libpyside/qsignal.cpp
+++ b/libpyside/qsignal.cpp
@@ -225,7 +225,7 @@ void signalUpdateSource(PyObject* source)
for(int i = 0, iMax = PyList_GET_SIZE(attrs.object()); i < iMax; ++i) {
PyObject *attrName = PyList_GET_ITEM(attrs.object(), i);
Shiboken::AutoDecRef attr(PyObject_GetAttr(reinterpret_cast(source->ob_type), attrName));
- if (attr->ob_type == &Signal_Type) {
+ if (!attr.isNull() && attr->ob_type == &Signal_Type) {
Shiboken::AutoDecRef signalInstance((PyObject*)PyObject_New(SignalInstanceData, &SignalInstance_Type));
signal_instance_initialize(signalInstance, attrName, reinterpret_cast(attr.object()), source, 0);
PyObject_SetAttr(source, attrName, signalInstance);
diff --git a/tests/QtCore/CMakeLists.txt b/tests/QtCore/CMakeLists.txt
index 76db54f..210aa01 100644
--- a/tests/QtCore/CMakeLists.txt
+++ b/tests/QtCore/CMakeLists.txt
@@ -34,6 +34,7 @@ PYSIDE_TEST(qobject_connect_notify_test.py)
PYSIDE_TEST(qobject_destructor.py)
PYSIDE_TEST(qobject_event_filter_test.py)
PYSIDE_TEST(qobject_inherits_test.py)
+PYSIDE_TEST(qobject_objectproperty_test.py)
PYSIDE_TEST(qobject_parent_test.py)
PYSIDE_TEST(qobject_property_test.py)
PYSIDE_TEST(qobject_protected_methods_test.py)
diff --git a/tests/QtCore/qobject_objectproperty_test.py b/tests/QtCore/qobject_objectproperty_test.py
new file mode 100644
index 0000000..2456b82
--- /dev/null
+++ b/tests/QtCore/qobject_objectproperty_test.py
@@ -0,0 +1,29 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+'''Test case for the bug #378
+http://bugs.openbossa.org/show_bug.cgi?id=378
+'''
+
+import unittest
+from PySide.QtCore import QObject
+
+class ExtQObject(QObject):
+ def __init__(self):
+ # "foobar" will become a object attribute that will not be
+ # listed on the among the type attributes. Thus for bug
+ # condition be correctly triggered the "foobar" attribute
+ # must not previously exist in the parent class.
+ self.foobar = None
+ # The parent __init__ method must be called after the
+ # definition of "self.foobar".
+ QObject.__init__(self)
+
+class TestBug378(unittest.TestCase):
+ '''Test case for the bug #378'''
+
+ def testBug378(self):
+ obj = ExtQObject()
+
+if __name__ == '__main__':
+ unittest.main()
+
From 1b754f30983fb870fcbd7f62fe3b0c8001c48426 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Thu, 23 Sep 2010 16:14:49 -0300
Subject: [PATCH 0254/1129] Removed doc files not used.
---
doc/_static/.gitignore | 0
doc/_static/basic.css | 417 ---------------------
doc/_static/default.css | 248 ------------
doc/_static/images/._background_search.jpg | Bin 4096 -> 0 bytes
doc/_static/images/._bread_crumb.png | Bin 4096 -> 0 bytes
doc/_static/images/._button_search.jpg | Bin 4096 -> 0 bytes
doc/_static/images/._side_background.jpg | Bin 25192 -> 0 bytes
doc/_static/images/._top_background.jpg | Bin 4096 -> 0 bytes
doc/_static/images/background_search.jpg | Bin 2129 -> 0 bytes
doc/_static/images/bg.jpg | Bin 5749 -> 0 bytes
doc/_static/images/bread_crumb.png | Bin 743 -> 0 bytes
doc/_static/images/button_search.png | Bin 3259 -> 0 bytes
doc/_static/images/side_background.jpg | Bin 13760 -> 0 bytes
doc/_static/images/top_background.jpg | Bin 500 -> 0 bytes
doc/conf.py.in | 2 +-
15 files changed, 1 insertion(+), 666 deletions(-)
delete mode 100644 doc/_static/.gitignore
delete mode 100644 doc/_static/basic.css
delete mode 100644 doc/_static/default.css
delete mode 100755 doc/_static/images/._background_search.jpg
delete mode 100755 doc/_static/images/._bread_crumb.png
delete mode 100755 doc/_static/images/._button_search.jpg
delete mode 100755 doc/_static/images/._side_background.jpg
delete mode 100755 doc/_static/images/._top_background.jpg
delete mode 100644 doc/_static/images/background_search.jpg
delete mode 100644 doc/_static/images/bg.jpg
delete mode 100644 doc/_static/images/bread_crumb.png
delete mode 100644 doc/_static/images/button_search.png
delete mode 100644 doc/_static/images/side_background.jpg
delete mode 100644 doc/_static/images/top_background.jpg
diff --git a/doc/_static/.gitignore b/doc/_static/.gitignore
deleted file mode 100644
index e69de29..0000000
diff --git a/doc/_static/basic.css b/doc/_static/basic.css
deleted file mode 100644
index 2509c22..0000000
--- a/doc/_static/basic.css
+++ /dev/null
@@ -1,417 +0,0 @@
-/**
- * Sphinx stylesheet -- basic theme
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- */
-
-/* -- main layout ----------------------------------------------------------- */
-
-div.documentwrapper {
- float: left;
- width: 100%;
-}
-
-div.bodywrapper {
- margin: 0 0 0 230px;
-}
-
-div.clearer {
- clear: both;
-}
-
-/* -- relbar ---------------------------------------------------------------- */
-
-div.related {
- width: 100%;
- font-size: 90%;
-}
-
-div.related h3 {
- display: none;
-}
-
-div.related ul {
- margin: 0;
- padding: 0 0 0 0px;
- list-style: none;
-}
-
-div.related li {
- float: left;
- display: inline;
- padding-right:17px;
- padding-left:10px;
- background-image:url(images/bread_crumb.png);
- background-position:right;
- background-repeat:no-repeat;
-}
-
-div.related li.right {
- float: right;
- margin-right: 5px;
- padding: 0 0 0 0px;
- background-image:none;
-}
-
-/* -- sidebar --------------------------------------------------------------- */
-
-div.sphinxsidebarwrapper {
- padding: 10px 5px 0 10px;
-}
-
-div.sphinxsidebar {
- float: left;
- width: 230px;
- margin-left: -100%;
- font-size: 90%;
-}
-
-div.sphinxsidebar ul {
- list-style: none;
-}
-
-div.sphinxsidebar ul ul,
-div.sphinxsidebar ul.want-points {
- margin-left: 20px;
- list-style: square;
-}
-
-div.sphinxsidebar ul ul {
- margin-top: 0;
- margin-bottom: 0;
-}
-
-div.sphinxsidebar form {
- margin-top: 10px;
-}
-
-img {
- border: 0;
-}
-
-/* -- search page ----------------------------------------------------------- */
-
-ul.search {
- margin: 10px 0 0 20px;
- padding: 0;
-}
-
-ul.search li {
- padding: 5px 0 5px 20px;
- background-image: url(file.png);
- background-repeat: no-repeat;
- background-position: 0 7px;
-}
-
-ul.search li a {
- font-weight: bold;
-}
-
-ul.search li div.context {
- color: #888;
- margin: 2px 0 0 30px;
- text-align: left;
-}
-
-ul.keywordmatches li.goodmatch a {
- font-weight: bold;
-}
-
-/* -- index page ------------------------------------------------------------ */
-
-table.contentstable {
- text-align: left;
- width: 90%;
-}
-
-table.contentstable p.biglink {
- line-height: 150%;
-}
-
-a.biglink {
- font-size: 1.3em;
-}
-
-span.linkdescr {
- text-align: left;
- padding-top: 5px;
- font-size: 90%;
-}
-
-/* -- general index --------------------------------------------------------- */
-
-table.indextable td {
- text-align: left;
- vertical-align: top;
-}
-
-table.indextable dl, table.indextable dd {
- margin-top: 0;
- margin-bottom: 0;
-}
-
-table.indextable tr.pcap {
- height: 10px;
-}
-
-table.indextable tr.cap {
- margin-top: 10px;
- background-color: #f2f2f2;
-}
-
-img.toggler {
- margin-right: 3px;
- margin-top: 3px;
- cursor: pointer;
-}
-
-/* -- general body styles --------------------------------------------------- */
-
-a.headerlink {
- visibility: hidden;
-}
-
-h1:hover > a.headerlink,
-h2:hover > a.headerlink,
-h3:hover > a.headerlink,
-h4:hover > a.headerlink,
-h5:hover > a.headerlink,
-h6:hover > a.headerlink,
-dt:hover > a.headerlink {
- visibility: visible;
-}
-
-div.body p.caption {
- text-align: inherit;
-}
-
-div.body td {
- text-align: left;
-}
-
-.field-list ul {
- padding-left: 1em;
-}
-
-.first {
- margin-top: 0 !important;
-}
-
-p.rubric {
- margin-top: 30px;
- font-weight: bold;
-}
-
-/* -- sidebars -------------------------------------------------------------- */
-
-div.sidebar {
- margin: 0 0 0.5em 1em;
- border: 1px solid #ddb;
- padding: 7px 7px 0 7px;
- background-color: #ffe;
- width: 40%;
- float: right;
-}
-
-p.sidebar-title {
- font-weight: bold;
-}
-
-/* -- topics ---------------------------------------------------------------- */
-
-div.topic {
- border: 1px solid #ccc;
- padding: 7px 7px 0 7px;
- margin: 10px 0 10px 0;
-}
-
-p.topic-title {
- font-size: 1.1em;
- font-weight: bold;
- margin-top: 10px;
-}
-
-/* -- admonitions ----------------------------------------------------------- */
-
-div.admonition {
- margin-top: 10px;
- margin-bottom: 10px;
- padding: 7px;
-}
-
-div.admonition dt {
- font-weight: bold;
-}
-
-div.admonition dl {
- margin-bottom: 0;
-}
-
-p.admonition-title {
- margin: 0px 10px 5px 0px;
- font-weight: bold;
-}
-
-div.body p.centered {
- text-align: center;
- margin-top: 25px;
-}
-
-/* -- tables ---------------------------------------------------------------- */
-
-table.docutils {
- border: 0;
- border-collapse: collapse;
-}
-
-table.docutils td, table.docutils th {
- padding: 2px 8px 2px 8px;
- border-top: 0;
- border-left: 0;
- border-right: 0;
- border-bottom: 1px solid #aaa;
-}
-
-table.field-list td, table.field-list th {
- border: 0 !important;
-}
-
-table.footnote td, table.footnote th {
- border: 0 !important;
-}
-
-th {
- text-align: left;
- padding-right: 5px;
-}
-
-/* -- other body styles ----------------------------------------------------- */
-
-dl {
- margin-bottom: 15px;
-}
-
-dd p {
- margin-top: 0px;
-}
-
-dd ul, dd table {
- margin-bottom: 10px;
-}
-
-dd {
- margin-top: 3px;
- margin-bottom: 10px;
- margin-left: 30px;
-}
-
-dt:target, .highlight {
- background-color: #fbe54e;
-}
-
-dl.glossary dt {
- font-weight: bold;
- font-size: 1.1em;
-}
-
-.field-list ul {
- margin: 0;
- padding-left: 1em;
-}
-
-.field-list p {
- margin: 0;
-}
-
-.refcount {
- color: #060;
-}
-
-.optional {
- font-size: 1.3em;
-}
-
-.versionmodified {
- font-style: italic;
-}
-
-.system-message {
- background-color: #fda;
- padding: 5px;
- border: 3px solid red;
-}
-
-.footnote:target {
- background-color: #ffa
-}
-
-/* -- code displays --------------------------------------------------------- */
-
-pre {
- overflow: auto;
-}
-
-td.linenos pre {
- padding: 5px 0px;
- border: 0;
- background-color: transparent;
- color: #aaa;
-}
-
-table.highlighttable {
- margin-left: 0.5em;
-}
-
-table.highlighttable td {
- padding: 0 0.5em 0 0.5em;
-}
-
-tt.descname {
- background-color: transparent;
- font-weight: bold;
- font-size: 1.2em;
-}
-
-tt.descclassname {
- background-color: transparent;
-}
-
-tt.xref, a tt {
- background-color: transparent;
- font-weight: bold;
-}
-
-h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt {
- background-color: transparent;
-}
-
-/* -- math display ---------------------------------------------------------- */
-
-img.math {
- vertical-align: middle;
-}
-
-div.math p {
- text-align: center;
-}
-
-span.eqno {
- float: right;
-}
-
-/* -- printout stylesheet --------------------------------------------------- */
-
-@media print {
- div.document,
- div.documentwrapper,
- div.bodywrapper {
- margin: 0;
- width: 100%;
- }
-
- div.sphinxsidebar,
- div.related,
- div.footer,
- #top-link {
- display: none;
- }
-}
diff --git a/doc/_static/default.css b/doc/_static/default.css
deleted file mode 100644
index 721ceb7..0000000
--- a/doc/_static/default.css
+++ /dev/null
@@ -1,248 +0,0 @@
-/**
- * Sphinx stylesheet -- default theme
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- */
-
-@import url("basic.css");
-
-/* -- page layout ----------------------------------------------------------- */
-
-body {
- font-family: sans-serif;
- font-size: 100%;
- background-color: #000000;
- color: #000;
- margin: 0;
- padding: 0;
-}
-
-div.document {
- background-image:url(images/side_background.jpg);
- background-repeat:repeat-y;
- background-color:#ffd800;
-}
-
-div.body {
- position:relative;
- background-color:#fff;
- color: #000000;
- padding: 0 20px 30px 20px;
-}
-
-div.footer {
- color: #ffffff;
- width: 100%;
- padding: 9px 0 9px 0;
- text-align: center;
- font-size: 75%;
-}
-
-div.footer a {
- color: #ffffff;
- text-decoration: underline;
-}
-
-div.related {
- background-image:url(images/top_background.jpg);
- background-repeat:repeat-x;
- background-color: #d7aa00;
- line-height:33px;
- height:33px;
- color: #000000;
-}
-
-div.related a {
- color: #000000;
-}
-
-div.related img {
- padding-top:3px;
-}
-
-div.sphinxsidebar {
-}
-
-div.sphinxsidebar h3 {
- font-family: Arial, Verdana, sans-serif;
- color: #000000;
- font-size: 1.4em;
- font-weight: normal;
- margin: 0;
- padding: 0;
-}
-
-div.sphinxsidebar h3 a {
- color: #000000;
-}
-
-div.sphinxsidebar h4 {
- font-family: Arial, Verdana, sans-serif;
- color: #000000;
- font-size: 1.3em;
- font-weight: normal;
- margin: 5px 0 0 0;
- padding: 0;
-}
-
-div.sphinxsidebar p {
- color: #ffffff;
-}
-
-div.sphinxsidebar p.topless {
- margin: 5px 10px 10px 10px;
-}
-
-div.sphinxsidebar ul {
- margin: 10px;
- padding: 0;
- color: #ffffff;
-}
-
-div#searchbox p.searchtip {
- color:#000000;
- font-size:90%;
- padding-top:50px;
-}
-
-div#searchbox {
- background-image:url(images/background_search.jpg);
- background-repeat:no-repeat;
- background-position:center;
- border:none;
-}
-
-div.sphinxsidebar a {
- color: #009491;
-}
-
-
-/* -- body styles ----------------------------------------------------------- */
-
-a {
- color: #009491;
- text-decoration: underline;
-}
-
-a:hover {
- text-decoration: underline;
-}
-
-div.body p, div.body dd, div.body li {
- text-align: left;
- line-height: 130%;
-}
-
-div.body h1 {
- font-family: Arial, Verdana, sans-serif;
- background-color: #f2f2f2;
- font-weight: normal;
- color: #20435c;
- border-bottom: 1px solid #ccc;
- margin: 20px -20px 10px -20px;
- padding: 3px 0 3px 10px;
-}
-
-div.body h2,
-div.body h3,
-div.body h4,
-div.body h5,
-div.body h6 {
- font-family: Arial, Verdana, Helvetica, sans-serif;
- font-size:12px;
- font-weight:normal;
- border-left-width: 1px;
- border-right-width: 1px;
- border-top-width: 1px;
- border-bottom-width: 2px;
- border-style: solid;
- border-left-color: #b1b1b1;
- border-right-color: #b1b1b1;
- border-top-color: #b1b1b1;
- border-bottom-color: #009491;
- background-color: #e0e0e0;
- padding-left:5px;
-}
-
-div.body h1 { margin-top: 0; font-size: 200%; }
-div.body h2 { font-size: 120%; }
-div.body h3 { font-size: 115%; }
-div.body h4 { font-size: 110%; }
-div.body h5 { font-size: 105%; }
-div.body h6 { font-size: 100%; }
-
-a.headerlink {
- color: #c60f0f;
- font-size: 0.8em;
- padding: 0 4px 0 4px;
- text-decoration: none;
-}
-
-a.headerlink:hover {
- background-color: #c60f0f;
- color: white;
-}
-
-div.body p, div.body dd, div.body li {
- text-align: left;
- line-height: 130%;
-}
-
-div.admonition p.admonition-title + p {
- display: inline;
-}
-
-div.note {
- background-color: #eee;
- border: 1px solid #ccc;
-}
-
-div.seealso {
- background-color: #ffc;
- border: 1px solid #ff6;
-}
-
-div.topic {
- background-color: #eee;
-}
-
-div.warning {
- background-color: #ffe4e4;
- border: 1px solid #f66;
-}
-
-p.admonition-title {
- display: inline;
-}
-
-p.admonition-title:after {
- content: ":";
-}
-
-input[type=text]{
- background-color: #009491;
- font: 11px verdana, arial, helvetica, sans-serif;
- color:#FFFFFF;
- width: 150px;
- height: 18px;
- border: 1px solid #009491;
- margin-left:13px;
- margin-top:15px;
- margin-bottom:4px;
- border:none;
-}
-
-pre {
- padding: 5px;
- background-color: #eeffcc;
- color: #333333;
- line-height: 120%;
- border: 1px solid #ac9;
- border-left: none;
- border-right: none;
-}
-
-tt {
- background-color: #ecf0f3;
- padding: 0 1px 0 1px;
- font-size: 0.95em;
-}
diff --git a/doc/_static/images/._background_search.jpg b/doc/_static/images/._background_search.jpg
deleted file mode 100755
index d5c689c31bb9b045cfb9534f0dd71c5f63c85661..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 4096
zcmZQz6=P>$Vqox1Ojhs@R)|o50+1L3ClDJkFz{^v(m+1nBL)UWIj;a$cMB&^U!WKc
z;207TWIgNTe~1o-3LMHtg-1hRGz3ONU^E0qLtr!nMnhmU1V%$(Gz3ONU^E0qLx8Fw
zzz8%Aguy^ABqOs}p(wRDzqBYhRUs|EC|e;juOv0EBr`uRF(;=|AtyDhL?J0BF)tg~
U7l!H@(iE!y;a-tpko*510Px@-SpWb4
diff --git a/doc/_static/images/._bread_crumb.png b/doc/_static/images/._bread_crumb.png
deleted file mode 100755
index 46b8591c6c018df537faed736270c57745dd4d5d..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 4096
zcmZQz6=P>$Vqox1Ojhs@R)|o50+1L3ClDJkFz{^v(m+1nBL)UWxd1=+Gz%wBU!WKc
z;207TWIgNTe~1o-3LMHtg-1hRGz3ONU^E0qLtr!nMnhmU1V%$(Gz3ONU^E0qLx8Fw
zzz8%Aguy^ABqOs}p(wRDzqBYhRUs|EC|e;juOv0EBr`uRF(;=|AtyDhL?J0BF)tg~
U7l!H@(iE!y;a-tpko*5106BCZegFUf
diff --git a/doc/_static/images/._button_search.jpg b/doc/_static/images/._button_search.jpg
deleted file mode 100755
index d5c689c31bb9b045cfb9534f0dd71c5f63c85661..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 4096
zcmZQz6=P>$Vqox1Ojhs@R)|o50+1L3ClDJkFz{^v(m+1nBL)UWIj;a$cMB&^U!WKc
z;207TWIgNTe~1o-3LMHtg-1hRGz3ONU^E0qLtr!nMnhmU1V%$(Gz3ONU^E0qLx8Fw
zzz8%Aguy^ABqOs}p(wRDzqBYhRUs|EC|e;juOv0EBr`uRF(;=|AtyDhL?J0BF)tg~
U7l!H@(iE!y;a-tpko*510Px@-SpWb4
diff --git a/doc/_static/images/._side_background.jpg b/doc/_static/images/._side_background.jpg
deleted file mode 100755
index a79b91c97466a70bbdcf67be2df78db09871c16a..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 25192
zcmeI4O>7%Q6oB9UWc^bo7&!@zgjlOYRpp`}(HtUDSt%B20y0Fg521%j)J58mG>&Kv
z^yUIZLTRL`RaL1%0;C>tiCUE+iiGH)O_j7x;M@c{BF$ucEms6e=Ix=T)4dg&~ODqj5quO5c%|t
zzSj?Syw)35F>zx#5RLYCUYup6BjCf0b5SZ0AOb{y2oM1xKm>>Y5g-CYfCvzQ>JpH!
zxX4a`e%xTBx@G?-N^A5TI2u3lp1;qCkHwE0@lk&$vJXI;)F!R^?|?7iS($l&6*1oP
zc;hB+;qsOACp7cBek*3BAN=66QRDKF_dx=;mCEy8M2&rv_&W|zdQ4C*(+hr3z-ig-
zyRsi1cELD%sI9C%TF>Xr;yN?sqFFf0mYG&8utLGaG~LYSAFV9^@#~K_Z{41my)&1b
zzn5BATud*eGnu7aHhVqyAXm(?49mJQn7FvGkh(WtOlmXJKYTj{asgx+=z)l((Zh!I4*8qLJp{Q|z4;^m?
z2V*10dDt6z>qYFbpBz=}Bg`f`LrGu(pX_qhaeb4l+hXEA?Xp!TgR$Wb9B{YHVXJ=W
zxatzHw}lP$9h(Ycmbni1|K7OaLa&A7gct4%aq;uJ1
z&YR6GppKvLa4y-kEqyN@>A=TVL$
z|CIXQK>PkscTcYX>FEybZx2-ZU#Ri;1GOH1u>v)nfACJQrt>d83qTPz{VY$sN^WUS
z1c(3;AOb{y2oM1xKm>>Y5g-CYfCvx)B0vO)01+SpM1Tko0U|&Is!4#qjjF7RIr-aN
z`3hgH@p)V$Q;9_T{iyHa>uq7!HaZd?!|>J8np@C)W4W|W*39S5oyG-A=c{X?a9z8V
N#Pl2AS$Zag`d>4|UkLyJ
diff --git a/doc/_static/images/._top_background.jpg b/doc/_static/images/._top_background.jpg
deleted file mode 100755
index d5c689c31bb9b045cfb9534f0dd71c5f63c85661..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 4096
zcmZQz6=P>$Vqox1Ojhs@R)|o50+1L3ClDJkFz{^v(m+1nBL)UWIj;a$cMB&^U!WKc
z;207TWIgNTe~1o-3LMHtg-1hRGz3ONU^E0qLtr!nMnhmU1V%$(Gz3ONU^E0qLx8Fw
zzz8%Aguy^ABqOs}p(wRDzqBYhRUs|EC|e;juOv0EBr`uRF(;=|AtyDhL?J0BF)tg~
U7l!H@(iE!y;a-tpko*510Px@-SpWb4
diff --git a/doc/_static/images/background_search.jpg b/doc/_static/images/background_search.jpg
deleted file mode 100644
index c0481c561d78056e870b3ef0c7f326f56ddc9128..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 2129
zcmex=uI=H%w(=K}(Mey}1a#RK7?>VxzCA7BvVV9;T>$jm6nz$D1XEXer(2*YNevqA0w
zx)TN%**G|vm|5Am7(r6ZKoSlZ*;v_`SvZ(D1%TRExtQ2l*;%2Ij6f}Hf|psQE@KxD
zPuCCx?ZR5hS(A(6nu#)(EwNy2RG3zdSJj6W0}e5fq`{}uxeGtgy%%z_N|46A>2
ze9aa%>WKTGd*gDzlLeNU+!yX$bXHN!3RRnMQZsbbl+tNV0cU5eR@C~aDC4avv@k{c
z`t$zn_8ALqwU*0A8Gn|p=(wzR{YL84m#NYIl}r6*iho+NNlWW%jQ0E$amq(a9;Udw
z2-_W6bI-+)H~Zy2)oYO@_qHUoteLV@BlM?#sI1))#Z3bJg*${_tZEhVXXIa4J}F#m
zQ`gdb&U9rd{cba5t*;O5d{3<;dmUGf7usRoI7VMTN_Ld`>f3KTr74(-5l`v(|ea
zTas2rABsF?a$hdzSm@_NH8HE&1KKX^J}K4{s$Jo2acuVEvolWZtMKoh8t_WsmUyMo
zMX(hTmuo6FONO84{8+R~)=Apwy-Ji}$l8ZGkEQba&62f#KD5&dbzb3|5&NXuO>62N
z)j7$&AD^8`jki%h3U$)NjH5x@TQ>J(?z6esv-)|3weRQfH<|V*ZlZw!>KhN
z=8J1ByrQ^8@006dQLlSK=L|=^Krj}bB)fi0JAx&&C-!_lJnLgu{k=WvM^8hOMlLvM
z6f3@qzs6F?y)Pqg_R%V{?uAy_sggnSM7Dgq{6ZtvNOe>1e&f*4X`xf%LQeF(3cS5;
z-`3yO;b8)A?N)8}ck#Wpv(o`=shs=YzHOdR#VAf93k-Oz8YTyP{i0KdaB^XMJ5h
zFYa>YzSQ>mx#j;ECY}B&7qVGt#q5KT-QUlb|C)TQ=CgUuwMlokDsFn2acjb^vr_Bk
zOyeXwOwv=AFrR|cjNvJjYVpybR
z!cCXuYeTP0)c8@l;9#wBoaMSz&kg&gh2&0|{xJVuYR#LiT6OAqR-!A?&st}1tmiwb
zajfJOx(x`v&EkotzI5DscU^c|+rD=j5UULAMa
z*;H`H`P;o^Pfvzg1;8`=^q3dR2}4j~8D>u5S8#qb2A4c1fL|Ha`!SHJQg%3(TFHtvgQ!
z$ZOnfe4{x%>U4U$UBTT2d1t;U+`P8w=EL)I%rm4n+jf|huGv;m{G9g|+ne)Ayu(nF
z;O2d2QZ^r+Z;^Ka6fTeEFTQss`TNhBdDRbZJKU{&<81NQxYndtGa~fN=X$35hR-Bz
zvL~xoPu73?!Sm-%`Rg|_*6;kj%Plw4#%8a)_7Cg(;(PCXsyToAR@5qMyZ9f~_2OG!
Q{AY-pY|v{K>Hq&G084;`WdHyG
diff --git a/doc/_static/images/bg.jpg b/doc/_static/images/bg.jpg
deleted file mode 100644
index 2ceb19583d43d0b5ba9d04767436b668228e9bfd..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 5749
zcmb7H2Ut^Cx4lW|AP_7J4uS%TbOBKiDWepn3epomsY2+z2u4M!f`k$g1OzEkLX#??
zBPD|ab0D%F(hV%i5
zp8=?fw>82a00A@r0H~2%iva6iHm+8-fK3C*10oWD5P$|k2C1Z>qal6iX=!L^=^5zg
z=;`Pfm>3vIU|?cmA%j#NIKaXJCF9U9fM{rG8R!|i4$%831r|Smj)|lkTv+
zeNKMUO|;uT*!vH{o-#FysKHT@=g;_CYg^q}0N_=}`-QCY7~R19o0045T`Ko3AouzE
zmZF?00%b0G>P8ml%ba&Cbq_r1!pFFIA|ynsnMM9YbeP*2&5u5*sJ6~Jiogv
zGI6**Pmt}ekFRMPbul2jdXD=;Y
zKG(Q8TG{^S%G6MuB41TsCyBuJ^3}50(f)?A&RK<9i@5Kx_?~JlllAql@&A1Qc4*NEp9Qzlb
zWxY+I_0pPSi=rN1>N|@G?NkEH_9Pa4f7-<7B8zbu=A*IIg?}ZI9~r8Nz*^gegtZKJ
z;B67@i|G^&ZMG&6u(@a&TS
z?@NE`_w`y~KXj>=p8aPM^~qq?!E3O0MN><=bNMSqBm&+*@`H7B()7DGrbAOp%@*(&
z$2UHg%CT~%F`jIOrT%J(!C5m=XvItu4{UJ^d*N0FUM;reSqa~3M7cGib!SCV^NSCb
zY&X-X4g6O6RpgG)Gp;MDaS=?dF!O?1#i+kaVO+h&an3HJH2?tedgy0w)xw=0m-m^A
zcdS11*U*ogjhwN&h&|HHSAi3>Ny%PzBH)~hK#$o<;-8;9T`N#d-d9pX4{m#XO1X_2
zwQ4KU-ctAYpTi58ibOSO9$L?4hB~zyi=A;{i!+l!|2d$gXYiwE%tYvezE{Kk^5Tw?a8kb)
z5=-!27H^h*E>p8|!!T
zaMFhjagQMdksODr6(21Ft7_7rMi7IQekzQZ+-5JFlQwEQ|LXUQeVbl>?$NuE0G_Hk
zHB(c9g`T0UXCAD~M9HBt8h5dlPFX>XBPHIdByR9tM?yACJU8^2bg=!RBm$qEVqNmT
z>^A^dmA%yZ`s|D9CR2%ce;eUoqp9wK_wXWv+tHU^?CQtO_DkvH#+n=U7l-J7OY(Z!
zG4c7oF1!71{%(N`?{N7C+GzK)*lS!Ea_kK7giloY4
z<0{Ri#6Woyl>tM-FLpaz>X+ZCXoB;jM_!{Jh?t{V*VM7;(lgh{G|)VILfj)alOAn>
z>cOM6sYYBH{03e)_zaGZPnk@h0+cwJXm?WE45>Y2K!LEcBgpB1?`||H6%+8N9vD&Ee}oKiN692GFRuH`;|o9Qos9Hdsy7Iwg}giMQl#A>Yq*a?R==;iBh61VjaP*#DTM&QwxU
z;>Ak|J!3YebT9b1WM0dOnVc&Yu0@jh@-{Qo$r-T2v2B^`GSkXr*B(I3k%T!L=b2P?
z^MD@>QhU>RKIGKq1KHpLx9(mf^$HTcFXvQL!}mo&Jv-0QdA=sQXH3>sL9sPMmQG*Np1K|}^rLcW
z#t+Zc;JXihu~8l5N|ip)wKm$3+u?I_kqJo|V?b-7x_;iyT1aU!Ei{PDRgdn)@qKma
z6qwTYWCfF2AEPPy#x_JPAGlfm$HJ9D&D_pas
z+Itl^5>#}#pH5RA?GNux2x+K$d
z=3W!jMAegz{~Z7rxu@h5YSb}r3FF@$z#{E6(y5|sULzO89+lS$az;XoK{gwvgi`H*8i-BW5uPeRwg=SSM9ucB%kRKE|g<=6z+3;Jqsc
zbS?{WCkQiZqxx*BEr-J+lt~Ijmm!iZD-uFJYn)4_+1zg*3p0}3WY8>fKKqfisZ9h9
zJQeJ2-wr=JLGpss+ob(E<*q0|mreUheoY|bxn9j9YXZn#w>s|9;&o?}S%JF49etfD
zCP=cD+?c9=WR`aRADZQg26QmF_%cBRrdtGlvLqu^v6btY+472$
zd@ZEB5vN;uzPdOX0_21(s-gp?AeHP9B$~HEO#u^u2X14kqTLHy7Ee@v9Qs!0!MC^b
z=(*n;6^!WQ8^tt>yTc&PPl}>2pm|XRly3vW&
zG~d718FniP!?LMgGv}dOu9a2p3S;X1{3~OwZj*s^d%Tv7Al_>+xFBqE#NxK%bKbwLa@>L
znv}_0_NqPmC+g2}^fM;{gB|!&%PAK*=3?BTX8^8X5#PepGTqR6(pVk4<8tC!B!$bm
zX~1<0I((SBE=%R_@-5co?Beh`_yBh
zJX@Z;U?hn`KUm2nB<3(#gB)@#((T`sb@jd(0fjumu|)Geb+^DTLe5c-q=Qn>RowHV
zF%sTe+9Kr4UnuNu^V#wo@4}bm5dm=;Z%W|kgL9iYKgJg72EhDbJa>L*yvJJw#on-w
zOecrI!Rp^#U-bL!-09VWBgvjU(6DUmSnmXV?hdHA%@;dN@j5sXfhnbJK_YNO#dE6T
zj(%ljzvc2{uD#bO>OmA0pft1|O*OOfi7B@W8UCjt+N
zz$f&sDRlLbI(O8aM7`jzem`$BNwJAZ>IMD&fjONH@ZYs)?HplvT(bJjr{BDFXIi4u
z$wA1qbUf3r84)N7gWZLGjkw(3KE`w9>+K6c4Yo{F2F5HfF{k8{ZL~s}
z*RT?UDi%o6)$s3n6^Y2c>rIvw=HvFA=@cGKEymurQ31yF(!!!!a`j-Gu13ExB|<7l
zqjYaHuJO2tC+F*|%=U8rbJ(B&>)EQcfym0X0dr7~9*#K(rqw~9$eyOR-
z{fYUDbw1b&{3TrF^L<6ED%3>{oLu@``K`?Dz6qX}d;3UFv5bl`00{ZbUdJWh`+hDk
zt%~Uq^{xd#`bFb;B>h-QDo|O*&jPYbKFXk(2ktOJy9~wjn_pmzVaE=QuV3{E)iM@_
zOqDXj(GKczvoE8EEhVLfd;1a6Wr^Wp{aUXP13PNY9h0M?xLTCoZ6<0rf!?KuIqNHg
zRTG$N#Hv_$crnS(P>utOO&`ST(y@-+VCTDV%nj8
z&B5>jn<*vTCzXW{S|}$0g^|`&YWbl)7_o`y6Zb74U0umu8byATX{TFs)bs4h#RZ7O
z>8g%5nv8ShC;8(?bT#y#@*XjF
z^0r9-XqPQ|1@R2A?1^zZZRRk(zW0jS-AVvTx&VYDMztWXxbyH$p3K=@*M)(BH=B?+$MWMT;z7
z-7?mMTt&5CM}7dB+k=w5h9aI1FcD-`B2UVQA>pXl!6`yj*~uJm>ph
zUxiDHJbj}dJrlFse7P;n8k{ECSY|Le-}EW?8OLX)qIg@nDcPzHg!YY2#l1ApVvTbR
zto*MYc&y1?d-S-kE@?#aV`j{3H=vwcPN|l{#o3ISPNPYR#q!Agrl=O%k?V#ypFuUm
zx~TGfSK5xD>^}$UdzZ~)*iQ^Kh+59qNX??$zgf}vyTRAI)ucb6HpUNkEY)t~FV8#d
z{K2c3oVvvU>76j$a?Dz?P)f!TtY#q5q&4=uAi_km(^Ul)*N#yj^KmA53~_97DuP``+89mEh*hjr#wmsO$O_
zX`csI0fGS2Pga8uJFj8;dz3)x;^kYS{dIX>qxNo2-
z`bn?SsCH~=9kQNxEY~quHJMah``jI$3&upTHa4PYhcIoeI_#^mY;JF3ZOp^x
zG3gRGdh8%M*Vn?Y!wIGWudG|CgnXK_q&f2_Uxulrn=J2Si77HSjdP{@2aBjly!G|L+14Dg|L@8W7=N<
Z1^{ctoJ~SsgrNWc002ovPDHLkV1lEqWYhov
diff --git a/doc/_static/images/button_search.png b/doc/_static/images/button_search.png
deleted file mode 100644
index 0160b81ab5034ba55a704d049534356a289216b3..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 3259
zcmV;s3`FyZP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T
zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p
z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&nehQ1i
z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW
zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X
zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4
zfg=2N-7=cNnjjOr{yriy6mMFgG#l
znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U
zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya?
z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y
zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB
zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt
z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C
z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB
zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe
zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0
z?2xS?_ve_-kiKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$
z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4
z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu
zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu
z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E
ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw
zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX
z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i&
z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01
z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R
z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw
zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD
zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3|
zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy
zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z
zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F}
z0005zNklob_00960
zLea#)!0?}efq@Yw+XWS1U|?Wi00000|Nmlu+GP)=8UFwO&%grHf@}s80|Ub~26O<`
z@*ir1H%vPNns#ph00030|AMKM{{R2~xBvhD8$)&c|NsBL1hVBY#sp+RD87Nrhxx~h
zfq@|k$*P$Q3=EgCIT9ECkM3|>0Op~e00000|NnH7u?Ye}5JevxD2S1PxfWp=mSG^m
zrAAg^1-7D?S%GkYEhvJ4Jd-(Dm+?o-?AuxX=a;X?>Pnqt+xtVO?gBcf*9_dKi|S&l
zE^F}l$H=jc=aQJ10jD2VY6IMXQOpLwD{H_Tm;zl?{;JRM0nDrKn}CNUm}y_a
zb)hr0!0kgy8L}V{L_zpV)&oHhtOu9wmzcDhOoDK~$LfDDiD0$b1e3{Rze5^OF86O*>gML3@$Tlb-pbiz(*OEys^N{lUsgn_0f=`1UebwWBP
zcG?aQpp^XR5EBZd(@wtHLYa03LO*~XGyz)ZF9?MKoz9TZrZiJZJ_@BwXVkZQce3Qj
zNm@#q1fOQ#?Y@2c_Pw|7c6Il5i*FR)Mh&a`B7KN5QD_zXQ1O`g!QS!oFhbENT8E;&G$x>75kPbeq&&rud^6
z7>8~79;zccZ3;z^srXk^Pf93xJ8oJ09l8tE)zs8DYU&)0y2e^(ZDY&ay1Kb7txZiW
zO--$hb>z}-T46e*=G4~Csh`tOU*FJNUtiyhL4C8f*@t$kjS_Tfsd2fElDy!Gqf`uq_q&4>^7@FL|Dkqvw#G*x|*!q9lM&b1cwJ+
zImNfdkL7nvh6Y;_1@GxaHY|XBv2f%l2ytM3vUkX*%EwD0%q+o@DG`cqp*l0^vk|RC
zC->}Z*t2u~cOLxmAxGQ1XwPJ%t@+?&WYMy=$;j$R+vETsb`u1rzWC_9LuYRL_VU97
zuFB3UqT-vy_vrl8qrrDDD9{s$TCjs6WdA%oaQK-cxJ3ll@b2lG&w38G?%V&B)Q?_B
zzV(^^BJUU?MUQhNmcSj8%JkB1@@`3
z?lvoNjkeRH*Et>MWtmpx(e8X+nwVlL;Ub6x4Gp1Y;BjHKFcT0uv%=4HdPoNIJ+DLs
zRZ``?jFc)#1oU7;IVI;;Fr6MFO9b>75_WnFu{#aig-2ptJ}tvIsNhvbXC;-Zw!R$3
zp^8%2;)dDSN(){pLot|;GT_Qr&M-_RA~?{$=S#d
zc$(*2{xi}Hij_v=5_u#FWAT`_&gLXo_cx`p!^$ROHLbQv_ecBt!~K{xq$K6F(x_}q
zUu7%jzq5{9?1FyYN&DOt-O*{Rjo9SIiiz`BtMh1qN%X%F-F*2!3Zw1x|2g{lSZxWP
zT7jmm;f~UR4ZW3C@iMF~Wh||vBx3E$*U~fSP-f?JL1~x%&$gaEsuh3px|5s73aXsM
z$N@Q_UXCvRpDBn(sq8_55?RQZ4shtHCH(?umKB6*lw*q~Mxd7NA0xKfCz+Tpq@VUNyKE*EinR!b1
zp{#U8PR$pk;S3MvXJT%yZXm#3Ig|6nsW^iZ%rFhlfWFLU=Ugs%<<8JEDOWa2|G(c;
zrY|r08&P+E1m1%2=j*Be%lexY!*p=)5AxzZ*Qyh_vX@M~&GbIW`i$3V?RB<{cj;B@
zd~c=a%4)m>P8aojT*@Ui+Mg?^@mYMjq=ulK9`dn$g_Fbz%#t|63HSC-9ZN!dXl07{EXI7t~oX1EQ6{qW@^AvByLeVRYO
zS&+grJPb7%fDo*Mi_$Us9^O;Ja0Gu7K!ZjgnD!|QiFtekWrT7NkgIx`-^JBctBRkb
zj##D!^F~-#(A)GyE$LRo0a8RljGBEG;G%gDfTj;FYHd%zeJ(1XG)f{FZ9;J*p#<83
zQYeoUG={Q(Cq3W>6&DUr8W-kb1Vas6$^0dRPNX-?j%6}{!LcPbFt&+vIcBo2j-I!XC4adNB&I~xxIoP_mqJl%6
zgRg}l9+^%~p2ek@8LERstvp5Y+H==P@{~SH;jIdqLu<1jrbni)0l-Gw3#k^eZzI$U
zdDsll3ZeYj;Qws!|HOx%UhrS@(}m!B2n|63U&RYTH%$8qECw>7Q9l}iyb7s6ayg)A
zx&Q@@LTC{2n4#8#4YKgKYujEZ*bG$vkRHs>7CI!nJ%_~d$EBPHhx-w1BgjcOkWR;C
zm{+@8??3abi%uuITsI0)CYlS$Bk5J!^YY;KwXwwZEeSCRy9(&e@!)K$JsVH@9}5yd&8>p
z#We=0lnaL7bDS!NA$7U%)~$9X(9Q@k*t*5THZH!M;e!lpIss{dQP_4eJW-95?DDE0
z1@A~os&rArLolFFW$##-1S9%ma#Cta9lE07e_
z;mh%>U@MD~pCC?vjUJ3-Ay|`5$dPcDYiul?3^IK@*XQdE2x5Q__p+=gFy2t0Cm{5B
zLqZ_TxoB+VVA(DM*pQvDm!!{uQy)ay51pnj@)D4PaPH9A`hTQs)H
z;dDwaV65PCbAlgI0FvnDe4Lx}dm#ZX;B^Z;1Brz^-~+sy6Mb%;Vck3%fF!yF4ie7+
z4*2*PNI>hyWdZ6T@m`+0PUL#SVo#VC`g#I^aJajN6T(cN=<^GFuV3VSumcHPDA=DK
zmopo}X?PN}%}E@OHz$>?ArDFd1he>gFdBwH4^YG~0F(f6Up$x)
zL);4wro|B20wit0uwK>+wHSi505y!C!FtPP!c)YOa185n!*II61>8Qj-yLv^ZZHkYx>?T6
z@^04ahT#Pw*6#*ifXSEx4*>@O-x0u#zze`(zz?qL5kg{^<9!_43tqv8ybQ~TJ$`S1
z6S{ppe#Yg2N!p{&(l}dMBUTvG`0Rbw0<#vFwZN!vsf%vi_L1aIc$(>Yizcf+B&DR*6FNk&`wV1x9P_yv@&J4+vn8HX>Dj|
z{UnDe8qf(d1*Z?D4pV#q4pZ#MFV^K}DUii#HrXhoAEq#w%;mL}-&0JK86T#w+06h<
z1+>-rs%%G)+E7cie_%tK6{IHnBf?IRs2+2e#hxWA@AVi{wETJBSLt|{Ra;D
z=Esuib4QQYEWXp>Y`yxf-MxJWpIray(9#8G-Z_g8RLEm@KcF3|nBh!CVAY0^@ozlz
z$j@JViKYaSvZ=L*DJA7fbTH!#5rN(R?
zB?lq!`Hybv4Ir`Y);o4_`yM~leE5}P*Y>mw#Pg^5Hg9OhRg;5@_9vb=VlNyOj)(7@
zAG;rpnzUZM*w?#YNm3p1pE+>oxuwfqedp|5yAM8DDRN)gL6GuuAQdv7N91YeHPYX$
z`O;IjtV;8Bre|8VF8|BW8;?DHWBkW2+_JMu@%3dR$A)|_Ssr=zs}HTd
Zxrp9R-o}6Y&E(vJ`-(50{BLu7^IzPYJ<|XH
diff --git a/doc/_static/images/top_background.jpg b/doc/_static/images/top_background.jpg
deleted file mode 100644
index aafe1f72ef27bd58af06ca3ef6b6a085f6cf4ddc..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 500
zcmex=T;Nd3XdtKm-mL
zSy)*)*g5#QxcEi*`1s)BL^J*$U=ZYBP-Kv0W)x@ci+Wc+`GA(w#>2!O6c09F=u
zpa?UnC^OKtYyv>V9Lxxn3=Bbx6Bk}&4rUR#!Y&~Q3=}4AWLZY$Kp{b(0;Zr#EFz*}
z|8FtyFf#(}W)@_yXIS{uZ}ZN1f9y1m?mhQgxislomEG1IYp3&TmCil${ozOVo%d7n
z)paWR$u6o_9l3WzindBlJdY#RqD5hf~+tt#8lVqkVsW@(pEl6osJ<%y}e50pJ
kkfth^nWl!vqE=~
Date: Thu, 23 Sep 2010 16:33:19 -0300
Subject: [PATCH 0255/1129] Removed modindex.hmtm and added domainindex.html to
work with newer sphinx versions.
---
doc/_themes/pysidedocs/domainindex.html | 57 +++++++++++++++++++++++++
doc/_themes/pysidedocs/modindex.html | 40 -----------------
2 files changed, 57 insertions(+), 40 deletions(-)
create mode 100644 doc/_themes/pysidedocs/domainindex.html
delete mode 100644 doc/_themes/pysidedocs/modindex.html
diff --git a/doc/_themes/pysidedocs/domainindex.html b/doc/_themes/pysidedocs/domainindex.html
new file mode 100644
index 0000000..c136cdd
--- /dev/null
+++ b/doc/_themes/pysidedocs/domainindex.html
@@ -0,0 +1,57 @@
+{#
+ basic/domainindex.html
+ ~~~~~~~~~~~~~~~~~~~~~~
+
+ Template for domain indices (module index, ...).
+
+ :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+#}
+{% extends "layout.html" %}
+{% set title = indextitle %}
+{% block extrahead %}
+{{ super() }}
+{% if not embedded and collapse_index %}
+
+{% endif %}
+{% endblock %}
+{% block body %}
+
+ {%- set curr_group = 0 %}
+
+
{{ indextitle }}
+
+
+ {%- for (letter, entries) in content %}
+
{{ letter }}
+ {%- if not loop.last %} | {% endif %}
+ {%- endfor %}
+
+
+
+ {%- for letter, entries in content %}
+ | | |
+ |
+ {{ letter }} | |
+ {%- for (name, grouptype, page, anchor, extra, qualifier, description)
+ in entries %}
+ {%- if grouptype == 1 %}{% set curr_group = curr_group + 1 %}{% endif %}
+
+ {% if grouptype == 1 -%}
+
+ {%- endif %} |
+ {% if grouptype == 2 %} {% endif %}
+ {% if page %}{% endif -%}
+ {{ name|e }}
+ {%- if page %}{% endif %}
+ {%- if extra %} ({{ extra|e }}){% endif -%}
+ | {% if qualifier %}{{ qualifier|e }}:{% endif %}
+ {{ description|e }} |
+ {%- endfor %}
+ {%- endfor %}
+
+
+{% endblock %}
diff --git a/doc/_themes/pysidedocs/modindex.html b/doc/_themes/pysidedocs/modindex.html
deleted file mode 100644
index b00a440..0000000
--- a/doc/_themes/pysidedocs/modindex.html
+++ /dev/null
@@ -1,40 +0,0 @@
-{% extends "layout.html" %}
-{% set title = _('Global Module Index') %}
-{% block extrahead %}
-{{ super() }}
-{% if not embedded and collapse_modindex %}
-
-{% endif %}
-{% endblock %}
-{% block body %}
-
-
{{ _('Global Module Index') }}
-
- {%- for letter in letters %}
-
{{ letter }} {% if not loop.last %}| {% endif %}
- {%- endfor %}
-
-
-
- {%- for modname, collapse, cgroup, indent, fname, synops, pform, dep, stripped in modindexentries %}
- {%- if not modname -%}
- {%- else -%}
-
- {% if collapse -%}
-
- {%- endif %} |
- {% if indent %} {% endif %}
- {% if fname %}{% endif -%}
- {{ stripped|e }}{{ modname|e }}
- {%- if fname %}{% endif %}
- {%- if pform and pform[0] %} ({{ pform|join(', ') }}){% endif -%}
- | {% if dep %}{{ _('Deprecated')}}:{% endif %}
- {{ synops|e }} |
- {%- endif -%}
- {% endfor %}
-
-
-{% endblock %}
From 31db130bbdf4895ff110f3570599b44458b989ad Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Thu, 23 Sep 2010 16:34:13 -0300
Subject: [PATCH 0256/1129] Fixed bug#310
---
PySide/QtCore/typesystem_core.xml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index ec78941..92a154c 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -739,6 +739,9 @@
+
+
+
int yearNumber;
int week = %CPPSELF.%FUNCTION_NAME(&yearNumber);
From 9eddff59405f9bfb94c0bb15da3d047eb7029958 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Fri, 24 Sep 2010 10:43:04 -0300
Subject: [PATCH 0257/1129] Fix bug#385 - "Windows build error (MSVC Express
2008)"
---
libpyside/pyside.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/libpyside/pyside.cpp b/libpyside/pyside.cpp
index d466458..9b8c4cc 100644
--- a/libpyside/pyside.cpp
+++ b/libpyside/pyside.cpp
@@ -28,6 +28,7 @@
#include
#include
#include
+#include
#include
extern "C" void init_signal(PyObject* module);
From 3e0af488ee5820f35462f381c5a1676dc9560a5d Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Fri, 24 Sep 2010 15:34:20 -0300
Subject: [PATCH 0258/1129] Fix bug#168 - "API documentation suggestions" and
other fixes.
Reviewer: Luciano Wolf
Marcelo Lira
---
CMakeLists.txt | 10 +-
PySide/CMakeLists.txt | 18 +-
doc/CMakeLists.txt | 109 ++++--------
doc/pyside.qdocconf | 20 ---
doc/pyside.qdocconf.in | 352 ++++++++++++++++++++++++++++++++++++++
doc/typesystem_doc.xml.in | 89 ++++++++++
6 files changed, 497 insertions(+), 101 deletions(-)
delete mode 100644 doc/pyside.qdocconf
create mode 100644 doc/pyside.qdocconf.in
create mode 100644 doc/typesystem_doc.xml.in
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 47ab784..5c50500 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -179,6 +179,12 @@ enable_testing()
add_subdirectory(libpyside)
# project directories
-add_subdirectory(${BINDING_NAME})
+add_subdirectory(PySide)
add_subdirectory(tests)
-add_subdirectory(doc)
+
+find_program(DOT_EXEC dot)
+if (QT_SRC_DIR AND DOT_EXEC)
+ add_subdirectory(doc)
+else ()
+ message(STATUS "QT_SRC_DIR variable not set or graphviz not found, apidoc generation targets disabled.")
+endif()
diff --git a/PySide/CMakeLists.txt b/PySide/CMakeLists.txt
index 8769d3a..8a1f4d2 100644
--- a/PySide/CMakeLists.txt
+++ b/PySide/CMakeLists.txt
@@ -88,15 +88,12 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/global.h.in"
# Only add subdirectory if the associated Qt module is found.
macro(HAS_QT_MODULE var name)
-if (DISABLE_${name})
- message(STATUS "Generation of ${name} disabled.")
-else()
- if (${var})
+ if (NOT DISABLE_${name} AND ${var})
add_subdirectory(${name})
else()
- message(STATUS "${name} NOT found. ${name} support disabled.")
+ set("if_${name}" "" PARENT_SCOPE)
endif()
-endif()
endmacro()
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/__init__.py"
@@ -115,6 +112,9 @@ if (NOT QT_QTMULTIMEDIA_FOUND AND ${QTVERSION} VERSION_GREATER 4.5.9)
find_library(QT_QTMULTIMEDIA_LIBRARY QtMultimedia PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
if (QT_QTMULTIMEDIA_INCLUDE_DIR AND QT_QTMULTIMEDIA_LIBRARY)
set(QT_QTMULTIMEDIA_FOUND ON)
+ else()
+ set(if_QtMultimedia "" PARENT_SCOPE)
endif()
endif ()
@@ -129,6 +129,9 @@ if (NOT QT_QTMAEMO5_FOUND AND ${QTVERSION} VERSION_GREATER 4.5.9)
if (QT_QTMAEMO5_INCLUDE_DIR AND QT_QTMAEMO5_LIBRARY)
set(QT_QTMAEMO5_FOUND ON)
set(Q_WS_MAEMO_5 ON)
+ else()
+ set(if_Maemo5 "" PARENT_SCOPE)
endif()
endif ()
@@ -142,6 +145,9 @@ if (NOT QT_QTDECLARATIVE_FOUND AND ${QTVERSION} VERSION_GREATER 4.6.0)
find_library(QT_QTDECLARATIVE_LIBRARY QtDeclarative PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
if (QT_QTDECLARATIVE_INCLUDE_DIR AND QT_QTDECLARATIVE_LIBRARY)
set(QT_QTDECLARATIVE_FOUND ON)
+ else()
+ set(if_QtDeclarative "" PARENT_SCOPE)
endif()
endif ()
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index 92389b9..7b29ca6 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -1,91 +1,54 @@
-find_program(graphviz_exec dot)
+project(doc)
-if (QT_SRC_DIR)
+set(DOC_DATA_DIR "${CMAKE_CURRENT_BINARY_DIR}/qdoc3-output")
+configure_file("pyside.qdocconf.in" "pyside.qdocconf" @ONLY)
-if (NOT ${graphviz_exec} STREQUAL graphviz_exec-NOTFOUND)
+add_custom_target(qdoc3
+ COMMAND qdoc3 pyside.qdocconf
+ COMMENT "Running qdoc3 against Qt source code..."
+ SOURCE "pyside.qdocconf")
add_custom_target(apidoc
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/rst
- COMMAND sphinx-build -b html ${CMAKE_CURRENT_BINARY_DIR}/rst htmldocs
+ COMMAND sphinx-build -b html ${CMAKE_CURRENT_BINARY_DIR}/rst html
)
# create conf.py based on conf.py.in
configure_file("conf.py.in" "rst/conf.py" @ONLY)
+configure_file(typesystem_doc.xml.in typesystem_doc.xml @ONLY)
-# copy pyside.qdocconf to qt source dir.
-configure_file("pyside.qdocconf" "${QT_SRC_DIR}/tools/qdoc3/test/pyside.qdocconf" @ONLY)
-set(DOC_DATA_DIR "${CMAKE_CURRENT_BINARY_DIR}/qt4xmldoc")
-set(ENV{QTDIR} ${QT_SRC_DIR} )
-
-add_custom_target(qdoc3
- COMMAND QTDIR=${QT_SRC_DIR} qdoc3 pyside.qdocconf
- WORKING_DIRECTORY "${QT_SRC_DIR}/tools/qdoc3/test"
- COMMENT "Running qdoc3 against Qt source code..."
- SOURCE "pyside.qdocconf")
-
-macro(create_doc module typesystem_path)
-string(REGEX REPLACE "^Qt" "" module_name ${module})
-string(TOLOWER ${module_name} module_name)
-add_custom_target("${module}-apidoc"
-COMMAND ${GENERATORRUNNER_BINARY} --generatorSet=qtdoc
- ${pyside_BINARY_DIR}/global.h
- --include-paths=${QT_INCLUDE_DIR}:${QT_QTCORE_INCLUDE_DIR}
- --typesystem-paths=${pyside_SOURCE_DIR}:${${module}_BINARY_DIR}:${typesystem_path}
- ${pyside_SOURCE_DIR}/${module}/typesystem_${module_name}.xml
- --library-source-dir=${QT_SRC_DIR}
- --documentation-only
- --documentation-data-dir=${DOC_DATA_DIR}
- --documentation-out-dir=${CMAKE_CURRENT_BINARY_DIR}/rst
- --documentation-code-snippets-dir=${CMAKE_CURRENT_SOURCE_DIR}/codesnippets
-WORKING_DIRECTORY ${${module}_SOURCE_DIR}
-
-COMMENT "Running generator to generate documentation of ${module}..."
+add_custom_target("docrsts"
+ COMMAND ${GENERATORRUNNER_BINARY} --generatorSet=qtdoc
+ ${pyside_BINARY_DIR}/global.h
+ --include-paths="${QT_INCLUDE_DIR}${PATH_SEP}${QT_QTCORE_INCLUDE_DIR}"
+ --api-version=${SUPPORTED_QT_VERSION}
+ --typesystem-paths="${pyside_SOURCE_DIR}${PATH_SEP}${QtCore_SOURCE_DIR}${PATH_SEP}${QtDeclarative_SOURCE_DIR}${PATH_SEP}${QtGui_SOURCE_DIR}${PATH_SEP}${QtGui_BINARY_DIR}${PATH_SEP}${QtHelp_SOURCE_DIR}${PATH_SEP}${QtMaemo5_SOURCE_DIR}${PATH_SEP}${QtMultimedia_SOURCE_DIR}${PATH_SEP}${QtNetwork_SOURCE_DIR}${PATH_SEP}${QtOpenGL_SOURCE_DIR}${PATH_SEP}${QtScript_SOURCE_DIR}${PATH_SEP}${QtScriptTools_SOURCE_DIR}${PATH_SEP}${QtSql_SOURCE_DIR}${PATH_SEP}${QtSvg_SOURCE_DIR}${PATH_SEP}${QtTest_SOURCE_DIR}${PATH_SEP}${QtUiTools_SOURCE_DIR}${PATH_SEP}${QtWebKit_SOURCE_DIR}${PATH_SEP}${QtXml_SOURCE_DIR}${PATH_SEP}${QtXmlPatterns_SOURCE_DIR}"
+ --library-source-dir=${QT_SRC_DIR}
+ --documentation-only
+ --documentation-data-dir=${DOC_DATA_DIR}
+ --output-directory=${CMAKE_CURRENT_BINARY_DIR}/rst
+ --documentation-code-snippets-dir=${CMAKE_CURRENT_SOURCE_DIR}/codesnippets
+ ${CMAKE_CURRENT_BINARY_DIR}/typesystem_doc.xml
+ WORKING_DIRECTORY ${${module}_SOURCE_DIR}
+ COMMENT "Running generator to generate documentation..."
)
-add_dependencies("${module}-apidoc" qdoc3)
-add_dependencies(apidoc "${module}-apidoc")
-endmacro()
+add_dependencies(apidoc docrsts)
+add_dependencies(docrsts qdoc3)
-create_doc(QtCore "")
-create_doc(QtGui "${QtCore_SOURCE_DIR}")
-create_doc(QtHelp "${QtCore_SOURCE_DIR}:${QtGui_BINARY_DIR}:${QtGui_SOURCE_DIR}:${QtHelp_SOURCE_DIR}")
-create_doc(QtNetwork "${QtCore_SOURCE_DIR}")
-create_doc(QtOpengl "${QtCore_SOURCE_DIR}:${QtGui_BINARY_DIR}:${QtGui_SOURCE_DIR}:${QtOpenGL_SOURCE_DIR}")
-create_doc(QtSql "${QtCore_SOURCE_DIR}:${QtGui_BINARY_DIR}:${QtGui_SOURCE_DIR}:${QtSql_SOURCE_DIR}")
-create_doc(QtSvg "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtGui_BINARY_DIR}")
-create_doc(QtUitools "${QtCore_SOURCE_DIR}:${QtGui_BINARY_DIR}:${QtGui_SOURCE_DIR}:${QtXml_SOURCE_DIR}:${QtUiTools_SOURCE_DIR}")
-create_doc(QtXml "${QtCore_SOURCE_DIR}")
-create_doc(QtWebKit "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtGui_BINARY_DIR}:${QtNetwork_SOURCE_DIR}")
-create_doc(QtMultimedia "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtGui_BINARY_DIR}")
-create_doc(QtScript "${QtCore_SOURCE_DIR}")
-create_doc(QtScriptTools "${QtCore_SOURCE_DIR}:${QtScript_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtGui_BINARY_DIR}")
-create_doc(QtTest "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtGui_BINARY_DIR}")
-create_doc(QtXmlPatterns "${QtCore_SOURCE_DIR}")
-create_doc(phonon "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtGui_BINARY_DIR}")
-if (QT_QTDECLARATIVE_FOUND)
- create_doc(QtDeclarative "${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}:${QtGui_BINARY_DIR}:${QtNetwork_SOURCE_DIR}")
-endif()
-
-#create devhelp file
-add_custom_target(apidevhelp
- COMMAND python;${CMAKE_CURRENT_SOURCE_DIR}/pyhtml2devhelp.py;${CMAKE_BINARY_DIR}/apidoc/html;index.html >
- ${CMAKE_BINARY_DIR}/apidoc/html/PySide.devhelp;${BINDING_API_VERSION}&&;
- gzip;-9v;-f;${CMAKE_BINARY_DIR}/apidoc/html/PySide.devhelp
- COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_INSTALL_PREFIX}/share/devhelp/books"
- COMMAND ${CMAKE_COMMAND} -E create_symlink "${CMAKE_INSTALL_PREFIX}/share/doc/${BINDING_NAME}/html" "${CMAKE_INSTALL_PREFIX}/share/devhelp/books/${BINDING_NAME}"
-)
+# #create devhelp file
+# add_custom_target(apidevhelp
+# COMMAND python;${CMAKE_CURRENT_SOURCE_DIR}/pyhtml2devhelp.py;${CMAKE_BINARY_DIR}/apidoc/html;index.html >
+# ${CMAKE_BINARY_DIR}/apidoc/html/PySide.devhelp;${BINDING_API_VERSION}&&;
+# gzip;-9v;-f;${CMAKE_BINARY_DIR}/apidoc/html/PySide.devhelp
+# COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_INSTALL_PREFIX}/share/devhelp/books"
+# COMMAND ${CMAKE_COMMAND} -E create_symlink "${CMAKE_INSTALL_PREFIX}/share/doc/${BINDING_NAME}/html" "${CMAKE_INSTALL_PREFIX}/share/devhelp/books/${BINDING_NAME}"
+# )
#install files
add_custom_target(apidocinstall
- COMMAND mkdir -p ${CMAKE_INSTALL_PREFIX}/share/doc/${BINDING_NAME} && cp -rv ${CMAKE_BINARY_DIR}/apidoc/* ${CMAKE_INSTALL_PREFIX}/share/doc/${BINDING_NAME}
+ COMMAND mkdir -p ${CMAKE_INSTALL_PREFIX}/share/doc/PySide-${BINDING_API_VERSION} && cp -rv ${CMAKE_CURRENT_BINARY_DIR}/html/* ${CMAKE_INSTALL_PREFIX}/share/doc/PySide-${BINDING_API_VERSION}
)
-add_dependencies(apidocinstall apidevhelp)
-
-else ()
- message(STATUS "Missing graphviz tool (dot), apidoc generation targets disabled.")
-endif ()
-
-else ()
- message(STATUS "QT_SRC_DIR variable not set, apidoc generation targets disabled.")
-endif ()
+add_dependencies(apidocinstall apidoc)
+# add_dependencies(apidocinstall apidevhelp)
diff --git a/doc/pyside.qdocconf b/doc/pyside.qdocconf
deleted file mode 100644
index 1e940fa..0000000
--- a/doc/pyside.qdocconf
+++ /dev/null
@@ -1,20 +0,0 @@
-include(qt.qdocconf)
-
-quotinginformation = true
-exampledirs = $QTDIR/doc/src \
- $QTDIR/examples \
- $QTDIR/examples/tutorials \
- $QTDIR \
- $QTDIR/qmake/examples \
- $QTDIR/src/3rdparty/webkit/WebKit/qt/docs
-
-imagedirs = $QTDIR/doc/src/images \
- $QTDIR/examples \
- $QTDIR/doc/src/declarative/pics \
- $QTDIR/doc/src/template/image
-
-outputdir = @CMAKE_CURRENT_BINARY_DIR@/qt4xmldoc
-outputformats = WebXML
-
-generateindex = false
-url = .
diff --git a/doc/pyside.qdocconf.in b/doc/pyside.qdocconf.in
new file mode 100644
index 0000000..a9b0223
--- /dev/null
+++ b/doc/pyside.qdocconf.in
@@ -0,0 +1,352 @@
+######################## compat.qdocconf
+alias.i = e
+alias.include = input
+
+macro.0 = "\\\\0"
+macro.b = "\\\\b"
+macro.n = "\\\\n"
+macro.r = "\\\\r"
+macro.i = "\\o"
+macro.i11 = "\\o{1,1}"
+macro.i12 = "\\o{1,2}"
+macro.i13 = "\\o{1,3}"
+macro.i14 = "\\o{1,4}"
+macro.i15 = "\\o{1,5}"
+macro.i16 = "\\o{1,6}"
+macro.i17 = "\\o{1,7}"
+macro.i18 = "\\o{1,8}"
+macro.i19 = "\\o{1,9}"
+macro.i21 = "\\o{2,1}"
+macro.i31 = "\\o{3,1}"
+macro.i41 = "\\o{4,1}"
+macro.i51 = "\\o{5,1}"
+macro.i61 = "\\o{6,1}"
+macro.i71 = "\\o{7,1}"
+macro.i81 = "\\o{8,1}"
+macro.i91 = "\\o{9,1}"
+macro.img = "\\image"
+macro.endquote = "\\endquotation"
+macro.relatesto = "\\relates"
+
+spurious = "Missing comma in .*" \
+ "Missing pattern .*"
+
+######################## macros.qdocconf
+macro.aacute.HTML = "á"
+macro.Aring.HTML = "Å"
+macro.aring.HTML = "å"
+macro.Auml.HTML = "Ä"
+macro.author = "\\bold{Author:}"
+macro.br.HTML = "
"
+macro.BR.HTML = "
"
+macro.copyright.HTML = "©"
+macro.eacute.HTML = "é"
+macro.gui = "\\bold"
+macro.hr.HTML = "
"
+macro.iacute.HTML = "í"
+macro.key = "\\bold"
+macro.menu = "\\bold"
+macro.note = "\\bold{Note:}"
+macro.oslash.HTML = "ø"
+macro.ouml.HTML = "ö"
+macro.QA = "\\e{Qt Assistant}"
+macro.QD = "\\e{Qt Designer}"
+macro.QL = "\\e{Qt Linguist}"
+macro.param = "\\e"
+macro.raisedaster.HTML = "*"
+macro.rarrow.HTML = "→"
+macro.reg.HTML = "®"
+macro.return = "Returns"
+macro.starslash = "\\c{*/}"
+macro.begincomment = "\\c{/*}"
+macro.endcomment = "\\c{*/}"
+macro.uuml.HTML = "ü"
+macro.mdash.HTML = "—"
+
+macro.beginfloatleft.HTML = ""
+macro.beginfloatright.HTML = "
"
+macro.endfloat.HTML = "
"
+macro.clearfloat.HTML = "
"
+
+######################## qt-cpp-ignore.qdocconf
+Cpp.ignoretokens = QAXFACTORY_EXPORT \
+ QDESIGNER_COMPONENTS_LIBRARY \
+ QDESIGNER_EXTENSION_LIBRARY \
+ QDESIGNER_SDK_LIBRARY \
+ QDESIGNER_SHARED_LIBRARY \
+ QDESIGNER_UILIB_LIBRARY \
+ QM_EXPORT_CANVAS \
+ QM_EXPORT_DNS \
+ QM_EXPORT_DOM \
+ QM_EXPORT_FTP \
+ QM_EXPORT_HTTP \
+ QM_EXPORT_ICONVIEW \
+ QM_EXPORT_NETWORK \
+ QM_EXPORT_OPENGL \
+ QM_EXPORT_OPENVG \
+ QM_EXPORT_SQL \
+ QM_EXPORT_TABLE \
+ QM_EXPORT_WORKSPACE \
+ QM_EXPORT_XML \
+ QT_ASCII_CAST_WARN \
+ QT_ASCII_CAST_WARN_CONSTRUCTOR \
+ QT_BEGIN_HEADER \
+ QT_DESIGNER_STATIC \
+ QT_END_HEADER \
+ QT_FASTCALL \
+ QT_WIDGET_PLUGIN_EXPORT \
+ Q_COMPAT_EXPORT \
+ Q_CORE_EXPORT \
+ Q_CORE_EXPORT_INLINE \
+ Q_EXPLICIT \
+ Q_EXPORT \
+ Q_EXPORT_CODECS_CN \
+ Q_EXPORT_CODECS_JP \
+ Q_EXPORT_CODECS_KR \
+ Q_EXPORT_PLUGIN \
+ Q_GFX_INLINE \
+ Q_AUTOTEST_EXPORT \
+ Q_GUI_EXPORT \
+ Q_GUI_EXPORT_INLINE \
+ Q_GUI_EXPORT_STYLE_CDE \
+ Q_GUI_EXPORT_STYLE_COMPACT \
+ Q_GUI_EXPORT_STYLE_MAC \
+ Q_GUI_EXPORT_STYLE_MOTIF \
+ Q_GUI_EXPORT_STYLE_MOTIFPLUS \
+ Q_GUI_EXPORT_STYLE_PLATINUM \
+ Q_GUI_EXPORT_STYLE_POCKETPC \
+ Q_GUI_EXPORT_STYLE_SGI \
+ Q_GUI_EXPORT_STYLE_WINDOWS \
+ Q_GUI_EXPORT_STYLE_WINDOWSXP \
+ QHELP_EXPORT \
+ Q_INLINE_TEMPLATE \
+ Q_INTERNAL_WIN_NO_THROW \
+ Q_NETWORK_EXPORT \
+ Q_OPENGL_EXPORT \
+ Q_OPENVG_EXPORT \
+ Q_OUTOFLINE_TEMPLATE \
+ Q_SQL_EXPORT \
+ Q_SVG_EXPORT \
+ Q_SCRIPT_EXPORT \
+ Q_SCRIPTTOOLS_EXPORT \
+ Q_TESTLIB_EXPORT \
+ Q_TYPENAME \
+ Q_XML_EXPORT \
+ Q_XMLSTREAM_EXPORT \
+ Q_XMLPATTERNS_EXPORT \
+ QDBUS_EXPORT \
+ QT_BEGIN_NAMESPACE \
+ QT_BEGIN_INCLUDE_NAMESPACE \
+ QT_END_NAMESPACE \
+ QT_END_INCLUDE_NAMESPACE \
+ PHONON_EXPORT \
+ Q_DECLARATIVE_EXPORT \
+ Q_GADGET \
+ QWEBKIT_EXPORT
+Cpp.ignoredirectives = Q_DECLARE_HANDLE \
+ Q_DECLARE_INTERFACE \
+ Q_DECLARE_METATYPE \
+ Q_DECLARE_OPERATORS_FOR_FLAGS \
+ Q_DECLARE_PRIVATE \
+ Q_DECLARE_PUBLIC \
+ Q_DECLARE_SHARED \
+ Q_DECLARE_TR_FUNCTIONS \
+ Q_DECLARE_TYPEINFO \
+ Q_DISABLE_COPY \
+ QT_FORWARD_DECLARE_CLASS \
+ Q_DUMMY_COMPARISON_OPERATOR \
+ Q_ENUMS \
+ Q_FLAGS \
+ Q_INTERFACES \
+ __attribute__ \
+ K_DECLARE_PRIVATE \
+ PHONON_OBJECT \
+ PHONON_HEIR
+
+######################## qt-html-templates.qdocconf
+HTML.stylesheets = classic.css
+HTML.postheader = "
\n" \
+ "\n" \
+ "" \
+ " " \
+ " | \n" \
+ " | " \
+ "" \
+ "
"
+
+HTML.footer = "
\n" \
+ "
\n" \
+ "| Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies) | \n" \
+ "Trademarks | \n" \
+ "Qt \\version | \n" \
+ "
"
+
+######################## qt-defines.qdocconf
+defines = Q_QDOC \
+ QT_.*_SUPPORT \
+ QT_.*_LIB \
+ QT_COMPAT \
+ QT_KEYPAD_NAVIGATION \
+ QT3_SUPPORT \
+ Q_WS_.* \
+ Q_OS_.* \
+ Q_BYTE_ORDER \
+ QT_DEPRECATED \
+ Q_NO_USING_KEYWORD \
+ __cplusplus
+
+versionsym = QT_VERSION_STR
+
+codeindent = 1
+
+# Files not referenced in any qdoc file (last four needed by qtdemo)
+# See also qhp.Qt.extraFiles
+extraimages.HTML = qt-logo \
+ trolltech-logo \
+ taskmenuextension-example.png \
+ coloreditorfactoryimage.png \
+ dynamiclayouts-example.png \
+ stylesheet-coffee-plastique.png
+
+######################## qt.qdocconf
+
+project = Qt
+versionsym =
+version = %VERSION%
+description = Qt Reference Documentation
+url = http://qt.nokia.com/doc/@PYSIDE_QT_VERSION@
+
+edition.Desktop.modules = QtCore QtDBus QtGui QtNetwork QtOpenGL QtScript QtScriptTools QtSql QtSvg \
+ QtWebKit QtXml QtXmlPatterns Qt3Support QtHelp \
+ QtDesigner QtAssistant QAxContainer Phonon \
+ QAxServer QtUiTools QtTest QtDBus
+edition.DesktopLight.modules = QtCore QtDBus QtGui Qt3SupportLight QtTest
+edition.DesktopLight.groups = -graphicsview-api
+
+qhp.projects = Qt
+
+qhp.Qt.file = qt.qhp
+qhp.Qt.namespace = com.trolltech.qt.460
+qhp.Qt.virtualFolder = qdoc
+qhp.Qt.indexTitle = Qt Reference Documentation
+qhp.Qt.indexRoot =
+
+# Files not referenced in any qdoc file (last four are needed by qtdemo)
+# See also extraimages.HTML
+qhp.Qt.extraFiles = classic.css \
+ images/qt-logo.png \
+ images/taskmenuextension-example.png \
+ images/coloreditorfactoryimage.png \
+ images/dynamiclayouts-example.png \
+ images/stylesheet-coffee-plastique.png
+
+qhp.Qt.filterAttributes = qt @PYSIDE_QT_VERSION@ qtrefdoc
+qhp.Qt.customFilters.Qt.name = Qt @PYSIDE_QT_VERSION@
+qhp.Qt.customFilters.Qt.filterAttributes = qt @PYSIDE_QT_VERSION@
+qhp.Qt.subprojects = classes overviews examples
+qhp.Qt.subprojects.classes.title = Classes
+qhp.Qt.subprojects.classes.indexTitle = Qt's Classes
+qhp.Qt.subprojects.classes.selectors = class fake:headerfile
+qhp.Qt.subprojects.classes.sortPages = true
+qhp.Qt.subprojects.overviews.title = Overviews
+qhp.Qt.subprojects.overviews.indexTitle = All Overviews and HOWTOs
+qhp.Qt.subprojects.overviews.selectors = fake:page,group,module
+qhp.Qt.subprojects.examples.title = Tutorials and Examples
+qhp.Qt.subprojects.examples.indexTitle = Qt Examples
+qhp.Qt.subprojects.examples.selectors = fake:example
+
+language = Cpp
+
+headerdirs = @QT_SRC_DIR@/src \
+ @QT_SRC_DIR@/extensions/activeqt \
+ @QT_SRC_DIR@/tools/assistant/lib \
+ @QT_SRC_DIR@/tools/assistant/compat/lib \
+ @QT_SRC_DIR@/tools/designer/src/uitools \
+ @QT_SRC_DIR@/tools/designer/src/lib/extension \
+ @QT_SRC_DIR@/tools/designer/src/lib/sdk \
+ @QT_SRC_DIR@/tools/designer/src/lib/uilib \
+ @QT_SRC_DIR@/tools/qtestlib/src \
+ @QT_SRC_DIR@/tools/qdbus/src
+sourcedirs = @QT_SRC_DIR@/src \
+ @QT_SRC_DIR@/doc/src \
+ @QT_SRC_DIR@/extensions/activeqt \
+ @QT_SRC_DIR@/tools/assistant/lib \
+ @QT_SRC_DIR@/tools/assistant/compat/lib \
+ @QT_SRC_DIR@/tools/designer/src/uitools \
+ @QT_SRC_DIR@/tools/designer/src/lib/extension \
+ @QT_SRC_DIR@/tools/designer/src/lib/sdk \
+ @QT_SRC_DIR@/tools/designer/src/lib/uilib \
+ @QT_SRC_DIR@/tools/qtestlib/src \
+ @QT_SRC_DIR@/tools/qdbus
+
+excludedirs = @QT_SRC_DIR@/src/3rdparty/clucene \
+ @QT_SRC_DIR@/src/3rdparty/des \
+ @QT_SRC_DIR@/src/3rdparty/freetype \
+ @QT_SRC_DIR@/src/3rdparty/harfbuzz \
+ @QT_SRC_DIR@/src/3rdparty/kdebase \
+ @QT_SRC_DIR@/src/3rdparty/libjpeg \
+ @QT_SRC_DIR@/src/3rdparty/libmng \
+ @QT_SRC_DIR@/src/3rdparty/libpng \
+ @QT_SRC_DIR@/src/3rdparty/libtiff \
+ @QT_SRC_DIR@/src/3rdparty/md4 \
+ @QT_SRC_DIR@/src/3rdparty/md5 \
+ @QT_SRC_DIR@/src/3rdparty/patches \
+ @QT_SRC_DIR@/src/3rdparty/sha1 \
+ @QT_SRC_DIR@/src/3rdparty/sqlite \
+ @QT_SRC_DIR@/src/3rdparty/webkit/JavaScriptCore \
+ @QT_SRC_DIR@/src/3rdparty/webkit/WebCore \
+ @QT_SRC_DIR@/src/3rdparty/wintab \
+ @QT_SRC_DIR@/src/3rdparty/zlib \
+ @QT_SRC_DIR@/doc/src/snippets \
+ @QT_SRC_DIR@/src/3rdparty/phonon/gstreamer \
+ @QT_SRC_DIR@/src/3rdparty/phonon/ds9 \
+ @QT_SRC_DIR@/src/3rdparty/phonon/qt7 \
+ @QT_SRC_DIR@/src/3rdparty/phonon/mmf \
+ @QT_SRC_DIR@/src/3rdparty/phonon/waveout
+
+sources.fileextensions = "*.cpp *.qdoc *.mm"
+examples.fileextensions = "*.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp"
+examples.imageextensions = "*.png"
+
+exampledirs = @QT_SRC_DIR@/doc/src \
+ @QT_SRC_DIR@/examples \
+ @QT_SRC_DIR@/examples/tutorials \
+ @QT_SRC_DIR@ \
+ @QT_SRC_DIR@/qmake/examples \
+ @QT_SRC_DIR@/src/3rdparty/webkit/WebKit/qt/docs
+imagedirs = @QT_SRC_DIR@/doc/src/images \
+ @QT_SRC_DIR@/examples
+outputdir = @QT_SRC_DIR@/doc/html
+tagfile = @QT_SRC_DIR@/doc/html/qt.tags
+base = file:@QT_SRC_DIR@/doc/html
+
+HTML.generatemacrefs = "true"
+
+######################## pyside.qdocconf
+quotinginformation = true
+exampledirs = @QT_SRC_DIR@/doc/src \
+ @QT_SRC_DIR@/examples \
+ @QT_SRC_DIR@/examples/tutorials \
+ @QT_SRC_DIR@ \
+ @QT_SRC_DIR@/qmake/examples \
+ @QT_SRC_DIR@/src/3rdparty/webkit/WebKit/qt/docs
+
+imagedirs = @QT_SRC_DIR@/doc/src/images \
+ @QT_SRC_DIR@/examples \
+ @QT_SRC_DIR@/doc/src/declarative/pics \
+ @QT_SRC_DIR@/doc/src/template/image
+
+outputdir = @DOC_DATA_DIR@
+outputformats = WebXML
+
+generateindex = false
+url = .
diff --git a/doc/typesystem_doc.xml.in b/doc/typesystem_doc.xml.in
new file mode 100644
index 0000000..eaf5178
--- /dev/null
+++ b/doc/typesystem_doc.xml.in
@@ -0,0 +1,89 @@
+
+
+
+
+
+
+
+ @if_QtDeclarative@
+
+ @end_QtDeclarative@
+
+ @if_QtGui@
+
+ @end_QtGui@
+
+ @if_QtHelp@
+
+ @end_QtHelp@
+
+ @if_Maemo5@
+
+ @end_Maemo5@
+
+ @if_Multimedia@
+
+ @end_Multimedia@
+
+ @if_QtNetwork@
+
+ @end_QtNetwork@
+
+ @if_QtOpenGL@
+
+ @end_QtOpenGL@
+
+ @if_QtScript@
+
+ @end_QtScript@
+
+ @if_QtScriptTools@
+
+ @end_QtScriptTools@
+
+ @if_QtSql@
+
+ @end_QtSql@
+
+ @if_QtSvg@
+
+ @end_QtSvg@
+
+ @if_QtTest@
+
+ @end_QtTest@
+
+ @if_QtUiTools@
+
+ @end_QtUiTools@
+
+ @if_QtWebKit@
+
+ @end_QtWebKit@
+
+ @if_QtXml@
+
+ @end_QtXml@
+
+ @if_QtXmlPatterns@
+
+ @end_QtXmlPatterns@
+
\ No newline at end of file
From 88fd0c6e0bca1cf0a25a80ba367e6ee3d59b1862 Mon Sep 17 00:00:00 2001
From: renatofilho
Date: Thu, 23 Sep 2010 11:47:34 -0300
Subject: [PATCH 0259/1129] Fixed QVariant::Type convertions.
Fixed QItemEditorFactory ownership rules on typesystem.
Fixes bug #373.
Reviewer: Hugo Parente Lima
Luciano Wolf
---
PySide/QtCore/qvariant_type_conversions.h | 8 ++++++--
PySide/QtGui/typesystem_gui_common.xml | 4 ++--
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/PySide/QtCore/qvariant_type_conversions.h b/PySide/QtCore/qvariant_type_conversions.h
index d1cf9f0..e5384cd 100644
--- a/PySide/QtCore/qvariant_type_conversions.h
+++ b/PySide/QtCore/qvariant_type_conversions.h
@@ -25,8 +25,12 @@ struct Converter
typeName = "double"; // float is a UserType in QVariant.
else if (pyObj == reinterpret_cast(&PyLong_Type))
typeName = "int"; // long is a UserType in QVariant.
- else if (PyType_Check(pyObj))
- typeName = reinterpret_cast(pyObj)->tp_name;
+ else if (PyType_Check(pyObj)) {
+ if (pyObj->ob_type == &Shiboken::SbkBaseWrapperType_Type)
+ typeName = reinterpret_cast(pyObj)->original_name;
+ else
+ typeName = reinterpret_cast(pyObj)->tp_name;
+ }
else if (PyString_Check(pyObj))
typeName = PyString_AS_STRING(pyObj);
else if (PyUnicode_Check(pyObj))
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index 76afecc..4581e1f 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -1550,12 +1550,12 @@
-
+
-
+
From 2bd1bab4bb37b44e5ffc94e284e67d7cfe4ce9ff Mon Sep 17 00:00:00 2001
From: renatofilho
Date: Fri, 24 Sep 2010 15:55:20 -0300
Subject: [PATCH 0260/1129] Fixed unit test to avoid put a object child of
QApplication.
This will cause assert on debug mode. Because qApp is dever destroyed.
Reviewer: Hugo Parente Lima
Luciano Wolf
---
tests/QtGui/keep_reference_test.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/QtGui/keep_reference_test.py b/tests/QtGui/keep_reference_test.py
index 310361a..47c7a59 100644
--- a/tests/QtGui/keep_reference_test.py
+++ b/tests/QtGui/keep_reference_test.py
@@ -28,7 +28,7 @@ class KeepReferenceTest(UsesQApplication):
def testModelWithParent(self):
view = QTableView()
- model = TestModel(self.app)
+ model = TestModel(None)
view.setModel(model)
samemodel = view.model()
self.assertEqual(model, samemodel)
From 6320bfa4fa3428d05785edc433ff9740799c938f Mon Sep 17 00:00:00 2001
From: renatofilho
Date: Fri, 24 Sep 2010 15:58:00 -0300
Subject: [PATCH 0261/1129] Fixed QCoreApplication and QApplication cleanup.
Reviewer: Hugo Parente Lima
Luciano Wolf
---
PySide/QtCore/glue/qcoreapplication_init.cpp | 3 +--
PySide/QtGui/glue/qapplication_init.cpp | 7 ++-----
2 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/PySide/QtCore/glue/qcoreapplication_init.cpp b/PySide/QtCore/glue/qcoreapplication_init.cpp
index 14ccbb8..461757c 100644
--- a/PySide/QtCore/glue/qcoreapplication_init.cpp
+++ b/PySide/QtCore/glue/qcoreapplication_init.cpp
@@ -10,10 +10,9 @@ void DeleteQCoreApplicationAtExit()
QCoreApplication *cpp = QCoreApplication::instance();
if (cpp) {
Shiboken::BindingManager &bmngr = Shiboken::BindingManager::instance();
- PyObject* pySelf = bmngr.retrieveWrapper(cpp);
cpp->flush();
QCoreApplication::processEvents();
- bmngr.invalidateWrapper(pySelf);
+ bmngr.destroyWrapper(cpp);
delete cpp;
}
}
diff --git a/PySide/QtGui/glue/qapplication_init.cpp b/PySide/QtGui/glue/qapplication_init.cpp
index 208d59a..246e5d1 100644
--- a/PySide/QtGui/glue/qapplication_init.cpp
+++ b/PySide/QtGui/glue/qapplication_init.cpp
@@ -15,18 +15,15 @@ void DeleteQApplicationAtExit()
// Delete all widgets, this is slow but is necessary to avoid problems with python object
foreach(QWidget* w, QApplication::allWidgets()) {
- PyObject* pySelf = bmngr.retrieveWrapper(w);
-
w->deleteLater();
//Make sure all events will send before invalidated the python object
QApplication::processEvents();
- bmngr.invalidateWrapper(pySelf);
+ bmngr.destroyWrapper(w);
}
- PyObject* pySelf = bmngr.retrieveWrapper(cpp);
cpp->deleteLater();
QApplication::processEvents();
- bmngr.invalidateWrapper(pySelf);
+ bmngr.destroyWrapper(cpp);
}
}
From 805824d4b637a240f5f26bde1f09d11780551950 Mon Sep 17 00:00:00 2001
From: renatofilho
Date: Fri, 24 Sep 2010 15:58:43 -0300
Subject: [PATCH 0262/1129] Fixed model view ownership rules.
Reviewer: Hugo Parente Lima
Luciano Wolf
---
PySide/QtCore/typesystem_core.xml | 10 ++--
PySide/QtGui/typesystem_gui_common.xml | 75 +++++++++++---------------
2 files changed, 35 insertions(+), 50 deletions(-)
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 92a154c..0df47a9 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -1717,7 +1717,7 @@
%3)
);
// invalidate to avoid use of python object
- Shiboken::BindingManager::instance().invalidateWrapper((Shiboken::SbkBaseWrapper *)pyTimer);
+ Shiboken::BindingManager::instance().destroyWrapper((Shiboken::SbkBaseWrapper *)pyTimer);
timer->setSingleShot(true);
timer->connect(timer, SIGNAL("timeout()"), timer, SLOT("deleteLater()"));
timer->start(%1);
@@ -1741,7 +1741,7 @@
SIGNAL(timeout()),
pyargs[1])
);
- Shiboken::BindingManager::instance().invalidateWrapper((Shiboken::SbkBaseWrapper *)pyTimer);
+ Shiboken::BindingManager::instance().destroyWrapper((Shiboken::SbkBaseWrapper *)pyTimer);
timer->start(%1);
@@ -1769,7 +1769,7 @@
signalInstance->source,
signalSignature.object())
);
- Shiboken::BindingManager::instance().invalidateWrapper((Shiboken::SbkBaseWrapper *)pyTimer);
+ Shiboken::BindingManager::instance().destroyWrapper((Shiboken::SbkBaseWrapper *)pyTimer);
timer->start(%1);
@@ -2288,13 +2288,13 @@
-
+
-
+
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index 4581e1f..81e0a33 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -1216,6 +1216,16 @@
+
+
+
+
+
+
+
+
+
+
@@ -2145,17 +2146,6 @@
-
-
-
-
-
-
-
-
-
-
-
@@ -3971,11 +3961,6 @@
-
-
-
-
-
From 41bd89393e3203c027cb659771e390a7101c5fc4 Mon Sep 17 00:00:00 2001
From: renatofilho
Date: Fri, 24 Sep 2010 15:59:11 -0300
Subject: [PATCH 0263/1129] Inlcluded assert to avoid call objectcts metacall
whithout Python relatives.
Reviewer: Hugo Parente Lima
Luciano Wolf
---
libpyside/signalmanager.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/libpyside/signalmanager.cpp b/libpyside/signalmanager.cpp
index 3724500..b8e97f9 100644
--- a/libpyside/signalmanager.cpp
+++ b/libpyside/signalmanager.cpp
@@ -355,6 +355,7 @@ int SignalManager::qt_metacall(QObject* object, QMetaObject::Call call, int id,
QMetaProperty mp;
Shiboken::TypeResolver* typeResolver = 0;
PyObject* pySelf = Shiboken::BindingManager::instance().retrieveWrapper(object);
+ Q_ASSERT(pySelf);
if (call != QMetaObject::InvokeMetaMethod) {
mp = metaObject->property(id);
From 51d9d503cd847b5677d7bf438df2f754119f0400 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Mon, 27 Sep 2010 15:17:12 -0300
Subject: [PATCH 0264/1129] Add return value docs to functions returning
tuples.
---
PySide/QtCore/typesystem_core.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 0df47a9..0eafbb1 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -706,7 +706,7 @@
-->
-
+
@@ -727,7 +727,7 @@
-
+
int year, month, day;
From 199b8b3baee2e3297413636a63ca09abe6aac39a Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Mon, 27 Sep 2010 16:14:53 -0300
Subject: [PATCH 0265/1129] Fix bug#375 - "Just an empty table when using
delegate."
Reviewer: Luciano Wolf
Marcelo Lira
---
PySide/QtGui/typesystem_gui_common.xml | 31 +++++++++++++++-----------
1 file changed, 18 insertions(+), 13 deletions(-)
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index 81e0a33..4ba84e6 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -1226,6 +1226,11 @@
+
+
+
+
+
@@ -430,14 +428,12 @@
-
-
@@ -2228,9 +2224,8 @@
-
+
-
@@ -2597,7 +2592,11 @@
+
+
+
+
diff --git a/PySide/QtGui/CMakeLists.txt b/PySide/QtGui/CMakeLists.txt
index 9d50294..85c61b9 100644
--- a/PySide/QtGui/CMakeLists.txt
+++ b/PySide/QtGui/CMakeLists.txt
@@ -3,6 +3,8 @@ project(QtGui)
if(ENABLE_X11)
set(SPECIFIC_OS_FILES
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qx11info_wrapper.cpp
+ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qx11embedcontainer_wrapper.cpp
+ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qx11embedwidget_wrapper.cpp
)
if(Q_WS_MAEMO_5)
@@ -28,6 +30,7 @@ else()
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qmatrix4x3_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qmatrix4x4_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgesture_wrapper.cpp
+ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgestureevent_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgesturerecognizer_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgraphicsanchor_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgraphicsanchorlayout_wrapper.cpp
@@ -46,6 +49,8 @@ else()
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qpinchgesture_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qquaternion_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qswipegesture_wrapper.cpp
+ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtapandholdgesture_wrapper.cpp
+ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtapgesture_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtilerules_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtouchevent_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtouchevent_touchpoint_wrapper.cpp
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index 4ba84e6..6e1ef31 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -2333,6 +2333,33 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -4849,6 +4876,8 @@
+
+
@@ -4912,7 +4941,7 @@
-
+
diff --git a/PySide/QtGui/typesystem_gui_x11.xml b/PySide/QtGui/typesystem_gui_x11.xml
index 0fd3628..920b6a2 100644
--- a/PySide/QtGui/typesystem_gui_x11.xml
+++ b/PySide/QtGui/typesystem_gui_x11.xml
@@ -26,6 +26,12 @@
-
+
+
+
+
+
+
+
diff --git a/PySide/global.h.in b/PySide/global.h.in
index 7266fe1..0e76e46 100644
--- a/PySide/global.h.in
+++ b/PySide/global.h.in
@@ -337,6 +337,8 @@ QT_END_HEADER
#include "qpytextobject.h"
#if @ENABLE_X11@
#include
+ #include
+ #include
#endif
#include
#include
From 6ad03f2a795563aec47d45d6426639323f981975 Mon Sep 17 00:00:00 2001
From: renatofilho
Date: Wed, 29 Sep 2010 11:15:42 -0300
Subject: [PATCH 0269/1129] Added support on script to compare symbols in both
Qt bindings (PySide/PyQt4)
Reviewer: Luciano Wolf
Marcelo Lira
---
tests/tools/list-class-hierarchy.py | 78 +++++++++++++++++------------
1 file changed, 45 insertions(+), 33 deletions(-)
diff --git a/tests/tools/list-class-hierarchy.py b/tests/tools/list-class-hierarchy.py
index 381efee..a4faf60 100755
--- a/tests/tools/list-class-hierarchy.py
+++ b/tests/tools/list-class-hierarchy.py
@@ -44,6 +44,7 @@ ignore = ["staticMetaObject",
def recurse_into(el,obj):
#s = el.split('.')[-1]
#pdb.set_trace()
+ symbols = []
for item in sorted(dir(obj)):
if item[0]=='_':
continue
@@ -52,44 +53,55 @@ def recurse_into(el,obj):
mobj = eval(mel)
except Exception:
continue
+
if item in ignore:
continue
- print mel
+ else:
+ symbols.append(mel)
+
if isclass(mobj):
- recurse_into(mel,mobj)
+ symbols += recurse_into(mel,mobj)
+
+ return symbols
if __name__=='__main__':
- top = sys.argv[1]
+ modules = [ 'QtCore',
+ 'QtGui',
+ 'QtHelp',
+ #'QtMultimedia',
+ 'QtNetwork',
+ 'QtOpenGL',
+ 'QtScript',
+ 'QtScriptTools',
+ 'QtSql',
+ 'QtSvg',
+ 'QtTest',
+ #'QtUiTools',
+ 'QtWebKit',
+ 'QtXml',
+ 'QtXmlPatterns' ]
- if top=="PyQt4":
- import sip
- sip.setapi('QDate',2)
- sip.setapi('QDateTime',2)
- sip.setapi('QString',2)
- sip.setapi('QTextStream',2)
- sip.setapi('QTime',2)
- sip.setapi('QUrl',2)
- sip.setapi('QVariant',2)
+ libraries = ["PySide", "PyQt4"]
+ librarySymbols = {}
+ for l in libraries:
+ dictionary = []
+ if l =="PyQt4":
+ import sip
+ sip.setapi('QDate',2)
+ sip.setapi('QDateTime',2)
+ sip.setapi('QString',2)
+ sip.setapi('QTextStream',2)
+ sip.setapi('QTime',2)
+ sip.setapi('QUrl',2)
+ sip.setapi('QVariant',2)
- if len(sys.argv)>2:
- modules = sys.argv[2:]
- else:
- modules = [ 'QtCore',
- 'QtGui',
- 'QtHelp',
- #'QtMultimedia',
- 'QtNetwork',
- 'QtOpenGL',
- 'QtScript',
- 'QtScriptTools',
- 'QtSql',
- 'QtSvg',
- 'QtTest',
- #'QtUiTools',
- 'QtWebKit',
- 'QtXml',
- 'QtXmlPatterns' ]
+ for m in modules:
+ exec "from %s import %s" % (l,m) in globals(), locals()
+ dictionary += recurse_into(m, eval(m))
+ librarySymbols[l] = dictionary
- for m in modules:
- exec "from %s import %s" % (top,m) in globals(), locals()
- recurse_into(m,eval(m))
+ print "PyQt4: ", len(librarySymbols["PyQt4"]), " PySide: ", len(librarySymbols["PySide"])
+
+ for symbol in librarySymbols["PyQt4"]:
+ if not (symbol in librarySymbols["PySide"]):
+ print "Symbol not found in PySide:", symbol
From eabb9d37a78d1c584fe7e70928f0e820bd6e0afc Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Tue, 28 Sep 2010 18:07:02 -0300
Subject: [PATCH 0270/1129] Fix bug#372 - "DiagramScene (GraphicsView) Example
not working"
The correct title would be "QVariant doesn't correct store a QGraphicsScene object."
---
PySide/QtCore/qvariant_conversions.h | 5 +----
tests/QtGui/CMakeLists.txt | 1 +
tests/QtGui/qvariant_test.py | 23 +++++++++++++++++++++++
3 files changed, 25 insertions(+), 4 deletions(-)
create mode 100644 tests/QtGui/qvariant_test.py
diff --git a/PySide/QtCore/qvariant_conversions.h b/PySide/QtCore/qvariant_conversions.h
index 06a8368..fc2dca5 100644
--- a/PySide/QtCore/qvariant_conversions.h
+++ b/PySide/QtCore/qvariant_conversions.h
@@ -47,9 +47,6 @@ struct Converter
return convertToVariantMap(pyObj);
} else if (PySequence_Check(pyObj)) {
return convertToVariantList(pyObj);
- } else if (!isShibokenType(pyObj) || isUserType(pyObj)) {
- // QVariant(User class)
- return QVariant::fromValue(pyObj);
} else {
// a class supported by QVariant?
if (Shiboken::isShibokenType(pyObj)) {
@@ -60,7 +57,7 @@ struct Converter
void** data = reinterpret_cast(pyObj)->cptr;
if (typeName[strlen(typeName)-1] == '*')
return QVariant(typeCode, data);
- else
+ else if (!isUserType(pyObj)) // User types inherited from Value types *should* not be converted.
return QVariant(typeCode, data[0]);
}
}
diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt
index 9b928ac..a26c1f6 100644
--- a/tests/QtGui/CMakeLists.txt
+++ b/tests/QtGui/CMakeLists.txt
@@ -61,6 +61,7 @@ PYSIDE_TEST(qtextedit_test.py)
PYSIDE_TEST(qtextedit_signal_test.py)
PYSIDE_TEST(qtoolbar_test.py)
PYSIDE_TEST(qtoolbox_test.py)
+PYSIDE_TEST(qvariant_test.py)
PYSIDE_TEST(qwidget_setlayout_test.py)
PYSIDE_TEST(qwidget_test.py)
PYSIDE_TEST(reference_count_test.py)
diff --git a/tests/QtGui/qvariant_test.py b/tests/QtGui/qvariant_test.py
new file mode 100644
index 0000000..faa755a
--- /dev/null
+++ b/tests/QtGui/qvariant_test.py
@@ -0,0 +1,23 @@
+
+import unittest
+from PySide.QtCore import *
+from PySide.QtGui import *
+
+class MyDiagram(QGraphicsScene):
+ pass
+
+class MyItem(QGraphicsRectItem):
+ def itemChange(self, change, value):
+ return value;
+
+class QGraphicsSceneOnQVariantTest(unittest.TestCase):
+ """Test storage ot QGraphicsScene into QVariants"""
+ def testIt(self):
+ app = QApplication([])
+ s = MyDiagram()
+ i = MyItem()
+ s.addItem(i)
+ self.assertEqual(len(s.items()), 1)
+
+if __name__ == '__main__':
+ unittest.main()
From 169d0f8147316f9c1b287953f03113dca997a37b Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Tue, 28 Sep 2010 18:24:11 -0300
Subject: [PATCH 0271/1129] Add test to check iterability of QPolygonF.
---
tests/QtGui/CMakeLists.txt | 1 +
tests/QtGui/qpolygonf_test.py | 22 ++++++++++++++++++++++
2 files changed, 23 insertions(+)
create mode 100644 tests/QtGui/qpolygonf_test.py
diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt
index a26c1f6..c8db7a2 100644
--- a/tests/QtGui/CMakeLists.txt
+++ b/tests/QtGui/CMakeLists.txt
@@ -48,6 +48,7 @@ PYSIDE_TEST(qobject_mi_test.py)
PYSIDE_TEST(qpainter_test.py)
PYSIDE_TEST(qpen_test.py)
PYSIDE_TEST(qpixmap_test.py)
+PYSIDE_TEST(qpolygonf_test.py)
PYSIDE_TEST(qpushbutton_test.py)
PYSIDE_TEST(qradialgradient_test.py)
PYSIDE_TEST(qregion_test.py)
diff --git a/tests/QtGui/qpolygonf_test.py b/tests/QtGui/qpolygonf_test.py
new file mode 100644
index 0000000..83e643c
--- /dev/null
+++ b/tests/QtGui/qpolygonf_test.py
@@ -0,0 +1,22 @@
+
+import unittest
+from PySide.QtCore import *
+from PySide.QtGui import *
+
+class QPolygonFNotIterableTest(unittest.TestCase):
+ """Test if a QPolygonF is iterable"""
+ def testIt(self):
+ p = QPolygonF(4)
+ self.assertEqual(len(p), 4)
+
+ for i in range(0, 4):
+ p[i] = QPointF(float(i), float(i))
+
+ i = 0
+ for point in p:
+ self.assertEqual(int(point.x()), i)
+ self.assertEqual(int(point.y()), i)
+ i += 1;
+
+if __name__ == '__main__':
+ unittest.main()
From 492ac5c64ca75fbed346d3b13b3b0dd99c140910 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Wed, 29 Sep 2010 15:16:52 -0300
Subject: [PATCH 0272/1129] Modify return type QLineF::intersect to look nice
in the documentation.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Reviewer: Luciano Wolf
Renato Araújo
---
PySide/QtCore/typesystem_core.xml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index f364dd0..68bd04c 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -685,6 +685,9 @@
+
+
+
QPointF p;
%RETURN_TYPE retval = %CPPSELF.%FUNCTION_NAME(%ARGUMENT_NAMES, &p);
From fa87b811adbe0930523c927adcdeaf8272fbf865 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Wed, 29 Sep 2010 18:02:31 -0300
Subject: [PATCH 0273/1129] Fix bug#388 - "Fatal Python error:
PyEval_SaveThread: NULL tstate"
Reviewer: Luciano Wolf
Marcelo Lira
---
PySide/QtGui/glue/qapplication_init.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/PySide/QtGui/glue/qapplication_init.cpp b/PySide/QtGui/glue/qapplication_init.cpp
index 246e5d1..be90d10 100644
--- a/PySide/QtGui/glue/qapplication_init.cpp
+++ b/PySide/QtGui/glue/qapplication_init.cpp
@@ -21,9 +21,9 @@ void DeleteQApplicationAtExit()
bmngr.destroyWrapper(w);
}
- cpp->deleteLater();
- QApplication::processEvents();
+ cpp->processEvents();
bmngr.destroyWrapper(cpp);
+ delete cpp;
}
}
From 866c76ff1fd8246ffb1be557670a522dd678050a Mon Sep 17 00:00:00 2001
From: renatofilho
Date: Wed, 29 Sep 2010 18:31:18 -0300
Subject: [PATCH 0274/1129] Use PyObject as default type on signal/slot
signature.
Fixes bug #390.
Reviewer: Luciano Wolf
---
libpyside/qsignal.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libpyside/qsignal.cpp b/libpyside/qsignal.cpp
index 95fc251..76fc450 100644
--- a/libpyside/qsignal.cpp
+++ b/libpyside/qsignal.cpp
@@ -255,7 +255,7 @@ char* get_type_name(PyObject* type)
else if (objType == &PyBool_Type)
typeName = strdup("bool");
else
- typeName = strdup("object");
+ typeName = strdup("PyObject");
}
return typeName;
} else if (PyString_Check(type)) {
From 5222609f31c298f4f729789a0f7764a4496b5ae9 Mon Sep 17 00:00:00 2001
From: renatofilho
Date: Thu, 30 Sep 2010 12:07:04 -0300
Subject: [PATCH 0275/1129] Unit test for bug 390.
Reviewer: Luciano Wolf
Marcelo Lira
---
tests/QtGui/CMakeLists.txt | 1 +
tests/QtGui/bug_389.py | 15 +++++++++++++++
2 files changed, 16 insertions(+)
create mode 100644 tests/QtGui/bug_389.py
diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt
index c8db7a2..f260321 100644
--- a/tests/QtGui/CMakeLists.txt
+++ b/tests/QtGui/CMakeLists.txt
@@ -8,6 +8,7 @@ PYSIDE_TEST(bug_324.py)
PYSIDE_TEST(bug_338.py)
PYSIDE_TEST(bug_363.py)
PYSIDE_TEST(bug_367.py)
+PYSIDE_TEST(bug_389.py)
PYSIDE_TEST(add_action_test.py)
PYSIDE_TEST(customproxywidget_test.py)
PYSIDE_TEST(float_to_int_implicit_conversion_test.py)
diff --git a/tests/QtGui/bug_389.py b/tests/QtGui/bug_389.py
new file mode 100644
index 0000000..b01019a
--- /dev/null
+++ b/tests/QtGui/bug_389.py
@@ -0,0 +1,15 @@
+''' Test bug 389: http://bugs.openbossa.org/show_bug.cgi?id=389'''
+
+import sys
+import unittest
+from helper import UsesQApplication
+from PySide import QtCore,QtGui
+
+class BugTest(UsesQApplication):
+ def testCase(self):
+ s = QtGui.QWidget().style()
+ i = s.standardIcon(QtGui.QStyle.SP_TitleBarMinButton)
+ self.assertEqual(type(i), QtGui.QIcon)
+
+if __name__ == '__main__':
+ unittest.main()
From 44af04703081f529c433f0fbc5229e9e0d12304f Mon Sep 17 00:00:00 2001
From: renatofilho
Date: Thu, 30 Sep 2010 12:07:20 -0300
Subject: [PATCH 0276/1129] Fix QWidget::style / QWidget::setStyle ownership
rules.
Fixes bug #389.
Reviewer: Luciano Wolf
Marcelo Lira
---
PySide/QtGui/typesystem_gui_common.xml | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index 6e1ef31..b490319 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -3248,6 +3248,31 @@
+
+
+ Shiboken::keepReference(reinterpret_cast<Shiboken::SbkBaseWrapper*>(%PYSELF), "__style__", %PYARG_1);
+
+
+
+
+ QStyle* myStyle = %CPPSELF->style();
+ if (myStyle && qApp) {
+ %PYARG_0 = %CONVERTTOPYTHON[QStyle*](myStyle);
+ QStyle *appStyle = qApp->style();
+ if (appStyle == myStyle) {
+ Shiboken::AutoDecRef pyApp(%CONVERTTOPYTHON[QApplication*](qApp));
+ Shiboken::setParent(pyApp, %PYARG_0);
+ SbkBaseWrapper_setOwnership(%PYARG_0, false);
+ } else {
+ Shiboken::keepReference(reinterpret_cast<Shiboken::SbkBaseWrapper*>(%PYSELF), "__style__", %PYARG_0);
+ }
+ }
+
+
+
+
+
+
From 846c9a151f23ec727540f1bda8d6b43609f5ad43 Mon Sep 17 00:00:00 2001
From: renatofilho
Date: Thu, 30 Sep 2010 15:35:49 -0300
Subject: [PATCH 0277/1129] Unit test for bug #392.
Reviewer: Luciano Wolf
Marcelo Lira
---
tests/QtUiTools/CMakeLists.txt | 1 +
tests/QtUiTools/bug_392.py | 19 +++++++++++++++++++
2 files changed, 20 insertions(+)
create mode 100644 tests/QtUiTools/bug_392.py
diff --git a/tests/QtUiTools/CMakeLists.txt b/tests/QtUiTools/CMakeLists.txt
index 9ede81f..7cb8b6a 100644
--- a/tests/QtUiTools/CMakeLists.txt
+++ b/tests/QtUiTools/CMakeLists.txt
@@ -1,4 +1,5 @@
PYSIDE_TEST(bug_360.py)
PYSIDE_TEST(bug_376.py)
+PYSIDE_TEST(bug_392.py)
PYSIDE_TEST(uiloader_test.py)
PYSIDE_TEST(ui_test.py)
diff --git a/tests/QtUiTools/bug_392.py b/tests/QtUiTools/bug_392.py
new file mode 100644
index 0000000..ebda08c
--- /dev/null
+++ b/tests/QtUiTools/bug_392.py
@@ -0,0 +1,19 @@
+import unittest
+import os
+from helper import UsesQApplication
+
+from PySide import QtCore, QtGui
+from PySide.QtUiTools import QUiLoader
+
+class BugTest(UsesQApplication):
+ def testCase(self):
+ w = QtGui.QWidget()
+ loader = QUiLoader()
+
+ filePath = os.path.join(os.path.dirname(__file__), 'action.ui')
+ result = loader.load(filePath, w)
+ self.assertEqual(type(result.statusbar.actionFoo), QtGui.QAction)
+
+if __name__ == '__main__':
+ unittest.main()
+
From 7633675d1154eda8d799aa340c5513baa34621b9 Mon Sep 17 00:00:00 2001
From: renatofilho
Date: Thu, 30 Sep 2010 15:36:20 -0300
Subject: [PATCH 0278/1129] Support any QObject in QUiLoader.load function.
Fix bug #392.
Reviewer: Luciano Wolf
Marcelo Lira
---
PySide/QtUiTools/glue/uitools_loadui.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/PySide/QtUiTools/glue/uitools_loadui.h b/PySide/QtUiTools/glue/uitools_loadui.h
index da851c1..bce1367 100644
--- a/PySide/QtUiTools/glue/uitools_loadui.h
+++ b/PySide/QtUiTools/glue/uitools_loadui.h
@@ -7,7 +7,7 @@
#include
static void
-_populate_parent(PyObject* pyParent, QWidget *parent)
+_populate_parent(PyObject* pyParent, QObject *parent)
{
if (parent->children().isEmpty())
return;
@@ -21,7 +21,7 @@ _populate_parent(PyObject* pyParent, QWidget *parent)
PyObject_SetAttrString(pyParent, qPrintable(name), pyChild);
Shiboken::setParent(pyParent, pyChild);
- _populate_parent(pyChild, qobject_cast(child));
+ _populate_parent(pyChild, qobject_cast(child));
}
}
}
From 288a53369fa8df74a92c7517e8744c5139797c78 Mon Sep 17 00:00:00 2001
From: Lauro Neto
Date: Fri, 1 Oct 2010 13:23:04 -0300
Subject: [PATCH 0279/1129] Removing deprecated and duplicated test
Reviewer: Hugo Lima
---
tests/signals/CMakeLists.txt | 1 -
tests/signals/segfault_proxyparent_test.py | 14 -----
tests/signals/upstream_segfault_test.py | 64 ----------------------
3 files changed, 79 deletions(-)
delete mode 100644 tests/signals/upstream_segfault_test.py
diff --git a/tests/signals/CMakeLists.txt b/tests/signals/CMakeLists.txt
index eaa9a84..9aafe75 100644
--- a/tests/signals/CMakeLists.txt
+++ b/tests/signals/CMakeLists.txt
@@ -34,4 +34,3 @@ PYSIDE_TEST(signal_signature_test.py)
PYSIDE_TEST(signal_with_primitive_type_test.py)
PYSIDE_TEST(slot_reference_count_test.py)
PYSIDE_TEST(static_metaobject_test.py)
-PYSIDE_TEST(upstream_segfault_test.py)
diff --git a/tests/signals/segfault_proxyparent_test.py b/tests/signals/segfault_proxyparent_test.py
index 2b41f67..791e19c 100644
--- a/tests/signals/segfault_proxyparent_test.py
+++ b/tests/signals/segfault_proxyparent_test.py
@@ -54,20 +54,6 @@ class SegfaultCase(unittest.TestCase):
self.assert_(self.called)
- def testSameReference(self):
- """Example of how sip(?) reuses memory positions"""
- obj = Dummy()
- s1 = str(obj)
- del obj
- obj = Dummy()
- s2 = str(obj)
- self.assertEqual(s1, s2)
-
- obj2 = Dummy()
- s3 = str(obj2)
- self.assertNotEqual(s2, s3)
-
-
if __name__ == '__main__':
unittest.main()
diff --git a/tests/signals/upstream_segfault_test.py b/tests/signals/upstream_segfault_test.py
deleted file mode 100644
index 793b04b..0000000
--- a/tests/signals/upstream_segfault_test.py
+++ /dev/null
@@ -1,64 +0,0 @@
-
-import unittest
-
-from PySide.QtCore import QObject, SIGNAL, SLOT
-
-# Upstream version of segfault_test
-
-class Dummy(QObject):
- def __init__(self, parent=None):
- QObject.__init__(self, parent)
-
-class Joe(QObject):
- def __init__(self, parent=None):
- QObject.__init__(self, parent)
-
-class SegfaultCase(unittest.TestCase):
- """Test case for the segfault happening when parent() is called inside
- ProxyObject"""
-
- def setUp(self):
- self.called = False
-
- def tearDown(self):
- try:
- del self.args
- except:
- pass
-
- def callback(self, *args):
- if tuple(self.args) == args:
- self.called = True
-
- def testSegfault(self):
- obj = Dummy()
- QObject.connect(obj, SIGNAL('bar(int)'), self.callback)
- self.args = (33,)
- obj.emit(SIGNAL('bar(int)'), self.args[0])
- self.assert_(self.called)
-
- del obj
- obj = Joe()
- QObject.connect(obj, SIGNAL('bar(int)'), self.callback)
- self.args = (33,)
- obj.emit(SIGNAL('bar(int)'), self.args[0])
- self.assert_(self.called)
-
-
- def testSameReference(self):
- """Example of how sip reuses an already used PyObject"""
- obj = Dummy()
- s1 = str(obj)
- del obj
- obj = Dummy()
- s2 = str(obj)
- self.assertEqual(s1, s2)
-
- obj2 = Dummy()
- s3 = str(obj2)
- self.assertNotEqual(s2, s3)
-
-
-if __name__ == '__main__':
- unittest.main()
-
From 940b90e80a7ec21e513ac16ff73d8fa8cf23d489 Mon Sep 17 00:00:00 2001
From: renatofilho
Date: Fri, 1 Oct 2010 19:00:36 -0300
Subject: [PATCH 0280/1129] Implement python conversion to QTime, QDate,
QDateTime
Fixes bug #371.
Reviewer: Hugo Parente Lima
Luciano Wolf
---
PySide/QtCore/qdate_conversions.h | 35 +++++++++++++++++++
PySide/QtCore/qdatetime_conversions.h | 41 ++++++++++++++++++++++
PySide/QtCore/qtime_conversions.h | 36 +++++++++++++++++++
PySide/QtCore/typesystem_core.xml | 20 +++++++++--
tests/QtCore/CMakeLists.txt | 1 +
tests/QtCore/python_conversion.py | 50 +++++++++++++++++++++++++++
6 files changed, 181 insertions(+), 2 deletions(-)
create mode 100644 PySide/QtCore/qdate_conversions.h
create mode 100644 PySide/QtCore/qdatetime_conversions.h
create mode 100644 PySide/QtCore/qtime_conversions.h
create mode 100644 tests/QtCore/python_conversion.py
diff --git a/PySide/QtCore/qdate_conversions.h b/PySide/QtCore/qdate_conversions.h
new file mode 100644
index 0000000..e0f1dd9
--- /dev/null
+++ b/PySide/QtCore/qdate_conversions.h
@@ -0,0 +1,35 @@
+namespace Shiboken {
+template <>
+struct PythonConverter
+{
+ static bool isPythonConvertible(PyObject* pyObj)
+ {
+ if (!PyDateTimeAPI)
+ PyDateTime_IMPORT;
+
+ return pyObj && PyDate_Check(pyObj);
+ }
+
+ static QDate* transformFromPython(PyObject* obj)
+ {
+ if (isPythonConvertible(obj)) {
+ int day = PyDateTime_GET_DAY(obj);
+ int month = PyDateTime_GET_MONTH(obj);
+ int year = PyDateTime_GET_YEAR(obj);
+ return new QDate(year, month, day);
+ }
+ return 0;
+ }
+
+ static PyObject* transformToPython(QDate* d)
+ {
+ if (d) {
+ if (!PyDateTimeAPI)
+ PyDateTime_IMPORT;
+
+ return PyDate_FromDate(d->year(), d->month(), d->day());
+ }
+ return 0;
+ }
+};
+}
diff --git a/PySide/QtCore/qdatetime_conversions.h b/PySide/QtCore/qdatetime_conversions.h
new file mode 100644
index 0000000..a3cdf09
--- /dev/null
+++ b/PySide/QtCore/qdatetime_conversions.h
@@ -0,0 +1,41 @@
+namespace Shiboken {
+template <>
+struct PythonConverter
+{
+ static bool isPythonConvertible(PyObject* pyObj)
+ {
+ if (!PyDateTimeAPI)
+ PyDateTime_IMPORT;
+
+ return pyObj && PyDateTime_Check(pyObj);
+ }
+
+ static QDateTime* transformFromPython(PyObject* obj)
+ {
+ if (isPythonConvertible(obj)) {
+ int day = PyDateTime_GET_DAY(obj);
+ int month = PyDateTime_GET_MONTH(obj);
+ int year = PyDateTime_GET_YEAR(obj);
+ int hour = PyDateTime_DATE_GET_HOUR(obj);
+ int min = PyDateTime_DATE_GET_MINUTE(obj);
+ int sec = PyDateTime_DATE_GET_SECOND(obj);
+ int msec = PyDateTime_DATE_GET_MICROSECOND(obj);
+ return new QDateTime(QDate(year, month, day), QTime(hour, min, sec, msec));
+ }
+ return 0;
+ }
+
+ static PyObject* transformToPython(QDateTime* d)
+ {
+ if (d) {
+ if (!PyDateTimeAPI)
+ PyDateTime_IMPORT;
+
+ QDate date = d->date();
+ QTime time = d->time();
+ return PyDateTime_FromDateAndTime(date.year(), date.month(), date.day(), time.hour(), time.minute(), time.second(), time.msec());
+ }
+ return 0;
+ }
+};
+}
diff --git a/PySide/QtCore/qtime_conversions.h b/PySide/QtCore/qtime_conversions.h
new file mode 100644
index 0000000..5e172fa
--- /dev/null
+++ b/PySide/QtCore/qtime_conversions.h
@@ -0,0 +1,36 @@
+namespace Shiboken {
+template <>
+struct PythonConverter
+{
+ static bool isPythonConvertible(PyObject* pyObj)
+ {
+ if (!PyDateTimeAPI)
+ PyDateTime_IMPORT;
+
+ return pyObj && PyTime_Check(pyObj);
+ }
+
+ static QTime* transformFromPython(PyObject* obj)
+ {
+ if (isPythonConvertible(obj)) {
+ int hour = PyDateTime_TIME_GET_HOUR(obj);
+ int min = PyDateTime_TIME_GET_MINUTE(obj);
+ int sec = PyDateTime_TIME_GET_SECOND(obj);
+ int msec = PyDateTime_TIME_GET_MICROSECOND(obj);
+ return new QTime(hour, min, sec, msec);
+ }
+ return 0;
+ }
+
+ static PyObject* transformToPython(QTime* d)
+ {
+ if (d) {
+ if (!PyDateTimeAPI)
+ PyDateTime_IMPORT;
+
+ return PyTime_FromTime(d->hour(), d->minute(), d->second(), d->msec());
+ }
+ return 0;
+ }
+};
+}
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 68bd04c..704e8d4 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -721,6 +721,10 @@
+
+
+
+
@@ -756,7 +760,14 @@
-
+
+
+
+
+
+
+
+
@@ -818,7 +829,12 @@
-
+
+
+
+
+
+
diff --git a/tests/QtCore/CMakeLists.txt b/tests/QtCore/CMakeLists.txt
index 210aa01..30f3ff6 100644
--- a/tests/QtCore/CMakeLists.txt
+++ b/tests/QtCore/CMakeLists.txt
@@ -6,6 +6,7 @@ PYSIDE_TEST(deletelater_test.py)
PYSIDE_TEST(duck_punching_test.py)
PYSIDE_TEST(hash_test.py)
PYSIDE_TEST(missing_symbols_test.py)
+PYSIDE_TEST(python_conversion.py)
PYSIDE_TEST(qabs_test.py)
PYSIDE_TEST(qabstractitemmodel_test.py)
PYSIDE_TEST(qabstracttransition_test.py)
diff --git a/tests/QtCore/python_conversion.py b/tests/QtCore/python_conversion.py
new file mode 100644
index 0000000..43dfccf
--- /dev/null
+++ b/tests/QtCore/python_conversion.py
@@ -0,0 +1,50 @@
+#!/usr/bin/python
+'''Test cases for QLineF'''
+
+import unittest
+import os
+import datetime
+
+from PySide.QtCore import *
+
+class TestDateTimeConversions (unittest.TestCase):
+ def testQDate(self):
+ date = datetime.date(2010, 04, 23)
+ other = QDate(date)
+ self.assertEqual(date.year, other.year())
+ self.assertEqual(date.month, other.month())
+ self.assertEqual(date.day, other.day())
+
+ self.assertEqual(date, other.toPython())
+
+ def testQTime(self):
+ time = datetime.time(11, 14, 00, 01)
+ other = QTime(time)
+ self.assertEqual(time.hour, other.hour())
+ self.assertEqual(time.minute, other.minute())
+ self.assertEqual(time.second, other.second())
+ self.assertEqual(time.microsecond, other.msec())
+
+ self.assertEqual(time, other.toPython())
+
+ def testQDateTime(self):
+ dateTime = datetime.datetime(2010, 04, 23, 11, 14, 00, 01)
+ other = QDateTime(dateTime)
+
+ otherDate = other.date()
+ self.assertEqual(dateTime.year, otherDate.year())
+ self.assertEqual(dateTime.month, otherDate.month())
+ self.assertEqual(dateTime.day, otherDate.day())
+
+ otherTime = other.time()
+ self.assertEqual(dateTime.hour, otherTime.hour())
+ self.assertEqual(dateTime.minute, otherTime.minute())
+ self.assertEqual(dateTime.second, otherTime.second())
+ self.assertEqual(dateTime.microsecond, otherTime.msec())
+
+ self.assertEqual(dateTime, other.toPython())
+
+
+
+if __name__ == '__main__':
+ unittest.main()
From 51cbe9d49e3a992f1d02dd97fe68e34fae6957ee Mon Sep 17 00:00:00 2001
From: renatofilho
Date: Fri, 1 Oct 2010 19:43:53 -0300
Subject: [PATCH 0281/1129] Added missing file on QtUitools tests.
Reviewer: Hugo Parente Lima
Luciano Wolf
---
tests/QtUiTools/action.ui | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
create mode 100644 tests/QtUiTools/action.ui
diff --git a/tests/QtUiTools/action.ui b/tests/QtUiTools/action.ui
new file mode 100644
index 0000000..9eda559
--- /dev/null
+++ b/tests/QtUiTools/action.ui
@@ -0,0 +1,16 @@
+
+ main_window
+
+
+
+
+
+
+ foo
+
+
+
+
+
+
+
From 2f8381e71213a1ecaed3ceda9ed9cdd981b79893 Mon Sep 17 00:00:00 2001
From: renatofilho
Date: Mon, 4 Oct 2010 11:15:56 -0300
Subject: [PATCH 0282/1129] Implemented detection for VideoCaptureDevice on
phonon module.
Fixes bug #355.
Reviewer: Hugo Parente Lima
Luciano Wolf
---
PySide/CMakeLists.txt | 27 ++++++++++++++++++++++++---
PySide/phonon/CMakeLists.txt | 5 ++++-
PySide/phonon/typesystem_phonon.xml | 8 ++++++--
3 files changed, 34 insertions(+), 6 deletions(-)
diff --git a/PySide/CMakeLists.txt b/PySide/CMakeLists.txt
index 8a1f4d2..05191e3 100644
--- a/PySide/CMakeLists.txt
+++ b/PySide/CMakeLists.txt
@@ -47,19 +47,41 @@ macro(create_pyside_module module_name module_include_dir module_libraries modul
install(FILES ${typesystem_files} DESTINATION share/PySide${pyside_SUFFIX}/typesystems)
endmacro()
+#macro(check_qt_class_with_namespace module namespace class global_sources [namespace])
macro(check_qt_class module class global_sources)
+ if (${ARGC} GREATER 3)
+ set (namespace ${ARGV3})
+ string(TOLOWER ${namespace} _namespace)
+ else ()
+ set (namespace "")
+ endif ()
+ if (${ARGC} GREATER 4)
+ set (include_file ${ARGV4})
+ else ()
+ set (include_file ${module})
+ endif ()
string(TOLOWER ${class} _class)
string(TOUPPER ${module} _module)
- set(_cppfile ${CMAKE_CURRENT_BINARY_DIR}/PySide/${module}/${_class}_wrapper.cpp)
+ if (${namespace})
+ set(_cppfile ${CMAKE_CURRENT_BINARY_DIR}/PySide/${module}/${_namespace}_${_class}_wrapper.cpp)
+ else ()
+ set(_cppfile ${CMAKE_CURRENT_BINARY_DIR}/PySide/${module}/${_class}_wrapper.cpp)
+ endif ()
if (DEFINED PYSIDE_${class})
if (PYSIDE_${class})
list(APPEND ${global_sources} ${_cppfile})
endif()
else()
+ if (NOT ${namespace} STREQUAL "" )
+ set (NAMESPACE_USE "using namespace ${namespace};")
+ else ()
+ set (NAMESPACE_USE "")
+ endif ()
set(SRC_FILE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/test${class}.cxx)
file(WRITE ${SRC_FILE}
- "#include <${module}>\n"
+ "#include <${include_file}>\n"
"#include \n"
+ "${NAMESPACE_USE}\n"
"int main() { typeid(${class}); }\n"
)
try_compile(Q_WORKS ${CMAKE_BINARY_DIR}
@@ -85,7 +107,6 @@ endmacro()
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/global.h.in"
"${CMAKE_CURRENT_BINARY_DIR}/global.h" @ONLY)
-
# Only add subdirectory if the associated Qt module is found.
macro(HAS_QT_MODULE var name)
if (NOT DISABLE_${name} AND ${var})
diff --git a/PySide/phonon/CMakeLists.txt b/PySide/phonon/CMakeLists.txt
index 5961a9e..198ed6e 100644
--- a/PySide/phonon/CMakeLists.txt
+++ b/PySide/phonon/CMakeLists.txt
@@ -3,7 +3,7 @@ project(phonon)
# workaround for a cmake bug under MacOSX, it finds phonon but not the include path
if (NOT QT_PHONON_INCLUDE_DIR AND CMAKE_HOST_APPLE)
set(QT_PHONON_INCLUDE_DIR "${QT_LIBRARY_DIR}/phonon.framework/Headers")
-endif()
+endif ()
set(phonon_SRC
${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_abstractaudiooutput_wrapper.cpp
@@ -43,6 +43,9 @@ ${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_volumeslider_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_backendcapabilities_notifierwrapper_wrapper.cpp
)
+
+check_qt_class("phonon" "VideoCaptureDevice" phonon_SRC "Phonon" "ObjectDescription")
+
set(phonon_typesystem_path "${QtCore_SOURCE_DIR}${PATH_SEP}${QtGui_SOURCE_DIR}${PATH_SEP}${phonon_SOURCE_DIR}${PATH_SEP}${QtGui_BINARY_DIR}")
set(phonon_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
${QT_QTCORE_INCLUDE_DIR}
diff --git a/PySide/phonon/typesystem_phonon.xml b/PySide/phonon/typesystem_phonon.xml
index 4c700bc..ef05c26 100644
--- a/PySide/phonon/typesystem_phonon.xml
+++ b/PySide/phonon/typesystem_phonon.xml
@@ -158,8 +158,12 @@
-
-
+
+
+
+
+
+
From 73fea931819ee1f6a32c50c9d67a9c292e69d45a Mon Sep 17 00:00:00 2001
From: renatofilho
Date: Mon, 4 Oct 2010 16:15:25 -0300
Subject: [PATCH 0283/1129] Fixed QApplication cleanup.
Fixes bug #396.
Reviewer: Hugo Parente Lima
Luciano Wolf
---
PySide/QtGui/glue/qapplication_init.cpp | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/PySide/QtGui/glue/qapplication_init.cpp b/PySide/QtGui/glue/qapplication_init.cpp
index be90d10..d082b99 100644
--- a/PySide/QtGui/glue/qapplication_init.cpp
+++ b/PySide/QtGui/glue/qapplication_init.cpp
@@ -11,18 +11,18 @@ void DeleteQApplicationAtExit()
QCoreApplication* cpp = QApplication::instance();
if (cpp) {
Shiboken::BindingManager &bmngr = Shiboken::BindingManager::instance();
- cpp->flush();
// Delete all widgets, this is slow but is necessary to avoid problems with python object
foreach(QWidget* w, QApplication::allWidgets()) {
- w->deleteLater();
- //Make sure all events will send before invalidated the python object
- QApplication::processEvents();
- bmngr.destroyWrapper(w);
+ PyObject* wrapper = bmngr.retrieveWrapper(w);
+ if (wrapper) {
+ if (SbkBaseWrapper_hasOwnership(wrapper))
+ delete w; // destroy C++ object and invalidate wrapper object
+ else
+ bmngr.destroyWrapper(wrapper); // only invalidate wrapper object
+ }
}
-
- cpp->processEvents();
- bmngr.destroyWrapper(cpp);
+ cpp->flush();
delete cpp;
}
}
From 7f4e85f6501aa58623244303cdaf6e129c02af4d Mon Sep 17 00:00:00 2001
From: renatofilho
Date: Mon, 4 Oct 2010 16:16:20 -0300
Subject: [PATCH 0284/1129] Fixed QWidget setLayout rules.
Reviewer: Hugo Parente Lima
Luciano Wolf
---
PySide/QtGui/glue/qwidget_glue.h | 30 +++++++++++++++++++++++-------
1 file changed, 23 insertions(+), 7 deletions(-)
diff --git a/PySide/QtGui/glue/qwidget_glue.h b/PySide/QtGui/glue/qwidget_glue.h
index 9488522..6be6518 100644
--- a/PySide/QtGui/glue/qwidget_glue.h
+++ b/PySide/QtGui/glue/qwidget_glue.h
@@ -17,11 +17,13 @@ qwidgetReparentLayout(QWidget *parent, QLayout *layout)
{
QLayoutItem *item = layout->itemAt(i);
QWidget *w = item->widget();
-
if (w)
{
- Shiboken::AutoDecRef pyChild(Shiboken::Converter::toPython(w));
- Shiboken::setParent(pyParent, pyChild);
+ QWidget* pw = w->parentWidget();
+ if (pw != parent) {
+ Shiboken::AutoDecRef pyChild(Shiboken::Converter::toPython(w));
+ Shiboken::setParent(pyParent, pyChild);
+ }
}
else
{
@@ -33,7 +35,6 @@ qwidgetReparentLayout(QWidget *parent, QLayout *layout)
Shiboken::AutoDecRef pyChild(Shiboken::Converter::toPython(layout));
Shiboken::setParent(pyParent, pyChild);
-
//remove previous references
Shiboken::keepReference(reinterpret_cast(pyChild.object()), qPrintable(retrieveObjectName(pyChild)), Py_None);
}
@@ -41,9 +42,24 @@ qwidgetReparentLayout(QWidget *parent, QLayout *layout)
static inline void
qwidgetSetLayout(QWidget *self, QLayout *layout)
{
- if (self->layout())
+ if (!layout || self->layout())
return;
- qwidgetReparentLayout(self, layout);
- self->setLayout(layout);
+ QObject* oldParent = layout->parent();
+ if (oldParent && oldParent != self) {
+ if (oldParent->isWidgetType()) {
+ // remove old parent policy
+ Shiboken::AutoDecRef pyLayout(Shiboken::Converter::toPython(layout));
+ Shiboken::setParent(Py_None, pyLayout);
+ } else {
+ PyErr_Format(PyExc_RuntimeError, "QWidget::setLayout: Attempting to set QLayout \"%s\" on %s \"%s\", when the QLayout already has a parent",
+ qPrintable(layout->objectName()), self->metaObject()->className(), qPrintable(self->objectName()));
+ return;
+ }
+ }
+
+ if (oldParent != self) {
+ qwidgetReparentLayout(self, layout);
+ self->setLayout(layout);
+ }
}
From 4adb686fc15dc3dfdb872157df27b534f1ca7f98 Mon Sep 17 00:00:00 2001
From: renatofilho
Date: Tue, 5 Oct 2010 12:07:08 -0300
Subject: [PATCH 0285/1129] Extend QUiLoader test to test ui files with custom
widgets.
---
tests/QtUiTools/bug_392.py | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/tests/QtUiTools/bug_392.py b/tests/QtUiTools/bug_392.py
index ebda08c..5717d45 100644
--- a/tests/QtUiTools/bug_392.py
+++ b/tests/QtUiTools/bug_392.py
@@ -2,7 +2,7 @@ import unittest
import os
from helper import UsesQApplication
-from PySide import QtCore, QtGui
+from PySide import QtCore, QtGui, QtDeclarative
from PySide.QtUiTools import QUiLoader
class BugTest(UsesQApplication):
@@ -14,6 +14,16 @@ class BugTest(UsesQApplication):
result = loader.load(filePath, w)
self.assertEqual(type(result.statusbar.actionFoo), QtGui.QAction)
+ def testCustomWidgets(self):
+ w = QtGui.QWidget()
+ loader = QUiLoader()
+
+ filePath = os.path.join(os.path.dirname(__file__), 'customwidget.ui')
+ result = loader.load(filePath, w)
+ self.assert_(type(result.declarativeView), QtDeclarative.QDeclarativeView)
+ self.assert_(type(result.worldTimeClock), QtGui.QWidget)
+
+
if __name__ == '__main__':
unittest.main()
From 254d365d5c8017a63916bf524c69313cefdeccb2 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Mon, 4 Oct 2010 18:59:17 -0300
Subject: [PATCH 0286/1129] Use QByteArray instead of QString in some internal
QLayout functions.
As only latin1 chars are expected, we don't need waste memory with QString.
---
PySide/QtGui/glue/qlayout_help_functions.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/PySide/QtGui/glue/qlayout_help_functions.h b/PySide/QtGui/glue/qlayout_help_functions.h
index 9e07ff5..e62077a 100644
--- a/PySide/QtGui/glue/qlayout_help_functions.h
+++ b/PySide/QtGui/glue/qlayout_help_functions.h
@@ -3,10 +3,10 @@
void addLayoutOwnership(QLayout *layout, QLayoutItem *item);
-inline QString retrieveObjectName(PyObject *obj)
+inline QByteArray retrieveObjectName(PyObject *obj)
{
Shiboken::AutoDecRef objName(PyObject_Str(obj));
- return QString(PyString_AsString(objName));
+ return PyString_AsString(objName);
}
inline void addLayoutOwnership(QLayout *layout, QWidget *widget)
@@ -18,7 +18,7 @@ inline void addLayoutOwnership(QLayout *layout, QWidget *widget)
//keep the reference while the layout is orphan
Shiboken::AutoDecRef pyParent(Shiboken::Converter::toPython(layout));
Shiboken::AutoDecRef pyChild(Shiboken::Converter::toPython(widget));
- Shiboken::keepReference(reinterpret_cast(pyParent.object()), qPrintable(retrieveObjectName(pyParent)), pyChild, true);
+ Shiboken::keepReference(reinterpret_cast(pyParent.object()), retrieveObjectName(pyParent).data(), pyChild, true);
} else {
Shiboken::AutoDecRef pyParent(Shiboken::Converter::toPython(parent));
Shiboken::AutoDecRef pyChild(Shiboken::Converter::toPython(widget));
@@ -34,7 +34,7 @@ inline void addLayoutOwnership(QLayout *layout, QLayout *other)
//keep the reference while the layout is orphan
Shiboken::AutoDecRef pyParent(Shiboken::Converter::toPython(layout));
Shiboken::AutoDecRef pyChild(Shiboken::Converter::toPython(other));
- Shiboken::keepReference(reinterpret_cast(pyParent.object()), qPrintable(retrieveObjectName(pyParent)), pyChild, true);
+ Shiboken::keepReference(reinterpret_cast(pyParent.object()), retrieveObjectName(pyParent).data(), pyChild, true);
return;
}
From 4caa8e8ab32ffdad8d8c9c47b9bc2b52600fd5d5 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Mon, 4 Oct 2010 19:04:28 -0300
Subject: [PATCH 0287/1129] Sort typesystem according to their dependencies to
avoid the inclusion of a typesystem with generate=no.
---
doc/typesystem_doc.xml.in | 28 +++++++++++++++-------------
1 file changed, 15 insertions(+), 13 deletions(-)
diff --git a/doc/typesystem_doc.xml.in b/doc/typesystem_doc.xml.in
index eaf5178..9d87adc 100644
--- a/doc/typesystem_doc.xml.in
+++ b/doc/typesystem_doc.xml.in
@@ -23,9 +23,18 @@
- @if_QtDeclarative@
-
- @end_QtDeclarative@
+
+ @if_QtNetwork@
+
+ @end_QtNetwork@
+
+ @if_QtXml@
+
+ @end_QtXml@
+
+ @if_QtScript@
+
+ @end_QtScript@
@if_QtGui@
@@ -43,18 +52,14 @@
@end_Multimedia@
- @if_QtNetwork@
-
- @end_QtNetwork@
+ @if_QtDeclarative@
+
+ @end_QtDeclarative@
@if_QtOpenGL@
@end_QtOpenGL@
- @if_QtScript@
-
- @end_QtScript@
-
@if_QtScriptTools@
@end_QtScriptTools@
@@ -79,9 +84,6 @@
@end_QtWebKit@
- @if_QtXml@
-
- @end_QtXml@
@if_QtXmlPatterns@
From 5f21b20e722a41bd3d1d9bbf4c36f8f08aba4f63 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Mon, 4 Oct 2010 19:05:46 -0300
Subject: [PATCH 0288/1129] Generate documentation for phonon.
---
doc/CMakeLists.txt | 4 ++--
doc/typesystem_doc.xml.in | 6 +++++-
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index 7b29ca6..7f72f41 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -20,9 +20,9 @@ configure_file(typesystem_doc.xml.in typesystem_doc.xml @ONLY)
add_custom_target("docrsts"
COMMAND ${GENERATORRUNNER_BINARY} --generatorSet=qtdoc
${pyside_BINARY_DIR}/global.h
- --include-paths="${QT_INCLUDE_DIR}${PATH_SEP}${QT_QTCORE_INCLUDE_DIR}"
+ --include-paths="${QT_INCLUDE_DIR}${PATH_SEP}${pyside_SOURCE_DIR}"
--api-version=${SUPPORTED_QT_VERSION}
- --typesystem-paths="${pyside_SOURCE_DIR}${PATH_SEP}${QtCore_SOURCE_DIR}${PATH_SEP}${QtDeclarative_SOURCE_DIR}${PATH_SEP}${QtGui_SOURCE_DIR}${PATH_SEP}${QtGui_BINARY_DIR}${PATH_SEP}${QtHelp_SOURCE_DIR}${PATH_SEP}${QtMaemo5_SOURCE_DIR}${PATH_SEP}${QtMultimedia_SOURCE_DIR}${PATH_SEP}${QtNetwork_SOURCE_DIR}${PATH_SEP}${QtOpenGL_SOURCE_DIR}${PATH_SEP}${QtScript_SOURCE_DIR}${PATH_SEP}${QtScriptTools_SOURCE_DIR}${PATH_SEP}${QtSql_SOURCE_DIR}${PATH_SEP}${QtSvg_SOURCE_DIR}${PATH_SEP}${QtTest_SOURCE_DIR}${PATH_SEP}${QtUiTools_SOURCE_DIR}${PATH_SEP}${QtWebKit_SOURCE_DIR}${PATH_SEP}${QtXml_SOURCE_DIR}${PATH_SEP}${QtXmlPatterns_SOURCE_DIR}"
+ --typesystem-paths="${pyside_SOURCE_DIR}${PATH_SEP}${QtCore_SOURCE_DIR}${PATH_SEP}${QtDeclarative_SOURCE_DIR}${PATH_SEP}${QtGui_SOURCE_DIR}${PATH_SEP}${QtGui_BINARY_DIR}${PATH_SEP}${QtHelp_SOURCE_DIR}${PATH_SEP}${QtMaemo5_SOURCE_DIR}${PATH_SEP}${QtMultimedia_SOURCE_DIR}${PATH_SEP}${QtNetwork_SOURCE_DIR}${PATH_SEP}${QtOpenGL_SOURCE_DIR}${PATH_SEP}${QtScript_SOURCE_DIR}${PATH_SEP}${QtScriptTools_SOURCE_DIR}${PATH_SEP}${QtSql_SOURCE_DIR}${PATH_SEP}${QtSvg_SOURCE_DIR}${PATH_SEP}${QtTest_SOURCE_DIR}${PATH_SEP}${QtUiTools_SOURCE_DIR}${PATH_SEP}${QtWebKit_SOURCE_DIR}${PATH_SEP}${QtXml_SOURCE_DIR}${PATH_SEP}${QtXmlPatterns_SOURCE_DIR}${PATH_SEP}${phonon_SOURCE_DIR}"
--library-source-dir=${QT_SRC_DIR}
--documentation-only
--documentation-data-dir=${DOC_DATA_DIR}
diff --git a/doc/typesystem_doc.xml.in b/doc/typesystem_doc.xml.in
index 9d87adc..2ed2068 100644
--- a/doc/typesystem_doc.xml.in
+++ b/doc/typesystem_doc.xml.in
@@ -88,4 +88,8 @@
@if_QtXmlPatterns@
@end_QtXmlPatterns@
-
\ No newline at end of file
+
+ @if_phonon@
+
+ @end_phonon@
+
From ebe20bd63fa677804a520df6ce1a2fd64a9401ad Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Mon, 4 Oct 2010 19:08:29 -0300
Subject: [PATCH 0289/1129] Add unit test for bug#172
---
tests/QtGui/CMakeLists.txt | 1 +
tests/QtGui/bug_172.py | 13 +++++++++++++
2 files changed, 14 insertions(+)
create mode 100644 tests/QtGui/bug_172.py
diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt
index f260321..350948b 100644
--- a/tests/QtGui/CMakeLists.txt
+++ b/tests/QtGui/CMakeLists.txt
@@ -1,6 +1,7 @@
#Keep this in alphabetical sort
PYSIDE_TEST(api2_test.py)
+PYSIDE_TEST(bug_172.py)
PYSIDE_TEST(bug_243.py)
PYSIDE_TEST(bug_300_test.py)
PYSIDE_TEST(bug_307.py)
diff --git a/tests/QtGui/bug_172.py b/tests/QtGui/bug_172.py
new file mode 100644
index 0000000..d14c94c
--- /dev/null
+++ b/tests/QtGui/bug_172.py
@@ -0,0 +1,13 @@
+from PySide.QtGui import *
+
+if __name__ == '__main__':
+ app = QApplication([])
+
+ wdg = QWidget()
+
+ hbox = QHBoxLayout()
+
+ vbox = QVBoxLayout()
+ vbox.addLayout(hbox)
+
+ wdg.setLayout(vbox)
From 79f837715f1a3bb91ed728e62eb27a5b0887b215 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Tue, 5 Oct 2010 11:48:44 -0300
Subject: [PATCH 0290/1129] Removed whitespaces.
---
PySide/QtGui/typesystem_gui_common.xml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index b490319..29b1657 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -3250,13 +3250,13 @@
- Shiboken::keepReference(reinterpret_cast<Shiboken::SbkBaseWrapper*>(%PYSELF), "__style__", %PYARG_1);
+ Shiboken::keepReference(reinterpret_cast<Shiboken::SbkBaseWrapper*>(%PYSELF), "__style__", %PYARG_1);
QStyle* myStyle = %CPPSELF->style();
- if (myStyle && qApp) {
+ if (myStyle && qApp) {
%PYARG_0 = %CONVERTTOPYTHON[QStyle*](myStyle);
QStyle *appStyle = qApp->style();
if (appStyle == myStyle) {
@@ -4966,7 +4966,7 @@
-
+
From bebede17c03c5f6180262a4031c53998142564ad Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Tue, 5 Oct 2010 11:49:13 -0300
Subject: [PATCH 0291/1129] Fixed doc of return values.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Reviewer: Renato Araújo
Luciano Wolf
---
PySide/QtCore/typesystem_core.xml | 7 +++--
PySide/QtGui/typesystem_gui_common.xml | 11 +++++---
PySide/QtNetwork/typesystem_network.xml | 6 ++---
PySide/QtOpenGL/typesystem_opengl.xml | 3 +++
PySide/QtWebKit/typesystem_webkit.xml | 3 +++
PySide/QtXml/typesystem_xml.xml | 36 ++++++++++++++++++++-----
6 files changed, 51 insertions(+), 15 deletions(-)
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 704e8d4..37decba 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -1867,6 +1867,9 @@
+
+
+
qint64 pid;
%RETURN_TYPE retval = %TYPE::%FUNCTION_NAME(%1, %2, %3, &pid);
@@ -2531,7 +2534,7 @@
-
+
%PYARG_0 = PySet_New(0);
foreach(QAbstractState* abs_state, %CPPSELF.configuration()) {
@@ -2542,7 +2545,7 @@
-
+
%PYARG_0 = PyList_New(0);
foreach(QAbstractAnimation* abs_anim, %CPPSELF.defaultAnimations()) {
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index 29b1657..68d5c0d 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -1156,6 +1156,9 @@
+
+
+
QGraphicsItem *item_ = NULL;
%RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(&item_);
@@ -3664,7 +3667,7 @@
-
+
@@ -3675,7 +3678,7 @@
-
+
@@ -3686,7 +3689,7 @@
-
+
@@ -3892,7 +3895,7 @@
-
+
%RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, %2);
diff --git a/PySide/QtNetwork/typesystem_network.xml b/PySide/QtNetwork/typesystem_network.xml
index 5e09ab7..0321a65 100644
--- a/PySide/QtNetwork/typesystem_network.xml
+++ b/PySide/QtNetwork/typesystem_network.xml
@@ -118,7 +118,7 @@
-
+
@@ -145,7 +145,7 @@
-
+
@@ -170,7 +170,7 @@
-
+
diff --git a/PySide/QtOpenGL/typesystem_opengl.xml b/PySide/QtOpenGL/typesystem_opengl.xml
index 2a7557e..b94e8af 100644
--- a/PySide/QtOpenGL/typesystem_opengl.xml
+++ b/PySide/QtOpenGL/typesystem_opengl.xml
@@ -136,6 +136,9 @@
+
+
+
char *data = new char[%3];
bool result = %CPPSELF.read(%1, data, %3);
diff --git a/PySide/QtWebKit/typesystem_webkit.xml b/PySide/QtWebKit/typesystem_webkit.xml
index 1c39111..f11c6e3 100644
--- a/PySide/QtWebKit/typesystem_webkit.xml
+++ b/PySide/QtWebKit/typesystem_webkit.xml
@@ -76,6 +76,9 @@
+
+
+
QString str;
%RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, &str);
diff --git a/PySide/QtXml/typesystem_xml.xml b/PySide/QtXml/typesystem_xml.xml
index 4cccb8a..dac7b56 100644
--- a/PySide/QtXml/typesystem_xml.xml
+++ b/PySide/QtXml/typesystem_xml.xml
@@ -68,6 +68,9 @@
+
+
+
@@ -85,6 +88,9 @@
+
+
+
@@ -102,6 +108,9 @@
+
+
+
@@ -119,6 +128,9 @@
+
+
+
@@ -136,6 +148,9 @@
+
+
+
@@ -153,6 +168,9 @@
+
+
+
@@ -170,6 +188,9 @@
+
+
+
@@ -187,6 +208,9 @@
+
+
+
@@ -278,7 +302,7 @@
-
+
@@ -301,7 +325,7 @@
-
+
@@ -336,7 +360,7 @@
-
+
@@ -351,7 +375,7 @@
-
+
@@ -403,7 +427,7 @@
-
+
@@ -418,7 +442,7 @@
-
+
From 829ffd3dfd31eef3b98678adfcba1609445305b3 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Tue, 5 Oct 2010 16:42:40 -0300
Subject: [PATCH 0292/1129] Revert "Fixed doc of return values."
This reverts commit bebede17c03c5f6180262a4031c53998142564ad.
---
PySide/QtCore/typesystem_core.xml | 7 ++---
PySide/QtGui/typesystem_gui_common.xml | 11 +++-----
PySide/QtNetwork/typesystem_network.xml | 6 ++---
PySide/QtOpenGL/typesystem_opengl.xml | 3 ---
PySide/QtWebKit/typesystem_webkit.xml | 3 ---
PySide/QtXml/typesystem_xml.xml | 36 +++++--------------------
6 files changed, 15 insertions(+), 51 deletions(-)
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 37decba..704e8d4 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -1867,9 +1867,6 @@
-
-
-
qint64 pid;
%RETURN_TYPE retval = %TYPE::%FUNCTION_NAME(%1, %2, %3, &pid);
@@ -2534,7 +2531,7 @@
-
+
%PYARG_0 = PySet_New(0);
foreach(QAbstractState* abs_state, %CPPSELF.configuration()) {
@@ -2545,7 +2542,7 @@
-
+
%PYARG_0 = PyList_New(0);
foreach(QAbstractAnimation* abs_anim, %CPPSELF.defaultAnimations()) {
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index 68d5c0d..29b1657 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -1156,9 +1156,6 @@
-
-
-
QGraphicsItem *item_ = NULL;
%RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(&item_);
@@ -3667,7 +3664,7 @@
-
+
@@ -3678,7 +3675,7 @@
-
+
@@ -3689,7 +3686,7 @@
-
+
@@ -3895,7 +3892,7 @@
-
+
%RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, %2);
diff --git a/PySide/QtNetwork/typesystem_network.xml b/PySide/QtNetwork/typesystem_network.xml
index 0321a65..5e09ab7 100644
--- a/PySide/QtNetwork/typesystem_network.xml
+++ b/PySide/QtNetwork/typesystem_network.xml
@@ -118,7 +118,7 @@
-
+
@@ -145,7 +145,7 @@
-
+
@@ -170,7 +170,7 @@
-
+
diff --git a/PySide/QtOpenGL/typesystem_opengl.xml b/PySide/QtOpenGL/typesystem_opengl.xml
index b94e8af..2a7557e 100644
--- a/PySide/QtOpenGL/typesystem_opengl.xml
+++ b/PySide/QtOpenGL/typesystem_opengl.xml
@@ -136,9 +136,6 @@
-
-
-
char *data = new char[%3];
bool result = %CPPSELF.read(%1, data, %3);
diff --git a/PySide/QtWebKit/typesystem_webkit.xml b/PySide/QtWebKit/typesystem_webkit.xml
index f11c6e3..1c39111 100644
--- a/PySide/QtWebKit/typesystem_webkit.xml
+++ b/PySide/QtWebKit/typesystem_webkit.xml
@@ -76,9 +76,6 @@
-
-
-
QString str;
%RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, &str);
diff --git a/PySide/QtXml/typesystem_xml.xml b/PySide/QtXml/typesystem_xml.xml
index dac7b56..4cccb8a 100644
--- a/PySide/QtXml/typesystem_xml.xml
+++ b/PySide/QtXml/typesystem_xml.xml
@@ -68,9 +68,6 @@
-
-
-
@@ -88,9 +85,6 @@
-
-
-
@@ -108,9 +102,6 @@
-
-
-
@@ -128,9 +119,6 @@
-
-
-
@@ -148,9 +136,6 @@
-
-
-
@@ -168,9 +153,6 @@
-
-
-
@@ -188,9 +170,6 @@
-
-
-
@@ -208,9 +187,6 @@
-
-
-
@@ -302,7 +278,7 @@
-
+
@@ -325,7 +301,7 @@
-
+
@@ -360,7 +336,7 @@
-
+
@@ -375,7 +351,7 @@
-
+
@@ -427,7 +403,7 @@
-
+
@@ -442,7 +418,7 @@
-
+
From 1508831725b74ce7962a1dba79848cad8e87258f Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Tue, 5 Oct 2010 14:55:20 -0300
Subject: [PATCH 0293/1129] Fixed some code snippets used in the PySide docs.
---
.../dialogs/classwizard/classwizard.cpp | 28 +++++++++----------
.../examples/dialogs/extension/finddialog.cpp | 8 +++---
.../dialogs/licensewizard/licensewizard.cpp | 2 +-
.../dialogs/standarddialogs/dialog.cpp | 4 +--
.../dialogs/trivialwizard/trivialwizard.cpp | 2 +-
.../sql/querymodel/editablesqlmodel.cpp | 4 +--
.../relationaltablemodel.cpp | 6 ++--
.../snippets/textdocument-resources/main.cpp | 2 +-
8 files changed, 28 insertions(+), 28 deletions(-)
diff --git a/doc/codesnippets/examples/dialogs/classwizard/classwizard.cpp b/doc/codesnippets/examples/dialogs/classwizard/classwizard.cpp
index 5814d5f..0d5c221 100644
--- a/doc/codesnippets/examples/dialogs/classwizard/classwizard.cpp
+++ b/doc/codesnippets/examples/dialogs/classwizard/classwizard.cpp
@@ -60,14 +60,14 @@ def __init__(self, parent):
//! [3]
def accept(self):
//! [3] //! [4]
- className = self.field("className").toByteArray()
- baseClass = self.field("baseClass").toByteArray()
- macroName = self.field("macroName").toByteArray()
- baseInclude = self.field("baseInclude").toByteArray()
+ className = self.field("className")
+ baseClass = self.field("baseClass")
+ macroName = self.field("macroName")
+ baseInclude = self.field("baseInclude")
- outputDir = self.field("outputDir").toString()
- header = self.field("header").toString()
- implementation = self.field("implementation").toString()
+ outputDir = self.field("outputDir")
+ header = self.field("header")
+ implementation = self.field("implementation")
//! [4]
...
@@ -223,17 +223,17 @@ class CodeStylePage(QWizardPage):
//! [16]
def initializePage(self):
- className = self.field("className").toString()
+ className = self.field("className")
self.macroNameLineEdit.setText(className.toUpper() + "_H")
- baseClass = self.field("baseClass").toString()
+ baseClass = self.field("baseClass")
- self.includeBaseCheckBox.setChecked(not baseClass.isEmpty())
- self.includeBaseCheckBox.setEnabled(not baseClass.isEmpty())
- self.baseIncludeLabel.setEnabled(not baseClass.isEmpty())
- self.baseIncludeLineEdit.setEnabled(not baseClass.isEmpty())
+ self.includeBaseCheckBox.setChecked(len(baseClass))
+ self.includeBaseCheckBox.setEnabled(len(baseClass))
+ self.baseIncludeLabel.setEnabled(len(baseClass))
+ self.baseIncludeLineEdit.setEnabled(len(baseClass))
- if baseClass.isEmpty():
+ if not baseClass:
self.baseIncludeLineEdit.clear()
elsif QRegExp("Q[A-Z].*").exactMatch(baseClass):
baseIncludeLineEdit.setText("<" + baseClass + ">")
diff --git a/doc/codesnippets/examples/dialogs/extension/finddialog.cpp b/doc/codesnippets/examples/dialogs/extension/finddialog.cpp
index 3ccf847..d557b06 100644
--- a/doc/codesnippets/examples/dialogs/extension/finddialog.cpp
+++ b/doc/codesnippets/examples/dialogs/extension/finddialog.cpp
@@ -78,7 +78,7 @@ def __init__(self, parent):
//! [3]
connect(moreButton, SIGNAL("toggled(bool)"), extension, SLOT("setVisible(bool)"))
- QVBoxLayout *extensionLayout = QVBoxLayout
+ extensionLayout = QVBoxLayout()
extensionLayout.setMargin(0)
extensionLayout.addWidget(wholeWordsCheckBox)
extensionLayout.addWidget(backwardCheckBox)
@@ -87,17 +87,17 @@ def __init__(self, parent):
//! [3]
//! [4]
- topLeftLayout = QHBoxLayout
+ topLeftLayout = QHBoxLayout()
topLeftLayout.addWidget(label)
topLeftLayout.addWidget(lineEdit)
- leftLayout = QVBoxLayout
+ leftLayout = QVBoxLayout()
leftLayout.addLayout(topLeftLayout)
leftLayout.addWidget(caseCheckBox)
leftLayout.addWidget(fromStartCheckBox)
leftLayout.addSself.tretch(1)
- mainLayout = QGridLayout
+ mainLayout = QGridLayout()
mainLayout.setSizeConsself.traint(QLayout.SetFixedSize)
mainLayout.addLayout(leftLayout, 0, 0)
mainLayout.addWidget(buttonBox, 0, 1)
diff --git a/doc/codesnippets/examples/dialogs/licensewizard/licensewizard.cpp b/doc/codesnippets/examples/dialogs/licensewizard/licensewizard.cpp
index 5229acd..731bdd1 100644
--- a/doc/codesnippets/examples/dialogs/licensewizard/licensewizard.cpp
+++ b/doc/codesnippets/examples/dialogs/licensewizard/licensewizard.cpp
@@ -83,7 +83,7 @@ void LicenseWizard::showHelp()
{
static QString lastHelpMessage;
- QString message;
+ message = ""
switch (currentId()) {
case Page_Intro:
diff --git a/doc/codesnippets/examples/dialogs/standarddialogs/dialog.cpp b/doc/codesnippets/examples/dialogs/standarddialogs/dialog.cpp
index bf196ed..be048d6 100644
--- a/doc/codesnippets/examples/dialogs/standarddialogs/dialog.cpp
+++ b/doc/codesnippets/examples/dialogs/standarddialogs/dialog.cpp
@@ -63,9 +63,9 @@
//! [2]
//! [3]
- QString text = QInputDialog::getText(self, self.tr("QInputDialog().getText()"),
+ text = QInputDialog::getText(self, self.tr("QInputDialog().getText()"),
self.tr("User name:"), QLineEdit.Normal,
QDir().home().dirName(), ok)
- if ok and not text.isEmpty():
+ if ok and text:
textLabel.setText(text)
//! [3]
diff --git a/doc/codesnippets/examples/dialogs/trivialwizard/trivialwizard.cpp b/doc/codesnippets/examples/dialogs/trivialwizard/trivialwizard.cpp
index bcae8c8..cc59b36 100644
--- a/doc/codesnippets/examples/dialogs/trivialwizard/trivialwizard.cpp
+++ b/doc/codesnippets/examples/dialogs/trivialwizard/trivialwizard.cpp
@@ -113,7 +113,7 @@ def createConclusionPage(self):
def main():
app = QApplication(sys.argv)
- translatorFileName = QLatin1String("qt_")
+ translatorFileName = "qt_"
translatorFileName += QLocale.system().name()
translator = QTranslator(app)
if translator.load(translatorFileName, QLibraryInfo.location(QLibraryInfo.TranslationsPath)):
diff --git a/doc/codesnippets/examples/sql/querymodel/editablesqlmodel.cpp b/doc/codesnippets/examples/sql/querymodel/editablesqlmodel.cpp
index b1d14de..743df78 100644
--- a/doc/codesnippets/examples/sql/querymodel/editablesqlmodel.cpp
+++ b/doc/codesnippets/examples/sql/querymodel/editablesqlmodel.cpp
@@ -68,9 +68,9 @@ def setData(self, index, value, role):
ok = False
if index.column() == 1:
- ok = self.setFirstName(id, value.toString())
+ ok = self.setFirstName(id, value)
else:
- ok = self.setLastName(id, value.toString())
+ ok = self.setLastName(id, value)
self.refresh()
return ok
}
diff --git a/doc/codesnippets/examples/sql/relationaltablemodel/relationaltablemodel.cpp b/doc/codesnippets/examples/sql/relationaltablemodel/relationaltablemodel.cpp
index 93c5209..b59646d 100644
--- a/doc/codesnippets/examples/sql/relationaltablemodel/relationaltablemodel.cpp
+++ b/doc/codesnippets/examples/sql/relationaltablemodel/relationaltablemodel.cpp
@@ -100,11 +100,11 @@ def main():
createRelationalTables()
- QSqlRelationalTableModel model
+ model = QSqlRelationalTableModel()
- initializeModel(&model)
+ initializeModel(model)
- view = createView(QObject.tr("Relational Table Model"), &model)
+ view = createView(QObject.tr("Relational Table Model"), model)
view.show()
return app.exec_()
diff --git a/doc/codesnippets/snippets/textdocument-resources/main.cpp b/doc/codesnippets/snippets/textdocument-resources/main.cpp
index e8f010a..86da5e2 100644
--- a/doc/codesnippets/snippets/textdocument-resources/main.cpp
+++ b/doc/codesnippets/snippets/textdocument-resources/main.cpp
@@ -59,7 +59,7 @@ int main(int argc, char *argv[])
//! [Adding a resource]
document.addResource(QTextDocument.ImageResource,
- QUrl("mydata://image.png"), QVariant(image))
+ QUrl("mydata://image.png"), image)
//! [Adding a resource]
//! [Inserting an image with a cursor]
From ec252fae3f8c231cac63711b9e7522aaa6a53a79 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Wed, 6 Oct 2010 11:37:15 -0300
Subject: [PATCH 0294/1129] Update pyside.qdocconf.in removing useless entries.
---
doc/pyside.qdocconf.in | 101 +++++------------------------------------
1 file changed, 12 insertions(+), 89 deletions(-)
diff --git a/doc/pyside.qdocconf.in b/doc/pyside.qdocconf.in
index a9b0223..76f4680 100644
--- a/doc/pyside.qdocconf.in
+++ b/doc/pyside.qdocconf.in
@@ -52,6 +52,8 @@ macro.ouml.HTML = "ö"
macro.QA = "\\e{Qt Assistant}"
macro.QD = "\\e{Qt Designer}"
macro.QL = "\\e{Qt Linguist}"
+macro.QQV = "\\e{Qt QML Viewer}"
+macro.qmlbasictype = "\\e"
macro.param = "\\e"
macro.raisedaster.HTML = "*"
macro.rarrow.HTML = "→"
@@ -161,34 +163,10 @@ Cpp.ignoredirectives = Q_DECLARE_HANDLE \
__attribute__ \
K_DECLARE_PRIVATE \
PHONON_OBJECT \
- PHONON_HEIR
-
-######################## qt-html-templates.qdocconf
-HTML.stylesheets = classic.css
-HTML.postheader = "\n" \
- "\n" \
- "" \
- " " \
- " | \n" \
- " | " \
- "" \
- "
"
-
-HTML.footer = "
\n" \
- "
\n" \
- "| Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies) | \n" \
- "Trademarks | \n" \
- "Qt \\version | \n" \
- "
"
+ PHONON_HEIR \
+ Q_PRIVATE_PROPERTY \
+ Q_DECLARE_PRIVATE_D \
+ Q_CLASSINFO
######################## qt-defines.qdocconf
defines = Q_QDOC \
@@ -208,61 +186,13 @@ versionsym = QT_VERSION_STR
codeindent = 1
-# Files not referenced in any qdoc file (last four needed by qtdemo)
-# See also qhp.Qt.extraFiles
-extraimages.HTML = qt-logo \
- trolltech-logo \
- taskmenuextension-example.png \
- coloreditorfactoryimage.png \
- dynamiclayouts-example.png \
- stylesheet-coffee-plastique.png
-
######################## qt.qdocconf
project = Qt
versionsym =
-version = %VERSION%
+version = @PYSIDE_QT_VERSION@
description = Qt Reference Documentation
-url = http://qt.nokia.com/doc/@PYSIDE_QT_VERSION@
-
-edition.Desktop.modules = QtCore QtDBus QtGui QtNetwork QtOpenGL QtScript QtScriptTools QtSql QtSvg \
- QtWebKit QtXml QtXmlPatterns Qt3Support QtHelp \
- QtDesigner QtAssistant QAxContainer Phonon \
- QAxServer QtUiTools QtTest QtDBus
-edition.DesktopLight.modules = QtCore QtDBus QtGui Qt3SupportLight QtTest
-edition.DesktopLight.groups = -graphicsview-api
-
-qhp.projects = Qt
-
-qhp.Qt.file = qt.qhp
-qhp.Qt.namespace = com.trolltech.qt.460
-qhp.Qt.virtualFolder = qdoc
-qhp.Qt.indexTitle = Qt Reference Documentation
-qhp.Qt.indexRoot =
-
-# Files not referenced in any qdoc file (last four are needed by qtdemo)
-# See also extraimages.HTML
-qhp.Qt.extraFiles = classic.css \
- images/qt-logo.png \
- images/taskmenuextension-example.png \
- images/coloreditorfactoryimage.png \
- images/dynamiclayouts-example.png \
- images/stylesheet-coffee-plastique.png
-
-qhp.Qt.filterAttributes = qt @PYSIDE_QT_VERSION@ qtrefdoc
-qhp.Qt.customFilters.Qt.name = Qt @PYSIDE_QT_VERSION@
-qhp.Qt.customFilters.Qt.filterAttributes = qt @PYSIDE_QT_VERSION@
-qhp.Qt.subprojects = classes overviews examples
-qhp.Qt.subprojects.classes.title = Classes
-qhp.Qt.subprojects.classes.indexTitle = Qt's Classes
-qhp.Qt.subprojects.classes.selectors = class fake:headerfile
-qhp.Qt.subprojects.classes.sortPages = true
-qhp.Qt.subprojects.overviews.title = Overviews
-qhp.Qt.subprojects.overviews.indexTitle = All Overviews and HOWTOs
-qhp.Qt.subprojects.overviews.selectors = fake:page,group,module
-qhp.Qt.subprojects.examples.title = Tutorials and Examples
-qhp.Qt.subprojects.examples.indexTitle = Qt Examples
-qhp.Qt.subprojects.examples.selectors = fake:example
+url = http://www.pyside.org/docs/pyside-@PYSIDE_QT_VERSION@
language = Cpp
@@ -306,26 +236,19 @@ excludedirs = @QT_SRC_DIR@/src/3rdparty/clucene \
@QT_SRC_DIR@/src/3rdparty/webkit/WebCore \
@QT_SRC_DIR@/src/3rdparty/wintab \
@QT_SRC_DIR@/src/3rdparty/zlib \
- @QT_SRC_DIR@/doc/src/snippets \
@QT_SRC_DIR@/src/3rdparty/phonon/gstreamer \
@QT_SRC_DIR@/src/3rdparty/phonon/ds9 \
@QT_SRC_DIR@/src/3rdparty/phonon/qt7 \
@QT_SRC_DIR@/src/3rdparty/phonon/mmf \
- @QT_SRC_DIR@/src/3rdparty/phonon/waveout
+ @QT_SRC_DIR@/src/3rdparty/phonon/waveout \
+ @QT_SRC_DIR@/doc/src/snippets \
+ @QT_SRC_DIR@/doc/src/ja_JP \
+ @QT_SRC_DIR@/doc/src/zh_CN
sources.fileextensions = "*.cpp *.qdoc *.mm"
examples.fileextensions = "*.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp"
examples.imageextensions = "*.png"
-exampledirs = @QT_SRC_DIR@/doc/src \
- @QT_SRC_DIR@/examples \
- @QT_SRC_DIR@/examples/tutorials \
- @QT_SRC_DIR@ \
- @QT_SRC_DIR@/qmake/examples \
- @QT_SRC_DIR@/src/3rdparty/webkit/WebKit/qt/docs
-imagedirs = @QT_SRC_DIR@/doc/src/images \
- @QT_SRC_DIR@/examples
-outputdir = @QT_SRC_DIR@/doc/html
tagfile = @QT_SRC_DIR@/doc/html/qt.tags
base = file:@QT_SRC_DIR@/doc/html
From 673c0d26757526a068e758195d235c047150d789 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Wed, 6 Oct 2010 11:40:42 -0300
Subject: [PATCH 0295/1129] Added documentation to QPyTextObject class.
---
PySide/qpytextobject.cpp | 33 +++++++++++++++++++++++++++++++++
doc/pyside.qdocconf.in | 6 ++++--
2 files changed, 37 insertions(+), 2 deletions(-)
create mode 100644 PySide/qpytextobject.cpp
diff --git a/PySide/qpytextobject.cpp b/PySide/qpytextobject.cpp
new file mode 100644
index 0000000..90462f5
--- /dev/null
+++ b/PySide/qpytextobject.cpp
@@ -0,0 +1,33 @@
+/*
+ * This file is part of the PySide project.
+ *
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * Contact: PySide team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "qpytextobject.h"
+
+/*!
+ \class QPyTextObject
+ \brief Workaround to make possible use QTextObjectInterface on PySide.
+ \ingroup richtext-processing
+ Due to the technical details of how to bind C++ classes to Python, you need to use this class when you need to implement
+ your own QTextObjectInterface rather than create a class inheriting from QObject and QTextObjectInterface.
+
+ \sa QTextObjectInterface
+*/
diff --git a/doc/pyside.qdocconf.in b/doc/pyside.qdocconf.in
index 76f4680..1c8d0e3 100644
--- a/doc/pyside.qdocconf.in
+++ b/doc/pyside.qdocconf.in
@@ -205,7 +205,8 @@ headerdirs = @QT_SRC_DIR@/src \
@QT_SRC_DIR@/tools/designer/src/lib/sdk \
@QT_SRC_DIR@/tools/designer/src/lib/uilib \
@QT_SRC_DIR@/tools/qtestlib/src \
- @QT_SRC_DIR@/tools/qdbus/src
+ @QT_SRC_DIR@/tools/qdbus/src \
+ @pyside_SOURCE_DIR@
sourcedirs = @QT_SRC_DIR@/src \
@QT_SRC_DIR@/doc/src \
@QT_SRC_DIR@/extensions/activeqt \
@@ -216,7 +217,8 @@ sourcedirs = @QT_SRC_DIR@/src \
@QT_SRC_DIR@/tools/designer/src/lib/sdk \
@QT_SRC_DIR@/tools/designer/src/lib/uilib \
@QT_SRC_DIR@/tools/qtestlib/src \
- @QT_SRC_DIR@/tools/qdbus
+ @QT_SRC_DIR@/tools/qdbus \
+ @pyside_SOURCE_DIR@
excludedirs = @QT_SRC_DIR@/src/3rdparty/clucene \
@QT_SRC_DIR@/src/3rdparty/des \
From 6b8d262b4067bffd4e5a9611c07b862aa64d2538 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Wed, 6 Oct 2010 14:48:25 -0300
Subject: [PATCH 0296/1129] Workaround to change the documentation about the
return value of some functions.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Reviewer: Renato Araújo
Luciano Wolf
---
PySide/QtCore/typesystem_core.xml | 7 +++++--
PySide/QtGui/typesystem_gui_common.xml | 11 +++++++----
PySide/QtNetwork/typesystem_network.xml | 6 +++---
PySide/QtOpenGL/typesystem_opengl.xml | 3 +++
PySide/QtWebKit/typesystem_webkit.xml | 3 +++
PySide/QtXml/typesystem_xml.xml | 24 ++++++++++++++++++++++++
6 files changed, 45 insertions(+), 9 deletions(-)
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 704e8d4..37decba 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -1867,6 +1867,9 @@
+
+
+
qint64 pid;
%RETURN_TYPE retval = %TYPE::%FUNCTION_NAME(%1, %2, %3, &pid);
@@ -2531,7 +2534,7 @@
-
+
%PYARG_0 = PySet_New(0);
foreach(QAbstractState* abs_state, %CPPSELF.configuration()) {
@@ -2542,7 +2545,7 @@
-
+
%PYARG_0 = PyList_New(0);
foreach(QAbstractAnimation* abs_anim, %CPPSELF.defaultAnimations()) {
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index 29b1657..68d5c0d 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -1156,6 +1156,9 @@
+
+
+
QGraphicsItem *item_ = NULL;
%RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(&item_);
@@ -3664,7 +3667,7 @@
-
+
@@ -3675,7 +3678,7 @@
-
+
@@ -3686,7 +3689,7 @@
-
+
@@ -3892,7 +3895,7 @@
-
+
%RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, %2);
diff --git a/PySide/QtNetwork/typesystem_network.xml b/PySide/QtNetwork/typesystem_network.xml
index 5e09ab7..0321a65 100644
--- a/PySide/QtNetwork/typesystem_network.xml
+++ b/PySide/QtNetwork/typesystem_network.xml
@@ -118,7 +118,7 @@
-
+
@@ -145,7 +145,7 @@
-
+
@@ -170,7 +170,7 @@
-
+
diff --git a/PySide/QtOpenGL/typesystem_opengl.xml b/PySide/QtOpenGL/typesystem_opengl.xml
index 2a7557e..b94e8af 100644
--- a/PySide/QtOpenGL/typesystem_opengl.xml
+++ b/PySide/QtOpenGL/typesystem_opengl.xml
@@ -136,6 +136,9 @@
+
+
+
char *data = new char[%3];
bool result = %CPPSELF.read(%1, data, %3);
diff --git a/PySide/QtWebKit/typesystem_webkit.xml b/PySide/QtWebKit/typesystem_webkit.xml
index 1c39111..f11c6e3 100644
--- a/PySide/QtWebKit/typesystem_webkit.xml
+++ b/PySide/QtWebKit/typesystem_webkit.xml
@@ -76,6 +76,9 @@
+
+
+
QString str;
%RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, &str);
diff --git a/PySide/QtXml/typesystem_xml.xml b/PySide/QtXml/typesystem_xml.xml
index 4cccb8a..f5d6f2c 100644
--- a/PySide/QtXml/typesystem_xml.xml
+++ b/PySide/QtXml/typesystem_xml.xml
@@ -68,6 +68,9 @@
+
+
+
@@ -85,6 +88,9 @@
+
+
+
@@ -102,6 +108,9 @@
+
+
+
@@ -119,6 +128,9 @@
+
+
+
@@ -136,6 +148,9 @@
+
+
+
@@ -153,6 +168,9 @@
+
+
+
@@ -170,6 +188,9 @@
+
+
+
@@ -187,6 +208,9 @@
+
+
+
From 15b0e9aa2b16109aa293ab446a8edc533af56658 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Wed, 6 Oct 2010 14:49:12 -0300
Subject: [PATCH 0297/1129] Add a d-pointer to DynamicMetaObject.
This break the ABI.
---
libpyside/dynamicqmetaobject.cpp | 111 ++++++++++++++++++-------------
libpyside/dynamicqmetaobject.h | 54 ++-------------
libpyside/dynamicqmetaobject_p.h | 69 +++++++++++++++++++
libpyside/qproperty.cpp | 2 +-
libpyside/qslot.cpp | 2 +-
5 files changed, 138 insertions(+), 100 deletions(-)
create mode 100644 libpyside/dynamicqmetaobject_p.h
diff --git a/libpyside/dynamicqmetaobject.cpp b/libpyside/dynamicqmetaobject.cpp
index 6c7710f..f8902c6 100644
--- a/libpyside/dynamicqmetaobject.cpp
+++ b/libpyside/dynamicqmetaobject.cpp
@@ -21,10 +21,12 @@
*/
#include "dynamicqmetaobject.h"
+#include "dynamicqmetaobject_p.h"
#include
#include
#include
#include
+#include
#include
#include
#include
@@ -66,6 +68,18 @@ enum PropertyFlags {
Notify = 0x00400000
};
+class DynamicQMetaObject::DynamicQMetaObjectPrivate
+{
+public:
+ QLinkedList m_signals;
+ QLinkedList m_slots;
+ QLinkedList m_properties;
+ QByteArray m_className;
+
+ void updateMetaObject(QMetaObject* metaObj);
+ void writeMethodsData(QLinkedList& methods, unsigned int** data, QList* strings, int* prtIndex, int maxCount, int nullIndex, int flags);
+};
+
static int registerString(const QByteArray& s, QList* strings)
{
int idx = 0;
@@ -266,76 +280,77 @@ bool PropertyData::operator==(const char* name) const
}
-DynamicQMetaObject::DynamicQMetaObject(const char* className, const QMetaObject* metaObject)
+DynamicQMetaObject::DynamicQMetaObject(const char* className, const QMetaObject* metaObject) : m_d(new DynamicQMetaObjectPrivate)
{
d.superdata = metaObject;
d.stringdata = 0;
d.data = 0;
d.extradata = 0;
- m_className = QByteArray(className);
- updateMetaObject();
+ m_d->m_className = QByteArray(className);
+ m_d->updateMetaObject(this);
}
DynamicQMetaObject::~DynamicQMetaObject()
{
delete[] d.stringdata;
delete[] d.data;
+ delete m_d;
}
void DynamicQMetaObject::addSignal(const char* signal, const char* type)
{
- QLinkedList::iterator i = qFind(m_signals.begin(), m_signals.end(), signal);
- if (i != m_signals.end())
+ QLinkedList::iterator i = qFind(m_d->m_signals.begin(), m_d->m_signals.end(), signal);
+ if (i != m_d->m_signals.end())
return;
//search for a empty space
MethodData blank;
- i = qFind(m_signals.begin(), m_signals.end(), blank);
- if (i != m_signals.end()) {
+ i = qFind(m_d->m_signals.begin(), m_d->m_signals.end(), blank);
+ if (i != m_d->m_signals.end()) {
*i = MethodData(signal, type);
- updateMetaObject();
+ m_d->updateMetaObject(this);
return;
}
- int maxSignals = maxSignalsCount(m_className);
- if (m_signals.size() >= maxSignals) {
+ int maxSignals = maxSignalsCount(m_d->m_className);
+ if (m_d->m_signals.size() >= maxSignals) {
qWarning() << "Fail to add dynamic signal to QObject. PySide support at most" << maxSignals << "dynamic signals.";
return;
}
- m_signals << MethodData(signal, type);
- updateMetaObject();
+ m_d->m_signals << MethodData(signal, type);
+ m_d->updateMetaObject(this);
}
void DynamicQMetaObject::addSlot(const char* slot, const char* type)
{
- QLinkedList::iterator i = qFind(m_slots.begin(), m_slots.end(), slot);
- if (i != m_slots.end())
+ QLinkedList::iterator i = qFind(m_d->m_slots.begin(), m_d->m_slots.end(), slot);
+ if (i != m_d->m_slots.end())
return;
- int maxSlots = maxSlotsCount(m_className);
- if (m_slots.size() >= maxSlots) {
+ int maxSlots = maxSlotsCount(m_d->m_className);
+ if (m_d->m_slots.size() >= maxSlots) {
qWarning() << "Fail to add dynamic slot to QObject. PySide support at most" << maxSlots << "dynamic slots.";
return;
}
//search for a empty space
MethodData blank;
- i = qFind(m_slots.begin(), m_slots.end(), blank);
- if (i != m_slots.end())
+ i = qFind(m_d->m_slots.begin(), m_d->m_slots.end(), blank);
+ if (i != m_d->m_slots.end())
*i = MethodData(slot, type);
else
- m_slots << MethodData(slot, type);
- updateMetaObject();
+ m_d->m_slots << MethodData(slot, type);
+ m_d->updateMetaObject(this);
}
void DynamicQMetaObject::removeSlot(uint index)
{
QMetaMethod m = method(index);
- foreach(MethodData md, m_slots) {
+ foreach(MethodData md, m_d->m_slots) {
if (md.signature() == m.signature()) {
md.clear();
- updateMetaObject();
+ m_d->updateMetaObject(this);
break;
}
}
@@ -343,19 +358,19 @@ void DynamicQMetaObject::removeSlot(uint index)
void DynamicQMetaObject::addProperty(const char* property, PyObject* data)
{
- QLinkedList::iterator i = qFind(m_properties.begin(), m_properties.end(), property);
- if (i != m_properties.end())
+ QLinkedList::iterator i = qFind(m_d->m_properties.begin(), m_d->m_properties.end(), property);
+ if (i != m_d->m_properties.end())
return;
//search for a empty space
PropertyData blank;
- i = qFind(m_properties.begin(), m_properties.end(), blank);
- if (i != m_properties.end()) {
+ i = qFind(m_d->m_properties.begin(), m_d->m_properties.end(), blank);
+ if (i != m_d->m_properties.end()) {
*i = PropertyData(property, data);
} else {
- m_properties << PropertyData(property, data);
+ m_d->m_properties << PropertyData(property, data);
}
- updateMetaObject();
+ m_d->updateMetaObject(this);
}
@@ -412,46 +427,46 @@ void DynamicQMetaObject::removeSignal(uint index)
{
//Current Qt implementation does not support runtime remove signal
QMetaMethod m = method(index);
- foreach(MethodData md, m_signals) {
+ foreach(MethodData md, m_d->m_signals) {
if (md.signature() == m.signature()) {
md.clear();
- updateMetaObject();
+ m_d->updateMetaObject(this);
break;
}
}
}
-void DynamicQMetaObject::writeMethodsData(QLinkedList& methods,
- unsigned int **data,
- QList *strings,
- int *prtIndex,
- int max_count,
- int null_index,
- int flags)
+void DynamicQMetaObject::DynamicQMetaObjectPrivate::writeMethodsData(QLinkedList& methods,
+ unsigned int** data,
+ QList* strings,
+ int* prtIndex,
+ int maxCount,
+ int nullIndex,
+ int flags)
{
int index = *prtIndex;
QLinkedList::iterator iMethod = methods.begin();
- for(int i=0; i < max_count; i++) {
+ for(int i=0; i < maxCount; i++) {
QByteArray mType;
if (iMethod != methods.end() && ((*iMethod).signature().size() > 0) ) {
(*data)[index++] = registerString((*iMethod).signature(), strings); // func name
mType = (*iMethod).type();
} else {
- (*data)[index++] = null_index; // func name
+ (*data)[index++] = nullIndex; // func name
}
- (*data)[index++] = null_index; // arguments
- (*data)[index++] = (mType.size() > 0 ? registerString(mType, strings) : null_index); // normalized type
- (*data)[index++] = null_index; // tags
+ (*data)[index++] = nullIndex; // arguments
+ (*data)[index++] = (mType.size() > 0 ? registerString(mType, strings) : nullIndex); // normalized type
+ (*data)[index++] = nullIndex; // tags
(*data)[index++] = flags;
- if (iMethod != methods.end())
+ if (iMethod != methods.end())
iMethod++;
}
*prtIndex = index;
}
-void DynamicQMetaObject::updateMetaObject()
+void DynamicQMetaObject::DynamicQMetaObjectPrivate::updateMetaObject(QMetaObject* metaObj)
{
// these values are from moc source code, generator.cpp:66
enum MethodFlags {
@@ -485,7 +500,7 @@ void DynamicQMetaObject::updateMetaObject()
const int HEADER_LENGHT = sizeof(header)/sizeof(int);
header[5] = HEADER_LENGHT;
// header size + 5 indexes per method + an ending zero
- delete[] d.data;
+ delete[] metaObj->d.data;
unsigned int* data;
data = new unsigned int[HEADER_LENGHT + n_methods*5 + n_properties*3 + 1];
std::memcpy(data, header, sizeof(header));
@@ -524,9 +539,9 @@ void DynamicQMetaObject::updateMetaObject()
str.append(char(0));
}
- delete[] d.stringdata;
+ delete[] metaObj->d.stringdata;
char* stringData = new char[str.count()];
std::copy(str.begin(), str.end(), stringData);
- d.data = data;
- d.stringdata = stringData;
+ metaObj->d.data = data;
+ metaObj->d.stringdata = stringData;
}
diff --git a/libpyside/dynamicqmetaobject.h b/libpyside/dynamicqmetaobject.h
index 22387a6..b2f018e 100644
--- a/libpyside/dynamicqmetaobject.h
+++ b/libpyside/dynamicqmetaobject.h
@@ -26,59 +26,18 @@
#include "pysidemacros.h"
#include
#include
-#include
-#include
-#include
-
-#define PYSIDE_SLOT_LIST_ATTR "_slots"
-
-class QObject;
namespace PySide
{
-class MethodData
-{
-public:
- MethodData(){}
- MethodData(const char* signature, const char* type);
- void clear();
- bool isValid() const;
- QByteArray signature() const;
- QByteArray type() const;
- bool operator==(const MethodData& other) const;
- bool operator==(const char* other) const;
-
-private:
- QSharedPointer m_signature;
- QSharedPointer m_type;
-};
-
-class PropertyData
-{
-public:
- PropertyData();
- PropertyData(const char*name, PyObject *data);
- QByteArray name() const;
- QByteArray type() const;
- uint flags() const;
- bool isValid() const;
- bool operator==(const PropertyData& other) const;
- bool operator==(const char* name) const;
-
-private:
- QByteArray m_name;
- PyObject* m_data;
-};
-
class PYSIDE_API DynamicQMetaObject : public QMetaObject
{
public:
DynamicQMetaObject(const char* className, const QMetaObject* metaObject);
~DynamicQMetaObject();
- void addSignal(const char* signal, const char* type=0);
- void addSlot(const char* slot, const char* type=0);
+ void addSignal(const char* signal, const char* type = 0);
+ void addSlot(const char* slot, const char* type = 0);
void addProperty(const char* property, PyObject* data);
void removeSignal(uint idex);
@@ -89,13 +48,8 @@ public:
static DynamicQMetaObject* createBasedOn(PyObject* obj, PyTypeObject* type, const QMetaObject* base);
private:
- QLinkedList m_signals;
- QLinkedList m_slots;
- QLinkedList m_properties;
- QByteArray m_className;
-
- void updateMetaObject();
- void writeMethodsData(QLinkedList& methods, unsigned int **data, QList *strings, int *index, int max_count, int null_index, int flags);
+ class DynamicQMetaObjectPrivate;
+ DynamicQMetaObjectPrivate* m_d;
};
PYSIDE_API inline void deleteDynamicQMetaObject(void* data)
diff --git a/libpyside/dynamicqmetaobject_p.h b/libpyside/dynamicqmetaobject_p.h
new file mode 100644
index 0000000..4488f07
--- /dev/null
+++ b/libpyside/dynamicqmetaobject_p.h
@@ -0,0 +1,69 @@
+/*
+ * This file is part of the PySide project.
+ *
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * Contact: PySide team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef DYNAMICMETAPROPERTY_P_H
+#define DYNAMICMETAPROPERTY_P_H
+
+#include
+#include
+#include
+
+#define PYSIDE_SLOT_LIST_ATTR "_slots"
+
+namespace PySide
+{
+ class MethodData
+ {
+ public:
+ MethodData(){}
+ MethodData(const char* signature, const char* type);
+ void clear();
+ bool isValid() const;
+ QByteArray signature() const;
+ QByteArray type() const;
+ bool operator==(const MethodData& other) const;
+ bool operator==(const char* other) const;
+
+ private:
+ QSharedPointer m_signature;
+ QSharedPointer m_type;
+ };
+
+ class PropertyData
+ {
+ public:
+ PropertyData();
+ PropertyData(const char* name, PyObject* data);
+ QByteArray name() const;
+ QByteArray type() const;
+ uint flags() const;
+ bool isValid() const;
+ bool operator==(const PropertyData& other) const;
+ bool operator==(const char* name) const;
+
+ private:
+ QByteArray m_name;
+ PyObject* m_data;
+ };
+}
+
+#endif
diff --git a/libpyside/qproperty.cpp b/libpyside/qproperty.cpp
index 7453876..7a35edb 100644
--- a/libpyside/qproperty.cpp
+++ b/libpyside/qproperty.cpp
@@ -25,7 +25,7 @@
#include
#include "qproperty.h"
-
+#include "dynamicqmetaobject_p.h"
#define QPROPERTY_CLASS_NAME "Property"
diff --git a/libpyside/qslot.cpp b/libpyside/qslot.cpp
index 3c7f4fc..273de27 100644
--- a/libpyside/qslot.cpp
+++ b/libpyside/qslot.cpp
@@ -21,7 +21,7 @@
*/
#include
-#include
+#include "dynamicqmetaobject_p.h"
#include
From 9257cd1783c96401b4736e48b1f9741624183124 Mon Sep 17 00:00:00 2001
From: Hugo Parente Lima
Date: Wed, 6 Oct 2010 15:28:20 -0300
Subject: [PATCH 0298/1129] Changed name of qproperty functions
---
libpyside/dynamicqmetaobject.cpp | 20 ++++++++++----------
libpyside/pyside.cpp | 2 +-
libpyside/qproperty.cpp | 28 ++++++++++++++--------------
libpyside/qproperty.h | 28 ++++++++++++++--------------
libpyside/signalmanager.cpp | 8 ++++----
5 files changed, 43 insertions(+), 43 deletions(-)
diff --git a/libpyside/dynamicqmetaobject.cpp b/libpyside/dynamicqmetaobject.cpp
index f8902c6..89a35ef 100644
--- a/libpyside/dynamicqmetaobject.cpp
+++ b/libpyside/dynamicqmetaobject.cpp
@@ -159,39 +159,39 @@ uint PropertyData::flags() const
else if (!isQRealType(typeName))
flags |= qvariant_nameToType(typeName) << 24;
- if (qproperty_is_readble(m_data))
+ if (qpropertyIsReadable(m_data))
flags |= Readable;
- if (qproperty_is_writable(m_data))
+ if (qpropertyIsWritable(m_data))
flags |= Writable;
- if (qproperty_has_reset(m_data))
+ if (qpropertyHasReset(m_data))
flags |= Resettable;
- if (!qproperty_is_designable(m_data))
+ if (!qpropertyIsDesignable(m_data))
flags |= ResolveDesignable;
else
flags |= Designable;
- if (!qproperty_is_scriptable(m_data))
+ if (!qpropertyIsScriptable(m_data))
flags |= ResolveScriptable;
else
flags |= Scriptable;
- if (!qproperty_is_stored(m_data))
+ if (!qpropertyIsStored(m_data))
flags |= ResolveStored;
else
flags |= Stored;
- if (!qproperty_is_user(m_data))
+ if (!qpropertyIsUser(m_data))
flags |= ResolveUser;
else
flags |= User;
- if (qproperty_is_constant(m_data))
+ if (qpropertyIsConstant(m_data))
flags |= Constant;
- if (qproperty_is_final(m_data))
+ if (qpropertyIsFinal(m_data))
flags |= Final;
return flags;
@@ -255,7 +255,7 @@ PropertyData::PropertyData(const char* name, PyObject* data)
QByteArray PropertyData::type() const
{
- return QByteArray(qproperty_get_type(m_data));
+ return QByteArray(qpropertyGetType(m_data));
}
diff --git a/libpyside/pyside.cpp b/libpyside/pyside.cpp
index 9b8c4cc..bb22fa7 100644
--- a/libpyside/pyside.cpp
+++ b/libpyside/pyside.cpp
@@ -69,7 +69,7 @@ bool fillQtProperties(PyObject* qObj, const QMetaObject* metaObj, PyObject* kwds
} else {
PyObject* attr = PyObject_GenericGetAttr(qObj, key);
if (isQPropertyType(attr))
- PySide::qproperty_set(attr, qObj, value);
+ PySide::qpropertySet(attr, qObj, value);
}
} else {
propName.append("()");
diff --git a/libpyside/qproperty.cpp b/libpyside/qproperty.cpp
index 7a35edb..32ff8a8 100644
--- a/libpyside/qproperty.cpp
+++ b/libpyside/qproperty.cpp
@@ -164,7 +164,7 @@ bool isQPropertyType(PyObject* pyObj)
return false;
}
-int qproperty_set(PyObject* self, PyObject* source, PyObject* value)
+int qpropertySet(PyObject* self, PyObject* source, PyObject* value)
{
QPropertyData *data = reinterpret_cast(self);
if (data->fset) {
@@ -181,7 +181,7 @@ int qproperty_set(PyObject* self, PyObject* source, PyObject* value)
return -1;
}
-PyObject* qproperty_get(PyObject* self, PyObject* source)
+PyObject* qpropertyGet(PyObject* self, PyObject* source)
{
QPropertyData *data = reinterpret_cast(self);
if (data->fget) {
@@ -193,7 +193,7 @@ PyObject* qproperty_get(PyObject* self, PyObject* source)
return 0;
}
-int qproperty_reset(PyObject* self, PyObject* source)
+int qpropertyReset(PyObject* self, PyObject* source)
{
QPropertyData *data = reinterpret_cast(self);
if (data->freset) {
@@ -207,13 +207,13 @@ int qproperty_reset(PyObject* self, PyObject* source)
}
-const char* qproperty_get_type(PyObject* self)
+const char* qpropertyGetType(PyObject* self)
{
QPropertyData *data = reinterpret_cast(self);
return data->typeName;
}
-PyObject* qproperty_get_object(PyObject* source, PyObject* name)
+PyObject* qpropertyGetObject(PyObject* source, PyObject* name)
{
PyObject* attr = PyObject_GenericGetAttr(source, name);
if (attr && isQPropertyType(attr))
@@ -249,55 +249,55 @@ char* translate_type_name(PyObject* type)
return 0;
}
-bool qproperty_is_readble(PyObject* self)
+bool qpropertyIsReadable(PyObject* self)
{
QPropertyData *data = reinterpret_cast(self);
return (data->fget != 0);
}
-bool qproperty_is_writable(PyObject* self)
+bool qpropertyIsWritable(PyObject* self)
{
QPropertyData *data = reinterpret_cast(self);
return (data->fset != 0);
}
-bool qproperty_has_reset(PyObject* self)
+bool qpropertyHasReset(PyObject* self)
{
QPropertyData *data = reinterpret_cast(self);
return (data->freset != 0);
}
-bool qproperty_is_designable(PyObject* self)
+bool qpropertyIsDesignable(PyObject* self)
{
QPropertyData *data = reinterpret_cast(self);
return data->designable;
}
-bool qproperty_is_scriptable(PyObject* self)
+bool qpropertyIsScriptable(PyObject* self)
{
QPropertyData *data = reinterpret_cast