Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pyside-uic: "ValueError: unknown baseclass QOpenGLWidget" #13

Open
gim- opened this issue Jan 19, 2016 · 0 comments
Open

pyside-uic: "ValueError: unknown baseclass QOpenGLWidget" #13

gim- opened this issue Jan 19, 2016 · 0 comments

Comments

@gim-
Copy link

gim- commented Jan 19, 2016

PySide's UIC can't generate a class that contains a custom widget like this:

<customwidgets>
<customwidget>
<class>MyOwnOpenGLWidget</class>
<extends>QOpenGLWidget</extends>
<header>MyOwnOpenGLWidget</header>
</customwidget>
</customwidgets>

PyQt5 UIC version doesn't have this issue.

% pyside-uic --version
PySide User Interface Compiler version 0.2.15, running on PySide 1.2.4.

% pyside-uic untitled.ui -o test.py -d
Traceback (most recent call last):
  File "/usr/lib/python3.5/site-packages/pysideuic/Compiler/qobjectcreator.py", line 93, in _resolveBaseclass
    baseClass = self._widgets[baseClass][0]
KeyError: 'QOpenGLWidget'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.5/site-packages/pysideuic/port_v3/invoke.py", line 34, in invoke
    exit_status = driver.invoke()
  File "/usr/lib/python3.5/site-packages/pysideuic/driver.py", line 60, in invoke
    self._generate()
  File "/usr/lib/python3.5/site-packages/pysideuic/driver.py", line 94, in _generate
    compileUi(self._ui_file, pyfile, self._opts.execute, self._opts.indent, self._opts.from_imports)
  File "/usr/lib/python3.5/site-packages/pysideuic/__init__.py", line 142, in compileUi
    winfo = compiler.UICompiler().compileUi(uifile, pyfile, from_imports)
  File "/usr/lib/python3.5/site-packages/pysideuic/Compiler/compiler.py", line 91, in compileUi
    w = self.parse(input_stream)
  File "/usr/lib/python3.5/site-packages/pysideuic/uiparser.py", line 867, in parse
    actor(elem)
  File "/usr/lib/python3.5/site-packages/pysideuic/uiparser.py", line 710, in createUserInterface
    self.traverseWidgetTree(elem)
  File "/usr/lib/python3.5/site-packages/pysideuic/uiparser.py", line 688, in traverseWidgetTree
    handler(self, child)
  File "/usr/lib/python3.5/site-packages/pysideuic/uiparser.py", line 423, in createLayout
    self.traverseWidgetTree(elem)
  File "/usr/lib/python3.5/site-packages/pysideuic/uiparser.py", line 688, in traverseWidgetTree
    handler(self, child)
  File "/usr/lib/python3.5/site-packages/pysideuic/uiparser.py", line 460, in handleItem
    self.traverseWidgetTree(elem)
  File "/usr/lib/python3.5/site-packages/pysideuic/uiparser.py", line 688, in traverseWidgetTree
    handler(self, child)
  File "/usr/lib/python3.5/site-packages/pysideuic/uiparser.py", line 189, in createWidget
    self.stack.push(self.setupObject(widget_class, parent, elem))
  File "/usr/lib/python3.5/site-packages/pysideuic/uiparser.py", line 152, in setupObject
    obj =  self.factory.createQObject(clsname, name, args, is_attribute)
  File "/usr/lib/python3.5/site-packages/pysideuic/objcreator.py", line 87, in createQObject
    classType = self.findQObjectType(classname)
  File "/usr/lib/python3.5/site-packages/pysideuic/objcreator.py", line 97, in findQObjectType
    w = module.search(classname)
  File "/usr/lib/python3.5/site-packages/pysideuic/Compiler/qobjectcreator.py", line 104, in search
    baseClass = self._resolveBaseclass(self._widgets[cls][0])
  File "/usr/lib/python3.5/site-packages/pysideuic/Compiler/qobjectcreator.py", line 98, in _resolveBaseclass
    raise ValueError("unknown baseclass %s" % baseClass)
ValueError: unknown baseclass QOpenGLWidget

untitled_ui.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant