Results 1 to 10 of 10

Thread: QFileDialog failed by ueing Keyboard

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2016
    Posts
    21
    Qt products
    Qt5
    Platforms
    Unix/X11

    Exclamation QFileDialog failed by ueing Keyboard

    Hi

    I'm using QT5 from Ubuntu 16.04 and have troubles when i use the keyboard.
    Qt Version 5.5.1.

    When i select all Buttons or Files with the Mouse it works fine, but when i to the work with the Keyboard and press Enter i got a SIGSEGV
    by using getSaveFileName. getExistingDirectory works fine.


    The inferior stopped because it received a signal from the operating system.
    Signal name : SIGSEGV
    Signal meaning : Segmentation fault

    Qt Code:
    1. void ExportDialog::onExportButton_clicked()
    2. {
    3. QSettings settings(QSettings::IniFormat, QSettings::UserScope, "XX", "XX");
    4. QString lastUsedDirectory = settings.value("lastUsedDirectory", QDir::currentPath()).toString();
    5.  
    6. if (m_saveTodir) {
    7. m_filename = QFileDialog::getExistingDirectory(this, tr("Save to ..."),lastUsedDirectory);
    8. } else {
    9. m_filename = QFileDialog::getSaveFileName(this, tr("save"), lastUsedDirectory, "CSV (*.csv)");
    10. }
    11.  
    12. if (m_filename.isNull())
    13. return;
    14.  
    15. settings.setValue("lastUsedDirectory", m_filename);
    16.  
    17. QDialog::accept();
    18.  
    19. }
    To copy to clipboard, switch view to plain text mode 

    Can you tell me what i'm doing wrong?

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QFileDialog failed by ueing Keyboard

    Your code looks fine.
    Did you have a look at the stack trace of the crash?

    Is your application showing the Qt file dialog or a native one?

    Cheers,
    _

  3. #3
    Join Date
    Feb 2016
    Posts
    21
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: QFileDialog failed by ueing Keyboard

    It's in both case's Native and not Native.

    But i see after new Debug and rewrite the code some times the crash comes after the QDialog::accept()

    It's not the QFileDialog, it's a QMessageBox after the QDialog::accept() in parent Class. Sorry

    I do not see why, but when i do a delete ExportDialog before i call the QMessageBox it seems to work.

    Workflow

    new ExportDialog
    if (ExportDialog ....)
    QMessageBox will send the SIG

    But

    new ExportDialog
    if (ExportDialog ....)
    delete ExportDialog;
    QMessageBox will work.


    Strong but why it work when i walk through the FileDialog with Mouseclicks.

    So the Error is not QFileDialog alone. It's only when i use in parent class a QMessagebox before i delete the Dialog.

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QFileDialog failed by ueing Keyboard

    Very strange.

    Can you provide a compilable minimal example that shows that behavior?

    Cheers,
    _

Similar Threads

  1. APK Build Failed
    By Mathan in forum Qt Programming
    Replies: 0
    Last Post: 1st August 2016, 12:39
  2. failed to crosscompiling with qt 4.8
    By bkroy in forum Qt Programming
    Replies: 1
    Last Post: 5th January 2016, 22:56
  3. Build failed
    By anh5kor in forum Newbie
    Replies: 1
    Last Post: 25th March 2015, 14:33
  4. How to implement visual keyboard in a QFileDialog
    By johnson604 in forum Qt Programming
    Replies: 2
    Last Post: 22nd November 2014, 20:22
  5. Replies: 7
    Last Post: 5th March 2014, 17:36

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.