bugfix and nicer decklist font
This commit is contained in:
parent
2e50822d48
commit
3043157a1d
3 changed files with 12 additions and 3 deletions
|
@ -353,10 +353,10 @@ void DeckListModel::printDeckList(QPrinter *printer)
|
||||||
{
|
{
|
||||||
QTextDocument doc;
|
QTextDocument doc;
|
||||||
|
|
||||||
/* QFont font("Times");
|
QFont font("Serif");
|
||||||
font.setStyleHint(QFont::Serif);
|
font.setStyleHint(QFont::Serif);
|
||||||
doc.setDefaultFont(font);
|
doc.setDefaultFont(font);
|
||||||
*/
|
|
||||||
QTextCursor cursor(&doc);
|
QTextCursor cursor(&doc);
|
||||||
|
|
||||||
QTextBlockFormat headerBlockFormat;
|
QTextBlockFormat headerBlockFormat;
|
||||||
|
|
|
@ -56,7 +56,7 @@ WndDeckEditor::WndDeckEditor(CardDatabase *_db, QWidget *parent)
|
||||||
QLabel *nameLabel = new QLabel(tr("Deck &name:"));
|
QLabel *nameLabel = new QLabel(tr("Deck &name:"));
|
||||||
nameEdit = new QLineEdit;
|
nameEdit = new QLineEdit;
|
||||||
nameLabel->setBuddy(nameEdit);
|
nameLabel->setBuddy(nameEdit);
|
||||||
connect(nameEdit, SIGNAL(textChanged(const QString &)), deckModel->getDeckList(), SLOT(setName(const QString &)));
|
connect(nameEdit, SIGNAL(textChanged(const QString &)), this, SLOT(updateName(const QString &)));
|
||||||
QLabel *commentsLabel = new QLabel(tr("&Comments:"));
|
QLabel *commentsLabel = new QLabel(tr("&Comments:"));
|
||||||
commentsEdit = new QTextEdit;
|
commentsEdit = new QTextEdit;
|
||||||
commentsEdit->setMaximumHeight(70);
|
commentsEdit->setMaximumHeight(70);
|
||||||
|
@ -146,9 +146,16 @@ WndDeckEditor::~WndDeckEditor()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WndDeckEditor::updateName(const QString &name)
|
||||||
|
{
|
||||||
|
deckModel->getDeckList()->setName(name);
|
||||||
|
setWindowModified(true);
|
||||||
|
}
|
||||||
|
|
||||||
void WndDeckEditor::updateComments()
|
void WndDeckEditor::updateComments()
|
||||||
{
|
{
|
||||||
deckModel->getDeckList()->setComments(commentsEdit->toPlainText());
|
deckModel->getDeckList()->setComments(commentsEdit->toPlainText());
|
||||||
|
setWindowModified(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WndDeckEditor::updateCardInfoLeft(const QModelIndex ¤t, const QModelIndex &/*previous*/)
|
void WndDeckEditor::updateCardInfoLeft(const QModelIndex ¤t, const QModelIndex &/*previous*/)
|
||||||
|
@ -219,6 +226,7 @@ void WndDeckEditor::actLoadDeck()
|
||||||
deckModel->sort(1);
|
deckModel->sort(1);
|
||||||
deckView->expandAll();
|
deckView->expandAll();
|
||||||
deckView->resizeColumnToContents(0);
|
deckView->resizeColumnToContents(0);
|
||||||
|
setWindowModified(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,7 @@ class QTextEdit;
|
||||||
class WndDeckEditor : public QMainWindow {
|
class WndDeckEditor : public QMainWindow {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
private slots:
|
private slots:
|
||||||
|
void updateName(const QString &name);
|
||||||
void updateComments();
|
void updateComments();
|
||||||
void updateCardInfoLeft(const QModelIndex ¤t, const QModelIndex &previous);
|
void updateCardInfoLeft(const QModelIndex ¤t, const QModelIndex &previous);
|
||||||
void updateCardInfoRight(const QModelIndex ¤t, const QModelIndex &previous);
|
void updateCardInfoRight(const QModelIndex ¤t, const QModelIndex &previous);
|
||||||
|
|
Loading…
Reference in a new issue