void Card::setAll(const char* allch) { String all = allch; int indexof = all.find(delim); if (indexof > -1) { setQuantity(all.substr(0,indexof++).c_str()); all=all.substr(indexof); indexof = all.find(delim); setText(all.substr(0,indexof++).c_str()); all=all.substr(indexof); indexof = all.find(delim); setThumb(all.substr(0,indexof++).c_str()); all=all.substr(indexof); indexof = all.find(delim); setFront(all.substr(0,indexof++).c_str()); all=all.substr(indexof); indexof = all.find(delim); setBack(all.substr(0,indexof++).c_str()); all=all.substr(indexof); indexof = all.find(delim); setId(all.substr(0,indexof++).c_str()); all=all.substr(indexof); indexof = all.find(delim); setRate(all.substr(0,indexof++).c_str()); all=all.substr(indexof); indexof = all.find(delim); setValue(all.substr(0,indexof++).c_str()); all=all.substr(indexof); indexof = all.find(delim); setNote(all.substr(0,indexof++).c_str()); all=all.substr(indexof); setLoaded(true); if ((getText().length() <= 0)||(getQuantity().length() <= 0)) { setQuantity(""); setText(""); setLoaded(false); } } else { setQuantity(""); setText(""); setThumb(""); setFront(""); setBack(""); setId(""); setRate(""); setValue(""); setNote(""); setLoaded(false); } }
void CalMonthWidget::slotThumbnail(const LoadingDescription& desc, const QPixmap& pix) { if (QUrl::fromLocalFile(desc.filePath) != d->imagePath) { return; } setThumb(pix); }
void MonthWidget::gotThumbnail( const KUrl &url, const QPixmap &pix ) { if ( url != imagePath_ ) return; QPixmap image = pix; int angle = interface_->info( url ).angle(); if ( angle != 0 ) { QMatrix matrix; matrix.rotate( angle ); image = image.transformed( matrix ); } setThumb(image); }
bool CCScrollBar::initWithTrackAndThumb(CCScale9Sprite* track, CCScale9Sprite* thumb) { if(!CCLayer::init()) { return false; } // anchor ignoreAnchorPointForPosition(false); // save track and thumb setTrack(track); setThumb(thumb); // update scheduleUpdate(); return true; }
CalMonthWidget::CalMonthWidget(QWidget* const parent, int month) : QPushButton(parent), d(new Private) { setAcceptDrops(true); setFixedSize(QSize(74, 94)); d->month = month; d->imagePath = QUrl(); setThumb(QPixmap(QIcon::fromTheme(QLatin1String("view-preview")) .pixmap(32, QIcon::Disabled))); connect(d->thumbLoadThread, SIGNAL(signalThumbnailLoaded(LoadingDescription,QPixmap)), this, SLOT(slotThumbnail(LoadingDescription,QPixmap))); connect(this, SIGNAL(pressed()), this, SLOT(slotMonthSelected())); }
void MonthWidget::mouseReleaseEvent(QMouseEvent* event) { if (!contentsRect().contains(event->pos())) return; if (event->button() == Qt::LeftButton) { KIPIPlugins::ImageDialog dlg( this, interface_, true ); setImage(dlg.url()); } else if (event->button() == Qt::RightButton) { imagePath_ = QString(""); CalSettings::instance()->setImage(month_,imagePath_); setThumb(QPixmap(SmallIcon("image-x-generic", KIconLoader::SizeMedium, KIconLoader::DisabledState))); } }
FindDuplicatesAlbumItem::FindDuplicatesAlbumItem(QTreeWidget* const parent, SAlbum* const album) : QTreeWidgetItem(parent), d(new Private) { d->album = album; if (d->album) { d->refImgInfo = ImageInfo(d->album->title().toLongLong()); setText(0, d->refImgInfo.name()); SearchXmlReader reader(d->album->query()); reader.readToFirstField(); QList<int> list; list << reader.valueToIntList(); setText(1, QString::number(list.count())); } setThumb(SmallIcon("image-x-generic", parent->iconSize().width(), KIconLoader::DisabledState), false); }
void CalMonthWidget::mouseReleaseEvent(QMouseEvent* e) { if (!contentsRect().contains(e->pos())) { return; } if (e->button() == Qt::LeftButton) { ImageDialog dlg(this, QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::PicturesLocation)), true); setImage(dlg.url()); } else if (e->button() == Qt::RightButton) { d->imagePath = QUrl(); CalSettings::instance()->setImage(d->month, d->imagePath); setThumb(QPixmap(QIcon::fromTheme(QLatin1String("view-preview")).pixmap(32, QIcon::Disabled))); } }
void Card::setAll(const char* allch) { String all = allch; int indexof = all.find(","); if (indexof > -1) { setQuantity(all.substr(0,indexof++).c_str()); all=all.substr(indexof); indexof = all.find(","); setText(all.substr(0,indexof++).c_str()); all=all.substr(indexof); indexof = all.find(","); setThumb(all.substr(0,indexof++).c_str()); all=all.substr(indexof); indexof = all.find(","); setFront(all.substr(0,indexof++).c_str()); all=all.substr(indexof); indexof = all.find(","); setBack(all.substr(0,indexof++).c_str()); all=all.substr(indexof); indexof = all.find(","); setId(all.substr(0,indexof++).c_str()); all=all.substr(indexof); indexof = all.find(","); setRate(all.substr(0,indexof++).c_str()); all=all.substr(indexof); indexof = all.find(","); setValue(all.substr(0,indexof++).c_str()); all=all.substr(indexof); indexof = all.find(","); setNote(all.substr(0,indexof++).c_str()); all=all.substr(indexof); indexof = all.find(","); setOrientation(all.substr(0,indexof++).c_str()); all=all.substr(indexof); Stat *newStat; while (all.length() > 1) { indexof = all.find("$"); newStat = new Stat(); newStat->setAll(all.substr(0,indexof++).c_str()); stats.add(newStat); all=all.substr(indexof); } setLoaded(true); if ((getText().length() <= 0)||(getQuantity().length() <= 0)) { setQuantity(""); setText(""); setLoaded(false); } } else { setQuantity(""); setText(""); setThumb(""); setFront(""); setBack(""); setId(""); setRate(""); setValue(""); setNote(""); setOrientation(""); setLoaded(false); } }