Page 2 of 2 FirstFirst 12
Results 21 to 22 of 22

Thread: Display Problem

  1. #21
    Join Date
    Apr 2009
    Posts
    61
    Qt products
    Qt4
    Platforms
    MacOS X
    Thanks
    4

    Default Re: Display Problem

    one , am i correct..

    We can display 24 items in listview..


    please give one sample code

  2. #22
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    4
    Thanked 140 Times in 132 Posts

    Default Re: Display Problem

    okej, use this code, but first remove QStandardItemModel inheritance from mainwindow.h
    Qt Code:
    1. MainWindow::MainWindow(QWidget *parent)
    2. : QMainWindow(parent), ui(new Ui::MainWindowClass)
    3. {
    4. ui->setupUi(this);
    5.  
    6. for (int i = 0; i < 24; ++i)
    7. {
    8. model->appendRow(item);
    9. }
    10.  
    11. ui->listView->setModel(model);
    12.  
    13. for (int i = 0; i < 24; ++i)
    14. {
    15. Tweet * t = new Tweet(this);
    16. t->resize(ui->listView->size().width(), 70);
    17. model->item(i)->setSizeHint(t->size());
    18. ui->listView->setIndexWidget(model->item(i)->index(), t);
    19. }
    20. }
    To copy to clipboard, switch view to plain text mode 

    And now take a one week free from work/school and spend it on learning C++ and reading docs. And try to do something by yourself next time - but not just guessing - just check what those methods, classes and C++ keywords and operators do! It's simple - you can just use Google (www.google.com) to find C++ tutorial (and English Lessons/Dictionaries if you can understand docs - but how you can say that if dont mind even opening single document?)
    Last edited by faldzip; 3rd May 2009 at 14:37.
    I would like to be a "Guru"

    Useful hints (try them before asking):
    1. Use Qt Assistant
    2. Search the forum

    If you haven't found solution yet then create new topic with smart question.

Similar Threads

  1. Replies: 1
    Last Post: 23rd April 2009, 09:05
  2. Replies: 19
    Last Post: 3rd April 2009, 23:17
  3. Replies: 2
    Last Post: 19th November 2008, 09:01
  4. Tricky problem with ARGB widget / UpdateLayeredWindow
    By nooky59 in forum Qt Programming
    Replies: 3
    Last Post: 21st February 2008, 10:35
  5. Model display problem
    By gyre in forum Newbie
    Replies: 3
    Last Post: 31st December 2007, 13:46

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.