//VOXOX CHANGE by Rolando - 2009.05.11 - updates variables _shortMessage and _message according parameter text void VoxOxToolTipLineEdit::updateMessageText(QString text){ //VOXOX CHANGE by Rolando - 2009.06.18 - bug fixed when a user changes current text and this one was ending with ellipsis i.e "some large text...e" //VOXOX CHANGE by Rolando - 2009.10.13 if(text.length() > getMaximumCharsAllowed() && text.indexOf(QRegExp(QString("^%1.$").arg(_shortMessage))) != -1){//VOXOX CHANGE by Rolando - 2009.06.18 - check if current text contains to _shortMessage and ends with a different character i.e "shortMessage...e" QString lastChar = text.at(text.length()-1);//VOXOX CHANGE by Rolando - 2009.06.18 - gets the last char of current text text = _message + lastChar;//VOXOX CHANGE by Rolando - 2009.06.18 - merge _message with lastChar and updates text value } if(_shortMessage != text){ _message = text; ////if message is larger than maximum length of status message, removes that difference and adds ellipsis (...) //if(text.length()> _maximumWidthPixels){//VOXOX CHANGE by Rolando - 2009.10.13 // //VOXOX CHANGE by Rolando - 2009.10.13 // text = text.remove(_maximumWidthPixels-3,text.length());//VOXOX CHANGE by Rolando - 2009.10.13 // text += "..."; //} _shortMessage = verifyText(rect(), font(), text);//VOXOX CHANGE by Rolando - 2009.10.13 //_shortMessage = text;//VOXOX CHANGE by Rolando - 2009.10.13 } repaintPrimaryColor(); }
//VOXOX CHANGE by Rolando - 2009.10.13 void VoxOxToolTipLineEdit::updateCurrentText(){ if(text() != ""){ _shortMessage = verifyText(rect(), font(), _message); QLineEdit::setText(_shortMessage); } }
QT_BEGIN_NAMESPACE TranslateDialog::TranslateDialog(QWidget *parent) : QDialog(parent) { m_ui.setupUi(this); connect(m_ui.findNxt, SIGNAL(clicked()), this, SLOT(emitFindNext())); connect(m_ui.translate, SIGNAL(clicked()), this, SLOT(emitTranslateAndFindNext())); connect(m_ui.translateAll, SIGNAL(clicked()), this, SLOT(emitTranslateAll())); connect(m_ui.ledFindWhat, SIGNAL(textChanged(QString)), SLOT(verifyText())); connect(m_ui.ckMatchCase, SIGNAL(toggled(bool)), SLOT(verifyText())); }
QT_BEGIN_NAMESPACE FindDialog::FindDialog(QWidget *parent) : QDialog(parent) { setupUi(this); findNxt->setEnabled(false); connect(findNxt, SIGNAL(clicked()), this, SLOT(emitFindNext())); connect(led, SIGNAL(textChanged(QString)), this, SLOT(verifyText(QString))); led->setFocus(); }
//VOXOX CHANGE - Add support for ItemList style and change paint structure. void QtUMItem::paintForeground(QPainter * painter, const QStyleOptionViewItem & option) { QMutexLocker locker(&_mutex); QtContactPixmap * spx = QtContactPixmap::getInstance(); QtUMItemListStyle * itemListStyle = QtUMItemListStyle::getInstance(); //VOXOX CHANGE by Rolando - 2009.08.25 - getting corresponding close button QPixmap closeButtonPixmap; if ((option.state & QStyle::State_Selected) == QStyle::State_Selected) { closeButtonPixmap = QPixmap(":/pics/chat/umtreewidget/btn_close_selected.png");//VOXOX CHANGE by Rolando - 2009.08.25 painter->setPen(_fontColor);//VOXOX CHANGE by Rolando - 2009.09.07 } else { closeButtonPixmap = QPixmap(":/pics/chat/umtreewidget/btn_close_nonselected.png");//VOXOX CHANGE by Rolando - 2009.08.25 painter->setPen(_fontColor);//VOXOX CHANGE by Rolando - 2009.09.07 } QRect painterRect = option.rect; if(!isAGroupItem()){ //VOXOX CHANGE by Rolando - 2009.08.25 - painting the close button _posXCloseButton = painterRect.right() - closeButtonPixmap.width() - 5;//VOXOX CHANGE by Rolando - 2009.09.16 int centeredCloseButton_y = ((painterRect.bottom() - painterRect.top()) - closeButtonPixmap.size().height()) / 2; painter->drawPixmap(_posXCloseButton, painterRect.top() + centeredCloseButton_y, closeButtonPixmap); _posYCloseButton = painterRect.top() + centeredCloseButton_y; _widthCloseButton = closeButtonPixmap.width();//VOXOX CHANGE by Rolando - 2009.08.27 _heightCloseButton = closeButtonPixmap.height();//VOXOX CHANGE by Rolando - 2009.08.27 } else{ _posXCloseButton = painterRect.right();//VOXOX CHANGE by Rolando - 2009.09.25 } //painting the status icon QPixmap normalPx = getCurrentStatusPixmap();//VOXOX CHANGE by Rolando - 2009.10.26 _posXNetworkStatus = _posXCloseButton - normalPx.width() - 4;//VOXOX CHANGE by Rolando - 2009.10.26 _posXNetworkButton = _posXNetworkStatus; int centeredPx_y = ((painterRect.bottom() - painterRect.top()) - normalPx.size().height()) / 2;//VOXOX CHANGE by Rolando - 2009.10.26 _posYNetworkButton = painterRect.top() + centeredPx_y;//VOXOX CHANGE by Rolando - 2009.10.26 painter->drawPixmap(_posXNetworkStatus, painterRect.top() + centeredPx_y, normalPx);//VOXOX CHANGE by Rolando - 2009.10.26 _widthNetworkButton = normalPx.size().width();//VOXOX CHANGE by Rolando - 2009.10.21 _heightNetworkButton = normalPx.size().height();//VOXOX CHANGE by Rolando - 2009.10.21 std::string foregroundPixmapData = getAvatarData().toStdString(); QPixmap avatar; avatar.loadFromData ((uchar*) foregroundPixmapData.c_str(), foregroundPixmapData.size()); avatar = avatar.scaled ( AVATAR_HEIGHT, AVATAR_WIDTH, Qt::KeepAspectRatio, Qt::SmoothTransformation) ; if(getGroupName() == ""){//VOXOX CHANGE by Rolando - 2009.08.31 painter->drawPixmap(CONTACT_MARGIN, painterRect.top() + (painterRect.height() - AVATAR_HEIGHT) /2, avatar);//VOXOX CHANGE by Rolando - 2009.08.31 painterRect.setLeft(CONTACT_MARGIN+AVATAR_WIDTH+AVATAR_TEXT_MARGIN);//VOXOX CHANGE by Rolando - 2009.08.31 } else{ painter->drawPixmap(CONTACT_MARGIN_IN_GROUP, painterRect.top() + (painterRect.height() - AVATAR_HEIGHT) /2, avatar);//VOXOX CHANGE by Rolando - 2009.08.31 painterRect.setLeft(CONTACT_MARGIN_IN_GROUP+AVATAR_WIDTH+AVATAR_TEXT_MARGIN);//VOXOX CHANGE by Rolando - 2009.08.31 } // Draw the text painter->setFont(option.font); // Center the text vertically QRect textRect = painterRect; int textY = painterRect.top()+AVATAR_MARGIN_TOP+3; textRect.setTop(textY); QString text = fixHtmlString(getDisplayName()); text = verifyText(textRect,option.font,text); painter->drawText(textRect, Qt::AlignLeft, text, 0); }
void TranslateDialog::showEvent(QShowEvent *) { verifyText(); m_ui.ledFindWhat->setFocus(); }