2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 Alexander Drozdov.
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
2016-10-10 09:49:46 +10:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2022-09-29 15:26:31 +02:00
|
|
|
#include <utils/filepath.h>
|
2020-04-17 15:30:05 +02:00
|
|
|
|
2017-09-14 15:18:50 +02:00
|
|
|
#include <QComboBox>
|
2016-10-10 09:49:46 +10:00
|
|
|
#include <QStyledItemDelegate>
|
|
|
|
|
|
2022-09-29 15:26:31 +02:00
|
|
|
namespace CMakeProjectManager::Internal {
|
2016-10-10 09:49:46 +10:00
|
|
|
|
|
|
|
|
class ConfigModelItemDelegate : public QStyledItemDelegate
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
2017-09-14 15:18:50 +02:00
|
|
|
|
2016-10-10 09:49:46 +10:00
|
|
|
public:
|
2019-05-28 13:49:26 +02:00
|
|
|
ConfigModelItemDelegate(const Utils::FilePath &base, QObject *parent = nullptr);
|
2017-09-14 15:18:50 +02:00
|
|
|
|
|
|
|
|
QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
|
|
|
|
|
const QModelIndex &index) const final;
|
|
|
|
|
void setEditorData(QWidget *editor, const QModelIndex &index) const final;
|
|
|
|
|
void setModelData(QWidget *editor, QAbstractItemModel *model,
|
|
|
|
|
const QModelIndex &index) const final;
|
|
|
|
|
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const final;
|
2016-10-10 09:49:46 +10:00
|
|
|
|
2017-09-14 15:18:50 +02:00
|
|
|
private:
|
2019-05-28 13:49:26 +02:00
|
|
|
Utils::FilePath m_base;
|
2016-10-10 09:49:46 +10:00
|
|
|
};
|
|
|
|
|
|
2022-09-29 15:26:31 +02:00
|
|
|
} // CMakeProjectManager::Internal
|