Results 1 to 6 of 6

Thread: Could I use QWidget and qml together?

  1. #1
    Join Date
    Jan 2011
    Posts
    127
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    42
    Thanked 4 Times in 4 Posts

    Default Could I use QWidget and qml together?

    I want to use QTextBrowser to create a simple help engine
    How could I open a QWidget from qml?

    something like

    Qt Code:
    1. import QtQuick 2.1
    2.  
    3. import Help 1.0
    4.  
    5. Rectangle {
    6. width: 100
    7. height: 62
    8.  
    9. HelpBrowser{id: helpBrowser}
    10.  
    11. MouseArea{
    12. anchors.fill: parent
    13.  
    14. onClicked: {
    15. helpBrowser.showBrowser()
    16. }
    17. }
    18.  
    19. }
    To copy to clipboard, switch view to plain text mode 

    Or there exist easier solution in qml?

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

    Default Re: Could I use QWidget and qml together?

    Expose a "HelpBrowser" type to QML that will open a widget when its showBrowser() slot is called. Be aware the widget will be opened in a new window. Also remember to construct a QApplication instead of QGuiApplication and link the widgets module.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following user says thank you to wysota for this useful post:

    stereoMatching (3rd July 2013)

  4. #3
    Join Date
    Jan 2011
    Posts
    127
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    42
    Thanked 4 Times in 4 Posts

    Default Re: Could I use QWidget and qml together?

    Thanks, qml do not exist a rich text "browser" like QTextBrowser?
    QWebkit is not an option since Qt on android do not support this module yet
    But open a new window on mobile is weird too

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

    Default Re: Could I use QWidget and qml together?

    Quote Originally Posted by stereoMatching View Post
    Thanks, qml do not exist a rich text "browser" like QTextBrowser?
    You can show rich text using the Text element.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. The following user says thank you to wysota for this useful post:

    stereoMatching (3rd July 2013)

  7. #5
    Join Date
    Jan 2011
    Posts
    127
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    42
    Thanked 4 Times in 4 Posts

    Default Re: Could I use QWidget and qml together?

    I wrote some helps as "html", Text element can't bite all of the tags in those html, but I guess
    I don't have a better choice but to do some alternation about the helps by now.

  8. #6
    Join Date
    Jan 2011
    Posts
    127
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    42
    Thanked 4 Times in 4 Posts

    Default Re: Could I use QWidget and qml together?

    The codes works now, I typed something wrong before. Thanks for your helps

Similar Threads

  1. Replies: 1
    Last Post: 30th October 2010, 12:28
  2. Replies: 1
    Last Post: 16th September 2010, 15:57
  3. Replies: 1
    Last Post: 12th April 2010, 12:55
  4. Replies: 3
    Last Post: 1st April 2010, 23:56
  5. Replies: 1
    Last Post: 2nd May 2006, 21:11

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.