×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Feb 2010
    Posts
    210

    QTextBrowser and 'sticky' link on 3rd edition devices

    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++
    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));
    }
    Here is the HTML source from the textBrowser;
    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&amp;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>
    And finally here is the textBrowser property's from the ui_aboutDialog.h header;
    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);
    Can anybody see where I am going wrong with this?
    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
    Last edited by Jon Heron; 2011-02-13 at 18:14.

  2. #2
    Registered User
    Join Date
    Feb 2010
    Posts
    210

    Re: QTextBrowser and 'sticky' link on 3rd edition devices

    Here is a complete test application that reproduces the problem, including in the S60_3rd_FP1_4 SDK emulator via creator.
    Jon
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    Feb 2010
    Posts
    210

    Re: QTextBrowser and 'sticky' link on 3rd edition devices

    I have filed a bug report HERE.
    Jon

Similar Threads

  1. Replies: 9
    Last Post: 2011-07-24, 07:44
  2. always on top icon on 3rd edition devices
    By saji_iq in forum Symbian User Interface
    Replies: 5
    Last Post: 2007-09-27, 23:37
  3. Animation support on S60 3rd edition devices
    By dave-rv in forum Symbian
    Replies: 0
    Last Post: 2007-07-26, 12:10
  4. FILETEXT on real 3rd edition devices
    By John.Holloway in forum Symbian
    Replies: 1
    Last Post: 2006-05-18, 05:25

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×