title: Is possible set order by bool in QSortFilterProxyModel with setSortRole()?
body: <p>Hello i have a class Filtro(in english is Filter) that is QSortFilterProxyModel , i have setted her sourceModel with myModel class. myModel class is a QAbstractListModel in this class i have a</p>
  
  <pre><code>QList&lt;Tile&gt; m_recipes; 
  </code></pre>
  
  <p>Tile class is this:</p>
  
  <pre><code>class Tile {
  
  public :
      Tile (const QString &amp;nameRecipe,const QString &amp;color,const int &amp;duration,const bool &amp;userRecipe);
      QString nameRecipe()const;
      QString color() const;
      int duration() const;
      bool userRecipe() const;
  
  private:
  
     QString m_nameRecipe;
     QString m_color;
     int     m_duration;
     bool    m_UserRecipe;
  };
  </code></pre>
  
  <p>Now when i filter the list with the class Filtro, i want to show in qml before all the elements with m_UserRecipe == true and after all the elements with m_UserRecipe == false .
  So my question is : in  QSortFilterProxyModel  is possible set order with a role that rapresents a bool value ??  </p>
  
  <pre><code>QHash&lt;int, QByteArray&gt; myModel::roleNames() const
  {
  
      QHash &lt;int,QByteArray&gt; roles;
      roles[NameRecipe]="NameRecipe";
      roles[Color]="Color";
      roles[Duration]="Duration";
      roles[UserRecipe]="userRecipe";
      return roles;
  
  }
  </code></pre>
  
  <p>filtro.h :</p>
  
  <pre><code>class Filtro : public QSortFilterProxyModel
  {
      Q_OBJECT
  
  public:
      Filtro(QObject* parent=0);
       ~Filtro();
  
      Q_INVOKABLE void setStringaFiltro(QString string);
      Q_PROPERTY(bool  showOnlyUserRic READ showOnlyUserRic WRITE setshowOnlyUserRic NOTIFY showOnlyUserRicChanged)
      Q_PROPERTY(QString string READ string WRITE setstring NOTIFY stringChanged)
  
  public slots:
  
      void setshowOnlyUserRic(bool showOnlyUserRic);
      bool showOnlyUserRic() const;
  
      QString string() const;
      void setstring(QString string);
  
  signals:
      void showOnlyUserRicChanged();
      void oggettiFiltChanged();
  
      void stringChanged();
  
  private:
  
      bool m_showOnlyUserRic;
      int m_oggettiFilt;
  
      QString m_string;
  
  protected:
      bool filterAcceptsRow(int source_row, const QModelIndex &amp;source_parent) const;
  
  };
  </code></pre>
  
  <p>filtro.cpp</p>
  
  <pre><code>Filtro::Filtro(QObject *parent): QSortFilterProxyModel(parent)
        , m_showOnlyUserRic(false)
        ,m_oggettiFilt(0)
        ,m_string("")
      {
         this-&gt;setSourceModel(&amp;myModel);
  
      }
  
      Filtro::~Filtro()
      {
  
      }
  
      void Filtro::setStringaFiltro(QString string)
      {
          this-&gt;setFilterCaseSensitivity(Qt::CaseInsensitive); // lo rendo case insensitive
          this-&gt;setFilterFixedString(string);
      }
  
      QString Filtro::string() const
      {
          return m_string;
      }
  
      void Filtro::setstring(QString string)
      {
          if (m_string == string)
              return;
  
          m_string = string;
          emit stringChanged();
          invalidateFilter();  // fa rivalutare il filtro e quindi entra di nuovo in filterAcceptsRows()
      }
  
      bool Filtro::showOnlyUserRic() const
      {
          return m_showOnlyUserRic;
      }
  
      void Filtro::setshowOnlyUserRic(bool showOnlyUserRic)
      {
          if (m_showOnlyUserRic == showOnlyUserRic)
              return;
  
          m_showOnlyUserRic = showOnlyUserRic;
          emit showOnlyUserRicChanged();
  
          invalidateFilter();  // fa rivalutare il filtro e quindi entra di nuovo in filterAcceptsRows()
  
      }
  
  
  
      bool Filtro::filterAcceptsRow(int source_row, const QModelIndex &amp;source_parent) const
      {
  
  
          QRegExp regEx("*"+string()+"*");
          regEx.setPatternSyntax(QRegExp::Wildcard);
          regEx.setCaseSensitivity(Qt::CaseInsensitive);
  
          if(showOnlyUserRic()==true) {
           // se devo visualizzare solo
           QModelIndex ricUtente = sourceModel()-&gt;index(source_row,0, source_parent); // vado a leggere singolarmente ogni riga del modello
           QString stringaConfronto=sourceModel()-&gt;data(ricUtente,modello::NomeRicetta).toString();
  
           if(sourceModel()-&gt;data(ricUtente,modello::RicettaUtente)==true &amp;&amp; stringaConfronto.contains(regEx)==true)
           {
               // se è ricetta utente
               return true;
           }
           else{
  
               return false;
           }
  
         }
          else{
  
              QModelIndex ricUtente = sourceModel()-&gt;index(source_row,0, source_parent); // vado a leggere singolarmente ogni riga del modello
              QString stringaConfronto=sourceModel()-&gt;data(ricUtente,modello::NomeRicetta).toString();
              if(stringaConfronto.contains(regEx))
                  return true;
      //        if(sourceModel()-&gt;data(ricUtente,modello::NomeRicetta)== string() )  //confronto il roles ricetta utene x filtrare il
      //        {
      //            return true;
      //        }
              return false;
     }
  }
  </code></pre>