SkinButton::SkinButton(QWidget *parent, const char *name, WFlags f) : QButton(parent, name, f), pixRegular(NULL), pixActive(NULL) { QObject::connect(this, SIGNAL(pressed()), SLOT(slotPressed())); QObject::connect(this, SIGNAL(released()), SLOT(slotReleased())); }
/****************************************************************************** ** ScanSurfaceDialog */ ScanSurfaceDialog::ScanSurfaceDialog(QWidget *p) : QDialog(p) { setupUi(this); parent = static_cast<MainWindow*>(p); cnc = parent->mk1; setStyleSheet(parent->programStyleSheet); selectedX = -1; selectedY = -1; Scan = false; // QString n = QString::number(1.01); // toDecimalPoint = (n.indexOf(",") > 0) ? ',' : '.'; // fromDecimalPoint = (toDecimalPoint == ',') ? '.' : ','; indexScanX = 0; indexScanY = 0; indexMaxScanX = 0; indexMaxScanY = 0; scanThread = NULL; numSpeed->setValue(200); numReturn->setValue(400); //TODO: loading data from the matrix surfaceArr = parent->surfaceMatrix; sizeY = surfaceArr.count(); sizeX = 0; if (sizeY > 0) { sizeX = surfaceArr[0].count(); } // ruled is the old // hermite and cubic are new QStringList ls = (QStringList() << "Ruled" << "Hermite-Spline" << "Quadric"); comboZ->addItems(ls); comboGrid->addItems((QStringList() << "10" << "5" << "3" << "2" << "1")); translateDialog(); startOffsetX->setValue(Settings::coord[X].posMm()); startOffsetY->setValue(Settings::coord[Y].posMm()); startOffsetZ->setValue(Settings::coord[Z].posMm()); connect(pushOk, SIGNAL(clicked()), this, SLOT(onSave())); connect(pushCancel, SIGNAL(clicked()), this, SLOT(reject())); connect(pushButtonScan, SIGNAL(clicked()), this, SLOT(onScan())); connect(pushButtonTest, SIGNAL(clicked()), this, SLOT(onTestScan())); connect(checkBoxViewOnly, SIGNAL(stateChanged ( int)), this, SLOT(checkBoxChanged(int))); // start offset connect(startOffsetX, SIGNAL(valueChanged(QString)), this, SLOT(writeDataGridHeader())); connect(startOffsetY, SIGNAL(valueChanged(QString)), this, SLOT(writeDataGridHeader())); connect(startOffsetZ, SIGNAL(valueChanged(QString)), this, SLOT(valueChanged())); connect(deltaStepX, SIGNAL(valueChanged(QString)), this, SLOT(writeDataGridHeader())); connect(numCountX, SIGNAL(valueChanged(QString)), this, SLOT(resizeDataGrid())); connect(deltaStepY, SIGNAL(valueChanged(QString)), this, SLOT(writeDataGridHeader())); connect(numCountY, SIGNAL(valueChanged(QString)), this, SLOT(resizeDataGrid())); connect(numSpeed, SIGNAL(valueChanged(int)), this, SLOT(valueSpeedChanged(int))); connect(numReturn, SIGNAL(valueChanged(int)), this, SLOT(valueReturnChanged(int))); connect(dataGridView, SIGNAL(itemChanged ( QTableWidgetItem * )), this, SLOT(itemChanged(QTableWidgetItem*))); connect(dataGridView, SIGNAL(itemClicked ( QTableWidgetItem * )), this, SLOT(itemClicked(QTableWidgetItem*))); connect(dataGridView, SIGNAL(cellActivated ( int, int )), this, SLOT(cellActivated(int, int))); connect(toolButtonZUp, SIGNAL(pressed()), this, SLOT(buttonPlusZDown())); connect(toolButtonZUp, SIGNAL(released()), this, SLOT(buttonStop())); connect(toolButtonZSet, SIGNAL(clicked()), this, SLOT(buttonSetZ())); // connect(toolButtonZSet, SIGNAL(released()), this, SLOT(valueChanged())); connect(toolButtonZDown, SIGNAL(pressed()), this, SLOT(buttonMinusZDown())); connect(toolButtonZDown, SIGNAL(released()), this, SLOT(buttonStop())); connect(toolButtonMove, SIGNAL(clicked(bool)), this, SLOT(valueChanged())); // connect(toolButtonMove, SIGNAL(released()), this, SLOT(valueChanged())); label10->setText(""); adjustSize(); }
} void EvaluateHandleModifierUI::toggleSignals(bool toggleconnections){ if (toggleconnections){ connect(name, SIGNAL(textEdited(QString)), this, SLOT(setName(QString)), Qt::UniqueConnection); connect(enable, SIGNAL(released()), this, SLOT(setEnable()), Qt::UniqueConnection); connect(handlePositionOut, SIGNAL(editingFinished()), this, SLOT(setHandlePositionOut()), Qt::UniqueConnection); connect(handleRotationOut, SIGNAL(editingFinished()), this, SLOT(setHandleRotationOut()), Qt::UniqueConnection); connect(isValidOut, SIGNAL(released()), this, SLOT(setIsValidOut()), Qt::UniqueConnection); connect(extrapolationTimeStep, SIGNAL(editingFinished()), this, SLOT(setExtrapolationTimeStep()), Qt::UniqueConnection); connect(handleChangeSpeed, SIGNAL(editingFinished()), this, SLOT(setHandleChangeSpeed()), Qt::UniqueConnection); connect(handleChangeMode, SIGNAL(currentIndexChanged(int)), this, SLOT(setHandleChangeMode(int)), Qt::UniqueConnection); connect(table, SIGNAL(cellDoubleClicked(int,int)), this, SLOT(viewSelected(int,int)), Qt::UniqueConnection); }else{ disconnect(name, SIGNAL(textEdited(QString)), this, SLOT(setName(QString))); disconnect(enable, SIGNAL(released()), this, SLOT(setEnable())); disconnect(handlePositionOut, SIGNAL(editingFinished()), this, SLOT(setHandlePositionOut())); disconnect(handleRotationOut, SIGNAL(editingFinished()), this, SLOT(setHandleRotationOut())); disconnect(isValidOut, SIGNAL(released()), this, SLOT(setIsValidOut())); disconnect(extrapolationTimeStep, SIGNAL(editingFinished()), this, SLOT(setExtrapolationTimeStep())); disconnect(handleChangeSpeed, SIGNAL(editingFinished()), this, SLOT(setHandleChangeSpeed())); disconnect(handleChangeMode, SIGNAL(currentIndexChanged(int)), this, SLOT(setHandleChangeMode(int))); disconnect(table, SIGNAL(cellDoubleClicked(int,int)), this, SLOT(viewSelected(int,int))); } } void EvaluateHandleModifierUI::connectToTables(GenericTableWidget *variables, GenericTableWidget *properties){ if (variables && properties){ disconnect(variables, SIGNAL(elementSelected(int,QString)), 0, 0); disconnect(properties, SIGNAL(elementSelected(int,QString)), 0, 0); connect(variables, SIGNAL(elementSelected(int,QString)), this, SLOT(setBindingVariable(int,QString)), Qt::UniqueConnection);
MppShortcutTab :: MppShortcutTab(MppMainWindow *_mw) { uint32_t x; uint32_t xr = 0; uint32_t y = 0; mw = _mw; gb_jump = new MppGroupBox(tr("Label Jump MIDI shortcuts")); gb_mode = new MppGroupBox(tr("View Mode MIDI shortcuts")); gb_ops = new MppGroupBox(tr("Operation MIDI shortcuts")); gl = new MppGridLayout(); gl->addWidget(gb_jump, 0,0,2,4); gl->addWidget(gb_mode, 0,4,1,4); gl->addWidget(gb_ops, 1,4,1,4); gl->setRowStretch(3, 1); gl->setColumnStretch(8, 1); watchdog = new QTimer(this); watchdog->setSingleShot(1); connect(watchdog, SIGNAL(timeout()), this, SLOT(handle_watchdog())); memset(filter, 0, sizeof(filter)); memset(shortcut_desc, 0, sizeof(shortcut_desc)); shortcut_desc[MPP_SHORTCUT_J0] = "J0"; shortcut_desc[MPP_SHORTCUT_J1] = "J1"; shortcut_desc[MPP_SHORTCUT_J2] = "J2"; shortcut_desc[MPP_SHORTCUT_J3] = "J3"; shortcut_desc[MPP_SHORTCUT_J4] = "J4"; shortcut_desc[MPP_SHORTCUT_J5] = "J5"; shortcut_desc[MPP_SHORTCUT_J6] = "J6"; shortcut_desc[MPP_SHORTCUT_J7] = "J7"; shortcut_desc[MPP_SHORTCUT_J8] = "J8"; shortcut_desc[MPP_SHORTCUT_J9] = "J9"; shortcut_desc[MPP_SHORTCUT_J10] = "J10"; shortcut_desc[MPP_SHORTCUT_J11] = "J11"; shortcut_desc[MPP_SHORTCUT_J12] = "J12"; shortcut_desc[MPP_SHORTCUT_J13] = "J13"; shortcut_desc[MPP_SHORTCUT_J14] = "J14"; shortcut_desc[MPP_SHORTCUT_J15] = "J15"; shortcut_desc[MPP_SHORTCUT_ALL] = "ALL"; shortcut_desc[MPP_SHORTCUT_TRANS] = "TRANS"; shortcut_desc[MPP_SHORTCUT_FIXED] = "FIXED"; shortcut_desc[MPP_SHORTCUT_MIXED] = "MIXED"; shortcut_desc[MPP_SHORTCUT_CHORD_PIANO] = "CHORD-PIANO"; shortcut_desc[MPP_SHORTCUT_CHORD_GUITAR] = "CHORD-GUITAR"; shortcut_desc[MPP_SHORTCUT_TRIGGER] = "TRIGGER"; shortcut_desc[MPP_SHORTCUT_PAUSE] = "PAUSE"; shortcut_desc[MPP_SHORTCUT_REWIND] = "REWIND"; shortcut_desc[MPP_SHORTCUT_BPM_TOGGLE] = "BPMTOG"; but_set_all = new QPushButton("Record All"); connect(but_set_all, SIGNAL(released()), this, SLOT(handle_set_all_flat())); but_clr_all = new QPushButton("Record None"); connect(but_clr_all, SIGNAL(released()), this, SLOT(handle_clr_all_flat())); but_reset = new QPushButton("Clear Selected"); connect(but_reset, SIGNAL(released()), this, SLOT(handle_reset_all_flat())); but_default = new QPushButton("Set Defaults"); connect(but_default, SIGNAL(released()), this, SLOT(handle_default())); gl->addWidget(but_set_all, 2, 0, 1, 1); gl->addWidget(but_clr_all, 2, 1, 1, 1); gl->addWidget(but_reset, 2, 2, 1, 1); gl->addWidget(but_default, 2, 3, 1, 1); for (x = 0; x != MPP_SHORTCUT_MAX; x++) { MppGroupBox *gb; if (x == MPP_SHORTCUT_LABEL_MAX || x == MPP_SHORTCUT_MODE_MAX) { xr = 0; y = 0; } but_rec[x] = new MppButton(tr("REC"), x); connect(but_rec[x], SIGNAL(released(int)), this, SLOT(handle_record(int))); led_cmd[x] = new QLineEdit(); led_cmd[x]->setMaxLength(32); connect(led_cmd[x], SIGNAL(textChanged(const QString &)), this, SLOT(handle_text_changed(const QString &))); if (x < MPP_SHORTCUT_LABEL_MAX) { gb = gb_jump; } else if (x < MPP_SHORTCUT_MODE_MAX) { gb = gb_mode; } else { gb = gb_ops; } gb->addWidget(new QLabel(tr(shortcut_desc[x])), xr, y, 1, 1); gb->addWidget(led_cmd[x], xr, y + 1, 1, 1); gb->addWidget(but_rec[x], xr, y + 2, 1, 1); xr++; if (xr == 8) { xr = 0; y += 3; } } handle_default(); }
BOOLE kbdDrvEventChecker(kbd_drv_pc_symbol symbol_key) { ULO eol_evpos = kbd_state.eventsEOL.inpos; ULO eof_evpos = kbd_state.eventsEOF.inpos; ULO port, setting; for (;;) { if (kbd_drv_capture) { #ifdef _DEBUG fellowAddLog( "Key captured: %s\n", kbdDrvKeyString( symbol_key )); #endif kbd_drv_captured_key = symbol_key; return TRUE; } if (released(PCK_PAGE_DOWN)) { if (ispressed(PCK_HOME)) { issue_event(EVENT_RESOLUTION_NEXT); } else { if (ispressed(PCK_END)) { issue_event(EVENT_SCALEY_NEXT); } } } if (released(PCK_PAGE_UP)) { if (ispressed(PCK_HOME)) { issue_event(EVENT_RESOLUTION_PREV); } else { if (ispressed(PCK_END)) { issue_event(EVENT_SCALEY_PREV); } } } if(ispressed(PCK_RIGHT_WINDOWS) || ispressed(PCK_START_MENU)) if(ispressed(PCK_LEFT_WINDOWS)) if(ispressed(PCK_LEFT_CTRL)) issue_event(EVENT_HARD_RESET); if (ispressed(PCK_PRINT_SCREEN)) issue_event(EVENT_BMP_DUMP); #ifdef RETRO_PLATFORM if(RP.GetHeadlessMode()) { if( ispressed ( PCK_LEFT_ALT ) ) if(ispressed ( PCK_F4 ) ) issue_event(EVENT_EXIT); if(!RP.GetEmulationPaused()) { if( pressed ( RP.GetEscapeKey() )) { RP.SetEscapeKeyHeld(true); return TRUE; } if( released ( RP.GetEscapeKey() )) { ULONGLONG t = RP.SetEscapeKeyHeld(false); if((t != 0) && (t < RP.GetEscapeKeyHoldTime())) { UBY a_code = kbd_drv_pc_symbol_to_amiga_scancode[RP.GetEscapeKey()]; fellowAddLog("RetroPlatform escape key held shorter than escape interval, simulate key being pressed for %u milliseconds...\n", t); RP.SetEscapeKeySimulatedTargetTime(RP.GetTime() + RP.GetEscapeKeyHoldTime()); kbdKeyAdd(a_code); // hold escape key return TRUE; } else return TRUE; } } else { if( pressed ( RP.GetEscapeKey() )) RP.PostEscaped(); } } #endif #ifdef RETRO_PLATFORM if(!RP.GetHeadlessMode()) #endif if( released( PCK_F11 )) { issue_event( EVENT_EXIT ); } #ifdef RETRO_PLATFORM if(!RP.GetHeadlessMode()) #endif if( released( PCK_F12 )) { mouseDrvToggleFocus(); joyDrvToggleFocus(); break; } if( ispressed(PCK_HOME) ) { if( released( PCK_F1 )) issue_event( EVENT_INSERT_DF0 ); if( released( PCK_F2 )) issue_event( EVENT_INSERT_DF1 ); if( released( PCK_F3 )) issue_event( EVENT_INSERT_DF2 ); if( released( PCK_F4 )) issue_event( EVENT_INSERT_DF3 ); } else if( ispressed(PCK_END) ) { if( released( PCK_F1 )) issue_event( EVENT_EJECT_DF0 ); if( released( PCK_F2 )) issue_event( EVENT_EJECT_DF1 ); if( released( PCK_F3 )) issue_event( EVENT_EJECT_DF2 ); if( released( PCK_F4 )) issue_event( EVENT_EJECT_DF3 ); } // Check joysticks replacements // New here: Must remember last value to decide if a change has happened for( port = 0; port < 2; port++ ) { for( setting = 0; setting < 2; setting++ ) { if( kbd_drv_joykey_enabled[port][setting] ) { // Here the gameport is set up for input from the specified set of joykeys // Check each key for change int direction; for (direction = 0; direction < MAX_JOYKEY_VALUE; direction++) { if (symbol_key == kbd_drv_joykey[setting][direction]) { if( pressed( symbol_key ) || released( symbol_key )) { kbdEventEOLAdd(kbd_drv_joykey_event[port][pressed(symbol_key)][direction]); } } } } } } break; } return (eol_evpos != kbd_state.eventsEOL.inpos) || (eof_evpos != kbd_state.eventsEOF.inpos); }
LoaderWindow::LoaderWindow() : QbWindow(config.geometry.loaderWindow) { setObjectName("loader-window"); setMinimumWidth(520); layout = new QVBoxLayout; layout->setMargin(Style::WindowMargin); layout->setSpacing(Style::WidgetSpacing); layout->setAlignment(Qt::AlignTop); setLayout(layout); grid = new QGridLayout; layout->addLayout(grid); baseLabel = new QLabel("Base cartridge:"); grid->addWidget(baseLabel, 0, 0); baseFile = new QLineEdit; baseFile->setReadOnly(true); grid->addWidget(baseFile, 0, 1); baseBrowse = new QPushButton("Browse ..."); grid->addWidget(baseBrowse, 0, 2); baseClear = new QPushButton("Clear"); grid->addWidget(baseClear, 0, 3); slot1Label = new QLabel("Slot A cartridge:"); grid->addWidget(slot1Label, 1, 0); slot1File = new QLineEdit; slot1File->setReadOnly(true); grid->addWidget(slot1File, 1, 1); slot1Browse = new QPushButton("Browse ..."); grid->addWidget(slot1Browse, 1, 2); slot1Clear = new QPushButton("Clear"); grid->addWidget(slot1Clear, 1, 3); slot2Label = new QLabel("Slot B cartridge:"); grid->addWidget(slot2Label, 2, 0); slot2File = new QLineEdit; slot2File->setReadOnly(true); grid->addWidget(slot2File, 2, 1); slot2Browse = new QPushButton("Browse ..."); grid->addWidget(slot2Browse, 2, 2); slot2Clear = new QPushButton("Clear"); grid->addWidget(slot2Clear, 2, 3); load = new QPushButton("Load"); grid->addWidget(load, 3, 2); cancel = new QPushButton("Cancel"); grid->addWidget(cancel, 3, 3); connect(baseBrowse, SIGNAL(released()), this, SLOT(selectBaseCartridge())); connect(baseClear, SIGNAL(released()), this, SLOT(clearBaseCartridge())); connect(slot1Browse, SIGNAL(released()), this, SLOT(selectSlot1Cartridge())); connect(slot1Clear, SIGNAL(released()), this, SLOT(clearSlot1Cartridge())); connect(slot2Browse, SIGNAL(released()), this, SLOT(selectSlot2Cartridge())); connect(slot2Clear, SIGNAL(released()), this, SLOT(clearSlot2Cartridge())); connect(load, SIGNAL(released()), this, SLOT(onLoad())); connect(cancel, SIGNAL(released()), this, SLOT(close())); }
void update_state() { if( pressed() ) state_ = BTN_PRESS; else if( released() ) state_ = BTN_RELEASE; else if( now() ) state_ = BTN_DOWN; else state_ = BTN_UP; }
Debugger::Debugger() { setObjectName("debugger"); setWindowTitle("Debugger"); setGeometryString(&config().geometry.debugger); application.windowList.append(this); layout = new QHBoxLayout; layout->setMargin(Style::WindowMargin); layout->setSpacing(Style::WidgetSpacing); setLayout(layout); menu = new QMenuBar; layout->setMenuBar(menu); menu_tools = menu->addMenu("Tools"); menu_tools_disassembler = menu_tools->addAction("Disassembler ..."); menu_tools_breakpoint = menu_tools->addAction("Breakpoint Editor ..."); menu_tools_memory = menu_tools->addAction("Memory Editor ..."); menu_tools_propertiesViewer = menu_tools->addAction("Properties Viewer ..."); menu_ppu = menu->addMenu("S-PPU"); menu_ppu_vramViewer = menu_ppu->addAction("Video RAM Viewer ..."); menu_ppu_oamViewer = menu_ppu->addAction("Sprite Viewer ..."); menu_ppu_cgramViewer = menu_ppu->addAction("Palette Viewer ..."); menu_misc = menu->addMenu("Misc"); menu_misc_clear = menu_misc->addAction("Clear Console"); menu_misc_options = menu_misc->addAction("Options ..."); console = new QTextEdit; console->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); console->setReadOnly(true); console->setFont(QFont(Style::Monospace)); console->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); console->setMinimumWidth((92 + 4) * console->fontMetrics().width(' ')); console->setMinimumHeight((25 + 1) * console->fontMetrics().height()); layout->addWidget(console); controlLayout = new QVBoxLayout; controlLayout->setSpacing(0); layout->addLayout(controlLayout); commandLayout = new QHBoxLayout; controlLayout->addLayout(commandLayout); runBreak = new QPushButton("Break"); commandLayout->addWidget(runBreak); commandLayout->addSpacing(Style::WidgetSpacing); stepInstruction = new QPushButton("Step"); commandLayout->addWidget(stepInstruction); controlLayout->addSpacing(Style::WidgetSpacing); stepCPU = new QCheckBox("Step S-CPU"); controlLayout->addWidget(stepCPU); stepSMP = new QCheckBox("Step S-SMP"); controlLayout->addWidget(stepSMP); traceCPU = new QCheckBox("Trace S-CPU opcodes"); controlLayout->addWidget(traceCPU); traceSMP = new QCheckBox("Trace S-SMP opcodes"); controlLayout->addWidget(traceSMP); traceMask = new QCheckBox("Enable trace mask"); controlLayout->addWidget(traceMask); spacer = new QWidget; spacer->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding); controlLayout->addWidget(spacer); tracer = new Tracer; disassembler = new Disassembler; breakpointEditor = new BreakpointEditor; memoryEditor = new MemoryEditor; propertiesViewer = new PropertiesViewer; vramViewer = new VramViewer; oamViewer = new OamViewer; cgramViewer = new CgramViewer; debuggerOptions = new DebuggerOptions; connect(menu_tools_disassembler, SIGNAL(triggered()), disassembler, SLOT(show())); connect(menu_tools_breakpoint, SIGNAL(triggered()), breakpointEditor, SLOT(show())); connect(menu_tools_memory, SIGNAL(triggered()), memoryEditor, SLOT(show())); connect(menu_tools_propertiesViewer, SIGNAL(triggered()), propertiesViewer, SLOT(show())); connect(menu_ppu_vramViewer, SIGNAL(triggered()), vramViewer, SLOT(show())); connect(menu_ppu_oamViewer, SIGNAL(triggered()), oamViewer, SLOT(show())); connect(menu_ppu_cgramViewer, SIGNAL(triggered()), cgramViewer, SLOT(show())); connect(menu_misc_clear, SIGNAL(triggered()), this, SLOT(clear())); connect(menu_misc_options, SIGNAL(triggered()), debuggerOptions, SLOT(show())); connect(runBreak, SIGNAL(released()), this, SLOT(toggleRunStatus())); connect(stepInstruction, SIGNAL(released()), this, SLOT(stepAction())); connect(stepCPU, SIGNAL(released()), this, SLOT(synchronize())); connect(stepSMP, SIGNAL(released()), this, SLOT(synchronize())); connect(traceCPU, SIGNAL(stateChanged(int)), tracer, SLOT(setCpuTraceState(int))); connect(traceSMP, SIGNAL(stateChanged(int)), tracer, SLOT(setSmpTraceState(int))); connect(traceMask, SIGNAL(stateChanged(int)), tracer, SLOT(setTraceMaskState(int))); frameCounter = 0; synchronize(); resize(855, 425); }
QxtFilterDialog::QxtFilterDialog(QWidget *parent) : QDialog(parent) { QXT_INIT_PRIVATE(QxtFilterDialog); qxt_d().proxyModel = new QSortFilterProxyModel(this); QVBoxLayout * dlgLayout = new QVBoxLayout(this); /*the line edit to type in the filter*/ qxt_d().lineEditFilter = new QLineEdit(); dlgLayout->addWidget(qxt_d().lineEditFilter); connect(qxt_d().lineEditFilter,SIGNAL(textChanged(const QString &)),&qxt_d(),SLOT(createRegExpPattern(const QString &))); /*the treeview that shows the filtered choices */ qxt_d().listingTreeView = new QTreeView(this); qxt_d().listingTreeView->setSortingEnabled(true); //not editable , even if the model supports it qxt_d().listingTreeView->setEditTriggers(QAbstractItemView::NoEditTriggers); dlgLayout->addWidget(qxt_d().listingTreeView); connect(qxt_d().listingTreeView,SIGNAL(activated ( const QModelIndex & )),this,SLOT(accept())); #if 1 /*Group Box for changing search behaviour*/ QxtGroupBox *group = new QxtGroupBox(this); // group->setCollapsive(true); group->setTitle(tr("Filter options")); qxt_d().matchCaseOption = new QCheckBox(tr("Match case")); connect(qxt_d().matchCaseOption,SIGNAL(stateChanged ( int )),&qxt_d(),SLOT(matchCaseOptionStateChanged(int))); qxt_d().filterModeOption = new QCheckBox(tr("Filter mode:")); connect(qxt_d().filterModeOption,SIGNAL(stateChanged ( int )),&qxt_d(),SLOT(filterModeOptionStateChanged(int))); qxt_d().filterMode = new QComboBox(); qxt_d().filterMode->addItem(tr("Fixed String (Default)"),QRegExp::FixedString); qxt_d().filterMode->addItem(tr("Wildcard"),QRegExp::Wildcard); qxt_d().filterMode->addItem(tr("Regular Expression"),QRegExp::RegExp); qxt_d().filterMode->setEnabled(false); connect(qxt_d().filterMode,SIGNAL(activated (int)),&qxt_d(),SLOT(filterModeChoosen(int))); QVBoxLayout * groupBoxLayout = new QVBoxLayout(group); groupBoxLayout->addWidget(qxt_d().matchCaseOption); groupBoxLayout->addWidget(qxt_d().filterModeOption); groupBoxLayout->addWidget(qxt_d().filterMode); group->setLayout(groupBoxLayout); dlgLayout->addWidget(group); //group->setCollapsed(); group->setChecked(false); /*end group box*/ #endif /*a button to cancel the selection*/ QPushButton *cancelButton = new QPushButton(tr("Cancel")); dlgLayout->addWidget(cancelButton); connect(cancelButton,SIGNAL(released()),this,SLOT(reject())); QWidget::setTabOrder(qxt_d().lineEditFilter,qxt_d().listingTreeView); //QWidget::setTabOrder(qxt_d().listingTreeView,group); //QWidget::setTabOrder(group,qxt_d().matchCaseOption); QWidget::setTabOrder(qxt_d().listingTreeView,qxt_d().matchCaseOption); QWidget::setTabOrder(qxt_d().matchCaseOption,qxt_d().filterModeOption); QWidget::setTabOrder(qxt_d().filterModeOption,qxt_d().filterMode); QWidget::setTabOrder(qxt_d().filterMode,cancelButton); /*set the layout and title*/ setLayout(dlgLayout); setWindowTitle(tr("Filter")); }
void GenericDataCollectionTableFilterDialog::buildDialog() { setWindowTitle(tr("Search Table")); // Radio buttons for search: // Column (enable column selector) // table // selected // Check boxes for: // case sensitive // entire cell // Search value (based on what I want to find) // Replace value (baesd on what I want to find) QGroupBox* filterType = new QGroupBox(); m_rbString = new QRadioButton(tr("String")); m_rbRegExp = new QRadioButton(tr("Regular Expression")); m_rbWild = new QRadioButton(tr("Wild Card")); QPushButton* button; QVBoxLayout *vLayout; QVBoxLayout *vLayout2; //QHBoxLayout *hLayout; QFormLayout *fLayout = new QFormLayout; vLayout = new QVBoxLayout(); m_findValueLineEdit = new QLineEdit(); m_replaceValueLineEdit = new QLineEdit(); //hLayout = new QHBoxLayout(); vLayout->addWidget(new QLabel(tr("Search &Text"))); button = new QPushButton(tr("&Find")); connect(button, SIGNAL(released()), this, SLOT(find())); QHBoxLayout *hLayout2 = new QHBoxLayout(); hLayout2->addWidget(m_findValueLineEdit); hLayout2->addWidget(button); vLayout->addLayout(hLayout2); vLayout->addWidget(new QLabel(tr("Replace with"))); vLayout2 = new QVBoxLayout(); button = new QPushButton(tr("Replace")); connect(button, SIGNAL(released()), this, SLOT(replace())); vLayout2->addWidget(button); button = new QPushButton(tr("Replace All")); connect(button, SIGNAL(released()), this, SLOT(replaceAll())); vLayout2->addWidget(button); hLayout2 = new QHBoxLayout(); hLayout2->addWidget(m_replaceValueLineEdit); hLayout2->addLayout(vLayout2); vLayout->addLayout(hLayout2); hLayout2 = new QHBoxLayout(); vLayout2 = new QVBoxLayout(); m_matchCaseCB = new QCheckBox(tr("Match case")); vLayout2->addWidget(m_matchCaseCB); m_regularExpressionCB = new QCheckBox(tr("Regular expression")); vLayout2->addWidget(m_regularExpressionCB); hLayout2->addLayout(vLayout2); vLayout2 = new QVBoxLayout(); m_matchEntireCellCB = new QCheckBox(tr("Match cell only")); vLayout2->addWidget(m_matchEntireCellCB); m_selectionOnlyCB = new QCheckBox(tr("Current Selection Only")); vLayout2->addWidget(m_selectionOnlyCB); hLayout2->addLayout(vLayout2); vLayout->addLayout(hLayout2); QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Close); connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); vLayout->addWidget(buttonBox); /** hLayout2 = new QHBoxLayout(); m_matchCaseCB = new QCheckBox(tr("Match case")); hLayout2->addWidget(m_matchCaseCB); m_matchEntireCellCB = new QCheckBox(tr("Match cell only")); hLayout2->addWidget(m_matchEntireCellCB); vLayout->addLayout(hLayout2); hLayout2 = new QHBoxLayout(); m_regularExpressionCB = new QCheckBox(tr("Regular expression")); hLayout2->addWidget(m_regularExpressionCB); m_selectionOnlyCB = new QCheckBox(tr("Current Selection Only")); hLayout2->addWidget(m_selectionOnlyCB); vLayout->addLayout(hLayout2); **/ //vLayout = new QVBoxLayout(); //vLayout->addWidget(new QLabel(tr("Find: "))); //hLayout->addLayout(vLayout); //vLayout->addWidget(new QLabel(tr("Replace: "))); //hLayout->addLayout(vLayout); //hLayout->addLayout(vLayout); //vLayout = new QVBoxLayout(); //vLayout->addWidget(m_findValueLineEdit); //vLayout->addWidget(m_replaceValueLineEdit); //hLayout->addLayout(vLayout); fLayout->addRow(vLayout); setLayout(fLayout); /** m_configFilePath = new QLineEdit(); hLayout = new QHBoxLayout(); vLayout = new QVBoxLayout(); vLayout->addWidget(new QLabel(tr("Configuration File: "))); hLayout->addLayout(vLayout); vLayout = new QVBoxLayout(); vLayout->addWidget(m_configFilePath); hLayout->addLayout(vLayout); button = new QPushButton(tr("Load")); connect(button, SIGNAL(clicked()), this, SLOT(loadConfiguration())); hLayout->addWidget(button); button = new QPushButton(tr("Save")); connect(button, SIGNAL(clicked()), this, SLOT(saveConfiguration())); hLayout->addWidget(button); fLayout->addRow(hLayout); hLayout = new QHBoxLayout(); vLayout = new QVBoxLayout(); vLayout->addWidget(new QLabel(tr("Sort Fields:"))); button = new QPushButton(tr("Add")); connect(button, SIGNAL(clicked()), this, SLOT(addRow())); vLayout->addWidget(button); m_addButton = button; button = new QPushButton(tr("Delete")); connect(button, SIGNAL(clicked()), this, SLOT(delSelectedRow())); vLayout->addWidget(button); m_deleteButton = button; button = new QPushButton(tr("Up")); connect(button, SIGNAL(clicked()), this, SLOT(rowUp())); vLayout->addWidget(button); m_upButton = button; button = new QPushButton(tr("Down")); connect(button, SIGNAL(clicked()), this, SLOT(rowDown())); vLayout->addWidget(button); m_downButton = button; vLayout->addStretch(); hLayout->addLayout(vLayout); m_tableView = new QTableView(); m_tableModel = new TableSortFieldTableModel(m_dataCollection); m_tableView->setModel(m_tableModel); // Parameter sets the owning parent that will delete the delegate. LinkBackFilterDelegate* delegate = new LinkBackFilterDelegate(m_tableView); m_tableView->setItemDelegate(delegate); CheckBoxOnlyDelegate * cboDelegate = new CheckBoxOnlyDelegate(m_tableView); m_tableView->setItemDelegateForColumn(TableSortFieldTableModel::ascendingColumn, cboDelegate); m_tableView->setItemDelegateForColumn(TableSortFieldTableModel::caseColumn, cboDelegate); hLayout->addWidget(m_tableView); fLayout->addRow(hLayout); QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal); connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); fLayout->addRow(buttonBox); setLayout(fLayout); QSettings settings; restoreGeometry(settings.value(Constants::Settings_SortFieldDlgGeometry).toByteArray()); setConfigFilePath(settings.value(Constants::SortFieldConfigDialogLastConfigPath).toString()); QString s = settings.value(Constants::SortFieldConfigDialogRoutingColumnWidths).toString(); if (s.length() > 0) { QStringList list = s.split(','); bool ok = true; for (int i=0; i<list.size() && i<TableSortFieldTableModel::numColumns; ++i) { int width = list[i].toInt(&ok); if (ok && width > 0) { m_tableView->setColumnWidth(i, width); } } } connect(m_tableView->selectionModel(), SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)), this, SLOT(selectionChanged(const QItemSelection &, const QItemSelection &))); **/ enableButtons(); }
ControlEditorDialog::ControlEditorDialog ( QWidget *parent, RosegardenDocument *doc, DeviceId device ): QMainWindow(parent), m_studio(&doc->getStudio()), m_doc(doc), m_device(device), m_modified(false) { RG_DEBUG << "ControlEditorDialog::ControlEditorDialog: device is " << m_device << endl; QWidget *mainFrame = new QWidget(this); QVBoxLayout *mainFrameLayout = new QVBoxLayout; setCentralWidget(mainFrame); setAttribute(Qt::WA_DeleteOnClose); // everything else failed, so screw it, let's just set the fscking minimum // width the brute force way setMinimumWidth(935); setWindowTitle(tr("Manage Controllers")); QString deviceName(tr("<no device>")); MidiDevice *md = dynamic_cast<MidiDevice *>(m_studio->getDevice(m_device)); if (md) deviceName = strtoqstr(md->getName()); // spacing hack! new QLabel("", mainFrame); new QLabel(tr(" Controllers for %1 (device %2)") .arg(deviceName) .arg(device), mainFrame); new QLabel("", mainFrame); QStringList sl; sl << tr("Name ") << tr("Type ") << tr("Number ") << tr("Description ") << tr("Min. value ") << tr("Max. value ") << tr("Default value ") << tr("Color ") << tr("Position on instrument panel"); m_treeWidget = new QTreeWidget(mainFrame); m_treeWidget->setHeaderLabels(sl); m_treeWidget->setSortingEnabled(true); mainFrameLayout->addWidget(m_treeWidget); QFrame *btnBox = new QFrame(mainFrame); mainFrameLayout->addWidget(btnBox); mainFrame->setLayout(mainFrameLayout); btnBox->setSizePolicy( QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed)); // QT3: I don't think it's necessary to replace the following ",4, 10" with // anything to explicitly set the dimensions of the HBox, but there might be // some compatibility trickery I'm not remembering, etc. Leaving as a // reminder in case the layout turns out broken: QHBoxLayout* layout = new QHBoxLayout(btnBox /*, 4, 10 */); m_addButton = new QPushButton(tr("Add"), btnBox); m_deleteButton = new QPushButton(tr("Delete"), btnBox); m_closeButton = new QPushButton(tr("Close"), btnBox); m_addButton->setToolTip(tr("Add a Control Parameter to the Studio")); m_deleteButton->setToolTip(tr("Delete a Control Parameter from the Studio")); m_closeButton->setToolTip(tr("Close the Control Parameter editor")); layout->addStretch(10); layout->addWidget(m_addButton); layout->addWidget(m_deleteButton); layout->addSpacing(30); layout->addWidget(m_closeButton); layout->addSpacing(5); connect(m_addButton, SIGNAL(released()), SLOT(slotAdd())); connect(m_deleteButton, SIGNAL(released()), SLOT(slotDelete())); setupActions(); connect(CommandHistory::getInstance(), SIGNAL(commandExecuted()), this, SLOT(slotUpdate())); connect(m_treeWidget, SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)), SLOT(slotEdit(QTreeWidgetItem *, int))); // Highlight all columns - enable extended selection mode // m_treeWidget->setAllColumnsShowFocus(true); m_treeWidget->setSelectionMode(QAbstractItemView::ExtendedSelection); initDialog(); // Set the top item in the list, if able. if (m_treeWidget->topLevelItemCount()) { m_treeWidget->setCurrentItem(m_treeWidget->topLevelItem(0)); } }
QWidget * QCamVesta::buildGUI(QWidget * parent) { QWidget * remoteCTRL=QCamV4L2::buildGUI(parent); //QHGroupBox* vestaCtrl=new QHGroupBox("Vesta controls",remoteCTRL); QGridBox * sliders= new QGridBox(/*vestaCtrl*/VctrlBox,Qt::Vertical,3); /* QHBox * sliders=new QHBox(remoteCTRL); QVBox * left = new QVBox(sliders); QVBox * right = new QVBox(sliders); */ if (QCamUtilities::expertMode()) { QCheckBox * backLight = new QCheckBox(tr("Back Light"),sliders); connect(backLight,SIGNAL(toggled(bool)),this,SLOT(setBackLight(bool))); backLight->setToolTip(tr("In case the object you are viewing with the camera is\n" "in front of a bright background (for example, a window\n" "or some bright lights), the automatic exposure unit may\n" "make the image too dark. In that case you can turn the\n" "backlight compensation mode off")); QCheckBox * flicker = new QCheckBox(tr("Anti-flicker"),sliders); connect(flicker,SIGNAL(toggled(bool)),this,SLOT(setFlicker(bool))); flicker->setToolTip(tr("Suppress 'flickering' of the image when light with a fluo tube")); } remoteCTRLgama_=new QCamSlider(tr("Gamma"),false,sliders); // not very clean...but works remoteCTRLgama_->setMinValue(0); remoteCTRLgama_->setMaxValue(32); remoteCTRLgama_->setToolTip(tr("Low gamma implies less contrasts")); remoteCTRLgain_=new QCamSlider(tr("Gain"),true,sliders); remoteCTRLgain_->setToolTip(tr("More Gain implies more noise in the images")); remoteCTRLexposure_=new QCamSlider(tr("Exp."),true,sliders,0,65535,true); remoteCTRLexposure_->setToolTip(tr("More exposure reduce noise in images.\n" "(manual exposure setting don't work on type 740\n" "if automatic gain is activated).") ); if (QCamUtilities::expertMode()) { remoteCTRLcompression_=new QCamSlider(tr("Comp."),false,sliders,0,3); remoteCTRLnoiseRemoval_=new QCamSlider(tr("Noise"),false,sliders,0,3); remoteCTRLsharpness_=new QCamSlider(tr("Sharp."),false,sliders,0,65535); connect(this,SIGNAL(compressionChange(int)),remoteCTRLcompression_,SLOT(setValue(int))); connect(remoteCTRLcompression_,SIGNAL(valueChange(int)),this,SLOT(setCompression(int))); connect(this,SIGNAL(noiseRemovalChange(int)),remoteCTRLnoiseRemoval_,SLOT(setValue(int))); connect(remoteCTRLnoiseRemoval_,SIGNAL(valueChange(int)),this,SLOT(setNoiseRemoval(int))); remoteCTRLnoiseRemoval_->setToolTip(tr("Dynamic Noise removal (0=none, 3=high) (0 give brighter image)")); connect(this,SIGNAL(sharpnessChange(int)),remoteCTRLsharpness_,SLOT(setValue(int))); connect(remoteCTRLsharpness_,SIGNAL(valueChange(int)),this,SLOT(setSharpness(int))); remoteCTRLsharpness_->setToolTip(tr("Shaprness enhancement (0=none, 65536=high) (low value blurs image)")); } int wbValue[]={PWC_WB_AUTO, PWC_WB_INDOOR, PWC_WB_OUTDOOR, PWC_WB_FL, PWC_WB_MANUAL}; const char *wbLabel[]={"Auto", "In","Out","Neon","Manual"}; remoteCTRLWhiteBalance_=new QCamRadioBox("White Balance",VctrlBox,5,wbValue,wbLabel,5); QWidget* whiteBalanceGroup=new QWidget(); QHBoxLayout* whiteBalanceGroup_layout= new QHBoxLayout(); whiteBalanceGroup->setLayout(whiteBalanceGroup_layout); connect(remoteCTRLWhiteBalance_,SIGNAL(change(int)),this,SLOT(setWhiteBalanceMode(int))); connect(this,SIGNAL(whiteBalanceModeChange(int)),remoteCTRLWhiteBalance_,SLOT(update(int))); QCheckBox * liveWBupdateB = new QCheckBox(tr("live"),whiteBalanceGroup); connect(liveWBupdateB,SIGNAL(toggled(bool)),this,SLOT(setLiveWhiteBalance(bool))); liveWBupdateB->setToolTip(tr("Live Update of red/blue value in automatic mode")); whiteBalanceGroup_layout->addWidget(liveWBupdateB); remoteCTRLWBred_ = new QCamSlider(tr("red bal."),false,whiteBalanceGroup,0,65535); whiteBalanceGroup_layout->addWidget(remoteCTRLWBred_); connect(this,SIGNAL(whiteBalanceRedChange(int)),remoteCTRLWBred_,SLOT(setValue(int))); connect(remoteCTRLWBred_,SIGNAL(valueChange(int)),this,SLOT(setWhiteBalanceRed(int))); remoteCTRLWBblue_ = new QCamSlider(tr("blue bal."),false,whiteBalanceGroup,0,65535); whiteBalanceGroup_layout->addWidget(remoteCTRLWBblue_); connect(this,SIGNAL(whiteBalanceBlueChange(int)),remoteCTRLWBblue_,SLOT(setValue(int))); connect(remoteCTRLWBblue_,SIGNAL(valueChange(int)),this,SLOT(setWhiteBalanceBlue(int))); remoteCTRLWhiteBalance_->layout()->addWidget(whiteBalanceGroup); remoteCTRLWBred_->setEnabled(false); remoteCTRLWBblue_->setEnabled(false); remoteCTRLWhiteBalance_->show(); exposureTimeLeft_=NULL; connect(this,SIGNAL(gainChange(int)),remoteCTRLgain_,SLOT(setValue(int))); connect(remoteCTRLgain_,SIGNAL(valueChange(int)),this,SLOT(setGain(int))); /* connect(this,SIGNAL(exposureChange(int)),remoteCTRLexposure_, SLOT(setValue(int))); */ connect(remoteCTRLexposure_,SIGNAL(valueChange(int)),this,SLOT(setExposure(int))); connect(this,SIGNAL(gamaChange(int)),remoteCTRLgama_,SLOT(setValue(int))); connect(remoteCTRLgama_,SIGNAL(valueChange(int)),this,SLOT(setGama(int))); QCamHBox* settings=new QCamHBox(VctrlBox); settings->setToolTip(tr("save/restore settings of gain,exposure & white balance")); QPushButton* saveSettingsB =new QPushButton(tr("save"),settings); saveSettingsB->setToolTip(tr("Save User settings (gain,exposure & white balance)")); connect(saveSettingsB,SIGNAL(released()),this,SLOT(saveSettings())); QPushButton* restoreSettingsB =new QPushButton(tr("restore"),settings); restoreSettingsB->setToolTip(tr("Restore User settings")); connect(restoreSettingsB,SIGNAL(released()),this,SLOT(restoreSettings())); QPushButton* restoreFactorySettingsB =new QPushButton(tr("factory"),settings); restoreFactorySettingsB->setToolTip(tr("Restore factory default settings")); connect(restoreFactorySettingsB,SIGNAL(released()),this,SLOT(restoreFactorySettings())); remoteCTRLframeRate_ =new QCamHGroupBox(tr("fps / long exposure"),remoteCTRL); int frameRate[]={5,10,15,20,25,30}; remoteCTRLframeRate2_=new QCamComboBox("fps",remoteCTRLframeRate_,6,frameRate,NULL); remoteCTRLframeRate2_->setToolTip(tr("Camera frame rate")); connect(this,SIGNAL(frameRateChange(int)),remoteCTRLframeRate2_,SLOT(update(int))); connect(remoteCTRLframeRate2_,SIGNAL(change(int)),this,SLOT(setFrameRate(int))); remoteCTRLframeRate2_->show(); int scModeTable[]={SCmodNone,SCmodPPort2,SCmodLed,SCmodSerial}; const char* scModeLabel[]={"SC mod : None","SC mod : // port","SC mod : TUC led","SC mod : serial"}; SCmodSelector_ = new QCamComboBox("SC mod",remoteCTRLframeRate_,4,scModeTable,scModeLabel); SCmodSelector_->setToolTip(tr("Long exposure device")); connect(SCmodSelector_,SIGNAL(change(int)),this,SLOT(setSCmod(int))); initRemoteControlLongExposure(remoteCTRLframeRate_); setBestQuality(); refreshPictureSettings(); remoteCTRL->show(); return remoteCTRL; }
/** * @brief 右侧布局 */ void MainWindow::setupMainWindow() { btnGroup = new QButtonGroup; QGridLayout *grid = new QGridLayout; QSignalMapper *mapper = new QSignalMapper(this); QPixmap bmp; QString name; for (int i = 0; i < FunCount; i++) { bmp = getFuncIcon(i); funcBtn[i] = createPushButton(QSize(97, 132), bmp, QString(), SLOT(updateButtonTip()), SLOT(updateButtonTip())); name = getFuncName(i); funcLbl[i] = new Label; funcLbl[i]->setCustomText(name, Qt::AlignCenter); funcBtn[i]->setObjectName(name); btnGroup->addButton(funcBtn[i]); QVBoxLayout *vbox = new QVBoxLayout; vbox->addWidget(funcBtn[i]); vbox->addWidget(funcLbl[i]); connect(funcBtn[i], SIGNAL(released()), mapper, SLOT(map())); mapper->setMapping(funcBtn[i], i); grid->addLayout(vbox, i / 5, i % 5); } connect(mapper, SIGNAL(mapped(int)), this, SLOT(onFuncSelect(int))); grid->setVerticalSpacing(15); grid->setHorizontalSpacing(50); mainBtnStyleRender(); logo = new QLabel; logo->setPixmap(QPixmap("../icons/mainwindow/logo.png")); title = new QLabel; title->setText("电 源 远 程 监 控 系 统"); title->setAlignment(Qt::AlignCenter); #ifdef ARM_COMPILE title->setStyleSheet("color:rgb(200,19,55)"); #else title->setStyleSheet("font-size: 30px;color:rgb(200,19,55)"); #endif QHBoxLayout *logoLayout = new QHBoxLayout; logoLayout->addSpacing(20); logoLayout->addWidget(logo); logoLayout->addSpacing(80); logoLayout->addWidget(title); logoLayout->addStretch(); QHBoxLayout *funcLayout = new QHBoxLayout; funcLayout->addStretch(); funcLayout->addLayout(grid); funcLayout->addStretch(); QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout->addLayout(logoLayout); mainLayout->addSpacing(80); mainLayout->addLayout(funcLayout); mainLayout->addStretch(); mainLayout->setContentsMargins(10, 10, 10, 10); setLayout(mainLayout); }
void KCommonDecoration::addButtons(ButtonContainer &btnContainer, const QString& s, bool isLeft) { if (s.length() > 0) { for (unsigned n=0; n < s.length(); n++) { KCommonDecorationButton *btn = 0; switch (s[n]) { case 'M': // Menu button if (!m_button[MenuButton]){ btn = createButton(MenuButton); if (!btn) break; btn->setTipText(i18n("Menu") ); btn->setRealizeButtons(LeftButton|RightButton); connect(btn, SIGNAL(pressed()), SLOT(menuButtonPressed())); connect(btn, SIGNAL(released()), this, SLOT(menuButtonReleased())); m_button[MenuButton] = btn; } break; case 'S': // OnAllDesktops button if (!m_button[OnAllDesktopsButton]){ btn = createButton(OnAllDesktopsButton); if (!btn) break; const bool oad = isOnAllDesktops(); btn->setTipText(oad?i18n("Not on all desktops"):i18n("On all desktops") ); btn->setToggleButton(true); btn->setOn( oad ); connect(btn, SIGNAL(clicked()), SLOT(toggleOnAllDesktops())); m_button[OnAllDesktopsButton] = btn; } break; case 'H': // Help button if ((!m_button[HelpButton]) && providesContextHelp()){ btn = createButton(HelpButton); if (!btn) break; btn->setTipText(i18n("Help") ); connect(btn, SIGNAL(clicked()), SLOT(showContextHelp())); m_button[HelpButton] = btn; } break; case 'I': // Minimize button if ((!m_button[MinButton]) && isMinimizable()){ btn = createButton(MinButton); if (!btn) break; btn->setTipText(i18n("Minimize") ); connect(btn, SIGNAL(clicked()), SLOT(minimize())); m_button[MinButton] = btn; } break; case 'A': // Maximize button if ((!m_button[MaxButton]) && isMaximizable()){ btn = createButton(MaxButton); if (!btn) break; btn->setRealizeButtons(LeftButton|MidButton|RightButton); const bool max = maximizeMode()==MaximizeFull; btn->setTipText(max?i18n("Restore"):i18n("Maximize") ); btn->setToggleButton(true); btn->setOn( max ); connect(btn, SIGNAL(clicked()), SLOT(slotMaximize())); m_button[MaxButton] = btn; } break; case 'X': // Close button if ((!m_button[CloseButton]) && isCloseable()){ btn = createButton(CloseButton); if (!btn) break; btn->setTipText(i18n("Close") ); connect(btn, SIGNAL(clicked()), SLOT(closeWindow())); m_button[CloseButton] = btn; } break; case 'F': // AboveButton button if (!m_button[AboveButton]){ btn = createButton(AboveButton); if (!btn) break; bool above = keepAbove(); btn->setTipText(above?i18n("Do not keep above others"):i18n("Keep above others") ); btn->setToggleButton(true); btn->setOn( above ); connect(btn, SIGNAL(clicked()), SLOT(slotKeepAbove())); m_button[AboveButton] = btn; } break; case 'B': // BelowButton button if (!m_button[BelowButton]){ btn = createButton(BelowButton); if (!btn) break; bool below = keepBelow(); btn->setTipText(below?i18n("Do not keep below others"):i18n("Keep below others") ); btn->setToggleButton(true); btn->setOn( below ); connect(btn, SIGNAL(clicked()), SLOT(slotKeepBelow())); m_button[BelowButton] = btn; } break; case 'L': // Shade button if ((!m_button[ShadeButton]) && isShadeable()){ btn = createButton(ShadeButton); if (!btn) break; bool shaded = isSetShade(); btn->setTipText(shaded?i18n("Unshade"):i18n("Shade") ); btn->setToggleButton(true); btn->setOn( shaded ); connect(btn, SIGNAL(clicked()), SLOT(slotShade())); m_button[ShadeButton] = btn; } break; case '_': // Spacer item btnContainer.append(0); } if (btn) { btn->setLeft(isLeft); btn->setSize(QSize(layoutMetric(LM_ButtonWidth, true, btn),layoutMetric(LM_ButtonHeight, true, btn)) ); btn->show(); btnContainer.append(btn); } } } }
/** Met en place le dialogue */ void QETPrintPreviewDialog::build() { preview_ = new QPrintPreviewWidget(printer_); diagrams_label_ = new QLabel(tr("Sch\351mas \340 imprimer\240:")); diagrams_list_ = new DiagramsChooser(project_); diagrams_select_all_ = new QPushButton(tr("Tout cocher")); diagrams_select_none_ = new QPushButton(tr("Tout d\351cocher")); toggle_diagrams_list_ = new QAction(QET::Icons::Diagram, tr("Cacher la liste des sch\351mas"), this); toggle_print_options_ = new QAction(QET::Icons::Configure, tr("Cacher les options d'impression"), this); adjust_width_ = new QAction(QET::Icons::ViewFitWidth, tr("Ajuster la largeur"), this); adjust_page_ = new QAction(QET::Icons::ViewFitWindow, tr("Ajuster la page"), this); zoom_out_ = new QAction(QET::Icons::ZoomOut, tr("Zoom arri\350re"), this); zoom_box_ = new QComboBox(this); zoom_in_ = new QAction(QET::Icons::ZoomIn, tr("Zoom avant"), this); landscape_ = new QAction(QET::Icons::PrintLandscape, tr("Paysage"), this); portrait_ = new QAction(QET::Icons::PrintPortrait, tr("Portrait"), this); first_page_ = new QAction(QET::Icons::ArrowLeftDouble, tr("Premi\350re page"), this); previous_page_ = new QAction(QET::Icons::ArrowLeft, tr("Page pr\351c\351dente"), this); next_page_ = new QAction(QET::Icons::ArrowRight, tr("Page suivante"), this); last_page_ = new QAction(QET::Icons::ArrowRightDouble, tr("Derni\350re page"), this); single_page_view_ = new QAction(QET::Icons::SinglePage, tr("Afficher une seule page"), this); facing_pages_view_ = new QAction(QET::Icons::PrintTwoPages, tr("Afficher deux pages"), this); all_pages_view_ = new QAction(QET::Icons::PrintAllPages, tr("Afficher un aper\347u de toutes les pages"), this); page_setup_ = new QAction(QET::Icons::DocumentPrintFrame, tr("Mise en page"), this); toggle_diagrams_list_ -> setCheckable(true); toggle_diagrams_list_ -> setChecked(true); toggle_print_options_ -> setCheckable(true); toggle_print_options_ -> setChecked(true); #ifdef Q_OS_WIN32 /* Sous Windows, le QPageSetupDialog utilise le dialogue natif ; ce dernier ne peut gerer que les imprimantes physiques ("native printers" ). cf avertissement : QAbstractPageSetupDialog::QAbstractPageSetupDialog: Page setup dialog cannot be used on non-native printers */ if (!(printer_ -> outputFileName().isEmpty())) { page_setup_ -> setEnabled(false); page_setup_ -> setText(tr("Mise en page (non disponible sous Windows pour l'impression PDF/PS)")); } #endif toolbar_ = new QToolBar(); toolbar_ -> addAction(toggle_diagrams_list_); toolbar_ -> addAction(toggle_print_options_); toolbar_ -> addSeparator(); toolbar_ -> addAction(adjust_width_); toolbar_ -> addAction(adjust_page_); toolbar_ -> addAction(zoom_out_); toolbar_ -> addWidget(zoom_box_); toolbar_ -> addAction(zoom_in_); toolbar_ -> addSeparator(); toolbar_ -> addAction(landscape_); toolbar_ -> addAction(portrait_); toolbar_ -> addSeparator(); toolbar_ -> addAction(first_page_); toolbar_ -> addAction(previous_page_); toolbar_ -> addAction(next_page_); toolbar_ -> addAction(last_page_); toolbar_ -> addSeparator(); toolbar_ -> addAction(single_page_view_); toolbar_ -> addAction(facing_pages_view_); toolbar_ -> addAction(all_pages_view_); toolbar_ -> addSeparator(); toolbar_ -> addAction(page_setup_); print_options_box_= new QGroupBox(tr("Options d'impression")); use_full_page_ = new QCheckBox(tr("Utiliser toute la feuille")); use_full_page_ -> setChecked(printer_ -> fullPage()); use_full_page_label_ = new QLabel(tr( "Si cette option est coch\351e, les marges de la feuille seront " "ignor\351es et toute sa surface sera utilis\351e pour l'impression. " "Cela peut ne pas \352tre support\351 par votre imprimante." )); use_full_page_label_ -> setWordWrap(true); use_full_page_label_ -> setContentsMargins(20, 0, 0, 0); fit_diagram_to_page_ = new QCheckBox(tr("Adapter le sch\351ma \340 la page")); fit_diagram_to_page_label_ = new QLabel(tr( "Si cette option est coch\351e, le sch\351ma sera agrandi ou " "r\351tr\351ci de fa\347on \340 remplir toute la surface imprimable " "d'une et une seule page." )); fit_diagram_to_page_label_ -> setWordWrap(true); fit_diagram_to_page_label_ -> setContentsMargins(20, 0, 0, 0); fit_diagram_to_page_ -> setChecked(true); // recupere les parametres d'export definis dans la configuration de l'application ExportProperties default_print_properties = QETDiagramEditor::defaultPrintProperties(); render_properties_ = new ExportPropertiesWidget(default_print_properties); render_properties_ -> setPrintingMode(true); buttons_ = new QDialogButtonBox(); buttons_ -> addButton(new QPushButton(QET::Icons::DocumentPrint, tr("Imprimer")), QDialogButtonBox::AcceptRole); buttons_ -> addButton(QDialogButtonBox::Cancel); connect(diagrams_select_all_, SIGNAL(released()), this, SLOT(selectAllDiagrams())); connect(diagrams_select_none_, SIGNAL(released()), this, SLOT(selectNoDiagram())); connect(toggle_diagrams_list_, SIGNAL(toggled(bool)), this, SLOT(setDiagramsListVisible(bool))); connect(toggle_print_options_, SIGNAL(toggled(bool)), this, SLOT(setPrintOptionsVisible(bool))); connect(adjust_width_, SIGNAL(triggered()), preview_, SLOT(fitToWidth())); connect(adjust_page_, SIGNAL(triggered()), preview_, SLOT(fitInView())); connect(zoom_out_, SIGNAL(triggered()), this, SLOT(zoomOut())); connect(zoom_in_, SIGNAL(triggered()), this, SLOT(zoomIn())); connect(landscape_, SIGNAL(triggered()), preview_, SLOT(setLandscapeOrientation())); connect(portrait_, SIGNAL(triggered()), preview_, SLOT(setPortraitOrientation())); connect(first_page_, SIGNAL(triggered()), this, SLOT(firstPage())); connect(previous_page_, SIGNAL(triggered()), this, SLOT(previousPage())); connect(next_page_, SIGNAL(triggered()), this, SLOT(nextPage())); connect(last_page_, SIGNAL(triggered()), this, SLOT(lastPage())); connect(single_page_view_, SIGNAL(triggered()), preview_, SLOT(setSinglePageViewMode())); connect(facing_pages_view_, SIGNAL(triggered()), preview_, SLOT(setFacingPagesViewMode())); connect(all_pages_view_, SIGNAL(triggered()), preview_, SLOT(setAllPagesViewMode())); connect(page_setup_, SIGNAL(triggered()), this, SLOT(pageSetup())); connect(use_full_page_, SIGNAL(toggled(bool)), this, SLOT(useFullPage(bool))); connect(fit_diagram_to_page_, SIGNAL(toggled(bool)), this, SLOT(fitDiagramToPage(bool))); connect(render_properties_, SIGNAL(optionChanged()), preview_, SLOT(updatePreview())); connect(preview_, SIGNAL(previewChanged()), this, SLOT(updateZoomList())); connect(zoom_box_, SIGNAL(currentIndexChanged(int)), this, SLOT(updatePreviewZoom())); connect(buttons_, SIGNAL(accepted()), this, SLOT(accept())); connect(buttons_, SIGNAL(rejected()), this, SLOT(reject())); hlayout0_ = new QHBoxLayout(); vlayout0_ = new QVBoxLayout(); vlayout1_ = new QVBoxLayout(); vlayout2_ = new QVBoxLayout(); vlayout1_ -> addWidget(use_full_page_); vlayout1_ -> addWidget(use_full_page_label_); vlayout1_ -> addWidget(fit_diagram_to_page_); vlayout1_ -> addWidget(fit_diagram_to_page_label_); print_options_box_ -> setLayout(vlayout1_); vlayout2_ -> addWidget(diagrams_label_); vlayout2_ -> addWidget(diagrams_list_); vlayout2_ -> addWidget(diagrams_select_all_); vlayout2_ -> addWidget(diagrams_select_none_); hlayout0_ -> addLayout(vlayout2_); hlayout0_ -> addWidget(preview_); vlayout0_ -> addWidget(toolbar_); vlayout0_ -> addLayout(hlayout0_); vlayout0_ -> addWidget(render_properties_); vlayout0_ -> addWidget(print_options_box_); vlayout0_ -> addWidget(buttons_); setLayout(vlayout0_); updateZoomList(); }
void ArchaeoLinesDialog::createDialogContent() { al = GETSTELMODULE(ArchaeoLines); ui->setupUi(dialog); #ifdef Q_OS_WIN //Kinetic scrolling for tablet pc and pc QList<QWidget *> addscroll; addscroll << ui->aboutTextBrowser; installKineticScrolling(addscroll); #endif connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate())); connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())); connect(ui->TitleBar, SIGNAL(movedTo(QPoint)), this, SLOT(handleMovedTo(QPoint))); //ui->useDmsFormatCheckBox->setChecked(al->isDmsFormat()); //connect(ui->useDmsFormatCheckBox, SIGNAL(toggled(bool)), al, SLOT(useDmsFormat(bool))); ui->equinoxCheckBox->setChecked(al->isEquinoxDisplayed()); connect(ui->equinoxCheckBox, SIGNAL(toggled(bool)), al, SLOT(showEquinox(bool))); ui->solsticesCheckBox->setChecked(al->isSolsticesDisplayed()); connect(ui->solsticesCheckBox, SIGNAL(toggled(bool)), al, SLOT(showSolstices(bool))); ui->crossquarterCheckBox->setChecked(al->isCrossquartersDisplayed()); connect(ui->crossquarterCheckBox, SIGNAL(toggled(bool)), al, SLOT(showCrossquarters(bool))); ui->majorStandstillCheckBox->setChecked(al->isMajorStandstillsDisplayed()); connect(ui->majorStandstillCheckBox, SIGNAL(toggled(bool)), al, SLOT(showMajorStandstills(bool))); ui->minorStandstillCheckBox->setChecked(al->isMinorStandstillsDisplayed()); connect(ui->minorStandstillCheckBox, SIGNAL(toggled(bool)), al, SLOT(showMinorStandstills(bool))); ui->zenithPassageCheckBox->setChecked(al->isZenithPassageDisplayed()); connect(ui->zenithPassageCheckBox, SIGNAL(toggled(bool)), al, SLOT(showZenithPassage(bool))); ui->nadirPassageCheckBox->setChecked(al->isNadirPassageDisplayed()); connect(ui->nadirPassageCheckBox, SIGNAL(toggled(bool)), al, SLOT(showNadirPassage(bool))); ui->selectedObjectCheckBox->setChecked(al->isSelectedObjectDisplayed()); connect(ui->selectedObjectCheckBox, SIGNAL(toggled(bool)), al, SLOT(showSelectedObject(bool))); ui->currentSunCheckBox->setChecked(al->isCurrentSunDisplayed()); connect(ui->currentSunCheckBox, SIGNAL(toggled(bool)), al, SLOT(showCurrentSun(bool))); ui->currentMoonCheckBox->setChecked(al->isCurrentMoonDisplayed()); connect(ui->currentMoonCheckBox, SIGNAL(toggled(bool)), al, SLOT(showCurrentMoon(bool))); // Planet ComboBox requires special handling! setCurrentPlanetFromApp(); connect(al, SIGNAL(currentPlanetChanged(ArchaeoLine::Line)), this, SLOT(setCurrentPlanetFromApp())); connect(ui->currentPlanetComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(setCurrentPlanetFromGUI(int))); ui->customAzimuth1CheckBox->setChecked(al->isCustomAzimuth1Displayed()); connect(ui->customAzimuth1CheckBox, SIGNAL(toggled(bool)), al, SLOT(showCustomAzimuth1(bool))); ui->customAzimuth2CheckBox->setChecked(al->isCustomAzimuth2Displayed()); connect(ui->customAzimuth2CheckBox, SIGNAL(toggled(bool)), al, SLOT(showCustomAzimuth2(bool))); ui->customAzimuth1DoubleSpinBox->setValue(al->getLineAngle(ArchaeoLine::CustomAzimuth1)); ui->customAzimuth2DoubleSpinBox->setValue(al->getLineAngle(ArchaeoLine::CustomAzimuth2)); connect(ui->customAzimuth1DoubleSpinBox, SIGNAL(valueChanged(double)), al, SLOT(setCustomAzimuth1(double))); connect(ui->customAzimuth2DoubleSpinBox, SIGNAL(valueChanged(double)), al, SLOT(setCustomAzimuth2(double))); ui->customAzimuth1LineEdit->setText(al->getLineLabel(ArchaeoLine::CustomAzimuth1)); ui->customAzimuth2LineEdit->setText(al->getLineLabel(ArchaeoLine::CustomAzimuth2)); connect(ui->customAzimuth1LineEdit, SIGNAL(textChanged(QString)), al, SLOT(setCustomAzimuth1Label(QString))); connect(ui->customAzimuth2LineEdit, SIGNAL(textChanged(QString)), al, SLOT(setCustomAzimuth2Label(QString))); equinoxColor = al->getLineColor(ArchaeoLine::Equinox); solsticeColor = al->getLineColor(ArchaeoLine::Solstices); crossquarterColor = al->getLineColor(ArchaeoLine::Crossquarters); majorStandstillColor = al->getLineColor(ArchaeoLine::MajorStandstill); minorStandstillColor = al->getLineColor(ArchaeoLine::MinorStandstill); zenithPassageColor = al->getLineColor(ArchaeoLine::ZenithPassage); nadirPassageColor = al->getLineColor(ArchaeoLine::NadirPassage); selectedObjectColor = al->getLineColor(ArchaeoLine::SelectedObject); currentSunColor = al->getLineColor(ArchaeoLine::CurrentSun); currentMoonColor = al->getLineColor(ArchaeoLine::CurrentMoon); currentPlanetColor = al->getLineColor(ArchaeoLine::CurrentPlanetNone); customAzimuth1Color = al->getLineColor(ArchaeoLine::CustomAzimuth1); customAzimuth2Color = al->getLineColor(ArchaeoLine::CustomAzimuth2); equinoxColorPixmap=QPixmap(48, 12); equinoxColorPixmap.fill(equinoxColor); ui->equinoxColorToolButton->setIconSize(QSize(48, 12)); ui->equinoxColorToolButton->setIcon(QIcon(equinoxColorPixmap)); solsticeColorPixmap=QPixmap(48, 12); solsticeColorPixmap.fill(solsticeColor); ui->solsticesColorToolButton->setIconSize(QSize(48, 12)); ui->solsticesColorToolButton->setIcon(QIcon(solsticeColorPixmap)); crossquarterColorPixmap=QPixmap(48, 12); crossquarterColorPixmap.fill(crossquarterColor); ui->crossquarterColorToolButton->setIconSize(QSize(48, 12)); ui->crossquarterColorToolButton->setIcon(QIcon(crossquarterColorPixmap)); minorStandstillColorPixmap=QPixmap(48, 12); minorStandstillColorPixmap.fill(minorStandstillColor); ui->minorStandstillColorToolButton->setIconSize(QSize(48, 12)); ui->minorStandstillColorToolButton->setIcon(QIcon(minorStandstillColorPixmap)); majorStandstillColorPixmap=QPixmap(48, 12); majorStandstillColorPixmap.fill(majorStandstillColor); ui->majorStandstillColorToolButton->setIconSize(QSize(48, 12)); ui->majorStandstillColorToolButton->setIcon(QIcon(majorStandstillColorPixmap)); zenithPassageColorPixmap=QPixmap(48, 12); zenithPassageColorPixmap.fill(zenithPassageColor); ui->zenithPassageColorToolButton->setIconSize(QSize(48, 12)); ui->zenithPassageColorToolButton->setIcon(QIcon(zenithPassageColorPixmap)); nadirPassageColorPixmap=QPixmap(48, 12); nadirPassageColorPixmap.fill(nadirPassageColor); ui->nadirPassageColorToolButton->setIconSize(QSize(48, 12)); ui->nadirPassageColorToolButton->setIcon(QIcon(nadirPassageColorPixmap)); selectedObjectColorPixmap=QPixmap(48, 12); selectedObjectColorPixmap.fill(selectedObjectColor); ui->selectedObjectColorToolButton->setIconSize(QSize(48, 12)); ui->selectedObjectColorToolButton->setIcon(QIcon(selectedObjectColorPixmap)); currentSunColorPixmap=QPixmap(48, 12); currentSunColorPixmap.fill(currentSunColor); ui->currentSunColorToolButton->setIconSize(QSize(48, 12)); ui->currentSunColorToolButton->setIcon(QIcon(currentSunColorPixmap)); currentMoonColorPixmap=QPixmap(48, 12); currentMoonColorPixmap.fill(currentMoonColor); ui->currentMoonColorToolButton->setIconSize(QSize(48, 12)); ui->currentMoonColorToolButton->setIcon(QIcon(currentMoonColorPixmap)); currentPlanetColorPixmap=QPixmap(48, 12); currentPlanetColorPixmap.fill(currentPlanetColor); ui->currentPlanetColorToolButton->setIconSize(QSize(48, 12)); ui->currentPlanetColorToolButton->setIcon(QIcon(currentPlanetColorPixmap)); customAzimuth1ColorPixmap=QPixmap(48, 12); customAzimuth1ColorPixmap.fill(customAzimuth1Color); ui->customAzimuth1ColorToolButton->setIconSize(QSize(48, 12)); ui->customAzimuth1ColorToolButton->setIcon(QIcon(customAzimuth1ColorPixmap)); customAzimuth2ColorPixmap=QPixmap(48, 12); customAzimuth2ColorPixmap.fill(customAzimuth2Color); ui->customAzimuth2ColorToolButton->setIconSize(QSize(48, 12)); ui->customAzimuth2ColorToolButton->setIcon(QIcon(customAzimuth2ColorPixmap)); connect(ui->equinoxColorToolButton, SIGNAL(released()), this, SLOT(askEquinoxColor())); connect(ui->solsticesColorToolButton, SIGNAL(released()), this, SLOT(askSolsticeColor())); connect(ui->crossquarterColorToolButton, SIGNAL(released()), this, SLOT(askCrossquarterColor())); connect(ui->majorStandstillColorToolButton, SIGNAL(released()), this, SLOT(askMajorStandstillColor())); connect(ui->minorStandstillColorToolButton, SIGNAL(released()), this, SLOT(askMinorStandstillColor())); connect(ui->zenithPassageColorToolButton, SIGNAL(released()), this, SLOT(askZenithPassageColor())); connect(ui->nadirPassageColorToolButton, SIGNAL(released()), this, SLOT(askNadirPassageColor())); connect(ui->selectedObjectColorToolButton, SIGNAL(released()), this, SLOT(askSelectedObjectColor())); connect(ui->currentSunColorToolButton, SIGNAL(released()), this, SLOT(askCurrentSunColor())); connect(ui->currentMoonColorToolButton, SIGNAL(released()), this, SLOT(askCurrentMoonColor())); connect(ui->currentPlanetColorToolButton, SIGNAL(released()), this, SLOT(askCurrentPlanetColor())); connect(ui->customAzimuth1ColorToolButton, SIGNAL(released()), this, SLOT(askCustomAzimuth1Color())); connect(ui->customAzimuth2ColorToolButton, SIGNAL(released()), this, SLOT(askCustomAzimuth2Color())); connect(ui->restoreDefaultsButton, SIGNAL(clicked()), this, SLOT(resetArchaeoLinesSettings())); // We must apparently warn about a potential problem, but only on Windows. (QTBUG-35302) #ifndef Q_OS_WIN ui->switchToWindowedModeLabel->hide(); #endif setAboutHtml(); }
DiskBrowser::DiskBrowser() : QbWindow(config.geometry.diskBrowser) { setObjectName("disk-browser"); resize(720, 480); layout = new QVBoxLayout; layout->setMargin(Style::WindowMargin); layout->setSpacing(Style::WidgetSpacing); setLayout(layout); topLayout = new QHBoxLayout; layout->addLayout(topLayout); browseLayout = new QVBoxLayout; topLayout->addLayout(browseLayout); pathLayout = new QHBoxLayout; browseLayout->addLayout(pathLayout); path = new QComboBox; path->setEditable(true); path->setMinimumContentsLength(16); path->setSizeAdjustPolicy(QComboBox::AdjustToMinimumContentsLength); path->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); pathLayout->addWidget(path); newFolder = new QPushButton; newFolder->setIconSize(QSize(16, 16)); newFolder->setIcon(QIcon(":/16x16/folder-new.png")); pathLayout->addWidget(newFolder); view = new DiskBrowserView; view->setIconSize(QSize(16, 16)); browseLayout->addWidget(view); panelLayout = new QVBoxLayout; topLayout->addLayout(panelLayout); group = new QGroupBox; panelLayout->addWidget(group); groupLayout = new QVBoxLayout; group->setLayout(groupLayout); info = new QLabel; info->setFixedWidth(256); groupLayout->addWidget(info); image = new DiskBrowserImage; image->setFixedSize(256, 239); groupLayout->addWidget(image); spacer = new QWidget; spacer->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding); groupLayout->addWidget(spacer); applyPatch = new QCheckBox("Apply UPS patch"); applyPatch->setChecked(true); applyPatch->setEnabled(false); groupLayout->addWidget(applyPatch); controlLayout = new QHBoxLayout; layout->addLayout(controlLayout); filter = new QComboBox; filter->setMinimumContentsLength(16); filter->setSizeAdjustPolicy(QComboBox::AdjustToMinimumContentsLength); filter->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); controlLayout->addWidget(filter); options = new QPushButton("Options"); controlLayout->addWidget(options); menu = new QMenu; options->setMenu(menu); menu->addAction(showPanel = new QbCheckAction("Show Side Panel", 0)); showPanel->setChecked(config.diskBrowser.showPanel); ok = new QPushButton("Ok"); ok->setEnabled(false); controlLayout->addWidget(ok); cancel = new QPushButton("Cancel"); controlLayout->addWidget(cancel); model = new QFileSystemModel; model->setFilter(QDir::AllDirs | QDir::Files | QDir::NoDotAndDotDot); model->setNameFilterDisables(false); view->setModel(model); view->setExpandsOnDoubleClick(false); view->setAllColumnsShowFocus(true); view->setUniformRowHeights(true); view->setSortingEnabled(true); view->sortByColumn(0, Qt::AscendingOrder); view->setColumnHidden(1, true); view->setColumnHidden(2, true); view->setColumnHidden(3, true); view->setHeaderHidden(true); folderCreator = new FolderCreator; connect(newFolder, SIGNAL(released()), folderCreator, SLOT(show())); connect(view, SIGNAL(cdUp()), this, SLOT(cdUp())); connect(view, SIGNAL(activated(const QModelIndex&)), this, SLOT(activateItem(const QModelIndex&))); connect(view, SIGNAL(changed(const QModelIndex&)), this, SLOT(changeItem(const QModelIndex&))); connect(ok, SIGNAL(released()), this, SLOT(loadSelected())); connect(cancel, SIGNAL(released()), this, SLOT(close())); connect(showPanel, SIGNAL(triggered()), this, SLOT(toggleShowPanel())); }
void DiveHandler::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { QGraphicsItem::mouseReleaseEvent(event); emit released(); }
void CStartButton::mouseReleaseEvent(QGraphicsSceneMouseEvent *) { update(); emit released (); }
void tva::Doc::initConnect() { { bool flag = connect(btnEigenCalc, SIGNAL(released ()), this, SLOT(slMakeEigenData())); if(!flag) tva::util::showMsg("error on connection to slot btnEigenCalc"); } { bool flag = connect( btnWizShaft, SIGNAL(released()) , this, SLOT(slWizardShaft()) ); if(!flag) tva::util::showMsg("error on connection to slot btnWizShaft"); } { bool flag = connect( btnWizDisc, SIGNAL(released()) , this, SLOT(slWizardDisc()) ); if(!flag) tva::util::showMsg("error on connection to slot btnWizDisc"); } { bool flag = connect( this, SIGNAL(rawShaftDataChanged()) , this, SLOT(slUpdateRawShaftData()) ); if(!flag) tva::util::showMsg("error on connection to slot slUpdateRawShaftData"); } { bool flag = connect( this, SIGNAL(rawDiscDataChanged()) , this, SLOT(slUpdateRawDiscData()) ); if(!flag) tva::util::showMsg("error on connection to slot slUpdateRawShaftData"); } { bool flag = connect( wrRawShaftData.get(), SIGNAL(sigWidgetEdited()) , this, SLOT(slTableShaftToModel()) ); if(!flag) tva::util::showMsg("error on connection to slot slTableShaftToModel"); } { bool flag = connect( wrRawDiscData.get(), SIGNAL(sigWidgetEdited()) , this, SLOT(slTableDiscToModel()) ); if(!flag) tva::util::showMsg("error on connection to slot slTableDiscToModel"); } // { bool flag = connect( btnSensCalc, SIGNAL(released()) , this, SLOT(slSensAnalisys()) ); if(!flag) tva::util::showMsg("error on connection to slot slSensAnalisys"); } { bool flag = connect( btnStaticTask, SIGNAL(released()) , this, SLOT(slSolveStaticTask()) ); if(!flag) tva::util::showMsg("error on connection to slot slSensAnalisys"); } { bool flag = connect( btnDynTask, SIGNAL(released()) , this, SLOT(slSolveDynamicTask()) ); if(!flag) tva::util::showMsg("error on connection to slot slSolveDynamicTask"); } { bool flag = connect( dynSlider, SIGNAL(valueChanged ( int )) , this, SLOT(slShowDynStep(int)) ); if(!flag) tva::util::showMsg("error on connection to slot slShowDynStep"); } }
UnsharpDialog::UnsharpDialog(QWidget *parent): QDialog(parent) { this->ui.setupUi(this); this->connect(this->ui.pushButtonOk, SIGNAL(released()), this, SLOT(ok())); this->connect(this->ui.pushButtonCancel, SIGNAL(released()), this, SLOT(cancel())); }
OamViewer::OamViewer() { setObjectName("oam-viewer"); setWindowTitle("Sprite Viewer"); setGeometryString(&config().geometry.oamViewer); application.windowList.append(this); inRefreshCall = false; layout = new QHBoxLayout; layout->setAlignment(Qt::AlignLeft); layout->setMargin(Style::WindowMargin); layout->setSpacing(Style::WidgetSpacing); setLayout(layout); list = new QTreeWidget; list->setColumnCount(8); list->setHeaderLabels(QStringList() << "#" << "Size" << "X" << "Y" << "Char" << "Pri" << "Pal" << "Flags"); list->setAllColumnsShowFocus(true); list->setAlternatingRowColors(true); list->setRootIsDecorated(false); list->setUniformRowHeights(true); list->setSortingEnabled(false); layout->addWidget(list); unsigned dw = list->fontMetrics().width('0'); list->setColumnWidth(0, dw * 4); list->setColumnWidth(1, dw * 8); list->setColumnWidth(2, dw * 6); list->setColumnWidth(3, dw * 6); list->setColumnWidth(4, dw * 6); list->setColumnWidth(5, dw * 6); list->setColumnWidth(6, dw * 6); list->setColumnWidth(7, dw * 6); for(unsigned i = 0; i < 128; i++) { QTreeWidgetItem *item = new QTreeWidgetItem(list); item->setData(0, Qt::DisplayRole, i); item->setData(0, Qt::UserRole, QVariant(i)); item->setTextAlignment(0, Qt::AlignRight); item->setTextAlignment(1, Qt::AlignHCenter); item->setTextAlignment(2, Qt::AlignRight); item->setTextAlignment(3, Qt::AlignRight); item->setTextAlignment(4, Qt::AlignRight); item->setTextAlignment(5, Qt::AlignRight); item->setTextAlignment(6, Qt::AlignRight); item->setTextAlignment(7, Qt::AlignLeft); } list->setCurrentItem(NULL); list->sortItems(0, Qt::AscendingOrder); list->setSortingEnabled(true); controlLayout = new QVBoxLayout; controlLayout->setAlignment(Qt::AlignTop); controlLayout->setSpacing(0); layout->addLayout(controlLayout); canvas = new OamCanvas; controlLayout->addWidget(canvas); autoUpdateBox = new QCheckBox("Auto update"); controlLayout->addWidget(autoUpdateBox); refreshButton = new QPushButton("Refresh"); controlLayout->addWidget(refreshButton); connect(refreshButton, SIGNAL(released()), this, SLOT(refresh())); connect(list, SIGNAL(itemSelectionChanged()), this, SLOT(onSelectedChanged())); }
MainWnd::MainWnd( QWidget * parent ) : QMainWindow( parent ) { ui.setupUi( this ); connect( this, SIGNAL(sigLog(const QString &)), this, SLOT(slotLog(const QString &)), Qt::QueuedConnection ); connect( ui.console, SIGNAL(line_validate(const QString &)), this, SLOT(slotSend(const QString &)), Qt::QueuedConnection ); QObject::connect( ui.clearLog, SIGNAL(triggered()), this, SLOT(slotClearLog()) ); QObject::connect( ui.dontSleep, SIGNAL(triggered()), this, SLOT(slotDontSleep()) ); QObject::connect( ui.showFullLog, SIGNAL(triggered()), this, SLOT(slotShowFullLog()) ); QObject::connect( ui.queryStatus, SIGNAL(triggered()), this, SLOT(slotStatus()) ); QObject::connect( ui.queryOsc, SIGNAL(triggered()), this, SLOT(slotOsc()) ); QObject::connect( ui.shutdown, SIGNAL(triggered()), this, SLOT(slotShutdown()) ); QObject::connect( ui.setupPipe, SIGNAL(triggered()), this, SLOT(slotSetupPipe()) ); QObject::connect( ui.lightBtn, SIGNAL(clicked()), this, SLOT(slotLight()) ); QObject::connect( ui.motoEnBtn, SIGNAL(clicked()), this, SLOT(slotMotoEn()) ); QObject::connect( ui.fwdBtn, SIGNAL(pressed()), this, SLOT(slotForward()) ); QObject::connect( ui.bwdBtn, SIGNAL(pressed()), this, SLOT(slotBackward()) ); QObject::connect( ui.leftBtn, SIGNAL(pressed()), this, SLOT(slotLeft()) ); QObject::connect( ui.rightBtn, SIGNAL(pressed()), this, SLOT(slotRight()) ); QObject::connect( ui.fwdBtn, SIGNAL(released()), this, SLOT(slotStop()) ); QObject::connect( ui.bwdBtn, SIGNAL(released()), this, SLOT(slotStop()) ); QObject::connect( ui.leftBtn, SIGNAL(released()), this, SLOT(slotStop()) ); QObject::connect( ui.rightBtn, SIGNAL(released()), this, SLOT(slotStop()) ); QObject::connect( ui.showFullLog, SIGNAL(triggered()), this, SLOT(slotShowFullLog()) ); m_peer = new QXmppPeer( this ); QObject::connect( m_peer, SIGNAL(connected()), this, SLOT(slotConnected()) ); QObject::connect( m_peer, SIGNAL(disconnected()), this, SLOT(slotDisconnected()) ); QObject::connect( m_peer, SIGNAL(textmsg(QString)), this, SLOT(qxmppMessageReceived(QString)) ); m_video = new QXmppVideo( m_peer ); // It also connects frameReady() signal to an appropriate slot. ui.view->setVideo( m_video ); this->setCentralWidget( ui.view ); QSettings ini( CONFIG_FILE, QSettings::IniFormat ); ini.beginGroup( "main" ); QString selfJid = ini.value( "selfJid", "client@xmpp" ).toString(); QString destJid = ini.value( "destJid", "host@xmpp" ).toString(); QString password = ini.value( "password", "12345" ).toString(); QString host = ini.value( "host", QString() ).toString(); int port = ini.value( "port", -1 ).toInt(); bool tls = ini.value( "tls", true ).toBool(); bool updateDest = ini.value( "updateDest", true ).toBool(); m_peer->setTarget( destJid, updateDest ); m_video->setTarget( destJid ); m_peer->connect( selfJid, password, host, port, tls ); m_jidDest = destJid; m_pipe = new QXmppMsgPipe( m_peer, 1 ); m_pipe->setOutPipe( m_jidDest, 1234, 22, "localhost" ); m_dontSleepTimer = new QTimer( this ); m_dontSleepTimer->setInterval( 15000 ); QObject::connect( m_dontSleepTimer, SIGNAL(timeout()), this, SLOT(slotDontSleepTimeout()) ); }
void ItemHandlerCombobox::Handle (const QDomElement& item, QWidget *pwidget) { QGridLayout *lay = qobject_cast<QGridLayout*> (pwidget->layout ()); QHBoxLayout *hboxLay = new QHBoxLayout; QComboBox *box = new QComboBox (XSD_); hboxLay->addWidget (box); XSD_->SetTooltip (box, item); box->setObjectName (item.attribute ("property")); box->setSizeAdjustPolicy (QComboBox::AdjustToContents); if (item.hasAttribute ("maxVisibleItems")) box->setMaxVisibleItems (item.attribute ("maxVisibleItems").toInt ()); bool mayHaveDataSource = item.hasAttribute ("mayHaveDataSource") && item.attribute ("mayHaveDataSource").toLower () == "true"; if (mayHaveDataSource) { const QString& prop = item.attribute ("property"); Factory_->RegisterDatasourceSetter (prop, [this] (const QString& str, QAbstractItemModel *m, Util::XmlSettingsDialog *xsd) { SetDataSource (str, m, xsd); }); Propname2Combobox_ [prop] = box; Propname2Item_ [prop] = item; } hboxLay->addStretch (); if (item.hasAttribute ("moreThisStuff")) { QPushButton *moreButt = new QPushButton (tr ("More stuff...")); hboxLay->addWidget (moreButt); moreButt->setObjectName (item.attribute ("moreThisStuff")); connect (moreButt, SIGNAL (released ()), XSD_, SLOT (handleMoreThisStuffRequested ())); } QDomElement option = item.firstChildElement ("option"); while (!option.isNull ()) { const auto& images = XSD_->GetImages (option); if (!images.isEmpty ()) { const QIcon icon (QPixmap::fromImage (images.at (0))); box->addItem (icon, XSD_->GetLabel (option), option.attribute ("name")); } else box->addItem (XSD_->GetLabel (option), option.attribute ("name")); auto setColor = [&option, box] (const QString& attr, Qt::ItemDataRole role) -> void { if (option.hasAttribute (attr)) { const QColor color (option.attribute (attr)); box->setItemData (box->count () - 1, color, role); } }; setColor ("color", Qt::ForegroundRole); setColor ("bgcolor", Qt::BackgroundRole); option = option.nextSiblingElement ("option"); } connect (box, SIGNAL (currentIndexChanged (int)), this, SLOT (updatePreferences ())); QDomElement scriptContainer = item.firstChildElement ("scripts"); if (!scriptContainer.isNull ()) { Scripter scripter (scriptContainer); QStringList fromScript = scripter.GetOptions (); Q_FOREACH (const QString& elm, scripter.GetOptions ()) box->addItem (scripter.HumanReadableOption (elm), elm); }
InstrumentTrackView::InstrumentTrackView( InstrumentTrack * _it, TrackContainerView* tcv ) : trackView( _it, tcv ), m_window( NULL ), m_lastPos( -1, -1 ) { setAcceptDrops( true ); setFixedHeight( 32 ); m_tlb = new trackLabelButton( this, getTrackSettingsWidget() ); m_tlb->setCheckable( true ); m_tlb->setIcon( embed::getIconPixmap( "instrument_track" ) ); m_tlb->move( 3, 1 ); m_tlb->show(); connect( m_tlb, SIGNAL( toggled( bool ) ), this, SLOT( toggleInstrumentWindow( bool ) ) ); connect( _it, SIGNAL( nameChanged() ), m_tlb, SLOT( update() ) ); // creation of widgets for track-settings-widget int widgetWidth; if( configManager::inst()->value( "ui", "compacttrackbuttons" ).toInt() ) { widgetWidth = DEFAULT_SETTINGS_WIDGET_WIDTH_COMPACT; } else { widgetWidth = DEFAULT_SETTINGS_WIDGET_WIDTH; } m_volumeKnob = new knob( knobSmall_17, getTrackSettingsWidget(), tr( "Volume" ) ); m_volumeKnob->setVolumeKnob( true ); m_volumeKnob->setModel( &_it->m_volumeModel ); m_volumeKnob->setHintText( tr( "Volume:" ) + " ", "%" ); m_volumeKnob->move( widgetWidth-2*24, 2 ); m_volumeKnob->setLabel( tr( "VOL" ) ); m_volumeKnob->show(); m_volumeKnob->setWhatsThis( tr( volume_help ) ); m_panningKnob = new knob( knobSmall_17, getTrackSettingsWidget(), tr( "Panning" ) ); m_panningKnob->setModel( &_it->m_panningModel ); m_panningKnob->setHintText( tr( "Panning:" ) + " ", "%" ); m_panningKnob->move( widgetWidth-24, 2 ); m_panningKnob->setLabel( tr( "PAN" ) ); m_panningKnob->show(); m_midiMenu = new QMenu( tr( "MIDI" ), this ); // sequenced MIDI? if( !engine::mixer()->midiClient()->isRaw() ) { _it->m_midiPort.m_readablePortsMenu = new MidiPortMenu( MidiPort::Input ); _it->m_midiPort.m_writablePortsMenu = new MidiPortMenu( MidiPort::Output ); _it->m_midiPort.m_readablePortsMenu->setModel( &_it->m_midiPort ); _it->m_midiPort.m_writablePortsMenu->setModel( &_it->m_midiPort ); m_midiInputAction = m_midiMenu->addMenu( _it->m_midiPort.m_readablePortsMenu ); m_midiOutputAction = m_midiMenu->addMenu( _it->m_midiPort.m_writablePortsMenu ); } else { m_midiInputAction = m_midiMenu->addAction( "" ); m_midiOutputAction = m_midiMenu->addAction( "" ); m_midiInputAction->setCheckable( true ); m_midiOutputAction->setCheckable( true ); connect( m_midiInputAction, SIGNAL( changed() ), this, SLOT( midiInSelected() ) ); connect( m_midiOutputAction, SIGNAL( changed() ), this, SLOT( midiOutSelected() ) ); connect( &_it->m_midiPort, SIGNAL( modeChanged() ), this, SLOT( midiConfigChanged() ) ); } m_midiInputAction->setText( tr( "Input" ) ); m_midiOutputAction->setText( tr( "Output" ) ); m_activityIndicator = new fadeButton( QApplication::palette().color( QPalette::Active, QPalette::Background), QApplication::palette().color( QPalette::Active, QPalette::BrightText ), getTrackSettingsWidget() ); m_activityIndicator->setGeometry( widgetWidth-2*24-11, 2, 8, 28 ); m_activityIndicator->show(); connect( m_activityIndicator, SIGNAL( pressed() ), this, SLOT( activityIndicatorPressed() ) ); connect( m_activityIndicator, SIGNAL( released() ), this, SLOT( activityIndicatorReleased() ) ); connect( _it, SIGNAL( newNote() ), m_activityIndicator, SLOT( activate() ) ); setModel( _it ); }
tuiomultiplexer::tuiomultiplexer(QWidget *parent) : QDialog(parent), ui(new Ui::tuiomultiplexer) { ui->setupUi(this); grid=new QGridLayout(); gridGest=new QGridLayout(); titulos[0]=new QLabel("N"); titulos[1]=new QLabel("Host"); titulos[2]=new QLabel("Port"); titulos[3]=new QLabel("Active"); titulos[4]=new QLabel("Gesture ID"); titulos[5]=new QLabel("Train Gesture"); gridGest->addWidget(titulos[4],0,0,1,1); gridGest->addWidget(titulos[5],0,1,1,1); gridGest->setRowStretch(0,0); grid->addWidget(titulos[0],0,0,1,1); grid->addWidget(titulos[1],0,1,1,1); grid->addWidget(titulos[2],0,2,1,1); grid->addWidget(titulos[3],0,3,1,1); signalMapper = new QSignalMapper(this); signalMapperGest=new QSignalMapper(this); connect(signalMapper,SIGNAL(mapped(int)),this,SLOT(activated(int))); connect(signalMapperGest,SIGNAL(mapped(int)),this,SLOT(startTraining(int))); for(int i=0;i<NUM_SER;i++){ ports[i]=new QSpinBox(); ports[i]->setMinimum(0); ports[i]->setMaximum(65000); ports[i]->setValue(3333+i+1); hosts[i]=new QLineEdit("localhost"); labels[i]=new QLabel(QString::number(i+1)); actives[i]=new QCheckBox(); grid->addWidget(labels[i],i+1,0,1,1); grid->addWidget(hosts[i],i+1,1,1,1); grid->addWidget(ports[i],i+1,2,1,1); grid->addWidget(actives[i],i+1,3,1,1); signalMapper->setMapping(actives[i], i); connect(actives[i], SIGNAL(released()), signalMapper, SLOT(map())); serverCreated[i]=false; } grid->setRowStretch(0,0); for(int i=0;i<NUM_SER;i++){ grid->setRowStretch(i+1,1); } ui->scrollAreaContentTUIO->setLayout(grid); //ui->groupBox_2->setLayout(grid); ui->scrollAreaWidgetContents->setLayout(gridGest); ui->scrollAreaWidgetContents->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding); ui->scrollAreaWidgetContents->resize(ui->scrollGest->size().width() ,ui->scrollGest->size().height()); ui->scrollGest->setWidgetResizable(true); ui->scrollGest->setWidget(ui->scrollAreaWidgetContents); ui->scrollAreaWidgetContents->adjustSize(); this->setAttribute( Qt::WA_DeleteOnClose, true ); clientCreated=false; clientHasBeenUsed=false; updateM=false; areWeCalibrating=false; pp=NULL; kindNew=4; workingPP=false; calSKT=new calibrationskt(); timer=new QTimer(this); timer->start(30); QObject::connect(timer, SIGNAL(timeout()), this, SLOT(updateMats())); }
About::About(QWidget *parent, QString language) : QDialog(parent) { // Setup UI: setupUi(this); setupUiFonts(); // Display title/program version: progversion_label->setText(progversion_label->text() + " " + QApplication::applicationVersion()); // Load licence text and changelog: QFile changelog_file; if (language == "de") { licence_textBrowser->setSource(QUrl("qrc:/licence_de.html")); changelog_file.setFileName(":/changelog_de.txt"); } else { licence_textBrowser->setSource(QUrl("qrc:/licence_en.html")); changelog_file.setFileName(":/changelog_en.txt"); } changelog_file.open(QIODevice::ReadOnly | QIODevice::Text); QString changelog_content = static_cast<QString>(changelog_file.readAll()); changelog_textBrowser->setText(changelog_content); changelog_file.close(); // *** Definitions: SSMprotocol2_def_en ssmp_defs; // Display number of supported DTCs: int nrofDTCs_SUB = ssmp_defs.SUBDTCrawDefs().size(); int nrofDTCs_OBD = ssmp_defs.OBDDTCrawDefs().size(); int nrofDTCs_CC = ssmp_defs.CCCCrawDefs().size(); QString dtcstr = QString::number( nrofDTCs_SUB ) + " / " + QString::number( nrofDTCs_OBD ) + " / " + QString::number( nrofDTCs_CC ); nrofsupportedDTCs_label->setText( dtcstr ); // Display number of supported measuring blocks / switches: int nrofMBs = ssmp_defs.MBrawDefs().size(); int nrofSWs = ssmp_defs.SWrawDefs().size(); QString mbswstr = QString::number( nrofMBs ) + " / " + QString::number( nrofSWs ); nrofsupportedMBsSWs_label->setText( mbswstr ); // Display number of supported Adjustment values: int ecu_adjustments = 0; int tcu_adjustments = 0; QStringList adjustmentdefs = ssmp_defs.AdjustmentRawDefs(); for (int k=0; k< adjustmentdefs.size(); k++) { if (adjustmentdefs.at(k).section(';', 1, 1).toInt() == 0) { ecu_adjustments++; } else if (adjustmentdefs.at(k).section(';', 1, 1).toInt() == 1) { tcu_adjustments++; } } QString adjustmentsstr = QString::number( ecu_adjustments ) + " / " + QString::number( tcu_adjustments ); nrofadjustmentvalues_label->setText( adjustmentsstr ); // Display number of supported system tests: int nrofSysTests = ssmp_defs.ActuatorRawDefs().size(); QString systestsstr = QString::number( nrofSysTests ) + " / 1"; nrofActuatortests_label->setText(systestsstr); // Display supported program languages: QString langstr; for (int k=0; k<__supportedLocales.size(); k++) { QLocale locale = __supportedLocales.at(k); QString langname = QLocale::languageToString( locale.language() ); QString langname_tr = QCoreApplication::translate( "Language", langname.toAscii() ); if (k > 0) langstr.append(", "); langstr.append(langname_tr); } languages_label->setText( langstr ); // Connect "Close"-button: connect( close_pushButton, SIGNAL( released() ), this, SLOT( close() ) ); }
/* * Constructs a configurePO as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * * The dialog will by default be modeless, unless you set 'modal' to * true to construct a modal dialog. */ configurePO::configurePO(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_close, SIGNAL(released()), this, SLOT(reject())); connect(_internalCopy, SIGNAL(toggled(bool)), _numOfCopies, SLOT(setEnabled(bool))); if (_metrics->value("Application") == "PostBooks") { _enableDropShip->hide(); _billDropShip->hide(); } else { q.prepare("SELECT pohead_id FROM pohead " "WHERE ( (pohead_dropship = 'TRUE') " " AND (pohead_status = 'O') )"); q.exec(); if (q.first()) { _enableDropShip->setChecked(TRUE); _enableDropShip->setEnabled(FALSE); _billDropShip->setChecked(_metrics->boolean("BillDropShip")); _billDropShip->setEnabled(FALSE); } else { _enableDropShip->setChecked(_metrics->boolean("EnableDropShipments")); _billDropShip->setChecked(_metrics->boolean("BillDropShip")); } } if (_metrics->value("PONumberGeneration") == "M") _orderNumGeneration->setCurrentIndex(0); else if (_metrics->value("PONumberGeneration") == "A") _orderNumGeneration->setCurrentIndex(1); else if (_metrics->value("PONumberGeneration") == "O") _orderNumGeneration->setCurrentIndex(2); #if 0 if (_metrics->value("VoucherNumberGeneration") == "M") _voucherNumGeneration->setCurrentIndex(0); else if (_metrics->value("VoucherNumberGeneration") == "A") _voucherNumGeneration->setCurrentIndex(1); else if (_metrics->value("VoucherNumberGeneration") == "O") _voucherNumGeneration->setCurrentIndex(2); #endif // ToDo if (_metrics->value("PrNumberGeneration") == "M") _prNumberGeneration->setCurrentIndex(0); else if (_metrics->value("PrNumberGeneration") == "A") _prNumberGeneration->setCurrentIndex(1); else if (_metrics->value("PrNumberGeneration") == "O") _prNumberGeneration->setCurrentIndex(2); _nextPoNumber->setValidator(omfgThis->orderVal()); _nextVcNumber->setValidator(omfgThis->orderVal()); _nextPrNumber->setValidator(omfgThis->orderVal()); q.exec( "SELECT ponumber.orderseq_number AS ponumber," " vcnumber.orderseq_number AS vcnumber," " prnumber.orderseq_number AS prnumber " "FROM orderseq AS ponumber," " orderseq AS vcnumber," " orderseq AS prnumber " "WHERE ( (ponumber.orderseq_name='PoNumber')" " AND (vcnumber.orderseq_name='VcNumber')" " AND (prnumber.orderseq_name='PrNumber') );" ); if (q.first()) { _nextPoNumber->setText(q.value("ponumber").toString()); _nextVcNumber->setText(q.value("vcnumber").toString()); _nextPrNumber->setText(q.value("prnumber").toString()); } _poChangeLog->setChecked(_metrics->boolean("POChangeLog")); _vendorChangeLog->setChecked(_metrics->boolean("VendorChangeLog")); _earliestPO->setChecked(_metrics->boolean("UseEarliestAvailDateOnPOItem")); _printPO->setChecked(_metrics->boolean("DefaultPrintPOOnSave")); _vendorCopy->setChecked(_metrics->boolean("POVendor")); _requirePoitemStdCost->setChecked(_metrics->boolean("RequireStdCostForPOItem")); if (_metrics->value("POInternal").toInt() > 0) { _internalCopy->setChecked(TRUE); _numOfCopies->setValue(_metrics->value("POInternal").toInt()); } else { _internalCopy->setChecked(FALSE); _numOfCopies->setEnabled(FALSE); } _defaultShipVia->setText(_metrics->value("DefaultPOShipVia")); this->setWindowTitle("Purchase Configuration"); }
SpeedDial::SpeedDial(QWidget* parent) : QGroupBox(parent) , m_timer(new QTimer(this)) , m_dial(NULL) , m_hrs(NULL) , m_min(NULL) , m_sec(NULL) , m_ms(NULL) , m_focus(NULL) , m_previousDialValue(0) , m_preventSignals(false) , m_value(0) , m_tapTime(NULL) , m_tapTickTimer(NULL) , m_tapTick(false) { QGridLayout* grid = new QGridLayout(this); grid->setSpacing(0); grid->setMargin(2); m_plus = new QToolButton(this); m_plus->setIconSize(QSize(32, 32)); m_plus->setIcon(QIcon(":/edit_add.png")); grid->addWidget(m_plus, 0, 0, Qt::AlignVCenter | Qt::AlignLeft); connect(m_plus, SIGNAL(pressed()), this, SLOT(slotPlusMinus())); connect(m_plus, SIGNAL(released()), this, SLOT(slotPlusMinus())); m_minus = new QToolButton(this); m_minus->setIconSize(QSize(32, 32)); m_minus->setIcon(QIcon(":/edit_remove.png")); grid->addWidget(m_minus, 1, 0, Qt::AlignVCenter | Qt::AlignLeft); connect(m_minus, SIGNAL(pressed()), this, SLOT(slotPlusMinus())); connect(m_minus, SIGNAL(released()), this, SLOT(slotPlusMinus())); m_dial = new QDial(this); m_dial->setWrapping(true); m_dial->setNotchesVisible(true); m_dial->setTracking(true); grid->addWidget(m_dial, 0, 1, 2, 2, Qt::AlignHCenter); connect(m_dial, SIGNAL(valueChanged(int)), this, SLOT(slotDialChanged(int))); m_tap = new QPushButton(tr("Tap"), this); m_tap->setStyleSheet(tapDefaultSS); m_tap->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding); grid->addWidget(m_tap, 0, 3, 2, 1); connect(m_tap, SIGNAL(clicked()), this, SLOT(slotTapClicked())); m_hrs = new FocusSpinBox(this); m_hrs->setRange(0, HRS_MAX); m_hrs->setSuffix("h"); m_hrs->setButtonSymbols(QSpinBox::NoButtons); m_hrs->setToolTip(tr("Hours")); grid->addWidget(m_hrs, 2, 0); connect(m_hrs, SIGNAL(valueChanged(int)), this, SLOT(slotHoursChanged())); connect(m_hrs, SIGNAL(focusGained()), this, SLOT(slotSpinFocusGained())); m_min = new FocusSpinBox(this); m_min->setRange(0, MIN_MAX); m_min->setSuffix("m"); m_min->setButtonSymbols(QSpinBox::NoButtons); m_min->setToolTip(tr("Minutes")); grid->addWidget(m_min, 2, 1); connect(m_min, SIGNAL(valueChanged(int)), this, SLOT(slotMinutesChanged())); connect(m_min, SIGNAL(focusGained()), this, SLOT(slotSpinFocusGained())); m_sec = new FocusSpinBox(this); m_sec->setRange(0, SEC_MAX); m_sec->setSuffix("s"); m_sec->setButtonSymbols(QSpinBox::NoButtons); m_sec->setToolTip(tr("Seconds")); grid->addWidget(m_sec, 2, 2); connect(m_sec, SIGNAL(valueChanged(int)), this, SLOT(slotSecondsChanged())); connect(m_sec, SIGNAL(focusGained()), this, SLOT(slotSpinFocusGained())); m_ms = new FocusSpinBox(this); m_ms->setRange(0, MS_MAX / MS_DIV); m_ms->setPrefix("."); m_ms->setButtonSymbols(QSpinBox::NoButtons); m_ms->setToolTip(tr("Milliseconds")); grid->addWidget(m_ms, 2, 3); connect(m_ms, SIGNAL(valueChanged(int)), this, SLOT(slotMSChanged())); connect(m_ms, SIGNAL(focusGained()), this, SLOT(slotSpinFocusGained())); m_infiniteCheck = new QCheckBox(this); m_infiniteCheck->setText(tr("Infinite")); grid->addWidget(m_infiniteCheck, 3, 0, 1, 4); connect(m_infiniteCheck, SIGNAL(toggled(bool)), this, SLOT(slotInfiniteChecked(bool))); m_focus = m_ms; m_dial->setRange(m_focus->minimum(), m_focus->maximum()); m_dial->setSingleStep(m_focus->singleStep()); m_timer->setInterval(TIMER_HOLD); connect(m_timer, SIGNAL(timeout()), this, SLOT(slotPlusMinusTimeout())); }
ConfigWindow::ConfigWindow(QWidget *parent) : QDialog(parent, Qt::Dialog | Qt::WindowCloseButtonHint) { setWindowTitle(tr("Configuration")); QGroupBox *dependances = new QGroupBox(tr("Dépendances"), this); listFF7 = new QTreeWidget(dependances); listFF7->setColumnCount(1); listFF7->setUniformRowHeights(true); listFF7->setHeaderLabels(QStringList(tr("Final Fantasy VII installés"))); listFF7->setFixedHeight(80); ff7ButtonMod = new QPushButton(dependances); ff7ButtonRem = new QPushButton(tr("Supprimer"), dependances); kernelAuto = new QCheckBox(tr("kernel2.bin"), dependances); kernelPath = new QLabel(dependances); kernelPath->setFixedWidth(500); kernelButton = new QPushButton(tr("Changer"), dependances); windowAuto = new QCheckBox(tr("window.bin"), dependances); windowPath = new QLabel(dependances); windowPath->setFixedWidth(500); windowButton = new QPushButton(tr("Changer"), dependances); charAuto = new QCheckBox(tr("char.lgp"), dependances); charPath = new QLabel(dependances); charPath->setFixedWidth(500); charButton = new QPushButton(tr("Changer"), dependances); QGridLayout *dependLayout = new QGridLayout(dependances); dependLayout->addWidget(listFF7, 0, 0, 3, 2); dependLayout->addWidget(ff7ButtonMod, 0, 2); dependLayout->addWidget(ff7ButtonRem, 1, 2); dependLayout->setRowStretch(2, 1); dependLayout->addWidget(kernelAuto, 3, 0); dependLayout->addWidget(kernelPath, 3, 1); dependLayout->addWidget(kernelButton, 3, 2); dependLayout->addWidget(windowAuto, 4, 0); dependLayout->addWidget(windowPath, 4, 1); dependLayout->addWidget(windowButton, 4, 2); dependLayout->addWidget(charAuto, 5, 0); dependLayout->addWidget(charPath, 5, 1); dependLayout->addWidget(charButton, 5, 2); QGroupBox *openGL = new QGroupBox(tr("OpenGL"), this); disableOGL = new QCheckBox(tr("Désactiver OpenGL"), openGL); QGridLayout *OGLLayout = new QGridLayout(openGL); OGLLayout->addWidget(disableOGL, 0, 0); QGroupBox *textEditor = new QGroupBox(tr("Editeur de texte"), this); windowColor1 = new QPushButton(textEditor); windowColor2 = new QPushButton(textEditor); windowColor3 = new QPushButton(textEditor); windowColor4 = new QPushButton(textEditor); windowPreview = new QLabel(textEditor); windowColorReset = new QPushButton(tr("Valeurs par défaut"), textEditor); optiText = new QCheckBox(trUtf8("Optimiser automatiquement les duos de caract\xc3\xa8res \xc2\xab . \xc2\xbb, \xc2\xab .\" \xc2\xbb et \xc2\xab \xe2\x80\xa6\" \xc2\xbb.")); optiText->hide();//TODO japEnc = new QCheckBox(tr("Caractères japonais"), textEditor); listCharNames = new QComboBox(textEditor); for(int i=0 ; i<9 ; ++i) { listCharNames->addItem(QIcon(QString(":/images/icon-char-%1.png").arg(i)), Data::char_names.at(i)); } charNameEdit = new QLineEdit(textEditor); charNameEdit->setMaxLength(9); autoSizeMarginEdit = new QSpinBox(textEditor); autoSizeMarginEdit->setRange(0, 320); spacedCharactersWidthEdit = new QSpinBox(textEditor); spacedCharactersWidthEdit->setRange(0, 320); QGridLayout *windowPreviewLayout = new QGridLayout; windowPreviewLayout->addWidget(windowColor1, 0, 0, Qt::AlignRight | Qt::AlignTop); windowPreviewLayout->addWidget(windowColor3, 1, 0, Qt::AlignRight | Qt::AlignBottom); windowPreviewLayout->addWidget(windowPreview, 0, 1, 2, 1, Qt::AlignCenter); windowPreviewLayout->addWidget(windowColor2, 0, 2, Qt::AlignLeft | Qt::AlignTop); windowPreviewLayout->addWidget(windowColor4, 1, 2, Qt::AlignLeft | Qt::AlignBottom); windowPreviewLayout->addWidget(windowColorReset, 2, 0, 1, 3, Qt::AlignLeft); windowPreviewLayout->setColumnStretch(3, 1); QGridLayout *textEditorLayout = new QGridLayout(textEditor); textEditorLayout->addWidget(japEnc, 0, 0, 1, 2); // windowPreviewLayout->addWidget(optiText, 1, 0, 1, 2); textEditorLayout->addLayout(windowPreviewLayout, 1, 0, 4, 2, Qt::AlignTop); textEditorLayout->addWidget(listCharNames, 0, 2, 1, 2, Qt::AlignTop); textEditorLayout->addWidget(charNameEdit, 1, 2, 1, 2, Qt::AlignTop); textEditorLayout->addWidget(new QLabel(tr("Taille auto. : marge à droite")), 3, 2, Qt::AlignBottom); textEditorLayout->addWidget(autoSizeMarginEdit, 3, 3, Qt::AlignBottom); textEditorLayout->addWidget(new QLabel(tr("Largeur {SPACED CHARACTERS}")), 4, 2, Qt::AlignBottom); textEditorLayout->addWidget(spacedCharactersWidthEdit, 4, 3, Qt::AlignBottom); textEditorLayout->setRowStretch(2, 1); QGroupBox *scriptEditor = new QGroupBox(tr("Editeur de script"), this); expandedByDefault = new QCheckBox(tr("Lignes expansées par défaut"), scriptEditor); QVBoxLayout *scriptEditorLayout = new QVBoxLayout(scriptEditor); scriptEditorLayout->addWidget(expandedByDefault); scriptEditorLayout->addStretch(); QGroupBox *misc = new QGroupBox(tr("Divers"), this); lzsNotCheck = new QCheckBox(tr("Ne pas vérifier strictement le format des fichiers"), misc); QVBoxLayout *miscLayout = new QVBoxLayout(misc); miscLayout->addWidget(lzsNotCheck); miscLayout->addStretch(); QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this); QGridLayout *layout = new QGridLayout(this); layout->addWidget(dependances, 0, 0, 1, 2); layout->addWidget(openGL, 1, 0, 1, 2); layout->addWidget(textEditor, 2, 0, 1, 2); layout->addWidget(scriptEditor, 3, 0); layout->addWidget(misc, 3, 1); layout->addWidget(buttonBox, 4, 0, 1, 2); connect(listFF7, SIGNAL(itemSelectionChanged()), SLOT(changeFF7ListButtonsState())); connect(ff7ButtonMod, SIGNAL(released()), SLOT(modifyCustomFF7Path())); connect(ff7ButtonRem, SIGNAL(released()), SLOT(removeCustomFF7Path())); connect(kernelAuto, SIGNAL(toggled(bool)), SLOT(kernelAutoChange(bool))); connect(windowAuto, SIGNAL(toggled(bool)), SLOT(windowAutoChange(bool))); connect(charAuto, SIGNAL(toggled(bool)), SLOT(charAutoChange(bool))); connect(kernelButton, SIGNAL(released()), SLOT(changeKernelPath())); connect(windowButton, SIGNAL(released()), SLOT(changeWindowPath())); connect(charButton, SIGNAL(released()), SLOT(changeCharPath())); connect(windowColor1, SIGNAL(released()), SLOT(changeColor())); connect(windowColor2, SIGNAL(released()), SLOT(changeColor())); connect(windowColor3, SIGNAL(released()), SLOT(changeColor())); connect(windowColor4, SIGNAL(released()), SLOT(changeColor())); connect(windowColorReset, SIGNAL(released()), SLOT(resetColor())); connect(listCharNames, SIGNAL(currentIndexChanged(int)), SLOT(fillCharNameEdit())); connect(charNameEdit, SIGNAL(textEdited(QString)), SLOT(setCharName(QString))); connect(buttonBox, SIGNAL(accepted()), SLOT(accept())); connect(buttonBox, SIGNAL(rejected()), SLOT(reject())); fillConfig(); changeFF7ListButtonsState(); }