Guest User

Untitled

a guest
Jun 22nd, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. void MapDocument::setCurrentLayer(int index)
  2. {
  3. Q_ASSERT(index >= -1 && index < mMap->layers().size());
  4. mCurrentLayer = index;
  5.  
  6. /* This function always sends the following signal, even if the index
  7. * didn't actually change. This is because the selected index in the layer
  8. * table view might be out of date anyway, and would otherwise not be
  9. * properly updated.
  10. *
  11. * This problem happens due to the selection model not sending signals
  12. * about changes to its current index when it is due to insertion/removal
  13. * of other items. The selected item doesn't change in that case, but our
  14. * layer index does.
  15. */
  16. emit currentLayerChanged(mCurrentLayer);
  17. }
Add Comment
Please, Sign In to add comment