Comments (8)
It seems to be a problem for newer PySide versions. With my Qt 6.2.4 and corresponding PySide version it works without problems.
if button == QtGui.QDialogButtonBox.Apply.value:
The value
attribute doesn't exist for older PySide versions. To make it working for all PySide versions you should try:
def clicked(self, button):
if button == int(QtGui.QDialogButtonBox.Apply):
from freecad.
it does not work:
<class 'TypeError'>: int() argument must be a string, a bytes-like object or a real number, not 'StandardButton'
from freecad.
OK, then the alternative is to modify TaskDialogPython::clicked(int i)
where the int should be converted into a QtGui.QDialogButtonBox.StandardButton and passed to the clicked() method of the Python wrapper.
Does this code snippet work for you?
from PySide import QtGui
QtGui.QDialogButtonBox.StandardButton(33554432)
from freecad.
The code snippet works.
With:
def clicked(self, button):
b=QtGui.QDialogButtonBox.StandardButton(button)
if b == QtGui.QDialogButtonBox.Apply:
the button works normally.
from freecad.
OK, I will prepare a PR to handle this and #14156
Can you also check whether this works for you? #14156 (comment)
from freecad.
With #14156 (comment) buttons are not even added and there is an error generated when executing Gui.Control.showDialog
.
<input>(1)<class 'TypeError'>: int() argument must be a string, a bytes-like object or a real number, not 'StandardButton'
from freecad.
Thanks for testing. Yes, according to the docs PyNumber_Long in C is equal to int() in Python and will fail in your case. So, I have to additionally check if the passed object has the attribute value
and do the cast on that.
from freecad.
from freecad.
Related Issues (20)
- BIM: Layers manager not working HOT 6
- Sketcher selection box barely visible in Light theme HOT 10
- Tool is not selected in the toolbar after clicking HOT 2
- "Undo" doesn't work properly for external geometry creation HOT 6
- Cannot find Polar transform in sketcher workbench HOT 1
- TechDraw: No default page template HOT 9
- Cannot change Shape Appearance HOT 1
- UI: task overlay interferes with spreadsheet HOT 5
- No visual cue to help selecting a point in model view HOT 9
- Change a position of the dimentions popup (Length, etc)
- Importing SVG (produced by InkScape) fails with "ordinal not in range(128)" HOT 5
- Part Workbench: Create sketch from three points, origin unrelated to any of the points HOT 3
- Suppressing geometry triggers TNP HOT 2
- After recent upgrade of Qt6 and python3.12 on Archlinux, Draft and Arch WB get errors. HOT 4
- STEP Export going wrong HOT 2
- Arch Wall Alignments using implict Sketcher Direction Constraints HOT 1
- Addon manager causes temporary ban from github (ratelimit) HOT 15
- Locale defaults to "C" on Mac, rather than utf-8, triggers bugs HOT 3
- "New File" option buttons on Welcome Screen shrink when theme is selected HOT 1
- PartDesign::Thickness fails on more complex solids with "unknown exception" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from freecad.