The ProjectEditor class.
More...
#include <projecteditor.h>
Inherits QObject.
◆ ProjectEditor() [1/3]
◆ ProjectEditor() [2/3]
◆ ProjectEditor() [3/3]
◆ ~ProjectEditor()
◆ getWorkspace()
◆ getProject()
◆ getDefaultLengthUnit()
◆ getUndoStack()
Get a reference to the undo stack of the project.
- Returns
- A reference to the UndoStack object
◆ windowIsAboutToClose()
bool windowIsAboutToClose |
( |
QMainWindow & |
window | ) |
|
|
noexcept |
Inform the editor that a project related window is about to close.
The project must be closed and destroyed automatically after the last opened window of the project is closed, because without a window the user is no longer able to close the project himself. So, every project related window have to "ask" the librepcb::project::editor::ProjectEditor object whether it is allowed to close or not. If the last opened window wants to close, the editor will first ask the user if unsaved changes should be written to the harddisc. Only if the user accepts this question and the project is saved successfully, the method will return true to allow the last window to close. Then it will also close the whole project.
- Parameters
-
window | A reference to the window which is about to close |
- Returns
- true if the window can be closed, false if closing the window is denied
◆ operator=()
◆ showAllRequiredEditors
void showAllRequiredEditors |
( |
| ) |
|
|
slotnoexcept |
Open the schematic and/or the board editor window.
Which editors this will open depends on whether the project has schematics and/or boards. If there aren't any boards or schematics, the schematic editor will be shown anyway (otherwise the whole project editor would be invisible).
◆ showSchematicEditor
void showSchematicEditor |
( |
| ) |
|
|
slotnoexcept |
Open the schematic editor window and bring it to the front.
◆ showBoardEditor
Open the board editor window and bring it to the front.
◆ execProjectSettingsDialog
void execProjectSettingsDialog |
( |
QWidget * |
parent = nullptr | ) |
|
|
slotnoexcept |
Execute the project settings dialog (blocking!)
- Parameters
-
parent | parent widget of the settings dialog (optional) |
◆ execNetClassesEditorDialog
void execNetClassesEditorDialog |
( |
QWidget * |
parent = nullptr | ) |
|
|
slotnoexcept |
Execute the netclasses editor dialog (blocking!)
- Parameters
-
parent | parent widget of the dialog (optional) |
◆ execLppzExportDialog
void execLppzExportDialog |
( |
QWidget * |
parent = nullptr | ) |
|
|
slotnoexcept |
Execute the *.lppz export dialog (blocking!)
- Parameters
-
parent | parent widget of the dialog (optional) |
◆ saveProject
Save the whole project to the harddisc.
- Note
- The whole save procedere is described in Atomic Saving Procedure.
- Returns
- true on success, false on failure
◆ autosaveProject
Make a automatic backup of the project (save to temporary files)
- Note
- The whole save procedere is described in Atomic Saving Procedure.
- Returns
- true on success, false on failure
◆ closeAndDestroy
bool closeAndDestroy |
( |
bool |
askForSave, |
|
|
QWidget * |
msgBoxParent = 0 |
|
) |
| |
|
slotnoexcept |
Close the project (this will destroy this object!)
If there are unsaved changes to the project, this method will ask the user whether the changes should be saved or not. If the user clicks on "cancel" or the project could not be saved successfully, this method will return false. If there was no such error, this method will call QObject::deleteLater() which means that this object will be deleted in the Qt's event loop.
- Warning
- This method can be called both from within this class and from outside this class (for example from the librepcb::application::ControlPanel). But if you call this method from outside this class, you may have to delete the object yourself afterwards! In special cases, the deleteLater() mechanism could lead in fatal errors otherwise!
- Parameters
-
askForSave | If true and there are unsaved changes, this method shows a message box to ask whether the project should be saved or not. If false, the project will NOT be saved. |
msgBoxParent | Here you can specify a parent window for the message box |
- Returns
- true on success (project closed), false on failure (project stays open)
◆ showControlPanelClicked
void showControlPanelClicked |
( |
| ) |
|
|
signal |
◆ openProjectLibraryUpdaterClicked
void openProjectLibraryUpdaterClicked |
( |
const FilePath & |
fp | ) |
|
|
signal |
◆ projectEditorClosed
void projectEditorClosed |
( |
| ) |
|
|
signal |
◆ getCountOfVisibleEditorWindows()
int getCountOfVisibleEditorWindows |
( |
| ) |
const |
|
privatenoexcept |
◆ mWorkspace
◆ mProject
◆ mAutoSaveTimer
◆ mUndoStack
◆ mSchematicEditor
The schematic editor (GUI)
◆ mBoardEditor
The documentation for this class was generated from the following files: