Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. How to use QUiLoader to load cutom widget plugin under QtEmbedded?
QtWS25 Last Chance

How to use QUiLoader to load cutom widget plugin under QtEmbedded?

Scheduled Pinned Locked Moved Mobile and Embedded
4 Posts 2 Posters 5.2k Views
  • 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.
  • W Offline
    W Offline
    Weilly
    wrote on last edited by
    #1

    Dear all,

    QUiLoader can load my custom widget plugin under Ununtu 10.10. However, I cross compile the plugin and my app using QUiLoader and deploy them to my target device. My app can not load my custom widget plugin. How can I make it?

    Thanks.

    Best regards,
    Weilly

    1 Reply Last reply
    0
    • Y Offline
      Y Offline
      yogesh
      wrote on last edited by
      #2

      Are you able to get it working on your host machine (without cross compiling)? And you need to provide more information about your code or may be you can post your code because there could be any small mistake you must be making like "wrong path of the plugin".
      Make sure you get the name of your plugin when you call the method @QUiLoader::availableWidgets@

      also dont forget to call @addPluginPath@ before you try to load the plugin and UI.

      1 Reply Last reply
      0
      • W Offline
        W Offline
        Weilly
        wrote on last edited by
        #3

        Dear Yogesh,

        Q1: Are you able to get it working on your host machine (without cross compiling)?
        A1: Yes.

        Q2: Make sure you get the name of your plugin when you call the method
        A2: Yes. I am sure the Path is no problem as below.

        [My App]
        QUiLoader loader;

        qDebug() << loader.pluginPaths();
        loader.addPluginPath("/home/test/designer");
        qDebug() << loader.pluginPaths();

        QFile file("test.ui"); //which is generated by Designer including my custom widget
        file.open(QFile::ReadOnly);
        QWidget *widget = loader.load(&file);
        file.close();

        QStringList availableWidgets = loader.availableWidgets();
        qDebug() << availableWidgets;

        if(availableWidgets.contains("MyTestButton"))
        qDebug() << "Has MyTestButton";
        else
        qDebug() << "No MyTestButton";

        [MyTestButton]
        I just use Creator to create a project.
        [Other Project]->[Qt Custome Designer Widget]

        I put this custom widget plugin to Designer. So, Designer can generate test.ui which includes MyTestButton info.. The error message I got at my target device as below:
        "QFormBuilder was unable to create a custom widget of the class 'MyTestButton' ; defaulting to base class 'QWidget'."

        I am not sure if I make my cross compiling environment by static not shared. Because I will get make error when I use shared.
        ./configure -prefix /usr/local/test -static -embedded arm -make tools -xplatform qws/linux-arm-g++ -v

        P.S.

        1. My host machine is Ubuntu 10.10
        2. My toolchain
          http://www.codesourcery.com/public/gnu_toolchain/arm-none-linux-gnueabi/arm-2007q1-10-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2

        Best regards,
        Weilly

        1 Reply Last reply
        0
        • W Offline
          W Offline
          Weilly
          wrote on last edited by
          #4

          Dear all,

          Anyway, I have solved this problem when I use shared library and add -no-webkit option in my ./configure. So, I guess using static is impossoble to load custom widget via QUiloader.

          Best regards,
          Weilly

          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