AdvancedForm::AdvancedForm() : GenericForm(QPixmap(":/img/settings/general.png")) { bodyUI = new Ui::AdvancedSettings; bodyUI->setupUi(this); bodyUI->dbLabel->setTextInteractionFlags(Qt::TextBrowserInteraction); bodyUI->dbLabel->setOpenExternalLinks(true); bodyUI->cbMakeToxPortable->setChecked(Settings::getInstance().getMakeToxPortable()); bodyUI->syncTypeComboBox->setSizeAdjustPolicy(QComboBox::AdjustToMinimumContentsLength); bodyUI->syncTypeComboBox->addItems({tr("FULL - very safe, slowest (recommended)"), tr("NORMAL - almost as safe as FULL, about 20% faster than FULL"), tr("OFF - disables all safety, when something goes wrong your history may be lost, fastest (not recommended)") }); int index = 2 - static_cast<int>(Settings::getInstance().getDbSyncType()); bodyUI->syncTypeComboBox->setCurrentIndex(index); connect(bodyUI->cbMakeToxPortable, &QCheckBox::stateChanged, this, &AdvancedForm::onMakeToxPortableUpdated); connect(bodyUI->syncTypeComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(onDbSyncTypeUpdated())); connect(bodyUI->resetButton, SIGNAL(clicked()), this, SLOT(resetToDefault())); for (QComboBox* cb : findChildren<QComboBox*>()) { cb->installEventFilter(this); cb->setFocusPolicy(Qt::StrongFocus); } Translator::registerHandler(std::bind(&AdvancedForm::retranslateUi, this), this); }
AdvancedForm::AdvancedForm() : GenericForm(QPixmap(":/img/settings/general.png")) { bodyUI = new Ui::AdvancedSettings; bodyUI->setupUi(this); bodyUI->dbLabel->setTextInteractionFlags(Qt::TextBrowserInteraction); bodyUI->dbLabel->setOpenExternalLinks(true); bodyUI->cbMakeToxPortable->setChecked(Settings::getInstance().getMakeToxPortable()); bodyUI->syncTypeComboBox->setSizeAdjustPolicy(QComboBox::AdjustToMinimumContentsLength); bodyUI->syncTypeComboBox->addItems({tr("Synchronized - safe / recommended"), tr("Partially async - risky / 20% faster"), tr("Asynchronous - dangerous / fastest") }); int index = 2 - static_cast<int>(Settings::getInstance().getDbSyncType()); bodyUI->syncTypeComboBox->setCurrentIndex(index); connect(bodyUI->cbMakeToxPortable, &QCheckBox::stateChanged, this, &AdvancedForm::onMakeToxPortableUpdated); connect(bodyUI->syncTypeComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(onDbSyncTypeUpdated())); connect(bodyUI->resetButton, SIGNAL(clicked()), this, SLOT(resetToDefault())); for (QComboBox* cb : findChildren<QComboBox*>()) { cb->installEventFilter(this); cb->setFocusPolicy(Qt::StrongFocus); } Translator::registerHandler(std::bind(&AdvancedForm::retranslateUi, this), this); }
/** * Konstruktor. */ Settings::Settings() { // um 3 Uhr Display abschalten (Minuten, Stunden, -, -, -, -) _nightModeTime[0] = new TimeStamp(0, 3, 0, 0, 0, 0); // um 4:30 Uhr Display wieder anschalten (Minuten, Stunden, -, -, -, -) _nightModeTime[1] = new TimeStamp(30, 4, 0, 0, 0, 0); resetToDefault(); // Versuche alte Einstellungen zu laden... loadFromEEPROM(); }
void ccBoundingBoxEditorDlg::setBaseBBox(const ccBBox& box, bool isMinimal/*=true*/) { //set new default one m_initBBox = m_baseBBox = box; m_baseBoxIsMinimal = isMinimal; defaultPushButton->setVisible(m_baseBBox.isValid()); resetToDefault(); }
ccBoundingBoxEditorDlg::ccBoundingBoxEditorDlg(QWidget* parent/*=0*/) : QDialog(parent, Qt::Tool) , Ui::BoundingBoxEditorDialog() , m_baseBoxIsMinimal(false) , m_showInclusionWarning(true) { setupUi(this); showBoxAxes(false); xDoubleSpinBox->setMinimum(-1.0e9); yDoubleSpinBox->setMinimum(-1.0e9); zDoubleSpinBox->setMinimum(-1.0e9); xDoubleSpinBox->setMaximum( 1.0e9); yDoubleSpinBox->setMaximum( 1.0e9); zDoubleSpinBox->setMaximum( 1.0e9); dxDoubleSpinBox->setMinimum( 0.0); dyDoubleSpinBox->setMinimum( 0.0); dzDoubleSpinBox->setMinimum( 0.0); dxDoubleSpinBox->setMaximum(1.0e9); dyDoubleSpinBox->setMaximum(1.0e9); dzDoubleSpinBox->setMaximum(1.0e9); connect(pointTypeComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(reflectChanges(int))); connect(keepSquareCheckBox, SIGNAL(toggled(bool)), this, SLOT(squareModeActivated(bool))); connect(okPushButton, SIGNAL(clicked()), this, SLOT(saveBoxAndAccept())); connect(cancelPushButton, SIGNAL(clicked()), this, SLOT(cancel())); connect(defaultPushButton, SIGNAL(clicked()), this, SLOT(resetToDefault())); connect(lastPushButton, SIGNAL(clicked()), this, SLOT(resetToLast())); connect(xDoubleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(updateCurrentBBox(double))); connect(yDoubleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(updateCurrentBBox(double))); connect(zDoubleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(updateCurrentBBox(double))); connect(dxDoubleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(updateXWidth(double))); connect(dyDoubleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(updateYWidth(double))); connect(dzDoubleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(updateZWidth(double))); connect(xOriXDoubleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(onAxisValueChanged(double))); connect(xOriYDoubleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(onAxisValueChanged(double))); connect(xOriZDoubleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(onAxisValueChanged(double))); connect(yOriXDoubleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(onAxisValueChanged(double))); connect(yOriYDoubleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(onAxisValueChanged(double))); connect(yOriZDoubleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(onAxisValueChanged(double))); connect(zOriXDoubleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(onAxisValueChanged(double))); connect(zOriYDoubleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(onAxisValueChanged(double))); connect(zOriZDoubleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(onAxisValueChanged(double))); defaultPushButton->setVisible(false); lastPushButton->setVisible(s_lastBBox.isValid()); checkBaseInclusion(); }
void Thumbwheel::mousePressEvent(QMouseEvent *e) { if (e->button() == Qt::MidButton || ((e->button() == Qt::LeftButton) && (e->modifiers() & Qt::ControlModifier))) { resetToDefault(); } else if (e->button() == Qt::LeftButton) { m_clicked = true; m_clickPos = e->pos(); m_clickRotation = m_rotation; } }
void LLControlVariable::setValue(const LLSD& new_value, bool saved_value) { if ((*mValidateSignal)(this, new_value) == false) { // can not set new value, exit return; } LLSD storable_value = getComparableValue(new_value); bool value_changed = llsd_compare(getValue(), storable_value) == FALSE; if(saved_value) { // If we're going to save this value, return to default but don't fire resetToDefault(false); if (llsd_compare(mValues.back(), storable_value) == FALSE) { mValues.push_back(storable_value); } } else { // This is a unsaved value. Its needs to reside at // mValues[2] (or greater). It must not affect // the result of getSaveValue() if (llsd_compare(mValues.back(), storable_value) == FALSE) { while(mValues.size() > 2) { // Remove any unsaved values. mValues.pop_back(); } if(mValues.size() < 2) { // Add the default to the 'save' value. mValues.push_back(mValues[0]); } // Add the 'un-save' value. mValues.push_back(storable_value); } } if(value_changed) { if(getCOAActive() == this) (*mCommitSignal)(this,storable_value); } }
void PlayerWidget::handlePlayerStateChanged(QMediaPlayer::State state) { if(state == QMediaPlayer::PlayingState) { playBtn->setIcon(QIcon(":/kuwoMusic/KuwoMusic/imgs/play-start.png")); }else if(state == QMediaPlayer::PausedState) { playBtn->setIcon(QIcon(":/kuwoMusic/KuwoMusic/imgs/play-pause.png")); }else if(state == QMediaPlayer::StoppedState) { playBtn->setIcon(QIcon(":/kuwoMusic/KuwoMusic/imgs/play-pause.png")); resetToDefault(); } }
PlayerWidget::PlayerWidget(QWidget *parent) : QWidget(parent) { //setMaximumHeight(80); player = new QMediaPlayer(this); mainLayout = new QGridLayout(this); headLbl = new QLabel; durationLbl = new QLabel; songNameLbl = new QLabel; playBtn = new QPushButton; nextBtn = new QPushButton; progressBar = new QSlider;// mainLayout->setMargin(2); mainLayout->setSpacing(2); headLbl->setFixedSize(100,100); playBtn->setFocusPolicy(Qt::NoFocus); playBtn->setFixedSize(50,50); nextBtn->setFixedSize(50,50); playBtn->setFlat(true); nextBtn->setFlat(true); playBtn->setIconSize(QSize(50,50)); nextBtn->setIconSize(QSize(50,50)); playBtn->setIcon(QIcon(":/kuwoMusic/KuwoMusic/imgs/play-pause.png")); nextBtn->setIcon(QIcon(":/kuwoMusic/KuwoMusic/imgs/next.png")); //songNameLbl->setWordWrap(true); songNameLbl->setMaximumHeight(35); //songNameLbl->setFixedSize(70,30); progressBar->setOrientation(Qt::Horizontal); progressBar->setRange(0,1000); //mainLayout->addWidget(headLbl,0,0,3,3); mainLayout->addWidget(progressBar,0,0,1,7); mainLayout->addWidget(songNameLbl,1,0,1,5); mainLayout->addWidget(durationLbl,2,0,1,5); //mainLayout->addWidget(playBtn,1,5,1,1); mainLayout->addWidget(playBtn,1,6,2,2); //mainLayout->addWidget(nextBtn,1,6,1,1); resetToDefault(); timer = new QTimer(this); connect(timer,SIGNAL(timeout()),this,SLOT(getPlayInfo())); connect(player,SIGNAL(stateChanged(QMediaPlayer::State)),this,SLOT(handlePlayerStateChanged(QMediaPlayer::State))); connect(playBtn,SIGNAL(clicked()),this,SLOT(playBtnClick())); connect(progressBar,SIGNAL(sliderMoved(int)),this,SLOT(seek(int))); }
void LLControlVariable::setDefaultValue(const LLSD& value) { // Set the control variables value and make it // the default value. If the active value is changed, // send the signal. // *NOTE: Default values are not saved, only read. LLSD comparable_value = getComparableValue(value); bool value_changed = (llsd_compare(getValue(), comparable_value) == FALSE); resetToDefault(false); mValues[0] = comparable_value; if(value_changed) { firePropertyChanged(); } }
void GSettings::initialize() { QSettings settings("rusith","Genius"); QFile fSettings(settings.fileName()); if(fSettings.exists()==false || fSettings.size()<1) resetToDefault(); showInSingleLine=settings.value("showInSingleLine").toBool(); limitcharLength=settings.value("limitViewCharactorLength").toBool(); limitedCharLength=settings.value("charactorLimitOfItem").toInt(); maximumItemsInHistory=settings.value("maximumItemsInHistory").toInt(); saveImages=settings.value("saveImages").toBool(); openMinimized=settings.value("openMinimized").toBool(); pasteAutomaticlay=settings.value("pasteAutomaticaly").toBool(); historyItemLimit=settings.value("historyItemLimit").toInt(); clearHistoryHotKey=QKeySequence(settings.value("clearHistoryHotkey").toString()); pasteLastHotKey=QKeySequence(settings.value("pasteLastHotkey").toString()); openManagerHotkey=QKeySequence(settings.value("openManagerHotkey").toString()); openSettingsHotKey=QKeySequence(settings.value("openSettingsHotkey").toString()); clearHistoryHotKeyEnabled=settings.value("clearHistoryHotKeyEnabled").toBool(); pasteLastHotKeyEnabled=settings.value("pasteLastHotKeyEnabled").toBool(); openManagerHotkeyEnabled=settings.value("openManagerHotkeyEnabled").toBool(); openSettingsHotKeyEnabled=settings.value("openSettingsHotKeyEnabled").toBool(); selectorEnabled=settings.value("selectorEnabled").toBool(); selectorItemBackgroundColor=settings.value("selectorItemBackgroundColor").toString(); selectorTextColor=settings.value("selectorTextColor").toString(); selectorBorderColor=settings.value("selectorBorderColor").toString(); selectorBorderSize=settings.value("selectorBorderSize").toInt(); selectorAnimationDuration=settings.value("selectorAnimationDuration").toInt(); selectorBorderRadius=settings.value("selectorBorderRadius").toInt(); maximumImageWidth=settings.value("maximumImageWidth").toInt(); maximumImageHight=settings.value("maximumImageHight").toInt(); historyMenuHotkeyEnabled=settings.value("historyMenuHotkeyEnabled").toBool(); historyMenuHotkey=QKeySequence(settings.value("historyMenuHotkey").toString()); showIndexesInHistoryMenu=settings.value("showIndexesInHistoryMenu").toBool(); enableDeepSearch=settings.value("enableDeepSearch").toBool(); }
PropertyGridComboBoxPropertyDesc::PropertyGridComboBoxPropertyDesc() : PropertyGridItemDesc() { resetToDefault(); }
ToolBarItemDesc::ToolBarItemDesc() : ContainerWidgetDesc(), toolBar(NULL) { resetToDefault(); }
ContextMenuDesc::ContextMenuDesc() : WindowDesc() { resetToDefault(); }
MenuImageItemDesc::MenuImageItemDesc() : MenuItemDesc() { resetToDefault(); }
MenuPanelDesc::MenuPanelDesc() : WindowDesc() { resetToDefault(); }
ListTextItemDesc::ListTextItemDesc() : ListItemDesc(), TextUserDesc() { resetToDefault(); }
ComponentWidgetDesc::ComponentWidgetDesc() : WidgetDesc() { resetToDefault(); }
OptionDialog::OptionDialog(QWidget* parent) { int i; // I need a lot of control over what is displayed on the DbConfig dialog. // Maybe designer can do it? No idea. So I did this hybrid model, and I // think it will end up biting my ... // anyway. It isn't pretty setupUi(this); createPostgresElements(); createSQLiteElements(); if( parent != 0 ) { setWindowIcon(parent->windowIcon()); } ndxToLangCode << "ca" << "cs" << "da" << "de" << "el" << "en" << "es" << "et" << "eu" << "fr" << "gl" << "hu" << "it" << "lv" << "nb" << "nl" << "pl" << "pt" << "ru" << "sr" << "sv" << "tr" << "zh"; // Do this just to have model indices to set icons. comboBox_lang->addItems(ndxToLangCode); // MUST correspond to ndxToLangCode. langIcons << /*ca*/ QIcon(":images/flagCatalonia.svg") << /*cs*/ QIcon(":images/flagCzech.svg") << /*da*/ QIcon() << /*de*/ QIcon(":images/flagGermany.svg") << /*el*/ QIcon(":images/flagGreece.svg") << /*en*/ QIcon(":images/flagUK.svg") << /*es*/ QIcon(":images/flagSpain.svg") << /*et*/ QIcon() << /*eu*/ QIcon() << /*fr*/ QIcon(":images/flagFrance.svg") << /*gl*/ QIcon() << /*hu*/ QIcon() << /*it*/ QIcon(":images/flagItaly.svg") << /*lv*/ QIcon() << /*nb*/ QIcon() << /*nl*/ QIcon(":images/flagNetherlands.svg") << /*pl*/ QIcon(":images/flagPoland.svg") << /*pt*/ QIcon(":images/flagBrazil.svg") << /*ru*/ QIcon(":images/flagRussia.svg") << /*sr*/ QIcon() << /*sv*/ QIcon() << /*tr*/ QIcon() << /*zh*/ QIcon(":images/flagChina.svg"); // Set icons. for( i = 0; i < langIcons.size(); ++i ) comboBox_lang->setItemIcon(i, langIcons[i]); // Call this here to set up translatable strings. retranslate(); // Populate combo boxes on the "Units" tab weightComboBox->addItem(tr("SI units"), QVariant(SI)); weightComboBox->addItem(tr("US traditional units"), QVariant(USCustomary)); weightComboBox->addItem(tr("British imperial units"), QVariant(Imperial)); temperatureComboBox->addItem(tr("Celsius"), QVariant(Celsius)); temperatureComboBox->addItem(tr("Fahrenheit"), QVariant(Fahrenheit)); volumeComboBox->addItem(tr("SI units"), QVariant(SI)); volumeComboBox->addItem(tr("US traditional units"), QVariant(USCustomary)); volumeComboBox->addItem(tr("British imperial units"), QVariant(Imperial)); gravityComboBox->addItem(tr("20C/20C Specific Gravity"), QVariant(Brewtarget::SG)); gravityComboBox->addItem(tr("Plato/Brix/Balling"), QVariant(Brewtarget::PLATO)); dateComboBox->addItem(tr("mm-dd-YYYY"), QVariant(Unit::displayUS)); dateComboBox->addItem(tr("dd-mm-YYYY"), QVariant(Unit::displayImp)); dateComboBox->addItem(tr("YYYY-mm-dd"), QVariant(Unit::displaySI)); colorComboBox->addItem(tr("SRM"), QVariant(Brewtarget::SRM)); colorComboBox->addItem(tr("EBC"), QVariant(Brewtarget::EBC)); // Populate combo boxes on the "Formulas" tab ibuFormulaComboBox->addItem(tr("Tinseth's approximation"), QVariant(Brewtarget::TINSETH)); ibuFormulaComboBox->addItem(tr("Rager's approximation"), QVariant(Brewtarget::RAGER)); ibuFormulaComboBox->addItem(tr("Noonan's approximation"), QVariant(Brewtarget::NOONAN)); colorFormulaComboBox->addItem(tr("Mosher's approximation"), QVariant(Brewtarget::MOSHER)); colorFormulaComboBox->addItem(tr("Daniel's approximation"), QVariant(Brewtarget::DANIEL)); colorFormulaComboBox->addItem(tr("Morey's approximation"), QVariant(Brewtarget::MOREY)); connect( buttonBox, SIGNAL( accepted() ), this, SLOT( saveAndClose() ) ); connect( buttonBox, SIGNAL( rejected() ), this, SLOT( cancel() ) ); // database panel stuff comboBox_engine->addItem( tr("SQLite (default)"), QVariant(Brewtarget::SQLITE)); comboBox_engine->addItem( tr("PostgreSQL"), QVariant(Brewtarget::PGSQL)); connect( comboBox_engine, SIGNAL( currentIndexChanged(int) ), this, SLOT( setEngine(int) ) ); connect( pushButton_testConnection, SIGNAL( clicked() ), this, SLOT(testConnection())); // figure out which database we have setDbDialog((Brewtarget::DBTypes)Brewtarget::option("dbType", Brewtarget::SQLITE).toInt()); // Set the signals connect( checkBox_savePassword, SIGNAL(clicked(bool)), this, SLOT(savePassword(bool))); connect( btStringEdit_hostname, SIGNAL( textModified() ), this, SLOT(testRequired())); connect( btStringEdit_portnum, SIGNAL( textModified() ), this, SLOT(testRequired())); connect( btStringEdit_schema, SIGNAL( textModified() ), this, SLOT(testRequired())); connect( btStringEdit_dbname, SIGNAL( textModified() ), this, SLOT(testRequired())); connect( btStringEdit_username, SIGNAL( textModified() ), this, SLOT(testRequired())); connect( btStringEdit_password, SIGNAL( textModified() ), this, SLOT(testRequired())); connect( pushButton_browseDataDir, SIGNAL( clicked() ), this, SLOT( setDataDir() ) ); connect( pushButton_browseBackupDir, SIGNAL( clicked() ), this, SLOT( setBackupDir() ) ); connect( pushButton_resetToDefault, SIGNAL( clicked() ), this, SLOT( resetToDefault() ) ); pushButton_testConnection->setEnabled(false); }
PrinterSettings::PrinterSettings(QWidget *parent) : QDialog(parent), ui(new Ui::PrinterSettings), mPrinter(0), mUnit(UnitMillimeter) { setAttribute(Qt::WA_DeleteOnClose); ui->setupUi(this); ui->leftMarginSpin->installEventFilter(this); ui->rightMarginSpin->installEventFilter(this); ui->topMarginSpin->installEventFilter(this); ui->bottomMarginSpin->installEventFilter(this); ui->internalMarginSpin->installEventFilter(this); ui->duplexTypeComboBox->addItem(tr("Printer has duplexer"), DuplexAuto); ui->duplexTypeComboBox->addItem(tr("Manual with reverse (suitable for most printers)"), DuplexManualReverse); ui->duplexTypeComboBox->addItem(tr("Manual without reverse"), DuplexManual); QPalette pal(palette()); pal.setColor(QPalette::Background, QColor(105, 101, 98)); ui->marginsPereview->setPalette(pal); ui->marginsPereview->setAutoFillBackground(true); int n = qMax(ui->addProfileButton->minimumSizeHint().width(), ui->addProfileButton->minimumSizeHint().height()); ui->addProfileButton->setMinimumSize(n, n); ui->delProfileButton->setMinimumSize(n, n); connect(ui->buttonBox, SIGNAL(clicked(QAbstractButton*)), this, SLOT(btnClicked(QAbstractButton*))); connect(ui->borderCbx, SIGNAL(toggled(bool)), this, SLOT(updatePreview())); connect(ui->profilesList, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, SLOT(selectProfile(QListWidgetItem*,QListWidgetItem*))); connect(ui->profilesList->itemDelegate(), SIGNAL(closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint)), this, SLOT(profileRenamed(QWidget*,QAbstractItemDelegate::EndEditHint))); connect(ui->addProfileButton, SIGNAL(clicked()), this, SLOT(addProfile())); connect(ui->delProfileButton, SIGNAL(clicked()), this, SLOT(delProfile())); connect(ui->leftMarginSpin, SIGNAL(editingFinished()), this, SLOT(updateProfile())); connect(ui->rightMarginSpin, SIGNAL(editingFinished()), this, SLOT(updateProfile())); connect(ui->topMarginSpin, SIGNAL(editingFinished()), this, SLOT(updateProfile())); connect(ui->bottomMarginSpin, SIGNAL(editingFinished()), this, SLOT(updateProfile())); connect(ui->internalMarginSpin, SIGNAL(editingFinished()), this, SLOT(updateProfile())); connect(ui->duplexTypeComboBox, SIGNAL(activated(int)), this, SLOT(updateProfile())); connect(ui->reverseOrderCbx, SIGNAL(clicked()), this, SLOT(updateProfile())); connect(ui->borderCbx, SIGNAL(clicked()), this, SLOT(updateProfile())); connect(ui->resetButton, SIGNAL(clicked()), this, SLOT(resetToDefault())); restoreGeometry(settings->value(Settings::PrinterSettingsDialog_Geometry).toByteArray()); }
ActionsDialog::ActionsDialog(QList<QAction *>& actions, MainWindow *parent) : QDialog(parent), Main(parent) { setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); actionsTable = new QTableWidget(actions.count(), 2, this); QStringList hdr; hdr << tr("Description") << tr("Shortcut"); actionsTable->setHorizontalHeaderLabels(hdr); actionsTable->verticalHeader()->hide(); actionsTable->horizontalHeader()->setMinimumSectionSize(100); #ifdef QT5 #define setResizeMode setSectionResizeMode #endif actionsTable->horizontalHeader()->setResizeMode(0, QHeaderView::Stretch); actionsTable->horizontalHeader()->setResizeMode(1, QHeaderView::ResizeToContents); #undef setResizeMode //actionsTable->setColumnReadOnly(0, true); int row = 0; for (int i=0; i<actions.size(); ++i) { QAction *action = static_cast<QAction*>(actions.at(i)); QTableWidgetItem* it = new QTableWidgetItem(action->toolTip()); it->setFlags(0); actionsTable->setItem(row, 0, it); actionsTable->setItem(row, 1, new QTableWidgetItem(action->shortcut().toString())); actionsList.append(action); ++row; } QPushButton *importButton = new QPushButton(tr("&Import"), this); QPushButton *exportButton = new QPushButton(tr("&Export"), this); QPushButton *defaultButton = new QPushButton(tr("&Default"), this); QPushButton *okButton = new QPushButton(tr("&OK"), this); QPushButton *cancelButton = new QPushButton(tr("&Cancel"), this); connect(actionsTable, SIGNAL(currentCellChanged(int, int, int, int)), this, SLOT(recordAction(int, int))); connect(actionsTable, SIGNAL(cellChanged(int, int)), this, SLOT(validateAction(int, int))); connect(importButton, SIGNAL(clicked()), this, SLOT(importShortcuts())); connect(exportButton, SIGNAL(clicked()), this, SLOT(exportShortcuts())); connect(defaultButton, SIGNAL(clicked()), this, SLOT(resetToDefault())); connect(okButton, SIGNAL(clicked()), this, SLOT(accept())); connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject())); QHBoxLayout *buttonLayout = new QHBoxLayout; buttonLayout->setSpacing(8); buttonLayout->addStretch(1); buttonLayout->addWidget(importButton); buttonLayout->addWidget(exportButton); buttonLayout->addWidget(defaultButton); buttonLayout->addWidget(okButton); buttonLayout->addWidget(cancelButton); QVBoxLayout *mainLayout = new QVBoxLayout(this); mainLayout->setMargin(8); mainLayout->setSpacing(8); mainLayout->addWidget(actionsTable); mainLayout->addLayout(buttonLayout); setWindowTitle(tr("Shortcut Editor")); cancelButton->setFocus(); }
MenuDesc::MenuDesc() : MenuTextItemDesc() { resetToDefault(); }
// stops cooking, resets counter. bool SlowCooker::stopCook() { m_state = STATE_NOT_COOKING; resetToDefault(); setHeaterState(LOW); }
ListImageItemDesc::ListImageItemDesc() : ListItemDesc() { resetToDefault(); }
//-------------------------------------------------------------- void testApp::buttonAction(int i) { int butt = i; switch(butt) { case 0: d->set(770,242); if(ib->mode == 0 && ib->active) d->mode = ib->type; //rabbitfunction is populated based on ib->type else if(ib-> mode == 1) d->mode = 11; //display emulator 1 else break; d->populateList(); d->active=true; break; case 1: d->set(770,178); if(ib->mode == 0 || ib -> mode == 3) d->mode = 9; //change active element else d->mode = 10; //output resolution list d->populateList(); d->active=true; break; case 2: d->set(770,440); if(ib->type==0 && ib->mode == 0 && ib->active) { d->mode = 4; //toggle } else if(ib->mode == 1) { d->mode = 13; //on source loss } else break; d->populateList(); d->active=true; break; case 3: case 4: case 5: case 6: curSkin = butt-3; ib->mode=0; copyElementDataToInterface(); break; case 7: ib->reset(); ib->mode=1; for(int i = 0; i < numberOfElements; i++) { e[i]->selected = false; } break; case 8: saveToDisk(getSaveFileName()); break; case 9: loadFromFile(); break; case 10: saveToDevice(); //nooooooo! break; case 11: loadFromDevice(); break; case 12: resetToDefault(); break; //IP case 13: ib->enterIPAddress(); break; //enter OSC bar case 14: if(ib->mode == 0 && ib->active) { ib->enterOscAddress(); if(ib->oscAddress!="") { ib->toggleOSC = true; ib->stoggleOSC = d->onOffList[ib->toggleOSC]; } else { ib->toggleOSC = false; ib->stoggleOSC = d->onOffList[ib->toggleOSC]; } } break; //display emulator two case 15: if(ib->mode == 1) { d->set(770,264); d->mode = 12; //display emulator 2 d->populateList(); d->active=true; } break; case 16: d->set(770,330); if(ib->mode == 0 && ib->active) d->mode = 5; //toggle osc else if(ib->mode == 1) d->mode = 6; //output hdcp else break; d->populateList(); d->active=true; break; case 17: if(ib->mode == 1) { d->set(770,350); d->mode = 7; //input 01 hdcp d->populateList(); d->active=true; } break; case 18: if(ib->mode == 1) { d->set(770,370); d->mode = 8; //input 02 hdcp d->populateList(); d->active=true; } break; default: break; } }
TreeViewCheckBoxNodeDesc::TreeViewCheckBoxNodeDesc() : TreeViewNodeDesc() { resetToDefault(); }
void MyLineEdit::slotResetToDefault() { resetToDefault(); emit returnPressed(); }
ThankYouDialog::ThankYouDialog() { resetToDefault(); }
TreeViewDesc::TreeViewDesc() : ContainerWidgetDesc() { resetToDefault(); }
void MySpinBox::slotResetToDefault() { resetToDefault(); }