[Qt-interest] Can QTextEdit scale in the way what QGraphicsView does?

cheng long kevinclcn at gmail.com
Thu May 20 10:11:06 CEST 2010


Does it works only in Qt 4.7? I tried but it fails to work. Codes as below:
   m_pWinWidget = new QWinWidget(this);
   QHBoxLayout* hbox = new QHBoxLayout(m_pWinWidget);

   QGraphicsView* view = new QGraphicsView();
   hbox->addWidget(view);

   QGraphicsScene* scene = new QGraphicsScene();
   view->setScene(scene);

   QTextEdit* textEdit = new QTextEdit(view);
   textEdit->setText("Hello, Qt");
   scene->addWidget(textEdit);

   hbox->setMargin(0);
   view->setMinimumHeight(300);
   view->setMinimumWidth(300);
   m_pWinWidget->show();

Kevin

On Thu, May 20, 2010 at 4:00 PM, Guido Seifert <Wargand at gmx.de> wrote:

>
>
> I want to add: I tried this once. Worked fine. Sort of. The fonts looked
> very quickly very ugly.
>
> Guido
>
> -------- Original-Nachricht --------
> > Datum: Thu, 20 May 2010 08:58:57 +0100
> > Von: Sean Harmer <sean.harmer at maps-technology.com>
> > An: qt-interest at trolltech.com
> > Betreff: Re: [Qt-interest] Can QTextEdit scale in the way what
> QGraphicsView  does?
>
> > Hi,
> >
> > On Thursday 20 May 2010 08:47:06 cheng long wrote:
> > > QGraphicsView scales its content by adjusting its transform matrix,
> > > very excellent!
> > >
> > > Is there any way to add this functionality to QTextEdit? How?
> >
> > You can use QGraphicsProxyWidget to add a QTextEdit to a graphics view to
> > enable transformations. See the example in the documentation for more
> > detail:
> >
> > http://doc.qt.nokia.com/4.7-snapshot/qgraphicsproxywidget.html#details
> >
> > Cheers,
> >
> > Sean
> > _______________________________________________
> > Qt-interest mailing list
> > Qt-interest at trolltech.com
> > http://lists.trolltech.com/mailman/listinfo/qt-interest
>
> --
> GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
> Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100520/233ba09a/attachment.html 


More information about the Qt-interest-old mailing list