Results 1 to 11 of 11

Thread: QT QListView (as icons)

  1. #1
    Join Date
    Nov 2008
    Posts
    17
    Qt products
    Qt4
    Platforms
    Windows

    Default QT QListView (as icons)

    Hello all,
    I'm web developer and also I used to write C++ code, Now I need to do a project for document clustering by using QT. I don't have experience with Qt , I read much and still have more than much to read, but because of the time, and I have to deliver this project for my university I need some help.

    I'm sure that all the people here have more experience in QT than me , and maybe not only in QT

    What I'm trying to do now is the interface.
    I want to create QT QListView (as icons) but I did not find examples or tutorials to do this,
    The image attached show what I want to do , so please if you have idea or which part of QT help I need to read tell me.

    I just want the direction to do it , so tell me what should I read because really QT is sea .. and I don't want to be lost

    Thanks a lot
    Attached Images Attached Images

  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: QT QListView (as icons)

    look at this property QListView::viewMode.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  3. #3
    Join Date
    Nov 2008
    Posts
    17
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QT QListView (as icons)

    Hi spirit, thanks for your fast response,

    yes I already found the Property for switch mode.. now I'm trying to add Item for that list..

    How to add Item ? can you give me example ?

    Thanks

  4. #4
    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: QT QListView (as icons)

    you can use list-model, see QStringListModel or QStandardItemModel then set this model to view using setModel method of view. anyway, I suggest you to read Model view programming for more information.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  5. #5
    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: QT QListView (as icons)

    If you need something simple or do not feel proficient enough to use complex solutions, use QListWidget instead of QListView.

  6. #6
    Join Date
    Nov 2008
    Posts
    17
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QT QListView (as icons)

    thanks guys I go to model / view , its nice but its need long time to learn so i used QListWidget as wysota said, its much much easier.

    Now for that QListWidgetI want to create pop-up menu , so when someone click right click he can get the list to add items, so I go thought QMenubut I did not understand it in the right way... So anyone can gives me some hints ?
    I search in the examples but I'm confused because the menu examples handle all type of menu so I did not understand where is the code that responsible for creating the Pop-up menu , can someone give me small example .... Thanks

    Sorry guys , I'm really new

  7. #7
    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: QT QListView (as icons)

    look at this post context menu.
    Last edited by wysota; 2nd January 2009 at 19:56.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  8. #8
    Join Date
    Nov 2008
    Posts
    17
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QT QListView (as icons)

    spirit, Thanks man its work 100%, let me continue working in the project and see where i will get stuck lol, I really want to learn this QT but i think its need time, The logic of programming in my head is right, even sometimes I do guessing and its work but I need to practice more... I just start QT from 1 month a go and most of time busy in my work as web developer....

    Please spirit , how long you have been programming with QT ?

    Thanks again

  9. #9
    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: QT QListView (as icons)

    Quote Originally Posted by Majdi View Post
    spirit, Thanks man its work 100%, let me continue working in the project and see where i will get stuck lol, I really want to learn this QT but i think its need time, The logic of programming in my head is right, even sometimes I do guessing and its work but I need to practice more... I just start QT from 1 month a go and most of time busy in my work as web developer....

    Please spirit , how long you have been programming with QT ?

    Thanks again
    4 years
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  10. #10
    Join Date
    Nov 2008
    Posts
    17
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QT QListView (as icons)

    so its normal I keep ask questions heheh

    I'm stuck here , I want to delay the execution of the program in the main.cpp file
    Qt Code:
    1. #include<QTestEventList >
    2. ....
    3. events.addDelay(200);
    4.  
    5. QLineEdit *lineEdit = new QLineEdit(myParent);
    6.  
    7. events.simulate(lineEdit);
    To copy to clipboard, switch view to plain text mode 
    but did not work .
    also i use this

    Qt Code:
    1. #include <QTest>
    2. ...
    3. QTest *wait=new QTest();
    4. wait->qWait(250);
    To copy to clipboard, switch view to plain text mode 

    but also did not work .... ! how to do it ?... thanks

  11. #11
    Join Date
    Mar 2010
    Location
    Volcano, Big Island, Hawaii
    Posts
    10
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QT QListView (as icons)

    Try:
    QTest::qWait(250);

Similar Threads

  1. QListView with icons on top of the text, not at the left
    By vfernandez in forum Qt Programming
    Replies: 7
    Last Post: 19th February 2009, 04:19
  2. no icons on the another machine (after installation)
    By roxton in forum Installation and Deployment
    Replies: 2
    Last Post: 4th July 2008, 17:24
  3. QListView word wrap
    By serega in forum Qt Programming
    Replies: 17
    Last Post: 30th August 2007, 03:13
  4. Subclass QListView to show two colums in one
    By Mookie in forum Qt Programming
    Replies: 2
    Last Post: 23rd June 2007, 02:12
  5. QIcon Icons are not visible
    By harakiri in forum Qt Programming
    Replies: 1
    Last Post: 6th May 2007, 19:11

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.