Results 1 to 8 of 8

Thread: How to get data from sqlquery that result 3 columns in a row and show only 1 Colum

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2009
    Posts
    83

    Default Re: How to get data from sqlquery that result 3 columns in a row and show only 1 Colu

    Thanks for the answer , but this dosn't work i set the table like this :
    Qt Code:
    1. m_pPlayListMiniItemDelegate =new PlayListMiniItemDelegate(this);
    2. ui->PlayListMini_tableView->setSelectionBehavior(QAbstractItemView::SelectRows);
    3. ui->PlayListMini_tableView->setSelectionMode(QAbstractItemView::SingleSelection);
    4. ui->PlayListMini_tableView->setItemDelegate(m_pPlayListMiniItemDelegate);
    5. ui->PlayListMini_tableView->setAlternatingRowColors(true);
    6. ui->PlayListMini_tableView->setModel(PlayListMiniSqlModel::instance());
    7. ui->PlayListMini_tableView->hideColumn(0);
    8. ui->PlayListMini_tableView->hideColumn(1);
    To copy to clipboard, switch view to plain text mode 
    and inside the PlayListMiniSqlModel::instance()
    i execute simple sql that returns 3 results in a row.
    "SELECT foo1,foo2,foo3 FROM tbl"
    the hide column 0,1 dosnt work i still see 3 column in raw.
    also i follow this tutorial :
    http://www.jwdougherty.com/content/q...ser-interfaces

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to get data from sqlquery that result 3 columns in a row and show only 1 Colu

    Show us your model implementation, please.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: How to get data from sqlquery that result 3 columns in a row and show only 1 Colu

    Quote Originally Posted by umen View Post
    i execute simple sql that returns 3 results in a row.
    "SELECT foo1,foo2,foo3 FROM tbl"
    the hide column 0,1 dosnt work i still see 3 column in raw.
    Ah yes... and that is a problem because...?

Similar Threads

  1. Replies: 3
    Last Post: 5th January 2011, 22:55
  2. qabstracttablemodel/qtableview: vector data columns
    By xyfix in forum Qt Programming
    Replies: 0
    Last Post: 15th September 2010, 12:51
  3. Replies: 2
    Last Post: 27th August 2009, 20:31
  4. QCcompleter , colum probelm
    By deepinlife in forum Qt Programming
    Replies: 7
    Last Post: 10th April 2008, 07:46
  5. Replies: 1
    Last Post: 21st March 2006, 12:54

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
  •  
Qt is a trademark of The Qt Company.