Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 3

Qt-interest Archive, March 2002
PageUp/PageDown as accelerator for QPushButton


Message 1 in thread

Hey everybody,

I'd like to use the PageUp and PageDown Keys as accelerators for a 
QPushButton, but I don't find the correct key.
I treid the following with different combinations of KEY_PAGEUP and so, 
but nothing did work:
 QPushButton *showNext = new QPushButton ( "next", gbViewer, 
"showNextSlice");
  showNext->setAccel(QAccel::stringToKey(tr("Key_PageUp")) );

E.g. CTRL+'U' works as expected, so I suppose that I just don't find the 
right code for the PageUp and PageDown keys.

Anybody's got an idea? Is there somewhere a complete list of the keys? 
Might be I want to use the cursor keys , too.

Thanks for your help,

Sebastian


Message 2 in thread

On Fri, 2002-03-08 at 10:34, Sebastian Loebbert wrote:
> Hey everybody,
> 
> I'd like to use the PageUp and PageDown Keys as accelerators for a 
> QPushButton, but I don't find the correct key.
> I treid the following with different combinations of KEY_PAGEUP and so, 
> but nothing did work:
>  QPushButton *showNext = new QPushButton ( "next", gbViewer, 
> "showNextSlice");
>   showNext->setAccel(QAccel::stringToKey(tr("Key_PageUp")) );
> 
> E.g. CTRL+'U' works as expected, so I suppose that I just don't find the 
> right code for the PageUp and PageDown keys.
> 
> Anybody's got an idea? Is there somewhere a complete list of the keys? 
> Might be I want to use the cursor keys , too.

Try Qt::Key_Up. You can find the full list of keys in the Qt Class
Reference or in the header file qnamespace.h

cheers,
tomek