• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ pal函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中pal函数的典型用法代码示例。如果您正苦于以下问题:C++ pal函数的具体用法?C++ pal怎么用?C++ pal使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: pal

void tst_QGLRender::values()
{
    QGLSceneNode node;   // by default has QGL::FlatColor
    QGLSceneNode node2;
    QSharedPointer<QGLMaterialCollection> pal(new QGLMaterialCollection());
    node.setPalette(pal);
    node2.setPalette(pal);
    node2.setEffect(QGL::LitMaterial);

    QGLRenderState s;
    QGLRenderOrder order(&node, s);
    QGLRenderOrder other(&node2, s);
    QGLRenderOrderComparator cmp;
    QVERIFY(!cmp.isEqualTo(other, order));
    QVERIFY(cmp.isLessThan(order, other));

    QGLRenderState state;
    QGLMaterial *mat = new QGLMaterial;
    mat->setAmbientColor(Qt::blue);
    int ix = pal->addMaterial(mat);
    QGLSceneNode node3;
    node3.setPalette(pal);
    node3.setMaterialIndex(ix);
    node3.setEffect(QGL::LitMaterial);
    state.updateFrom(&node3);
    QGLRenderOrder other2(&node, state);
    QVERIFY(other2.effectiveHasEffect());
    QCOMPARE(other2.effectiveMaterial(), mat);
    QCOMPARE(other2.effectiveStandardEffect(), QGL::LitMaterial);
    QCOMPARE(other2.effectiveUserEffect(), (QGLAbstractEffect*)0);
    QVERIFY(cmp.isLessThan(order, other2));
    QVERIFY(cmp.isLessThan(other, other2));
}
开发者ID:Distrotech,项目名称:qt3d,代码行数:33,代码来源:tst_qglrender.cpp


示例2: p

void KexiDBLabel::paintEvent(QPaintEvent* e)
{
    QPainter p(this);
    KexiDBTextWidgetInterface::paint(this, &p, text().isEmpty(), alignment(), false);
    p.end();

    QPalette origPal;
    if (editingMode()) {
        origPal = palette();
        QPalette pal(palette());
        pal.setBrush(QPalette::WindowText, Qt::transparent);
        setPalette(pal);
    }
    QLabel::paintEvent(e);
    if (editingMode()) {
        setPalette(origPal);
    }

    const bool hasFrame = frameWidth() >= 1 && frameShape() != QFrame::NoFrame;
    if (designMode() && !hasFrame) {
        p.begin(this);
        KFormDesigner::paintWidgetFrame(p, rect());
        p.end();
    }
}
开发者ID:TheTypoMaster,项目名称:calligra,代码行数:25,代码来源:kexidblabel.cpp


示例3: pal

void ToyPedalWidget::SetTextColor(const QColor &textColor)
{
	ToyWidget::SetTextColor(textColor);
	QPalette pal( m_Widget->palette() );
	pal.setColor(QPalette::ButtonText, m_TextColor);
	m_Widget->setPalette(pal);
}
开发者ID:richardwilliamson,项目名称:OSCWidgets,代码行数:7,代码来源:ToyPedal.cpp


示例4: GTK_COLOR_SELECTION

void wxColourDialog::ColourDataToDialog()
{
    GtkColorSelection* sel = GTK_COLOR_SELECTION(
        gtk_color_selection_dialog_get_color_selection(
        GTK_COLOR_SELECTION_DIALOG(m_widget)));

    const wxColour& color = m_data.GetColour();
    if (color.IsOk())
    {
#ifdef __WXGTK3__
        gtk_color_selection_set_current_rgba(sel, color);
#else
        gtk_color_selection_set_current_color(sel, color.GetColor());
#endif
    }

    // setup the palette:

    GdkColor colors[wxColourData::NUM_CUSTOM];
    gint n_colors = 0;
    for (unsigned i = 0; i < WXSIZEOF(colors); i++)
    {
        wxColour c = m_data.GetCustomColour(i);
        if (c.IsOk())
        {
            colors[n_colors] = *c.GetColor();
            n_colors++;
        }
    }

    wxGtkString pal(gtk_color_selection_palette_to_string(colors, n_colors));

    GtkSettings *settings = gtk_widget_get_settings(GTK_WIDGET(sel));
    g_object_set(settings, "gtk-color-palette", pal.c_str(), NULL);
}
开发者ID:Asmodean-,项目名称:Ishiiruka,代码行数:35,代码来源:colordlg.cpp


示例5: main

int main()
{
	char s[100001];
	scanf("%s",s);
	pal(s);
	return 0;
}
开发者ID:PronabM,项目名称:Hackerrank_solutions,代码行数:7,代码来源:game_of_thrones.c


示例6: drawColor

void drawColor(QPainter *p, int x, int y, int r, QColor* c)
{
    QColor w("white");
    QPalette pal(*c);

    QPen oldPen = p->pen();
    QBrush oldBrush = p->brush();

    p->setBrush(pal.color( QPalette::Active, QPalette::Dark ));
    p->setPen(pal.color( QPalette::Active, QPalette::Dark ));
    p->drawEllipse( x-r - 10,y-r +5, 2*r,2*r);

    p->setBrush(pal.color( QPalette::Active, QPalette::Mid ));
    p->setPen(pal.color( QPalette::Active, QPalette::Mid ));
    p->drawEllipse( x-r,y-r, 2*r,2*r);

    p->setBrush(pal.color( QPalette::Active, QPalette::Light ));
    p->setPen(pal.color( QPalette::Active, QPalette::Light ));
    p->drawEllipse( x-r/3, y-r/3, 4*r/3,4*r/3);

    p->setBrush(w);
    p->setPen(w);
    p->drawEllipse( x+r/3, y+r/3, r/3,r/3);

    p->setPen(oldPen);
    p->setBrush(oldBrush);
}
开发者ID:weidendo,项目名称:qenolaba,代码行数:27,代码来源:BoardWidget.cpp


示例7: pal

void KexiRelationViewTableContainerHeader::unsetFocus()
{
    QPalette pal(palette());
    pal.setColor(QPalette::Window, m_inactiveBG);
    pal.setColor(QPalette::WindowText, m_inactiveFG);
    setPalette(pal);
}
开发者ID:abhishekmurthy,项目名称:Calligra,代码行数:7,代码来源:KexiRelationsTableContainer_p.cpp


示例8: main

int main()
{
	while ( gets(input) )
	{
		printf("%s", input);
		if ( pal() && mir() )
			puts(" -- is a mirrored palindrome.\n");
		else if ( pal() )
			puts(" -- is a regular palindrome.\n");
		else if ( mir() )
			puts(" -- is a mirrored string.\n");
		else
			puts(" -- is not a palindrome.\n");
	}
	
	return 0;
}
开发者ID:lopesivan,项目名称:snippets,代码行数:17,代码来源:uva401.c


示例9: main

void main()
{
	char s[100];

	scanf("%s",s);

	printf("%d \n",pal(s));
}
开发者ID:ragunath3252,项目名称:miscellaneous,代码行数:8,代码来源:palindrome_insertion.c


示例10: pal

char pal(int a, int b){
	if(a > b) return 1;
		if(matrix[a][b] == -1){
			if(str[a] == str[b] && pal(a+1, b-1)) return (matrix[a][b] = 1);
				return (matrix[a][b] = 0);
	}
return matrix[a][b];
}
开发者ID:welbert,项目名称:Lab2,代码行数:8,代码来源:palindrome.c


示例11: pal

void ToyLabelWidget::SetColor(const QColor &color)
{
	ToyWidget::SetColor(color);
	
	QPalette pal( m_Widget->palette() );
	pal.setColor(QPalette::Window, m_Color);
	m_Widget->setPalette(pal);
}
开发者ID:zoombapup,项目名称:OSCWidgets,代码行数:8,代码来源:ToyLabel.cpp


示例12: QScrollArea

KexiDBSubForm::KexiDBSubForm(KFormDesigner::Form *parentForm, QWidget *parent)
        : QScrollArea(parent), m_parentForm(parentForm), m_form(0), m_widget(0)
{
    setFrameStyle(QFrame::WinPanel | QFrame::Sunken);
    QPalette pal(viewport()->palette());
    pal.setBrush(viewport()->backgroundRole(), pal.brush(QPalette::Mid));
    viewport()->setPalette(pal);
}
开发者ID:woylaski,项目名称:kexi,代码行数:8,代码来源:kexidbsubform.cpp


示例13: main

void main(){
	char a[100];
	printf("enter the string:");
	gets(a);
	pal(a);
	getch();
	

}
开发者ID:BDKPrakashReddy,项目名称:mrnd2016,代码行数:9,代码来源:Is_palindrome.c


示例14: pal

void MainWindowEx::resizeEvent(QResizeEvent *event)
{
    if( m_backgroundCover.isNull() ) return;

    QPixmap temp = m_backgroundCover.copy(m_backgroundCover.rect());
    QPalette pal(palette());
    pal.setBrush(QPalette::Window,QBrush(temp.scaled(event->size())));
    setPalette(pal);
}
开发者ID:newdebug,项目名称:NewDebug,代码行数:9,代码来源:MainWindowEx.cpp


示例15: pal

void CameraView::initView(QWidget *view)
{
    QPalette pal(palette());
    pal.setColor(QPalette::Background, Qt::black);
    view->setAutoFillBackground(true);
    view->setMinimumSize(400, 400);
    view->setPalette(pal);
    view->show();
}
开发者ID:gunnasko,项目名称:QtCameraControl,代码行数:9,代码来源:cameraview.cpp


示例16: HILDON_COLOR_SELECTOR

void wxColourDialog::ColourDataToDialog()
{
#if wxUSE_LIBHILDON || wxUSE_LIBHILDON2
    const GdkColor * const
        col = m_data.GetColour().IsOk() ? m_data.GetColour().GetColor()
                                      : NULL;
#endif
#if wxUSE_LIBHILDON
    HildonColorSelector * const sel = HILDON_COLOR_SELECTOR(m_widget);
    hildon_color_selector_set_color(sel, const_cast<GdkColor *>(col));
#elif wxUSE_LIBHILDON2
    GdkColor clr;
    if (col)
        clr = *col;
    else {
        clr.pixel = 0;
        clr.red = 32768;
        clr.green = 32768;
        clr.blue = 32768;
    }

    hildon_color_chooser_dialog_set_color((HildonColorChooserDialog *)m_widget, &clr);
#else // !wxUSE_LIBHILDON2/!wxUSE_LIBHILDON && !wxUSE_LIBHILDON2
    GtkColorSelection* sel = GTK_COLOR_SELECTION(
        gtk_color_selection_dialog_get_color_selection(
        GTK_COLOR_SELECTION_DIALOG(m_widget)));

    const wxColour& c = m_data.GetColour();
    if (c.IsOk())
    {
#ifdef __WXGTK3__
        gtk_color_selection_set_current_rgba(sel, c);
#else
        gtk_color_selection_set_current_color(sel, c.GetColor());
#endif
    }

    // setup the palette:

    GdkColor colors[wxColourData::NUM_CUSTOM];
    gint n_colors = 0;
    for (unsigned i = 0; i < WXSIZEOF(colors); i++)
    {
        wxColour c = m_data.GetCustomColour(i);
        if (c.IsOk())
        {
            colors[n_colors] = *c.GetColor();
            n_colors++;
        }
    }

    wxGtkString pal(gtk_color_selection_palette_to_string(colors, n_colors));

    GtkSettings *settings = gtk_widget_get_settings(GTK_WIDGET(sel));
    g_object_set(settings, "gtk-color-palette", pal.c_str(), NULL);
#endif // wxUSE_LIBHILDON / wxUSE_LIBHILDON2 /!wxUSE_LIBHILDON && !wxUSE_LIBHILDON2
}
开发者ID:iokto,项目名称:newton-dynamics,代码行数:57,代码来源:colordlg.cpp


示例17: QWidget

AdvancedPanel::AdvancedPanel(QWidget *parent)
	: QWidget(parent, Qt::Tool)
{
	setWindowTitle( tr("Advanced Options") );

	QGridLayout *layout = new QGridLayout(this);

	int row = 0;
	m_EncoderDegreesPerTick = new QLineEdit(this);
	layout->addWidget(new QLabel(tr("Encoder degrees per tick"),this), row, 0);
	layout->addWidget(m_EncoderDegreesPerTick, row, 1);

	++row;
	m_FeedbackDelay = new QLineEdit(this);
	layout->addWidget(new QLabel(tr("Fader Feedback Delay (ms)"),this), row, 0);
	layout->addWidget(m_FeedbackDelay, row, 1);

	++row;
	m_CmdSendAllDelay = new QLineEdit(this);
	layout->addWidget(new QLabel(tr("Command Send All Delay (ms)"),this), row, 0);
	layout->addWidget(m_CmdSendAllDelay, row, 1);

	++row;
	m_MetroRefreshRate = new QLineEdit(this);
	layout->addWidget(new QLabel(tr("Metronome Refresh Rate (ms)"),this), row, 0);
	layout->addWidget(m_MetroRefreshRate, row, 1);

	++row;
	m_SineRefreshRate = new QLineEdit(this);
	layout->addWidget(new QLabel(tr("Sine Wave Refresh Rate (ms)"),this), row, 0);
	layout->addWidget(m_SineRefreshRate, row, 1);

	++row;
	m_PedalRefreshRate = new QLineEdit(this);
	layout->addWidget(new QLabel(tr("Pedal Refresh Rate (ms)"),this), row, 0);
	layout->addWidget(m_PedalRefreshRate, row, 1);
	
	++row;
	m_FlickerRefreshRate = new QLineEdit(this);
	layout->addWidget(new QLabel(tr("Flicker Refresh Rate (ms)"),this), row, 0);
	layout->addWidget(m_FlickerRefreshRate, row, 1);

	++row;
	QPushButton *button = new QPushButton(tr("Restore Defaults"), this);
	QPalette pal( button->palette() );
	pal.setColor(QPalette::Button, ERROR_COLOR);
	button->setPalette(pal);
	connect(button, SIGNAL(clicked(bool)), this, SLOT(onRestoreDefaultsClicked(bool)));
	layout->addWidget(button, row, 0);

	button = new QPushButton(tr("Apply"), this);
	connect(button, SIGNAL(clicked(bool)), this, SLOT(onApplyClicked(bool)));
	layout->addWidget(button, row, 1);

	Load();
}
开发者ID:ElectronicTheatreControlsLabs,项目名称:OSCWidgets,代码行数:56,代码来源:SettingsPanel.cpp


示例18: pal

void CTAPalette::Init(void)
{
	CFileHandler pal("PALETTE.PAL");

	if(!pal.FileExists()){

	}
	for(int c=0;c<256;c++){
		for(int c2=0;c2<4;c2++){
			pal.Read(&p[c][c2],1);
		}
		p[c][3]=255;
	}
	for(int a=0;a<10;++a)
		teamColor[a][3]=255;

	teamColor[0][0]=90;
	teamColor[0][1]=90;
	teamColor[0][2]=255;

	teamColor[1][0]=255;
	teamColor[1][1]=80;
	teamColor[1][2]=80;

	teamColor[2][0]=255;
	teamColor[2][1]=255;
	teamColor[2][2]=255;

	teamColor[3][0]=70;
	teamColor[3][1]=220;
	teamColor[3][2]=70;

	teamColor[4][0]=10;
	teamColor[4][1]=10;
	teamColor[4][2]=220;

	teamColor[5][0]=150;
	teamColor[5][1]=10;
	teamColor[5][2]=180;

	teamColor[6][0]=255;
	teamColor[6][1]=255;
	teamColor[6][2]=0;

	teamColor[7][0]=60;
	teamColor[7][1]=60;
	teamColor[7][2]=60;

	teamColor[8][0]=140;
	teamColor[8][1]=190;
	teamColor[8][2]=255;

	teamColor[9][0]=160;
	teamColor[9][1]=160;
	teamColor[9][2]=145;
}
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:56,代码来源:TAPalette.cpp


示例19: pal

void CTAPalette::Init(void)
{
	CFileHandler pal("PALETTE.PAL");

	if (pal.FileExists()) {
		for(int c=0;c<256;c++){
			for(int c2=0;c2<4;c2++){
				pal.Read(&p[c][c2],1);
			}
			p[c][3]=255;
		}
	}

	for(int a=0;a<10;++a)
		teamColor[a][3]=255;

	teamColor[0][0]=90;  //blue 
	teamColor[0][1]=90; 
	teamColor[0][2]=255; 

	teamColor[1][0]=200; //red 
	teamColor[1][1]=0; 
	teamColor[1][2]=0; 

	teamColor[2][0]=255; //white 
	teamColor[2][1]=255; 
	teamColor[2][2]=255; 

	teamColor[3][0]=38; //green 
	teamColor[3][1]=155; 
	teamColor[3][2]=32; 

	teamColor[4][0]=7;  //blue 
	teamColor[4][1]=31; 
	teamColor[4][2]=125; 

	teamColor[5][0]=150; //purple 
	teamColor[5][1]=10; 
	teamColor[5][2]=180; 

	teamColor[6][0]=255; //yellow 
	teamColor[6][1]=255; 
	teamColor[6][2]=0; 

	teamColor[7][0]=50;  //black 
	teamColor[7][1]=50; 
	teamColor[7][2]=50; 

	teamColor[8][0]=152; // ltblue 
	teamColor[8][1]=200; 
	teamColor[8][2]=220; 

	teamColor[9][0]=171; //tan 
	teamColor[9][1]=171; 
	teamColor[9][2]=131;
}
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:56,代码来源:TAPalette.cpp


示例20: pal

void EditPanel::SetTextColor(const QColor &textColor)
{
	QPalette pal( m_TextColor->palette() );
	pal.setColor(QPalette::ButtonText, textColor);
	m_TextColor->setPalette(pal);
	
	pal = m_Color->palette();
	pal.setColor(QPalette::ButtonText, textColor);
	m_Color->setPalette(pal);
}
开发者ID:richardwilliamson,项目名称:OSCWidgets,代码行数:10,代码来源:EditPanel.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ palClearPad函数代码示例发布时间:2022-05-30
下一篇:
C++ pairmake函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap