view src/mainwindow.h @ 0:147b08bc7d64

Initial commit of a basic Application framework.
author Andre Heinecke <andre.heinecke@intevation.de>
date Mon, 23 Mar 2015 12:41:52 +0100
parents
children 97d2c8869c39
line wrap: on
line source
/* Copyright (C) 2014 by Intevation GmbH
 *
 * This file is Free Software under the GNU GPL (v>=2)
 * and comes with ABSOLUTELY NO WARRANTY!
 * See LICENSE.txt for details.
 */


/** @file The Main UI class.
 *
 * Parent class of all dialogs and graphical user interaction.
 */
#include <QMainWindow>
#include <QSettings>

class QPushButton;
class QDropEvent;
class QDragLeaveEvent;
class QDragMoveEvent;
class QDragEnterEvent;

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow();

protected:
    /** @brief UI setup */
    void setupGUI();

    /** @brief Cleanup and save the current state */
    virtual void closeEvent(QCloseEvent *event);

    /** @brief Restores the last window state */
    void readSettings();

    /* The drag drop actions */
    void dragEnterEvent(QDragEnterEvent *event);
    void dragMoveEvent(QDragMoveEvent *event);
    void dragLeaveEvent(QDragLeaveEvent *event);
    void dropEvent(QDropEvent *event);

public slots:
    /** @brief set an absolute folder to read a metadata.csv from. */
    void setFolder(const QString &folder);

protected slots:
    /** @brief Show an error dialog to the user. */
    void showErrorMessage(const QString& errMsg);

private:
    QSettings mSettings;

    bool mHasValidFolder;
    QString mCurFolder;
};
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)