diff --git a/src/lib/QtGui/QApplication.ts b/src/lib/QtGui/QApplication.ts index 1d35fedce..c4200db03 100644 --- a/src/lib/QtGui/QApplication.ts +++ b/src/lib/QtGui/QApplication.ts @@ -67,9 +67,13 @@ export class QApplication extends NodeObject { setQuitOnLastWindowClosed(quit: boolean): void { this.native.setQuitOnLastWindowClosed(quit); } - setStyleSheet(styleSheet: string): void { - const preparedSheet = StyleSheet.create(styleSheet); - this.native.setStyleSheet(preparedSheet); + setStyleSheet(styleSheet: string, postprocess = true): void { + if (postprocess) { + const preparedSheet = StyleSheet.create(styleSheet); + this.native.setStyleSheet(preparedSheet); + } else { + this.native.setStyleSheet(styleSheet); + } } static clipboard(): QClipboard | null { const clipboardNative = addon.QApplication.clipboard(); diff --git a/src/lib/QtWidgets/QWidget.ts b/src/lib/QtWidgets/QWidget.ts index ecae15647..dc8126459 100644 --- a/src/lib/QtWidgets/QWidget.ts +++ b/src/lib/QtWidgets/QWidget.ts @@ -369,10 +369,14 @@ export abstract class NodeWidget extends YogaWid this.native.setGraphicsEffect(effect.native); } // TODO: void setInputMethodHints(Qt::InputMethodHints hints) - setInlineStyle(style: string): void { - this._rawInlineStyle = style; - const preparedSheet = prepareInlineStyleSheet(this, style); - this.native.setStyleSheet(preparedSheet); + setInlineStyle(style: string, postprocess = true): void { + if (postprocess) { + this._rawInlineStyle = style; + const preparedSheet = prepareInlineStyleSheet(this, style); + this.native.setStyleSheet(preparedSheet); + } else { + this.native.setStyleSheet(style); + } } setLayout(parentLayout: NodeLayout): void { const flexLayout = parentLayout as FlexLayout; @@ -612,9 +616,13 @@ export abstract class NodeWidget extends YogaWid setHidden(hidden: boolean): void { this.native.setHidden(hidden); } - setStyleSheet(styleSheet: string): void { - const preparedSheet = StyleSheet.create(styleSheet); - this.native.setStyleSheet(preparedSheet); + setStyleSheet(styleSheet: string, postprocess = true): void { + if (postprocess) { + const preparedSheet = StyleSheet.create(styleSheet); + this.native.setStyleSheet(preparedSheet); + } else { + this.native.setStyleSheet(styleSheet); + } } setVisible(visible: boolean): void { this.native.setVisible(visible);