diff --git a/library/JQLibrary/JQLibrary.pri b/library/JQLibrary/JQLibrary.pri index 8fef157..8f64dd1 100644 --- a/library/JQLibrary/JQLibrary.pri +++ b/library/JQLibrary/JQLibrary.pri @@ -149,10 +149,10 @@ contains( QT, network ) { } } -exists( $$PWD/src/JQTranslation.cpp ) { +exists( $$PWD/src/jqthread.cpp ) { - SOURCES *= $$PWD/src/JQTranslation.cpp - HEADERS *= $$PWD/include/JQTranslation.h + SOURCES *= $$PWD/src/jqthread.cpp + HEADERS *= $$PWD/include/jqthread.h } contains( QT, multimedia | concurrent ) { diff --git a/library/JQLibrary/include/JQFile.h b/library/JQLibrary/include/JQFile.h index e69a321..bb4d246 100644 --- a/library/JQLibrary/include/JQFile.h +++ b/library/JQLibrary/include/JQFile.h @@ -15,8 +15,8 @@ http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. */ -#ifndef JQFILE_H_ -#define JQFILE_H_ +#ifndef JQLIBRARY_INCLUDE_JQFILE_H_ +#define JQLIBRARY_INCLUDE_JQFILE_H_ // C++ lib import #include @@ -52,4 +52,4 @@ bool setFileLastReadAndLastModifiedTime(const char *fileName, const quint32 &las } -#endif//JQFILE_H_ +#endif//JQLIBRARY_INCLUDE_JQFILE_H_ diff --git a/library/JQLibrary/include/JQFoundation.h b/library/JQLibrary/include/JQFoundation.h index 401c840..f5a676f 100755 --- a/library/JQLibrary/include/JQFoundation.h +++ b/library/JQLibrary/include/JQFoundation.h @@ -15,8 +15,8 @@ http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. */ -#ifndef JQFOUNDATION_H_ -#define JQFOUNDATION_H_ +#ifndef JQLIBRARY_INCLUDE_JQFOUNDATION_H_ +#define JQLIBRARY_INCLUDE_JQFOUNDATION_H_ #if ((__cplusplus < 201103) && !(defined _MSC_VER)) || ((defined _MSC_VER) && (_MSC_VER < 1800)) # error("Please add c++11 config on pro file") @@ -168,23 +168,11 @@ QByteArray pixmapToByteArray(const QPixmap &pixmap, const QString &format, int q QByteArray imageToByteArray(const QImage &image, const QString &format, int quality = -1); -QPixmap byteArrayToPixmap(const QByteArray &byteArray); - #if ( ( defined Q_OS_MAC ) && !( defined Q_OS_IOS ) ) || ( defined Q_OS_WIN ) || ( defined Q_OS_LINUX ) QPair< int, QByteArray > startProcessAndReadOutput(const QString &program, const QStringList &arguments, const int &maximumTime = 5 * 1000); #endif #ifdef QT_WIDGETS_LIB -void tableWidgetSetHorizontalHeaderLabels(QTableWidget *tableWidget, const QStringList &stringList); - -void tableWidgetSetColumnWidth(QTableWidget *tableWidget, const QVector &columnWidth); - -void tableWidgetAddString(QTableWidget *tablwWidget, const QStringList &string); - -void treeWidgetSetHorizontalHeaderLabels(QTreeWidget *treeWidget, const QStringList &ttringList); - -void treeWidgetSetColumnWidth(QTreeWidget *treeWidget, const QVector &columnWidth); - void setWidgetColor(QWidget *label, const QColor &color); void texetEditMoveCursorToEnd(QTextEdit *textEdit); @@ -250,4 +238,4 @@ QMap< Key, T > mapMix(const QMap< Key, T > &source, const QMap< Key, T > &mix) } -#endif//JQFOUNDATION_H_ +#endif//JQLIBRARY_INCLUDE_JQFOUNDATION_H_ diff --git a/library/JQLibrary/src/JQFoundation.cpp b/library/JQLibrary/src/JQFoundation.cpp index e025501..dcf68f5 100755 --- a/library/JQLibrary/src/JQFoundation.cpp +++ b/library/JQLibrary/src/JQFoundation.cpp @@ -424,15 +424,6 @@ QByteArray JQFoundation::imageToByteArray(const QImage &image, const QString &fo return bytes; } -QPixmap JQFoundation::byteArrayToPixmap(const QByteArray &byteArray) -{ - QPixmap Pixmap; - - Pixmap.loadFromData(byteArray); - - return Pixmap; -} - #if ( ( defined Q_OS_MAC ) && !( defined Q_OS_IOS ) ) || ( defined Q_OS_WIN ) || ( defined Q_OS_LINUX ) QPair< int, QByteArray > JQFoundation::startProcessAndReadOutput(const QString &program, const QStringList &arguments, const int &maximumTime) { @@ -459,63 +450,6 @@ QPair< int, QByteArray > JQFoundation::startProcessAndReadOutput(const QString & #endif #ifdef QT_WIDGETS_LIB -void JQFoundation::tableWidgetSetHorizontalHeaderLabels(QTableWidget *tableWidget, const QStringList &stringList) -{ - tableWidget->setColumnCount(stringList.size()); - tableWidget->setHorizontalHeaderLabels(stringList); -} - -void JQFoundation::tableWidgetSetColumnWidth(QTableWidget *tableWidget, const QVector &columnWidth) -{ - int column = -1; - foreach (auto &&now, columnWidth) - { - tableWidget->setColumnWidth(++column, now); - } -} - -void JQFoundation::tableWidgetAddString(QTableWidget *tableWidget, const QStringList &stringList) -{ - int x = 0, y = tableWidget->rowCount(); - tableWidget->setRowCount(y + 1); - QTableWidgetItem *item; - - foreach (QString Now, stringList) - { - item = new QTableWidgetItem(Now); - item->setSelected(false); - item->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter); - tableWidget->setItem(y, x++, item); - } -} - -void JQFoundation::treeWidgetSetHorizontalHeaderLabels(QTreeWidget *treeWidget, const QStringList &stringList) -{ - treeWidget->setColumnCount(stringList.size()); - treeWidget->setHeaderLabels(stringList); -} - -void JQFoundation::treeWidgetSetColumnWidth(QTreeWidget *treeWidget, const QVector &columnWidth) -{ - int column = -1; - foreach (auto &&now, columnWidth) - { - ++column; - if (now > 0) - { - treeWidget->setColumnWidth(column, now); - } - else if (!now) - { - continue; - } - else - { - treeWidget->setColumnWidth(column, treeWidget->headerItem()->text(column).size() * abs(now)); - } - } -} - void JQFoundation::setWidgetColor(QWidget *label, const QColor &color) { QPalette palette;