void WDWizardPage::setupDialogSize() { adjustSize(); wizard()->setFixedSize(wizard()->sizeHint()); }
void TabbedArea::setWidth(int width) { Widget::setWidth(width); adjustSize(); }
void TabbedArea::setSize(int width, int height) { Widget::setSize(width, height); adjustSize(); }
void TwoButton::setUpImage(Image* image) { m_upImage = image; adjustSize(); }
void TwoButton::setHoverImage(Image* image) { m_hoverImage = image; adjustSize(); }
/** * @brief TimeTable::newTimeTable 새 시간표를 만든다 */ void TimeTable::newTimeTable() { static const QStringList weekDays( QStringList() << tr("월") << tr("화") << tr("수") << tr("목") << tr("금") << tr("토")); // 변경된 시간표를 저장할지 물어봄 if (!saveModifiedTable()) return; _timeTable->clear(); // 테이블 초기화 _tableCols = 6; // 세로줄 수는 6 _tableRows = 8; // 가로줄 수는 8 _timeTable->setColumnCount(_tableCols); // 세로줄 수 설정 _timeTable->setRowCount(_tableRows); // 가로줄 수 설정 // 가로 헤더 아이템 설정 for (int i = 0; i < _tableCols; ++i) { // 테이블 아이템 생성 QTableWidgetItem *item = new QTableWidgetItem; // 아이템 텍스트 요일로 설정 item->setText(weekDays.at(i)); // 가로 헤더 아이템 설정 _timeTable->setHorizontalHeaderItem(i, item); } // 가로 헤더 컨텍스트 메뉴 정책 설 _timeTable->horizontalHeader()->setContextMenuPolicy(Qt::CustomContextMenu); // 컨텍스트 메뉴 시그널 연결 connect(_timeTable->horizontalHeader(), SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(headerContextMenuRequested(QPoint))); // 세로 헤더 아이템 설정 for (int i = 0; i < _tableRows; ++i) { // 테이블 아이템 생성 QTableWidgetItem *item = new QTableWidgetItem; // 아이템 텍스트 시간으로 설정 item->setText(QString::number(i + 1)); // 세로 헤더 아이템 설정 _timeTable->setVerticalHeaderItem(i, item); } // 세로 헤더 컨텍스트 메뉴 정책 설정 _timeTable->verticalHeader()->setContextMenuPolicy(Qt::CustomContextMenu); // 컨텍스트 메뉴 시그널 연결 connect(_timeTable->verticalHeader(), SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(headerContextMenuRequested(QPoint))); // 테이블 셀 초기화 for (int i = 0; i < _tableRows; ++i) { for (int j = 0; j < _tableCols; ++j) { // 빈 아이템으로 설정 _timeTable->setItem(i, j, new QTableWidgetItem(QString())); } } // 테이블 크기에 맞추어서 창 크기 조절 resize(_timeTable->sizeHint().width(), _timeTable->sizeHint().height()); // 내부 위젯에 맞추어서 크기 조절 adjustSize(); // 셀 내용이 바뀌면 modified() 호출 connect(_timeTable, SIGNAL(cellChanged(int,int)), this, SLOT(modified())); setFileName(tr("이름 없음")); // 새 이름은 "이름 없음" setWindowModified(false); // 변경되지 않았음 }
// Constructor. qtractorMidiControlForm::qtractorMidiControlForm ( QWidget *pParent, Qt::WindowFlags wflags ) : QDialog(pParent, wflags) { // Setup UI struct... m_ui.setupUi(this); // Window modality (let plugin/tool windows rave around). QDialog::setWindowModality(Qt::WindowModal); m_iDirtyCount = 0; m_iDirtyMap = 0; m_iUpdating = 0; QHeaderView *pHeader = m_ui.FilesListView->header(); pHeader->setDefaultAlignment(Qt::AlignLeft); #if QT_VERSION >= 0x050000 // pHeader->setSectionResizeMode(QHeaderView::Custom); pHeader->setSectionResizeMode(QHeaderView::ResizeToContents); pHeader->setSectionsMovable(false); #else // pHeader->setResizeMode(QHeaderView::Custom); pHeader->setResizeMode(QHeaderView::ResizeToContents); pHeader->setMovable(false); #endif pHeader = m_ui.ControlMapListView->header(); pHeader->setDefaultAlignment(Qt::AlignLeft); #if QT_VERSION >= 0x050000 // pHeader->setSectionResizeMode(QHeaderView::Custom); pHeader->setSectionResizeMode(QHeaderView::ResizeToContents); pHeader->setSectionsMovable(false); #else // pHeader->setResizeMode(QHeaderView::Custom); pHeader->setResizeMode(QHeaderView::ResizeToContents); pHeader->setMovable(false); #endif m_pControlTypeGroup = new qtractorMidiControlTypeGroup(NULL, m_ui.ControlTypeComboBox, m_ui.ParamComboBox, m_ui.ParamTextLabel); m_ui.ControlTypeComboBox->setCurrentIndex(3); // Controller (default). // m_ui.ChannelComboBox->clear(); m_ui.ChannelComboBox->addItem("*"); for (unsigned short iChannel = 0; iChannel < 16; ++iChannel) m_ui.ChannelComboBox->addItem(textFromChannel(iChannel)); const QIcon iconCommand(":/images/itemChannel.png"); // m_ui.CommandComboBox->clear(); m_ui.CommandComboBox->addItem(iconCommand, qtractorMidiControl::nameFromCommand(qtractorMidiControl::TRACK_GAIN)); m_ui.CommandComboBox->addItem(iconCommand, qtractorMidiControl::nameFromCommand(qtractorMidiControl::TRACK_PANNING)); m_ui.CommandComboBox->addItem(iconCommand, qtractorMidiControl::nameFromCommand(qtractorMidiControl::TRACK_MONITOR)); m_ui.CommandComboBox->addItem(iconCommand, qtractorMidiControl::nameFromCommand(qtractorMidiControl::TRACK_RECORD)); m_ui.CommandComboBox->addItem(iconCommand, qtractorMidiControl::nameFromCommand(qtractorMidiControl::TRACK_MUTE)); m_ui.CommandComboBox->addItem(iconCommand, qtractorMidiControl::nameFromCommand(qtractorMidiControl::TRACK_SOLO)); m_ui.SyncCheckBox->setChecked(qtractorMidiControl::isSync()); stabilizeTypeChange(); refreshFiles(); adjustSize(); // UI signal/slot connections... QObject::connect(m_ui.FilesListView, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), SLOT(stabilizeForm())); QObject::connect(m_ui.ControlMapListView, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), SLOT(stabilizeForm())); QObject::connect(m_ui.ImportPushButton, SIGNAL(clicked()), SLOT(importSlot())); QObject::connect(m_ui.RemovePushButton, SIGNAL(clicked()), SLOT(removeSlot())); QObject::connect(m_ui.MoveUpPushButton, SIGNAL(clicked()), SLOT(moveUpSlot())); QObject::connect(m_ui.MoveDownPushButton, SIGNAL(clicked()), SLOT(moveDownSlot())); QObject::connect(m_pControlTypeGroup, SIGNAL(controlTypeChanged(int)), SLOT(typeChangedSlot())); QObject::connect(m_pControlTypeGroup, SIGNAL(controlParamChanged(int)), SLOT(keyChangedSlot())); QObject::connect(m_ui.ChannelComboBox, SIGNAL(activated(int)), SLOT(keyChangedSlot())); QObject::connect(m_ui.TrackCheckBox, SIGNAL(toggled(bool)), SLOT(keyChangedSlot())); QObject::connect(m_ui.TrackSpinBox, SIGNAL(valueChanged(int)), SLOT(valueChangedSlot())); QObject::connect(m_ui.CommandComboBox, SIGNAL(activated(int)), SLOT(valueChangedSlot())); QObject::connect(m_ui.FeedbackCheckBox, SIGNAL(toggled(bool)), SLOT(valueChangedSlot())); QObject::connect(m_ui.MapPushButton, SIGNAL(clicked()), SLOT(mapSlot())); QObject::connect(m_ui.UnmapPushButton, SIGNAL(clicked()), SLOT(unmapSlot())); QObject::connect(m_ui.SyncCheckBox, SIGNAL(toggled(bool)), SLOT(syncSlot(bool))); QObject::connect(m_ui.ReloadPushButton, SIGNAL(clicked()), SLOT(reloadSlot())); QObject::connect(m_ui.ExportPushButton, SIGNAL(clicked()), SLOT(exportSlot())); QObject::connect(m_ui.ClosePushButton, SIGNAL(clicked()), SLOT(reject())); }
void MSLayout::childConfigure(MSWidget *widget_) { if (widget_!=label()) MSLayoutManager::childConfigure(widget_); else if (label()->mapped()==MSTrue&&label()->frozen()==MSFalse) adjustSize(); }
purchaseOrderItem::purchaseOrderItem(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); #ifndef Q_WS_MAC _vendorItemNumberList->setMaximumWidth(25); #else _listPrices->setMinimumWidth(60); #endif _invVendUOMRatio = 1; _minimumOrder = 0; _orderMultiple = 0; connect(_ordered, SIGNAL(lostFocus()), this, SLOT(sDeterminePrice())); connect(_inventoryItem, SIGNAL(toggled(bool)), this, SLOT(sInventoryItemToggled(bool))); connect(_item, SIGNAL(privateIdChanged(int)), this, SLOT(sFindWarehouseItemsites(int))); connect(_item, SIGNAL(newId(int)), this, SLOT(sPopulateItemInfo(int))); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_vendorItemNumberList, SIGNAL(clicked()), this, SLOT(sVendorItemNumberList())); connect(_notesButton, SIGNAL(toggled(bool)), this, SLOT(sHandleButtons())); connect(_listPrices, SIGNAL(clicked()), this, SLOT(sVendorListPrices())); connect(_taxLit, SIGNAL(leftClickedURL(QString)), this, SLOT(sTaxDetail())); // new slot added for tax url // connect(_extendedPrice, SIGNAL(valueChanged()), this, SLOT(sCalculateTax())); // new slot added for price // connect(_taxtype, SIGNAL(newID(int)), this, SLOT(sCalculateTax())); // new slot added for taxtype // _parentwo = -1; _parentso = -1; _itemsrcid = -1; _taxzoneid = -1; // _taxzoneid added // _orderQtyCache = -1; _overriddenUnitPrice = false; _ordered->setValidator(omfgThis->qtyVal()); _project->setType(ProjectLineEdit::PurchaseOrder); if(!_metrics->boolean("UseProjects")) _project->hide(); _itemchar = new QStandardItemModel(0, 2, this); _itemchar->setHeaderData( 0, Qt::Horizontal, tr("Name"), Qt::DisplayRole); _itemchar->setHeaderData( 1, Qt::Horizontal, tr("Value"), Qt::DisplayRole); _itemcharView->setModel(_itemchar); ItemCharacteristicDelegate * delegate = new ItemCharacteristicDelegate(this); _itemcharView->setItemDelegate(delegate); _minOrderQty->setValidator(omfgThis->qtyVal()); _orderQtyMult->setValidator(omfgThis->qtyVal()); _received->setValidator(omfgThis->qtyVal()); _invVendorUOMRatio->setValidator(omfgThis->ratioVal()); q.exec("SELECT DISTINCT 1,itemsrc_manuf_name FROM itemsrc;"); _manufName->populate(q); _manufName->setCurrentText(""); //If not multi-warehouse hide whs control if (!_metrics->boolean("MultiWhs")) { _warehouseLit->hide(); _warehouse->hide(); } //If not Revision Control, hide controls if (!_metrics->boolean("RevControl")) _tab->removePage(_tab->page(4)); adjustSize(); //TO DO: Implement later _taxRecoverable->hide(); }
// -------------------------------------------------------------------------------- void QmvFormTool::init( const QString & name ) { // If null name, then there must already be a form. if ( !name.length() && !fh ) return; // Construct a formHeader strutcure if not exists. if (!fh) fh = new formHeader; // Reload with a new form if ( name.length() ) for ( int i = 0; i < reln_form->count(); i++ ) { if ( reln_form->attributeValue( i, "form_code" ) == name ) { if (!fh->load( i, reln_form )) { QMessageBox::information( 0, "init::Not Found", tr("No form could be loaded."), "OK", 0 ); return; } break; } } // Look for includes QString form_detail = QString ( "%1 %2" ) .arg( fh->form_code ).arg( fh->form_includes ); form_detail.simplifyWhiteSpace(); form_detail.replace( QRegExp("[, ]"), "','" ); form_detail = QString( "fmdt_form_code in ( '%1')" ) .arg( form_detail ); int count = reln_fmdt->open( QString("select * from fmdt where %1" ).arg(form_detail) ); // Clear existing objects canvas_details.setAutoDelete( true ); canvas_details.clear(); initDisplayParameters(); // -------------------------------------------- // Setup the page. // Clear the background and set default labels // -------------------------------------------- // Resize canvas to pagesize clearCanvasView(); buildBackgroundPixmap(); QSize sz = background.size(); getCanvas()->resize( background.width(), background.height() ); getCanvas()->setBackgroundPixmap ( background ); canvasView()->adjustSize(); adjustSize(); updateGeometry(); sz = getCanvas()->size(); setCaption( QString( "Forms Management - %1" ).arg(reln_form->attributeValue( 0, "form_desc" ) ) ); displayDetails(); }
/** * @brief Constructs dialog with specified connection */ CreateConnectionDialog::CreateConnectionDialog(ConnectionsDialog* parent) : QDialog(), _connectionsDialog(parent), _connection(nullptr), _fromURI(true), // todo: _fromURI:false _mongoUriWithStatus(nullptr) { setWindowTitle("Create New Connection"); setWindowIcon(GuiRegistry::instance().serverIcon()); setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); // Remove help button (?) setMinimumWidth(450); //setAttribute(Qt::WA_DeleteOnClose); // Splitter-Left auto label01 = new QLabel("Replica Set"); label01->setStyleSheet("font-weight: bold"); auto wid1 = new QLabel; auto repSetImage = QPixmap("C:\\Users\\gsimsek\\Google Drive\\Cases - Drive\\replica_sets\\icons\\repset.png"); wid1->setPixmap(repSetImage); _uriLineEdit = new QLineEdit("mongodb://localhost:27017,localhost:27018,localhost:27019/admin?replicaSet=repset"); auto const& createConnStr= QString("b) <a style='color: %1' href='create'>Create connection manually</a>").arg("#106CD6"); auto createConnLabel = new QLabel(createConnStr); VERIFY(connect(createConnLabel, SIGNAL(linkActivated(QString)), this, SLOT(on_createConnLinkActivated()))); auto splitterL = new QSplitter; splitterL->setOrientation(Qt::Vertical); splitterL->addWidget(label01); splitterL->addWidget(wid1); //splitterL->addWidget(new QLabel("")); //splitterL->addWidget(nameWid); splitterL->addWidget(new QLabel("")); splitterL->addWidget(new QLabel("a) I have a URI connection string:")); splitterL->addWidget(_uriLineEdit); splitterL->addWidget(new QLabel("")); splitterL->addWidget(createConnLabel); splitterL->addWidget(new QLabel("")); // Splitter-Right auto label2 = new QLabel("Stand Alone Server"); label2->setStyleSheet("font-weight: bold"); auto wid2 = new QLabel; auto standAlone = QPixmap("C:\\Users\\gsimsek\\Google Drive\\Cases - Drive\\replica_sets\\icons\\stand_alone.png"); wid2->setPixmap(standAlone); auto splitterR = new QSplitter; splitterR->setOrientation(Qt::Vertical); splitterR->addWidget(label2); splitterR->addWidget(wid2); // Splitter layout auto splitterLay = new QHBoxLayout; splitterLay->addWidget(splitterL); //splitterLay->addWidget(splitterR); // Button Box QPushButton *testButton = new QPushButton("&Test"); testButton->setIcon(qApp->style()->standardIcon(QStyle::SP_MessageBoxInformation)); VERIFY(connect(testButton, SIGNAL(clicked()), this, SLOT(testConnection()))); QHBoxLayout *bottomLayout = new QHBoxLayout; bottomLayout->addWidget(testButton, 1, Qt::AlignLeft); QDialogButtonBox *buttonBox = new QDialogButtonBox(this); buttonBox->setOrientation(Qt::Horizontal); buttonBox->setStandardButtons(QDialogButtonBox::Cancel | QDialogButtonBox::Save); buttonBox->button(QDialogButtonBox::Save)->setText("Next"); VERIFY(connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()))); VERIFY(connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()))); bottomLayout->addWidget(buttonBox); // main layout auto mainLayout = new QVBoxLayout; mainLayout->addLayout(splitterLay); mainLayout->addLayout(bottomLayout); setLayout(mainLayout); //_basicTab->setFocus(); adjustSize(); // Set minimum width - adjustment after adding SSLTab setMinimumWidth(550); }
QmvFormTool::QmvFormTool( QmvRelationWidget * rlw, QmvApplication * parent, const char * name ) : QmvToolWindow( rlw->getRelation(), parent, name ) { // ------------------------------------------------------------ // Query Objects // ------------------------------------------------------------ // Form header fh = 0; pagesize = background.size(); if ( rlw ) rlw_form = rlw; else throw( QmvException( QString( "<h3>QmvFormTool::QmvFormTool</h2>" "Failed to build FORM object" ), QmvException::Critical) ); reln_form = rlw->getRelation(); if ( !reln_form ) throw( QmvException( QString( "<h3>QmvFormTool::QmvFormTool</h2>" "Failed to build FORM object" ), QmvException::Critical) ); // Form details. QmvSqlClass * fmdt_existing = (QmvSqlClass *) reln_form->dataBase()->dbRelation( "fmdt" ); if ( fmdt_existing ) reln_fmdt = new QmvSqlClass( *fmdt_existing ); else throw( QmvException( QString( "<h3>QmvFormTool::QmvFormTool</h2>" "Failed to build FMDT object" ), QmvException::Critical) ); // ------------------------------------------- // Mouse Clicks ------------------------------ // ------------------------------------------- // notice button clicks on grid connect( canvasView(), SIGNAL( clicked( QCanvasItem *, const QPoint &, ButtonState, ButtonState ) ), this, SLOT( popupEventDetails( QCanvasItem *, const QPoint &, ButtonState, ButtonState ) ) ); // doubleclick - edit connect( canvasView(), SIGNAL( doubleClicked( QCanvasItem *, const QPoint &, ButtonState, ButtonState ) ), this, SLOT( dataChangeRequested( QCanvasItem *, const QPoint &, ButtonState, ButtonState ) ) ); // notice grid movements connect( canvasView(), SIGNAL( moved( QCanvasItem *, const QPoint &, const QPoint & ) ), this, SLOT( eventLabelMoved( QCanvasItem *, const QPoint &, const QPoint & ) ) ); // notice resizes connect( canvasView(), SIGNAL( resized( QCanvasItem *, const QRect &, const QRect & ) ), this, SLOT( eventLabelResized( QCanvasItem *, const QRect &, const QRect & ) ) ); // --- ACCELERATORS --------------------------------------- // ------------------------------------------------------------ QAccel * ap_accel = new QAccel( this, "forms" ); int a_id; // line down a_id = ap_accel->insertItem( Key_Down ); ap_accel->connectItem( a_id, this, SLOT( slotLineDown() ) ); ap_accel->setWhatsThis( a_id, "Scroll down one line" ); // line up a_id = ap_accel->insertItem( Key_Up ); ap_accel->connectItem( a_id, this, SLOT( slotLineUp() ) ); ap_accel->setWhatsThis( a_id, "Scroll up one line" ); // page down a_id = ap_accel->insertItem( Key_Next ); ap_accel->connectItem( a_id, this, SLOT( slotPageDown() ) ); ap_accel->setWhatsThis( a_id, "Scroll down one page" ); // page up a_id = ap_accel->insertItem( Key_Prior ); ap_accel->connectItem( a_id, this, SLOT( slotPageUp() ) ); ap_accel->setWhatsThis( a_id, "Scroll up one page" ); QAction * ac; QActionGroup * ag_insert = new QActionGroup( this, "ag_insert" ); // ------------------------------------------------------------ // Navigation Toolbar // ------------------------------------------------------------ // clear the navigation toolbar - not needed yet navigationToolBar()->clear(); // ------------------------------------------------------------ // Tool buttons for adding detail objects // ------------------------------------------------------------ ag_insert->setExclusive(TRUE); QSignalMapper *ndt_sigmap = new QSignalMapper( this ); connect( ndt_sigmap, SIGNAL( mapped(int) ), this, SLOT( slotAddNewDetail(int) ) ); // Label ----------------------------------------------------- ac = new QAction( "Text", *stdicons->makeTextPixmap( new QPixmap(stdicons->getPixmap(QmvIcons::BlankPageIcon)), tr("T"), QFont("Times"), QColor( blue ), QRect() ), "Text", ALT+SHIFT+Key_T, ag_insert, "text", FALSE ); ndt_sigmap->setMapping( ac, formDetail::Label ); connect( ac, SIGNAL( activated() ), ndt_sigmap, SLOT( map() ) ); // Field ----------------------------------------------------- ac = new QAction( "Field", *stdicons->makeTextPixmap( new QPixmap(stdicons->getPixmap(QmvIcons::BlankPageIcon)), tr("F"), QFont("Times"), QColor( blue ), QRect() ), "Field", ALT+SHIFT+Key_F, ag_insert, "Field", FALSE ); ndt_sigmap->setMapping( ac, formDetail::Field ); connect( ac, SIGNAL( activated() ), ndt_sigmap, SLOT( map() ) ); // Line ----------------------------------------------------- ac = new QAction( "Line", *stdicons->makeTextPixmap( new QPixmap(stdicons->getPixmap(QmvIcons::BlankPageIcon)), tr("L"), QFont("Times"), QColor( blue ), QRect() ), "Line", ALT+SHIFT+Key_L, ag_insert, "Line", FALSE ); ndt_sigmap->setMapping( ac, formDetail::Line ); connect( ac, SIGNAL( activated() ), ndt_sigmap, SLOT( map() ) ); // Calc ----------------------------------------------------- ac = new QAction( "Calculation", *stdicons->makeTextPixmap( new QPixmap(stdicons->getPixmap(QmvIcons::BlankPageIcon)), tr("C"), QFont("Times"), QColor( blue ), QRect() ), "Calculation", ALT+SHIFT+Key_C, ag_insert, "Calculation", FALSE ); ndt_sigmap->setMapping( ac, formDetail::Calc ); connect( ac, SIGNAL( activated() ), ndt_sigmap, SLOT( map() ) ); // Special ----------------------------------------------------- ac = new QAction( "Special", *stdicons->makeTextPixmap( new QPixmap(stdicons->getPixmap(QmvIcons::BlankPageIcon)), tr("S"), QFont("Times"), QColor( blue ), QRect() ), "Special", ALT+SHIFT+Key_S, ag_insert, "Special", FALSE ); ndt_sigmap->setMapping( ac, formDetail::Special ); connect( ac, SIGNAL( activated() ), ndt_sigmap, SLOT( map() ) ); // Print ------------------------------------------------------ ac = new QAction( "Print", QPixmap( QmvFormToolIcons::print_xpm ), "&Print", Key_P, ag_insert, "form_print", FALSE ); connect( ac, SIGNAL( activated() ), this, SLOT( slotPrint() ) ); // Fax ------------------------------------------------------ ac = new QAction( "Fax", QPixmap( QmvFormToolIcons::fax_xpm ), "Fa&x", Key_X, ag_insert, "form_fax", FALSE ); connect( ac, SIGNAL( activated() ), this, SLOT( slotFax() ) ); // Email ------------------------------------------------------ ac = new QAction( "Email", QPixmap( QmvFormToolIcons::email_xpm ), "&Email", Key_E, ag_insert, "form_email", FALSE ); connect( ac, SIGNAL( activated() ), this, SLOT( slotEmail() ) ); // Add actiongroup to toolbar otherToolBar()->clear(); new QLabel( "Add new detail: ", otherToolBar(), "display_label" ); ag_insert->addTo( otherToolBar() ); // prepare for display setToolBarsMovable(FALSE); adjustSize(); updateGeometry(); setFocus(); // adjust canvas to the base magnification. setCanvasSize(); }
GUI::GUI(Robot* robot, Ice::CommunicatorPtr ic) { this->robot = robot; QGridLayout* mainLayout = new QGridLayout(); QGridLayout* layoutControl = new QGridLayout(); QVBoxLayout* layoutButtons = new QVBoxLayout(); camerasWidget = new CamerasWidget(robot); buttonStopRobot = new QPushButton("Stop Robot"); checkLaser = new QCheckBox("Laser"); checkCameras = new QCheckBox("Cameras"); InfoCurrentV = new QLabel("Current v (m/s):"); InfoCurrentW = new QLabel("Current w (rad/s):"); currentV = new QLabel("0"); currentW = new QLabel("0"); canvasVW = new controlVW(); canvasVW->setIC(ic); laserWidget =new LaserWidget(); int indiceFilaGui = 0; layoutControl->addWidget(canvasVW, 0, 0); layoutButtons->addWidget(InfoCurrentV, 0); layoutButtons->addWidget(currentV, 1); layoutButtons->addWidget(InfoCurrentW, 2); layoutButtons->addWidget(currentW, 3); QSpacerItem *item = new QSpacerItem(0,200, QSizePolicy::Expanding, QSizePolicy::Fixed); layoutButtons->addItem(item); layoutButtons->addWidget(buttonStopRobot, 2); layoutButtons->addWidget(checkCameras, 3); layoutButtons->addWidget(checkLaser, 4); mainLayout->addLayout(layoutControl, 0, 0); mainLayout->addLayout(layoutButtons, 0, 1); setLayout(mainLayout); setVisible(true); adjustSize(); connect(this, SIGNAL(signal_updateGUI()), this, SLOT(on_updateGUI_recieved())); connect(buttonStopRobot, SIGNAL(clicked()),this, SLOT(on_buttonStopRobot_clicked()) ); connect(canvasVW, SIGNAL(VW_changed(float,float)), this, SLOT(on_update_canvas_recieved(float, float))); connect(checkLaser, SIGNAL(stateChanged(int)), this, SLOT(on_checks_changed())); connect(checkCameras, SIGNAL(stateChanged(int)), this, SLOT(on_checks_changed())); show(); }
SetupCamera::SetupCamera(QWidget* const parent) : QScrollArea(parent), d(new Private) { d->tab = new QTabWidget(viewport()); setWidget(d->tab); setWidgetResizable(true); const int spacing = QApplication::style()->pixelMetric(QStyle::PM_DefaultLayoutSpacing); QWidget* const panel = new QWidget(d->tab); QGridLayout* const grid = new QGridLayout(panel); d->listView = new QTreeWidget(panel); d->listView->sortItems(0, Qt::AscendingOrder); d->listView->setColumnCount(4); d->listView->setRootIsDecorated(false); d->listView->setSelectionMode(QAbstractItemView::SingleSelection); d->listView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); d->listView->setAllColumnsShowFocus(true); d->listView->setWhatsThis(i18n("Here you can see the digital camera list used by digiKam " "via the Gphoto interface.")); QStringList labels; labels.append(i18n("Title")); labels.append(i18n("Model")); labels.append(i18n("Port")); labels.append(i18n("Path")); d->listView->setHeaderLabels(labels); d->listView->header()->setSectionResizeMode(0, QHeaderView::ResizeToContents); d->listView->header()->setSectionResizeMode(1, QHeaderView::Stretch); d->listView->header()->setSectionResizeMode(2, QHeaderView::Stretch); d->listView->header()->setSectionResizeMode(3, QHeaderView::Stretch); // ------------------------------------------------------------- d->addButton = new QPushButton(panel); d->removeButton = new QPushButton(panel); d->editButton = new QPushButton(panel); d->autoDetectButton = new QPushButton(panel); d->addButton->setText(i18n("&Add...")); d->addButton->setIcon(QIcon::fromTheme(QLatin1String("list-add"))); d->removeButton->setText(i18n("&Remove")); d->removeButton->setIcon(QIcon::fromTheme(QLatin1String("list-remove"))); d->editButton->setText(i18n("&Edit...")); d->editButton->setIcon(QIcon::fromTheme(QLatin1String("configure"))); d->autoDetectButton->setText(i18n("Auto-&Detect")); d->autoDetectButton->setIcon(QIcon::fromTheme(QLatin1String("system-search"))); d->removeButton->setEnabled(false); d->editButton->setEnabled(false); // ------------------------------------------------------------- QSpacerItem* const spacer = new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding); DActiveLabel* const gphotoLogoLabel = new DActiveLabel(QUrl(QLatin1String("http://www.gphoto.org")), QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1String("digikam/data/logo-gphoto.png")), panel); gphotoLogoLabel->setToolTip(i18n("Visit Gphoto project website")); #ifndef HAVE_GPHOTO2 // If digiKam is compiled without Gphoto2 support, we hide widgets relevant. d->autoDetectButton->hide(); gphotoLogoLabel->hide(); #endif /* HAVE_GPHOTO2 */ // ------------------------------------------------------------- grid->setContentsMargins(spacing, spacing, spacing, spacing); grid->setSpacing(spacing); grid->setAlignment(Qt::AlignTop); grid->addWidget(d->listView, 0, 0, 6, 1); grid->addWidget(d->addButton, 0, 1, 1, 1); grid->addWidget(d->removeButton, 1, 1, 1, 1); grid->addWidget(d->editButton, 2, 1, 1, 1); grid->addWidget(d->autoDetectButton, 3, 1, 1, 1); grid->addItem(spacer, 4, 1, 1, 1); grid->addWidget(gphotoLogoLabel, 5, 1, 1, 1); d->tab->insertTab(0, panel, i18n("Devices")); // ------------------------------------------------------------- QWidget* const panel2 = new QWidget(d->tab); QVBoxLayout* const layout = new QVBoxLayout(panel2); d->useFileMetadata = new QCheckBox(i18n("Use file metadata (makes connection slower)"), panel2); d->turnHighQualityThumbs = new QCheckBox(i18n("Turn on high quality thumbnail loading (slower loading)"), panel2); d->useDefaultTargetAlbum = new QCheckBox(i18n("Use a default target album to download from camera"), panel2); d->target1AlbumSelector = new AlbumSelectWidget(panel2); d->tab->insertTab(1, panel2, i18n("Behavior")); layout->setContentsMargins(spacing, spacing, spacing, spacing); layout->setSpacing(spacing); layout->addWidget(d->useFileMetadata); layout->addWidget(d->turnHighQualityThumbs); layout->addWidget(d->useDefaultTargetAlbum); layout->addWidget(d->target1AlbumSelector); layout->addStretch(); // ------------------------------------------------------------- QWidget* const panel3 = new QWidget(d->tab); QGridLayout* const importGrid = new QGridLayout(panel3); d->importListView = new QListWidget(panel3); d->importListView->setSelectionMode(QAbstractItemView::SingleSelection); d->importListView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); d->importListView->setWhatsThis(i18n("Here you can see filters that can be used to filter " "files in import dialog.")); d->importAddButton = new QPushButton(panel3); d->importRemoveButton = new QPushButton(panel3); d->importEditButton = new QPushButton(panel3); QSpacerItem* const spacer2 = new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding); QGroupBox* const groupBox = new QGroupBox(panel3); QVBoxLayout* const verticalLayout = new QVBoxLayout(groupBox); QLabel* const label = new QLabel(groupBox); verticalLayout->addWidget(label); d->ignoreNamesEdit = new QLineEdit(groupBox); verticalLayout->addWidget(d->ignoreNamesEdit); QLabel* const label2 = new QLabel(groupBox); verticalLayout->addWidget(label2); d->ignoreExtensionsEdit = new QLineEdit(groupBox); verticalLayout->addWidget(d->ignoreExtensionsEdit); groupBox->setTitle(i18n("Always ignore")); label->setText(i18n("Ignored file names:")); label2->setText(i18n("Ignored file extensions:")); d->importAddButton->setText(i18n("&Add...")); d->importAddButton->setIcon(QIcon::fromTheme(QLatin1String("list-add"))); d->importRemoveButton->setText(i18n("&Remove")); d->importRemoveButton->setIcon(QIcon::fromTheme(QLatin1String("list-remove"))); d->importEditButton->setText(i18n("&Edit...")); d->importEditButton->setIcon(QIcon::fromTheme(QLatin1String("configure"))); d->importRemoveButton->setEnabled(false); d->importEditButton->setEnabled(false); importGrid->setContentsMargins(spacing, spacing, spacing, spacing); importGrid->setSpacing(spacing); importGrid->setAlignment(Qt::AlignTop); importGrid->addWidget(d->importListView, 0, 0, 4, 1); importGrid->addWidget(groupBox, 5, 0, 1, 1); importGrid->addWidget(d->importAddButton, 0, 1, 1, 1); importGrid->addWidget(d->importRemoveButton, 1, 1, 1, 1); importGrid->addWidget(d->importEditButton, 2, 1, 1, 1); importGrid->addItem(spacer2, 3, 1, 1, 1); d->tab->insertTab(2, panel3, i18n("Import Filters")); // -- Import Icon View ---------------------------------------------------------- QWidget* const panel4 = new QWidget(d->tab); QVBoxLayout* const layout2 = new QVBoxLayout(panel4); QGroupBox* const iconViewGroup = new QGroupBox(i18n("Icon-View Options"), panel4); QGridLayout* const grid2 = new QGridLayout(iconViewGroup); d->iconShowNameBox = new QCheckBox(i18n("Show file&name"), iconViewGroup); d->iconShowNameBox->setWhatsThis(i18n("Set this option to show the filename below the image thumbnail.")); d->iconShowSizeBox = new QCheckBox(i18n("Show file si&ze"), iconViewGroup); d->iconShowSizeBox->setWhatsThis(i18n("Set this option to show the file size below the image thumbnail.")); d->iconShowDateBox = new QCheckBox(i18n("Show camera creation &date"), iconViewGroup); d->iconShowDateBox->setWhatsThis(i18n("Set this option to show the camera creation date " "below the image thumbnail")); /* d->iconShowResolutionBox = new QCheckBox(i18n("Show ima&ge dimensions"), iconViewGroup); d->iconShowResolutionBox->setWhatsThis(i18n("Set this option to show the image size in pixels " "below the image thumbnail.")); */ d->iconShowFormatBox = new QCheckBox(i18n("Show image Format"), iconViewGroup); d->iconShowFormatBox->setWhatsThis(i18n("Set this option to show image format over image thumbnail.")); d->iconShowCoordinatesBox = new QCheckBox(i18n("Show Geolocation Indicator"), iconViewGroup); d->iconShowCoordinatesBox->setWhatsThis(i18n("Set this option to indicate if image has geolocation information.")); d->iconShowTagsBox = new QCheckBox(i18n("Show digiKam &tags"), iconViewGroup); d->iconShowTagsBox->setWhatsThis(i18n("Set this option to show the digiKam tags " "below the image thumbnail.")); d->iconShowRatingBox = new QCheckBox(i18n("Show item &rating"), iconViewGroup); d->iconShowRatingBox->setWhatsThis(i18n("Set this option to show the item rating " "below the image thumbnail.")); d->iconShowOverlaysBox = new QCheckBox(i18n("Show rotation overlay buttons"), iconViewGroup); d->iconShowOverlaysBox->setWhatsThis(i18n("Set this option to show overlay buttons on " "the image thumbnail for image rotation.")); QLabel* const leftClickLabel = new QLabel(i18n("Thumbnail click action:"), iconViewGroup); d->leftClickActionComboBox = new QComboBox(iconViewGroup); d->leftClickActionComboBox->addItem(i18n("Show embedded preview"), ImportSettings::ShowPreview); d->leftClickActionComboBox->addItem(i18n("Start image editor"), ImportSettings::StartEditor); d->leftClickActionComboBox->setToolTip(i18n("Choose what should happen when you click on a thumbnail.")); d->iconViewFontSelect = new DFontSelect(i18n("Icon View font:"), panel); d->iconViewFontSelect->setToolTip(i18n("Select here the font used to display text in Icon Views.")); grid2->addWidget(d->iconShowNameBox, 0, 0, 1, 1); grid2->addWidget(d->iconShowSizeBox, 1, 0, 1, 1); grid2->addWidget(d->iconShowDateBox, 2, 0, 1, 1); grid2->addWidget(d->iconShowFormatBox, 3, 0, 1, 1); // grid2->addWidget(d->iconShowResolutionBox, 4, 0, 1, 1); TODO grid2->addWidget(d->iconShowTagsBox, 0, 1, 1, 1); grid2->addWidget(d->iconShowRatingBox, 1, 1, 1, 1); grid2->addWidget(d->iconShowOverlaysBox, 2, 1, 1, 1); grid2->addWidget(d->iconShowCoordinatesBox, 3, 1, 1, 1); grid2->addWidget(leftClickLabel, 5, 0, 1, 1); grid2->addWidget(d->leftClickActionComboBox, 5, 1, 1, 1); grid2->addWidget(d->iconViewFontSelect, 6, 0, 1, 2); grid2->setContentsMargins(spacing, spacing, spacing, spacing); grid2->setSpacing(spacing); // -------------------------------------------------------- QGroupBox* const interfaceOptionsGroup = new QGroupBox(i18n("Preview Options"), panel4); QGridLayout* const grid3 = new QGridLayout(interfaceOptionsGroup); d->previewLoadFullImageSize = new QCheckBox(i18n("Embedded preview loads full-sized images"), interfaceOptionsGroup); d->previewLoadFullImageSize->setWhatsThis(i18n("<p>Set this option to load images at their full size " "for preview, rather than at a reduced size. As this option " "will make it take longer to load images, only use it if you have " "a fast computer.</p>" "<p><b>Note:</b> for Raw images, a half size version of the Raw data " "is used instead of the embedded JPEG preview.</p>")); d->previewItemsWhileDownload = new QCheckBox(i18n("Preview each item while downloading it"), interfaceOptionsGroup); d->previewItemsWhileDownload->setWhatsThis(i18n("<p>Set this option to preview each item while downloading.</p>")); d->previewShowIcons = new QCheckBox(i18n("Show icons and text over preview"), interfaceOptionsGroup); d->previewShowIcons->setWhatsThis(i18n("Uncheck this if you don't want to see icons and text in the image preview.")); grid3->setContentsMargins(spacing, spacing, spacing, spacing); grid3->setSpacing(spacing); grid3->addWidget(d->previewLoadFullImageSize, 0, 0, 1, 2); grid3->addWidget(d->previewItemsWhileDownload, 1, 0, 1, 2); grid3->addWidget(d->previewShowIcons, 2, 0, 1, 2); // -------------------------------------------------------- d->fullScreenSettings = new FullScreenSettings(FS_IMPORTUI, panel4); layout2->setContentsMargins(QMargins()); layout2->setSpacing(spacing); layout2->addWidget(iconViewGroup); layout2->addWidget(interfaceOptionsGroup); layout2->addWidget(d->fullScreenSettings); layout2->addStretch(); d->tab->insertTab(3, panel4, i18n("Import Window")); // ------------------------------------------------------------- adjustSize(); // ------------------------------------------------------------- connect(d->listView, SIGNAL(itemSelectionChanged()), this, SLOT(slotSelectionChanged())); connect(d->addButton, SIGNAL(clicked()), this, SLOT(slotAddCamera())); connect(d->removeButton, SIGNAL(clicked()), this, SLOT(slotRemoveCamera())); connect(d->editButton, SIGNAL(clicked()), this, SLOT(slotEditCamera())); connect(d->autoDetectButton, SIGNAL(clicked()), this, SLOT(slotAutoDetectCamera())); connect(d->useDefaultTargetAlbum, SIGNAL(toggled(bool)), d->target1AlbumSelector, SLOT(setEnabled(bool))); connect(d->previewItemsWhileDownload, SIGNAL(clicked()), this, SLOT(slotPreviewItemsClicked())); connect(d->previewLoadFullImageSize, SIGNAL(clicked()), this, SLOT(slotPreviewFullImageSizeClicked())); // ------------------------------------------------------------- connect(d->importListView, SIGNAL(itemSelectionChanged()), this, SLOT(slotImportSelectionChanged())); connect(d->importAddButton, SIGNAL(clicked()), this, SLOT(slotAddFilter())); connect(d->importRemoveButton, SIGNAL(clicked()), this, SLOT(slotRemoveFilter())); connect(d->importEditButton, SIGNAL(clicked()), this, SLOT(slotEditFilter())); // ------------------------------------------------------------- connect(d->useFileMetadata, SIGNAL(toggled(bool)), this, SIGNAL(signalUseFileMetadataChanged(bool))); // ------------------------------------------------------------- readSettings(); }
void ListBox::setListModel(ListModel *listModel) { mSelected = -1; mListModel = listModel; adjustSize(); }
void ShareDialog::showRemindCheck(bool b) { check_widget->setVisible(b); adjustSize(); }
MicroSettingsDlg::MicroSettingsDlg( MicroSettings * microSettings, QWidget *parent, const char *name ) : //KDialog( parent, name, true, i18n("PIC Settings"), KDialog::Ok|KDialog::Apply|KDialog::Cancel, KDialog::Ok, true ) KDialog( parent /*, name, true, i18n("PIC Settings"), KDialog::Ok|KDialog::Apply|KDialog::Cancel, KDialog::Ok, true */ ) { setName(name); setModal(true); setCaption(i18n("PIC Settings")); setButtons(KDialog::Ok | KDialog::Apply | KDialog::Cancel); setDefaultButton(KDialog::Ok); showButtonSeparator(true); m_pMicroSettings = microSettings; m_pNewPinMappingWidget = 0l; m_pNewPinMappingDlg = 0l; m_pWidget = new MicroSettingsWidget(this); QWhatsThis::add( this, i18n("This dialog allows editing of the initial properties of the PIC") ); QWhatsThis::add( m_pWidget->portsGroupBox, i18n("Edit the initial value of the ports here. For each binary number, the order from right-to-left is pins 0 through 7.<br><br>The \"Type (TRIS)\" edit shows the initial input/output state of the ports; 1 represents an input, and 0 an output.<br><br>The \"State (PORT)\" edit shows the initial high/low state of the ports; 1 represents a high, and 0 a low.") ); QWhatsThis::add( m_pWidget->variables, i18n("Edit the initial value of the variables here.<br><br>Note that the value of the variable can only be in the range 0->255. These variables will be initialized before any other code is executed.") ); //BEGIN Initialize initial port settings m_portNames = microSettings->microInfo()->package()->portNames(); m_portTypeEdit.resize( m_portNames.size(), 0 ); m_portStateEdit.resize( m_portNames.size(), 0 ); uint row = 0; QStringList::iterator end = m_portNames.end(); for ( QStringList::iterator it = m_portNames.begin(); it != end; ++it, ++row ) { //BEGIN Get current Type / State text QString portType = QString::number( microSettings->portType(*it), 2 ); QString portState = QString::number( microSettings->portState(*it), 2 ); QString fill; fill.fill( '0', 8-portType.length() ); portType.prepend(fill); fill.fill( '0', 8-portState.length() ); portState.prepend(fill); //END Get current Type / State text Q3GroupBox * groupBox = new Q3GroupBox( *it, m_pWidget->portsGroupBox ); groupBox->setColumnLayout(0, Qt::Vertical ); groupBox->layout()->setSpacing( 6 ); groupBox->layout()->setMargin( 11 ); QGridLayout * groupBoxLayout = new QGridLayout( groupBox->layout() ); groupBoxLayout->setAlignment( Qt::AlignTop ); // TODO: replace this with i18n( "the type", "Type (TRIS register):" ); groupBoxLayout->addWidget( new QLabel( i18n("Type (TRIS register):"), groupBox ), 0, 0 ); groupBoxLayout->addWidget( new QLabel( i18n("State (PORT register):"), groupBox ), 1, 0 ); m_portTypeEdit[row] = new KLineEdit( portType, groupBox ); groupBoxLayout->addWidget( m_portTypeEdit[row], 0, 1 ); m_portStateEdit[row] = new KLineEdit( portState, groupBox ); groupBoxLayout->addWidget( m_portStateEdit[row], 1, 1 ); // (dynamic_cast<QVBoxLayout*>(m_pWidget->portsGroupBox->layout()))->insertWidget( row, groupBox ); (dynamic_cast<QVBoxLayout*>(m_pWidget->portsGroupBox->layout()))->addWidget( groupBox ); } //END Initialize initial port settings //BEGIN Initialize initial variable settings // Hide row headers m_pWidget->variables->setLeftMargin(0); // Make columns as thin as possible m_pWidget->variables->setColumnStretchable( 0, true ); m_pWidget->variables->setColumnStretchable( 1, true ); QStringList variables = microSettings->variableNames(); row = 0; end = variables.end(); for ( QStringList::iterator it = variables.begin(); it != end; ++it ) { VariableInfo *info = microSettings->variableInfo(*it); if (info) { m_pWidget->variables->insertRows( row, 1 ); m_pWidget->variables->setText( row, 0, *it ); m_pWidget->variables->setText( row, 1, info->valueAsString() ); ++row; } } m_pWidget->variables->insertRows( row, 1 ); connect( m_pWidget->variables, SIGNAL(valueChanged(int,int)), this, SLOT(checkAddVariableRow()) ); //END Initialize initial variable settings //BEGIN Initialize pin maps connect( m_pWidget->pinMapAdd, SIGNAL(clicked()), this, SLOT(slotCreatePinMap()) ); connect( m_pWidget->pinMapModify, SIGNAL(clicked()), this, SLOT(slotModifyPinMap()) ); connect( m_pWidget->pinMapRename, SIGNAL(clicked()), this, SLOT(slotRenamePinMap()) ); connect( m_pWidget->pinMapRemove, SIGNAL(clicked()), this, SLOT(slotRemovePinMap()) ); m_pinMappings = microSettings->pinMappings(); m_pWidget->pinMapCombo->insertStringList( m_pinMappings.keys() ); updatePinMapButtons(); //END Initialize pin maps //enableButtonSeparator( false ); showButtonSeparator( false ); setMainWidget(m_pWidget); m_pWidget->adjustSize(); adjustSize(); connect( this, SIGNAL(applyClicked()), this, SLOT(slotSaveStuff()) ); }
OptionsForm::OptionsForm ( QWidget* pParent ) : QDialog(pParent) { m_ui.setupUi(this); // No settings descriptor initially (the caller will set it). m_pOptions = NULL; // Initialize dirty control state. m_iDirtySetup = 0; m_iDirtyCount = 0; // Set dialog validators... m_ui.ServerPortComboBox->setValidator( new QIntValidator(m_ui.ServerPortComboBox)); // Try to restore old window positioning. adjustSize(); QObject::connect(m_ui.ServerHostComboBox, SIGNAL(editTextChanged(const QString&)), SLOT(optionsChanged())); QObject::connect(m_ui.ServerPortComboBox, SIGNAL(editTextChanged(const QString&)), SLOT(optionsChanged())); QObject::connect(m_ui.ServerTimeoutSpinBox, SIGNAL(valueChanged(int)), SLOT(optionsChanged())); QObject::connect(m_ui.ServerStartCheckBox, SIGNAL(stateChanged(int)), SLOT(optionsChanged())); QObject::connect(m_ui.ServerCmdLineComboBox, SIGNAL(editTextChanged(const QString&)), SLOT(optionsChanged())); QObject::connect(m_ui.StartDelaySpinBox, SIGNAL(valueChanged(int)), SLOT(optionsChanged())); QObject::connect(m_ui.MessagesLogCheckBox, SIGNAL(stateChanged(int)), SLOT(optionsChanged())); QObject::connect(m_ui.MessagesLogPathComboBox, SIGNAL(editTextChanged(const QString&)), SLOT(optionsChanged())); QObject::connect(m_ui.MessagesLogPathToolButton, SIGNAL(clicked()), SLOT(browseMessagesLogPath())); QObject::connect(m_ui.DisplayFontPushButton, SIGNAL(clicked()), SLOT(chooseDisplayFont())); QObject::connect(m_ui.DisplayEffectCheckBox, SIGNAL(toggled(bool)), SLOT(toggleDisplayEffect(bool))); QObject::connect(m_ui.AutoRefreshCheckBox, SIGNAL(stateChanged(int)), SLOT(optionsChanged())); QObject::connect(m_ui.AutoRefreshTimeSpinBox, SIGNAL(valueChanged(int)), SLOT(optionsChanged())); QObject::connect(m_ui.MaxVolumeSpinBox, SIGNAL(valueChanged(int)), SLOT(optionsChanged())); QObject::connect(m_ui.MessagesFontPushButton, SIGNAL(clicked()), SLOT(chooseMessagesFont())); QObject::connect(m_ui.MessagesLimitCheckBox, SIGNAL(stateChanged(int)), SLOT(optionsChanged())); QObject::connect(m_ui.MessagesLimitLinesSpinBox, SIGNAL(valueChanged(int)), SLOT(optionsChanged())); QObject::connect(m_ui.ConfirmRemoveCheckBox, SIGNAL(stateChanged(int)), SLOT(optionsChanged())); QObject::connect(m_ui.ConfirmResetCheckBox, SIGNAL(stateChanged(int)), SLOT(optionsChanged())); QObject::connect(m_ui.ConfirmRestartCheckBox, SIGNAL(stateChanged(int)), SLOT(optionsChanged())); QObject::connect(m_ui.ConfirmErrorCheckBox, SIGNAL(stateChanged(int)), SLOT(optionsChanged())); QObject::connect(m_ui.KeepOnTopCheckBox, SIGNAL(stateChanged(int)), SLOT(optionsChanged())); QObject::connect(m_ui.StdoutCaptureCheckBox, SIGNAL(stateChanged(int)), SLOT(optionsChanged())); QObject::connect(m_ui.MaxRecentFilesSpinBox, SIGNAL(valueChanged(int)), SLOT(optionsChanged())); QObject::connect(m_ui.CompletePathCheckBox, SIGNAL(stateChanged(int)), SLOT(optionsChanged())); QObject::connect(m_ui.InstrumentNamesCheckBox, SIGNAL(stateChanged(int)), SLOT(optionsChanged())); QObject::connect(m_ui.BaseFontSizeComboBox, SIGNAL(editTextChanged(const QString&)), SLOT(optionsChanged())); QObject::connect(m_ui.MaxVoicesSpinBox, SIGNAL(valueChanged(int)), SLOT(maxVoicesChanged(int))); QObject::connect(m_ui.MaxStreamsSpinBox, SIGNAL(valueChanged(int)), SLOT(maxStreamsChanged(int))); QObject::connect(m_ui.DialogButtonBox, SIGNAL(accepted()), SLOT(accept())); QObject::connect(m_ui.DialogButtonBox, SIGNAL(rejected()), SLOT(reject())); }
/** * @brief TimeTable::openTimeTable 시간표 파일을 읽는다 */ void TimeTable::openTimeTable() { // 변경된 시간표를 저장할지 물어봄 if (!saveModifiedTable()) return; QString name = QFileDialog::getOpenFileName(this, tr("시간표 열기"), QString(), tr("시간표 (*.tbl);;" "모든 파일 (*)")); // 파일을 골랐으면 if (!name.isEmpty()) { QFile f(name); // 읽기 전용으로 파일 열기 if (f.open(QIODevice::ReadOnly)) { _timeTable->clear(); // 테이블 초기화 QTextStream in(&f); // 파일을 텍스트 스트림으로 처리 in >> _tableRows >> _tableCols; // 세로줄 수와 가로줄 수 읽기 in.readLine(); // 줄바꿈 문자 읽기 _timeTable->setColumnCount(_tableCols); // 가로줄 수 설정 _timeTable->setRowCount(_tableRows); // 세로줄 수 설정 // 세로 헤더 아이템 읽어 설정 for (int i = 0; i < _tableCols; ++i) { QTableWidgetItem *item = new QTableWidgetItem; item->setText(in.readLine()); _timeTable->setHorizontalHeaderItem(i, item); } _timeTable->horizontalHeader()->setContextMenuPolicy(Qt::CustomContextMenu); connect(_timeTable->horizontalHeader(), SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(headerContextMenuRequested(QPoint))); // 가로 헤더 아이템 읽어 설정 for (int i = 0; i < _tableRows; ++i) { QTableWidgetItem *item = new QTableWidgetItem; item->setText(in.readLine()); _timeTable->setVerticalHeaderItem(i, item); } _timeTable->verticalHeader()->setContextMenuPolicy(Qt::CustomContextMenu); connect(_timeTable->verticalHeader(), SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(headerContextMenuRequested(QPoint))); // 테이블 셀 설정 for (int i = 0; i < _tableRows; ++i) { for (int j = 0; j < _tableCols; ++j) { _timeTable->setItem(i, j, new QTableWidgetItem(in.readLine())); } } f.close(); // 파일 닫음 // 테이블 크기에 따라 창크기 조절 resize(_timeTable->sizeHint().width(), _timeTable->sizeHint().height()); adjustSize(); // 내부 위젯에 맞추어 크기 조절 setFileName(name); // 파일 이름 설정 setWindowModified(false); // 변경되지 않았 }
configureSO::configureSO(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_invoiceNumOfCopies, SIGNAL(valueChanged(int)), this, SLOT(sHandleInvoiceCopies(int))); connect(_creditMemoNumOfCopies, SIGNAL(valueChanged(int)), this, SLOT(sHandleCreditMemoCopies(int))); connect(_invoiceWatermarks, SIGNAL(itemSelected(int)), this, SLOT(sEditInvoiceWatermark())); connect(_creditLimit, SIGNAL(editingFinished()), this, SLOT(sEditCreditLimit())); connect(_creditMemoWatermarks, SIGNAL(itemSelected(int)), this, SLOT(sEditCreditMemoWatermark())); connect(_askUpdatePrice, SIGNAL(toggled(bool)), _ignoreCustDisc, SLOT(setEnabled(bool))); _invoiceWatermarks->addColumn( tr("Copy #"), _dateColumn, Qt::AlignCenter ); _invoiceWatermarks->addColumn( tr("Watermark"), -1, Qt::AlignLeft ); _invoiceWatermarks->addColumn( tr("Show Prices"), _dateColumn, Qt::AlignCenter ); _creditMemoWatermarks->addColumn( tr("Copy #"), _dateColumn, Qt::AlignCenter ); _creditMemoWatermarks->addColumn( tr("Watermark"), -1, Qt::AlignLeft ); _creditMemoWatermarks->addColumn( tr("Show Prices"), _dateColumn, Qt::AlignCenter ); _nextSoNumber->setValidator(omfgThis->orderVal()); _nextQuNumber->setValidator(omfgThis->orderVal()); _nextRaNumber->setValidator(omfgThis->orderVal()); _nextCmNumber->setValidator(omfgThis->orderVal()); _nextInNumber->setValidator(omfgThis->orderVal()); _creditLimit->setValidator(omfgThis->moneyVal()); QString metric = _metrics->value("CONumberGeneration"); if (metric == "M") _orderNumGeneration->setCurrentIndex(0); else if (metric == "A") _orderNumGeneration->setCurrentIndex(1); else if (metric == "O") _orderNumGeneration->setCurrentIndex(2); metric = _metrics->value("QUNumberGeneration"); if (metric == "M") _quoteNumGeneration->setCurrentIndex(0); else if (metric == "A") _quoteNumGeneration->setCurrentIndex(1); else if (metric == "O") _quoteNumGeneration->setCurrentIndex(2); else if (metric == "S") _quoteNumGeneration->setCurrentIndex(3); metric = _metrics->value("CMNumberGeneration"); if (metric == "M") _creditMemoNumGeneration->setCurrentIndex(0); else if (metric == "A") _creditMemoNumGeneration->setCurrentIndex(1); else if (metric == "O") _creditMemoNumGeneration->setCurrentIndex(2); else if (metric == "S") _creditMemoNumGeneration->setCurrentIndex(3); metric = _metrics->value("InvcNumberGeneration"); if (metric == "M") _invoiceNumGeneration->setCurrentIndex(0); else if (metric == "A") _invoiceNumGeneration->setCurrentIndex(1); else if (metric == "O") _invoiceNumGeneration->setCurrentIndex(2); metric = _metrics->value("InvoiceDateSource"); if (metric == "scheddate") _invcScheddate->setChecked(true); else if (metric == "shipdate") _invcShipdate->setChecked(true); else _invcCurrdate->setChecked(true); q.exec( "SELECT sonumber.orderseq_number AS sonumber," " qunumber.orderseq_number AS qunumber," " cmnumber.orderseq_number AS cmnumber," " innumber.orderseq_number AS innumber " "FROM orderseq AS sonumber," " orderseq AS qunumber," " orderseq AS cmnumber," " orderseq AS innumber " "WHERE ( (sonumber.orderseq_name='SoNumber')" " AND (qunumber.orderseq_name='QuNumber')" " AND (cmnumber.orderseq_name='CmNumber')" " AND (innumber.orderseq_name='InvcNumber') );" ); if (q.first()) { _nextSoNumber->setText(q.value("sonumber")); _nextQuNumber->setText(q.value("qunumber")); _nextCmNumber->setText(q.value("cmnumber")); _nextInNumber->setText(q.value("innumber")); } else if (q.lastError().type() != QSqlError::NoError) { systemError(this, q.lastError().databaseText(), __FILE__, __LINE__); return; } _allowDiscounts->setChecked(_metrics->boolean("AllowDiscounts")); _allowASAP->setChecked(_metrics->boolean("AllowASAPShipSchedules")); _customerChangeLog->setChecked(_metrics->boolean("CustomerChangeLog")); _salesOrderChangeLog->setChecked(_metrics->boolean("SalesOrderChangeLog")); _restrictCreditMemos->setChecked(_metrics->boolean("RestrictCreditMemos")); _autoSelectForBilling->setChecked(_metrics->boolean("AutoSelectForBilling")); _saveAndAdd->setChecked(_metrics->boolean("AlwaysShowSaveAndAdd")); _firmAndAdd->setChecked(_metrics->boolean("FirmSalesOrderPackingList")); _priceOverride->setChecked(_metrics->boolean("DisableSalesOrderPriceOverride")); _autoAllocateCM->setChecked(_metrics->boolean("AutoAllocateCreditMemos")); _hideSOMiscChrg->setChecked(_metrics->boolean("HideSOMiscCharge")); _enableSOShipping->setChecked(_metrics->boolean("EnableSOShipping")); _printSO->setChecked(_metrics->boolean("DefaultPrintSOOnSave")); _enablePromiseDate->setChecked(_metrics->boolean("UsePromiseDate")); _calcFreight->setChecked(_metrics->boolean("CalculateFreight")); _includePkgWeight->setChecked(_metrics->boolean("IncludePackageWeight")); _invoiceNumOfCopies->setValue(_metrics->value("InvoiceCopies").toInt()); if (_invoiceNumOfCopies->value()) { for (int counter = 0; counter < _invoiceWatermarks->topLevelItemCount(); counter++) { _invoiceWatermarks->topLevelItem(counter)->setText(1, _metrics->value(QString("InvoiceWatermark%1").arg(counter))); _invoiceWatermarks->topLevelItem(counter)->setText(2, ((_metrics->value(QString("InvoiceShowPrices%1").arg(counter)) == "t") ? tr("Yes") : tr("No"))); } } _creditMemoNumOfCopies->setValue(_metrics->value("CreditMemoCopies").toInt()); if (_invoiceNumOfCopies->value()) { for (int counter = 0; counter < _creditMemoWatermarks->topLevelItemCount(); counter++) { _creditMemoWatermarks->topLevelItem(counter)->setText(1, _metrics->value(QString("CreditMemoWatermark%1").arg(counter))); _creditMemoWatermarks->topLevelItem(counter)->setText(2, ((_metrics->value(QString("CreditMemoShowPrices%1").arg(counter)) == "t") ? tr("Yes") : tr("No"))); } } _shipform->setId(_metrics->value("DefaultShipFormId").toInt()); _shipvia->setId(_metrics->value("DefaultShipViaId").toInt()); if (_metrics->value("DefaultBalanceMethod") == "B") _balanceMethod->setCurrentIndex(0); else if (_metrics->value("DefaultBalanceMethod") == "O") _balanceMethod->setCurrentIndex(1); _custtype->setId(_metrics->value("DefaultCustType").toInt()); _salesrep->setId(_metrics->value("DefaultSalesRep").toInt()); _terms->setId(_metrics->value("DefaultTerms").toInt()); _partial->setChecked(_metrics->boolean("DefaultPartialShipments")); _backorders->setChecked(_metrics->boolean("DefaultBackOrders")); _freeFormShiptos->setChecked(_metrics->boolean("DefaultFreeFormShiptos")); _creditLimit->setText(_metrics->value("SOCreditLimit")); _creditRating->setText(_metrics->value("SOCreditRate")); if (_metrics->value("soPriceEffective") == "OrderDate") _priceOrdered->setChecked(true); else if (_metrics->value("soPriceEffective") == "ScheduleDate") _priceScheduled->setChecked(true); if(_metrics->value("UpdatePriceLineEdit").toInt() == 1) _dontUpdatePrice->setChecked(true); else if (_metrics->value("UpdatePriceLineEdit").toInt() == 2) _askUpdatePrice->setChecked(true); else if(_metrics->value("UpdatePriceLineEdit").toInt() == 3) _updatePrice->setChecked(true); _ignoreCustDisc->setChecked(_askUpdatePrice->isChecked() && _metrics->boolean("IgnoreCustDisc")); this->setWindowTitle("Sales Configuration"); //Set status of Returns Authorization based on context if(_metrics->value("Application") == "PostBooks") { _authNumGenerationLit->setVisible(false); _returnAuthorizationNumGeneration->setVisible(false); _nextRaNumberLit->setVisible(false); _nextRaNumber->setVisible(false); _tab->removePage(_tab->page(3)); _enableReturns->setChecked(false); _enableReservations->hide(); _enableReservations->setChecked(false); _locationGroup->hide(); _locationGroup->setChecked(false); _lowest->setChecked(false); _highest->setChecked(false); _alpha->setChecked(false); } else { q.exec("SELECT rahead_id FROM rahead LIMIT 1;"); if (q.first()) _enableReturns->setCheckable(false); else _enableReturns->setChecked(_metrics->boolean("EnableReturnAuth")); q.exec( "SELECT ranumber.orderseq_number AS ranumber " "FROM orderseq AS ranumber " "WHERE (ranumber.orderseq_name='RaNumber');" ); if (q.first()) { _nextRaNumber->setText(q.value("ranumber")); } else _nextRaNumber->setText("10000"); metric = _metrics->value("RANumberGeneration"); if (metric == "M") _returnAuthorizationNumGeneration->setCurrentIndex(0); else if (metric == "A") _returnAuthorizationNumGeneration->setCurrentIndex(1); else if (metric == "O") _returnAuthorizationNumGeneration->setCurrentIndex(2); metric = _metrics->value("DefaultRaDisposition"); if (metric == "C") _disposition->setCurrentIndex(0); else if (metric == "R") _disposition->setCurrentIndex(1); else if (metric == "P") _disposition->setCurrentIndex(2); else if (metric == "V") _disposition->setCurrentIndex(3); else if (metric == "M") _disposition->setCurrentIndex(4); if (_metrics->value("DefaultRaTiming") == "R") _timing->setCurrentIndex(1); metric = _metrics->value("DefaultRaCreditMethod"); if (metric == "N") _creditBy->setCurrentIndex(0); else if (metric == "M") _creditBy->setCurrentIndex(1); else if (metric == "K") _creditBy->setCurrentIndex(2); else if (metric == "C") _creditBy->setCurrentIndex(3); _returnAuthChangeLog->setChecked(_metrics->boolean("ReturnAuthorizationChangeLog")); _printRA->setChecked(_metrics->boolean("DefaultPrintRAOnSave")); _enableReservations->setChecked(_metrics->boolean("EnableSOReservations")); _locationGroup->setChecked(_metrics->boolean("EnableSOReservationsByLocation")); if(_metrics->value("SOReservationLocationMethod").toInt() == 1) _lowest->setChecked(true); else if (_metrics->value("SOReservationLocationMethod").toInt() == 2) _highest->setChecked(true); else if(_metrics->value("SOReservationLocationMethod").toInt() == 3) _alpha->setChecked(true); } adjustSize(); }
KstMatrixDialogI::KstMatrixDialogI(QWidget* parent, const char* name, bool modal, WFlags fl) : KstDataDialog(parent, name, modal, fl) { _w = new MatrixDialogWidget(_contents); setMultiple(true); _inTest = false; _w->_fileName->completionObject()->setDir(QDir::currentDirPath()); connect(_w->_readFromSource, SIGNAL(clicked()), this, SLOT(updateEnables())); connect(_w->_generateGradient, SIGNAL(clicked()), this, SLOT(updateEnables())); connect(_w->_xStartCountFromEnd, SIGNAL(clicked()), this, SLOT(xStartCountFromEndClicked())); connect(_w->_yStartCountFromEnd, SIGNAL(clicked()), this, SLOT(yStartCountFromEndClicked())); connect(_w->_xNumStepsReadToEnd, SIGNAL(clicked()), this, SLOT(xNumStepsReadToEndClicked())); connect(_w->_yNumStepsReadToEnd, SIGNAL(clicked()), this, SLOT(yNumStepsReadToEndClicked())); connect(_w->_doSkip, SIGNAL(clicked()), this, SLOT(updateEnables())); _w->_fileName->setMode(KFile::File | KFile::Directory | KFile::ExistingOnly); connect(_w->_fileName, SIGNAL(openFileDialog(KURLRequester *)), this, SLOT(selectFolder())); connect(_w->_fileName, SIGNAL(textChanged(const QString&)), this, SLOT(updateCompletion())); connect(_w->_configure, SIGNAL(clicked()), this, SLOT(configureSource())); connect(_w->_readFromSource, SIGNAL(clicked()), this, SLOT(enableSource())); connect(_w->_generateGradient, SIGNAL(clicked()), this, SLOT(updateEnables())); connect(_w->_connect, SIGNAL(clicked()), this, SLOT(testURL())); _w->_configure->setEnabled(false); _fieldCompletion = _w->_field->completionObject(); _w->_field->setAutoDeleteCompletionObject(true); setFixedHeight(height()); _configWidget = 0L; _w->_field->setEnabled(false); _ok->setEnabled(_w->_field->isEnabled()); // connections for multiple edit mode connect(_w->_xStartCountFromEnd, SIGNAL(clicked()), this, SLOT(setXStartCountFromEndDirty())); connect(_w->_yStartCountFromEnd, SIGNAL(clicked()), this, SLOT(setYStartCountFromEndDirty())); connect(_w->_xNumStepsReadToEnd, SIGNAL(clicked()), this, SLOT(setXNumStepsReadToEndDirty())); connect(_w->_yNumStepsReadToEnd, SIGNAL(clicked()), this, SLOT(setYNumStepsReadToEndDirty())); connect(_w->_doSkip, SIGNAL(clicked()), this, SLOT(setDoSkipDirty())); connect(_w->_doAve, SIGNAL(clicked()), this, SLOT(setDoAveDirty())); // for apply button connect(_w->_fileName, SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply())); connect(_w->_field, SIGNAL(highlighted(int)), this, SLOT(wasModifiedApply())); connect(_w->_configure, SIGNAL(clicked()), this, SLOT(wasModifiedApply())); connect(_w->_xStart, SIGNAL(valueChanged(int)), this, SLOT(wasModifiedApply())); connect(_w->_yStart, SIGNAL(valueChanged(int)), this, SLOT(wasModifiedApply())); connect(_w->_xNumSteps, SIGNAL(valueChanged(int)), this, SLOT(wasModifiedApply())); connect(_w->_yNumSteps, SIGNAL(valueChanged(int)), this, SLOT(wasModifiedApply())); connect(_w->_xStart->child("qt_spinbox_edit"), SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply())); connect(_w->_yStart->child("qt_spinbox_edit"), SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply())); connect(_w->_xNumSteps->child("qt_spinbox_edit"), SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply())); connect(_w->_yNumSteps->child("qt_spinbox_edit"), SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply())); connect(_w->_xStartCountFromEnd, SIGNAL(clicked()), this, SLOT(wasModifiedApply())); connect(_w->_yStartCountFromEnd, SIGNAL(clicked()), this, SLOT(wasModifiedApply())); connect(_w->_xNumStepsReadToEnd, SIGNAL(clicked()), this, SLOT(wasModifiedApply())); connect(_w->_yNumStepsReadToEnd, SIGNAL(clicked()), this, SLOT(wasModifiedApply())); connect(_w->_doSkip, SIGNAL(clicked()), this, SLOT(wasModifiedApply())); connect(_w->_skip, SIGNAL(valueChanged(int)), this, SLOT(wasModifiedApply())); connect(_w->_skip->child("qt_spinbox_edit"), SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply())); connect(_w->_doAve, SIGNAL(clicked()), this, SLOT(wasModifiedApply())); connect(_w->_gradientX, SIGNAL(clicked()), this, SLOT(wasModifiedApply())); connect(_w->_gradientY, SIGNAL(clicked()), this, SLOT(wasModifiedApply())); connect(_w->_gradientZAtMin, SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply())); connect(_w->_gradientZAtMax, SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply())); connect(_w->_nX, SIGNAL(valueChanged(int)), this, SLOT(wasModifiedApply())); connect(_w->_nY, SIGNAL(valueChanged(int)), this, SLOT(wasModifiedApply())); connect(_w->_minX, SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply())); connect(_w->_minY, SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply())); connect(_w->_xStep, SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply())); connect(_w->_yStep, SIGNAL(textChanged(const QString&)), this, SLOT(wasModifiedApply())); adjustSize(); resize(minimumSizeHint()); setFixedHeight(height()); }
VarManager::VarManager(FieldArchive *fieldArchive, QWidget *parent) : QWidget(parent, Qt::Tool) { setWindowTitle(tr("Gestionnaire de variables")); QFont font; font.setPointSize(8); QGridLayout *globalLayout = new QGridLayout(this); QHBoxLayout *layout1 = new QHBoxLayout(); bank = new QSpinBox(this); bank->setRange(1,15); adress = new QSpinBox(this); adress->setRange(0,255); name = new QLineEdit(this); name->setMaxLength(50); rename = new QPushButton(tr("Renommer"), this); layout1->addWidget(bank); layout1->addWidget(adress); layout1->addWidget(name); layout1->addWidget(rename); QHBoxLayout *layout2 = new QHBoxLayout(); liste1 = new QListWidget(this); liste1->setFixedWidth(40); liste1->setFont(font); liste2 = new QTreeWidget(this); liste2->setColumnCount(4); liste2->setHeaderLabels(QStringList() << tr("Adresse") << tr("Surnom") << tr("Opération") << tr("Taille")); liste2->setIndentation(0); liste2->setItemsExpandable(false); liste2->setSortingEnabled(true); liste2->setFont(font); layout2->addWidget(liste1); layout2->addWidget(liste2); QHBoxLayout *layout3 = new QHBoxLayout(); searchButton = new QPushButton(tr("Adresses utilisées"), this); ok = new QPushButton(QApplication::style()->standardIcon(QStyle::SP_DialogSaveButton), tr("Enregistrer"), this); ok->setEnabled(false); layout3->addWidget(searchButton); layout3->addStretch(); layout3->addWidget(ok); globalLayout->addLayout(layout1, 0, 0); globalLayout->addLayout(layout2, 1, 0); globalLayout->addLayout(layout3, 2, 0); setFieldArchive(fieldArchive); local_var_names = Var::get(); fillList1(); fillList2(); liste1->setCurrentRow(0); liste2->setCurrentItem(liste2->topLevelItem(0)); changeBank(0); fillForm(); connect(bank, SIGNAL(valueChanged(int)), SLOT(scrollToList1(int))); connect(adress, SIGNAL(valueChanged(int)), SLOT(scrollToList2(int))); connect(liste1, SIGNAL(currentRowChanged(int)), SLOT(changeBank(int))); connect(liste2, SIGNAL(itemSelectionChanged()), SLOT(fillForm())); connect(name, SIGNAL(returnPressed()), SLOT(renameVar())); connect(rename, SIGNAL(released()), SLOT(renameVar())); connect(ok, SIGNAL(released()), SLOT(save())); connect(searchButton, SIGNAL(released()), SLOT(search())); adjustSize(); }
void TwoButton::setDownImage(Image* image) { m_downImage = image; adjustSize(); }
KexiCSVImportOptionsDialog::KexiCSVImportOptionsDialog( const KexiCSVImportOptions& options, QWidget* parent) : KDialog(parent) { setWindowTitle(i18n("CSV Import Options")); setButtons(Ok | Cancel); setDefaultButton(Ok); setObjectName("KexiCSVImportOptionsDialog"); setModal(true); QWidget *plainPage = new QWidget(this); setMainWidget(plainPage); QGridLayout *lyr = new QGridLayout(plainPage); QGroupBox* textEncodingGroupBox = new QGroupBox(i18n("Text encoding"), plainPage); lyr->addWidget(textEncodingGroupBox, 0, 0, 1, 2); QVBoxLayout* textEncodingGroupBoxLyr = new QVBoxLayout; KexiUtils::setStandardMarginsAndSpacing(textEncodingGroupBoxLyr); textEncodingGroupBox->setLayout(textEncodingGroupBoxLyr); textEncodingGroupBoxLyr->addItem(new QSpacerItem(20, 15, QSizePolicy::Fixed, QSizePolicy::Fixed)); m_encodingComboBox = new KexiCharacterEncodingComboBox(textEncodingGroupBox, options.encoding); textEncodingGroupBoxLyr->addWidget(m_encodingComboBox); lyr->addItem(new QSpacerItem(20, KDialog::spacingHint(), QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 2); m_chkAlwaysUseThisEncoding = new QCheckBox( i18n("Always use this encoding when importing CSV data files"), textEncodingGroupBox); textEncodingGroupBoxLyr->addWidget(m_chkAlwaysUseThisEncoding); m_comboDateFormat = new QComboBox(plainPage); m_comboDateFormat->setObjectName("m_comboDateFormat"); m_comboDateFormat->addItem(i18nc("Date format: Auto", "Auto")); QString year(i18n("year")), month(i18n("month")), day(i18n("day")); QString mask(i18nc("do not reorder placeholders, just translate e.g. and - to the separator used by dates in your language", "%1, %2, %3 (e.g. %4-%5-%6)")); m_comboDateFormat->addItem( mask.arg(day).arg(month).arg(year).arg(30).arg(12).arg(2008)); m_comboDateFormat->addItem( mask.arg(year).arg(month).arg(day).arg(2008).arg(12).arg(30)); m_comboDateFormat->addItem( mask.arg(month).arg(day).arg(year).arg(12).arg(30).arg(2008)); lyr->addWidget(m_comboDateFormat, 1, 1); QLabel* lblDateFormat = new QLabel(i18n("Date format:"), plainPage); lblDateFormat->setBuddy(m_comboDateFormat); lyr->addWidget(lblDateFormat, 1, 0); m_chkStripWhiteSpaceInTextValues = new QCheckBox( i18n("Strip leading and trailing blanks off of text values"), plainPage); lyr->addWidget(m_chkStripWhiteSpaceInTextValues, 2, 0, 1, 2); m_chkImportNULLsAsEmptyText = new QCheckBox( i18n("Import missing text values as empty texts"), plainPage); lyr->addWidget(m_chkImportNULLsAsEmptyText, 3, 0, 1, 2); lyr->addItem(new QSpacerItem(30, KDialog::spacingHint(), QSizePolicy::Minimum, QSizePolicy::Expanding), 4, 0); //update widgets m_encodingComboBox->setSelectedEncoding(options.encoding); if (options.defaultEncodingExplicitySet) { m_chkAlwaysUseThisEncoding->setChecked(true); } m_comboDateFormat->setCurrentIndex((int)options.dateFormat); m_chkStripWhiteSpaceInTextValues->setChecked(options.trimmedInTextValuesChecked); m_chkImportNULLsAsEmptyText->setChecked(options.nullsImportedAsEmptyTextChecked); adjustSize(); m_encodingComboBox->setFocus(); }
void QWidget::setWindowState(Qt::WindowStates newstate) { Q_D(QWidget); Qt::WindowStates oldstate = windowState(); if (oldstate == newstate) return; int max = SW_SHOWNORMAL; int normal = SW_SHOWNOACTIVATE; if ((oldstate & Qt::WindowMinimized) && !(newstate & Qt::WindowMinimized)) newstate |= Qt::WindowActive; if (newstate & Qt::WindowActive) normal = SW_SHOWNORMAL; if (isWindow()) { createWinId(); Q_ASSERT(testAttribute(Qt::WA_WState_Created)); // Ensure the initial size is valid, since we store it as normalGeometry below. if ((!testAttribute(Qt::WA_Resized) && !isVisible())) adjustSize(); if (!d->topData()->normalGeometry.isValid()) { if (newstate & Qt::WindowMaximized && !(oldstate & Qt::WindowFullScreen)) d->topData()->normalGeometry = geometry(); if (newstate & Qt::WindowMinimized && !(oldstate & Qt::WindowFullScreen)) d->topData()->normalGeometry = geometry(); } if ((oldstate & Qt::WindowMaximized) != (newstate & Qt::WindowMaximized)) { if (!(newstate & Qt::WindowMaximized)) { int style = GetWindowLong(internalWinId(), GWL_STYLE) | WS_BORDER | WS_POPUP | WS_CAPTION; SetWindowLong(internalWinId(), GWL_STYLE, style); SetWindowLong(internalWinId(), GWL_EXSTYLE, GetWindowLong (internalWinId(), GWL_EXSTYLE) & ~ WS_EX_NODRAG); } if (isVisible() && newstate & Qt::WindowMaximized) qt_wince_maximize(this); if (isVisible() && !(newstate & Qt::WindowMinimized)) { ShowWindow(internalWinId(), (newstate & Qt::WindowMaximized) ? max : normal); if (!(newstate & Qt::WindowFullScreen)) { QRect r = d->topData()->normalGeometry; if (!(newstate & Qt::WindowMaximized) && r.width() >= 0) { if (pos() != r.topLeft() || size() !=r.size()) { d->topData()->normalGeometry = QRect(0,0,-1,-1); setGeometry(r); } } } else { d->updateFrameStrut(); } } } if ((oldstate & Qt::WindowFullScreen) != (newstate & Qt::WindowFullScreen)) { if (newstate & Qt::WindowFullScreen) { if (d->topData()->normalGeometry.width() < 0 && !(oldstate & Qt::WindowMaximized)) d->topData()->normalGeometry = geometry(); d->topData()->savedFlags = (Qt::WindowFlags)GetWindowLong(internalWinId(), GWL_STYLE); UINT style = WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_POPUP; if (isVisible()) style |= WS_VISIBLE; SetWindowLong(internalWinId(), GWL_STYLE, style); QRect r = qApp->desktop()->screenGeometry(this); UINT swpf = SWP_FRAMECHANGED; if (newstate & Qt::WindowActive) swpf |= SWP_NOACTIVATE; qt_wince_full_screen(internalWinId(), true, swpf); d->updateFrameStrut(); } else { UINT style = d->topData()->savedFlags; if (isVisible()) style |= WS_VISIBLE; SetWindowLong(internalWinId(), GWL_STYLE, style); UINT swpf = SWP_FRAMECHANGED | SWP_NOZORDER | SWP_NOSIZE | SWP_NOMOVE; if (newstate & Qt::WindowActive) swpf |= SWP_NOACTIVATE; qt_wince_full_screen(internalWinId(), false, swpf); d->updateFrameStrut(); // preserve maximized state if (isVisible()) { ShowWindow(internalWinId(), (newstate & Qt::WindowMaximized) ? max : normal); if (newstate & Qt::WindowMaximized) qt_wince_maximize(this); } if (!(newstate & Qt::WindowMaximized)) { QRect r = d->topData()->normalGeometry; d->topData()->normalGeometry = QRect(0,0,-1,-1); if (r.isValid()) setGeometry(r); } } } if ((oldstate & Qt::WindowMinimized) != (newstate & Qt::WindowMinimized)) { if (newstate & Qt::WindowMinimized) qt_wince_minimize(internalWinId()); else if (newstate & Qt::WindowMaximized) { ShowWindow(internalWinId(), max); qt_wince_maximize(this); } else { ShowWindow(internalWinId(), normal); } } } data->window_state = newstate; QWindowStateChangeEvent e(oldstate); QApplication::sendEvent(this, &e); }
void Tab::setCaption(const std::string& caption) { mLabel->setCaption(caption); mLabel->adjustSize(); adjustSize(); }
void TabbedArea::setHeight(int height) { Widget::setHeight(height); adjustSize(); }
void ListBox::logic() { adjustSize(); }
void TabbedArea::setDimension(const Rectangle& dimension) { Widget::setDimension(dimension); adjustSize(); }
void QOpenCV::OpenCVWindow::configureWindow() { setModal( false ); setWindowTitle( tr( "Kinect and Aruco Window" ) ); mWindowLabel = new QLabel( "", this, 0 ); mKinectRB = new QRadioButton( tr( "Kinect" ) ); mArucoRB = new QRadioButton( tr( "Aruco" ) ); mFaceRecRB = new QRadioButton( tr( "Face Recognition" ) ); mMarkerRB = new QRadioButton( tr( "Marker" ) ); mMultiMarkerRB = new QRadioButton( tr( "Multi Marker" ) ); mFaceRecPB = new QPushButton( tr( "Start Face Recognition" ) ); mMarkerPB = new QPushButton( tr( "Start Marker Detection" ) ); mMultiMarkerPB = new QPushButton( tr( "Start MultiMarker" ) ); mKinectPB = new QPushButton( tr( "Start Kinect" ) ); mKinectSnapshotPB = new QPushButton( tr( "Kinect Snapshot" ) ); mUpdateCorParPB = new QPushButton( tr( "Update cor. param." ) ); mInterchangeMarkersPB = new QPushButton( tr( "Change Markers" ) ); mNoVideo = new QCheckBox( tr( "NoVideo" ) ); mMarkerBackgrCB = new QCheckBox( tr( "Background" ) ); mFaceDetBackgrCB = new QCheckBox( tr( "Background" ) ); mMarkerBehindCB = new QCheckBox( tr( "Marker is behind" ) ); mCorEnabledCB = new QCheckBox( tr( "Correction" ) ); mDisableCursorCB = new QCheckBox( tr( "Turn off cursor" ) ); mDisableZoomCursorCB = new QCheckBox( tr( "Turn off zoom" ) ); mEnableMarkerDetectCB = new QCheckBox( tr( "Turn on Marker Detection" ) ); mSpeed = new QSlider( Qt::Vertical ); mSpeed->setRange( 5,20 ); mSpeed->setValue( 10 ); mSpeed->setPageStep( 1 ); mSpeed->setFocusPolicy( Qt::NoFocus ); mSpeed->setToolTip( "Modify speed of movement" ); mModulesStackL = new QStackedLayout; mSubmodulesStackL = new QStackedLayout; QHBoxLayout* mainLayout = new QHBoxLayout; QVBoxLayout* buttonLayout = new QVBoxLayout; #ifdef OPENNI2_FOUND mKinectRB->setChecked( true ); buttonLayout->addWidget( mKinectRB ); #endif buttonLayout->addWidget( mArucoRB ); buttonLayout->addLayout( mModulesStackL ); QWidget* kinectPageWid = new QWidget; QWidget* arucoPageWid = new QWidget; QWidget* arucoFaceRecPageWid = new QWidget; QWidget* arucoMarkerPageWid = new QWidget; QWidget* arucoMultiMarkerPageWid = new QWidget; QWidget* arucoSubPageWid = new QWidget; QVBoxLayout* kinectPageLayout = new QVBoxLayout; QVBoxLayout* arucoPageLayout = new QVBoxLayout; QVBoxLayout* arucoFaceRecPageLayout = new QVBoxLayout; QVBoxLayout* arucoMarkerPageLayout = new QVBoxLayout; QVBoxLayout* arucoMultiMarkerPageLayout = new QVBoxLayout; QVBoxLayout* arucoSubPageLayout = new QVBoxLayout; mFaceRecRB->setChecked( true ); arucoSubPageLayout->addWidget( mFaceRecRB ); arucoSubPageLayout->addWidget( mMarkerRB ); //arucoSubPageLayout->addWidget( mMultiMarkerRB ); arucoSubPageLayout->addWidget( mNoVideo ); arucoSubPageLayout->addLayout( mSubmodulesStackL ); kinectPageLayout->setAlignment( Qt::AlignBottom ); arucoPageLayout->setAlignment( Qt::AlignBottom ); arucoFaceRecPageLayout->setAlignment( Qt::AlignBottom ); arucoMarkerPageLayout->setAlignment( Qt::AlignBottom ); arucoMultiMarkerPageLayout->setAlignment( Qt::AlignBottom ); mModulesStackL->addWidget( kinectPageWid ); mModulesStackL->addWidget( arucoSubPageWid ); mSubmodulesStackL->addWidget( arucoFaceRecPageWid ); mSubmodulesStackL->addWidget( arucoMarkerPageWid ); //mSubmodulesStackL->addWidget( arucoMultiMarkerPageWid ); kinectPageWid->setLayout( kinectPageLayout ); arucoPageWid->setLayout( arucoPageLayout ); arucoFaceRecPageWid->setLayout( arucoFaceRecPageLayout ); arucoMarkerPageWid->setLayout( arucoMarkerPageLayout ); arucoMultiMarkerPageWid->setLayout( arucoMultiMarkerPageLayout ); arucoSubPageWid->setLayout( arucoSubPageLayout ); //set up page layouts kinectPageLayout->addWidget( mDisableCursorCB ); kinectPageLayout->addWidget( mDisableZoomCursorCB ); kinectPageLayout->addWidget( mEnableMarkerDetectCB ); kinectPageLayout->addWidget( mSpeed ); kinectPageLayout->addWidget( mKinectSnapshotPB ); kinectPageLayout->addWidget( mKinectPB ); //arucoPageLayout->addWidget( mMultiMarkerPB ); arucoFaceRecPageLayout->addWidget( mFaceDetBackgrCB ); arucoFaceRecPageLayout->addWidget( mFaceRecPB ); arucoMarkerPageLayout->addWidget( mMarkerBackgrCB ); arucoMarkerPageLayout->addWidget( mMarkerBehindCB ); arucoMarkerPageLayout->addWidget( mCorEnabledCB ); arucoMarkerPageLayout->addWidget( mUpdateCorParPB ); arucoMarkerPageLayout->addWidget( mInterchangeMarkersPB ); arucoMarkerPageLayout->addWidget( mMarkerPB ); //arucoMultiMarkerPageLayout->addWidget( mMultiMarkerPB ); if ( Util::ApplicationConfig::get()->getValue( "Viewer.SkyBox.Noise" ).toInt() < 2 ) { mMarkerBackgrCB->setDisabled( true ); } //set layout mainLayout->addLayout( buttonLayout ); mainLayout->addWidget( mWindowLabel, Qt::AlignCenter ); mainLayout->setSizeConstraint( QLayout::SetMinimumSize ); setLayout( mainLayout ); adjustSize(); //set up Widgets mUpdateCorParPB->setEnabled( false ); mFaceDetBackgrCB->setEnabled( false ); mMarkerBackgrCB->setEnabled( false ); mMarkerBehindCB->setEnabled( false ); mCorEnabledCB->setEnabled( false ); mEnableMarkerDetectCB->setEnabled( true ); mMultiMarkerPB->setCheckable( true ); mFaceRecPB->setCheckable( true ); mMarkerPB->setCheckable( true ); mKinectPB->setCheckable( true ); //set up signals to slots connect( mKinectRB, SIGNAL( clicked() ), this, SLOT( onSelModulChange() ) ); connect( mArucoRB, SIGNAL( clicked() ), this, SLOT( onSelModulChange() ) ); connect( mFaceRecRB, SIGNAL( clicked() ), this, SLOT( onSelSubModulChange() ) ); connect( mMarkerRB, SIGNAL( clicked() ), this, SLOT( onSelSubModulChange() ) ); connect( mMultiMarkerRB, SIGNAL( clicked() ), this, SLOT( onSelSubModulChange() ) ); connect( mNoVideo, SIGNAL( clicked() ), this, SLOT( onSelSubModulChange() ) ); connect( mUpdateCorParPB, SIGNAL( clicked() ), this, SLOT( onUpdateCorPar() ) ); connect( mMarkerPB, SIGNAL( clicked( bool ) ), this, SLOT( onMarkerStartCancel( bool ) ) ); connect( mFaceRecPB, SIGNAL( clicked( bool ) ), this, SLOT( onFaceRecStartCancel( bool ) ) ); connect( mMultiMarkerPB, SIGNAL( clicked( bool ) ), this, SLOT( onMultiMarkerStartCancel( bool ) ) ); connect( mKinectPB, SIGNAL( clicked( bool ) ), this, SLOT( onKinectStartCancel( bool ) ) ); connect( mKinectSnapshotPB, SIGNAL( clicked() ), this, SLOT( onKinectSnapshotPBClicked() ) ); connect( mMarkerBackgrCB, SIGNAL( clicked( bool ) ), this, SLOT( onMarkerBackgrCBClicked( bool ) ) ); connect( mFaceDetBackgrCB, SIGNAL( clicked( bool ) ), this, SLOT( onFaceDetBackgrCBClicked( bool ) ) ); connect( mEnableMarkerDetectCB, SIGNAL( clicked( bool ) ), this, SLOT( setMarkerDetection( bool ) ) ); connect( mDisableCursorCB, SIGNAL( clicked() ), this, SLOT( stopMovingCursor() ) ); connect( mDisableZoomCursorCB, SIGNAL( clicked( bool ) ), this, SLOT( stopZoom() ) ); }