[ Fixed ] [ Bug ] Draft_SetStyle failed: no attribute 'dimButton'

A forum dedicated to the Draft, Arch and BIM workbenches development.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
Roy_043
Veteran
Posts: 8538
Joined: Thu Dec 27, 2018 12:28 pm

[ Fixed ] [ Bug ] Draft_SetStyle failed: no attribute 'dimButton'

Post by Roy_043 »

Pretty recent stuff:

Calling Draft_SetStyle results in an error:
Running the Python command 'Draft_SetStyle' failed:
Traceback (most recent call last):
File "D:\BKG_Tmp\FreeCAD_0.20_Last\Mod\Draft\draftguitools\gui_setstyle.py", line 61, in Activated
FreeCADGui.Control.showDialog(Draft_SetStyle_TaskPanel())
File "D:\BKG_Tmp\FreeCAD_0.20_Last\Mod\Draft\draftguitools\gui_setstyle.py", line 76, in __init__
self.form.dimButton.setIcon(QtGui.QIcon(":/icons/Draft_Text.svg"))

'PySide2.QtWidgets.QWidget' object has no attribute 'dimButton'


Code: Select all

OS: Windows 8.1 Version 6.3 (Build 9600)
Word size of FreeCAD: 64-bit
Version: 0.20.24893 (Git)
Build type: Release
Branch: master
Hash: 03855f793feaceeb4385c02f6520f3e1b6429c93
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.0
Locale: Dutch/Netherlands (nl_NL)
Last edited by Roy_043 on Fri Jul 23, 2021 7:56 pm, edited 1 time in total.
User avatar
bitacovir
Veteran
Posts: 1570
Joined: Sat Apr 19, 2014 6:23 am
Contact:

Re: [ Bug ] Draft_SetStyle failed: no attribute 'dimButton'

Post by bitacovir »

Roy_043 wrote: Mon May 17, 2021 10:46 am Pretty recent stuff:

Calling Draft_SetStyle results in an error:
It works for me if I load Draft WB first

OS: Windows 10 (10.0)
Word size of FreeCAD: 64-bit
Version: 0.20.24894 (Git)
Build type: Release
Branch: master
Hash: a378b6b66f8a5992fc1452567ff59bdb613abc80
Python version: 3.8.10
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.5.2
Locale: English/United States (en_US)
::bitacovir::
==================
One must be absolutely modern.
Arthur Rimbaud (A Season in Hell -1873)

Canal Youtube Grupo Telegram de FreeCAD Español

My personal web site
My GitHub repository
Mini Airflow Tunnel Project
User avatar
Roy_043
Veteran
Posts: 8538
Joined: Thu Dec 27, 2018 12:28 pm

Re: [ Bug ] Draft_SetStyle failed: no attribute 'dimButton'

Post by Roy_043 »

bitacovir wrote: Mon May 17, 2021 11:27 am It works for me if I load Draft WB first
Of course I also do that.

Updating to your version resolves the issue. Strange...
User avatar
Roy_043
Veteran
Posts: 8538
Joined: Thu Dec 27, 2018 12:28 pm

Re: [ Bug ] Draft_SetStyle failed: no attribute 'dimButton'

Post by Roy_043 »

Apparently the problem is not related to the FreeCAD version, but rather related the Qt version?

The problem occurs in this version:

Code: Select all

OS: Windows 8.1 Version 6.3 (Build 9600)
Word size of FreeCAD: 64-bit
Version: 0.20.24986 (Git)
Build type: Release
Branch: master
Hash: ff6845e2f31988cc714027980e0100bb5521843e
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.0
Locale: Dutch/Netherlands (nl_NL)
User avatar
yorik
Founder
Posts: 13659
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: [ Bug ] Draft_SetStyle failed: no attribute 'dimButton'

Post by yorik »

Everything seems to work OK here... Do you compile FreeCAD yourself? You might need to touch Draft.qrc , that happens sometimes, an .ui file gets changed, but since the .qrc file didn't change, cmake doesn't recompile it
User avatar
Roy_043
Veteran
Posts: 8538
Joined: Thu Dec 27, 2018 12:28 pm

Re: [ Bug ] Draft_SetStyle failed: no attribute 'dimButton'

Post by Roy_043 »

yorik wrote: Tue Jun 01, 2021 3:22 pm Do you compile FreeCAD yourself?
No. The mentioned version is a weekly build:
FreeCAD_0.20.24986_Win-LPv12.5.4_vc17.x-x86-64.7z
User avatar
Roy_043
Veteran
Posts: 8538
Joined: Thu Dec 27, 2018 12:28 pm

Re: [ Bug ] Draft_SetStyle failed: no attribute 'dimButton'

Post by Roy_043 »

yorik wrote: Tue Jun 01, 2021 3:22 pm Everything seems to work OK here... Do you compile FreeCAD yourself? You might need to touch Draft.qrc , that happens sometimes, an .ui file gets changed, but since the .qrc file didn't change, cmake doesn't recompile it
It is probably a compile issue.

I am using these weekly builds ATM:
FreeCAD_0.20.25065_Win-LPv12.5.4_vc17.x-x86-64.7z
FreeCAD_weekly-builds-25065-Win-Conda_vc14.x-x86_64.7z

If I check the Draft_rc.py file I notice that only in the case of the Conda version does it contain a reference to "dimButton".
Syres
Veteran
Posts: 2898
Joined: Thu Aug 09, 2018 11:14 am

Re: [ Bug ] Draft_SetStyle failed: no attribute 'dimButton'

Post by Syres »

sgrogan wrote: Thu Mar 04, 2021 10:51 pm ping
Could you please have a look that this with regard to the compilation of the weekly LP build noting @Yorik's comment above?
User avatar
Roy_043
Veteran
Posts: 8538
Joined: Thu Dec 27, 2018 12:28 pm

Re: [ Bug ] Draft_SetStyle failed: no attribute 'dimButton'

Post by Roy_043 »

This bug has been fixed. Thanks.

FreeCAD_0.20.25306_Win-LPv12.5.4_vc17.x-x86-64.7z

Code: Select all

OS: Windows 8.1 Version 6.3 (Build 9600)
Word size of FreeCAD: 64-bit
Version: 0.20.25306 (Git)
Build type: Release
Branch: master
Hash: 5f5b3d9b67136edda1f6738f1a83154990f7839d
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.0
Locale: Dutch/Netherlands (nl_NL)
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: [ Bug ] Draft_SetStyle failed: no attribute 'dimButton'

Post by uwestoehr »

yorik wrote: Tue Jun 01, 2021 3:22 pm Everything seems to work OK here... Do you compile FreeCAD yourself? You might need to touch Draft.qrc , that happens sometimes, an .ui file gets changed, but since the .qrc file didn't change, cmake doesn't recompile it
How do I touch the Draft.qrc to force Cmake's recompilation?

I am asking because Roy_043 pointed me to this to resolve the bug I reported here:
https://tracker.freecadweb.org/view.php?id=4705
Post Reply