void MainWindow::on_getimgsrc_clicked() { QString path=QFileDialog::getOpenFileName(this); if(path!="") { QPixmap qpixmap(path); ui->screenimg->paint(qpixmap); ui->screenimg->setMinimumWidth(qpixmap.width()); ui->screenimg->setMinimumHeight(qpixmap.height()); ui->scrollAreaWidgetContents->setMinimumWidth(qpixmap.width()); ui->scrollAreaWidgetContents->setMinimumHeight(qpixmap.height()); } }
void Nick::refresh() { int flags = 0; NickInfo* nickInfo = getChannelNick()->getNickInfo(); bool away = false; if ( nickInfo ) away = nickInfo->isAway(); if(away) flags=1; Images* images = KonversationApplication::instance()->images(); QPixmap icon; if ( getChannelNick()->isOwner() ) { flags += 64; icon = images->getNickIcon( Images::Owner, away ); } else if ( getChannelNick()->isAdmin() ) { flags += 128; icon = images->getNickIcon( Images::Admin, away ); } else if ( getChannelNick()->isOp() ) { flags += 32; icon = images->getNickIcon( Images::Op, away ); } else if ( getChannelNick()->isHalfOp() ) { flags += 16; icon = images->getNickIcon( Images::HalfOp, away ); } else if ( getChannelNick()->hasVoice() ) { flags += 8; icon = images->getNickIcon( Images::Voice, away ); } else { flags += 4; icon = images->getNickIcon( Images::Normal, away ); } setPixmap( 0, icon ); KABC::Picture pic = nickInfo->getAddressee().photo(); if(!pic.isIntern()) { pic = nickInfo->getAddressee().logo(); } if(pic.isIntern()) { QPixmap qpixmap(pic.data().scaleHeight(m_height)); setPixmap(1,qpixmap); } QString newtext1 = calculateLabel1(); if(newtext1 != text(1)) { setText(1, newtext1); flags += 2; } setText(2, calculateLabel2()); repaint(); if(m_flags != flags) { m_flags = flags; emit refreshed(); // Resort nick list } }