Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace obsolete setTextColor method by setForeground in qtreewidgetitem #2309

Merged
merged 2 commits into from
May 4, 2015

Conversation

dhoegh
Copy link
Contributor

@dhoegh dhoegh commented Apr 8, 2015

Fixes #2305


@Nodd could you check if this fixes your problem?

@ccordoba12 ccordoba12 added this to the v3.0 milestone Apr 16, 2015
@ccordoba12
Copy link
Member

@Nodd, could you test @dhoegh fix please?

@goanpeca
Copy link
Member

@Nodd ?

@goanpeca
Copy link
Member

@dhoegh can we have a more explanatory title for this PR?

@Nodd
Copy link
Contributor

Nodd commented Apr 22, 2015

Now I have

Traceback (most recent call last):
  File "/home/joseph/prog/spyder.git/spyderplugins/widgets/profilergui.py", line 253, in <lambda>
    self.finished(ec, es))
  File "/home/joseph/prog/spyder.git/spyderplugins/widgets/profilergui.py", line 318, in finished
    self.show_data(justanalyzed=True)
  File "/home/joseph/prog/spyder.git/spyderplugins/widgets/profilergui.py", line 340, in show_data
    self.datatree.show_tree()
  File "/home/joseph/prog/spyder.git/spyderplugins/widgets/profilergui.py", line 467, in show_tree
    self.populate_tree(self, self.find_callees(rootkey))
  File "/home/joseph/prog/spyder.git/spyderplugins/widgets/profilergui.py", line 540, in populate_tree
    child_item.setTextColor(2, QColor(cum_time_dif[1]))
AttributeError: 'TreeWidgetItem' object has no attribute 'setTextColor'

And the name and total time of the first function appear in the table, so it's already better !

@dhoegh
Copy link
Contributor Author

dhoegh commented Apr 23, 2015

@Nodd thank you for testing, I will debug further in the weekend when I have some time off from the master thesis.

@dhoegh
Copy link
Contributor Author

dhoegh commented Apr 24, 2015

@nood I am not able to reproduce your result on ubuntu 14.10 Python 2.7.8 64bits, Qt 4.8.6, PyQt4 (API v2) 4.11.2 on Linux do you have any idea what could be wrong?

@dhoegh
Copy link
Contributor Author

dhoegh commented Apr 24, 2015

Everything seems to work fine on my side with this pr's branch, but on master I am able to reproduce you error reported in #2305

>>> Traceback (most recent call last):
  File "/media/hoegh/8CA055F2A055E2EE/Users/Hoegh/Documents/spyder/spyderplugins/widgets/profilergui.py", line 253, in <lambda>
    self.finished(ec, es))
  File "/media/hoegh/8CA055F2A055E2EE/Users/Hoegh/Documents/spyder/spyderplugins/widgets/profilergui.py", line 318, in finished
    self.show_data(justanalyzed=True)
  File "/media/hoegh/8CA055F2A055E2EE/Users/Hoegh/Documents/spyder/spyderplugins/widgets/profilergui.py", line 339, in show_data
    self.datatree.load_data(self.DATAPATH)
  File "/media/hoegh/8CA055F2A055E2EE/Users/Hoegh/Documents/spyder/spyderplugins/widgets/profilergui.py", line 427, in load_data
    map(lambda x: x.calc_callees().stats, stats_indi)
  File "/media/hoegh/8CA055F2A055E2EE/Users/Hoegh/Documents/spyder/spyderplugins/widgets/profilergui.py", line 427, in <lambda>
    map(lambda x: x.calc_callees().stats, stats_indi)
AttributeError: 'NoneType' object has no attribute 'stats'

@Nodd Nodd mentioned this pull request Apr 24, 2015
5 tasks
@dhoegh
Copy link
Contributor Author

dhoegh commented Apr 27, 2015

@goanpeca could you see if you can find any problems with the profiler on this branch, because I can't reproduce what @Nodd sees on either linux/windows with 2.7 or 3.4.

@goanpeca
Copy link
Member

goanpeca commented May 4, 2015

@dhoegh sorry for the delay, I tested your branch on win7 py2.7 and py3.4 and it seems to be working fine 👍

@Nodd
Copy link
Contributor

Nodd commented May 4, 2015

Aha, setTextColor is obsolete: http://doc.qt.io/qt-4.8/qtreewidgetitem-obsolete.html
Since I use Qt5, it was removed but it is still present in Qt4.8 to keep compatibility.

@dhoegh
Copy link
Contributor Author

dhoegh commented May 4, 2015

@Nodd I have pushed a new commit where setTextColor is changed to setForeground. Can you verify this solves your problem with the profiler completely?

@Nodd
Copy link
Contributor

Nodd commented May 4, 2015

It works, thanks !

@goanpeca
Copy link
Member

goanpeca commented May 4, 2015

Merging then?

@dhoegh
Copy link
Contributor Author

dhoegh commented May 4, 2015

Great, then this is good to merge:)

@goanpeca goanpeca changed the title Try to fix #2305. Replace obsolete setTextColor method by setForeground in qtreewidgetitem May 4, 2015
@goanpeca
Copy link
Member

goanpeca commented May 4, 2015

Thanks for working on this @dhoegh.


@ccordoba12, this should be ready for merging

@ccordoba12
Copy link
Member

@Nodd, thanks a lot for the review and for testing ;-)

ccordoba12 added a commit that referenced this pull request May 4, 2015
Replace obsolete setTextColor method by setForeground in qtreewidgetitem
@ccordoba12 ccordoba12 merged commit c87cdbd into spyder-ide:master May 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Profiling error
4 participants