Hi guys,
I have a little problem over here, hope you can help me. When i compile a little application i get this: error: invalid use of void expression
I dont have any idea why im getting that message, the code that gives me problems is the following:
connect(feliz, SIGNAL(clicked()), SLOT(sendImage()));
connect(feliz, SIGNAL(clicked()), SLOT(sendImage()));
To copy to clipboard, switch view to plain text mode
void SimpleChatClient::sendImage(){
QImage img
("/home/wae/Qt4/SimpleChat/SimpleChatClient/Iconos/feliz.png");
chat
->document
()->addResource
(QTextDocument::ImageResource,
QUrl("/home/wae/Qt4/SimpleChat/SimpleChatClient/Iconos/feliz.png"), img
);
html.append("<img src=/home/wae/Qt4/SimpleChat/SimpleChatClient/Iconos/feliz.png>");
socket->write("<" + nick->text().toLatin1() + "> " );
socket->write(chat->setHtml(html));
socket->write("\n");
}
void SimpleChatClient::sendImage(){
QString html;
QImage img("/home/wae/Qt4/SimpleChat/SimpleChatClient/Iconos/feliz.png");
chat->document()->addResource(QTextDocument::ImageResource, QUrl("/home/wae/Qt4/SimpleChat/SimpleChatClient/Iconos/feliz.png"), img);
html.append("<img src=/home/wae/Qt4/SimpleChat/SimpleChatClient/Iconos/feliz.png>");
socket->write("<" + nick->text().toLatin1() + "> " );
socket->write(chat->setHtml(html));
socket->write("\n");
}
To copy to clipboard, switch view to plain text mode
I also added the slot in my .h
Hope you can help me, thank u in advanced!!!
Bookmarks