Subversion Repositories qb

Compare Revisions

Ignore whitespace Rev 7 → Rev 8

/trunk/qbsqlator/mainwindow.cpp
37,9 → 37,11
QGroupBox *resultGroup = new QGroupBox("Result");
resultTable = new QTableView;
resultModel = new QSqlQueryModel;
QPushButton *previewButton = new QPushButton("Preview");
QPushButton *printButton = new QPushButton("Print");
QHBoxLayout *resultLayout = new QHBoxLayout;
resultLayout->addWidget(resultTable);
resultLayout->addWidget(previewButton);
resultLayout->addWidget(printButton);
resultGroup->setLayout(resultLayout);
 
56,7 → 58,8
connect(queryExecButton,SIGNAL(clicked()),this,SLOT(queryExec()));
connect(dbPrefButton, SIGNAL(clicked()),this,SLOT(settingsDB()));
connect(dbConnectButton, SIGNAL(clicked()),this,SLOT(connectDB()));
connect(printButton, SIGNAL(clicked()), this, SLOT(on_previewPushButton_clicked()));
connect(previewButton, SIGNAL(clicked()), this, SLOT(on_previewPushButton_clicked()));
connect(printButton, SIGNAL(clicked()), this, SLOT(on_printPushButton_clicked()));
statusBar()->showMessage(tr("Ready"));
}
 
105,3 → 108,10
delete dialog;
}
 
void MainWindow::on_printPushButton_clicked()
{
TDPreviewDialog *dialog = new TDPreviewDialog(resultTable,new QPrinter(QPrinter::HighResolution),this);
dialog->print();
delete dialog;
}
 
/trunk/qbsqlator/mainwindow.h
24,6 → 24,7
void settingsDB();
void connectDB();
void on_previewPushButton_clicked();
void on_printPushButton_clicked();
};
 
#endif // MAINWINDOW_H