문제

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)));
도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top