Results 1 to 4 of 4

Thread: problem while dropping into QTableView

  1. #1
    Join Date
    Feb 2008
    Posts
    60
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default problem while dropping into QTableView

    Dear all,

    I am using QTableView+QDirModel for displaying local file system files and folders.

    at first, it is showing all Drives using "model->setRootIndex("/");".

    If a row in the table is double clicked, I am displaying clicked folder contents. again I am using
    "setRootIndex(clicked path)" method.

    I have enabled Drag and Drop for this View and also reimplemented Drag and Drop related functions in the MyDirModel class. In the same way flags function is also reimplemented by returning the below flags.
    return Qt::ItemIsEnabled | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled;
    My problem is,
    This view is accepting drops only if the "/" contents were in display.
    it is not accepting drops when all other path's contents were displayed.

    Please any one help me.

    Thanks.

  2. #2
    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 while dropping into QTableView

    Could you provide a minimal compilable example reproducing the problem?

  3. #3
    Join Date
    Feb 2008
    Posts
    60
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: problem while dropping into QTableView

    Dear wysota,

    I have attached a Zip file contains 4 files.

    I am using
    Qt 4.4.0 in windows.

    Thanks you.
    Attached Files Attached Files

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: problem while dropping into QTableView

    For QDirModel, it is enough to setReadOnly(false) to enable drag and drop functionality. See [WIKI]Extended Dir View example[/WIKI] for more details.
    J-P Nurmi

Similar Threads

  1. Problem with QTableView
    By BoneCollector in forum Qt Programming
    Replies: 5
    Last Post: 12th March 2008, 12:30
  2. Slow problem QTableView
    By skuda in forum Qt Programming
    Replies: 6
    Last Post: 26th February 2008, 12:19
  3. problem in printing QTableView
    By miguel_mark in forum Qt Programming
    Replies: 2
    Last Post: 6th February 2008, 08:19
  4. Problem: QThead and QTableview
    By ederbs in forum Qt Programming
    Replies: 5
    Last Post: 9th November 2007, 10:17
  5. QTableView Performance Problem on Windows
    By umitoz in forum Qt Programming
    Replies: 1
    Last Post: 31st August 2007, 16:47

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.