Import As Test | Qt
Description: Demonstrating import <@op>.</@op><@op>.</@op><@op>.</@op> as <@op>.</@op><@op>.</@op><@op>.</@op> statements.

# Import As Test

This page demonstrates an issuewhere QDoc fails to generate proper links when QML types are accessed through module aliases.

## Problem Description

When a QML module is imported with an alias:

    import TestModule as TM

    TM.BaseType {
        title: "Example"
    }

QDoc should be able to:

- Recognize that `TM.BaseType` refers to BaseType.
- Generate proper inheritance links.
- Link to properties and methods from the aliased type.

## Comparison with Non-Aliased Qualified Types

For comparison, here's how non-aliased qualified types work:

    import TestModule

    TestModule.BaseType {
        title: "Direct import"
    }

## Mixed Module Import Patterns

QDoc should handle different import and qualification patterns:

    import QtQuick.Controls
    import QtQml.Models as Models

    Item {
        // Standard module qualified types
        property ListModel modelData: Models.ListModel {}

        // Nested property access patterns
        Layout.preferredSize: Qt.size(100, 50)

        // Standard QML qualified types for comparison
        anchors.fill: parent
    }

## Multi-Segment Qualified Names

More complex qualified names with multiple segments:

    import TestModule.SubModule.Deep as X

    DeepNestedType {
        // Four-segment qualified type name: X.Level1.Level2.Leaf
        nested: X.Level1.Level2.Leaf {
            value: 42
        }

        // Multi-segment property access
        Layout.preferredWidth: 100
        anchors.margins.left: 10
    }

This tests QDoc's ability to handle qualified names with 3+ segments like `X.Level1.Level2.Leaf` where each segment should be properly spanned and linked as a complete type reference.

## Test Cases

This test covers multiple scenarios for QDoc's qualified name handling:

- DerivedType - Uses `import TestModule as TM` syntax (2 segments).
- DeepNestedType - Uses `X.Level1.Level2.Leaf` syntax (4 segments).
- Module aliased types: `Models.ListModel` with `import QtQml.Models as Models`.
- Mixed import patterns: Both direct and aliased imports in same file.
- Multi-segment properties: `Layout.preferredWidth`, `anchors.fill`.
- The inheritance should show BaseType as the parent.
- Code examples should link to BaseType::doSomething().
- Compare aliased vs non-aliased qualified type linking behavior.

### Expected Behavior

- QML qualified names with "." should be marked up completely: `<span class="type">TM.BaseType</span>`
- Module qualified types should be marked up completely: `<span class="type">Models.ListModel</span>`
- Property names should be marked up completely: `<span class="name">Layout.preferredSize</span>`
- Types that can be resolved should get clickable links: `<a href="...">TM.BaseType</a>`
- Multi-segment names should be handled correctly regardless of length.

### Manual Link Commands

QDoc should also support manual linking to QML qualified names:

- Link to TM.BaseType using QML context with qualified name.
- Link to TM.BaseType using QML context with qualified name in braces.
- Compare with BaseType simple name linking.

}