void ResourcesBrowser::setupBookmarks()
{
   ASSERT( m_tabsManager != NULL );

   QString topObjectName( "ResourcesBrowser/bookmarksFrame" );

   // frame
   QFrame* frame = NULL;
   QVBoxLayout* layout = NULL;
   {
      frame = new QFrame( m_tabsManager );
      frame->setObjectName( topObjectName );
      layout = new QVBoxLayout( frame );
      frame->setLayout( layout );
      layout->setSpacing(0);
      layout->setMargin(0);
      m_tabsManager->addTab( frame, "Bookmarks" );
   }

   // bookmarks list
   {
      m_bookmarks = new QListWidget( m_tabsManager );
      m_bookmarks->setContextMenuPolicy( Qt::CustomContextMenu );
      m_bookmarks->setObjectName( topObjectName + "/m_bookmarks" );
      layout->addWidget( m_bookmarks );

      connect( m_bookmarks, SIGNAL( itemDoubleClicked( QListWidgetItem* ) ), this, SLOT( onFocusOnFile( QListWidgetItem* ) ) );
      connect( m_bookmarks, SIGNAL( customContextMenuRequested( const QPoint& ) ), this, SLOT( showBookmarksPopupMenu( const QPoint& ) ) );
   }
}
/**
 * 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);
	}
}
Exemple #3
0
QFrame* MainWindow::initVideoFrame()
{
    QFrame *frame = new QFrame(this);

    QVBoxLayout *layout = new QVBoxLayout();

    player->setMinimumHeight(240);

#ifdef MACOSX
            player->openImage(qApp->applicationDirPath().append("/../Resources/placeholder.jpg"));

#else
            player->openImage(qApp->applicationDirPath().append("/placeholder.jpg"));
#endif

    frame->setObjectName("video_frame");
    frame->setStyleSheet("QFrame#video_frame { background: qlineargradient(x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgb(8, 9, 9), stop:0.6 rgb(40, 40, 40), "
                         "stop:0.8 rgb(57, 57, 57), stop:0.9 rgb(51, 51, 51), stop:1 rgb(31, 31, 31)) } ");

    frame->setLayout(layout);


    layout->setMargin(0);
    layout->addWidget(player);

    return frame;
}
Exemple #4
0
void playlistItemText::createPropertiesWidget()
{
  // Absolutely always only call this once// 
  assert (propertiesWidget == NULL);
  
  // Create a new widget and populate it with controls
  propertiesWidget = new QWidget;
  if (propertiesWidget->objectName().isEmpty())
    propertiesWidget->setObjectName(QStringLiteral("playlistItemText"));

  // On the top level everything is layout vertically
  QVBoxLayout *vAllLaout = new QVBoxLayout(propertiesWidget);

  QFrame *line = new QFrame(propertiesWidget);
  line->setObjectName(QStringLiteral("line"));
  line->setFrameShape(QFrame::HLine);
  line->setFrameShadow(QFrame::Sunken);

  // First add the parents controls (duration) then the text spcific controls (font, text...)
  vAllLaout->addLayout( createStaticTimeController(propertiesWidget) );
  vAllLaout->addWidget( line );
  vAllLaout->addLayout( createTextController(propertiesWidget) );

  // Insert a stretch at the bottom of the vertical global layout so that everything
  // gets 'pushed' to the top
  vAllLaout->insertStretch(3, 1);

  // Set the layout and add widget
  propertiesWidget->setLayout( vAllLaout );
}
void KbLayoutWidget::initUI() {
    setObjectName("KeyboardLayoutFrame");
    setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    this->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    setSelectionMode(QAbstractItemView::NoSelection);
    setResizeMode(Adjust);

    for (int i = 0; i < m_buttons.length(); i++) {
        LayoutButton* itemButton = new LayoutButton(m_buttons[i]);
        m_layoutButtons.append(itemButton);
        itemButton->setFixedSize(widget_width, DDESESSIONCC::LAYOUTBUTTON_HEIGHT);

        QFrame* borderFrame = new QFrame;
        borderFrame->setObjectName("LayoutBorderFrame");
        QVBoxLayout* borderLayout = new QVBoxLayout;
        borderLayout->setContentsMargins(0, 0, 0, 0);
        borderLayout->setSpacing(0);
        borderLayout->addWidget(itemButton);
        borderFrame->setLayout(borderLayout);
        borderFrame->setFixedSize(widget_width, DDESESSIONCC::LAYOUTBUTTON_HEIGHT);

        QListWidgetItem* item = new QListWidgetItem(this);
        item->sizeHint();
        this->addItem(item);
        setItemWidget(item,  borderFrame);
        this->setGridSize(QSize(widget_width, DDESESSIONCC::LAYOUTBUTTON_HEIGHT));
        this->setFixedWidth(widget_width);
    }
    this->setFixedHeight(DDESESSIONCC::LAYOUTBUTTON_HEIGHT*3);



    updateStyle(":/skin/keybdlayoutwidget.qss", this);
}
Exemple #6
0
URLWatcherPlugin::URLWatcherPlugin()
{
	viewer_ = new QWidget();
	QVBoxLayout *vboxLayout;
	QFrame *frame;
	QLabel *label;
	vboxLayout = new QVBoxLayout(viewer_);
	vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
	frame = new QFrame(viewer_);
	frame->setObjectName(QString::fromUtf8("frame"));
	frame->setFrameShape(QFrame::StyledPanel);
	frame->setFrameShadow(QFrame::Raised);
	viewerText_ = new QTextEdit(frame);
	viewerText_->setObjectName(QString::fromUtf8("text"));
	viewerText_->setReadOnly(true);

	

	label = new QLabel(viewer_);
	label->setObjectName(QString::fromUtf8("label"));
	label->setText("URLs");
	vboxLayout->addWidget(label);
	vboxLayout->addWidget(viewerText_);
	viewer_->show();
}
SchematicViewer::SchematicViewer(QWidget *parent)
	: QWidget(parent), m_fullSchematic(true), m_maximizedNode(false), m_sceneHandle(0)
{
	m_viewer = new SchematicSceneViewer(this);
	m_stageScene = new StageSchematicScene(this);
	m_fxScene = new FxSchematicScene(this);

	m_commonToolbar = new QToolBar(m_viewer);
	m_stageToolbar = new QToolBar(m_viewer);
	m_fxToolbar = new QToolBar(m_viewer);
	m_swapToolbar = new QToolBar(m_viewer);

	m_commonToolbar->setObjectName("ToolBarWithoutBorder");
	m_stageToolbar->setObjectName("ToolBarWithoutBorder");
	m_fxToolbar->setObjectName("ToolBarWithoutBorder");
	m_swapToolbar->setObjectName("ToolBarWithoutBorder");

	createToolbars();
	createActions();

	// layout
	QVBoxLayout *mainLayout = new QVBoxLayout();
	mainLayout->setMargin(1);
	mainLayout->setSpacing(0);
	{
		mainLayout->addWidget(m_viewer, 1);

		QFrame *bottomFrame = new QFrame(this);
		bottomFrame->setObjectName("SchematicBottomFrame");
		QHBoxLayout *horizontalLayout = new QHBoxLayout();
		horizontalLayout->setMargin(0);
		horizontalLayout->setSpacing(0);
		{
			horizontalLayout->addWidget(m_commonToolbar);
			horizontalLayout->addStretch();
			horizontalLayout->addWidget(m_fxToolbar);
			horizontalLayout->addWidget(m_stageToolbar);
			horizontalLayout->addWidget(m_swapToolbar);
		}
		bottomFrame->setLayout(horizontalLayout);

		mainLayout->addWidget(bottomFrame, 0);
	}
	setLayout(mainLayout);

	connect(m_fxScene, SIGNAL(showPreview(TFxP)), this, SIGNAL(showPreview(TFxP)));
	connect(m_fxScene, SIGNAL(doCollapse(const QList<TFxP> &)), this, SIGNAL(doCollapse(const QList<TFxP> &)));
	connect(m_stageScene, SIGNAL(doCollapse(QList<TStageObjectId>)), this, SIGNAL(doCollapse(QList<TStageObjectId>)));
	connect(m_fxScene, SIGNAL(doExplodeChild(const QList<TFxP> &)), this, SIGNAL(doExplodeChild(const QList<TFxP> &)));
	connect(m_stageScene, SIGNAL(doExplodeChild(QList<TStageObjectId>)), this, SIGNAL(doExplodeChild(QList<TStageObjectId>)));
	connect(m_stageScene, SIGNAL(editObject()), this, SIGNAL(editObject()));
	connect(m_fxScene, SIGNAL(editObject()), this, SIGNAL(editObject()));

	m_viewer->setScene(m_stageScene);
	m_fxToolbar->hide();

	setFocusProxy(m_viewer);
}
Exemple #8
0
QFrame* AddLineSeparator(QWidget* parent)
{
    QFrame* line = new QFrame(parent);
    line->setObjectName(QString::fromUtf8("line"));
    line->setFrameShape(QFrame::HLine);
    line->setFrameShadow(QFrame::Sunken);
    line->setFixedHeight(10);
    return line;
}
Exemple #9
0
bool Ruler::collectExtraInfo(QWidget * parent, const QString & family, const QString & prop, const QString & value, bool swappingEnabled, QString & returnProp, QString & returnValue, QWidget * & returnWidget)
{
	bool result = PaletteItem::collectExtraInfo(parent, family, prop, value, swappingEnabled, returnProp, returnValue, returnWidget);

	if (prop.compare("width", Qt::CaseInsensitive) == 0) {
		returnProp = tr("width");

		int units = m_modelPart->localProp("width").toString().contains("cm") ? IndexCm : IndexIn;
		QLineEdit * e1 = new QLineEdit();
		QDoubleValidator * validator = new QDoubleValidator(e1);
		validator->setRange(1.0, 20 * ((units == IndexCm) ? 2.54 : 1), 2);
		validator->setNotation(QDoubleValidator::StandardNotation);
		e1->setValidator(validator);
		e1->setEnabled(swappingEnabled);
		QString temp = m_modelPart->localProp("width").toString();
		temp.chop(2);
		e1->setText(temp);
		e1->setObjectName("infoViewLineEdit");	
        e1->setMaximumWidth(80);

		m_widthEditor = e1;
		m_widthValidator = validator;

		QComboBox * comboBox = new QComboBox(parent);
		comboBox->setEditable(false);
		comboBox->setEnabled(swappingEnabled);
		comboBox->addItem("cm");
		comboBox->addItem("in");
		comboBox->setCurrentIndex(units);
		m_unitsEditor = comboBox;
		comboBox->setObjectName("infoViewComboBox");	
        comboBox->setMinimumWidth(60);


		QHBoxLayout * hboxLayout = new QHBoxLayout();
		hboxLayout->setAlignment(Qt::AlignLeft);
		hboxLayout->setContentsMargins(0, 0, 0, 0);
		hboxLayout->setSpacing(0);
		hboxLayout->setMargin(0);


		hboxLayout->addWidget(e1);
		hboxLayout->addWidget(comboBox);

		QFrame * frame = new QFrame();
		frame->setLayout(hboxLayout);
		frame->setObjectName("infoViewPartFrame");

		connect(e1, SIGNAL(editingFinished()), this, SLOT(widthEntry()));
		connect(comboBox, SIGNAL(currentIndexChanged(const QString &)), this, SLOT(unitsEntry(const QString &)));

        returnValue = temp + QString::number(units);
		returnWidget = frame;

		return true;
	}
QFrame * createLine()
{
	QFrame * line = new QFrame();
    line->setObjectName(QString::fromUtf8("line"));
    //line->setGeometry(QRect(320, 150, 118, 3));
    line->setFrameShape(QFrame::HLine);
    line->setFrameShadow(QFrame::Sunken);

	return line;
}
Exemple #11
0
void RSSManager::refreshTable()
{
    QSqlQuery query;
    ui->tabWidget->setUpdatesEnabled(false);
    deleteAllTabs();

    query.exec("SELECT address, title, icon FROM rss");
    int i = 0;
    while (query.next()) {
        QUrl address = query.value(0).toUrl();
        QString title = query.value(1).toString();
        QIcon icon = QPixmap::fromImage(QImage::fromData(query.value(2).toByteArray()));
        TreeWidget* tree = new TreeWidget();
        tree->setHeaderLabel(tr("News"));
        tree->setContextMenuPolicy(Qt::CustomContextMenu);
        connect(tree, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(customContextMenuRequested(QPoint)));

        ui->tabWidget->addTab(tree, title);
        ui->tabWidget->setTabToolTip(i, address.toString());
        connect(tree, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), this, SLOT(loadFeed(QTreeWidgetItem*)));
        connect(tree, SIGNAL(itemMiddleButtonClicked(QTreeWidgetItem*)), this, SLOT(controlLoadFeed(QTreeWidgetItem*)));
        connect(tree, SIGNAL(itemControlClicked(QTreeWidgetItem*)), this, SLOT(controlLoadFeed(QTreeWidgetItem*)));
        QTreeWidgetItem* item = new QTreeWidgetItem();
        item->setText(0, tr("Loading..."));
        tree->addTopLevelItem(item);

        ui->tabWidget->setTabIcon(i, icon);
        beginToLoadSlot(address);
        i++;
    }
    if (i > 0) {
        ui->deletebutton->setEnabled(true);
        m_reloadButton->setEnabled(true);
        ui->edit->setEnabled(true);
    }
    else {
        ui->deletebutton->setEnabled(false);
        m_reloadButton->setEnabled(false);
        ui->edit->setEnabled(false);

        QFrame* frame = new QFrame();
        frame->setObjectName("rssmanager-frame");
        QVBoxLayout* verticalLayout = new QVBoxLayout(frame);
        QLabel* label_2 = new QLabel(frame);
        label_2->setPixmap(QPixmap(":/icons/menu/rss.png"));
        label_2->setAlignment(Qt::AlignBottom | Qt::AlignHCenter);
        verticalLayout->addWidget(label_2);
        QLabel* label = new QLabel(frame);
        label->setAlignment(Qt::AlignHCenter | Qt::AlignTop);
        label->setText(tr("You don't have any RSS Feeds.<br/>\nPlease add some with RSS icon in navigation bar on site which offers feeds."));
        verticalLayout->addWidget(label);
        ui->tabWidget->addTab(frame, tr("Empty"));
    }
    ui->tabWidget->setUpdatesEnabled(true);
}
Exemple #12
0
void FramelessDlg::InitTitleBar()
{
	QVBoxLayout* layout = qobject_cast<QVBoxLayout*>(this->layout());

	m_closeBtn = new QToolButton(this);
	QToolButton* minBtn = new QToolButton(this);
	QToolButton* menuBtn = new QToolButton(this);

	m_subTitle = new QLabel(this);
	m_subTitle->setAlignment(Qt::AlignRight | Qt::AlignVCenter);

	m_closeBtn->setObjectName("closeBtn");
	minBtn->setObjectName("minBtn");
	menuBtn->setObjectName("menuBtn");
	m_subTitle->setObjectName("subTitle");

	menuBtn->setPopupMode(QToolButton::InstantPopup);
	m_menu = new QMenu(this);
	menuBtn->setMenu(m_menu);

	m_closeBtn->setFixedSize(27, 22);
	minBtn->setFixedSize(27, 22);
	menuBtn->setFixedSize(27, 22);
	m_subTitle->setFixedSize(400, 25);

	connect(m_closeBtn, SIGNAL(clicked()), this, SLOT(reject()));
	connect(m_closeBtn, SIGNAL(clicked()), this, SLOT(close()));
	connect(minBtn, SIGNAL(clicked()), this, SLOT(showMinimized()));

	QFrame* tb = new QFrame(this);
	tb->setObjectName("titleBar");
	QHBoxLayout* tbLayout = new QHBoxLayout;
	m_title = new QLabel(this);
	m_title->setObjectName("label_title");
	m_title->setFixedSize(300, 25);

	tbLayout->addWidget(m_title);
	tbLayout->addSpacerItem(new QSpacerItem(20, 40, QSizePolicy::Expanding, QSizePolicy::Fixed));

	if ( m_flag & SUB_TITLE )
		tbLayout->addWidget(m_subTitle);

	if ( m_flag & MENU_BUTTON )
		tbLayout->addWidget(menuBtn);

	if ( m_flag & MIN_BUTTON )
		tbLayout->addWidget(minBtn);

	if ( m_flag & CLOSE_BUTTON )
		tbLayout->addWidget(m_closeBtn);

	tb->setLayout(tbLayout);
	layout->addWidget(tb);
}
Exemple #13
0
QFrame* MainWindow::initDragFrame(QWidget *parent)
{
    QFrame *frame = new QFrame(parent);

    QLabel *logoLabel = new QLabel(frame);
    QLabel *dragLabel = new QLabel("Drop Folders Here Or", frame);
    //QPushButton *addFilesButton = new QPushButton("Select files", frame);
    QPushButton *addFilesButton = new QPushButton("Select Folder", frame);

    logoLabel->setPixmap(QPixmap(":/resources/logo.png"));
    dragLabel->setAlignment(Qt::AlignCenter);

    QHBoxLayout *mainLayout = new QHBoxLayout(frame);
    QVBoxLayout *addFilesLayout = new QVBoxLayout();

    addFilesButton->setFixedSize(290, 30);

    addFilesLayout->setAlignment(Qt::AlignCenter);
    addFilesLayout->addWidget(dragLabel);
    addFilesLayout->addWidget(addFilesButton);

    mainLayout->addSpacing(25);
    mainLayout->addWidget(logoLabel);
    mainLayout->addLayout(addFilesLayout);
    mainLayout->addSpacing(65);

    frame->setFixedSize(570, 155);
    frame->setObjectName("add_files_frame");
    frame->setStyleSheet("QFrame#add_files_frame {"
                         "border: 3px dashed rgb(220, 220, 220);"
                         "border-radius: 24px"
                         "}"
                         "QPushButton {"
                         "background: qlineargradient(x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgb(245, 245, 245), stop:1 rgb(214, 214, 214));"
                         "border: 1px solid rgb(171, 171, 171);"
                         "border-radius: 5px"
                         "}"
                         "QPushButton:pressed {"
                         "background: qlineargradient(x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgb(214, 214, 214), stop:1 rgb(230, 230, 230));"
                         "}"
                         "QWidget {"
                         "font: bold 13px \"Arial\";"
                         "color: rgb(58, 58, 58);"
                         "}");

    setMinimumWidth(frame->width()+10);

    //connect(addFilesButton, &QPushButton::clicked, this, [=](){ filesList->addFiles(QFileDialog::getOpenFileNames(this, "Select Files")); });
    connect(addFilesButton, &QPushButton::clicked, this, [=](){ filesList->addFolder(QFileDialog::getExistingDirectory(this, "Select Directory")); });


    return frame;
}
QWidget *DialogController::frameWidget(QWidget *widget)
{
    QFrame *frame = new QFrame(m_parent);
    frame->setLayout(new QHBoxLayout);
    frame->setObjectName("actionFrame");
    frame->setMinimumWidth(widget->width());
    frame->layout()->addWidget(widget);
    frame->layout()->setContentsMargins(0,0,0,0);
    if(m_mode == Bottom) {
        frame->setStyleSheet("QFrame#actionFrame { background: rgb(35,35,35); border:none; border-top:2px solid rgb(108,108,108);}");
    }
    return frame;
}
Exemple #15
0
void MultisigDialog::on_addDestinationButton_clicked()
{
    QFrame* destinationFrame = new QFrame(ui->destinationsScrollAreaContents);
    destinationFrame->setObjectName(QStringLiteral("destinationFrame"));
    destinationFrame->setFrameShape(QFrame::StyledPanel);
    destinationFrame->setFrameShadow(QFrame::Raised);

    QVBoxLayout* frameLayout = new QVBoxLayout(destinationFrame);
    frameLayout->setObjectName(QStringLiteral("destinationFrameLayout"));
    QHBoxLayout* destinationLayout = new QHBoxLayout();
    destinationLayout->setSpacing(0);
    destinationLayout->setObjectName(QStringLiteral("destinationLayout"));
    QLabel* destinationAddressLabel = new QLabel(destinationFrame);
    destinationAddressLabel->setObjectName(QStringLiteral("destinationAddressLabel"));

    destinationLayout->addWidget(destinationAddressLabel);

    QValidatedLineEdit* destinationAddress = new QValidatedLineEdit(destinationFrame);
    destinationAddress->setObjectName(QStringLiteral("destinationAddress"));

    destinationLayout->addWidget(destinationAddress);

    QSpacerItem* horizontalSpacer = new QSpacerItem(10, 20, QSizePolicy::Fixed, QSizePolicy::Minimum);
    destinationLayout->addItem(horizontalSpacer);

    QLabel* destinationAmountLabel = new QLabel(destinationFrame);
    destinationAmountLabel->setObjectName(QStringLiteral("destinationAmountLabel"));

    destinationLayout->addWidget(destinationAmountLabel);

    BitcoinAmountField* destinationAmount = new BitcoinAmountField(destinationFrame);
    destinationAmount->setObjectName(QStringLiteral("destinationAmount"));

    destinationAddressLabel->setText(QApplication::translate("MultisigDialog", strprintf("%i. Address: ", ui->destinationsList->count()+1).c_str(), 0));
    destinationAmountLabel->setText(QApplication::translate("MultisigDialog", "Amount: ", 0));

    destinationLayout->addWidget(destinationAmount);

    QPushButton* destinationDeleteButton = new QPushButton(destinationFrame);
    destinationDeleteButton->setObjectName(QStringLiteral("destinationDeleteButton"));
    QIcon icon;
    icon.addFile(QStringLiteral(":/icons/remove"), QSize(), QIcon::Normal, QIcon::Off);
    destinationDeleteButton->setIcon(icon);
    destinationDeleteButton->setAutoDefault(false);
    connect(destinationDeleteButton, SIGNAL(clicked()), this, SLOT(deleteFrame()));
    destinationLayout->addWidget(destinationDeleteButton);

    frameLayout->addLayout(destinationLayout);

    ui->destinationsList->addWidget(destinationFrame);
}
PipelineWidget::PipelineWidget(VisualizationServicePtr visualizationService, PatientModelServicePtr patientModelService, QWidget* parent, PipelinePtr pipeline) :
    BaseWidget(parent, "PipelineWidget", "Pipeline"),
    mPipeline(pipeline)
{
	this->setToolTip("Run a series of filters");
	FilterGroupPtr filters = mPipeline->getFilters();
	std::vector<SelectDataStringPropertyBasePtr> nodes = mPipeline->getNodes();
	if (filters->size()+1 != nodes.size())
		reportError("Filter/Node mismatch");

	QVBoxLayout* topLayout = new QVBoxLayout(this);
	mButtonGroup = new QButtonGroup(this);

	struct Inner
	{
		static QHBoxLayout* addHMargin(QWidget* base)
		{
			QHBoxLayout* layout = new QHBoxLayout;
			layout->addWidget(base);
			layout->setContentsMargins(4,0,4,0);
			return layout;
		}
	};

	for (unsigned i=0; i<filters->size(); ++i)
	{
		topLayout->addLayout(Inner::addHMargin(new DataSelectWidget(visualizationService, patientModelService, this, nodes[i])));

		PipelineWidgetFilterLine* algoLine = new PipelineWidgetFilterLine(this, filters->get(i), mButtonGroup);
		connect(algoLine, SIGNAL(requestRunFilter()), this, SLOT(runFilterSlot()));
		connect(algoLine, SIGNAL(filterSelected(QString)), this, SLOT(filterSelectedSlot(QString)));
		algoLine->mTimedAlgorithmProgressBar->attach(mPipeline->getTimedAlgorithm(filters->get(i)->getUid()));

		mAlgoLines.push_back(algoLine);
		QFrame* frame = this->wrapInFrame(algoLine);
		frame->layout()->setContentsMargins(4,4,4,4); // nice on linux
		frame->setObjectName("FilterBackground");
		topLayout->addWidget(frame);
	}
	topLayout->addLayout(Inner::addHMargin(new DataSelectWidget(visualizationService, patientModelService, this, nodes.back())));

	topLayout->addSpacing(12);

	mSetupWidget = new CompactFilterSetupWidget(visualizationService, patientModelService, this, filters->getOptions(), true);
	topLayout->addWidget(mSetupWidget);

	topLayout->addStretch();

	this->filterSelectedSlot(filters->get(0)->getUid());
}
Exemple #17
0
LoadView::LoadView(QWidget* parent):DropArea( parent )
{

    QVBoxLayout *layout = new QVBoxLayout( this );

    layout->addWidget( tempAccountLbl = new QLabel(
        "<center>Ceci est un compte administrateur temporaire<br>"
        "Veuillez<ol><li>Enregistrer vos coordonnées dans le système en cliquant sur <strong>\"Ajouter\"</strong></li>"
        "<li>Vous rendre dans <strong>\"Réglages\"</strong> afin de créer votre compte administrateur</li></ol></center>"
        ));
    tempAccountLbl->setObjectName( "tempAccountLbl" );
    tempAccountLbl->hide();
    connect( &Socket::sock(), SIGNAL(loggedAsTempAdmin()), SLOT(onLoggedAsTempAdmin()) );
    connect( &Socket::sock(), SIGNAL(loggedAsUser()), SLOT(onLogged()) );
    connect( &Socket::sock(), SIGNAL(loggedAsAdmin()), SLOT(onLogged()) );

    QLabel *loadImageLbl = new QLabel( "Pour commencer" );
    loadImageLbl->setObjectName("loadImageLbl");
    layout->addWidget(loadImageLbl);

    layout->addStretch(0);

    QHBoxLayout *hLayout;
    layout->addLayout( hLayout = new QHBoxLayout() );

        QFrame *dropZone = new QFrame( this );
        dropZone->setObjectName( "dropZone" );
        hLayout->addWidget( dropZone, Qt::AlignCenter );

        QVBoxLayout *dropZoneLayout = new QVBoxLayout( dropZone );
        QLabel *deposezFichierLbl = new QLabel( dropZone );
        deposezFichierLbl->setObjectName( "deposezFichierLbl" );
        deposezFichierLbl->setText( 
        "<center>"
        "Chargez une ou plusieurs photos depuis votre ordinateur"
        "</center>"
        );
        dropZoneLayout->addWidget( deposezFichierLbl, 1, Qt::AlignCenter );

        QPushButton *browseImagesBtn = new QPushButton( dropZone );
        browseImagesBtn->setText( "Séléctionnez des Images" );
        browseImagesBtn->setObjectName( "browseImagesBtn" );
        dropZoneLayout->addWidget( browseImagesBtn, 1, Qt::AlignCenter );

        connect( browseImagesBtn, SIGNAL( clicked() ), SLOT( onBrowseImages() ) );
    
    layout->addStretch(0);

}
Exemple #18
0
CPasswdConfig::CPasswdConfig(QWidget *parent)
	: QDialog(parent)
	, m_bPressed(false)
{
	setObjectName("passwdframe");
	setMinimumSize(QSize(350, 300));
	setWindowFlags(Qt::Dialog | Qt::WindowCloseButtonHint | Qt::FramelessWindowHint);
	m_titleWidget = new CTitleWidget(this);
	m_titleWidget->setParent(this);
	m_titleWidget->setMinimumHint(false);
	m_titleWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
	m_titleWidget->setTitle(QString::fromLocal8Bit("ÃÜÂëÅäÖÃ"));
	connect(m_titleWidget, &CTitleWidget::closed, this, &CPasswdConfig::reject);

	QFrame* frame = new QFrame(this);
	frame->setObjectName("passwdtable");

	QLabel* label = new QLabel(this);
	label->setText(QString::fromLocal8Bit("ÇëÔÚ±í¸ñÖÐÊäÈëÆ·ÅÆÃÜÂë"));

	m_tableWidget = new QTableWidget(this);
	m_tableWidget->verticalHeader()->hide();
	m_tableWidget->setColumnCount(2);
	m_tableWidget->setHorizontalHeaderLabels(QStringList() 
		<< QString::fromLocal8Bit("Æ·ÅÆÃû³Æ")
		<< QString::fromLocal8Bit("ÃÜÂë"));
	m_tableWidget->horizontalHeader()->setStretchLastSection(true);
	m_tableWidget->setSelectionBehavior(QTableWidget::SelectItems);
	m_tableWidget->setSelectionMode(QTableWidget::SingleSelection);

	connect(m_tableWidget, &QTableWidget::itemChanged, this, &CPasswdConfig::dataChanged);

	m_buttonBox = new QDialogButtonBox(Qt::Horizontal, this);
	m_buttonBox->addButton(QString::fromLocal8Bit("È·¶¨"), QDialogButtonBox::AcceptRole);
	m_buttonBox->addButton(QString::fromLocal8Bit("È¡Ïû"), QDialogButtonBox::RejectRole);
	connect(m_buttonBox, &QDialogButtonBox::accepted, this, &CPasswdConfig::acceptPasswd);
	connect(m_buttonBox, &QDialogButtonBox::rejected, this, &CPasswdConfig::reject);

	QVBoxLayout* layout = new QVBoxLayout(frame);
	layout->addWidget(label);
	layout->addWidget(m_tableWidget);
	layout->addWidget(m_buttonBox);

	QVBoxLayout* mainLayout = new QVBoxLayout(this);
	mainLayout->setMargin(0);
	mainLayout->setSpacing(0);
	mainLayout->addWidget(m_titleWidget);
	mainLayout->addWidget(frame);
}
lCDefaultLengthConstraint::lCDefaultLengthConstraint( QWidget *parent,
						      const char *name )
  : QGroupBox ( parent ), edited_( false )
{
  setObjectName( name );
  setTitle( "Temporary label" );

  //TODO
  //setColumnLayout( 0, Qt::Vertical );
  layout()->setSpacing( 6 );
  layout()->setMargin( 11 );

  QGridLayout* g_layout = new QGridLayout( this );


  specified_button_ = new QRadioButton( this );
  specified_button_->setText( tr( "Specified" ) );

  specified_spin_box_ = new lCDefaultLengthSpinBox( this, "specifiedLength" );

  imported_button_ = new QRadioButton( this );
  imported_button_->setText( tr( "Imported" ) );

  imported_constraint_chooser_ = new lCConstraintChooser( this, "constrainedLength" );

  QFrame* separator = new QFrame( this );
  separator->setObjectName(  "separator" );
  separator->setFrameShape( QFrame::HLine );
  separator->setFrameShadow( QFrame::Sunken );

  g_layout->addWidget( specified_button_, 0, 0 );
  g_layout->addWidget( specified_spin_box_, 0, 1 );
  g_layout->addWidget( separator, 1, 0, 1, 1 );
  g_layout->addWidget( imported_button_, 2, 0 );
  g_layout->addWidget( imported_constraint_chooser_, 2, 1 );

  connect( this, SIGNAL( clicked(int) ), SLOT( updateChooser(int) ) );
  connect( specified_spin_box_, SIGNAL( valueChanged(double) ),
	   this, SIGNAL( valueChanged(double ) ) );

  specified_button_->setChecked( true );

  // Only temporary...
  imported_button_->setEnabled( false );
  imported_constraint_chooser_->setEnabled( false );
}
Exemple #20
0
void mainWindow::conViewInit()
{
    QFrame *f =new QFrame(this);
    QWidget *conView=contentHdl->view();
    
    QVBoxLayout *l=new QVBoxLayout(f);
    l->addWidget(core::contentHdl->toolBar() );
    l->addWidget(conView);
    l->setContentsMargins(0,0,0,0);
    conView->setAutoFillBackground(false);
    f->setObjectName("mainFrame");
//     f->setFrameShape(QFrame::Panel);
//     f->setFrameShadow(QFrame::Plain);
//     f->setStyleSheet("#mainFrame { border:1px solid gray; border-radius: 4px; }");
//     f->setStyleSheet("#mainFrame { border-width: 1px;border-style: solid;border-color: gray; border-radius: 4px; }");
    setCentralWidget(f); 
}
void ResourcesBrowser::setupFileFinder()
{
   QString topObjectName( "ResourcesBrowser/fileFinderFrame" );

   // frame
   QFrame* frame = NULL;
   QVBoxLayout* layout = NULL;
   {
      frame = new QFrame( m_tabsManager );
      frame->setObjectName( topObjectName );
      layout = new QVBoxLayout( frame );
      frame->setLayout( layout );
      layout->setSpacing(0);
      layout->setMargin(0);
      m_tabsManager->addTab( frame, "Search" );
   }

   // toolbar
   {
      QToolBar* toolbar = new QToolBar( m_tabsManager );
      toolbar->setObjectName( topObjectName + "/toolbar" );
      layout->addWidget( toolbar );

      // find file
      {
         m_findFile = new QAction( tr( "Find file" ), toolbar );
         m_findFile->setIcon( QIcon( m_iconsDir + "search.png" ) );
         toolbar->addAction( m_findFile );
         connect( m_findFile, SIGNAL( triggered() ), this, SLOT( onFindFile() ) );

         m_searchedFileName = new QLineEdit( toolbar );
         toolbar->addWidget( m_searchedFileName );
      }
   }

   // results list
   {
      m_searchResults = new QListWidget( m_tabsManager );
      m_searchResults->setObjectName( topObjectName + "/m_searchResults" );
      layout->addWidget( m_searchResults );

      connect( m_searchResults, SIGNAL( itemDoubleClicked( QListWidgetItem* ) ), this, SLOT( onFocusOnFile( QListWidgetItem* ) ) );

   }
}
Exemple #22
0
void MultisigDialog::on_addPrivKeyButton_clicked()
{
    if(isFirstPrivKey){//on first click the scroll area must show
        isFirstPrivKey = false;
        ui->keyScrollArea->show();
    }

    if(ui->keyList->count() > 14){
        ui->signButtonStatus->setStyleSheet("QTextEdit{ color: red }");
        ui->signButtonStatus->setText(tr("Maximum (15)"));
        return;
    }

    QFrame* keyFrame = new QFrame(ui->keyScrollAreaContents);

    keyFrame->setObjectName(QStringLiteral("keyFrame"));
    keyFrame->setFrameShape(QFrame::StyledPanel);
    keyFrame->setFrameShadow(QFrame::Raised);

    QHBoxLayout* keyLayout = new QHBoxLayout(keyFrame);
    keyLayout->setObjectName(QStringLiteral("keyLayout"));

    QLabel* keyLabel = new QLabel(keyFrame);
    keyLabel->setObjectName(QStringLiteral("keyLabel"));
    keyLabel->setText(QApplication::translate("MultisigDialog", strprintf("Key %i: ", (ui->keyList->count()+1)).c_str(), 0));
    keyLayout->addWidget(keyLabel);

    QLineEdit* key = new QLineEdit(keyFrame);
    key->setObjectName(QStringLiteral("key"));
    key->setEchoMode(QLineEdit::Password);
    keyLayout->addWidget(key);

    QPushButton* keyDeleteButton = new QPushButton(keyFrame);
    keyDeleteButton->setObjectName(QStringLiteral("keyDeleteButton"));
    QIcon icon;
    icon.addFile(QStringLiteral(":/icons/remove"), QSize(), QIcon::Normal, QIcon::Off);
    keyDeleteButton->setIcon(icon);
    keyDeleteButton->setAutoDefault(false);
    connect(keyDeleteButton, SIGNAL(clicked()), this, SLOT(deleteFrame()));
    keyLayout->addWidget(keyDeleteButton);

    ui->keyList->addWidget(keyFrame);
}
Exemple #23
0
void DBaseDialog::initUI(const QString &icon,
                         const QString &message,
                         const QString &tipMessage,
                         const QStringList &buttonKeys,
                         const QStringList &buttonTexts){
    m_icon = icon;
    m_message = message;
    m_tipMessage = tipMessage;
    m_buttonKeys = buttonKeys;
    m_buttonTexts = buttonTexts;

    QFrame* contentFrame = new QFrame;
    contentFrame->setObjectName("ContentFrame");

    m_iconLabel = new QLabel;
    m_iconLabel->setFixedSize(48, 48);
    setIcon(m_icon);

    m_messageLabel = new QLabel;
    m_messageLabel->setObjectName("MessageLabel");
    setMessage(m_message);

    m_tipMessageLabel = new QLabel;
    m_tipMessageLabel->setObjectName("TipMessageLabel");
    setTipMessage(m_tipMessage);

    m_buttonGroup = new QButtonGroup;
    QHBoxLayout* buttonLayout = new QHBoxLayout;
    foreach (QString label, m_buttonKeys) {
        int index = m_buttonKeys.indexOf(label);
        QPushButton* button = new QPushButton(label);
        button->setObjectName("ActionButton");
        button->setAttribute(Qt::WA_NoMousePropagation);
        button->setFixedHeight(28);
        m_buttonGroup->addButton(button, index);
        buttonLayout->addWidget(button);
        if (index < m_buttonKeys.length() - 1){
            QLabel* label = new QLabel;
            label->setObjectName("VLine");
            label->setFixedWidth(1);
            buttonLayout->addWidget(label);
        }
    }
Exemple #24
0
SettingsDialog::SettingsDialog(Settings *settings, QWidget *parent)
  : QDialog(parent)
{
  setAttribute(Qt::WA_DeleteOnClose);
  setWindowFlags(windowFlags() ^ Qt::WindowContextHelpButtonHint);
  setWindowTitle(SCHAT_NAME);
  setMinimumWidth(320);

  QFrame *topFrame = new QFrame(this);
  topFrame->setObjectName(LS("TopFrame"));
  topFrame->setStyleSheet(LS("#TopFrame{background-color:#fff;}"));

  m_settingsBtn = addBtn(QIcon(LS(":/images/32/gear.png")), tr("Settings"));
  m_settingsBtn->setChecked(true);

  m_aboutBtn = new QToolButton(this);
  m_aboutBtn->setText(QApplication::applicationVersion());
  m_aboutBtn->setAutoRaise(true);
  m_aboutBtn->setCheckable(true);
  m_aboutBtn->setToolButtonStyle(Qt::ToolButtonTextOnly);
  connect(m_aboutBtn, SIGNAL(clicked()), SLOT(tooglePage()));

  m_pages = new QStackedWidget(this);
  m_pages->addWidget(new SettingsPage(settings, this));
  m_pages->addWidget(new AboutPage(settings, this));

  QFrame *line = new QFrame(this);
  line->setFrameStyle(QFrame::HLine | QFrame::Sunken);

  QHBoxLayout *btnLay = new QHBoxLayout(topFrame);
  btnLay->addWidget(m_settingsBtn);
  btnLay->addStretch();
  btnLay->addWidget(m_aboutBtn, 0, Qt::AlignTop);
  btnLay->setMargin(4);

  QVBoxLayout *layout = new QVBoxLayout(this);
  layout->addWidget(topFrame);
  layout->addWidget(line);
  layout->addWidget(m_pages);
  layout->setMargin(0);
  layout->setSpacing(0);
}
void Board::setupLoadImage(QWidget * parent, const QString & family, const QString & prop, const QString & value, bool swappingEnabled, QString & returnProp, QString & returnValue, QWidget * & returnWidget) 
{
    Q_UNUSED(returnValue);
    Q_UNUSED(value);
    Q_UNUSED(prop);
    Q_UNUSED(family);
    Q_UNUSED(parent);

	returnProp = tr("image file");

	QFrame * frame = new QFrame();
	frame->setObjectName("infoViewPartFrame");
	QVBoxLayout * vboxLayout = new QVBoxLayout();
	vboxLayout->setContentsMargins(0, 0, 0, 0);
	vboxLayout->setSpacing(0);
	vboxLayout->setMargin(0);

	QComboBox * comboBox = new QComboBox();
	comboBox->setObjectName("infoViewComboBox");
	comboBox->setEditable(false);
	comboBox->setEnabled(swappingEnabled);
	m_fileNameComboBox = comboBox;

	setFileNameItems();

	connect(comboBox, SIGNAL(currentIndexChanged(const QString &)), this, SLOT(fileNameEntry(const QString &)));

	QPushButton * button = new QPushButton (tr("load image file"));
	button->setObjectName("infoViewButton");
	connect(button, SIGNAL(pressed()), this, SLOT(prepLoadImage()));
	button->setEnabled(swappingEnabled);

	vboxLayout->addWidget(comboBox);
	vboxLayout->addWidget(button);

	frame->setLayout(vboxLayout);
	returnWidget = frame;

	returnProp = "";
}
Exemple #26
0
void stkSlicerAppPrivate::setupUi(QMainWindow * mainWindow)
{
	Q_Q(stkSlicerApp);

	this->Ui_stkSlicerApp::setupUi(mainWindow);

	// Color of the spacing between views:
	QFrame* layoutFrame = new QFrame(this->slicerWidget);
	layoutFrame->setObjectName("CentralWidgetLayoutFrame");
	QHBoxLayout* centralLayout = new QHBoxLayout(this->slicerWidget);
	centralLayout->setContentsMargins(0, 0, 0, 0);
	centralLayout->addWidget(layoutFrame);

	QColor windowColor = this->slicerWidget->palette().color(QPalette::Window);
	QPalette centralPalette = this->slicerWidget->palette();
	centralPalette.setColor(QPalette::Window, QColor(95, 95, 113));
	this->slicerWidget->setAutoFillBackground(true);
	this->slicerWidget->setPalette(centralPalette);

	// Restore the palette for the children
	centralPalette.setColor(QPalette::Window, windowColor);
	layoutFrame->setPalette(centralPalette);
	layoutFrame->setAttribute(Qt::WA_NoSystemBackground, true);
	layoutFrame->setAttribute(Qt::WA_TranslucentBackground, true);


	//----------------------------------------------------------------------------
	// Layout Manager
	//----------------------------------------------------------------------------
	// Instanciate and assign the layout manager to the slicer application
	this->LayoutManager = new qSlicerLayoutManager(layoutFrame);
	qSlicerApplication::application()->setLayoutManager(this->LayoutManager);

	// Layout manager should also listen the MRML scene
	this->LayoutManager->setMRMLScene(qSlicerApplication::application()->mrmlScene());
	QObject::connect(qSlicerApplication::application(), SIGNAL(mrmlSceneChanged(vtkMRMLScene*)), this->LayoutManager, SLOT(setMRMLScene(vtkMRMLScene*)));

	//3d View Appearence setting
	stkSlicerDisplayHelper::Set3DViewNodeAppearence();
}
Exemple #27
0
 foreach(QString s, names){
     if(s=="|"){
         QFrame *line = new QFrame(this);
         line->setObjectName(QString::fromUtf8("line"));
         if(flag==Qt::AlignLeft||flag==Qt::AlignRight){
             line->setFrameShape(QFrame::VLine);
         } else {
             line->setFrameShape(QFrame::HLine);
         }
         line->setFrameShadow(QFrame::Sunken);
         line->setStyleSheet("background:black;");
         layout->addWidget(line);
     } else {
         lds_toolbar_button *t=new lds_toolbar_button(this);
         t->setText(s);
         if(t->text()==tr("退出")
                 ||t->text()==tr("取消"))t->setProperty("outer_stylesheet", "pushbutton_blue");
         else t->setProperty("outer_stylesheet", "pushbutton");
         layout->addWidget(t);
         nameTool.insert(s, t);
     }
 }
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);
}
Exemple #29
0
QFrame * ProgramTab::createFooter() {
    QFrame * footerFrame = new QFrame();
    footerFrame->setObjectName("footer"); // Used for styling
	footerFrame->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Fixed);

    QLabel * languageLabel = new QLabel(tr("Language:"), this);

	m_languageComboBox = new QComboBox();
	m_languageComboBox->setEditable(false);
    m_languageComboBox->setEnabled(true);
    m_languageComboBox->addItems(m_programWindow->getAvailableLanguages());
	QSettings settings;
	QString currentLanguage = settings.value("programwindow/language", "").toString();
	if (currentLanguage.isEmpty()) {
		currentLanguage = m_languageComboBox->currentText();
	}
    setLanguage(currentLanguage, false);

	QPushButton * addButton = new QPushButton(tr("New"));
	//addButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
	connect(addButton, SIGNAL(clicked()), m_programWindow, SLOT(addTab()));

    QPushButton * loadButton = new QPushButton(tr("Open..."));
	//loadButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    connect(loadButton, SIGNAL(clicked()), this, SLOT(loadProgramFile()));

    m_saveButton = new QPushButton(tr("Save"));
	//m_saveButton->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
    connect(m_saveButton, SIGNAL(clicked()), this, SLOT(save()));

    QLabel * portLabel = new QLabel(tr("Port:"), this);

    m_portComboBox = new SerialPortComboBox();
    m_portComboBox->setEditable(false);
    m_portComboBox->setEnabled(true);
	QStringList ports = m_programWindow->getSerialPorts();
    m_portComboBox->addItems(ports);

	QString currentPort = settings.value("programwindow/port", "").toString();
	if (currentPort.isEmpty()) {
		currentPort = m_portComboBox->currentText();
	}
	else if (!ports.contains(currentPort)) {
		currentPort = m_portComboBox->currentText();
	}
    setPort(currentPort);

	m_programButton = new QPushButton(tr("Program"));
	m_programButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    connect(m_programButton, SIGNAL(clicked()), this, SLOT(sendProgram()));
	m_programButton->setEnabled(false);

	QLabel * programmerLabel = new QLabel(tr("Programmer:"), this);

	m_programmerComboBox = new QComboBox();
	m_programmerComboBox->setEditable(false);
    m_programmerComboBox->setEnabled(true);
	updateProgrammers();
	QString currentProgrammer = ProgramWindow::LocateName;
	QString temp = settings.value("programwindow/programmer", "").toString();
	if (!temp.isEmpty()) {
		QFileInfo fileInfo(temp);
		if (fileInfo.exists()) {
			currentProgrammer = temp;
		}
	}
	chooseProgrammerAux(currentProgrammer, false);

	QHBoxLayout *footerLayout = new QHBoxLayout;

	footerLayout->setMargin(0);
	footerLayout->setSpacing(5);
    footerLayout->addWidget(addButton);
    footerLayout->addWidget(loadButton);
    footerLayout->addWidget(m_saveButton);

    footerLayout->addSpacerItem(new QSpacerItem(5,0,QSizePolicy::Expanding,QSizePolicy::Minimum));

    footerLayout->addWidget(languageLabel);
    footerLayout->addWidget(m_languageComboBox);
    footerLayout->addWidget(portLabel);
    footerLayout->addWidget(m_portComboBox);
	footerLayout->addWidget(programmerLabel);
	footerLayout->addWidget(m_programmerComboBox);
	footerLayout->addWidget(m_programButton);

	footerFrame->setLayout(footerLayout);

	// connect last so these signals aren't triggered during initialization
    connect(m_languageComboBox, SIGNAL(currentIndexChanged(const QString &)), this, SLOT(setLanguage(const QString &)));
    connect(m_portComboBox, SIGNAL(currentIndexChanged(const QString &)), this, SLOT(setPort(const QString &)));
	connect(m_portComboBox, SIGNAL(aboutToShow()), this, SLOT(updateSerialPorts()), Qt::DirectConnection);
    connect(m_programmerComboBox, SIGNAL(activated(int)), this, SLOT(chooseProgrammerTimed(int)));	

	return footerFrame;
}
CleanupSettingsPane::CleanupSettingsPane(QWidget *parent)
    : QFrame(parent), m_attached(false) {
  // Rotate&Flip
  QFrame *rotFlipFrame = new QFrame(this);
  m_rotateOm           = new QComboBox(this);
  m_flipX              = new QCheckBox(tr("Horizontal"), this);
  m_flipY              = new QCheckBox(tr("Vertical"), this);
  // Camera
  QFrame *cameraFrame = new QFrame(this);
  m_cameraWidget      = new CleanupCameraSettingsWidget();
  // LineProcessing
  QFrame *lineProcFrame = new QFrame(this);
  m_antialias           = new QComboBox(this);
  m_sharpness           = new DoubleField(this);
  m_despeckling         = new IntField(this);
  m_aaValueLabel        = new QLabel(tr("MLAA Intensity:"));
  m_aaValue             = new IntField(this);
  m_lineProcessing      = new QComboBox(this);
  m_paletteViewer       = new CleanupPaletteViewer(this);
  m_pathField           = new CleanupSaveInField(this, QString(""));

  QPushButton *saveBtn  = new QPushButton(tr("Save"));
  QPushButton *loadBtn  = new QPushButton(tr("Load"));
  QPushButton *resetBtn = new QPushButton(tr("Reset"));

  // Rotate&Flip
  rotFlipFrame->setObjectName("CleanupSettingsFrame");
  QStringList rotate;
  rotate << "0"
         << "90"
         << "180"
         << "270";
  m_rotateOm->addItems(rotate);
  // Camera
  cameraFrame->setObjectName("CleanupSettingsFrame");
  m_cameraWidget->setCameraPresetListFile(ToonzFolder::getReslistPath(true));
  // LineProcessing
  lineProcFrame->setObjectName("CleanupSettingsFrame");
  QStringList items;
  items << tr("Standard") << tr("None") << tr("Morphological");
  m_antialias->addItems(items);

  items.clear();
  items << tr("Greyscale") << tr("Color");
  m_lineProcessing->addItems(items);

  m_sharpness->setValues(90, 0, 100);
  m_despeckling->setValues(2, 0, 20);
  m_aaValue->setValues(70, 0, 100);

  //  Model-related stuff
  CleanupSettingsModel *model = CleanupSettingsModel::instance();
  m_backupParams.assign(model->getCurrentParameters(), false);

  //----layout
  QVBoxLayout *mainLay = new QVBoxLayout();
  mainLay->setSpacing(2);
  mainLay->setMargin(5);
  {
    // Rotate&Flip
    QGridLayout *rotFlipLay = new QGridLayout();
    rotFlipLay->setMargin(5);
    rotFlipLay->setSpacing(3);
    {
      rotFlipLay->addWidget(new QLabel(tr("Rotate")), 0, 0,
                            Qt::AlignRight | Qt::AlignVCenter);
      rotFlipLay->addWidget(m_rotateOm, 0, 1, 1, 2);
      rotFlipLay->addWidget(new QLabel(tr("Flip")), 1, 0,
                            Qt::AlignRight | Qt::AlignVCenter);
      rotFlipLay->addWidget(m_flipX, 1, 1);
      rotFlipLay->addWidget(m_flipY, 1, 2);
    }
    rotFlipLay->setColumnStretch(0, 0);
    rotFlipLay->setColumnStretch(1, 0);
    rotFlipLay->setColumnStretch(2, 1);
    rotFlipFrame->setLayout(rotFlipLay);
    mainLay->addWidget(rotFlipFrame, 0);

    // Camera
    QVBoxLayout *cleanupCameraFrameLay = new QVBoxLayout();
    cleanupCameraFrameLay->setMargin(0);
    cleanupCameraFrameLay->setSpacing(0);
    { cleanupCameraFrameLay->addWidget(m_cameraWidget); }
    cameraFrame->setLayout(cleanupCameraFrameLay);
    mainLay->addWidget(cameraFrame, 0);

    // Cleanup Palette
    QGridLayout *lineProcLay = new QGridLayout();
    lineProcLay->setMargin(5);
    lineProcLay->setSpacing(3);
    {
      lineProcLay->addWidget(new QLabel(tr("Line Processing:")), 0, 0,
                             Qt::AlignRight | Qt::AlignVCenter);
      lineProcLay->addWidget(m_lineProcessing, 0, 1);
      lineProcLay->addWidget(new QLabel(tr("Antialias:")), 1, 0,
                             Qt::AlignRight | Qt::AlignVCenter);
      lineProcLay->addWidget(m_antialias, 1, 1);
      lineProcLay->addWidget(new QLabel(tr("Sharpness:")), 2, 0,
                             Qt::AlignRight | Qt::AlignVCenter);
      lineProcLay->addWidget(m_sharpness, 2, 1);
      lineProcLay->addWidget(new QLabel(tr("Despeckling:")), 3, 0,
                             Qt::AlignRight | Qt::AlignVCenter);
      lineProcLay->addWidget(m_despeckling, 3, 1);
      lineProcLay->addWidget(m_aaValueLabel, 4, 0,
                             Qt::AlignRight | Qt::AlignVCenter);
      lineProcLay->addWidget(m_aaValue, 4, 1);

      lineProcLay->addWidget(m_paletteViewer, 5, 0, 1, 2);
    }
    lineProcLay->setRowStretch(0, 0);
    lineProcLay->setRowStretch(1, 0);
    lineProcLay->setRowStretch(2, 0);
    lineProcLay->setRowStretch(3, 0);
    lineProcLay->setRowStretch(4, 0);
    lineProcLay->setRowStretch(5, 1);
    lineProcLay->setColumnStretch(0, 0);
    lineProcLay->setColumnStretch(1, 1);

    lineProcFrame->setLayout(lineProcLay);

    mainLay->addWidget(lineProcFrame, 100);

    // Bottom Parts
    QHBoxLayout *pathLay = new QHBoxLayout();
    pathLay->setMargin(0);
    pathLay->setSpacing(3);
    {
      pathLay->addWidget(new QLabel("Save In"), 0);
      pathLay->addWidget(m_pathField);
    }
    mainLay->addLayout(pathLay, 0);

    mainLay->addSpacing(5);

    QHBoxLayout *saveLoadLay = new QHBoxLayout();
    saveLoadLay->setMargin(0);
    saveLoadLay->setSpacing(1);
    {
      saveLoadLay->addWidget(saveBtn);
      saveLoadLay->addWidget(loadBtn);
      saveLoadLay->addWidget(resetBtn);
    }
    mainLay->addLayout(saveLoadLay, 0);
  }
  setLayout(mainLay);

  //-----signal-slot connections
  bool ret = true;
  ret      = ret && connect(m_rotateOm, SIGNAL(activated(int)),
                       SLOT(onGenericSettingsChange()));
  ret = ret && connect(m_flipX, SIGNAL(stateChanged(int)),
                       SLOT(onGenericSettingsChange()));
  ret = ret && connect(m_flipY, SIGNAL(stateChanged(int)),
                       SLOT(onGenericSettingsChange()));
  ret =
      ret && connect(m_pathField, SIGNAL(pathChanged()), SLOT(onPathChange()));
  ret = ret && connect(m_sharpness, SIGNAL(valueChanged(bool)),
                       SLOT(onSharpnessChange(bool)));
  ret = ret && connect(m_antialias, SIGNAL(activated(int)),
                       SLOT(onGenericSettingsChange()));
  ret = ret && connect(m_lineProcessing, SIGNAL(activated(int)),
                       SLOT(onGenericSettingsChange()));
  ret = ret && connect(m_despeckling, SIGNAL(valueChanged(bool)),
                       SLOT(onGenericSettingsChange()));
  ret = ret && connect(m_aaValue, SIGNAL(valueChanged(bool)),
                       SLOT(onGenericSettingsChange()));
  ret = ret &&
        connect(TApp::instance()->getCurrentLevel(),
                SIGNAL(xshLevelSwitched(TXshLevel *)), SLOT(onLevelSwitched()));
  ret = ret && connect(m_cameraWidget, SIGNAL(cleanupSettingsChanged()),
                       SLOT(onGenericSettingsChange()));

  ret =
      ret && connect(saveBtn, SIGNAL(pressed()), this, SLOT(onSaveSettings()));

  ret = ret && connect(loadBtn, SIGNAL(pressed()), model, SLOT(promptLoad()));
  ret = ret && connect(resetBtn, SIGNAL(pressed()), this,
                       SLOT(onRestoreSceneSettings()));

  assert(ret);
}