当前位置: 首页>>代码示例>>C++>>正文


C++ QColorDialog::setOptions方法代码示例

本文整理汇总了C++中QColorDialog::setOptions方法的典型用法代码示例。如果您正苦于以下问题:C++ QColorDialog::setOptions方法的具体用法?C++ QColorDialog::setOptions怎么用?C++ QColorDialog::setOptions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QColorDialog的用法示例。


在下文中一共展示了QColorDialog::setOptions方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: slot_open_color_picker

void DisneyMaterialLayerUI::slot_open_color_picker(const QString& widget_name)
{
    IInputWidgetProxy* widget_proxy = m_widget_proxies.get(widget_name.toStdString());

    const string color_expression = widget_proxy->get();
    const QColor initial_color = ColorExpressionProxy::expression_to_qcolor(widget_proxy->get());

    QColorDialog* dialog = new QColorDialog(initial_color, m_content_widget);
    dialog->setWindowTitle("Pick Color");
    dialog->setOptions(QColorDialog::DontUseNativeDialog);

    ForwardColorChangedSignal* forward_signal =
        new ForwardColorChangedSignal(dialog, widget_name, initial_color);
    connect(
        dialog, SIGNAL(currentColorChanged(const QColor&)),
        forward_signal, SLOT(slot_color_changed(const QColor&)));
    connect(
        forward_signal, SIGNAL(signal_color_changed(const QString&, const QColor&)),
        SLOT(slot_color_changed(const QString&, const QColor&)));
    connect(
        dialog, SIGNAL(rejected()),
        forward_signal, SLOT(slot_color_reset()));
    connect(
        forward_signal, SIGNAL(signal_color_reset(const QString&, const QColor&)),
        SLOT(slot_color_changed(const QString&, const QColor&)));

    dialog->exec();
}
开发者ID:dcoeurjo,项目名称:appleseed,代码行数:28,代码来源:disneymateriallayerui.cpp

示例2: mouseDoubleClickEvent

void ColorWidget::mouseDoubleClickEvent( QMouseEvent * event)
{
//printf("ColorWidget::mouseDoubleClickEvent:\n");
   QColorDialog * dialog = new QColorDialog( clr->c, this);
   dialog->setModal( false);
   dialog->setOptions( QColorDialog::NoButtons);
   connect( dialog, SIGNAL( currentColorChanged( const QColor &)), this, SLOT( currentColorChanged( const QColor &)));
   connect( dialog, SIGNAL( finished(              int         )), this, SLOT( finished(              int         )));
   Watch::repaintStart();
   dialog->open();
//   dialog->open( this, "accepted");
}
开发者ID:CGRU,项目名称:cgru,代码行数:12,代码来源:colorwidget.cpp

示例3: getLiveColor

QColor QgsColorDialog::getLiveColor( const QColor &initialColor, QObject *updateObject, const char *updateSlot, QWidget *parent, const QString &title, const bool allowAlpha )
{
  QColor returnColor( initialColor );

  QSettings settings;

  //using native color dialogs?
  bool useNative = settings.value( QStringLiteral( "/qgis/native_color_dialogs" ), false ).toBool();
  if ( useNative )
  {
    QColorDialog* liveDialog = new QColorDialog( initialColor, parent );
    liveDialog->setWindowTitle( title.isEmpty() ? tr( "Select Color" ) : title );
    liveDialog->setOptions( allowAlpha ? QColorDialog::ShowAlphaChannel : ( QColorDialog::ColorDialogOption )0 );

    connect( liveDialog, SIGNAL( currentColorChanged( const QColor& ) ),
             updateObject, updateSlot );

    if ( liveDialog->exec() )
    {
      returnColor = liveDialog->currentColor();
    }
    delete liveDialog;
  }
  else
  {
    QgsColorDialog* liveDialog = new QgsColorDialog( parent, 0, initialColor );
    liveDialog->setWindowTitle( title.isEmpty() ? tr( "Select Color" ) : title );
    if ( !allowAlpha )
    {
      liveDialog->setAllowAlpha( false );
    }

    connect( liveDialog, SIGNAL( currentColorChanged( const QColor& ) ),
             updateObject, updateSlot );

    if ( liveDialog->exec() )
    {
      returnColor = liveDialog->color();
    }
    delete liveDialog;
  }

  return returnColor;
}
开发者ID:3liz,项目名称:Quantum-GIS,代码行数:44,代码来源:qgscolordialog.cpp

示例4: QColorDialog

void
PlanSimSubpanel::onToolColor()
{
    QTreeWidgetItem* item = right->ui->treeSimViews->currentItem();
    QString viewName = item->data(0, Qt::UserRole + 1).toString();
    QString portName = item->data(0, Qt::UserRole + 2).toString();
    if (portName == "") {
        return;
    } else {
        QColorDialog* colorDialog = new QColorDialog(left);
        colorDialog->setOptions(QColorDialog::DontUseNativeDialog);
        if (colorDialog->exec()) {
            portToPlot* p = getPortToPlot(viewName, portName);
            p->color = colorDialog->selectedColor();
            onTreeItemSelected();
            updateCustomPlot();
        }
    }
}
开发者ID:quesnel,项目名称:packages,代码行数:19,代码来源:PlanSimSubpanel.cpp

示例5: getLiveColor

QColor QgsColorDialog::getLiveColor( const QColor& initialColor, QObject* updateObject, const char* updateSlot,
                                     QWidget* parent,
                                     const QString& title,
                                     const QColorDialog::ColorDialogOptions& options )
{
  QColor returnColor( initialColor );
  QColorDialog* liveDialog = new QColorDialog( initialColor, parent );
  liveDialog->setWindowTitle( title.isEmpty() ? tr( "Select Color" ) : title );
  liveDialog->setOptions( options );

  connect( liveDialog, SIGNAL( currentColorChanged( const QColor& ) ),
           updateObject, updateSlot );

  if ( liveDialog->exec() )
  {
    returnColor = liveDialog->currentColor();
  }
  delete liveDialog;
  liveDialog = nullptr;

  return returnColor;
}
开发者ID:NyakudyaA,项目名称:QGIS,代码行数:22,代码来源:qgscolordialog.cpp


注:本文中的QColorDialog::setOptions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。