Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void MapDocument::setCurrentLayer(int index)
- {
- Q_ASSERT(index >= -1 && index < mMap->layers().size());
- mCurrentLayer = index;
- /* This function always sends the following signal, even if the index
- * didn't actually change. This is because the selected index in the layer
- * table view might be out of date anyway, and would otherwise not be
- * properly updated.
- *
- * This problem happens due to the selection model not sending signals
- * about changes to its current index when it is due to insertion/removal
- * of other items. The selected item doesn't change in that case, but our
- * layer index does.
- */
- emit currentLayerChanged(mCurrentLayer);
- }
Add Comment
Please, Sign In to add comment