Results 1 to 15 of 15

Thread: h0w i can get a browser window on selection of item from tree-widget(item-based)

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: h0w i can get a browser window on selection of item from tree-widget(item-based)


  2. #2
    Join Date
    Nov 2006
    Location
    gurgaon
    Posts
    49
    Qt products
    Qt4
    Platforms
    MacOS X
    Thanks
    12

    Default Re: h0w i can get a browser window on selection of item from tree-widget(item-based)

    my coding part:


    void form1::showResult(QTreeWidgetItem * item, int column)
    {
    QString str,str1;
    str=item->text(0);

    if(str.compare("sub1")==0)

    {
    QUrl myurl;
    myurl=QUrl::fromEncoded("http://www.google.com");
    textBrowser->setSource(myurl);

    }

    form1 is my name of form

    so plz suggest me best fit coding
    as u say QDesktopServices::
    as i find openURl() take bool value...
    thanks & regards
    --------------------
    jyoti

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: h0w i can get a browser window on selection of item from tree-widget(item-based)

    Quote Originally Posted by jyoti View Post
    as i find openURl() take bool value...
    ?????????????????????????????

    AFAIK this method takes a QUrl argument...

    Qt Code:
    1. QDesktopServices::openUrl(QUrl("http://www.qtcentre.org"));
    To copy to clipboard, switch view to plain text mode 

  4. #4
    Join Date
    Nov 2006
    Location
    gurgaon
    Posts
    49
    Qt products
    Qt4
    Platforms
    MacOS X
    Thanks
    12

    Default Re: h0w i can get a browser window on selection of item from tree-widget(item-based)

    thank u very much...


    but can u plz help me abt this type of another query...
    if my file is placed on my desktop n i want the same...
    means on selection of "sub11"
    a help folder should be opened..which is placed on my desktop...

    plz do help me out....as soon as possible

    thanks in advance
    thanks & regards
    --------------------
    jyoti

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: h0w i can get a browser window on selection of item from tree-widget(item-based)

    Just change the URL to point to the file you wish to open. QUrl::fromLocalFile() may be handy.

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
  •  
Qt is a trademark of The Qt Company.