简体   繁体   中英

Qt Designer doesn't load my custom widget plugin

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

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.

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.

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.

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

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/ ".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM