本文整理汇总了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();
}
示例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");
}
示例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;
}
示例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();
}
}
}
示例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;
}