Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QCompleter
Qt 6.12 LTS is out! See what's new in the release blog

QCompleter

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 839 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.
  • G Offline
    G Offline
    GrahamL
    wrote on last edited by
    #1

    Hi
    I am trying to get QCompleter to behave as follows -
    complete folder names but only show files with a given extension
    So for example

    C:\ - user sees all folders under C
    C:\my - user sees all folders that match
    C:\myFolder\a - user sees all folders that match + any files that match a*.myext

    I have played with the various options in QDirModel and QFileSystemModel but cannot find the correct combination.

    Is this possible with QCompleter as it is or do I need to derive from it to get some extra functionality?

    Thanks

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      Because of the strange requirement that "C:\my" only lists matching folders and "C:\myFolder\a" matches both files and folders, I suspect you will have to derive a class from QFileSystemModel and implement your own match().

      Why shouldn't "C:\my" list matching files and folders?

      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
      • Unsolved