PySide Bugzilla Closed for New Bugs

PySide is now a Qt Add-on and uses the Qt Project's JIRA Bug Tracker instead of this Bugzilla instance. This Bugzilla is left for reference purposes.

Bug 424 - QDockWidget.setTitleBarWidget does not accept 0
: QDockWidget.setTitleBarWidget does not accept 0
Status: CLOSED FIXED
Product: PySide
Classification: Unclassified
Component: Documentation
: 0.4.2
: All All
: P3 normal
Assigned To: Hugo Parente Lima
:
:
:
  Show dependency treegraph
 
Reported: 2010-10-20 22:22 EEST by kbrownlees
Modified: 2011-06-22 20:14 EEST (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kbrownlees 2010-10-20 22:22:02 EEST
From the Docs: 
"Sets an arbitrary widget as the dock widget's title bar. If widget is 0, the
title bar widget is removed, but not deleted."

When attempting to call setTitleBarWidget(0):
File "/home/kieran/Work/top_level/top_level/src/tweaky/gui/mainWindow.py", line
36, in __init__
    self.ui.dockWidget_connect.setTitleBarWidget(0)
TypeError: 'PySide.QtGui.QDockWidget.setTitleBarWidget' called with wrong
argument types:
  PySide.QtGui.QDockWidget.setTitleBarWidget(int)
Supported signatures:
  PySide.QtGui.QDockWidget.setTitleBarWidget(PySide.QtGui.QWidget)
Comment 1 Matti Airas 2010-10-21 04:23:31 EEST
I'd expect the argument should be None, not 0 in Python. Did you try that?

Of course, even if that works, the bug is still valid, but then it's a
documentation issue instead of a functional one.
Comment 2 kbrownlees 2010-10-21 16:29:34 EEST
Hmm very good point and None does work. Moved it to documentation. 

Should the supported signatures show NoneType as an option? eg:

Supported signatures:
  PySide.QtGui.QDockWidget.setTitleBarWidget(NoneType)
  PySide.QtGui.QDockWidget.setTitleBarWidget(PySide.QtGui.QWidget)
Comment 3 Matti Airas 2010-11-23 05:54:32 EET
(In reply to comment #2)

> Should the supported signatures show NoneType as an option? eg:
> 
> Supported signatures:
>   PySide.QtGui.QDockWidget.setTitleBarWidget(NoneType)
>   PySide.QtGui.QDockWidget.setTitleBarWidget(PySide.QtGui.QWidget)

Good question. I'm not sure whether any functions report NoneType currently.
I'm retaining P3 priority - we'll look into this issue in the upcoming sprints.
Comment 4 Matti Airas 2010-12-16 18:03:48 EET
Having discussed with Renato and Hugo, we think this is a documentation issue.
It's more widespread than only in this case, so all of them should be fixed at
the same time. This, however, is a bigger issue, and post-1.0 material. So, I'm
reprioritizing to P4.
Comment 5 Matti Airas 2011-03-31 11:31:32 EEST
This was deprioritized to P4 because the bug was regarded as post-1.0 material.
Now that 1.0 has been published for one month already, I'd like to see this
bumped to P3.
Comment 6 Hugo Parente Lima 2011-03-31 15:20:57 EEST
Before start working on this bug we should have a definition of done for it,
i.e. what would be a feasible solution for it?

Because replace all 0 by None on PySide docs by hand is a herculean job IMO, so
I stick with Marcelo's proposal of add a note on docs explaining that the
documentation is auto generated from the Qt C++ sources and you must interpret
foo as bar, etc. what do you think? any other suggestion?
Comment 7 Matti Airas 2011-03-31 16:15:54 EEST
(In reply to comment #6)
> Before start working on this bug we should have a definition of done for it,
> i.e. what would be a feasible solution for it?
> 
> Because replace all 0 by None on PySide docs by hand is a herculean job IMO, so
> I stick with Marcelo's proposal of add a note on docs explaining that the
> documentation is auto generated from the Qt C++ sources and you must interpret
> foo as bar, etc. what do you think? any other suggestion?

OK, I get the point. I disagree with going around the problem by adding a note,
though: no-one will read such notes in advance, and if people then stumble on
the same issue and are replied with RTFM, that would just appear as unhelpful
and arrogant.

On the other hand, I of course fully understand that the amount of work could
be rather large if it's done manually.

Pardon my ignorance - where are the doc texts stored in the source tree? I
tried grepping for "widget is 0" in the pyside repo but got nothing.
Comment 8 Hugo Parente Lima 2011-03-31 21:17:58 EEST
(In reply to comment #7)
> OK, I get the point. I disagree with going around the problem by adding a note,
> though: no-one will read such notes in advance, and if people then stumble on
> the same issue and are replied with RTFM, that would just appear as unhelpful
> and arrogant.
> 
> On the other hand, I of course fully understand that the amount of work could
> be rather large if it's done manually.
> 
> Pardon my ignorance - where are the doc texts stored in the source tree? I
> tried grepping for "widget is 0" in the pyside repo but got nothing.

They are on Qt repository :-), the doc is extracted from Qt sources using the
qdoc3 tool.
Comment 9 Matti Airas 2011-04-01 10:31:36 EEST
(In reply to comment #8)

> They are on Qt repository :-), the doc is extracted from Qt sources using the
> qdoc3 tool.

Thanks. Would you mind telling me the precise location?
Comment 10 Hugo Parente Lima 2011-04-05 16:44:13 EEST
(In reply to comment #9)
> (In reply to comment #8)
> 
> > They are on Qt repository :-), the doc is extracted from Qt sources using the
> > qdoc3 tool.
> 
> Thanks. Would you mind telling me the precise location?

Of this method documentation on Qt?

On Qt 4.7.2:

src/gui/widgets/qdockwidget.cpp line 1533
Comment 11 Hugo Parente Lima 2011-05-30 21:26:10 EEST
@all ping

We need to find an acceptable way to fix this bug or it will remain here
forever.

I still voting for Marcelo's proposal of adding a note on docs explaining that
the documentation is auto generated from the Qt C++ sources and you must
interpret foo as bar, etc.
Comment 12 Matti Airas 2011-05-31 14:23:53 EEST
(In reply to comment #11)
> @all ping
> 
> We need to find an acceptable way to fix this bug or it will remain here
> forever.
> 
> I still voting for Marcelo's proposal of adding a note on docs explaining that
> the documentation is auto generated from the Qt C++ sources and you must
> interpret foo as bar, etc.

I guess I'm OK with that. Not the neatest way to fix it, but I figure we don't
have other good options, either.
Comment 13 Hugo Parente Lima 2011-06-07 21:27:19 EEST
Note added in commit:

pyside/e48aa921039e608bbe1dea0adfeb381be87a29df
Comment 14 renato filho 2011-06-22 20:14:15 EEST
release 1.0.4