Ignore:
Timestamp:
01/27/10 13:06:32 (12 years ago)
Author:
pavelpa <pavelpa@…>
Branches:
master, qt5
Children:
6123b48
Parents:
ce59092
Message:

refactored Event 'details' dialog

  • TODO: implement 'links' method(s) in Event and use it in the dialog
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gui/eventdialog.cpp

    rce59092 r1bcd66f  
    77#include <alarm.h>
    88#endif
    9 
    10 DetailsContainer::DetailsContainer(QWidget *aParent)
    11     : QWidget(aParent)
    12 {
    13     mAbstract.setWordWrap(true);
    14     mDescription.setWordWrap(true);
    15 
    16     QFont f = QLabel().font();
    17     f.setBold(true);
    18     f.setItalic(true);
    19     mMainLayout = new QVBoxLayout(this);
    20     QLabel *persons = new QLabel("Persons:");
    21     persons->setFont(f);
    22     mMainLayout->addWidget(persons);
    23     mMainLayout->addWidget(&mPersons);
    24     mMainLayout->addWidget(new QLabel("")); // spacer
    25     QLabel *abstract = new QLabel("Abstract:");
    26     abstract->setFont(f);
    27     mMainLayout->addWidget(abstract);
    28     mMainLayout->addWidget(&mAbstract);
    29     mMainLayout->addWidget(new QLabel("")); // spacer
    30     QLabel *description = new QLabel("Description:");
    31     description->setFont(f);
    32     mMainLayout->addWidget(description);
    33     mMainLayout->addWidget(&mDescription);
    34     setLayout(mMainLayout);
    35 }
    36 
    37 void DetailsContainer::setPersons(const QStringList &aPersons)
    38 {
    39     mPersons.setText(aPersons.join(" and "));
    40 }
    41 
    42 void DetailsContainer::setAbstract(const QString &aAbstract)
    43 {
    44     mAbstract.setText(aAbstract);
    45 }
    46 
    47 void DetailsContainer::setDescription(const QString &aDescription)
    48 {
    49     mDescription.setText(aDescription);
    50 }
    519
    5210EventDialog::EventDialog(const int &aEventId, QWidget *aParent)
     
    6321
    6422    title->setText(event.title());
    65     mDetails.setPersons(event.persons());
    66     mDetails.setAbstract(event.abstract());
    67     mDetails.setDescription(event.description());
    68     scrollArea->setWidget(&mDetails);
     23    persons->setText(event.persons().join(" and "));
     24    abstract->setText(event.abstract());
     25    description->setText(event.description());
    6926
    7027    connect(favouriteButton, SIGNAL(clicked()), SLOT(favouriteClicked()));
Note: See TracChangeset for help on using the changeset viewer.