2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
2014-07-03 16:57:18 +02:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2014-07-03 16:57:18 +02:00
|
|
|
|
|
|
|
|
#include "utils_global.h"
|
|
|
|
|
|
|
|
|
|
#include <QComboBox>
|
|
|
|
|
|
|
|
|
|
namespace Utils {
|
|
|
|
|
|
|
|
|
|
// Documentation inside.
|
2022-05-24 13:45:35 +02:00
|
|
|
class QTCREATOR_UTILS_EXPORT TextFieldComboBox : public QComboBox
|
|
|
|
|
{
|
2017-05-10 15:19:00 +02:00
|
|
|
Q_PROPERTY(QString indexText READ text WRITE setText)
|
2014-07-03 16:57:18 +02:00
|
|
|
Q_OBJECT
|
2022-05-24 13:45:35 +02:00
|
|
|
|
2014-07-03 16:57:18 +02:00
|
|
|
public:
|
2018-05-07 17:33:02 +02:00
|
|
|
explicit TextFieldComboBox(QWidget *parent = nullptr);
|
2014-07-03 16:57:18 +02:00
|
|
|
|
|
|
|
|
QString text() const;
|
|
|
|
|
void setText(const QString &s);
|
|
|
|
|
|
|
|
|
|
void setItems(const QStringList &displayTexts, const QStringList &values);
|
|
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
void text4Changed(const QString &); // Do not conflict with Qt 3 compat signal.
|
|
|
|
|
|
2016-06-28 22:31:02 +03:00
|
|
|
private:
|
2014-07-03 16:57:18 +02:00
|
|
|
void slotCurrentIndexChanged(int);
|
|
|
|
|
|
|
|
|
|
inline QString valueAt(int) const;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Utils
|