Kstars

opsastrometryindexfiles.cpp
1
2#include "opsastrometryindexfiles.h"
3
4#include "align.h"
5#include "kstars.h"
6#include "ksutils.h"
7#include "Options.h"
8#include "ksnotification.h"
9
10#include <KConfigDialog>
11#include <KMessageBox>
12#include <QFileDialog>
13#include <QDesktopServices>
14
15namespace Ekos
16{
17OpsAstrometryIndexFiles::OpsAstrometryIndexFiles(Align *parent) : QDialog(KStars::Instance())
18{
19 setupUi(this);
20
21 downloadSpeed = 100;
22 actualdownloadSpeed = downloadSpeed;
23 alignModule = parent;
24 manager = new QNetworkAccessManager();
25
26 indexURL->setText("http://broiler.astrometry.net/~dstn/");
27
28 //Get a pointer to the KConfigDialog
29 // m_ConfigDialog = KConfigDialog::exists( "alignsettings" );
30 connect(openIndexFileDirectory, SIGNAL(clicked()), this, SLOT(slotOpenIndexFileDirectory()));
31 connect(indexURL, &QLineEdit::textChanged, [&]()
32 {
33 indexURL->text();
34 });
35
36
37 astrometryIndex[2.8] = "00";
38 astrometryIndex[4.0] = "01";
39 astrometryIndex[5.6] = "02";
40 astrometryIndex[8] = "03";
41 astrometryIndex[11] = "04";
42 astrometryIndex[16] = "05";
43 astrometryIndex[22] = "06";
44 astrometryIndex[30] = "07";
45 astrometryIndex[42] = "08";
46 astrometryIndex[60] = "09";
47 astrometryIndex[85] = "10";
48 astrometryIndex[120] = "11";
49 astrometryIndex[170] = "12";
50 astrometryIndex[240] = "13";
51 astrometryIndex[340] = "14";
52 astrometryIndex[480] = "15";
53 astrometryIndex[680] = "16";
54 astrometryIndex[1000] = "17";
55 astrometryIndex[1400] = "18";
56 astrometryIndex[2000] = "19";
57
58 QList<QCheckBox *> checkboxes = findChildren<QCheckBox *>();
59
60 connect(indexLocations, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
61 &OpsAstrometryIndexFiles::slotUpdate);
62
63 for (auto &checkBox : checkboxes)
64 {
65 connect(checkBox, &QCheckBox::clicked, this, &OpsAstrometryIndexFiles::downloadOrDeleteIndexFiles);
66 }
67
68 QList<QProgressBar *> progressBars = findChildren<QProgressBar *>();
69 QList<QLabel *> qLabels = findChildren<QLabel *>();
70 QList<QPushButton *> qButtons = findChildren<QPushButton *>();
71
72 for (auto &bar : progressBars)
73 {
74 if(bar->objectName().contains("progress"))
75 {
76 bar->setVisible(false);
77 bar->setTextVisible(false);
78 }
79 }
80
81 for (auto &button : qButtons)
82 {
83 if(button->objectName().contains("cancel"))
84 {
85 button->setVisible(false);
86 }
87 }
88
89 for (QLabel * label : qLabels)
90 {
91 if(label->text().contains("info") || label->text().contains("perc"))
92 {
93 label->setVisible(false);
94 }
95 }
96
97 connect(addIndexFileDirectory, &QAbstractButton::clicked, this, [this]()
98 {
99 QString dir = QFileDialog::getExistingDirectory(this, "Load Index File Directory",
103 if (dir.isEmpty())
104 return;
105 addDirectoryToList(dir);
106 });
107 connect(removeIndexFileDirectory, &QAbstractButton::clicked, this, [this]()
108 {
109 if(indexLocations->currentIndex() != 0)
110 removeDirectoryFromList(indexLocations->currentText());
111 });
112
113
114}
115
116void OpsAstrometryIndexFiles::showEvent(QShowEvent *)
117{
118 updateIndexDirectoryList();
119
120}
121
122void OpsAstrometryIndexFiles::updateIndexDirectoryList()
123{
124 // This is needed because they might have directories stored in the config file.
125 // So we can't just use the options folder list.
126 QStringList astrometryDataDirs = KSUtils::getAstrometryDataDirs();
127
128 indexLocations->clear();
129 if(astrometryDataDirs.count() > 1)
130 indexLocations->addItem("All Sources");
131 indexLocations->addItems(astrometryDataDirs);
132 slotUpdate();
133}
134
135void OpsAstrometryIndexFiles::addDirectoryToList(QString directory)
136{
137 QDir dir(directory);
138 if(!dir.exists())
139 return;
140 QString directoryPath = dir.absolutePath();
141
142 QStringList indexFileDirs = Options::astrometryIndexFolderList();
143 if(indexFileDirs.contains(directoryPath))
144 return;
145 indexFileDirs.append(directoryPath);
146 Options::setAstrometryIndexFolderList(indexFileDirs);
147 updateIndexDirectoryList();
148}
149
150void OpsAstrometryIndexFiles::removeDirectoryFromList(QString directory)
151{
152 QStringList indexFileDirs = Options::astrometryIndexFolderList();
153 if(indexFileDirs.contains(directory))
154 {
155 indexFileDirs.removeOne(directory);
156 Options::setAstrometryIndexFolderList(indexFileDirs);
157 updateIndexDirectoryList();
158 }
159}
160
161void OpsAstrometryIndexFiles::slotUpdate()
162{
163 QList<QCheckBox *> checkboxes = findChildren<QCheckBox *>();
164
165 for (auto &checkBox : checkboxes)
166 {
167 checkBox->setChecked(false);
168 }
169
170 if(indexLocations->count() == 0)
171 return;
172
173 double fov_w, fov_h, fov_pixscale;
174
175 // Values in arcmins. Scale in arcsec per pixel
176 alignModule->getFOVScale(fov_w, fov_h, fov_pixscale);
177
178 double fov_check = qMax(fov_w, fov_h);
179
180 FOVOut->setText(QString("%1' x %2'").arg(QString::number(fov_w, 'f', 2), QString::number(fov_h, 'f', 2)));
181
182 QStringList nameFilter("*.fits");
183
184 QStringList astrometryDataDirs = Options::astrometryIndexFolderList();
185
186 bool allDirsSelected = (indexLocations->currentIndex() == 0 && astrometryDataDirs.count() > 1);
187 bool folderIsWriteable;
188
189 QStringList astrometryDataDirsToIndex;
190
191 if(allDirsSelected)
192 {
193 folderDetails->setText(i18n("Downloads Disabled, this is not a directory, it is a list of all index files."));
194 folderIsWriteable = false;
195 astrometryDataDirsToIndex = astrometryDataDirs;
196 openIndexFileDirectory->setEnabled(false);
197 }
198 else
199 {
200 QString folderPath = indexLocations->currentText();
201 folderIsWriteable = QFileInfo(folderPath).isWritable();
202 if(folderIsWriteable)
203 folderDetails->setText(i18n("Downloads Enabled, the directory exists and is writeable."));
204 else
205 folderDetails->setText(i18n("Downloads Disabled, directory permissions issue."));
206 if(!QFileInfo::exists(folderPath))
207 folderDetails->setText(i18n("Downloads Disabled, directory does not exist."));
208 astrometryDataDirsToIndex << folderPath;
209 openIndexFileDirectory->setEnabled(true);
210 }
211 folderDetails->setCursorPosition(0);
212
213 //This loop checks all the folders that are supposed to be checked for the files
214 //It checks the box if it finds them
215 for(auto &astrometryDataDir : astrometryDataDirsToIndex)
216 {
217 QDir directory(astrometryDataDir);
218 QStringList indexList = directory.entryList(nameFilter);
219
220 for (auto &indexName : indexList)
221 {
222 if (fileCountMatches(directory, indexName))
223 {
224 indexName = indexName.replace('-', '_').left(10);
225 QCheckBox *indexCheckBox = findChild<QCheckBox *>(indexName);
226 if (indexCheckBox)
227 indexCheckBox->setChecked(true);
228 }
229 }
230 }
231
232 for (auto &checkBox : checkboxes)
233 {
234 checkBox->setEnabled(folderIsWriteable);
235 checkBox->setIcon(QIcon(":/icons/astrometry-optional.svg"));
236 checkBox->setToolTip(i18n("Optional"));
237 checkBox->setStyleSheet("");
238 }
239
240 float last_skymarksize = 2;
241
242 for (auto &skymarksize : astrometryIndex.keys())
243 {
244 QString indexName1 = "index_41" + astrometryIndex.value(skymarksize);
245 QString indexName2 = "index_42" + astrometryIndex.value(skymarksize);
246 QString indexName3 = "index_52" + astrometryIndex.value(skymarksize);
247 QCheckBox *indexCheckBox1 = findChild<QCheckBox *>(indexName1);
248 QCheckBox *indexCheckBox2 = findChild<QCheckBox *>(indexName2);
249 QCheckBox *indexCheckBox3 = findChild<QCheckBox *>(indexName3);
250 if ((skymarksize >= 0.40 * fov_check && skymarksize <= 0.9 * fov_check) ||
251 (fov_check > last_skymarksize && fov_check < skymarksize))
252 {
253 if (indexCheckBox1)
254 {
255 indexCheckBox1->setIcon(QIcon(":/icons/astrometry-required.svg"));
256 indexCheckBox1->setToolTip(i18n("Required"));
257 }
258 if (indexCheckBox2)
259 {
260 indexCheckBox2->setIcon(QIcon(":/icons/astrometry-required.svg"));
261 indexCheckBox2->setToolTip(i18n("Required"));
262 }
263 if (indexCheckBox3)
264 {
265 indexCheckBox3->setIcon(QIcon(":/icons/astrometry-required.svg"));
266 indexCheckBox3->setToolTip(i18n("Required"));
267 }
268 }
269 else if (skymarksize >= 0.10 * fov_check && skymarksize <= fov_check)
270 {
271 if (indexCheckBox1)
272 {
273 indexCheckBox1->setIcon(QIcon(":/icons/astrometry-recommended.svg"));
274 indexCheckBox1->setToolTip(i18n("Recommended"));
275 }
276 if (indexCheckBox2)
277 {
278 indexCheckBox2->setIcon(QIcon(":/icons/astrometry-recommended.svg"));
279 indexCheckBox2->setToolTip(i18n("Recommended"));
280 }
281 if (indexCheckBox3)
282 {
283 indexCheckBox3->setIcon(QIcon(":/icons/astrometry-recommended.svg"));
284 indexCheckBox3->setToolTip(i18n("Recommended"));
285 }
286 }
287
288 last_skymarksize = skymarksize;
289 }
290
291 //This loop goes over all the directories and adds a stylesheet to change the look of the checkbox text
292 //if the File is installed in any directory. Note that this indicator is then used below in the
293 //Index File download function to check if they really want to do install a file that is installed.
294 for(QString astrometryDataDir : astrometryDataDirs)
295 {
296 QDir directory(astrometryDataDir);
297 QStringList indexList = directory.entryList(nameFilter);
298
299 for (auto &indexName : indexList)
300 {
301 if (fileCountMatches(directory, indexName))
302 {
303 indexName = indexName.replace('-', '_').left(10);
304 QCheckBox *indexCheckBox = findChild<QCheckBox *>(indexName);
305 if (indexCheckBox)
306 indexCheckBox->setStyleSheet("QCheckBox{font-weight: bold; color:green}");
307 }
308 }
309 }
310}
311
312int OpsAstrometryIndexFiles::indexFileCount(QString indexName)
313{
314 int count = 0;
315 if(indexName.contains("4207") || indexName.contains("4206") || indexName.contains("4205"))
316 count = 12;
317 else if(indexName.contains("4204") || indexName.contains("4203") || indexName.contains("4202")
318 || indexName.contains("4201") || indexName.contains("4200") || indexName.contains("5206")
319 || indexName.contains("5205") || indexName.contains("5204") || indexName.contains("5203")
320 || indexName.contains("5202") || indexName.contains("5201") || indexName.contains("5200"))
321 count = 48;
322 else
323 count = 1;
324 return count;
325}
326
327bool OpsAstrometryIndexFiles::fileCountMatches(QDir directory, QString indexName)
328{
329 QString indexNameMatch = indexName.left(10) + "*.fits";
330 QStringList list = directory.entryList(QStringList(indexNameMatch));
331 return list.count() == indexFileCount(indexName);
332}
333
334void OpsAstrometryIndexFiles::slotOpenIndexFileDirectory()
335{
336 if(indexLocations->count() == 0)
337 return;
338 QUrl path = QUrl::fromLocalFile(indexLocations->currentText());
340}
341
342bool OpsAstrometryIndexFiles::astrometryIndicesAreAvailable()
343{
344 QUrl indexUrl = QUrl(this->indexURL->text());
345 QNetworkReply *response = manager->get(QNetworkRequest(QUrl(indexUrl.url(QUrl::RemovePath))));
346 QTimer timeout(this);
347 timeout.setInterval(5000);
348 timeout.setSingleShot(true);
349 timeout.start();
350 while (!response->isFinished())
351 {
352 if (!timeout.isActive())
353 {
354 response->deleteLater();
355 return false;
356 }
357 qApp->processEvents();
358 }
359
360 timeout.stop();
361 bool wasSuccessful = (response->error() == QNetworkReply::NoError);
362 response->deleteLater();
363
364 return wasSuccessful;
365}
366
367void OpsAstrometryIndexFiles::downloadIndexFile(const QString &URL, const QString &fileN, QCheckBox *checkBox,
368 int currentIndex, int maxIndex, double fileSize)
369{
370 QElapsedTimer downloadTime;
371 downloadTime.start();
372
373 QString indexString = QString::number(currentIndex);
374 if (currentIndex < 10)
375 indexString = '0' + indexString;
376
377 QString indexSeriesName = checkBox->text().remove('&');
378 QProgressBar *indexDownloadProgress = findChild<QProgressBar *>(indexSeriesName.replace('-', '_').left(10) + "_progress");
379 QLabel *indexDownloadInfo = findChild<QLabel *>(indexSeriesName.replace('-', '_').left(10) + "_info");
380 QPushButton *indexDownloadCancel = findChild<QPushButton *>(indexSeriesName.replace('-', '_').left(10) + "_cancel");
381 QLabel *indexDownloadPerc = findChild<QLabel *>(indexSeriesName.replace('-', '_').left(10) + "_perc");
382
383 setDownloadInfoVisible(indexSeriesName, checkBox, true);
384
385 if(indexDownloadInfo)
386 {
387 if (indexDownloadProgress && maxIndex > 0)
388 indexDownloadProgress->setValue(currentIndex * 100 / maxIndex);
389 indexDownloadInfo->setText("(" + QString::number(currentIndex) + '/' + QString::number(maxIndex + 1) + ") ");
390 }
391
392 QString indexURL = URL;
393
394 indexURL.replace('*', indexString);
395
396 QNetworkReply *response = manager->get(QNetworkRequest(QUrl(indexURL)));
397
398 //Shut it down after too much time elapses.
399 //If the filesize is less than 4 MB, it sets the timeout for 1 minute or 60000 ms.
400 //If it's larger, it assumes a bad download rate of 1 Mbps (100 bytes/ms)
401 //and the calculation estimates the time in milliseconds it would take to download.
402 int timeout = 60000;
403 if(fileSize > 4000000)
404 timeout = fileSize / downloadSpeed;
405 //qDebug()<<"Filesize: "<< fileSize << ", timeout: " << timeout;
406
407 QMetaObject::Connection *cancelConnection = new QMetaObject::Connection();
408 QMetaObject::Connection *replyConnection = new QMetaObject::Connection();
409 QMetaObject::Connection *percentConnection = new QMetaObject::Connection();
410
411 if(indexDownloadPerc)
412 {
413 *percentConnection = connect(response, &QNetworkReply::downloadProgress,
414 [ = ](qint64 bytesReceived, qint64 bytesTotal)
415 {
416 if (indexDownloadProgress)
417 {
418 indexDownloadProgress->setValue(bytesReceived);
419 indexDownloadProgress->setMaximum(bytesTotal);
420 }
421 indexDownloadPerc->setText(QString::number(bytesReceived * 100 / bytesTotal) + '%');
422 });
423
424 }
425
426 timeoutTimer.disconnect();
427 connect(&timeoutTimer, &QTimer::timeout, this, [&]()
428 {
429 KSNotification::error(
430 i18n("Download Timed out. Either the network is not fast enough, the file is not accessible, or you are not connected."));
431 disconnectDownload(cancelConnection, replyConnection, percentConnection);
432 if(response)
433 {
434 response->abort();
435 response->deleteLater();
436 }
437 setDownloadInfoVisible(indexSeriesName, checkBox, false);
438 });
439 timeoutTimer.start(timeout);
440
441 *cancelConnection = connect(indexDownloadCancel, &QPushButton::clicked,
442 [ = ]()
443 {
444 qDebug() << Q_FUNC_INFO << "Download Cancelled.";
445 timeoutTimer.stop();
446 disconnectDownload(cancelConnection, replyConnection, percentConnection);
447 if(response)
448 {
449 response->abort();
450 response->deleteLater();
451 }
452 setDownloadInfoVisible(indexSeriesName, checkBox, false);
453 });
454
455 *replyConnection = connect(response, &QNetworkReply::finished, this,
456 [ = ]()
457 {
458 timeoutTimer.stop();
459 if(response)
460 {
461 disconnectDownload(cancelConnection, replyConnection, percentConnection);
462 setDownloadInfoVisible(indexSeriesName, checkBox, false);
463 response->deleteLater();
464 if (response->error() != QNetworkReply::NoError)
465 return;
466
467 QByteArray responseData = response->readAll();
468 QString indexFileN = fileN;
469
470 indexFileN.replace('*', indexString);
471
472 QFile file(indexFileN);
473 if (QFileInfo(QFileInfo(file).path()).isWritable())
474 {
475 if (!file.open(QIODevice::WriteOnly))
476 {
477 KSNotification::error(i18n("File Write Error"));
478 slotUpdate();
479 return;
480 }
481 else
482 {
483 file.write(responseData.data(), responseData.size());
484 file.close();
485 int downloadedFileSize = QFileInfo(file).size();
486 int dtime = downloadTime.elapsed();
487 actualdownloadSpeed = (actualdownloadSpeed + (downloadedFileSize / dtime)) / 2;
488 qDebug() << Q_FUNC_INFO << "Filesize: " << downloadedFileSize << ", time: " << dtime << ", inst speed: " <<
489 downloadedFileSize / dtime <<
490 ", averaged speed: " << actualdownloadSpeed;
491
492 }
493 }
494 else
495 {
496 KSNotification::error(i18n("Astrometry Folder Permissions Error"));
497 }
498
499 if (currentIndex == maxIndex)
500 {
501 slotUpdate();
502 }
503 else
504 downloadIndexFile(URL, fileN, checkBox, currentIndex + 1, maxIndex, fileSize);
505 }
506 });
507}
508
509void OpsAstrometryIndexFiles::setDownloadInfoVisible(QString indexSeriesName, QCheckBox *checkBox, bool set)
510{
511 Q_UNUSED(checkBox);
512
513 QProgressBar *indexDownloadProgress = findChild<QProgressBar *>(indexSeriesName.replace('-', '_').left(10) + "_progress");
514 QLabel *indexDownloadInfo = findChild<QLabel *>(indexSeriesName.replace('-', '_').left(10) + "_info");
515 QPushButton *indexDownloadCancel = findChild<QPushButton *>(indexSeriesName.replace('-', '_').left(10) + "_cancel");
516 QLabel *indexDownloadPerc = findChild<QLabel *>(indexSeriesName.replace('-', '_').left(10) + "_perc");
517 if (indexDownloadProgress)
518 indexDownloadProgress->setVisible(set);
519 if (indexDownloadInfo)
520 indexDownloadInfo->setVisible(set);
521 if (indexDownloadCancel)
522 indexDownloadCancel->setVisible(set);
523 if (indexDownloadPerc)
524 indexDownloadPerc->setVisible(set);
525}
526void OpsAstrometryIndexFiles::disconnectDownload(QMetaObject::Connection *cancelConnection,
527 QMetaObject::Connection *replyConnection, QMetaObject::Connection *percentConnection)
528{
529 if(cancelConnection)
530 disconnect(*cancelConnection);
531 if(replyConnection)
532 disconnect(*replyConnection);
533 if(percentConnection)
534 disconnect(*percentConnection);
535}
536
537void OpsAstrometryIndexFiles::downloadOrDeleteIndexFiles(bool checked)
538{
539 QCheckBox *checkBox = qobject_cast<QCheckBox *>(QObject::sender());
540
541 if (indexLocations->count() == 0)
542 return;
543
544 QString astrometryDataDir = indexLocations->currentText();
545 if(!QFileInfo::exists(astrometryDataDir))
546 {
547 KSNotification::sorry(
548 i18n("The selected Index File directory does not exist. Please either create it or choose another."));
549 return;
550 }
551
552 if (checkBox)
553 {
554 QString indexSeriesName = checkBox->text().remove('&');
555 QString filePath = astrometryDataDir + '/' + indexSeriesName;
556 QString fileNumString = indexSeriesName.mid(8, 2);
557
558 if (checked)
559 {
560 if(!checkBox->styleSheet().isEmpty()) //This means that the checkbox has a stylesheet so the index file was installed someplace.
561 {
563 nullptr, i18n("The file %1 already exists in another directory. Are you sure you want to download it to this directory as well?",
564 indexSeriesName),
565 i18n("Install File(s)"), KStandardGuiItem::cont(),
566 KStandardGuiItem::cancel(), "install_index_files_warning"))
567 {
568 slotUpdate();
569 return;
570 }
571 }
572 checkBox->setChecked(!checked);
573 if (astrometryIndicesAreAvailable())
574 {
575 QString BASE_URL;
576 QString URL;
577
578 if (this->indexURL->text().endsWith("/"))
579 {
580 BASE_URL = this->indexURL->text();
581 }
582 else
583 {
584 BASE_URL = this->indexURL->text() + "/";
585 }
586
587 if (indexSeriesName.startsWith(QLatin1String("index-41")))
588 URL = BASE_URL + "4100/" + indexSeriesName;
589 else if (indexSeriesName.startsWith(QLatin1String("index-42")))
590 URL = BASE_URL + "4200/" + indexSeriesName;
591 else if (indexSeriesName.startsWith(QLatin1String("index-52")))
592 URL = "https://portal.nersc.gov/project/cosmo/temp/dstn/index-5200/LITE/" + indexSeriesName;
593
594 int maxIndex = indexFileCount(indexSeriesName) - 1;
595
596 double fileSize = 1E11 * qPow(astrometryIndex.key(fileNumString),
597 -1.909); //This estimates the file size based on skymark size obtained from the index number.
598 if(maxIndex != 0)
599 fileSize /= maxIndex; //FileSize is divided between multiple files for some index series.
600 downloadIndexFile(URL, filePath, checkBox, 0, maxIndex, fileSize);
601 }
602 else
603 {
604 KSNotification::sorry(i18n("Could not contact Astrometry Index Server."));
605 }
606 }
607 else
608 {
610 nullptr, i18n("Are you sure you want to delete these index files? %1", indexSeriesName),
611 i18n("Delete File(s)"), KStandardGuiItem::cont(),
612 KStandardGuiItem::cancel(), "delete_index_files_warning"))
613 {
614 if (QFileInfo(astrometryDataDir).isWritable())
615 {
616 QStringList nameFilter("*.fits");
617 QDir directory(astrometryDataDir);
618 QStringList indexList = directory.entryList(nameFilter);
619 for (auto &fileName : indexList)
620 {
621 if (fileName.contains(indexSeriesName.left(10)))
622 {
623 if (!directory.remove(fileName))
624 {
625 KSNotification::error(i18n("File Delete Error"));
626 slotUpdate();
627 return;
628 }
629 slotUpdate();
630 }
631 }
632 }
633 else
634 {
635 KSNotification::error(i18n("Astrometry Folder Permissions Error"));
636 slotUpdate();
637 }
638 }
639 }
640 }
641}
642}
This is the main window for KStars.
Definition kstars.h:89
QString i18n(const char *text, const TYPE &arg...)
Ekos is an advanced Astrophotography tool for Linux.
Definition align.cpp:83
QString path(const QString &relativePath)
ButtonCode warningContinueCancel(QWidget *parent, const QString &text, const QString &title=QString(), const KGuiItem &buttonContinue=KStandardGuiItem::cont(), const KGuiItem &buttonCancel=KStandardGuiItem::cancel(), const QString &dontAskAgainName=QString(), Options options=Notify)
KIOCORE_EXPORT QString dir(const QString &fileClass)
KIOCORE_EXPORT QStringList list(const QString &fileClass)
KGuiItem cont()
KGuiItem cancel()
QString label(StandardShortcut id)
void setChecked(bool)
void clicked(bool checked)
void setIcon(const QIcon &icon)
char * data()
qsizetype size() const const
void currentIndexChanged(int index)
bool openUrl(const QUrl &url)
QStringList entryList(Filters filters, SortFlags sort) const const
QString homePath()
bool remove(const QString &fileName)
qint64 elapsed() const const
QString getExistingDirectory(QWidget *parent, const QString &caption, const QString &dir, Options options)
bool exists() const const
bool isWritable() const const
qint64 size() const const
QByteArray readAll()
void setText(const QString &)
void textChanged(const QString &text)
void append(QList< T > &&value)
qsizetype count() const const
bool removeOne(const AT &t)
virtual void abort()=0
void downloadProgress(qint64 bytesReceived, qint64 bytesTotal)
NetworkError error() const const
bool isFinished() const const
void deleteLater()
QObject * sender() const const
void setMaximum(int maximum)
void setValue(int value)
bool contains(QChar ch, Qt::CaseSensitivity cs) const const
bool endsWith(QChar c, Qt::CaseSensitivity cs) const const
bool isEmpty() const const
QString left(qsizetype n) const const
QString mid(qsizetype position, qsizetype n) const const
QString number(double n, char format, int precision)
QString & replace(QChar before, QChar after, Qt::CaseSensitivity cs)
bool contains(QLatin1StringView str, Qt::CaseSensitivity cs) const const
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
void timeout()
QUrl fromLocalFile(const QString &localFile)
QString url(FormattingOptions options) const const
void setStyleSheet(const QString &styleSheet)
void setToolTip(const QString &)
virtual void setVisible(bool visible)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:38:42 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.