Qt设计器不加载我的自定义窗口小部件插件 [英] Qt Designer doesn't load my custom widget plugin

查看:551
本文介绍了Qt设计器不加载我的自定义窗口小部件插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读的书使用Qt4的C ++ GUI编程,我已经达到了集成自定义小部件与Qt设计器的主题。

I'm reading the book "C++ GUI Programming with Qt4", and I've reached the topic of Integrating Custom Widgets with Qt Designer.

我已经创建了一个示例项目(图标编辑器插件),我得到一个名为'libiconeditorplugin.so'的文件,我已经复制它'/ usr / lib / qt4 / plugins / designer /'。但是当我启动Qt Creator时,我在窗口小部件框中没有看到图标编辑器部件。

I've built the example project outlined there (the icon editor plugin), and I get a file called 'libiconeditorplugin.so', and I've copied it to '/usr/lib/qt4/plugins/designer/'. But when I start Qt Creator I don't see the icon editor widget in the widget box.

我做的不同于我的唯一的事情是我删除了DESTDIR从.pro文件,因为它有$ QTDIR和$ QTDIR没有在我的计算机中定义,我不知道它应该指向哪里。

The only thing I've done differently from the book is I removed the DESTDIR from the .pro file because it had $QTDIR, and $QTDIR is not defined in my computer and I don't know where it should point. Instead, I copied the .so file manually.

我不知道是否在正确的目录中复制了插件,如果libiconeditorplugin.so是唯一的

I'm not sure if I've copied the plugin in the right directory, and if libiconeditorplugin.so is the only file that I needed to copy, the book was kind of sketchy on how it should work.

我的操作系统是Ubuntu,我已经安装了Qt Creator和apt-get。

My OS is Ubuntu and I've installed Qt Creator with apt-get.

推荐答案

结果我将libiconeditorplugin.so复制到错误的目录。我将其复制到 / usr / lib / qt4 / plugins / designer / ,而Qt Designer正在查找 / usr / lib / x86_64-linux-gnu / qt4 / plugins / designer /

Turns out I was copying libiconeditorplugin.so to the wrong directory. I was copying it to "/usr/lib/qt4/plugins/designer/", while Qt Designer was looking in "/usr/lib/x86_64-linux-gnu/qt4/plugins/designer/".

这篇关于Qt设计器不加载我的自定义窗口小部件插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆