Mercurial > projects > qtd
comparison demos/browser/tabwidget.d @ 80:85c59c4e5f19
remove QLatin1String and other fixes
author | mandel |
---|---|
date | Sun, 24 May 2009 15:25:41 +0000 |
parents | 0654fc9bac95 |
children | 87bb4e622f9e |
comparison
equal
deleted
inserted
replaced
79:957f549cfc65 | 80:85c59c4e5f19 |
---|---|
81 super(parent); | 81 super(parent); |
82 setContextMenuPolicy(Qt.CustomContextMenu); | 82 setContextMenuPolicy(Qt.CustomContextMenu); |
83 setAcceptDrops(true); | 83 setAcceptDrops(true); |
84 this.customContextMenuRequested.connect(&this.contextMenuRequested); | 84 this.customContextMenuRequested.connect(&this.contextMenuRequested); |
85 | 85 |
86 string alt = QLatin1String("Alt+%1"); | 86 string alt = "Alt+%1"; |
87 for (int i = 1; i <= 10; ++i) { | 87 for (int i = 1; i <= 10; ++i) { |
88 int key = i; | 88 int key = i; |
89 if (key == 10) | 89 if (key == 10) |
90 key = 0; | 90 key = 0; |
91 QShortcut shortCut = new QShortcut(alt.arg(key), this); | 91 QShortcut shortCut = new QShortcut(alt.arg(key), this); |
119 int index = tabAt(event.pos()); | 119 int index = tabAt(event.pos()); |
120 QUrl url = tabData(index).toUrl(); | 120 QUrl url = tabData(index).toUrl(); |
121 urls ~= url; | 121 urls ~= url; |
122 mimeData.setUrls(urls); | 122 mimeData.setUrls(urls); |
123 mimeData.setText(tabText(index)); | 123 mimeData.setText(tabText(index)); |
124 mimeData.setData(QLatin1String("action"), "tab-reordering"); | 124 mimeData.setData("action", "tab-reordering"); |
125 drag.setMimeData(mimeData); | 125 drag.setMimeData(mimeData); |
126 drag.exec(); | 126 drag.exec(); |
127 } | 127 } |
128 } | 128 } |
129 QTabBar.mouseMoveEvent(event); | 129 QTabBar.mouseMoveEvent(event); |
358 m_tabBar.tabMoved.connect(&this.moveTab); | 358 m_tabBar.tabMoved.connect(&this.moveTab); |
359 setTabBar(m_tabBar); | 359 setTabBar(m_tabBar); |
360 setDocumentMode(true); | 360 setDocumentMode(true); |
361 | 361 |
362 // Actions | 362 // Actions |
363 m_newTabAction = new QAction(QIcon(QLatin1String(":addtab.png")), tr("New &Tab"), this); | 363 m_newTabAction = new QAction(new QIcon(":addtab.png"), tr("New &Tab"), this); |
364 m_newTabAction.setShortcuts(QKeySequence.AddTab); | 364 m_newTabAction.setShortcuts(QKeySequence.AddTab); |
365 m_newTabAction.setIconVisibleInMenu(false); | 365 m_newTabAction.setIconVisibleInMenu(false); |
366 m_newTabAction.triggered.connect(&this.newTab); | 366 m_newTabAction.triggered.connect(&this.newTab); |
367 | 367 |
368 m_closeTabAction = new QAction(QIcon(QLatin1String(":closetab.png")), tr("&Close Tab"), this); | 368 m_closeTabAction = new QAction(new QIcon(":closetab.png"), tr("&Close Tab"), this); |
369 m_closeTabAction.setShortcuts(QKeySequence.Close); | 369 m_closeTabAction.setShortcuts(QKeySequence.Close); |
370 m_closeTabAction.setIconVisibleInMenu(false); | 370 m_closeTabAction.setIconVisibleInMenu(false); |
371 m_closeTabAction.triggered.connect(&this.closeTab); | 371 m_closeTabAction.triggered.connect(&this.closeTab); |
372 | 372 |
373 m_nextTabAction = new QAction(tr("Show Next Tab"), this); | 373 m_nextTabAction = new QAction(tr("Show Next Tab"), this); |
817 void webViewLoadStarted() | 817 void webViewLoadStarted() |
818 { | 818 { |
819 WebView webView = cast(WebView) signalSender(); | 819 WebView webView = cast(WebView) signalSender(); |
820 int index = webViewIndex(webView); | 820 int index = webViewIndex(webView); |
821 if (-1 != index) { | 821 if (-1 != index) { |
822 auto icon = new QIcon(QLatin1String(":loading.gif")); | 822 auto icon = new QIcon(":loading.gif"); |
823 setTabIcon(index, icon); | 823 setTabIcon(index, icon); |
824 } | 824 } |
825 } | 825 } |
826 | 826 |
827 void webViewIconChanged() | 827 void webViewIconChanged() |