mainwindow.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. #ifndef MAINWINDOW_H
  2. #define MAINWINDOW_H
  3. #include "QtGui/qstandarditemmodel.h"
  4. #include "QtWidgets/qlistview.h"
  5. #include "QtWidgets/qlistwidget.h"
  6. #include "dialog.h"
  7. #include <QMainWindow>
  8. #include <QDir>
  9. #include <QFile>
  10. #include <QTextStream>
  11. #include <QFile>
  12. #include <QJsonDocument>
  13. #include <QJsonObject>
  14. #include <QJsonArray>
  15. #include <QDebug>
  16. #include"../sample_button_slide/CustomButton.h"
  17. #include"../test_drag/mylistwidget.h"
  18. #include "tool.h"
  19. QT_BEGIN_NAMESPACE
  20. namespace Ui { class MainWindow; }
  21. QT_END_NAMESPACE
  22. class MainWindow : public QMainWindow
  23. {
  24. Q_OBJECT
  25. public:
  26. MainWindow(QWidget *parent = nullptr);
  27. ~MainWindow();
  28. protected:
  29. private:
  30. Ui::MainWindow *ui;
  31. Dialog *dialog;
  32. QJsonArray QJA;//保存了左侧树的结构 QJA QJsonArray([{"children":[{"name":"version1"},{"name":"version2"},{"name":"version3"}],"name":"tes1"},{"children":[],"name":"tet2"}])
  33. QJsonArray RQJA;//保存右侧的分组的结构
  34. QListWidget* qlw;
  35. QJsonObject QJO;
  36. CustomButton* customB2;
  37. CustomButton* customB3;
  38. CustomButton* customB4;
  39. Dialog _sender;
  40. MyListWidget* my1;
  41. MyListWidget* my2;
  42. MyListWidget* my3;
  43. MyListWidget* my4;
  44. QString config_json_path;
  45. QString treeview_path;
  46. QString root_pro_path;
  47. void add_slide();
  48. void readFile(const QString& filePath);
  49. QJsonObject readJsonFile(const QString& filePath);
  50. void initTreeView(QStandardItem* parentItem,const QJsonArray& jsonArray);
  51. void initComboBox(QStringList jsonPath);
  52. void initRight(QString parentNode,QString childNode);
  53. void initRightListwidget(QListWidget* qv,const QJsonArray& qja);
  54. void updateConfig(QListWidget* qw);
  55. void writeBackToConfigJson();
  56. void clearRight();
  57. private slots:
  58. void on_pushButton_clicked();
  59. void on_pushButton_2_clicked();
  60. void on_pushButton_4_clicked();
  61. void slotTreeMenu(const QPoint &pos);
  62. void slotTreeMenuDelete();
  63. void on_treeView_clicked(const QModelIndex &index);
  64. void on_listWidget_customContextMenuRequested(const QPoint &pos);
  65. void deleteSeedSlot();
  66. void on_listWidget_2_customContextMenuRequested(const QPoint &pos);
  67. void on_listWidget_3_customContextMenuRequested(const QPoint &pos);
  68. void on_listWidget_4_customContextMenuRequested(const QPoint &pos);
  69. void onWidgetClicked();
  70. void on_comboBox_currentTextChanged(const QString &arg1);
  71. void handleOperationCompleted(QString fromfilePath);
  72. void onDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles);
  73. void on_pushButton_5_clicked();
  74. void on_comboBox_customContextMenuRequested(const QPoint &pos);
  75. void on_pushButton_9_clicked();
  76. void handleSignal();
  77. };
  78. #endif // MAINWINDOW_H