Results 1 to 4 of 4

Thread: Howto create custom File Browser view

  1. #1
    Join Date
    Feb 2013
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Howto create custom File Browser view

    Hello,
    I am new to Qt and would like to ask your help in implement the following features:

    A file browser that accepts comments and tags about the file(s) that are being displayed. Double clicking on the entry should open the file (which can be assumed to be text only) for editing via an inbuilt editor.


    P.S: I just started programming in QT a few hours ago and am fairly new to python programming too.


    Regards,
    f1ns

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    4,943
    Thanks
    276
    Thanked 804 Times in 793 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: Howto create custom File Browser view

    A file browser that accepts comments and tags about the file(s) that are being displayed.
    What do you mean by this? That the user can select a file, and then somehow add comments or tags? Or the file already has comments and tags (that were added somehow by another means) and you want to display those when the user selects (and hovers) on the file name?

    P.S: I just started programming in QT a few hours ago
    And you are already trying to implement a custom file browser? I guess you don't believe in learning to walk before you start out running at full speed.

  3. #3
    Join Date
    Feb 2013
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Howto create custom File Browser view

    Quote Originally Posted by d_stranz View Post
    What do you mean by this? That the user can select a file, and then somehow add comments or tags?
    Yes
    Quote Originally Posted by d_stranz View Post
    Or the file already has comments and tags (that were added somehow by another means) and you want to display those when the user selects (and hovers) on the file name?
    A user can add comments and tags to a file using my interface and that can be used when searching for files (using just my app). There is a another separate interface for deleting already existing tags/comments.

    Quote Originally Posted by d_stranz View Post
    And you are already trying to implement a custom file browser? I guess you don't believe in learning to walk before you start out running at full speed.
    No, i am trying to fight for QT. AFAIK things like this are easier to do in HTML xD.

  4. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    4,943
    Thanks
    276
    Thanked 804 Times in 793 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: Howto create custom File Browser view

    I presume you understand that you need some external mechanism for associating the comments and other attributes with the files, like a database or some other local file created in the directory that will hold this extra information. I don't believe there is a generic (i.e OS-independent) way to do this.

    I would start by looking at the signals emitted by QFileDialog, especially currentChanged() and directoryEntered(). currentChanged() is the handle you need to tell you which file the user has clicked on. In a slot that handles this, you might create a tooltip that displays the current information, or a right-click "properties" menu that posts a new dialog to allow the user to add or edit comments and tags. In the slot that handles directoryEntered(), you know where you are in the file system and can look up cached information for that directory.

    QFileDialog is of course used for file selection, but the code contains all the functions needed for traversing the file system and notifying the app about what the user is up to. You could use it as the basis for a custom browser.

Similar Threads

  1. Replies: 1
    Last Post: 15th August 2012, 18:00
  2. Howto create custom slot with Designer
    By gkhrapunovich in forum Qt Tools
    Replies: 6
    Last Post: 27th January 2011, 16:31
  3. Replies: 1
    Last Post: 26th November 2010, 08:22
  4. Custom file browser - grouping files
    By chezifresh in forum Qt Programming
    Replies: 3
    Last Post: 21st September 2009, 03:05
  5. Example HowTo create custom view
    By dexjam in forum Newbie
    Replies: 6
    Last Post: 12th July 2006, 11:06

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.