Results 1 to 2 of 2

Thread: How to use a public Qwebelement variable

  1. #1
    Join Date
    Mar 2012
    Posts
    6
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60

    Default How to use a public Qwebelement variable

    Hello, when I try to use the Qwebelement as a public variable, it doesn't work. For this reason I want to know what am I doing wrong?

    This is my code:

    Header
    Qt Code:
    1. private: QWebElement *element;
    To copy to clipboard, switch view to plain text mode 

    Cpp
    Qt Code:
    1. element = ui->webView->page()->currentFrame()->findFirstElement("#"+ElementID);
    To copy to clipboard, switch view to plain text mode 

    However the compiler send me some errors and I am not sure how to solve that

  2. #2
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: How to use a public Qwebelement variable

    First a recommendation: always tell us the error you get (when you get one).

    Anyway the most obvious problem is that conforming to the documentation findFirstElement returns a QWebElement object and you try to assign that to a QWebElement* (use an object instead of a pointer to hold a copy of that return value).

    If you are having a different problem please write more information.

Similar Threads

  1. Set html <style> with QWebElement
    By poser in forum Qt Programming
    Replies: 1
    Last Post: 18th January 2014, 18:31
  2. QWebElement render problem
    By Vaterland in forum Qt Programming
    Replies: 0
    Last Post: 24th March 2012, 00:36
  3. QWebElement evaluateJavaScript problem
    By Talei in forum Newbie
    Replies: 0
    Last Post: 10th March 2011, 05:38
  4. Dynamically create SVG with QWebElement
    By yawar in forum Qt Programming
    Replies: 0
    Last Post: 11th April 2010, 04:53
  5. How can I access public variable parent Form
    By validator in forum Qt Programming
    Replies: 14
    Last Post: 18th December 2008, 22:12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.