本文整理汇总了C++中ApplicationWindow类的典型用法代码示例。如果您正苦于以下问题:C++ ApplicationWindow类的具体用法?C++ ApplicationWindow怎么用?C++ ApplicationWindow使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ApplicationWindow类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: gsl_fft_complex_wavetable_alloc
void FFT::fftTable()
{
double *amp = (double *)malloc(d_n*sizeof(double));
gsl_fft_complex_wavetable *wavetable = gsl_fft_complex_wavetable_alloc (d_n);
gsl_fft_complex_workspace *workspace = gsl_fft_complex_workspace_alloc (d_n);
if(!amp || !wavetable || !workspace){
memoryErrorMessage();
return;
}
double df = 1.0/(double)(d_n*d_sampling);//frequency sampling
double aMax = 0.0;//max amplitude
if(d_inverse)
gsl_fft_complex_inverse (d_y, 1, d_n, wavetable, workspace);
else
gsl_fft_complex_forward (d_y, 1, d_n, wavetable, workspace);
gsl_fft_complex_wavetable_free (wavetable);
gsl_fft_complex_workspace_free (workspace);
if (d_shift_order) {
int n2 = d_n/2;
for(int i = 0; i < d_n; i++) {
d_x[i] = (i - n2)*df;
int j = i + d_n;
double aux = d_y[i];
d_y[i] = d_y[j];
d_y[j] = aux;
}
} else {
for(int i = 0; i < d_n; i++)
d_x[i] = i*df;
}
for(int i = 0; i < d_n; i++) {
int i2 = 2*i;
double a = sqrt(d_y[i2]*d_y[i2] + d_y[i2+1]*d_y[i2+1]);
amp[i]= a;
if (a > aMax)
aMax = a;
}
ApplicationWindow *app = (ApplicationWindow *)parent();
QLocale locale = app->locale();
int prec = app->d_decimal_digits;
for (int i = 0; i < d_n; i++) {
int i2 = 2*i;
d_result_table->setText(i, 0, locale.toString(d_x[i], 'g', prec));
d_result_table->setText(i, 1, locale.toString(d_y[i2], 'g', prec));
d_result_table->setText(i, 2, locale.toString(d_y[i2 + 1], 'g', prec));
if (d_normalize)
d_result_table->setText(i, 3, locale.toString(amp[i]/aMax, 'g', prec));
else
d_result_table->setText(i, 3, locale.toString(amp[i], 'g', prec));
d_result_table->setText(i, 4, locale.toString(atan(d_y[i2 + 1]/d_y[i2]), 'g', prec));
}
free(amp);
}
示例2: main
int main( int argc, char ** argv ) {
QApplication a( argc, argv );
ApplicationWindow *mw = new ApplicationWindow();
mw->setCaption( "Qt Example - Application" );
mw->show();
a.connect( &a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()) );
return a.exec();
}
示例3: main
int main( int argc, char ** argv ) {
QApplication window( argc, argv );
ApplicationWindow *mw = new ApplicationWindow();
mw->show();
window.connect( &window, SIGNAL(lastWindowClosed()), &window, SLOT(quit()) );
return window.exec();
}
示例4: parent
void ScriptingLangDialog::accept()
{
ApplicationWindow *app = (ApplicationWindow*) parent();
if (app->setScriptingLang(langList->currentText()))
close();
else
QMessageBox::critical(this, tr("QtiPlot - Scripting Error"), tr("Scripting language \"%1\" failed to initialize.").arg(langList->currentText()));
}
示例5: QListWidget
void Plot3DDialog::initAxesPage()
{
axesList2 = new QListWidget();
axesList2->addItem(tr( "X" ) );
axesList2->addItem(tr( "Y" ) );
axesList2->addItem(tr( "Z" ) );
axesList2->setFixedWidth(50);
axesList2->setCurrentRow(0);
QGridLayout *gl1 = new QGridLayout();
gl1->addWidget(new QLabel(tr("Title")), 0, 0);
boxLabel = new QTextEdit();
boxLabel->setMaximumHeight(60);
gl1->addWidget(boxLabel, 0, 1);
gl1->addWidget(new QLabel(tr("Axis Font")), 1, 0);
QHBoxLayout* hb1 = new QHBoxLayout();
btnLabelFont = new QPushButton(tr( "&Font" ));
btnLabelFont->setIcon(QIcon(":/font.png"));
hb1->addWidget(btnLabelFont);
axisTitleFormatButtons = new TextFormatButtons(boxLabel);
hb1->addWidget(axisTitleFormatButtons);
hb1->addStretch();
gl1->addLayout(hb1, 1, 1);
ApplicationWindow *app = (ApplicationWindow *)parent();
gl1->addWidget(new QLabel(tr("Major Ticks Length")), 2, 0);
boxMajorLength = new DoubleSpinBox();
boxMajorLength->setLocale(app->locale());
boxMajorLength->setDecimals(app->d_decimal_digits);
boxMajorLength->setMinimum(0.0);
gl1->addWidget(boxMajorLength, 2, 1);
gl1->addWidget(new QLabel(tr("Minor Ticks Length")), 3, 0);
boxMinorLength = new DoubleSpinBox();
boxMinorLength->setLocale(app->locale());
boxMinorLength->setDecimals(app->d_decimal_digits);
boxMinorLength->setMinimum(0.0);
gl1->addWidget(boxMinorLength, 3, 1);
gl1->setRowStretch(4, 1);
QGroupBox *gb1 = new QGroupBox();
gb1->setLayout(gl1);
QHBoxLayout* hb2 = new QHBoxLayout();
hb2->addWidget(axesList2);
hb2->addWidget(gb1);
axes = new QWidget();
axes->setLayout(hb2);
generalDialog->insertTab(axes, tr( "&Axis" ) );
connect( btnLabelFont, SIGNAL(clicked()), this, SLOT(pickAxisLabelFont()));
}
示例6: setDefaultValues
void LineDialog::setDefaultValues()
{
ApplicationWindow *app = (ApplicationWindow *)this->parent();
if (!app)
return;
app->setArrowDefaultSettings(widthBox->value(), colorBox->color(), styleBox->style(),
boxHeadLength->value(), boxHeadAngle->value(), filledBox->isChecked());
}
示例7: if
void Differentiation::output()
{
double *result = new double[d_n - 1];
for (int i = 1; i < d_n - 1; i++){
double xl = d_x[i - 1];
double xc = d_x[i];
double xr = d_x[i + 1];
if (xr != xc && xl != xc)
result[i] = 0.5*((d_y[i + 1] - d_y[i])/(xr - xc) + (d_y[i] - d_y[i - 1])/(xc - xl));
else if (xr != xc)
result[i] = (d_y[i + 1] - d_y[i])/(xr - xc);
else if (xl != xc)
result[i] = (d_y[i] - d_y[i - 1])/(xc - xl);
else
result[i] = result[i - 1];
}
ApplicationWindow *app = (ApplicationWindow *)parent();
QLocale locale = app->locale();
QString tableName = app->generateUniqueName(QString(objectName()));
QString dataSet;
if (d_curve)
dataSet = d_curve->title().text();
else
dataSet = d_y_col_name;
int prec = app->d_decimal_digits;
int rows = d_n - 2;
int col = 1;
if (!d_result_table || d_result_table->numRows() < rows){
d_result_table = app->newHiddenTable(tableName, tr("Derivative") + " " + tr("of", "Derivative of") + " " + dataSet, rows, 2);
for (int i = 1; i < d_n-1; i++) {
int aux = i - 1;
d_result_table->setText(aux, 0, locale.toString(d_x[i], 'g', prec));
d_result_table->setText(aux, 1, locale.toString(result[i], 'g', prec));
}
} else {
col = d_result_table->numCols();
d_result_table->addCol();
for (int i = 1; i < d_n-1; i++)
d_result_table->setText(i - 1, col, locale.toString(result[i], 'g', prec));
}
delete[] result;
if (d_graphics_display){
if (!d_output_graph){
createOutputGraph();
d_output_graph->removeLegend();
}
d_output_graph->insertCurve(d_result_table, d_result_table->colLabel(col), 0);
if (d_update_output_graph)
d_output_graph->updatePlot();
}
}
示例8: setDefaultValues
void TextDialog::setDefaultValues()
{
ApplicationWindow *app = (ApplicationWindow *)this->parent();
if (!app)
return;
app->setLegendDefaultSettings(backgroundBox->currentItem(), f,
colorBox->color(), backgroundBtn->color());
}
示例9: showFunctionDialog
void CurvesDialog::showFunctionDialog()
{
ApplicationWindow *app = (ApplicationWindow *)this->parent();
int currentRow = contents->currentRow();
close();
if (app)
app->showFunctionDialog(d_graph, currentRow);
}
示例10: initPreview
void ImportASCIIDialog::initPreview(int previewMode)
{
if (previewMode < NewTables || previewMode > Overwrite)
return;
ApplicationWindow *app = (ApplicationWindow *)parent();
if (!app)
return;
if (d_preview_table){
delete d_preview_table;
d_preview_table = NULL;
}
if (d_preview_matrix){
delete d_preview_matrix;
d_preview_matrix = NULL;
}
switch(previewMode){
case NewTables:
d_preview_table = new PreviewTable(30, 2, this);
d_preview_table->setNumericPrecision(app->d_decimal_digits);
d_preview_stack->addWidget(d_preview_table);
connect(d_preview_table, SIGNAL(modifiedColumnType()), this, SLOT(preview()));
enableTableOptions(true);
break;
case NewMatrices:
d_preview_matrix = new PreviewMatrix(app);
d_preview_stack->addWidget(d_preview_matrix);
enableTableOptions(false);
break;
case NewColumns:
case NewRows:
case Overwrite:
MdiSubWindow *w = app->activeWindow();
if (!w)
return;
if (w->inherits("Table")){
d_preview_table = new PreviewTable(30, ((Table*)w)->numCols(), this);
d_preview_table->setNumericPrecision(app->d_decimal_digits);
d_preview_stack->addWidget(d_preview_table);
connect(d_preview_table, SIGNAL(modifiedColumnType()), this, SLOT(preview()));
enableTableOptions(true);
} else if (w->isA("Matrix")){
d_preview_matrix = new PreviewMatrix(app, (Matrix *)w);
d_preview_stack->addWidget(d_preview_matrix);
enableTableOptions(false);
}
break;
}
preview();
}
示例11: main
int main( int argc, char ** argv ) {
QApplication a( argc, argv );
ApplicationWindow * mw = new ApplicationWindow();
a.setMainWidget(mw);
mw->setCaption( "Qt Example - Multiple Documents Interface (MDI)" );
mw->show();
a.connect( &a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()) );
int res = a.exec();
return res;
}
示例12: logic_error
MultiLayer * Filter::createOutputGraph()
{
ApplicationWindow *app = dynamic_cast<ApplicationWindow *>(this->parent());
if (!app) {
throw std::logic_error("Parent of Filter is not ApplicationWindow as expected.");
}
MultiLayer *ml = app->newGraph(objectName() + tr("Plot"));
d_output_graph = ml->activeGraph();
return ml;
}
示例13: setDefaultValues
void LineDialog::setDefaultValues()
{
ApplicationWindow *app = dynamic_cast<ApplicationWindow *>(this->parent());
if (!app)
return;
app->setArrowDefaultSettings(widthBox->value(), colorBox->color(),
Graph::getPenStyle(styleBox->currentItem()),
boxHeadLength->value(), boxHeadAngle->value(), filledBox->isChecked());
}
示例14: VERIFYNR
void OptionsFileLocations::applyChanges(CustomTreeWidget* pTree)
{
VERIFYNR(pTree != NULL);
Service<ConfigurationSettings> pSettings;
QTreeWidgetItemIterator iter(pTree);
while (*iter != NULL)
{
QTreeWidgetItem* pItem = *iter;
if (pItem != NULL)
{
string type = pItem->text(0).toStdString();
string confSettingsKey;
string confSettingsArgumentKey;
for (vector<FileLocationDescriptor>::iterator iter2 = mFileLocations.begin();
iter2 != mFileLocations.end();
++iter2)
{
if (iter2->getText() == type)
{
confSettingsKey = iter2->getKey();
confSettingsArgumentKey = iter2->getArgumentKey();
break;
}
}
if (!confSettingsKey.empty())
{
QString strLocation = pItem->text(1);
strLocation.replace(QRegExp("\\\\"), "/");
FactoryResource<Filename> pFilename;
string location = strLocation.toStdString();
pFilename->setFullPathAndName(location);
pSettings->setSetting(confSettingsKey, *(pFilename.get()));
if (type == "Message Log Path")
{
MessageLogMgrImp::instance()->setPath(location);
}
else if (type == "Wizard Path")
{
Service<DesktopServices> pDesktop;
ApplicationWindow* pAppWindow = static_cast<ApplicationWindow*>(pDesktop->getMainWidget());
if ((location != mWizardPath) && (pAppWindow != NULL))
{
pAppWindow->updateWizardCommands();
}
}
}
if (!confSettingsArgumentKey.empty())
{
pSettings->setSetting(confSettingsArgumentKey, pItem->text(2).toStdString());
}
}
++iter;
}
}
示例15: clearList
void SurfaceDialog::clearList() {
ApplicationWindow *app = static_cast<ApplicationWindow *>(this->parent());
if (app && boxType->currentIndex()) {
app->d_param_surface_func.clear();
} else {
boxFunction->clear();
if (app)
app->clearSurfaceFunctionsList();
}
}