本文整理汇总了Python中backend.Backend.get_selected方法的典型用法代码示例。如果您正苦于以下问题:Python Backend.get_selected方法的具体用法?Python Backend.get_selected怎么用?Python Backend.get_selected使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类backend.Backend
的用法示例。
在下文中一共展示了Backend.get_selected方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: InputPad
# 需要导入模块: from backend import Backend [as 别名]
# 或者: from backend.Backend import get_selected [as 别名]
#.........这里部分代码省略.........
self.desktop = QtGui.QApplication.desktop()
rect = self.desktop.screenGeometry()
if rect.height() < rect.width() :
self.portrait = False
else :
self.portrait = True
def callback_show( self, string ) :
self.textedit.setText( string )
self.textedit.moveCursor( QtGui.QTextCursor.End )
self.textedit.ensureCursorVisible()
rect = self.desktop.screenGeometry()
if rect.height() < rect.width() :
self.portrait = False
else :
self.portrait = True
self.show()
def resizeEvent( self, event ) :
#print self.width(), self.height(), self.isVisible()
if self.height() < self.PAD_HEIGHT :
self.resize( 480, self.PAD_HEIGHT )
def context_update( self ) :
update_stamp = []
for i in range( len( self.KEY_MAP ) ) :
self.key_label_list[i].setFont( self.FONT_LAGER )
update_stamp.append( False )
if self.mode == self.MODE_NORMAL :
index = 1
for item in self.backend.cand_list :
#print item
self.key_label_list[index].setFont( self.FONT_NORMAL )
self.key_label_list[index].setText( item[2] )
update_stamp[index] = True
index = index + 1
text = self.backend.get_selected() + self.backend.code()
self.textedit.set_preedit( text )
elif self.mode == self.MODE_SELECT :
index = 1
for item in self.backend.cand_list :
self.key_label_list[index].setFont( self.FONT_UNDERLINE )
self.key_label_list[index].setText( item[2] )
update_stamp[index] = True
index = index + 1
text = self.backend.get_selected() + self.backend.code()
self.textedit.set_preedit( text )
elif self.mode == self.MODE_PUNC :
index = 2
punc_list = self.PUNC_MAP[self.punc_index]
for punc in punc_list :
self.key_label_list[index].setText( punc )
update_stamp[index] = True
index = index + 1
elif self.mode == self.MODE_ROLLER :
self.textedit.set_preedit( self.roller.get() )
elif self.mode == self.MODE_FILTER :
index = 1
pinyin_index = self.pinyin_index
while pinyin_index < len( self.pinyin_list ) and index < 7 :
self.key_label_list[index].setFont( self.FONT_NORMAL )
self.key_label_list[index].setText( self.pinyin_list[pinyin_index] )
update_stamp[index] = True
index = index + 1
pinyin_index = pinyin_index + 1
for i in range( len( self.KEY_MAP ) ) :
if not update_stamp[i] :
self.key_label_list[i].setText( self.KEY_TEXT[i][self.mode] )
def slot_commit( self, c ) :