7#include <AppKit/NSWorkspace.h>
8#include <AppKit/NSColorSampler.h>
9#include <Foundation/NSURL.h>
12#include <QtCore/qscopedvaluerollback.h>
14#include <QtGui/qdesktopservices.h>
15#include <QtGui/private/qcoregraphics_p.h>
22 if (url == m_handlingUrl)
25 return [[NSWorkspace sharedWorkspace] openURL:url.toNSURL()];
36 QScopedValueRollback<QUrl> rollback(m_handlingUrl, url);
40 return QDesktopServices::openUrl(url);
51 [m_colorSampler showSamplerWithSelectionHandler:^(NSColor *selectedColor) {
52 emit colorPicked(qt_mac_toQColor(selectedColor));
56 NSColorSampler *m_colorSampler =
nullptr;
69 case ColorPicking:
return true;
70 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.