when Copy and Paste profiles from one SpectralView to another, all (but the "name") the attributes get lost

Issue #563 resolved
Andreas Janz created an issue

Comments (10)

  1. Benjamin Jakimow

    are you sure? the screenshot for example shows the “fid” field. Did the missing fields/attributes need to exist in the target library as well. QGIS copies attributes which exist in both QgsVectorLayers only.

  2. Andreas Janz reporter

    @benjamin I will open this again, ok? Because the user can’t copy the attributes and has no options to take the field definitions from one speclib to another.

  3. Benjamin Jakimow

    To my understanding this is not a bug, as it does the same like QGIS does between two vectorlayers.

    Let
    Layer1 have fields (“name”,”number”, “xyz”) and
    Layer2 have fields (“name”,”number”,”foobar”).

    In this case copy & paste of features (or “rows”) from Layer1 to Layer2 will ommit values in “xyz”, as the field does not exist in Layer2.

  4. Benjamin Jakimow

    And basically I don’t see a way to change this, since operations like copy, paste and cut are done by the QGIS API

  5. Andreas Janz reporter

    Can you connect to a signal that emits when a new feature is added? If so you could ask the user if he wants to create the missing fields? Or something along those lines?

  6. Andreas Janz reporter

    If not possible, we can close this here and open a new issue for implementing an easy functionality to copy field definitions from one speclib to another.

  7. Benjamin Jakimow

    The QgsVectorLayer does not provide a “featureWillBeAdded” signal. In addition, this would be triggered very often, slowing donw the GUI. Instead, having something like “copy field definitions” would be a good addition to Standard QGIS as well.

    So yes, could be a new feature request, but - as everything works like known from QGIS - I wouldn’t consider it being a bug

  8. Andreas Janz reporter

    having something like “copy field definitions” would be a good addition to Standard QGIS as well.

    So yes, could be a new feature request, but - as everything works like known from QGIS - I wouldn’t consider it being a bug

    Ok, I’ll open a new issue.

  9. Log in to comment