Domanda

How do I connect QSlider to QWebView's setTextSizeMultiplier in Qt? I want to web's text to get smaller or larger depending on the slider's value when it changes.

This is how I'm trying to do it, but not getting anywhere: thesliderbar is QSlider and vweb is QWebView

connect(thesliderbar,SIGNAL(valueChanged(int)),ui->vweb,SLOT(setTextSizeMultiplier(int)));
È stato utile?

Soluzione

http://doc.qt.io/qt-5/qwebview.html for here you can see that setTextSizeMultiplier it is not a slot so you can not connect/compile...

EDIT1: also function signature is different. You are using int as a parameter but it is a qreal...

Make a slot in your class, connect to it and update the text multiplier from there.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top