eric6/WebBrowser/WebBrowserTabWidget.py

branch
maintenance
changeset 8043
0acf98cd089a
parent 7924
8a96736d465e
parent 7923
91e843545d9a
child 8176
31965986ecd1
equal deleted inserted replaced
7991:866adc8c315b 8043:0acf98cd089a
375 """ 375 """
376 Public method to create a new web browser tab. 376 Public method to create a new web browser tab.
377 377
378 @param link link to be shown 378 @param link link to be shown
379 @type str or QUrl 379 @type str or QUrl
380 @keyparam position position to create the new tab at or -1 to add it 380 @param position position to create the new tab at or -1 to add it
381 to the end 381 to the end
382 @type int 382 @type int
383 @keyparam background flag indicating to open the tab in the 383 @param background flag indicating to open the tab in the
384 background 384 background
385 @type bool 385 @type bool
386 @keyparam restoreSession flag indicating a restore session action 386 @param restoreSession flag indicating a restore session action
387 @type bool 387 @type bool
388 @return reference to the new browser 388 @return reference to the new browser
389 @rtype WebBrowserView 389 @rtype WebBrowserView
390 """ 390 """
391 if link is None: 391 if link is None:
492 """ 492 """
493 Public method to create a new web browser tab after a given one. 493 Public method to create a new web browser tab after a given one.
494 494
495 @param browser reference to the browser to add after (WebBrowserView) 495 @param browser reference to the browser to add after (WebBrowserView)
496 @param link link to be shown (string or QUrl) 496 @param link link to be shown (string or QUrl)
497 @keyparam background flag indicating to open the tab in the 497 @param background flag indicating to open the tab in the
498 background (bool) 498 background (bool)
499 @return reference to the new browser 499 @return reference to the new browser
500 @rtype WebBrowserView 500 @rtype WebBrowserView
501 """ 501 """
502 if browser: 502 if browser:
845 def __elide(self, txt, mode=Qt.ElideRight, length=40): 845 def __elide(self, txt, mode=Qt.ElideRight, length=40):
846 """ 846 """
847 Private method to elide some text. 847 Private method to elide some text.
848 848
849 @param txt text to be elided (string) 849 @param txt text to be elided (string)
850 @keyparam mode elide mode (Qt.TextElideMode) 850 @param mode elide mode (Qt.TextElideMode)
851 @keyparam length amount of characters to be used (integer) 851 @param length amount of characters to be used (integer)
852 @return the elided text (string) 852 @return the elided text (string)
853 """ 853 """
854 if mode == Qt.ElideNone or len(txt) < length: 854 if mode == Qt.ElideNone or len(txt) < length:
855 return txt 855 return txt
856 elif mode == Qt.ElideLeft: 856 elif mode == Qt.ElideLeft:

eric ide

mercurial