• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kdeprint
 

kdeprint

  • kdeprint
  • cups
  • cupsdconf2
qdirlineedit.cpp
1 /*
2  * This file is part of the KDE libraries
3  * Copyright (c) 2001 Michael Goffioul <kdeprint@swing.be>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License version 2 as published by the Free Software Foundation.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public License
15  * along with this library; see the file COPYING.LIB. If not, write to
16  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  **/
19 
20 #include "qdirlineedit.h"
21 
22 #include <tqlineedit.h>
23 #include <tqlayout.h>
24 #include <kpushbutton.h>
25 #include <kfiledialog.h>
26 #include <kiconloader.h>
27 
28 QDirLineEdit::QDirLineEdit(bool file, TQWidget *parent, const char *name)
29  : TQWidget(parent, name)
30 {
31  edit_ = new TQLineEdit(this);
32  button_ = new KPushButton(this);
33  button_->setPixmap(SmallIcon("fileopen"));
34  connect(button_,TQT_SIGNAL(clicked()),TQT_SLOT(buttonClicked()));
35 
36  TQHBoxLayout *main_ = new TQHBoxLayout(this, 0, 3);
37  main_->addWidget(edit_);
38  main_->addWidget(button_);
39 
40  fileedit_ = file;
41 }
42 
43 QDirLineEdit::~QDirLineEdit()
44 {
45 }
46 
47 void QDirLineEdit::setURL(const TQString& txt)
48 {
49  edit_->setText(txt);
50 }
51 
52 TQString QDirLineEdit::url()
53 {
54  return edit_->text();
55 }
56 
57 void QDirLineEdit::buttonClicked()
58 {
59  TQString dirname;
60  if (!fileedit_)
61  dirname = KFileDialog::getExistingDirectory(edit_->text(), this);
62  else
63  dirname = KFileDialog::getOpenFileName(edit_->text(), TQString::null, this);
64  if (!dirname.isEmpty())
65  edit_->setText(dirname);
66 }
67 
68 void QDirLineEdit::setFileEdit(bool on)
69 {
70  fileedit_ = on;
71 }
72 
73 #include "qdirlineedit.moc"

kdeprint

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

kdeprint

Skip menu "kdeprint"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kdeprint by doxygen 1.8.1.2
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |