Why connecttng signals and slots of an element of action gets segfault

I add an action item to a page. For some reasong I had to disconnect the item, delete and re-create, and then reconnect it. But I am getting exception when I try to pull the plug. If I omit the disconnection then I get exception when connecting. My code is below

  if(addAllRules)
    {
        disconnect(addAllRules,SIGNAL(triggered()),this,SLOT(onTriggeredAddRuleActionAllRules()));
        delete(addAllRules);
    }
    addAllRules =  ActionItem::create().title("Add Rule").enabled(true);
    allRulesPage->addAction(addAllRules, ActionBarPlacement::OnBar);
    connect(addAllRules,SIGNAL(triggered()),this,SLOT(onTriggeredAddRuleActionAllRules()));

Have you tried cleaning and reconstruction project?

You will need to find the exact location of the crash using a debugger or newspapers, or analyze a dump core after accident.

This can also occur due to memory corruption. If the memory is damaged from somewhere, the accident can happen in completely independent place. In this case, try commenting on most of the features of the application until the QTimer started working restaurant then step by step.

Tags: BlackBerry Developers

Similar Questions

  • Signals and Slots

    Try to test something after that someone wanted to help with the signals and Slots sorta. I know there is an alternative to this, but I'm trying to understand why this does not work when doing it this way.  It relies, it works but it does not fly... I mean this isn't the trigger of the SLOT feature... Not even sure if she sends a SIGNAL...

    Thanks in advance.

    file:

    // Default empty project template
    #ifndef Testme_HPP_
    #define Testme_HPP_
    
    #include 
    
    namespace bb { namespace cascades { class Application; }}
    namespace bb { namespace cascades { class TouchEvent; }}
    namespace bb { namespace cascades { class Container; }}
    namespace bb { namespace cascades { class ImageView; }}
    
    /*!
     * @brief Application pane object
     *
     *Use this object to create and init app UI, to create context objects, to register the new meta types etc.
     */
    class Testme : public QObject
    {
        Q_OBJECT
    public:
        Testme(bb::cascades::Application *app);
        virtual ~Testme() {}
    public slots:
        void handleTouch(bb::cascades::TouchEvent* tEvent);
    private:
        bb::cascades::Container* rootContainer;
        bb::cascades::ImageView* imgView;
    };
    
    #endif /* Testme_HPP_ */
    

    .cpp file:

    // Default empty project template
    #include "Testme.hpp"
    
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    
    using namespace bb::cascades;
    
    Testme::Testme(bb::cascades::Application *app)
    : QObject(app)
    {
        // create scene document from main.qml asset
        // set parent to created document to ensure it exists for the whole application lifetime
        QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);
        QmlDocument *qml2 = QmlDocument::create("asset:///Testingme.qml").parent(this);
    
        // create root object for the UI
        AbstractPane *root = qml->createRootObject();
        // set created root object as a scene
        app->setScene(root);
    
        if (!qml2->hasErrors()) {
            rootContainer = qml2->createRootObject();
    
            if (rootContainer) {
                imgView = rootContainer->findChild("imgView");
    
                if (imgView) {
                    bool res = QObject::connect(imgView,                                        SIGNAL(touch(bb::cascades::TouchEvent*)),
                            this, SLOT(handleTouch(bb::cascades::TouchEvent*)));
                    Q_ASSERT(res);
                    Q_UNUSED(res);
                    fprintf(stderr, "Height: %f and width: %f\n",
                            imgView->preferredHeight(),                                        imgView->preferredWidth());
                } else {
                    fprintf(stderr, "No ImageView\n");
                }
            } else {
                fprintf(stderr, "No root container\n");
            }
        } else {
            fprintf(stderr, "QML2 has errors\n");
        }
    }
    
    void Testme::handleTouch(TouchEvent *tEvent)
    {
        fprintf(stderr, "Touch Touch Touch\n");
    }
    

    hand file. QML:

    // Default empty project template
    import bb.cascades 1.0
    
    // creates one page with a label
    Page {
        Container {
            layout: StackLayout {}
            Label {
                text: qsTr("Hello World")
            }
    
            Testingme {
                id: testingMe
            }
        }
    }
    

    File Testingme.QML:

    import bb.cascades 1.0
    
    Container {
        objectName: "rootContainer"
        horizontalAlignment: HorizontalAlignment.Center
        verticalAlignment: VerticalAlignment.Center
        background: Color.create ("#262626")
    
        ImageView {
            objectName: "imgView"
            imageSource: "asset:///belligerent.png"
            preferredHeight: 200
            preferredWidth: 200
        }
    }
    

    The main file is the one you get when you create a new project of Cascades Standard default. So, what's wrong with this picture? Or of images, other than the fact that I use the png of bellicose blocks file...

    -Edit (this and some formatting).

    I'm using the Simulator, so don't know if it would make a difference. BTW, I even tried to use a checkbox, and which does not trigger anything.

    Well, it works eventually got. I'm still not sure where to check signals during debugging, however.

    Although there are two files QML, the first main QML object is one that should be used. I used the 2nd QML file object that was wrong, even if the image is in the 2nd...

  • Problem, the signals and Slots

    Hi, as I posted in one of my other posts I have following problem with signals and messages and would be nice if someone could clarify anything that I don't seem to be able to find what the problem of the outputs.

    I have the code:

    void MYNetworkClass::requestFinished(QNetworkReply* reply)
    {
    
          // Check the network reply for errors
          if (reply->error() == QNetworkReply::NoError)
          {
             // read response
             const QByteArray response(reply->readAll());
             qDebug() <<"Response: "<< response;
    
             JsonDataAccess jda;
             QVariantMap results = jda.loadFromBuffer(response).toMap();
    
             QVariantMap data = results.value("SomeData").toMap();
    
             emit signalSuccess(data); // I reach here .... 
    
    // however actually when I click "Step Over" in debug mode, and try to exit the function// afterwards I get such "error" saying: No source available for "QMetaObject::activate() at  0xb9668da7" - highlighted in red.
    
         }
         else
         {
             qDebug() << "\n Problem with the network";
             qDebug() << "\n" << reply->errorString();
         }
    

    In MyNetwork class I also added the definition of signal in the header file:

    signals:
    
        void signalSuccess(QVariantMap result);
    

    Now also when someone calls an object MyNetworkClass method which calls requestFinished,.

    I want to catch the signal which is emitted by the requestFinished - as shown above.

         MyNetworkClass *network = new MyNetworkClass();
    
        QMap params;
        params.insert("username", userEmail);
    
        bool res = QObject::connect(network, SIGNAL(signalSuccess(QVariantMap)), this, SLOT(SomeSlotForSignal(QVariantMap)));
    
            Q_ASSERT(res);
        Q_UNUSED(res);
            network->makePostRequest("Login");
    

    My problem is that the SomeSlotForSignal slot never is called... (even if the signal is issued constitute requestFinished method and as I stated SomeSlotForSignal as a crack in the header file...) What can be problem? Any help? Thank you.

    I guess I solved the problem.

    The code I presented previously registered function

    F of a class B:

     void B::f()
    {
    MyNetworkClass *network = new MyNetworkClass();
    
        QMap params;
        params.insert("username", userEmail);
    
        bool res = QObject::connect(network, SIGNAL(signalSuccess(QVariantMap)), this, SLOT(SomeSlotForSignal(QVariantMap)));
    
            Q_ASSERT(res);
        Q_UNUSED(res);
    
    network->makePostRequest("Login");
    }
    

    Then the function f is called to:

        B object;
        object.f();
    
    The problem was I think that when the server responded "object" was destroyed from the stack. When I replaced the above code, with 
    
         B* object = new B();
        object->f();
    
    I think it works now......
    
  • Unable connect 2 classes of signals and Slots

    I am transferring from one category to the other channels.

    Their memories are:

    .hpp files------------
    class A::public QObject{
    Q_OBJECT
    
    signals:
    void emitMsg(QString* msg);
    }
    
    class B::public QObject{
    signals:
    void emitA(QString* msgA);
    public slots:
    void logMsg(QString* msg);
    }
    
    ---------.cpp files
    
    classB::classB(){
    bool temp= connect(objB,SIGNAL(emitA(QString*)),this,SLOT(logMsg(QString*)));
    
    qDebug()<<"value="<
    

    But even running in the device debug mode Dev Alpha, the application displays a value in the log messages, or moves out of the screen dark splash.

    Please adivse, what is missing from the other code?

    Is there a way by which the slots and signals of different classes could be connected to data transfer?

    Create a Downloader object?

    (BTW, I always initialize pointers to 0 in the initializer list.)  Who does this kind of obvious thing, and it has the same thing for debug and release)

    Stuart

  • How to get the callUpdated signal and respond to the function of oncallUpdated slot?

    Hello world:

    I want to get the 'phone. callUpdated (const bb::system:: call & appeal) "signal and do something in the slot to onCallUpdated function, but the problem is crack onCallUpdated() function does NOT respond!

    Here is my code:

    . CPP

    #include 
    

    MyApp (bb::cascades:Application * app) in myApp.cpp

        bb::system::phone::Phone phone;
    
        bool success = QObject::connect(&phone,SIGNAL(callUpdated(const bb::system::phone::Call&)),this,SLOT(onCallUpdated(const bb::system::phone::Call&)));
    
        qDebug()<<"bb::system::phone::Phone phone:  "<
    

    When the application runs, the success of back connect is true!

    void Quicker::onCallUpdated(const bb::system::phone::Call &call)
    {
    
        //CallState::Type state = call.callState();
    
        qDebug()<<"onCallUpdated is called";
    }
    

    In myApp.hpp

    #include 
    
         void onCallUpdated(const bb::system::phone::Call &call);
    

    In the bar - descriptor.xml

        run_when_backgrounded
        access_phone
    

    I found the problem:

    bb::system::phone::Phone phone;
    

    the code must be in the *.hpp.

    Thank you all.

  • Why not load not Photoshop elements 11 and Prime Minister 11 elements?

    I just bought Photoshop elements 11 and Prime Minister 11 elements.  I have Windows 7pro, have the disc for Windows and the serial numbers for both programs.  When I put the disk, I can't go past the Welcome screen.  Why?


    Adobe photoshop elements and premier elements 11 welcome screen.JPG

    Access your cd using your file browser > click with the right button on the Setup file > click 'run as administrator '.

  • Align the two signals and measure the Phase Shift

    Hello

    I do an experiment in which I use the NI USB-6221 DAQ card. The jury is able to make 250 k samples/second. I want to measure two voltages in a circuit and find the phase shift between them at frequencies between 1 and 10000. First I ouputted a wave sinusoidal frequency variable through the Commission and applied to a test circuit. Then I used the Board to measure the two tensions consecutively (thus reducing the maximum sampling frequency at 125 k). I used the signals align VI and measured the two phases and then calculates the phase shift (VI attached in Phase 1). It worked well for the test circuit I built in which the phase shift went way logarithmique.20 degrees ~84.5 degrees and then stabilized. At frequencies above 5 000 Hz phase shift must have remained constant, but it varies more or less 1 degree. When the phase shift is 84.5 degrees, present a degree of variability is not particularly explicit. When I asked my program on the circuit that I really wanted to measure, the phase shift went from-. 5 degrees up to about 1.2 degrees. The change in the values of phase shift at high frequencies (> 3000) was environ.2 degrees. Given the small phase shift, this variation is unacceptable. Now I tried to use a sequence to each blood individually (increase the maximum sampling frequency to 250 k) and then align the two signals and measure the phase of each shift. When I use align it and re - sample Express VI to realign the two signals, I get the message "error 20333 analysis: cannot align two waveforms with dt even if their samples are not clocked in phase." Is it possible to align two signals I describe here? I enclose the new VI as Phase 2

    Matthew,

    I think I have an idea for at least part of the problem.

    I took your program data and deleted stuff DAQ.  I have converted the Signal on the chart control and looked then what was going on with the signal analysis.

    The output of the Waveforms.vi line has two waveforms, like the entry.  However, arrays of Y in the two waveforms are empty!  It does not generate an error. After some head scratching, reading the help files and try things out, that's what I think is happening: the time t0 two input signals are 1,031 seconds apart. Since the wavefoms contains 1,000 seconds of data, there is no overlap and may not align them.

    I changed the t0 on two waveforms are the same, and it lines up.  The number of items in the tables is reduced by one. Then I increased the t0 of 0.1 seconds on the first element. The output had both greater than the entry by dt t0 t0 and the size of the arrays was 224998.  Reversing the t0 two elements shifts the phase in the opposite direction.

    What that tells me, is that you can not reliably align two waveforms which do not overlap.

    I suggest that you go to 2-channel data acquisition and that it accept the reduced sample rate.  You won't get the resolution you want, but you should be able to tell if something important happens.

    You may be able to improve the equivalent resolution by taking multiple steps with a slight phase shift. This is similar to the way that old oscilloscopes of sampling (analog) worked. Take a series of measures with the signal you are currently using.  The make enough average to minimize changes due to noise. Then pass the phase of the signal of excitement to an amount that is smaller than the resolution of phase of sampling rate and repeat the measurements.  Recall that I calculated that for a 5 kHz signal sampled at 125kHz, you get a sample every 14.4 degrees. If shift you the phase of 1 degree (to the point/mathematical simulation), you get a different set of samples for excitement.  They are always separated by 14.4 degrees.  Take another series of measures. Transfer phase another degree and repeat.  As long as your sampling clocks are stable enough so that frequency does not drift significantly (and it shouldn't with your equipment), you should be able to get near resolution of what you need.  The trade-off is that you need to perform more measurements and may need to keep track of the phase shifts between the various measures.

    Lynn

  • acquisition of wireless signals and record the signal as text at the same time for 5 minutes

    Hello

    I'm wireless ECG signal and the display in waveform graph. And at the same time, I need to save it as text for 5 minutes. The problem I faced is for record of the signal, I use scripture to the extent file that saves the file as text... but everything by saving the trace speed decreases.

    I'm very new to labview so please can someone me if Miss me something in it... Please help...

    Why people always post photos of their screws rather than the screws themselves or at least excerpts?  We can't tell from the picture what Version of LabVIEW, you use (so if we post code, you will not be able to open it), and we can not 'play' with your code and try without, ourselves, by hand, trying to recreate your diagram (sometimes very small).  Please, help us help you!

    This is in any case helps to familiarize yourself with the design of producer/consumer model.

    1. Open LabVIEW.
    2. Click on 'File', choose 'new '.... "(no new VI), then (in models) producer/consumer Design Pattern (data).
    3. Study the model and adapt it to your problem.

    The producer would be anything that generates data.  Once you have the data, you put on the queue and send to the consumer for the entire treatment.  The idea is that the producer has an inherent calendar that he must answer, otherwise you lose data points.  The consumer, on the other hand, just need to follow 'more or less' (in fact, the queue may / will develop, if the amount of data is not megabytes, so the consumer can really be quite slow, if you usually want to consumers, on average, to be at least as fast as the producer).

    Bob Schor

  • Why is this and how?

    So I bought Adobe Photoshop and Prime Elements for my Mac, got the serial number and the time to download, but it downloads only at 25%. Why is this and what can I do to make it to download? I need to have for the projects, but I let it charge for 2 days once and has not yet moved from 25%.

    Restart your download installation files.


    Available downloadable Setup files:

    Download and installation help links Adobe

    Help download and installation to Prodesigntools links can be found on the most linked pages.  They are essential; especially steps 1, 2 and 3.  If you click on a link that does not have these listed steps, open a second window by using the link to Lightroom 3 to see these "important Instructions".

  • IPhone 5 s losing signal and MIC is muffled

    Hello guys,.

    My Rich Dad a 5s iPhone and it loses signal and muffled the sound when he talks about phone! Any solution before going to the apple service?

    Hello

    Try following the steps here in terms of sound not clear:

    Get help with microphones on your iPhone, iPad and iPod touch - Apple Support

    Follow the instructions in respect of the loss of cellular signal:

    If you cannot connect to a cellular network or cellular data - Apple Support

  • Right now, Firefox works on Sony Ericsson Xperia X 10, but not on the Xperia X 10 mini. Why is this and it will be fixed?

    I have Sony Ericsson Xperia X 10 mini and WOULD like Firefox Mobile on it. However, for now, Firefox is only compatible with the Xperia X 10. Why is this and it will be fixed?

    This is due to the processor that uses the X 10 mini. Mobile Firefox requires a processor that supports the ARMv7 architecture, but the processor in the X 10 mini supports ARMv6 architecture.

    For some time Mozilla developed a version which worked on processors who use ARMv6, but currently stopped because there were bugs that caused his accident ever. Mozilla peut start developing for ARMv6 processors once again, but right now they are not actively working on it.

  • I am facing a problem with the beep.vi. I have a DAQ program, which acquired the signal and compare it to a threshold value. When a signal is out of range, a Visual and sound alarm has occurred. I use the VI beep.vi to generate the sound.

    I am facing a problem with the beep.vi.  I have a DAQ program, which acquired the signal and compare it to a threshold value. When a signal is out of range, a Visual and sound alarm has occurred. I use the VI beep.vi to generate the sound. Everything works fine except the sound alarm. It gives the table 1 d of type mismatch. I tried to fix this by placing it in a box structure. But it still does not work. If someone could help? Please find attached my VI. Best wishes to all visitors to the Forums of Discussion OR.

    Ihab El-Sayed

    published here: http://forums.ni.com/t5/LabVIEW/Playing-sound-based-on-exceeding-a-threshold-value-1D-array-data/m-p...

  • How do I get the analog input signal and send it to output analog (real time)

    Hello world

    I do a simple task in Visual C++ and I use PCI-6221(37 pin).

    Basically, I want to send the same signal of "analog input" to the "analog output".

    at the same time (or almost), to make real-time application.

    Can someone provide me with sample program please.

    I would be grateful if you could provide me with the great tutorial that explains

    step by step everything about NOR-DAQmx for C/C++ programming.

    Best regards

    Khassan

    This is my code in C++, you can optimize it if that seems too messy. This code reads the analog input signals and exports it through the analog outputs.

    To make this code additional work of the directories include and library directories must be added to OR.

    I hope it helps someone.

    #include
    #include
    #include "NIDAQmx.h".
    #include

    #define DAQmxErrChk (functionCall) {if (DAQmxFailed (error = (functionCall))) {goto error ;}}

    int main (int argc, char * argv [])
    {
    Int32 error = 0;
    TaskHandle taskHandleRead = 0, taskHandleWrite = 0;
    Read Int32 = 0;
    float64 context [1000];
    char errBuffRead [2048] = {'\0'};
    char errBuffWrite [2048] = {'\0'};
    bool32 done = 0;
    Int32 wrote;

    DAQmxErrChk (DAQmxCreateTask("",&taskHandleRead));
    DAQmxErrChk (DAQmxCreateAIVoltageChan(taskHandleRead,"Dev1/ai0","",DAQmx_Val_Cfg_Default,-10.0,10.0,DAQmx_Val_Volts,NULL));
    DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandleRead,"",100.0,DAQmx_Val_Rising,DAQmx_Val_ContSamps,0));
    DAQmxErrChk (DAQmxCreateTask("",&taskHandleWrite));
    DAQmxErrChk (DAQmxCreateAOVoltageChan(taskHandleWrite,"Dev1/ao0","",-10.0,10.0,DAQmx_Val_Volts,NULL));
    DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandleWrite,"ai/SampleClock",100.0,DAQmx_Val_Rising,DAQmx_Val_ContSamps,1000));

    DAQmxErrChk (DAQmxStartTask (taskHandleRead));
    DAQmxErrChk (DAQmxStartTask (taskHandleWrite));

    While (! fact &! _kbhit())

    {

    DAQmxErrChk (DAQmxReadAnalogF64(taskHandleRead,1,10,DAQmx_Val_GroupByScanNumber,dataRead,1000,&read,));

    DAQmxErrChk (DAQmxWriteAnalogF64(taskHandleWrite,read,0,10.0,DAQmx_Val_GroupByChannel,dataRead,&written,));

    }
    _getch();

    Error:
    If (DAQmxFailed (error))

    {
    DAQmxGetExtendedErrorInfo (errBuffRead, 2048);
    DAQmxGetExtendedErrorInfo (errBuffWrite, 2048);
    }
    If (taskHandleRead! = 0)

    {

    DAQmxStopTask (taskHandleRead);
    DAQmxClearTask (taskHandleRead);
    }
    If (taskHandleWrite! = 0)

    {

    DAQmxStopTask (taskHandleWrite);
    DAQmxClearTask (taskHandleWrite);
    }
    If {(DAQmxFailed (error))
    printf ("error DAQmx: %s\n",errBuffRead); ")
    printf ("error DAQmx: %s\n",errBuffWrite); ")
    }
    printf ("end of the program, press the Enter key to quit\n");
    GetChar ();
    return 0;
    }

  • Determine which cluster and the array index element was clicked on table clusters

    Hello

    I'm overload of brain with dynamic events and references and nodes of property etc.

    I am trying to identify the cluster and the array index element that was clicked on table clusters

    This gives me the name of the element:

    Is this reasonable?  How can I get the index?

    Thank you

    Paul

    Hello

    Download the VI in this link (also attached).  It gives you the index of the array element that you clicked. Hope this will help you.

    Kind regards
    Nitz

    (Bravo to give good answers, mark it as a Solution If your problem is resolved)

  • X3DAudio1_7.dll, what is this .dll file and why keep is asked to install it in order to get my games to work?

    original title: X3DAudio1_7.dll
    What is this .dll file and why keep is asked to install it in order to get my games to work?

    This file is a newer DirectX file (Feb 2010) not listed is not in the out-of-the-box DirectX, which is part of Windows 7 (July 2009). You must download and install the latest updates of DirectX http://www.microsoft.com/downloads/en/details.aspx?FamilyID=2da43d38-db71-4c1b-bc6a-9b6652cd92a3&displaylang=en. Do not be annoyed by the description"provides updates to 9.0 c and previous versions of DirectX", the package updates ALL your versions of DirectX installed (usually 9, 10 and 11).  "192GO should be enough for everyone." (of the miniseries "Next generation jokes")

Maybe you are looking for

  • Identification of exact model of laptop

    I can't identify exactly which model of laptop I have and need to know that a couple of pieces could do with upgrading. It is a few years old, and all my system info tells it me is that the laptop is a HP Pavilion dv7. Can someone help me understand

  • I want to reprint a 2010 iPhoto book

    I want to reprint a 2010 iPhoto book. They keep books of which a long time ago?  I still have it as a jpg.  All pages are saved in jpg format.

  • C:\users\owner\pamperedpertnerplus\workspace\.metadata\.log.

    I get this error message when I try to go to my pampered partner program & I'm not able to understand how to fix it.

  • Problem with VLAN between Cisco Catalyst (3560G) and SG300-52

    I am having trouble with the creation of a trunk of vlan between a SG300-52 and a Cisco Catalyst 3560 G.  I have 4 VLANS (1, 2, 10 and 11) on the 3650 and I need ports on the SG300 to be able to communicate with them. On the 3560, port 14 is defined

  • DigitalPersona and Firefox 3

    Hello I have a Pavilion TX2510us running DigitalPersona Personal version 3.1.0.3276. Finger print recognition OK jobs all the time. I can access sites protected by password on Internet Explorer and Firefox. I also noticed that this program has added