Warning, file /multimedia/kid3/src/app/qt/kid3qtapplication.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /**
0002  * \file kid3qtapplication.h
0003  * QApplication subclass with adapted session management.
0004  *
0005  * \b Project: Kid3
0006  * \author Urs Fleisch
0007  * \date 5 Aug 2014
0008  *
0009  * Copyright (C) 2014-2024  Urs Fleisch
0010  *
0011  * This file is part of Kid3.
0012  *
0013  * Kid3 is free software; you can redistribute it and/or modify
0014  * it under the terms of the GNU General Public License as published by
0015  * the Free Software Foundation; either version 2 of the License, or
0016  * (at your option) any later version.
0017  *
0018  * Kid3 is distributed in the hope that it will be useful,
0019  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0020  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0021  * GNU General Public License for more details.
0022  *
0023  * You should have received a copy of the GNU General Public License
0024  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
0025  */
0026 
0027 #include <QApplication>
0028 
0029 /**
0030  * QApplication subclass with adapted session management.
0031  */
0032 class Kid3QtApplication : public QApplication {
0033   Q_OBJECT
0034 public:
0035   /**
0036    * Constructor.
0037    * @param argc number of arguments (including command)
0038    * @param argv arguments
0039    */
0040   Kid3QtApplication(int& argc, char** argv);
0041 
0042   /**
0043    * Destructor.
0044    */
0045   ~Kid3QtApplication() override = default;
0046 
0047   /**
0048    * Called when session manager wants application to commit all its data.
0049    *
0050    * This method is reimplemented to avoid closing all top level widgets and
0051    * make restoring with the KDE window manager working.
0052    *
0053    * @param manager session manager
0054    */
0055   virtual void commitData(QSessionManager& manager);
0056 
0057   /**
0058    * Send event to receiver.
0059    * @param receiver receiver
0060    * @param event event
0061    * @return return value from receiver's event handler.
0062    */
0063   bool notify(QObject* receiver, QEvent* event) override;
0064 
0065 signals:
0066   /**
0067    * Emitted when files have to be opened.
0068    * @param paths path to file
0069    */
0070   void openFileRequested(const QStringList& paths);
0071 
0072 protected:
0073   /**
0074    * Handle file open events on Mac OS X.
0075    * @param e event
0076    * @return true if event handled.
0077    */
0078   bool event(QEvent* e) override;
0079 };