Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-3501

QTextEdit "alt" tag regression from Qt3

XMLWordPrintable

      Running the Qt4 test case below results in the loss of the "alt" tag, whereas in the Qt3 version it doesn't happen.

      Qt4 test case:
      //----------------------
      #include <QtGui>

      class Test: public QMainWindow
      {
      public:
      Test( QWidget * parent = 0 )
      : QMainWindow( parent )

      { QTextEdit * edit = new QTextEdit( this ); setCentralWidget( edit ); QString html = "<img src='foo' alt='stuff:0:0'>"; edit->setHtml( html ); qDebug() << "Html in : " << html; qDebug() << "Html out: " << edit->toHtml(); }

      };

      int main( int argc, char * argv[] )
      {
      QApplication a( argc, argv );
      Test t;
      t.resize( 700, 800 );
      t.show();
      return a.exec();
      }

      Qt3 test case:
      //----------------------
      #include <qapplication.h>
      #include <qmainwindow.h>
      #include <qtextedit.h>

      class Test: public QMainWindow
      {
      public:
      Test( QWidget * parent = 0, const char * name = 0 )
      : QMainWindow( parent, name )

      { QTextEdit * edit = new QTextEdit( this ); setCentralWidget( edit ); QString html = "<img src='foo' alt='stuff:0:0'>"; edit->setTextFormat(Qt::RichText); edit->setText( html ); qDebug("Html in : %s \n", html.latin1() ); qDebug("Html out: %s \n", edit->text().latin1()); }

      };

      int main( int argc, char * argv[] )
      {
      QApplication a( argc, argv );
      Test t;
      t.resize( 700, 800 );
      t.show();
      return a.exec();
      }

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            esabraha Eskil Abrahamsen Blomfeldt
            admin Administrator
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes