KSane

ksanewidget.cpp
1/*
2 * SPDX-FileCopyrightText: 2007-2010 Kare Sars <kare dot sars at iki dot fi>
3 * SPDX-FileCopyrightText: 2009 Matthias Nagl <matthias at nagl dot info>
4 * SPDX-FileCopyrightText: 2009 Grzegorz Kurtyka <grzegorz dot kurtyka at gmail dot com>
5 * SPDX-FileCopyrightText: 2007-2008 Gilles Caulier <caulier dot gilles at gmail dot com>
6 * SPDX-FileCopyrightText: 2014 Gregor Mitsch : port to KDE5 frameworks
7 * SPDX-FileCopyrightText: 2021 Alexander Stippich <a.stippich@gmx.net>
8 *
9 * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
10 */
11
12#include "ksanewidget.h"
13#include "ksanewidget_p.h"
14
15#include <unistd.h>
16
17#include <QApplication>
18#include <QList>
19#include <QLabel>
20#include <QSplitter>
21#include <QPointer>
22#include <QIcon>
23#include <QShortcut>
24
25#include <KPasswordDialog>
26#ifdef HAVE_KWALLET
27#include <KWallet>
28#endif
29
30#include <KLocalizedString>
31
32#include "ksanedevicedialog.h"
33#include <ksane_debug.h>
34
35namespace KSaneIface
36{
37
39 : QWidget(parent), d(new KSaneWidgetPrivate(this))
40{
41 d->m_ksaneCoreInterface = new KSaneCore::Interface();
42
44 connect(d->m_ksaneCoreInterface, &KSaneCore::Interface::scanFinished, d, &KSaneWidgetPrivate::oneFinalScanDone);
45 connect(d->m_ksaneCoreInterface, &KSaneCore::Interface::previewScanFinished, d, &KSaneWidgetPrivate::previewScanDone);
46 connect(d->m_ksaneCoreInterface, &KSaneCore::Interface::userMessage, d, &KSaneWidgetPrivate::alertUser);
47 connect(d->m_ksaneCoreInterface, &KSaneCore::Interface::scanProgress, d, &KSaneWidgetPrivate::updateProgress);
48 connect(d->m_ksaneCoreInterface, &KSaneCore::Interface::previewProgress, d, &KSaneWidgetPrivate::updatePreviewProgress);
49 connect(d->m_ksaneCoreInterface, &KSaneCore::Interface::batchModeCountDown, d, &KSaneWidgetPrivate::updateCountDown);
50 connect(d->m_ksaneCoreInterface, &KSaneCore::Interface::availableDevices, d, &KSaneWidgetPrivate::signalDevListUpdate);
52
53 // Create the static UI
54 // create the preview
55 d->m_previewViewer = new KSaneViewer(&(d->m_previewImg), this);
56 connect(d->m_previewViewer, &KSaneViewer::newSelection,
57 d, &KSaneWidgetPrivate::handleSelection);
58
59 d->m_warmingUp = new QLabel;
60 d->m_warmingUp->setText(i18n("Waiting for the scan to start."));
61 d->m_warmingUp->setAlignment(Qt::AlignCenter);
62 d->m_warmingUp->hide();
63
64 d->m_countDown = new QLabel;
65 d->m_countDown->setAlignment(Qt::AlignCenter);
66 d->m_countDown->hide();
67
68 d->m_progressBar = new QProgressBar;
69 d->m_progressBar->setMaximum(100);
70
71 d->m_cancelBtn = new QPushButton;
72 d->m_cancelBtn->setIcon(QIcon::fromTheme(QStringLiteral("process-stop")));
73 d->m_cancelBtn->setToolTip(i18n("Cancel current scan operation"));
75
76 d->m_activityFrame = new QWidget;
77 QHBoxLayout *progress_lay = new QHBoxLayout(d->m_activityFrame);
78 progress_lay->setContentsMargins(0, 0, 0, 0);
79 progress_lay->addWidget(d->m_progressBar, 100);
80 progress_lay->addWidget(d->m_warmingUp, 100);
81 progress_lay->addWidget(d->m_countDown, 100);
82 progress_lay->addWidget(d->m_cancelBtn, 0);
83 d->m_activityFrame->hide();
84
85 d->m_zInBtn = new QToolButton(this);
86 d->m_zInBtn->setAutoRaise(true);
87 d->m_zInBtn->setIcon(QIcon::fromTheme(QStringLiteral("zoom-in")));
88 d->m_zInBtn->setToolTip(i18n("Zoom In"));
89 connect(d->m_zInBtn, &QToolButton::clicked, d->m_previewViewer, &KSaneViewer::zoomIn);
90
91 d->m_zOutBtn = new QToolButton(this);
92 d->m_zOutBtn->setAutoRaise(true);
93 d->m_zOutBtn->setIcon(QIcon::fromTheme(QStringLiteral("zoom-out")));
94 d->m_zOutBtn->setToolTip(i18n("Zoom Out"));
95 connect(d->m_zOutBtn, &QToolButton::clicked, d->m_previewViewer, &KSaneViewer::zoomOut);
96
97 d->m_zSelBtn = new QToolButton(this);
98 d->m_zSelBtn->setAutoRaise(true);
99 d->m_zSelBtn->setIcon(QIcon::fromTheme(QStringLiteral("zoom-fit-best")));
100 d->m_zSelBtn->setToolTip(i18n("Zoom to Selection"));
101 connect(d->m_zSelBtn, &QToolButton::clicked, d->m_previewViewer, &KSaneViewer::zoomSel);
102
103 d->m_zFitBtn = new QToolButton(this);
104 d->m_zFitBtn->setAutoRaise(true);
105 d->m_zFitBtn->setIcon(QIcon::fromTheme(QStringLiteral("document-preview")));
106 d->m_zFitBtn->setToolTip(i18n("Zoom to Fit"));
107 connect(d->m_zFitBtn, &QToolButton::clicked, d->m_previewViewer, &KSaneViewer::zoom2Fit);
108
109 d->m_clearSelBtn = new QToolButton(this);
110 d->m_clearSelBtn->setAutoRaise(true);
111 d->m_clearSelBtn->setIcon(QIcon::fromTheme(QStringLiteral("edit-clear")));
112 d->m_clearSelBtn->setToolTip(i18n("Clear Selections"));
113 connect(d->m_clearSelBtn, &QToolButton::clicked, d->m_previewViewer, &KSaneViewer::clearSelections);
114
115 QShortcut *prevShortcut = new QShortcut(QKeySequence(QStringLiteral("Ctrl+P")), this);
116 connect(prevShortcut, &QShortcut::activated, d, &KSaneWidgetPrivate::startPreviewScan);
117
118 QShortcut *scanShortcut = new QShortcut(QKeySequence(QStringLiteral("Ctrl+S")), this);
119 connect(scanShortcut, &QShortcut::activated, d, &KSaneWidgetPrivate::startFinalScan);
120
121 d->m_prevBtn = new QPushButton(this);
122 d->m_prevBtn->setIcon(QIcon::fromTheme(QStringLiteral("document-import")));
123 d->m_prevBtn->setToolTip(i18n("Scan Preview Image (%1)", prevShortcut->key().toString(QKeySequence::NativeText)));
124 d->m_prevBtn->setText(i18nc("Preview button text", "Preview"));
125 connect(d->m_prevBtn, &QToolButton::clicked, d, &KSaneWidgetPrivate::startPreviewScan);
126
127 d->m_scanBtn = new QPushButton(this);
128 d->m_scanBtn->setIcon(QIcon::fromTheme(QStringLiteral("document-save")));
129 d->m_scanBtn->setToolTip(i18n("Scan Final Image (%1)", scanShortcut->key().toString(QKeySequence::NativeText)));
130 d->m_scanBtn->setText(i18nc("Final scan button text", "Scan"));
131 d->m_scanBtn->setFocus(Qt::OtherFocusReason);
132 setFocusProxy(d->m_scanBtn);
133 connect(d->m_scanBtn, &QToolButton::clicked, d, &KSaneWidgetPrivate::startFinalScan);
134
135 d->m_btnFrame = new QWidget;
136 QHBoxLayout *btn_lay = new QHBoxLayout(d->m_btnFrame);
137 btn_lay->setContentsMargins(0, 0, 0, 0);
138 btn_lay->addWidget(d->m_zInBtn);
139 btn_lay->addWidget(d->m_zOutBtn);
140 btn_lay->addWidget(d->m_zSelBtn);
141 btn_lay->addWidget(d->m_zFitBtn);
142 btn_lay->addWidget(d->m_clearSelBtn);
143 btn_lay->addStretch(100);
144 btn_lay->addWidget(d->m_prevBtn);
145 btn_lay->addWidget(d->m_scanBtn);
146
147 // calculate the height of the waiting/scanning/buttons frames to avoid jumpiness.
148 int minHeight = d->m_btnFrame->sizeHint().height();
149 if (d->m_activityFrame->sizeHint().height() > minHeight) {
150 minHeight = d->m_activityFrame->sizeHint().height();
151 }
152 d->m_btnFrame->setMinimumHeight(minHeight);
153 d->m_activityFrame->setMinimumHeight(minHeight);
154 d->m_warmingUp->setMinimumHeight(minHeight);
155 d->m_countDown->setMinimumHeight(minHeight);
156
157 d->m_previewFrame = new QWidget;
158 QVBoxLayout *preview_layout = new QVBoxLayout(d->m_previewFrame);
159 preview_layout->setContentsMargins(0, 0, 0, 0);
160 preview_layout->addWidget(d->m_previewViewer, 100);
161 preview_layout->addWidget(d->m_activityFrame, 0);
162 preview_layout->addWidget(d->m_btnFrame, 0);
163
164 // Create Options Widget
165 d->m_optsTabWidget = new QTabWidget();
166
167 // Add the basic options tab
168 d->m_basicScrollA = new QScrollArea();
169 d->m_basicScrollA->setWidgetResizable(true);
170 d->m_basicScrollA->setFrameShape(QFrame::NoFrame);
171 d->m_optsTabWidget->addTab(d->m_basicScrollA, i18n("Basic Options"));
172
173 // Add the advanced options tab
174 d->m_advancedScrollA = new QScrollArea();
175 d->m_advancedScrollA->setWidgetResizable(true);
176 d->m_advancedScrollA->setFrameShape(QFrame::NoFrame);
177 d->m_optsTabWidget->addTab(d->m_advancedScrollA, i18n("Advanced Options"));
178
179 // Add the other options tab
180 d->m_otherScrollA = new QScrollArea;
181 d->m_otherScrollA->setWidgetResizable(true);
182 d->m_otherScrollA->setFrameShape(QFrame::NoFrame);
183 d->m_optsTabWidget->addTab(d->m_otherScrollA, i18n("Scanner Specific Options"));
184
185 d->m_splitter = new QSplitter(this);
186 d->m_splitter->addWidget(d->m_optsTabWidget);
187 d->m_splitter->setStretchFactor(0, 0);
188 d->m_splitter->addWidget(d->m_previewFrame);
189 d->m_splitter->setStretchFactor(1, 100);
190
191 d->m_optionsCollapser = new SplitterCollapser(d->m_splitter, d->m_optsTabWidget);
192
193 QHBoxLayout *base_layout = new QHBoxLayout(this);
194 base_layout->addWidget(d->m_splitter);
195 base_layout->setContentsMargins(0, 0, 0, 0);
196
197 // disable the interface in case no device is opened.
198 d->m_optsTabWidget->setDisabled(true);
199 d->m_previewViewer->setDisabled(true);
200 d->m_btnFrame->setDisabled(true);
201
202}
203
205{
206 delete d->m_ksaneCoreInterface;
207 delete d;
208}
209
211{
212 return d->m_ksaneCoreInterface->deviceName();
213}
214
216{
217 return d->m_ksaneCoreInterface->deviceVendor();
218}
219
221{
222 return d->m_ksaneCoreInterface->deviceModel();
223}
224
226{
227 QString selected_name;
228 QPointer<KSaneDeviceDialog> sel = new KSaneDeviceDialog(parent);
229 connect(d->m_ksaneCoreInterface, &KSaneCore::Interface::availableDevices, sel, &KSaneDeviceDialog::updateDevicesList);
230 connect(sel, &KSaneDeviceDialog::requestReloadList, d->m_ksaneCoreInterface, &KSaneCore::Interface::reloadDevicesList);
231
232 d->m_ksaneCoreInterface->reloadDevicesList();
233
234 if (sel->exec() == QDialog::Accepted) {
235 selected_name = sel->getSelectedName();
236 }
237
238 delete sel;
239 return selected_name;
240}
241
242bool KSaneWidget::openDevice(const QString &deviceName)
243{
244 KPasswordDialog *dlg;
245#ifdef HAVE_KWALLET
246 KWallet::Wallet *saneWallet;
247#endif
248 QString myFolderName = QStringLiteral("ksane");
249 QMap<QString, QString> wallet_entry;
250
251 KSaneCore::Interface::OpenStatus status = d->m_ksaneCoreInterface->openDevice(deviceName);
252 if (status == KSaneCore::Interface::OpeningFailed) {
253 return false;
254 }
255
256 bool password_dialog_ok = true;
257
258 // prepare wallet for authentication and create password dialog
259 if (status == KSaneCore::Interface::OpeningDenied) {
260#ifdef HAVE_KWALLET
262
263 if (saneWallet) {
265 if (!saneWallet->hasFolder(myFolderName)) {
266 saneWallet->createFolder(myFolderName);
267 }
268 saneWallet->setFolder(myFolderName);
269 saneWallet->readMap(deviceName, wallet_entry);
270 if (!wallet_entry.empty() || true) {
271 dlg->setUsername(wallet_entry[QStringLiteral("username")]);
272 dlg->setPassword(wallet_entry[QStringLiteral("password")]);
273 dlg->setKeepPassword(true);
274 }
275 } else
276#endif
277 {
279 }
280 dlg->setPrompt(i18n("Authentication required for resource: %1", deviceName));
281
282 }
283
284 // sane_open failed due to insufficient authorization
285 // retry opening device with user provided data assisted with kwallet records
286 while (status == KSaneCore::Interface::OpeningDenied) {
287
288 password_dialog_ok = dlg->exec();
289 if (!password_dialog_ok) {
290 delete dlg;
291 return false; //the user canceled
292 }
293
294 // add/update the device user-name and password for authentication
295 status = d->m_ksaneCoreInterface->openRestrictedDevice(deviceName, dlg->username(), dlg->password());
296
297#ifdef HAVE_KWALLET
298 // store password in wallet on successful authentication
299 if (dlg->keepPassword() && status != KSaneCore::Interface::OpeningDenied) {
301 entry[QStringLiteral("username")] = dlg->username();
302 entry[QStringLiteral("password")] = dlg->password();
303 if (saneWallet) {
304 saneWallet->writeMap(deviceName, entry);
305 }
306 }
307#endif
308 }
309
310 // Create the options interface
311 d->createOptInterface();
312
313 // Enable the interface
314 d->m_optsTabWidget->setDisabled(false);
315 d->m_previewViewer->setDisabled(false);
316 d->m_btnFrame->setDisabled(false);
317
318 // estimate the preview size and create an empty image
319 // this is done so that you can select scan area without
320 // having to scan a preview.
321 d->updatePreviewSize();
322 QTimer::singleShot(1000, d->m_previewViewer, &KSaneViewer::zoom2Fit);
323 return true;
324}
325
327{
328 bool result = d->m_ksaneCoreInterface->closeDevice();
329 if (!result) {
330 return false;
331 }
332 d->clearDeviceOptions();
333 // disable the interface until a new device is opened.
334 d->m_optsTabWidget->setDisabled(true);
335 d->m_previewViewer->setDisabled(true);
336 d->m_btnFrame->setDisabled(true);
337
338 return true;
339}
340
342{
343 if (d->m_btnFrame->isEnabled()) {
344 d->m_cancelMultiScan = false;
345 d->startFinalScan();
346 } else {
347 // if the button frame is disabled, there is no open device to scan from
349 }
350}
351
353{
354 if (d->m_btnFrame->isEnabled()) {
355 d->m_cancelMultiScan = false;
356 d->startPreviewScan();
357 } else {
358 // if the button frame is disabled, there is no open device to scan from
360 }
361}
362
364{
365 d->m_cancelMultiScan = true;
366 d->m_ksaneCoreInterface->stopScan();
367}
368
370{
371 d->m_ksaneCoreInterface->setPreviewResolution(dpi);
372}
373
374void KSaneWidget::getOptionValues(QMap <QString, QString> &opts)
375{
376 opts.clear();
377 opts = d->m_ksaneCoreInterface->getOptionsMap();
378}
379
380bool KSaneWidget::getOptionValue(const QString &option, QString &value)
381{
382 const auto optionsMap = d->m_ksaneCoreInterface->getOptionsMap();
383 auto it = optionsMap.constBegin();
384 while (it != optionsMap.constEnd()) {
385 if(it.key() == option) {
386 value = it.value();
387 return !value.isEmpty();
388 }
389 it++;
390 }
391 return false;
392}
393
394int KSaneWidget::setOptionValues(const QMap <QString, QString> &options)
395{
396 int ret = 0;
397
398 ret = d->m_ksaneCoreInterface->setOptionsMap(options);
399
400 if ((d->m_splitGamChB) &&
401 (d->m_optGamR) &&
402 (d->m_optGamG) &&
403 (d->m_optGamB)) {
404 // check if the current gamma values are identical. if they are identical,
405 // uncheck the "Separate color intensity tables" checkbox
406 QVariant redGamma = d->m_optGamR->value();
407 QVariant greenGamma = d->m_optGamG->value();
408 QVariant blueGamma = d->m_optGamB->value();
409
410 if ((redGamma == greenGamma) && (greenGamma == blueGamma)) {
411 d->m_splitGamChB->setChecked(false);
412 // set the values to the common gamma widget
413 d->m_commonGamma->setValues(redGamma);
414 } else {
415 d->m_splitGamChB->setChecked(true);
416 }
417 }
418 return ret;
419}
420
421bool KSaneWidget::setOptionValue(const QString &option, const QString &value)
422{
423 if (d->m_scanOngoing) {
424 return false;
425 }
426
427 const auto optionsList = d->m_ksaneCoreInterface->getOptionsList();
428 for (auto &writeOption : optionsList) {
429 if (writeOption->name() == option) {
430 if (writeOption->setValue(value)) {
431 if ((d->m_splitGamChB) &&
432 (d->m_optGamR) &&
433 (d->m_optGamG) &&
434 (d->m_optGamB) &&
435 ((writeOption == d->m_optGamR) ||
436 (writeOption == d->m_optGamG) ||
437 (writeOption == d->m_optGamB))) {
438 // check if the current gamma values are identical. if they are identical,
439 // uncheck the "Separate color intensity tables" checkbox
440 QVariant redGamma = d->m_optGamR->value();
441 QVariant greenGamma = d->m_optGamG->value();
442 QVariant blueGamma = d->m_optGamB->value();
443 if ((redGamma == greenGamma) && (greenGamma == blueGamma)) {
444 d->m_splitGamChB->setChecked(false);
445 // set the values to the common gamma widget
446 d->m_commonGamma->setValues(redGamma);
447 } else {
448 d->m_splitGamChB->setChecked(true);
449 }
450 }
451 return true;
452 }
453 }
454 }
455 return false;
456}
457
459{
460 d->m_autoSelect = enable;
461}
462
464{
465 float result = 0.0;
466 if (d->m_optBrX) {
467 if (d->m_optBrX->valueUnit() == KSaneCore::Option::UnitPixel) {
468 result = d->m_optBrX->maximumValue().toFloat();
469 float dpi = 0;
470 if (d->m_optRes) {
471 dpi = d->m_optRes->value().toFloat();
472 }
473 if (dpi < 1) {
474 qCDebug(KSANE_LOG) << "Broken DPI value";
475 dpi = 1.0;
476 }
477 result = result / dpi / 25.4;
478 } else if (d->m_optBrX->valueUnit() == KSaneCore::Option::UnitMilliMeter) {
479 result = d->m_optBrX->maximumValue().toFloat();
480 }
481 }
482 return result;
483}
484
486{
487 float result = 0.0;
488 if (d->m_optBrY) {
489 if (d->m_optBrY->valueUnit() == KSaneCore::Option::UnitPixel) {
490 result = d->m_optBrY->maximumValue().toFloat();
491 float dpi = 0;
492 if (d->m_optRes) {
493 dpi = d->m_optRes->value().toFloat();
494 }
495 if (dpi < 1) {
496 qCDebug(KSANE_LOG) << "Broken DPI value";
497 dpi = 1.0;
498 }
499 result = result / dpi / 25.4;
500 } else if (d->m_optBrY->valueUnit() == KSaneCore::Option::UnitMilliMeter) {
501 result = d->m_optBrY->maximumValue().toFloat();
502 }
503 }
504 return result;
505}
506
507void KSaneWidget::setSelection(QPointF topLeft, QPointF bottomRight)
508{
509 if (!d->m_optBrX || !d->m_optBrY || !d->m_optTlX || !d->m_optTlY) {
510 return;
511 }
512 if (topLeft.x() < 0.0 || topLeft.y() < 0.0 || bottomRight.x() < 0.0 || bottomRight.y() < 0.0) {
513 d->m_previewViewer->clearActiveSelection();
514 return;
515 }
516
517 float tlxRatio = d->scanAreaToRatioX(topLeft.x());
518 float tlyRatio = d->scanAreaToRatioY(topLeft.y());
519 float brxRatio = d->scanAreaToRatioX(bottomRight.x());
520 float bryRatio = d->scanAreaToRatioX(bottomRight.y());
521
522 d->m_previewViewer->setSelection(tlxRatio, tlyRatio, brxRatio, bryRatio);
523}
524
525} // NameSpace KSaneIface
526
527#include "moc_ksanewidget.cpp"
void setKeepPassword(bool b)
QString password() const
void setUsername(const QString &)
void setPrompt(const QString &prompt)
void setPassword(const QString &password)
bool keepPassword() const
QString username() const
bool reloadDevicesList(DeviceType type=AllDevices)
void scannedImageReady(const QImage &scannedImage)
void previewScanFinished(KSaneCore::Interface::ScanStatus status, const QString &strStatus)
void availableDevices(const QList< DeviceInformation * > &deviceList)
void scanFinished(KSaneCore::Interface::ScanStatus status, const QString &strStatus)
void batchModeCountDown(int remainingSeconds)
void previewProgress(int percent)
void userMessage(KSaneCore::Interface::ScanStatus status, const QString &strStatus)
void scanProgress(int percent)
void buttonPressed(const QString &optionName, const QString &optionLabel, bool pressed)
bool openDevice(const QString &device_name)
This method opens the specified scanner device and adds the scan options to the KSane widget.
bool getOptionValue(const QString &option, QString &value)
This function reads one parameter value into a string.
@ ErrorGeneral
The error string should contain an error message.
Definition ksanewidget.h:39
void cancelScan()
This method can be used to cancel a scan or prevent an automatic new scan.
void scanDone(int status, const QString &strStatus)
This signal is emitted when the scanning has ended.
bool closeDevice()
This method closes the currently open scanner device.
bool setOptionValue(const QString &option, const QString &value)
This function writes one parameter value into a string.
QString selectDevice(QWidget *parent=nullptr)
This helper method displays a dialog for selecting a scanner.
void getOptionValues(QMap< QString, QString > &options)
This method reads the available parameters and their values and returns them in a QMap (Name,...
QString deviceVendor() const
This method returns the vendor name of the currently opened scanner.
int setOptionValues(const QMap< QString, QString > &options)
This method can be used to write many parameter values at once.
void startPreviewScan()
This method can be used to start a preview scan.
void scannedImageReady(const QImage &scannedImage)
This signal is emitted when a final scan is ready.
void setPreviewResolution(float dpi)
This function is used to set the preferred resolution for scanning the preview.
QString deviceName() const
This method returns the internal device name of the currently opened scanner.
KSaneWidget(QWidget *parent=nullptr)
This constructor initializes the private class variables, but the widget is left empty.
void startScan()
This method can be used to start a scan (if no GUI is needed).
float scanAreaWidth()
This method returns the scan area's width in mm.
void enableAutoSelect(bool enable)
This function can be used to enable/disable automatic selections on previews.
float scanAreaHeight()
This method returns the scan area's height in mm.
void setSelection(QPointF topLeft, QPointF bottomRight)
This method sets the selection according to the given points.
QString deviceModel() const
This method returns the model of the currently opened scanner.
void buttonPressed(const QString &optionName, const QString &optionLabel, bool pressed)
This Signal is emitted when a hardware button is pressed.
~KSaneWidget() override
Standard destructor.
A button which appears on the side of a splitter handle and allows easy collapsing of the widget on t...
virtual bool createFolder(const QString &f)
virtual bool hasFolder(const QString &f)
virtual int readMap(const QString &key, QMap< QString, QString > &value)
static const QString LocalWallet()
static Wallet * openWallet(const QString &name, WId w, OpenType ot=Synchronous)
virtual bool setFolder(const QString &f)
virtual int writeMap(const QString &key, const QMap< QString, QString > &value)
Q_SCRIPTABLE CaptureState status()
QString i18nc(const char *context, const char *text, const TYPE &arg...)
QString i18n(const char *text, const TYPE &arg...)
void clicked(bool checked)
void addStretch(int stretch)
void addWidget(QWidget *widget, int stretch, Qt::Alignment alignment)
virtual int exec()
QIcon fromTheme(const QString &name)
void setContentsMargins(const QMargins &margins)
void clear()
bool empty() const const
Q_EMITQ_EMIT
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
QObject * parent() const const
qreal x() const const
qreal y() const const
void activated()
bool isEmpty() const const
AlignCenter
OtherFocusReason
QWidget(QWidget *parent, Qt::WindowFlags f)
void setFocusProxy(QWidget *w)
WId winId() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:06:01 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.