Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to set focus to file list box in QFileDialog
Forum Updated to NodeBB v4.3 + New Features

How to set focus to file list box in QFileDialog

Scheduled Pinned Locked Moved QML and Qt Quick
6 Posts 4 Posters 5.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mliu
    wrote on last edited by
    #1

    I only have six keys (up,down,left,right,Esc,Enter) in my app, there is no mouse. Now I need to open QFileDialog, use keys to select the file I want to open, so I have to set focus to file list box first after I open QFileDialog, but I have no idea to set focus in QFileDialog. Any help, please. Thanks a lot.

    1 Reply Last reply
    0
    • K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      "setFocus":http://doc.qt.nokia.com/4.7/qwidget.html#setFocus-2 can be used with QFileDialog. Or do you have to navigate from another widget to your file dialog using these 6 keys?

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0
      • D Offline
        D Offline
        dangelog
        wrote on last edited by
        #3

        Are you really sure you want to use QFileDialog and not a custom build file selection dialog?

        Software Engineer
        KDAB (UK) Ltd., a KDAB Group company

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mliu
          wrote on last edited by
          #4

          I know setFocus can be used with QFileDialog, but focus is just in file name box, can't be moved to file list box. I try to build file selection dialog, but how to get all files name under specific directory? Thank you.

          1 Reply Last reply
          0
          • A Offline
            A Offline
            andre
            wrote on last edited by
            #5

            QFileSystemModel is a good place to start; you can combine it with any of the Qt item views.

            1 Reply Last reply
            0
            • M Offline
              M Offline
              mliu
              wrote on last edited by
              #6

              Thanks. I'll try it.

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved