parameters: (self)
docstring: Add MOC_FLAGS which may be necessary for moc::
  
  		def build(bld):
  			bld.program(features='qt4', source='main.cpp', target='app', use='QTCORE')
  
  	The additional parameters are:
  
  	:param lang: list of translation files (\\*.ts) to process
  	:type lang: list of :py:class:`waflib.Node.Node` or string without the .ts extension
  	:param update: whether to process the C++ files to update the \\*.ts files (use **waf --translate**)
  	:type update: bool
  	:param langname: if given, transform the \\*.ts files into a .qrc files to include in the binary file
  	:type langname: :py:class:`waflib.Node.Node` or string without the .qrc extension
docstring_summary: Add MOC_FLAGS which may be necessary for moc::
docstring_tokens: Add MOC_FLAGS which may be necessary for moc ::
function: def apply_qt4(self):
  	"""
  	Add MOC_FLAGS which may be necessary for moc::
  
  		def build(bld):
  			bld.program(features='qt4', source='main.cpp', target='app', use='QTCORE')
  
  	The additional parameters are:
  
  	:param lang: list of translation files (\\*.ts) to process
  	:type lang: list of :py:class:`waflib.Node.Node` or string without the .ts extension
  	:param update: whether to process the C++ files to update the \\*.ts files (use **waf --translate**)
  	:type update: bool
  	:param langname: if given, transform the \\*.ts files into a .qrc files to include in the binary file
  	:type langname: :py:class:`waflib.Node.Node` or string without the .qrc extension
  	"""
  	if getattr(self, 'lang', None):
  		qmtasks = []
  		for x in self.to_list(self.lang):
  			if isinstance(x, str):
  				x = self.path.find_resource(x + '.ts')
  			qmtasks.append(self.create_task('ts2qm', x, x.change_ext('.qm')))
  
  		if getattr(self, 'update', None) and Options.options.trans_qt4:
  			cxxnodes = [a.inputs[0] for a in self.compiled_tasks] + [
  				a.inputs[0] for a in self.tasks if getattr(a, 'inputs', None) and a.inputs[0].name.endswith('.ui')]
  			for x in qmtasks:
  				self.create_task('trans_update', cxxnodes, x.inputs)
  
  		if getattr(self, 'langname', None):
  			qmnodes = [x.outputs[0] for x in qmtasks]
  			rcnode = self.langname
  			if isinstance(rcnode, str):
  				rcnode = self.path.find_or_declare(rcnode + '.qrc')
  			t = self.create_task('qm2rcc', qmnodes, rcnode)
  			k = create_rcc_task(self, t.outputs[0])
  			self.link_task.inputs.append(k.outputs[0])
  
  	lst = []
  	for flag in self.to_list(self.env['CXXFLAGS']):
  		if len(flag) < 2:
  			continue
  		f = flag[0:2]
  		if f in ('-D', '-I', '/D', '/I'):
  			if (f[0] == '/'):
  				lst.append('-' + flag[1:])
  			else:
  				lst.append(flag)
  	self.env.append_value('MOC_FLAGS', lst)
function_tokens: def apply_qt4 ( self ) : if getattr ( self , 'lang' , None ) : qmtasks = [ ] for x in self . to_list ( self . lang ) : if isinstance ( x , str ) : x = self . path . find_resource ( x + '.ts' ) qmtasks . append ( self . create_task ( 'ts2qm' , x , x . change_ext ( '.qm' ) ) ) if getattr ( self , 'update' , None ) and Options . options . trans_qt4 : cxxnodes = [ a . inputs [ 0 ] for a in self . compiled_tasks ] + [ a . inputs [ 0 ] for a in self . tasks if getattr ( a , 'inputs' , None ) and a . inputs [ 0 ] . name . endswith ( '.ui' ) ] for x in qmtasks : self . create_task ( 'trans_update' , cxxnodes , x . inputs ) if getattr ( self , 'langname' , None ) : qmnodes = [ x . outputs [ 0 ] for x in qmtasks ] rcnode = self . langname if isinstance ( rcnode , str ) : rcnode = self . path . find_or_declare ( rcnode + '.qrc' ) t = self . create_task ( 'qm2rcc' , qmnodes , rcnode ) k = create_rcc_task ( self , t . outputs [ 0 ] ) self . link_task . inputs . append ( k . outputs [ 0 ] ) lst = [ ] for flag in self . to_list ( self . env [ 'CXXFLAGS' ] ) : if len ( flag ) < 2 : continue f = flag [ 0 : 2 ] if f in ( '-D' , '-I' , '/D' , '/I' ) : if ( f [ 0 ] == '/' ) : lst . append ( '-' + flag [ 1 : ] ) else : lst . append ( flag ) self . env . append_value ( 'MOC_FLAGS' , lst )