[Qt-interest] Can QTextEdit scale in the way what QGraphicsView does?
Guido Seifert
Wargand at gmx.de
Thu May 20 11:24:52 CEST 2010
Nope, works fine in 4.6.
But you just cannot add a text widget to a graphics scene.
To to this you need the QGraphicsProxyWidget. You find an example
how to do it in your qt's demo folder under 'embeddeddialogs'.
Guido
> 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
> >
--
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
More information about the Qt-interest-old
mailing list