Krita Source Code Documentation
Loading...
Searching...
No Matches
krita.sceditor.console.QtQmlCompleter Class Reference
+ Inheritance diagram for krita.sceditor.console.QtQmlCompleter:

Public Member Functions

 __init__ (self, engine)
 
 attr_matches (self, text)
 
 complete (self, text, state)
 
 global_matches (self, text)
 
 iter_obj (self, obj)
 

Public Attributes

 engine
 
 matches
 

Detailed Description

Definition at line 406 of file console.py.

Constructor & Destructor Documentation

◆ __init__()

krita.sceditor.console.QtQmlCompleter.__init__ ( self,
engine )

Definition at line 408 of file console.py.

408 def __init__(self, engine):
409 self.engine = engine
410

Member Function Documentation

◆ attr_matches()

krita.sceditor.console.QtQmlCompleter.attr_matches ( self,
text )

Definition at line 422 of file console.py.

422 def attr_matches(self, text):
423 return []
424

◆ complete()

krita.sceditor.console.QtQmlCompleter.complete ( self,
text,
state )

Definition at line 411 of file console.py.

411 def complete(self, text, state):
412 if state == 0:
413 if "." in text:
414 self.matches = self.attr_matches(text)
415 else:
416 self.matches = self.global_matches(text)
417 try:
418 return self.matches[state]
419 except IndexError:
420 return None
421

◆ global_matches()

krita.sceditor.console.QtQmlCompleter.global_matches ( self,
text )

Definition at line 431 of file console.py.

431 def global_matches(self, text):
432 words = list(self.iter_obj(self.engine.globalObject()))
433 words.extend(js_words)
434 l = []
435 n = len(text)
436 for w in words:
437 if w[:n] == text:
438 l.append(w)
439 return l
440
441

References KoColorConversionSystem::Node.engine, krita.sceditor.console.QtQmlInterpreter.engine, krita.sceditor.console.QtQmlCompleter.engine, and krita.sceditor.console.QtQmlCompleter.iter_obj().

◆ iter_obj()

krita.sceditor.console.QtQmlCompleter.iter_obj ( self,
obj )

Definition at line 425 of file console.py.

425 def iter_obj(self, obj):
426 it = QScriptValueIterator(self.engine.globalObject())
427 while it.hasNext():
428 yield str(it.name())
429 it.next()
430

References KoColorConversionSystem::Node.engine, krita.sceditor.console.QtQmlInterpreter.engine, and krita.sceditor.console.QtQmlCompleter.engine.

Member Data Documentation

◆ engine

krita.sceditor.console.QtQmlCompleter.engine

Definition at line 409 of file console.py.

◆ matches

krita.sceditor.console.QtQmlCompleter.matches

Definition at line 414 of file console.py.


The documentation for this class was generated from the following file: