Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-interest Archive, May 2007
Display png image in a dialog


Message 1 in thread

I simply want to display a .png image file in a simple dialog box.

Is QGraphicsView the proper way to approach this?  It seems a bit too 
complicated for just displaying an image in an About dialog box.

Mark

--
 [ signature omitted ] 

Message 2 in thread

Use QLabel.

Mark Thompson wrote:
>
> I simply want to display a .png image file in a simple dialog box.
>
> Is QGraphicsView the proper way to approach this?  It seems a bit too
> complicated for just displaying an image in an About dialog box.
>
> Mark
>
> -- 
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>

--
 [ signature omitted ] 

Message 3 in thread

Thanks!  works perfectly.
Mark

Paul Koshevoy wrote:
> Use QLabel.
>
> Mark Thompson wrote:
>   
>> I simply want to display a .png image file in a simple dialog box.
>>
>> Is QGraphicsView the proper way to approach this?  It seems a bit too
>> complicated for just displaying an image in an About dialog box.
>>
>> Mark
>>
>> -- 
>> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
>> "unsubscribe" in the subject or the body.
>> List archive and information: http://lists.trolltech.com/qt-interest/
>>
>>     
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
>
>
>   

-- 
 [ signature omitted ] 

Message 4 in thread

What about simply use QLabel? This was best approach in qt3, and in qt4 it 
even can play movies...

On Friday 04 May 2007 00:33:16 Mark Thompson wrote:
> I simply want to display a .png image file in a simple dialog box.
>
> Is QGraphicsView the proper way to approach this?  It seems a bit too
> complicated for just displaying an image in an About dialog box.

My About dialog:

	void TDlgAbout::setApplication(const QString& app, const char* ico)
	{
		setWindowTitle(tr("About %1...").arg(app));
		lineApp->setText(app);
		labelIcon->setPixmap(QPixmap(ico));
	}

where ico is normally compiled into the program via qrc. Don't forget to 
display something like

	void TDlgAbout::setBuildInfo(const QString& ver, long build, const QDateTime& 
dt)
	{
		lineVer->setText(ver);
		lineBuild->setText(QString::number(build));
		lineDate->setText(dt.toString(tr("dd.MM.yyyy (hh:mm)")));
	}

;-)

--
 [ signature omitted ] 

Message 5 in thread

J. Preiss wrote:
> and in qt4 it even can play movies...

It can play movies in Qt 3 too. :)

--Dave

--
 [ signature omitted ]