×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Dec 2010
    Posts
    4

    Cursor for QWebView

    I want to create a web base application that involve opening a web view. I do this by using QWebView, but the cursor is missing from my web view. How would I enable it and make it just like normal browser?

  2. #2
    Registered User
    Join Date
    Dec 2010
    Posts
    4

    Re: Cursor for QWebView

    Can someone help me, how would I navigate in my web view without a cursor?

  3. #3
    Super Contributor
    Join Date
    Oct 2008
    Location
    INDIA
    Posts
    2,326

    Re: Cursor for QWebView

    Quote Originally Posted by AlexTan View Post
    I want to create a web base application that involve opening a web view. I do this by using QWebView, but the cursor is missing from my web view. How would I enable it and make it just like normal browser?
    http://doc.qt.nokia.com/4.6-snapshot/qcursor.html

  4. #4
    Registered User
    Join Date
    Dec 2010
    Posts
    4

    Re: Cursor for QWebView

    QWebView *webView = new QWebView(this);
    QPalette pal = webView->palette();
    pal.setBrush(QPalette::Base, Qt::white);
    webView->setPalette(pal);

    webView->setGeometry(5,5,230,200);
    webView->setStyleSheet("background-color:rgb(255,255,255); padding: 7px ; color:rgb(255,255,255)");

    QCursor myCursor;
    myCursor.setShape(Qt::ArrowCursor);
    myCursor.setPos(50,50);
    webView->setCursor(myCursor);

    webView->load(QUrl("http://www.google.com"));
    webView->show();
    Hi, thanks
    Above is my code, still doesn't see any cursor, am I missing anything?

  5. #5
    Super Contributor
    Join Date
    Oct 2008
    Location
    INDIA
    Posts
    2,326

    Re: Cursor for QWebView

    To associate a cursor with a widget, use QWidget::setCursor(). To associate a cursor with all widgets (normally for a short period of time), use QApplication::setOverrideCursor().

  6. #6
    Regular Contributor
    Join Date
    Sep 2010
    Posts
    76

    Re: Cursor for QWebView

    QWebView *webView = new QWebView(this);
    QPalette pal = webView->palette();
    pal.setBrush(QPalette::Base, Qt::white);
    webView->setPalette(pal);

    webView->setGeometry(5,5,230,200);
    webView->setStyleSheet("background-color:rgb(255,255,255); padding: 7px ; color:rgb(255,255,255)");

    QCursor myCursor;
    myCursor.setShape(Qt::ArrowCursor);
    myCursor.setPos(50,50);
    webView->setCursor(myCursor);

    webView->load(QUrl("http://www.google.com"));
    webView->show();
    Hi, thanks
    Above is my code, still doesn't see any cursor, am I missing anything?
    As he explain, already use setCursor, but the cursor didn't appear.

  7. #7
    Registered User
    Join Date
    Dec 2010
    Posts
    4

    Re: Cursor for QWebView

    Yes I already put the setCursor() but still didn't see it, can someone please help.

Similar Threads

  1. QWebView
    By atonical in forum Qt
    Replies: 1
    Last Post: 2011-02-13, 19:14
  2. QWebView 崩溃的问题
    By zipboy1979 in forum [Archived] Qt General ( Qt技术)
    Replies: 9
    Last Post: 2011-01-14, 17:06
  3. Problem with QwebView
    By toto42toto in forum Qt
    Replies: 1
    Last Post: 2010-07-20, 13:07

Posting Permissions

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