Results 1 to 7 of 7

Thread: Moving the needle in qwtDial using keyboard

  1. #1
    Join Date
    Jun 2015
    Location
    India
    Posts
    28
    Thanks
    7
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Android Maemo/MeeGo

    Default Re: Moving the needle in qwtDial using Mouse or keyboard

    i would like to change the value of the dial by moving the needle using Mouse or keyboard

    how do i resolve?

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,277
    Thanked 871 Times in 819 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Moving the needle in qwtDial using Mouse or keyboard


  3. #3
    Join Date
    Jun 2015
    Location
    India
    Posts
    28
    Thanks
    7
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Android Maemo/MeeGo

    Default Re: Moving the needle in qwtDial using Mouse or keyboard

    Though read only mode is false,needle is not moving using mouse

  4. #4
    Join Date
    Jun 2015
    Location
    India
    Posts
    28
    Thanks
    7
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Android Maemo/MeeGo

    Default Re: Moving the needle in qwtDial using Mouse or keyboard

    hi Uwe
    Though read only mode is false,needle is not moving using mouse

  5. #5
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,277
    Thanked 871 Times in 819 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Moving the needle in qwtDial using Mouse or keyboard

    Check the dials example and compare it with your code.

    Uwe

  6. The following user says thank you to Uwe for this useful post:

    Navi (30th June 2015)

  7. #6
    Join Date
    Jun 2015
    Location
    India
    Posts
    28
    Thanks
    7
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Android Maemo/MeeGo

    Default Re: Moving the needle in qwtDial using Mouse or keyboard

    Quote Originally Posted by Uwe View Post
    Check the dials example and compare it with your code.

    Uwe

    This is my code
    i could not do it in mouse

    void Dial::mousePressEvent(QMouseEvent *event)
    {
    if (event->button() ==Qt::LeftButton)

    myDial->setSingleSteps(4);

    }


    but i can do it in keyboard...
    void Dial::keyPressEvent(QKeyEvent *event)
    {
    if(event->key()==Qt::Key_Left)
    myDial->setSingleSteps(4);
    }
    Last edited by Navi; 30th June 2015 at 06:55.

  8. #7
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,277
    Thanked 871 Times in 819 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Moving the needle in qwtDial using Mouse or keyboard

    Throw your code away ( it doesn't make any sense - neither for keyboard or mouse events ) and use the dial as it is.

    Uwe

Similar Threads

  1. QDial in Qt4.6 is without needle?
    By raedbenz in forum Qt Programming
    Replies: 9
    Last Post: 16th July 2010, 14:57
  2. needle diagram
    By darksaga in forum Qt Programming
    Replies: 4
    Last Post: 31st March 2008, 11:01
  3. Can I Add two needle for QwtDial
    By validator in forum Qwt
    Replies: 4
    Last Post: 14th February 2008, 08:57
  4. How can I draw needle for dial in Qwt
    By validator in forum Qwt
    Replies: 6
    Last Post: 3rd February 2008, 20:27
  5. How can I resize needle of QDial
    By validator in forum Qt Tools
    Replies: 1
    Last Post: 1st February 2008, 10:10

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.