--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ sodipodi:docname="system-search.svg"
+ sodipodi:docbase="/home/tigert/cvs/freedesktop.org/tango-icon-theme/scalable/actions"
+ inkscape:version="0.46"
+ sodipodi:version="0.32"
+ id="svg11300"
+ height="48px"
+ width="48px"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <defs
+ id="defs3">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 24 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="48 : 24 : 1"
+ inkscape:persp3d-origin="24 : 16 : 1"
+ id="perspective47" />
+ <linearGradient
+ id="linearGradient2846">
+ <stop
+ id="stop2848"
+ offset="0.0000000"
+ style="stop-color:#8a8a8a;stop-opacity:1.0000000;" />
+ <stop
+ id="stop2850"
+ offset="1.0000000"
+ style="stop-color:#484848;stop-opacity:1.0000000;" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient2366">
+ <stop
+ id="stop2368"
+ offset="0"
+ style="stop-color:#ffffff;stop-opacity:1;" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.21904762;"
+ offset="0.50000000"
+ id="stop2374" />
+ <stop
+ id="stop2370"
+ offset="1.0000000"
+ style="stop-color:#ffffff;stop-opacity:1.0000000;" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4487">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:1;"
+ offset="0"
+ id="stop4489" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0;"
+ offset="1"
+ id="stop4491" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4477">
+ <stop
+ style="stop-color:#000000;stop-opacity:1;"
+ offset="0"
+ id="stop4479" />
+ <stop
+ style="stop-color:#000000;stop-opacity:0;"
+ offset="1"
+ id="stop4481" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient4467">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:1;"
+ offset="0"
+ id="stop4469" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.24761905;"
+ offset="1.0000000"
+ id="stop4471" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient4454">
+ <stop
+ style="stop-color:#729fcf;stop-opacity:0.20784314;"
+ offset="0.0000000"
+ id="stop4456" />
+ <stop
+ style="stop-color:#729fcf;stop-opacity:0.67619050;"
+ offset="1.0000000"
+ id="stop4458" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient4440">
+ <stop
+ style="stop-color:#7d7d7d;stop-opacity:1;"
+ offset="0"
+ id="stop4442" />
+ <stop
+ id="stop4448"
+ offset="0.50000000"
+ style="stop-color:#b1b1b1;stop-opacity:1.0000000;" />
+ <stop
+ style="stop-color:#686868;stop-opacity:1.0000000;"
+ offset="1.0000000"
+ id="stop4444" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4440"
+ id="linearGradient4446"
+ x1="30.656250"
+ y1="34.000000"
+ x2="33.218750"
+ y2="31.062500"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.334593,0.000000,0.000000,1.291292,-6.973842,-7.460658)" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4454"
+ id="radialGradient4460"
+ cx="18.240929"
+ cy="21.817987"
+ fx="18.240929"
+ fy="21.817987"
+ r="8.3085051"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4467"
+ id="radialGradient4473"
+ cx="15.414371"
+ cy="13.078408"
+ fx="15.414371"
+ fy="13.078408"
+ r="6.6562500"
+ gradientTransform="matrix(2.592963,-7.746900e-24,-5.714443e-24,2.252104,-25.05975,-18.94100)"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4487"
+ id="radialGradient4493"
+ cx="24.130018"
+ cy="37.967922"
+ fx="24.130018"
+ fy="37.967922"
+ r="16.528622"
+ gradientTransform="matrix(1.000000,0.000000,0.000000,0.237968,3.152859e-15,28.93278)"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ gradientUnits="userSpaceOnUse"
+ y2="25.743469"
+ x2="17.500893"
+ y1="13.602121"
+ x1="18.292673"
+ id="linearGradient2372"
+ xlink:href="#linearGradient2366"
+ inkscape:collect="always" />
+ <radialGradient
+ r="16.528622"
+ fy="37.967922"
+ fx="24.130018"
+ cy="37.967922"
+ cx="24.130018"
+ gradientTransform="matrix(1.000000,0.000000,0.000000,0.237968,-2.471981e-16,28.93278)"
+ gradientUnits="userSpaceOnUse"
+ id="radialGradient2842"
+ xlink:href="#linearGradient4477"
+ inkscape:collect="always" />
+ <linearGradient
+ gradientUnits="userSpaceOnUse"
+ y2="30.557772"
+ x2="31.335964"
+ y1="26.580296"
+ x1="27.366341"
+ id="linearGradient2852"
+ xlink:href="#linearGradient2846"
+ inkscape:collect="always" />
+ </defs>
+ <sodipodi:namedview
+ stroke="#3465a4"
+ inkscape:window-y="94"
+ inkscape:window-x="239"
+ inkscape:window-height="754"
+ inkscape:window-width="691"
+ inkscape:showpageshadow="false"
+ inkscape:document-units="px"
+ inkscape:grid-bbox="true"
+ showgrid="false"
+ inkscape:current-layer="layer1"
+ inkscape:cy="23.07052"
+ inkscape:cx="9.502648"
+ inkscape:zoom="11.313708"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0.0"
+ borderopacity="0.25490196"
+ bordercolor="#666666"
+ pagecolor="#ffffff"
+ id="base"
+ fill="#729fcf" />
+ <metadata
+ id="metadata4">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:creator>
+ <cc:Agent>
+ <dc:title>Jakub Steiner</dc:title>
+ </cc:Agent>
+ </dc:creator>
+ <dc:source>http://jimmac.musichall.cz</dc:source>
+ <cc:license
+ rdf:resource="http://creativecommons.org/licenses/publicdomain/" />
+ </cc:Work>
+ <cc:License
+ rdf:about="http://creativecommons.org/licenses/publicdomain/">
+ <cc:permits
+ rdf:resource="http://creativecommons.org/ns#Reproduction" />
+ <cc:permits
+ rdf:resource="http://creativecommons.org/ns#Distribution" />
+ <cc:permits
+ rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
+ </cc:License>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:groupmode="layer"
+ inkscape:label="Layer 1"
+ id="layer1">
+ <g
+ id="g1772">
+ <path
+ sodipodi:type="arc"
+ style="opacity:0.17112298;color:#000000;fill:url(#radialGradient2842);fill-opacity:1.0000000;fill-rule:evenodd;stroke:none;stroke-width:1.0000000;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:10.000000;stroke-dasharray:none;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000;visibility:visible;display:inline;overflow:visible;"
+ id="path4475"
+ sodipodi:cx="24.130018"
+ sodipodi:cy="37.967922"
+ sodipodi:rx="16.528622"
+ sodipodi:ry="3.9332814"
+ d="M 40.658640 37.967922 A 16.528622 3.9332814 0 1 1 7.6013966,37.967922 A 16.528622 3.9332814 0 1 1 40.658640 37.967922 z"
+ transform="matrix(1.446431,0.000000,0.000000,1.519990,-10.97453,-17.75168)" />
+ <path
+ sodipodi:nodetypes="csscccscccscczzzz"
+ id="path2844"
+ d="M 18.627569,3.1435548 C 10.488439,3.1435548 3.8827682,9.7492259 3.8827682,17.888356 C 3.8827682,26.027486 10.488439,32.633158 18.627569,32.633158 C 22.107124,32.633158 25.178570,31.248765 27.701292,29.230511 C 27.495915,30.237392 27.623257,31.265879 28.457436,31.990436 L 39.421520,41.517846 C 40.654936,42.589175 42.508982,42.448806 43.580310,41.215389 C 44.651638,39.981971 44.511269,38.127927 43.277853,37.056599 L 32.313769,27.529188 C 31.642242,26.945909 30.820891,26.773219 30.007531,26.886466 C 31.994231,24.374044 33.372370,21.337663 33.372370,17.888356 C 33.372370,9.7492259 26.766699,3.1435548 18.627569,3.1435548 z M 18.551954,4.3697381 C 26.191413,4.3697381 31.843729,9.1586886 31.843729,17.661513 C 31.843729,26.336626 26.027039,30.953288 18.551954,30.953288 C 11.249005,30.953288 5.2601806,25.475196 5.2601806,17.661513 C 5.2601806,9.6774061 11.084819,4.3697380 18.551954,4.3697381 z "
+ style="opacity:1.0000000;color:#000000;fill:#dcdcdc;fill-opacity:1.0000000;fill-rule:evenodd;stroke:url(#linearGradient2852);stroke-width:2.0000010;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:10.000000;stroke-dasharray:none;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000;visibility:visible;display:inline;overflow:visible;" />
+ <path
+ style="opacity:1.0000000;color:#000000;fill:#dcdcdc;fill-opacity:1.0000000;fill-rule:evenodd;stroke:none;stroke-width:1.0000004;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:10.000000;stroke-dasharray:none;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000;visibility:visible;display:inline;overflow:visible;"
+ d="M 18.602905,3.0803551 C 10.437465,3.0803551 3.8104408,9.7073791 3.8104408,17.872819 C 3.8104408,26.038259 10.437465,32.665283 18.602905,32.665283 C 22.093708,32.665283 25.175082,31.276416 27.705960,29.251638 C 27.499919,30.261774 27.627672,31.293585 28.464547,32.020484 L 39.464073,41.578691 C 40.701476,42.653483 42.561515,42.512661 43.636306,41.275256 C 44.711097,40.037852 44.570274,38.177814 43.332871,37.103023 L 32.333346,27.544815 C 31.659648,26.959651 30.835642,26.786402 30.019653,26.900016 C 32.012775,24.379472 33.395369,21.333276 33.395369,17.872819 C 33.395369,9.7073791 26.768345,3.0803551 18.602905,3.0803551 z M 18.527046,6.2664243 C 24.808154,6.2664245 29.905864,11.364135 29.905864,17.645243 C 29.905864,23.926351 24.808154,29.024061 18.527046,29.024061 C 12.245938,29.024061 7.1482276,23.926351 7.1482276,17.645243 C 7.1482278,11.364135 12.245938,6.2664243 18.527046,6.2664243 z "
+ id="path4430" />
+ <path
+ style="opacity:1.0000000;color:#000000;fill:url(#linearGradient4446);fill-opacity:1.0000000;fill-rule:evenodd;stroke:none;stroke-width:1.0000000;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:10.000000;stroke-dasharray:none;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000;visibility:visible;display:inline;overflow:visible;"
+ d="M 39.507004,41.577690 C 39.028332,39.304503 40.904334,36.766268 43.091057,36.789315 C 43.091057,36.789315 32.330690,27.531204 32.330690,27.531204 C 29.385899,27.474498 28.061188,29.803820 28.553876,32.131126 L 39.507004,41.577690 z "
+ id="path4438"
+ sodipodi:nodetypes="ccccc" />
+ <path
+ sodipodi:type="arc"
+ style="opacity:1.0000000;color:#000000;fill:none;fill-opacity:1.0000000;fill-rule:evenodd;stroke:url(#linearGradient2372);stroke-width:0.80273360;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:10.000000;stroke-dasharray:none;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000;visibility:visible;display:inline;overflow:visible;"
+ id="path4450"
+ sodipodi:cx="17.500893"
+ sodipodi:cy="18.920233"
+ sodipodi:rx="11.048544"
+ sodipodi:ry="11.048544"
+ d="M 28.549437 18.920233 A 11.048544 11.048544 0 1 1 6.4523487,18.920233 A 11.048544 11.048544 0 1 1 28.549437 18.920233 z"
+ transform="matrix(1.245743,0.000000,0.000000,1.245743,-3.425346,-6.177033)" />
+ <path
+ transform="matrix(0.497764,0.000000,0.000000,0.609621,8.973526,15.61929)"
+ d="M 40.658640 37.967922 A 16.528622 3.9332814 0 1 1 7.6013966,37.967922 A 16.528622 3.9332814 0 1 1 40.658640 37.967922 z"
+ sodipodi:ry="3.9332814"
+ sodipodi:rx="16.528622"
+ sodipodi:cy="37.967922"
+ sodipodi:cx="24.130018"
+ id="path4485"
+ style="opacity:1.0000000;color:#000000;fill:url(#radialGradient4493);fill-opacity:1.0000000;fill-rule:evenodd;stroke:none;stroke-width:1.0000000;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:10.000000;stroke-dasharray:none;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000;visibility:visible;display:inline;overflow:visible;"
+ sodipodi:type="arc" />
+ <rect
+ style="opacity:0.43315509;color:#000000;fill:none;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.0000311;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:10.000000;stroke-dasharray:none;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000;visibility:visible;display:inline;overflow:visible;"
+ id="rect4495"
+ width="19.048439"
+ height="4.4404783"
+ x="40.373337"
+ y="0.14086054"
+ rx="2.1366608"
+ ry="1.8879365"
+ transform="matrix(0.752986,0.658037,-0.648902,0.760872,0.000000,0.000000)" />
+ <path
+ sodipodi:type="arc"
+ style="color:#000000;fill:url(#radialGradient4460);fill-opacity:1.0000000;fill-rule:evenodd;stroke:#3063a3;stroke-width:0.71499395;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:10.000000;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000;marker:none;marker-start:none;marker-mid:none;marker-end:none;visibility:visible;"
+ id="path4452"
+ sodipodi:cx="17.589281"
+ sodipodi:cy="18.478292"
+ sodipodi:rx="8.3085051"
+ sodipodi:ry="8.3085051"
+ d="M 25.897786 18.478292 A 8.3085051 8.3085051 0 1 1 9.2807760,18.478292 A 8.3085051 8.3085051 0 1 1 25.897786 18.478292 z"
+ transform="matrix(1.398614,0.000000,0.000000,1.398614,-6.224338,-8.298958)" />
+ <path
+ style="opacity:0.83422458;color:#000000;fill:url(#radialGradient4473);fill-opacity:1.0000000;fill-rule:evenodd;stroke:none;stroke-width:1.0000000;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:10.000000;stroke-dasharray:none;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000;visibility:visible;display:inline;overflow:visible;"
+ d="M 18.156915,7.3966938 C 12.949325,7.3966938 8.7323681,11.613651 8.7323681,16.821241 C 8.7323681,18.325216 9.1526753,19.709014 9.7795400,20.971144 C 11.031920,21.432757 12.362297,21.746827 13.774307,21.746827 C 19.945262,21.746827 24.873589,16.885190 25.254413,10.809698 C 23.523449,8.7641668 21.044374,7.3966938 18.156915,7.3966938 z "
+ id="path4462" />
+ </g>
+ </g>
+</svg>
#include <QDebug>
#include <QInputDialog>
#include <QLabel>
+#include <QLineEdit>
#include <QPushButton>
#include <QVBoxLayout>
namespace decoder_selector {
+bool QCustomSortFilterProxyModel::filterAcceptsRow(int source_row,
+ const QModelIndex& source_parent) const
+{
+ // Search model recursively
+
+ if (QSortFilterProxyModel::filterAcceptsRow(source_row, source_parent))
+ return true;
+
+ const QModelIndex index = sourceModel()->index(source_row, 0, source_parent);
+
+ for (int i = 0; i < sourceModel()->rowCount(index); i++)
+ if (filterAcceptsRow(i, index))
+ return true;
+
+ return false;
+}
+
+
void QCustomTreeView::currentChanged(const QModelIndex& current,
const QModelIndex& previous)
{
info_label_body_(new QLabel()),
info_label_footer_(new QLabel()),
model_(new DecoderCollectionModel()),
- sort_filter_model_(new QSortFilterProxyModel())
+ sort_filter_model_(new QCustomSortFilterProxyModel())
{
QVBoxLayout* root_layout = new QVBoxLayout(this);
root_layout->setContentsMargins(0, 0, 0, 0);
root_layout->addWidget(splitter_);
+ QWidget* upper_container = new QWidget();
+ QVBoxLayout* upper_layout = new QVBoxLayout(upper_container);
+ upper_layout->setContentsMargins(0, 5, 0, 0);
+ QLineEdit* filter = new QLineEdit();
+ upper_layout->addWidget(filter);
+ upper_layout->addWidget(tree_view_);
+
splitter_->setOrientation(Qt::Vertical);
- splitter_->addWidget(tree_view_);
+ splitter_->addWidget(upper_container);
splitter_->addWidget(info_box_);
+ const QIcon filter_icon(QIcon::fromTheme("search",
+ QIcon(":/icons/search.svg")));
+ filter->setClearButtonEnabled(true);
+ filter->addAction(filter_icon, QLineEdit::LeadingPosition);
+
sort_filter_model_->setSourceModel(model_);
+ sort_filter_model_->setFilterCaseSensitivity(Qt::CaseInsensitive);
tree_view_->setModel(sort_filter_model_);
tree_view_->setRootIsDecorated(true);
info_label_body_->setWordWrap(true);
info_label_body_->setText(tr("Select a decoder to see its description here."));
+ connect(filter, SIGNAL(textChanged(const QString&)),
+ this, SLOT(on_filter_changed(const QString&)));
+
connect(tree_view_, SIGNAL(currentChanged(const QModelIndex&)),
this, SLOT(on_item_changed(const QModelIndex&)));
connect(tree_view_, SIGNAL(activated(const QModelIndex&)),
new_decoders_selected(decoders);
}
+void SubWindow::on_filter_changed(const QString& text)
+{
+ sort_filter_model_->setFilterFixedString(text);
+}
+
} // namespace decoder_selector
} // namespace subwindows
} // namespace pv