AudioSettings::AudioSettings(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::AudioSettings)
{
    ui->setupUi(this);

    // apply and cancel buttons
    connect(ui->bnOK, SIGNAL(clicked()), this, SLOT(onOKButtonClicked()));
    connect(ui->bnSave, SIGNAL(clicked()), this, SLOT(saveSettings()));
    connect(ui->bnCancel, SIGNAL(clicked()), this, SLOT(close()));

    fillParams();
    loadSettings();

}
void KisPerspectiveTransformWorker::init(const QTransform &transform)
{
    m_isIdentity = transform.isIdentity();

    m_forwardTransform = transform;
    m_backwardTransform = transform.inverted();

    if (m_dev) {
        m_srcRect = m_dev->exactBounds();

        QPolygonF dstClipPolygonUnused;

        fillParams(m_srcRect,
                   m_dev->defaultBounds()->bounds(),
                   &m_dstRegion,
                   &dstClipPolygonUnused);
    }
}
Exemple #3
0
	// Assumes that this constructor is only called once 
	// or that it is totally cleaned up between calls.
CMesh::CMesh(parameterMap* pM) {
	pMap = pM;
	fillParams();
	
	CCell* dummyCell = new CCell(pMap);
	
	if (mInitNS != 0.0 && mInitNSTxxP != 0.0) {
		std::cout << "\nCMesh::CMesh(parameterMap* pM)....\nConflicting instructions for shear tensor initialization...\n";
		std::cout << "Use either HYDRO_INIT_NS or HYDRO_INIT_NS_TXXP but not both!\n  Aborting.\n\n";
		fflush(stdout);
		exit(1);
	}
	
#ifdef HYDRO_BOOST_THREADS
	for (int i=0;i<NTHREADS;i++){
		eosVector[i] = new CEos();
		helperVector[i] = new CCellHelper();
	}
#endif
	
	wnNormalize();
	
	localE4 = new double***[2];
	for (int i1=0; i1 < 2; i1++) {
		localE4[i1] = new double**[2];
		for (int i2=0; i2 < 2; i2++) {
			localE4[i1][i2] = new double*[2];
			for (int i3=0; i3 < 2; i3++) {
				localE4[i1][i2][i3] = new double[2];
			}
		}
	}
	
	localE3 = new double**[2];
	for (int i1=0; i1 < 2; i1++) {
		localE3[i1] = new double*[2];
		for (int i2=0; i2 < 2; i2++) 
			localE3[i1][i2] = new double[2];
	}
	
	dxCorn = new double[4];
	
	delete dummyCell;
}
bool QueryHolder::runQuery(IDataSource::DatasourceMode mode)
{
    m_mode = mode;
    QSqlDatabase db = QSqlDatabase::database(m_connectionName);
    if (!db.isValid()) {
        setLastError(QObject::tr("Invalid connection! %1").arg(m_connectionName));
        return false;
    }

    if (!m_prepared){
        extractParams();
        if (!m_prepared) return false;
    }

    if (!m_query){
        m_query = new QSqlQuery(db);
        m_query->prepare(m_preparedSQL);
    }

    fillParams(m_query);
    m_query->exec();

    QSqlQueryModel *model = new QSqlQueryModel;
    model->setQuery(*m_query);

    while (model->canFetchMore())
        model->fetchMore();

    if (model->lastError().isValid()){
        if (m_dataSource)
           m_dataSource.clear();
        setLastError(model->lastError().text());
        delete model;
        return false;
    } else setLastError("");

    setDatasource(IDataSource::Ptr(new ModelToDataSource(model,true)));
    return true;
}