-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* avoid using lambdas and use dedicate class and subclasses for each widget type (lable, groupbox, tree, etc) * this makes the code much more clearer * allow creating custom highlight widgets with API
- Loading branch information
Showing
11 changed files
with
849 additions
and
347 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/gui/qgsoptionsdialoghighlightwidget.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ | ||
|
||
|
||
|
||
|
||
class QgsOptionsDialogHighlightWidget : QObject | ||
{ | ||
%Docstring | ||
Container for a widget to be used to search text in the option dialog | ||
If the widget type is handled, it is valid. | ||
It can perform a text search in the widget and highlight it in case of success. | ||
This uses stylesheets. | ||
|
||
.. versionadded:: 3.0 | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgsoptionsdialoghighlightwidget.h" | ||
%End | ||
public: | ||
static QgsOptionsDialogHighlightWidget *createWidget( QWidget *widget ) /Factory/; | ||
|
||
bool isValid(); | ||
%Docstring | ||
Returns if it valid: if the widget type is handled and if the widget is not still available | ||
%End | ||
|
||
bool searchHighlight( const QString &text ); | ||
%Docstring | ||
search for a text pattern and highlight the widget if the text is found | ||
|
||
:return: true if the text pattern is found | ||
%End | ||
|
||
QWidget *widget(); | ||
%Docstring | ||
Return the widget | ||
%End | ||
|
||
|
||
virtual bool eventFilter( QObject *obj, QEvent *event ); | ||
|
||
|
||
|
||
protected: | ||
|
||
virtual bool searchText( const QString &text ) = 0; | ||
%Docstring | ||
Search for the ``text`` in the widget and return true if it was found | ||
%End | ||
|
||
virtual bool highlightText( const QString &text ) = 0; | ||
%Docstring | ||
Highlight the ``text`` in the widget. | ||
|
||
:return: true if the text could be highlighted. | ||
%End | ||
|
||
virtual void reset() = 0; | ||
%Docstring | ||
reset the style of the widgets to its original state | ||
%End | ||
|
||
explicit QgsOptionsDialogHighlightWidget( QWidget *widget = 0 ); | ||
%Docstring | ||
Constructor | ||
|
||
:param widget: the widget used to search text into | ||
%End | ||
|
||
|
||
}; | ||
|
||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/gui/qgsoptionsdialoghighlightwidget.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ |
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,127 @@ | ||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/gui/qgsoptionsdialoghighlightwidgetsimpl.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
class QgsOptionsDialogHighlightLabel : QgsOptionsDialogHighlightWidget | ||
{ | ||
%Docstring | ||
A highlight widget for labels. | ||
This is used to search and highlight text in QgsOptionsDialogBase implementations. | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgsoptionsdialoghighlightwidgetsimpl.h" | ||
%End | ||
public: | ||
QgsOptionsDialogHighlightLabel( QLabel *label ); | ||
%Docstring | ||
constructs a highlight widget for a label | ||
%End | ||
protected: | ||
virtual bool searchText( const QString &text ); | ||
virtual bool highlightText( const QString &text ); | ||
virtual void reset(); | ||
}; | ||
|
||
class QgsOptionsDialogHighlightCheckBox : QgsOptionsDialogHighlightWidget | ||
{ | ||
%Docstring | ||
A highlight widget for checkboxes. | ||
This is used to search and highlight text in QgsOptionsDialogBase implementations. | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgsoptionsdialoghighlightwidgetsimpl.h" | ||
%End | ||
public: | ||
QgsOptionsDialogHighlightCheckBox( QCheckBox *checkBox ); | ||
%Docstring | ||
constructs a highlight widget for a checkbox | ||
%End | ||
protected: | ||
virtual bool searchText( const QString &text ); | ||
virtual bool highlightText( const QString &text ); | ||
virtual void reset(); | ||
}; | ||
|
||
class QgsOptionsDialogHighlightButton : QgsOptionsDialogHighlightWidget | ||
{ | ||
%Docstring | ||
A highlight widget for buttons. | ||
This is used to search and highlight text in QgsOptionsDialogBase implementations. | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgsoptionsdialoghighlightwidgetsimpl.h" | ||
%End | ||
public: | ||
QgsOptionsDialogHighlightButton( QAbstractButton *button ); | ||
%Docstring | ||
constructs a highlight widget for a button. | ||
%End | ||
protected: | ||
virtual bool searchText( const QString &text ); | ||
virtual bool highlightText( const QString &text ); | ||
virtual void reset(); | ||
}; | ||
|
||
class QgsOptionsDialogHighlightGroupBox : QgsOptionsDialogHighlightWidget | ||
{ | ||
%Docstring | ||
A highlight widget for group boxes. | ||
This is used to search and highlight text in QgsOptionsDialogBase implementations. | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgsoptionsdialoghighlightwidgetsimpl.h" | ||
%End | ||
public: | ||
QgsOptionsDialogHighlightGroupBox( QGroupBox *groupBox ); | ||
%Docstring | ||
constructs a highlight widget for a group box. | ||
%End | ||
protected: | ||
virtual bool searchText( const QString &text ); | ||
virtual bool highlightText( const QString &text ); | ||
virtual void reset(); | ||
}; | ||
|
||
class QgsOptionsDialogHighlightTree : QgsOptionsDialogHighlightWidget | ||
{ | ||
%Docstring | ||
A highlight widget for trees. | ||
This is used to search and highlight text in QgsOptionsDialogBase implementations. | ||
Highlighting is only available for tree widgets only while searching can be performed | ||
in any tree view or inherited class. | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgsoptionsdialoghighlightwidgetsimpl.h" | ||
%End | ||
public: | ||
QgsOptionsDialogHighlightTree( QTreeView *treeView ); | ||
%Docstring | ||
constructs a highlight widget for a tree view or widget. | ||
%End | ||
protected: | ||
virtual bool searchText( const QString &text ); | ||
virtual bool highlightText( const QString &text ); | ||
virtual void reset(); | ||
}; | ||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/gui/qgsoptionsdialoghighlightwidgetsimpl.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ |
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.