Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
stringlisteditor.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
4#ifndef STRINGLISTEDITOR_H
5#define STRINGLISTEDITOR_H
6
7#include "ui_stringlisteditor.h"
8#include <QtCore/qstringlist.h>
9
10QT_BEGIN_NAMESPACE
11class QStringListModel;
12
13namespace qdesigner_internal {
14
15class StringListEditor : public QDialog, private Ui::Dialog
16{
18public:
20 void setStringList(const QStringList &stringList);
21 QStringList stringList() const;
22
24 QWidget *parent, const QStringList &init = QStringList(), int *result = nullptr);
25
26private slots:
27 void upButtonClicked();
28 void downButtonClicked();
29 void newButtonClicked();
30 void deleteButtonClicked();
31 void valueEdited(const QString &text);
32 void currentIndexChanged(const QModelIndex &current, const QModelIndex &previous);
33 void currentValueChanged();
34
35private:
36 StringListEditor(QWidget *parent = nullptr);
37 void updateUi();
38 int currentIndex() const;
39 void setCurrentIndex(int index);
40 int count() const;
41 QString stringAt(int index) const;
42 void setStringAt(int index, const QString &value);
43 void removeString(int index);
44 void insertString(int index, const QString &value);
45 void editString(int index);
46
47 QStringListModel *m_model;
48};
49
50} // namespace qdesigner_internal
51
52QT_END_NAMESPACE
53
54#endif // STRINGLISTEDITOR_H
static QStringList getStringList(QWidget *parent, const QStringList &init=QStringList(), int *result=nullptr)
void setStringList(const QStringList &stringList)
Combined button and popup list for selecting options.
Auxiliary methods to store/retrieve settings.