Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(2)  |  Derive(0)  |  Import(0)

src/a/u/auto-resizing-text-edit-0.1.0/auto_resizing_text_edit/auto_resizing_text_edit.py   auto-resizing-text-edit(Download)
    def heightForWidth(self, width):
        margins = self.contentsMargins()
 
        if width >= margins.left() + margins.right():
            document_width = width - margins.left() - margins.right()
        assert num_lines >= 0
 
        widget_margins  = self.contentsMargins()
        document_margin = self.document().documentMargin()
        font_metrics    = QFontMetrics(self.document().defaultFont())