Results 1 to 8 of 8

Thread: QSqlTableModel

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2009
    Posts
    206
    Thanks
    34
    Thanked 2 Times in 2 Posts

    Default QSqlTableModel

    Hello there,

    I have one problem in setting the filter from the above metioned object. So I have an QSqlTableModel and when I set my filter like this (line 7)
    Qt Code:
    1. ValidToFilter->addItem("9999-12-31 23:59:59");
    2. QString product = ProductFilter->currentText();
    3. QString date = ValidToFilter->currentText();
    4. QString eingabeFilter = "vcProductID='"+product+"'";
    5. QString validationFilter = "dtValidTo='"+date+"'";
    6. QString price = "dcPrice='0.200'";
    7. model->setFilter( eingabeFilter +" and "+dcPrice);
    To copy to clipboard, switch view to plain text mode 
    everything is ok with multiple filter argument but when I change the second filter argument to this
    Qt Code:
    1. model->setFilter( eingabeFilter +" and "+validationFilter );
    2. view->setModel(model);
    To copy to clipboard, switch view to plain text mode 

    my view is empty. The second filterargument is an Datetime type on the mssql server table
    So what do I wrong I have to filter the column on the sql server. For example this is one representativ entry in the column with datetime type : 9999-12-31 23:59:59.000

    anybody some idea???
    Last edited by codeman; 24th April 2009 at 11:55.

Similar Threads

  1. QSqlTableModel & treeview
    By janEUcitzen in forum Qt Programming
    Replies: 6
    Last Post: 14th November 2008, 20:00
  2. QSqlTableModel inserts empty rows
    By Nesbitt in forum Qt Programming
    Replies: 2
    Last Post: 6th August 2008, 12:47
  3. Replies: 4
    Last Post: 9th May 2008, 17:02
  4. Subclassing QSqlTableModel to overwrite setQuery
    By montuno in forum Qt Programming
    Replies: 3
    Last Post: 16th November 2007, 10:32
  5. QSqlTableModel verticak header connect
    By patrik08 in forum Qt Programming
    Replies: 1
    Last Post: 1st July 2007, 13:07

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.