-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Document setStyleSheet for script Dialog widgets #3605
Document setStyleSheet for script Dialog widgets #3605
Conversation
25bdc0f
to
ce9b89d
Compare
Rather than "adjust the stylesheet", I think better wording would be "set the stylesheet", since the entire stylesheet is replaced. |
docs/scripting-doc/index.d.ts
Outdated
* Set the style sheet for the entire dialog. | ||
* @param styleSheet The text of your style sheet. See https://doc.qt.io/qt-6/stylesheet.html and https://doc.qt.io/qt-6/stylesheet-examples.html for more information | ||
*/ | ||
setStyleSheet(styleSheet: string) : void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than documenting setStyleSheet
here, I think we could derive Dialog
from Qt.QWidget
. The minimumWidth
and minimumHeight
properties could be moved there as well, since they're QWidget
properties after all and should work on all widgets you can add to the dialog as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, btw, I think this should just be documented as a styleSheet : string
property.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done thanks
Most of that stuff should be supported. However, I'm in the process of implementing a custom style for Tiled (#3597), and unfortunately the QStyle documentation notes:
(and I think this warning has been there for many years, since QStyle barely changed since Qt 4) |
…eSheet rather than setStyleSheet().
I didn't realize that this method existed but it seems you can do a lot with this
Example:
Can produce:
I found this because a user was asking if the foreground and background colors could be changed for dialogs.
I added links to the documentation but I am not sure if there are limitations of what stylesheet features can be used versus what is documented in the Qt doc.