688 indentation *= indentCount |
688 indentation *= indentCount |
689 else: |
689 else: |
690 indentation = 0 |
690 indentation = 0 |
691 # Check if text is longer than available space |
691 # Check if text is longer than available space |
692 fontMetrics = QFontMetrics(self.treeView.font()) |
692 fontMetrics = QFontMetrics(self.treeView.font()) |
693 textSize = fontMetrics.width(tooltip) |
693 try: |
|
694 textSize = fontMetrics.horizontalAdvance(tooltip) |
|
695 except AttributeError: |
|
696 textSize = fontMetrics.width(tooltip) |
694 textSize += indentation + 5 # How to determine border size? |
697 textSize += indentation + 5 # How to determine border size? |
695 header = self.treeView.header() |
698 header = self.treeView.header() |
696 if textSize >= header.sectionSize(column): |
699 if textSize >= header.sectionSize(column): |
697 return tooltip |
700 return tooltip |
698 else: |
701 else: |