stylesheet performance fix
This commit is contained in:
parent
2359ca8838
commit
65da42e1f3
@ -63,7 +63,11 @@
|
||||
Napi::HandleScope scope(env); \
|
||||
Napi::String text = info[0].As<Napi::String>(); \
|
||||
std::string style = text.Utf8Value(); \
|
||||
this->instance->setStyleSheet(style.c_str()); \
|
||||
QString newStyle = QString::fromStdString(style); \
|
||||
QString currentStyleSheet = this->instance->styleSheet(); \
|
||||
if (newStyle != currentStyleSheet) { \
|
||||
this->instance->setStyleSheet(newStyle); \
|
||||
} \
|
||||
return env.Null(); \
|
||||
} \
|
||||
Napi::Value setCursor(const Napi::CallbackInfo& info) { \
|
||||
|
||||
@ -9,6 +9,8 @@ const label = new QLabel();
|
||||
label.setText('Hello');
|
||||
const label2 = new QLabel();
|
||||
label2.setText('LABEL');
|
||||
label2.setInlineStyle('color: blue;');
|
||||
label2.setInlineStyle('color: teal;');
|
||||
|
||||
tab.addTab(label, new QIcon(), 'I am label tab');
|
||||
tab.addTab(label2, new QIcon(), 'TAB2');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user