2 from PyQt4.QtGui import QHeaderView, QStandardItemModel, QToolButton, QFrame, QVBoxLayout, QSizePolicy
8 QFrame.__init__(self, parent)
9 self.setFrameShadow(QFrame.Raised)
10 self.setFrameStyle(QFrame.StyledPanel)
11 self.setLayout(QVBoxLayout())
12 self.layout().setContentsMargins(0, 0, 0, 0)
13 self.layout().setSpacing(0)
19 if isinstance(widget, QFrame):
20 widget.setFrameStyle(QFrame.NoFrame)
29 QHeaderView.__init__(self, orientation, parent)
31 self.setModel(QStandardItemModel(self))
32 self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
33 self.setStretchLastSection(
True)
34 self.setFixedHeight(25)
39 self._menuButton.setText(label)
46 if self.orientation() == Qt.Horizontal:
47 self.model().setHorizontalHeaderLabels([text])
48 elif self.orientation() == Qt.Vertical:
49 self.model().setVerticalHeaderLabels([text])
52 QHeaderView.mousePressEvent(self,event)
53 if event.button()==Qt.RightButton:
54 self.emit(SIGNAL(
"mouseRightPressed"), event.globalPos())