-
-
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.
Merge pull request #3475 from m-kuhn/visibilityTab218
[Feature] conditional visibility for tabs and groupboxes (backport)
- Loading branch information
Showing
28 changed files
with
1,098 additions
and
16 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,83 @@ | ||
/*************************************************************************** | ||
qgsoptionalexpression.sip - QgsOptionalExpression | ||
|
||
--------------------- | ||
begin : 8.9.2016 | ||
copyright : (C) 2016 by Matthias Kuhn | ||
email : matthias@opengis.ch | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
|
||
/** | ||
* \ingroup core | ||
* | ||
* QgsOptionalExpression is a container for an expression with an additional enabled/disabled flag. | ||
* | ||
* @note Added in QGIS 3.0 | ||
*/ | ||
class QgsOptionalExpression | ||
{ | ||
%TypeHeaderCode | ||
#include <qgsoptionalexpression.h> | ||
%End | ||
public: | ||
/** | ||
* A QgsOptionalExpression is disabled by default if default constructed. | ||
*/ | ||
QgsOptionalExpression(); | ||
|
||
/** | ||
* A QgsOptionalExpression is enabled by default if constructed with an expression. | ||
*/ | ||
QgsOptionalExpression( const QgsExpression& data ); | ||
|
||
/** | ||
* A QgsOptionalExptression constructed with enabled status and data | ||
*/ | ||
QgsOptionalExpression( const QgsExpression& data, bool enabled ); | ||
|
||
/** | ||
* Compare this QgsOptionalExptression to another one. | ||
* | ||
* This will compare the enabled flag and call the == operator | ||
* of the contained class. | ||
* | ||
* @note Added in QGIS 3.0 | ||
*/ | ||
bool operator== ( const QgsOptionalExpression& other ) const; | ||
operator bool () const; | ||
|
||
/** | ||
* Check if this optional is enabled | ||
* | ||
* @note Added in QGIS 3.0 | ||
*/ | ||
bool enabled() const; | ||
|
||
/** | ||
* Set if this optional is enabled | ||
* | ||
* @note Added in QGIS 3.0 | ||
*/ | ||
void setEnabled( bool enabled ); | ||
|
||
/** | ||
* Access the payload data | ||
* | ||
* @note Added in QGIS 3.0 | ||
*/ | ||
QgsExpression data() const; | ||
|
||
/** | ||
* Set the payload data | ||
* | ||
* @note Added in QGIS 3.0 | ||
*/ | ||
void setData( const QgsExpression& data ); | ||
}; |
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,84 @@ | ||
/*************************************************************************** | ||
qgstabwidget.sip - QgsTabWidget | ||
|
||
--------------------- | ||
begin : 8.9.2016 | ||
copyright : (C) 2016 by Matthias Kuhn | ||
email : matthias@opengis.ch | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
|
||
/** \ingroup gui | ||
* The QgsTabWidget class is the same as the QTabWidget but with additional methods to | ||
* temporarily hide/show tabs. | ||
* | ||
* @note Added in QGIS 2.18 | ||
*/ | ||
class QgsTabWidget : QTabWidget | ||
{ | ||
%TypeHeaderCode | ||
#include <qgstabwidget.h> | ||
%End | ||
|
||
public: | ||
/** | ||
* Create a new QgsTabWidget with the optionally provided parent. | ||
* | ||
* @note Added in QGIS 2.18 | ||
*/ | ||
QgsTabWidget( QWidget *parent = nullptr ); | ||
|
||
/** | ||
* Hides the tab with the given widget | ||
* | ||
* @note Added in QGIS 2.18 | ||
*/ | ||
void hideTab( QWidget* tab ); | ||
|
||
/** | ||
* Shows the tab with the given widget | ||
* | ||
* @note Added in QGIS 2.18 | ||
*/ | ||
void showTab( QWidget* tab ); | ||
|
||
/** | ||
* Control the visibility for the tab with the given widget. | ||
* | ||
* @note Added in QGIS 2.18 | ||
*/ | ||
void setTabVisible( QWidget* tab, bool visible ); | ||
|
||
/** | ||
* Returns the index of the tab with the given widget. | ||
* This index is not the same as the one provided to insertTab and removeTab | ||
* since these methods are not aware of hidden tabs. | ||
* | ||
* @note Added in QGIS 2.18 | ||
*/ | ||
int realTabIndex( QWidget* widget ); | ||
|
||
/** | ||
* Is called internally whenever a new tab has been inserted. | ||
* | ||
* Is used to keep track of currently available and visible tabs. | ||
* | ||
* @note Added in QGIS 2.18 | ||
*/ | ||
virtual void tabInserted( int index ); | ||
|
||
/** | ||
* Is called internally whenever a tab has been removed. | ||
* | ||
* Is used to keep track of currently available and visible tabs. | ||
* | ||
* @note Added in QGIS 2.18 | ||
*/ | ||
virtual void tabRemoved( int index ); | ||
}; |
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.