Hello All,
Let me preface by stating I am likely doing something wrong here...
I have an about screen that utilizes a QTextBrowser for the 'about' text as well as the support email and website links.
My code works fine on all touch devices and the desktop, however, on 3rd edition devices the cursor gets 'stuck' on the email link. In other words when the user scrolls down the About page, as soon as the cursor hits the email link the cursor freezes on the link and cannot be moved, thus the user must close the about dialog to continue.
If I enable the textEditable property I can then scroll past the email link but the about screen then always opens with the cursor at the bottom of the screen instead of the top, I use ui->textBrowser->moveCursor(QTextCursor::Start); to set the cursor to the top of the page.
Here is my code, bear in mind that I am a beginner to C++
Here is the HTML source from the textBrowser;Code:aboutDialog::aboutDialog(QWidget *parent) : QDialog(parent), ui(new Ui::aboutDialog) { ui->setupUi(this); //set cursor to top of text window ui->textBrowser->moveCursor(QTextCursor::Start); //connect link clicked to open connect(ui->textBrowser, SIGNAL(anchorClicked(QUrl)),this, SLOT(openUrl(QUrl))); //set back soft key back = new QAction(tr("OK"), this); back->setSoftKeyRole(QAction::PositiveSoftKey); connect(back, SIGNAL(triggered()), this, SLOT(backButton())); //set exit softkey aboutDialog::addAction(back); ui->textBrowser->setFocus(); } void aboutDialog::openUrl(QUrl link) { QDesktopServices::openUrl(QUrl(link)); }
And finally here is the textBrowser property's from the ui_aboutDialog.h header;Code:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt; font-weight:600; color:#aa0000;">No Smoking</span></p> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt; font-weight:600; color:#aa0000;"></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">No Smoking was created by Keats Pascoe</span></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Ported to Qt by Jon Heron</span></p> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">For comments and bug reports send us an emai!</span></p> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:4pt; text-decoration: underline; color:#0000ff;"></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-weight:600; text-decoration: underline;">All </span><span style=" font-family:'MS Shell Dlg 2,sans-serif'; font-size:8pt; font-weight:600; text-decoration: underline;">correspondence</span><span style=" font-size:8pt; font-weight:600; text-decoration: underline;"> must be made in English</span></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Be sure to include the application name and version as well as your phone model and/or OS and a detailed description of the issue you are having, if any.</span></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="mailto:symbian.app.support@snappyappz.com?subject=Support&body=What is the problem?"><span style=" font-size:5pt; text-decoration: underline; color:#0000ff;">symbian.app.support@snappyappz.com </span></a></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">For other great applications visit: </span><a href="http://www.snappyappz.com/"><span style=" font-size:8pt; text-decoration: underline; color:#0000ff;">SnappyAppz.com</span></a></p> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt; text-decoration: underline; color:#0000ff;"></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9pt; font-weight:600; color:#006300;">Quality apps in a snap!</span></p> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:9pt; font-weight:600; color:#006300;"></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:7pt;">All rights reserved 2011</span></p> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"></p></body></html>
Can anybody see where I am going wrong with this?Code:textBrowser = new QTextBrowser(scrollAreaWidgetContents); textBrowser->setObjectName(QString::fromUtf8("textBrowser")); QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); sizePolicy.setHeightForWidth(textBrowser->sizePolicy().hasHeightForWidth()); textBrowser->setSizePolicy(sizePolicy); textBrowser->setMouseTracking(true); textBrowser->setContextMenuPolicy(Qt::NoContextMenu); textBrowser->setAcceptDrops(false); textBrowser->setFrameShape(QFrame::NoFrame); textBrowser->setFrameShadow(QFrame::Plain); textBrowser->setTabChangesFocus(true); textBrowser->setAcceptRichText(false); textBrowser->setTextInteractionFlags(Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse); textBrowser->setOpenExternalLinks(true); textBrowser->setOpenLinks(false);
I have a suspicion that it is a bug with Qt creator 2.01 but I dont have enough coding experience to be sure!
Thanks for any and all assistance!
Jon





