Results 1 to 20 of 20

Thread: Flickering mouse pointer

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2010
    Posts
    29
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Flickering mouse pointer

    An extremely simple text editor accepts external file drop changing its title:
    Qt Code:
    1. MainWindow::MainWindow(QWidget *parent) :
    2. QMainWindow(parent),
    3. ui(new Ui::MainWindow)
    4. {
    5. ui->setupUi(this);
    6. setAcceptDrops(true);
    7. }
    8.  
    9. void MainWindow::dragEnterEvent(QDragEnterEvent *event)
    10. {
    11. event->accept();
    12. }
    13.  
    14. void MainWindow::dragMoveEvent(QDragMoveEvent *event)
    15. {
    16. event->accept();
    17. }
    18.  
    19. void MainWindow::dropEvent(QDropEvent *event)
    20. {
    21. if (event->mimeData()->hasFormat("text/uri-list")) {
    22. QList<QUrl> urls = event->mimeData()->urls();
    23. if (urls.isEmpty())
    24. return;
    25. QString fileName = urls.first().toLocalFile();
    26. if (fileName.isEmpty())
    27. return;
    28. setWindowTitle(tr("%1 - %2").arg(fileName).arg(tr("Drag File")));
    29. }
    30. }
    To copy to clipboard, switch view to plain text mode 
    MainWindow has just one widget, textEdit, defined by:
    Qt Code:
    1. MyTextEdit::MyTextEdit(QWidget *parent)
    2. : QTextEdit(parent)
    3. {
    4. setAcceptDrops(true);
    5. }
    6.  
    7. void MyTextEdit::dragEnterEvent(QDragEnterEvent *e)
    8. {
    9. if (e->source()) {
    10. if (e->source() == viewport()) {
    11. e->accept();
    12. }
    13. }
    14. }
    To copy to clipboard, switch view to plain text mode 
    textEdit accepts only "self" drops, so inserted text can then be moved or copied.
    What is the reason of the pointer flickering? How can i remove it?
    Thanks.
    Last edited by guiQt; 31st August 2010 at 17:25.

  2. #2
    Join Date
    Mar 2010
    Posts
    29
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Flickering mouse pointer

    Bump

  3. #3
    Join Date
    Mar 2010
    Posts
    29
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Flickering mouse pointer

    Looking for an answer

  4. #4
    Join Date
    Mar 2010
    Posts
    29
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Flickering mouse pointer

    Rebump

  5. #5
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Flickering mouse pointer

    I can't see any problem in your code, so can you please provide a minimal compilable example reproducing your problem.

  6. #6
    Join Date
    Mar 2010
    Posts
    29
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Flickering mouse pointer

    droptest example
    Problem shows up when you try to move/copy any entered word by dragging/Ctrl+dragging.
    Attached Files Attached Files
    Last edited by guiQt; 12th September 2010 at 09:41.

  7. #7
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Flickering mouse pointer

    Can't reproduce it here on Mac. Where did you see it, Linux (which) or Windows or both?

  8. #8
    Join Date
    Mar 2010
    Posts
    29
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Flickering mouse pointer

    Ubuntu 10.04. Not tested on Windows.

  9. #9
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Flickering mouse pointer

    I have tested on kubuntu 10.4 and there is no "flicker", and can test on ubuntu, but a little bit later

    LE:tested on ubuntu 10.4 and didn't flicker.
    Last edited by Zlatomir; 12th September 2010 at 11:43.

  10. #10
    Join Date
    Mar 2010
    Posts
    29
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Flickering mouse pointer

    Well, I'm pleased with the correctness of the code, but astonished with the configuration of my system.
    Can't think about anything correlated...

  11. #11
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Flickering mouse pointer

    Try playing with performance settings.

    - Update your graphics driver
    - Try disabling some desktop effects

Similar Threads

  1. Is it possible to hide mouse pointer??
    By webquinty in forum Newbie
    Replies: 5
    Last Post: 24th November 2009, 14:57
  2. changing mouse pointer
    By bhogasena in forum Qt Programming
    Replies: 2
    Last Post: 29th January 2009, 15:57
  3. free mouse pointer
    By raflegan in forum Qt Programming
    Replies: 1
    Last Post: 1st October 2008, 14:11
  4. How can I hide the mouse pointer?
    By dimaz in forum Qt Programming
    Replies: 2
    Last Post: 22nd August 2008, 19:08
  5. Scribble example: problem with mouse pointer
    By srinath1986 in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 24th February 2008, 13:13

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.