Qt: QFileDialog

Created on 21 May 2018  路  1Comment  路  Source: therecipe/qt

Please give an example of using QFileDialog

Most helpful comment

Hey

Here is a very basic example:

package main

import (
    "fmt"
    "os"

    "github.com/therecipe/qt/widgets"
)

func main() {

    widgets.NewQApplication(len(os.Args), os.Args)

    //using the class
    fd := widgets.NewQFileDialog(nil, 0)
    fd.SetFileMode(widgets.QFileDialog__ExistingFiles)
    fd.ConnectFilesSelected(func(files []string) {
        fmt.Println(files)
    })
    fd.Exec()

    //using the static function
    fmt.Println(widgets.QFileDialog_GetOpenFileNames(nil, "some caption", "", "", "", 0))

    widgets.QApplication_Exec()
}

>All comments

Hey

Here is a very basic example:

package main

import (
    "fmt"
    "os"

    "github.com/therecipe/qt/widgets"
)

func main() {

    widgets.NewQApplication(len(os.Args), os.Args)

    //using the class
    fd := widgets.NewQFileDialog(nil, 0)
    fd.SetFileMode(widgets.QFileDialog__ExistingFiles)
    fd.ConnectFilesSelected(func(files []string) {
        fmt.Println(files)
    })
    fd.Exec()

    //using the static function
    fmt.Println(widgets.QFileDialog_GetOpenFileNames(nil, "some caption", "", "", "", 0))

    widgets.QApplication_Exec()
}
Was this page helpful?
0 / 5 - 0 ratings

Related issues

StarAurryon picture StarAurryon  路  5Comments

joeblew99 picture joeblew99  路  7Comments

quantonganh picture quantonganh  路  6Comments

mathieujobin picture mathieujobin  路  4Comments

adneg picture adneg  路  6Comments