Results 1 to 3 of 3

Thread: Simple example use of qtmmlwidget.

  1. #1
    Join Date
    Aug 2009
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Simple example use of qtmmlwidget.

    Dear QtCentre,

    I am trying to use the above widget to display a polynomial (nothing more for now!). I have downloaded qtmmlwidget-2.4-opensource which is a "Qt Solution". I have compiled the example provided, which works as expected. I understand that I need to add

    include(../src/qtmmlwidget.pri)

    or equivalent to my .pro file.

    However, from the example I'm having trouble discerning exactly how to:

    (a) read the .mml file into a QTextStream, and then into a QString.
    (b) use QtMmlWidget to take this string and display the content of the .mml file.

    I would be grateful if someone could show me as simple an example as possible of a qt application that takes a .mml file and displays it as a widget in say a MainWindow.

    Many Thanks

    Matt

  2. #2
    Join Date
    Jul 2009
    Location
    Enschede, Netherlands
    Posts
    462
    Thanked 69 Times in 67 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Simple example use of qtmmlwidget.

    Read about QTextStream and QtMmlWidget (check setContent()). It really isn't that difficult.

    1. Open a file
    2. Connect a QTextStream to it
    3. Extract data (textstream >> string)
    4. Put data in QtMmlWidget (mmlThing->setContent(string))

  3. #3
    Join Date
    Aug 2009
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Simple example use of qtmmlwidget.

    I have it working now! I'll make the 'Class Reference' pages my first port of call in future.

    Thanks

    Matt

Similar Threads

  1. Simple way to expand all nodes on a QTreeView?
    By cboles in forum Qt Programming
    Replies: 10
    Last Post: 12th April 2014, 16:54
  2. simple % curve diagram.
    By janEUcitzen in forum Qwt
    Replies: 3
    Last Post: 27th March 2009, 08:16
  3. A simple example of a tree model
    By YaK in forum Qt Programming
    Replies: 2
    Last Post: 4th March 2009, 17:15
  4. Replies: 3
    Last Post: 3rd March 2009, 12:24
  5. very simple and basic FAM/Gamin wrapper for qt
    By momesana in forum Qt-based Software
    Replies: 0
    Last Post: 8th April 2008, 12:46

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.