<!--
{
  "availability" : [
    "macOS: 10.6.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "QuickLookUI",
  "identifier" : "/documentation/QuickLookUI/QLPreviewView",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Quick Look UI"
    ],
    "preciseIdentifier" : "c:objc(cs)QLPreviewView"
  },
  "title" : "QLPreviewView"
}
-->

# QLPreviewView

A Quick Look preview of an item that you can embed into your view hierarchy.

```
class QLPreviewView
```

## Topics

### Creating a Preview View

[`-  initWithFrame:style:`](/documentation/QuickLookUI/QLPreviewView/init(frame:style:))

Creates a preview view with the provided frame and style.

[`-  initWithFrame:`](/documentation/QuickLookUI/QLPreviewView/init(frame:))

Creates a preview view with the provided frame.

[`QLPreviewViewStyle`](/documentation/QuickLookUI/QLPreviewViewStyle)

Styles for a Preview View.

### Displaying a Preview

[`previewItem`](/documentation/QuickLookUI/QLPreviewView/previewItem)

The item to preview.

[`-  refreshPreviewItem`](/documentation/QuickLookUI/QLPreviewView/refreshPreviewItem())

Updates the preview to display the currently previewed item.

[`displayState`](/documentation/QuickLookUI/QLPreviewView/displayState)

The current display state of the [`previewItem`](/documentation/QuickLookUI/QLPreviewView/previewItem).

[`autostarts`](/documentation/QuickLookUI/QLPreviewView/autostarts)

A Boolean value that determines whether the preview starts automatically.

### Closing a Preview

[`shouldCloseWithWindow`](/documentation/QuickLookUI/QLPreviewView/shouldCloseWithWindow)

A Boolean value that determines whether the preview should close when its window closes.

[`-  close`](/documentation/QuickLookUI/QLPreviewView/close())

Closes the view, releasing the current preview item.

## Relationships

### Conforms To

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`NSUserInterfaceItemIdentification`](/documentation/AppKit/NSUserInterfaceItemIdentification)

[`Hashable`](/documentation/Swift/Hashable)

[`NSUserActivityRestoring`](/documentation/AppKit/NSUserActivityRestoring)

[`NSAppearanceCustomization`](/documentation/AppKit/NSAppearanceCustomization)

[`NSStandardKeyBindingResponding`](/documentation/AppKit/NSStandardKeyBindingResponding)

[`Sendable`](/documentation/Swift/Sendable)

[`NSCoding`](/documentation/Foundation/NSCoding)

[`NSAccessibilityProtocol`](/documentation/AppKit/NSAccessibilityProtocol)

[`NSTouchBarProvider`](/documentation/AppKit/NSTouchBarProvider)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`NSDraggingDestination`](/documentation/AppKit/NSDraggingDestination)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Equatable`](/documentation/Swift/Equatable)

[`NSAnimatablePropertyContainer`](/documentation/AppKit/NSAnimatablePropertyContainer)

[`CVarArg`](/documentation/Swift/CVarArg)

[`NSAccessibilityElementProtocol`](/documentation/AppKit/NSAccessibilityElementProtocol)

### Inherits From

[`NSView`](/documentation/AppKit/NSView)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)