aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--PySide/CMakeLists.txt17
-rw-r--r--PySide/QtCore/typesystem_core.xml7
-rw-r--r--PySide/QtGui/CMakeLists.txt4
-rw-r--r--PySide/QtGui/typesystem_gui_common.xml9
-rw-r--r--PySide/QtGui/typesystem_gui_win.xml6
-rw-r--r--PySide/QtNetwork/CMakeLists.txt13
-rw-r--r--PySide/QtNetwork/glue/qudpsocket_read_datagram_glue.cpp2
-rw-r--r--PySide/QtNetwork/typesystem_network.xml13
-rw-r--r--PySide/QtScriptTools/CMakeLists.txt59
-rw-r--r--PySide/QtSvg/CMakeLists.txt12
-rw-r--r--PySide/QtTest/CMakeLists.txt12
-rw-r--r--PySide/QtWebKit/CMakeLists.txt12
-rw-r--r--PySide/global.h.in2
-rw-r--r--PySide/typesystem_templates.xml2
-rw-r--r--libpyside/autoarraypointer.h58
-rw-r--r--libpyside/qproperty.h2
-rw-r--r--libpyside/qsignal.h6
-rw-r--r--tests/CMakeLists.txt4
-rw-r--r--tests/QtCore/qflags_test.py9
-rw-r--r--tests/signals/ref05_test.py2
-rw-r--r--tests/signals/ref06_test.py2
21 files changed, 145 insertions, 108 deletions
diff --git a/PySide/CMakeLists.txt b/PySide/CMakeLists.txt
index 25f267e16..10e0bc71b 100644
--- a/PySide/CMakeLists.txt
+++ b/PySide/CMakeLists.txt
@@ -21,19 +21,24 @@ 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")
+ 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 ${CMAKE_CURRENT_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)
- 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)
@@ -52,16 +57,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 571cc913d..1e371f026 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -127,14 +127,13 @@
<primitive-type name="unsigned int" default-constructor="0"/>
<primitive-type name="signed long" default-constructor="0"/>
<primitive-type name="long"/>
- <primitive-type name="unsigned long" default-constructor="0"/>
- <primitive-type name="WId">
- <!-- FIXME This is a workaround to include some headers needed by some includes (nothing to do with QBool) -->
+ <primitive-type name="unsigned long" default-constructor="0">
+ <!-- FIXME APIExtractor or shiboken do not support multiple includes by primitive type -->
<include file-name="signalmanager.h" location="global"/>
</primitive-type>
<primitive-type name="Qt::HANDLE" target-lang-api-name="PyLong">
<!-- FIXME APIExtractor or shiboken do not support multiple includes by primitive type -->
- <include file-name="QTextDocument" location="global"/>
+ <include file-name="QTextDocument" location="global"/>
</primitive-type>
<primitive-type name="QBool" target-lang-api-name="PyBool">
<conversion-rule file="qbool_conversions.h"/>
diff --git a/PySide/QtGui/CMakeLists.txt b/PySide/QtGui/CMakeLists.txt
index 18ce25601..9d2b89704 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_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index 111096488..80122c297 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -2587,7 +2587,10 @@
<!-- TODO: Support conversions on virtual function -->
<modify-function signature="drawItems(QPainter*, int, QGraphicsItem**, const QStyleOptionGraphicsItem*)">
-
+ <extra-includes>
+ <include file-name="autoarraypointer.h" location="global"/>
+ </extra-includes>
+
<modify-argument index="2">
<remove-argument/>
<conversion-rule class="native">
@@ -2599,7 +2602,7 @@
<replace-type modified-type="PySequence"/>
<conversion-rule class="native">
int numItems = PySequence_Size(%PYARG_1);
- QGraphicsItem *%out[numItems];
+ PySide::AutoArrayPointer&lt;QGraphicsItem*&gt; %out(numItems);
for (int i=0; i &lt; numItems; i++) {
%out[i] = %CONVERTTOCPP[QGraphicsItem*](PySequence_Fast_GET_ITEM(%PYARG_1, i));
}
@@ -2626,7 +2629,7 @@
<conversion-rule class="native">
int numOptions = PySequence_Size(%PYARG_2);
- QStyleOptionGraphicsItem %out[numOptions];
+ PySide::AutoArrayPointer&lt;QStyleOptionGraphicsItem&gt; %out(numOptions);
for (int i=0; i &lt; numOptions; i++) {
%out[i] = %CONVERTTOCPP[QStyleOptionGraphicsItem](PySequence_Fast_GET_ITEM(%PYARG_1, i));
}
diff --git a/PySide/QtGui/typesystem_gui_win.xml b/PySide/QtGui/typesystem_gui_win.xml
new file mode 100644
index 000000000..f44d3d4d2
--- /dev/null
+++ b/PySide/QtGui/typesystem_gui_win.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<typesystem package="PySide.QtGui">
+ <primitive-type name="Qt::HANDLE" target-lang-api-name="PyObject"/>
+ <enum-type name="QPixmap::HBitmapFormat" />
+ <load-typesystem name="typesystem_gui_common.xml" generate="yes"/>
+</typesystem>
diff --git a/PySide/QtNetwork/CMakeLists.txt b/PySide/QtNetwork/CMakeLists.txt
index df3c12964..15504990d 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/QtNetwork/glue/qudpsocket_read_datagram_glue.cpp b/PySide/QtNetwork/glue/qudpsocket_read_datagram_glue.cpp
index 95ece5193..db38f4526 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<char> data(%ARGUMENT_NAMES);
QHostAddress ha;
quint16 port;
diff --git a/PySide/QtNetwork/typesystem_network.xml b/PySide/QtNetwork/typesystem_network.xml
index 9a56b74b9..80a62a4bc 100644
--- a/PySide/QtNetwork/typesystem_network.xml
+++ b/PySide/QtNetwork/typesystem_network.xml
@@ -10,6 +10,7 @@
<rejection class="QIPv6Address" field-name="c"/>
<rejection class="QSslCertificate"/>
+ <enum-type name="QNetworkConfiguration::BearerType" />
<enum-type name="QAbstractSocket::NetworkLayerProtocol"/>
<enum-type name="QAbstractSocket::SocketError"/>
<enum-type name="QAbstractSocket::SocketOption"/>
@@ -53,6 +54,10 @@
</object-type>
<object-type name="QFtp">
+ <extra-includes>
+ <include file-name="autoarraypointer.h" location="global"/>
+ </extra-includes>
+
<modify-function signature="connectToHost(const QString&amp;, quint16)" allow-thread="yes" />
<modify-function signature="login(const QString&amp;, const QString&amp;)" allow-thread="yes" />
<modify-function signature="close()" allow-thread="yes" />
@@ -81,6 +86,10 @@
</object-type>
<object-type name="QHttp">
+ <extra-includes>
+ <include file-name="autoarraypointer.h" location="global"/>
+ </extra-includes>
+
<modify-function signature="closeConnection()" remove="all"/>
<modify-function signature="readAll()" allow-thread="yes"/>
<modify-function signature="read(char*, qint64)" allow-thread="yes">
@@ -115,6 +124,10 @@
</object-type>
<object-type name="QTcpSocket"/>
<object-type name="QUdpSocket">
+ <extra-includes>
+ <include file-name="autoarraypointer.h" location="global"/>
+ </extra-includes>
+
<modify-function signature="readDatagram(char*, qint64, QHostAddress*, quint16*)" allow-thread="yes">
<modify-argument index="1">
<remove-argument/>
diff --git a/PySide/QtScriptTools/CMakeLists.txt b/PySide/QtScriptTools/CMakeLists.txt
index 22860b1d4..39faee45b 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 4119512ce..a56ee3382 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 def84db80..4bf0bca25 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 08e20be02..9039835b4 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 ()
diff --git a/PySide/global.h.in b/PySide/global.h.in
index c9c8ba8f2..cf21bd6cc 100644
--- a/PySide/global.h.in
+++ b/PySide/global.h.in
@@ -345,7 +345,7 @@ QT_END_HEADER
#define QT_NO_DEBUG
#include <QtCore/QtCore>
-#if @ENABLE_MAC@
+#if @ENABLE_MAC@ || @ENABLE_WIN@
#undef qdoc
#endif
#include <QtGui/QtGui>
diff --git a/PySide/typesystem_templates.xml b/PySide/typesystem_templates.xml
index 1de06a1d6..b8c43eebe 100644
--- a/PySide/typesystem_templates.xml
+++ b/PySide/typesystem_templates.xml
@@ -121,7 +121,7 @@
%PYARG_0 = Shiboken::makeTuple(a, b, c, d, e);
</template>
<template name="read_wrapper">
- char _data[%2];
+ PySide::AutoArrayPointer&lt;char&gt; _data(%2);
qint64 _size = %CPPSELF.%FUNCTION_NAME(_data, %2);
if (_size > 0)
%PYARG_0 = %CONVERTTOPYTHON[QByteArray](QByteArray(_data, _size));
diff --git a/libpyside/autoarraypointer.h b/libpyside/autoarraypointer.h
new file mode 100644
index 000000000..433401c43
--- /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 <contact@pyside.org>
+ *
+ * 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 T>
+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
+
diff --git a/libpyside/qproperty.h b/libpyside/qproperty.h
index 7e0e1bc93..f561d47b7 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);
diff --git a/libpyside/qsignal.h b/libpyside/qsignal.h
index b20834367..fe4d5ff07 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);
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index fe4f7ec2f..ce457965e 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()
diff --git a/tests/QtCore/qflags_test.py b/tests/QtCore/qflags_test.py
index 1346c11ef..8b3a48816 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)
diff --git a/tests/signals/ref05_test.py b/tests/signals/ref05_test.py
index 7c53300a5..90766aae7 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 05712b3be..ef7098ddc 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__':