summaryrefslogtreecommitdiffstats
path: root/tests/manual/widgets/widgets/qtabbar/stylesheet/main.cpp
blob: 7d886d1ebc7ec7defe365d99bfaa5f38cbcffd4d (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
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

// This test is for checking that when there is padding set on the stylesheet and the elide mode is
// set that it is correctly shown as elided and not clipped.

#include <QApplication>
#include <QTabBar>
#include <QIcon>

int main(int argc, char** argv)
{
    QApplication app(argc, argv);
    app.setStyleSheet("QTabBar::tab { padding-left: 20px; }\n");
    QIcon icon(":/v.ico");

    QTabBar b;
    b.setElideMode(Qt::ElideRight);
    b.addTab(icon, "some text");
    b.resize(80,32);
    b.show();

    return app.exec();
}