On my mac i use.....
qmake -v
QMake version 2.01a
Using Qt version 4.4.0-snapshot-20070608 in /usr/local/Trolltech/Qt-4.4.0-snapshot-20070608/lib
and its run OK
try to build
http://code.google.com/p/qxhtml-edit/
only append text plain ...
http://qxhtml-edit.googlecode.com/sv...c/qvimedit.cpp
void QVimedit
::insertFromMimeData ( const QMimeData * source
) {
//////////qDebug() << "### insertFromMimeData 2 ";
if ( source->hasImage() ) {
numerobase++;
QImage images
= qvariant_cast<QImage>
(source
->imageData
());
bool salvato = images.save(nuovaim,"PNG",100);
//////////////////qDebug() << "### salvato 1/0 " << salvato;
emit TakeImage(nuovaim); /* and remove nuovaim */
return;
}
////////////////QTextEdit::insertFromMimeData(source);
if ( source->formats().contains("text/html") ) {
////////qDebug() << "### incomming paste text/html ";
/* fwriteutf8(QString fullFileName,QString xml) */
QTidy *tidy = new QTidy(); /* QTidy *tidy; */
tidy->Init(tidicaches); /* tidy cache remove on last event */
const QString xhtmlnew
= tidy
->TidyExternalHtml
(draghtml
);
///////fwriteutf8("copy_in.html",xhtmlnew);
textCursor().insertFragment(fragment);
emit IncommingHTML();
return;
}
}
void QVimedit::insertFromMimeData ( const QMimeData * source )
{
//////////qDebug() << "### insertFromMimeData 2 ";
if ( source->hasImage() ) {
numerobase++;
const QString nuovaim = QString("%2/image_%1.png").arg(numerobase).arg(QDir::homePath());
QImage images = qvariant_cast<QImage>(source->imageData());
bool salvato = images.save(nuovaim,"PNG",100);
//////////////////qDebug() << "### salvato 1/0 " << salvato;
emit TakeImage(nuovaim); /* and remove nuovaim */
return;
}
////////////////QTextEdit::insertFromMimeData(source);
if ( source->formats().contains("text/html") ) {
////////qDebug() << "### incomming paste text/html ";
const QString tidicaches = QString("%2/.qtidy/").arg(QDir::homePath());
QString draghtml = source->html();
/* fwriteutf8(QString fullFileName,QString xml) */
QTidy *tidy = new QTidy(); /* QTidy *tidy; */
tidy->Init(tidicaches); /* tidy cache remove on last event */
const QString xhtmlnew = tidy->TidyExternalHtml(draghtml);
///////fwriteutf8("copy_in.html",xhtmlnew);
QTextDocumentFragment fragment = QTextDocumentFragment::fromHtml(xhtmlnew);
textCursor().insertFragment(fragment);
emit IncommingHTML();
return;
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks