show property changes in main list

This commit is contained in:
Herwig Birke
2018-05-29 09:02:11 +02:00
parent 5bbba38786
commit 9cc893e511
15 changed files with 240 additions and 5 deletions
+9
View File
@@ -345,6 +345,15 @@ cTextDocument* cCharacter::description()
return(m_lpDescription);
}
void cCharacter::setItem(QList<QStandardItem*> itemList)
{
m_itemList = itemList;
}
QList<QStandardItem*> cCharacter::item()
{
return(m_itemList);
}
void cCharacter::setDeleted(bool bDeleted)
{
+18
View File
@@ -17,6 +17,8 @@
#include <QColor>
#include <QObject>
#include <QStandardItem>
/*!
\brief
@@ -476,6 +478,21 @@ public:
*/
QList<cImageDescription*> images();
/*!
\brief
\fn setItem
\param itemList
*/
void setItem(QList<QStandardItem*> itemList);
/*!
\brief
\fn item
\return QList<QStandardItem*>
*/
QList<QStandardItem*> item();
/*!
\brief
@@ -518,6 +535,7 @@ private:
QString m_szJob; /*!< TODO: describe */
cTextDocument* m_lpDescription; /*!< TODO: describe */
QList<cImageDescription*> m_imageList; /*!< TODO: describe */
QList<QStandardItem*> m_itemList; /*!< TODO: describe */
bool m_bDeleted; /*!< TODO: describe */
signals:
+59
View File
@@ -201,21 +201,38 @@ cCharacter* cCharacterWindow::character()
void cCharacterWindow::onFirstNameChanged(const QString& szText)
{
m_lpCharacter->setFirstName(szText);
nameChanged();
m_lpMainWindow->somethingChanged();
}
void cCharacterWindow::onMiddleNameChanged(const QString& szText)
{
m_lpCharacter->setMiddleName(szText);
nameChanged();
m_lpMainWindow->somethingChanged();
}
void cCharacterWindow::onLastNameChanged(const QString& szText)
{
m_lpCharacter->setLastName(szText);
nameChanged();
m_lpMainWindow->somethingChanged();
}
void cCharacterWindow::nameChanged()
{
QList<QStandardItem*> items = m_lpCharacter->item();
if(items.count())
items[0]->setText(m_lpCharacter->name());
}
void cCharacterWindow::onNickNameChanged(const QString& szText)
{
m_lpCharacter->setNickName(szText);
@@ -225,12 +242,40 @@ void cCharacterWindow::onNickNameChanged(const QString& szText)
void cCharacterWindow::onMainCharacterClicked(bool bChecked)
{
m_lpCharacter->setMainCharacter(bChecked);
QList<QStandardItem*> items = m_lpCharacter->item();
if(items.count())
{
QFont font = items[0]->font();
if(bChecked)
{
font.setBold(true);
font.setItalic(false);
}
else
{
font.setBold(false);
font.setItalic(true);
}
for(int x = 0;x < items.count();x++)
items[x]->setFont(font);
}
m_lpMainWindow->somethingChanged();
}
void cCharacterWindow::onCreatureChanged(const QString& szText)
{
m_lpCharacter->setCreature(szText);
QList<QStandardItem*> items = m_lpCharacter->item();
if(items.count() >= 2)
items[1]->setText(szText);
m_lpMainWindow->somethingChanged();
}
@@ -243,6 +288,8 @@ void cCharacterWindow::onGenderMaleClicked(bool /*bChecked*/)
else
m_lpCharacter->setGender(cCharacter::GENDER_undefined);
genderChanged();
m_lpMainWindow->somethingChanged();
}
@@ -255,6 +302,8 @@ void cCharacterWindow::onGenderFemaleClicked(bool /*bChecked*/)
else
m_lpCharacter->setGender(cCharacter::GENDER_undefined);
genderChanged();
m_lpMainWindow->somethingChanged();
}
@@ -267,9 +316,19 @@ void cCharacterWindow::onGenderOtherClicked(bool /*bChecked*/)
else
m_lpCharacter->setGender(cCharacter::GENDER_undefined);
genderChanged();
m_lpMainWindow->somethingChanged();
}
void cCharacterWindow::genderChanged()
{
QList<QStandardItem*> items = m_lpCharacter->item();
if(items.count() >= 3)
items[2]->setText(m_lpCharacter->genderText());
}
void cCharacterWindow::onTitleChanged(const QString& szText)
{
m_lpCharacter->setTitle(szText);
+14
View File
@@ -238,6 +238,20 @@ private:
Ui::cCharacterWindow* ui; /*!< TODO: describe */
cMainWindow* m_lpMainWindow; /*!< TODO: describe */
cCharacter* m_lpCharacter; /*!< TODO: describe */
/*!
\brief
\fn nameChanged
*/
void nameChanged();
/*!
\brief
\fn genderChanged
*/
void genderChanged();
};
#endif // CCHARACTERWINDOW_H
+10
View File
@@ -61,6 +61,16 @@ cTextDocument* cObject::description()
return(m_lpDescription);
}
void cObject::setItem(QList<QStandardItem*> itemList)
{
m_itemList = itemList;
}
QList<QStandardItem*> cObject::item()
{
return(m_itemList);
}
void cObject::setDeleted(bool bDeleted)
{
m_bDeleted = bDeleted;
+20 -2
View File
@@ -15,6 +15,8 @@
#include <QString>
#include <QObject>
#include <QStandardItem>
/*!
\brief
@@ -110,20 +112,35 @@ public:
*/
QList<cImageDescription*> images();
/*!
\brief
\fn setItem
\param itemList
*/
void setItem(QList<QStandardItem*> itemList);
/*!
\brief
\fn item
\return QList<QStandardItem*>
*/
QList<QStandardItem*> item();
/*!
\brief
\fn setDeleted
\param bDeleted
*/
void setDeleted(bool bDeleted);
void setDeleted(bool bDeleted);
/*!
\brief
\fn deleted
\return bool
*/
bool deleted();
bool deleted();
private:
qint32 m_iID; /*!< TODO: describe */
@@ -131,6 +148,7 @@ private:
QString m_szType; /*!< TODO: describe */
cTextDocument* m_lpDescription; /*!< TODO: describe */
QList<cImageDescription*> m_imageList; /*!< TODO: describe */
QList<QStandardItem*> m_itemList; /*!< TODO: describe */
bool m_bDeleted; /*!< TODO: describe */
signals:
+12
View File
@@ -76,12 +76,24 @@ cObject* cObjectWindow::object()
void cObjectWindow::onNameChanged(const QString& szName)
{
m_lpObject->setName(szName);
QList<QStandardItem*> items = m_lpObject->item();
if(items.count())
items[0]->setText(szName);
m_lpMainWindow->somethingChanged();
}
void cObjectWindow::onTypeChanged(const QString& szName)
{
m_lpObject->setType(szName);
QList<QStandardItem*> items = m_lpObject->item();
if(items.count() >= 2)
items[1]->setText(szName);
m_lpMainWindow->somethingChanged();
}
+10
View File
@@ -72,6 +72,16 @@ cTextDocument* cPlace::description()
return(m_lpDescription);
}
void cPlace::setItem(QList<QStandardItem*> itemList)
{
m_itemList = itemList;
}
QList<QStandardItem*> cPlace::item()
{
return(m_itemList);
}
void cPlace::setDeleted(bool bDeleted)
{
m_bDeleted = bDeleted;
+20 -2
View File
@@ -15,6 +15,8 @@
#include <QString>
#include <QObject>
#include <QStandardItem>
/*!
\brief
@@ -125,20 +127,35 @@ public:
*/
QList<cImageDescription*> images();
/*!
\brief
\fn setItem
\param itemList
*/
void setItem(QList<QStandardItem*> itemList);
/*!
\brief
\fn item
\return QList<QStandardItem*>
*/
QList<QStandardItem*> item();
/*!
\brief
\fn setDeleted
\param bDeleted
*/
void setDeleted(bool bDeleted);
void setDeleted(bool bDeleted);
/*!
\brief
\fn deleted
\return bool
*/
bool deleted();
bool deleted();
private:
qint32 m_iID; /*!< TODO: describe */
@@ -147,6 +164,7 @@ private:
QString m_szType; /*!< TODO: describe */
cTextDocument* m_lpDescription; /*!< TODO: describe */
QList<cImageDescription*> m_imageList; /*!< TODO: describe */
QList<QStandardItem*> m_itemList; /*!< TODO: describe */
bool m_bDeleted; /*!< TODO: describe */
signals:
+18
View File
@@ -81,18 +81,36 @@ cPlace* cPlaceWindow::place()
void cPlaceWindow::onNameChanged(const QString& szName)
{
m_lpPlace->setName(szName);
QList<QStandardItem*> items = m_lpPlace->item();
if(items.count())
items[0]->setText(szName);
m_lpMainWindow->somethingChanged();
}
void cPlaceWindow::onTypeChanged(const QString& szName)
{
m_lpPlace->setType(szName);
QList<QStandardItem*> items = m_lpPlace->item();
if(items.count() >= 2)
items[1]->setText(szName);
m_lpMainWindow->somethingChanged();
}
void cPlaceWindow::onLocationChanged(const QString& szName)
{
m_lpPlace->setLocation(szName);
QList<QStandardItem*> items = m_lpPlace->item();
if(items.count() >= 3)
items[2]->setText(szName);
m_lpMainWindow->somethingChanged();
}
+10
View File
@@ -61,6 +61,16 @@ cTextDocument* cRecherche::description()
return(m_lpDescription);
}
void cRecherche::setItem(QList<QStandardItem*> itemList)
{
m_itemList = itemList;
}
QList<QStandardItem*> cRecherche::item()
{
return(m_itemList);
}
void cRecherche::setDeleted(bool bDeleted)
{
m_bDeleted = bDeleted;
+18
View File
@@ -18,6 +18,8 @@
#include <QString>
#include <QObject>
#include <QStandardItem>
/*!
\brief
@@ -159,6 +161,21 @@ public:
*/
QList<cPlaceDescription*> placeList();
/*!
\brief
\fn setItem
\param itemList
*/
void setItem(QList<QStandardItem*> itemList);
/*!
\brief
\fn item
\return QList<QStandardItem*>
*/
QList<QStandardItem*> item();
/*!
\brief
@@ -183,6 +200,7 @@ private:
QList<cCharacterDescription*> m_characterList; /*!< TODO: describe */
QList<cObjectDescription*> m_objectList; /*!< TODO: describe */
QList<cPlaceDescription*> m_placeList; /*!< TODO: describe */
QList<QStandardItem*> m_itemList; /*!< TODO: describe */
bool m_bDeleted; /*!< TODO: describe */
signals:
+12
View File
@@ -218,12 +218,24 @@ void cRechercheWindow::onObjectDoubleClicked(const QModelIndex& index)
void cRechercheWindow::onNameChanged(const QString& szName)
{
m_lpRecherche->setName(szName);
QList<QStandardItem*> items = m_lpRecherche->item();
if(items.count())
items[0]->setText(szName);
m_lpMainWindow->somethingChanged();
}
void cRechercheWindow::onLinkChanged(const QString& szName)
{
m_lpRecherche->setLink(szName);
QList<QStandardItem*> items = m_lpRecherche->item();
if(items.count() >= 2)
items[1]->setText(szName);
m_lpMainWindow->somethingChanged();
}
+4
View File
@@ -855,6 +855,7 @@ bool cStoryBook::fillCharacterList(QTreeView* lpView)
}
lpModel->appendRow(lpItems);
lpCharacter->setItem(lpItems);
}
lpView->header()->setStretchLastSection(true);
@@ -896,6 +897,7 @@ bool cStoryBook::fillPlaceList(QTreeView* lpView)
}
lpModel->appendRow(lpItems);
lpPlace->setItem(lpItems);
}
lpView->header()->setStretchLastSection(true);
@@ -936,6 +938,7 @@ bool cStoryBook::fillObjectList(QTreeView* lpView)
}
lpModel->appendRow(lpItems);
lpObject->setItem(lpItems);
}
lpView->header()->setStretchLastSection(true);
@@ -976,6 +979,7 @@ bool cStoryBook::fillRechercheList(QTreeView* lpView)
}
lpModel->appendRow(lpItems);
lpRecherche->setItem(lpItems);
}
lpView->header()->setStretchLastSection(true);
+6 -1
View File
@@ -12,12 +12,17 @@
#include "csplashscreen.h"
//#define SHOW_SPLASH
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
#ifdef SHOW_SPLASH
QPixmap pixmap(":/images/splash.png");
// QPixmap pixmap(":/images/splashEmpty.png");
#else
QPixmap pixmap(":/images/splashEmpty.png");
#endif
cSplashScreen* lpSplash = new cSplashScreen(pixmap);
// int id = QFontDatabase::addApplicationFont(":/fonts/Stingray.otf");
// int id = QFontDatabase::addApplicationFont(":/fonts/Luna.ttf");