当前位置: 首页>>代码示例>>C++>>正文


C++ QTabWidget::setWindowTitle方法代码示例

本文整理汇总了C++中QTabWidget::setWindowTitle方法的典型用法代码示例。如果您正苦于以下问题:C++ QTabWidget::setWindowTitle方法的具体用法?C++ QTabWidget::setWindowTitle怎么用?C++ QTabWidget::setWindowTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QTabWidget的用法示例。


在下文中一共展示了QTabWidget::setWindowTitle方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

int main(int argc, char** argv) {
	QApplication app(argc, argv);
	QTabWidget tab;
	QStringList lst;
	tab.setWindowTitle("Tab Example");

	lst << "Windows" << "Linux" << "Android" << "MacOSX";
	foreach(QString str, lst) {
		tab.addTab(new QLabel(str, &tab), QPixmap(":/" + str + ".jpg"), str);
	}
开发者ID:glazatkina,项目名称:qt_Labs,代码行数:10,代码来源:main.cpp

示例2: main

int main(int argc,char **argv) {
	QApplication app(argc,argv);

	QLabel *label_first = new QLabel("first");
	QLabel *label_second = new QLabel("second");

	QTabWidget w;
	w.addTab(label_first,"first");
	w.addTab(label_second,"second");
	w.setWindowTitle("test for QTabWidget");
	w.show();

	return app.exec();
}
开发者ID:nightfly19,项目名称:renyang-learn,代码行数:14,代码来源:main.cpp

示例3: dynamicNormalizerGuiMain

static int dynamicNormalizerGuiMain(int argc, char* argv[])
{
	uint32_t versionMajor, versionMinor, versionPatch;
	MDynamicAudioNormalizer::getVersionInfo(versionMajor, versionMinor, versionPatch);

	//initialize application
	QApplication app(argc, argv);
	app.setWindowIcon(QIcon(":/res/chart_curve.png"));
	app.setStyle(new QPlastiqueStyle());

	//create basic tab widget
	QTabWidget window;
	window.setWindowTitle(QString("Dynamic Audio Normalizer - Log Viewer [%1]").arg(QString().sprintf("v%u.%02u-%u", versionMajor, versionMinor, versionPatch)));
	window.setMinimumSize(640, 480);
	window.show();

	//get arguments
	const QStringList args = app.arguments();
	
	//choose input file
	const QString logFileName = (args.size() < 2) ? QFileDialog::getOpenFileName(&window, "Open Log File", QString(), QString("Log File (*.log)")) : args.at(1);
	if(logFileName.isEmpty())
	{
		return EXIT_FAILURE;
	}

	//check for existence
	if(!(QFileInfo(logFileName).exists() && QFileInfo(logFileName).isFile()))
	{
		QMessageBox::critical(&window, QString().sprintf("Dynamic Audio Normalizer"), QString("Error: The specified log file could not be found!"));
		return EXIT_FAILURE;
	}

	//open the input file
	QFile logFile(logFileName);
	if(!logFile.open(QIODevice::ReadOnly | QIODevice::Text))
	{
		QMessageBox::critical(&window, QString().sprintf("Dynamic Audio Normalizer"), QString("Error: The selected log file could not opened for reading!"));
		return EXIT_FAILURE;
	}

	//wrap into text stream
	QTextStream textStream(&logFile);
	textStream.setCodec("UTF-8");

	double minValue = DBL_MAX;
	double maxValue = 0.0;
	unsigned int channels = 0;

	//parse header
	if(!parseHeader(textStream, channels))
	{
		QMessageBox::critical(&window, QString("Dynamic Audio Normalizer"), QString("Error: Failed to parse the header of the log file!\nProbably the file is of an unsupported type."));
		return EXIT_FAILURE;
	}

	//allocate buffers
	LogFileData *data = new LogFileData[channels];
	QCustomPlot *plot = new QCustomPlot[channels];

	//load data
	parseData(textStream, channels, data, minValue, maxValue);
	logFile.close();

	//check data
	if((data[0].original.size() < 1) || (data[0].minimal.size() < 1) || (data[0].smoothed.size() < 1))
	{
		QMessageBox::critical(&window, QString("Dynamic Audio Normalizer"), QString("Error: Failed to load data. Log file countains no valid data!"));
		delete [] data;
		delete [] plot;
		return EXIT_FAILURE;
	}

	//determine length of data
	unsigned int length = UINT_MAX;
	for(unsigned int c = 0; c < channels; c++)
	{
		length = qMin(length, (unsigned int) data[c].original.count());
		length = qMin(length, (unsigned int) data[c].minimal .count());
		length = qMin(length, (unsigned int) data[c].smoothed.count());
	}

	//create x-axis steps
	QVector<double> steps(length);
	for(unsigned int i = 0; i < length; i++)
	{
		steps[i] = double(i);
	}

	//now create the plots
	for(unsigned int c = 0; c < channels; c++)
	{
		//init the legend
		plot[c].legend->setVisible(true);
		plot[c].legend->setFont(QFont("Helvetica", 9));

		//create graph and assign data to it:
		createGraph(&plot[c], steps, data[c].original, Qt::blue,  Qt::SolidLine, 1);
		createGraph(&plot[c], steps, data[c].minimal,  Qt::green, Qt::SolidLine, 1);
		createGraph(&plot[c], steps, data[c].smoothed, Qt::red,   Qt::DashLine,  2);
//.........这里部分代码省略.........
开发者ID:ArthurMarz,项目名称:DynamicAudioNormalizer,代码行数:101,代码来源:Main.cpp


注:本文中的QTabWidget::setWindowTitle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。