parts/quickopen/quickopenbase.cpp
Go to the documentation of this file.00001
#include <kdialog.h>
00002
#include <klocale.h>
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
#include "quickopenbase.h"
00013
00014
#include <qvariant.h>
00015
#include <qlabel.h>
00016
#include <klistbox.h>
00017
#include <qpushbutton.h>
00018
#include <qlayout.h>
00019
#include <qtooltip.h>
00020
#include <qwhatsthis.h>
00021
#include "doclineedit.h"
00022
00023
00024
00025
00026
00027
00028
00029
00030 QuickOpenDialogBase::QuickOpenDialogBase(
QWidget* parent,
const char* name,
bool modal, WFlags fl )
00031 :
QDialog( parent, name, modal, fl )
00032 {
00033
if ( !name )
00034 setName(
"QuickOpenDialogBase" );
00035 setSizeGripEnabled( TRUE );
00036
QuickOpenDialogBaseLayout =
new QGridLayout(
this, 1, 1, 11, 6,
"QuickOpenDialogBaseLayout");
00037
00038
nameLabel =
new QLabel(
this,
"nameLabel" );
00039
00040
QuickOpenDialogBaseLayout->addWidget(
nameLabel, 0, 0 );
00041
00042
itemListLabel =
new QLabel(
this,
"itemListLabel" );
00043
00044
QuickOpenDialogBaseLayout->addWidget(
itemListLabel, 2, 0 );
00045
00046
itemList =
new KListBox(
this,
"itemList" );
00047
00048
QuickOpenDialogBaseLayout->addWidget(
itemList, 3, 0 );
00049
00050
Layout1 =
new QHBoxLayout( 0, 0, 6,
"Layout1");
00051
Horizontal_Spacing2 =
new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00052
Layout1->addItem(
Horizontal_Spacing2 );
00053
00054
buttonOk =
new QPushButton(
this,
"buttonOk" );
00055
buttonOk->setAutoDefault( TRUE );
00056
buttonOk->setDefault( TRUE );
00057
Layout1->addWidget(
buttonOk );
00058
00059
buttonCancel =
new QPushButton(
this,
"buttonCancel" );
00060
buttonCancel->setAutoDefault( TRUE );
00061
Layout1->addWidget(
buttonCancel );
00062
00063
QuickOpenDialogBaseLayout->addLayout(
Layout1, 4, 0 );
00064
00065
nameEdit =
new DocLineEdit(
this,
"nameEdit" );
00066
nameEdit->setSizePolicy(
QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0,
nameEdit->sizePolicy().hasHeightForWidth() ) );
00067
nameEdit->setMinimumSize(
QSize( 0, 18 ) );
00068
nameEdit->setFocusPolicy( DocLineEdit::WheelFocus );
00069
00070
QuickOpenDialogBaseLayout->addWidget(
nameEdit, 1, 0 );
00071
languageChange();
00072 resize(
QSize(369, 331).expandedTo(minimumSizeHint()) );
00073 clearWState( WState_Polished );
00074
00075
00076 connect(
buttonOk, SIGNAL( clicked() ),
this, SLOT( accept() ) );
00077 connect(
buttonCancel, SIGNAL( clicked() ),
this, SLOT( reject() ) );
00078 connect(
itemList, SIGNAL(
executed(
QListBoxItem*) ),
this, SLOT(
slotExecuted(
QListBoxItem*) ) );
00079 connect(
itemList, SIGNAL( returnPressed(
QListBoxItem*) ),
this, SLOT(
slotExecuted(
QListBoxItem*) ) );
00080 connect(
buttonOk, SIGNAL( clicked() ),
this, SLOT(
slotReturnPressed() ) );
00081 connect(
nameEdit, SIGNAL( returnPressed() ),
this, SLOT(
slotReturnPressed() ) );
00082 connect(
nameEdit, SIGNAL( textChanged(
const QString&) ),
this, SLOT(
slotTextChanged(
const QString&) ) );
00083
00084
00085 setTabOrder(
nameEdit,
itemList );
00086 setTabOrder(
itemList,
buttonOk );
00087 setTabOrder(
buttonOk,
buttonCancel );
00088
00089
00090
nameLabel->setBuddy(
nameEdit );
00091
itemListLabel->setBuddy(
itemList );
00092 }
00093
00094
00095
00096
00097 QuickOpenDialogBase::~QuickOpenDialogBase()
00098 {
00099
00100 }
00101
00102
00103
00104
00105
00106 void QuickOpenDialogBase::languageChange()
00107 {
00108 setCaption( tr2i18n(
"Quick Open" ) );
00109
nameLabel->setText( tr2i18n(
"[NAME]" ) );
00110
itemListLabel->setText( tr2i18n(
"[ITEM LIST]" ) );
00111
buttonOk->setText( tr2i18n(
"&OK" ) );
00112
buttonOk->setAccel(
QKeySequence( QString::null ) );
00113
buttonCancel->setText( tr2i18n(
"&Cancel" ) );
00114
buttonCancel->setAccel(
QKeySequence( QString::null ) );
00115 }
00116
00117 void QuickOpenDialogBase::slotTextChanged(
const QString&)
00118 {
00119 qWarning(
"QuickOpenDialogBase::slotTextChanged(const QString&): Not implemented yet" );
00120 }
00121
00122 void QuickOpenDialogBase::slotReturnPressed()
00123 {
00124 qWarning(
"QuickOpenDialogBase::slotReturnPressed(): Not implemented yet" );
00125 }
00126
00127 void QuickOpenDialogBase::executed(
QListBoxItem*)
00128 {
00129 qWarning(
"QuickOpenDialogBase::executed(QListBoxItem*): Not implemented yet" );
00130 }
00131
00132 void QuickOpenDialogBase::slotExecuted(
QListBoxItem*)
00133 {
00134 qWarning(
"QuickOpenDialogBase::slotExecuted(QListBoxItem*): Not implemented yet" );
00135 }
00136
00137
#include "quickopenbase.moc"
This file is part of the documentation for KDevelop Version 3.0.4.