42 #include "qplatformdefs.h" 44 #ifndef QT_NO_PRINTDIALOG 46 #include "private/qabstractprintdialog_p.h" 47 #include <QtGui/qmessagebox.h> 50 #include <QtCore/qdir.h> 51 #include <QtGui/qevent.h> 52 #include <QtGui/qfilesystemmodel.h> 53 #include <QtGui/qstyleditemdelegate.h> 54 #include <QtGui/qprinter.h> 56 #include <QtGui/qdialogbuttonbox.h> 59 #include "ui_qprintpropertieswidget.h" 60 #include "ui_qprintsettingsoutput.h" 61 #include "ui_qprintwidget.h" 63 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY) 64 # include <private/qcups_p.h> 65 # include <cups/cups.h> 66 # include <private/qpdf_p.h> 68 # include <QtCore/qlibrary.h> 71 #include <private/qprinterinfo_unix_p.h> 85 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY) 103 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY) 121 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY) 125 void _q_chbPrintLastFirstToggled(
bool);
126 #ifndef QT_NO_MESSAGEBOX 127 void _q_checkFields();
129 void _q_collapseOrExpandDialog();
143 #if defined (Q_OS_UNIX) 155 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY) 156 void setCupsProperties();
160 void _q_printerChanged(
int index);
161 void _q_btnPropertiesClicked();
162 void _q_btnBrowseClicked();
175 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY) 184 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY) 200 while (!childItems.isEmpty())
201 delete childItems.takeFirst();
250 void cbChanged(
int index);
278 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY) 281 delete widget.cupsPropertiesPage;
287 widget.pageSetup->setPrinter(p);
292 widget.pageSetup->setupPrinter();
294 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY) 309 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY) 311 widget.treeView->setModel(0);
329 widget.tabs->setTabEnabled(1,
true);
331 widget.tabs->setTabEnabled(1,
false);
337 widget.cupsPropertiesPage->setEnabled(
false);
338 widget.pageSetup->selectPrinter(0);
344 widget.treeView->setModel(0);
345 widget.pageSetup->selectPdfPsPrinter(p);
346 widget.tabs->setTabEnabled(1,
false);
351 widget.treeView->resizeColumnToContents(0);
355 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY) 361 const ppd_option_t* opt =
reinterpret_cast<const ppd_option_t*
>(itm->
ptr);
363 if (
qstrcmp(opt->defchoice, opt->choices[itm->
selected].choice) != 0) {
364 markedOptions << opt->keyword << opt->choices[itm->
selected].choice;
374 : top(0), bottom(0),
buttons(0), collapseButton(0)
386 top =
new QUnixPrintWidget(0, q);
388 options.setupUi(bottom);
389 options.color->setIconSize(
QSize(32, 32));
390 options.color->setIcon(
QIcon(
QLatin1String(
":/trolltech/dialogs/qprintdialog/images/status-color.png")));
391 options.grayscale->setIconSize(
QSize(32, 32));
392 options.grayscale->setIcon(
QIcon(
QLatin1String(
":/trolltech/dialogs/qprintdialog/images/status-gray-scale.png")));
393 top->d->setOptionsPane(
this);
398 bottom->setVisible(
false);
414 #ifdef QT_NO_MESSAGEBOX 422 q,
SLOT(_q_chbPrintLastFirstToggled(
bool)));
430 options.color->setChecked(
true);
432 options.grayscale->setChecked(
true);
436 options.noDuplex->setChecked(
true);
break;
439 options.duplexLong->setChecked(
true);
break;
441 options.duplexShort->setChecked(
true);
break;
443 options.copies->setValue(p->
copyCount());
446 top->d->applyPrinterProperties(p);
460 int collapseHeight = 0;
462 QWidget *widgetToHide = bottom;
465 collapseHeight = widgetToHide->
y() + widgetToHide->
height() - (top->y() + top->height());
471 q->layout()->activate();
472 q->resize(
QSize(q->width(), q->height() - collapseHeight) );
476 #ifndef QT_NO_MESSAGEBOX 480 if (top->d->checkFields())
483 #endif // QT_NO_MESSAGEBOX 490 if (options.duplex->isEnabled()) {
491 if (options.noDuplex->isChecked())
493 else if (options.duplexLong->isChecked())
502 if (options.printAll->isChecked()) {
505 }
else if (options.printSelection->isChecked()) {
508 }
else if (options.printCurrentPage->isChecked()) {
511 }
else if (options.printRange->isChecked()) {
513 p->
setFromTo(options.from->value(),
qMax(options.from->value(), options.to->value()));
520 top->d->setupPrinter();
535 switch (q->printRange()) {
537 options.printAll->setChecked(
true);
540 options.printSelection->setChecked(
true);
543 options.printRange->setChecked(
true);
547 options.printCurrentPage->setChecked(
true);
552 const int minPage =
qMax(1,
qMin(q->minPage() , q->maxPage()));
553 const int maxPage =
qMax(1, q->maxPage() ==
INT_MAX ? 9999 : q->maxPage());
555 options.from->setMinimum(minPage);
556 options.to->setMinimum(minPage);
557 options.from->setMaximum(maxPage);
558 options.to->setMaximum(maxPage);
560 options.from->setValue(q->fromPage());
561 options.to->setValue(q->toPage());
562 top->d->updateWidget();
567 while(options.tabs->count() > 2)
568 delete options.tabs->widget(2);
571 while(iter != tabWidgets.
constEnd()) {
578 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY) 581 options.duplex->setEnabled(cups && cups->
ppdOption(
"Duplex"));
637 void QPrintDialog::setPrinter(
QPrinter *printer,
bool pickupSettings)
643 d->printer = printer;
646 d->applyPrinterProperties(printer);
654 #endif // QT3_SUPPORT 656 #if defined (Q_OS_UNIX) 661 : parent(p), propertiesDialog(0), printer(0), optionsPane(0), filePrintersAdded(false)
663 , cups(0), cupsPrinterCount(0), cupsPrinters(0), cupsPPD(0)
672 int currentPrinterIndex = 0;
673 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY) 685 widget.printers->addItem(printerName);
687 widget.printers->setCurrentIndex(i);
692 widget.properties->setEnabled(
true);
701 widget.printers->addItem((*i).name);
702 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY) 706 #if !defined(QT_NO_FILESYSTEMMODEL) && !defined(QT_NO_COMPLETER) 719 widget.preview->setVisible(
false);
726 if (
widget.printers->count())
727 widget.printers->insertSeparator(
widget.printers->count());
733 widget.printers->removeItem(
widget.printers->count()-1);
734 widget.printers->removeItem(
widget.printers->count()-1);
735 if (
widget.printers->count())
736 widget.printers->removeItem(
widget.printers->count()-1);
743 widget.printers->setCurrentIndex(
widget.printers->count() - 2);
745 widget.printers->setCurrentIndex(
widget.printers->count() - 1);
746 widget.filename->setEnabled(
true);
747 widget.lOutput->setEnabled(
true);
750 widget.filename->setVisible(printToFile);
751 widget.lOutput->setVisible(printToFile);
752 widget.fileBrowser->setVisible(printToFile);
759 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY) 768 const int printerCount =
widget.printers->count();
769 widget.filename->setEnabled(
false);
770 widget.lOutput->setEnabled(
false);
773 Q_ASSERT(index != printerCount - 3);
774 if (index > printerCount - 3) {
775 bool pdfPrinter = (index == printerCount - 2);
779 widget.properties->setEnabled(
true);
780 widget.filename->setEnabled(
true);
787 widget.filename->setText(filename);
788 widget.lOutput->setEnabled(
true);
791 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY) 800 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY) 808 widget.location->setText(location);
815 widget.type->setText(type);
828 widget.type->setText(type);
832 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY) 847 #ifndef QT_NO_FILEDIALOG 854 widget.filename->setText(filename);
856 widget.printers->setCurrentIndex(
widget.printers->count() - 1);
858 widget.printers->setCurrentIndex(
widget.printers->count() - 2);
859 else if (
widget.printers->currentIndex() !=
widget.printers->count() - 1)
860 widget.printers->setCurrentIndex(
widget.printers->count() - 2);
896 widget.filename->setText(cur);
902 for (
int i = 0; i <
widget.printers->count(); ++i) {
904 widget.printers->setCurrentIndex(i);
915 #ifndef QT_NO_MESSAGEBOX 918 if (
widget.filename->isEnabled()) {
922 bool exists = fi.
exists();
924 if (exists && fi.
isDir()) {
930 QPrintDialog::tr(
"File %1 is not writable.\nPlease choose a different file name.").
arg(file));
949 #endif // QT_NO_MESSAGEBOX 959 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY) 965 && (
widget.printers->currentIndex() >
widget.printers->count() - 3))
973 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY) 980 for (
int i = 0; i < pageSizes->num_choices; ++i) {
981 if (static_cast<int>(pageSizes->choices[i].marked) == 1)
982 cupsPageSize = pageSizes->choices[i].choice;
996 printer->
setPaperSize(static_cast<QPrinter::PaperSize>(ps));
1004 const int printerCount =
widget.printers->count();
1005 const int index =
widget.printers->currentIndex();
1009 Q_ASSERT(index != printerCount - 3);
1010 if (index == printerCount - 2)
1026 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY) 1035 QUnixPrintWidget::QUnixPrintWidget(
QPrinter *printer,
QWidget *parent)
1038 d->applyPrinterProperties(printer);
1043 QUnixPrintWidget::~QUnixPrintWidget()
1055 void QUnixPrintWidget::updatePrinter()
1063 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY) 1181 const ppd_file_t* ppdFile =
reinterpret_cast<const ppd_file_t*
>(parent->
ptr);
1184 for (
int i = 0; i < ppdFile->num_groups; ++i) {
1193 const ppd_group_t* group =
reinterpret_cast<const ppd_group_t*
>(parent->
ptr);
1196 for (
int i = 0; i < group->num_subgroups; ++i) {
1208 const ppd_group_t* group =
reinterpret_cast<const ppd_group_t*
>(parent->
ptr);
1209 for (
int i = 0; i < group->num_options; ++i) {
1218 const ppd_option_t* option =
reinterpret_cast<const ppd_option_t*
>(parent->
ptr);
1219 bool marked =
false;
1220 for (
int i = 0; i < option->num_choices; ++i) {
1222 if (static_cast<int>(option->choices[i].marked) == 1) {
1226 }
else if (!marked &&
qstrcmp(option->choices[i].choice, option->defchoice) == 0) {
1287 const ppd_option_t* opt =
reinterpret_cast<const ppd_option_t*
>(itm->
ptr);
1307 #include "moc_qprintdialog.cpp" 1308 #include "qprintdialog_unix.moc" 1309 #include "qrc_qprintdialog.cpp" 1311 #endif // QT_NO_PRINTDIALOG The QVariant class acts like a union for the most common Qt data types.
DuplexMode duplex() const
Returns the current duplex mode.
T qobject_cast(QObject *object)
void setDuplex(DuplexMode duplex)
Enables double sided printing based on the duplex mode.
void * internalPointer() const
Returns a void * pointer used by the model to associate the index with the internal data structure...
const ppd_option_t * ppdOption(const char *key) const
const ppd_file_t * currentPPD() const
int columnCount(const QModelIndex &parent=QModelIndex()) const
Returns the number of columns for the children of the given parent.
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
The QFileSystemModel class provides a data model for the local filesystem.
static QString fromLocal8Bit(const char *, int size=-1)
Returns a QString initialized with the first size characters of the 8-bit string str.
int markOption(const char *name, const char *value)
PaperSize paperSize(QPrinter::PaperSize paperSize)
QDialogButtonBox * buttons
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
QPrintPropertiesDialog(QAbstractPrintDialog *parent=0)
QString cap(int nth=0) const
Returns the text captured by the nth subexpression.
#define QT_END_NAMESPACE
This macro expands to.
Ui::QPrintSettingsOutput options
static QString getSaveFileName(QWidget *parent=0, const QString &caption=QString(), const QString &dir=QString(), const QString &filter=QString(), QString *selectedFilter=0, Options options=0)
This is a convenience static function that will return a file name selected by the user...
int availablePrintersCount() const
QPPDOptionsModel(QCUPSSupport *cups, QObject *parent=0)
QString docName() const
Returns the document name.
Ui::QPrintPropertiesWidget widget
const QChar at(int i) const
Returns the character at the given index position in the string.
The QRegExp class provides pattern matching using regular expressions.
The QDialog class is the base class of dialog windows.
bool open(OpenMode flags)
Opens the file using OpenMode mode, returning true if successful; otherwise false.
bool isOptionEnabled(PrintDialogOption option) const
Use QPrintDialog::testOption(option) instead.
int exec()
Shows the dialog as a modal dialog, blocking until the user closes it.
QString & replace(int i, int len, QChar after)
The QByteArray class provides an array of bytes.
int length() const
Returns the number of characters in this string.
static Qt::MouseButtons buttons
virtual void accept()
Hides the modal dialog and sets the result code to Accepted.
iterator begin()
Returns an STL-style iterator pointing to the first item in the list.
virtual void reject()
Hides the modal dialog and sets the result code to Rejected.
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the list.
QModelIndex createIndex(int row, int column, void *data=0) const
Creates a model index for the given row and column with the internal pointer ptr. ...
int width() const
Returns the width of the rectangle.
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
Returns the data stored under the given role for the item referred to by the index.
The QCompleter class provides completions based on an item model.
~QPrintPropertiesDialog()
static QString tr(const char *sourceText, const char *comment=0, int n=-1)
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
bool exists() const
Returns true if the file exists; otherwise returns false.
void setCurrentIndex(int index)
int count(const T &t) const
Returns the number of occurrences of value in the list.
void setPaperSize(PaperSize)
Sets the printer paper size to newPaperSize if that size is supported.
int height() const
Returns the height of the rectangle.
static bool isRelativePath(const QString &path)
Returns true if path is relative; returns false if it is absolute.
The QString class provides a Unicode character string.
static QString currentPath()
Returns the absolute path of the application's current directory.
void parseOptions(QOptionTreeItem *parent)
QRect pageRect(const char *choice) const
const cups_dest_t * availablePrinters() const
QString outputFileName() const
Returns the name of the output file.
The QObject class is the base class of all Qt objects.
static bool isAvailable()
void addItem(const QString &text, const QVariant &userData=QVariant())
Adds an item to the combobox with the given text, and containing the specified userData (stored in th...
static QChar separator()
Returns the native directory separator: "/" under Unix (including Mac OS X) and "\\" under Windows...
void addWidget(QWidget *, int stretch=0, Qt::Alignment alignment=0)
Adds widget to the end of this box layout, with a stretch factor of stretch and alignment alignment...
The QStyledItemDelegate class provides display and editing facilities for data items from a model...
QPushButton * collapseButton
static StandardButton warning(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=Ok, StandardButton defaultButton=NoButton)
Opens a warning message box with the given title and text in front of the specified parent widget...
void setCollateCopies(bool collate)
Sets the default value for collation checkbox when the print dialog appears.
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Qt::ItemFlags flags(const QModelIndex &index) const
Returns the item flags for the given index.
static QString translate(const char *context, const char *key, const char *disambiguation=0, Encoding encoding=CodecForTr)
QPrintEngine * printEngine() const
Returns the print engine used by the printer.
static QFont font()
Returns the default application font.
QList< QOptionTreeItem * > childItems
void setCopyCount(int)
Sets the number of copies to be printed to count.
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
Returns the index of the item in the model specified by the given row, column and parent index...
~QPrintDialog()
Destroys the print dialog.
The QPrintDialog class provides a dialog for specifying the printer's configuration.
void applyPrinterProperties(QPrinter *p)
copy printer properties to the widget
QPrinter * printer() const
Returns the printer that this printer dialog operates on.
QOptionTreeItem(ItemType t, int i, const void *p, const char *desc, QOptionTreeItem *pi)
void append(const T &t)
Inserts value at the end of the list.
#define QT_BEGIN_NAMESPACE
This macro expands to.
OutputFormat outputFormat() const
Returns the output format for this printer.
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
Returns the editor to be used for editing the data item with the given index.
void setBold(bool)
If enable is true sets the font's weight to QFont::Bold ; otherwise sets the weight to QFont::Normal...
const ppd_option_t * pageSizes() const
The QPrintEngine class defines an interface for how QPrinter interacts with a given printing subsyste...
bool isDir() const
Returns true if this object points to a directory or to a symbolic link to a directory; otherwise ret...
QString left(int n) const Q_REQUIRED_RESULT
Returns a substring that contains the n leftmost characters of the string.
void layoutAboutToBeChanged()
This signal is emitted just before the layout of a model is changed.
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
int qt_getLprPrinters(QList< QPrinterDescription > &printers)
QRect paperRect(const char *choice) const
QStringList options() const
The QPrinter class is a paint device that paints on a printer.
const T & at(int i) const
Returns the item at index position i in the list.
void setPrintRange(PrintRange range)
Sets the print range option in to be range.
void _q_chbPrintLastFirstToggled(bool)
The QComboBox widget is a combined button and popup list.
void saveOptions(QList< const ppd_option_t *> options, QList< const char *> markedOptions)
void parseChoices(QOptionTreeItem *parent)
void rejected()
This signal is emitted when the dialog has been rejected either by the user or by calling reject() or...
QOptionTreeItem * parentItem
void setCups(QCUPSSupport *cups)
QDialogButtonBox * m_buttons
void cbChanged(int index)
void setFromTo(int fromPage, int toPage)
Sets the range of pages to be printed to cover the pages with numbers specified by from and to...
const T * ptr(const T &t)
int exec()
Reimplemented Function
ColorMode colorMode() const
Returns the current color mode.
void layoutChanged()
This signal is emitted whenever the layout of items exposed by the model has changed; for example...
QPPDOptionsModel * m_cupsOptionsModel
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
Returns the data for the given role and section in the header with the specified orientation.
void selectPrinter(QCUPSSupport *cups)
QModelIndex setRootPath(const QString &path)
Sets the directory that is being watched by the model to newPath by installing a file system watcher ...
int currentPrinterIndex() const
void setColorMode(ColorMode)
Sets the printer's color mode to newColorMode, which can be either Color or GrayScale.
The QShowEvent class provides an event that is sent when a widget is shown.
bool isValid() const
Returns true if this model index is valid; otherwise returns false.
void _q_collapseOrExpandDialog()
The QAbstractItemModel class provides the abstract interface for item model classes.
void setResult(int r)
Sets the modal dialog's result code to i.
void setupPrinter() const
const cups_option_t * printerOption(const QString &key) const
virtual void setProperty(PrintEnginePropertyKey key, const QVariant &value)=0
Sets the print engine's property specified by key to the given value.
void addItemToOptions(QOptionTreeItem *parent, QList< const ppd_option_t *> &options, QList< const char *> &markedOptions) const
The QAbstractPrintDialog class provides a base implementation for print dialogs used to configure pri...
QString arg(qlonglong a, int fieldwidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT
#define Q_DECLARE_PUBLIC(Class)
#define PPK_CupsStringPageSize
The QFile class provides an interface for reading from and writing to files.
const ppd_file_t * setCurrentPrinter(int index)
The QFont class specifies a font used for drawing text.
bool collateCopies() const
Returns true if collation is turned on when multiple copies is selected.
void clear()
Clears the contents of the string and makes it empty.
void showEvent(QShowEvent *event)
This event handler can be reimplemented in a subclass to receive widget show events which are passed ...
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
PaperSize
This enum type specifies what paper size QPrinter should use.
QObject * parent() const
Returns a pointer to the parent object.
QString unicodeString(const char *s)
void parseGroups(QOptionTreeItem *parent)
QString suffix() const
Returns the suffix of the file.
void selectPdfPsPrinter(const QPrinter *p)
static QTestResult::TestLocation location
int result() const
In general returns the modal dialog's result code, Accepted or Rejected.
static StandardButton question(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=Ok, StandardButton defaultButton=NoButton)
Opens a question message box with the given title and text in front of the specified parent widget...
The QModelIndex class is used to locate data in a data model.
bool event(QEvent *e)
Reimplemented Function
if(void) toggleToolbarShown
The QRect class defines a rectangle in the plane using integer precision.
QPrinter * printer()
Returns the printer that this printer dialog operates on.
void applyPrinterProperties(QPrinter *p)
copy printer properties to the widget
bool remove()
Removes the file specified by fileName().
int copyCount() const
Returns the number of copies that will be printed.
bool exactMatch(const QString &str) const
Returns true if str is matched exactly by this regular expression; otherwise returns false...
void setVisible(bool visible)
Reimplemented Function
int currentIndex
the index of the current item in the combobox.
void accepted()
This signal is emitted when the dialog has been accepted either by the user or by calling accept() or...
#define PPK_CupsPaperRect
virtual void setTabs(const QList< QWidget *> &tabs)
The QSize class defines the size of a two-dimensional object using integer point precision.
void setOutputFormat(OutputFormat format)
Sets the output format for this printer to format.
int qstrcmp(const QByteArray &str1, const char *str2)
Qt::Orientation orientation() const
Returns the dialog's extension orientation.
The QVBoxLayout class lines up widgets vertically.
The QStyleOptionViewItem class is used to describe the parameters used to draw an item in a view widg...
QOptionTreeItem * rootItem
QPPDOptionsEditor(QObject *parent=0)
void setEditorData(QWidget *editor, const QModelIndex &index) const
Sets the contents of the given editor to the data for the item at the given index.
bool endsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string ends with s; otherwise returns false.
The QFileInfo class provides system-independent file information.
static void updateWidgets(const QList< const QWidget *> &widgets)
virtual void close()
Calls QFile::flush() and closes the file.
QString printerName() const
Returns the printer name.
void setVisible(bool visible)
Reimplemented Function
bool isWritable() const
Returns true if the user can write to the file; otherwise returns false.
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
Sets the data for the item at the given index in the model to the contents of the given editor...
#define Q_DECLARE_TR_FUNCTIONS(context)
The Q_DECLARE_TR_FUNCTIONS() macro declares and implements two translation functions, tr() and trUtf8(), with these signatures:
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
QPrintDialog(QPrinter *printer, QWidget *parent=0)
Constructs a new modal printer dialog for the given printer with the given parent.
const char * selDescription
PageOrder pageOrder() const
Returns the current page order.
void setPrinterName(const QString &)
Sets the printer name to name.
int column() const
Returns the column this model index refers to.
int rowCount(const QModelIndex &parent=QModelIndex()) const
Returns the number of rows under the given parent.
The QList class is a template class that provides lists.
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the list...
void setOutputFileName(const QString &)
Sets the name of the output file to fileName.
static QString homePath()
Returns the absolute path of the user's home directory.
The QIcon class provides scalable icons in different modes and states.