Examples of QRegExp


Examples of com.trolltech.qt.core.QRegExp

        if (filterCaseSensitivityCheckBox.isChecked())
            caseSensitivity = Qt.CaseSensitivity.CaseSensitive;
        else
            caseSensitivity = Qt.CaseSensitivity.CaseInsensitive;

        QRegExp regExp = new QRegExp(filterPatternLineEdit.text(),
                                     caseSensitivity, syntax);
        proxyModel.setFilterRegExp(regExp);
    }
View Full Code Here

Examples of com.trolltech.qt.core.QRegExp

        private MySortFilterProxyModel(QObject parent) {
            super(parent);
        }
        @Override
        protected boolean filterAcceptsRow(int sourceRow, QModelIndex sourceParent){
            QRegExp filter = filterRegExp();
            QAbstractItemModel model = sourceModel();
            boolean matchFound = false;

            for(int i=0; i < model.columnCount(); i++){
              Object data = model.data(sourceModel().index(sourceRow, i, sourceParent));
              matchFound |= data != null && filter.indexIn(data.toString()) != -1;
            }
            return matchFound;
        }
View Full Code Here

Examples of com.trolltech.qt.core.QRegExp

        protected boolean lessThan(QModelIndex left, QModelIndex right) {
            boolean result = false;
            Object leftData = sourceModel().data(left);
            Object rightData = sourceModel().data(right);

            QRegExp emailPattern = new QRegExp("([\\w\\.]*@[\\w\\.]*)");

            String leftString = leftData.toString();
            if(left.column() == 1 && emailPattern.indexIn(leftString) != -1)
                leftString = emailPattern.cap(1);

            String rightString = rightData.toString();
            if(right.column() == 1 && emailPattern.indexIn(rightString) != -1)
                rightString = emailPattern.cap(1);

            result = leftString.compareTo(rightString) < 0;
            return result;
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.