Compare commits
4 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f011ce2cb9 | ||
|
|
fe8dc36f90 | ||
|
|
db6f1e3306 | ||
|
|
d30a8672c3 |
6 changed files with 30 additions and 7 deletions
|
|
@ -5,8 +5,7 @@ project(pysidebindings)
|
|||
cmake_minimum_required(VERSION 2.6)
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Macros/
|
||||
${CMAKE_MODULE_PATH})
|
||||
find_package(GeneratorRunner 0.6.16 REQUIRED)
|
||||
find_package(Shiboken 1.1.0 REQUIRED)
|
||||
find_package(Shiboken 1.1.1 REQUIRED)
|
||||
find_package(Qt4 4.5.0 REQUIRED)
|
||||
find_file(GL_H "gl.h" PATH_SUFFIXES "GL")
|
||||
include(FindQt4Extra)
|
||||
|
|
@ -63,7 +62,7 @@ endif()
|
|||
set(BINDING_NAME PySide)
|
||||
set(BINDING_API_MAJOR_VERSION "1")
|
||||
set(BINDING_API_MINOR_VERSION "1")
|
||||
set(BINDING_API_MICRO_VERSION "0")
|
||||
set(BINDING_API_MICRO_VERSION "1")
|
||||
set(BINDING_API_RELEASE_LEVEL "final") # alpha, beta, rc, or final
|
||||
set(BINDING_API_SERIAL 1) # leave as 0 when release level is final
|
||||
set(BINDING_API_VERSION "${BINDING_API_MAJOR_VERSION}.${BINDING_API_MINOR_VERSION}.${BINDING_API_MICRO_VERSION}" CACHE STRING "PySide version" FORCE)
|
||||
|
|
|
|||
|
|
@ -1257,6 +1257,13 @@
|
|||
%0 = new %TYPE(date, time, Qt::TimeSpec(%8));
|
||||
</inject-code>
|
||||
</add-function>
|
||||
<add-function signature="QDateTime(int, int, int, int, int, int)">
|
||||
<inject-code class="target" position="beginning">
|
||||
QDate date(%1, %2, %3);
|
||||
QTime time(%4, %5, %6);
|
||||
%0 = new %TYPE(date, time);
|
||||
</inject-code>
|
||||
</add-function>
|
||||
<add-function signature="__repr__" return-type="PyObject*">
|
||||
<inject-code class="target" position="beginning">
|
||||
<insert-template name="repr_code">
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ macro(create_pyside_module module_name module_include_dir module_libraries modul
|
|||
endif()
|
||||
|
||||
add_custom_command(OUTPUT ${${module_sources}}
|
||||
COMMAND ${GENERATORRUNNER_BINARY} ${GENERATOR_EXTRA_FLAGS}
|
||||
COMMAND ${SHIBOKEN_BINARY} ${GENERATOR_EXTRA_FLAGS}
|
||||
${pyside_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}}
|
||||
|
|
@ -71,7 +71,7 @@ macro(check_qt_class module class optional_source_files dropped_entries)
|
|||
endif ()
|
||||
string(TOLOWER ${class} _class)
|
||||
string(TOUPPER ${module} _module)
|
||||
if (${namespace})
|
||||
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)
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ configure_file("conf.py.in" "rst/conf.py" @ONLY)
|
|||
configure_file(typesystem_doc.xml.in typesystem_doc.xml @ONLY)
|
||||
|
||||
add_custom_target("docrsts"
|
||||
COMMAND ${GENERATORRUNNER_BINARY} --generator-set=qtdoc
|
||||
COMMAND ${SHIBOKEN_BINARY} --generator-set=qtdoc
|
||||
${pyside_BINARY_DIR}/pyside_global.h
|
||||
--include-paths="${QT_INCLUDE_DIR}${PATH_SEP}${pyside_SOURCE_DIR}"
|
||||
--api-version=${SUPPORTED_QT_VERSION}
|
||||
|
|
|
|||
|
|
@ -43,5 +43,22 @@ class TestDateTimeConversions (unittest.TestCase):
|
|||
|
||||
self.assertEqual(dateTime, other.toPython())
|
||||
|
||||
def testQDateTime6arg(self):
|
||||
dateTime = datetime.datetime(2010, 4, 23, 11, 14, 7)
|
||||
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/1000, otherTime.msec())
|
||||
|
||||
self.assertEqual(dateTime, other.toPython())
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/testbinding/testbinding_module_wrapper.cpp
|
|||
)
|
||||
|
||||
add_custom_command(OUTPUT ${testbinding_SRC}
|
||||
COMMAND ${GENERATORRUNNER_BINARY} ${GENERATOR_EXTRA_FLAGS}
|
||||
COMMAND ${SHIBOKEN_BINARY} ${GENERATOR_EXTRA_FLAGS}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/pysidetest_global.h
|
||||
--include-paths=${pyside_BINARY_DIR}${PATH_SEP}${CMAKE_CURRENT_SOURCE_DIR}${PATH_SEP}${QT_INCLUDE_DIR}${PATH_SEP}${QT_QTCORE_INCLUDE_DIR}${PATH_SEP}${QT_QTGUI_INCLUDE_DIR}
|
||||
--typesystem-paths=${CMAKE_CURRENT_SOURCE_DIR}${PATH_SEP}${pyside_SOURCE_DIR}${PATH_SEP}${QtCore_SOURCE_DIR}${PATH_SEP}${QtCore_BINARY_DIR}${PATH_SEP}${QtGui_SOURCE_DIR}${PATH_SEP}${QtGui_BINARY_DIR}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue