Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bundle custom widget lib for Qt Designer #3

Closed
PeterPetrik opened this issue May 20, 2019 · 11 comments
Closed

Bundle custom widget lib for Qt Designer #3

PeterPetrik opened this issue May 20, 2019 · 11 comments
Assignees
Labels
enhancement New feature or request qgis-deps

Comments

@PeterPetrik
Copy link
Contributor

https://github.com/lutraconsulting/qgis-mac-packager/issues/80

It would be nice to have the custom widgets available for Qt Designer

Run cmake with -DWITH_CUSTOMWIDGETS=ON
This will place the lib in QT_PLUGINS_DIR
Then the question is how any existing Qt Designer would find the lib?
a) The user would have to add the path to the lib before starting Qt Designer
b) or we ship Qt Designer in the bundle?

@PeterPetrik PeterPetrik added the enhancement New feature or request label May 20, 2019
@M-Rick
Copy link

M-Rick commented Oct 9, 2019

Yes it would we great to get it. I have plenty of custom forms not working anymore in QGIS3 that have to be updated with custom widgets. Currently the only way is by running QGIS inside a Linux VM. Thats's not really convenient.

@3nids
Copy link
Member

3nids commented Dec 5, 2019

To me, the best approach seems to copy the Designer.app directly into QGIS bundle.

Following this answer, it seems possible

  • Run cmake with -D WITH_CUSTOM_WIDGETS=ON (done in compile custom widgets #22)
  • Copy /usr/local/opt/qt/libexec/Designer.app into the bundle (see the above link)
  • Check that the custom widget lib is in QT_PLUGINS_DIR (/usr/local/opt/qt/plugins/designer)
  • Controls that it opens fine i.e. it can find qgis_core and qgis_gui
  • Create a shortuct or make the app visible

@PeterPetrik could you as a quick try, just copy Designer.app in the bundle?
I am not familiar with the code...

@M-Rick
Copy link

M-Rick commented Dec 5, 2019

It is the way it's done with windows packages.

@M-Rick
Copy link

M-Rick commented Dec 13, 2019

QtDesigner 4 works with only those items.
QtDesigner 4.zip

@PeterPetrik
Copy link
Contributor Author

should be part or tomorrow's nightly2 builds

@M-Rick
Copy link

M-Rick commented Jul 23, 2020

I tried the latest nightly2 which is qgis_nightly2_master_20200723_032054.

I did find Qt Designer packaged inside at QGIS.app/Contents/MacOS/Designer.app

But when launching it, it doesn't include the QGIS custom widgets. But at least it works well.

Capture d’écran 2020-07-23 à 15 30 36

@PeterPetrik PeterPetrik reopened this Jul 23, 2020
@PeterPetrik
Copy link
Contributor Author

maybe related qgis/QGIS#4113

@PeterPetrik
Copy link
Contributor Author

Screenshot 2020-08-20 at 00 17 48

@PeterPetrik
Copy link
Contributor Author

If forced to take libraries from bundled MacOS/lib, it fails to load some Apple's native frameworks due to symbol/lib clashes (libjpeg, libpng, libtiff and libsqlite3)

peter@pp-mb:/opt/QGIS/qgis-dev$ DYLD_LIBRARY_PATH=/opt/QGIS/qgis-dev/bundle/QGIS.app/Contents/MacOS/lib ./Designer.app/Contents/MacOS/Designer 
dyld: Symbol not found: __cg_jpeg_resync_to_restart
  Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
  Expected in: /opt/QGIS/qgis-dev/bundle/QGIS.app/Contents/MacOS/lib/libJPEG.dylib
 in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
Abort trap: 6

if I set rpath to bundled lib (equivallent of setting fallback library path), the /usr/lib/libsqlite3.dylib is picked which causes coredump when using QgsProject::instance() (see previous screen)

peter@pp-mb:/opt/QGIS/qgis-dev$ DYLD_FALLBACK_LIBRARY_PATH=/opt/QGIS/qgis-dev/bundle/QGIS.app/Contents/MacOS/lib ./Designer.app/Contents/MacOS/Designer 
src/core/auth/qgsauthmanager.cpp:3711 : (authDbQuery) [1ms] Auth db query exec() FAILED
WARNING: Auth db query exec() FAILED
Segmentation fault: 11

@PeterPetrik
Copy link
Contributor Author

fixed by usage of DYLD_INSERT_LIBRARIES

the Designer must be lauched by wrapper script located in QGIS.app/Contents/MacOS/bin/designer

@M-Rick
Copy link

M-Rick commented Aug 22, 2020

I created a Platypus application that you can join next to the QGIS application.

Designer.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request qgis-deps
Projects
None yet
Development

No branches or pull requests

3 participants