#ifndef DEMO001_3_H
#define DEMO001_3_H

#include <QMainWindow>
#include <QSlider>
#include <QLineEdit>

namespace Ui {
class Demo001_3;
}

class Demo001_3 : public QMainWindow
{
    Q_OBJECT

public:
    explicit Demo001_3(QWidget *parent = nullptr);
    ~Demo001_3();

    void initFrom();
    void connectSliderAndLineEdit(QSlider* slider, QLineEdit* lineEdit);
    void initSliders();
    void initLineEdits();
    void saveSliderStates();
    void loadSliderStates();
    void closeEvent(QCloseEvent *event);

    void loadGroupSettings(int Id, int Index);

public slots: // 确保这里声明了槽函数
    void onComboBoxIndexChanged(int index); // 确保签名匹配
    QString getImagePathFromIndex(int index);

protected:
    void wheelEvent(QWheelEvent *event);
    void loadSettings();
    void checkSettings();
    void showEvent(QShowEvent *event) override;
    void hideEvent(QHideEvent *event) override;

private slots:
    void on_ZoomUpButton_clicked();

    QPixmap getCurrentPixmap() const {
        return currentPixmap;
    }

    void on_ZoomOutButton_clicked();

private:
    Ui::Demo001_3 *ui;

    QPixmap currentPixmap;
    qreal scaleFactor;
};

#endif // DEMO001_3_H
