Important: Please read the Qt Code of Conduct -

QTreeWidget resize width similar to in QtCreator

  • Hi,

    I have a QTreeWidget and QTextEdit in a QHBoxLayout. I used designer form.ui to do this.
    In the left pane ie on QTreeWidget I show some files and right pane ie QTextEdit I show source code. This app is similar to QtCreator. I want my app also to be moved horizontally with mouse click similar to QtCreator.

    Please share your views. Appreciate your help in this regard.


  • I tried the following:

    this->Internals->treeWidget->header()->setResizeMode(0, QHeaderView::ResizeToContents);


    Doing this, only QTreeWidget header is moving but not actual treewidget. How can I make QTreeWidget, QTextEdit move horizontally like in QtCreator.

    Please share your views.

  • Hi,

    Please read the documentation of the class QSplitter.

Log in to reply