diff options
author | deva <deva> | 2008-12-04 13:03:16 +0000 |
---|---|---|
committer | deva <deva> | 2008-12-04 13:03:16 +0000 |
commit | e5ae0c0bb0b641673f21855927395ca053d05de2 (patch) | |
tree | 1a556be6902579617cf86c201cc7f3fd0d261d10 | |
parent | 816278b4cb0fe5040d890f2678908dcae0fed12c (diff) |
Moved images to icons folder and added them as internal resources. Created a nice way to show full resume in resumewidget.
-rw-r--r-- | client/client.qrc | 4 | ||||
-rw-r--r-- | client/icons/add.png (renamed from client/add.png) | bin | 242 -> 242 bytes | |||
-rw-r--r-- | client/icons/arrows.png (renamed from client/arrows.png) | bin | 547 -> 547 bytes | |||
-rw-r--r-- | client/icons/compressed.png | bin | 0 -> 302 bytes | |||
-rw-r--r-- | client/icons/del.png (renamed from client/del.png) | bin | 370 -> 370 bytes | |||
-rw-r--r-- | client/resumewidget.cc | 34 | ||||
-rw-r--r-- | client/resumewidget.h | 6 | ||||
-rw-r--r-- | client/widgets/multilist.cc | 6 |
8 files changed, 42 insertions, 8 deletions
diff --git a/client/client.qrc b/client/client.qrc index 2ef2314..6da90ed 100644 --- a/client/client.qrc +++ b/client/client.qrc @@ -2,5 +2,9 @@ <RCC version="1.0"> <qresource> <file>icons/icon.png</file> + <file>icons/add.png</file> + <file>icons/del.png</file> + <file>icons/arrows.png</file> + <file>icons/compressed.png</file> </qresource> </RCC> diff --git a/client/add.png b/client/icons/add.png Binary files differindex 7a8dfc0..7a8dfc0 100644 --- a/client/add.png +++ b/client/icons/add.png diff --git a/client/arrows.png b/client/icons/arrows.png Binary files differindex ae56b01..ae56b01 100644 --- a/client/arrows.png +++ b/client/icons/arrows.png diff --git a/client/icons/compressed.png b/client/icons/compressed.png Binary files differnew file mode 100644 index 0000000..6213762 --- /dev/null +++ b/client/icons/compressed.png diff --git a/client/del.png b/client/icons/del.png Binary files differindex 222ac8b..222ac8b 100644 --- a/client/del.png +++ b/client/icons/del.png diff --git a/client/resumewidget.cc b/client/resumewidget.cc index 563d2df..8e67b92 100644 --- a/client/resumewidget.cc +++ b/client/resumewidget.cc @@ -29,6 +29,9 @@ #include <QHBoxLayout> #include <QBoxLayout> +#include <QTextEdit> +#include <QDialog> + #define MAX_COMPACT_SIZE 100 //#define RICH // Experimental syntax highlighter (numbers turn blue) @@ -48,6 +51,8 @@ ResumeWidget::ResumeWidget(bool compact) resume->setWordWrap(true); layout()->addWidget(resume); + + connect(resume, SIGNAL(linkActivated(const QString &)), this, SLOT(showFull(const QString &))); } #define LINEWIDTH 80 @@ -78,6 +83,8 @@ void ResumeWidget::setText(QString text) { QString f; + fulltext = text; + #ifdef FIXED_FONT QFont font = resume->font(); font.setFamily("Courier New"); @@ -98,19 +105,36 @@ void ResumeWidget::setText(QString text) #endif if(compact) { - QString origtext = f; - if(f.count('\n') > 0) f = f.left(f.indexOf('\n')); // Limit to one line. if(f.length() > MAX_COMPACT_SIZE) { f = f.left(MAX_COMPACT_SIZE); // limit to first MAX_COMPACT_SIZE characters. } - if(text != f) { - f += " <img src=\"compressed.png\"/>"; - resume->setToolTip(reformatString(origtext)); // Only set tooltip if resume has actually been cut off. + if(fulltext != f) { + f += " <a href=\"#\"><img src=\":icons/compressed.png\"/></a>"; + resume->setToolTip(reformatString(fulltext)); // Only set tooltip if resume has actually been cut off. + resume->setWhatsThis(fulltext); // Only set tooltip if resume has actually been cut off. } } resume->setText(f); } + +void ResumeWidget::showFull(const QString &) +{ + QDialog d(this); + d.setWindowTitle("Resume"); + + QTextEdit *t = new QTextEdit(&d); + d.resize(500, 200); + d.move(mapToGlobal(pos())); + t->setText(reformatString(fulltext)); + t->setReadOnly(true); + t->setLineWrapMode(QTextEdit::NoWrap); + + d.setLayout(new QHBoxLayout()); + d.layout()->addWidget(t); + + d.exec(); +} diff --git a/client/resumewidget.h b/client/resumewidget.h index 4b0eba9..fe8beb1 100644 --- a/client/resumewidget.h +++ b/client/resumewidget.h @@ -29,14 +29,20 @@ #include <QWidget> #include <QLabel> +#include <QMouseEvent> class ResumeWidget : public QWidget { +Q_OBJECT public: ResumeWidget(bool compact); void setText(QString text); +public slots: + void showFull(const QString &); + private: + QString fulltext; QLabel *resume; bool compact; }; diff --git a/client/widgets/multilist.cc b/client/widgets/multilist.cc index 5ba40ac..bff3ad7 100644 --- a/client/widgets/multilist.cc +++ b/client/widgets/multilist.cc @@ -89,13 +89,13 @@ MultiList::MultiList(QDomNode &node, MacroWindow *macrowindow) } QLabel *arrows = new QLabel(); - arrows->setPixmap(QPixmap("arrows.png")); + arrows->setPixmap(QPixmap(":icons/arrows.png")); layout->addWidget(arrows, 1, 0, 1, 2, Qt::AlignHCenter); QPushButton *add = new QPushButton(this); connect(add, SIGNAL(clicked()), this, SLOT(add())); add->setText("Tilføj ovenstående til listen"); - add->setIcon(QIcon(QPixmap("add.png"))); + add->setIcon(QIcon(QPixmap(":icons/add.png"))); // layout->addWidget(add, 0, 1, Qt::AlignTop); layout->addWidget(add, 2, 0, 1, 1, Qt::AlignTop); @@ -103,7 +103,7 @@ MultiList::MultiList(QDomNode &node, MacroWindow *macrowindow) QPushButton *rem = new QPushButton(this); connect(rem, SIGNAL(clicked()), this, SLOT(remove())); rem->setText("Fjern det markerede element fra listen"); - rem->setIcon(QIcon(QPixmap("del.png"))); + rem->setIcon(QIcon(QPixmap(":icons/del.png"))); // layout->addWidget(rem, 1, 1, Qt::AlignTop); layout->addWidget(rem, 2, 1, 1, 1, Qt::AlignTop); |