-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
400 additions
and
294 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/** | ||
* A stack widget to manage panels in the interface. Handles the open and close events | ||
* for added panels. | ||
* Any widgets that want to have a non blocking panel based interface should use this | ||
* class to manage the panels. | ||
*/ | ||
class QgsPanelWidgetStack: public QWidget | ||
{ | ||
%TypeHeaderCode | ||
#include "qgspanelwidgetstack.h" | ||
%End | ||
public: | ||
|
||
/** | ||
* A stack widget to manage panels in the interface. Handles the open and close events | ||
* for added panels. | ||
* @param parent | ||
*/ | ||
QgsPanelWidgetStack( QWidget* parent = nullptr ); | ||
|
||
/** | ||
* Adds the main widget to the stack and selects it for the user | ||
* The main widget can not be closed and only the showPanel signal is attached | ||
* to handle children widget opening panels. | ||
* @param panel The panel to set as the first widget in the stack. | ||
*/ | ||
void addMainPanel( QgsPanelWidget* panel ); | ||
|
||
/** | ||
* The main widget that is set in the stack. The main widget can not be closed | ||
* and doesn't display a back button. | ||
* @return The main QgsPanelWidget that is active in the stack. | ||
*/ | ||
QgsPanelWidget* mainWidget(); | ||
|
||
/** | ||
* Removes the main widget from the stack and transfers ownsership to the | ||
* caller. | ||
* @return The main widget that is set in the stack. | ||
*/ | ||
QgsPanelWidget* takeMainWidget(); | ||
|
||
/** | ||
* Clear the stack of all widgets. Unless the panels autoDelete is set to false | ||
* the widget will be deleted. | ||
*/ | ||
void clear(); | ||
|
||
|
||
public slots: | ||
/** | ||
* Accept the current active widget in the stack. | ||
* | ||
* Calls the panelAccepeted signal on the active widget. | ||
*/ | ||
void acceptCurrentPanel(); | ||
|
||
/** | ||
* Show a panel in the stack widget. Will connect to the panels showPanel event to handle | ||
* nested panels. Auto switches the the given panel for the user. | ||
* @param panel The panel to show. | ||
*/ | ||
void showPanel( QgsPanelWidget* panel ); | ||
|
||
/** | ||
* Closes the panel in the widget. Will also delete the widget. | ||
* This slot is normally auto connected to panelAccepted when a panel is shown. | ||
* @param panel The panel to close. | ||
*/ | ||
void closePanel( QgsPanelWidget* panel ); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
e097443
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks a lot for all this!!!