Results 1 to 5 of 5

Thread: MacOS Key_F9 becomes Key_8

  1. #1
    Join Date
    Jun 2009
    Posts
    37
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default MacOS Key_F9 becomes Key_8

    Hi people!!!

    I have a strange behaviour on MacOS X... On my QAction I have set the following

    Qt Code:
    1. QAction my1Action = new QAction(this);
    2. my1Action->setShortcut(Qt::Key_F9);
    3. my1Action->setText(tr("My 1st action"));
    4. connect(...)
    5.  
    6. QAction my2Action = new QAction(this);
    7. my2Action->setShortcut(QSequence(Qt::SHIFT + Qt::Key_F9));
    8. my2Action->setText(tr("My 2nd action"));
    9. connect(...)
    To copy to clipboard, switch view to plain text mode 

    Now... why in my menu do I see the following???
    (in the menu, F9 is replaced by a 8)...
    f9-8.png

    This happens only on Mac, on windows it works pretty well.

    Thanks for any hint...

  2. #2
    Join Date
    Sep 2011
    Location
    Manchester
    Posts
    538
    Thanks
    3
    Thanked 106 Times in 103 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: MacOS Key_F9 becomes Key_8

    That's odd...
    Does it happen for all keys or only F9?

  3. #3
    Join Date
    Jun 2009
    Posts
    37
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: MacOS Key_F9 becomes Key_8

    Hi Spitfire.

    Thank you for taking the time to answer me
    Only with F9... I saw on Mac documentation that Function keys from F9 to F12 are used by OSX to handle Dashbord and windows behaviour... I'm quite sure it is related...
    Anyway, I could not find out why it uses the 8...

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

    Default Re: MacOS Key_F9 becomes Key_8

    Hi,

    Qt Code:
    1. #include <QtGui>
    2.  
    3. int main(int argc, char *argv[])
    4. {
    5. QApplication a(argc, argv);
    6.  
    7.  
    8. QAction* my1Action = new QAction(&w);
    9. my1Action->setShortcut(Qt::Key_F9);
    10. my1Action->setText("My 1st action");
    11.  
    12. QAction* my2Action = new QAction(&w);
    13. my2Action->setShortcut(QKeySequence(Qt::SHIFT + Qt::Key_F9));
    14. my2Action->setText("My 2nd action");
    15.  
    16. QMenu m;
    17. m.addAction(my1Action);
    18. m.addAction(my2Action);
    19. m.setTitle("test");
    20. w.menuBar()->addMenu(&m);
    21.  
    22. w.show();
    23.  
    24. return a.exec();
    25. }
    To copy to clipboard, switch view to plain text mode 
    works just fine on my MacOSX 10.6.8 (MacBook Pro).

  5. #5
    Join Date
    Jun 2009
    Posts
    37
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: MacOS Key_F9 becomes Key_8

    Ok... that means it's a misconfiguration on my mac...

    Thank you very much!


    Added after 9 minutes:


    I put up a Brand new Mac OS 10.7.3 machine... Installed Xcode and QT and...
    there it is... F9 is replaced with an 8...
    I'll investigate further, but I think this problem starts with the 10.7.3 update released in march 2012...
    Last edited by JoZCaVaLLo; 30th March 2012 at 13:54.

Similar Threads

  1. OpenCV with MacOS 10.6 Example?
    By nelagnelag in forum Qt Programming
    Replies: 0
    Last Post: 16th August 2010, 17:08
  2. QT-opencv-MACOS
    By ireneluis in forum Qt Programming
    Replies: 0
    Last Post: 15th March 2010, 04:25
  3. QLineEdit on MacOS X
    By bunjee in forum Qt Programming
    Replies: 0
    Last Post: 24th November 2009, 15:20
  4. Qt 4.5.0 under MacOS-X
    By hunsrus in forum Qt Programming
    Replies: 0
    Last Post: 13th March 2009, 10:50
  5. Another MacOS issue ?!
    By Nemo in forum Qt Programming
    Replies: 3
    Last Post: 14th February 2006, 09:16

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.