Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. qfiledialog
    Log in to post

    • SOLVED Return empty getExistingDirectory for Android SDK >= 30
      Mobile and Embedded • qfiledialog android 11 file management • • Kafabih  

      4
      0
      Votes
      4
      Posts
      79
      Views

      In the bug report you write that "have to edit what I reported here before is wrong method. So the right method is getOpenFileNames. I am apologized." Of course, you should have updated your post here. More often than not, a problem is not in the API, but new conditions (such as new OS version) that expose a problem in how you use it. And you don't tell anything about it.
    • SOLVED How to get overwrite result from QFileDialog
      General and Desktop • qfiledialog • • djsuson  

      6
      0
      Votes
      6
      Posts
      167
      Views

      Hi, Just a recommendation: you should put a note in your code about that requirement otherwise there will likely be someone in the future (yourself included) that will wonder why there's that ! char there.
    • UNSOLVED QFileDialog & favorites/customisation
      General and Desktop • qfiledialog • • Dariusz  

      2
      0
      Votes
      2
      Posts
      128
      Views

      Hi, there is https://doc.qt.io/qt-5/qfiledialog.html#setSidebarUrls, is that what you want?
    • SOLVED Absurd QT File Handling Issue(QFile)
      C++ Gurus • qt5.6 c++ qt qfile qfiledialog file read • • Sabhya Sood  

      11
      0
      Votes
      11
      Posts
      916
      Views

      @JonB Thanks for your insight. I did as you suggested and found one of my local variable's address a nullptr(though not sure where it came from). I changed a few lines of code and apparently, my code works fine now. @Christian-Ehrlicher @J-Hilk thanks!
    • UNSOLVED How to show the fileDialog window on top of all windows
      General and Desktop • qfiledialog • • ChiaoHuang  

      2
      0
      Votes
      2
      Posts
      172
      Views

      I don't know. You need to set the dialog to be "ApplicationModal" or set "modal" property: https://doc.qt.io/qt-5/qdialog.html#modal-prop
    • UNSOLVED QFileDialog > look In as editable entry
      General and Desktop • qfiledialog • • Dariusz  

      11
      0
      Votes
      11
      Posts
      488
      Views

      @mrjj I read it from the qt source code. I always do that when I want to cheat by using findChild / findChildren, to make sure I can find the right object.
    • UNSOLVED How to save a text file directly without using QfileDialog box?
      General and Desktop • c++ qt 5.4 qtextedit qfiledialog • • Mr-Workalot  

      4
      0
      Votes
      4
      Posts
      248
      Views

      @Mr-Workalot But what location do you need? Where do you want to store the file? It is really not clear from your description. Did you check the link I provided: https://doc.qt.io/qt-5/qstandardpaths.html ? Example: to store in Documents folder call https://doc.qt.io/qt-5/qstandardpaths.html#writableLocation with QStandardPaths::DocumentsLocation as parameter
    • UNSOLVED QFileDialog is not scaled the same way as the QApplicaiton with high DPI monitor
      General and Desktop • qfiledialog highdpi qt5.14 • • johnyang  

      5
      0
      Votes
      5
      Posts
      476
      Views

      @jsulm Looks like that is the only way to get the scaled widget correctly. Thanks!
    • SOLVED QfileDialog::Getopenfilename does not open the second time and after
      General and Desktop • qimage qpixmap qfiledialog • • aramaz  

      3
      0
      Votes
      3
      Posts
      329
      Views

      @Bonnie said in QfileDialog::Getopenfilename does not open the second time and after: Remove that static. Static local variables Variables declared at block scope with the specifier static or thread_local (since C++11) have static or thread (since C++11) storage duration but are initialized the first time control passes through their declaration (unless their initialization is zero- or constant-initialization, which can be performed before the block is first entered). On all further calls, the declaration is skipped. So with the static keyword, getOpenFileName will only be called at the first time. Thanks! I just realized that I should not have copy pasted that line of code without looking at it closer. Cheers.
    • UNSOLVED File Browser with context menu to unzip files
      General and Desktop • qtreeview qfiledialog qfilesystemmode • • mahesh_j  

      7
      0
      Votes
      7
      Posts
      701
      Views

      @mahesh_j said in File Browser with context menu to unzip files: But I don't know what actions to add to the QMenu The actions you need. You have to create such a pop-up menu. Take a look at http://quazip.sourceforge.net/
    • UNSOLVED Weird behaviour with QFileDialog::getExistingDirectory
      General and Desktop • c++ qfiledialog • • FrankE  

      3
      0
      Votes
      3
      Posts
      416
      Views

      Hi, One base rule: all GUI manipulation must be done in the main thread (well the one that started the QApplication event loop).
    • UNSOLVED Get children of QFileDialog derived class
      General and Desktop • qfiledialog • • GrahamLa  

      3
      0
      Votes
      3
      Posts
      434
      Views

      @GrahamLa Where and when do you call func()?
    • UNSOLVED Checking run time characteristics for QFileDialog::getOpenFileName()
      General and Desktop • qfiledialog file management responsiveness getopenfilename run time • • elfring  

      16
      0
      Votes
      16
      Posts
      1861
      Views

      you are looking at the strace output in real time Not really. - I would start such program tracing only after a personal delay to notice that data processing for the function “QFileDialog::getOpenFileName” might take longer than what I would usually expect. (I might be more patient under other circumstances.) what you would see is the last line of output would "hang" This did not happen. The dialogue software might be still busy with other stuff. Additional activities might distract then from temporary technical difficulties. just as you went into a "delay", and that would be your indication as to why.... I found questionable software behaviour also for other components in the suggested way so that corresponding clarification requests and bug reports were published.
    • UNSOLVED Version 5.10.1 windows mingw32 release question about the Class QFileDialog
      General and Desktop • qfiledialog • • Hcf134  

      5
      0
      Votes
      5
      Posts
      570
      Views

      @Hcf134 Maybe you should first call dialog.setMimeTypeFilters(mimeTypeFilters); and then dialog.selectMimeTypeFilter(selecttype);
    • UNSOLVED Want a QFileDialog that displays only executable files, but QDir::Filter values are used differently by QFileDialog than by QDir::entryInfoList(..)
      General and Desktop • linux qfiledialog qdir filters • • mbrochmann  

      3
      0
      Votes
      3
      Posts
      749
      Views

      I am using Qt 5.10.1, on CentOS 7
    • UNSOLVED How to save Multiple File in
      General and Desktop • qfile qfiledialog qt 5.6 • • Yash001  

      3
      0
      Votes
      3
      Posts
      1027
      Views

      @SGaist Thank you for answer. From your suggestion, I need to create my own Dialog box.
    • UNSOLVED A couple of problems with QFileDialog
      General and Desktop • qfiledialog • • Psychotron  

      8
      0
      Votes
      8
      Posts
      4709
      Views

      @SGaist void DisplayDlg::on_pushButtonLoad_clicked() { QString fileName = QFileDialog::getOpenFileName(Q_NULLPTR, tr("Open Overlay"), "", "XML (*.xml)"); //This line crashes sometimes. Haven't seen it crash if I add option DontUseNativeDialog. ... } mfc140d.dll!000007fec6f97e0c() Unknown mfc140d.dll!000007fec6f5342c() Unknown mfc140d.dll!000007fec6f52832() Unknown user32.dll!0000000076ed9bdd() Unknown user32.dll!0000000076ee6189() Unknown user32.dll!0000000076ee4ea7() Unknown user32.dll!0000000076ee4f36() Unknown user32.dll!0000000076ee4f6c() Unknown comdlg32.dll!000007feff1628e8() Unknown qwindowsd.dll!000007fec494e5d1() Unknown qwindowsd.dll!000007fec495b823() Unknown qwindowsd.dll!000007fec495b7a5() Unknown Qt5Widgetsd.dll!00000000650ca1d2() Unknown Qt5Widgetsd.dll!0000000065048a8e() Unknown Qt5Widgetsd.dll!0000000065048920() Unknown MYDLL.dll!DisplayDlg::on_pushButtonLoad_clicked() Line 683 C++ MYDLL.dll!DisplayDlg::qt_static_metacall(QObject * _o, QMetaObject::Call _c, int _id, void * * _a) Line 128 C++ MYDLL.dll!DisplayDlg::qt_metacall(QMetaObject::Call _c, int _id, void * * _a) Line 184 C++ Qt5Cored.dll!000000006715df44() Unknown Qt5Cored.dll!00000000671a5e04() Unknown Qt5Cored.dll!00000000671a5488() Unknown Qt5Widgetsd.dll!0000000064fe877d() Unknown Qt5Widgetsd.dll!0000000064fea8b4() Unknown Qt5Widgetsd.dll!0000000064fe9977() Unknown Qt5Widgetsd.dll!0000000064fe8f37() Unknown Qt5Widgetsd.dll!0000000064cd695d() Unknown Qt5Widgetsd.dll!0000000064fe89cb() Unknown Qt5Widgetsd.dll!0000000065006011() Unknown Qt5Widgetsd.dll!0000000064c76f3e() Unknown Qt5Widgetsd.dll!0000000064c7217c() Unknown Qt5Cored.dll!000000006714f666() Unknown Qt5Cored.dll!00000000672b5cbb() Unknown Qt5Widgetsd.dll!0000000064c79633() Unknown Qt5Widgetsd.dll!0000000064d20e37() Unknown Qt5Widgetsd.dll!0000000064d1f60a() Unknown Qt5Widgetsd.dll!0000000064c76f3e() Unknown Qt5Widgetsd.dll!0000000064c71973() Unknown Qt5Cored.dll!000000006714f666() Unknown Qt5Cored.dll!00000000672b5cbb() Unknown Qt5Guid.dll!000007fedd97c19a() Unknown Qt5Guid.dll!000007fedd97ed13() Unknown Qt5Guid.dll!000007fedd939a45() Unknown qwindowsd.dll!000007fec499fe82() Unknown Qt5Cored.dll!000000006720ad0d() Unknown [External Code] MYAPP.exe!WinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, char * lpCmdLine, int nCmdShow) Line 26 C++ [External Code]
    • UNSOLVED File modes of QFileDialog
      General and Desktop • qfiledialog • • ssmo3  

      2
      0
      Votes
      2
      Posts
      801
      Views

      Hi and welcome to devnet, IIRC, you can select one or the other but not both at the same time.
    • SOLVED Windows directory
      General and Desktop • qfiledialog getopenfilename • • Armin  

      2
      0
      Votes
      2
      Posts
      711
      Views

      @Armin You can use the static member function getOpenFileName
    • UNSOLVED QFileDialogの自動化について
      Japanese • qfiledialog gui automation qtest findchild selectfile • • Takeshi  

      1
      0
      Votes
      1
      Posts
      1386
      Views

      No one has replied

    • UNSOLVED Force Filename in Save File Dialog
      General and Desktop • qfiledialog save filebrowser fixed name • • oblivioncth  

      5
      0
      Votes
      5
      Posts
      2667
      Views

      @Rondog @alex_malyu I see that this is not as simple as I had hoped and I guess I will just deal with using a directory browse or letting the user set the name. The reason i have the user interacting with an .ini is because it is not just global program settings that are loaded. I want the user to have multiple configurations that they can easily switch between that have file paths and numeric settings saved so that the program can be used easily in rapid succession. The GUI is a port of a console application that is not yet finished so I want debugging with it to be quick. This is why I have the ability to save and load a .ini file so that if a user keeps testing with the same paths over and over they don't need to keep browsing for the same files over and over again. However, I wanted there to be the ability to have multiple setups saved which is why I don't just want there to be one .ini that is used automatically. I know I could use some kind of slot system with the same .ini (like saves lots on a video game) to accomplish the same thing and the user just picks one of those slots. But like I said the application is not finished yet (the code behind the GUI) so it being perfectly clean is not an issue at the moment. Thank you for the information.
    • SOLVED Change Behavior of Double Click for QFileDialog
      General and Desktop • c++ qt4 qfiledialog qevent doubleclick • • DougyDrumz  

      2
      0
      Votes
      2
      Posts
      1339
      Views

      I figured it out. You can't call the connect statement for the doubleClick signal until the QListView is in scope.
    • SOLVED QFileDialog: block access to folders or drives on Windows
      General and Desktop • windows qfiledialog • • the_  

      13
      0
      Votes
      13
      Posts
      5693
      Views

      @Devopia53 This did it with Windows. Thanks
    • UNSOLVED QFileDialog: choose directories only but show files as well
      General and Desktop • qfiledialog qdir • • michelson  

      13
      0
      Votes
      13
      Posts
      21172
      Views

      I've tested on windows. It seems the only possible solution is to ignore native dialog. QFileDialog dialog; dialog.setFileMode(QFileDialog::DirectoryOnly); dialog.setOption(QFileDialog::DontUseNativeDialog, true); dialog.setOption(QFileDialog::ShowDirsOnly, false); dialog.exec(); qDebug() << dialog.directory();
    • SOLVED Clear File Selection in a QFileDialog
      General and Desktop • qfiledialog • • DougyDrumz  

      11
      0
      Votes
      11
      Posts
      4099
      Views

      Thanks! That did the trick. However, I had to delete each instance by hand, instead if using Qt::WA_DeleteOnClose, because I was referencing data from the dialog after it was closed.
    • QFileDialog::getOpenFileName linux doesn't work
      General and Desktop • linux qfiledialog • • bejard  

      6
      0
      Votes
      6
      Posts
      3704
      Views

      Instead of editing the moc file you can just rebuild you project completely (you can delete the build folder before you rebuild).
    • SOLVED Non-Traverseable QFileDialog
      General and Desktop • qfiledialog • • DougyDrumz  

      11
      0
      Votes
      11
      Posts
      4022
      Views

      I got it all working. I modified ololoepepe's class (http://stackoverflow.com/questions/12169878/limit-directory-traversal-in-qfiledialog) a bit for my pourposes and set the double click interval to 0 (essentially disabling double clicks). Thanks again.
    • UNSOLVED QFileDialog
      General and Desktop • qfiledialog • • GrahamL  

      3
      0
      Votes
      3
      Posts
      1013
      Views

      One approach we used was to use the directoryEntered signal from the QFileDialog along with a custom proxy filter to handle it. The proxy contained a member variable for the last known good folder. Example code: void MyProxyModel::DirectoryEntered( const QString& Dir ) { QDir CurrentDir( Dir ); // If directory has no contents, reject the change. The isReadable() property is not reliable for some reason, as // it permits "opening" directories that the user has no permissions for (the result is no entries in the dialog). if( CurrentDir.entryList().size() == 0 ) { CurrentDir = m_LastGoodDir; m_pFileDialog->setDirectory( CurrentDir ); } m_LastGoodDir = CurrentDir; }
    • How to customize a QFileDialog with checkboxes
      General and Desktop • qfiledialog checkbox customize • • bereid  

      1
      0
      Votes
      1
      Posts
      1113
      Views

      No one has replied

    • QFileDialog objects appear behind main window when called for the second time onwards on Unity in Ubuntu 14.04
      General and Desktop • ubuntu 14.04 qfiledialog unity • • kzarog  

      3
      0
      Votes
      3
      Posts
      1134
      Views

      @Eyeless really sorry for the late reply! Just realised you have replied to me. After some testing I have solidified the conclusion that it is not a Qt problem, as was expected. As such, there is no reason to post my trivial dialog code. I am writing this for posterity's sake. This issue is caused due to the focus stealing prevention mechanism by Unity. The user could change Unity's default behaviour by issuing in a terminal the command: dconf write /org/compiz/profiles/unity/plugins/core/focus-prevention-level 0 This will allow for the consequent dialogs to appear in front of their parents, as expected.
    • QFileDialog problem [SOLVED]
      General and Desktop • qwidget error qfiledialog not rendering • • annettaws  

      4
      0
      Votes
      4
      Posts
      2790
      Views

      Solved!! The problem was the paintEvent on the Qwidget CVWidget always running when I open an image. I suppose that it contrast the paintEvent of the QFileDialog with an incorrenct visualitazion.
    • [SOLVED] malloc fails after calling getOpenFileNames() with native file dialog
      General and Desktop • windows qt5.5 qfiledialog • • stefanq  

      8
      0
      Votes
      8
      Posts
      2662
      Views

      @stefanq Super. Thank you for the feedback. Was not sure the linker flag would work with mingw. That is one mother of a texture :) Good luck
    • QFileDialog - stopping it updating (i.e. enabling) its own button
      General and Desktop • qfiledialog • • Moschops  

      1
      0
      Votes
      1
      Posts
      535
      Views

      No one has replied

    • QFileDialog but disallow changing directory?
      General and Desktop • qfiledialog directory filters • • pmh4514  

      1
      0
      Votes
      1
      Posts
      520
      Views

      No one has replied

    • Select file OR directory?
      General and Desktop • qfiledialog • • Moschops  

      9
      0
      Votes
      9
      Posts
      3762
      Views

      I forgot to double check but indeed it looks like that's the case