• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KIO

  • kio
  • kio
pastedialog.cpp
Go to the documentation of this file.
1/* This file is part of the KDE libraries
2 Copyright (C) 2005 David Faure <faure@kde.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License version 2 as published by the Free Software Foundation.
7
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details.
12
13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 Boston, MA 02110-1301, USA.
17*/
18
19#include "pastedialog.h"
20
21#include <kcombobox.h>
22#include <klineedit.h>
23#include <klocale.h>
24
25#include <QApplication>
26#include <QLabel>
27#include <QLayout>
28#include <QClipboard>
29
30KIO::PasteDialog::PasteDialog( const QString &caption, const QString &label,
31 const QString &value, const QStringList& items,
32 QWidget *parent,
33 bool clipboard )
34 : KDialog( parent )
35{
36 setCaption( caption );
37 setButtons( Ok | Cancel );
38 setModal( true );
39 setDefaultButton( Ok );
40
41 QFrame *frame = new QFrame;
42 setMainWidget( frame );
43
44 QVBoxLayout *layout = new QVBoxLayout( frame );
45
46 m_label = new QLabel( label, frame );
47 layout->addWidget( m_label );
48
49 m_lineEdit = new KLineEdit( value, frame );
50 layout->addWidget( m_lineEdit );
51
52 m_lineEdit->setFocus();
53 m_label->setBuddy( m_lineEdit );
54
55 layout->addWidget( new QLabel( i18n( "Data format:" ), frame ) );
56 m_comboBox = new KComboBox( frame );
57 m_comboBox->addItems( items );
58 layout->addWidget( m_comboBox );
59
60 layout->addStretch();
61
62 //connect( m_lineEdit, SIGNAL(textChanged(QString)),
63 // SLOT(slotEditTextChanged(QString)) );
64 //connect( this, SIGNAL(user1Clicked()), m_lineEdit, SLOT(clear()) );
65
66 //slotEditTextChanged( value );
67 setMinimumWidth( 350 );
68
69 m_clipboardChanged = false;
70 if ( clipboard )
71 connect( QApplication::clipboard(), SIGNAL(dataChanged()),
72 this, SLOT(slotClipboardDataChanged()) );
73}
74
75void KIO::PasteDialog::slotClipboardDataChanged()
76{
77 m_clipboardChanged = true;
78}
79
80QString KIO::PasteDialog::lineEditText() const
81{
82 return m_lineEdit->text();
83}
84
85int KIO::PasteDialog::comboItem() const
86{
87 return m_comboBox->currentIndex();
88}
89
90#include "pastedialog.moc"
KComboBox
KDialog
KDialog::setMainWidget
void setMainWidget(QWidget *widget)
KDialog::setButtons
void setButtons(ButtonCodes buttonMask)
KDialog::Ok
Ok
KDialog::Cancel
Cancel
KDialog::setDefaultButton
void setDefaultButton(ButtonCode id)
KDialog::setCaption
virtual void setCaption(const QString &caption)
KIO::PasteDialog::PasteDialog
PasteDialog(const QString &caption, const QString &label, const QString &value, const QStringList &items, QWidget *parent, bool clipboard)
Definition: pastedialog.cpp:30
KIO::PasteDialog::lineEditText
QString lineEditText() const
Definition: pastedialog.cpp:80
KIO::PasteDialog::comboItem
int comboItem() const
Definition: pastedialog.cpp:85
KLineEdit
QFrame
QLabel
QWidget
kcombobox.h
klineedit.h
klocale.h
i18n
QString i18n(const char *text)
caption
QString caption()
label
QString label(StandardShortcut id)
pastedialog.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KIO

Skip menu "KIO"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal