Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QUiLoader's method "load" used in custom widget results in "Segmentation fault" in Linguist
Forum Updated to NodeBB v4.3 + New Features

QUiLoader's method "load" used in custom widget results in "Segmentation fault" in Linguist

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 2.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mazzzterz
    wrote on last edited by
    #1

    Hi !
    I'm writing an interface program and it came time to internationalize it, so I started reading the Qt Documentation. I was happy to see that all forms loaded by QUiLoader are automatically translated, but I stumbled on a problem. Almost the whole interface consists of custom widgets that are put in the forms from designer. Some of the custom widgets use their own forms that they load using QUiLoader class and here the problem appeared. When I start Linguist and choose a translation that is located on a form that uses some of my custom widgets the program ends with "Segmentation Fault". I put a lot of prints to see where Linguist dies and I fount that when I invoke the method "load" from class QUiLoader with valid ui file the application dies. If the file isn't valid it doesn't die. I'm not sure if this is a bug or not so I'm posting it here.

    I made a simple example showing the problem.
    "Download it":http://www.filefactory.com/file/cc52b9f/n/DEMO4_zip

    P.P. I forgot to mention that I use Qt 4.7.0 because it comes with SDK that is compiled with the same version. I tried using the new one but in my custom widgets I use things like SQL and OpenGL and some more and designer complains that cannot mix 4.7.1/4.7.2/4.7.3 with 4.7.4. I can work aroung the problem with the environment variable LD_PRELOAD but it I don't like this solution.

    Edit: As mlong remarked I cleaned the code from all auto-generated stuff.
    Edit2: It will be helpful and if you tell me where I can find help for my problem.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mlong
      wrote on last edited by
      #2

      In the future, when putting together sample code, please make sure to clean your project before packaging it up. MOC files, object files, and other sundry auto-generated stuff is just unnecessary bloat.

      Software Engineer
      My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mazzzterz
        wrote on last edited by
        #3

        If someone confirmed the problem exists please write to be sure that it's not just me.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mazzzterz
          wrote on last edited by
          #4

          In future if someone else is in need:
          "Your text to link here...":http://lists.qt.nokia.com/pipermail/qt-interest/2011-July/034969.html

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved