summaryrefslogtreecommitdiffstats
path: root/src/widgets/doc/snippets/whatsthis/whatsthis.cpp
blob: b8c84259a596df40a13a4485a5fe2e681d5ad8e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

#include <QMainWindow>
#include <QAction>

class MainWindow : public QMainWindow
{
public:
    QAction *newAct;
    MainWindow()
    {
        //! [0]
        newAct = new QAction(tr("&New"), this);
        newAct->setShortcut(tr("Ctrl+N"));
        newAct->setStatusTip(tr("Create a new file"));
        newAct->setWhatsThis(tr("Click this option to create a new file."));
        //! [0]
    }
};

int main()
{
    return 0;
}