Because implicit-conversion
to QString
will be used, when passed const char[]
to function and there is no implicit-conversion
, without call to function, so, you are trying to call method arg
on const char[]
, that is incorrect, construct QString
by
statusBar()->showMessage(QString("%1 a sample text").arg("This is "));
and all will be fine.