DissipatoreProcessoreAddWidget::DissipatoreProcessoreAddWidget(QWidget* parent):QWidget(parent){ createLabels(); createLineEdits(); createCheckBoxes(); createDoubleSpinBoxes(); QGridLayout* gridLayout=new QGridLayout; gridLayout->addWidget(nomeLabelDissipatoreProcessore,0,0,1,1); gridLayout->addWidget(nomeLineEditDissipatoreProcessore,0,1,1,1); gridLayout->addWidget(prezzoLabelDissipatoreProcessore,1,0,1,1); gridLayout->addWidget(prezzoDoubleSpinBoxDissipatoreProcessore,1,1,1,1); gridLayout->addWidget(produttoreLabelDissipatoreProcessore,2,0,1,1); gridLayout->addWidget(produttoreLineEditDissipatoreProcessore,2,1,1,1); gridLayout->addWidget(socketSupportatiLabelDissipatoreProcessore,3,0,1,1); gridLayout->addWidget(socketSupportatiLineEditDissipatoreProcessore,3,1,1,1); gridLayout->addWidget(rpmVentolaLabelDissipatoreProcessore,4,0,1,1); gridLayout->addWidget(rpmVentolaLineEditDissipatoreProcessore,4,1,1,1); gridLayout->addWidget(altezzaLabelDissipatoreProcessore,5,0,1,1); gridLayout->addWidget(altezzaLineEditDissipatoreProcessore,5,1,1,1); gridLayout->addWidget(raffreddamentoALiquidoCheckBoxDissipatoreProcessore,6,1,1,1); gridLayout->addWidget(altezzaRadiatoreLabelDissipatoreProcessore,7,0,1,1); gridLayout->addWidget(altezzaRadiatoreLineEditDissipatoreProcessore,7,1,1,1); gridLayout->addWidget(livelloRumoreLabelDissipatoreProcessore,8,0,1,1); gridLayout->addWidget(livelloRumoreLineEditDissipatoreProcessore,8,1,1,1); setLayout(gridLayout); }
HeatMapVisualization::HeatMapVisualization(Database *database) : QWidget() { lastEvents = NULL; height = database->getResolution().height(); width = database->getResolution().width(); heatMap = new int*[height]; for (int i = 0; i < height; ++i) heatMap[i] = new int[width]; clickHeatMap = new int*[height]; for (int i = 0; i < height; ++i) clickHeatMap[i] = new int[width]; mouseRoute = new QVector<QPoint>(); clearHeatMap(); marge = 20; mouseRouteInterval = 1; clickThresholdArea = 10; showLeftClicks = showRightClicks = showSingleClicks = showDoubleClicks = showMouseMoveRoute = true; showMouseMove = false; screenWidth = (QApplication::desktop()->width() >= 1920) ? 1050: 470; screenWidth = (screenWidth > width) ? width : screenWidth; screenHeight = (QApplication::desktop()->width() > 800) ? 500 : 300; screenHeight = (screenHeight > height) ? height : screenHeight; heatMapImage = new QImage(width, height, QImage::Format_ARGB32_Premultiplied); scene = new HeatMapVisQGraphicsScene(); view = new QGraphicsView(scene); view->setRenderHints(QPainter::Antialiasing); scene->setSceneRect(0, 0, screenWidth, screenHeight); connect(scene, SIGNAL(clicked(QPointF)), SLOT(pixelSelected(QPointF))); mainLayout = new QVBoxLayout(); mainLayout->addWidget(view, 0, Qt::AlignCenter); createCheckBoxes(); determineAvailableBackgroundImages(database->getMaxEventTime()); renderVisualization(); setLayout(mainLayout); }
void Configurator::loadItem( QListWidgetItem* item ) { if( 0 == item ) return; // searching corresponding section QString sectionName = item->listWidget()->objectName(); QDomNode configurator = _domDocument.documentElement(); QDomNode section = configurator.firstChild(); while( false == section.isNull() ) { QDomNamedNodeMap sectionAttributes = section.attributes(); if( sectionName == sectionAttributes.namedItem(c_attributeName).nodeValue() ) break; section = section.nextSibling(); } // having section, searching for the sectionItem QString sectionItemName = item->data( Qt::UserRole ).toString(); QDomNode sectionItem = section.firstChild(); while( false == sectionItem.isNull() ) { QDomNamedNodeMap sectionItemAttributes = sectionItem.attributes(); if( QDomNode::CommentNode != section.nodeType() ) if( sectionItemName == sectionItemAttributes.namedItem(c_attributeName).nodeValue() ) break; sectionItem = sectionItem.nextSibling(); } // destroying all previous controls from the frame QObjectList children = _configOptions->children(); foreach( QObject* child, children ) delete child; // vertical-layout all the frame's objects QVBoxLayout* verticalLayout = new QVBoxLayout( _configOptions ); // at this step we have everything to start load data from DOM QDomNode control = sectionItem.firstChild(); while( false == control.isNull() ) { // note: not all the nodes met will have these attributes, speciffic nodes will have some of these QDomNamedNodeMap controlAttributes = control.attributes(); QString controlName = controlAttributes.namedItem( c_attributeName ).nodeValue(); QString controlText = controlAttributes.namedItem( c_attributeText ).nodeValue(); QString controlType = controlAttributes.namedItem( c_attributeType ).nodeValue(); QString controlValue = controlAttributes.namedItem( c_attributeValue ).nodeValue(); switch( getControlTypeByName(controlType) ) { case eFontChooser : verticalLayout->addWidget( createFontChooser(controlName,controlText,controlValue) ); break; case eColorChooser : verticalLayout->addWidget( createColorChooser(controlName,controlText,controlValue) ); break; case ePathChooser : verticalLayout->addWidget( createPathChooser(controlName,controlText,controlValue) ); break; case eRadioBoxes : verticalLayout->addWidget( createRadioBoxes(controlName,controlText,controlValue,control.firstChild()) ); break; case eCheckBoxes : verticalLayout->addWidget( createCheckBoxes(controlName,controlText,controlValue,control.firstChild()) ); break; case eTextViewer : verticalLayout->addWidget( createTextViewer(controlName,control) ); break; case eLineInput : verticalLayout->addWidget( createLineInput(controlName,controlText,controlValue) ); break; case ePlugins : verticalLayout->addWidget( createPlugins(controlName,controlValue) ); break; default: break; } control = control.nextSibling(); } }