Results 1 to 6 of 6

Thread: Synchronize a list and a viewer

  1. #1
    Join Date
    Jun 2010
    Posts
    142
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    11
    Thanked 4 Times in 3 Posts

    Default Synchronize a list and a viewer

    I have a QStandardItemModel full of filenames, and a file viewer widget. How do I synchronize the currently viewed file with the list's current item?

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

    Default Re: Synchronize a list and a viewer

    With signal and slots.

  3. #3
    Join Date
    Jun 2010
    Posts
    142
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    11
    Thanked 4 Times in 3 Posts

    Default Re: Synchronize a list and a viewer

    I tried doing it with the currentChanged() signal, but it's not emitted when the list is cleared or when it's not in focus.

  4. #4
    Join Date
    Sep 2010
    Location
    Poland
    Posts
    112
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Maemo/MeeGo
    Thanks
    8
    Thanked 3 Times in 3 Posts

    Default Re: Synchronize a list and a viewer

    Quote Originally Posted by MTK358 View Post
    .... file viewer widget....
    which is ?
    I am asking because I once used QTreeWidget and it's signal
    Qt Code:
    1. itemSelectionChanged()
    To copy to clipboard, switch view to plain text mode 
    and I had no problems both when selection was changed with mouse or key... though I can't really check if it would work in your case

    nevertheless You can try it out
    My schedule makes my cry
    My works makes my laugh
    My life makes... oh...no....

  5. #5
    Join Date
    Jun 2010
    Posts
    142
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    11
    Thanked 4 Times in 3 Posts

    Default Re: Synchronize a list and a viewer

    Quote Originally Posted by kornicameister View Post
    I had no problems both when selection was changed with mouse or key...
    Items will be added, removed, and cleared without the list being in focus.

  6. #6
    Join Date
    Sep 2010
    Location
    Poland
    Posts
    112
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Maemo/MeeGo
    Thanks
    8
    Thanked 3 Times in 3 Posts

    Default Re: Synchronize a list and a viewer

    to be honest I can not say a word about removing or clearing the list of items because I had to abandon writing it due to other more important project I am working on right now

    If I find some time, I will go for it to check it out
    My schedule makes my cry
    My works makes my laugh
    My life makes... oh...no....

Similar Threads

  1. Synchronize with Editor
    By dwarnold45 in forum Newbie
    Replies: 0
    Last Post: 31st March 2010, 04:40
  2. Replies: 12
    Last Post: 6th October 2009, 10:27
  3. synchronize threads
    By weixj2003ld in forum Qt Programming
    Replies: 3
    Last Post: 10th April 2009, 07:08
  4. Can we synchronize QMovie and QSound
    By learning_qt in forum Qt Programming
    Replies: 3
    Last Post: 8th September 2008, 08:57
  5. synchronize two QSplitters
    By sreedhar in forum Qt Programming
    Replies: 1
    Last Post: 22nd February 2007, 17:14

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.