TabEditor-Qt/mainwindow.h
2023-08-13 23:44:42 +08:00

48 lines
1.2 KiB
C++

#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QProgressDialog>
#include <QTableWidget>
#include <QDragEnterEvent>
#include <QMimeData>
#include <QShortcut>
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
void loadTextFile(const QString& fileName);
void dragEnterEvent(QDragEnterEvent *event);
void dropEvent(QDropEvent *event);
void convertTextToSqlite();
void convertSqliteToText();
void showProgressDialog(const QString& labelText, int minimum, int maximum);
void contextMenuEvent(QContextMenuEvent* event);
private slots:
void onOpenButtonClicked();
void onSaveButtonClicked();
void onSaveAsButtonClicked();
void onAddRowAboveActionTriggered();
void onAddRowBelowActionTriggered();
void onAddColAboveActionTriggered();
void onAddColBelowActionTriggered();
private:
Ui::MainWindow *ui;
QProgressDialog* progressDialog;
QString openFilePath;
QMenu* firstColMenu; // 右键菜单
QMenu* firstRowMenu; // 右键菜单
};
#endif // MAINWINDOW_H