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> #include <utility>
AbstractExtItemAggregator::AbstractExtItemAggregator(QWidget *_parent, QString _type) AbstractExtItemAggregator::AbstractExtItemAggregator(QObject *_parent, QString _type)
: QDialog(_parent) : QObject(_parent)
, ui(new Ui::AbstractExtItemAggregator) , ui(new Ui::AbstractExtItemAggregator)
, m_type(std::move(_type)) , m_type(std::move(_type))
{ {

View File

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

View File

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