I created a simple form with some radio buttons inside a minimal QWebView application. The form has five radio buttons. When I click on the first radio button, the second one becomes selected. When I click on the second, the third is selected. If I click on the last radio button, they all deselect. This is strange because in other browsers the radio button I click on gets selected, not its neighbor.
Here is my form:
<html>
<head>
<title>Fun</title>
</head>
<body>
<form>
<input type=radio name=position value='first'>First<br>
<input type=radio name=position value='second'>Second<br>
<input type=radio name=position value='third'>Third<br>
<input type=radio name=position value='fourth'>Fourth<br>
<input type=radio name=position value='fifth'>Fifth<br>
<input type=submit value='Send it'>
</form>
</body>
</html>
And here is my application:
#include "mainwindow.h"
#include <QApplication>
#include <QWebView>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QWebView wv;
wv.setHtml("<html> <head> <title>Fun</title> </head> <body> <form> <input type=radio name=position value='first'>First<br> <input type=radio name=position value='second'>Second<br> <input type=radio name=position value='third'>Third<br> <input type=radio name=position value='fourth'>Fourth<br> <input type=radio name=position value='fifth'>Fifth<br> <input type=submit value='Send it'> </form> </body> </html>");
wv.show();
return a.exec();
}
This bug occurs with the 5.0.2 release of Qt downloaded from the Qt website. It appears on both Windows Vista and Windows 8. It appeared first on a much more complicated form, this is the simplest application I was able to create that illustrated the problem. I am completely unable to get radio buttons on QWebView to behave properly.
Has anyone else had any luck with the QWebView radio buttons? Am I the only one having this problem? I’ve seen it on two separate machines. I tried using an html document that passed strict html validation from the WC3 site but that didn’t change anything.
Thank you for your help.
↧