# Copyright (C) 2026 Wilhelmus Dingenus de Pooter
# SPDX-License-Identifier: GPL-3.0-or-later
"""ENCore GIS — QGIS plugin entry point.

QGIS calls classFactory() when loading the plugin; it returns the plugin object
that wires up the toolbar action and the dock widget.

The Qt5/Qt6 compatibility layer (enc_qt_compat) is applied FIRST inside
classFactory — before any GUI module is imported — so the plugin runs on both
QGIS 3 (Qt5) and QGIS 4 (Qt6) from the same code, while the package itself
stays import-light (no Qt/qgis import at package-import time, which keeps the
headless test harness and pure-Python consumers clean).
"""


def classFactory(iface):
    """Construct and return the ENCore GIS plugin object (QGIS plugin hook)."""
    from . import enc_qt_compat                         # noqa: F401  (Qt5/Qt6)
    from .enc_explorer import ENCExplorer
    return ENCExplorer(iface)
