Changeset 183eecd for src/gui/eventdialog.cpp
- Timestamp:
- 01/25/10 12:07:00 (13 years ago)
- Branches:
- master, qt5
- Children:
- 7b70507
- Parents:
- 6dc0dbc
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/gui/eventdialog.cpp
r6dc0dbc r183eecd 3 3 4 4 #include <QScrollBar> 5 6 DetailsContainer::DetailsContainer(QWidget *aParent) 7 : QWidget(aParent) 8 { 9 mAbstract.setWordWrap(true); 10 mDescription.setWordWrap(true); 11 12 QFont f = QLabel().font(); 13 f.setBold(true); 14 f.setItalic(true); 15 mMainLayout = new QVBoxLayout(this); 16 QLabel *persons = new QLabel("Persons:"); 17 persons->setFont(f); 18 mMainLayout->addWidget(persons); 19 mMainLayout->addWidget(&mPersons); 20 mMainLayout->addWidget(new QLabel("")); // spacer 21 QLabel *abstract = new QLabel("Abstract:"); 22 abstract->setFont(f); 23 mMainLayout->addWidget(abstract); 24 mMainLayout->addWidget(&mAbstract); 25 mMainLayout->addWidget(new QLabel("")); // spacer 26 QLabel *description = new QLabel("Description:"); 27 description->setFont(f); 28 mMainLayout->addWidget(description); 29 mMainLayout->addWidget(&mDescription); 30 setLayout(mMainLayout); 31 } 32 33 void DetailsContainer::setPersons(const QStringList &aPersons) 34 { 35 mPersons.setText(aPersons.join(" and ")); 36 } 37 38 void DetailsContainer::setAbstract(const QString &aAbstract) 39 { 40 mAbstract.setText(aAbstract); 41 } 42 43 void DetailsContainer::setDescription(const QString &aDescription) 44 { 45 mDescription.setText(aDescription); 46 } 5 47 6 48 EventDialog::EventDialog(const int &aEventId, QWidget *aParent) … … 16 58 Event event = Event::getById(aEventId,AppSettings::confId()); 17 59 18 //abstract->setStyleSheet("background-color : transparent;");19 //description->setStyleSheet("background-color : transparent;");20 21 // use text color from 'title' QLabel22 QColor color = title->palette().color(QPalette::Active, QPalette::WindowText);23 QColor bkgrColor = this->palette().color(QPalette::Active, QPalette::Background);24 QPalette p = abstract->palette();25 p.setColor(QPalette::Active, QPalette::Text, color);26 p.setColor(QPalette::Active, QPalette::Base, bkgrColor);27 abstract->setPalette(p);28 description->setPalette(p);29 30 // set scrollbars color31 //QPalette p2 = description->verticalScrollBar()->palette();32 //p2.setColor(QPalette::Active, QPalette::Background, color);33 ////description->verticalScrollBar()->setStyleSheet("background-color : blue;");34 //abstract->verticalScrollBar()->setPalette(p2);35 //description->verticalScrollBar()->setPalette(p2);36 37 60 title->setText(event.title()); 38 persons->setText(event.persons().join(" and ")); 39 abstract->setPlainText(event.abstract()); 40 description->setPlainText(event.description()); 61 mDetails.setPersons(event.persons()); 62 mDetails.setAbstract(event.abstract()); 63 mDetails.setDescription(event.description()); 64 scrollArea->setWidget(&mDetails); 41 65 } 42 66
Note: See TracChangeset
for help on using the changeset viewer.