-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
QGIS custom widgets plugins for Qt Designer #1325
Conversation
Hi @3nids Ah this is awesome! I will test on my ubuntu and give you any feedback. Do I need to do anything special to make designer aware of the widgets? Sorry I just this week replaced my mac's OS with ubuntu (finally got it to work with 14.04) so I am unable to test it there. |
Hi @timlinux, Then, the built library should automatically be installed in the Qt Designer plugin folder. I had access to the widgets from the standalone designer and also within creator. Thanks for testing this! |
@@ -285,6 +290,12 @@ ENDIF (ENABLE_TESTS) | |||
|
|||
INCLUDE( ${QT_USE_FILE} ) | |||
|
|||
IF (WITH_CUSTOM_WIDGETS) | |||
ADD_DEFINITIONS(-DQT_PLUGIN) | |||
ADD_DEFINITIONS(-DQT_NO_DEBUG) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found this from here:
http://www.cmake.org/pipermail/cmake/2006-June/009587.html
My main concerns are:
[0] http://lists.osgeo.org/pipermail/qgis-developer/2014-May/032425.html |
There is a problem with the definition of flags in QgsMapLayerComboBox. |
assigned to @NathanW2 |
@wonder-sk is having a look at it too. |
Nice stuff Denis! I think one of @timlinux dreams will soon come true, he has hoped for this for years! :-) The possibility to have useful QGIS widgets directly in designer will make the design of dialogs much easier. Below are my comments... root CMakeLists.txt:
Custom Widgets CMakeLists.txt:
Custom Widgets:
Python support:
maplayercombobox:
scalevisibilitywidget:
|
Yeah! Soon the day will come when I can open designer, drop in a legend widget, a map canvas widget and a navigation toolbar widget and then write a few lines of python to add some layers and then smile broadly for 7 weeks :-)
Any other ways to manage this? I have 4 different versions of QGIS installed under @3nids I love what you are doing here - rock on! |
@wonder-sk thanks a lot for this detailed review, I will come back ASAP with a reworked PR! |
But this thing only relates to pyuic4. There is another, broader issue with |
I fixed issues you reported.
|
Nice! This will be bloody handy. On Fri, May 9, 2014 at 12:50 AM, Denis Rouzaud notifications@github.comwrote:
|
ENDIF (NOT ANDROID) | ||
|
||
# make sure that UI files will be processed first | ||
ADD_DEPENDENCIES(qgis_customwidgets ui) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- no need to install headers
- no need for dependency on ui target anymore
- actually no need to build for android at all - there is no designer AFAIK
- no need for QGIS_CUSTOMWIDGETS_UI_HDRS
- no need for ${CMAKE_CURRENT_BINARY_DIR}/../ui in INCLUDE_DIRECTORIES
- no need for PUBLIC_HEADER in INSTALL(TARGETS ...)
Regarding Qt Creator - yes if the creator is built with Qt5 it will likely not accept Qt4 plugins. In addition to the options you give it should be possible to use older version of Creator (< 2.8 I believe) where its binaries were still built with Qt4. |
…Box to custom widgets
… widgets, denom/true scale, raster and rulebased dialogs, tooltip, alignement, etc.
thanks again, and again ;) Last 3 commits should fix your remarks. For the uic packages, I sticked to MODULE and not CW_FILTER because it was not working with QgsMapLayerComboBox which uses flags (QgsMapLayerProxyModel::Filters). But it does compiles using MODULE. There is virtually no documentation at all on this, I am moving in the dark... I left UI related lines commented in the CMakeList as I am pretty sure they'll be back one day. OK, for you? I hope we're getting closer ;) |
QGIS custom widgets plugins for Qt Designer
This adds a new library for using custom widgets in Qt Designer.
I implemented as a first try a a group box for scale dependent visibility.
I successfully built this on ubuntu, but did not try on Win/Mac.
@jef-n may you have a look at the CMakeList files?
@timlinux would be nice to have your opinon since I believe you were waiting for such feature ;) Also, could you have a look if it works well on mac?