Skip to content
Snippets Groups Projects
Select Git revision
  • de5f358c804a8e35353870d27a26e0d7b01f110d
  • main default protected
  • leveleditor
  • david-author
  • clang-tidy-cleanup
  • architecture-refactoring
  • cleanUpMenus
  • doxygen-cleanup
  • project-structure-refactoring
  • interpolation
  • buildingFeatures
  • win_end_screen
  • helpMenu
  • leveleditor-placement
  • text-rendering
  • updated_unit_contextmenu
  • level-from-commandline
  • unit_contextmenu
  • player
  • engine-scaling
  • clang-tidy
21 results

LevelNameEdit.hpp

Blame
  • LevelNameEdit.hpp 1.08 KiB
    /**
     * LevelNameEdit.hpp
     *
     * @date 29.01.2025
     * @author Jonathan Dueck (jonathan.dueck@informatik.hs-fulda.de)
     */
    
    #pragma once
    
    #include <QLineEdit>
    
    namespace editor
    {
    
    /**
     * The LevelNameEdit Widget is displayed on the left of the TopBar.
     * It allows the user to set a custom level name.
     */
    class LevelNameEdit : public QLineEdit
    {
        public:
            /**
             * Creates a LevelNameEdit Widget prefilling the provided level_name.
             * The parent of the LevelNameEdit Widget is set to the provided parent.
             * @param levelName The initial name of the level.
             * @param parent The Widget that should be set as the parent of this Widget.
             */
            LevelNameEdit(const std::string& levelName, QWidget* parent = nullptr);
    
        protected:
            /**
             * Receives a QKeyEvent when the user presses a key to change the content of the QLineEdit.
             * The onLevelNameUpdated event method is subsequently emitted.
             * @param event The QKeyEvent for the Key Press.
             */
            void keyPressEvent(QKeyEvent* event) override;
    };
    
    } // namespace editor