Unexpected object type error when using RBA::QMessageBox in 0.24.10

I just installed KLayout 0.24.10 on Xubuntu 16.04 and am having problems with existing scripts that are working fine under the same Windows version. Note that unfortunately, I cannot update to the latest KLayout version, as our large library of Ruby scripts isn't 100% compatible yet. Now to the error:

After opening KLayout and the Macro Development (Ruby) window, I entered the following in the Console:

RBA::QMessageBox::information(RBA::Application.instance.main_window, "Title", "Message")

which gives the following traceback:

Unexpected object type (expected argument of class QWidget_Native, got RBA::MainWindow) in QMessageBox_Native::information
  <main>:in `information'
  <main>:in `<main>'

I am suspecting a Qt problem on my Ubuntu box, but don't really know what to look for, any help would be highly appreciated.


  • edited March 2019

    I just tried in a virtual box with Xubuntu 14.04 in it, the error isn't there and the message box displays as expected.

    So here's a summary, KLayout version is always 0.24.10. I also included the reported Qt version from KLayout's About Qt dialog. Interestingly the Qt version reported by Ubuntu's package manager doesn't always match that exactly, as I found out through running apt-cache show libqtcore4 |grep Version.

    • Working: Windows7, About Qt=4.8.2
    • Working: Xubuntu14.04, About Qt=4.8.6, apt-cache=4:4.8.5+git192-g085f851+dfsg-2ubuntu4.1
    • Broken: Xubuntu16.04, About Qt=4.8.7, apt-cache=4:4.8.7+dfsg-5ubuntu2

    Hope that provides some clues...

  • Hi,

    0.24.10 is actually quite old, so I'd need to dig deep to find the root cause.

    I recall that this issue was there in 0.25.x too and got fixed, but it will be very hard to backport this fix as 0.24.x has deviated significantly.

    As a quick workaround I think you can also use "nil" as the parent widget. This will make the message box become a detached main window, but I think that is acceptable.

    Kind regards,


Sign In or Register to comment.