Giter Site home page Giter Site logo

Comments (3)

NicolasCami avatar NicolasCami commented on July 20, 2024 1

Additional information: The issue only occurs on Wayland. Running the problematic example on X11 works.
As a workaround, you can force Qt to use X11 instead of Wayland:

export QT_QPA_PLATFORM=xcb
python app.py

from pyvistaqt.

YuXHe15 avatar YuXHe15 commented on July 20, 2024

I did a little research around stackoverflow and one answer mentioned that it could happen when the window id passed is not correct, which can be found here:
https://stackoverflow.com/questions/34704542/in-linux-get-window-class-raise-x-error-of-failed-request-badwindow-invalid
I don't know if it would be helpful

from pyvistaqt.

NicolasCami avatar NicolasCami commented on July 20, 2024

Hi there,

I get the exact same error output. I'm working with virtualenv. I tried with pyqt5, pyqt6, pyside6 (using os.environ["QT_API"]) and get the same error as soon as the BackgroundPlotter is instantiated.

I did several tests to understand if the issue is related to pyqt/pyside or qtpy or pyvista or pyvistaqt:

  • Using directly pyqt/pyside works.
  • Using directly qtpy works.
  • Using pyvista works.
  • It seems that only pyvistaqt produces this error.

Here is an example that works. But if I uncomment QtInteractor or BackgroundPlotter lines I get the same error message.

import os
os.environ["QT_API"] = "pyside6"

from qtpy.QtWidgets import *
from pyvistaqt import QtInteractor, BackgroundPlotter

class MainWindow(QDialog):

    def __init__(self, parent=None):
        QDialog.__init__(self, parent)

        self.frame = QFrame()
        vlayout = QVBoxLayout()
        self.frame.setLayout(vlayout)

if __name__ == '__main__':
    import sys

    app = QApplication(sys.argv)

    # Produces X error: BadWindow
    #plotter = BackgroundPlotter(False, app=app)

    win = MainWindow()

    # Produces X error: BadWindow
    #interactor = QtInteractor(win)

    win.show()
    sys.exit(app.exec())

I wonder if it's related to my Qt installation, or Wayland. My config:

  • Ubuntu 22.04.3
  • GNOME 42.9
  • Wayland

from pyvistaqt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.