QWidget* GeneratingView::createMainWidget()
{

    QLabel *label = new QLabel;
    label->setFixedSize(32,32);
    // FIXME: hidpi
    QString path = ":/resource/theme/images/spinner/32/";
    DMovie *movie = new DMovie(label);
    movie->setMoviePath(path, label);
    movie->start();

    DBaseButton *button = new DBaseButton(tr("Cancel"),this);
    button->setFixedSize(160, 36);
    connect(button, SIGNAL(clicked(bool)), this, SLOT(onCancelButtonClicked()));

    QWidget* mainWidget = new QWidget;

    InfoLabel* text = new InfoLabel;
    text->setText(tr("Generating verification code, please wait... "));

    auto mainLayout = new QVBoxLayout(mainWidget);
    mainLayout->setSpacing(0);
    mainLayout->setMargin(0);

    mainLayout->addSpacing(60);
    mainLayout->addWidget(label, 0, Qt::AlignHCenter);
    mainLayout->addSpacing(30);
    mainLayout->addWidget(text, 0, Qt::AlignHCenter);

    addButton(button);

    return mainWidget;
}
示例#2
0
void ResourceDock::setupHTools() {
	auto htools = new QFrame(this);
	auto vlayout = new QVBoxLayout(htools);
	vlayout->setMargin(2);
	vlayout->setSpacing(0);

	auto hlayoutTitle = new QHBoxLayout();
	auto title = new QLabel(htools);
	title->setText("Resource Explorer ");
	title->setStyleSheet("color: lightGray;");
	hlayoutTitle->addWidget(title);

	auto sepBrush = QBrush(Qt::gray, Qt::BrushStyle::Dense6Pattern);
	QPalette sepPalette;
	sepPalette.setBrush(QPalette::Background, sepBrush);

	auto seprator = new QLabel(htools);
	seprator->setAutoFillBackground(true);
	seprator->setPalette(sepPalette);
	seprator->setMaximumHeight(10);
	hlayoutTitle->addWidget(seprator, 1, Qt::AlignBottom);

	auto btnClose = new QToolButton(htools);
	btnClose->setText("X");
	btnClose->setStyleSheet("color: lightGray\n");
	btnClose->setAutoRaise(true);
	btnClose->setMaximumWidth(16);
	btnClose->setMaximumHeight(16);
	hlayoutTitle->addWidget(btnClose);
	connect(btnClose, &QToolButton::clicked, this, &QDockWidget::hide);

	vlayout->addLayout(hlayoutTitle);
	vlayout->addSpacing(2);

	auto hlayoutTools = new QHBoxLayout();
	hlayoutTools->setMargin(0);
	hlayoutTools->setSpacing(0);

	auto btnCollAll = new QToolButton(htools);
	btnCollAll->setIcon(QIcon(":/icons/col"));
	btnCollAll->setToolTip("Collapse All");
	btnCollAll->setToolButtonStyle(Qt::ToolButtonIconOnly);
	connect(btnCollAll, &QToolButton::clicked, resTree, &QTreeWidget::collapseAll);
	hlayoutTools->addWidget(btnCollAll);
	hlayoutTools->addSpacing(5);

	auto ledit = new QLineEdit(htools);
	ledit->setPlaceholderText("Search");
	ledit->addAction(QIcon(":/icons/search"), QLineEdit::ActionPosition::TrailingPosition);
	ledit->setStyleSheet("background-color: gray;");
	connect(ledit, &QLineEdit::textChanged, this, &ResourceDock::searchAct);
	hlayoutTools->addWidget(ledit, 1);
	vlayout->addLayout(hlayoutTools);

	htools->setLayout(vlayout);

	setTitleBarWidget(htools);
}
示例#3
0
ImportWidget::ImportWidget(QWidget *parent) : QFrame(parent), d_ptr(new ImportWidgetPrivate(this))
{
    Q_D(ImportWidget);
    setObjectName("ImportWidget");

    DThemeManager::instance()->registerWidget(this);

    setAcceptDrops(true);

    auto layout = new QVBoxLayout(this);

    auto logo = new QLabel;
    logo->setFixedSize(128, 128);
    logo->setObjectName("ImportViewLogo");

//    auto btFrme = new QFrame;
//    auto btFrmeLayout = new QVBoxLayout(btFrme);
//    btFrme->setFixedSize(150, 50);
    d->importButton = new QPushButton;
    d->importButton->setObjectName("ImportViewImportButton");
    d->importButton->setFixedSize(142, 42);
//    btFrmeLayout->addWidget(d->importButton, 0, Qt::AlignCenter);
    d->importButton->setText(tr("Add folder"));

    d->text = new QLabel;
    d->text->setObjectName("ImportViewText");
    d->text->setFixedHeight(24);
    d->text->setOpenExternalLinks(false);
    QString linkText = QString(linkTemplate).arg(tr("Scan")).arg(tr("Scan"));
    d->text->setText(QString(tr("%1 music directory or drag & drop music file to add music")).arg(linkText));

    layout->addStretch();
    layout->addWidget(logo, 0, Qt::AlignCenter);
    layout->addSpacing(20);
    layout->addWidget(d->importButton, 0, Qt::AlignCenter);
    layout->addSpacing(10);
    layout->addWidget(d->text, 0, Qt::AlignCenter);
    layout->addStretch();

    connect(d->importButton, &QPushButton::clicked,
    this, [ = ] {
        Q_EMIT this->importFiles();
    });

    connect(d->text, &QLabel::linkActivated,
    this, [ = ](const QString & /*link*/) {
        showWaitHint();
        Q_EMIT this->scanMusicDirectory();
    });
}
示例#4
0
YoudaoDictWidget::YoudaoDictWidget(QWidget *parent)
    : ContentFrame(parent),
      youdao_api_(new YoudaoAPI),
      word_label_(new QLabel),
      explains_label_(new QLabel),
      us_voice_btn_(new ImageButton(":/images/audio-normal.svg",
                                    ":/images/audio-hover.svg",
                                    ":/images/audio-press.svg")),
      uk_voice_btn_(new ImageButton(":/images/audio-normal.svg",
                                    ":/images/audio-hover.svg",
                                    ":/images/audio-press.svg")),
      voice_player_(new QMediaPlayer),
      us_voice_label_(new QLabel),
      uk_voice_label_(new QLabel)
{
    QHBoxLayout *voice_layout = new QHBoxLayout;
    voice_layout->addWidget(uk_voice_btn_);
    voice_layout->addSpacing(5);
    voice_layout->addWidget(uk_voice_label_);
    voice_layout->addSpacing(50);
    voice_layout->addWidget(us_voice_btn_);
    voice_layout->addSpacing(5);
    voice_layout->addWidget(us_voice_label_);
    voice_layout->addStretch();

    uk_voice_btn_->hide();
    us_voice_btn_->hide();
    us_voice_label_->hide();
    uk_voice_label_->hide();

    word_label_->setWordWrap(true);
    explains_label_->setWordWrap(true);

    word_label_->setStyleSheet("QLabel { font-size: 20px; }");
    word_label_->setTextInteractionFlags(Qt::TextSelectableByMouse);
    explains_label_->setTextInteractionFlags(Qt::TextSelectableByMouse);

    addWidget(word_label_);
    addSpacing(5);
    addLayout(voice_layout);
    addSpacing(10);
    addWidget(explains_label_);
    addStretch();

    connect(youdao_api_, &YoudaoAPI::searchFinished, this, &YoudaoDictWidget::queryWordFinished);
    connect(us_voice_btn_, &ImageButton::clicked, this, &YoudaoDictWidget::playUSVoice);
    connect(uk_voice_btn_, &ImageButton::clicked, this, &YoudaoDictWidget::playUKVoice);
}
示例#5
0
  SubSection(const QString & title, const QString & description, QLabel * imageLabel) : QWidget() 
  {
    auto mainHLayout = new QHBoxLayout();
    setLayout(mainHLayout);

    mainHLayout->addWidget(imageLabel);

    auto mainVLayout = new QVBoxLayout();
    mainHLayout->addLayout(mainVLayout);
    auto titleLabel = new QLabel(title);
    titleLabel->setStyleSheet("QLabel { font-size: 14px; font: bold; color: #242D31; }");
    titleLabel->setWordWrap(true);
    mainVLayout->addWidget(titleLabel);

    auto descriptionHLayout = new QHBoxLayout();
    mainVLayout->addLayout(descriptionHLayout);
    descriptionHLayout->addSpacing(35);

    auto descriptionLabel = new QLabel(description);
    descriptionLabel->setFixedWidth(700);
    descriptionLabel->setStyleSheet("QLabel { font-size: 14px; color: black; }");
    descriptionLabel->setWordWrap(true);
    descriptionHLayout->addWidget(descriptionLabel);

    mainHLayout->setAlignment(Qt::AlignLeft);
  }
示例#6
0
static void setupVSTControl(
      const VSTControlInlet& inlet,
      QWidget* inlet_widget,
      const score::DocumentContext& ctx,
      Inspector::Layout& vlay,
      QWidget* parent)
{
  // TODO refactor with PortWidgetSetup::setupControl
  auto widg = new QWidget;
  auto advBtn = new QToolButton{widg};
  advBtn->setText("●");

  auto lab = new TextLabel{inlet.customData(), widg};
  auto hl = new score::MarginLess<QHBoxLayout>{widg};
  hl->addWidget(advBtn);
  hl->addWidget(lab);

  auto sw = new QWidget{parent};
  sw->setContentsMargins(0, 0, 0, 0);
  auto hl2 = new score::MarginLess<QHBoxLayout>{sw};
  hl2->addSpacing(30);
  auto lay = new Inspector::Layout{};
  Process::PortWidgetSetup::setupInLayout(inlet, ctx, *lay, sw);
  hl2->addLayout(lay);

  QObject::connect(advBtn, &QToolButton::clicked, sw, [=] {
    sw->setVisible(!sw->isVisible());
  });
  sw->setVisible(false);

  vlay.addRow(widg, inlet_widget);
  vlay.addRow(sw);
}
// *****************************************************************************
RenderSettingsDialog::RenderSettingsDialog(QWidget *parent)
    : QDialog(parent, Qt::WindowCloseButtonHint | Qt::WindowTitleHint)
{
    resize(400, 300);

    //TabWidget
    auto tabWidget = new QTabWidget;
    tabWidget->addTab(new GeneralTab(), tr("General"));
    tabWidget->addTab(new RenderTab(), tr("Renderer"));

    //ButtonBox
    auto closeButton = new QPushButton(tr("Close"));
    auto cancelButton = new QPushButton(tr("Cancel")); 
    auto applyButton = new QPushButton(tr("Apply"));
    auto renderButton = new QPushButton(tr("Render"));
    renderButton->setDefault(true);

    //Render button
    auto buttonLayout = new QHBoxLayout();
    buttonLayout->addWidget(renderButton);
    buttonLayout->addSpacing(10);
    buttonLayout->addStretch();
    buttonLayout->addWidget(closeButton);
    buttonLayout->addWidget(cancelButton);
    buttonLayout->addWidget(applyButton);

    //Main layout
    auto *mainLayout = new QVBoxLayout;
    mainLayout->addWidget(tabWidget);
    mainLayout->addItem(buttonLayout);

    setLayout(mainLayout);
}
示例#8
0
int fixSpacing(FILE *inputFile, char *spacer)
{
	char tmp[readsize];
	int indents = 0;
	int trailing = 0;
	do
	{
		fgets(tmp, readsize, inputFile);
		trailing = indents;
		
		if(startsWith("FOR", tmp) || startsWith("IF", tmp))
		{
			indents++;
		}
		
		if(startsWith("NEXT", tmp) || startsWith("ENDIF", tmp))
		{
			indents--;
		}
		addSpacing(tmp, trailing, spacer);
		
		fputs(tmp, tmpFile)
	}
	while(!feof(inputFile));
	
	
	return 0;
}
SayCheesePhotoManager::SelectConnectionTypeScreenView::SelectConnectionTypeScreenView(Bundle *bundle, MainWindow *mainWindow)
    : SayCheeseScreen(bundle, mainWindow)
{
    auto mainLayout = new QVBoxLayout();
    auto buttonsLayout = new QHBoxLayout();

    auto titleLabel = new QLabel(tr("Select Connection Type"), this);
    titleLabel->setObjectName("SelectConnectionTypeTitleLabel");

    this->usbButton = new QThemedImageButton(":/resources/androidusb.png", this);
    this->usbButton->setObjectName("SelectConnectionTypeUsbButton");
    this->usbButton->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
    this->usbButton->setFocusPolicy(Qt::NoFocus);

    this->wifiButton = new QThemedImageButton(":/resources/androidwifi.png", this);
    this->wifiButton->setObjectName("SelectConnectionTypeWifiButton");
    this->wifiButton->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
    this->wifiButton->setFocusPolicy(Qt::NoFocus);

    this->backButton = new QThemedImageButton(":resources/back.png", this);
    this->backButton->setObjectName("SelectConnectionTypeBackButton");
    this->backButton->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);

    buttonsLayout->addWidget(this->usbButton);
    buttonsLayout->addWidget(this->wifiButton);

    mainLayout->addWidget(titleLabel);
    mainLayout->addSpacing(25);
    mainLayout->addLayout(buttonsLayout);
    mainLayout->addWidget(this->backButton);

    this->setLayout(mainLayout);
}
示例#10
0
LightHeader::LightHeader(QWidget * parent)
  : OSHeader(new HeaderToggleButton())
{
  setSizePolicy(QSizePolicy::Ignored,QSizePolicy::Fixed);
  setFixedHeight(30);

  QString style;
  style.append("openstudio--LightHeader { ");
  style.append("background: #E0E0E0; ");
  style.append("} ");
  setStyleSheet(style);

  auto mainHLayout = new QHBoxLayout();
  mainHLayout->setContentsMargins(5,0,5,0);
  setLayout(mainHLayout);

  mainHLayout->addSpacing(15);

  mainHLayout->addWidget(toggleButton);

  label = new QLabel();
  style.clear();
  style.append("QLabel { ");
  style.append("font: bold; ");
  style.append("} ");
  label->setStyleSheet(style);
  mainHLayout->addWidget(label);
}
示例#11
0
KviPasswordLineEdit::KviPasswordLineEdit(QWidget * par)
: KviTalHBox(par)
{
	setSpacing(0);
	setMargin(0);

	m_pLineEdit = new QLineEdit(this);
	addSpacing(4);
	m_pCheckBox = new QCheckBox(this);
	m_pLineEdit->setEchoMode(QLineEdit::Password);
	m_pCheckBox->setCheckState(Qt::Checked);
	connect(m_pCheckBox,SIGNAL(stateChanged(int)), this, SLOT(checkToggled(int)));
	//m_pLineEdit->setMinimumWidth(200);
	setStretchFactor(m_pLineEdit,1);
}
示例#12
0
VariableHeaderView::VariableHeaderView(bool t_fixed)
  : OSHeader(new HeaderToggleButton()), measureListView(nullptr), m_fixed(t_fixed)
{
  setFixedHeight(40);


  auto mainHLayout = new QHBoxLayout();
  mainHLayout->setContentsMargins(5,0,5,0);
  mainHLayout->setSpacing(5);
  mainHLayout->setAlignment(Qt::AlignLeft);
  setLayout(mainHLayout);
  
  mainHLayout->addWidget(toggleButton);
  
  QRegExp nameRegex("^\\S.*");
  auto validator = new QRegExpValidator(nameRegex, this);

  variableNameEdit = new QLineEdit();
  variableNameEdit->setStyleSheet("font:italic");
  variableNameEdit->setAcceptDrops(false);
  variableNameEdit->setValidator(validator);
  mainHLayout->addWidget(variableNameEdit);

  if (t_fixed)
  {
    measureListView = new OSListView();
    measureListView->setContentsMargins(0,0,0,0);
    mainHLayout->addWidget(measureListView);

    toggleButton->setVisible(false);
    variableNameEdit->setVisible(false);
    setStyleSheet("openstudio--measuretab--VariableHeaderView { background: #F4F4F4; border: 2px solid #A5A5A5; }");
  } else {
    setStyleSheet("openstudio--measuretab--VariableHeaderView { background: #D5D5D5;  }");
  }

  removeButton = new SofterRemoveButton();
  mainHLayout->addWidget(removeButton);

  mainHLayout->addSpacing(50);

  downButton = new DownButton();
  mainHLayout->addWidget(downButton);

  upButton = new UpButton();
  mainHLayout->addWidget(upButton);
}
示例#13
0
void FileTransferWindow::createGui()
{
	setWindowTitle(tr("Kadu - file transfers"));
	setMinimumSize(QSize(100, 100));

	setAttribute(Qt::WA_DeleteOnClose);

	auto layout = new QVBoxLayout{this};

	m_scrollView = new QScrollArea{this};

	layout->addWidget(m_scrollView.get());
	m_scrollView->move(0, 0);

	m_innerFrame = new QFrame{this};
	m_innerFrame->setAutoFillBackground(true);
	m_innerFrame->setFrameStyle(QFrame::NoFrame);
 	m_innerFrame->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum);

	m_transfersLayout = new QVBoxLayout{m_innerFrame.get()};
	m_transfersLayout->setDirection(QBoxLayout::Up);
	m_transfersLayout->setMargin(0);
	m_transfersLayout->setSpacing(0);

 	m_scrollView->setWidget(m_innerFrame.get());
	m_scrollView->setWidgetResizable(true);

	auto buttons = new QDialogButtonBox{Qt::Horizontal, this};

	auto clearButton = new QPushButton{qApp->style()->standardIcon(QStyle::SP_DialogResetButton), tr("Clear"), buttons};
	connect(clearButton, SIGNAL(clicked(bool)), this, SLOT(clearClicked()));

	auto closeButton = new QPushButton{qApp->style()->standardIcon(QStyle::SP_DialogCloseButton), tr("Close"), this};
	connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));

	buttons->addButton(closeButton, QDialogButtonBox::RejectRole);
	buttons->addButton(clearButton, QDialogButtonBox::DestructiveRole);

	layout->addSpacing(16);
	layout->addWidget(buttons);
}
示例#14
0
KviPasswordSelector::KviPasswordSelector(QWidget * par,const QString & txt,QString *pOption,bool bEnabled)
: KviTalHBox(par), KviSelectorInterface()
{
	setSpacing(0);
	setMargin(0);

	m_pLabel = new QLabel(txt,this);
	m_pLineEdit = new QLineEdit(this);
	addSpacing(4);
	m_pCheckBox = new QCheckBox(this);
	m_pLineEdit->setEchoMode(QLineEdit::Password);
	m_pCheckBox->setCheckState(Qt::Checked);
	connect(m_pCheckBox,SIGNAL(stateChanged(int)), this, SLOT(checkToggled(int)));
	//m_pLineEdit->setMinimumWidth(200);
	QString tmp = *pOption;
	m_pLineEdit->setText(tmp);

	setStretchFactor(m_pLineEdit,1);

	m_pOption = pOption;

	setEnabled(bEnabled);
}
示例#15
0
void BCLMeasureDialog::init()
{
#ifdef Q_OS_MAC
  int btnHeight = 44;
#else
  int btnHeight = 34;
#endif

  QPushButton* cancelButton = this->cancelButton();
  cancelButton->setText("Cancel");
  cancelButton->setMinimumHeight(btnHeight);
  cancelButton->setDefault(true);

  QPushButton* okButton = this->okButton();
  okButton->setText("Create Measure and \n Open for Editing");
  okButton->setMinimumHeight(btnHeight);

  auto vLayout = new QVBoxLayout;
  vLayout->setContentsMargins(QMargins(0,0,0,0));

  auto label = new QLabel;
  label->setText("Name:");
  label->setObjectName("H2");
  vLayout->addWidget(label);
  m_nameLineEdit = new QLineEdit(this);
  vLayout->addWidget(m_nameLineEdit);

  auto tempHLayout = new QHBoxLayout;
  label = new QLabel;
  label->setText("Class Name:");
  label->setObjectName("H2");
  tempHLayout->addWidget(label);
  m_classNameLabel = new QLabel(this);
  tempHLayout->addWidget(m_classNameLabel);
  tempHLayout->addStretch();
  vLayout->addLayout(tempHLayout);
  vLayout->addSpacing(10);

  label = new QLabel;
  label->setText("Description:");
  label->setObjectName("H2");
  vLayout->addWidget(label);
  m_descriptionTextEdit = new QTextEdit(this);
  m_descriptionTextEdit->setAcceptRichText(false);
  m_descriptionTextEdit->setTabChangesFocus(true);
  vLayout->addWidget(m_descriptionTextEdit);
  vLayout->addSpacing(10);

  label = new QLabel;
  label->setText("Modeler Description:");
  label->setObjectName("H2");
  vLayout->addWidget(label);
  m_modelerDescriptionTextEdit = new QTextEdit(this);
  m_modelerDescriptionTextEdit->setAcceptRichText(false);
  m_modelerDescriptionTextEdit->setTabChangesFocus(true);
  vLayout->addWidget(m_modelerDescriptionTextEdit);
  vLayout->addSpacing(10);

  tempHLayout = new QHBoxLayout;
  vLayout->addLayout(tempHLayout);

  auto tempVLayout = new QVBoxLayout;

  label = new QLabel;
  label->setText("Measure Type:");
  label->setObjectName("H2");
  tempVLayout->addWidget(label);
  m_measureTypeComboBox = new QComboBox(this);
  m_measureTypeComboBox->addItem("OpenStudio Measure");
  m_measureTypeComboBox->addItem("EnergyPlus Measure");
  //m_measureTypeComboBox->addItem("Utility Measure"); // Disable for now
  m_measureTypeComboBox->addItem("Reporting Measure");
  m_measureTypeComboBox->setCurrentIndex(0);
  tempVLayout->addWidget(m_measureTypeComboBox);
  tempVLayout->addSpacing(10);
  tempHLayout->addLayout(tempVLayout);

  tempVLayout = new QVBoxLayout;

  label = new QLabel;
  label->setText("Taxonomy:");
  label->setObjectName("H2");
  tempVLayout->addWidget(label);
  m_taxonomyFirstLevelComboBox = new QComboBox(this);

  std::vector<std::string> firstLevelTerms = BCLMeasure::suggestedFirstLevelTaxonomyTerms();
  for (const std::string& firstLevelTerm : firstLevelTerms){
    m_taxonomyFirstLevelComboBox->addItem(toQString(firstLevelTerm));
  }

  m_taxonomySecondLevelComboBox = new QComboBox(this);
  auto tempHLayout2 = new QHBoxLayout;
  tempHLayout2->addWidget(m_taxonomyFirstLevelComboBox);
  tempHLayout2->addWidget(m_taxonomySecondLevelComboBox);
  tempVLayout->addLayout(tempHLayout2);
  tempVLayout->addSpacing(10);
  tempHLayout->addLayout(tempVLayout);

  tempHLayout = new QHBoxLayout;
  vLayout->addLayout(tempHLayout);

  tempVLayout = new QVBoxLayout;

  label = new QLabel;
  label->setText("Intended Software Tools:");
  label->setObjectName("H2");
  tempVLayout->addWidget(label);
  m_intendedSoftwareToolListWidget = new QListWidget(this);
  tempVLayout->addWidget(m_intendedSoftwareToolListWidget);
  QStringList intendedSoftwareTools;
  for (const std::string& suggestedTool : BCLMeasure::suggestedIntendedSoftwareTools()){
    intendedSoftwareTools.append(toQString(suggestedTool));
  }
  QStringListIterator it(intendedSoftwareTools);
  while (it.hasNext()){
    QString intendedSoftwareTool = it.next();
    auto listItem = new QListWidgetItem(intendedSoftwareTool, m_intendedSoftwareToolListWidget);
    // DLM: defaults per David
    if (intendedSoftwareTool == "Analysis Spreadsheet"){
      listItem->setCheckState(Qt::Unchecked);
    }else{
      listItem->setCheckState(Qt::Checked);
    }
    listItem->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
    m_intendedSoftwareToolListWidget->addItem(listItem);
  }
  tempHLayout->addLayout(tempVLayout);

  tempVLayout = new QVBoxLayout;

  label = new QLabel;
  label->setText("Intended Use Cases:");
  label->setObjectName("H2");
  tempVLayout->addWidget(label);
  m_intendedUseCaseListWidget = new QListWidget();
  tempVLayout->addWidget(m_intendedUseCaseListWidget);
  QStringList intendedUseCases;
  for (const std::string& suggestedUseCase : BCLMeasure::suggestedIntendedUseCases()){
    intendedUseCases.append(toQString(suggestedUseCase));
  }
  it = QStringListIterator(intendedUseCases);
  while (it.hasNext()){
    QString intendedUseCase = it.next();
    auto listItem = new QListWidgetItem(intendedUseCase, m_intendedUseCaseListWidget);
    // DLM: default to unchecked per David
    listItem->setCheckState(Qt::Unchecked);
    listItem->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
    m_intendedUseCaseListWidget->addItem(listItem);
  }
  tempHLayout->addLayout(tempVLayout);

  QBoxLayout* upperLayout = this->upperLayout();
  upperLayout->addLayout(vLayout);
  upperLayout->addStretch();

  connect(m_nameLineEdit, &QLineEdit::textChanged, this, &BCLMeasureDialog::nameChanged);

  connect(m_measureTypeComboBox, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged),
    this, &BCLMeasureDialog::measureTypeChanged);

  connect(m_taxonomyFirstLevelComboBox, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged),
    this, &BCLMeasureDialog::firstLevelTaxonomyChanged);

  this->setWindowModality(Qt::ApplicationModal);
  //this->setSizeGripEnabled(true);

  #ifdef Q_OS_MAC
    setWindowFlags(Qt::FramelessWindowHint);
  #else
    setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint);
  #endif
}
ConverterConfigurationEditDialog::ConverterConfigurationEditDialog(QWidget *parent) : QDialog(parent), showToolTips(true)
{
    // layouts
    auto mainLayout = new QVBoxLayout;
    auto fileExtenstionsLayout = new QHBoxLayout;
    auto inputFileExtLayout = new QVBoxLayout;
    auto outputFileExtLayout = new QVBoxLayout;
    auto executablePathLayout = new QHBoxLayout;
    auto downloadLocationLayout = new QHBoxLayout;

    // Widgets
    enabledCheckbox = new QCheckBox(tr("Enabled"));
    priorityEdit = new QLineEdit;
    nameEdit = new QLineEdit;
    commentEdit = new QTextEdit;
    downloadLocationEdit = new QLineEdit;
    openURLButton = new QPushButton(tr("Launch"));
    inputFileExtEdit = new QLineEdit;
    outputFileExtEdit = new QLineEdit;
    executableEdit = new QLineEdit;
    executablePathEdit = new FancyLineEdit;
    executablePathBrowseButton = new QPushButton(tr("Browse ..."));
    commandLineEdit = new QLineEdit;
    dialogButtonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);

    // labels
    executablePathLabel = new QLabel(tr("Path of Executable"));
    QLabel* heading = new QLabel(tr("Edit External Converter Settings"));
    QLabel* priorityLabel = new QLabel(tr("Priority"));
    QLabel* nameLabel = new QLabel(tr("Name"));
    QLabel* commentLabel = new QLabel(tr("Comments"));
    QLabel* downloadLocationLabel = new QLabel(tr("Link to Download / Information"));
    QLabel* inputFileExtLabel = new QLabel(tr("Input File Extension"));
    QLabel* outputFileExtLabel = new QLabel(tr("Output File Extension"));
    QLabel* executableLabel = new QLabel(tr("Executable"));
    QLabel* commandLineLabel = new QLabel(tr("Command Line Arguments"));

    // set fonts
    QFont f = heading->font();
    QFont headingFont{f};
    headingFont.setPointSize(f.pointSize() + 2);
    heading->setFont(headingFont);

    // configure widgets
    heading->setAlignment(Qt::AlignHCenter);
    executablePathEdit->hideEditButton();
    QFontMetrics m(commentEdit->font());
    commentEdit->setMaximumHeight(10 * m.lineSpacing());

    // set tooltips
    executablePathEdit->setToolTip(tr("Filename of actual converter program"));
    openURLButton->setToolTip(tr("Open link in Browser"));
    commandLineEdit->setToolTip(tr("Use {i} for Input File and {o} for Output File"));

    // hide things
    priorityLabel->setHidden(true);
    priorityEdit->setHidden(true);
    executableLabel->setHidden(true);
    executableEdit->setHidden(true);

    // attach
    mainLayout->addWidget(heading);
    mainLayout->addSpacing(12);
    mainLayout->addWidget(enabledCheckbox);
    mainLayout->addSpacing(6);
    mainLayout->addWidget(nameLabel);
    mainLayout->addWidget(nameEdit);
    mainLayout->addWidget(priorityLabel);
    mainLayout->addWidget(priorityEdit);
    inputFileExtLayout->addWidget(inputFileExtLabel);
    inputFileExtLayout->addWidget(inputFileExtEdit);
    outputFileExtLayout->addWidget(outputFileExtLabel);
    outputFileExtLayout->addWidget(outputFileExtEdit);
    fileExtenstionsLayout->addLayout(inputFileExtLayout);
    fileExtenstionsLayout->addLayout(outputFileExtLayout);
    mainLayout->addLayout(fileExtenstionsLayout);
    mainLayout->addWidget(executableLabel);
    mainLayout->addWidget(executableEdit);
    mainLayout->addWidget(executablePathLabel);
    executablePathLayout->addWidget(executablePathEdit);
    executablePathLayout->addWidget(executablePathBrowseButton);
    mainLayout->addLayout(executablePathLayout);
    mainLayout->addWidget(commandLineLabel);
    mainLayout->addWidget(commandLineEdit);
    mainLayout->addWidget(commentLabel);
    mainLayout->addWidget(commentEdit);
    mainLayout->addWidget(downloadLocationLabel);
    downloadLocationLayout->addWidget(downloadLocationEdit);
    downloadLocationLayout->addWidget(openURLButton);
    mainLayout->addLayout(downloadLocationLayout);
    mainLayout->addSpacing(12);
    mainLayout->addStretch();
    mainLayout->addWidget(dialogButtonBox);

    // set main Layout
    this->setLayout(mainLayout);

    setContentsMargins(12, 12, 12, 12);

    // connect signals / slots
    connect(executablePathBrowseButton, &QPushButton::clicked, this, [this] {
       promptForExecutableLocation();
    });

    connect(openURLButton, &QPushButton::clicked, this, [this] {
       QDesktopServices::openUrl(QUrl(downloadLocationEdit->text()));
    });

    connect(dialogButtonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
    connect(dialogButtonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
}
示例#17
0
void TimelineToolBar::createRightControls()
{
    auto *spacer = createSpacer();
    spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
    addWidget(spacer);

    addSeparator();

    m_firstFrame = createToolBarLineEdit(this);
    addWidget(m_firstFrame);

    auto emitStartChanged = [this]() { emit startFrameChanged(m_firstFrame->text().toInt()); };
    connect(m_firstFrame, &QLineEdit::editingFinished, emitStartChanged);

    addSeparator();

    addSpacing(10);

    auto *zoomOut = createAction(TimelineConstants::C_ZOOM_OUT,
                                 TimelineIcons::ZOOM_SMALL.icon(),
                                 tr("Zoom Out"),
                                 QKeySequence(QKeySequence::ZoomOut));

    connect(zoomOut, &QAction::triggered, [this]() {
        m_scale->setValue(m_scale->value() - m_scale->pageStep());
    });
    addAction(zoomOut);

    addSpacing(10);

    m_scale = new QSlider(this);
    m_scale->setOrientation(Qt::Horizontal);
    m_scale->setMaximumWidth(200);
    m_scale->setMinimumWidth(100);
    m_scale->setMinimum(0);
    m_scale->setMaximum(100);
    m_scale->setValue(0);

    connect(m_scale, &QSlider::valueChanged, this, &TimelineToolBar::scaleFactorChanged);
    addWidget(m_scale);

    addSpacing(10);

    auto *zoomIn = createAction(TimelineConstants::C_ZOOM_IN,
                                TimelineIcons::ZOOM_BIG.icon(),
                                tr("Zoom In"),
                                QKeySequence(QKeySequence::ZoomIn));

    connect(zoomIn, &QAction::triggered, [this]() {
        m_scale->setValue(m_scale->value() + m_scale->pageStep());
    });
    addAction(zoomIn);

    addSpacing(10);

    addSeparator();

    m_lastFrame = createToolBarLineEdit(this);
    addWidget(m_lastFrame);

    auto emitEndChanged = [this]() { emit endFrameChanged(m_lastFrame->text().toInt()); };
    connect(m_lastFrame, &QLineEdit::editingFinished, emitEndChanged);

    addSeparator();

    m_stateLabel = new QLabel(this);
    m_stateLabel->setFixedWidth(80);
    m_stateLabel->setAlignment(Qt::AlignVCenter | Qt::AlignHCenter);
    addWidget(m_stateLabel);
}
示例#18
0
void TimelineToolBar::createCenterControls()
{
    addSpacing(5);

    auto *toStart = createAction(TimelineConstants::C_TO_START,
                                 TimelineIcons::TO_FIRST_FRAME.icon(),
                                 tr("To Start"),
                                 QKeySequence(Qt::Key_Home));

    connect(toStart, &QAction::triggered, this, &TimelineToolBar::toFirstFrameTriggered);
    addAction(toStart);

    addSpacing(2);

    auto *previous = createAction(TimelineConstants::C_PREVIOUS,
                                  TimelineIcons::BACK_ONE_FRAME.icon(),
                                  tr("Previous"),
                                  QKeySequence(Qt::Key_Comma));

    connect(previous, &QAction::triggered, this, &TimelineToolBar::previousFrameTriggered);
    addAction(previous);

    addSpacing(2);

    auto *play = createAction(TimelineConstants::C_PLAY,
                              TimelineIcons::START_PLAYBACK.icon(),
                              tr("Play"),
                              QKeySequence(Qt::Key_Space));

    connect(play, &QAction::triggered, this, &TimelineToolBar::playTriggered);
    addAction(play);

    addSpacing(2);

    auto *next = createAction(TimelineConstants::C_NEXT,
                              TimelineIcons::FORWARD_ONE_FRAME.icon(),
                              tr("Next"),
                              QKeySequence(Qt::Key_Period));

    connect(next, &QAction::triggered, this, &TimelineToolBar::nextFrameTriggered);
    addAction(next);

    addSpacing(2);

    auto *toEnd = createAction(TimelineConstants::C_TO_END,
                               TimelineIcons::TO_LAST_FRAME.icon(),
                               tr("To End"),
                               QKeySequence(Qt::Key_End));

    connect(toEnd, &QAction::triggered, this, &TimelineToolBar::toLastFrameTriggered);
    addAction(toEnd);

#if 0
    auto *loop = new QAction(TimelineIcons::LOOP_PLAYBACK.icon(), tr("Loop"), this);
    addAction(loop);
#endif

    addSpacing(5);

    addSeparator();

    m_currentFrame = createToolBarLineEdit(this);
    addWidget(m_currentFrame);

    auto emitCurrentChanged = [this]() { emit currentFrameChanged(m_currentFrame->text().toInt()); };
    connect(m_currentFrame, &QLineEdit::editingFinished, emitCurrentChanged);

    addSeparator();

    addSpacing(10);

    QIcon autoKeyIcon = TimelineUtils::mergeIcons(TimelineIcons::GLOBAL_RECORD_KEYFRAMES,
                                                  TimelineIcons::GLOBAL_RECORD_KEYFRAMES_OFF);

    m_recording = createAction(TimelineConstants::C_AUTO_KEYFRAME,
                               autoKeyIcon,
                               tr("Auto Key"),
                               QKeySequence(Qt::Key_K));

    m_recording->setCheckable(true);
    connect(m_recording, &QAction::toggled, [&](bool value) { emit recordToggled(value); });

    addAction(m_recording);

    addSpacing(10);

    addSeparator();

    addSpacing(10);

    auto *curvePicker = createAction(TimelineConstants::C_CURVE_PICKER,
                                     TimelineIcons::CURVE_EDITOR.icon(),
                                     tr("Curve Picker"),
                                     QKeySequence(Qt::Key_C));

    curvePicker->setObjectName("Curve Picker");
    connect(curvePicker, &QAction::triggered, this, &TimelineToolBar::openEasingCurveEditor);
    addAction(curvePicker);

    addSpacing(10);

#if 0
    addSeparator();

    addSpacing(10);

    auto *curveEditor = new QAction(TimelineIcons::CURVE_PICKER.icon(), tr("Curve Editor"));
    addAction(curveEditor);
#endif
}
示例#19
0
void ComponentDock::setupHTools() {
	htools = new QFrame(this);
	auto vlayout = new QVBoxLayout(htools);
	vlayout->setMargin(2);
	vlayout->setSpacing(0);

	auto hlayoutTitle = new QHBoxLayout();
	hlabel = new QLabel(htools);
	hlabel->setText("Components Editor ");
	hlabel->setStyleSheet("color: lightGray;");
	hlayoutTitle->addWidget(hlabel);

	auto sepBrush = QBrush(Qt::gray, Qt::BrushStyle::Dense6Pattern);
	QPalette sepPalette;
	sepPalette.setBrush(QPalette::Background, sepBrush);

	auto seprator = new QLabel(htools);
	seprator->setAutoFillBackground(true);
	seprator->setPalette(sepPalette);
	seprator->setMaximumHeight(10);
	hlayoutTitle->addWidget(seprator, 1, Qt::AlignBottom);

	auto btnClose = new QToolButton(htools);
	btnClose->setText("X");
	btnClose->setStyleSheet("color: lightGray\n");
	btnClose->setAutoRaise(true);
	btnClose->setMaximumWidth(16);
	btnClose->setMaximumHeight(16);
	hlayoutTitle->addWidget(btnClose);
	connect(btnClose, &QToolButton::clicked, this, &QDockWidget::hide);

	vlayout->addLayout(hlayoutTitle);

	auto hlayout = new QHBoxLayout(htools);
	hlayout->setMargin(0);

	auto btnAddComps = new QToolButton(htools);
	btnAddComps->setMenu(mtypes);
	btnAddComps->setDefaultAction(addDefComp);
	btnAddComps->setIcon(QIcon(":/icons/add"));
	btnAddComps->setPopupMode(QToolButton::MenuButtonPopup);
	btnAddComps->setToolButtonStyle(Qt::ToolButtonIconOnly);
	hlayout->addWidget(btnAddComps);

	hlayout->addStretch(1);

	// lua table name
	llabel = new QLabel(htools);
	hlayout->addWidget(llabel);

	vlayout->addLayout(hlayout);

	auto hlayout2 = new QHBoxLayout(htools);
	hlayout2->setMargin(0);

	auto lblLayer = new QLabel(this);
	lblLayer->setText("Layer: ");
	hlayout2->addWidget(lblLayer);

	spnLayer = new QSpinBox(this);
	spnLayer->setMinimum(0);
	spnLayer->setMaximum(KENTITY_LAYER_SIZE);
	connect(spnLayer, static_cast<void(QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &ComponentDock::layerChanged);
	hlayout2->addWidget(spnLayer, 1);
	hlayout2->addSpacing(5);

	auto lblOrder = new QLabel(this);
	lblOrder->setText("Z: ");
	hlayout2->addWidget(lblOrder);

	spnZOrder = new QSpinBox(this);
	spnZOrder->setMinimum(0);
	spnZOrder->setMaximum(9999999);
	spnZOrder->setValue(0);
	connect(spnZOrder, static_cast<void(QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &ComponentDock::zorderChanged);
	hlayout2->addWidget(spnZOrder, 1);
	hlayout2->addSpacing(5);

	// static
	chkStatic = new QCheckBox(this);
	chkStatic->setText("Static");
	connect(chkStatic, &QCheckBox::stateChanged, this, &ComponentDock::staticChanged);
	hlayout2->addWidget(chkStatic);
	hlayout2->addSpacing(5);

	vlayout->addLayout(hlayout2);

	auto hlayout3 = new QHBoxLayout(htools);
	hlayout3->setMargin(0);
	hlayout3->setSpacing(0);

	auto btnCollpaseAll = new QToolButton(htools);
	btnCollpaseAll->setIcon(QIcon(":/icons/col"));
	btnCollpaseAll->setToolButtonStyle(Qt::ToolButtonIconOnly);
	connect(btnCollpaseAll, &QToolButton::clicked, comTree, &QTreeWidget::collapseAll);
	hlayout3->addWidget(btnCollpaseAll);

	hlayout3->addSpacing(5);

	ledit = new QLineEdit(htools);
	ledit->setPlaceholderText("Search");
	ledit->addAction(QIcon(":/icons/search"), QLineEdit::ActionPosition::TrailingPosition);
	ledit->setStyleSheet("background-color: gray;");
	connect(ledit, &QLineEdit::textChanged, this, &ComponentDock::actSearch);
	hlayout3->addWidget(ledit, 1);

	vlayout->addLayout(hlayout3);

	htools->setLayout(vlayout);
	setTitleBarWidget(htools);
}
示例#20
0
// toolbar for remote-control-widget
RemoteAccessWidgetToolBar::RemoteAccessWidgetToolBar( RemoteAccessWidget* parrent, bool viewOnly ) :
	QWidget( parrent ),
	m_parent( parrent ),
	m_showHideTimeLine(),
	m_iconStateTimeLine(),
	m_connecting( false ),
	m_icon( QPixmap( ":/resources/icon128.png" ).scaled( QSize( 48, 48 ), Qt::IgnoreAspectRatio, Qt::SmoothTransformation ) ),
	m_viewOnlyButton( new ToolButton( QPixmap( ":/remoteaccess/kmag.png" ), tr( "View only" ), tr( "Remote control" ) ) ),
	m_sendShortcutButton( new ToolButton( QPixmap( ":/remoteaccess/preferences-desktop-keyboard.png" ), tr( "Send shortcut" ) ) ),
	m_screenshotButton( new ToolButton( QPixmap( ":/remoteaccess/camera-photo.png" ), tr( "Screenshot" ) ) ),
	m_fullScreenButton( new ToolButton( QPixmap( ":/remoteaccess/view-fullscreen.png" ), tr( "Fullscreen" ), tr( "Window" ) ) ),
	m_quitButton( new ToolButton( QPixmap( ":/remoteaccess/application-exit.png" ), tr( "Quit" ) ) )
{
	QPalette pal = palette();
	pal.setBrush( QPalette::Window, QPixmap( ":/resources/toolbar-background.png" ) );
	setPalette( pal );

	setAttribute( Qt::WA_NoSystemBackground, true );
	move( 0, 0 );
	show();
	startConnection();

	m_viewOnlyButton->setCheckable( true );
	m_fullScreenButton->setCheckable( true );
	m_viewOnlyButton->setChecked( viewOnly );
	m_fullScreenButton->setChecked( false );

	connect( m_viewOnlyButton, &ToolButton::toggled, this, &RemoteAccessWidgetToolBar::updateControls );
	connect( m_viewOnlyButton, &QAbstractButton::toggled, parrent, &RemoteAccessWidget::toggleViewOnly );
	connect( m_fullScreenButton, &QAbstractButton::toggled, parrent, &RemoteAccessWidget::toggleFullScreen );
	connect( m_screenshotButton, &QAbstractButton::clicked, parrent, &RemoteAccessWidget::takeScreenshot );
	connect( m_quitButton, &QAbstractButton::clicked, parrent, &QWidget::close );

	auto vncView = parrent->m_vncView;

	auto shortcutMenu = new QMenu();
#if QT_VERSION < 0x050600
#warning Building legacy compat code for unsupported version of Qt
	connect( shortcutMenu->addAction( tr( "Ctrl+Alt+Del" ) ), &QAction::triggered,
				[=]() { vncView->sendShortcut( VncView::ShortcutCtrlAltDel ); } );
	connect( shortcutMenu->addAction( tr( "Ctrl+Esc" ) ), &QAction::triggered,
				[=]() { vncView->sendShortcut( VncView::ShortcutCtrlEscape ); } );
	connect( shortcutMenu->addAction( tr( "Alt+Tab" ) ), &QAction::triggered,
				[=]() { vncView->sendShortcut( VncView::ShortcutAltTab ); } );
	connect( shortcutMenu->addAction( tr( "Alt+F4" ) ), &QAction::triggered,
				[=]() { vncView->sendShortcut( VncView::ShortcutAltF4 ); } );
	connect( shortcutMenu->addAction( tr( "Win+Tab" ) ), &QAction::triggered,
				[=]() { vncView->sendShortcut( VncView::ShortcutWinTab ); } );
	connect( shortcutMenu->addAction( tr( "Win" ) ), &QAction::triggered,
				[=]() { vncView->sendShortcut( VncView::ShortcutWin ); } );
	connect( shortcutMenu->addAction( tr( "Menu" ) ), &QAction::triggered,
				[=]() { vncView->sendShortcut( VncView::ShortcutMenu ); } );
	connect( shortcutMenu->addAction( tr( "Alt+Ctrl+F1" ) ), &QAction::triggered,
				[=]() { vncView->sendShortcut( VncView::ShortcutAltCtrlF1 ); } );
#else
	shortcutMenu->addAction( tr( "Ctrl+Alt+Del" ), [=]() { vncView->sendShortcut( VncView::ShortcutCtrlAltDel ); }  );
	shortcutMenu->addAction( tr( "Ctrl+Esc" ), [=]() { vncView->sendShortcut( VncView::ShortcutCtrlEscape ); }  );
	shortcutMenu->addAction( tr( "Alt+Tab" ), [=]() { vncView->sendShortcut( VncView::ShortcutAltTab ); }  );
	shortcutMenu->addAction( tr( "Alt+F4" ), [=]() { vncView->sendShortcut( VncView::ShortcutAltF4 ); }  );
	shortcutMenu->addAction( tr( "Win+Tab" ), [=]() { vncView->sendShortcut( VncView::ShortcutWinTab ); }  );
	shortcutMenu->addAction( tr( "Win" ), [=]() { vncView->sendShortcut( VncView::ShortcutWin ); }  );
	shortcutMenu->addAction( tr( "Menu" ), [=]() { vncView->sendShortcut( VncView::ShortcutMenu ); }  );
	shortcutMenu->addAction( tr( "Alt+Ctrl+F1" ), [=]() { vncView->sendShortcut( VncView::ShortcutAltCtrlF1 ); }  );
#endif

	m_sendShortcutButton->setMenu( shortcutMenu );
	m_sendShortcutButton->setPopupMode( QToolButton::InstantPopup );

	auto layout = new QHBoxLayout( this );
	layout->setMargin( 1 );
	layout->setSpacing( 1 );
	layout->addStretch( 0 );
	layout->addWidget( m_sendShortcutButton );
	layout->addWidget( m_viewOnlyButton );
	layout->addWidget( m_screenshotButton );
	layout->addWidget( m_fullScreenButton );
	layout->addWidget( m_quitButton );
	layout->addSpacing( 5 );
	connect( m_parent->m_vncView, &VncView::startConnection, this, &RemoteAccessWidgetToolBar::startConnection );
	connect( m_parent->m_vncView, &VncView::connectionEstablished, this, &RemoteAccessWidgetToolBar::connectionEstablished );

	setFixedHeight( 52 );

	m_showHideTimeLine.setFrameRange( 0, height() );
	m_showHideTimeLine.setDuration( 800 );
	m_showHideTimeLine.setCurveShape( QTimeLine::EaseInCurve );
	connect( &m_showHideTimeLine, &QTimeLine::valueChanged, this, &RemoteAccessWidgetToolBar::updatePosition );

	m_iconStateTimeLine.setFrameRange( 0, 100 );
	m_iconStateTimeLine.setDuration( 1500 );
	m_iconStateTimeLine.setUpdateInterval( 60 );
	m_iconStateTimeLine.setCurveShape( QTimeLine::SineCurve );
	connect( &m_iconStateTimeLine, &QTimeLine::valueChanged, this, &RemoteAccessWidgetToolBar::updateConnectionAnimation );
	connect( &m_iconStateTimeLine, &QTimeLine::finished, &m_iconStateTimeLine, &QTimeLine::start );
}
    SelectionContactsForConference::SelectionContactsForConference(
        Logic::ChatMembersModel* _conferenceMembersModel,
        Logic::ChatMembersModel* _otherContactsModel,
        const QString& _labelText,
        QWidget* _parent,
        ConferenceSearchMember& usersSearchModel,
        bool _handleKeyPressEvents)
        : SelectContactsWidget(
            _conferenceMembersModel,
            Logic::MembersWidgetRegim::VIDEO_CONFERENCE,
            _labelText,
            "",
            _parent,
            _handleKeyPressEvents,
            &usersSearchModel),
        conferenceMembersModel_(_conferenceMembersModel),
        videoConferenceMaxUsers_(-1)
    {
        setStyleSheet(Utils::LoadStyle(":/qss/videochat_dialog"));

        mainWidget_ = new QWidget(this);
        auto mainWidgetLayout = Utils::emptyVLayout(mainWidget_);
        mainWidget_->setLayout(mainWidgetLayout);
        mainWidgetLayout->setContentsMargins(0, 0, 0, 0);
        mainWidget_->setContentsMargins(0, 0, 0, 0);

        auto memberWidget = new PureClickedWidget(this);
        memberWidget->setContentsMargins(Utils::scale_value(16), Utils::scale_value(12), Utils::scale_value(20), Utils::scale_value(4));
        auto memberWidgetLayout = Utils::emptyHLayout(memberWidget);
        memberWidget->setLayout(memberWidgetLayout);
        memberWidget->setCursor(Qt::PointingHandCursor);
        memberWidget->setStyleSheet(Utils::LoadStyle(":/qss/videochat_dialog"));

        memberLabel_ = new QLabel(QT_TRANSLATE_NOOP("voip_pages", "MEMBERS"), memberWidget);
        memberLabel_->setContentsMargins(0, 0, 0, 0);
        QPalette p;
        p.setColor(QPalette::Foreground, CommonStyle::getColor(CommonStyle::Color::GREEN_TEXT));
        memberLabel_->setPalette(p);
        memberLabel_->setFont(Fonts::appFontScaled(12, Fonts::FontWeight::Medium));
        memberWidgetLayout->addWidget(memberLabel_);
        memberWidgetLayout->addSpacing(Utils::scale_value(6));

        memberArrowLabel_ = new QPushButton(memberWidget);
        memberArrowLabel_->setStyleSheet("border: 0;");
        memberArrowLabel_->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
        memberArrowLabel_->setStyle(QApplication::style());
        memberArrowLabel_->setContentsMargins(0, 0, 0, 0);

        if (platform::is_apple())
        {
            memberWidgetLayout->addWidget(memberArrowLabel_, 0, Qt::AlignTop);
        }
        else
        {
            memberWidgetLayout->addWidget(memberArrowLabel_);
        }

        memberWidgetLayout->addStretch();

        auto clDelegate  = new Logic::ContactListItemDelegate(this, Logic::MembersWidgetRegim::VIDEO_CONFERENCE, conferenceMembersModel_);
        conferenceContacts_ = CreateFocusableViewAndSetTrScrollBar(this);
        conferenceContacts_->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
        conferenceContacts_->setFrameShape(QFrame::NoFrame);
        conferenceContacts_->setSpacing(0);
        conferenceContacts_->setModelColumn(0);
        conferenceContacts_->setUniformItemSizes(false);
        conferenceContacts_->setBatchSize(50);
        conferenceContacts_->setStyleSheet("background: transparent;");
        conferenceContacts_->setCursor(Qt::PointingHandCursor);
        conferenceContacts_->setMouseTracking(true);
        conferenceContacts_->setAcceptDrops(true);
        conferenceContacts_->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
        conferenceContacts_->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);

        conferenceContacts_->setAutoScroll(false);
        conferenceContacts_->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
        conferenceContacts_->setAttribute(Qt::WA_MacShowFocusRect, false);
        conferenceContacts_->setModel(conferenceMembersModel_);
        conferenceContacts_->setItemDelegate(clDelegate);
        conferenceContacts_->setContentsMargins(0, 0, 0, 0);

        auto othersLabel = new QLabel(QT_TRANSLATE_NOOP("voip_pages", "OTHERS"), mainWidget_);
        othersLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum);
        othersLabel->setContentsMargins(Utils::scale_value(16), Utils::scale_value(12), Utils::scale_value(20), Utils::scale_value(4));
        //Qt ignory our Margins if zoom is 200%. This line fix this problem.
        othersLabel->setMinimumHeight(2 * Utils::scale_value(12) + Utils::scale_value(4));
        QPalette pal;
        pal.setColor(QPalette::Foreground, CommonStyle::getColor(CommonStyle::Color::GREEN_TEXT));
        othersLabel->setPalette(pal);
        othersLabel->setFont(Fonts::appFontScaled(12, Fonts::FontWeight::Medium));

        auto index = globalLayout_->indexOf(searchWidget_);

        mainWidgetLayout->addWidget(memberWidget);
        mainWidgetLayout->addWidget(conferenceContacts_);
        mainWidgetLayout->addWidget(othersLabel);

        contactList_->setIndexWidget(0, mainWidget_);
        usersSearchModel.setWidget(mainWidget_);

        globalLayout_->insertWidget(index + 1, contactList_, 1);

        mainDialog_->addButtonsPair(QT_TRANSLATE_NOOP("popup_window", "CANCEL"), QT_TRANSLATE_NOOP("popup_window", "ADD"), true);

        connect(conferenceContacts_, &FocusableListView::clicked, this, &SelectionContactsForConference::itemClicked, Qt::QueuedConnection);

        // Update other contacts list.
        connect(_otherContactsModel, &Logic::ChatMembersModel::dataChanged, this, [=]() {
            searchModel_->searchPatternChanged(searchModel_->getCurrentPattern());
        });

        connect(&Ui::GetDispatcher()->getVoipController(), &voip_proxy::VoipController::onVoipCallNameChanged,
            this, &SelectionContactsForConference::onVoipCallNameChanged, Qt::DirectConnection);

        connect(&Ui::GetDispatcher()->getVoipController(), &voip_proxy::VoipController::onVoipCallDestroyed,
            this, &SelectionContactsForConference::onVoipCallDestroyed, Qt::DirectConnection);

        connect(memberWidget, &PureClickedWidget::clicked, this, &SelectionContactsForConference::clickConferenceMembers);

        connect(memberArrowLabel_, &QPushButton::clicked, this, &SelectionContactsForConference::clickConferenceMembers);

        clickConferenceMembers();
        updateMemberList();
    }
示例#22
0
TracksItem::TracksItem(QWidget *widget) :
    QWidget(widget),
    d(new TracksItemPrivate(this)) {
    auto em = QRockyStyle::em(this);

    this->setAutoFillBackground(true);
    QPalette palette(this->palette());
    palette.setColor(QPalette::Window, palette.alternateBase().color());
    palette.setColor(QPalette::WindowText, palette.brightText().color());
    palette.setColor(QPalette::Button, palette.alternateBase().color());
    palette.setColor(QPalette::ButtonText, QColor(0x33, 0x33, 0x33));
    palette.setColor(QPalette::Light, QColor(0x33, 0x33, 0x33));
    this->setPalette(palette);

    d->lbl_color = new QWidget;
    d->lbl_color->setMinimumWidth(qRound(em));
    d->lbl_color->setMaximumWidth(qRound(em));
    d->lbl_color->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Minimum);

    d->lbl_artwork = new QLabel;
    auto pxm_artwork = QIcon(":/Roca.svg").pixmap(qRound(4*em), qRound(4*em));
    d->lbl_artwork->setPixmap(pxm_artwork);
    d->lbl_artwork->setMinimumSize(qRound(4*em), qRound(4*em));
    d->lbl_artwork->setMaximumSize(qRound(4*em), qRound(4*em));

    d->lbl_trackname = new QLabel("Track 1");
    QFont font1_5x(this->font());
    if(font1_5x.pointSizeF() > 0) {
        font1_5x.setPointSizeF(font1_5x.pointSizeF()*3/2);
    } else {
        font1_5x.setPixelSize((font1_5x.pixelSize()*3+1)/2);
    }
    d->lbl_trackname->setFont(font1_5x);
    d->lbl_trackname->setPalette(palette);
    d->lbl_trackname->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed);
    d->lbl_sfname = new QLabel("Roca IcySnowy 0.1.0alpha");
    d->lbl_sfname->setPalette(palette);
    d->lbl_sfname->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed);

    d->btn_mute = new QRockyButton("M");
    d->btn_mute->setCheckable(true);
    d->btn_mute->setCombineBorders(QRockyStyle::Combine_Right);
    d->btn_mute->setMinMaxSize(qRound(1.5*em), qRound(1.5*em));
    d->btn_mute->setPalette(palette);
    d->btn_solo = new QRockyButton("S");
    d->btn_solo->setCheckable(true);
    d->btn_solo->setCombineBorders(QRockyStyle::Combine_Left);
    d->btn_solo->setMinMaxSize(qRound(1.5*em), qRound(1.5*em));
    d->btn_solo->setPalette(palette);

    d->sld_volume = new QSlider;
    d->sld_volume->setMinimum(0);
    d->sld_volume->setMaximum(65536);
    d->sld_volume->setValue(65536);
    d->sld_volume->setMinimumWidth(qRound(7*em));
    d->sld_volume->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Minimum);
    d->sld_volume->setOrientation(Qt::Horizontal);
    this->connect(d->sld_volume, &QSlider::valueChanged, this, &TracksItem::onVolumeChange);
    d->lbl_volume = new QLabel("0.0 dB");
    d->lbl_volume->setMinimumWidth(qRound(4.5*em));
    d->lbl_volume->setPalette(palette);

    auto layout0 = new QVBoxLayout;
    layout0->addWidget(d->lbl_trackname);
    layout0->addWidget(d->lbl_sfname);

    auto layout1 = new QHBoxLayout;
    layout1->addWidget(d->lbl_artwork);
    layout1->addSpacing(qRound(em));
    layout1->addLayout(layout0);

    auto layout2 = new QHBoxLayout;
    layout2->addSpacing(qRound(em/2));
    layout2->addWidget(d->btn_mute);
    layout2->addWidget(d->btn_solo);
    layout2->addSpacing(qRound(1.5*em));
    layout2->addWidget(d->sld_volume);
    layout2->addSpacing(qRound(em/2));
    layout2->addWidget(d->lbl_volume);

    auto layout3 = new QVBoxLayout;
    layout3->addSpacing(qRound(em/16));
    layout3->addLayout(layout1);
    layout3->addSpacing(qRound(em/4));
    layout3->addLayout(layout2);
    layout3->addSpacing(qRound(em/4 + em/16));

    auto layout = new QHBoxLayout;
    layout->setMargin(0);
    layout->setSpacing(0);
    layout->addWidget(d->lbl_color);
    layout->addLayout(layout3);

    this->setLayout(layout);

    this->setColor(generateColor());
}
ColorEditor::ColorEditor(QWidget *parent) :
    QFrame(parent),
    d(new ColorEditorImpl(this))
{
    setFocusPolicy(Qt::StrongFocus);
    setCursor(QCursor(Qt::ArrowCursor));

    // Build UI
    // Color format selection
    d->rgbBtn->setText(QLatin1String("rgb"));
    d->hsvBtn->setText(QLatin1String("hsv"));
    d->hslBtn->setText(QLatin1String("hsl"));
    d->qmlRgbaBtn->setText(QLatin1String("Qt.rgba"));
    d->qmlHslaBtn->setText(QLatin1String("Qt.hsla"));
    d->vecBtn->setText(QLatin1String("vec"));
    d->hexBtn->setText(QLatin1String("hex"));

    d->rgbBtn->setCheckable(true);
    d->hsvBtn->setCheckable(true);
    d->hslBtn->setCheckable(true);
    d->qmlRgbaBtn->setCheckable(true);
    d->qmlHslaBtn->setCheckable(true);
    d->vecBtn->setCheckable(true);
    d->hexBtn->setCheckable(true);

    // Build layouts
    d->formatsLayout->setSpacing(0);

    d->colorFrame->setMinimumSize(QSize(30, 35));

    auto rightLayout = new QVBoxLayout;
    rightLayout->addWidget(d->colorFrame);
    rightLayout->addStretch();

    auto leftPanelLayout = new QVBoxLayout;
    leftPanelLayout->addStretch();

    auto colorWidgetsLayout = new QHBoxLayout;
    colorWidgetsLayout->addWidget(d->colorPicker);
    colorWidgetsLayout->addWidget(d->hueSlider);
    colorWidgetsLayout->addWidget(d->saturationSlider);
    colorWidgetsLayout->addWidget(d->valueSlider);
    colorWidgetsLayout->addWidget(d->opacitySlider);
    colorWidgetsLayout->addLayout(rightLayout);

    auto centerLayout = new QVBoxLayout;
    centerLayout->addLayout(colorWidgetsLayout);
    centerLayout->addLayout(d->formatsLayout);

    auto mainLayout = new QHBoxLayout(this);
    mainLayout->addLayout(leftPanelLayout);
    mainLayout->addSpacing(0);
    mainLayout->addLayout(centerLayout);

    // Color format selection logic
    d->btnGroup->addButton(d->rgbBtn);
    d->btnGroup->addButton(d->hsvBtn);
    d->btnGroup->addButton(d->hslBtn);
    d->btnGroup->addButton(d->qmlRgbaBtn);
    d->btnGroup->addButton(d->qmlHslaBtn);
    d->btnGroup->addButton(d->vecBtn);
    d->btnGroup->addButton(d->hexBtn);

    d->buttonToColorFormat.insert(d->rgbBtn, ColorFormat::QCssRgbUCharFormat);
    d->buttonToColorFormat.insert(d->hsvBtn, ColorFormat::QssHsvFormat);
    d->buttonToColorFormat.insert(d->hslBtn, ColorFormat::CssHslFormat);
    d->buttonToColorFormat.insert(d->qmlRgbaBtn, ColorFormat::QmlRgbaFormat);
    d->buttonToColorFormat.insert(d->qmlHslaBtn, ColorFormat::QmlHslaFormat);
    d->buttonToColorFormat.insert(d->vecBtn, ColorFormat::GlslFormat);
    d->buttonToColorFormat.insert(d->hexBtn, ColorFormat::HexFormat);

    connect(d->btnGroup, qOverload<QAbstractButton *>(&QButtonGroup::buttonClicked),
            [=] (QAbstractButton *btn) {
        ColorFormat format = d->buttonToColorFormat.value(btn);

        d->setCurrentFormat(format);
    });

    // Color changes logic
    connect(d->colorPicker, &ColorPickerWidget::colorChanged,
            [=](const QColor &color) { d->onPickerColorChanged(color); });

    connect(d->hueSlider, &HueSlider::valueChanged,
            [=](int hue) { d->onHueChanged(hue); });

    connect(d->saturationSlider, &SaturationSlider::valueChanged,
            [=](int sat) { d->onSaturationChanged(sat); });

    connect(d->valueSlider, &ValueSlider::valueChanged,
            [=](int val) { d->onValueChanged(val); });

    connect(d->opacitySlider, &OpacitySlider::valueChanged,
            [=](int opacity) { d->onOpacityChanged(opacity); });

    setColorCategory(ColorCategory::AnyCategory);
    setOutputFormat(ColorFormat::QCssRgbUCharFormat);
    setColor(Qt::red);
}
示例#24
0
StartupView::StartupView( QWidget * parent ) 
  : QWidget( parent )
{
  m_templateListModel = std::shared_ptr<TemplateListModel>( new TemplateListModel() );

  setStyleSheet("openstudio--StartupView { background: #E6E6E6; }");
  
#ifdef Q_OS_MAC
  setWindowFlags(Qt::FramelessWindowHint);
#else
  setWindowFlags(Qt::CustomizeWindowHint);
#endif

  auto recentProjectsView = new QWidget();
  recentProjectsView->setStyleSheet("QWidget { background: #F2F2F2; }");
  auto recentProjectsLayout = new QVBoxLayout();
  recentProjectsLayout->setContentsMargins(10,10,10,10);
  QLabel * recentProjectsLabel = new QLabel("Recent Projects");
  recentProjectsLabel->setStyleSheet("QLabel { font: bold }");
  recentProjectsLayout->addWidget(recentProjectsLabel,0,Qt::AlignTop);
  recentProjectsView->setLayout(recentProjectsLayout);

  auto openButton = new QToolButton();
  openButton->setText("Open File");
  openButton->setStyleSheet("QToolButton { font: bold; }");
  openButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
  QIcon openIcon(":/images/open_file.png");
  openButton->setIcon(openIcon);
  openButton->setIconSize(QSize(40,40));
  connect(openButton, &QToolButton::clicked, this, &StartupView::openClicked);
  auto importButton = new QToolButton();
  importButton->setText("Import Idf");
  importButton->setStyleSheet("QToolButton { font: bold; }");
  importButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
  QIcon importIcon(":/images/import_file.png");
  importButton->setIcon(importIcon);
  importButton->setIconSize(QSize(40,40));
  connect(importButton, &QToolButton::clicked, this, &StartupView::importClicked);
/*  
  QToolButton * importSDDButton = new QToolButton();
  importSDDButton->setText("Import SDD");
  importSDDButton->setStyleSheet("QToolButton { font: bold; }");
  importSDDButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
  QIcon importSDDIcon(":/images/import_file.png");
  importSDDButton->setIcon(importSDDIcon);
  importSDDButton->setIconSize(QSize(40,40));
  connect(importSDDButton, &QToolButton::clicked, this, &StartupView::importSDDClicked);
*/
  auto projectChooserView = new QWidget();
  projectChooserView->setFixedWidth(238);
  projectChooserView->setStyleSheet("QWidget { background: #F2F2F2; }");
  auto projectChooserLayout = new QVBoxLayout();
  projectChooserLayout->setContentsMargins(10,10,10,10);
  QLabel * projectChooserLabel = new QLabel("Create New From Template");
  projectChooserLabel->setStyleSheet("QLabel { font: bold }");
  projectChooserLayout->addWidget(projectChooserLabel,0,Qt::AlignTop);
  m_listView = new QListView();
  m_listView->setViewMode(QListView::IconMode);
  m_listView->setModel(m_templateListModel.get());
  m_listView->setFocusPolicy(Qt::NoFocus);
  m_listView->setFlow(QListView::LeftToRight);
  m_listView->setUniformItemSizes(true);
  m_listView->setSelectionMode(QAbstractItemView::SingleSelection);
  projectChooserLayout->addWidget(m_listView);
  projectChooserView->setLayout(projectChooserLayout);

  m_projectDetailView = new QWidget();
  m_projectDetailView->setStyleSheet("QWidget { background: #F2F2F2; }");
  auto projectDetailLayout = new QVBoxLayout();
  projectDetailLayout->setContentsMargins(10,10,10,10);
  m_projectDetailView->setLayout(projectDetailLayout);

  auto footerView = new QWidget();
  footerView->setObjectName("FooterView");
  footerView->setStyleSheet("QWidget#FooterView { background: #E6E6E6; }");
  footerView->setMaximumHeight(50);
  footerView->setMinimumHeight(50);

  auto cancelButton = new QPushButton();
  cancelButton->setObjectName("StandardGrayButton");
  cancelButton->setMinimumSize(QSize(99,28));
  #ifdef OPENSTUDIO_PLUGIN
    cancelButton->setText("Cancel");
    connect(cancelButton, &QPushButton::clicked, this, &StartupView::hide);
  #else
    #ifdef Q_OS_MAC
      cancelButton->setText("Quit");
    #else
      cancelButton->setText("Exit");
    #endif
    connect(cancelButton, &QPushButton::clicked, OpenStudioApp::instance(), &OpenStudioApp::quit);
  #endif
  cancelButton->setStyleSheet("QPushButton { font: bold; }");

  auto chooseButton = new QPushButton();
  chooseButton->setObjectName("StandardBlueButton");
  chooseButton->setText("Choose");
  chooseButton->setMinimumSize(QSize(99,28));
  connect(chooseButton, &QPushButton::clicked, this, &StartupView::newFromTemplateSlot);
  chooseButton->setStyleSheet("QPushButton { font: bold; }");

  auto hFooterLayout = new QHBoxLayout();
  hFooterLayout->setSpacing(25);
  hFooterLayout->setContentsMargins(0,0,0,0);
  hFooterLayout->addStretch();
  hFooterLayout->addWidget(cancelButton);
  hFooterLayout->addWidget(chooseButton);
  footerView->setLayout(hFooterLayout);

  auto hLayout = new QHBoxLayout();
  auto vLayout = new QVBoxLayout();

  auto vOpenLayout = new QVBoxLayout();
  vOpenLayout->addWidget(recentProjectsView);
  vOpenLayout->addWidget(openButton);
  vOpenLayout->addWidget(importButton);
  //vOpenLayout->addWidget(importSDDButton);

  hLayout->addLayout(vOpenLayout);
  hLayout->addWidget(projectChooserView);
  hLayout->addWidget(m_projectDetailView,1);

  vLayout->addSpacing(50);
  vLayout->addLayout(hLayout);
  vLayout->addWidget(footerView);

  setLayout(vLayout);

  connect(m_listView, &QListView::clicked, this, &StartupView::showDetailsForItem);

  m_listView->setCurrentIndex(m_templateListModel->index(0,0));
  showDetailsForItem(m_templateListModel->index(0,0));
}
示例#25
0
LoopLibraryDialog::LoopLibraryDialog(QWidget * parent)
  : QDialog(parent)
{
  setObjectName("GrayWidget");

  setFixedSize(280,584);

  setWindowTitle("Add HVAC System");
  setWindowFlags(Qt::WindowFlags(Qt::Dialog | Qt::WindowTitleHint | Qt::WindowCloseButtonHint));

  auto mainVLayout = new QVBoxLayout();
  mainVLayout->setContentsMargins(0,0,0,0);
  mainVLayout->setSpacing(0);
  setLayout(mainVLayout);

  QLabel * loopsLabel = new QLabel("HVAC Systems");
  loopsLabel->setStyleSheet("QLabel { margin-left: 5px; }");
  mainVLayout->addSpacing(5);
  mainVLayout->addWidget(loopsLabel);
  mainVLayout->addSpacing(5);

  auto divider = new QFrame();
  divider->setFrameShape(QFrame::HLine);
  divider->setFrameShadow(QFrame::Sunken);
  mainVLayout->addWidget(divider);

  auto scrollAreaWidget = new QWidget();
  scrollAreaWidget->setContentsMargins(0,0,0,0);
  scrollAreaWidget->setObjectName("GrayWidget");

  auto scrollAreaLayout = new QVBoxLayout();
  scrollAreaLayout->setContentsMargins(0,0,0,0);
  scrollAreaLayout->setSpacing(0);
  scrollAreaLayout->setAlignment(Qt::AlignTop);

  scrollAreaWidget->setLayout(scrollAreaLayout);

  m_scrollArea = new QScrollArea();
  m_scrollArea->setFrameStyle(QFrame::NoFrame);
  m_scrollArea->setWidget(scrollAreaWidget);
  m_scrollArea->setWidgetResizable(true);
  m_scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);

  mainVLayout->addWidget(m_scrollArea,100);

  mainVLayout->addStretch();

  //newItem( ADDTOMODEL_SYSTEM_TYPE_1,
  //         QString("Packaged Terminal \nAir Conditioner"),
  //         QPixmap(":/images/system_type_1.png") );

  //newItem( ADDTOMODEL_SYSTEM_TYPE_2,
  //         QString("Packaged Terminal Heat Pump"),
  //         QPixmap(":/images/system_type_2.png") );

  newItem( ADDTOMODEL_SYSTEM_TYPE_3,
           QString("Packaged Rooftop Unit"),
           QPixmap(":/images/system_type_3.png") );

  newItem( ADDTOMODEL_SYSTEM_TYPE_4,
           QString("Packaged Rooftop Heat Pump"),
           QPixmap(":/images/system_type_4.png") );

  newItem( ADDTOMODEL_SYSTEM_TYPE_5,
           QString("Packaged DX Rooftop VAV \nwith Reheat"),
           QPixmap(":/images/system_type_5.png") );

  newItem( ADDTOMODEL_SYSTEM_TYPE_6,
           QString("Packaged Rooftop \nVAV with Parallel Fan \nPower Boxes and reheat"),
           QPixmap(":/images/system_type_6.png") );

  newItem( ADDTOMODEL_SYSTEM_TYPE_7,
           QString("Packaged Rooftop \nVAV with Reheat"),
           QPixmap(":/images/system_type_7.png") );

  newItem( ADDTOMODEL_SYSTEM_TYPE_8,
           QString("VAV with Parallel Fan-Powered \nBoxes and Reheat"),
           QPixmap(":/images/system_type_8.png") );

  newItem( ADDTOMODEL_SYSTEM_TYPE_9,
           QString("Warm Air Furnace \nGas Fired"),
           QPixmap(":/images/system_type_9.png") );

  newItem( ADDTOMODEL_SYSTEM_TYPE_10,
           QString("Warm Air Furnace \nElectric"),
           QPixmap(":/images/system_type_10.png") );

  newItem( ADDTOMODEL_AIRLOOPHVAC,
           QString("Empty Air Loop"),
           QPixmap(":/images/air_loop_icon.png") );

  newItem( ADDTOMODEL_DUAL_AIRLOOPHVAC,
           QString("Dual Duct Air Loop"),
           QPixmap(":/images/air_loop_icon.png") );

  newItem( ADDTOMODEL_PLANTLOOP,
           QString("Empty Plant Loop"),
           QPixmap(":/images/plant_loop_icon.png") );
}
示例#26
0
BreakpointDialog::BreakpointDialog(Breakpoint b, QWidget *parent)
    : QDialog(parent), m_enabledParts(~0), m_previousType(UnknownBreakpointType),
      m_firstTypeChange(true)
{
    setWindowTitle(tr("Edit Breakpoint Properties"));

    auto groupBoxBasic = new QGroupBox(tr("Basic"), this);

    // Match BreakpointType (omitting unknown type).
    QStringList types;
    types << tr("File name and line number")
          << tr("Function name")
          << tr("Break on memory address")
          << tr("Break when C++ exception is thrown")
          << tr("Break when C++ exception is caught")
          << tr("Break when function \"main\" starts")
          << tr("Break when a new process is forked")
          << tr("Break when a new process is executed")
          << tr("Break when a system call is executed")
          << tr("Break on data access at fixed address")
          << tr("Break on data access at address given by expression")
          << tr("Break on QML signal emit")
          << tr("Break when JavaScript exception is thrown");
    // We don't list UnknownBreakpointType, so 1 less:
    QTC_CHECK(types.size() + 1 == LastBreakpointType);
    m_comboBoxType = new QComboBox(groupBoxBasic);
    m_comboBoxType->setMaxVisibleItems(20);
    m_comboBoxType->addItems(types);
    m_labelType = new QLabel(tr("Breakpoint &type:"), groupBoxBasic);
    m_labelType->setBuddy(m_comboBoxType);

    m_pathChooserFileName = new Utils::PathChooser(groupBoxBasic);
    m_pathChooserFileName->setHistoryCompleter(QLatin1String("Debugger.Breakpoint.File.History"));
    m_pathChooserFileName->setExpectedKind(Utils::PathChooser::File);
    m_labelFileName = new QLabel(tr("&File name:"), groupBoxBasic);
    m_labelFileName->setBuddy(m_pathChooserFileName);

    m_lineEditLineNumber = new QLineEdit(groupBoxBasic);
    m_labelLineNumber = new QLabel(tr("&Line number:"), groupBoxBasic);
    m_labelLineNumber->setBuddy(m_lineEditLineNumber);

    m_checkBoxEnabled = new QCheckBox(groupBoxBasic);
    m_labelEnabled = new QLabel(tr("&Enabled:"), groupBoxBasic);
    m_labelEnabled->setBuddy(m_checkBoxEnabled);

    m_lineEditAddress = new QLineEdit(groupBoxBasic);
    m_labelAddress = new QLabel(tr("&Address:"), groupBoxBasic);
    m_labelAddress->setBuddy(m_lineEditAddress);

    m_lineEditExpression = new QLineEdit(groupBoxBasic);
    m_labelExpression = new QLabel(tr("&Expression:"), groupBoxBasic);
    m_labelExpression->setBuddy(m_lineEditExpression);

    m_lineEditFunction = new QLineEdit(groupBoxBasic);
    m_labelFunction = new QLabel(tr("Fun&ction:"), groupBoxBasic);
    m_labelFunction->setBuddy(m_lineEditFunction);

    auto groupBoxAdvanced = new QGroupBox(tr("Advanced"), this);

    m_checkBoxTracepoint = new QCheckBox(groupBoxAdvanced);
    m_labelTracepoint = new QLabel(tr("T&racepoint only:"), groupBoxAdvanced);
    m_labelTracepoint->setBuddy(m_checkBoxTracepoint);

    m_checkBoxOneShot = new QCheckBox(groupBoxAdvanced);
    m_labelOneShot = new QLabel(tr("&One shot only:"), groupBoxAdvanced);
    m_labelOneShot->setBuddy(m_checkBoxOneShot);

    const QString pathToolTip =
        tr("<p>Determines how the path is specified "
                "when setting breakpoints:</p><ul>"
           "<li><i>Use Engine Default</i>: Preferred setting of the "
                "debugger engine.</li>"
           "<li><i>Use Full Path</i>: Pass full path, avoiding ambiguities "
                "should files of the same name exist in several modules. "
                "This is the engine default for CDB and LLDB.</li>"
           "<li><i>Use File Name</i>: Pass the file name only. This is "
                "useful when using a source tree whose location does "
                "not match the one used when building the modules. "
                "It is the engine default for GDB as using full paths can "
                "be slow with this engine.</li></ul>");
    m_comboBoxPathUsage = new QComboBox(groupBoxAdvanced);
    m_comboBoxPathUsage->addItem(tr("Use Engine Default"));
    m_comboBoxPathUsage->addItem(tr("Use Full Path"));
    m_comboBoxPathUsage->addItem(tr("Use File Name"));
    m_comboBoxPathUsage->setToolTip(pathToolTip);
    m_labelUseFullPath = new QLabel(tr("Pat&h:"), groupBoxAdvanced);
    m_labelUseFullPath->setBuddy(m_comboBoxPathUsage);
    m_labelUseFullPath->setToolTip(pathToolTip);

    const QString moduleToolTip =
        tr("<p>Specifying the module (base name of the library or executable) "
           "for function or file type breakpoints can significantly speed up "
           "debugger start-up times (CDB, LLDB).");
    m_lineEditModule = new QLineEdit(groupBoxAdvanced);
    m_lineEditModule->setToolTip(moduleToolTip);
    m_labelModule = new QLabel(tr("&Module:"), groupBoxAdvanced);
    m_labelModule->setBuddy(m_lineEditModule);
    m_labelModule->setToolTip(moduleToolTip);

    const QString commandsToolTip =
        tr("<p>Debugger commands to be executed when the breakpoint is hit. "
           "This feature is only available for GDB.");
    m_textEditCommands = new SmallTextEdit(groupBoxAdvanced);
    m_textEditCommands->setToolTip(commandsToolTip);
    m_labelCommands = new QLabel(tr("&Commands:"), groupBoxAdvanced);
    m_labelCommands->setBuddy(m_textEditCommands);
    m_labelCommands->setToolTip(commandsToolTip);

    m_lineEditMessage = new QLineEdit(groupBoxAdvanced);
    m_labelMessage = new QLabel(tr("&Message:"), groupBoxAdvanced);
    m_labelMessage->setBuddy(m_lineEditMessage);

    m_lineEditCondition = new QLineEdit(groupBoxAdvanced);
    m_labelCondition = new QLabel(tr("C&ondition:"), groupBoxAdvanced);
    m_labelCondition->setBuddy(m_lineEditCondition);

    m_spinBoxIgnoreCount = new QSpinBox(groupBoxAdvanced);
    m_spinBoxIgnoreCount->setMinimum(0);
    m_spinBoxIgnoreCount->setMaximum(2147483647);
    m_labelIgnoreCount = new QLabel(tr("&Ignore count:"), groupBoxAdvanced);
    m_labelIgnoreCount->setBuddy(m_spinBoxIgnoreCount);

    m_lineEditThreadSpec = new QLineEdit(groupBoxAdvanced);
    m_labelThreadSpec = new QLabel(tr("&Thread specification:"), groupBoxAdvanced);
    m_labelThreadSpec->setBuddy(m_lineEditThreadSpec);

    m_buttonBox = new QDialogButtonBox(this);
    m_buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);

    if (b) {
        if (DebuggerEngine *engine = b.engine()) {
            if (!engine->hasCapability(BreakConditionCapability))
                m_enabledParts &= ~ConditionPart;
            if (!engine->hasCapability(BreakModuleCapability))
                m_enabledParts &= ~ModulePart;
            if (!engine->hasCapability(TracePointCapability))
                m_enabledParts &= ~TracePointPart;
        }
    }

    auto basicLayout = new QFormLayout(groupBoxBasic);
    basicLayout->addRow(m_labelType, m_comboBoxType);
    basicLayout->addRow(m_labelFileName, m_pathChooserFileName);
    basicLayout->addRow(m_labelLineNumber, m_lineEditLineNumber);
    basicLayout->addRow(m_labelEnabled, m_checkBoxEnabled);
    basicLayout->addRow(m_labelAddress, m_lineEditAddress);
    basicLayout->addRow(m_labelExpression, m_lineEditExpression);
    basicLayout->addRow(m_labelFunction, m_lineEditFunction);
    basicLayout->addRow(m_labelOneShot, m_checkBoxOneShot);

    auto advancedLeftLayout = new QFormLayout();
    advancedLeftLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
    advancedLeftLayout->addRow(m_labelCondition, m_lineEditCondition);
    advancedLeftLayout->addRow(m_labelIgnoreCount, m_spinBoxIgnoreCount);
    advancedLeftLayout->addRow(m_labelThreadSpec, m_lineEditThreadSpec);
    advancedLeftLayout->addRow(m_labelUseFullPath, m_comboBoxPathUsage);
    advancedLeftLayout->addRow(m_labelModule, m_lineEditModule);

    auto advancedRightLayout = new QFormLayout();
    advancedRightLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
    advancedRightLayout->addRow(m_labelCommands, m_textEditCommands);
    advancedRightLayout->addRow(m_labelTracepoint, m_checkBoxTracepoint);
    advancedRightLayout->addRow(m_labelMessage, m_lineEditMessage);

    auto horizontalLayout = new QHBoxLayout(groupBoxAdvanced);
    horizontalLayout->addLayout(advancedLeftLayout);
    horizontalLayout->addSpacing(15);
    horizontalLayout->addLayout(advancedRightLayout);

    auto verticalLayout = new QVBoxLayout(this);
    verticalLayout->addWidget(groupBoxBasic);
    verticalLayout->addSpacing(10);
    verticalLayout->addWidget(groupBoxAdvanced);
    verticalLayout->addSpacing(10);
    verticalLayout->addWidget(m_buttonBox);
    verticalLayout->setStretchFactor(groupBoxAdvanced, 10);

    connect(m_comboBoxType, static_cast<void(QComboBox::*)(int)>(&QComboBox::activated),
            this, &BreakpointDialog::typeChanged);
    connect(m_buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
    connect(m_buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
}
示例#27
0
Expander::Expander(Kite::KComponent *Comp, QTreeWidget *Parent):
	QObject(Parent), expandable(true)
{
	chandle = Comp->getHandle();
	ctype = Comp->getType();
	QString name = Comp->getTypeName().c_str();
	if (ctype == Kite::CTypes::Logic) {
		name.append(" ");
		name.append(Comp->getName().c_str());
	}

	head = new QTreeWidgetItem(Parent);
	head->setFlags(head->flags() ^ Qt::ItemIsDropEnabled);
	head->setChildIndicatorPolicy(QTreeWidgetItem::ShowIndicator);
	head->setText(0, name);
	head->setHidden(true);

	auto headFrame = new QFrame(Parent);
	auto headLayout = new QVBoxLayout(headFrame);
	headLayout->setMargin(0);
	headLayout->addSpacing(3);

	btnExpand = new QPushButton(Parent);
	btnExpand->setObjectName("btnExpand");
	btnExpand->setIcon(QIcon(":/icons/exp"));
	btnExpand->setText(name);
	btnExpand->setFocusPolicy(Qt::NoFocus);
	btnExpand->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
	btnExpand->setStyleSheet("QPushButton { text-align: left;"
							 "color: rgb(255, 255, 255);"
							 "background-color: rgb(38, 38, 38);"
							 "border: 1px solid rgb(38, 38, 38);"
							 "border-radius: 3px;}");
	headLayout->addWidget(btnExpand);

	auto hlayout = new QHBoxLayout(btnExpand);
	hlayout->setMargin(0);
	hlayout->setSpacing(0);
	hlayout->addStretch(1);

	// dependecy label
	if (!Comp->getDependency().empty()) {
		auto lblDep = new QLabel(btnExpand);
		lblDep->setText("<img src=\":/icons/depend\" height=\"16\" width=\"16\" >");
		lblDep->setStyleSheet("QToolTip { border: 1px solid #2c2c2c; background-color: #242424; color: white;}");
		QString tooltip("<font color=\"orange\">Dependency List:</font>");
		auto depList = Comp->getDependency();
		for (auto it = depList.begin(); it != depList.end(); ++it) {
			tooltip += "\n" + QString(Kite::getCTypesName((*it)).c_str());
		}
		lblDep->setToolTip(tooltip);
		hlayout->addWidget(lblDep);
		hlayout->addSpacing(2);
	}

	// remove on zero dependency label
	if (Comp->getRemoveOnZeroDep()) {
		auto lblZeroDep = new QLabel(btnExpand);
		lblZeroDep->setText("<img src=\":/icons/remzdep\" height=\"16\" width=\"16\" >");
		lblZeroDep->setStyleSheet("QToolTip { border: 1px solid #2c2c2c; background-color: #242424; color: white;}");
		lblZeroDep->setToolTip("Will be removed automatically if there is no dependence on it");
		hlayout->addWidget(lblZeroDep);
		hlayout->addSpacing(2);
	}

	// remove button
	auto btnClose = new QToolButton(btnExpand);
	btnClose->setContentsMargins(0, 0, 0, 0); 
	btnClose->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
	btnClose->setIcon(QIcon(":/icons/close"));
	btnClose->setIconSize(QSize(8, 8));
	btnClose->setToolButtonStyle(Qt::ToolButtonIconOnly);
	btnClose->setAutoRaise(true);
	btnClose->setStyleSheet("QToolTip { border: 1px solid #2c2c2c; background-color: #242424; color: white;}");
	btnClose->setToolTip("Remove Component");
	hlayout->addWidget(btnClose);

	Parent->setItemWidget(head, 0, headFrame);

	content = new ComponentView(Comp, Parent);
	content->setStyleSheet("QFrame {background-color: rgb(58, 58, 58);\n"
						   "border: 1px solid rgb(58, 58, 58);\n"
						   "border-bottom-left-radius: 3px;\n"
						   "border-bottom-right-radius: 3px;}");
	connect(content, &ComponentView::updateResList, this, &Expander::updateResList);
	connect(content, &ComponentView::componentEdited, this, &Expander::componentEdited);
	connect(content, &ComponentView::requestRes, this, &Expander::requestRes);
	connect(content, &ComponentView::requestPropValue, this, &Expander::requestPropValue);
	
	auto child = new QTreeWidgetItem(head);
	child->setDisabled(true);
	Parent->setItemWidget(child, 0, content);

	connect(btnExpand, &QPushButton::pressed, this, &Expander::expClicked);
	connect(btnClose, &QToolButton::clicked, this, &Expander::clsClicked);
}