blob: ba76c28fd4720630e3984fbafde2809313624a5e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#import <AppKit/AppKit.h>
#include <QMenu>
#include <QTest>
void tst_qmenu_QTBUG_37933_ampersands()
{
QMenu m;
QFETCH(QString, title);
QFETCH(QString, visibleTitle);
m.addAction(title);
NSMenu* nativeMenu = m.toNSMenu();
Q_ASSERT(nativeMenu != 0);
NSMenuItem* item = [nativeMenu itemAtIndex:0];
Q_ASSERT(item != 0);
QCOMPARE(QString::fromUtf8([[item title] UTF8String]), visibleTitle);
}
|