0

I dare to ask that question here and not in the programmers section, cause i'm actually not looking for a coding answer, but a solution through the QtDesigner GUI (if possible).

Custom QT-forms combined with QGIS can be a really powerful solution for data-entry tasks, so i try to tweak things further, but already reached my limits.

my form

Little explanation on the form:

I have lists of bird observations with start and end times. I already connected some time fields through signals and slots, so when changing the start field, the end fields take over that value as well (only have to change the minutes afterwards -> less typing -> less errors)

When an entry is finished and the next item is digitized, the previous values will be loaded as default.

As most of the time intervals are contigous, i would like to be able to copy the former end-value to the new start-value when pressing the button E -> A.

In the example that means, that the reloaded end-value 15:03 would be inserted instead of 15:00.

It's quite easy to send values form here to there via signals and slots, but i didn't understand so far if it's possible to trigger such an action also with a third partner (the button)

0

You can't do this in Qt Designer unless you make your own widget and define a slot that does the work. Unless you have good reason I would avoid this as it just makes things more complicated.

The best solution is just to write that logic in the code:

 button.pressed.connect(update_values)

 def update_values():
     # Do stuff
  • Thanx Nathan. That was my fear. Besides the fact that i really have no clue what "# Do stuff " will look alike, i see also no way to enter code somewhere. Can anyone point me to a basic tutorial how to use that stuff?? I only find docs with explanatory value = 0 and the built in help in QTDesigner doesn't work. (The page could not be found 'qthelp://com.trolltech.designer.471/qdoc/designer-manual.html') – Bernd V. Aug 8 '13 at 11:57
  • You can read my blog post for an example of using custom forms with logic nathanw.net/2011/09/05/… – Nathan W Aug 8 '13 at 12:00
  • Excellent! I also found your video on youtube youtu.be/Z84GMcQV3EM , really nice. Well, now that i have one of the masterminds here, just one more question: It seems that SpinBox and Time Edit /Date Edit have no equivalents in QGIS so far, which will also display the values from the last data set (At least it doesn't work for me). Should i change all those fields to Line Edits, or are there more tricks to make them work? Is there somewhere a list which widgets are supported and which not? – Bernd V. Aug 8 '13 at 14:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.