Changeset 183eecd in confclerk_git
- Timestamp:
- 01/25/10 12:07:00 (13 years ago)
- Branches:
- master, qt5
- Children:
- 7b70507
- Parents:
- 6dc0dbc
- Location:
- src/gui
- Files:
-
- 3 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 -
src/gui/eventdialog.h
r6dc0dbc r183eecd 5 5 #include "ui_eventdialog.h" 6 6 #include <event.h> 7 8 class DetailsContainer : public QWidget 9 { 10 public: 11 DetailsContainer(QWidget *aParent = NULL); 12 void setPersons(const QStringList &aPersons); 13 void setAbstract(const QString &aAbstract); 14 void setDescription(const QString &aDescription); 15 private: 16 QBoxLayout *mMainLayout; 17 QLabel mPersons; 18 QLabel mAbstract; 19 QLabel mDescription; 20 }; 21 7 22 8 23 class EventDialog : public QDialog, Ui::EventDialog … … 13 28 private: 14 29 int mEventId; 30 DetailsContainer mDetails; 15 31 }; 16 32 -
src/gui/eventdialog.ui
r6dc0dbc r183eecd 6 6 <x>0</x> 7 7 <y>0</y> 8 <width>4 68</width>9 <height> 496</height>8 <width>442</width> 9 <height>380</height> 10 10 </rect> 11 11 </property> … … 28 28 <widget class="QLabel" name="title" > 29 29 <property name="sizePolicy" > 30 <sizepolicy vsizetype="Minimum Expanding" hsizetype="MinimumExpanding" >30 <sizepolicy vsizetype="Minimum" hsizetype="MinimumExpanding" > 31 31 <horstretch>0</horstretch> 32 32 <verstretch>0</verstretch> … … 37 37 <weight>75</weight> 38 38 <bold>true</bold> 39 <underline>true</underline> 39 40 </font> 40 41 </property> … … 51 52 </item> 52 53 <item> 53 <layout class="QGridLayout" name="gridLayout_2" > 54 <item row="1" column="1" > 55 <widget class="QLabel" name="label_2" > 56 <property name="text" > 57 <string>Presenter(s): </string> 58 </property> 59 </widget> 60 </item> 61 <item row="1" column="2" > 62 <widget class="QLabel" name="persons" > 63 <property name="text" > 64 <string>persons go here</string> 65 </property> 66 </widget> 67 </item> 68 <item row="2" column="1" > 69 <widget class="QLabel" name="label_3" > 70 <property name="text" > 71 <string>Abstract:</string> 72 </property> 73 <property name="alignment" > 74 <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> 75 </property> 76 </widget> 77 </item> 78 <item row="2" column="2" > 79 <widget class="QPlainTextEdit" name="abstract" > 80 <property name="autoFillBackground" > 81 <bool>false</bool> 82 </property> 83 <property name="frameShape" > 84 <enum>QFrame::NoFrame</enum> 85 </property> 86 <property name="frameShadow" > 87 <enum>QFrame::Plain</enum> 88 </property> 89 <property name="lineWidth" > 90 <number>1</number> 91 </property> 92 <property name="readOnly" > 93 <bool>true</bool> 94 </property> 95 <property name="backgroundVisible" > 96 <bool>false</bool> 97 </property> 98 <property name="centerOnScroll" > 99 <bool>false</bool> 100 </property> 101 </widget> 102 </item> 103 <item row="3" column="1" > 104 <widget class="QLabel" name="label" > 105 <property name="text" > 106 <string>Description:</string> 107 </property> 108 <property name="alignment" > 109 <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> 110 </property> 111 </widget> 112 </item> 113 <item row="3" column="2" > 114 <widget class="QPlainTextEdit" name="description" > 115 <property name="frameShape" > 116 <enum>QFrame::NoFrame</enum> 117 </property> 118 <property name="frameShadow" > 119 <enum>QFrame::Plain</enum> 120 </property> 121 <property name="readOnly" > 122 <bool>true</bool> 123 </property> 124 </widget> 125 </item> 126 </layout> 54 <widget class="QScrollArea" name="scrollArea" > 55 <property name="widgetResizable" > 56 <bool>true</bool> 57 </property> 58 <widget class="QWidget" name="scrollAreaWidgetContents" > 59 <property name="geometry" > 60 <rect> 61 <x>0</x> 62 <y>0</y> 63 <width>418</width> 64 <height>296</height> 65 </rect> 66 </property> 67 </widget> 68 </widget> 127 69 </item> 128 70 <item>
Note: See TracChangeset
for help on using the changeset viewer.