This forum has been archived. All content is frozen. Please use KDE Discuss instead.

How do i change images?

Tags: None
(comma "," separated)
User avatar
QueenZ
Registered Member
Posts
78
Karma
0
OS

How do i change images?

Sun Feb 07, 2010 2:25 pm
I got errors with my code...
Code: Select all
ui->label->pixmap(":/new/prefix1/images/solve3.png");


also got errors with this code...

Code: Select all
  char[32] urr = ":/new/prefix1/images/solve3.png";
    ui->label->pixmap(urr);


ERRORS:
/Users/martins/showhide/mainwindow.cpp:31: error: no matching function for call to 'QLabel::pixmap(const char [32])'

/Library/Frameworks/QtGui.framework/Headers/qlabel.h:75: note: candidates are: const QPixmap* QLabel::pixmap() const


pinotree
KDE Developer
Posts
222
Karma
7
OS

Re: How do i change images?

Sun Feb 07, 2010 4:42 pm
What about

Code: Select all
ui->label->setPixmap(QPixmap(":/new/prefix1/images/solve3.png"));

?
Also, having a look at the API documentation isn't a bad idea at all: http://doc.trolltech.com/4.6/qlabel.html


Pino Toscano


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell