diff --git a/Documentation/TO-DO b/Documentation/TO-DO index fd1bf115..a1d2db92 100644 --- a/Documentation/TO-DO +++ b/Documentation/TO-DO @@ -598,6 +598,7 @@ biblioteq_callnum_table_item.[cc, h] (Completed) biblioteq_copy_editor_book.[cc, h] (Completed) biblioteq_files.[cc, h] (Completed) + biblioteq_item.[cc, h] (Completed) biblioteq_magazine.[cc, h] (Completed) biblioteq_photographcollection.[cc, h] (Completed) biblioteq_videogame.[cc, h] (Completed) diff --git a/Source/biblioteq_item.cc b/Source/biblioteq_item.cc index b1c5e123..24f4b89a 100644 --- a/Source/biblioteq_item.cc +++ b/Source/biblioteq_item.cc @@ -36,6 +36,7 @@ #include #include #include +#include #include biblioteq_item::biblioteq_item(const QModelIndex &index) @@ -49,15 +50,8 @@ biblioteq_item::biblioteq_item(const QModelIndex &index) qmain = nullptr; } -biblioteq_item::biblioteq_item(void) +biblioteq_item::biblioteq_item(void):biblioteq_item(QModelIndex()) { - m_index = new QPersistentModelIndex(QModelIndex()); - m_isQueryEnabled = false; - m_oldq = -1; - m_parentWid = nullptr; - m_queryHighlightColor = QColor(162, 205, 90); - m_requiredHighlightColor = QColor(255, 248, 220); - qmain = nullptr; } biblioteq_item::~biblioteq_item() @@ -91,8 +85,7 @@ bool biblioteq_item::hasDataChanged(QMainWindow *window) const if(classname == "QComboBox") newdata[objectname] = - (qobject_cast (widget))->currentText(). - trimmed(); + (qobject_cast (widget))->currentText().trimmed(); else if(classname == "QDateEdit") newdata[objectname] = (qobject_cast (widget))->date().toString @@ -157,6 +150,34 @@ int biblioteq_item::getRow(void) const return -1; } +void biblioteq_item::prepareIcons(QMainWindow *window) +{ + if(!window) + return; + + QSettings setting; + auto index = setting.value("otheroptions/display_icon_set_index", 0).toInt(); + + if(index == 1) + { + // System. + } + else + { + // Faenza. + + foreach(auto pushButton, window->findChildren ()) + { + auto text(pushButton->text()); + } + + foreach(auto toolButton, window->findChildren ()) + { + auto text(toolButton->text()); + } + } +} + void biblioteq_item::print(QWidget *parent) { QPrinter printer; @@ -192,7 +213,7 @@ void biblioteq_item::setQMain(QMainWindow *window) foreach(auto widget, window->findChildren ()) { - const QString &classname(widget->metaObject()->className()); + const QString classname(widget->metaObject()->className()); if(classname == "biblioteq_hyperlinked_text_edit") qobject_cast (widget)-> diff --git a/Source/biblioteq_item.h b/Source/biblioteq_item.h index b4c2c1de..4b90f02d 100644 --- a/Source/biblioteq_item.h +++ b/Source/biblioteq_item.h @@ -94,6 +94,7 @@ class biblioteq_item bool m_isQueryEnabled; int m_oldq; bool hasDataChanged(QMainWindow *window) const; + void prepareIcons(QMainWindow *window); void print(QWidget *parent); void setQMain(QMainWindow *window); void setReadOnlyFields(QMainWindow *window, const bool state);