Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
+126
@@ -0,0 +1,126 @@
|
||||
#ifndef LTS_ABSTRACT_SEQUENCE_WIDGET_H
|
||||
#define LTS_ABSTRACT_SEQUENCE_WIDGET_H
|
||||
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* ABC for creating custom views of dds sequences
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Verena Eberlein, SPMO, 2023-08-03
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
#include <QGroupBox>
|
||||
#include <QList>
|
||||
#include "lts_widgets_export.h"
|
||||
|
||||
class QToolButton;
|
||||
namespace LtsWidgets
|
||||
{
|
||||
|
||||
|
||||
class LTSWIDGETS_EXPORT LtsAbstractSequenceWidget : public QGroupBox
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
/**
|
||||
* @brief LtsAbstractSequenceWidget inits pbAddMember and adds logic to it.
|
||||
* @attention pbAddMember must be inserted into a layout
|
||||
* @param readOnly if read only, disable all buttons on creation
|
||||
* @param name
|
||||
* @param contentType
|
||||
* @param parent
|
||||
*/
|
||||
|
||||
explicit LtsAbstractSequenceWidget(QWidget *parent = nullptr, const bool &readOnly = false);
|
||||
|
||||
~LtsAbstractSequenceWidget();
|
||||
|
||||
/**
|
||||
* @brief adds a given QWidget
|
||||
* @param widget
|
||||
*/
|
||||
virtual void addWidget(QWidget* widget, bool isReadOnly, bool isButtonVisible = true);
|
||||
/**
|
||||
* @brief getValue get widget by objectname
|
||||
* @param contentType
|
||||
* @param findObjectName
|
||||
*/
|
||||
virtual void getValue(QWidget *contentType,
|
||||
const QString &findObjectName) const;
|
||||
|
||||
/**
|
||||
* @brief setMemberCount
|
||||
* @param count
|
||||
*/
|
||||
virtual void setMemberCount(int count);
|
||||
|
||||
/**
|
||||
* @brief getMemberCount by objectname
|
||||
* @return count
|
||||
*/
|
||||
virtual uint32_t getMemberCount() const;
|
||||
|
||||
/**
|
||||
* @brief get the current memberlist size
|
||||
* @return count
|
||||
*/
|
||||
virtual int getMemberlistSize();
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
/**
|
||||
* @brief pbAddMember
|
||||
* @return
|
||||
*/
|
||||
virtual QToolButton *pbAddMember() const;
|
||||
|
||||
|
||||
/**
|
||||
* @brief getObjectName generates a valid object name given by index
|
||||
* @param index
|
||||
* @return
|
||||
*/
|
||||
virtual QString getObjectName(int index) const;
|
||||
|
||||
/**
|
||||
* @brief setupMemberWidget place child and button widget into a layout
|
||||
* @param child
|
||||
* @param pbChild
|
||||
* @param objectName
|
||||
*/
|
||||
virtual void setupMemberWidget(QWidget *child, QToolButton *pbChild, const QString &objectName, bool isButtonVisible = true) = 0;
|
||||
|
||||
signals:
|
||||
/**
|
||||
* @brief signal is send when ToolButton is pressed so we can add a member widget via addWidget
|
||||
*/
|
||||
void addMember();
|
||||
|
||||
private slots:
|
||||
/**
|
||||
* @brief addMemberWidget create a new button and connect to child
|
||||
* @param member new child
|
||||
*/
|
||||
virtual void addMemberWidget(QWidget *member, bool isReadOnly, bool isButtonVisible = true);
|
||||
|
||||
/**
|
||||
* @brief deleteMemberWidget clean up child and reindex other children objectnames
|
||||
* @param member deleted child
|
||||
*/
|
||||
virtual void deleteMemberWidget(QObject *member);
|
||||
|
||||
private:
|
||||
bool m_readOnly;
|
||||
QToolButton *m_pbAddMember = nullptr;
|
||||
QList<QWidget*> m_memberList;
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
#endif // LTS_ABSTRACT_SEQUENCE_WIDGET_H
|
||||
Reference in new issue
Block a user