kdeui Library API Documentation

kshortcutdialog_simple.cpp

00001 #include <klocale.h>
00002 /****************************************************************************
00003 ** Form implementation generated from reading ui file './kshortcutdialog_simple.ui'
00004 **
00005 ** Created: Wed Feb 4 11:24:08 2004
00006 **      by: The User Interface Compiler ($Id: qt/main.cpp   3.2.3   edited May 19 14:22 $)
00007 **
00008 ** WARNING! All changes made in this file will be lost!
00009 ****************************************************************************/
00010 
00011 #include "kshortcutdialog_simple.h"
00012 
00013 #include <qvariant.h>
00014 #include <kpushbutton.h>
00015 #include <qlabel.h>
00016 #include <qpushbutton.h>
00017 #include <qlayout.h>
00018 #include <qtooltip.h>
00019 #include <qwhatsthis.h>
00020 
00021 /*
00022  *  Constructs a KShortcutDialogSimple as a child of 'parent', with the
00023  *  name 'name' and widget flags set to 'f'.
00024  */
00025 KShortcutDialogSimple::KShortcutDialogSimple( QWidget* parent, const char* name, WFlags fl )
00026     : QWidget( parent, name, fl )
00027 {
00028     if ( !name )
00029     setName( "KShortcutDialogSimple" );
00030     KShortcutDialogSimpleLayout = new QGridLayout( this, 1, 1, 0, KDialog::spacingHint(), "KShortcutDialogSimpleLayout"); 
00031 
00032     textLabel2 = new QLabel( this, "textLabel2" );
00033 
00034     KShortcutDialogSimpleLayout->addWidget( textLabel2, 0, 0 );
00035     QSpacerItem* spacer = new QSpacerItem( 20, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
00036     KShortcutDialogSimpleLayout->addItem( spacer, 1, 0 );
00037 
00038     m_txtShortcut = new KPushButton( this, "m_txtShortcut" );
00039     m_txtShortcut->setPaletteBackgroundColor( QColor( 255, 255, 255 ) );
00040     m_txtShortcut->setCursor( QCursor( 4 ) );
00041     m_txtShortcut->setFocusPolicy( KPushButton::ClickFocus );
00042     m_txtShortcut->setAutoDefault( FALSE );
00043     m_txtShortcut->setDefault( FALSE );
00044 
00045     KShortcutDialogSimpleLayout->addWidget( m_txtShortcut, 0, 3 );
00046 
00047     m_btnClearShortcut = new QPushButton( this, "m_btnClearShortcut" );
00048     m_btnClearShortcut->setFlat( TRUE );
00049 
00050     KShortcutDialogSimpleLayout->addWidget( m_btnClearShortcut, 0, 2 );
00051     QSpacerItem* spacer_2 = new QSpacerItem( 40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00052     KShortcutDialogSimpleLayout->addItem( spacer_2, 0, 4 );
00053     languageChange();
00054     resize( QSize(177, 36).expandedTo(minimumSizeHint()) );
00055     clearWState( WState_Polished );
00056 }
00057 
00058 /*
00059  *  Destroys the object and frees any allocated resources
00060  */
00061 KShortcutDialogSimple::~KShortcutDialogSimple()
00062 {
00063     // no need to delete child widgets, Qt does it all for us
00064 }
00065 
00066 /*
00067  *  Sets the strings of the subwidgets using the current
00068  *  language.
00069  */
00070 void KShortcutDialogSimple::languageChange()
00071 {
00072     setCaption( tr2i18n( "KShortcutDialogSimple" ) );
00073     textLabel2->setText( tr2i18n( "Shortcut:" ) );
00074     m_txtShortcut->setText( tr2i18n( "Alt+Tab" ) );
00075     m_btnClearShortcut->setText( tr2i18n( "x" ) );
00076     QToolTip::add( m_btnClearShortcut, tr2i18n( "Clear shortcut" ) );
00077 }
00078 
00079 #include "kshortcutdialog_simple.moc"
KDE Logo
This file is part of the documentation for kdeui Library Version 3.2.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Feb 4 12:34:19 2004 by doxygen 1.2.18 written by Dimitri van Heesch, © 1997-2003