-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a context menu option to the inspector to filter on a certain a…
…ttribute.
- Loading branch information
Showing
9 changed files
with
79 additions
and
25 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,8 @@ | ||
#ifndef QUERY_HH | ||
#define QUERY_HH | ||
|
||
#include <QString> | ||
|
||
QString generateQuery(QString const &base, QString const &attribute, QString const &value); | ||
|
||
#endif // QUERY_HH |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include "Query.hh" | ||
|
||
QString generateQuery(QString const &base, QString const &attribute, QString const &value) | ||
{ | ||
int subSelectionPos = base.lastIndexOf('/'); | ||
|
||
if (!subSelectionPos) | ||
return QString(); | ||
|
||
//qWarning() << base.mid(subSelectionPos); | ||
|
||
int closingBracketPos = base.mid(subSelectionPos).lastIndexOf(']'); | ||
|
||
QString condition = QString("@%1=\"%2\"").arg(attribute).arg(value); | ||
|
||
if (closingBracketPos == -1) | ||
return QString("%1[%2]").arg(base).arg(condition); | ||
else | ||
return QString("%1 and %2%3").arg( | ||
base.left(subSelectionPos + closingBracketPos), | ||
condition, | ||
base.mid(subSelectionPos + closingBracketPos)); | ||
} |
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