作者的网站在这里
main.cpp使用Demo演示:
/*
* Copyright (C) 2008/07/02 Florian Becker <[email]fb@pyades.com[/email]>
*
* The ownership of this document rests with the Pyades Technologies GmbH.
* It is strictly prohibited to change, sell or publish it in any way. In
* case you have access to this document, you are obligated to ensure its
* nondisclosure. Noncompliances will be prosecuted.
*
* Diese Datei ist Eigentum der Pyades Technologies GmbH. Ändern, verkaufen
* oder auf eine andere Weise verbreiten und Öffentlich machen ist strikt
* untersagt. Falls Sie Zugang zu dieser Datei haben, sind Sie verpflichtet
* alles Mögliche für deren Geheimhaltung zu tun. Zuwiderhandlungen werden
* strafrechtlich verfolgt.
*/
/* qt header */
#include <QApplication>
#include <QVBoxLayout>
/* local header */
#include
"QColorButton.h"
int main(
int argc,
char **argv ) {
QApplication app( argc, argv );
QWidget *widget =
new QWidget;
widget -> setWindowTitle(
"QColorButton Demo - pyades.com" );
//设置标题文本
QVBoxLayout *baseWidgetLayout =
new QVBoxLayout( widget );
//新建3个QColorButton的对象
QColorButton *btn1 =
new QColorButton( widget );
baseWidgetLayout -> addWidget( btn1 );
QColorButton *btn2 =
new QColorButton( widget );
btn2 -> setText(
"Color Button" );
//设置文本
btn2 -> enableColorText(
false);
//是否开启颜色值用作Button文本
baseWidgetLayout -> addWidget( btn2 );
QColorButton *btn3 =
new QColorButton( widget );
btn3 -> setText(
"Color Button Without ToolTip" );
btn3 -> enableColorText(
false );
btn3 -> enableToolTip(
false );
//是否开启ToolTip提示
baseWidgetLayout -> addWidget( btn3 );
widget -> show();
return app.exec();
}
截图:
本文转自 xcf007 51CTO博客,原文链接: 本文转自 xcf007 51CTO博客,原文链接:,如需转载请自行联系原作者
,如需转载请自行联系原作者