0

With Qt Installer Controller Script I see how to change the text of some labels on the Introduction page. I did

function Controller()
{
}

Controller.prototype.IntroductionPageCallback = function()
{

    var widget = gui.currentPageWidget();
    if (widget != null) {
        widget.title = "New title"; 
        widget.MessageLabel.setText("New Message."); 
    }
}

Why they work differently? To set title I do = "New title" but to set MessageLabel I do .setText("New Message.").

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
KcFnMi
  • 5,516
  • 10
  • 62
  • 136
  • 2
    Because that's how the developer decided to implement these. One as a property, the other one as a method. – Thomas May 02 '21 at 05:04
  • How can one find out which way should be used? Try both and see which one works? – KcFnMi May 02 '21 at 05:12
  • 1
    @KcFnMi Both ways are valid, in C++ it would be like: `wizardPage->setTitle("Foo")` and `wizardPage->setProperty("title", "Foo")`. That is, the C++ qproperties are exposed as properties. – eyllanesc May 02 '21 at 05:17
  • I tried `widget.title.setText("New title")` and unless I did something else wrong it didn't worked. Also tried `widget.MessageLabel = "New Message"` and it also don't seem to work. Why do you say "both ways are valid"? – KcFnMi May 02 '21 at 05:41

0 Answers0