do not derive from qwidget in aggregates

This commit is contained in:
Evgenii Alekseev 2024-03-21 18:08:19 +02:00
parent 33a41bb6c0
commit 0ee8d40ade
3 changed files with 6 additions and 12 deletions

View File

@ -26,8 +26,8 @@
#include <utility>
AbstractExtItemAggregator::AbstractExtItemAggregator(QWidget *_parent, QString _type)
: QDialog(_parent)
AbstractExtItemAggregator::AbstractExtItemAggregator(QObject *_parent, QString _type)
: QObject(_parent)
, ui(new Ui::AbstractExtItemAggregator)
, m_type(std::move(_type))
{

View File

@ -18,7 +18,6 @@
#ifndef ABSTRACTEXTITEMAGGREGATOR_H
#define ABSTRACTEXTITEMAGGREGATOR_H
#include <QDialog>
#include <QStandardPaths>
#include "abstractextitem.h"
@ -27,20 +26,15 @@
class QAbstractButton;
class QListWidgetItem;
namespace Ui
{
class AbstractExtItemAggregator;
}
class AbstractExtItemAggregator : public QDialog
class AbstractExtItemAggregator : public QObject
{
Q_OBJECT
Q_PROPERTY(QVariant configArgs READ configArgs WRITE setConfigArgs)
Q_PROPERTY(QVariant type READ type)
public:
explicit AbstractExtItemAggregator(QWidget *_parent, QString _type);
~AbstractExtItemAggregator() override;
explicit AbstractExtItemAggregator(QObject *_parent, QString _type);
// methods
void copyItem();
template <class T> void createItem()

View File

@ -31,7 +31,7 @@
template <class T> class ExtItemAggregator : public AbstractExtItemAggregator
{
public:
explicit ExtItemAggregator(QWidget *_parent, const QString &_type)
explicit ExtItemAggregator(QObject *_parent, const QString &_type)
: AbstractExtItemAggregator(_parent, _type)
{
qSetMessagePattern(AWDebug::LOG_FORMAT);
@ -57,7 +57,7 @@ public:
void editItems()
{
repaintList();
int ret = exec();
auto ret = exec();
qCInfo(LOG_LIB) << "Dialog returns" << ret;
};