Yolo_Label/mainwindow.h

88 lines
2.0 KiB
C
Raw Normal View History

2018-10-29 07:26:06 +03:00
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QWheelEvent>
#include <QTableWidgetItem>
#include <QMessageBox>
#include <iostream>
#include <fstream>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = nullptr);
~MainWindow();
private slots:
void on_pushButton_open_files_clicked();
void on_pushButton_change_dir_clicked();
2018-10-29 07:26:06 +03:00
void on_pushButton_save_clicked();
2018-12-14 07:44:18 +03:00
void on_pushButton_remove_clicked();
2018-10-29 07:26:06 +03:00
void on_pushButton_prev_clicked();
void on_pushButton_next_clicked();
void keyPressEvent(QKeyEvent *);
2018-12-14 07:44:18 +03:00
void next_img(bool bSavePrev = true);
void prev_img(bool bSavePrev = true);
2018-10-29 07:26:06 +03:00
void save_label_data() const;
void clear_label_data();
2020-10-02 16:26:19 +03:00
void remove_img();
2018-10-29 07:26:06 +03:00
void next_label();
void prev_label();
2018-12-14 07:44:18 +03:00
void on_tableWidget_label_cellDoubleClicked(int , int );
void on_tableWidget_label_cellClicked(int , int );
2018-10-29 07:26:06 +03:00
2018-12-14 07:44:18 +03:00
void on_horizontalSlider_images_sliderMoved(int );
2018-10-29 07:26:06 +03:00
private:
void init();
2018-12-14 07:44:18 +03:00
void init_table_widget();
void init_button_event();
void init_horizontal_slider();
2018-10-29 07:26:06 +03:00
void img_open(const int);
void set_label_progress(const int);
void set_focused_file(const int);
2018-12-14 05:01:40 +03:00
void goto_img(const int);
2018-10-29 07:26:06 +03:00
void load_label_list_data(QString);
QString get_labeling_data(QString)const;
2018-12-14 05:01:40 +03:00
void set_label(const int);
2018-12-14 07:44:18 +03:00
void set_label_color(const int , const QColor);
2018-10-29 07:26:06 +03:00
void pjreddie_style_msgBox(QMessageBox::Icon, QString, QString);
2018-12-14 07:44:18 +03:00
void open_img_dir(bool&);
void open_obj_file(bool&);
void reupdate_img_list();
Ui::MainWindow *ui;
QString m_imgDir;
2018-12-14 05:01:40 +03:00
QStringList m_imgList;
int m_imgIndex;
2018-12-14 05:01:40 +03:00
QStringList m_objList;
int m_objIndex;
2018-10-29 07:26:06 +03:00
protected:
void wheelEvent(QWheelEvent *);
};
#endif // MAINWINDOW_H