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

KIO

  • sources
  • kde-4.14
  • kdelibs
  • 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 
30 KIO::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 
75 void KIO::PasteDialog::slotClipboardDataChanged()
76 {
77  m_clipboardChanged = true;
78 }
79 
80 QString KIO::PasteDialog::lineEditText() const
81 {
82  return m_lineEdit->text();
83 }
84 
85 int KIO::PasteDialog::comboItem() const
86 {
87  return m_comboBox->currentIndex();
88 }
89 
90 #include "pastedialog.moc"
QWidget::layout
QLayout * layout() const
i18n
QString i18n(const char *text)
kcombobox.h
QWidget
KIO::PasteDialog::lineEditText
QString lineEditText() const
Definition: pastedialog.cpp:80
QDialog::setModal
void setModal(bool modal)
KIO::PasteDialog::PasteDialog
PasteDialog(const QString &caption, const QString &label, const QString &value, const QStringList &items, QWidget *parent, bool clipboard)
Definition: pastedialog.cpp:30
QWidget::setMinimumWidth
void setMinimumWidth(int minw)
KDialog
klocale.h
QLabel::setBuddy
void setBuddy(QWidget *buddy)
Ok
QBoxLayout::addWidget
void addWidget(QWidget *widget, int stretch, QFlags< Qt::AlignmentFlag > alignment)
QApplication::clipboard
QClipboard * clipboard()
QWidget::setFocus
void setFocus()
QVBoxLayout
QString
QStringList
QFrame
Cancel
KLineEdit
QBoxLayout::addStretch
void addStretch(int stretch)
KIO::PasteDialog::comboItem
int comboItem() const
Definition: pastedialog.cpp:85
QWidget::setCaption
void setCaption(const QString &c)
KComboBox
klineedit.h
QComboBox::addItems
void addItems(const QStringList &texts)
pastedialog.h
QObject::connect
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QLabel
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:53 by doxygen 1.8.7 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 API Reference

Skip menu "kdelibs 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

Search



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