views.mainwindow: Remove unused import
[git-cola.git] / cola / qtcompat.py
blobef0636ce1f69d0277141fdcd13298814760412af
1 from PyQt4 import QtGui
2 from PyQt4 import QtCore
4 def install():
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'):
18 return
19 nested = QtGui.QMainWindow.AllowNestedDocks
20 tabbed = QtGui.QMainWindow.AllowTabbedDocks
21 animated = QtGui.QMainWindow.AnimatedDocks
22 window.setDockOptions(nested | tabbed | animated)