Bug 27118
Summary: | [QT] Wrong of declaration of writeOnlyProperty: READ function is always required. | ||
---|---|---|---|
Product: | WebKit | Reporter: | Antonio Gomes <tonikitoo> |
Component: | Tools / Tests | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED WONTFIX | ||
Severity: | Minor | CC: | hausmann, jedrzej.nowacki, laszlo.gombos, ossy |
Priority: | P2 | Keywords: | Qt |
Version: | 528+ (Nightly build) | ||
Hardware: | PC | ||
OS: | Linux |
Antonio Gomes
tst_qwebframe.cpp we have:
(...)
class MyQObject : public QObject
{
Q_OBJECT
(...)
Q_PROPERTY(int writeOnlyProperty WRITE setWriteOnlyProperty)
(...)
which is wrong and triggers a compile warning while building ...
(...)
/home/agomes/reps/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp:88: Warning: Property declaration writeOnlyProperty has no READ accessor function. The property will be invalid.
(...)
--> See statement in http://chaos.troll.no/~tavestbo/webkit/domapi/qobject.html#Q_PROPERTY
"...The property name and type and the READ function are required..."
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Jędrzej Nowacki
In general Qt discourage to declare write-only properties.
In all cases, apart from one, the warning is correct. In this particular case we need a hack to test the JavaScript functionality. In the JavaScript concept of write-only property exists, we can't change it. We can support the feature, but in the same time we discourage to use it.
According to logs, there was a bigger discussion about the problem.
I'm closing the bug, but if you disagree, feel free to reopen it.
Laszlo Gombos
I looked into this a while bug and draw the same conclusion as Jędrzej.
Just for future reference - I think the warning is coming from moc and not from the C/C++ compiler.
Csaba Osztrogonác
*** Bug 43356 has been marked as a duplicate of this bug. ***
Csaba Osztrogonác
(In reply to comment #2)
> I looked into this a while bug and draw the same conclusion as Jędrzej.
>
> Just for future reference - I think the warning is coming from moc and not from the C/C++ compiler.
Yes, this warning is coming from moc, and doesn't block build if we add -Werror option to gcc: https://bugs.webkit.org/show_bug.cgi?id=43191
But unfortunately it makes the compiling step orange on the buildbot. :(
Is there a correct way to hide this warning to make the bot green?