.
This commit is contained in:
@@ -346,6 +346,11 @@ void cCharacter::addImage(cImage* lpImage)
|
||||
m_imageList.append(lpImage);
|
||||
}
|
||||
|
||||
QList<cImage*> cCharacter::images()
|
||||
{
|
||||
return(m_imageList);
|
||||
}
|
||||
|
||||
cCharacter* cCharacterList::add(const qint32& iID)
|
||||
{
|
||||
cCharacter* lpCharacter = find(iID);
|
||||
|
||||
+1
-1
@@ -109,7 +109,7 @@ public:
|
||||
cTextDocument* description();
|
||||
|
||||
void addImage(cImage* lpImage);
|
||||
|
||||
QList<cImage*> images();
|
||||
private:
|
||||
qint32 m_id;
|
||||
bool m_bMainCharacter;
|
||||
|
||||
+69
-1
@@ -1,14 +1,82 @@
|
||||
#include "ccharacterwindow.h"
|
||||
#include "ui_ccharacterwindow.h"
|
||||
|
||||
#include "cimagewidget.h"
|
||||
|
||||
#include <QStandardItem>
|
||||
|
||||
|
||||
cCharacterWindow::cCharacterWindow(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::cCharacterWindow)
|
||||
ui(new Ui::cCharacterWindow),
|
||||
m_lpCharacter(0)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->m_lpTab->setCurrentIndex(0);
|
||||
}
|
||||
|
||||
cCharacterWindow::~cCharacterWindow()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void cCharacterWindow::setCharacter(cCharacter* lpCharacter)
|
||||
{
|
||||
m_lpCharacter = lpCharacter;
|
||||
|
||||
ui->m_lpFirstName->setText(lpCharacter->firstName());
|
||||
ui->m_lpMiddleName->setText(lpCharacter->middleName());
|
||||
ui->m_lpLastName->setText(lpCharacter->lastName());
|
||||
ui->m_lpMainCharacter->setChecked(lpCharacter->mainCharacter());
|
||||
ui->m_lpCreature->setText(lpCharacter->creature());
|
||||
ui->m_lpTitle->setText(lpCharacter->title());
|
||||
switch(lpCharacter->gender())
|
||||
{
|
||||
case cCharacter::GENDER_female:
|
||||
ui->m_lpFemale->setChecked(true);
|
||||
break;
|
||||
case cCharacter::GENDER_male:
|
||||
ui->m_lpMale->setChecked(true);
|
||||
break;
|
||||
case cCharacter::GENDER_undefined:
|
||||
ui->m_lpOther->setChecked(true);
|
||||
break;
|
||||
}
|
||||
ui->m_lpDayOfBirth->setDate(lpCharacter->dateOfBirth());
|
||||
ui->m_lpDayOfDeath->setDate(lpCharacter->dateOfDeath());
|
||||
ui->m_lpPlaceOfBirth->setText(lpCharacter->placeOfBirth());
|
||||
ui->m_lpPlaceOfDeath->setText(lpCharacter->placeOfDeath());
|
||||
ui->m_lpHeight->setValue(lpCharacter->height());
|
||||
ui->m_lpWeight->setValue(lpCharacter->weight());
|
||||
ui->m_lpFigure->setText(lpCharacter->figure());
|
||||
ui->m_lpNature->setText(lpCharacter->nature());
|
||||
ui->m_lpSkin->setText(lpCharacter->skin());
|
||||
ui->m_lpHairColor->setText(lpCharacter->hairColor());
|
||||
ui->m_lpHairCut->setText(lpCharacter->hairCut());
|
||||
ui->m_lpHairLength->setText(lpCharacter->hairLength());
|
||||
ui->m_lpSchool->setText(lpCharacter->school());
|
||||
ui->m_lpspokenLanguages->setText(lpCharacter->spokenLanguages());
|
||||
ui->m_lpJob->setHtml(lpCharacter->job());
|
||||
ui->m_lpDescription->setDocument(lpCharacter->description());
|
||||
|
||||
QList<cImage*> images = lpCharacter->images();
|
||||
for(int x = 0;x < images.count();x++)
|
||||
{
|
||||
cImage* lpImage = images[x];
|
||||
QPixmap pixmap = lpImage->load();
|
||||
cImageWidget* lpImageWidget = new cImageWidget;
|
||||
|
||||
lpImageWidget->setValues(lpImage->name(), lpImage->type(), lpImage->description(), pixmap);
|
||||
ui->m_lpLayout->addWidget(lpImageWidget);
|
||||
}
|
||||
|
||||
QSpacerItem* lpSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
|
||||
ui->m_lpLayout->addItem(lpSpacer);
|
||||
|
||||
setWindowTitle(tr("[character] - ") + lpCharacter->name());
|
||||
}
|
||||
|
||||
cCharacter* cCharacterWindow::character()
|
||||
{
|
||||
return(m_lpCharacter);
|
||||
}
|
||||
|
||||
+10
-1
@@ -1,7 +1,12 @@
|
||||
#ifndef CCHARACTERWINDOW_H
|
||||
#define CCHARACTERWINDOW_H
|
||||
|
||||
|
||||
#include "ccharacter.h"
|
||||
|
||||
#include <QWidget>
|
||||
#include <QStandardItemModel>
|
||||
|
||||
|
||||
namespace Ui {
|
||||
class cCharacterWindow;
|
||||
@@ -15,8 +20,12 @@ public:
|
||||
explicit cCharacterWindow(QWidget *parent = 0);
|
||||
~cCharacterWindow();
|
||||
|
||||
void setCharacter(cCharacter* lpCharacter);
|
||||
cCharacter* character();
|
||||
|
||||
private:
|
||||
Ui::cCharacterWindow *ui;
|
||||
Ui::cCharacterWindow* ui;
|
||||
cCharacter* m_lpCharacter;
|
||||
};
|
||||
|
||||
#endif // CCHARACTERWINDOW_H
|
||||
|
||||
+375
-319
@@ -14,327 +14,383 @@
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="1">
|
||||
<layout class="QGridLayout" name="gridLayout" rowstretch="1,0,0,0,0,0,0,0,0,0">
|
||||
<item row="9" column="1" colspan="5">
|
||||
<widget class="QTextEdit" name="m_lpDescription"/>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="text">
|
||||
<string>Date of Death:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QDoubleSpinBox" name="m_lpHeight">
|
||||
<property name="maximum">
|
||||
<double>999999.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QLineEdit" name="m_lpCreature"/>
|
||||
</item>
|
||||
<item row="3" column="3">
|
||||
<widget class="QLineEdit" name="m_lpPlaceOfBirth"/>
|
||||
</item>
|
||||
<item row="4" column="2">
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="text">
|
||||
<string>Place of Death:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_12">
|
||||
<property name="text">
|
||||
<string>Height:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>Creature:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="text">
|
||||
<string>Place of Birth:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QDateEdit" name="m_lpDayOfDeath"/>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QDateEdit" name="m_lpDayOfBirth"/>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>Date of Birth:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="3">
|
||||
<widget class="QLineEdit" name="m_lpPlaceOfDeath"/>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QCheckBox" name="m_lpMainCharacter">
|
||||
<property name="text">
|
||||
<string>Main Character</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_13">
|
||||
<property name="text">
|
||||
<string>Weight:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QDoubleSpinBox" name="m_lpWeight">
|
||||
<property name="maximum">
|
||||
<double>999999.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Middle Name:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>Title:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>First Name:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="m_lpFirstName"/>
|
||||
</item>
|
||||
<item row="9" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Description:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QLineEdit" name="m_lpMiddleName"/>
|
||||
</item>
|
||||
<item row="0" column="4">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Last Name:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="5">
|
||||
<widget class="QLineEdit" name="m_lpLastName"/>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="m_lpTitle"/>
|
||||
</item>
|
||||
<item row="5" column="4">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Hair Color:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="4">
|
||||
<widget class="QLabel" name="label_14">
|
||||
<property name="text">
|
||||
<string>Hair Cut:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="4">
|
||||
<widget class="QLabel" name="label_15">
|
||||
<property name="text">
|
||||
<string>Hair Length:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="5">
|
||||
<widget class="QLineEdit" name="m_lpHairColor"/>
|
||||
</item>
|
||||
<item row="6" column="5">
|
||||
<widget class="QLineEdit" name="m_lpHairCut"/>
|
||||
</item>
|
||||
<item row="7" column="5">
|
||||
<widget class="QLineEdit" name="m_lpHairLength"/>
|
||||
</item>
|
||||
<item row="5" column="2">
|
||||
<widget class="QLabel" name="label_16">
|
||||
<property name="text">
|
||||
<string>Figure:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="3">
|
||||
<widget class="QLineEdit" name="m_lpFigure"/>
|
||||
</item>
|
||||
<item row="8" column="4">
|
||||
<widget class="QLabel" name="label_21">
|
||||
<property name="text">
|
||||
<string>Job:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="2">
|
||||
<widget class="QLabel" name="label_19">
|
||||
<property name="text">
|
||||
<string>Skin:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="3">
|
||||
<widget class="QLineEdit" name="m_lpSkin"/>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<widget class="QLabel" name="label_20">
|
||||
<property name="text">
|
||||
<string>School:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="2">
|
||||
<widget class="QLabel" name="label_18">
|
||||
<property name="text">
|
||||
<string>Spoken Languages:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="2">
|
||||
<widget class="QLabel" name="label_17">
|
||||
<property name="text">
|
||||
<string>Nature:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="3">
|
||||
<widget class="QLineEdit" name="m_lpNature"/>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<widget class="QTextEdit" name="m_lpSchool"/>
|
||||
</item>
|
||||
<item row="8" column="3">
|
||||
<widget class="QTextEdit" name="m_lpspokenLanguages"/>
|
||||
</item>
|
||||
<item row="8" column="5">
|
||||
<widget class="QTextEdit" name="m_lpJob"/>
|
||||
</item>
|
||||
<item row="1" column="5" rowspan="4">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Gender</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="0">
|
||||
<widget class="QRadioButton" name="m_lpMale">
|
||||
<property name="text">
|
||||
<string>Male</string>
|
||||
<item row="0" column="0">
|
||||
<widget class="QTabWidget" name="m_lpTab">
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="m_lpBasic">
|
||||
<attribute name="title">
|
||||
<string>Basic</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout" rowstretch="1,0,0,0,0,0,0,0,0,0">
|
||||
<item row="9" column="1" colspan="5">
|
||||
<widget class="QTextEdit" name="m_lpDescription"/>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="text">
|
||||
<string>Date of Death:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QDoubleSpinBox" name="m_lpHeight">
|
||||
<property name="maximum">
|
||||
<double>999999.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QLineEdit" name="m_lpCreature"/>
|
||||
</item>
|
||||
<item row="3" column="3">
|
||||
<widget class="QLineEdit" name="m_lpPlaceOfBirth"/>
|
||||
</item>
|
||||
<item row="4" column="2">
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="text">
|
||||
<string>Place of Death:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_12">
|
||||
<property name="text">
|
||||
<string>Height:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>Creature:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="text">
|
||||
<string>Place of Birth:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QDateEdit" name="m_lpDayOfDeath"/>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QDateEdit" name="m_lpDayOfBirth"/>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>Date of Birth:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="3">
|
||||
<widget class="QLineEdit" name="m_lpPlaceOfDeath"/>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QCheckBox" name="m_lpMainCharacter">
|
||||
<property name="text">
|
||||
<string>Main Character</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_13">
|
||||
<property name="text">
|
||||
<string>Weight:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QDoubleSpinBox" name="m_lpWeight">
|
||||
<property name="maximum">
|
||||
<double>999999.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Middle Name:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>Title:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>First Name:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="m_lpFirstName"/>
|
||||
</item>
|
||||
<item row="9" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Description:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QLineEdit" name="m_lpMiddleName"/>
|
||||
</item>
|
||||
<item row="0" column="4">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Last Name:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="5">
|
||||
<widget class="QLineEdit" name="m_lpLastName"/>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="m_lpTitle"/>
|
||||
</item>
|
||||
<item row="5" column="4">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Hair Color:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="4">
|
||||
<widget class="QLabel" name="label_14">
|
||||
<property name="text">
|
||||
<string>Hair Cut:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="4">
|
||||
<widget class="QLabel" name="label_15">
|
||||
<property name="text">
|
||||
<string>Hair Length:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="5">
|
||||
<widget class="QLineEdit" name="m_lpHairColor"/>
|
||||
</item>
|
||||
<item row="6" column="5">
|
||||
<widget class="QLineEdit" name="m_lpHairCut"/>
|
||||
</item>
|
||||
<item row="7" column="5">
|
||||
<widget class="QLineEdit" name="m_lpHairLength"/>
|
||||
</item>
|
||||
<item row="5" column="2">
|
||||
<widget class="QLabel" name="label_16">
|
||||
<property name="text">
|
||||
<string>Figure:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="3">
|
||||
<widget class="QLineEdit" name="m_lpFigure"/>
|
||||
</item>
|
||||
<item row="8" column="4">
|
||||
<widget class="QLabel" name="label_21">
|
||||
<property name="text">
|
||||
<string>Job:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="2">
|
||||
<widget class="QLabel" name="label_19">
|
||||
<property name="text">
|
||||
<string>Skin:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="3">
|
||||
<widget class="QLineEdit" name="m_lpSkin"/>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<widget class="QLabel" name="label_20">
|
||||
<property name="text">
|
||||
<string>School:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="2">
|
||||
<widget class="QLabel" name="label_18">
|
||||
<property name="text">
|
||||
<string>Spoken Languages:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="2">
|
||||
<widget class="QLabel" name="label_17">
|
||||
<property name="text">
|
||||
<string>Nature:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="3">
|
||||
<widget class="QLineEdit" name="m_lpNature"/>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<widget class="QTextEdit" name="m_lpSchool"/>
|
||||
</item>
|
||||
<item row="8" column="3">
|
||||
<widget class="QTextEdit" name="m_lpspokenLanguages"/>
|
||||
</item>
|
||||
<item row="8" column="5">
|
||||
<widget class="QTextEdit" name="m_lpJob"/>
|
||||
</item>
|
||||
<item row="1" column="5" rowspan="4">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Gender</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="0">
|
||||
<widget class="QRadioButton" name="m_lpMale">
|
||||
<property name="text">
|
||||
<string>Male</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QRadioButton" name="m_lpFemale">
|
||||
<property name="text">
|
||||
<string>Female</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QRadioButton" name="m_lpOther">
|
||||
<property name="text">
|
||||
<string>Other</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="m_lpImages">
|
||||
<attribute name="title">
|
||||
<string>Images</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_5">
|
||||
<item row="0" column="0">
|
||||
<widget class="QScrollArea" name="m_lpScrollArea">
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="scrollAreaWidgetContents">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>681</width>
|
||||
<height>464</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_6">
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="m_lpLayout"/>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QRadioButton" name="m_lpFemale">
|
||||
<property name="text">
|
||||
<string>Female</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QRadioButton" name="m_lpOther">
|
||||
<property name="text">
|
||||
<string>Other</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
||||
@@ -84,7 +84,6 @@ QPixmap cImage::load()
|
||||
}
|
||||
}
|
||||
|
||||
myDebug << "image load error.";
|
||||
return(image);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
#include "cimagewidget.h"
|
||||
#include "ui_cimagewidget.h"
|
||||
|
||||
|
||||
cImageWidget::cImageWidget(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::cImageWidget)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
cImageWidget::~cImageWidget()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void cImageWidget::setValues(const QString &szName, const QString &szType, cTextDocument* lpDocument, const QPixmap &pixmap)
|
||||
{
|
||||
ui->m_lpName->setTitle(szName);
|
||||
ui->m_lpType->setText(szType);
|
||||
ui->m_lpDescription->setDocument(lpDocument);
|
||||
if(pixmap.width() > 200)
|
||||
ui->m_lpImage->setPixmap(pixmap.scaled(200, 9999, Qt::KeepAspectRatio));
|
||||
else
|
||||
ui->m_lpImage->setPixmap(pixmap);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
#ifndef CIMAGEWIDGET_H
|
||||
#define CIMAGEWIDGET_H
|
||||
|
||||
|
||||
#include "ctextdocument.h"
|
||||
#include <QWidget>
|
||||
#include <QPixmap>
|
||||
|
||||
|
||||
namespace Ui {
|
||||
class cImageWidget;
|
||||
}
|
||||
|
||||
class cImageWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit cImageWidget(QWidget *parent = 0);
|
||||
~cImageWidget();
|
||||
|
||||
void setValues(const QString& szName, const QString& szType, cTextDocument* lpDocument, const QPixmap& pixmap);
|
||||
private:
|
||||
Ui::cImageWidget* ui;
|
||||
};
|
||||
|
||||
#endif // CIMAGEWIDGET_H
|
||||
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>cImageWidget</class>
|
||||
<widget class="QWidget" name="cImageWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>380</width>
|
||||
<height>325</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="0">
|
||||
<widget class="QGroupBox" name="m_lpName">
|
||||
<property name="title">
|
||||
<string>GroupBox</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="1">
|
||||
<widget class="QTextEdit" name="m_lpDescription"/>
|
||||
</item>
|
||||
<item row="0" column="0" rowspan="2">
|
||||
<widget class="QLabel" name="m_lpImage">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Box</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Sunken</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="m_lpType">
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "cpartwindow.h"
|
||||
#include "cchapterwindow.h"
|
||||
#include "cscenewindow.h"
|
||||
#include "ccharacterwindow.h"
|
||||
|
||||
#include "cwidget.h"
|
||||
|
||||
@@ -125,6 +126,7 @@ void cMainWindow::createActions()
|
||||
connect(ui->m_lpMdiArea, SIGNAL(subWindowActivated(QMdiSubWindow*)), this, SLOT(onMdiAreaSubWindowActivated(QMdiSubWindow*)));
|
||||
|
||||
connect(ui->m_lpOutlineList, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(onOutlineDoubleClicked(QModelIndex)));
|
||||
connect(ui->m_lpCharacterList, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(onCharacterDoubleClicked(QModelIndex)));
|
||||
}
|
||||
|
||||
void cMainWindow::createFileActions()
|
||||
@@ -426,6 +428,14 @@ void cMainWindow::onOutlineDoubleClicked(const QModelIndex& index)
|
||||
QMessageBox::information(this, "DoubleClicked", "outline");
|
||||
}
|
||||
|
||||
void cMainWindow::onCharacterDoubleClicked(const QModelIndex& index)
|
||||
{
|
||||
QStandardItem* lpItem = m_lpCharacterModel->itemFromIndex(index);
|
||||
cCharacter* lpCharacter = qvariant_cast<cCharacter*>(lpItem->data());
|
||||
|
||||
showCharacterWindow(lpCharacter);
|
||||
}
|
||||
|
||||
void cMainWindow::showPartWindow(cPart* lpPart)
|
||||
{
|
||||
for(int x = 0;x < ui->m_lpMainTab->count();x++)
|
||||
@@ -507,6 +517,33 @@ void cMainWindow::showSceneWindow(cScene* lpScene)
|
||||
lpSceneWindow->show();
|
||||
}
|
||||
|
||||
void cMainWindow::showCharacterWindow(cCharacter* lpCharacter)
|
||||
{
|
||||
for(int x = 0;x < ui->m_lpMainTab->count();x++)
|
||||
{
|
||||
cWidget* lpWidget = (cWidget*)ui->m_lpMainTab->widget(x);
|
||||
if(lpWidget->type() == cWidget::TYPE_character)
|
||||
{
|
||||
cCharacterWindow* lpCharacterWindow = (cCharacterWindow*)lpWidget->widget();
|
||||
if(lpCharacterWindow->character() == lpCharacter)
|
||||
{
|
||||
ui->m_lpMainTab->setCurrentIndex(x);
|
||||
ui->m_lpMdiArea->setActiveSubWindow(lpWidget->window());
|
||||
m_bUpdatingTab = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cCharacterWindow* lpCharacterWindow = new cCharacterWindow(this);
|
||||
lpCharacterWindow->setCharacter(lpCharacter);
|
||||
cWidget* lpWidget1 = new cWidget(lpCharacterWindow);
|
||||
lpWidget1->setWindow(ui->m_lpMdiArea->addSubWindow(lpCharacterWindow));
|
||||
ui->m_lpMainTab->addTab((QWidget*)lpWidget1, lpCharacterWindow->windowTitle());
|
||||
|
||||
lpCharacterWindow->show();
|
||||
}
|
||||
|
||||
void cMainWindow::onFileNew()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ private slots:
|
||||
void onMdiAreaSubWindowActivated(QMdiSubWindow *arg1);
|
||||
|
||||
void onOutlineDoubleClicked(const QModelIndex& index);
|
||||
void onCharacterDoubleClicked(const QModelIndex& index);
|
||||
|
||||
void onFileNew();
|
||||
void onFileOpen();
|
||||
@@ -104,6 +105,8 @@ private:
|
||||
void showPartWindow(cPart* lpPart);
|
||||
void showChapterWindow(cChapter* lpChapter);
|
||||
void showSceneWindow(cScene* lpScene);
|
||||
void showCharacterWindow(cCharacter* lpCharacter);
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent *event);
|
||||
};
|
||||
|
||||
@@ -25,6 +25,14 @@ cWidget::cWidget(cSceneWindow* parent) :
|
||||
{
|
||||
}
|
||||
|
||||
cWidget::cWidget(cCharacterWindow* parent) :
|
||||
QWidget(parent),
|
||||
m_type(TYPE_character),
|
||||
m_lpWidget(parent),
|
||||
m_lpWindow(0)
|
||||
{
|
||||
}
|
||||
|
||||
cWidget::cWidget(QWidget* parent) :
|
||||
QWidget(parent),
|
||||
m_type(TYPE_unknown),
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "cpartwindow.h"
|
||||
#include "cchapterwindow.h"
|
||||
#include "cscenewindow.h"
|
||||
#include "ccharacterwindow.h"
|
||||
|
||||
#include <QWidget>
|
||||
#include <QMdiSubWindow>
|
||||
@@ -20,11 +21,13 @@ public:
|
||||
TYPE_part = 1,
|
||||
TYPE_chapter = 2,
|
||||
TYPE_scene = 3,
|
||||
TYPE_character = 4,
|
||||
};
|
||||
|
||||
explicit cWidget(cPartWindow* parent);
|
||||
explicit cWidget(cChapterWindow* parent);
|
||||
explicit cWidget(cSceneWindow* parent);
|
||||
explicit cWidget(cCharacterWindow* parent);
|
||||
explicit cWidget(QWidget* parent);
|
||||
|
||||
QWidget* widget();
|
||||
|
||||
+6
-3
@@ -60,7 +60,8 @@ SOURCES += \
|
||||
cimage.cpp \
|
||||
cchapterwindow.cpp \
|
||||
cscenewindow.cpp \
|
||||
ccharacterwindow.cpp
|
||||
ccharacterwindow.cpp \
|
||||
cimagewidget.cpp
|
||||
|
||||
HEADERS += \
|
||||
cmainwindow.h \
|
||||
@@ -82,14 +83,16 @@ HEADERS += \
|
||||
cimage.h \
|
||||
cchapterwindow.h \
|
||||
cscenewindow.h \
|
||||
ccharacterwindow.h
|
||||
ccharacterwindow.h \
|
||||
cimagewidget.h
|
||||
|
||||
FORMS += \
|
||||
cmainwindow.ui \
|
||||
cpartwindow.ui \
|
||||
cchapterwindow.ui \
|
||||
cscenewindow.ui \
|
||||
ccharacterwindow.ui
|
||||
ccharacterwindow.ui \
|
||||
cimagewidget.ui
|
||||
|
||||
DISTFILES += \
|
||||
storyBook.project
|
||||
|
||||
Reference in New Issue
Block a user