コード例 #1
0
ファイル: mainwindow.cpp プロジェクト: KroshkinaAlena/MCT
MainWindow::MainWindow(QWidget *parent) :  QMainWindow(parent), ui(new Ui::MainWindow)
{
    ui->setupUi(this);


    // Стиль списка
    ui->listWidget->setStyleSheet("color: black;"
                                  "background-color: grey;"
                                  "selection-color: grey;"
                                  "selection-background-color: grey;"
                                  "border-style: outset;"
                                  "background-image: url(ferrow2.jpg);"
                                  "background-attachment: fixed;"
                                  );
    //Стиль прокрутки
    ui->ViewFild->setStyleSheet("background-image: url(ferrow2.jpg);"
                                "background-attachment: fixed;");

    ui->label_3->setStyleSheet("background-color: WhiteSmoke;");
    ui->textBrowser->setStyleSheet("background-color: WhiteSmoke;");
    ui->label->setStyleSheet("background-color: WhiteSmoke;");
    ui->horizontalSlider->setStyleSheet("background-color: WhiteSmoke;");





    //Table
    /*QPalette pal;
    pal.setBrush(ui->PreviewFild->backgroundRole(), QBrush(QPixmap ("paper1.jpg").scaled(ui->PreviewFild->width(),ui->PreviewFild->height(),Qt::IgnoreAspectRatio)));
    ui->PreviewFild->setPalette(pal);
    ui->PreviewFild->setAutoFillBackground(true);
    */
    /*QPixmap myPixmap2( "cat.gif" );
    ScaledPixmap *label2 = new ScaledPixmap[50];

    for(int i = 0; i < 50; i++){
        label2[i].setScaledPixmap(myPixmap2);
    }
    int k = 0;
    for(int i = 0; i < 7; i++)
         for(int j = 0; j < 7; j++)
             ui->gridLayout->addWidget(&label2[k++], i, j);
             */


    Sql();
    connect(ui->horizontalSlider, SIGNAL(valueChanged(int)),ui->label, SLOT(setNum(int)));
    connect(ui->SubjectsList, SIGNAL(currentIndexChanged (QString)), this, SLOT(setPhotos(QString)));
    connect(ui->listWidget, SIGNAL(itemClicked(QListWidgetItem*)),this,SLOT(ViewPhoto(QListWidgetItem*)));


 }
コード例 #2
0
ファイル: SqlPreparedStatement.cpp プロジェクト: fjz13/Medusa
bool SqlPreparedStatement::Prepare()
{
	auto sql = Sql();
	mSTMT = mysql_stmt_init(Sql());
	if (mSTMT == nullptr)
	{
		throw SqlException(sql, "Error in SqlPreparedStatement::mysql_stmt_init");
	}

	if (mysql_stmt_prepare(mSTMT, mStatement.c_str(), (ulong)mStatement.Length()) != 0)
	{
		SqlException e(mSTMT, "Error in SqlPreparedStatement::mysql_stmt_prepare");
		mysql_stmt_free_result(mSTMT);
		mysql_stmt_close(mSTMT);
		throw e;
	}

	mParamterCount = mysql_stmt_param_count(mSTMT);
	mResultCount = mysql_stmt_field_count(mSTMT);
	if (mResultCount!=0)
	{
		if ((mResultMetadata = mysql_stmt_result_metadata(mSTMT)) == NULL)
		{
			throw SqlException(mSTMT, "Error in SqlPreparedStatement::mysql_stmt_result_metadata");
		}

		MYSQL_FIELD* field = nullptr;
		while ((field = mysql_fetch_field(mResultMetadata)) != nullptr)
		{
			mResultFields.Add(field);
		}
	}

	
	
	return true;
}