[Python] QTreeView has strange residues of other UI elements when enabling/disabling it

Discussão em 'Python' iniciado por Stack, Março 9, 2025.

  1. Stack

    Stack Membro Participativo

    I created a huge UI with PyQt6 Designer. Currently I'm seeing a very strange behaviour of the QTreeView.

    1. By default (starting the main) the right QTreeView is disabled.
    2. Selecting a child node from left QTreeView will enable the right QTreeView. Selecting a parent node from the left QTreeView will disable the right QTreeView.
    3. Switch to another tab
    4. Switching back to the tab where the right QTreeView is present

    Now you can see some shadows of the tab where we are switching from. What could cause this issue?

    I tried to play a little bit around and found out that this issue is not happening when I set the QTreeView on the right side by default (start of the main) to enabled.

    I can't post the full code since its a lot. I'm just looking for some hits and maybe an idea where this is coming from since I don't have any eplanation for this behaviour. I also tried (repaint() and update() function on the QTreeView, but this did not help. Only setting it to enabled by default works. But I want to have my QTreeView disabled at the beginning until a child node is selected from the left QTreeView.

    [​IMG]

    [​IMG]

    [​IMG]

    [​IMG]

    Continue reading...

Compartilhe esta Página