本文整理汇总了C++中QWidget::child方法的典型用法代码示例。如果您正苦于以下问题:C++ QWidget::child方法的具体用法?C++ QWidget::child怎么用?C++ QWidget::child使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QWidget
的用法示例。
在下文中一共展示了QWidget::child方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: showHelp
void QSAEditorBrowser::showHelp( const QString &str )
{
qFatal( "QSAEditorBrowser::showHelp( %s )", str.toLatin1().data() );
#if 0
if ( ( (QSAEditor*)curEditor)->isDebugging() ) {
QString s = str.simplified();
static QString legalChars = "abcdefghijklmnopqrstuvwxyzABSCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_";
while ( s.length() > 0 ) {
if ( legalChars.find( s[0] ) == -1 )
s.remove( 0, 1 );
else
break;
}
while ( s.length() > 0 ) {
if ( legalChars.find( s[ (int)s.length() - 1 ] ) == -1 )
s.remove( s.length() - 1, 1 );
else
break;
}
if ( s[ (int)s.length() - 1 ] == ';' )
s.remove( s.length() - 1, 1 );
QString type, val;
QSProject::ideQSAInterpreter()->debuggerEngine()->watch( s, type, val );
if ( !val.isEmpty() && !type.isEmpty() ) {
QWidget *w = curEditor->topLevelWidget();
QObject *o = w->child( "QSA_debugger_variableview", "QSAVariableView" );
if ( o )
( (QSAVariableView*)o )->addWatch( s );
}
} else {
}
#endif
}
示例2: debug
Vis::Selector*
Vis::Selector::instance()
{
QWidget *parent = reinterpret_cast<QWidget*>( pApp->playlistWindow() );
QObject *o = parent->child( "Vis::Selector::instance" );
debug() << bool(o == 0) << endl;
return o ? static_cast<Selector*>( o ) : new Selector( parent );
}
示例3: replayAdvance
void KuickShow::replayAdvance(DelayedRepeatEvent *event)
{
// ### WORKAROUND for QIconView bug in Qt <= 3.0.3 at least
// Sigh. According to qt-bugs, they won't fix this bug ever. So you can't
// rely on sorting to be correct before the QIconView has been show()n.
if ( fileWidget && fileWidget->view() ) {
QWidget *widget = fileWidget->view()->widget();
if ( widget->inherits( "QIconView" ) || widget->child(0, "QIconView" ) ){
fileWidget->setSorting( fileWidget->sorting() );
}
}
// --------------------------------------------------------------
slotAdvanceImage( event->viewer, *(int *) (event->data) );
}
示例4: slotReplayEvent
void KuickShow::slotReplayEvent()
{
disconnect( fileWidget, SIGNAL( finished() ),
this, SLOT( slotReplayEvent() ));
DelayedRepeatEvent *e = m_delayedRepeatItem;
m_delayedRepeatItem = 0L; // otherwise, eventFilter aborts
eventFilter( e->viewer, e->event );
delete e;
// ### WORKAROUND for QIconView bug in Qt <= 3.0.3 at least
if ( fileWidget && fileWidget->view() ) {
QWidget *widget = fileWidget->view()->widget();
if ( widget->inherits( "QIconView" ) || widget->child(0, "QIconView" ) ){
fileWidget->setSorting( fileWidget->sorting() );
}
}
// --------------------------------------------------------------
}
示例5: updateWidgets
void KstEditViewObjectDialogI::updateWidgets() {
// clear all the current widgets from the grid
clearWidgets();
// get the qt properties of the viewobject
if (_viewObject) {
_customWidget = _viewObject->configWidget();
if (_customWidget) {
_grid = new QGridLayout(_propertiesFrame, 1, 1);
_customWidget->reparent(_propertiesFrame, QPoint(0, 0));
_grid->addWidget(_customWidget, 0, 0);
_viewObject->fillConfigWidget(_customWidget, _isNew);
if (!_isNew) {
_viewObject->connectConfigWidget(this, _customWidget);
}
resize(minimumSizeHint());
return;
}
//---------------------------------------------------------------
// NOTE: due to Early return, nothing after this line is executed
// if the view object provides a custom widget.
int numProperties = _viewObject->metaObject()->numProperties(true);
// create a new grid
_grid = new QGridLayout(_propertiesFrame, numProperties, 2, 0, 8);
_grid->setColStretch(0,0);
_grid->setColStretch(1,1);
// get the property names and types
for (int i = 0; i < numProperties; i++) {
const QMetaProperty* property = _viewObject->metaObject()->property(i, true);
QString propertyType(property->type());
QString propertyName(property->name());
// for this property, get the meta-data map
QMap<QString, QVariant> metaData = _viewObject->widgetHints(propertyName);
if (!metaData.empty()) {
QString friendlyName = metaData["_kst_label"].toString();
QString widgetType = metaData["_kst_widgetType"].toString();
metaData.erase("_kst_label");
metaData.erase("_kst_widgetType");
// use friendly name for label
QLabel* propertyLabel = new QLabel(_propertiesFrame, "label-"+i);
propertyLabel->setText(friendlyName);
_grid->addWidget(propertyLabel,i,0);
_widgets.append(propertyLabel);
propertyLabel->show();
// display different types of widgets depending on what dialogData specifies
QWidget* propertyWidget = 0L;
if (widgetType == "QSpinBox") {
// insert a spinbox
propertyWidget = new QSpinBox(_propertiesFrame, (propertyName+","+"value").latin1());
propertyWidget->setProperty("value", _viewObject->property(property->name()));
if (!_isNew) {
connect(propertyWidget, SIGNAL(valueChanged(const QString&)), this, SLOT(modified()));
connect(propertyWidget->child("qt_spinbox_edit"), SIGNAL(textChanged(const QString&)), this, SLOT(modified()));
}
} else if (widgetType == "KColorButton") {