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. FileDialog will omit the nameFilter if you switch between select folder and select file
Forum Updated to NodeBB v4.3 + New Features

FileDialog will omit the nameFilter if you switch between select folder and select file

Scheduled Pinned Locked Moved QML and Qt Quick
1 Posts 1 Posters 672 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.
  • S Offline
    S Offline
    stereomatching
    wrote on last edited by
    #1

    OS : win7 64bit
    Qt 5.1.0 for Windows 32-bit (MinGW 4.8, OpenGL, 666 MB)

    @
    import QtQuick 2.1
    import QtQuick.Controls 1.0
    import QtQuick.Dialogs 1.0
    import QtQuick.Layouts 1.0

    ApplicationWindow{
    id: root

    title: "Color Correction"
    
    color: syspal.window
    width: 1450
    height: 750
    minimumHeight: 750
    minimumWidth: 1400
    
    SystemPalette {id: syspal}
    
    ListModel{
        id: fileModel
    }
    
    FileDialog{
        id: fileDialog
        selectMultiple: true
        nameFilters: [ "Image files (*.bmp *.jpg *.JPEG *.png *.ppm *.tiff *.xbm *.xpm)" ]      
    }
    
    ColumnLayout{
        anchors.fill: parent
    
        Button{
            text: "select folder"
    
            MouseArea{
                anchors.fill: parent
    
                onClicked: {
                    fileDialog.selectFolder = true
                    fileDialog.selectMultiple = false
                    fileDialog.open()
                }
            }
        }
    
        Button{
            text: "select images"
    
            MouseArea{
                anchors.fill: parent
    
                onClicked: {
                    fileDialog.selectFolder = false
                    fileDialog.selectMultiple = true
                    fileDialog.open()
                }
            }
        }
    }
    

    }

    @

    After I click the button of select folder, the nameFilters of the FileDialog will not
    function anymore, Anyone know what is happening?

    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