Problems with GPS signal/slot

Hello

I try to get GPS information for my application. I did a class to do so.

#ifndef GPSHANDLER_H_
#define GPSHANDLER_H_

#include 

#include 

#include 
#include 
#include 

using namespace QtMobilitySubset;

class GPShandler : public QObject{
    Q_OBJECT
public:
    GPShandler(QObject* parent);
    virtual ~GPShandler();
private Q_SLOTS:
    void positionUpdatedSlot(const QGeoPositionInfo &geoInfo);

public:
    void start();

    void stop();

    double Latitude();

    double Longitude();

private:
    double mGeoInfoLat;
    double mGeoInfoLong;
    QGeoPositionInfoSource *mGeo;
};
#endif /* GPSHANDLER_H_ */
#include "GPShandler.h"

GPShandler::GPShandler(QObject* parent)
: QObject(parent) {
    mGeoInfoLat = 0;
    mGeoInfoLong = 0;
    mGeo = QGeoPositionInfoSource::createDefaultSource(this);
    if (mGeo) {
        bool checkval = connect(mGeo, SIGNAL(positionUpdated(const QGeoPositionInfo &)), this,
                SLOT(positionUpdatedSlot(const QGeoPositionInfo &)));

        mGeo->setPreferredPositioningMethods(QGeoPositionInfoSource::SatellitePositioningMethods);
        mGeo->setUpdateInterval(1000);

        //checkval = mGeo->setProperty("backgroundMode", true);
        //int i = 3;
    }
}

GPShandler::~GPShandler() {
    // TODO Auto-generated destructor stub
}

void GPShandler::positionUpdatedSlot(const QGeoPositionInfo &geoInfo) {
    // Here's where you can do something with the device's position
    mGeoInfoLat = geoInfo.coordinate().latitude();
    mGeoInfoLong = geoInfo.coordinate().longitude();
}

void GPShandler::start()
{
    mGeo->startUpdates();
}

void GPShandler::stop()
{
    mGeo->stopUpdates();
}

double GPShandler::Latitude()
{
    return mGeoInfoLat;
}

double GPShandler::Longitude()
{
    return mGeoInfoLong;
}

As you can see I have connected the signal postionUpdate() of QGeo class that I use for the positionUpdatedSlot() of the slot. I use the class as follows:

Pop = new GPShandler (this);

void::startTimer() {} App

Pop-> start();

}
void::stopTimer() {} App

Pop-> stop();

}

which are called when a key is pressed. However, the positionUpdatedSlot() of slot function is never called. I have debugged in my code and cannot find the problem. I can confirm the work of connection (function returns true), and that presented startup and shutdown functions are called as expected. Is there a reason why my slot machine function is not called?

Note: I have another implementation of signal/slot in this app:

Connect (mTimer, SIGNAL (timeout ()), this, SLOT (update ()));

and it works very well.

Thank you

Gerry

I do not know which of the following has solved my problem, but in any case, it's working now after doing these things:

1. give permission to app to device identification information. (I had already given GPS, but examples also being device identifying information I thought I'd try that)

2. remove the line:

       mGeo>setPreferredPositioningMethods(QGeoPositionInfoSource::SatellitePositioningMethods);

as an example, I created using this example: http://blackberry.github.com/Cascades-Samples/geo-locationdiagnostics.html did not have this line

Tags: BlackBerry Developers

Similar Questions

  • Problem with PCI-e slots on the S51200ZCTO Pavilion

    Hello.  I bought this computer for use as a media server, replacing a 3300Z failed two weeks ago.  One of its functions is my AV receiver Rs232 command  I bought an adapter cheap PCI-e series online and installed.  The machine refused to start with the card installed in one of the three locations.  Attached to the HP splash screen.  Decided that my card 12 was obvious junk, I went downtown and bought another card for $30.  Same question.

    What I did:

    Disabled all 3 PCIe x 1 slots and slot of the minimap.

    The machine will start with the card installed, but of course, it's kind of useless.

    I activated the slots selectively.

    The machine will fail to start whenever the first location is enabled and one of the two cards is installled.

    If the first location is disabled, I can activate only two and three slots and the machine starts correctly with each installed card.

    I installed each card in turn in slot 2 and enabled only the slot 2 in the bios.

    Windows 7 can not find two cards.

    I manually installed each card in turn.

    They have installed but shows an error code 10 (device cannot be started)

    I have about confcluded that there must be a motherboard problem.

    I am a very technical user.  I have been upgraded and now my own machines for about 25 years and I've never met this kind of problem with a simple installation device PnP.

    If anyone has any idea I will try it.  I'm not enjoying the thought of working my way through levels of support for HP to convince them that there is a real problem or to ship the computer for repairs.

    Thanks for the chipset, here is another card:

    http://www.Newegg.com/product/product.aspx?item=N82E16815124112

  • Problem with crack & signals on Page 2

    Hello

    I would like to create application consisting of two pages.

    I use qml to build the user interface and C++ to build application logic.

    On the first page singal control I have recive in C++ code, but on the second Page (put on NavigationPane using push) reports not woking. Connect function returns true but singnal appears not in the C++ code.

    SecondPage::SecondPage() {
    }
    
    SecondPage::~SecondPage() {
    }
    
    bb::cascades::AbstractPane* SecondPage::showPage()
    {
        QmlDocument *qml = QmlDocument::create("mainList.qml");
        Page* pageRoot = qml->createRootNode();
        NavigationPane* navigationPane = TestSlotsApplication::getInstance()->getNavigationPane();
    
        navigationPane->push(pageRoot);
    
        if (pageRoot == NULL)
        {
            qDebug("pageRoot == NULL");
            return NULL;
        }
        else
        {
            navigationPane->setBackButtonsVisible(false);
            qDebug("pageRoot != NULL");
        }
    
        QObject* buttonTest = pageRoot->findChild("buttonTest");
        bool result2 = QObject::connect(buttonTest, SIGNAL(clicked()), this,
                SLOT(buttonOkClicked()));
        if (result2 == true) {
            qDebug("buttonTest connect ok");
        } else {
            qDebug("buttonTest connect error");
        }
    
        return pageRoot;
    }
    
    void SecondPage::buttonOkClicked()
    {
        qDebug("buttonOkClicked"); // NEVER SHOWS buttonOkClicked
    }
    

    If someone would like to put code on dropbox: https://dl.dropbox.com/u/464625/Test.zip

    Hello

    Actually it's not the class SecondPage but in FirstPage class.

    Simply replace the function of buttonOkClicked() with this code in the class FirstPage.

    void FirstPage::buttonOkClicked()
    {
         SecondPage *page = new SecondPage;
         page->showPage();
    }
    

    You must allocate memory by using the new keyword.

  • Problem with GPS in very remote locations...

    Hello

    I recently went to some remote areas of Western Australia. My phone is an old 4S running 9.3.5

    In these remote areas, I had either no reception iphone mobile, or the receipt of another carrier (to what I had) so all the

    I could get is SOS capacity in these areas.

    The GPS of the iphone did not work (location services). I got iphone apps preloaded for the trip, but because the GPS does not work I could not use them. It is, has it been fixed for iphones later, or do you need always mobile reception to get the GPS to work?

    Dissapointingly, I had to go back to my old windows phone where the GPS worked. The apps I had already downloaded for the iphone

    and windows phone had full maps already downloaded (as they were the map apps) for the region, in that I was.

    Thanks in advance. Stephen

    What app?

    This may be a limitation of the application in question against the GPS hardware in the phone.

  • Problem of GPS location after updating to IOS 10

    Anyone have problems with GPS location problem after update from IOS10?

    I drove Baltimore DC Regan airport, I tried with apple and Google map yesterday map, location was far from the highway, he could not determine where we are, we were on the road, but he kept us showing that we were on a local road to the highway.  Could not find 90% of time on my road.  Finally, I have to use my phone to brother with IOS9, we were fortunate that it has not updated to the most recent IOS 10.

    I wonder if anyone has the same problem after the update.

    Hello yinchiu85,

    I understand that your iPhone seems to have a hard time determining its location precisely. Fortunately, there are a number of steps you can take to help improve the accuracy of the information.

    Improve the accuracy of GPS

    GPS accuracy depends on the number of visible GPS satellites. Location of all visible satellites can take several minutes, with accuracy gradually increasing over time. To improve the accuracy of the GPS:

    • Make sure that you set the date, time and timezone correctly on the device in settings > general > Date & time. If possible, use the value automatically.
    • Keep a clear vision in several directions. Walls, vehicle roofs, buildings of great height, mountains and other obstacles can block the line of sight to GPS satellites. In this case, your device uses Wi - Fi or cellular networks to determine your position until the GPS satellites are still visible.

    If your iPhone is still unable to pinpoint your position, the next step would be to restore location Services.

    If you want to reset all settings to factory default location, go to settings > general > reset and tap reset card and privacy. When your location and privacy settings are reset, apps will be stop using your location until you grant them permission.

    On privacy and location in iOS Services 8 and later versions
    https://support.Apple.com/en-us/HT203033

  • Problems with wifi, bluetooth and gps in my iphone after updating iOS 6

    After that the last iOS 9.3 update my iphone 6 has problems with wifi, bluetooth and gps. Now, my wifi connection is slower and falls easily on a short distance. My bluetooth does the same. But the biggest problem is the GPS on my phone. I tried Island:

    -By doing a reset network

    -Do a reset total and restore my phone

    -To restart my phone twice.

    -Audit and third-party applications unnistalling

    Nothing works. I was in the apple store where they checked my phone and they say everything is ok with the phone. I'm not crazy, and I know when something does not work correctly. Also, I think it's iOS 9.3 update a reaponsible for my phone issues.

    Please fix bugs fast.

    Having the same exact problems since the upgrade. In addition, battery drains very quickly now, and sometimes the phone becomes very hot. It took to the Genius Bar and they told me everything was normal in the diagnostic tests. Restored, restarting, etc., and always the same problems. GPS locates me, but then don't follow my movement at all and told to go outside as the gps is not detected even if I am outside. Bluetooth connection to the car and watch grave intermittently. Signal WiFi is greatly reduced and falls easily.

  • my iPhone 6s has problems with the GPS when I use some applications, it does not work well and give especially the bad road. Can someone help me?

    my iPhone 6s has problems with the GPS when I use some applications, it does not work well and give especially the bad road. Can someone help me?

    My iphone 6 has started having the same problem. Its literally the GPS. Saying that it does not find me at all. Ive seen say location for more than an hour in the suburbs of chicago. It started to happen to me after I downloaded the latest update for the iphone. I hope they react and let you know what is happening because I'm dying to know as well.

  • Problem with P10-873 SD Slot

    I'm having a problem with the slot SD on my P10. The problem is that when I insert an SD card, it reads the card and keep reading. Then, the computer stops responding. When the computer finally answers I get an i/o device error.

    Any ideas how I could get this to work? I've had the problem since I bought the PC and tried several SD cards, brand new and very functional. I tried to uninstall and reinstall the driver for it on the CD and also the Web site with no luck. When I did this, the computer would read then don't detect any card and stop playback.
    Then I reinstalled again and I'm back to this old problem.

    The SD slot is installed as "SDA Standard compatible SD host controller."

    When I insert the card, it appears as "Secure digital storage device." If I try to change the driver for this I get two options:

    > Version: 6.0.4064.1 [2002-01-10] SD storage card

    When I use it, the card is read and read continuously until an IO device error appears. The ocmputer does not respond within the interval.

    > Version: 6.0.4069.1 [2002-01-10] SD storage card

    When I use it, a yellow exclamation point appears on the SD card in the Device Manager and the error message indicates that the device failed to start. Even after a reboot, same problem.

    Any help would be appreciated, thanks.

    Post edited by: hamidelaosta

    I just found out that the problem was caused by Norton Antivirus. The problem was that norton is set to scan all removable media for boot sector viruses, this is for a reason any causes the SD card to stop responding for a very long time, and then causes an error of e/s. I have disabled removable media scanning and it's working now, at the expense of some system of protection.
    Hope this helps someone find something else that they have problems with this.

  • Acquisition with USRP 2953R of the GPS signal

    Hi all

    How can I configure a 2953R USRP receive GPS signals? I have an antenna VERT900 connected to the GPS ANT of the USRP port, but in the example VI 'niUSRP EX Rx with GPS', I can't reference this port in the field 'Active antenna'. I put only things like TX/RX or RX1 etc. Should what values I put in other areas as well? I know that the L1 band is 1575,42 MHz.

    Hello

    The example you posted shows you how to acquire an RF signal on the ports of the USRP with internal clock RF and sources of reference defined in the GPS.

    To make it work properly, you must have a GPS antenna connected to the Terminal on the GPS device and installed in a place that receives a good level of GPS signal.

    The other control of antenna on the schema defines the port on which to receive the RF signal.

    If you want to capture and analyze the signal GPS (RF) itself, you can tune into the front-end RF (carrier frequency) at the right frequency of GPS band and connect your GPS antenna to the RF port.

    You can use the simple niUSRP EX Rx continuous Async.vi in this case (but may not work due to the very low consumption of GPS RF signal)

  • Error: 200279. Problems with playback of three signals with NI 9234

    I try to read three signals at the same time with the NI 9234. But I have the problem with the buffer, I have read about this error and tried all the solution they gave (sample of Crescent by channel, increasing the number of samples per channel or decrease rate) but still nothing. I also try architecture design of producer/consumer model, but nothing, it always get this error. Someone knows how to fix this?

    lincoln1991 wrote:

    Well, I realized that the error only occurred when I was to "highlight the execution", it's wear and tear

    So problem solved.  Now you know why.

  • Problems with signal followed during sampling of the signal

    Hello

    I'm relatively new to LabVIEW 8.0 and I'm having a problem with being able to monitor the signals that I am gaining two simultaneous analog signals.  I have the user to input the frequency of sampling and the length of the sample, and then I starts the scan, but when running the analysis, I don't see no result on the chart if the duration of the sample is passed, at which point all data comes.  Previously, I could see the acquisition of real-time data and I don't know what I've done since then have possibly that stop working.  I tried to introduce a kind of late for may allow the software to apply the data to the graphics, but I had no success.

    I have attached the VI of the data acquisition component.

    Thank you so much for reading this.

    Hello

    I suggest you try these two options:

    1. in each iteration of the while loop, add your data to the data of the previous iteration, IE use a shift register to create an Adrien to data that you have acquired. When you save the data in a file, read data from the table and not the current value of the waveform. You can read the data in the table by using a queue, or by using any simple method to pass data between the blocks.

    When you use a local variable of the waveform card, you only read the current value in the array, not its history.

    2. use a property of waveform graphs node to read the history of the ranking, convert the picture from picture to picture 1 d 2D using cluster of waveform ungroup functions and write to the file, click on "Save".

  • [FPGA] Problem with the sinusoidal signal generator

    Hello!

    At first I want to apologize for my English is not my mother tongue.

    Hardware and software I use is:

    LabVIEW 8.5

    NEITHER RIO 2.4.1

    NEITHER cRIO-9014 (controller in time real CompactRIO)

    NEITHER cRIO-9104 (chassis and FPGA)

    NEITHER 9264 (16 channels, +-10V, 16-bit voltage analogue output Module)

    I made a very simple FPGA VI: a while loop, generator of sinusoidal signal and a FPGA of e/s node in the loop. I've specified the Gnerator settings by following the path:

    Frequency = 50 Hz
    Amplitude = 1
    Phase shift = 0.00
    Size of the table look-up = 1024
    = 16-bit amplitude resolution

    FPGA clock frequency (40 MHz)

    But the wave of "sine" I got is not what I wanted to get. First of all, its amplitude is 1 V. shouldn't it be coded on 16 bits? If I wanted to get 1V I should have specified Amplitude as a 3277. In addition, 'sine' is not very detailed, it's look like "steps", as many samples vere missing. What I did wrong? I checked the samples and tutorials, I did everything the same way. A I forgot something or not has not specify other parameters?

    Thanks a lot for your help!

    OK, I solved a problem. It's embarrassing to admit, but maybe this will help someone else I blame my inexperience

    The main solution to the problem was changing calibration of calibrated RAW Mode. After that, everythoing works as expected. I had a problem with a sample because I was using a multiplier to control the generated sine wave amplitude. But... She was set to 1 in the sinusoidal signal generator. That was the reason for waveform Gradin. Please, don't laugh too much

    In any case, thank you for an answer! It is now resolved

  • 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...

  • Problems with the GPS on Z2

    Hello!

    I had a problem with my Z2 gps system. Tell me a little bit of the app my GPs is off when it is not and the weather widget can't find my place and whem I'm lucky he does but he is completely wrong, usealy 15km in the wrong direction. Strangely many of the fine required GPS application. Restart the phone has not worked and re - install the app nonfunctional of nor. At first, I thought the problems where in the application, but I can't believe that that many app have the same problem and also the weather widget that was installed at the factory does not work... There was another similar or the same problems? and does anyone have a solution?

    Phone:
    Sony Experia Z2
    Model:
    D6503
    Android version:
    4.4.2
    Buildnr:
    17.1.A.2.55

    Hello and welcome to the community! Since you are new, please make sure that you have checked our Forum.

    You can check the location settings if you go to settings > location. Go to high precision mode.

    If this does not help, try the following:

    Open the phone app > press on * #* #* #* #7378423 > service testing > GPS > purge data of assistance.

    Restart the machine and try to get your location when outdoors.

  • Problem with signal sony z2

    Hello, I have problem with my Sony z2 that I have weak signal mobile after update to new android 5.1.1 build number 23.4.A.1.264

    Before the updates signal was better.

    @Izaaa

    You can't unless you use flashtool or xperiafirm, or contact your Local support

    If I were you, I would repair the phone with PCC

    software repair

    PC Companion (CCP)

    Bridge (for Mac)

    Alternatives on how to backup Xperias

    http://talk.sonymobile.com/thread/36355

Maybe you are looking for

  • Unable to send an email with picture 36. because they say its 50 photo

    I use hotmail trying to convey a msg that has 36 pic, but it says that it cannot be sent because the limit is 50. I need to delete some before it can go. Why they say 50 when his 36?

  • Running Java?

    On the news today, they say I should stop using Java and uninstall it. How will this affect my XP Home Edition?

  • vocal mic. Sam. need a new.

    I always want my mic.sam voice to not sound like a squirrel in any case to have another voice or difficulty of him tried to deepen his voice. anyway to download new voices.   Thank you cindy

  • I always have to reset the Date & time...

    Whenever I turn on my computer, I have to reset the time & date. How can I fix?

  • HP Deskjet 3050 device non-reachable

    So, here's the skinny: I am running on a Macbook, OS X 10.5.8 and use a Belkin, WPA router and try to connect a Deskjet 3050 J610 Series. I have already successfully been printing, scanning, copying for a few months. In fact my last impression was a