本文整理汇总了C++中Q3GroupBox::setWhatsThis方法的典型用法代码示例。如果您正苦于以下问题:C++ Q3GroupBox::setWhatsThis方法的具体用法?C++ Q3GroupBox::setWhatsThis怎么用?C++ Q3GroupBox::setWhatsThis使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Q3GroupBox
的用法示例。
在下文中一共展示了Q3GroupBox::setWhatsThis方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: appendWidget
void GPConfigDlg::appendWidget(QWidget* parent, CameraWidget* widget)
{
QWidget* newParent = parent;
CameraWidgetType widget_type;
const char* widget_name;
const char* widget_info;
const char* widget_label;
float widget_value_float;
int widget_value_int;
const char* widget_value_string;
gp_widget_get_type(widget, &widget_type);
gp_widget_get_label(widget, &widget_label);
gp_widget_get_info(widget, &widget_info);
gp_widget_get_name(widget, &widget_name);
// gphoto2 doesn't seem to have any standard for i18n
QString whats_this = QString::fromLocal8Bit(widget_info);
// Add this widget to parent
switch (widget_type)
{
case GP_WIDGET_WINDOW:
{
setCaption(widget_label);
break;
}
case GP_WIDGET_SECTION:
{
if (!d->tabWidget)
{
d->tabWidget = new QTabWidget(parent);
parent->layout()->addWidget(d->tabWidget);
}
QWidget* tab = new QWidget(d->tabWidget);
// widgets are to be aligned vertically in the tab
QVBoxLayout* tabLayout = new QVBoxLayout(tab, marginHint(),
spacingHint());
d->tabWidget->insertTab(tab, widget_label);
KVBox* tabContainer = new KVBox(tab);
tabContainer->setSpacing(spacingHint());
tabLayout->addWidget(tabContainer);
newParent = tabContainer;
tabLayout->addStretch();
break;
}
case GP_WIDGET_TEXT:
{
gp_widget_get_value(widget, &widget_value_string);
Q3Grid* grid = new Q3Grid(2, Qt::Horizontal, parent);
parent->layout()->addWidget(grid);
grid->setSpacing(spacingHint());
new QLabel(QString::fromLocal8Bit(widget_label) + ':', grid);
QLineEdit* lineEdit = new QLineEdit(widget_value_string, grid);
d->wmap.insert(widget, lineEdit);
if (!whats_this.isEmpty())
{
grid->setWhatsThis(whats_this);
}
break;
}
case GP_WIDGET_RANGE:
{
float widget_low;
float widget_high;
float widget_increment;
gp_widget_get_range(widget, &widget_low, &widget_high, &widget_increment);
gp_widget_get_value(widget, &widget_value_float);
Q3GroupBox* groupBox = new Q3GroupBox(1, Qt::Horizontal, widget_label, parent);
parent->layout()->addWidget(groupBox);
QSlider* slider = new QSlider(
(int)widget_low,
(int)widget_high,
(int)widget_increment,
(int)widget_value_float,
Qt::Horizontal,
groupBox);
d->wmap.insert(widget, slider);
if (!whats_this.isEmpty())
{
groupBox->setWhatsThis(whats_this);
}
break;
}
case GP_WIDGET_TOGGLE:
{
//.........这里部分代码省略.........