1 from PyQt4
import QtGui
2 from PyQt4
import QtCore
5 if not hasattr(QtGui
.QHBoxLayout
, 'setContentsMargins'):
6 QtGui
.QHBoxLayout
.setContentsMargins
= lambda *args
: True
8 if not hasattr(QtGui
.QVBoxLayout
, 'setContentsMargins'):
9 QtGui
.QVBoxLayout
.setContentsMargins
= lambda *args
: True
12 def add_search_path(prefix
, path
):
13 if hasattr(QtCore
.QDir
, 'addSearchPath'):
14 QtCore
.QDir
.addSearchPath(prefix
, path
)
16 def set_common_dock_options(window
):
17 if not hasattr(window
, 'setDockOptions'):
19 nested
= QtGui
.QMainWindow
.AllowNestedDocks
20 tabbed
= QtGui
.QMainWindow
.AllowTabbedDocks
21 animated
= QtGui
.QMainWindow
.AnimatedDocks
22 window
.setDockOptions(nested | tabbed | animated
)