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 }
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 ); }
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) ); }
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() ); } } // -------------------------------------------------------------- }
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") {