/** The Constructor - your first job! */ Config::Config(QWidget *parent) : BConfig(parent), loadedPal(0), infoIsManage(false) { /** Setup the UI and geometry */ ui.setupUi(this); /** Some special stuff */ QEvent event(QEvent::PaletteChange); changeEvent(&event); ui.info->setOpenExternalLinks( true ); /** i've an internet link here */ ui.info->setMinimumWidth(160); const QPalette::ColorGroup groups[3] = { QPalette::Active, QPalette::Inactive, QPalette::Disabled }; ui.info->viewport()->setAutoFillBackground(false); QPalette pal = ui.info->palette(); for (int i = 0; i < 3; ++i) { pal.setColor(groups[i], QPalette::Base, pal.color(groups[i], QPalette::Window)); pal.setColor(groups[i], QPalette::Text, pal.color(groups[i], QPalette::WindowText)); } ui.info->setPalette(pal); /** set up color page, not of interest */ QColorDialog *cd = new QColorDialog(this); cd->hide(); connect ( ui.colorButton, SIGNAL(clicked()), cd, SLOT(show()) ); connect ( ui.colorButton, SIGNAL(clicked()), cd, SLOT(raise()) ); ui.role_window->installEventFilter(this); ui.role_windowText->installEventFilter(this); ui.role_highlight->installEventFilter(this); ui.role_highlightedText->installEventFilter(this); QTimer::singleShot( 50, this, SLOT(initColors()) ); /** fill some comboboxes, not of interest */ QSettings csettings("BE", "Config"); QStringList strList = csettings.value ( "UserPwChars", QStringList() ).toStringList(); ushort n; foreach (QString str, strList) { n = str.toUShort(0,16); if (n) ui.pwEchoChar->addItem(QChar(n), n); }