def check_layout_layers(layout, layers):
    """
    Check the layer widget order matches the layers order in the layout

    Parameters
    ----------
    layout : QLayout
        Layout to test
    layers : napari.components.LayerList
        LayersList to compare to

    Returns
    ----------
    match : bool
        Boolean if layout matches layers
    """
    layers_layout = [
        layout.itemAt(2 * i - 1).widget().layer
        for i in range(len(layers), 0, -1)
    ]
    return layers_layout == list(layers)