PaymentView::PaymentView(QWidget *parent) : QWidget(parent), ui(new Ui::PaymentView) { ui->setupUi(this); setWindowTitle(QString::fromUtf8("Платежи")); ui->table->setContextMenuPolicy(Qt::CustomContextMenu); EntityTable::setup(ui->table); ui->table->setSelectionMode(QAbstractItemView::SingleSelection); setStyleSheet("QTableView::item {margin-right: 20; margin-left: 20;}"); model = new PaymentModel(this); ui->table->setModel(model); QDate current = QDate::currentDate(); ui->dateTill->blockSignals(true); ui->dateTill->setDate(current); ui->dateFrom->setDate(current.addMonths(-1)); ui->dateTill->blockSignals(false); accountModel = ModelManager::getInstance()->getAccountModel(); connect(accountModel, SIGNAL(modelReset()), this, SLOT(cacheChanged())); cacheChanged(); appendMenu(); }
void ImageBase::setCache(bool cache) { if (cache != this->cache()) { Q_D(ImageBase); d->cache = cache; emit cacheChanged(); } }
void TelegramImageElement::initImage() { if(p->image) return; QQmlEngine *engine = qmlEngine(this); QQmlContext *context = qmlContext(this); if(!engine || !context) return; QQmlComponent component(engine); QString qmlImageCreationCode = p->qmlImageCreationCode; if(qmlImageCreationCode.isEmpty()) qmlImageCreationCode = QString("import QtQuick %1\n" "Image { anchors.fill: parent; }").arg(p->qtQuickVersion); component.setData(qmlImageCreationCode.toUtf8(), QUrl()); QQuickItem *item = qobject_cast<QQuickItem *>(component.create(context)); if(!item) return; item->setParent(this); item->setParentItem(this); QHashIterator<QString, QVariant> i(p->properties); while(i.hasNext()) { i.next(); item->setProperty(i.key().toUtf8(), i.value()); } connect(item, SIGNAL(asynchronousChanged()), this, SIGNAL(asynchronousChanged())); #if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0) connect(item, SIGNAL(autoTransformChanged()), this, SIGNAL(autoTransformChanged())); #endif connect(item, SIGNAL(cacheChanged()), this, SIGNAL(cacheChanged())); connect(item, SIGNAL(fillModeChanged()), this, SIGNAL(fillModeChanged())); connect(item, SIGNAL(mirrorChanged()), this, SIGNAL(mirrorChanged())); connect(item, SIGNAL(sourceSizeChanged()), this, SIGNAL(sourceSizeChanged())); p->image = item; }
void QQuickImageBase::setCache(bool cache) { Q_D(QQuickImageBase); if (d->cache == cache) return; d->cache = cache; emit cacheChanged(); if (isComponentComplete()) load(); }
// Actually perform the switch between old and new caches void Processor::_switchCaches() { if( _newCache == NULL ) return; delete _cache; _cache = _newCache; _newCache = NULL; // Let the view know that the model has changed emit cacheChanged(); }
void MyImage::setCache(bool arg) { if (m_cache != arg) { m_cache = arg; if(!m_cache){ QPixmap* temp_pixmap = pixmapCache.object(m_source.toString()); pixmapCache.remove(m_source.toString()); if(temp_pixmap!=NULL) delete temp_pixmap; } emit cacheChanged(arg); } }