qmlRegisterType problem

I cannot register a QML type. The first time I did it with the DataModel PrayerModel type I managed to do the work. However, I get errors with the PrayerBBMManager now. It is based on the example of Battambang, but I simplified the entire BBM feature heavily.

Real errors are:

Description Resource    Path    Location    Type
undefined reference to `prayerbbm::PrayerBBMManager::~PrayerBBMManager()'   PrayerJournal       line 86, external location: f:\bbndk\target_10_0_9_2318\qnx6\usr\include\qt4\QtDeclarative\qdeclarativeprivate.h    C/C++ Problem

Description Resource    Path    Location    Type
undefined reference to `prayerbbm::PrayerBBMManager::PrayerBBMManager(QObject*)'    PrayerJournal       line 82, external location: f:\bbndk\target_10_0_9_2318\qnx6\usr\include\qt4\QtDeclarative\qdeclarativeprivate.h    C/C++ Problem

Description Resource    Path    Location    Type
undefined reference to `prayerbbm::PrayerBBMManager::staticMetaObject'  PrayerJournal       line 163, external location: f:\bbndk\target_10_0_9_2318\qnx6\usr\include\qt4\QtDeclarative\qdeclarative.h  C/C++ Problem

Description Resource    Path    Location    Type
undefined reference to `prayerbbm::PrayerBBMManager::staticMetaObject'  PrayerJournal       line 189, external location: f:\bbndk\target_10_0_9_2318\qnx6\usr\include\qt4\QtDeclarative\qdeclarative.h  C/C++ Problem

Here's my PrayerJournal.cpp file:

#include "PrayerJournal.h"
#include "prayermodel.h"
#include "prayerbbm/prayerbbmmanager.h"

#include 
#include 
#include 

using namespace bb::cascades;
using namespace prayerbbm;

PrayerJournal::PrayerJournal(bb::cascades::Application *app)
: QObject(app)
{
    qDebug() << "starting PrayerJournal app constructor ";
    QCoreApplication::setOrganizationName("Alliteration Applications");
    QCoreApplication::setOrganizationDomain("http://alliterationapplications.com");
    QCoreApplication::setApplicationName("Prayer Journal");

  qmlRegisterType("com.prayerjournal.prayerdata", 1, 0, "PrayerModel");
  qmlRegisterType("com.prayerjournal.prayerbbm", 1, 0, "PrayerBBMManager");
  qDebug() << "Registered PrayerModel and PrayerBBM types for QML";

  // Create a QMLDocument and load it, using build patterns.
  QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);

  if (!qml->hasErrors()) {
      qDebug() << "QML is error-free! Celebrate!";
  }
  if (qml->hasErrors()) {
      qDebug() << "QML has errors";
  }

  //qml->setContextProperty("registrationHandler", registrationHandler);
  AbstractPane *appPage = qml->createRootObject();
  Application::instance()->setScene(appPage);

  qDebug() << "Created and initialized main.qml";
}

Thanks to all that refers to BBM files qml commenting regularly and working backward in this file I can identify the problem happening to qmlRegisterType statement.

Here's the prayerbbmmanager.h:

namespace prayerbbm
{
    /**
     * PrayerBBMManager Description:
     *
     * This manager takes care of registering the application with BBM
     */
    class PrayerBBMManager: public QObject
    {
    Q_OBJECT

    public:
        PrayerBBMManager(QObject *parent = 0);

        virtual ~PrayerBBMManager();

And the prayerbbmmanager.cpp:

namespace prayerbbm
{
    PrayerBBMManager::PrayerBBMManager(QObject *parent) :
            QObject(parent)
    {
         m_uuid = QString::fromUtf8("d8484b8d-bed5-4cde-8c11-462c6a04bc35");

         if (mSettings.value("connectToBBM").isNull()) {
            mSettings.setValue("connectToBBM", QVariant(false));
         }
    }

    PrayerBBMManager::~PrayerBBMManager()
    {
    }

Any help would be appreciated.

Yes it could be

My money is also on the sources of PrayerBBMManager is not THAT MOC would be because they were transferred in a directory that is not referenced in the .pro project file

Tags: BlackBerry Developers

Similar Questions

  • <>and problems QImage qmlRegisterType

    I put in work of a custom control cascade but my command does not display I register my control in qml qmlRegisterType('com.lib', 1, 0, 'View'); Here are the important codes.

    in the qml file, I call my control as

            View{
                horizontalAlignment: HorizontalAlignment.Center
                verticalAlignment: VerticalAlignment.Center
            }
    

    Constructor for my control

    View::View(Container *parent)
        : CustomControl(parent)
        , m_Image( )
    {
    
        // Create the image view for the handle using the image for
        // the inactive handle
        m_ImageView = ImageView::create()
            .image(m_Image)
            .horizontal(HorizontalAlignment::Center)
            .vertical(VerticalAlignment::Center).preferredSize(400.0, 300.0);
    
        // Create a scrollView for our  view
        m_ScrollView = ScrollView::create(m_ImageView).scrollMode(ScrollMode::Both);
    
        //m_rootContainer->add(m_ImageView);
    
        // Set the root of the custom control.
        setRoot(m_ScrollView);
    
    }
    

    Update for my opinion

    void View::updateImage()
    {
        QImage image;
        tile.load( QString::fromLatin1("app/native/assets/images/t2.png") );
    
        //draw the image
        QImage qImage(400.0, 300.0, QImage::Format_RGB32);
        QPainter painter(&qImage);
        painter.drawImage(0, 0, tile);
        qImage.rgbSwapped();
    
        const bb::ImageData imageData = bb::ImageData::fromPixels(qImage.bits(), bb::PixelFormat::RGBX, 400.0, 300.0, qImage.bytesPerLine());
    
        m_Image = bb::cascades::Image(imageData);
    
        emit imageChanged(m_Image);
    }
    

    Problem solved. It was a problem of getters and setters. found a work around but will need to read the style getters and setters of Qt.

  • problem with qmlRegisterType

    Hi I have a problem with qmlRegister for the use of an onFarenheitChanged signal for my weather app, when I build and run, has no problem except that when the application starts, the accident with a message like this

    Process 2016309487 (WeatherNow) terminated SIGSEGV code=2 fltno=11 ip=7844f196(/base/usr/lib/qt4/lib/libQtDeclarative.so.4.8.5@_ZN36QDeclarativePropertyValueInterceptorC1Ev+0x711) mapaddr=0014f196. ref=07a4f2f8 bdslot=1
    

    and this is the code

    CPP

    WeatherNowApp::WeatherNowApp()
    {
        QCoreApplication::setOrganizationName("conias media");
        QCoreApplication::setApplicationName("WeatherNow");
    
         qmlRegisterUncreatableType("bb.device", 1, 0, "BatteryChargingState", "");
         qmlRegisterType("My.Library", 1, 0, "QTimer");
         qmlRegisterType("Network.ExternalIP", 1, 0, "ExternalIP");
         qmlRegisterType("Weather.Now", 1, 0, "WeatherNowApp");
         //! [0]
    

    HPP

    #ifndef WEATHERNOWAPP_HPP_
    #define WEATHERNOWAPP_HPP_
    
    #include 
    #include 
    using namespace bb::cascades;
    
    namespace bb
    {
        namespace cascades
        {
            class Application;
        }
    }
    
    class WeatherNowApp : public QObject {
        Q_OBJECT
    
        Q_PROPERTY(bool useFarenheit READ useFarenheit WRITE setUseFarenheit NOTIFY useFarenheitChanged)
    
    public:
    
        WeatherNowApp();
        Q_INVOKABLE void showPhotoInCard(const QString fileName);
    
    Q_SIGNALS:
        void useFarenheitChanged();
    

    and the qml

    import Weather.Now 1.0
    
    attachedObjects: [
    WeatherNowApp {
                onUseFarenheitChanged: {
    
                }
            }
    ]
    

    the qml missing changes to the label and that, but it does not even withouth code in there, so this isn't a problem on the internal code, suggestions?

    SIGSEGV error basically tells you that your application's RAM that does not belong to her or trying to run a class via an invalid pointer method.

    Do I have reason to assume that the WeatherNowApp class is the UI of your main application class? If Yes, I am confused why you would be save with QML, then by attaching to a page in QML. It is not normal to save the UI class main QML in the constructor of this class even with qmlRegisterType().

    I think that maybe what you really do is pass the instance of the main application to QML as a context property. If you try to respond to a signal of your main UI in QML class, then you should do so with the connect() function. Something like this instead:

    WeatherNowApp::WeatherNowApp()
    {
        QCoreApplication::setOrganizationName("conias media");
        QCoreApplication::setApplicationName("WeatherNow");
    
        qmlRegisterUncreatableType("bb.device", 1, 0, "BatteryChargingState", "");
        qmlRegisterType("My.Library", 1, 0, "QTimer");
        qmlRegisterType("Network.ExternalIP", 1, 0, "ExternalIP");
    
        QmlDocument *qml = QmlDocument::create( "asset:///main.qml" ).parent( this );
    
        // ---Make this app object available in QML
        qml->setContextProperty( "app", this );
    }
    
    Page {
       id: myPage
       function onUseFarenheitChanged() {
          if (_WeatherNow.useFarenheit == true)
             weatherDataTemperature.text = Math.round((jsonweather.temp)*1.8+32);
          else {
             weatherDataTemperature.text = Math.round(jsonweather.temp);
          }
       }
       onCreationCompleted: {
          app.useFarenheitChanged.connect(myPage.onUseFarenheitChanged);
       }
    }
    

    BTW, it makes no difference to the code, but you poorly spelled fahrenheit.

  • QTimer and qmlRegisterType

    I think it's time for me to consult the world forum on my problem. It seems so simple and yet I could not find the cause of the problem. I started having problems after you install the SDK version Gold

    I use QTimer on stunts.

    In my .cpp, I registered the object as:

    qmlRegisterType ('my.library', 1, 0, 'QTimer");

    In main.qml, I imported as:

    import my.library 1.0

    and fixed on a label as follows:

    attachedObjects:]
    {QTimer
    ID: timer
    property int f: 0
    interval: 1000
    onTimeout: {}
    f += 1;
    timerLabel.text = "duration:"+ f; ".  timerLabel is the id of the tag that is fixed QTimer
    }
    }
    ]

    Thanks for any help!

    After trying several scenarios and working on your suggestions, I've finally found what is causing the problem. In the original code, it could save the object and reached the import statement, but he has never run the attachedObjects part.

    What I did is I renamed my main.qml in another (timeTrial.qml) and created a new main.qml. Can I access timeTrial.qml through navigationPane. It worked without any code changes.

    Can someone give an overview of how's done it?

    It goes like this:

    CPC (save the object) file-> main.qml-> timeTrial.qml (import my.library 1.0)

    Thank you very much!

  • Problem with the C++ object to qml exponent

    Hello, I followed the instructions by Qml and C++ integration but got stuck at a certain time.

    Here is my code:

    // applicationui.cppPage* ApplicationUI::doLoadPageDetails(){
    
        qmlRegisterType("myHtmlPage", 1, 0, "HtmlPage");
    
        QmlDocument *qml = QmlDocument::create("asset:///PageDetails/PageDetails.qml").parent(this);
        qml->setContextProperty("app", this);
    
        HtmlPage *htmlPage = new HtmlPage();
        qml->setContextProperty("htmlPage", htmlPage);
    
        htmlPage->setHtml("*some html code*");
    

    This function creates a Page with a container that contains a WebView. Here, I want to fill the string saved as htmlPage.html.

    I created the RPC classes as described in the link and they work. When I check the htmlPage-> html() in C++, I get the string I wanted.

    Now, my problem is how to get this string for qml.

    Here's what I do:

    import myHtmlPage 1.0....Container {
    ....
            ScrollView {            visible: true
                WebView {
                    attachedObjects: [
                       HtmlPage {
                            id: htmlPage
                        }
                    ]
    
                    id: webViewScrollable1....
                    html: "" +
                    "" +
                   "*style options*" +
                    "" +
    
                    htmlPage.html +  //<----- this should give me the string I saved in C++ under htmlPage->html()
    
                    "" +
                    ""
                }
            }
    

    But nothing is displayed on the page. But why? I forgot to link something?

    I think you're getting confused in the difference between a property and recording a QML component.

    You do both.

    When you attach an object to a QML file, you create an instantiation of the object at this time, when you set a context property that you you already created that object and are just passing a reference to this.

    So when you join HtmlPage in your QML file you create a new object and does not reference that you have created in your program C++ part, so no text.

  • Unable to Scan to the computer after downloading macOS Sierra. Is this a software problem?

    How can I scan from HP Envy 4500 to computer after downloading macOS Sierra?

    Hello wdemetris,

    Thanks for asking for scanning helps here in the Apple Support communities. I understand how it is important to have access to your scanner and am happy to offer help for this.

    As a precaution, we always recommend that you have backups to make sure that all your data is safe. You can perform a backup using Time Machine and an external hard drive. Use this article to help make a backup of your Mac: use Time Machine to back up or restore your Mac.

    Then, in accordance with article help: printer and scanner for Sierra, El Capitan, Yosemite, and the Mavericks macOS software, the HP Envy 4500 e-all-in-one is supported for printing and scanning. The drivers must be installed, but if not, if it please go to the App Store and check the updates tab to see if there are updates for HP. If there is, please install.

    If you have only general questions about how to get your updated scanner in place or how to scan pictures, please check out these two articles: macOS Sierra: implement a scanner & macOS Sierra: scan images or documents. If everything is configured correctly and you still have problems scanning, please visit this help article: macOS Sierra: scanning troubleshooting.

    Thanks again and have a great rest of your day.

  • My iPhone 6 installed 10.0.2 stops when it gets to 40% of autonomy.  In addition, it seems to pass power WAY to fast with the new software.  Does anyone else have this problem?

    My iPhone 6 installed 10.0.2 stops when it gets to 40% of autonomy.  In addition, it seems to pass power WAY to fast with the new software.  Does anyone else have this problem?

    Hello brooksm549,
    Thank you for using communities of Apple Support.

    I got your message which, since updating your iPhone 6 to iOS 10.0.2 your iPhone stops when it is 40% and the power to empty very quickly. I understand your concern with the iPhone turn off and drains the battery. I recommend you to review the use of the battery to see what app contributes more to the battery drain. The following article will provide you with steps on how to check the use of the battery:

    On the use of the battery on your iPhone, iPad and iPod touch

    When you know about the soft uses more battery, you can change your settings in order to optimize the battery life:

    Maximize the life of the battery and battery life

    Best regards.

  • MacBook Pro display problem

    Hello members of the community.

    As of recently, I have noticed some glitches when feeding on my MacBook or awakened from his sleep.

    The colors are distorted, usually with pink, green, or yellow blobs. Blobs cannot entirely replace the colors, they appear to be contained in a element would normally be. For example. the menu bar will be partially pink and white, but pink does not leave the menu bar in this area, and the Office has green lines on it.

    I tried to take a screenshot, but the problem resolves in about 20 seconds, but it's a recurring problem.

    It happens when I wake up, connection or not. I had also certain powers serious and problems of performance, such that my MagSafe LED would not illuminate when plugged on rare occasions, fan could turn unnecessarily, graphics performance were SUPER slow, and the health of my battery was running out quickly. I actually ran a report on the system at 2 different times and my quality of full load is depleting of 1.2% per charge cycle, which is very worrying. I went from 6281 mAh mAh 6138 maximum capacity after two cycles of load. I'm tracking closely it because at this rate, my battery will survive only at load cycles about 150 instead of the 1000 expected, gives me the idea that this could very well be a bad battery. The computer is also warm to the touch while you sleep, not connected to the power supply. I NAP active but even taking into account should not be hotter my iPhone did the same thing.

    I have reset the SMC, and it solved a couple of problems. The charger works fine now and my performance improved considerably (which made me feel better, either it is a high-performance laptop, a 11-inch MacBook Air should not he surpass), and battery life has improved. I feel even if it uses a lot of power in his sleep. Maybe I need to turn off the NAP and see if that makes a difference. The graphic bug still persists however, and I don't have enough time to see if the max battery is depleting again.

    In regards to the bug, is there something that can be done? Basically, I want to assure you that I took all appropriate measures or if someone else has this problem to see if it can be software related instead of my computer.

    I have the entry level MacBook Pro with the retina, last generation.

    Any constructive contribution welcome!

    See you soon.

    -adreaux

    Hello bernardn753,

    After reviewing your post, it seems that you are having problems with the screen showing strange things on it. Looks like you already have a troubleshooting. I recommend you read this article, as reset NVRAM would be to reset your screen resolution settings that should help.

    How to reset the NVRAM on your Mac.

    Thank you for using communities of Apple Support. Good day.

  • with IOS 10.0.2 - 5s iphone Bluetooth problems

    Since upgrading ISO 10.0.2 my M50 from PLT Plantronics (helmet unique headset) do not reliably connects with my iPhone 5 more. I have to go to the settings, activate bluetooth turned off/turned on, touch the device on the bluetooth page, etc. Once it connects successfully, it will reconnect (if I turn off the headset and turn it back on) for a short period. The next day he does not connect itself but I play with bluetooth on the iPhone again.

    It has always worked perfectly before the 10th of IOS.

    And, as I noticed others mentioning, the volume is much lower with IOS 10. The maximum volume is much lower. I can barely hear it now, more normal background noise, while driving.

    I did:

    Forget this device for the PLT M50 and paired again (several times)

    I did a Reset Network Settings

    I don't know what else to do - but it's a 10.0.2 IOS issue.

    Hello AppleUser2k,

    Please ask questions about your problems of connection between your iPhone and your Plantronics headset since you upgraded to iOS 10. I understand how important it is to have your Bluetooth devices connect with your iPhone with reliability. Here's what I recommend.

    The first thing we want to make sure is that all your data is safe. You can perform a backup in iCloud or iTunes using this article: backing up your iPhone, iPad, and iPod touch.

    Once your data is safe, try the troubleshooting steps in this article to help: get help to connect a Bluetooth accessory with your iPhone, iPad or iPod touch device should also check with the manufacturer that the device has all the drivers and firmware to work with the new version of iOS.

    If you have checked everything and that you have installed the latest firmware or driver and always are problems, please be aware of your surroundings when you encounter these problems. If you can isolate the time or location, you see the problems, you can isolate the cause. You can even see this help article to ensure that you are not affected by outside interference: the potential sources of Wi-Fi and Bluetooth.

    Thanks again and have a great rest of your day.

  • Problem after update 10.0.2 iOS iPhone touchscreen

    After I have updated to iOS 10.0.2, I noticed a problem with the touch screen. Using the position of the image on the right side, near the corner, the toushscreen does not work.
    For example: when you use the keyboard, I can't type the letter 'P', have trouble typing BACKSPACE. Using the Contacts app, I can't scroll through using the alphabet bar.

    Do what idea of the problem?

    Kind regards!

    Hi fabriciorela,

    Thanks for the upgrade to iOS 10! I understand that the right of your screen is unresponsive to the touch. You can try the steps in this link to fix the problem. If the screen of your iPhone, iPad or iPod touch does not respond to touch

    If it does not help the problem, try to restore the device to factory settings. I would like to backup your important data first.

    The backup of your iPhone, iPad and iPod touch

    Use iTunes on your Mac or PC to restore your iPhone, iPad or iPod to factory settings

    Please use the Apple Support communities to post your question. Let us know how it turns out. Have a great day.

  • Bluetooth connection problem iPhone - audio system Nissan after upgrade iOS10

    After iOS10.0.2 iOS9 on iPhone upgrade, I got a cordially problem receive calls raise Nissan car audio.

    I can make a call without any problem. Bluetooth connection is stable. I can download address book e.t.c. But I can't receive a call. I see the incoming call on the radio shows. After pressing the button "answer" on the car Audio System, audio between iPhone and Audio streams car breaks down.

    But the cellular connection remains active. I need to rotate the audio output on the screen of the iPhone car for iPhone and back to the car. After that, I can continue my call via the car radio.

    Thanks in advance

    Hello StasV,

    Thank you for using communities Support from Apple. I know having a problem with calls on your iPhone in your car, it's not what you expect. The good news is that these steps will be useful for your problem of phone calls while using the bluetooth in your car. Go to settings > general > accessibility > routing of Audio calls and the value headset/Bluetooth Headset and retest your question.

    Audio routing call - the iPhone user Guide
    Help to connect your iPhone, iPad or iPod touch with your car radio

    See you soon!

  • 2 iphones on one iTunes, problem of photo icloud account

    OK, my brother-in-law just updated its OS on his Iphone. He shared an Apple ID with his wife, who has his own iPhone. They all have two backup only in iCloud. His problem is that his wife photos are now on his phone. How can he fix it?

    Get its own identifier Apple- create and start using a Apple - Apple Support ID

  • Problem activation ISO 10 September 2016

    After my Ipad iOS 10.0.2 update I could not activate because it says I am not access with the original Apple journal. Makes no sense. I bought the new Ipad in seven of 2013 Dabs.com. She has been linked to my Apple account 10 days ago (I deleted my profile by own Apple support Web site suggestion as a way to fix my problem, the other restoration/upgrade to the Ipad with ITunes update). I contacted the support of Apple (I have two numbers in case Apple). Asked Apple support to provide a proof of purchase I made. Told me now the reception that I provided does not correspond to my Ipad, but Apple isn't going to help with all the details to help to regularize the situation. The Ipad is mine and well was linked to my account from the date of purchase in September of 2013 until I removed it at the suggestion of site specific help from Apple. I now do not have access to my ipad £460 for more than 10 days and have lost money and time talking to 4 different cooperatives of Apple, after 6 calls and none seem able to deal with a ridiculous situation. Alexandre Vitorino (Apple) seems to have the best handle on weird how this situation is. Please can someone fix this? A software update on an Ipad that I own shouldn't stop me using it and then force me to prove that I admit actually before I use it again! I'm a professional businessman who uses it for meetings of the Council. I have a receipt for my camera and get treated like a kind of criminal.

    My sincere sympathy for those who can't find their original receipt or forget their original log-in Ipad because Apple does not help, you and your Ipad will be also useless mine is currently!

    If you are in the same situation please confirm to this post. I can't be alone, if she feels like it!

    Post edited by: cibble10

    Lock activation occurs when the ID of original Apple blocking it does not match with your current Apple ID.

    Until you can bring a receipt valid from an Apple reseller or authorized, it's nothing you can do.

    BTW, the polling stations in this Apple-owned forums is prohibited. You can review the terms of use.

  • Anyone know how to solve my problem? I can't import my photos from Iphone to computer. Sign says: Photos in the camera cannot be imported because the IPhone is locked with a password or read. My phone is unlocked. I've tried everything

    Anyone know how to solve my problem? I can't import my photos from Iphone to computer. Sign says: Photos in the camera cannot be imported because the IPhone is locked with a password or read. My phone is unlocked. I tried everything, every single idea. Without success! Any other idea?

    For example, you specify that the device does not display the lock screen, correct? Do you use Touch IDS? If so, try to put your finger on the device to see if it's what he wants.

    See you soon,.

    GB

  • icloud in the iPhone activation problem 6 more

    IM someone buy iphone 6plus they don't sign Apple ID and icloud, I reset my phone and now I'm still icloud activation problem.how can I do?

    You can not. The only way is if the previous owner release form their iCloud account. If they will not do for you, it means nothing to you.

Maybe you are looking for