From 203ba231d0276943aae36111f9ec1e949f3c6a4c Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sat, 3 Dec 2011 22:23:44 -0600 Subject: Initial TQt conversion --- examples/mimetype.py | 98 ++++++++++++++++++++++++++-------------------------- 1 file changed, 49 insertions(+), 49 deletions(-) (limited to 'examples/mimetype.py') diff --git a/examples/mimetype.py b/examples/mimetype.py index f88009c..5f7a18b 100644 --- a/examples/mimetype.py +++ b/examples/mimetype.py @@ -39,7 +39,7 @@ copyright holder. import sys -from qt import QWidget, QButtonGroup, Qt, QLabel, QListView, QListViewItem +from qt import TQWidget, TQButtonGroup, TQt, TQLabel, TQListView, TQListViewItem from tdecore import KApplication, KCmdLineArgs, KAboutData, KURL from tdeui import KMainWindow, KTabCtl, KListBox @@ -62,15 +62,15 @@ class MainWin (KMainWindow): tabctl.show () -class OfferListTab (QWidget): +class OfferListTab (TQWidget): def __init__ (self, parent, name = ""): - QWidget.__init__ (self, parent, name) + TQWidget.__init__ (self, parent, name) self.setGeometry (0, 0, 500, 370) - lvLbl = QLabel ("Offers - text/html", self) + lvLbl = TQLabel ("Offers - text/html", self) lvLbl.setGeometry (10, 10, 150, 20) - lv = QListView (self) + lv = TQListView (self) lv.setSorting (-1) lv.addColumn ("type_", 75) lv.addColumn ("name", 100) @@ -82,28 +82,28 @@ class OfferListTab (QWidget): # insert list items in reverse order pref = KServiceTypeProfile.preferredService ("Application", "image/jpeg") - QListViewItem (lv, pref.type_ (), pref.name (), pref.exec_ (), pref.library ()) - QListViewItem (lv, "Preferred", "--------", "", "") - QListViewItem (lv, "", "", "", "") + TQListViewItem (lv, pref.type_ (), pref.name (), pref.exec_ (), pref.library ()) + TQListViewItem (lv, "Preferred", "--------", "", "") + TQListViewItem (lv, "", "", "", "") trader = KTrader.self () slist = trader.query ("image/jpeg", "Type == 'Application'") print "KTrader returned:", slist for s in slist: - lvi = QListViewItem (lv, s.type_ (), s.name (), s.exec_ (), s.library ()) + lvi = TQListViewItem (lv, s.type_ (), s.name (), s.exec_ (), s.library ()) lv.show () -class KServiceTypeTab (QWidget): +class KServiceTypeTab (TQWidget): def __init__ (self, parent, name = ""): - QWidget.__init__ (self, parent, name) + TQWidget.__init__ (self, parent, name) self.setGeometry (0, 0, 500, 370) - lvLbl = QLabel ("All Service Types", self) + lvLbl = TQLabel ("All Service Types", self) lvLbl.setGeometry (10, 10, 250, 20) - lv = QListView (self) + lv = TQListView (self) lv.addColumn ("name", 150) lv.addColumn ("desktopEntryPath", 300) lv.setGeometry (10, 30, 500, 300) @@ -112,20 +112,20 @@ class KServiceTypeTab (QWidget): slist = KServiceType.allServiceTypes () for s in slist: - lvi = QListViewItem (lv, s.name (), s.desktopEntryPath ()) + lvi = TQListViewItem (lv, s.name (), s.desktopEntryPath ()) lv.show () -class KSycocaEntryTab (QWidget): +class KSycocaEntryTab (TQWidget): def __init__ (self, parent, name = ""): - QWidget.__init__ (self, parent, name) + TQWidget.__init__ (self, parent, name) grp = KServiceGroup.baseGroup ("screensavers") self.setGeometry (0, 0, 500, 370) - lvLbl = QLabel ("Entries - 'screensavers': " + grp.name ().latin1 (), self) + lvLbl = TQLabel ("Entries - 'screensavers': " + grp.name ().latin1 (), self) lvLbl.setGeometry (10, 10, 250, 20) - lv = QListView (self) + lv = TQListView (self) lv.addColumn ("name", 150) lv.addColumn ("entryPath", 300) lv.setGeometry (10, 30, 500, 300) @@ -134,19 +134,19 @@ class KSycocaEntryTab (QWidget): slist = grp.entries (0, 0) for s in slist: - lvi = QListViewItem (lv, s.name (), s.entryPath ()) + lvi = TQListViewItem (lv, s.name (), s.entryPath ()) lv.show () -class KServiceTab (QWidget): +class KServiceTab (TQWidget): def __init__ (self, parent, name = ""): - QWidget.__init__ (self, parent, name) + TQWidget.__init__ (self, parent, name) self.setGeometry (0, 0, 500, 370) - lvLbl = QLabel ("All Services", self) + lvLbl = TQLabel ("All Services", self) lvLbl.setGeometry (10, 10, 150, 20) - lv = QListView (self) + lv = TQListView (self) lv.addColumn ("type_", 75) lv.addColumn ("name", 100) lv.addColumn ("exec_", 200) @@ -156,7 +156,7 @@ class KServiceTab (QWidget): slist = KService.allServices () for s in slist: - lvi = QListViewItem (lv, s.type_ (), s.name (), s.exec_ (), s.library ()) + lvi = TQListViewItem (lv, s.type_ (), s.name (), s.exec_ (), s.library ()) lv.show () @@ -169,12 +169,12 @@ class KServiceTab (QWidget): # print svc.library () -class KMimeTypeTab (QWidget): +class KMimeTypeTab (TQWidget): def __init__ (self, parent, name = ""): - QWidget.__init__ (self, parent, name) + TQWidget.__init__ (self, parent, name) self.setGeometry (0, 0, 500, 370) - lbLbl = QLabel ("All Mimetypes", self) + lbLbl = TQLabel ("All Mimetypes", self) lbLbl.setGeometry (10, 10, 150, 20) lb = KListBox (self) lb.setGeometry (10, 30, 200, 300) @@ -192,61 +192,61 @@ class KMimeTypeTab (QWidget): y = 10 mt = KMimeType.mimeType ("text/plain") - mtlbl = QLabel ("KMimeType.mimeType ('text/plain')", self) + mtlbl = TQLabel ("KMimeType.mimeType ('text/plain')", self) mtlbl.setGeometry (x, y, 250, 20) - mtnamelbl = QLabel ("name", self) + mtnamelbl = TQLabel ("name", self) mtnamelbl.setGeometry (x + 15, y + 20, 100, 20) - mtname = QLabel (mt.name (), self) + mtname = TQLabel (mt.name (), self) mtname.setGeometry (x + 120, y + 20, 100, 20) - mtdesklbl = QLabel ("desktopEntryPath", self) + mtdesklbl = TQLabel ("desktopEntryPath", self) mtdesklbl.setGeometry (x + 15, y + 40, 100, 20) - mtdesk = QLabel (mt.desktopEntryPath (), self) + mtdesk = TQLabel (mt.desktopEntryPath (), self) mtdesk.setGeometry (x + 120, y + 40, 150, 20) y = y + 80 fp = KMimeType.findByPath ("mimetype.py") - fplbl = QLabel ("KMimeType.findByPath ('mimetype.py')", self) + fplbl = TQLabel ("KMimeType.findByPath ('mimetype.py')", self) fplbl.setGeometry (x, y, 250, 20) - fpnamelbl = QLabel ("name", self) + fpnamelbl = TQLabel ("name", self) fpnamelbl.setGeometry (x + 15, y + 20, 100, 20) - fpname = QLabel (fp.name (), self) + fpname = TQLabel (fp.name (), self) fpname.setGeometry (x + 120, y + 20, 100, 20) - fpdesklbl = QLabel ("desktopEntryPath", self) + fpdesklbl = TQLabel ("desktopEntryPath", self) fpdesklbl.setGeometry (x + 15, y + 40, 100, 20) - fpdesk = QLabel (fp.desktopEntryPath (), self) + fpdesk = TQLabel (fp.desktopEntryPath (), self) fpdesk.setGeometry (x + 120, y + 40, 150, 20) y = y + 80 fu = KMimeType.findByURL (KURL ("file://mimetype.py")) - fulbl = QLabel ("KMimeType.findByURL ('file://mimetype.py')", self) + fulbl = TQLabel ("KMimeType.findByURL ('file://mimetype.py')", self) fulbl.setGeometry (x, y, 250, 20) - funamelbl = QLabel ("name", self) + funamelbl = TQLabel ("name", self) funamelbl.setGeometry (x + 15, y + 20, 100, 20) - funame = QLabel (fu.name (), self) + funame = TQLabel (fu.name (), self) funame.setGeometry (x + 120, y + 20, 100, 20) - fudesklbl = QLabel ("desktopEntryPath", self) + fudesklbl = TQLabel ("desktopEntryPath", self) fudesklbl.setGeometry (x + 15, y + 40, 100, 20) - fudesk = QLabel (fu.desktopEntryPath (), self) + fudesk = TQLabel (fu.desktopEntryPath (), self) fudesk.setGeometry (x + 120, y + 40, 150, 20) y = y + 80 fc, acc = KMimeType.findByFileContent ("mimetype.py") - fclbl = QLabel ("KMimeType.findByFileContent ('mimetype.py')", self) + fclbl = TQLabel ("KMimeType.findByFileContent ('mimetype.py')", self) fclbl.setGeometry (x, y, 250, 20) - fcnamelbl = QLabel ("name", self) + fcnamelbl = TQLabel ("name", self) fcnamelbl.setGeometry (x + 15, y + 20, 100, 20) - fcname = QLabel (fc.name (), self) + fcname = TQLabel (fc.name (), self) fcname.setGeometry (x + 120, y + 20, 100, 20) - fcdesklbl = QLabel ("desktopEntryPath", self) + fcdesklbl = TQLabel ("desktopEntryPath", self) fcdesklbl.setGeometry (x + 15, y + 40, 100, 20) - fcdesk = QLabel (fc.desktopEntryPath (), self) + fcdesk = TQLabel (fc.desktopEntryPath (), self) fcdesk.setGeometry (x + 120, y + 40, 100, 20) - fcacclbl = QLabel ("accuracy", self) + fcacclbl = TQLabel ("accuracy", self) fcacclbl.setGeometry (x + 15, y + 60, 100, 20) - fcacc = QLabel (str (acc), self) + fcacc = TQLabel (str (acc), self) fcacc.setGeometry (x + 120, y + 60, 150, 20) -- cgit v1.2.1