Hello,
- In the same namespace (RE) i have two classes called CumulativeHistogram and BlackAndWhiteConverter respectivelly.
- Both classes herits QObject (Indirectly via abstract classes).
- Both classes have Q_OBJECT macro.
- After CumulativeHistogram declaration, i have "Q_DECLARE_METATYPE(RE::CumulativeHistogram)".
- In my BlackAndWhiteConverter class, i have:
Q_PROPERTY( const CumulativeHistogram* CumulativeHistogram READ cumulativeHistogram WRITE setCumulativeHistogram)
Q_PROPERTY( const CumulativeHistogram* CumulativeHistogram READ cumulativeHistogram WRITE setCumulativeHistogram)
To copy to clipboard, switch view to plain text mode
Now, from my main routine, i'm doing this:
bwc.
setProperty("CumulativeHistogram",
QVariant::fromValue<CumulativeHistogram
*>
(&histo
));
bwc.setProperty("CumulativeHistogram", QVariant::fromValue<CumulativeHistogram*>(&histo));
To copy to clipboard, switch view to plain text mode
bwc being an instance of BlackAndWhiteConverter, histo being a CumulativeHistogram, nothing happens. Qt tries to create the property, because it thinks it doesn't exist (See bellow why).
When setting breakpoints, the processor is going inside QMetaProperty::write, at the line:
vtypeName && strcmp(typeName, vtypeName) == 0
vtypeName && strcmp(typeName, vtypeName) == 0
To copy to clipboard, switch view to plain text mode
it's comparing "const RE::CumulativeHistogram*" to "RE::CumulativeHistogram*"... But i can't declare my Q_PROPERTY as non-const, because it has to be.
The very strange thing is that if i call other properties of "scalar" types on a BlackAndWhiteConverter object (It has a few of type QRgb, unsigned char, etc), it works.
Anyone had this problem before?
Thanks,
Pierre.
Bookmarks