kshortcutdialog_simple.cpp

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