本文整理汇总了C++中QTabWidget::showMaximized方法的典型用法代码示例。如果您正苦于以下问题:C++ QTabWidget::showMaximized方法的具体用法?C++ QTabWidget::showMaximized怎么用?C++ QTabWidget::showMaximized使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QTabWidget
的用法示例。
在下文中一共展示了QTabWidget::showMaximized方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
if (!createConnection())
return 1;
QSqlQueryModel plainModel;
EditableSqlModel editableModel;
CustomSqlModel customModel;
initializeModel(&plainModel);
initializeModel(&editableModel);
initializeModel(&customModel);
#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
QTabWidget *tabWidget = new QTabWidget;
tabWidget->addTab(createView(&plainModel), QObject::tr("Plain"));
tabWidget->addTab(createView(&editableModel), QObject::tr("Editable"));
tabWidget->addTab(createView(&customModel), QObject::tr("Custom"));
tabWidget->showMaximized();
#else
createView(&plainModel, QObject::tr("Plain Query Model"));
createView(&editableModel, QObject::tr("Editable Query Model"));
createView(&customModel, QObject::tr("Custom Query Model"));
#endif
return app.exec();
}
示例2: main
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
if (!createConnection())
return 1;
QSqlTableModel model;
initializeModel(&model);
#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
QTabWidget *tabWidget = new QTabWidget;
tabWidget->addTab(createView(&model), "View 1");
tabWidget->addTab(createView(&model), "View 2");
tabWidget->showMaximized();
#else
QTableView *view1 = createView(&model, QObject::tr("Table Model (View 1)"));
QTableView *view2 = createView(&model, QObject::tr("Table Model (View 2)"));
view1->show();
view2->move(view1->x() + view1->width() + 20, view1->y());
view2->show();
#endif
return app.exec();
}
示例3: main
int main( int argc, char **argv )
{
QApplication a( argc, argv );
QTabWidget tab;
Scribble scribble(&tab, "scribble");
TabletStats tabStats( &tab, "tablet stats" );
scribble.setMinimumSize( 500, 350 );
tabStats.setMinimumSize( 500, 350 );
tab.addTab(&scribble, "Scribble" );
tab.addTab(&tabStats, "Tablet Stats" );
a.setMainWidget( &tab );
if ( QApplication::desktop()->width() > 550
&& QApplication::desktop()->height() > 366 )
tab.show();
else
tab.showMaximized();
return a.exec();
}
示例4: dynamicNormalizerGuiMain
//.........这里部分代码省略.........
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);
//set plot names
plot[c].graph(0)->setName("Local Max. Gain");
plot[c].graph(1)->setName("Minimum Filtered");
plot[c].graph(2)->setName("Final Smoothed");
//set axes labels:
plot[c].xAxis->setLabel("Frame #");
plot[c].yAxis->setLabel("Gain Factor");
makeAxisBold(plot[c].xAxis);
makeAxisBold(plot[c].yAxis);
//set axes ranges
plot[c].xAxis->setRange(0.0, length);
plot[c].yAxis->setRange(minValue - 0.25, maxValue + 0.25);
plot[c].yAxis->setScaleType(QCPAxis::stLinear);
plot[c].yAxis->setTickStep(1.0);
plot[c].yAxis->setAutoTickStep(false);
//add title
plot[c].plotLayout()->insertRow(0);
plot[c].plotLayout()->addElement(0, 0, new QCPPlotTitle(&plot[c], QString("%1 (Channel %2/%3)").arg(QFileInfo(logFile).fileName(), QString::number(c+1), QString::number(channels))));
//show the plot
plot[c].replot();
window.addTab(&plot[c], QString().sprintf("Channel #%u", c + 1));
}
//run application
window.showMaximized();
app.exec();
//clean up
delete [] data;
delete [] plot;
return EXIT_SUCCESS;
}