File: configpage.cpp

package info (click to toggle)
kcachegrind 4%3A22.12.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 9,156 kB
  • sloc: cpp: 28,878; xml: 338; perl: 325; python: 235; sh: 9; makefile: 6
file content (49 lines) | stat: -rw-r--r-- 861 bytes parent folder | download
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
    This file is part of KCachegrind.

    SPDX-FileCopyrightText: 2009-2016 Josef Weidendorfer <Josef.Weidendorfer@gmx.de>

    SPDX-License-Identifier: GPL-2.0-only
*/

/*
 * Base class of a subpage in the configuration dialog
 */

#include "configpage.h"

#include <QLabel>
#include <QWidget>

//
// ConfigPage
//

ConfigPage::ConfigPage(QWidget* parent, QString title, QString longTitle)
    : QWidget(parent)
{
    _title = title;
    if (longTitle.isEmpty())
        _longTitle = title;
    else
        _longTitle = longTitle;
}

void ConfigPage::activate(QString s)
{
    QWidget* w = _names.value(s);
    if (w) w->setFocus();
}

bool ConfigPage::check(QString&, QString&)
{
    return true;
}

void ConfigPage::accept()
{}

QString ConfigPage::inRangeError(int from, int to)
{
    return tr("Value must be between %1 and %2.").arg(from).arg(to);
}