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


C++ pal函数代码示例

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


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


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