Results 1 to 10 of 10

Thread: Problem with list View

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

    Default Problem with list View

    Hi

    I am facing problem with list view.....

    i added the one cloumn in my listview

    My code is
    Qt Code:
    1. QListView *view;
    2. view->addColumn("names");
    To copy to clipboard, switch view to plain text mode 

    But i am gettin error like :: error: 'class QListView' has no member named 'addColumn'



    please suggest me to solve this issue

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Problem with list View

    QListView has not such method, moreover it has not a header.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

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

    Default Re: Problem with list View

    Hi

    Thanks for your reply .....


    What i did know....

    just i dragged the listview and tried to add colums


    code

    ui->listView->addColums("name");



    This one giving problems

  4. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Problem with list View

    Seriously, have you problems reading and understanding English or are you just ignorant? What of the following do you not understand?
    Quote Originally Posted by spirit View Post
    QListView has not such method
    And by the way, may I ask you how long do you dealing with c++ and documentation reading?

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

    Default Re: Problem with list View

    Sorry,


    For my previous post......


    I corrected myself...

    I am a beginner.... I have been learning Qt...


    My Exact problem is adding the frame to Listview....

    Here i followed some code
    Qt Code:
    1. Tweet *tweet;
    2. ui->setupUi(this);
    3. ui->listView->setIndexWidget(item->index(), tweet );
    To copy to clipboard, switch view to plain text mode 

    Here Tweet is my frame .

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

    Default Re: Problem with list View

    Quote Originally Posted by yuvaraj.yadav View Post
    I am a beginner.... I have been learning Qt...
    Please post in the newbie section of the forum then. You'll get more patience from people there.


    My Exact problem is adding the frame to Listview....

    Here i followed some code
    Qt Code:
    1. Tweet *tweet;
    2. ui->setupUi(this);
    3. ui->listView->setIndexWidget(item->index(), tweet );
    To copy to clipboard, switch view to plain text mode 

    Here Tweet is my frame .
    What does this code have to do with adding columns? Please use QListWidget or better yet QScrollArea instead of QListView if you didn't intend to use a model with it.

    Now please click on each link in this post and read the documentation behind them carefully to understand differences between these widgets.
    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.


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

    Default Re: Problem with list View

    Thanks for your reply....


    My next thread onwards i will post in nebie forum...


    I used QlistWidget....

    still struggling with frame issue

    To display frame with in list widget is used like this

    listWidget->setIndexWidget(currentIndex,new QFrame);

    But In output i didn't get the frame ,even i tried with Qlabel also

    listWidget->setIndexWidget(currentIndex,new QLabel(tr("yuvaraj"));

    It is not diplay the label also

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

    Default Re: Problem with list View

    How many rows does your list widget have? Just please don't guess nor assume but rather check it out by calling the appropriate method from the widget's API.
    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.


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

    Default Re: Problem with list View

    Hi wysota..

    Don't mistake me

    Really I am struggling with frame issue.....


    please suggest me or provide sample code to add frame inside of listview.

    for my code to add the frame...

    ui->listview ->setIndexWidget(item(0)->index(), tweet)...


    I didn't get the frame(tweet) in listview.....

    Whats wrong with me

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

    Default Re: Problem with list View

    Quote Originally Posted by yuvaraj.yadav View Post
    Whats wrong with me
    Well... if you really want to know...

    1. You didn't go through any tutorials before taking on a "real programming"
    2. You didn't master C++ in a decent way before taking on Qt
    3. You didn't answer my question.
    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.


Similar Threads

  1. Scene vs. multiple views
    By lni in forum Qt Programming
    Replies: 16
    Last Post: 19th July 2022, 01:47
  2. QTableWidget view problem
    By zgulser in forum Qt Tools
    Replies: 6
    Last Post: 5th March 2009, 06:50
  3. View update problem
    By prakash in forum Qt Programming
    Replies: 6
    Last Post: 17th March 2006, 10:13
  4. Replies: 16
    Last Post: 7th March 2006, 15:57
  5. Problem using QValueList
    By yellowmat in forum Newbie
    Replies: 2
    Last Post: 7th February 2006, 20:01

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.