Commit 9b32a462c95f70d80aa05e6c49572075deaf7b81

Authored by David Graeff
Committed by David Gräff
1 parent 57f55429

Remove icons and use an icon font instead. Advantage: Color theme applicable, wo…

…rks in high dpi mode.
openhantek/res/application.qrc
... ... @@ -2,16 +2,9 @@
2 2 <qresource prefix="/">
3 3 <file alias="openhantek.png">images/openhantek.png</file>
4 4 <file alias="switch.png">images/switch.png</file>
  5 + <file>images/fontawesome-4.7.0.ttf</file>
  6 + <file>images/openhantek.svg</file>
  7 + <file>images/digitalphosphor.svg</file>
5 8 </qresource>
6   - <qresource prefix="/actions">
7   - <file alias="open.png">images/actions/open.png</file>
8   - <file alias="save.png">images/actions/save.png</file>
9   - <file alias="save-as.png">images/actions/save-as.png</file>
10   - <file alias="print.png">images/actions/print.png</file>
11   - <file alias="export-as.png">images/actions/export-as.png</file>
12   - <file alias="start.png">images/actions/start.png</file>
13   - <file alias="stop.png">images/actions/stop.png</file>
14   - <file alias="digitalphosphor.png">images/actions/digitalphosphor.png</file>
15   - <file alias="zoom.png">images/actions/zoom.png</file>
16   - </qresource>
  9 + <qresource prefix="/actions"/>
17 10 </RCC>
... ...
openhantek/res/images/actions/cursors.png deleted

545 Bytes

openhantek/res/images/actions/export-as.png deleted

1.26 KB

openhantek/res/images/actions/open.png deleted

1.06 KB

openhantek/res/images/actions/print.png deleted

1.23 KB

openhantek/res/images/actions/save-as.png deleted

2.1 KB

openhantek/res/images/actions/save.png deleted

1.23 KB

openhantek/res/images/actions/start.png deleted

1.15 KB

openhantek/res/images/actions/stop.png deleted

1.14 KB

openhantek/res/images/actions/zoom.png deleted

4.74 KB

openhantek/res/images/actions/digitalphosphor.png renamed to openhantek/res/images/digitalphosphor.png

379 Bytes

openhantek/res/images/actions/digitalphosphor.svg renamed to openhantek/res/images/digitalphosphor.svg
openhantek/res/images/fontawesome-4.7.0.ttf 0 → 100644
No preview for this file type
openhantek/src/iconfont/QtAwesome.cpp 0 → 100644
  1 +/**
  2 + * QtAwesome - use font-awesome (or other font icons) in your c++ / Qt Application
  3 + *
  4 + * MIT Licensed
  5 + *
  6 + * Copyright 2013-2016 - Reliable Bits Software by Blommers IT. All Rights Reserved.
  7 + * Author Rick Blommers
  8 + */
  9 +
  10 +#include "QtAwesome.h"
  11 +#include "QtAwesomeAnim.h"
  12 +
  13 +#include <QDebug>
  14 +#include <QFile>
  15 +#include <QFontDatabase>
  16 +
  17 +QtAwesome *iconFont = new QtAwesome();
  18 +
  19 +/// The font-awesome icon painter
  20 +class QtAwesomeCharIconPainter : public QtAwesomeIconPainter {
  21 +
  22 + protected:
  23 + QStringList optionKeysForModeAndState(const QString &key, QIcon::Mode mode, QIcon::State state) {
  24 + QString modePostfix;
  25 + switch (mode) {
  26 + case QIcon::Disabled:
  27 + modePostfix = "-disabled";
  28 + break;
  29 + case QIcon::Active:
  30 + modePostfix = "-active";
  31 + break;
  32 + case QIcon::Selected:
  33 + modePostfix = "-selected";
  34 + break;
  35 + case QIcon::Normal:
  36 + break;
  37 + }
  38 +
  39 + QString statePostfix;
  40 + if (state == QIcon::Off) { statePostfix = "-off"; }
  41 +
  42 + // the keys that need to bet tested: key-mode-state | key-mode | key-state | key
  43 + QStringList result;
  44 + if (!modePostfix.isEmpty()) {
  45 + if (!statePostfix.isEmpty()) { result.push_back(key + modePostfix + statePostfix); }
  46 + result.push_back(key + modePostfix);
  47 + }
  48 + if (!statePostfix.isEmpty()) { result.push_back(key + statePostfix); }
  49 +
  50 + return result;
  51 + }
  52 +
  53 + QVariant optionValueForModeAndState(const QString &baseKey, QIcon::Mode mode, QIcon::State state,
  54 + const QVariantMap &options) {
  55 + foreach (QString key, optionKeysForModeAndState(baseKey, mode, state)) {
  56 + if (options.contains(key)) return options.value(key);
  57 + }
  58 + return options.value(baseKey);
  59 + }
  60 +
  61 + public:
  62 + virtual void paint(QtAwesome *awesome, QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state,
  63 + const QVariantMap &options) {
  64 + Q_UNUSED(mode);
  65 + Q_UNUSED(state);
  66 + Q_UNUSED(options);
  67 +
  68 + painter->save();
  69 +
  70 + // set the default options
  71 + QColor color = optionValueForModeAndState("color", mode, state, options).value<QColor>();
  72 + QString text = optionValueForModeAndState("text", mode, state, options).toString();
  73 +
  74 + if (text.isEmpty() || color.red()==0) {
  75 + qWarning() << "empty for" << mode << state << options;
  76 + }
  77 +
  78 + painter->setPen(color);
  79 +
  80 + // add some 'padding' around the icon
  81 + int drawSize = qRound(rect.height() * options.value("scale-factor").toFloat());
  82 +
  83 + painter->setFont(awesome->font(drawSize));
  84 + painter->drawText(rect, text, QTextOption(Qt::AlignCenter | Qt::AlignVCenter));
  85 +
  86 + painter->restore();
  87 +
  88 + QVariant var = options.value("anim");
  89 + QtAwesomeAnimation *anim = var.value<QtAwesomeAnimation *>();
  90 + if (anim) { anim->setup(*painter, rect); }
  91 +
  92 + }
  93 +};
  94 +
  95 +//---------------------------------------------------------------------------------------
  96 +
  97 +/// The painter icon engine.
  98 +class QtAwesomeIconPainterIconEngine : public QIconEngine {
  99 +
  100 + public:
  101 + QtAwesomeIconPainterIconEngine(QtAwesome *awesome, QtAwesomeIconPainter *painter, const QVariantMap &options)
  102 + : awesomeRef_(awesome), iconPainterRef_(painter), options_(options) {}
  103 +
  104 + virtual ~QtAwesomeIconPainterIconEngine() {}
  105 +
  106 + QtAwesomeIconPainterIconEngine *clone() const override {
  107 + return new QtAwesomeIconPainterIconEngine(awesomeRef_, iconPainterRef_, options_);
  108 + }
  109 +
  110 + virtual void paint(QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state) override {
  111 + Q_UNUSED(mode);
  112 + Q_UNUSED(state);
  113 + iconPainterRef_->paint(awesomeRef_, painter, rect, mode, state, options_);
  114 + }
  115 +
  116 + virtual QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state) override {
  117 + QPixmap pm(size);
  118 + pm.fill(Qt::transparent); // we need transparency
  119 + {
  120 + QPainter p(&pm);
  121 + paint(&p, QRect(QPoint(0, 0), size), mode, state);
  122 + }
  123 + return pm;
  124 + }
  125 + //#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
  126 + // virtual QList<QSize> availableSizes(QIcon::Mode mode, QIcon::State state) const override {
  127 + // Q_UNUSED(mode);
  128 + // Q_UNUSED(state);
  129 + // QList<QSize> sizes = {QSize(16, 16), QSize(32, 32), QSize(64, 64),
  130 + // QSize(128, 128), QSize(256, 256), QSize(512, 512)};
  131 + // return sizes;
  132 + // }
  133 + //#endif
  134 + private:
  135 + QtAwesome *awesomeRef_; ///< a reference to the QtAwesome instance
  136 + QtAwesomeIconPainter *iconPainterRef_; ///< a reference to the icon painter
  137 + QVariantMap options_; ///< the options for this icon painter
  138 +};
  139 +
  140 +//---------------------------------------------------------------------------------------
  141 +
  142 +/// The default icon colors
  143 +QtAwesome::QtAwesome(QObject *parent) : QObject(parent), namedCodepoints_() {
  144 + // initialize the default options
  145 + setDefaultOption("color", QColor(50, 50, 50));
  146 + setDefaultOption("color-off", QColor(50, 50, 50));
  147 + setDefaultOption("color-disabled", QColor(70, 70, 70, 60));
  148 + setDefaultOption("color-active", QColor(10, 10, 10));
  149 + setDefaultOption("color-selected", QColor(10, 10, 10));
  150 + setDefaultOption("scale-factor", 1.0);
  151 +
  152 + fontIconPainter_ = new QtAwesomeCharIconPainter();
  153 +}
  154 +
  155 +QtAwesome::~QtAwesome() {
  156 + delete fontIconPainter_;
  157 + // delete errorIconPainter_;
  158 + qDeleteAll(painterMap_);
  159 +}
  160 +
  161 +/// initializes the QtAwesome icon factory with the given fontname
  162 +void QtAwesome::init(const QString &fontname) { fontName_ = fontname; }
  163 +
  164 +struct FANameIcon {
  165 + const char *name;
  166 + fa::icon icon;
  167 +};
  168 +
  169 +static const FANameIcon faNameIconArray[] = {{"fa_500px", fa::fa_500px},
  170 + {"addressbook", fa::addressbook},
  171 + {"addressbooko", fa::addressbooko},
  172 + {"addresscard", fa::addresscard},
  173 + {"addresscardo", fa::addresscardo},
  174 + {"adjust", fa::adjust},
  175 + {"adn", fa::adn},
  176 + {"aligncenter", fa::aligncenter},
  177 + {"alignjustify", fa::alignjustify},
  178 + {"alignleft", fa::alignleft},
  179 + {"alignright", fa::alignright},
  180 + {"amazon", fa::amazon},
  181 + {"ambulance", fa::ambulance},
  182 + {"americansignlanguageinterpreting", fa::americansignlanguageinterpreting},
  183 + {"anchor", fa::anchor},
  184 + {"android", fa::android},
  185 + {"angellist", fa::angellist},
  186 + {"angledoubledown", fa::angledoubledown},
  187 + {"angledoubleleft", fa::angledoubleleft},
  188 + {"angledoubleright", fa::angledoubleright},
  189 + {"angledoubleup", fa::angledoubleup},
  190 + {"angledown", fa::angledown},
  191 + {"angleleft", fa::angleleft},
  192 + {"angleright", fa::angleright},
  193 + {"angleup", fa::angleup},
  194 + {"apple", fa::apple},
  195 + {"archive", fa::archive},
  196 + {"areachart", fa::areachart},
  197 + {"arrowcircledown", fa::arrowcircledown},
  198 + {"arrowcircleleft", fa::arrowcircleleft},
  199 + {"arrowcircleodown", fa::arrowcircleodown},
  200 + {"arrowcircleoleft", fa::arrowcircleoleft},
  201 + {"arrowcircleoright", fa::arrowcircleoright},
  202 + {"arrowcircleoup", fa::arrowcircleoup},
  203 + {"arrowcircleright", fa::arrowcircleright},
  204 + {"arrowcircleup", fa::arrowcircleup},
  205 + {"arrowdown", fa::arrowdown},
  206 + {"arrowleft", fa::arrowleft},
  207 + {"arrowright", fa::arrowright},
  208 + {"arrowup", fa::arrowup},
  209 + {"arrows", fa::arrows},
  210 + {"arrowsalt", fa::arrowsalt},
  211 + {"arrowsh", fa::arrowsh},
  212 + {"arrowsv", fa::arrowsv},
  213 + {"aslinterpreting", fa::aslinterpreting},
  214 + {"assistivelisteningsystems", fa::assistivelisteningsystems},
  215 + {"asterisk", fa::asterisk},
  216 + {"at", fa::at},
  217 + {"audiodescription", fa::audiodescription},
  218 + {"automobile", fa::automobile},
  219 + {"backward", fa::backward},
  220 + {"balancescale", fa::balancescale},
  221 + {"ban", fa::ban},
  222 + {"bandcamp", fa::bandcamp},
  223 + {"bank", fa::bank},
  224 + {"barchart", fa::barchart},
  225 + {"barcharto", fa::barcharto},
  226 + {"barcode", fa::barcode},
  227 + {"bars", fa::bars},
  228 + {"bath", fa::bath},
  229 + {"bathtub", fa::bathtub},
  230 + {"battery", fa::battery},
  231 + {"battery0", fa::battery0},
  232 + {"battery1", fa::battery1},
  233 + {"battery2", fa::battery2},
  234 + {"battery3", fa::battery3},
  235 + {"battery4", fa::battery4},
  236 + {"batteryempty", fa::batteryempty},
  237 + {"batteryfull", fa::batteryfull},
  238 + {"batteryhalf", fa::batteryhalf},
  239 + {"batteryquarter", fa::batteryquarter},
  240 + {"batterythreequarters", fa::batterythreequarters},
  241 + {"bed", fa::bed},
  242 + {"beer", fa::beer},
  243 + {"behance", fa::behance},
  244 + {"behancesquare", fa::behancesquare},
  245 + {"bell", fa::bell},
  246 + {"bello", fa::bello},
  247 + {"bellslash", fa::bellslash},
  248 + {"bellslasho", fa::bellslasho},
  249 + {"bicycle", fa::bicycle},
  250 + {"binoculars", fa::binoculars},
  251 + {"birthdaycake", fa::birthdaycake},
  252 + {"bitbucket", fa::bitbucket},
  253 + {"bitbucketsquare", fa::bitbucketsquare},
  254 + {"bitcoin", fa::bitcoin},
  255 + {"blacktie", fa::blacktie},
  256 + {"blind", fa::blind},
  257 + {"bluetooth", fa::bluetooth},
  258 + {"bluetoothb", fa::bluetoothb},
  259 + {"bold", fa::bold},
  260 + {"bolt", fa::bolt},
  261 + {"bomb", fa::bomb},
  262 + {"book", fa::book},
  263 + {"bookmark", fa::bookmark},
  264 + {"bookmarko", fa::bookmarko},
  265 + {"braille", fa::braille},
  266 + {"briefcase", fa::briefcase},
  267 + {"btc", fa::btc},
  268 + {"bug", fa::bug},
  269 + {"building", fa::building},
  270 + {"buildingo", fa::buildingo},
  271 + {"bullhorn", fa::bullhorn},
  272 + {"bullseye", fa::bullseye},
  273 + {"bus", fa::bus},
  274 + {"buysellads", fa::buysellads},
  275 + {"cab", fa::cab},
  276 + {"calculator", fa::calculator},
  277 + {"calendar", fa::calendar},
  278 + {"calendarchecko", fa::calendarchecko},
  279 + {"calendarminuso", fa::calendarminuso},
  280 + {"calendaro", fa::calendaro},
  281 + {"calendarpluso", fa::calendarpluso},
  282 + {"calendartimeso", fa::calendartimeso},
  283 + {"camera", fa::camera},
  284 + {"cameraretro", fa::cameraretro},
  285 + {"car", fa::car},
  286 + {"caretdown", fa::caretdown},
  287 + {"caretleft", fa::caretleft},
  288 + {"caretright", fa::caretright},
  289 + {"caretsquareodown", fa::caretsquareodown},
  290 + {"caretsquareoleft", fa::caretsquareoleft},
  291 + {"caretsquareoright", fa::caretsquareoright},
  292 + {"caretsquareoup", fa::caretsquareoup},
  293 + {"caretup", fa::caretup},
  294 + {"cartarrowdown", fa::cartarrowdown},
  295 + {"cartplus", fa::cartplus},
  296 + {"cc", fa::cc},
  297 + {"ccamex", fa::ccamex},
  298 + {"ccdinersclub", fa::ccdinersclub},
  299 + {"ccdiscover", fa::ccdiscover},
  300 + {"ccjcb", fa::ccjcb},
  301 + {"ccmastercard", fa::ccmastercard},
  302 + {"ccpaypal", fa::ccpaypal},
  303 + {"ccstripe", fa::ccstripe},
  304 + {"ccvisa", fa::ccvisa},
  305 + {"certificate", fa::certificate},
  306 + {"chain", fa::chain},
  307 + {"chainbroken", fa::chainbroken},
  308 + {"check", fa::check},
  309 + {"checkcircle", fa::checkcircle},
  310 + {"checkcircleo", fa::checkcircleo},
  311 + {"checksquare", fa::checksquare},
  312 + {"checksquareo", fa::checksquareo},
  313 + {"chevroncircledown", fa::chevroncircledown},
  314 + {"chevroncircleleft", fa::chevroncircleleft},
  315 + {"chevroncircleright", fa::chevroncircleright},
  316 + {"chevroncircleup", fa::chevroncircleup},
  317 + {"chevrondown", fa::chevrondown},
  318 + {"chevronleft", fa::chevronleft},
  319 + {"chevronright", fa::chevronright},
  320 + {"chevronup", fa::chevronup},
  321 + {"child", fa::child},
  322 + {"chrome", fa::chrome},
  323 + {"circle", fa::circle},
  324 + {"circleo", fa::circleo},
  325 + {"circleonotch", fa::circleonotch},
  326 + {"circlethin", fa::circlethin},
  327 + {"clipboard", fa::clipboard},
  328 + {"clocko", fa::clocko},
  329 + {"clone", fa::clone},
  330 + {"close", fa::close},
  331 + {"cloud", fa::cloud},
  332 + {"clouddownload", fa::clouddownload},
  333 + {"cloudupload", fa::cloudupload},
  334 + {"cny", fa::cny},
  335 + {"code", fa::code},
  336 + {"codefork", fa::codefork},
  337 + {"codepen", fa::codepen},
  338 + {"codiepie", fa::codiepie},
  339 + {"coffee", fa::coffee},
  340 + {"cog", fa::cog},
  341 + {"cogs", fa::cogs},
  342 + {"columns", fa::columns},
  343 + {"comment", fa::comment},
  344 + {"commento", fa::commento},
  345 + {"commenting", fa::commenting},
  346 + {"commentingo", fa::commentingo},
  347 + {"comments", fa::comments},
  348 + {"commentso", fa::commentso},
  349 + {"compass", fa::compass},
  350 + {"compress", fa::compress},
  351 + {"connectdevelop", fa::connectdevelop},
  352 + {"contao", fa::contao},
  353 + {"copy", fa::copy},
  354 + {"copyright", fa::copyright},
  355 + {"creativecommons", fa::creativecommons},
  356 + {"creditcard", fa::creditcard},
  357 + {"creditcardalt", fa::creditcardalt},
  358 + {"crop", fa::crop},
  359 + {"crosshairs", fa::crosshairs},
  360 + {"css3", fa::css3},
  361 + {"cube", fa::cube},
  362 + {"cubes", fa::cubes},
  363 + {"cut", fa::cut},
  364 + {"cutlery", fa::cutlery},
  365 + {"dashboard", fa::dashboard},
  366 + {"dashcube", fa::dashcube},
  367 + {"database", fa::database},
  368 + {"deaf", fa::deaf},
  369 + {"deafness", fa::deafness},
  370 + {"dedent", fa::dedent},
  371 + {"delicious", fa::delicious},
  372 + {"desktop", fa::desktop},
  373 + {"deviantart", fa::deviantart},
  374 + {"diamond", fa::diamond},
  375 + {"digg", fa::digg},
  376 + {"dollar", fa::dollar},
  377 + {"dotcircleo", fa::dotcircleo},
  378 + {"download", fa::download},
  379 + {"dribbble", fa::dribbble},
  380 + {"driverslicense", fa::driverslicense},
  381 + {"driverslicenseo", fa::driverslicenseo},
  382 + {"dropbox", fa::dropbox},
  383 + {"drupal", fa::drupal},
  384 + {"edge", fa::edge},
  385 + {"edit", fa::edit},
  386 + {"eercast", fa::eercast},
  387 + {"eject", fa::eject},
  388 + {"ellipsish", fa::ellipsish},
  389 + {"ellipsisv", fa::ellipsisv},
  390 + {"empire", fa::empire},
  391 + {"envelope", fa::envelope},
  392 + {"envelopeo", fa::envelopeo},
  393 + {"envelopeopen", fa::envelopeopen},
  394 + {"envelopeopeno", fa::envelopeopeno},
  395 + {"envelopesquare", fa::envelopesquare},
  396 + {"envira", fa::envira},
  397 + {"eraser", fa::eraser},
  398 + {"etsy", fa::etsy},
  399 + {"eur", fa::eur},
  400 + {"euro", fa::euro},
  401 + {"exchange", fa::exchange},
  402 + {"exclamation", fa::exclamation},
  403 + {"exclamationcircle", fa::exclamationcircle},
  404 + {"exclamationtriangle", fa::exclamationtriangle},
  405 + {"expand", fa::expand},
  406 + {"expeditedssl", fa::expeditedssl},
  407 + {"externallink", fa::externallink},
  408 + {"externallinksquare", fa::externallinksquare},
  409 + {"eye", fa::eye},
  410 + {"eyeslash", fa::eyeslash},
  411 + {"eyedropper", fa::eyedropper},
  412 + {"fa", fa::fa},
  413 + {"facebook", fa::facebook},
  414 + {"facebookf", fa::facebookf},
  415 + {"facebookofficial", fa::facebookofficial},
  416 + {"facebooksquare", fa::facebooksquare},
  417 + {"fastbackward", fa::fastbackward},
  418 + {"fastforward", fa::fastforward},
  419 + {"fax", fa::fax},
  420 + {"feed", fa::feed},
  421 + {"female", fa::female},
  422 + {"fighterjet", fa::fighterjet},
  423 + {"file", fa::file},
  424 + {"filearchiveo", fa::filearchiveo},
  425 + {"fileaudioo", fa::fileaudioo},
  426 + {"filecodeo", fa::filecodeo},
  427 + {"fileexcelo", fa::fileexcelo},
  428 + {"fileimageo", fa::fileimageo},
  429 + {"filemovieo", fa::filemovieo},
  430 + {"fileo", fa::fileo},
  431 + {"filepdfo", fa::filepdfo},
  432 + {"filephotoo", fa::filephotoo},
  433 + {"filepictureo", fa::filepictureo},
  434 + {"filepowerpointo", fa::filepowerpointo},
  435 + {"filesoundo", fa::filesoundo},
  436 + {"filetext", fa::filetext},
  437 + {"filetexto", fa::filetexto},
  438 + {"filevideoo", fa::filevideoo},
  439 + {"filewordo", fa::filewordo},
  440 + {"filezipo", fa::filezipo},
  441 + {"fileso", fa::fileso},
  442 + {"film", fa::film},
  443 + {"filter", fa::filter},
  444 + {"fire", fa::fire},
  445 + {"fireextinguisher", fa::fireextinguisher},
  446 + {"firefox", fa::firefox},
  447 + {"firstorder", fa::firstorder},
  448 + {"flag", fa::flag},
  449 + {"flagcheckered", fa::flagcheckered},
  450 + {"flago", fa::flago},
  451 + {"flash", fa::flash},
  452 + {"flask", fa::flask},
  453 + {"flickr", fa::flickr},
  454 + {"floppyo", fa::floppyo},
  455 + {"folder", fa::folder},
  456 + {"foldero", fa::foldero},
  457 + {"folderopen", fa::folderopen},
  458 + {"folderopeno", fa::folderopeno},
  459 + {"font", fa::font},
  460 + {"fontawesome", fa::fontawesome},
  461 + {"fonticons", fa::fonticons},
  462 + {"fortawesome", fa::fortawesome},
  463 + {"forumbee", fa::forumbee},
  464 + {"forward", fa::forward},
  465 + {"foursquare", fa::foursquare},
  466 + {"freecodecamp", fa::freecodecamp},
  467 + {"frowno", fa::frowno},
  468 + {"futbolo", fa::futbolo},
  469 + {"gamepad", fa::gamepad},
  470 + {"gavel", fa::gavel},
  471 + {"gbp", fa::gbp},
  472 + {"ge", fa::ge},
  473 + {"gear", fa::gear},
  474 + {"gears", fa::gears},
  475 + {"genderless", fa::genderless},
  476 + {"getpocket", fa::getpocket},
  477 + {"gg", fa::gg},
  478 + {"ggcircle", fa::ggcircle},
  479 + {"gift", fa::gift},
  480 + {"git", fa::git},
  481 + {"gitsquare", fa::gitsquare},
  482 + {"github", fa::github},
  483 + {"githubalt", fa::githubalt},
  484 + {"githubsquare", fa::githubsquare},
  485 + {"gitlab", fa::gitlab},
  486 + {"gittip", fa::gittip},
  487 + {"glass", fa::glass},
  488 + {"glide", fa::glide},
  489 + {"glideg", fa::glideg},
  490 + {"globe", fa::globe},
  491 + {"google", fa::google},
  492 + {"googleplus", fa::googleplus},
  493 + {"googlepluscircle", fa::googlepluscircle},
  494 + {"googleplusofficial", fa::googleplusofficial},
  495 + {"googleplussquare", fa::googleplussquare},
  496 + {"googlewallet", fa::googlewallet},
  497 + {"graduationcap", fa::graduationcap},
  498 + {"gratipay", fa::gratipay},
  499 + {"grav", fa::grav},
  500 + {"group", fa::group},
  501 + {"hsquare", fa::hsquare},
  502 + {"hackernews", fa::hackernews},
  503 + {"handgrabo", fa::handgrabo},
  504 + {"handlizardo", fa::handlizardo},
  505 + {"handodown", fa::handodown},
  506 + {"handoleft", fa::handoleft},
  507 + {"handoright", fa::handoright},
  508 + {"handoup", fa::handoup},
  509 + {"handpapero", fa::handpapero},
  510 + {"handpeaceo", fa::handpeaceo},
  511 + {"handpointero", fa::handpointero},
  512 + {"handrocko", fa::handrocko},
  513 + {"handscissorso", fa::handscissorso},
  514 + {"handspocko", fa::handspocko},
  515 + {"handstopo", fa::handstopo},
  516 + {"handshakeo", fa::handshakeo},
  517 + {"hardofhearing", fa::hardofhearing},
  518 + {"hashtag", fa::hashtag},
  519 + {"hddo", fa::hddo},
  520 + {"header", fa::header},
  521 + {"headphones", fa::headphones},
  522 + {"heart", fa::heart},
  523 + {"hearto", fa::hearto},
  524 + {"heartbeat", fa::heartbeat},
  525 + {"history", fa::history},
  526 + {"home", fa::home},
  527 + {"hospitalo", fa::hospitalo},
  528 + {"hotel", fa::hotel},
  529 + {"hourglass", fa::hourglass},
  530 + {"hourglass1", fa::hourglass1},
  531 + {"hourglass2", fa::hourglass2},
  532 + {"hourglass3", fa::hourglass3},
  533 + {"hourglassend", fa::hourglassend},
  534 + {"hourglasshalf", fa::hourglasshalf},
  535 + {"hourglasso", fa::hourglasso},
  536 + {"hourglassstart", fa::hourglassstart},
  537 + {"houzz", fa::houzz},
  538 + {"html5", fa::html5},
  539 + {"icursor", fa::icursor},
  540 + {"idbadge", fa::idbadge},
  541 + {"idcard", fa::idcard},
  542 + {"idcardo", fa::idcardo},
  543 + {"ils", fa::ils},
  544 + {"image", fa::image},
  545 + {"imdb", fa::imdb},
  546 + {"inbox", fa::inbox},
  547 + {"indent", fa::indent},
  548 + {"industry", fa::industry},
  549 + {"info", fa::info},
  550 + {"infocircle", fa::infocircle},
  551 + {"inr", fa::inr},
  552 + {"instagram", fa::instagram},
  553 + {"institution", fa::institution},
  554 + {"internetexplorer", fa::internetexplorer},
  555 + {"intersex", fa::intersex},
  556 + {"ioxhost", fa::ioxhost},
  557 + {"italic", fa::italic},
  558 + {"joomla", fa::joomla},
  559 + {"jpy", fa::jpy},
  560 + {"jsfiddle", fa::jsfiddle},
  561 + {"key", fa::key},
  562 + {"keyboardo", fa::keyboardo},
  563 + {"krw", fa::krw},
  564 + {"language", fa::language},
  565 + {"laptop", fa::laptop},
  566 + {"lastfm", fa::lastfm},
  567 + {"lastfmsquare", fa::lastfmsquare},
  568 + {"leaf", fa::leaf},
  569 + {"leanpub", fa::leanpub},
  570 + {"legal", fa::legal},
  571 + {"lemono", fa::lemono},
  572 + {"leveldown", fa::leveldown},
  573 + {"levelup", fa::levelup},
  574 + {"lifebouy", fa::lifebouy},
  575 + {"lifebuoy", fa::lifebuoy},
  576 + {"lifering", fa::lifering},
  577 + {"lifesaver", fa::lifesaver},
  578 + {"lightbulbo", fa::lightbulbo},
  579 + {"linechart", fa::linechart},
  580 + {"link", fa::link},
  581 + {"linkedin", fa::linkedin},
  582 + {"linkedinsquare", fa::linkedinsquare},
  583 + {"linode", fa::linode},
  584 + {"fa_linux", fa::fa_linux},
  585 + {"list", fa::list},
  586 + {"listalt", fa::listalt},
  587 + {"listol", fa::listol},
  588 + {"listul", fa::listul},
  589 + {"locationarrow", fa::locationarrow},
  590 + {"lock", fa::lock},
  591 + {"longarrowdown", fa::longarrowdown},
  592 + {"longarrowleft", fa::longarrowleft},
  593 + {"longarrowright", fa::longarrowright},
  594 + {"longarrowup", fa::longarrowup},
  595 + {"lowvision", fa::lowvision},
  596 + {"magic", fa::magic},
  597 + {"magnet", fa::magnet},
  598 + {"mailforward", fa::mailforward},
  599 + {"mailreply", fa::mailreply},
  600 + {"mailreplyall", fa::mailreplyall},
  601 + {"male", fa::male},
  602 + {"map", fa::map},
  603 + {"mapmarker", fa::mapmarker},
  604 + {"mapo", fa::mapo},
  605 + {"mappin", fa::mappin},
  606 + {"mapsigns", fa::mapsigns},
  607 + {"mars", fa::mars},
  608 + {"marsdouble", fa::marsdouble},
  609 + {"marsstroke", fa::marsstroke},
  610 + {"marsstrokeh", fa::marsstrokeh},
  611 + {"marsstrokev", fa::marsstrokev},
  612 + {"maxcdn", fa::maxcdn},
  613 + {"meanpath", fa::meanpath},
  614 + {"medium", fa::medium},
  615 + {"medkit", fa::medkit},
  616 + {"meetup", fa::meetup},
  617 + {"meho", fa::meho},
  618 + {"mercury", fa::mercury},
  619 + {"microchip", fa::microchip},
  620 + {"microphone", fa::microphone},
  621 + {"microphoneslash", fa::microphoneslash},
  622 + {"minus", fa::minus},
  623 + {"minuscircle", fa::minuscircle},
  624 + {"minussquare", fa::minussquare},
  625 + {"minussquareo", fa::minussquareo},
  626 + {"mixcloud", fa::mixcloud},
  627 + {"mobile", fa::mobile},
  628 + {"mobilephone", fa::mobilephone},
  629 + {"modx", fa::modx},
  630 + {"money", fa::money},
  631 + {"moono", fa::moono},
  632 + {"mortarboard", fa::mortarboard},
  633 + {"motorcycle", fa::motorcycle},
  634 + {"mousepointer", fa::mousepointer},
  635 + {"music", fa::music},
  636 + {"navicon", fa::navicon},
  637 + {"neuter", fa::neuter},
  638 + {"newspapero", fa::newspapero},
  639 + {"objectgroup", fa::objectgroup},
  640 + {"objectungroup", fa::objectungroup},
  641 + {"odnoklassniki", fa::odnoklassniki},
  642 + {"odnoklassnikisquare", fa::odnoklassnikisquare},
  643 + {"opencart", fa::opencart},
  644 + {"openid", fa::openid},
  645 + {"opera", fa::opera},
  646 + {"optinmonster", fa::optinmonster},
  647 + {"outdent", fa::outdent},
  648 + {"pagelines", fa::pagelines},
  649 + {"paintbrush", fa::paintbrush},
  650 + {"paperplane", fa::paperplane},
  651 + {"paperplaneo", fa::paperplaneo},
  652 + {"paperclip", fa::paperclip},
  653 + {"paragraph", fa::paragraph},
  654 + {"paste", fa::paste},
  655 + {"pause", fa::pause},
  656 + {"pausecircle", fa::pausecircle},
  657 + {"pausecircleo", fa::pausecircleo},
  658 + {"paw", fa::paw},
  659 + {"paypal", fa::paypal},
  660 + {"pencil", fa::pencil},
  661 + {"pencilsquare", fa::pencilsquare},
  662 + {"pencilsquareo", fa::pencilsquareo},
  663 + {"percent", fa::percent},
  664 + {"phone", fa::phone},
  665 + {"phonesquare", fa::phonesquare},
  666 + {"photo", fa::photo},
  667 + {"pictureo", fa::pictureo},
  668 + {"piechart", fa::piechart},
  669 + {"piedpiper", fa::piedpiper},
  670 + {"piedpiperalt", fa::piedpiperalt},
  671 + {"piedpiperpp", fa::piedpiperpp},
  672 + {"pinterest", fa::pinterest},
  673 + {"pinterestp", fa::pinterestp},
  674 + {"pinterestsquare", fa::pinterestsquare},
  675 + {"plane", fa::plane},
  676 + {"play", fa::play},
  677 + {"playcircle", fa::playcircle},
  678 + {"playcircleo", fa::playcircleo},
  679 + {"plug", fa::plug},
  680 + {"plus", fa::plus},
  681 + {"pluscircle", fa::pluscircle},
  682 + {"plussquare", fa::plussquare},
  683 + {"plussquareo", fa::plussquareo},
  684 + {"podcast", fa::podcast},
  685 + {"poweroff", fa::poweroff},
  686 + {"print", fa::print},
  687 + {"producthunt", fa::producthunt},
  688 + {"puzzlepiece", fa::puzzlepiece},
  689 + {"qq", fa::qq},
  690 + {"qrcode", fa::qrcode},
  691 + {"question", fa::question},
  692 + {"questioncircle", fa::questioncircle},
  693 + {"questioncircleo", fa::questioncircleo},
  694 + {"quora", fa::quora},
  695 + {"quoteleft", fa::quoteleft},
  696 + {"quoteright", fa::quoteright},
  697 + {"ra", fa::ra},
  698 + {"random", fa::random},
  699 + {"ravelry", fa::ravelry},
  700 + {"rebel", fa::rebel},
  701 + {"recycle", fa::recycle},
  702 + {"reddit", fa::reddit},
  703 + {"redditalien", fa::redditalien},
  704 + {"redditsquare", fa::redditsquare},
  705 + {"refresh", fa::refresh},
  706 + {"registered", fa::registered},
  707 + {"remove", fa::remove},
  708 + {"renren", fa::renren},
  709 + {"reorder", fa::reorder},
  710 + {"repeat", fa::repeat},
  711 + {"reply", fa::reply},
  712 + {"replyall", fa::replyall},
  713 + {"resistance", fa::resistance},
  714 + {"retweet", fa::retweet},
  715 + {"rmb", fa::rmb},
  716 + {"road", fa::road},
  717 + {"rocket", fa::rocket},
  718 + {"rotateleft", fa::rotateleft},
  719 + {"rotateright", fa::rotateright},
  720 + {"rouble", fa::rouble},
  721 + {"rss", fa::rss},
  722 + {"rsssquare", fa::rsssquare},
  723 + {"rub", fa::rub},
  724 + {"ruble", fa::ruble},
  725 + {"rupee", fa::rupee},
  726 + {"s15", fa::s15},
  727 + {"safari", fa::safari},
  728 + {"save", fa::save},
  729 + {"scissors", fa::scissors},
  730 + {"scribd", fa::scribd},
  731 + {"search", fa::search},
  732 + {"searchminus", fa::searchminus},
  733 + {"searchplus", fa::searchplus},
  734 + {"sellsy", fa::sellsy},
  735 + {"send", fa::send},
  736 + {"sendo", fa::sendo},
  737 + {"server", fa::server},
  738 + {"share", fa::share},
  739 + {"sharealt", fa::sharealt},
  740 + {"sharealtsquare", fa::sharealtsquare},
  741 + {"sharesquare", fa::sharesquare},
  742 + {"sharesquareo", fa::sharesquareo},
  743 + {"shekel", fa::shekel},
  744 + {"sheqel", fa::sheqel},
  745 + {"shield", fa::shield},
  746 + {"ship", fa::ship},
  747 + {"shirtsinbulk", fa::shirtsinbulk},
  748 + {"shoppingbag", fa::shoppingbag},
  749 + {"shoppingbasket", fa::shoppingbasket},
  750 + {"shoppingcart", fa::shoppingcart},
  751 + {"shower", fa::shower},
  752 + {"signin", fa::signin},
  753 + {"signlanguage", fa::signlanguage},
  754 + {"signout", fa::signout},
  755 + {"signal", fa::signal},
  756 + {"signing", fa::signing},
  757 + {"simplybuilt", fa::simplybuilt},
  758 + {"sitemap", fa::sitemap},
  759 + {"skyatlas", fa::skyatlas},
  760 + {"skype", fa::skype},
  761 + {"slack", fa::slack},
  762 + {"sliders", fa::sliders},
  763 + {"slideshare", fa::slideshare},
  764 + {"smileo", fa::smileo},
  765 + {"snapchat", fa::snapchat},
  766 + {"snapchatghost", fa::snapchatghost},
  767 + {"snapchatsquare", fa::snapchatsquare},
  768 + {"snowflakeo", fa::snowflakeo},
  769 + {"soccerballo", fa::soccerballo},
  770 + {"sort", fa::sort},
  771 + {"sortalphaasc", fa::sortalphaasc},
  772 + {"sortalphadesc", fa::sortalphadesc},
  773 + {"sortamountasc", fa::sortamountasc},
  774 + {"sortamountdesc", fa::sortamountdesc},
  775 + {"sortasc", fa::sortasc},
  776 + {"sortdesc", fa::sortdesc},
  777 + {"sortdown", fa::sortdown},
  778 + {"sortnumericasc", fa::sortnumericasc},
  779 + {"sortnumericdesc", fa::sortnumericdesc},
  780 + {"sortup", fa::sortup},
  781 + {"soundcloud", fa::soundcloud},
  782 + {"spaceshuttle", fa::spaceshuttle},
  783 + {"spinner", fa::spinner},
  784 + {"spoon", fa::spoon},
  785 + {"spotify", fa::spotify},
  786 + {"square", fa::square},
  787 + {"squareo", fa::squareo},
  788 + {"stackexchange", fa::stackexchange},
  789 + {"stackoverflow", fa::stackoverflow},
  790 + {"star", fa::star},
  791 + {"starhalf", fa::starhalf},
  792 + {"starhalfempty", fa::starhalfempty},
  793 + {"starhalffull", fa::starhalffull},
  794 + {"starhalfo", fa::starhalfo},
  795 + {"staro", fa::staro},
  796 + {"steam", fa::steam},
  797 + {"steamsquare", fa::steamsquare},
  798 + {"stepbackward", fa::stepbackward},
  799 + {"stepforward", fa::stepforward},
  800 + {"stethoscope", fa::stethoscope},
  801 + {"stickynote", fa::stickynote},
  802 + {"stickynoteo", fa::stickynoteo},
  803 + {"stop", fa::stop},
  804 + {"stopcircle", fa::stopcircle},
  805 + {"stopcircleo", fa::stopcircleo},
  806 + {"streetview", fa::streetview},
  807 + {"strikethrough", fa::strikethrough},
  808 + {"stumbleupon", fa::stumbleupon},
  809 + {"stumbleuponcircle", fa::stumbleuponcircle},
  810 + {"subscript", fa::subscript},
  811 + {"subway", fa::subway},
  812 + {"suitcase", fa::suitcase},
  813 + {"suno", fa::suno},
  814 + {"superpowers", fa::superpowers},
  815 + {"superscript", fa::superscript},
  816 + {"support", fa::support},
  817 + {"table", fa::table},
  818 + {"tablet", fa::tablet},
  819 + {"tachometer", fa::tachometer},
  820 + {"tag", fa::tag},
  821 + {"tags", fa::tags},
  822 + {"tasks", fa::tasks},
  823 + {"taxi", fa::taxi},
  824 + {"telegram", fa::telegram},
  825 + {"television", fa::television},
  826 + {"tencentweibo", fa::tencentweibo},
  827 + {"terminal", fa::terminal},
  828 + {"textheight", fa::textheight},
  829 + {"textwidth", fa::textwidth},
  830 + {"th", fa::th},
  831 + {"thlarge", fa::thlarge},
  832 + {"thlist", fa::thlist},
  833 + {"themeisle", fa::themeisle},
  834 + {"thermometer", fa::thermometer},
  835 + {"thermometer0", fa::thermometer0},
  836 + {"thermometer1", fa::thermometer1},
  837 + {"thermometer2", fa::thermometer2},
  838 + {"thermometer3", fa::thermometer3},
  839 + {"thermometer4", fa::thermometer4},
  840 + {"thermometerempty", fa::thermometerempty},
  841 + {"thermometerfull", fa::thermometerfull},
  842 + {"thermometerhalf", fa::thermometerhalf},
  843 + {"thermometerquarter", fa::thermometerquarter},
  844 + {"thermometerthreequarters", fa::thermometerthreequarters},
  845 + {"thumbtack", fa::thumbtack},
  846 + {"thumbsdown", fa::thumbsdown},
  847 + {"thumbsodown", fa::thumbsodown},
  848 + {"thumbsoup", fa::thumbsoup},
  849 + {"thumbsup", fa::thumbsup},
  850 + {"ticket", fa::ticket},
  851 + {"times", fa::times},
  852 + {"timescircle", fa::timescircle},
  853 + {"timescircleo", fa::timescircleo},
  854 + {"timesrectangle", fa::timesrectangle},
  855 + {"timesrectangleo", fa::timesrectangleo},
  856 + {"tint", fa::tint},
  857 + {"toggledown", fa::toggledown},
  858 + {"toggleleft", fa::toggleleft},
  859 + {"toggleoff", fa::toggleoff},
  860 + {"toggleon", fa::toggleon},
  861 + {"toggleright", fa::toggleright},
  862 + {"toggleup", fa::toggleup},
  863 + {"trademark", fa::trademark},
  864 + {"train", fa::train},
  865 + {"transgender", fa::transgender},
  866 + {"transgenderalt", fa::transgenderalt},
  867 + {"trash", fa::trash},
  868 + {"trasho", fa::trasho},
  869 + {"tree", fa::tree},
  870 + {"trello", fa::trello},
  871 + {"tripadvisor", fa::tripadvisor},
  872 + {"trophy", fa::trophy},
  873 + {"truck", fa::truck},
  874 + {"fa_try", fa::fa_try},
  875 + {"tty", fa::tty},
  876 + {"tumblr", fa::tumblr},
  877 + {"tumblrsquare", fa::tumblrsquare},
  878 + {"turkishlira", fa::turkishlira},
  879 + {"tv", fa::tv},
  880 + {"twitch", fa::twitch},
  881 + {"twitter", fa::twitter},
  882 + {"twittersquare", fa::twittersquare},
  883 + {"umbrella", fa::umbrella},
  884 + {"underline", fa::underline},
  885 + {"undo", fa::undo},
  886 + {"universalaccess", fa::universalaccess},
  887 + {"university", fa::university},
  888 + {"unlink", fa::unlink},
  889 + {"unlock", fa::unlock},
  890 + {"unlockalt", fa::unlockalt},
  891 + {"unsorted", fa::unsorted},
  892 + {"upload", fa::upload},
  893 + {"usb", fa::usb},
  894 + {"usd", fa::usd},
  895 + {"user", fa::user},
  896 + {"usercircle", fa::usercircle},
  897 + {"usercircleo", fa::usercircleo},
  898 + {"usermd", fa::usermd},
  899 + {"usero", fa::usero},
  900 + {"userplus", fa::userplus},
  901 + {"usersecret", fa::usersecret},
  902 + {"usertimes", fa::usertimes},
  903 + {"users", fa::users},
  904 + {"vcard", fa::vcard},
  905 + {"vcardo", fa::vcardo},
  906 + {"venus", fa::venus},
  907 + {"venusdouble", fa::venusdouble},
  908 + {"venusmars", fa::venusmars},
  909 + {"viacoin", fa::viacoin},
  910 + {"viadeo", fa::viadeo},
  911 + {"viadeosquare", fa::viadeosquare},
  912 + {"videocamera", fa::videocamera},
  913 + {"vimeo", fa::vimeo},
  914 + {"vimeosquare", fa::vimeosquare},
  915 + {"vine", fa::vine},
  916 + {"vk", fa::vk},
  917 + {"volumecontrolphone", fa::volumecontrolphone},
  918 + {"volumedown", fa::volumedown},
  919 + {"volumeoff", fa::volumeoff},
  920 + {"volumeup", fa::volumeup},
  921 + {"warning", fa::warning},
  922 + {"wechat", fa::wechat},
  923 + {"weibo", fa::weibo},
  924 + {"weixin", fa::weixin},
  925 + {"whatsapp", fa::whatsapp},
  926 + {"wheelchair", fa::wheelchair},
  927 + {"wheelchairalt", fa::wheelchairalt},
  928 + {"wifi", fa::wifi},
  929 + {"wikipediaw", fa::wikipediaw},
  930 + {"windowclose", fa::windowclose},
  931 + {"windowcloseo", fa::windowcloseo},
  932 + {"windowmaximize", fa::windowmaximize},
  933 + {"windowminimize", fa::windowminimize},
  934 + {"windowrestore", fa::windowrestore},
  935 + {"windows", fa::windows},
  936 + {"won", fa::won},
  937 + {"wordpress", fa::wordpress},
  938 + {"wpbeginner", fa::wpbeginner},
  939 + {"wpexplorer", fa::wpexplorer},
  940 + {"wpforms", fa::wpforms},
  941 + {"wrench", fa::wrench},
  942 + {"xing", fa::xing},
  943 + {"xingsquare", fa::xingsquare},
  944 + {"ycombinator", fa::ycombinator},
  945 + {"ycombinatorsquare", fa::ycombinatorsquare},
  946 + {"yahoo", fa::yahoo},
  947 + {"yc", fa::yc},
  948 + {"ycsquare", fa::ycsquare},
  949 + {"yelp", fa::yelp},
  950 + {"yen", fa::yen},
  951 + {"yoast", fa::yoast},
  952 + {"youtube", fa::youtube},
  953 + {"youtubeplay", fa::youtubeplay},
  954 + {"youtubesquare", fa::youtubesquare}};
  955 +
  956 +/// a specialized init function so font-awesome is loaded and initialized
  957 +/// this method return true on success, it will return false if the fnot cannot be initialized
  958 +/// To initialize QtAwesome with font-awesome you need to call this method
  959 +bool QtAwesome::initFontAwesome() {
  960 + static int fontAwesomeFontId = -1;
  961 +
  962 + // only load font-awesome once
  963 + if (fontAwesomeFontId < 0) {
  964 + // load the font file
  965 + QFile res(":/images/fontawesome-4.7.0.ttf");
  966 + if (!res.open(QIODevice::ReadOnly)) {
  967 + qDebug() << "Font awesome font could not be loaded!";
  968 + return false;
  969 + }
  970 + QByteArray fontData(res.readAll());
  971 + res.close();
  972 +
  973 + // fetch the given font
  974 + fontAwesomeFontId = QFontDatabase::addApplicationFontFromData(fontData);
  975 + }
  976 +
  977 + QStringList loadedFontFamilies = QFontDatabase::applicationFontFamilies(fontAwesomeFontId);
  978 + if (!loadedFontFamilies.empty()) {
  979 + fontName_ = loadedFontFamilies.at(0);
  980 + } else {
  981 + qDebug() << "Font awesome font is empty?!";
  982 + fontAwesomeFontId = -1; // restore the font-awesome id
  983 + return false;
  984 + }
  985 +
  986 + // intialize the map
  987 + QHash<QString, int> &m = namedCodepoints_;
  988 + for (unsigned i = 0; i < sizeof(faNameIconArray) / sizeof(FANameIcon); ++i) {
  989 + m.insert(faNameIconArray[i].name, faNameIconArray[i].icon);
  990 + }
  991 +
  992 + return true;
  993 +}
  994 +
  995 +void QtAwesome::addNamedCodepoint(const QString &name, int codePoint) { namedCodepoints_.insert(name, codePoint); }
  996 +
  997 +/// Sets a default option. These options are passed on to the icon painters
  998 +void QtAwesome::setDefaultOption(const QString &name, const QVariant &value) { defaultOptions_.insert(name, value); }
  999 +
  1000 +/// Returns the default option for the given name
  1001 +QVariant QtAwesome::defaultOption(const QString &name) { return defaultOptions_.value(name); }
  1002 +
  1003 +// internal helper method to merge to option amps
  1004 +static QVariantMap mergeOptions(const QVariantMap &defaults, const QVariantMap &override) {
  1005 + QVariantMap result = defaults;
  1006 + if (!override.isEmpty()) {
  1007 + QMapIterator<QString, QVariant> itr(override);
  1008 + while (itr.hasNext()) {
  1009 + itr.next();
  1010 + result.insert(itr.key(), itr.value());
  1011 + }
  1012 + }
  1013 + return result;
  1014 +}
  1015 +
  1016 +/// Creates an icon with the given code-point
  1017 +/// <code>
  1018 +/// awesome->icon( icon_group )
  1019 +/// </code>
  1020 +QIcon QtAwesome::icon(int character, const QVariantMap &options) {
  1021 + // create a merged QVariantMap to have default options and icon-specific options
  1022 + QVariantMap optionMap = mergeOptions(defaultOptions_, options);
  1023 + if (!optionMap.contains("text")) optionMap.insert("text", QChar(character));
  1024 + if (!optionMap.contains("text-active")) optionMap.insert("text-active", QChar(character));
  1025 + if (!optionMap.contains("text-selected")) optionMap.insert("text-selected", QChar(character));
  1026 + if (!optionMap.contains("text-disabled")) optionMap.insert("text-disabled", QChar(character));
  1027 + if (!optionMap.contains("text-off")) optionMap.insert("text-off", QChar(character));
  1028 +
  1029 + return icon(fontIconPainter_, optionMap);
  1030 +}
  1031 +
  1032 +/// Creates an icon with the given name
  1033 +///
  1034 +/// You can use the icon names as defined on http://fortawesome.github.io/Font-Awesome/design.html withour the 'icon-'
  1035 +/// prefix
  1036 +/// @param name the name of the icon
  1037 +/// @param options extra option to pass to the icon renderer
  1038 +QIcon QtAwesome::icon(const QString &name, const QVariantMap &options) {
  1039 + // when it's a named codepoint
  1040 + if (namedCodepoints_.count(name)) { return icon(namedCodepoints_.value(name), options); }
  1041 +
  1042 + // create a merged QVariantMap to have default options and icon-specific options
  1043 + QVariantMap optionMap = mergeOptions(defaultOptions_, options);
  1044 +
  1045 + // this method first tries to retrieve the icon
  1046 + QtAwesomeIconPainter *painter = painterMap_.value(name);
  1047 + if (!painter) { return QIcon(); }
  1048 +
  1049 + return icon(painter, optionMap);
  1050 +}
  1051 +
  1052 +/// Create a dynamic icon by simlpy supplying a painter object
  1053 +/// The ownership of the painter is NOT transfered.
  1054 +/// @param painter a dynamic painter that is going to paint the icon
  1055 +/// @param optionmap the options to pass to the painter
  1056 +QIcon QtAwesome::icon(QtAwesomeIconPainter *painter, const QVariantMap &optionMap) {
  1057 + // Warning, when you use memoryleak detection. You should turn it of for the next call
  1058 + // QIcon's placed in gui items are often cached and not deleted when my memory-leak detection checks for leaks.
  1059 + // I'm not sure if it's a Qt bug or something I do wrong
  1060 + QtAwesomeIconPainterIconEngine *engine = new QtAwesomeIconPainterIconEngine(this, painter, optionMap);
  1061 + return QIcon(engine);
  1062 +}
  1063 +
  1064 +/// Adds a named icon-painter to the QtAwesome icon map
  1065 +/// As the name applies the ownership is passed over to QtAwesome
  1066 +///
  1067 +/// @param name the name of the icon
  1068 +/// @param painter the icon painter to add for this name
  1069 +void QtAwesome::give(const QString &name, QtAwesomeIconPainter *painter) {
  1070 + delete painterMap_.value(name); // delete the old one
  1071 + painterMap_.insert(name, painter);
  1072 +}
  1073 +
  1074 +/// Creates/Gets the icon font with a given size in pixels. This can be usefull to use a label for displaying icons
  1075 +/// Example:
  1076 +///
  1077 +/// QLabel* label = new QLabel( QChar( icon_group ) );
  1078 +/// label->setFont( awesome->font(16) )
  1079 +QFont QtAwesome::font(int size) {
  1080 + QFont font(fontName_);
  1081 + font.setPixelSize(size);
  1082 + return font;
  1083 +}
... ...
openhantek/src/iconfont/QtAwesome.h 0 → 100644
  1 +/**
  2 + * QtAwesome - use font-awesome (or other font icons) in your c++ / Qt Application
  3 + *
  4 + * MIT Licensed
  5 + *
  6 + * Copyright 2013-2015 - Reliable Bits Software by Blommers IT. All Rights Reserved.
  7 + * Author Rick Blommers
  8 + */
  9 +
  10 +#ifndef QTAWESOME_H
  11 +#define QTAWESOME_H
  12 +
  13 +#include "QtAwesomeAnim.h"
  14 +
  15 +#include <QIcon>
  16 +#include <QIconEngine>
  17 +#include <QPainter>
  18 +#include <QRect>
  19 +#include <QVariantMap>
  20 +
  21 +
  22 +/// A list of all icon-names with the codepoint (unicode-value) on the right
  23 +/// You can use the names on the page http://fortawesome.github.io/Font-Awesome/design.html
  24 +namespace fa {
  25 + enum icon {
  26 + fa_500px = 0xf26e,
  27 + addressbook = 0xf2b9,
  28 + addressbooko = 0xf2ba,
  29 + addresscard = 0xf2bb,
  30 + addresscardo = 0xf2bc,
  31 + adjust = 0xf042,
  32 + adn = 0xf170,
  33 + aligncenter = 0xf037,
  34 + alignjustify = 0xf039,
  35 + alignleft = 0xf036,
  36 + alignright = 0xf038,
  37 + amazon = 0xf270,
  38 + ambulance = 0xf0f9,
  39 + americansignlanguageinterpreting = 0xf2a3,
  40 + anchor = 0xf13d,
  41 + android = 0xf17b,
  42 + angellist = 0xf209,
  43 + angledoubledown = 0xf103,
  44 + angledoubleleft = 0xf100,
  45 + angledoubleright = 0xf101,
  46 + angledoubleup = 0xf102,
  47 + angledown = 0xf107,
  48 + angleleft = 0xf104,
  49 + angleright = 0xf105,
  50 + angleup = 0xf106,
  51 + apple = 0xf179,
  52 + archive = 0xf187,
  53 + areachart = 0xf1fe,
  54 + arrowcircledown = 0xf0ab,
  55 + arrowcircleleft = 0xf0a8,
  56 + arrowcircleodown = 0xf01a,
  57 + arrowcircleoleft = 0xf190,
  58 + arrowcircleoright = 0xf18e,
  59 + arrowcircleoup = 0xf01b,
  60 + arrowcircleright = 0xf0a9,
  61 + arrowcircleup = 0xf0aa,
  62 + arrowdown = 0xf063,
  63 + arrowleft = 0xf060,
  64 + arrowright = 0xf061,
  65 + arrowup = 0xf062,
  66 + arrows = 0xf047,
  67 + arrowsalt = 0xf0b2,
  68 + arrowsh = 0xf07e,
  69 + arrowsv = 0xf07d,
  70 + aslinterpreting = 0xf2a3,
  71 + assistivelisteningsystems = 0xf2a2,
  72 + asterisk = 0xf069,
  73 + at = 0xf1fa,
  74 + audiodescription = 0xf29e,
  75 + automobile = 0xf1b9,
  76 + backward = 0xf04a,
  77 + balancescale = 0xf24e,
  78 + ban = 0xf05e,
  79 + bandcamp = 0xf2d5,
  80 + bank = 0xf19c,
  81 + barchart = 0xf080,
  82 + barcharto = 0xf080,
  83 + barcode = 0xf02a,
  84 + bars = 0xf0c9,
  85 + bath = 0xf2cd,
  86 + bathtub = 0xf2cd,
  87 + battery = 0xf240,
  88 + battery0 = 0xf244,
  89 + battery1 = 0xf243,
  90 + battery2 = 0xf242,
  91 + battery3 = 0xf241,
  92 + battery4 = 0xf240,
  93 + batteryempty = 0xf244,
  94 + batteryfull = 0xf240,
  95 + batteryhalf = 0xf242,
  96 + batteryquarter = 0xf243,
  97 + batterythreequarters = 0xf241,
  98 + bed = 0xf236,
  99 + beer = 0xf0fc,
  100 + behance = 0xf1b4,
  101 + behancesquare = 0xf1b5,
  102 + bell = 0xf0f3,
  103 + bello = 0xf0a2,
  104 + bellslash = 0xf1f6,
  105 + bellslasho = 0xf1f7,
  106 + bicycle = 0xf206,
  107 + binoculars = 0xf1e5,
  108 + birthdaycake = 0xf1fd,
  109 + bitbucket = 0xf171,
  110 + bitbucketsquare = 0xf172,
  111 + bitcoin = 0xf15a,
  112 + blacktie = 0xf27e,
  113 + blind = 0xf29d,
  114 + bluetooth = 0xf293,
  115 + bluetoothb = 0xf294,
  116 + bold = 0xf032,
  117 + bolt = 0xf0e7,
  118 + bomb = 0xf1e2,
  119 + book = 0xf02d,
  120 + bookmark = 0xf02e,
  121 + bookmarko = 0xf097,
  122 + braille = 0xf2a1,
  123 + briefcase = 0xf0b1,
  124 + btc = 0xf15a,
  125 + bug = 0xf188,
  126 + building = 0xf1ad,
  127 + buildingo = 0xf0f7,
  128 + bullhorn = 0xf0a1,
  129 + bullseye = 0xf140,
  130 + bus = 0xf207,
  131 + buysellads = 0xf20d,
  132 + cab = 0xf1ba,
  133 + calculator = 0xf1ec,
  134 + calendar = 0xf073,
  135 + calendarchecko = 0xf274,
  136 + calendarminuso = 0xf272,
  137 + calendaro = 0xf133,
  138 + calendarpluso = 0xf271,
  139 + calendartimeso = 0xf273,
  140 + camera = 0xf030,
  141 + cameraretro = 0xf083,
  142 + car = 0xf1b9,
  143 + caretdown = 0xf0d7,
  144 + caretleft = 0xf0d9,
  145 + caretright = 0xf0da,
  146 + caretsquareodown = 0xf150,
  147 + caretsquareoleft = 0xf191,
  148 + caretsquareoright = 0xf152,
  149 + caretsquareoup = 0xf151,
  150 + caretup = 0xf0d8,
  151 + cartarrowdown = 0xf218,
  152 + cartplus = 0xf217,
  153 + cc = 0xf20a,
  154 + ccamex = 0xf1f3,
  155 + ccdinersclub = 0xf24c,
  156 + ccdiscover = 0xf1f2,
  157 + ccjcb = 0xf24b,
  158 + ccmastercard = 0xf1f1,
  159 + ccpaypal = 0xf1f4,
  160 + ccstripe = 0xf1f5,
  161 + ccvisa = 0xf1f0,
  162 + certificate = 0xf0a3,
  163 + chain = 0xf0c1,
  164 + chainbroken = 0xf127,
  165 + check = 0xf00c,
  166 + checkcircle = 0xf058,
  167 + checkcircleo = 0xf05d,
  168 + checksquare = 0xf14a,
  169 + checksquareo = 0xf046,
  170 + chevroncircledown = 0xf13a,
  171 + chevroncircleleft = 0xf137,
  172 + chevroncircleright = 0xf138,
  173 + chevroncircleup = 0xf139,
  174 + chevrondown = 0xf078,
  175 + chevronleft = 0xf053,
  176 + chevronright = 0xf054,
  177 + chevronup = 0xf077,
  178 + child = 0xf1ae,
  179 + chrome = 0xf268,
  180 + circle = 0xf111,
  181 + circleo = 0xf10c,
  182 + circleonotch = 0xf1ce,
  183 + circlethin = 0xf1db,
  184 + clipboard = 0xf0ea,
  185 + clocko = 0xf017,
  186 + clone = 0xf24d,
  187 + close = 0xf00d,
  188 + cloud = 0xf0c2,
  189 + clouddownload = 0xf0ed,
  190 + cloudupload = 0xf0ee,
  191 + cny = 0xf157,
  192 + code = 0xf121,
  193 + codefork = 0xf126,
  194 + codepen = 0xf1cb,
  195 + codiepie = 0xf284,
  196 + coffee = 0xf0f4,
  197 + cog = 0xf013,
  198 + cogs = 0xf085,
  199 + columns = 0xf0db,
  200 + comment = 0xf075,
  201 + commento = 0xf0e5,
  202 + commenting = 0xf27a,
  203 + commentingo = 0xf27b,
  204 + comments = 0xf086,
  205 + commentso = 0xf0e6,
  206 + compass = 0xf14e,
  207 + compress = 0xf066,
  208 + connectdevelop = 0xf20e,
  209 + contao = 0xf26d,
  210 + copy = 0xf0c5,
  211 + copyright = 0xf1f9,
  212 + creativecommons = 0xf25e,
  213 + creditcard = 0xf09d,
  214 + creditcardalt = 0xf283,
  215 + crop = 0xf125,
  216 + crosshairs = 0xf05b,
  217 + css3 = 0xf13c,
  218 + cube = 0xf1b2,
  219 + cubes = 0xf1b3,
  220 + cut = 0xf0c4,
  221 + cutlery = 0xf0f5,
  222 + dashboard = 0xf0e4,
  223 + dashcube = 0xf210,
  224 + database = 0xf1c0,
  225 + deaf = 0xf2a4,
  226 + deafness = 0xf2a4,
  227 + dedent = 0xf03b,
  228 + delicious = 0xf1a5,
  229 + desktop = 0xf108,
  230 + deviantart = 0xf1bd,
  231 + diamond = 0xf219,
  232 + digg = 0xf1a6,
  233 + dollar = 0xf155,
  234 + dotcircleo = 0xf192,
  235 + download = 0xf019,
  236 + dribbble = 0xf17d,
  237 + driverslicense = 0xf2c2,
  238 + driverslicenseo = 0xf2c3,
  239 + dropbox = 0xf16b,
  240 + drupal = 0xf1a9,
  241 + edge = 0xf282,
  242 + edit = 0xf044,
  243 + eercast = 0xf2da,
  244 + eject = 0xf052,
  245 + ellipsish = 0xf141,
  246 + ellipsisv = 0xf142,
  247 + empire = 0xf1d1,
  248 + envelope = 0xf0e0,
  249 + envelopeo = 0xf003,
  250 + envelopeopen = 0xf2b6,
  251 + envelopeopeno = 0xf2b7,
  252 + envelopesquare = 0xf199,
  253 + envira = 0xf299,
  254 + eraser = 0xf12d,
  255 + etsy = 0xf2d7,
  256 + eur = 0xf153,
  257 + euro = 0xf153,
  258 + exchange = 0xf0ec,
  259 + exclamation = 0xf12a,
  260 + exclamationcircle = 0xf06a,
  261 + exclamationtriangle = 0xf071,
  262 + expand = 0xf065,
  263 + expeditedssl = 0xf23e,
  264 + externallink = 0xf08e,
  265 + externallinksquare = 0xf14c,
  266 + eye = 0xf06e,
  267 + eyeslash = 0xf070,
  268 + eyedropper = 0xf1fb,
  269 + fa = 0xf2b4,
  270 + facebook = 0xf09a,
  271 + facebookf = 0xf09a,
  272 + facebookofficial = 0xf230,
  273 + facebooksquare = 0xf082,
  274 + fastbackward = 0xf049,
  275 + fastforward = 0xf050,
  276 + fax = 0xf1ac,
  277 + feed = 0xf09e,
  278 + female = 0xf182,
  279 + fighterjet = 0xf0fb,
  280 + file = 0xf15b,
  281 + filearchiveo = 0xf1c6,
  282 + fileaudioo = 0xf1c7,
  283 + filecodeo = 0xf1c9,
  284 + fileexcelo = 0xf1c3,
  285 + fileimageo = 0xf1c5,
  286 + filemovieo = 0xf1c8,
  287 + fileo = 0xf016,
  288 + filepdfo = 0xf1c1,
  289 + filephotoo = 0xf1c5,
  290 + filepictureo = 0xf1c5,
  291 + filepowerpointo = 0xf1c4,
  292 + filesoundo = 0xf1c7,
  293 + filetext = 0xf15c,
  294 + filetexto = 0xf0f6,
  295 + filevideoo = 0xf1c8,
  296 + filewordo = 0xf1c2,
  297 + filezipo = 0xf1c6,
  298 + fileso = 0xf0c5,
  299 + film = 0xf008,
  300 + filter = 0xf0b0,
  301 + fire = 0xf06d,
  302 + fireextinguisher = 0xf134,
  303 + firefox = 0xf269,
  304 + firstorder = 0xf2b0,
  305 + flag = 0xf024,
  306 + flagcheckered = 0xf11e,
  307 + flago = 0xf11d,
  308 + flash = 0xf0e7,
  309 + flask = 0xf0c3,
  310 + flickr = 0xf16e,
  311 + floppyo = 0xf0c7,
  312 + folder = 0xf07b,
  313 + foldero = 0xf114,
  314 + folderopen = 0xf07c,
  315 + folderopeno = 0xf115,
  316 + font = 0xf031,
  317 + fontawesome = 0xf2b4,
  318 + fonticons = 0xf280,
  319 + fortawesome = 0xf286,
  320 + forumbee = 0xf211,
  321 + forward = 0xf04e,
  322 + foursquare = 0xf180,
  323 + freecodecamp = 0xf2c5,
  324 + frowno = 0xf119,
  325 + futbolo = 0xf1e3,
  326 + gamepad = 0xf11b,
  327 + gavel = 0xf0e3,
  328 + gbp = 0xf154,
  329 + ge = 0xf1d1,
  330 + gear = 0xf013,
  331 + gears = 0xf085,
  332 + genderless = 0xf22d,
  333 + getpocket = 0xf265,
  334 + gg = 0xf260,
  335 + ggcircle = 0xf261,
  336 + gift = 0xf06b,
  337 + git = 0xf1d3,
  338 + gitsquare = 0xf1d2,
  339 + github = 0xf09b,
  340 + githubalt = 0xf113,
  341 + githubsquare = 0xf092,
  342 + gitlab = 0xf296,
  343 + gittip = 0xf184,
  344 + glass = 0xf000,
  345 + glide = 0xf2a5,
  346 + glideg = 0xf2a6,
  347 + globe = 0xf0ac,
  348 + google = 0xf1a0,
  349 + googleplus = 0xf0d5,
  350 + googlepluscircle = 0xf2b3,
  351 + googleplusofficial = 0xf2b3,
  352 + googleplussquare = 0xf0d4,
  353 + googlewallet = 0xf1ee,
  354 + graduationcap = 0xf19d,
  355 + gratipay = 0xf184,
  356 + grav = 0xf2d6,
  357 + group = 0xf0c0,
  358 + hsquare = 0xf0fd,
  359 + hackernews = 0xf1d4,
  360 + handgrabo = 0xf255,
  361 + handlizardo = 0xf258,
  362 + handodown = 0xf0a7,
  363 + handoleft = 0xf0a5,
  364 + handoright = 0xf0a4,
  365 + handoup = 0xf0a6,
  366 + handpapero = 0xf256,
  367 + handpeaceo = 0xf25b,
  368 + handpointero = 0xf25a,
  369 + handrocko = 0xf255,
  370 + handscissorso = 0xf257,
  371 + handspocko = 0xf259,
  372 + handstopo = 0xf256,
  373 + handshakeo = 0xf2b5,
  374 + hardofhearing = 0xf2a4,
  375 + hashtag = 0xf292,
  376 + hddo = 0xf0a0,
  377 + header = 0xf1dc,
  378 + headphones = 0xf025,
  379 + heart = 0xf004,
  380 + hearto = 0xf08a,
  381 + heartbeat = 0xf21e,
  382 + history = 0xf1da,
  383 + home = 0xf015,
  384 + hospitalo = 0xf0f8,
  385 + hotel = 0xf236,
  386 + hourglass = 0xf254,
  387 + hourglass1 = 0xf251,
  388 + hourglass2 = 0xf252,
  389 + hourglass3 = 0xf253,
  390 + hourglassend = 0xf253,
  391 + hourglasshalf = 0xf252,
  392 + hourglasso = 0xf250,
  393 + hourglassstart = 0xf251,
  394 + houzz = 0xf27c,
  395 + html5 = 0xf13b,
  396 + icursor = 0xf246,
  397 + idbadge = 0xf2c1,
  398 + idcard = 0xf2c2,
  399 + idcardo = 0xf2c3,
  400 + ils = 0xf20b,
  401 + image = 0xf03e,
  402 + imdb = 0xf2d8,
  403 + inbox = 0xf01c,
  404 + indent = 0xf03c,
  405 + industry = 0xf275,
  406 + info = 0xf129,
  407 + infocircle = 0xf05a,
  408 + inr = 0xf156,
  409 + instagram = 0xf16d,
  410 + institution = 0xf19c,
  411 + internetexplorer = 0xf26b,
  412 + intersex = 0xf224,
  413 + ioxhost = 0xf208,
  414 + italic = 0xf033,
  415 + joomla = 0xf1aa,
  416 + jpy = 0xf157,
  417 + jsfiddle = 0xf1cc,
  418 + key = 0xf084,
  419 + keyboardo = 0xf11c,
  420 + krw = 0xf159,
  421 + language = 0xf1ab,
  422 + laptop = 0xf109,
  423 + lastfm = 0xf202,
  424 + lastfmsquare = 0xf203,
  425 + leaf = 0xf06c,
  426 + leanpub = 0xf212,
  427 + legal = 0xf0e3,
  428 + lemono = 0xf094,
  429 + leveldown = 0xf149,
  430 + levelup = 0xf148,
  431 + lifebouy = 0xf1cd,
  432 + lifebuoy = 0xf1cd,
  433 + lifering = 0xf1cd,
  434 + lifesaver = 0xf1cd,
  435 + lightbulbo = 0xf0eb,
  436 + linechart = 0xf201,
  437 + link = 0xf0c1,
  438 + linkedin = 0xf0e1,
  439 + linkedinsquare = 0xf08c,
  440 + linode = 0xf2b8,
  441 + fa_linux = 0xf17c,
  442 + list = 0xf03a,
  443 + listalt = 0xf022,
  444 + listol = 0xf0cb,
  445 + listul = 0xf0ca,
  446 + locationarrow = 0xf124,
  447 + lock = 0xf023,
  448 + longarrowdown = 0xf175,
  449 + longarrowleft = 0xf177,
  450 + longarrowright = 0xf178,
  451 + longarrowup = 0xf176,
  452 + lowvision = 0xf2a8,
  453 + magic = 0xf0d0,
  454 + magnet = 0xf076,
  455 + mailforward = 0xf064,
  456 + mailreply = 0xf112,
  457 + mailreplyall = 0xf122,
  458 + male = 0xf183,
  459 + map = 0xf279,
  460 + mapmarker = 0xf041,
  461 + mapo = 0xf278,
  462 + mappin = 0xf276,
  463 + mapsigns = 0xf277,
  464 + mars = 0xf222,
  465 + marsdouble = 0xf227,
  466 + marsstroke = 0xf229,
  467 + marsstrokeh = 0xf22b,
  468 + marsstrokev = 0xf22a,
  469 + maxcdn = 0xf136,
  470 + meanpath = 0xf20c,
  471 + medium = 0xf23a,
  472 + medkit = 0xf0fa,
  473 + meetup = 0xf2e0,
  474 + meho = 0xf11a,
  475 + mercury = 0xf223,
  476 + microchip = 0xf2db,
  477 + microphone = 0xf130,
  478 + microphoneslash = 0xf131,
  479 + minus = 0xf068,
  480 + minuscircle = 0xf056,
  481 + minussquare = 0xf146,
  482 + minussquareo = 0xf147,
  483 + mixcloud = 0xf289,
  484 + mobile = 0xf10b,
  485 + mobilephone = 0xf10b,
  486 + modx = 0xf285,
  487 + money = 0xf0d6,
  488 + moono = 0xf186,
  489 + mortarboard = 0xf19d,
  490 + motorcycle = 0xf21c,
  491 + mousepointer = 0xf245,
  492 + music = 0xf001,
  493 + navicon = 0xf0c9,
  494 + neuter = 0xf22c,
  495 + newspapero = 0xf1ea,
  496 + objectgroup = 0xf247,
  497 + objectungroup = 0xf248,
  498 + odnoklassniki = 0xf263,
  499 + odnoklassnikisquare = 0xf264,
  500 + opencart = 0xf23d,
  501 + openid = 0xf19b,
  502 + opera = 0xf26a,
  503 + optinmonster = 0xf23c,
  504 + outdent = 0xf03b,
  505 + pagelines = 0xf18c,
  506 + paintbrush = 0xf1fc,
  507 + paperplane = 0xf1d8,
  508 + paperplaneo = 0xf1d9,
  509 + paperclip = 0xf0c6,
  510 + paragraph = 0xf1dd,
  511 + paste = 0xf0ea,
  512 + pause = 0xf04c,
  513 + pausecircle = 0xf28b,
  514 + pausecircleo = 0xf28c,
  515 + paw = 0xf1b0,
  516 + paypal = 0xf1ed,
  517 + pencil = 0xf040,
  518 + pencilsquare = 0xf14b,
  519 + pencilsquareo = 0xf044,
  520 + percent = 0xf295,
  521 + phone = 0xf095,
  522 + phonesquare = 0xf098,
  523 + photo = 0xf03e,
  524 + pictureo = 0xf03e,
  525 + piechart = 0xf200,
  526 + piedpiper = 0xf2ae,
  527 + piedpiperalt = 0xf1a8,
  528 + piedpiperpp = 0xf1a7,
  529 + pinterest = 0xf0d2,
  530 + pinterestp = 0xf231,
  531 + pinterestsquare = 0xf0d3,
  532 + plane = 0xf072,
  533 + play = 0xf04b,
  534 + playcircle = 0xf144,
  535 + playcircleo = 0xf01d,
  536 + plug = 0xf1e6,
  537 + plus = 0xf067,
  538 + pluscircle = 0xf055,
  539 + plussquare = 0xf0fe,
  540 + plussquareo = 0xf196,
  541 + podcast = 0xf2ce,
  542 + poweroff = 0xf011,
  543 + print = 0xf02f,
  544 + producthunt = 0xf288,
  545 + puzzlepiece = 0xf12e,
  546 + qq = 0xf1d6,
  547 + qrcode = 0xf029,
  548 + question = 0xf128,
  549 + questioncircle = 0xf059,
  550 + questioncircleo = 0xf29c,
  551 + quora = 0xf2c4,
  552 + quoteleft = 0xf10d,
  553 + quoteright = 0xf10e,
  554 + ra = 0xf1d0,
  555 + random = 0xf074,
  556 + ravelry = 0xf2d9,
  557 + rebel = 0xf1d0,
  558 + recycle = 0xf1b8,
  559 + reddit = 0xf1a1,
  560 + redditalien = 0xf281,
  561 + redditsquare = 0xf1a2,
  562 + refresh = 0xf021,
  563 + registered = 0xf25d,
  564 + remove = 0xf00d,
  565 + renren = 0xf18b,
  566 + reorder = 0xf0c9,
  567 + repeat = 0xf01e,
  568 + reply = 0xf112,
  569 + replyall = 0xf122,
  570 + resistance = 0xf1d0,
  571 + retweet = 0xf079,
  572 + rmb = 0xf157,
  573 + road = 0xf018,
  574 + rocket = 0xf135,
  575 + rotateleft = 0xf0e2,
  576 + rotateright = 0xf01e,
  577 + rouble = 0xf158,
  578 + rss = 0xf09e,
  579 + rsssquare = 0xf143,
  580 + rub = 0xf158,
  581 + ruble = 0xf158,
  582 + rupee = 0xf156,
  583 + s15 = 0xf2cd,
  584 + safari = 0xf267,
  585 + save = 0xf0c7,
  586 + scissors = 0xf0c4,
  587 + scribd = 0xf28a,
  588 + search = 0xf002,
  589 + searchminus = 0xf010,
  590 + searchplus = 0xf00e,
  591 + sellsy = 0xf213,
  592 + send = 0xf1d8,
  593 + sendo = 0xf1d9,
  594 + server = 0xf233,
  595 + share = 0xf064,
  596 + sharealt = 0xf1e0,
  597 + sharealtsquare = 0xf1e1,
  598 + sharesquare = 0xf14d,
  599 + sharesquareo = 0xf045,
  600 + shekel = 0xf20b,
  601 + sheqel = 0xf20b,
  602 + shield = 0xf132,
  603 + ship = 0xf21a,
  604 + shirtsinbulk = 0xf214,
  605 + shoppingbag = 0xf290,
  606 + shoppingbasket = 0xf291,
  607 + shoppingcart = 0xf07a,
  608 + shower = 0xf2cc,
  609 + signin = 0xf090,
  610 + signlanguage = 0xf2a7,
  611 + signout = 0xf08b,
  612 + signal = 0xf012,
  613 + signing = 0xf2a7,
  614 + simplybuilt = 0xf215,
  615 + sitemap = 0xf0e8,
  616 + skyatlas = 0xf216,
  617 + skype = 0xf17e,
  618 + slack = 0xf198,
  619 + sliders = 0xf1de,
  620 + slideshare = 0xf1e7,
  621 + smileo = 0xf118,
  622 + snapchat = 0xf2ab,
  623 + snapchatghost = 0xf2ac,
  624 + snapchatsquare = 0xf2ad,
  625 + snowflakeo = 0xf2dc,
  626 + soccerballo = 0xf1e3,
  627 + sort = 0xf0dc,
  628 + sortalphaasc = 0xf15d,
  629 + sortalphadesc = 0xf15e,
  630 + sortamountasc = 0xf160,
  631 + sortamountdesc = 0xf161,
  632 + sortasc = 0xf0de,
  633 + sortdesc = 0xf0dd,
  634 + sortdown = 0xf0dd,
  635 + sortnumericasc = 0xf162,
  636 + sortnumericdesc = 0xf163,
  637 + sortup = 0xf0de,
  638 + soundcloud = 0xf1be,
  639 + spaceshuttle = 0xf197,
  640 + spinner = 0xf110,
  641 + spoon = 0xf1b1,
  642 + spotify = 0xf1bc,
  643 + square = 0xf0c8,
  644 + squareo = 0xf096,
  645 + stackexchange = 0xf18d,
  646 + stackoverflow = 0xf16c,
  647 + star = 0xf005,
  648 + starhalf = 0xf089,
  649 + starhalfempty = 0xf123,
  650 + starhalffull = 0xf123,
  651 + starhalfo = 0xf123,
  652 + staro = 0xf006,
  653 + steam = 0xf1b6,
  654 + steamsquare = 0xf1b7,
  655 + stepbackward = 0xf048,
  656 + stepforward = 0xf051,
  657 + stethoscope = 0xf0f1,
  658 + stickynote = 0xf249,
  659 + stickynoteo = 0xf24a,
  660 + stop = 0xf04d,
  661 + stopcircle = 0xf28d,
  662 + stopcircleo = 0xf28e,
  663 + streetview = 0xf21d,
  664 + strikethrough = 0xf0cc,
  665 + stumbleupon = 0xf1a4,
  666 + stumbleuponcircle = 0xf1a3,
  667 + subscript = 0xf12c,
  668 + subway = 0xf239,
  669 + suitcase = 0xf0f2,
  670 + suno = 0xf185,
  671 + superpowers = 0xf2dd,
  672 + superscript = 0xf12b,
  673 + support = 0xf1cd,
  674 + table = 0xf0ce,
  675 + tablet = 0xf10a,
  676 + tachometer = 0xf0e4,
  677 + tag = 0xf02b,
  678 + tags = 0xf02c,
  679 + tasks = 0xf0ae,
  680 + taxi = 0xf1ba,
  681 + telegram = 0xf2c6,
  682 + television = 0xf26c,
  683 + tencentweibo = 0xf1d5,
  684 + terminal = 0xf120,
  685 + textheight = 0xf034,
  686 + textwidth = 0xf035,
  687 + th = 0xf00a,
  688 + thlarge = 0xf009,
  689 + thlist = 0xf00b,
  690 + themeisle = 0xf2b2,
  691 + thermometer = 0xf2c7,
  692 + thermometer0 = 0xf2cb,
  693 + thermometer1 = 0xf2ca,
  694 + thermometer2 = 0xf2c9,
  695 + thermometer3 = 0xf2c8,
  696 + thermometer4 = 0xf2c7,
  697 + thermometerempty = 0xf2cb,
  698 + thermometerfull = 0xf2c7,
  699 + thermometerhalf = 0xf2c9,
  700 + thermometerquarter = 0xf2ca,
  701 + thermometerthreequarters = 0xf2c8,
  702 + thumbtack = 0xf08d,
  703 + thumbsdown = 0xf165,
  704 + thumbsodown = 0xf088,
  705 + thumbsoup = 0xf087,
  706 + thumbsup = 0xf164,
  707 + ticket = 0xf145,
  708 + times = 0xf00d,
  709 + timescircle = 0xf057,
  710 + timescircleo = 0xf05c,
  711 + timesrectangle = 0xf2d3,
  712 + timesrectangleo = 0xf2d4,
  713 + tint = 0xf043,
  714 + toggledown = 0xf150,
  715 + toggleleft = 0xf191,
  716 + toggleoff = 0xf204,
  717 + toggleon = 0xf205,
  718 + toggleright = 0xf152,
  719 + toggleup = 0xf151,
  720 + trademark = 0xf25c,
  721 + train = 0xf238,
  722 + transgender = 0xf224,
  723 + transgenderalt = 0xf225,
  724 + trash = 0xf1f8,
  725 + trasho = 0xf014,
  726 + tree = 0xf1bb,
  727 + trello = 0xf181,
  728 + tripadvisor = 0xf262,
  729 + trophy = 0xf091,
  730 + truck = 0xf0d1,
  731 + fa_try = 0xf195,
  732 + tty = 0xf1e4,
  733 + tumblr = 0xf173,
  734 + tumblrsquare = 0xf174,
  735 + turkishlira = 0xf195,
  736 + tv = 0xf26c,
  737 + twitch = 0xf1e8,
  738 + twitter = 0xf099,
  739 + twittersquare = 0xf081,
  740 + umbrella = 0xf0e9,
  741 + underline = 0xf0cd,
  742 + undo = 0xf0e2,
  743 + universalaccess = 0xf29a,
  744 + university = 0xf19c,
  745 + unlink = 0xf127,
  746 + unlock = 0xf09c,
  747 + unlockalt = 0xf13e,
  748 + unsorted = 0xf0dc,
  749 + upload = 0xf093,
  750 + usb = 0xf287,
  751 + usd = 0xf155,
  752 + user = 0xf007,
  753 + usercircle = 0xf2bd,
  754 + usercircleo = 0xf2be,
  755 + usermd = 0xf0f0,
  756 + usero = 0xf2c0,
  757 + userplus = 0xf234,
  758 + usersecret = 0xf21b,
  759 + usertimes = 0xf235,
  760 + users = 0xf0c0,
  761 + vcard = 0xf2bb,
  762 + vcardo = 0xf2bc,
  763 + venus = 0xf221,
  764 + venusdouble = 0xf226,
  765 + venusmars = 0xf228,
  766 + viacoin = 0xf237,
  767 + viadeo = 0xf2a9,
  768 + viadeosquare = 0xf2aa,
  769 + videocamera = 0xf03d,
  770 + vimeo = 0xf27d,
  771 + vimeosquare = 0xf194,
  772 + vine = 0xf1ca,
  773 + vk = 0xf189,
  774 + volumecontrolphone = 0xf2a0,
  775 + volumedown = 0xf027,
  776 + volumeoff = 0xf026,
  777 + volumeup = 0xf028,
  778 + warning = 0xf071,
  779 + wechat = 0xf1d7,
  780 + weibo = 0xf18a,
  781 + weixin = 0xf1d7,
  782 + whatsapp = 0xf232,
  783 + wheelchair = 0xf193,
  784 + wheelchairalt = 0xf29b,
  785 + wifi = 0xf1eb,
  786 + wikipediaw = 0xf266,
  787 + windowclose = 0xf2d3,
  788 + windowcloseo = 0xf2d4,
  789 + windowmaximize = 0xf2d0,
  790 + windowminimize = 0xf2d1,
  791 + windowrestore = 0xf2d2,
  792 + windows = 0xf17a,
  793 + won = 0xf159,
  794 + wordpress = 0xf19a,
  795 + wpbeginner = 0xf297,
  796 + wpexplorer = 0xf2de,
  797 + wpforms = 0xf298,
  798 + wrench = 0xf0ad,
  799 + xing = 0xf168,
  800 + xingsquare = 0xf169,
  801 + ycombinator = 0xf23b,
  802 + ycombinatorsquare = 0xf1d4,
  803 + yahoo = 0xf19e,
  804 + yc = 0xf23b,
  805 + ycsquare = 0xf1d4,
  806 + yelp = 0xf1e9,
  807 + yen = 0xf157,
  808 + yoast = 0xf2b1,
  809 + youtube = 0xf167,
  810 + youtubeplay = 0xf16a,
  811 + youtubesquare = 0xf166
  812 + };
  813 +}
  814 +
  815 +
  816 +
  817 +//---------------------------------------------------------------------------------------
  818 +
  819 +class QtAwesomeIconPainter;
  820 +
  821 +/// The main class for managing icons
  822 +/// This class requires a 2-phase construction. You must first create the class and then initialize it via an init* method
  823 +class QtAwesome : public QObject
  824 +{
  825 +Q_OBJECT
  826 +
  827 +public:
  828 +
  829 + explicit QtAwesome(QObject *parent = 0);
  830 + virtual ~QtAwesome();
  831 +
  832 + void init( const QString& fontname );
  833 + bool initFontAwesome();
  834 +
  835 + void addNamedCodepoint( const QString& name, int codePoint );
  836 + QHash<QString,int> namedCodePoints() { return namedCodepoints_; }
  837 +
  838 + void setDefaultOption( const QString& name, const QVariant& value );
  839 + QVariant defaultOption( const QString& name );
  840 +
  841 + QIcon icon( int character, const QVariantMap& options = QVariantMap() );
  842 + QIcon icon( const QString& name, const QVariantMap& options = QVariantMap() );
  843 + QIcon icon(QtAwesomeIconPainter* painter, const QVariantMap& optionMap = QVariantMap() );
  844 +
  845 + void give( const QString& name, QtAwesomeIconPainter* painter );
  846 +
  847 + QFont font( int size );
  848 +
  849 + /// Returns the font-name that is used as icon-map
  850 + QString fontName() { return fontName_ ; }
  851 +
  852 +private:
  853 + QString fontName_; ///< The font name used for this map
  854 + QHash<QString,int> namedCodepoints_; ///< A map with names mapped to code-points
  855 +
  856 + QHash<QString, QtAwesomeIconPainter*> painterMap_; ///< A map of custom painters
  857 + QVariantMap defaultOptions_; ///< The default icon options
  858 + QtAwesomeIconPainter* fontIconPainter_; ///< A special painter fo painting codepoints
  859 +};
  860 +
  861 +
  862 +//---------------------------------------------------------------------------------------
  863 +
  864 +
  865 +/// The QtAwesomeIconPainter is a specialized painter for painting icons
  866 +/// your can implement an iconpainter to create custom font-icon code
  867 +class QtAwesomeIconPainter
  868 +{
  869 +public:
  870 + virtual ~QtAwesomeIconPainter() {}
  871 + virtual void paint( QtAwesome* awesome, QPainter* painter, const QRect& rect, QIcon::Mode mode, QIcon::State state, const QVariantMap& options ) = 0;
  872 +};
  873 +
  874 +Q_DECLARE_METATYPE(QtAwesomeAnimation*)
  875 +
  876 +extern QtAwesome* iconFont;
  877 +
  878 +#endif // QTAWESOME_H
... ...
openhantek/src/iconfont/QtAwesomeAnim.cpp 0 → 100644
  1 +#include "QtAwesomeAnim.h"
  2 +
  3 +#include <QPainter>
  4 +#include <QRect>
  5 +#include <QTimer>
  6 +#include <QWidget>
  7 +#include <cmath>
  8 +
  9 +QtAwesomeAnimation::QtAwesomeAnimation(QWidget *parentWidget, int interval, double step)
  10 + : parentWidgetRef_(parentWidget), timer_(0), interval_(interval), step_(step), angle_(0.0f) {}
  11 +
  12 +void QtAwesomeAnimation::setup(QPainter &painter, const QRect &rect) {
  13 + // first time set the timer
  14 + if (!timer_) {
  15 + timer_ = new QTimer();
  16 + connect(timer_, SIGNAL(timeout()), this, SLOT(update()));
  17 + timer_->start(interval_);
  18 + } else {
  19 + QPen pen = painter.pen();
  20 + pen.setWidth(2);
  21 + pen.setColor(QColor(Qt::gray));
  22 + painter.setPen(pen);
  23 + double val = 1 + sin(angle_) / 2;
  24 + if (val >= 0.5)
  25 + painter.drawArc(rect, 0 * 16, 16 * (360 - (val - 0.5) * 2 * 360));
  26 + else
  27 + painter.drawArc(rect, 0 * 16, 16 * (val * 2) * 360);
  28 + }
  29 +}
  30 +
  31 +void QtAwesomeAnimation::update() {
  32 + angle_ += step_;
  33 + parentWidgetRef_->update();
  34 +}
... ...
openhantek/src/iconfont/QtAwesomeAnim.h 0 → 100644
  1 +#ifndef QTAWESOMEANIMATION_H
  2 +#define QTAWESOMEANIMATION_H
  3 +
  4 +#include <QObject>
  5 +
  6 +class QPainter;
  7 +class QRect;
  8 +class QTimer;
  9 +class QWidget;
  10 +
  11 +///
  12 +/// Basic Animation Support for QtAwesome (Inspired by https://github.com/spyder-ide/qtawesome)
  13 +///
  14 +class QtAwesomeAnimation : public QObject
  15 +{
  16 +Q_OBJECT
  17 +
  18 +public:
  19 + QtAwesomeAnimation( QWidget* parentWidget, int interval=20, double step=0.01);
  20 +
  21 + void setup( QPainter& painter, const QRect& rect );
  22 +
  23 +public slots:
  24 + void update();
  25 +
  26 +private:
  27 + QWidget* parentWidgetRef_;
  28 + QTimer* timer_;
  29 + int interval_;
  30 + double step_;
  31 + double angle_;
  32 +
  33 +};
  34 +
  35 +
  36 +#endif // QTAWESOMEANIMATION_H
... ...
openhantek/src/mainwindow.cpp
1 1 #include "mainwindow.h"
  2 +#include "iconfont/QtAwesome.h"
2 3 #include "ui_mainwindow.h"
3 4  
4 5 #include "HorizontalDock.h"
... ... @@ -11,6 +12,8 @@
11 12 #include "dockwindows.h"
12 13 #include "dsomodel.h"
13 14 #include "dsowidget.h"
  15 +#include "exporting/exporterinterface.h"
  16 +#include "exporting/exporterregistry.h"
14 17 #include "hantekdsocontrol.h"
15 18 #include "usb/usbdevice.h"
16 19 #include "viewconstants.h"
... ... @@ -21,20 +24,43 @@
21 24 #include <QLineEdit>
22 25 #include <QMessageBox>
23 26  
24   -MainWindow::MainWindow(HantekDsoControl *dsoControl, DsoSettings *settings, QWidget *parent)
25   - : QMainWindow(parent), ui(new Ui::MainWindow), mSettings(settings) {
  27 +MainWindow::MainWindow(HantekDsoControl *dsoControl, DsoSettings *settings, ExporterRegistry *exporterRegistry,
  28 + QWidget *parent)
  29 + : QMainWindow(parent), ui(new Ui::MainWindow), mSettings(settings), exporterRegistry(exporterRegistry) {
26 30 ui->setupUi(this);
  31 + ui->actionSave->setIcon(iconFont->icon(fa::save));
  32 + ui->actionAbout->setIcon(iconFont->icon(fa::questioncircle));
  33 + ui->actionOpen->setIcon(iconFont->icon(fa::folderopen));
  34 + ui->actionSampling->setIcon(iconFont->icon(fa::pause,
  35 + {std::make_pair("text-selected-off", QChar(fa::play)),
  36 + std::make_pair("text-off", QChar(fa::play)),
  37 + std::make_pair("text-active-off", QChar(fa::play))}));
  38 + ui->actionSettings->setIcon(iconFont->icon(fa::gear));
  39 + ui->actionManualCommand->setIcon(iconFont->icon(fa::edit));
  40 + ui->actionDigital_phosphor->setIcon(QIcon(":/images/digitalphosphor.svg"));
  41 + ui->actionZoom->setIcon(iconFont->icon(fa::crop));
27 42  
28 43 // Window title
29 44 setWindowIcon(QIcon(":openhantek.png"));
30   - setWindowTitle(tr("OpenHantek - Device %1 - Renderer %2")
31   - .arg(QString::fromStdString(dsoControl->getDevice()->getModel()->name))
32   - .arg(QSurfaceFormat::defaultFormat().renderableType()==QSurfaceFormat::OpenGL?"OpenGL":"OpenGL ES"));
  45 + setWindowTitle(
  46 + tr("OpenHantek - Device %1 - Renderer %2")
  47 + .arg(QString::fromStdString(dsoControl->getDevice()->getModel()->name))
  48 + .arg(QSurfaceFormat::defaultFormat().renderableType() == QSurfaceFormat::OpenGL ? "OpenGL" : "OpenGL ES"));
33 49  
34 50 #if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
35 51 setDockOptions(dockOptions() | QMainWindow::GroupedDragging);
36 52 #endif
37 53  
  54 + for (auto *exporter : *exporterRegistry) {
  55 + QAction *action = new QAction(exporter->icon(), exporter->name(), this);
  56 + action->setCheckable(exporter->type() == ExporterInterface::Type::ContinousExport);
  57 + connect(action, &QAction::triggered, [exporter, exporterRegistry](bool checked) {
  58 + exporterRegistry->setExporterEnabled(
  59 + exporter, exporter->type() == ExporterInterface::Type::ContinousExport ? checked : true);
  60 + });
  61 + ui->menuExport->addAction(action);
  62 + }
  63 +
38 64 DsoSettingsScope *scope = &(mSettings->scope);
39 65 const Dso::ControlSpecification *spec = dsoControl->getDevice()->getModel()->spec();
40 66  
... ... @@ -166,22 +192,19 @@ MainWindow::MainWindow(HantekDsoControl *dsoControl, DsoSettings *settings, QWid
166 192 connect(spectrumDock, &SpectrumDock::magnitudeChanged, dsoWidget, &DsoWidget::updateSpectrumMagnitude);
167 193  
168 194 // Started/stopped signals from oscilloscope
169   - connect(dsoControl, &HantekDsoControl::samplingStarted, [this, dsoControl]() {
170   - this->ui->actionSampling->setText(tr("&Stop"));
171   - this->ui->actionSampling->setIcon(QIcon(":actions/stop.png"));
172   - this->ui->actionSampling->setStatusTip(tr("Stop the oscilloscope"));
173   -
174   - disconnect(this->ui->actionSampling, &QAction::triggered, dsoControl, &HantekDsoControl::startSampling);
175   - connect(this->ui->actionSampling, &QAction::triggered, dsoControl, &HantekDsoControl::stopSampling);
176   - });
177   - connect(dsoControl, &HantekDsoControl::samplingStopped, [this, dsoControl]() {
178   - this->ui->actionSampling->setText(tr("&Start"));
179   - this->ui->actionSampling->setIcon(QIcon(":actions/start.png"));
180   - this->ui->actionSampling->setStatusTip(tr("Start the oscilloscope"));
181   -
182   - disconnect(this->ui->actionSampling, &QAction::triggered, dsoControl, &HantekDsoControl::stopSampling);
183   - connect(this->ui->actionSampling, &QAction::triggered, dsoControl, &HantekDsoControl::startSampling);
  195 + connect(dsoControl, &HantekDsoControl::samplingStatusChanged, [this, dsoControl](bool enabled) {
  196 + QSignalBlocker blocker(this->ui->actionSampling);
  197 + if (enabled) {
  198 + this->ui->actionSampling->setText(tr("&Stop"));
  199 + this->ui->actionSampling->setStatusTip(tr("Stop the oscilloscope"));
  200 + } else {
  201 + this->ui->actionSampling->setText(tr("&Start"));
  202 + this->ui->actionSampling->setStatusTip(tr("Start the oscilloscope"));
  203 + }
  204 + this->ui->actionSampling->setChecked(enabled);
184 205 });
  206 + connect(this->ui->actionSampling, &QAction::triggered, dsoControl, &HantekDsoControl::enableSampling);
  207 + this->ui->actionSampling->setChecked(dsoControl->isSampling());
185 208  
186 209 connect(dsoControl, &HantekDsoControl::availableRecordLengthsChanged, horizontalDock,
187 210 &HorizontalDock::setAvailableRecordLengths);
... ... @@ -211,16 +234,6 @@ MainWindow::MainWindow(HantekDsoControl *dsoControl, DsoSettings *settings, QWid
211 234 mSettings->save();
212 235 });
213 236  
214   - connect(ui->actionPrint, &QAction::triggered, [this, spec]() {
215   - this->dsoWidget->setExporterForNextFrame(
216   - std::unique_ptr<Exporter>(Exporter::createPrintExporter(spec, this->mSettings)));
217   - });
218   -
219   - connect(ui->actionExport, &QAction::triggered, [this, spec]() {
220   - this->dsoWidget->setExporterForNextFrame(
221   - std::unique_ptr<Exporter>(Exporter::createSaveToFileExporter(spec, this->mSettings)));
222   - });
223   -
224 237 connect(ui->actionExit, &QAction::triggered, this, &QWidget::close);
225 238  
226 239 connect(ui->actionSettings, &QAction::triggered, [this]() {
... ... @@ -280,6 +293,12 @@ MainWindow::~MainWindow() { delete ui; }
280 293  
281 294 void MainWindow::showNewData(std::shared_ptr<PPresult> data) { dsoWidget->showNew(data); }
282 295  
  296 +void MainWindow::exporterStatusChanged(const QString &exporterName, const QString &status) {
  297 + ui->statusbar->showMessage(tr("%1: %2").arg(exporterName).arg(status));
  298 +}
  299 +
  300 +void MainWindow::exporterProgressChanged() { exporterRegistry->checkForWaitingExporters(); }
  301 +
283 302 /// \brief Save the settings before exiting.
284 303 /// \param event The close event that should be handled.
285 304 void MainWindow::closeEvent(QCloseEvent *event) {
... ...
openhantek/src/mainwindow.h
1 1 #pragma once
  2 +#include "post/ppresult.h"
2 3 #include <QMainWindow>
3 4 #include <memory>
4   -#include "post/ppresult.h"
5 5  
6 6 class SpectrumGenerator;
7 7 class HantekDsoControl;
8 8 class DsoSettings;
  9 +class ExporterRegistry;
9 10 class DsoWidget;
10 11 class HorizontalDock;
11 12 class TriggerDock;
... ... @@ -19,19 +20,22 @@ class MainWindow;
19 20 /// \brief The main window of the application.
20 21 /// The main window contains the classic oszilloscope-screen and the gui
21 22 /// elements used to control the oszilloscope.
22   -class MainWindow : public QMainWindow
23   -{
  23 +class MainWindow : public QMainWindow {
24 24 Q_OBJECT
25 25  
26   -public:
27   - explicit MainWindow(HantekDsoControl *dsoControl, DsoSettings *mSettings, QWidget *parent = 0);
  26 + public:
  27 + explicit MainWindow(HantekDsoControl *dsoControl, DsoSettings *mSettings, ExporterRegistry *exporterRegistry,
  28 + QWidget *parent = 0);
28 29 ~MainWindow();
29   -public slots:
  30 + public slots:
30 31 void showNewData(std::shared_ptr<PPresult> data);
  32 + void exporterStatusChanged(const QString &exporterName, const QString &status);
  33 + void exporterProgressChanged();
31 34  
32   -protected:
  35 + protected:
33 36 void closeEvent(QCloseEvent *event) override;
34   -private:
  37 +
  38 + private:
35 39 Ui::MainWindow *ui;
36 40  
37 41 // Central widgets
... ... @@ -39,4 +43,5 @@ private:
39 43  
40 44 // Settings used for the whole program
41 45 DsoSettings *mSettings;
  46 + ExporterRegistry *exporterRegistry;
42 47 };
... ...
openhantek/src/mainwindow.ui
... ... @@ -31,9 +31,6 @@
31 31 <addaction name="actionSave"/>
32 32 <addaction name="actionSave_as"/>
33 33 <addaction name="separator"/>
34   - <addaction name="actionPrint"/>
35   - <addaction name="actionExport"/>
36   - <addaction name="separator"/>
37 34 <addaction name="actionExit"/>
38 35 </widget>
39 36 <widget class="QMenu" name="menuView">
... ... @@ -58,7 +55,13 @@
58 55 </property>
59 56 <addaction name="actionAbout"/>
60 57 </widget>
  58 + <widget class="QMenu" name="menuExport">
  59 + <property name="title">
  60 + <string>Export</string>
  61 + </property>
  62 + </widget>
61 63 <addaction name="menuFile"/>
  64 + <addaction name="menuExport"/>
62 65 <addaction name="menuView"/>
63 66 <addaction name="menuOscilloscope"/>
64 67 <addaction name="menuHelp"/>
... ... @@ -76,73 +79,34 @@
76 79 </attribute>
77 80 <addaction name="actionOpen"/>
78 81 <addaction name="actionSave"/>
79   - <addaction name="actionSave_as"/>
80   - <addaction name="separator"/>
81   - <addaction name="actionPrint"/>
82   - <addaction name="actionExport"/>
83 82 <addaction name="separator"/>
84 83 <addaction name="actionSampling"/>
85 84 <addaction name="separator"/>
86 85 <addaction name="actionDigital_phosphor"/>
87 86 <addaction name="actionZoom"/>
  87 + <addaction name="separator"/>
88 88 </widget>
89 89 <action name="actionOpen">
90   - <property name="icon">
91   - <iconset resource="../res/application.qrc">
92   - <normaloff>:/actions/open.png</normaloff>:/actions/open.png</iconset>
93   - </property>
94 90 <property name="text">
95   - <string>Open</string>
  91 + <string>Open layout</string>
96 92 </property>
97 93 <property name="shortcut">
98 94 <string>Ctrl+O</string>
99 95 </property>
100 96 </action>
101 97 <action name="actionSave">
102   - <property name="icon">
103   - <iconset resource="../res/application.qrc">
104   - <normaloff>:/actions/save.png</normaloff>:/actions/save.png</iconset>
105   - </property>
106 98 <property name="text">
107   - <string>Save</string>
  99 + <string>Save layout</string>
108 100 </property>
109 101 <property name="shortcut">
110 102 <string>Ctrl+S</string>
111 103 </property>
112 104 </action>
113 105 <action name="actionSave_as">
114   - <property name="icon">
115   - <iconset resource="../res/application.qrc">
116   - <normaloff>:/actions/save-as.png</normaloff>:/actions/save-as.png</iconset>
117   - </property>
118 106 <property name="text">
119 107 <string>Save as ...</string>
120 108 </property>
121 109 </action>
122   - <action name="actionPrint">
123   - <property name="icon">
124   - <iconset resource="../res/application.qrc">
125   - <normaloff>:/actions/print.png</normaloff>:/actions/print.png</iconset>
126   - </property>
127   - <property name="text">
128   - <string>Print</string>
129   - </property>
130   - <property name="shortcut">
131   - <string>Ctrl+P</string>
132   - </property>
133   - </action>
134   - <action name="actionExport">
135   - <property name="icon">
136   - <iconset resource="../res/application.qrc">
137   - <normaloff>:/actions/export-as.png</normaloff>:/actions/export-as.png</iconset>
138   - </property>
139   - <property name="text">
140   - <string>Export as ...</string>
141   - </property>
142   - <property name="shortcut">
143   - <string>Ctrl+E</string>
144   - </property>
145   - </action>
146 110 <action name="actionExit">
147 111 <property name="text">
148 112 <string>Exit</string>
... ... @@ -152,10 +116,6 @@
152 116 <property name="checkable">
153 117 <bool>true</bool>
154 118 </property>
155   - <property name="icon">
156   - <iconset resource="../res/application.qrc">
157   - <normaloff>:/actions/digitalphosphor.png</normaloff>:/actions/digitalphosphor.png</iconset>
158   - </property>
159 119 <property name="text">
160 120 <string>Digital phosphor</string>
161 121 </property>
... ... @@ -164,10 +124,6 @@
164 124 <property name="checkable">
165 125 <bool>true</bool>
166 126 </property>
167   - <property name="icon">
168   - <iconset resource="../res/application.qrc">
169   - <normaloff>:/actions/zoom.png</normaloff>:/actions/zoom.png</iconset>
170   - </property>
171 127 <property name="text">
172 128 <string>Zoom</string>
173 129 </property>
... ... @@ -196,11 +152,6 @@
196 152 <property name="checkable">
197 153 <bool>true</bool>
198 154 </property>
199   - <property name="icon">
200   - <iconset resource="../res/application.qrc">
201   - <normaloff>:/actions/stop.png</normaloff>
202   - <normalon>:/actions/start.png</normalon>:/actions/stop.png</iconset>
203   - </property>
204 155 <property name="text">
205 156 <string>Sampling</string>
206 157 </property>
... ... @@ -217,8 +168,6 @@
217 168 </property>
218 169 </action>
219 170 </widget>
220   - <resources>
221   - <include location="../res/application.qrc"/>
222   - </resources>
  171 + <resources/>
223 172 <connections/>
224 173 </ui>
... ...