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. Error when closing application in Qt4.8 using QDeclarative and QML
Forum Updated to NodeBB v4.3 + New Features

Error when closing application in Qt4.8 using QDeclarative and QML

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 608 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.
  • Q Offline
    Q Offline
    Qnoobish
    wrote on last edited by
    #1

    Hello,

    I am having some trouble when I close my application I get an error. I am defining a new QML element by QDeclarativeItem and sharing a property through Q_PROPERTY. My class looks like this:

    @class PluginName : public QDeclarativeItem
    {
    Q_OBJECT
    Q_PROPERTY (QString pluginName READ m_sGetPluginName WRITE m_vSetPluginName)

    public:
    //PluginPage(QDeclarativeItem* poParent = NULL);
    //~PluginPage();
    void m_vSetPluginName (const QString& sName);
    QString m_sGetPluginName () const;

    private:
    QString m_sPluginName;
    };@

    And in the .cpp:

    @void PluginName::m_vSetPluginName (const QString& sName)
    {
    m_sPluginName = sName;
    }

    QString PluginName::m_sGetPluginName () const
    {
    return m_sPluginName;
    }@

    Also My .qml

    @import QtQuick 1.1
    import Simu 1.0

    Item{
    id: mainWindow
    objectName: "item"
    width:1000
    height:600

    PluginName
    {
    pluginName:"name"
    }

    Rectangle
    {
        id: idMyWindow                   // unique identifier for this button
    

    objectName: "rect"
    color: "blue" // backgrond color
    width: 800 // window size
    height: 600
    x: 10 // x-absolute position from parent <mainWindow>
    y: 20 // y-absolute position from parent <mainWindow>

    }
    

    }@

    I am also using "qmlRegisterType" to register my PluginName class.

    If I don't use my new QML element then I don't get the heap error I wonder what is wrong :(

    This is the error, I am using MSVC 2005:

    "Windows has triggered a breakpoint in _visufrwk_proj.exe.

    This may be due to a corruption of the heap, and indicates a bug in _visufrwk_proj.exe or any of the DLLs it has loaded.

    The output window may have more diagnostic information"

    Hopefully someone could share some knowledge.
    Thanks in advance.

    In short, software is eating the world.

    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