You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.4 KiB

  1. #include "mainwindow.h"
  2. #include "ui_mainwindow.h"
  3. MainWindow::MainWindow(QWidget *parent) :
  4. QMainWindow(parent),
  5. ui(new Ui::MainWindow)
  6. {
  7. ui->setupUi(this);
  8. this->setWindowTitle("DeltaPro XML Generator");
  9. this->setFixedSize(500,260);
  10. this->setGeometry(QStyle::alignedRect(
  11. Qt::LeftToRight,
  12. Qt::AlignCenter,
  13. this->size(),
  14. qApp->desktop()->availableGeometry()
  15. ));
  16. // if (QCoreApplication::arguments().length() >=2) {
  17. // QString argvstr = QCoreApplication::arguments().at(1);
  18. // filename = argvstr.section("/",-1,-1);
  19. // ui->FileLabel->setText(filename);
  20. // doEncrypt(QString(filename));
  21. // }
  22. }
  23. MainWindow::~MainWindow()
  24. {
  25. delete ui;
  26. }
  27. void MainWindow::on_BtnExit_clicked()
  28. {
  29. QApplication::quit();
  30. }
  31. void MainWindow::on_actionExit_triggered()
  32. {
  33. QApplication::quit();
  34. }
  35. void MainWindow::on_BtnBrowse_clicked()
  36. {
  37. QString filepath = QFileDialog::getOpenFileName(this, "Open a file for encryption", QString(), "*");
  38. filename = filepath.section("/",-1,-1);
  39. ui->FileLabel->setText(filename);
  40. }
  41. void MainWindow::on_actionAbout_triggered()
  42. {
  43. About *AboutWindow = new About(this);
  44. AboutWindow->show();
  45. }
  46. int MainWindow::ReadExcel() {
  47. using namespace libxl;
  48. Book* book = xlCreateBook();
  49. return 1;
  50. }