Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QFileDialog corrupted! QT bug?
Forum Updated to NodeBB v4.3 + New Features

QFileDialog corrupted! QT bug?

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 267 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.
  • N Offline
    N Offline
    NeilWang
    wrote on last edited by
    #1
    I create a app base on QmainWindow class, and a function OpenFile to open some file, when I click menu, the open file dialog appears,  but disappeared some seconds, and report error as following: 0x00007FF830C031F0 处(位于 QtGuiApplication3.exe 中)引发的异常: 0xC0000005: 读取位置 0x0000000000000000 时发生访问冲突。
    
    Do you meet this kind of problem ?  would you be so kind to tell me the solution or direction , I used five days to look for the solution , but failed! if there is no solution, I maybe give up QT developing.
    
    thank you very much.
    

    the project contents are listed as following:

    1. pro file:

    # ----------------------------------------------------
    # This file is generated by the Qt Visual Studio Tools.
    # ------------------------------------------------------
    
    TEMPLATE = app
    TARGET = QtGuiApplication3
    DESTDIR = ../x64/Debug
    QT += core gui widgets qmltest
    CONFIG += debug
    DEFINES += _UNICODE _ENABLE_EXTENDED_ALIGNED_STORAGE WIN64 QT_DLL QT_QMLTEST_LIB QT_WIDGETS_LIB
    INCLUDEPATH += ./GeneratedFiles \
        . \
        ./GeneratedFiles/$(ConfigurationName)
    DEPENDPATH += .
    MOC_DIR += ./GeneratedFiles/$(ConfigurationName)
    OBJECTS_DIR += debug
    UI_DIR += ./GeneratedFiles
    RCC_DIR += ./GeneratedFiles
    include(QtGuiApplication3.pri)
    
    1. h file:
    #pragma once
    
    #include <QtWidgets/QMainWindow>
    #include "ui_QtGuiApplication3.h"
    
    class QtGuiApplication3 : public QMainWindow
    {
    	Q_OBJECT
    
    public:
    	QtGuiApplication3(QWidget *parent = Q_NULLPTR);
    
    private:
    	Ui::QtGuiApplication3Class ui;
    
    private slots:
    	void OpenFile();
    };
    

    3.cpp file:

    #include "QtGuiApplication3.h"
    #include <QFileDialog>
    
    QtGuiApplication3::QtGuiApplication3(QWidget *parent)
    	: QMainWindow(parent)
    {
    	ui.setupUi(this);
    	connect(ui.actionOpen, SIGNAL(triggered()), this, SLOT(OpenFile()));
    }
    
    void QtGuiApplication3::OpenFile()
    {
    	QString fileName = QFileDialog::getOpenFileName(this, "Open", "", "Design Files (*.gd)");
    
    	if (!fileName.isEmpty()) {
    		
    	}
    	else {
    		
    	}
    }
    

    4. interface:
    interface.png

    error window:
    interface2.png

    C 1 Reply Last reply
    0
    • N NeilWang
      I create a app base on QmainWindow class, and a function OpenFile to open some file, when I click menu, the open file dialog appears,  but disappeared some seconds, and report error as following: 0x00007FF830C031F0 处(位于 QtGuiApplication3.exe 中)引发的异常: 0xC0000005: 读取位置 0x0000000000000000 时发生访问冲突。
      
      Do you meet this kind of problem ?  would you be so kind to tell me the solution or direction , I used five days to look for the solution , but failed! if there is no solution, I maybe give up QT developing.
      
      thank you very much.
      

      the project contents are listed as following:

      1. pro file:

      # ----------------------------------------------------
      # This file is generated by the Qt Visual Studio Tools.
      # ------------------------------------------------------
      
      TEMPLATE = app
      TARGET = QtGuiApplication3
      DESTDIR = ../x64/Debug
      QT += core gui widgets qmltest
      CONFIG += debug
      DEFINES += _UNICODE _ENABLE_EXTENDED_ALIGNED_STORAGE WIN64 QT_DLL QT_QMLTEST_LIB QT_WIDGETS_LIB
      INCLUDEPATH += ./GeneratedFiles \
          . \
          ./GeneratedFiles/$(ConfigurationName)
      DEPENDPATH += .
      MOC_DIR += ./GeneratedFiles/$(ConfigurationName)
      OBJECTS_DIR += debug
      UI_DIR += ./GeneratedFiles
      RCC_DIR += ./GeneratedFiles
      include(QtGuiApplication3.pri)
      
      1. h file:
      #pragma once
      
      #include <QtWidgets/QMainWindow>
      #include "ui_QtGuiApplication3.h"
      
      class QtGuiApplication3 : public QMainWindow
      {
      	Q_OBJECT
      
      public:
      	QtGuiApplication3(QWidget *parent = Q_NULLPTR);
      
      private:
      	Ui::QtGuiApplication3Class ui;
      
      private slots:
      	void OpenFile();
      };
      

      3.cpp file:

      #include "QtGuiApplication3.h"
      #include <QFileDialog>
      
      QtGuiApplication3::QtGuiApplication3(QWidget *parent)
      	: QMainWindow(parent)
      {
      	ui.setupUi(this);
      	connect(ui.actionOpen, SIGNAL(triggered()), this, SLOT(OpenFile()));
      }
      
      void QtGuiApplication3::OpenFile()
      {
      	QString fileName = QFileDialog::getOpenFileName(this, "Open", "", "Design Files (*.gd)");
      
      	if (!fileName.isEmpty()) {
      		
      	}
      	else {
      		
      	}
      }
      

      4. interface:
      interface.png

      error window:
      interface2.png

      C Offline
      C Offline
      ChrisW67
      wrote on last edited by ChrisW67
      #2

      @NeilWang said in QFileDialog corrupted! QT bug?:

      Exception thrown at (in QtGuiApplication3.exe): 0xC0000005: Access violation while reading location 0x0000000000000000

      Almost certainly accessing a null, uninitialised, or otherwise invalid pointer.

      There is nothing in the code you have posted that is an obvious cause for that. Delete all the intermediate files and do a complete rebuild of the project. Run a debug build of your program in the debugger, reproduce the error, and then copy and paste the text of the stack backtrace. Also post the exact code you compiled referenced by the stack trace.

      1 Reply Last reply
      3

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved