Thiago Macieira wrote:
>>
>> Having to touch all dataChanged() receivers looks quite intrusive.
>
> Then don't. Keep source compatibility:
>
> signals:
> dataChanged(QModelIndex, QModelIndex, QSet<int> = QSet<int>());
Indeed, that's what I proposed in my first mail.
What I thought though is that the signature of a function in a SIGNAL macro
must match exactly, but apparently that is not correct. Did that change at
some point?
So then this is not source incompatible at all.
That leaves us back with me asking for objections to making these changes.
I expected someone might make an argument against it for a reason such as
that it adds too many options to what you can implement in QAIM or whatever.
If that's not going to happen that's good.
Thanks,
Steve.
#include <QtGui>
class Model : public QObject
{
Q_OBJECT
public:
Model(QObject *parent = 0)
: QObject(parent)
{
QTimer::singleShot(1000, this, SLOT(doit()));
}
signals:
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QSet<int> &roles = QSet<int>());
private slots:
void doit()
{
emit dataChanged(QModelIndex(), QModelIndex());
}
};
class Other : public QObject
{
Q_OBJECT
public:
Other(QObject *parent = 0)
: QObject(parent)
{
}
public slots:
void onDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
{
qDebug() << topLeft << bottomRight;
}
};
int main(int argc, char **argv)
{
QApplication app(argc, argv);
Model model;
Other other;
QObject::connect(&model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), &other, SLOT(onDataChanged(QModelIndex,QModelIndex)));
// QObject::connect(&model, SIGNAL(dataChanged(QModelIndex,QModelIndex,QSet<int>)), &other, SLOT(onDataChanged(QModelIndex,QModelIndex)));
return app.exec();
}
#include "main.moc"
_______________________________________________
Qt5-feedback mailing list
[email protected]
http://lists.qt.nokia.com/mailman/listinfo/qt5-feedback