Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Import from Odt
Forum Updated to NodeBB v4.3 + New Features

Import from Odt

Scheduled Pinned Locked Moved Unsolved General and Desktop
qt4.8qtextdocumentqt5
3 Posts 3 Posters 1.7k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    alan73
    wrote on 25 Dec 2015, 10:21 last edited by
    #1

    Hello!

    There is an ability to export to Odt from QTextDocument with the help of QTextDocumentWriter in Qt. Is there any way to import to QTextDocument from Odt?

    B 1 Reply Last reply 25 Dec 2015, 14:09
    0
    • A alan73
      25 Dec 2015, 10:21

      Hello!

      There is an ability to export to Odt from QTextDocument with the help of QTextDocumentWriter in Qt. Is there any way to import to QTextDocument from Odt?

      B Offline
      B Offline
      Bagavathi
      wrote on 25 Dec 2015, 14:09 last edited by
      #2

      @alan73

      Please refer the below link, It may help you.

      OOReader

      1 Reply Last reply
      0
      • P Offline
        P Offline
        patrik08
        wrote on 9 Aug 2017, 14:35 last edited by
        #3

        Odt import file is very easy...

        OOReader.h is my work, is a subset from Okular KDE ...
        https://github.com/pehohlva/fop-miniscribus/blob/master/OO_Widged/oasis/OOReader.h
        2017 the best way is now textutil from mac it convert doc rtf docx odt and many other format to txt or html to play in QTextedit ...

        void ZipDoc::handler_txtutils( const QString file ) {
        	qDebug() << "### handler use-> " <<  __FUNCTION__;
             //// converter = /usr/bin/textutil
             if (converter.size() < 4) {
               text_s = QString("textutil -convert .. unable to read! or not mac osx.");
             }
            //// ram->LoadFile(file);
            //// const QByteArray base = ram->stream();
             QTime myTimer;
             myTimer.start();
            QProcess *process = new QProcess(NULL);
            process->setReadChannelMode(QProcess::MergedChannels);
            process->start(converter,  QStringList() << "-convert" << "txt" << file << "-stdout", QIODevice::ReadOnly );
              if (!process->waitForFinished()) {
                   text_s = QString("Unable to read!.");
              } else {
                   text_s = strip_tag(process->readAll());
              }
        
              qDebug() << "### handler_txtutils time-> " << myTimer.elapsed();
        }
        
        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved