For the filters, only you know what values they might have, I do not. In your table I see a value of 456_45. If you/the user passes that string to search for directly into your function as Filter1 or Filter2 and you generate SQL clause like:
WHERE Attribute2 LIKE '%"+Filter1+"%'
so that it expands to
WHERE Attribute2 LIKE '%456_45%'
it will not give the result it should do. Up to you whether you wish to deal with this.
For your compiler error, I have no idea, I don't use C++. All I was suggesting was that you write code to print out/display/whatever string you are passing to your original QM->setQuery(...) statement so that you/we can see what it's actually expanding to. Your compiler error will be to do with it mixing C strings & QStrings. Have a look at, say, https://stackoverflow.com/questions/18427191/how-to-print-string-literal-and-qstring-with-qdebug.