Cursor and green square 16x16 at startup



  • Hello,
    Something I always noticed but never solved because I was to leazy:
    At sturtup usually qtembedded (QWS server) show a little green square 16x16 within a mouse pointer.
    How can I remove it? (Now I have to...)
    Hiding the mouse is not a solution because the little square remains.
    And I can't recompile qt with the option "-no-feature-CURSOR".
    Is this something we can do?

    Thanks!


  • Lifetime Qt Champion

    Hi,

    Can you show an image of that ?



  • It's the classic square in the middle of the screen everyone saw one time in his qt-life, nothing special. Anyway I'm sorry but I didn't find an image to link.



  • I'm talking about QtEmbedded



  • Hi Ale82,

    If I understand correctly, Your display is bigger in size and your Qt application size is smaller than that. Since you are not utilizing the complete screen, the rest left out space shows in green color.

    Hope am correct. Because, even I do see the same behaviour here in my embedded target.

    This is nothing to do with QWS server. Its just that you dont use the full space.

    Suggest you to do develop the application which utilizes the full screen.

    Hope it helps.



  • You need to call update();after turning off the Mousepointer in QWS.



  • Sorry for reopening the old thread. I too see this green sqaure at the startup. Any solution for this issue ?

    My display is 160 X 128 LCD. No touch screen, no mouse pointer.

    Here is the code sample I have written

    int main(int argc, char *argv[])
    {
    QApplication a(argc, argv);
    #ifdef Q_WS_QWS
    QWSServer::setCursorVisible( false );
    a.setOverrideCursor( QCursor( Qt::BlankCursor ) );
    QWSServer::setBackground(QBrush(Qt::black));
    #endif

    MainWindow w;
    w.setWindowFlags(Qt::Window | Qt::FramelessWindowHint);
    w.setStyleSheet("background-color: Black;");
    
    
    w.show();
    a.exec();
    return a.exec();
    

    }

    Thank you



  • Did you add update(); after turning it off, as mentioned before?

    The easiest way to turn the cursor off is to call your application with -nomouse, i.e.:
    /bin/application -nomouse -qws

    btw: If you have set the cursor invisible with QWSServer::setCursorVisible( false );, there's no need to set a blank override cursor.



  • Where to add the update() function.

    I get this error :
    main.cpp: In function ‘int main(int, char**)’:
    main.cpp:72:9: error: ‘update’ was not declared in this scope

    I have added before Mainwindow w; line.



  • You can not call update() in main before any widget is created.
    http://doc.qt.io/qt-4.8/qwidget.html#update

    I do turn off/on the cursor from code if needed. After turning it off, the update() is needed.
    On the application start, use the -nomouse and the application will start without cursor and there is no need to call update() at that point.

    So in your case, if you never need to see the cursor, you best start with -nomouse.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.