예제 #1
0
void CounterInterface::getSearchProduct(QString text){
    if (text.length() > 0){
        QString sql = "select * from product where lower(name) like lower('" + text + "%') order by idproduct";

        order->bd.updateModelQuery("product", sql);

        sql = "select idproduct, note from product where lower(name) = lower('" + text + "')";

        if (order->bd.search(sql)){

            dataOrderIdProduct = order->bd.loadSimple(0);
            dataOrderNoteProduct = order->bd.loadSimple(1);
            dataOrderNameProduct = text;

            teProductNotes->setText(order->bd.loadSimple(1));

            sql = "select s.name, pv.valueproduct from size s, product p, productvalue pv where p.idproduct = pv.idproduct and pv.idsize = s.idsize and p.idproduct = " + order->bd.loadSimple(0);

            if (order->bd.search(sql, 1)){
                cbSize->clear();
                listSizes = order->bd.loadColumn(0, 1);
                listValues = order->bd.loadColumn(1, 1);
                cbSize->addItems(listSizes);

                float value = listValues[0].toDouble();

                dataOrderValueProduct = listValues[0].toDouble();

                productName = text;

                setPreview(productName, value, sbAmount->value());

                DSBValueProduct->setValue(value);
            }

        }else{
            listSizes.clear();
            listValues.clear();
            cbSize->clear();
            cbSize->addItem("Tamanho");
            DSBValueProduct->setValue(0.00);
            sbAmount->setValue(1);
            productName.clear();
            setPreview();
        }

    }else{
        QString sql = "select * from product order by idproduct";

        order->bd.updateModelQuery("product", sql);

        setPreview();
    }
}
예제 #2
0
void FunctionManager::dumpOnNewScene(QList<SceneValue> dumpValues, QList<quint32> selectedFixtures,
                                     quint32 channelMask, QString name)
{
    if (selectedFixtures.isEmpty() || dumpValues.isEmpty() || channelMask == 0)
        return;

    Scene *newScene = new Scene(m_doc);

    for (SceneValue sv : dumpValues)
    {
        if (selectedFixtures.contains(sv.fxi) == false)
            continue;

        quint32 chTypeBit = getChannelTypeMask(sv.fxi, sv.channel);

        if (channelMask & chTypeBit)
            newScene->setValue(sv);
    }

    if (name.isEmpty())
        newScene->setName(QString("%1 %2").arg(newScene->name()).arg(m_doc->nextFunctionID() + 1));
    else
        newScene->setName(name);

    if (m_doc->addFunction(newScene) == true)
    {
        setPreview(false);
        updateFunctionsTree();
        Tardis::instance()->enqueueAction(FunctionCreate, newScene->id(), QVariant(),
                                          Tardis::instance()->actionToByteArray(FunctionCreate, newScene->id()));
    }
    else
        delete newScene;
}
예제 #3
0
void CounterInterface::valueChanged_DSBValueProduct(double value)
{
    if (! productName.isEmpty())
        setPreview(productName, value, sbAmount->value());
    else
        DSBValueProduct->setValue(0);
}
예제 #4
0
void  RaytraceWindow::keyPressEvent(QKeyEvent *newevent) {
    if (newevent->key() == Qt::Key_Space) {
        setPreview(!preview);
        return;
    }

    else if (newevent->key() == Qt::Key_Escape) {
        exit(0);
    }
    if (preview) {
        switch (newevent->key()) {
            case Qt::Key_W:
                dv -= 0.15;
                break;
            case Qt::Key_A:
                dh += 0.15;
                break;
            case Qt::Key_D:
                dh -= 0.15;
                break;
            case Qt::Key_S:
                dv += 0.15;
                break;
            case Qt::Key_Q:
                distanse -= 10;
                break;
            case Qt::Key_E:
                distanse += 10;
                break;
            case Qt::Key_R:
                distanse = 600;
                break;
            case Qt::Key_Z:
                dh -= 0.01;
                break;
            case Qt::Key_C:
                dv += 0.01;
                break;

            default:
                break;
        }
        vertex3f newObserverPosition(
                distanse * qSin(dh) * qSin(dv),
                distanse * qCos(dh) * qSin(dv),
                distanse * qCos(dv)
        );

        scene.setObserver(newObserverPosition);
    }
    if (newevent->key() == Qt::Key_U)
        std::cout << (currentImage.save("output.png", "png", 100) ? "Image saved" : "Image not saved") << std::endl;

    update();
}
예제 #5
0
bool SeaView::updatePreview(const QPoint& pos)
{
    KGameCanvasItem* item = itemAt(pos);
    if (static_cast<KGameCanvasItem*>(m_fields[0]) == item) {
        m_fields[1]->cancelPreview();
        if (setPreview(Sea::Player(0), pos)) {
            m_last_preview = pos;
        }
        return true;
    }
    else if (static_cast<KGameCanvasItem*>(m_fields[1]) == item) {
        m_fields[0]->cancelPreview();
        if (setPreview(Sea::Player(1), pos)) {
            m_last_preview = pos;
        }
        return true;
    }
    else {
        return false;
    }
}
예제 #6
0
void CounterInterface::currentIndexChanged_cbSize(int index){
    Q_UNUSED(index);

    if (listSizes.length() > 0 && cbSize->count() > 0){
        float value = listValues[cbSize->currentIndex()].toDouble();

        DSBValueProduct->setValue(value);

        dataOrderValueProduct = value;

        setPreview(productName, value, sbAmount->value());
    }
}
예제 #7
0
KLFLibEntry::KLFLibEntry(const QString& latex, const QDateTime& dt, const QImage& preview,
			 const QSize& previewsize, const QString& category, const QString& tags,
			 const KLFStyle& style)
  : KLFPropertizedObject("KLFLibEntry")
{
  initRegisteredProperties();
  setLatex(latex);
  setDateTime(dt);
  setPreview(preview);
  setPreviewSize(previewsize);
  setCategory(category);
  setTags(tags);
  setStyle(style);
}
예제 #8
0
QIcon NewstuffModelPrivate::preview( int index )
{
    if ( m_items.at( index ).m_preview.isNull() ) {
        QPixmap dummyPixmap( 136, 136 );
        dummyPixmap.fill( Qt::transparent );
        setPreview( index, QIcon( dummyPixmap ) );
        QNetworkReply *reply = m_networkAccessManager.get( QNetworkRequest( m_items.at( index ).m_previewUrl ) );
        m_networkJobs.insert( reply, new FetchPreviewJob( this, index ) );
    }

    Q_ASSERT( !m_items.at( index ).m_preview.isNull() );

    return m_items.at( index ).m_preview;
}
예제 #9
0
int InterfacePreviewWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QLabel::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: setPreview((*reinterpret_cast< enum_style(*)>(_a[1]))); break;
        case 1: setNormalPreview((*reinterpret_cast< bool(*)>(_a[1]))); break;
        default: ;
        }
        _id -= 2;
    }
    return _id;
}
예제 #10
0
void CounterInterface::valueChanged_sbAmount(int value){
    Q_UNUSED(value);

    if (listSizes.length() > 0){
        //        float value = listValues[cbSize->currentIndex()].toDouble();

        float value = DSBValueProduct->value();

        dataOrderValueProduct = listValues[cbSize->currentIndex()].toDouble();

        dataOrderQntProduct = sbAmount->value();

        setPreview(productName, value, sbAmount->value());
    }
}
예제 #11
0
void CounterInterface::onClick_pbLeaveProduct(){
    setPreview();
    listSizes.clear();
    listValues.clear();
    sbAmount->setValue(1);
    cbSize->setCurrentIndex(0);
    teProductNotes->clear();
    searchProduct->eSearch->Clear();
    DSBValueProduct->setValue(0);

    productName.clear();

    dataOrderIdProduct.clear();

    pbLeaveProduct->setText("Limpar");
    pbConfirmProduct->setText("Confirmar");
}
예제 #12
0
KLFLibEntry::KLFLibEntry(const QString& latex, const QDateTime& dt, const QImage& preview,
			 const KLFStyle& style)
  : KLFPropertizedObject("KLFLibEntry")
{
  initRegisteredProperties();
  QString latexonly = stripCategoryTagsFromLatex(latex);
  QString category = categoryFromLatex(latex);
  QString tags = tagsFromLatex(latex);
  QSize previewsize = preview.size();
  setLatex(latexonly);
  setDateTime(dt);
  setPreview(preview);
  setPreviewSize(previewsize);
  setCategory(category);
  setTags(tags);
  setStyle(style);
}
예제 #13
0
	bool FileSharingWidget::loadPreviewFromLocalFile()
	{
		assert(isState(State::ImageFile_Initial));
		assert(QFile::exists(FsInfo_->GetLocalPath()));

		QPixmap preview;

        Utils::loadPixmap(FsInfo_->GetLocalPath(), Out preview);

		if (preview.isNull())
		{
			return false;
		}

        Preview_.FullImg_ = preview;

		setPreview(preview);

		return true;
	}
예제 #14
0
void AzubuHandler::handlePreview() {

    QNetworkReply *reply = qobject_cast<QNetworkReply*>(QObject::sender());
    QByteArray data = reply->readAll();

    // delete the reply
    reply->deleteLater();

    QJsonDocument response(QJsonDocument::fromJson(data.mid(1,data.length()-3)));
    QJsonObject streamJson = response.object();

    QJsonValue online = streamJson["Online"];

    if(!online.isNull() && !online.isUndefined() && !online.toString().compare("0")==0) {
        AzubuStream stream;
        stream.read(streamJson);
        emit setPreview(stream);
    } else {
        emit resetPreview();
    }

}
예제 #15
0
void FunctionManager::slotDocLoaded()
{
    setPreview(false);
    updateFunctionsTree();
}
예제 #16
0
void CounterInterface::input()
{
    lItens->setStyleSheet("background-color: qlineargradient(spread:pad, x1:0.498,"
                          "y1:0, x2:0.494636, y2:1, stop:0 rgba(255, 255, 255, 210),"
                          "stop:0.982955 rgba(255, 255, 255, 170));"
                          "border-radius: 5px;border: 1px solid rgba(255,255,255,255);");

    pbSaveOrdered->setObjectName("pbSaveOrdered");
    pbSaveOrdered->setStyleSheet(this->styleSheet());
    pbSaveOrdered->setText(tr("Salvar"));
    pbSaveOrdered->setFont(this->font());
    pbSaveOrdered->setCursor(Qt::PointingHandCursor);

    pbRemoveItem->setObjectName("pbRemoveItem");
    pbRemoveItem->setStyleSheet(this->styleSheet());
    pbRemoveItem->setText(tr("Remover"));
    pbRemoveItem->setFont(this->font());
    pbRemoveItem->setCursor(Qt::PointingHandCursor);

    pbClearOrdered->setObjectName("pbClearOrdered");
    pbClearOrdered->setStyleSheet(this->styleSheet());
    pbClearOrdered->setText(tr("Limpar"));
    pbClearOrdered->setFont(this->font());
    pbClearOrdered->setCursor(Qt::PointingHandCursor);

    pbCancelOrdered->setObjectName("pbCancelOrdered");
    pbCancelOrdered->setStyleSheet(this->styleSheet());
    pbCancelOrdered->setText(tr("Cancelar"));
    pbCancelOrdered->setFont(this->font());
    pbCancelOrdered->setCursor(Qt::PointingHandCursor);

    pbConfirmProduct->setObjectName("pbConfirmProduct");
    pbConfirmProduct->setStyleSheet(this->styleSheet());
    pbConfirmProduct->setFont(this->font());
    pbConfirmProduct->setText(tr("Confirmar"));
    pbConfirmProduct->setCursor(Qt::PointingHandCursor);

    pbLeaveProduct->setObjectName("pbLeaveProduct");
    pbLeaveProduct->setStyleSheet(this->styleSheet());
    pbLeaveProduct->setFont(this->font());
    pbLeaveProduct->setText(tr("Limpar"));
    pbLeaveProduct->setCursor(Qt::PointingHandCursor);

    productPreview->setStyleSheet("background-color: rgba(0,0,0,0);"
                                  "color: rgba(255,255,255,240);");

    lPizza->setImage(":/treatment/icopizza");
    lPizza->setHover(":/treatment/icopizza-hover");

    sbAmount->setPrefix(tr("Quant "));
    sbAmount->setFont(this->font());
    sbAmount->setMinimum(1);
    sbAmount->setValue(1);
    sbAmount->setMaximum(99999);

    DSBValueProduct->setPrefix(tr("R$ "));
    DSBValueProduct->setMaximum(9999999);

    lProductNotes->setPixmap(QPixmap(":/treatment/field-notes-Background"));
    lTextNotesProduct->setText(tr("Anotações"));
    lTextNotesProduct->setFont(this->font());
    lTextNotesProduct->setAlignment(Qt::AlignHCenter);
    lTextNotesProduct->setStyleSheet("color: rgba(254, 255, 180, 255);");

    teProductNotes->setStyleSheet("background-color: qlineargradient"
                                  "(spread:pad, x1:0, y1:1, x2:0.165045,"
                                  "y2:0, stop:0 rgba(254, 255, 180, 255),"
                                  "stop:0.721591 rgba(255, 250, 205, 255));"
                                  "border-radius: 5px;border: 1px solid #C0C0C0;");

    teProductNotes->setFont(this->font());

    lProduct->setPixmap(QPixmap(":/treatment/fieldBackground"));
    lProduct->setScaledContents(true);

    QFont f;

#if defined(Q_WS_X11)
    f.setPointSize(9);
#endif

#if defined(Q_WS_WIN)
    f.setPointSize(12);
#endif

    productPreview->setFont(f);
    setPreview();

    tableItem->setModel(dataModelItems);

    wPizzaMixed->setFont(this->font());
    wPizzaMixed->setStyleSheet(this->styleSheet());

    searchProduct->setCompleter(order->bd.getCompleter("product"));

    cbSize->add("Tamanhos");

    actionName->setCheckable(true);
    actionName->setChecked(true);
    actionName->setEnabled(false);

    actionNickName->setCheckable(true);
    actionNickName->setChecked(false);
    actionNickName->setEnabled(true);

    searchProduct->setAction(actionName);
    searchProduct->setAction(actionNickName);

    searchProduct->eSearch->setNextComponent(cbSize);
    cbSize->setNextComponent(DSBValueProduct);
    DSBValueProduct->setNextComponent(sbAmount);

    emit setInput();
}
예제 #17
0
void FunctionManager::clearTree()
{
    setPreview(false);
    m_previewList.clear();
    m_functionTree->clear();
}
예제 #18
0
void InterfacePreviewWidget::setNormalPreview( bool b_minimal )
{
    setPreview( ( b_minimal ) ? MINIMAL : COMPLETE );
}
예제 #19
0
파일: ksnapshot.cpp 프로젝트: Berrrry/Qtqq
void KSnapshot::updatePreview()
{
    setPreview( snapshot );
}