其他分享
首页 > 其他分享> > 123

123

作者:互联网

1

  1 void DocM::inital()
  2 {
  3 	mp_lable_dbstatus = new QLabel(this);
  4 	mp_lable_ret = new QLabel(this);
  5 	mp_lable_statistic = new QLabel(this);
  6 	mp_btn_dbstatus = new QPushButton(this);
  7 	mp_btn_dbstatus->setEnabled(false);
  8 	QString str = QString::number(DbUtil::getInstance().getBookCount());
  9 	mp_lable_statistic->setText(QString::fromLocal8Bit("系统中图书数量:%1 册").arg(str));
 10 	mp_lable_statistic->setStyleSheet("background-color: rgb(211, 211, 211);");
 11 
 12 	QFont pret;
 13 	pret.setBold(true);
 14 	mp_lable_ret->setFont(pret);
 15 	mp_lable_ret->setStyleSheet("QLabel{color:rgb(66, 133, 245);}");
 16 	mp_lable_ret->setText(QString::fromLocal8Bit("匹配书籍:20册"));
 17 
 18 
 19 	mp_btn_dbstatus->setMaximumHeight(25);
 20 	mp_btn_dbstatus->setMaximumWidth(25);
 21 	mp_btn_dbstatus->setMask(QRegion(0, 0, 22, 22, QRegion::Ellipse));
 22 
 23 	QFont font = mp_btn_dbstatus->font();
 24 	font.setPointSize(8);
 25 	mp_btn_dbstatus->setFont(font);
 26 	mp_btn_dbstatus->setStyleSheet("background-color: rgb(0, 255, 0);");
 27 	mp_btn_dbstatus->setText(QString::fromLocal8Bit("正常"));
 28 	if (DbUtil::getInstance().check())
 29 	{
 30 		mp_btn_dbstatus->setStyleSheet("background-color: rgb(0, 255, 0);");
 31 		mp_btn_dbstatus->setText(QString::fromLocal8Bit("正常"));
 32 	}
 33 	else
 34 	{
 35 		mp_btn_dbstatus->setStyleSheet("background-color: rgb(255, 0, 0);");
 36 		mp_btn_dbstatus->setText(QString::fromLocal8Bit("断开"));
 37 	}
 38 
 39 
 40 	mp_lable_dbstatus->setText(QString::fromLocal8Bit("数据库连接:"));
 41 
 42 	ui.statusBar->addWidget(mp_lable_statistic);
 43 	ui.statusBar->addWidget(mp_lable_ret);
 44 	ui.statusBar->addPermanentWidget(mp_lable_dbstatus);
 45 	ui.statusBar->addPermanentWidget(mp_btn_dbstatus);
 46 
 47 	ui.pb_search->setStyleSheet("background-color: rgb(220, 220, 220);");
 48 
 49 	ui.tbv_show->horizontalHeader()->setHighlightSections(false);
 50 	QFont fh_header = ui.tbv_show->horizontalHeader()->font();
 51 	fh_header.setFamily("song");
 52 	fh_header.setPointSize(14);
 53 	fh_header.setBold(true);
 54 	ui.tbv_show->horizontalHeader()->setFont(fh_header);
 55 	ui.tbv_show->horizontalHeader()->setStyleSheet("QHeaderView::section{background:DimGray;color:rgb(255, 255, 255)}");
 56 	ui.tbv_show->horizontalHeader()->setSortIndicatorShown(true);
 57 	ui.tbv_show->horizontalHeader()->setSortIndicator(0, Qt::SortOrder::AscendingOrder);
 58 	ui.tbv_show->verticalHeader()->setStyleSheet("QHeaderView::section{background:white; color:black;}");
 59 	QFont fv_header = ui.tbv_show->verticalHeader()->font();
 60 	fv_header.setFamily("song");
 61 	fv_header.setPointSize(10);
 62 	ui.tbv_show->verticalHeader()->setFont(fv_header);
 63 
 64 	ui.tbv_show->hide();
 65 	ui.tbv_show->horizontalHeader()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
 66 	mp_lable_ret->hide();
 67 }
 68 
View Code

2

void DocM::inital()
{
	mp_lable_dbstatus = new QLabel(this);
	mp_lable_ret = new QLabel(this);
	mp_lable_statistic = new QLabel(this);
	mp_btn_dbstatus = new QPushButton(this);
	mp_btn_dbstatus->setEnabled(false);
	QString str = QString::number(DbUtil::getInstance().getBookCount());
	mp_lable_statistic->setText(QString::fromLocal8Bit("系统中图书数量:%1 册").arg(str));
	mp_lable_statistic->setStyleSheet("background-color: rgb(211, 211, 211);");

	QFont pret;
	pret.setBold(true);
	mp_lable_ret->setFont(pret);
	mp_lable_ret->setStyleSheet("QLabel{color:rgb(66, 133, 245);}");
	mp_lable_ret->setText(QString::fromLocal8Bit("匹配书籍:20册"));


	mp_btn_dbstatus->setMaximumHeight(25);
	mp_btn_dbstatus->setMaximumWidth(25);
	mp_btn_dbstatus->setMask(QRegion(0, 0, 22, 22, QRegion::Ellipse));

	QFont font = mp_btn_dbstatus->font();
	font.setPointSize(8);
	mp_btn_dbstatus->setFont(font);
	mp_btn_dbstatus->setStyleSheet("background-color: rgb(0, 255, 0);");
	mp_btn_dbstatus->setText(QString::fromLocal8Bit("正常"));
	if (DbUtil::getInstance().check())
	{
		mp_btn_dbstatus->setStyleSheet("background-color: rgb(0, 255, 0);");
		mp_btn_dbstatus->setText(QString::fromLocal8Bit("正常"));
	}
	else
	{
		mp_btn_dbstatus->setStyleSheet("background-color: rgb(255, 0, 0);");
		mp_btn_dbstatus->setText(QString::fromLocal8Bit("断开"));
	}


	mp_lable_dbstatus->setText(QString::fromLocal8Bit("数据库连接:"));

	ui.statusBar->addWidget(mp_lable_statistic);
	ui.statusBar->addWidget(mp_lable_ret);
	ui.statusBar->addPermanentWidget(mp_lable_dbstatus);
	ui.statusBar->addPermanentWidget(mp_btn_dbstatus);

	ui.pb_search->setStyleSheet("background-color: rgb(220, 220, 220);");

	ui.tbv_show->horizontalHeader()->setHighlightSections(false);
	QFont fh_header = ui.tbv_show->horizontalHeader()->font();
	fh_header.setFamily("song");
	fh_header.setPointSize(14);
	fh_header.setBold(true);
	ui.tbv_show->horizontalHeader()->setFont(fh_header);
	ui.tbv_show->horizontalHeader()->setStyleSheet("QHeaderView::section{background:DimGray;color:rgb(255, 255, 255)}");
	ui.tbv_show->horizontalHeader()->setSortIndicatorShown(true);
	ui.tbv_show->horizontalHeader()->setSortIndicator(0, Qt::SortOrder::AscendingOrder);
	ui.tbv_show->verticalHeader()->setStyleSheet("QHeaderView::section{background:white; color:black;}");
	QFont fv_header = ui.tbv_show->verticalHeader()->font();
	fv_header.setFamily("song");
	fv_header.setPointSize(10);
	ui.tbv_show->verticalHeader()->setFont(fv_header);

	ui.tbv_show->hide();
	ui.tbv_show->horizontalHeader()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
	mp_lable_ret->hide();
}

3

void DocM::inital()
{
	mp_lable_dbstatus = new QLabel(this);
	mp_lable_ret = new QLabel(this);
	mp_lable_statistic = new QLabel(this);
	mp_btn_dbstatus = new QPushButton(this);
	mp_btn_dbstatus->setEnabled(false);
	QString str = QString::number(DbUtil::getInstance().getBookCount());
	mp_lable_statistic->setText(QString::fromLocal8Bit("系统中图书数量:%1 册").arg(str));
	mp_lable_statistic->setStyleSheet("background-color: rgb(211, 211, 211);");

	QFont pret;
	pret.setBold(true);
	mp_lable_ret->setFont(pret);
	mp_lable_ret->setStyleSheet("QLabel{color:rgb(66, 133, 245);}");
	mp_lable_ret->setText(QString::fromLocal8Bit("匹配书籍:20册"));


	mp_btn_dbstatus->setMaximumHeight(25);
	mp_btn_dbstatus->setMaximumWidth(25);
	mp_btn_dbstatus->setMask(QRegion(0, 0, 22, 22, QRegion::Ellipse));

	QFont font = mp_btn_dbstatus->font();
	font.setPointSize(8);
	mp_btn_dbstatus->setFont(font);
	mp_btn_dbstatus->setStyleSheet("background-color: rgb(0, 255, 0);");
	mp_btn_dbstatus->setText(QString::fromLocal8Bit("正常"));
	if (DbUtil::getInstance().check())
	{
		mp_btn_dbstatus->setStyleSheet("background-color: rgb(0, 255, 0);");
		mp_btn_dbstatus->setText(QString::fromLocal8Bit("正常"));
	}
	else
	{
		mp_btn_dbstatus->setStyleSheet("background-color: rgb(255, 0, 0);");
		mp_btn_dbstatus->setText(QString::fromLocal8Bit("断开"));
	}


	mp_lable_dbstatus->setText(QString::fromLocal8Bit("数据库连接:"));

	ui.statusBar->addWidget(mp_lable_statistic);
	ui.statusBar->addWidget(mp_lable_ret);
	ui.statusBar->addPermanentWidget(mp_lable_dbstatus);
	ui.statusBar->addPermanentWidget(mp_btn_dbstatus);

	ui.pb_search->setStyleSheet("background-color: rgb(220, 220, 220);");

	ui.tbv_show->horizontalHeader()->setHighlightSections(false);
	QFont fh_header = ui.tbv_show->horizontalHeader()->font();
	fh_header.setFamily("song");
	fh_header.setPointSize(14);
	fh_header.setBold(true);
	ui.tbv_show->horizontalHeader()->setFont(fh_header);
	ui.tbv_show->horizontalHeader()->setStyleSheet("QHeaderView::section{background:DimGray;color:rgb(255, 255, 255)}");
	ui.tbv_show->horizontalHeader()->setSortIndicatorShown(true);
	ui.tbv_show->horizontalHeader()->setSortIndicator(0, Qt::SortOrder::AscendingOrder);
	ui.tbv_show->verticalHeader()->setStyleSheet("QHeaderView::section{background:white; color:black;}");
	QFont fv_header = ui.tbv_show->verticalHeader()->font();
	fv_header.setFamily("song");
	fv_header.setPointSize(10);
	ui.tbv_show->verticalHeader()->setFont(fv_header);

	ui.tbv_show->hide();
	ui.tbv_show->horizontalHeader()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
	mp_lable_ret->hide();
}

4

void DocM::inital()
{
	mp_lable_dbstatus = new QLabel(this);
	mp_lable_ret = new QLabel(this);
	mp_lable_statistic = new QLabel(this);
	mp_btn_dbstatus = new QPushButton(this);
	mp_btn_dbstatus->setEnabled(false);
	QString str = QString::number(DbUtil::getInstance().getBookCount());
	mp_lable_statistic->setText(QString::fromLocal8Bit("系统中图书数量:%1 册").arg(str));
	mp_lable_statistic->setStyleSheet("background-color: rgb(211, 211, 211);");

	QFont pret;
	pret.setBold(true);
	mp_lable_ret->setFont(pret);
	mp_lable_ret->setStyleSheet("QLabel{color:rgb(66, 133, 245);}");
	mp_lable_ret->setText(QString::fromLocal8Bit("匹配书籍:20册"));


	mp_btn_dbstatus->setMaximumHeight(25);
	mp_btn_dbstatus->setMaximumWidth(25);
	mp_btn_dbstatus->setMask(QRegion(0, 0, 22, 22, QRegion::Ellipse));

	QFont font = mp_btn_dbstatus->font();
	font.setPointSize(8);
	mp_btn_dbstatus->setFont(font);
	mp_btn_dbstatus->setStyleSheet("background-color: rgb(0, 255, 0);");
	mp_btn_dbstatus->setText(QString::fromLocal8Bit("正常"));
	if (DbUtil::getInstance().check())
	{
		mp_btn_dbstatus->setStyleSheet("background-color: rgb(0, 255, 0);");
		mp_btn_dbstatus->setText(QString::fromLocal8Bit("正常"));
	}
	else
	{
		mp_btn_dbstatus->setStyleSheet("background-color: rgb(255, 0, 0);");
		mp_btn_dbstatus->setText(QString::fromLocal8Bit("断开"));
	}


	mp_lable_dbstatus->setText(QString::fromLocal8Bit("数据库连接:"));

	ui.statusBar->addWidget(mp_lable_statistic);
	ui.statusBar->addWidget(mp_lable_ret);
	ui.statusBar->addPermanentWidget(mp_lable_dbstatus);
	ui.statusBar->addPermanentWidget(mp_btn_dbstatus);

	ui.pb_search->setStyleSheet("background-color: rgb(220, 220, 220);");

	ui.tbv_show->horizontalHeader()->setHighlightSections(false);
	QFont fh_header = ui.tbv_show->horizontalHeader()->font();
	fh_header.setFamily("song");
	fh_header.setPointSize(14);
	fh_header.setBold(true);
	ui.tbv_show->horizontalHeader()->setFont(fh_header);
	ui.tbv_show->horizontalHeader()->setStyleSheet("QHeaderView::section{background:DimGray;color:rgb(255, 255, 255)}");
	ui.tbv_show->horizontalHeader()->setSortIndicatorShown(true);
	ui.tbv_show->horizontalHeader()->setSortIndicator(0, Qt::SortOrder::AscendingOrder);
	ui.tbv_show->verticalHeader()->setStyleSheet("QHeaderView::section{background:white; color:black;}");
	QFont fv_header = ui.tbv_show->verticalHeader()->font();
	fv_header.setFamily("song");
	fv_header.setPointSize(10);
	ui.tbv_show->verticalHeader()->setFont(fv_header);

	ui.tbv_show->hide();
	ui.tbv_show->horizontalHeader()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
	mp_lable_ret->hide();
}

5

void DocM::inital()
{
	mp_lable_dbstatus = new QLabel(this);
	mp_lable_ret = new QLabel(this);
	mp_lable_statistic = new QLabel(this);
	mp_btn_dbstatus = new QPushButton(this);
	mp_btn_dbstatus->setEnabled(false);
	QString str = QString::number(DbUtil::getInstance().getBookCount());
	mp_lable_statistic->setText(QString::fromLocal8Bit("系统中图书数量:%1 册").arg(str));
	mp_lable_statistic->setStyleSheet("background-color: rgb(211, 211, 211);");

	QFont pret;
	pret.setBold(true);
	mp_lable_ret->setFont(pret);
	mp_lable_ret->setStyleSheet("QLabel{color:rgb(66, 133, 245);}");
	mp_lable_ret->setText(QString::fromLocal8Bit("匹配书籍:20册"));


	mp_btn_dbstatus->setMaximumHeight(25);
	mp_btn_dbstatus->setMaximumWidth(25);
	mp_btn_dbstatus->setMask(QRegion(0, 0, 22, 22, QRegion::Ellipse));

	QFont font = mp_btn_dbstatus->font();
	font.setPointSize(8);
	mp_btn_dbstatus->setFont(font);
	mp_btn_dbstatus->setStyleSheet("background-color: rgb(0, 255, 0);");
	mp_btn_dbstatus->setText(QString::fromLocal8Bit("正常"));
	if (DbUtil::getInstance().check())
	{
		mp_btn_dbstatus->setStyleSheet("background-color: rgb(0, 255, 0);");
		mp_btn_dbstatus->setText(QString::fromLocal8Bit("正常"));
	}
	else
	{
		mp_btn_dbstatus->setStyleSheet("background-color: rgb(255, 0, 0);");
		mp_btn_dbstatus->setText(QString::fromLocal8Bit("断开"));
	}


	mp_lable_dbstatus->setText(QString::fromLocal8Bit("数据库连接:"));

	ui.statusBar->addWidget(mp_lable_statistic);
	ui.statusBar->addWidget(mp_lable_ret);
	ui.statusBar->addPermanentWidget(mp_lable_dbstatus);
	ui.statusBar->addPermanentWidget(mp_btn_dbstatus);

	ui.pb_search->setStyleSheet("background-color: rgb(220, 220, 220);");

	ui.tbv_show->horizontalHeader()->setHighlightSections(false);
	QFont fh_header = ui.tbv_show->horizontalHeader()->font();
	fh_header.setFamily("song");
	fh_header.setPointSize(14);
	fh_header.setBold(true);
	ui.tbv_show->horizontalHeader()->setFont(fh_header);
	ui.tbv_show->horizontalHeader()->setStyleSheet("QHeaderView::section{background:DimGray;color:rgb(255, 255, 255)}");
	ui.tbv_show->horizontalHeader()->setSortIndicatorShown(true);
	ui.tbv_show->horizontalHeader()->setSortIndicator(0, Qt::SortOrder::AscendingOrder);
	ui.tbv_show->verticalHeader()->setStyleSheet("QHeaderView::section{background:white; color:black;}");
	QFont fv_header = ui.tbv_show->verticalHeader()->font();
	fv_header.setFamily("song");
	fv_header.setPointSize(10);
	ui.tbv_show->verticalHeader()->setFont(fv_header);

	ui.tbv_show->hide();
	ui.tbv_show->horizontalHeader()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
	mp_lable_ret->hide();
}

6

void DocM::inital()
{
	mp_lable_dbstatus = new QLabel(this);
	mp_lable_ret = new QLabel(this);
	mp_lable_statistic = new QLabel(this);
	mp_btn_dbstatus = new QPushButton(this);
	mp_btn_dbstatus->setEnabled(false);
	QString str = QString::number(DbUtil::getInstance().getBookCount());
	mp_lable_statistic->setText(QString::fromLocal8Bit("系统中图书数量:%1 册").arg(str));
	mp_lable_statistic->setStyleSheet("background-color: rgb(211, 211, 211);");

	QFont pret;
	pret.setBold(true);
	mp_lable_ret->setFont(pret);
	mp_lable_ret->setStyleSheet("QLabel{color:rgb(66, 133, 245);}");
	mp_lable_ret->setText(QString::fromLocal8Bit("匹配书籍:20册"));


	mp_btn_dbstatus->setMaximumHeight(25);
	mp_btn_dbstatus->setMaximumWidth(25);
	mp_btn_dbstatus->setMask(QRegion(0, 0, 22, 22, QRegion::Ellipse));

	QFont font = mp_btn_dbstatus->font();
	font.setPointSize(8);
	mp_btn_dbstatus->setFont(font);
	mp_btn_dbstatus->setStyleSheet("background-color: rgb(0, 255, 0);");
	mp_btn_dbstatus->setText(QString::fromLocal8Bit("正常"));
	if (DbUtil::getInstance().check())
	{
		mp_btn_dbstatus->setStyleSheet("background-color: rgb(0, 255, 0);");
		mp_btn_dbstatus->setText(QString::fromLocal8Bit("正常"));
	}
	else
	{
		mp_btn_dbstatus->setStyleSheet("background-color: rgb(255, 0, 0);");
		mp_btn_dbstatus->setText(QString::fromLocal8Bit("断开"));
	}


	mp_lable_dbstatus->setText(QString::fromLocal8Bit("数据库连接:"));

	ui.statusBar->addWidget(mp_lable_statistic);
	ui.statusBar->addWidget(mp_lable_ret);
	ui.statusBar->addPermanentWidget(mp_lable_dbstatus);
	ui.statusBar->addPermanentWidget(mp_btn_dbstatus);

	ui.pb_search->setStyleSheet("background-color: rgb(220, 220, 220);");

	ui.tbv_show->horizontalHeader()->setHighlightSections(false);
	QFont fh_header = ui.tbv_show->horizontalHeader()->font();
	fh_header.setFamily("song");
	fh_header.setPointSize(14);
	fh_header.setBold(true);
	ui.tbv_show->horizontalHeader()->setFont(fh_header);
	ui.tbv_show->horizontalHeader()->setStyleSheet("QHeaderView::section{background:DimGray;color:rgb(255, 255, 255)}");
	ui.tbv_show->horizontalHeader()->setSortIndicatorShown(true);
	ui.tbv_show->horizontalHeader()->setSortIndicator(0, Qt::SortOrder::AscendingOrder);
	ui.tbv_show->verticalHeader()->setStyleSheet("QHeaderView::section{background:white; color:black;}");
	QFont fv_header = ui.tbv_show->verticalHeader()->font();
	fv_header.setFamily("song");
	fv_header.setPointSize(10);
	ui.tbv_show->verticalHeader()->setFont(fv_header);

	ui.tbv_show->hide();
	ui.tbv_show->horizontalHeader()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
	mp_lable_ret->hide();
}


7

  1 private void buttonOK_Click(object sender, EventArgs e)
  2         {
  3             this._configDb.Config.Brush = this.comboBrush.Text;
  4             this._configDb.Config.MainFormX = base.Left;
  5             this._configDb.Config.MainFormY = base.Top;
  6             this._configDb.Config.MainFormWidth = base.Width;
  7             this._configDb.Config.MainFormHeight = base.Height;
  8             this._configDb.SavePluginConfigurationData();
  9             try
 10             {
 11                 this._code = this.RemoteCodeHighlight();
 12             }
 13             catch (Exception exception)
 14             {
 15                 MessageBox.Show(exception.Message, "error", MessageBoxButtons.OK, MessageBoxIcon.Error);
 16                 return;
 17             }
 18             base.DialogResult = DialogResult.OK;
 19             base.Close();
 20         }
View Code

标签:lable,dbstatus,show,123,ui,mp,btn
来源: https://www.cnblogs.com/mehome/p/15739147.html