Beispiel #1
0
    def _createToolButtonWidget(self, parent):
        """
        @see: self.createWidget()
        """
        btn = QToolButton(parent)
        btn.setAutoFillBackground(True)
        btn.setToolButtonStyle(Qt.ToolButtonTextUnderIcon)
        btn.setMinimumWidth(75)
        btn.setMaximumWidth(75)
        btn.setMinimumHeight(62)
        btn.setAutoRaise(True)

        btn.setCheckable(True)
        btn.setDefaultAction(self)

        text = truncateText(self.text())
        btn.setText(text)

        if self._toolButtonPalette:
            btn.setPalette(self._toolButtonPalette)

        #@@@ ninad070125 The following function
        #adds a newline character after each word in toolbutton text.
        #but the changes are reflected only on 'mode' toolbuttons
        #on the flyout toolbar (i.e.only Checkable buttons..don't know
        #why. Disabling its use for now.
        debug_wrapText = False

        if debug_wrapText:
            text = wrapToolButtonText(action.text())
            if text:
                action.setText(text)

        return btn