void KPrMSPresentationCreateDialog::setupGUI() { back = new QVBox( this ); back->setMargin( KDialog::marginHint() ); QFrame *line; step1 = new QLabel( i18n( "Create directory structure" ), back ); step2 = new QLabel( i18n( "Create pictures of the slides" ), back ); step3 = new QLabel( i18n( "Create index file" ), back ); line = new QFrame( back ); line->setFrameStyle( QFrame::HLine | QFrame::Sunken ); line->setMaximumHeight( 20 ); progressBar = new KProgress( back ); line = new QFrame( back ); line->setFrameStyle( QFrame::HLine | QFrame::Sunken ); line->setMaximumHeight( 20 ); KButtonBox *bb = new KButtonBox( back ); bb->addStretch(); bDone = bb->addButton( i18n( "Done" ) ); bDone->setEnabled( false ); connect( bDone, SIGNAL( clicked() ), this, SLOT( accept() ) ); }
/** * Fills layer edit layout with layer edit widgets. */ void TopologyWidget::makeView(){ Q_ASSERT(model != NULL); //input layer LayerEditWidget* inputLayer = new LayerEditWidget(ui->layerScrollAreaContent); inputLayer->setLayerName(tr("[0] input layer: ")); inputLayer->setAsInputLayer(true); inputLayer->setRemoveButtonDisabled(true); inputLayer->setNeuronCount(model->inputCount()); QFrame* line = new QFrame(ui->layerScrollAreaContent); line->setObjectName(QString::fromUtf8("line")); line->setMaximumHeight(2); line->setFrameShape(QFrame::HLine); line->setFrameShadow(QFrame::Sunken); connect(inputLayer, SIGNAL(widgetPressed(LayerEditWidget*)), this, SLOT(widgetPressed(LayerEditWidget*))); connect(inputLayer, SIGNAL(removePressed(LayerEditWidget*)), this, SLOT(removeLayer(LayerEditWidget*))); connect(inputLayer, SIGNAL(duplicatePressed(LayerEditWidget*)), this, SLOT(duplicateLayer(LayerEditWidget*))); connect(inputLayer, SIGNAL(countChanged(LayerEditWidget*,int)), this, SLOT(countChanged(LayerEditWidget*, int))); layerEditList.append(inputLayer); layerLineList.append(line); layerEditLayout->insertWidget(0, line); layerEditLayout->insertWidget(0, inputLayer); //output layer and inner layers for(int i = 0; i < model->layerCount(); i++){ LayerEditWidget* layer = new LayerEditWidget(ui->layerScrollAreaContent); if(i < model->layerCount()-1) layer->setLayerName("[" + QString::number(i+1) + tr("] inner layer: ")); else layer->setLayerName("[" + QString::number(i+1) + tr("] output layer: ")); if(model->layerCount() <= 1) layer->setRemoveButtonDisabled(true); layer->setNeuronCount(model->neuronCount(i)); QFrame* line = new QFrame(ui->layerScrollAreaContent); line->setObjectName(QString::fromUtf8("line")); line->setMaximumHeight(2); line->setFrameShape(QFrame::HLine); line->setFrameShadow(QFrame::Sunken); connect(layer, SIGNAL(widgetPressed(LayerEditWidget*)), this, SLOT(widgetPressed(LayerEditWidget*))); connect(layer, SIGNAL(removePressed(LayerEditWidget*)), this, SLOT(removeLayer(LayerEditWidget*))); connect(layer, SIGNAL(duplicatePressed(LayerEditWidget*)), this, SLOT(duplicateLayer(LayerEditWidget*))); connect(layer, SIGNAL(countChanged(LayerEditWidget*,int)), this, SLOT(countChanged(LayerEditWidget*, int))); layerEditList.append(layer); layerLineList.append(line); layerEditLayout->insertWidget(0, line); layerEditLayout->insertWidget(0, layer); } }
//! //! Constructor of the TimelinePanel class. //! //! \param parent The parent widget the created instance will be a child of. //! \param flags Extra widget options. //! TimelinePanel::TimelinePanel ( QWidget *parent /* = 0 */, Qt::WindowFlags flags /* = 0 */ ) : ViewPanel(ViewPanel::T_Timeline, parent, flags), m_scaleScrollBar(0), m_timelineWidget(0), m_controlToolBar(0) { setupUi(this); // create the timeline widget as a child of the scroll area m_timelineWidget = new TimelineWidget(ui_scrollArea); ui_scrollArea->setWidget(m_timelineWidget); // set up signal relay connections from the timeline widget connect(m_timelineWidget, SIGNAL(currentFrameSet(int)), SIGNAL(currentFrameSet(int))); connect(m_timelineWidget, SIGNAL(startFrameSet(int)), SIGNAL(startFrameSet(int))); connect(m_timelineWidget, SIGNAL(endFrameSet(int)), SIGNAL(endFrameSet(int))); connect(m_timelineWidget, SIGNAL(inFrameSet(int)), SIGNAL(inFrameSet(int))); connect(m_timelineWidget, SIGNAL(outFrameSet(int)), SIGNAL(outFrameSet(int))); // set up action connections connect(ui_autoScrollAction, SIGNAL(toggled(bool)), m_timelineWidget, SLOT(setAutoScroll(bool))); // create the tool bar for timeline controls m_controlToolBar = new QToolBar("Timeline Controls", this); m_controlToolBar->setStyleSheet( "QToolButton {" " max-height: 24px;" "}" ); ui_horizontalLayout->insertWidget(2, m_controlToolBar); // set the special value text for the frame step spin box to an empty string that is displayed instead of "1st" ui_frameStepSpinBox->setSpecialValueText(" "); // Give a little space to the keyframe widget QWidget *spacerWidget = new QWidget(); spacerWidget->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); spacerWidget->setMinimumHeight(5); spacerWidget->setMaximumHeight(5); ui_verticalLayout->insertWidget(0, spacerWidget); // insert border widget to ui_verticalLayout at index 1 just over toolbar vbox QString borderStyle ( "border-top: 1px solid #393939; border-bottom: 1px solid #959595" ); QFrame *borderFrame = new QFrame(this); borderFrame->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); borderFrame->setMinimumHeight(2); borderFrame->setMaximumHeight(2); borderFrame->setStyleSheet(borderStyle); ui_verticalLayout->insertWidget(2, borderFrame); // insert border widget to ui_verticalLayout at index 1 just over toolbar vbox QFrame *borderFrame2 = new QFrame(this); borderFrame2->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); borderFrame2->setMinimumHeight(2); borderFrame2->setMaximumHeight(2); borderFrame2->setStyleSheet(borderStyle); ui_verticalLayout->insertWidget(4, borderFrame2); }
void KPrWebPresentationCreateDialog::setupGUI() { back = new QVBox( this ); back->setMargin( KDialog::marginHint() ); QFrame *line; line = new QFrame( back ); line->setFrameStyle( QFrame::HLine | QFrame::Sunken ); line->setMaximumHeight( 20 ); step1 = new QLabel( i18n( "Initialize (create file structure, etc.)" ), back ); step2 = new QLabel( i18n( "Create Pictures of the Slides" ), back ); step3 = new QLabel( i18n( "Create HTML Pages for the Slides" ), back ); step4 = new QLabel( i18n( "Create Main Page (Table of Contents)" ), back ); step5 = new QLabel( i18n( "Options for Unattended Presentations" ), back); line = new QFrame( back ); line->setFrameStyle( QFrame::HLine | QFrame::Sunken ); line->setMaximumHeight( 20 ); progressBar = new KProgress( back ); line = new QFrame( back ); line->setFrameStyle( QFrame::HLine | QFrame::Sunken ); line->setMaximumHeight( 20 ); KButtonBox *bb = new KButtonBox( back ); bSave = bb->addButton( i18n( "Save Configuration..." ) ); bb->addStretch(); bDone = bb->addButton( i18n( "Done" ) ); bSave->setEnabled( false ); bDone->setEnabled( false ); connect( bDone, SIGNAL( clicked() ), this, SLOT( accept() ) ); connect( bSave, SIGNAL( clicked() ), this, SLOT( saveConfig() ) ); }
PartsBinPaletteWidget::PartsBinPaletteWidget(ReferenceModel *referenceModel, HtmlInfoView *infoView, WaitPushUndoStack *undoStack, BinManager* manager) : QFrame(manager) { m_binLabel = NULL; m_monoIcon = m_icon = NULL; m_searchLineEdit = NULL; m_saveQuietly = false; m_fastLoaded = false; m_model = NULL; m_loadingProgressDialog = NULL; setAcceptDrops(true); setAllowsChanges(true); m_manager = manager; m_referenceModel = referenceModel; m_canDeleteModel = false; m_orderHasChanged = false; Q_UNUSED(undoStack); m_undoStack = new WaitPushUndoStack(this); connect(m_undoStack, SIGNAL(cleanChanged(bool)), this, SLOT(undoStackCleanChanged(bool)) ); m_iconView = new PartsBinIconView(m_referenceModel, this); m_iconView->setInfoView(infoView); m_listView = new PartsBinListView(m_referenceModel, this); m_listView->setInfoView(infoView); m_stackedWidget = new QStackedWidget(this); m_stackedWidget->addWidget(m_iconView); m_stackedWidget->addWidget(m_listView); QVBoxLayout * vbl = new QVBoxLayout(this); vbl->setMargin(3); vbl->setSpacing(0); m_header = NULL; setupHeader(); if (m_header) { vbl->addWidget(m_header); QFrame * separator = new QFrame(); separator->setMaximumHeight(1); separator->setObjectName("partsBinHeaderSeparator"); separator->setFrameShape(QFrame::HLine); separator->setFrameShadow(QFrame::Plain); vbl->addWidget(separator); } vbl->addWidget(m_stackedWidget); this->setLayout(vbl); setObjectName("partsBinContainer"); toIconView(); m_defaultSaveFolder = FolderUtils::getUserBinsPath(); m_untitledFileName = tr("Untitled Bin"); connect(m_listView, SIGNAL(currentRowChanged(int)), m_iconView, SLOT(setSelected(int))); connect(m_iconView, SIGNAL(selectionChanged(int)), m_listView, SLOT(setSelected(int))); connect(m_listView, SIGNAL(currentRowChanged(int)), m_manager, SLOT(updateBinCombinedMenuCurrent())); connect(m_iconView, SIGNAL(selectionChanged(int)), m_manager, SLOT(updateBinCombinedMenuCurrent())); connect(m_listView, SIGNAL(informItemMoved(int,int)), m_iconView, SLOT(itemMoved(int,int))); connect(m_iconView, SIGNAL(informItemMoved(int,int)), m_listView, SLOT(itemMoved(int,int))); connect(m_listView, SIGNAL(informItemMoved(int,int)), this, SLOT(itemMoved())); connect(m_iconView, SIGNAL(informItemMoved(int,int)), this, SLOT(itemMoved())); if (m_binLabel) m_binLabel->setText(m_title); m_addPartToMeAction = new QAction(m_title,this); connect(m_addPartToMeAction, SIGNAL(triggered()),this, SLOT(addSketchPartToMe())); installEventFilter(this); }
BasicHeader::BasicHeader( QWidget* parent ) : QWidget( parent ) { QLayout* l = new QVBoxLayout; TomahawkUtils::unmarginLayout( l ); setLayout( l ); m_mainLayout = new QHBoxLayout; m_imageLabel = new QLabel( this ); m_imageLabel->setFixedSize( 48, 48 ); m_mainLayout->addWidget( m_imageLabel ); m_mainLayout->addSpacing( 8 ); m_verticalLayout = new QVBoxLayout; m_mainLayout->addLayout( m_verticalLayout ); m_captionLabel = new ElidedLabel( this ); m_descriptionLabel = new ElidedLabel( this ); m_verticalLayout->addWidget( m_captionLabel ); m_verticalLayout->addWidget( m_descriptionLabel ); m_verticalLayout->addStretch(); m_mainLayout->addSpacing( 8 ); m_mainLayout->setStretchFactor( m_verticalLayout, 2 ); QPalette pal = palette(); pal.setColor( QPalette::Foreground, TomahawkStyle::HEADER_TEXT ); pal.setBrush( backgroundRole(), TomahawkStyle::HEADER_BACKGROUND ); m_captionLabel->setPalette( pal ); m_descriptionLabel->setPalette( pal ); QFont font = m_captionLabel->font(); font.setPointSize( TomahawkUtils::defaultFontSize() + 4 ); font.setBold( true ); m_captionLabel->setFont( font ); m_captionLabel->setElideMode( Qt::ElideRight ); m_captionLabel->setAlignment( Qt::AlignTop | Qt::AlignLeft ); font.setPointSize( TomahawkUtils::defaultFontSize() + 1 ); font.setBold( false ); m_descriptionLabel->setFont( font ); m_descriptionLabel->setAlignment( Qt::AlignTop | Qt::AlignLeft ); m_captionLabel->setMargin( 2 ); m_descriptionLabel->setMargin( 2 ); /* QGraphicsDropShadowEffect* effect = new QGraphicsDropShadowEffect(); effect->setBlurRadius( 4 ); effect->setXOffset( 0 ); effect->setYOffset( 0 ); effect->setColor( Qt::white ); m_captionLabel->setGraphicsEffect( effect );*/ // m_descriptionLabel->setGraphicsEffect( effect ); QFrame* lineAbove = new QFrame( this ); lineAbove->setStyleSheet( QString( "QFrame { border: 1px solid %1; }" ).arg( TomahawkStyle::HEADER_BACKGROUND.name() ) ); lineAbove->setFrameShape( QFrame::HLine ); lineAbove->setMaximumHeight( 1 ); QFrame* lineBelow = new QFrame( this ); lineBelow->setStyleSheet( QString( "QFrame { border: 1px solid black; }" ) ); lineBelow->setFrameShape( QFrame::HLine ); lineBelow->setMaximumHeight( 1 ); l->addItem( m_mainLayout ); l->addWidget( lineAbove ); l->addWidget( lineBelow ); TomahawkUtils::unmarginLayout( m_mainLayout ); m_mainLayout->setContentsMargins( 8, 4, 8, 4 ); setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); setFixedHeight( 58 ); setAutoFillBackground( true ); setPalette( pal ); }
ToolSet::ToolSet() { drawPalette = new QDockWidget(tr("Tools")); QFrame* drawGroup = new QFrame(); drawPalette->setWidget(drawGroup); QGridLayout* drawLay = new QGridLayout(); newToolButton(pencilButton); newToolButton(selectButton); newToolButton(moveButton); newToolButton(handButton); newToolButton(penButton); newToolButton(eraserButton); newToolButton(polylineButton); newToolButton(bucketButton); newToolButton(colouringButton); newToolButton(eyedropperButton); newToolButton(clearButton); newToolButton(magnifyButton); newToolButton(smudgeButton); pencilButton->setWhatsThis("Pencil Tool (N)"); selectButton->setWhatsThis("Select Tool (V)"); moveButton->setWhatsThis("Move Tool (Q)"); handButton->setWhatsThis("Hand Tool (H)"); penButton->setWhatsThis("Pen Tool (P)"); eraserButton->setWhatsThis("Eraser Tool (E)"); polylineButton->setWhatsThis("Polyline Tool (Y)"); bucketButton->setWhatsThis("Paint Bucket Tool(K)"); colouringButton->setWhatsThis("Brush Tool(B)"); eyedropperButton->setWhatsThis("Eyedropper Tool (I)"); clearButton->setWhatsThis("Clear Tool"); magnifyButton->setWhatsThis("Zoom Tool (Z)"); smudgeButton->setWhatsThis("Smudge Tool (A)"); pencilButton->setIcon(QIcon(":icons/pencil2.png")); pencilButton->setToolTip("Pencil Tool <b>(N)</b>: Sketch with pencil"); selectButton->setIcon(QIcon(":icons/select.png")); selectButton->setToolTip("Select Tool <b>(V)</b>: Select an object"); moveButton->setIcon(QIcon(":icons/arrow.png")); moveButton->setToolTip("Move Tool <b>(Q)</b>: Move an object"); handButton->setIcon(QIcon(":icons/hand.png")); handButton->setToolTip("Hand Tool <b>(H)</b>: Move the canvas"); penButton->setIcon(QIcon(":icons/pen.png")); penButton->setToolTip("Pen Tool <b>(P)</b>: Sketch with pen"); eraserButton->setIcon(QIcon(":icons/eraser.png")); eraserButton->setToolTip("Eraser Tool <b>(E)</b>: Erase"); polylineButton->setIcon(QIcon(":icons/polyline.png")); polylineButton->setToolTip("Polyline Tool <b>(Y)</b>: Create line/curves"); bucketButton->setIcon(QIcon(":icons/bucket.png")); bucketButton->setToolTip("Paint Bucket Tool <b>(K)</b>: Fill selected area with a color"); colouringButton->setIcon(QIcon(":icons/brush.png")); colouringButton->setToolTip("Brush Tool <b>(B)</b>: Paint smooth stroke with a brush"); eyedropperButton->setIcon(QIcon(":icons/eyedropper.png")); eyedropperButton->setToolTip("Eyedropper Tool <b>(I)</b>: Set color from the stage"); magnifyButton->setIcon(QIcon(":icons/magnify.png")); magnifyButton->setToolTip("Zoom Tool <b>(Z)</b>: Adjust the zoom level"); magnifyButton->setEnabled(false); smudgeButton->setIcon(QIcon(":icons/smudge.png")); smudgeButton->setToolTip("Smudge Tool <b>(A)</b>: Edit polyline/curves"); smudgeButton->setEnabled(true); clearButton->setIcon(QIcon(":icons/clear.png")); clearButton->setToolTip("Clear Tool <b>(L)</b>: Erases content of selected frame"); pencilButton->setCheckable(true); penButton->setCheckable(true); polylineButton->setCheckable(true); bucketButton->setCheckable(true); colouringButton->setCheckable(true); smudgeButton->setCheckable(true); eyedropperButton->setCheckable(true); selectButton->setCheckable(true); moveButton->setCheckable(true); handButton->setCheckable(true); eraserButton->setCheckable(true); pencilButton->setChecked(true); drawLay->setMargin(2); drawLay->setSpacing(0); drawLay->addWidget(moveButton,0,0); drawLay->setAlignment(moveButton, Qt::AlignRight); drawLay->addWidget(clearButton,0,1); drawLay->setAlignment(clearButton, Qt::AlignLeft); drawLay->addWidget(selectButton,1,0); drawLay->setAlignment(selectButton, Qt::AlignRight); drawLay->addWidget(colouringButton,1,1); drawLay->setAlignment(colouringButton, Qt::AlignLeft); drawLay->addWidget(polylineButton,2,0); drawLay->setAlignment(polylineButton, Qt::AlignRight); drawLay->addWidget(smudgeButton,2,1); drawLay->setAlignment(smudgeButton, Qt::AlignLeft); drawLay->addWidget(penButton,3,0); drawLay->setAlignment(penButton, Qt::AlignRight); drawLay->addWidget(handButton,3,1); drawLay->setAlignment(handButton, Qt::AlignLeft); drawLay->addWidget(pencilButton,4,0); drawLay->setAlignment(pencilButton, Qt::AlignRight); drawLay->addWidget(bucketButton,4,1); drawLay->setAlignment(bucketButton, Qt::AlignLeft); drawLay->addWidget(eyedropperButton,5,0); drawLay->setAlignment(eyedropperButton, Qt::AlignRight); drawLay->addWidget(eraserButton,5,1); drawLay->setAlignment(eraserButton, Qt::AlignLeft); drawGroup->setLayout(drawLay); drawGroup->setMaximumHeight(6*32+1); drawPalette->setMaximumHeight(200); connect(pencilButton, SIGNAL(clicked()), this, SIGNAL(pencilClick())); connect(selectButton, SIGNAL(clicked()), this, SIGNAL(selectClick())); connect(moveButton, SIGNAL(clicked()), this, SIGNAL(moveClick())); connect(handButton, SIGNAL(clicked()), this, SIGNAL(handClick())); connect(eraserButton, SIGNAL(clicked()), this, SIGNAL(eraserClick())); connect(penButton, SIGNAL(clicked()), this, SIGNAL(penClick())); connect(polylineButton, SIGNAL(clicked()), this, SIGNAL(polylineClick())); connect(bucketButton, SIGNAL(clicked()), this, SIGNAL(bucketClick())); connect(eyedropperButton, SIGNAL(clicked()), this, SIGNAL(eyedropperClick())); connect(colouringButton, SIGNAL(clicked()), this, SIGNAL(colouringClick())); connect(smudgeButton, SIGNAL(clicked()), this, SIGNAL(smudgeClick())); connect(clearButton, SIGNAL(clicked()), this, SIGNAL(clearClick())); connect(pencilButton, SIGNAL(clicked()), this, SLOT(changePencilButton())); connect(selectButton, SIGNAL(clicked()), this, SLOT(changeSelectButton())); connect(moveButton, SIGNAL(clicked()), this, SLOT(changeMoveButton())); connect(handButton, SIGNAL(clicked()), this, SLOT(changeHandButton())); connect(eraserButton, SIGNAL(clicked()), this, SLOT(changeEraserButton())); connect(penButton, SIGNAL(clicked()), this, SLOT(changePenButton())); connect(polylineButton, SIGNAL(clicked()), this, SLOT(changePolylineButton())); connect(bucketButton, SIGNAL(clicked()), this, SLOT(changeBucketButton())); connect(eyedropperButton, SIGNAL(clicked()), this, SLOT(changeEyedropperButton())); connect(colouringButton, SIGNAL(clicked()), this, SLOT(changeColouringButton())); connect(smudgeButton, SIGNAL(clicked()), this, SLOT(changeSmudgeButton())); }
void CoreWindow::createToolBar() { //inicializacia comboboxu typov vyberu nodeTypeComboBox = new QComboBox(); nodeTypeComboBox->insertItems(0,(QStringList() << "All" << "Node" << "Edge")); nodeTypeComboBox->setFocusPolicy(Qt::NoFocus); connect(nodeTypeComboBox,SIGNAL(currentIndexChanged(int)),this,SLOT(nodeTypeComboBoxChanged(int))); toolBar = new QToolBar("Tools",this); QFrame * frame = createHorizontalFrame(); frame->layout()->addWidget(noSelect); frame->layout()->addWidget(singleSelect); toolBar->addWidget(frame); frame = createHorizontalFrame(); toolBar->addWidget(frame); frame->layout()->addWidget(multiSelect); frame->layout()->addWidget(center); toolBar->addWidget(nodeTypeComboBox); toolBar->addSeparator(); frame = createHorizontalFrame(); toolBar->addWidget(frame); frame->layout()->addWidget(addMeta); frame->layout()->addWidget(removeMeta); frame = createHorizontalFrame(); toolBar->addWidget(frame); frame->layout()->addWidget(fix); frame->layout()->addWidget(unFix); frame = createHorizontalFrame(); toolBar->addWidget(frame); frame->layout()->addWidget(merge); frame->layout()->addWidget(separate); toolBar->addWidget(label); toolBar->addSeparator(); toolBar->addWidget(play); toolBar->addSeparator(); toolBar->addWidget(add_Edge); toolBar->addWidget(add_Node); toolBar->addWidget(remove_all); toolBar->addWidget(applyColor); //inicializacia colorpickera QtColorPicker * colorPicker = new QtColorPicker(); colorPicker->setStandardColors(); connect(colorPicker,SIGNAL(colorChanged(const QColor &)),this,SLOT(colorPickerChanged(const QColor &))); toolBar->addWidget(colorPicker); toolBar->addSeparator(); // layout restrictions frame = createHorizontalFrame(); toolBar->addWidget(frame); frame->layout()->addWidget(b_SetRestriction_SphereSurface); frame->layout()->addWidget(b_SetRestriction_Sphere); frame = createHorizontalFrame(); toolBar->addWidget(frame); frame->layout()->addWidget(b_SetRestriction_Plane); frame->layout()->addWidget(b_UnsetRestriction); toolBar->addSeparator(); //inicializacia slideru slider = new QSlider(Qt::Vertical,this); slider->setTickPosition(QSlider::TicksAbove); slider->setTickInterval(5); slider->setValue(5); slider->setFocusPolicy(Qt::NoFocus); connect(slider,SIGNAL(valueChanged(int)),this,SLOT(sliderValueChanged(int))); frame = createHorizontalFrame(); frame->setMaximumHeight(100); frame->layout()->setAlignment(Qt::AlignHCenter); toolBar->addWidget(frame); frame->layout()->addWidget(slider); addToolBar(Qt::LeftToolBarArea,toolBar); toolBar->setMovable(false); }
//! //! Constructor of the PanelFrame class. //! //! \param panelType The type of the panel to create. //! \param parent A widget the created instance will be child of. //! \param flags Extra widget options. //! \param showToolBars Flag to control whether to display tool bars in the panel frame. //! PanelFrame::PanelFrame ( Panel::Type panelType, QWidget *parent /* = 0 */, Qt::WindowFlags flags /* = 0 */, bool showToolBars /* = 0 */ ) : QFrame(parent, flags), m_mainToolBar(0), m_panelToolBar(0), m_panelType(Panel::T_Uninitialized), m_panel(0), m_label(0) { // create gui elements defined in the Ui_Panel class setupUi(this); setFrameShape(QFrame::Panel); setFrameShadow(QFrame::Plain); // set the style sheet to use for tool bars /* QString toolBarStyleSheet ( "QToolBar {" " border: none;" " margin: 0px;" " spacing: 1px;" "}" "QToolBar::separator {" " width: 6px;" " background-image: url(:/toolbarSeparatorIcon);" " background-repeat: no-repeat;" " background-origin: content;" " background-position: center center;" "}" "QToolButton {" " max-height: 22px;" " max-width: 22px;" "}" "QToolButton[popupMode=\"1\"] {" " max-width: 32px;" "}" ); QString frameStyleSheet ( "QFrame {" " border: 1px solid #737373;" " background: #595959;" "}" ); setStyleSheet(frameStyleSheet); */ // create the panel's main tool bar m_mainToolBar = new QToolBar(this); m_mainToolBar->setToolButtonStyle(Qt::ToolButtonIconOnly); m_mainToolBar->setIconSize(QSize(16, 16)); m_mainToolBar->setMinimumHeight(18); m_mainToolBar->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); // m_mainToolBar->setStyleSheet(toolBarStyleSheet); // create the panel's main tool bar m_panelToolBar = new QToolBar(this); m_panelToolBar->setToolButtonStyle(Qt::ToolButtonIconOnly); m_panelToolBar->setIconSize(QSize(16, 16)); m_panelToolBar->setMinimumHeight(18); m_panelToolBar->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); // m_panelToolBar->setStyleSheet(toolBarStyleSheet); if (!showToolBars) { m_mainToolBar->hide(); m_panelToolBar->hide(); ui_panelTypeComboBox->hide(); //ui_vboxLayout->removeItem(ui_hboxLayout); } // insert the panel's main tool bar after the spacer behind the panel type combo box // Give a little space to the keyframe widget QWidget *spacerWidget = new QWidget(); spacerWidget->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); spacerWidget->setMinimumWidth(5); spacerWidget->setMaximumWidth(5); ui_hboxLayout->insertWidget(0, spacerWidget); ui_hboxLayout->insertWidget(3, m_mainToolBar); ui_hboxLayout->insertWidget(4, m_panelToolBar); // fill panel type combo box with panel type names ui_panelTypeComboBox->blockSignals(true); for (int i = 0; i < Panel::T_NumTypes; ++i) { Panel::Type panelType = (Panel::Type) i; QString panelTypeName = Panel::getTypeName(panelType); QString panelTypeIconName = Panel::getTypeIconName(panelType); if (panelTypeIconName.isEmpty()) ui_panelTypeComboBox->addItem(panelTypeName); else ui_panelTypeComboBox->addItem(QIcon(panelTypeIconName), panelTypeName); } // fill the panel type combo box with dynamic type names for(int i = 0; i < PanelFactory::m_panelTypeMap.keys().length(); ++i){ QString PlugInName = PanelFactory::m_panelPluginNames.at(i); QIcon PlugInIcon = QIcon(PanelFactory::m_panelPluginIcons.at(i)); ui_panelTypeComboBox->addItem(PlugInIcon, PlugInName); } ui_panelTypeComboBox->blockSignals(false); // relay the viewPanelCreated signal to the window that this panel frame is contained in connect(this, SIGNAL(viewPanelCreated(ViewPanel *)), window(), SIGNAL(viewPanelCreated(ViewPanel *))); // initialize the panel frame's panel type setPanelType(panelType); // create the panel drop-down menu QMenu *panelMenu = new QMenu("Panel Menu", this); panelMenu->addAction(ui_splitHorizontallyAction); panelMenu->addAction(ui_splitVerticallyAction); panelMenu->addSeparator(); panelMenu->addAction(ui_maximizeAction); panelMenu->addAction(ui_restoreAction); panelMenu->addAction(ui_maximizeHorizontallyAction); panelMenu->addAction(ui_restoreHorizontallyAction); panelMenu->addAction(ui_maximizeVerticallyAction); panelMenu->addAction(ui_restoreVerticallyAction); panelMenu->addAction(ui_minimizeAction); panelMenu->addSeparator(); panelMenu->addAction(ui_maximizeRowAction); panelMenu->addAction(ui_minimizeRowAction); panelMenu->addAction(ui_maximizeColumnAction); panelMenu->addAction(ui_minimizeColumnAction); panelMenu->addSeparator(); panelMenu->addAction(ui_duplicateAction); panelMenu->addAction(ui_extractAction); panelMenu->addSeparator(); panelMenu->addAction(ui_closeRowAction); panelMenu->addAction(ui_closeColumnAction); panelMenu->addAction(ui_closeAction); ui_panelMenuAction->setMenu(panelMenu); ui_maximizeAction->setVisible(false); ui_restoreAction->setVisible(false); ui_maximizeHorizontallyAction->setVisible(false); ui_restoreHorizontallyAction->setVisible(false); ui_maximizeVerticallyAction->setVisible(false); ui_restoreVerticallyAction->setVisible(false); ui_maximizeColumnAction->setVisible(false); ui_minimizeColumnAction->setVisible(false); ui_maximizeRowAction->setVisible(false); ui_minimizeRowAction->setVisible(false); ui_closeRowAction->setVisible(false); ui_closeColumnAction->setVisible(false); // set up external signal/slot connections connect(this, SIGNAL(panelTypeChanged(const QString &)), window(), SLOT(updateWindowTitle(const QString &))); connect(this, SIGNAL(duplicateRequested(PanelFrame *)), window(), SLOT(duplicatePanelFrame(PanelFrame *))); connect(this, SIGNAL(extractRequested(PanelFrame *)), window(), SLOT(extractPanelFrame(PanelFrame *)), Qt::QueuedConnection); connect(this, SIGNAL(closeRequested(PanelFrame *)), window(), SLOT(closePanelFrame(PanelFrame *)), Qt::QueuedConnection); // insert border widget to ui_vboxLayout at index 1 just after toolbar vbox QString borderStyle ( "border-top: 1px solid #393939; border-bottom: 1px solid #959595" ); QFrame *borderFrame = new QFrame(this); borderFrame->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); borderFrame->setMinimumHeight(2); borderFrame->setMaximumHeight(2); borderFrame->setStyleSheet(borderStyle); ui_vboxLayout->insertWidget(1, borderFrame); }
PlaylistManager::PlaylistManager( QObject* parent ) : QObject( parent ) , m_widget( new QWidget() ) , m_welcomeWidget( new WelcomeWidget() ) , m_currentMode( 0 ) { s_instance = this; setHistoryPosition( -1 ); m_widget->setLayout( new QVBoxLayout() ); m_topbar = new TopBar(); m_infobar = new InfoBar(); m_stack = new QStackedWidget(); QFrame* line = new QFrame(); line->setFrameStyle( QFrame::HLine ); line->setStyleSheet( "border: 1px solid gray;" ); line->setMaximumHeight( 1 ); m_splitter = new AnimatedSplitter(); m_splitter->setOrientation( Qt::Vertical ); m_splitter->setChildrenCollapsible( false ); m_splitter->setGreedyWidget( 0 ); m_splitter->addWidget( m_stack ); m_queueView = new QueueView( m_splitter ); m_queueModel = new PlaylistModel( m_queueView ); m_queueView->queue()->setModel( m_queueModel ); AudioEngine::instance()->setQueue( m_queueView->queue()->proxyModel() ); m_splitter->addWidget( m_queueView ); m_splitter->hide( 1, false ); m_widget->layout()->addWidget( m_infobar ); m_widget->layout()->addWidget( m_topbar ); m_widget->layout()->addWidget( line ); m_widget->layout()->addWidget( m_splitter ); m_superCollectionView = new CollectionView(); m_superCollectionFlatModel = new CollectionFlatModel( m_superCollectionView ); m_superCollectionView->setModel( m_superCollectionFlatModel ); m_superCollectionView->setFrameShape( QFrame::NoFrame ); m_superCollectionView->setAttribute( Qt::WA_MacShowFocusRect, 0 ); m_superCollectionView->proxyModel()->setShowOfflineResults( false ); m_superAlbumView = new AlbumView(); m_superAlbumModel = new AlbumModel( m_superAlbumView ); m_superAlbumView->setModel( m_superAlbumModel ); m_superAlbumView->setFrameShape( QFrame::NoFrame ); m_superAlbumView->setAttribute( Qt::WA_MacShowFocusRect, 0 ); m_stack->setContentsMargins( 0, 0, 0, 0 ); m_widget->setContentsMargins( 0, 0, 0, 0 ); m_widget->layout()->setContentsMargins( 0, 0, 0, 0 ); m_widget->layout()->setMargin( 0 ); m_widget->layout()->setSpacing( 0 ); connect( &m_filterTimer, SIGNAL( timeout() ), SLOT( applyFilter() ) ); connect( m_topbar, SIGNAL( filterTextChanged( QString ) ), SLOT( setFilter( QString ) ) ); connect( m_topbar, SIGNAL( flatMode() ), SLOT( setTableMode() ) ); connect( m_topbar, SIGNAL( artistMode() ), SLOT( setTreeMode() ) ); connect( m_topbar, SIGNAL( albumMode() ), SLOT( setAlbumMode() ) ); }
void CollapsiblePairWidget::initialize() { // object name for custom stylesheets setObjectName("oeFrameContainer"); // create the main vertical layout QVBoxLayout* mainLayout = new QVBoxLayout; mainLayout->setSpacing(0); mainLayout->setContentsMargins(0, 0, 0, 0); setLayout(mainLayout); // create parent widget to hold the primary widget and header _primaryGroup = new QWidget; QVBoxLayout* primaryLayout = new QVBoxLayout; primaryLayout->setSpacing(0); primaryLayout->setContentsMargins(0, 0, 0, 0); _primaryGroup->setLayout(primaryLayout); // create primary header QFrame* primaryHeader = new QFrame; primaryHeader->setFrameStyle(QFrame::Box | QFrame::Plain); primaryHeader->setLineWidth(1); primaryHeader->setMaximumHeight(20); QHBoxLayout* primaryHeaderLayout = new QHBoxLayout; primaryHeaderLayout->setSpacing(4); primaryHeaderLayout->setContentsMargins(2, 2, 2, 2); primaryHeader->setLayout(primaryHeaderLayout); primaryHeader->setObjectName("oeItemHeader"); _primaryTitle = new QLabel(tr("Primary")); primaryHeaderLayout->addWidget(_primaryTitle); primaryHeaderLayout->addStretch(); _primaryHideButton = new QPushButton(_hideIcon, tr("")); _primaryHideButton->setFlat(true); _primaryHideButton->setMaximumSize(16, 16); primaryHeaderLayout->addWidget(_primaryHideButton); primaryLayout->addWidget(primaryHeader); // create primary widget container _primaryContainer = new QFrame; QVBoxLayout* primaryContainerLayout = new QVBoxLayout; primaryContainerLayout->setSpacing(0); primaryContainerLayout->setContentsMargins(0, 0, 0, 0); _primaryContainer->setLayout(primaryContainerLayout); _primaryContainer->setObjectName("oeFrameContainer"); primaryLayout->addWidget(_primaryContainer); mainLayout->addWidget(_primaryGroup); // create parent widget to hold the secondary widget and header _secondaryGroup = new QWidget; _secondaryGroup->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum); QVBoxLayout* secondaryGroupLayout = new QVBoxLayout; secondaryGroupLayout->setSpacing(0); secondaryGroupLayout->setContentsMargins(0, 0, 0, 0); _secondaryGroup->setLayout(secondaryGroupLayout); //create secondary header QFrame* secondaryHeader = new QFrame; secondaryHeader->setFrameStyle(QFrame::Box | QFrame::Plain); secondaryHeader->setLineWidth(1); secondaryHeader->setMaximumHeight(20); QHBoxLayout* secondaryHeaderLayout = new QHBoxLayout; secondaryHeaderLayout->setSpacing(4); secondaryHeaderLayout->setContentsMargins(2, 2, 2, 2); secondaryHeader->setLayout(secondaryHeaderLayout); secondaryHeader->setObjectName("oeItemHeader"); _secondaryTitle = new QLabel(tr("Secondary")); secondaryHeaderLayout->addWidget(_secondaryTitle); secondaryHeaderLayout->addStretch(); _secondaryHideButton = new QPushButton(_hideIcon, tr("")); _secondaryHideButton->setFlat(true); _secondaryHideButton->setMaximumSize(16, 16); secondaryHeaderLayout->addWidget(_secondaryHideButton); secondaryGroupLayout->addWidget(secondaryHeader); //create secondary widget container _secondaryContainer = new QFrame; QVBoxLayout* secondaryContainerLayout = new QVBoxLayout; secondaryContainerLayout->setSpacing(0); secondaryContainerLayout->setContentsMargins(0, 0, 0, 0); _secondaryContainer->setLayout(secondaryContainerLayout); _secondaryContainer->setObjectName("oeFrameContainer"); secondaryGroupLayout->addWidget(_secondaryContainer); mainLayout->addWidget(_secondaryGroup); //create widget with a stretch child for layout purposes (not ideal) _stretchBox = new QWidget; QVBoxLayout* stretchLayout = new QVBoxLayout; _stretchBox->setLayout(stretchLayout); stretchLayout->addStretch(); mainLayout->addWidget(_stretchBox); _stretchBox->setVisible(false); //connect show/hide button click events connect(_primaryHideButton, SIGNAL(clicked(bool)), this, SLOT(onPrimaryHideClicked(bool))); connect(_secondaryHideButton, SIGNAL(clicked(bool)), this, SLOT(onSecondaryHideClicked(bool))); resetStyleSheet(); }
BitcoinGUI::BitcoinGUI(QWidget *parent): QMainWindow(parent), clientModel(0), walletModel(0), encryptWalletAction(0), changePassphraseAction(0), unlockWalletAction(0), lockWalletAction(0), aboutQtAction(0), trayIcon(0), notificator(0), rpcConsole(0) { setMinimumSize(1000,550); resize(1040, 650); //setFixedSize(970, 550); setWindowTitle(tr("WhiteCoin") + " " + tr("Wallet")); qApp->setStyleSheet( "QMainWindow { background:white url(:/images/wallet_logo_background) no-repeat right bottom; background-origin: border; font-family:'Open Sans,sans-serif'; } " "QLineEdit { border: 4px solid rgb(14,105,162); } " "#frame { } QToolBar QLabel { padding-top:15px; padding-bottom:10px; margin:0px; border: 0px; border-color: yellow;} " "#spacer { background: rgb(14,105,162); border:none; } " "#toolbar { height:100%; padding-top:20px; background: white; text-align: left; min-width:220px; max-width:220px; border: none;} " "QToolBar QToolButton { font-family:Open Sans; padding-left:0px; padding-top:10px; padding-bottom:10px; width:220px; color: white; text-align: left; background-color: rgb(14,105,162) } " "QToolBar QToolButton:hover { color: black; background-color: white; border: none; } " "QToolBar QToolButton:pressed {color: black; background-color: white; border: none; } " "QToolBar QToolButton:checked { color: black; background-color: white; border: none; } " "#labelMiningIcon { padding-left:5px; font-family:Open Sans; width:100%;font-size:10px; text-align:center; color:grey; } " "QMenu { background: rgb(255,255,255); color:black; padding-bottom:10px; } " "QMenu::item { color:grey; background-color: transparent; } " "QMenu::item:selected { color: white; background-color: rgb(14,105,162); } " "QMenuBar { background: rgb(255,255,255); color:black; } " "QMenuBar::item { font-size:12px; padding-bottom:12px; padding-top:12px; padding-left:15px; padding-right:15px; color:grey; background-color: transparent; border:none;} " "QMenuBar::item:selected { color: white; background-color:rgb(14,105,162); border:none;}" "QRadionButton::indicator { background-color: rgb(14,105,162); } " "QIcon {}" "QTabWidget { background-color: rbg(14,105,162); }" "#debug QLabel {color: white; }" "QLineEdit { border: 1px solid rbg(14,105,162); border-radius: 4px; }" "#scrollArea { border-color: transparent; } " "QPushButton {}" "QStackedWidget {}" "QDateTime {}" ); #ifndef Q_OS_MAC QApplication::setWindowIcon(QIcon(":icons/bitcoin")); setWindowIcon(QIcon(":icons/bitcoin")); #else setUnifiedTitleAndToolBarOnMac(true); QApplication::setAttribute(Qt::AA_DontShowIconsInMenus); #endif // Accept D&D of URIs setAcceptDrops(true); // Create actions for the toolbar, menu bar and tray/dock icon createActions(); // Create application menu bar createMenuBar(); // Create the toolbars createToolBars(); // Create the tray icon (or setup the dock icon) createTrayIcon(); // Create tabs overviewPage = new OverviewPage(); statisticsPage = new StatisticsPage(this); blockBrowser = new BlockBrowser(this); poolBrowser = new PoolBrowser(this); transactionsPage = new QWidget(this); QVBoxLayout *vbox = new QVBoxLayout(); transactionView = new TransactionView(this); vbox->addWidget(transactionView); transactionsPage->setLayout(vbox); addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab); receiveCoinsPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab); sendCoinsPage = new SendCoinsDialog(this); signVerifyMessageDialog = new SignVerifyMessageDialog(this); //QVBoxLayout *vboxcentral = new QVBoxLayout(); //QWidget *centralWidgetWrapper = new QWidget(this); //centralWidgetWrapper->setStyleSheet("QStackedWidget{border:1px solid #555;}"); //centralWidget = new QStackedWidget(centralWidgetWrapper); centralWidget = new QStackedWidget(this); centralWidget->setStyleSheet("QStackedWidget{border:0px solid #000;}"); centralWidget->addWidget(overviewPage); centralWidget->addWidget(statisticsPage); centralWidget->addWidget(blockBrowser); centralWidget->addWidget(poolBrowser); centralWidget->addWidget(transactionsPage); centralWidget->addWidget(addressBookPage); centralWidget->addWidget(receiveCoinsPage); centralWidget->addWidget(sendCoinsPage); //vboxcentral->addWidget(centralWidget); //centralWidgetWrapper->setLayout(vboxcentral); // setCentralWidget(centralWidgetWrapper); setCentralWidget(centralWidget); // create status bar // statusBar(); // Status bar notification icons QFrame *frameBlocks = new QFrame(); frameBlocks->setStyleSheet("frameBlocks { background: rgb(255,255,255); }"); frameBlocks->setContentsMargins(0,0,0,0); frameBlocks->setMinimumHeight(26); frameBlocks->setMaximumHeight(26); frameBlocks->setMaximumWidth(96); QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks); frameBlocksLayout->setContentsMargins(0,1,0,1); frameBlocksLayout->setSpacing(-1); labelEncryptionIcon = new QLabel(); labelStakingIcon = new QLabel(); labelConnectionsIcon = new QLabel(); labelBlocksIcon = new QLabel(); frameBlocksLayout->addWidget(labelEncryptionIcon); frameBlocksLayout->addWidget(labelStakingIcon); frameBlocksLayout->addWidget(labelConnectionsIcon); frameBlocksLayout->addWidget(labelBlocksIcon); frameBlocksLayout->addStretch(); if (!GetBoolArg("-posmint", false)) { QTimer *timerStakingIcon = new QTimer(labelStakingIcon); connect(timerStakingIcon, SIGNAL(timeout()), this, SLOT(updateStakingIcon())); timerStakingIcon->start(30 * 1000); updateStakingIcon(); } // Progress bar and label for blocks download progressBarLabel = new QLabel(); progressBarLabel->setVisible(false); progressBar = new QProgressBar(); progressBar->setAlignment(Qt::AlignCenter); progressBar->setVisible(false); progressBar->setOrientation(Qt::Horizontal); progressBar->setObjectName("progress"); progressBar->setStyleSheet("QProgressBar { background-color: white; border: 0px solid grey; border-radius: 5px; padding: 1px; text-align: center;} " "QProgressBar::chunk { background: #0E69A2; border-radius: 5px; margin: 0px; }"); frameBlocks->setObjectName("frame"); // Override style sheet for progress bar for styles that have a segmented progress bar, // as they make the text unreadable (workaround for issue #1071) // See https://qt-project.org/doc/qt-4.8/gallery.html QString curStyle = QApplication::style()->metaObject()->className(); if(curStyle == "QWindowsStyle" || curStyle == "QWindowsXPStyle") { progressBar->setStyleSheet("QProgressBar { background-color: white; border: 0px solid grey; border-radius: 5px; padding: 1px; text-align: center;} " "QProgressBar::chunk { background: #0E69A2; border-radius: 5px; margin: 0px; }"); } statusBar()->addWidget(progressBarLabel); statusBar()->addWidget(progressBar); statusBar()->addPermanentWidget(frameBlocks); syncIconMovie = new QMovie(":/movies/update_spinner", "mng", this); // Clicking on a transaction on the overview page simply sends you to transaction history page connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), this, SLOT(gotoHistoryPage())); connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), transactionView, SLOT(focusTransaction(QModelIndex))); // Double-clicking on a transaction on the transaction history page shows details connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails())); rpcConsole = new RPCConsole(this); connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(show())); // Clicking on "Verify Message" in the address book sends you to the verify message tab connect(addressBookPage, SIGNAL(verifyMessage(QString)), this, SLOT(gotoVerifyMessageTab(QString))); // Clicking on "Sign Message" in the receive coins page sends you to the sign message tab connect(receiveCoinsPage, SIGNAL(signMessage(QString)), this, SLOT(gotoSignMessageTab(QString))); gotoOverviewPage(); }
MenuToolWidget::MenuToolWidget(const QString title, QWidget* pParent ) : BaseDockWidget( title, pParent, Qt::Tool ) { setWindowFlags(Qt::FramelessWindowHint); //也是去掉标题栏的语句 setTitleBarWidget(new QWidget); QFrame* toolGroup = new QFrame(); toolGroup->setStyleSheet("background-image: url(:icons/b2.jpg)"); setWidget(toolGroup); QGridLayout* layout = new QGridLayout(); openButton = newToolButton(QPixmap(":icons/open.png"), tr("Pencil Tool <b>(N)</b>: Sketch with pencil")); saveButton = newToolButton(QPixmap(":icons/save.png"), tr("Select Tool <b>(V)</b>: Select an object")); loadButton = newToolButton(QPixmap(":icons/mirrorV.png"), tr("Move Tool <b>(Q)</b>: Move an object")); cutButton = newToolButton(QPixmap(":icons/cut.png"), tr("Hand Tool <b>(H)</b>: Move the canvas")); copyButton = newToolButton(QPixmap(":icons/copy.png"), tr("Pen Tool <b>(P)</b>: Sketch with pen")); pasteButton = newToolButton(QPixmap(":icons/paste.png"), tr("Eraser Tool <b>(E)</b>: Erase")); undoButton = newToolButton(QPixmap(":icons/undo.png"), tr("Polyline Tool <b>(Y)</b>: Create line/curves")); recycleButton = newToolButton(QPixmap(":icons/redo.png"), tr("Paint Bucket Tool <b>(K)</b>: Fill selected area with a color")); onionupButton = newToolButton(QPixmap(":icons/onionPrev.png"), tr("Brush Tool <b>(B)</b>: Paint smooth stroke with a brush")); oniondownButton = newToolButton(QPixmap(":icons/onionNext.png"), tr("Eyedropper Tool <b>(I)</b>: Set color from the stage<br><b>[ALT]</b> for instant access")); // pencilButton->setWhatsThis(tr("Pencil Tool (N)")); // selectButton->setWhatsThis(tr("Select Tool (V)")); // moveButton->setWhatsThis(tr("Move Tool (Q)")); // handButton->setWhatsThis(tr("Hand Tool (H)")); // penButton->setWhatsThis(tr("Pen Tool (P)")); // eraserButton->setWhatsThis(tr("Eraser Tool (E)")); // polylineButton->setWhatsThis(tr("Polyline Tool (Y)")); // bucketButton->setWhatsThis(tr("Paint Bucket Tool(K)")); // colouringButton->setWhatsThis(tr("Brush Tool(B)")); // eyedropperButton->setWhatsThis(tr("Eyedropper Tool (I)")); // clearButton->setWhatsThis(tr("Clear Tool")); // smudgeButton->setWhatsThis(tr("Smudge Tool (A)")); // pencilButton->setCheckable(true); // penButton->setCheckable(true); // polylineButton->setCheckable(true); // bucketButton->setCheckable(true); // colouringButton->setCheckable(true); // smudgeButton->setCheckable(true); // eyedropperButton->setCheckable(true); // selectButton->setCheckable(true); // moveButton->setCheckable(true); // handButton->setCheckable(true); // eraserButton->setCheckable(true); // pencilButton->setChecked(true); layout->setMargin(10); layout->setSpacing(10); layout->addWidget(openButton,0,0); //layout->setAlignment(moveButton, Qt::AlignRight); layout->addWidget(saveButton,0,1); //layout->setAlignment(clearButton, Qt::AlignLeft); layout->addWidget(loadButton,0,2); //layout->setAlignment(selectButton, Qt::AlignRight); layout->addWidget(cutButton,0,3); //layout->setAlignment(colouringButton, Qt::AlignLeft); layout->addWidget(copyButton,0,4); //layout->setAlignment(polylineButton, Qt::AlignRight); layout->addWidget(pasteButton,0,5); //layout->setAlignment(smudgeButton, Qt::AlignLeft); layout->addWidget(undoButton,0,6); //layout->setAlignment(penButton, Qt::AlignRight); layout->addWidget(recycleButton,0,7); //layout->setAlignment(handButton, Qt::AlignLeft); layout->addWidget(onionupButton,0,8); //layout->setAlignment(pencilButton, Qt::AlignRight); layout->addWidget(oniondownButton,0,9); //layout->setAlignment(bucketButton, Qt::AlignLeft); toolGroup->setLayout(layout); toolGroup->setMaximumHeight(70); this->setMaximumHeight(70); }
QWidgetModuleDefault::QWidgetModuleDefault(Searchable& config, QWidget* parent, const char* name, bool modal, WFlags fl) : QWidget(parent, name, fl), _qwViewer(NULL), _qwOutput(NULL), _qwRPC(NULL), _qwConnections(NULL){ Property prop; prop.fromString(config.toString()); if(!prop.check("name")){ prop.put("name", "/moduleGui"); } this->setCaption("Yarp Default Module Interface"); // main layout (vbox) QVBoxLayout *mainLayout = new QVBoxLayout( this, 3, 3, "QWidgetModuleDefaultBaseLayout"); // add a vertical split as first entry to main layout QSplitter *splitMain = new QSplitter(this); mainLayout->addWidget(splitMain); // add horizontal splitter to left part of main splitter QSplitter *splitLeft = new QSplitter(Qt::Vertical, splitMain); Property propViewer; propViewer.fromString(prop.toString()); propViewer.put("name", std::string(std::string(propViewer.find("name").asString().c_str()) + std::string("/viewer")).c_str()); _qwViewer = new QWidgetViewer(propViewer, splitLeft); // the viewer widget _qwConnections = new QWidgetConnections(prop, splitLeft); // the connection widget // add horizontal splitter to right part of main splitter QSplitter *splitRight = new QSplitter(Qt::Vertical, splitMain); Property propOutput; propOutput.fromString(prop.toString()); propOutput.put("name", std::string(std::string(propOutput.find("name").asString().c_str()) + std::string("/stdout")).c_str()); _qwOutput = new QWidgetOutput(propOutput, splitRight); // the output widget Property propRPC; propRPC.fromString(prop.toString()); propRPC.put("name", std::string(std::string(propRPC.find("name").asString().c_str()) + std::string("/rpc")).c_str()); _qwRPC = new QWidgetRPC(propRPC, splitRight); // the RPC widget // add a frame as second entry in main layout QFrame *frmBottom = new QFrame(this); frmBottom->setMaximumHeight(35); mainLayout->addWidget(frmBottom); // add a layout to the bottom frame QHBoxLayout *frmBottomLayout = new QHBoxLayout(frmBottom, 0, -1, "frmBottomLayout"); frmBottomLayout->setSpacing(3); frmBottomLayout->setMargin(3); // add a button to the bottom frame QPushButton *btnCheckAll = new QPushButton(frmBottom); btnCheckAll->setText("check all ports and connections"); frmBottomLayout->addWidget(btnCheckAll); connect( btnCheckAll, SIGNAL( clicked() ), this, SLOT( btnCheckAll_clicked() ) ); this->resize(850,650); QValueList<int> valsSplitMain; valsSplitMain.append(400); valsSplitMain.append(450); splitMain->setSizes(valsSplitMain); QValueList<int> valsSplitLeft; valsSplitLeft.append(400); valsSplitLeft.append(250); splitLeft->setSizes(valsSplitLeft); QValueList<int> valsSplitRight; valsSplitRight.append(400); valsSplitRight.append(250); splitRight->setSizes(valsSplitRight); // position screen center QWidget* desk = QApplication::desktop(); this->move(desk->width()/2 - this->width()/2,desk->height()/2 - this->height()/2); }