Skip to content

Commit

Permalink
Icons.
Browse files Browse the repository at this point in the history
  • Loading branch information
textbrowser committed Mar 21, 2024
1 parent fc25d30 commit 1ded5b6
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 11 deletions.
1 change: 1 addition & 0 deletions Documentation/TO-DO
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
43 changes: 32 additions & 11 deletions Source/biblioteq_item.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <QLineEdit>
#include <QPersistentModelIndex>
#include <QPlainTextEdit>
#include <QSettings>
#include <QSpinBox>

biblioteq_item::biblioteq_item(const QModelIndex &index)
Expand All @@ -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()
Expand Down Expand Up @@ -91,8 +85,7 @@ bool biblioteq_item::hasDataChanged(QMainWindow *window) const

if(classname == "QComboBox")
newdata[objectname] =
(qobject_cast<QComboBox *> (widget))->currentText().
trimmed();
(qobject_cast<QComboBox *> (widget))->currentText().trimmed();
else if(classname == "QDateEdit")
newdata[objectname] =
(qobject_cast<QDateEdit *> (widget))->date().toString
Expand Down Expand Up @@ -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<QPushButton *> ())
{
auto text(pushButton->text());
}

foreach(auto toolButton, window->findChildren<QToolButton *> ())
{
auto text(toolButton->text());
}
}
}

void biblioteq_item::print(QWidget *parent)
{
QPrinter printer;
Expand Down Expand Up @@ -192,7 +213,7 @@ void biblioteq_item::setQMain(QMainWindow *window)

foreach(auto widget, window->findChildren<QWidget *> ())
{
const QString &classname(widget->metaObject()->className());
const QString classname(widget->metaObject()->className());

if(classname == "biblioteq_hyperlinked_text_edit")
qobject_cast<biblioteq_hyperlinked_text_edit *> (widget)->
Expand Down
1 change: 1 addition & 0 deletions Source/biblioteq_item.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1ded5b6

Please sign in to comment.