Bump to 1.1.3
[gonvert] / src / maeqt.py
1 from PyQt4 import QtCore
2
3
4 def _null_set_stackable(window, isStackable):
5         pass
6
7
8 def _maemo_set_stackable(window, isStackable):
9         window.setAttribute(QtCore.Qt.WA_Maemo5StackedWindow, isStackable)
10
11
12 try:
13         QtCore.Qt.WA_Maemo5StackedWindow
14         set_stackable = _maemo_set_stackable
15 except AttributeError:
16         set_stackable = _null_set_stackable
17
18
19 def _null_set_autorient(window, isStackable):
20         pass
21
22
23 def _maemo_set_autorient(window, isStackable):
24         window.setAttribute(QtCore.Qt.WA_Maemo5StackedWindow, isStackable)
25
26
27 try:
28         QtCore.Qt.WA_Maemo5AutoOrientation
29         set_autorient = _maemo_set_autorient
30 except AttributeError:
31         set_autorient = _null_set_autorient
32
33
34 def _null_set_landscape(window, isStackable):
35         pass
36
37
38 def _maemo_set_landscape(window, isStackable):
39         window.setAttribute(QtCore.Qt.WA_Maemo5StackedWindow, isStackable)
40
41
42 try:
43         QtCore.Qt.WA_Maemo5LandscapeOrientation
44         set_landscape = _maemo_set_landscape
45 except AttributeError:
46         set_landscape = _null_set_landscape
47
48
49 def _null_set_portrait(window, isStackable):
50         pass
51
52
53 def _maemo_set_portrait(window, isStackable):
54         window.setAttribute(QtCore.Qt.WA_Maemo5StackedWindow, isStackable)
55
56
57 try:
58         QtCore.Qt.WA_Maemo5PortraitOrientation
59         set_portrait = _maemo_set_portrait
60 except AttributeError:
61         set_portrait = _null_set_portrait
62
63
64 def _null_show_progress_indicator(window, isStackable):
65         pass
66
67
68 def _maemo_show_progress_indicator(window, isStackable):
69         window.setAttribute(QtCore.Qt.WA_Maemo5StackedWindow, isStackable)
70
71
72 try:
73         QtCore.Qt.WA_Maemo5ShowProgressIndicator
74         show_progress_indicator = _maemo_show_progress_indicator
75 except AttributeError:
76         show_progress_indicator = _null_show_progress_indicator
77
78
79 def _null_mark_numbers_preferred(widget):
80         pass
81
82
83 def _newqt_mark_numbers_preferred(widget):
84         widget.setInputMethodHints(QtCore.Qt.ImhPreferNumbers)
85
86
87 try:
88         QtCore.Qt.ImhPreferNumbers
89         mark_numbers_preferred = _newqt_mark_numbers_preferred
90 except AttributeError:
91         mark_numbers_preferred = _null_mark_numbers_preferred