6#include <AppKit/NSWorkspace.h>
7#include <AppKit/NSColorSampler.h>
8#include <Foundation/NSURL.h>
11#include <QtCore/qscopedvaluerollback.h>
13#include <QtGui/qdesktopservices.h>
14#include <QtGui/private/qcoregraphics_p.h>
21 if (url == m_handlingUrl)
24 return [[NSWorkspace sharedWorkspace] openURL:url.toNSURL()];
35 QScopedValueRollback<QUrl> rollback(m_handlingUrl, url);
39 return QDesktopServices::openUrl(url);
50 [m_colorSampler showSamplerWithSelectionHandler:^(NSColor *selectedColor) {
51 emit colorPicked(qt_mac_toQColor(selectedColor));
55 NSColorSampler *m_colorSampler =
nullptr;
68 case ColorPicking:
return true;
69 default:
return false;
void pickColor() override
bool handleUrl(const QUrl &url)
bool hasCapability(Capability capability) const override
QPlatformServiceColorPicker * colorPicker(QWindow *parent) override
bool openUrl(const QUrl &url) override
bool openDocument(const QUrl &url) override
Combined button and popup list for selecting options.