Results 1 to 4 of 4

Thread: QComboBox??

  1. #1
    Join Date
    Feb 2006
    Posts
    9
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QComboBox

    Thread close.
    Last edited by crocus; 7th February 2006 at 03:24.

  2. #2
    Join Date
    Jan 2006
    Location
    Ukraine,Lviv
    Posts
    454
    Thanks
    9
    Thanked 27 Times in 27 Posts
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: QComboBox??

    Just moment for a future:
    I think if you find solution for your problem you can post it here instead of replace question on "Thread closed" It help other people solve a similar problem fastets!

  3. #3
    Join Date
    Feb 2006
    Posts
    9
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QComboBox??

    К сожалению я совсем не говорю по-английски и очень плохо пишу
    Суть вопроса свелась к алгоритму продемонстрированному в /demos/books т.е. использовался фильтр, я же пытался применить QSqlQueryModel,
    для QSqlRelationalTableModel используется
    Qt Code:
    1. cdi.comboStreet->setCurrentIndex(cdi.comboStreet->findText(rec.value(streetIdx).toString()));
    To copy to clipboard, switch view to plain text mode 
    я же для QSqlQueryModel делал так:
    Qt Code:
    1. cdi.comboStreet->setCurrentIndex(cdi.comboStreet->findText(rec.value("street_cod").toString()));
    To copy to clipboard, switch view to plain text mode 
    И соответственно не получал необходимого результата( and don,t work).
    Вот так работает:
    Qt Code:
    1. QModelIndex currentIndex = modelFlats->index(0, streetIdx);
    2. if (modelFlats->data(currentIndex).toString() != text)
    3. modelFlats->setData(currentIndex, cdi.comboStreet->currentText());
    4. QString cod = cdi.comboStreet->currentText();
    5. QString queryStreet = ("UPDATE tbl_flats,tbl_street SET tbl_flats.street_cod = tbl_street.street_cod WHERE tbl_street.street_name = '"
    6. + cod + "' And tbl_flats.flats_cod = " + flatcod + " ;");
    7. modelQuery->setQuery(queryStreet);
    To copy to clipboard, switch view to plain text mode 

  4. #4
    Join Date
    Jan 2006
    Location
    Lincoln, NE USA
    Posts
    177
    Thanks
    3
    Thanked 7 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QComboBox??

    I KNEW there was a reason why I needed BableFish!

Similar Threads

  1. Editable QComboBox with QItemDelegate
    By Jmgr in forum Qt Programming
    Replies: 11
    Last Post: 10th December 2008, 10:21
  2. QDataWidgetMapper and QCombobox
    By miraks in forum Qt Programming
    Replies: 4
    Last Post: 6th December 2008, 18:53
  3. QComboBox drop list button events
    By maird in forum Qt Programming
    Replies: 5
    Last Post: 20th October 2007, 20:25
  4. using QComboBox as an ItemView
    By EricTheFruitbat in forum Qt Programming
    Replies: 3
    Last Post: 24th January 2007, 17:14
  5. QDataWidgetMapper <=> QComboBox best practice
    By saknopper in forum Qt Programming
    Replies: 1
    Last Post: 18th January 2007, 11:50

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.