<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Cannot resize QPlainTextEdit]]></title><description><![CDATA[<p dir="auto">I have the following layout:<br />
<img src="https://ddgobkiprc33d.cloudfront.net/5ea76870-4936-4e80-b49a-aca422cb987a.png" alt="Без имени-1.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Here's how it's implemented:</p>
<pre><code>class Block(QFrame):
    def __init__(self, parent):
        super().__init__(parent=parent)
        self.setObjectName("Block")
        self.setStyleSheet("QFrame#Block {background-color: rgba(0, 0, 0, 0.1);} "
                           "QWidget#InnerWidget {background-color: rgba(0, 0, 0, 0.1);}")
        self.main_layout = QVBoxLayout(self)

    def add_button(self, name):
        w = QWidget(self, objectName="InnerWidget")
        l = QHBoxLayout(w)

        l.addWidget(QLabel(name, parent=w))
        l.addWidget(QPushButton(name, parent=w))
        self.main_layout.addWidget(w)

    def add_text_area(self, name):
        w = QWidget(self, objectName="InnerWidget")
        l = QVBoxLayout(w)
        title_widget = QWidget(w)
        title_layout = QHBoxLayout(title_widget)
        title_layout.addWidget(QLabel(name, parent=w))
        title_layout.addWidget(QLabel(name, parent=w))
        l.addWidget(title_widget)

        text_edit = QPlainTextEdit(parent=w)
        l.addWidget(text_edit)
        self.main_layout.addWidget(w)


class Column(QWidget):
    def __init__(self, parent):
        super().__init__(parent=parent)
        self.setObjectName("Column")
        layout = QVBoxLayout(self)
        layout.setSpacing(20)
        self.setStyleSheet("background: transparent;")

    def add_block(self, block):
        self.layout().addWidget(block)


class RootWidget(QFrame):
    def __init__(self):
        super().__init__()
        self.setObjectName("RootWidget")
        self.setStyleSheet("background-color: rgb(80, 80, 80); color: white;")
        self.setAutoFillBackground(True)

        layout = QHBoxLayout(self)
        self.main_widget = QScrollArea(parent=self)
        self.columns = QWidget(parent=self.main_widget)
        self.columns_layout = QHBoxLayout(self.columns)

        self.column_1 = Column(self.columns)
        self.column_2 = Column(self.columns)
        self.column_3 = Column(self.columns)

        for column in [self.column_1, self.column_2, self.column_3]:
            for i in range(3):
                block = Block(column)
                for j in range(10):
                    block.add_button(str(j))
                    if i == 1 and j == 9:
                        block.add_text_area("TEST")
                column.add_block(block)
            column.layout().addStretch()
            self.columns_layout.addWidget(column)

        self.main_widget.setWidget(self.columns)
        layout.addWidget(self.main_widget)
</code></pre>
<p dir="auto">This is what I end up with:<br />
<img src="https://ddgobkiprc33d.cloudfront.net/92ba81de-dcd7-43f7-b5bb-cd9a1115103a.png" alt="python_CWKlwNxuVG.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Problem: I can't resize <em>QPlainTextEdit</em> in any way. How can this be done?</p>
<p dir="auto">I have tried <em>resize()</em>, <em>setGeometry()</em>, however nothing has worked.</p>
<pre><code>def add_text_area(self, name):
    w = QWidget(self, objectName="InnerWidget")
    l = QVBoxLayout(w)
    title_widget = QWidget(w)
    title_layout = QHBoxLayout(title_widget)
    title_layout.addWidget(QLabel(name, parent=w))
    title_layout.addWidget(QLabel(name, parent=w))
    l.addWidget(title_widget)

    text_edit = QPlainTextEdit(parent=w)
    text_edit.resize(100, 1000)
    # or text_edit.setGeometry(text_edit.geometry().x(), text_edit.geometry.y(), 100, 1000)
    l.addWidget(text_edit)
    self.main_layout.addWidget(w)
</code></pre>
]]></description><link>https://forum.qt.io/topic/148003/cannot-resize-qplaintextedit</link><generator>RSS for Node</generator><lastBuildDate>Wed, 12 Aug 2026 02:48:42 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/148003.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 15 Aug 2023 22:53:33 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Cannot resize QPlainTextEdit on Wed, 16 Aug 2023 00:05:45 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mpergand">@<bdi>mpergand</bdi></a> it doesn't work for me, because I want to make an animation for QPlainTextEdit, which will exactly change its height (something like a dropdown widget animation), and setMinimumHeight() won't let me change the height to 0.</p>
]]></description><link>https://forum.qt.io/post/768938</link><guid isPermaLink="true">https://forum.qt.io/post/768938</guid><dc:creator><![CDATA[Gygabrain]]></dc:creator><pubDate>Wed, 16 Aug 2023 00:05:45 GMT</pubDate></item><item><title><![CDATA[Reply to Cannot resize QPlainTextEdit on Tue, 15 Aug 2023 23:33:42 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/gygabrain">@<bdi>Gygabrain</bdi></a><br />
Try to set a minimum height.</p>
]]></description><link>https://forum.qt.io/post/768933</link><guid isPermaLink="true">https://forum.qt.io/post/768933</guid><dc:creator><![CDATA[mpergand]]></dc:creator><pubDate>Tue, 15 Aug 2023 23:33:42 GMT</pubDate></item></channel></rss>