1467 Qt.FocusReason.ActiveWindowFocusReason, |
1467 Qt.FocusReason.ActiveWindowFocusReason, |
1468 Qt.FocusReason.OtherFocusReason |
1468 Qt.FocusReason.OtherFocusReason |
1469 ]: |
1469 ]: |
1470 aw = QApplication.activeWindow() |
1470 aw = QApplication.activeWindow() |
1471 if aw is None or aw.parent() is not self: |
1471 if aw is None or aw.parent() is not self: |
1472 self.SendScintilla(QsciScintilla.SCI_CALLTIPCANCEL) |
1472 self.cancelCallTips() |
1473 else: |
1473 else: |
1474 self.SendScintilla(QsciScintilla.SCI_CALLTIPCANCEL) |
1474 self.cancelCallTips() |
1475 |
1475 |
1476 super().focusOutEvent(event) |
1476 super().focusOutEvent(event) |
1477 |
1477 |
1478 def event(self, evt): |
1478 def event(self, evt): |
1479 """ |
1479 """ |
1648 lin = self.SendScintilla(QsciScintilla.SCI_LINEFROMPOSITION, pos) |
1648 lin = self.SendScintilla(QsciScintilla.SCI_LINEFROMPOSITION, pos) |
1649 linpos = self.SendScintilla( |
1649 linpos = self.SendScintilla( |
1650 QsciScintilla.SCI_POSITIONFROMLINE, lin) |
1650 QsciScintilla.SCI_POSITIONFROMLINE, lin) |
1651 return lin, pos - linpos |
1651 return lin, pos - linpos |
1652 |
1652 |
1653 ########################################################################### |
|
1654 ## methods below have been added to QScintilla starting with version 2.5 |
|
1655 ########################################################################### |
|
1656 |
|
1657 if "contractedFolds" not in QsciScintilla.__dict__: |
|
1658 def contractedFolds(self): |
|
1659 """ |
|
1660 Public method to get a list of line numbers of collapsed folds. |
|
1661 |
|
1662 @return list of line numbers of folded lines (list of integer) |
|
1663 """ |
|
1664 line = 0 |
|
1665 folds = [] |
|
1666 maxline = self.lines() |
|
1667 while line < maxline: |
|
1668 if self.foldHeaderAt(line) and not self.foldExpandedAt(line): |
|
1669 folds.append(line) |
|
1670 line += 1 |
|
1671 return folds |
|
1672 |
|
1673 if "setContractedFolds" not in QsciScintilla.__dict__: |
|
1674 def setContractedFolds(self, folds): |
|
1675 """ |
|
1676 Public method to set a list of line numbers of collapsed folds. |
|
1677 |
|
1678 @param folds list of line numbers of folded lines (list of integer) |
|
1679 """ |
|
1680 for line in folds: |
|
1681 self.foldLine(line) |
|
1682 |
|
1683 ######################################################################### |
1653 ######################################################################### |
1684 ## Methods below are missing from QScintilla. |
1654 ## Methods below are missing from QScintilla. |
1685 ######################################################################### |
1655 ######################################################################### |
1686 |
1656 |
1687 if "setWrapStartIndent" not in QsciScintilla.__dict__: |
1657 if "setWrapStartIndent" not in QsciScintilla.__dict__: |
1708 0, pos) |
1678 0, pos) |
1709 y = self.SendScintilla(QsciScintilla.SCI_POINTYFROMPOSITION, |
1679 y = self.SendScintilla(QsciScintilla.SCI_POINTYFROMPOSITION, |
1710 0, pos) |
1680 0, pos) |
1711 return QPoint(x, y) |
1681 return QPoint(x, y) |
1712 |
1682 |
|
1683 if "cancelCallTips" not in QsciScintilla.__dict__: |
|
1684 def cancelCallTips(self): |
|
1685 """ |
|
1686 Public method to cancel displayed call tips. |
|
1687 """ |
|
1688 self.SendScintilla(QsciScintilla.SCI_CALLTIPCANCEL) |
|
1689 |
1713 ## ######################################################################### |
1690 ## ######################################################################### |
1714 ## ## Methods below have been added to QScintilla starting with version 2.x. |
1691 ## ## Methods below have been added to QScintilla starting with version 2.x. |
1715 ## ######################################################################### |
1692 ## ######################################################################### |
1716 ## |
1693 ## |
1717 ## if "newMethod" not in QsciScintilla.__dict__: |
1694 ## if "newMethod" not in QsciScintilla.__dict__: |