Bug 249567 - Smoke incorrectly detects type of QFlags<type>&
Summary: Smoke incorrectly detects type of QFlags<type>&
Status: RESOLVED FIXED
Alias: None
Product: bindings
Classification: Developer tools
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kde-bindings
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-31 02:39 UTC by Chris Burel
Modified: 2010-09-09 16:49 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Burel 2010-08-31 02:39:47 UTC
Version:           unspecified (using Devel) 
OS:                Linux

QFlags<type> is a typedef for a uint, so, QFlags<type>& is a uint*.

smokedata.cpp for qtcore has a type for unsigned int&:
{ "unsigned int&", 0, Smoke::t_voidp|Smoke::tf_ref }

but all the QFlags<type>& are set to Smoke::t_uint :
{ "QFlags<QTextCodec::ConversionFlag>&", 0, Smoke::t_uint|Smoke::tf_ref }
{ "QFlags<QAbstractSpinBox::StepEnabledFlag>&", 0, Smoke::t_uint|Smoke::tf_ref }
{ "QFlags<QPaintEngine::DirtyFlag>&", 0, Smoke::t_uint|Smoke::tf_ref }
{ "QFlags<QPaintEngine::PaintEngineFeature>&", 0, Smoke::t_uint|Smoke::tf_ref }
{ "QFlags<QStyle::StateFlag>&", 0, Smoke::t_uint|Smoke::tf_ref }
{ "QFlags<QStyle::SubControl>&", 0, Smoke::t_uint|Smoke::tf_ref }
{ "QFlags<QStyleOptionButton::ButtonFeature>&", 0, Smoke::t_uint|Smoke::tf_ref }
{ "QFlags<QStyleOptionFrameV2::FrameFeature>&", 0, Smoke::t_uint|Smoke::tf_ref }
{ "QFlags<QStyleOptionTab::CornerWidget>&", 0, Smoke::t_uint|Smoke::tf_ref }
{ "QFlags<QStyleOptionToolBar::ToolBarFeature>&", 0, Smoke::t_uint|Smoke::tf_ref }
{ "QFlags<QStyleOptionToolButton::ToolButtonFeature>&", 0, Smoke::t_uint|Smoke::tf_ref }
{ "QFlags<QStyleOptionViewItemV2::ViewItemFeature>&", 0, Smoke::t_uint|Smoke::tf_ref }
{ "QFlags<Qt::AlignmentFlag>&", 0, Smoke::t_uint|Smoke::tf_ref }
{ "QFlags<Qt::DropAction>&", 0, Smoke::t_uint|Smoke::tf_ref }
{ "QFlags<Qt::KeyboardModifier>&", 0, Smoke::t_uint|Smoke::tf_ref }
{ "QFlags<Qt::MouseButton>&", 0, Smoke::t_uint|Smoke::tf_ref }
{ "QFlags<Qt::TouchPointState>&", 0, Smoke::t_uint|Smoke::tf_ref }
{ "QFlags<Qt::WindowType>&", 0, Smoke::t_uint|Smoke::tf_ref }

Those be set to Smoke::t_voidp.  In particular, the QFlags<QStyle*Option> ones break the usage of the QStyle*Option classes.

Reproducible: Always
Comment 1 Chris Burel 2010-09-02 19:18:13 UTC
There's also a problem with the munged method name used for this.  If the argument is identified as 'unsigned int&', it gets a '$' in the signature.  But if it is identified as a 'QFlags<Type>&', it gets a '#'.  See QStyleOption::setState in QtGui for an example.
Comment 2 Arno Rehn 2010-09-02 20:41:08 UTC
Ah, seems like this problem only occurs with fields. QStyleOption::state is actually a field with type QFlags<something>. The code for that is completely broken, as it seems.
Thanks for the report, I'll hopefully fix this over the weekend.
Comment 3 Arno Rehn 2010-09-09 16:48:41 UTC
SVN commit 1173496 by arnorehn:

Improve logic for QFlags.

BUG:249567

 M  +2 -1      helpers.cpp  
 M  +1 -1      writeSmokeDataFile.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1173496
Comment 4 Arno Rehn 2010-09-09 16:49:31 UTC
SVN commit 1173497 by arnorehn:

Improve logic for QFlags.

BUG:249567

 M  +2 -1      helpers.cpp  
 M  +1 -1      writeSmokeDataFile.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1173497