From 7d7dad1cf41b12e7d5003476834968b1c119ad2e Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 31 Aug 2009 16:12:01 +0200 Subject: Add license headers to lupdate autotest data The data is essentially random line noise that happens to live in a .cpp file. --- .../lupdate/testdata/good/parsecpp2/main.cpp | 41 ++++++++++++++++++++++ .../lupdate/testdata/good/parsecpp2/main2.cpp | 41 ++++++++++++++++++++++ .../lupdate/testdata/good/parsecpp2/main3.cpp | 41 ++++++++++++++++++++++ 3 files changed, 123 insertions(+) diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp2/main.cpp b/tests/auto/linguist/lupdate/testdata/good/parsecpp2/main.cpp index eb4a09b..e6668a9 100644 --- a/tests/auto/linguist/lupdate/testdata/good/parsecpp2/main.cpp +++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp2/main.cpp @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + // IMPORTANT!!!! If you want to add testdata to this file, // always add it to the end in order to not change the linenumbers of translations!!! diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp2/main2.cpp b/tests/auto/linguist/lupdate/testdata/good/parsecpp2/main2.cpp index 1c72ac2..61029b3 100644 --- a/tests/auto/linguist/lupdate/testdata/good/parsecpp2/main2.cpp +++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp2/main2.cpp @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + // IMPORTANT!!!! If you want to add testdata to this file, // always add it to the end in order to not change the linenumbers of translations!!! diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp2/main3.cpp b/tests/auto/linguist/lupdate/testdata/good/parsecpp2/main3.cpp index 731d5cdf..6a80349 100644 --- a/tests/auto/linguist/lupdate/testdata/good/parsecpp2/main3.cpp +++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp2/main3.cpp @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + // IMPORTANT!!!! If you want to add testdata to this file, // always add it to the end in order to not change the linenumbers of translations!!! -- cgit v0.12 From 5a0d63f0f8920c425227004017d1c7d1a185dce6 Mon Sep 17 00:00:00 2001 From: kh1 Date: Mon, 31 Aug 2009 17:53:42 +0200 Subject: Stop building the depricated Assistant translation, soon the be removed. --- tools/assistant/translations/translations_adp.pro | 41 - translations/assistant_adp_de.ts | 1606 --------------------- translations/assistant_adp_ja.ts | 1047 -------------- translations/assistant_adp_pl.ts | 994 ------------- translations/assistant_adp_ru.ts | 977 ------------- translations/assistant_adp_untranslated.ts | 967 ------------- translations/assistant_adp_zh_CN.ts | 999 ------------- translations/assistant_adp_zh_TW.ts | 1000 ------------- translations/translations.pri | 9 +- 9 files changed, 2 insertions(+), 7638 deletions(-) delete mode 100644 tools/assistant/translations/translations_adp.pro delete mode 100644 translations/assistant_adp_de.ts delete mode 100644 translations/assistant_adp_ja.ts delete mode 100644 translations/assistant_adp_pl.ts delete mode 100644 translations/assistant_adp_ru.ts delete mode 100644 translations/assistant_adp_untranslated.ts delete mode 100644 translations/assistant_adp_zh_CN.ts delete mode 100644 translations/assistant_adp_zh_TW.ts diff --git a/tools/assistant/translations/translations_adp.pro b/tools/assistant/translations/translations_adp.pro deleted file mode 100644 index c6f3e81..0000000 --- a/tools/assistant/translations/translations_adp.pro +++ /dev/null @@ -1,41 +0,0 @@ -# Include those manually as they do not contain any directory specification - -FORMS += ../compat/helpdialog.ui \ - ../compat/mainwindow.ui \ - ../compat/tabbedbrowser.ui \ - ../compat/topicchooser.ui - -SOURCES += ../compat/main.cpp \ - ../compat/helpwindow.cpp \ - ../compat/topicchooser.cpp \ - ../compat/docuparser.cpp \ - ../compat/index.cpp \ - ../compat/profile.cpp \ - ../compat/config.cpp \ - ../compat/helpdialog.cpp \ - ../compat/mainwindow.cpp \ - ../compat/tabbedbrowser.cpp \ - ../compat/fontsettingsdialog.cpp - -SOURCES += ../../shared/fontpanel/fontpanel.cpp - -HEADERS += ../compat/helpwindow.h \ - ../compat/topicchooser.h \ - ../compat/docuparser.h \ - ../compat/index.h \ - ../compat/profile.h \ - ../compat/helpdialog.h \ - ../compat/mainwindow.h \ - ../compat/tabbedbrowser.h \ - ../compat/config.h \ - ../compat/fontsettingsdialog.h - - -TRANSLATIONS=$$[QT_INSTALL_TRANSLATIONS]/assistant_adp_de.ts \ - $$[QT_INSTALL_TRANSLATIONS]/assistant_adp_ja.ts \ - $$[QT_INSTALL_TRANSLATIONS]/assistant_adp_pl.ts \ - $$[QT_INSTALL_TRANSLATIONS]/assistant_adp_ru.ts \ - $$[QT_INSTALL_TRANSLATIONS]/assistant_adp_untranslated.ts \ - $$[QT_INSTALL_TRANSLATIONS]/assistant_adp_zh_CN.ts \ - $$[QT_INSTALL_TRANSLATIONS]/assistant_adp_zh_TW.ts -error("This is a dummy profile to be used for translations ONLY.") diff --git a/translations/assistant_adp_de.ts b/translations/assistant_adp_de.ts deleted file mode 100644 index ed8f1d5..0000000 --- a/translations/assistant_adp_de.ts +++ /dev/null @@ -1,1606 +0,0 @@ - - - - - Assistant - - Welcome to the <b>Qt Assistant</b>. Qt Assistant will give you quicker access to help and tips while using applications like Qt Designer. - Wilkommen bei <b>Qt Assistant</b>. Qt Assistant ermöglicht einen schnellen Zugriff der Onlinehilfe während dem Arbeiten mit Programmen wie dem Qt Designer. - - - Qt Assistant - Qt Assistant - - - - AssistantServer - - - Qt Assistant - Qt Assistant - - - - Failed to bind to port %1 - Kann Port %1 nicht binden - - - - FindDialog - - Find Text - Textsuche - - - &Find: - &Suchen: - - - &Find - &Suchen - - - Close - Schließen - - - &Direction - Rich&tung - - - Forwar&d - &Vorwärts - - - &Backward - &Rückwärts - - - &Options - &Optionen - - - &Whole words only - &Ganze Wörter - - - &Case sensitive - Groß- und &Kleinschreibung beachten - - - Qt Assistant - Find Text - Qt Assistant - Textsuche - - - Enter the text you are looking for. - Geben Sie den Suchtext ein. - - - Search reached end of the document - Die Suche hat das Ende des Dokuments erreicht - - - Search reached start of the document - Die Suche hat den Anfang des Dokuments erreicht - - - Text not found - Text nicht gefunden - - - Fo&rward - Vo&rwärts - - - F&ind: - Su&chen: - - - C&lose - Sch&ließen - - - - FontPanel - - - Font - Schrift - - - - &Writing system - S&kript - - - - &Family - &Schriftart - - - - &Style - S&chriftschnitt - - - - &Point size - Schriftg&rad - - - - FontSettingsDialog - - - Font Settings - Schriftart - - - - Font settings for: - Schriftart für: - - - - Browser - Hilfeseiten - - - - Application - Anwendung - - - - Use custom settings - Erweitere Einstellungen nutzen - - - - HelpDialog - - Index - Index - - - Bookmarks - Lesezeichen - - - - Con&tents - Inhal&t - - - Qt Reference Documentation - Qt Referenzdokumentation - - - Qt Designer Manual - Qt Designer Handbuch - - - Qt Linguist Manual - Qt Linguist Handbuch - - - Qt Assistant Manual - Qt Assistant Handbuch - - - - - - Qt Assistant - Qt Assistant - - - Open Link in Current Window - Öffne Link im aktuellen Fenster - - - - Open Link in New Window - Öffne Link in neuem Fenster - - - Contents - Inhalt - - - Search - Suche - - - - - Prepare... - Initialisiere... - - - - Cannot open the index file %1 - Kann Indexdatei %1 nicht öffnen - - - - - - Warning - Warnung - - - - - Documentation file %1 does not exist! -Skipping file. - Dokumentation %1 existiert nicht! -Überspringe Datei. - - - - - Parse Error - Syntaxfehler - - - - - Done - Fertig - - - - Indexing files... - Indiziere Dokumentation... - - - - Reading dictionary... - Lese Suchindex... - - - - - Full Text Search - Volltextsuche - - - - Using a wildcard within phrases is not allowed. - Wildcards innerhalb von Phrasen sind nicht zugelassen. - - - - The closing quotation mark is missing. - Das schließende Anführungszeichen fehlt. - - - - %n document(s) found. - - %n Dokumente gefunden. - - - - - - Open Link in Current Tab - Link im Aktuellen Tab öffnen - - - - Open Link in New Tab - Link in einem neuen Tab öffnen - - - - Failed to load keyword index file -Assistant will not work! - Die Indexdatei konnte nicht geladen werden. -Der Assistent ist nicht einsatzbereit! - - - - Documentation file %1 is not compatible! -Skipping file. - Dokumentation %1 ist nicht kompatibel! Datei wird übersprungen. - - - - Failed to save fulltext search index -Assistant will not work! - Der Index für die Volltextsuche konnte nicht gespeichert werden. -Assistent ist nicht einsatzbereit! - - - - Help - Hilfe - - - - <b>Help</b><p>Choose the topic you want help on from the contents list, or search the index for keywords.</p> - <b>Hilfe</b><p>Wählen Sie ein Hilfethema aus dem Inhalt oder suchen Sie im Index nach Schlüsselwörtern.</p> - - - - Displays help topics organized by category, index or bookmarks. Another tab inherits the full text search. - Zeigt Hilfethemen geordnet nach Kategorie, Index oder Lesezeichen an. Ein weiterer Abschnitt enthält die Volltextsuche. - - - - <b>Help topics organized by category.</b><p>Double-click an item to see the topics in that category. To view a topic, just double-click it.</p> - <b>Hilfethemen geordnet nach Kategorie.</b><p>Doppelklicken Sie einen Eintrag, um die Themen dieser Kategorie zu sehen. Doppelklicken Sie ein Thema, um es angezeigt zu bekommen.</p> - - - - column 1 - Spalte 1 - - - - &Index - &Index - - - - &Look For: - Suchen &nach: - - - - Enter keyword - Geben Sie ein Schlüsselwort ein - - - - <b>Enter a keyword.</b><p>The list will select an item that matches the entered string best.</p> - <b>Geben Sie ein Schlüsselwort ein.</b><p>Es wird dann der Eintrag aus der Liste ausgewählt, der am besten mit dem eingegebenen Begriff übereinstimmt.</p> - - - - <b>List of available help topics.</b><p>Double-click on an item to open its help page. If more than one is found, you must specify which page you want.</p> - <b>Liste aller verfügbaren Hilfethemen.</b><p>Doppelklicken Sie auf einen Eintrag, um die Hilfe zu öffnen. Wenn mehr als eine Seite gefunden wurde, wählen Sie die gewünschte Seite aus.</p> - - - - &Bookmarks - L&esezeichen - - - - Displays the list of bookmarks. - Zeigt alle Lesezeichen an. - - - - Add new bookmark - Füge neues Lesezeichen hinzu - - - - Add the currently displayed page as a new bookmark. - Füge aktuelle Seite zu den Lesezeichen hinzu. - - - - &New - &Neu - - - - Delete bookmark - Lösche Lesezeichen - - - - Delete the selected bookmark. - Lösche markiertes Lesezeichen. - - - - &Delete - &Löschen - - - - &Search - &Suche - - - - Searching f&or: - Suche &nach: - - - - Enter searchword(s). - Suchebegriff(e). - - - - <b>Enter search word(s).</b><p>Enter here the word(s) you are looking for. The words may contain wildcards (*). For a sequence of words quote them.</p> - <b>Geben Sie Suchbegriffe ein.</b><p>Geben Sie hier die gesuchten Begriffe ein. Die Begriffe können Wildcards (*) enthalten. Eine Phrase muß in Anführungszeichen stehen.</p> - - - - <b>Found documents</b><p>This list contains all found documents from the last search. The documents are ordered, i.e. the first document has the most matches.</p> - <b>Gefundene Dokumente</b><p>Diese Liste beinhaltet alle gefundenen Dokumente der letzten Suche. Die Dokumente sind nach der Häufigkeit der Treffer geordnet.</p> - - - - Found &Documents: - Gefundene &Dokumente: - - - - Display the help page. - Zeigt die Hilfe an. - - - - Display the help page for the full text search. - Zeigt die Hilfeseite für die Volltextsuche an. - - - - He&lp - Hi&lfe - - - - Start searching. - Starte Suche. - - - - Pressing this button starts the search. - Startet die Suche. - - - - Preparing... - Initialisiere... - - - - HelpDialogBase - - Help - Hilfe - - - <b>Help</b><p>Choose the topic you need help for from the contents list, or search the index for keywords.</p> - <b>Hilfe</b><p>Wählen Sie ein Thema vom Inhaltsverzeichnis oder suchen Sie im Index nach Schlüsselwörtern.</p> - - - Displays help topics organized by category, index or bookmarks - Zeigt die Hilfethemen unterteilt in Kategorien, Indizes oder Lesezeichen an - - - Con&tents - Inhal&t - - - Column 1 - Spalte 1 - - - <b>Help topics organized by category.</b><p>Double-click an item to see which topics are in that category. To view a topic, select it, and then click <b>Display</b>.</p> - <b>Die Hilfethemen sind nach Kategorien organisiert.</b><p>Ein Doppelklick auf einen Eintrag zeigt die Themen dieser Kategorie an. Um ein Thema anzuzeigen, wählen Sie es aus und drücken Sie <b>Anzeigen</b>.</p> - - - &Index - &Index - - - &Look For: - Suchen &nach: - - - Enter keyword - Geben Sie ein Schlüsselwort ein - - - <b>Enter a keyword.</b><p>The list will select an item that matches the entered string best.</p> - <b>Geben Sie ein Schlüsselwort ein.</b><p>Es wird dann der Eintrag aus der Liste ausgewählt, der am besten mit dem eingegebenen Begriff übereinstimmt.</p> - - - <b>List of available help topics.</b><p>Double-click on an item to open up the help page for this topic. You will have to choose the right page if more than one are found.</p> - <b>Liste aller verfügbaren Hilfethemen.</b><p>Ein Doppelklick auf einen Eintrag öffnet die dazugehörige Hilfeseite. Wenn es mehrere Seiten zu einem Eintrag gibt, wählen Sie die gewünschte aus.</p> - - - &Bookmarks - L&esezeichen - - - Displays the list of bookmarks. - Zeigt alle Lesezeichen an. - - - &New Bookmark - &Neues Lesezeichen - - - Add new bookmark - Füge neues Lesezeichen hinzu - - - Add the current displayed page as new bookmark to the list. - Füge die aktuelle Seite als Lesezeichen hinzu. - - - D&elete Bookmark - &Lösche Lesezeichen - - - Delete bookmark - Lösche Lesezeichen - - - Delete the selected bookmark from the list. - Lösche markiertes Lesezeichen. - - - Preparing... - Initialisiere... - - - <b>Help</b><p>Choose the topic you want help on from the contents list, or search the index for keywords.</p> - <b>Hilfe</b><p>Wählen Sie ein Hilfethema aus dem Inhalt oder suchen Sie im Index nach Schlüsselwörtern.</p> - - - Displays help topics organized by category, index or bookmarks. Another tab inherits the full text search. - Zeigt Hilfethemen geordnet nach Kategorie, Index oder Lesezeichen an. Ein weiterer Abschnitt enthält die Volltextsuche. - - - <b>Help topics organized by category.</b><p>Double-click an item to see the topics in that category. To view a topic, just double-click it.</p> - <b>Hilfethemen geordnet nach Kategorie.</b><p>Doppelklicken Sie einen Eintrag, um die Themen dieser Kategorie zu sehen. Doppelklicken Sie ein Thema, um es angezeigt zu bekommen.</p> - - - <b>List of available help topics.</b><p>Double-click on an item to open its help page. If more than one is found, you must specify which page you want.</p> - <b>Liste aller verfügbaren Hilfethemen.</b><p>Doppelklicken Sie auf einen Eintrag, um die Hilfe zu öffnen. Wenn mehr als eine Seite gefunden wurde, wählen Sie die gewünschte Seite aus.</p> - - - &New - &Neu - - - Add the currently displayed page as a new bookmark. - Füge aktuelle Seite zu den Lesezeichen hinzu. - - - &Delete - &Löschen - - - Delete the selected bookmark. - Lösche markiertes Lesezeichen. - - - &Search - &Suche - - - Searching f&or: - Suche &nach: - - - Enter searchword(s). - Suchebegriff(e). - - - <b>Enter search word(s).</b><p>Enter here the word(s) you are looking for. The words may contain wildcards (*). For a sequence of words quote them.</p> - <b>Geben Sie Suchbegriffe ein.</b><p>Geben Sie hier die gesuchten Begriffe ein. Die Begriffe können Wildcards (*) enthalten. Eine Phrase muß in Anführungszeichen stehen.</p> - - - <b>Found documents</b><p>This list contains all found documents from the last search. The documents are ordered, i.e. the first document has the most matches.</p> - <b>Gefundene Dokumente</b><p>Diese Liste beinhaltet alle gefundenen Dokumente der letzten Suche. Die Dokumente sind nach der Häufigkeit der Treffer geordnet.</p> - - - Found &Documents: - Gefundene &Dokumente: - - - He&lp - Hi&lfe - - - Display the help page. - Zeigt die Hilfe an. - - - Display the help page for the full text search. - Zeigt die Hilfeseite für die Volltextsuche an. - - - Start searching. - Starte Suche. - - - Pressing this button starts the search. - Startet die Suche. - - - - HelpWindow - - Qt Assistant by Trolltech - %1 - Qt Assistant von Trolltech - %1 - - - - Help - Hilfe - - - Can't load and display non-local file -%1 - Kann gewünschte Datei nicht laden: -%1 - - - - Open Link in New Window Shift+LMB - Öffne Link in neuem Fenster - - - Currently no Web browser is selected. -Please use the settings dialog to specify one! - - Es ist kein Webbrowser ausgewählt. -Öffnen Sie bitten den "Einstellungen" Dialog um einen Webbrowser auszuwählen. - - - - Qt Assistant by Trolltech - %1%2 - Qt Assistant von Trolltech - %1%2 - - - No PDF Viewer has been specified -Please use the settings dialog to specify one! - - Es wurde kein PDF Betrachter angegeben. -Bitte diesen im Menue Einstellungen festlegen! - - - - Qt Assistant is unable to start the PDF Viewer - -%1 - -Please make sure that the executable exists and is located at -the specified location. - Der Qt Assistent konnte den PDF betrachter -%1 nicht laden. -Bitte überprüfen Sie, das dieser an der angegeben Stelle existiert. - - - - Open Link in New Tab - Link in einem neuen Tab öffnen - - - - Unable to launch web browser. - - Der Webbrowser konnte nicht gestartet werden. - - - - - OK - OK - - - - Failed to open link: '%1' - Der Link '%1' konnte nicht geöffnet werden - - - - <div align="center"><h1>The page could not be found</h1><br><h3>'%1'</h3></div> - <div align="center"><h1>Die Seite wurde nicht gefunden</h1><br><h3>'%1'</h3></div> - - - - Error... - Fehler ... - - - - Copy &Link Location - Link-Adresse kopieren - - - - Index - - - Untitled - Unbenannt - - - - MainWindow - - Qt Assistant by Trolltech - Qt Assistant von Trolltech - - - - Toolbar - Werkzeugleiste - - - Print - Drucken - - - - &Print... - &Drucken... - - - Exit - Beenden - - - - E&xit - &Beenden - - - Copy - Kopieren - - - - &Copy - &Kopieren - - - Find in Text - Textsuche - - - - &Find in Text... - Text&suche... - - - Home - Startseite - - - - &Home - St&artseite - - - Previous - Vorherige - - - - &Previous - &Vorherige - - - Next - Nächste - - - - &Next - &Nächste - - - About - Über - - - - About Qt - Über Qt - - - Qt Class Reference - Qt Klassenreferenz - - - Qt Designer Manual - Qt Designer Handbuch - - - Zoom in - Vergrößern - - - - Zoom &in - Vergrößern - - - - Zoom &out - Ver&kleinern - - - Qt Linguist Manual - Qt Linguist Handbuch - - - &Settings - &Einstellungen - - - &Settings... - &Einstellungen... - - - - New Window - Neues Fenster... - - - Close - Schließen - - - Vie&ws - A&nsicht - - - - Ctrl+T - Strg+T - - - - - Ctrl+I - Strg+I - - - - Ctrl+B - Strg+E - - - You need a commercial Qt license for development of proprietary (closed source) applications. Please see <a href="http://qt.nokia.com/company/model">qt.nokia.com/company/model</a> for an overview of Qt licensing. - Sie benötigen eine kommerzielle Qt Lizenz für die Entwicklung von proprietären (geschlossenen) Anwendungen. Besuchen Sie <a href="http://qt.nokia.com/company/about/businessmodel">http://qt.nokia.com/company/about/businessmodel</a> um sich einen Überblick über die Qt Lizenzvergabe zu verschaffen. - - - This program is licensed to you under the terms of the Qt %1 License Agreement. For details, see the license file that came with this software distribution. - Dieses Programm ist für Sie lizenziert gemäß den Bedingungen des Qt %1 Lizenzvertrages. Einzelheiten können sie der mitgelieferten Lizenz-Datei entnehmen. - - - - - Qt Assistant - Qt Assistant - - - - &Add Bookmark - &Füge Lesezeichen hinzu - - - Qt Reference Documentation - Qt Referenzdokumention - - - - &File - &Datei - - - - &Edit - &Bearbeiten - - - - &View - &Ansicht - - - - &Go - &Gehe zu - - - - Boo&kmarks - &Lesezeichen - - - - Qt Assistant by Nokia - - - - - &Help - &Hilfe - - - - Print the currently displayed page. - Drucke aktuelle Seite. - - - - Ctrl+P - Strg+P - - - - Quit Qt Assistant. - Qt Assistant beenden. - - - - Ctrl+Q - Strg+Q - - - - Copy the selected text to the clipboard. - Den markierten Text in die Zwischenablage kopieren. - - - - Ctrl+C - Strg+C - - - - Open the Find dialog. Qt Assistant will search the currently displayed page for the text you enter. - Den Suchdialog öffnen. Qt Assistant sucht in der aktuellen Seite nach dem eingegebenen Text. - - - - Ctrl+F - Strg+F - - - - Go to the home page. Qt Assistant's home page is the Qt Reference Documentation. - Zur Startseite gehen. Startseite im Qt Assistant ist die Qt-Referenzdokumentation. - - - - Ctrl+Home - Strg+Pos1 - - - - Go to the previous page. - Gehe zur vorherigen Seite. - - - - Alt+Left - Alt+Links - - - - Go to the next page. - Gehe zur nächsten Seite. - - - - Alt+Right - Alt+Rechts - - - - Display further information about Qt Assistant. - Zeigt das Handbuch zum Qt Designer an. - - - - Zoom in on the document, i.e. increase the font size. - Vergrößert die Schrift. - - - - Ctrl++ - Strg++ - - - - Zoom out on the document, i.e. decrease the font size. - Verkleinert die Schrift. - - - - Ctrl+- - Strg+- - - - Display the Guide to the Qt Translation Tools. - Zeigt die Anleitung zu den Qt Übersetzungswerkzeugen an. - - - Open the settings dialog. - Öffnet den "Einstellungen" Dialog. - - - - Open a new window. - Öffnet ein neues Fenster. - - - - Ctrl+N - Strg+N - - - - &Close - &Schließen - - - - Close the current window. - Schließt das aktuelle Fenster. - - - - Qt Assistant Manual - Handbuch zu Qt Assistant - - - - F1 - F1 - - - - Add the currently displayed page as a new bookmark. - Aktuelle Seite zu den Lesezeichen hinzufügen. - - - - What's This? - Direkthilfe - - - - "What's This?" context sensitive help. - Kontextbezogene Direkthilfe. - - - - Shift+F1 - Umschalt+F1 - - - - Ctrl+S - Strg+S - - - - Initializing Qt Assistant... - Qt Assistant wird initialisiert... - - - - Go - Gehe zu - - - - Find &Next - Weitersuchen - - - - F3 - F3 - - - - Find &Previous - Vorheriges suchen - - - - Shift+F3 - Umschalt+F3 - - - - About Qt Assistant - Über Qt Assistent - - - Settings - Einstellungen - - - Add Bookmark - Lesezeichen einfügen - - - - Add Tab - Tab einfügen - - - - Ctrl+Alt+N - - - - - Next Tab - Nächster Tab - - - - Ctrl+Alt+Right - - - - - Previous Tab - Voriger Tab - - - - Ctrl+Alt+Left - - - - - Close Tab - Tab schließen - - - - Ctrl+Alt+Q - - - - - Failed to open about application contents in file: '%1' - Fehler beim Öffnen des Inhalts in Datei: '%1' - - - Error... - Fehler ... - - - - Sidebar - Sidebar - - - - &Window - &Fenster - - - - Minimize - Minimieren - - - - Ctrl+M - Strg+M - - - - SHIFT+CTRL+= - Umschalt+Strg+= - - - - Ctrl+W - Strg+W - - - - Ctrl+] - Strg+AltGr+] - - - - Ctrl+[ - Strg+AltGr+[ - - - - Views - Menüleisten/Sidebar - - - - Displays the main page of a specific documentation set. - Zeigt die Hauptseite eines Dokumentensets an. - - - Open Source Edition - Open Source Edition - - - This version of Qt Assistant is part of the Qt Open Source Edition, for use in the development of Open Source applications. Qt is a comprehensive C++ framework for cross-platform application development. - Diese Version von Qt Assistant ist Teil der Qt Open Source Edition und darf für die Entwicklung von Open Source Anwendungen genutzt werden. Qt ist ein umfangreiches C++ Framework für die Entwicklung von Cross-Platform-Anwendungen. - - - This program is licensed to you under the terms of the Qt Commercial License Agreement. For details, see the file LICENSE that came with this software distribution. - Dieses Programm ist für Sie lizenziert gemäß den Bedingungen des kommerziellen Qt Lizenzvertrages. Einzelheiten können Sie der mitgelieferten LICENSE-Datei entnehmen. - - - - ... - ... - - - - - Save Page - Seite speichern - - - - Cannot open file for writing! - Die Datei konnte nicht zum Schreiben geöffnet werden. - - - - Save Page As... - Seite speichern als... - - - - Ctrl+Alt+S - Strg+Alt+S - - - - Sync with Table of Contents - Seite mit Inhalt-Tab syncronisieren - - - - Select the page in contents tab. - Wählt die Seite im Inhalt-Tab aus. - - - - Font Settings... - Schriftart... - - - - QObject - - Qt Assistant by Trolltech - Qt Assistant von Trolltech - - - - Qt Assistant by Nokia - Qt Assistant von Nokia - - - - SettingsDialog - - all - Alle - - - Qt Assistant - Add Documentation - Qt Assistant - Hinzufügen von Dokumentation - - - Qt Assistant - Qt Assistant - - - Parse Error - Syntaxfehler - - - This item can not be deleted! - Dieser Eintrag kann nicht gelöscht werden! - - - This branch is not empty! -Firstly, all contents have to be removed. - Dieser Zweig ist nicht leer! -Es müssen zuerst alle Inhalte gelöscht werden. - - - Qt Assistant - Set Web Browser - Qt Assistant - Setze Webbrowser - - - Qt Assistant - Set PDF Browser - Qt Assistent - Setze PDF Betrachter - - - Qt Assistant - Set Homepage - Qt Assistent - Setzte Startseite - - - - SettingsDialogBase - - Settings - Einstellungen - - - Font: - Schriften: - - - Link color: - Linkfarbe: - - - Underline links - Unterstreiche Links - - - OK - OK - - - Cancel - Abbrechen - - - Fixed font: - Nicht-proportionale Schrift: - - - Qt Assistant - Settings - Qt Assistant - Einstellungen - - - General - Allgemein - - - Fix&ed font: - &Nicht-proportionale Schrift: - - - &Font: - &Schrift: - - - &Underline links - &Unterstreiche Links - - - Web - Web - - - &Web Browser Application: - &Webbrowser Anwendung: - - - ... - ... - - - Documentation - Dokumentation - - - &Delete - &Lösche - - - &Add... - &Hinzufügen... - - - Categories - Kategorien - - - Category &Name: - Kategorie&name: - - - &Add - &Hinzufügen - - - &OK - &OK - - - &Cancel - &Abbrechen - - - &General - &Haupt - - - &Web - &Web - - - Web &Browser Application: - Web&browser: - - - &Home page - &Startseite - - - &PDF - &PDF - - - PDF &Application - PDF &Betrachter - - - - TabbedBrowser - - - TabbedBrowser - - - - - Untitled - Unbenannt - - - - Add page - Seite einfügen - - - - Close page - Seite schließen - - - - ... - ... - - - - New Tab - Neuer Tab - - - - Close Tab - Tab schließen - - - - Close Other Tabs - Andere Tabs schließen - - - - Previous - Vorheriger - - - - Next - Nächster - - - - Case Sensitive - Groß-/Kleinschreibung beachten - - - - Whole words - Ganze Wörter - - - - <img src=":/trolltech/assistant/images/wrap.png">&nbsp;Search wrapped - <img src=":/trolltech/assistant/images/wrap.png">&nbsp;Seitenende - - - - TopicChooser - - - Choose a topic for <b>%1</b> - Wählen Sie ein Thema für <b>%1</b> - - - - Choose Topic - Thema wählen - - - - Select a topic from the list and click the <b>Display</b>-button to open the online help. - Wählen Sie ein Thema aus der Liste aus und klicken Sie <b>Anzeigen</b> um die Hilfe zu öffnen. - - - - &Topics - &Themen - - - - Displays a list of available help topics for the keyword. - Zeigt eine Liste der verfügbaren Hilfethemen für diesen Begriff an. - - - - &Display - &Anzeigen - - - - Open the topic selected in the list. - Öffne das gewählte Thema aus der Liste. - - - - &Close - &Schließen - - - - Close the Dialog. - Schließt den Dialog. - - - - TopicChooserBase - - Choose Topic - Thema wählen - - - Select a topic from the list and click the <b>Display</b>-button to open the online help. - Wählen Sie ein Thema aus der Liste aus und klicken Sie <b>Anzeigen</b> um die Hilfe zu öffnen. - - - &Topics - &Themen - - - Displays a list of available help topics for the keyword. - Zeigt eine Liste der verfügbaren Hilfethemen für diesen Begriff an. - - - &Display - &Anzeigen - - - Open the topic selected in the list. - Öffne das gewählte Thema aus der Liste. - - - &Close - &Schließen - - - Close the Dialog. - Schließt den Dialog. - - - diff --git a/translations/assistant_adp_ja.ts b/translations/assistant_adp_ja.ts deleted file mode 100644 index f87beab..0000000 --- a/translations/assistant_adp_ja.ts +++ /dev/null @@ -1,1047 +0,0 @@ - - - - - AssistantServer - - - Qt Assistant - Qt Assistant - - - - Failed to bind to port %1 - ポート %1 のバインドに失敗しました - - - - FontPanel - - - Font - - - - - &Writing system - - - - - &Family - - - - - &Style - - - - - &Point size - - - - - FontSettingsDialog - - - Font Settings - - - - - Font settings for: - - - - - Browser - - - - - Application - - - - - Use custom settings - - - - - HelpDialog - - - Open Link in Current Tab - リンクを現在のタブに開く - - - - Open Link in New Window - リンクを新しいウィンドウで開く - - - - Open Link in New Tab - リンクを新しいタブで開く - - - - - Prepare... - 準備中... - - - - - - Qt Assistant - Qt Assistant - - - - Failed to load keyword index file -Assistant will not work! - キーワードインデックスファイルのロードに失敗しました -Assistant は動きません! - - - - Cannot open the index file %1 - インデックスファイル %1 をオープンできません - - - - - - Warning - 警告 - - - - - Documentation file %1 does not exist! -Skipping file. - ドキュメンテーションファイル %1 は存在しません! -スキップします。 - - - - - Parse Error - パースエラー - - - - Documentation file %1 is not compatible! -Skipping file. - ドキュメンテーションファイル %1 は互換性がありません! -スキップします。 - - - - %n document(s) found. - - - - - - Index - インデックス - - - Bookmarks - ブックマーク - - - Contents - 目次 - - - Search - 検索 - - - - - Done - 完了 - - - - Failed to save fulltext search index -Assistant will not work! - 全文検索インデックスのセーブに失敗しました -Assistant は動きません! - - - - Indexing files... - インデックス作成中... - - - - Reading dictionary... - ディレクトリを読み込んでいます... - - - - - Full Text Search - 全文検索 - - - - Using a wildcard within phrases is not allowed. - フレーズ中のワイルドカードの使用は認められていません。 - - - - The closing quotation mark is missing. - 閉じ引用符がありません。 - - - - Help - ヘルプ - - - - <b>Help</b><p>Choose the topic you want help on from the contents list, or search the index for keywords.</p> - <b>ヘルプ</b><p>目次のリストからヘルプを希望するトピックを選択します、あるいはキーワードをインデックスから検索します。</p> - - - - Displays help topics organized by category, index or bookmarks. Another tab inherits the full text search. - カテゴリ、インデックス、ブックマークで編成したヘルプトピックを表示します。もう一つのタブは全文検索を引き継いでいます。 - - - - Con&tents - 目次(&T) - - - - <b>Help topics organized by category.</b><p>Double-click an item to see the topics in that category. To view a topic, just double-click it.</p> - <b>カテゴリで編成したヘルプトピックです。</b><p>カテゴリ内のトピックを見るには、項目をダブルクリックしてください。</p> - - - - column 1 - コラム 1 - - - - &Index - インデックス(&I) - - - - &Look For: - 以下を検索(&L): - - - - Enter keyword - キーワードを入力してください - - - - <b>Enter a keyword.</b><p>The list will select an item that matches the entered string best.</p> - <b>キーワードを入力してください。</b><p>入力された文字列に一番近いものを選択します。</p> - - - - <b>List of available help topics.</b><p>Double-click on an item to open its help page. If more than one is found, you must specify which page you want.</p> - <b>ヘルプトピック一覧</b><p>ヘルプページをオープンするには、項目をダブルクリックしてください。複数見つかった場合は、その中から選んでください。</p> - - - - &Bookmarks - ブックマーク(&B) - - - - Displays the list of bookmarks. - ブックマーク一覧を表示します。 - - - - Add new bookmark - 新しいブックマークを追加 - - - - Add the currently displayed page as a new bookmark. - 現在表示されているページを新しいブックマークとして追加します。 - - - - &New - 新規(&N) - - - - Delete bookmark - ブックマークを削除 - - - - Delete the selected bookmark. - 選択されたブックマークを削除します。 - - - - &Delete - 削除(&D) - - - - &Search - 検索(&S) - - - - Searching f&or: - 以下を検索(&O): - - - - Enter searchword(s). - 検索する語(フレーズ)を入力してください。 - - - - <b>Enter search word(s).</b><p>Enter here the word(s) you are looking for. The words may contain wildcards (*). For a sequence of words quote them.</p> - <b>検索する語(フレーズ)を入力してください。</b><p>検索する語(フレーズ)を入力してください。ワイルドカード(*)を含めることもできます。連続する語を入力する場合は引用符で囲んでください。</p> - - - - <b>Found documents</b><p>This list contains all found documents from the last search. The documents are ordered, i.e. the first document has the most matches.</p> - <b>見つかったドキュメント</b><p>この一覧は最新の検索で見つかったドキュメントを全て含んでいます。該当項目が多い順に並んでいます。</p> - - - - Found &Documents: - 見つかったドキュメント(&D): - - - - Display the help page. - ヘルプページを表示します。 - - - - Display the help page for the full text search. - 全文検索用にヘルプページを表示します。 - - - - He&lp - ヘルプ(&L) - - - - Start searching. - 検索を開始します。 - - - - Pressing this button starts the search. - このボタンを押すと検索が始まります。 - - - - Preparing... - 準備中... - - - - HelpWindow - - - Help - ヘルプ - - - - OK - - - - - Failed to open link: '%1' - リンク開けませんでした: '%1' - - - - <div align="center"><h1>The page could not be found</h1><br><h3>'%1'</h3></div> - <div align="center"><h1>ページが見つかりませんでした</h1><br><h3>'%1'</h3></div> - - - - Error... - エラー... - - - - Copy &Link Location - - - - - Open Link in New Window Shift+LMB - リンクを新しいウィンドウで開く Shift+LMB - - - - Open Link in New Tab - リンクを新しいタブで開く - - - - Unable to launch web browser. - - ブラウザを起動できません。 - - - - Ok - Ok - - - - Index - - - Untitled - タイトルなし - - - - MainWindow - - - Sidebar - サイドバー - - - - Initializing Qt Assistant... - Qt Assistant を初期化中... - - - - SHIFT+CTRL+= - SHIFT+CTRL+= - - - - Ctrl+T - Ctrl+T - - - - Ctrl+I - Ctrl+I - - - - Ctrl+B - Ctrl+B - - - - Ctrl+S - Ctrl+S - - - - Ctrl+W - Ctrl+W - - - - Ctrl+] - Ctrl+] - - - - Ctrl+[ - Ctrl+[ - - - - Views - 表示 - - - - Displays the main page of a specific documentation set. - 指定されたドキュメントセットのメインページを表示します。 - - - - - Qt Assistant - Qt Assistant - - - - Failed to open about application contents in file: '%1' - '%1' というファイル内の、アプリケーションについての説明内容を開けませんでした - - - - ... - ... - - - - - Save Page - ページを保存 - - - - Cannot open file for writing! - 書き込みのためにファイルが開けません! - - - Qt Assistant by Trolltech - Trolltech の Qt Assistant - - - - Toolbar - ツールバー - - - - Go - 移動 - - - - &File - ファイル(&F) - - - - &Edit - 編集(&E) - - - - Font Settings... - - - - - &View - 表示(&V) - - - - &Go - 移動(&G) - - - - Boo&kmarks - ブックマーク(&K) - - - - Qt Assistant by Nokia - - - - - &Help - ヘルプ(&H) - - - - Print the currently displayed page. - 現在表示されているページを印刷します。 - - - - Ctrl+P - Ctrl+P - - - - &Print... - 印刷(&P)... - - - - Quit Qt Assistant. - Qt Assistant を終了します。 - - - - Ctrl+Q - Ctrl+Q - - - - E&xit - 終了(&X) - - - - Copy the selected text to the clipboard. - 選択されているテキストをクリップボードにコピーします。 - - - - Ctrl+C - Ctrl+C - - - - &Copy - コピー(&C) - - - - Open the Find dialog. Qt Assistant will search the currently displayed page for the text you enter. - 検索ダイアログを開きます。Qt Assistant は入力されたテキストを現在表示されているページから検索します。 - - - - Ctrl+F - Ctrl+F - - - - &Find in Text... - テキスト内を検索(&F)... - - - - F3 - F3 - - - - Find &Next - 次を検索(&N) - - - - Shift+F3 - Shift+F3 - - - - Find &Previous - 前を検索(&P) - - - - Go to the home page. Qt Assistant's home page is the Qt Reference Documentation. - ホームページへ移動します。Qt Assistant のホームページは Qt Reference Documentation です。 - - - - Ctrl+Home - Ctrl+Home - - - - &Home - ホーム(&H) - - - - Go to the previous page. - 一つ前のページへ戻ります。 - - - - Alt+Left - Alt+左矢印 - - - - &Previous - 戻る(&P) - - - - Go to the next page. - 一つ先のページへ進みます。 - - - - Alt+Right - Alt+右矢印 - - - - &Next - 進む(&N) - - - - Display further information about Qt Assistant. - Qt Assistant について、さらに詳しい情報を表示します。 - - - - About Qt Assistant - Qt Assistant について - - - - About Qt - Qt について - - - - Zoom in on the document, i.e. increase the font size. - 文書をズームイン(フォントサイズを拡大)します。 - - - - Ctrl++ - Ctrl++ - - - - Zoom &in - 拡大(&I) - - - - Zoom out on the document, i.e. decrease the font size. - 文書をズームアウト(フォントサイズを縮小)します。 - - - - Ctrl+- - Ctrl+- - - - - Zoom &out - 縮小(&O) - - - - Open a new window. - 新規ウィンドウを開きます。 - - - - Ctrl+N - Ctrl+N - - - - New Window - 新しいウィンドウ - - - - Close the current window. - 現在のウィンドウを閉じます。 - - - - &Close - 閉じる(&C) - - - - Add the currently displayed page as a new bookmark. - 現在表示されているページを新規ブックマークとして追加します。 - - - - &Add Bookmark - ブックマークに追加(&A) - - - - "What's This?" context sensitive help. - 文脈依存のヘルプ、ヒントです。 - - - - Shift+F1 - Shift+F1 - - - - What's This? - ヒント - - - - Ctrl+Alt+N - Ctrl+Alt+N - - - - Add Tab - タブを追加 - - - - Ctrl+Alt+Right - Ctrl+Alt+右矢印 - - - - Next Tab - 次のタブ - - - - Ctrl+Alt+Left - Ctrl+Alt+左矢印 - - - - Previous Tab - 前のタブ - - - - Ctrl+Alt+Q - Ctrl+Alt+Q - - - - Close Tab - タブを閉じる - - - - F1 - F1 - - - - Qt Assistant Manual - Qt Assistant マニュアル - - - - Ctrl+Alt+S - Ctrl+Alt+S - - - - Save Page As... - 名前をつけてページを保存... - - - - &Window - ウィンドウ(&W) - - - - Minimize - 最小化 - - - - Ctrl+M - Ctrl+M - - - Open Source Edition - オープンソース版 - - - This version of Qt Assistant is part of the Qt Open Source Edition, for use in the development of Open Source applications. Qt is a comprehensive C++ framework for cross-platform application development. - この Qt Assistant は Qt オープンソース版の一部であり、オープンソースのアプリケーションの開発を目的としたものです。Qt は、複数のプラットフォームに対応するアプリケーションを開発するための C++ のわかりやすいフレームワークです。 - - - You need a commercial Qt license for development of proprietary (closed source) applications. Please see <a href="http://qt.nokia.com/company/model.html">qt.nokia.com/company/model.html</a> for an overview of Qt licensing. - 著作権のある(ソースを公開しない)アプリケーションを開発するには、Qt の商用ライセンスが必要です。Qt のライセンスの概要については <a href="http://qt.nokia.com/company/model.html">qt.nokia.com/company/model.html</a> をご覧ください。 - - - This program is licensed to you under the terms of the Qt Commercial License Agreement. For details, see the file LICENSE that came with this software distribution. - このプログラムは Qt 商用版ライセンス規約の定める条件の下で、あなたにライセンスされています。詳細はこのソフトウェアとともに配布される LICENSE ファイルをご覧ください。 - - - - Sync with Table of Contents - 目次の該当箇所を表示 - - - - Select the page in contents tab. - 「目次」タブからそのページを選択します。 - - - - QAssistantClient - - Failed to start Qt Assistant. - Qt Assistant の起動に失敗しました。 - - - Qt Assistant crashed. - Qt Assistant がクラッシュしました。 - - - Error while running Qt Assistant. - Qt Assistant 実行中にエラーが発生しました。 - - - Cannot connect to Qt Assistant. - Qt Assistant に接続できません。 - - - Could not connect to Assistant: Connection refused - Assistant に接続できませんでした: 接続を拒否されました - - - Could not connect to Assistant: Host not found - Assistant に接続できませんでした: ホストが見つかりませんでした - - - Communication error - 通信エラー - - - - QObject - - Qt Assistant by Trolltech - Trolltech の Qt Assistant - - - - Qt Assistant by Nokia - - - - - TabbedBrowser - - - ... - ... - - - - Add page - ページを追加 - - - - Close page - ページを閉じる - - - - New Tab - - - - - Close Tab - タブを閉じる - - - - Close Other Tabs - - - - - TabbedBrowser - タブブラウザ - - - - Untitled - タイトルなし - - - - Previous - - - - - Next - - - - - Case Sensitive - 大文字と小文字を区別する - - - - Whole words - 完全に一致する単語だけを検索する - - - - <img src=":/trolltech/assistant/images/wrap.png">&nbsp;Search wrapped - <img src=":/trolltech/assistant/images/wrap.png">&nbsp;検索が一通り終わりました - - - - TopicChooser - - - Choose a topic for <b>%1</b> - <b>%1</b> のトピックを選択 - - - - Choose Topic - トピックを選択 - - - - Select a topic from the list and click the <b>Display</b>-button to open the online help. - 一覧からトピックを選択し、<b>表示</b>ボタンをクリックしてオンラインヘルプを開いてください。 - - - - &Topics - トピック(&T) - - - - Displays a list of available help topics for the keyword. - 指定されたキーワードの使用できるヘルプトピックの一覧を表示します。 - - - - &Display - 表示(&D) - - - - Open the topic selected in the list. - 一覧から選択されたトピックを開きます。 - - - - &Close - 閉じる(&C) - - - - Close the Dialog. - ダイアログを閉じます。 - - - diff --git a/translations/assistant_adp_pl.ts b/translations/assistant_adp_pl.ts deleted file mode 100644 index 4b845f2..0000000 --- a/translations/assistant_adp_pl.ts +++ /dev/null @@ -1,994 +0,0 @@ - - - - - AssistantServer - - - Qt Assistant - Qt Assistant - - - - Failed to bind to port %1 - Błąd podłączenia do portu %1 - - - - FontPanel - - - Font - Czcionka - - - - &Writing system - Sys&tem pisania - - - - &Family - &Rodzina - - - - &Style - &Styl - - - - &Point size - &Wielkość punktu - - - - FontSettingsDialog - - - Font Settings - Ustawienia czcionki - - - - Font settings for: - Ustawienia czcionki - - - - Browser - przeglądarki - - - - Application - aplikacji - - - - Use custom settings - Użyj własnych ustawień - - - - HelpDialog - - - Open Link in Current Tab - Otwórz odsyłacz w bieżącej karcie - - - - Open Link in New Window - Otwórz odsyłacz w nowym oknie - - - - Open Link in New Tab - Otwórz odsyłacz w nowej karcie - - - - - Prepare... - Przygotuj... - - - - - - Qt Assistant - Qt Assistant - - - - Failed to load keyword index file -Assistant will not work! - Nie można wczytać indeksu słów kluczowych -Assistant nie będzie działał! - - - - Cannot open the index file %1 - Nie można otworzyć indeksu %1 - - - - - - Warning - Ostrzeżenie - - - - - Documentation file %1 does not exist! -Skipping file. - Plik dokumentacji %1 nie istnieje! -Plik zostaje pominięty. - - - - - Parse Error - Błąd parsowania - - - - Documentation file %1 is not compatible! -Skipping file. - Plik dokumentacji %1 jest nieodpowiedni! -Plik zostaje pominięty. - - - - - Done - Zrobione - - - - Failed to save fulltext search index -Assistant will not work! - Nie można zapisać indeksu dla pełnego wyszukiwania -Assistant nie będzie działał! - - - - Indexing files... - Indeksowanie plików... - - - - Reading dictionary... - Czytanie katalogu... - - - - - Full Text Search - Pełne wyszukiwanie - - - - Using a wildcard within phrases is not allowed. - Używanie znacznika w wyrażeniu nie jest dozwolone. - - - - The closing quotation mark is missing. - Brakuje kończącego znaku cudzysłowu. - - - - Help - Pomoc - - - - <b>Help</b><p>Choose the topic you want help on from the contents list, or search the index for keywords.</p> - <b>Pomoc</b><p>Wybierz temat pomocy z listy dostępnych tematów bądź poszukaj słowa kluczowego w indeksie.</p> - - - - Displays help topics organized by category, index or bookmarks. Another tab inherits the full text search. - Pokazuje listę tematów pomocy zorganizowaną w kategorie, indeks lub zakładki. Kolejna karta pozwala na pełne wyszukiwanie. - - - - Con&tents - &Spis treści - - - - <b>Help topics organized by category.</b><p>Double-click an item to see the topics in that category. To view a topic, just double-click it.</p> - <b>Tematy pomocy zorganizowane w kategorie.</b><p>Kliknij dwukrotnie na wybraną kategorię aby otworzyć listę jej tematów. Aby obejrzeć temat dwukrotnie kliknij go.</p> - - - - column 1 - kolumna 1 - - - - &Index - &Indeks - - - - &Look For: - &Szukaj wyrażenia: - - - - Enter keyword - Wprowadź słowo kluczowe - - - - <b>Enter a keyword.</b><p>The list will select an item that matches the entered string best.</p> - <b>Wprowadź słowo kluczowe.</b><p>Lista wybierze temat który najbardziej odpowiada szukanemu wyrażeniu.</p> - - - - <b>List of available help topics.</b><p>Double-click on an item to open its help page. If more than one is found, you must specify which page you want.</p> - <b>Lista dostępnych tematów pomocy</b><p>Kliknij dwukrotnie na wybranym temacie aby otworzyć jego treść. Jeśli temat występuje w kilku kontekstach, dodatkowo należy wybrać kontekst z listy.</p> - - - - &Bookmarks - &Zakładki - - - - Displays the list of bookmarks. - Pokazuje listę zakładek. - - - - Add new bookmark - Dodaj nową zakładkę - - - - Add the currently displayed page as a new bookmark. - Dodaj bieżącą stronę jako nową zakładkę. - - - - &New - &Nowa - - - - Delete bookmark - Usuń zakładkę - - - - Delete the selected bookmark. - Usuń zaznaczoną zakładkę. - - - - &Delete - &Usuń - - - - &Search - &Szukaj - - - - Searching f&or: - &Szukanie: - - - - Enter searchword(s). - Wprowadź wyrażenie(a) do szukania. - - - - <b>Enter search word(s).</b><p>Enter here the word(s) you are looking for. The words may contain wildcards (*). For a sequence of words quote them.</p> - <b>Wprowadź wyrażenie(a) do szukania.<b><p>Wprowadź w tym okienku wyrażenia, których szukasz. Wyrażenia mogą zawierać znaczniki (*). Dla wyszukania ciągu wyrażeń umieść całość w cudzysłowie.</p> - - - - <b>Found documents</b><p>This list contains all found documents from the last search. The documents are ordered, i.e. the first document has the most matches.</p> - <b>Znalezione dokumenty</b><p>Lista zawiera wszystkie znalezione dokumenty związane z ostatnim wyszukiwaniem. Dokumenty są poukładane w kolejności pod względem ilości trafień szukanego wyrażenia.</p> - - - - Found &Documents: - Znalezione &dokumenty: - - - - Display the help page. - Pokaż stronę pomocy. - - - - Display the help page for the full text search. - Pokaż stronę pomocy dla pełnego wyszukiwania. - - - - He&lp - &Pomoc - - - - Start searching. - Rozpocznij wyszukiwanie. - - - - Pressing this button starts the search. - Naciśnięcie tego przycisku powoduje rozpoczęcie wyszukiwania. - - - - Preparing... - Przygotowywanie... - - - - %n document(s) found. - - Znaleziono %n dokument. - Znaleziono %n dokumenty. - Znaleziono %n dokumentów. - - - - - HelpWindow - - - Help - Pomoc - - - - Unable to launch web browser. - - Nie można uruchomić przeglądarki internetowej. - - - - - Failed to open link: '%1' - Nie można otworzyć odsyłacza: '%1' - - - - <div align="center"><h1>The page could not be found</h1><br><h3>'%1'</h3></div> - <div align="center"><h1>Strona nie została znaleziona</h1><br><h3>'%1'</h3></div> - - - - Error... - Błąd... - - - - Open Link in New Window Shift+LMB - Otwórz odsyłacz w nowym oknie Shift+LMB - - - - Open Link in New Tab - Otwórz odsyłacz w nowej karcie - - - - OK - OK - - - - Copy &Link Location - Skopiuj &odsyłacz - - - - Index - - - Untitled - Nienazwany - - - - MainWindow - - - Sidebar - Panel - - - - &Window - &Okno - - - - Minimize - Minimalizuj - - - - Ctrl+M - Ctrl+M - - - - Initializing Qt Assistant... - Inicjalizowanie Qt Assistant... - - - - SHIFT+CTRL+= - SHIFT+CTRL+= - - - - Ctrl+T - Ctrl+T - - - - Ctrl+I - Ctrl+I - - - - Ctrl+B - Ctrl+B - - - - Ctrl+S - Ctrl+S - - - - Ctrl+W - Ctrl+W - - - - Ctrl+] - Ctrl+] - - - - Ctrl+[ - Ctrl+[ - - - - Views - Widoki - - - - Displays the main page of a specific documentation set. - Pokazuje główną stronę wybranego zestawu dokumentacji. - - - Open Source Edition - Wydanie Open Source - - - This version of Qt Assistant is part of the Qt Open Source Edition, for use in the development of Open Source applications. Qt is a comprehensive C++ framework for cross-platform application development. - Ta wersja Qt Assistant jest częścią wydania Qt Open Source, przeznaczonego do tworzenia aplikacji Open Source. Qt zawiera obszerny zestaw bibliotek wykorzystywanych do pisania przenośnych aplikacji. - - - - - Qt Assistant - Qt Assistant - - - - Failed to open about application contents in file: '%1' - Nie można otworzyć pliku: '%1' z informacjami o aplikacji - - - - ... - ... - - - - - Save Page - Zapisz stronę - - - - Cannot open file for writing! - Nie można otworzyć pliku do zapisu! - - - Qt Assistant by Trolltech - Qt Assistant Trolltech'a - - - - Qt Assistant by Nokia - - - - - Toolbar - Pasek główny - - - - Go - Pasek z odsyłaczami - - - - &Help - &Pomoc - - - - &File - &Plik - - - - Boo&kmarks - &Zakładki - - - - &Go - &Nawigacja - - - - &View - &Widok - - - - &Edit - &Edycja - - - - &Print... - Wy&drukuj... - - - - Print the currently displayed page. - Wydrukuj bieżącą stronę. - - - - Ctrl+P - Ctrl+P - - - - E&xit - &Zakończ - - - - Quit Qt Assistant. - Zakończ Qt Assistant. - - - - Ctrl+Q - Ctrl+Q - - - - &Copy - S&kopiuj - - - - Copy the selected text to the clipboard. - Skopiuj wybrany tekst do schowka. - - - - Ctrl+C - Ctrl+C - - - - &Find in Text... - &Znajdź w tekście... - - - - Open the Find dialog. Qt Assistant will search the currently displayed page for the text you enter. - Otwórz okno szukania. Qt Assistant będzie przeszukiwał bieżącą stronę dla podanego tekstu. - - - - Ctrl+F - Ctrl+F - - - - Find &Next - Znajdź &następne - - - - F3 - F3 - - - - Find &Previous - Znajdź &poprzednie - - - - Shift+F3 - Shift+F3 - - - - &Home - Strona &startowa - - - - Go to the home page. Qt Assistant's home page is the Qt Reference Documentation. - Przejdź do strony startowej. Strona startowa Qt Assistant jest główną stroną dokumentacji Qt. - - - - Ctrl+Home - Ctrl+Home - - - - &Previous - &Poprzednia strona - - - - Go to the previous page. - Przejdź do poprzedniej strony. - - - - Alt+Left - Alt+Left - - - - &Next - &Następna strona - - - - Go to the next page. - Przejdź do następnej strony. - - - - Alt+Right - Alt+Right - - - - About Qt Assistant - Informacje o Qt Assistant - - - - Display further information about Qt Assistant. - Pokaż dalsze informacje o Qt Assistant. - - - - About Qt - Informacje o Qt - - - - Zoom &in - Po&większ - - - - Zoom in on the document, i.e. increase the font size. - Powiększ rozmiar czcionek w dokumencie. - - - - Ctrl++ - Ctrl++ - - - - Zoom &out - Po&mniejsz - - - - Zoom out on the document, i.e. decrease the font size. - Pomniejsz rozmiar czcionek w dokumencie. - - - - Ctrl+- - Ctrl+- - - - - New Window - Nowe okno - - - - Open a new window. - Otwórz nowe okno. - - - - Ctrl+N - Ctrl+N - - - - &Close - Za&mknij - - - - Close the current window. - Zamknij bieżące okno. - - - - &Add Bookmark - &Dodaj zakładkę - - - - Add the currently displayed page as a new bookmark. - Dodaj bieżącą stronę jako nową zakładkę. - - - - What's This? - Co to jest? - - - - "What's This?" context sensitive help. - "Co to jest?" jest pomocą kontekstową. - - - - Shift+F1 - Shift+F1 - - - - Add Tab - Dodaj kartę - - - - Ctrl+Alt+N - Ctrl+Alt+N - - - - Next Tab - Następna karta - - - - Ctrl+Alt+Right - Ctrl+Alt+Right - - - - Previous Tab - Poprzednia karta - - - - Ctrl+Alt+Left - Ctrl+Alt+Left - - - - Close Tab - Zamknij kartę - - - - Ctrl+Alt+Q - Ctrl+Alt+Q - - - - Qt Assistant Manual - Podręcznik Qt Assistant - - - - F1 - F1 - - - - Save Page As... - Zapisz stronę jako... - - - - Ctrl+Alt+S - Ctrl+Alt+S - - - - Sync with Table of Contents - Znajdź bieżącą stronę w spisie treści - - - - Select the page in contents tab. - Wybierz stronę w karcie ze spisem treści. - - - - Font Settings... - Ustawienia czcionki... - - - You need a commercial Qt license for development of proprietary (closed source) applications. Please see <a href="http://qt.nokia.com/company/model">qt.nokia.com/company/model</a> for an overview of Qt licensing. - Aby móc tworzyć przy pomocy Qt własne aplikacje bez publikowania kodu (closed source) potrzebujesz wydania komercyjnego. Opis sposobów licencjonowania Qt znajduje się na stronie <a href="http://qt.nokia.com/company/model.html">qt.nokia.com/company/model.html</a>. - - - - QObject - - Qt Assistant by Trolltech - Qt Assistant Trolltech'a - - - - Qt Assistant by Nokia - - - - - TabbedBrowser - - - ... - ... - - - - Add page - Dodaj kartę - - - - Close page - Zamknij kartę - - - - TabbedBrowser - Przeglądarka z kartami - - - - Untitled - Nienazwany - - - - Previous - Poprzedni - - - - Next - Następny - - - - Case Sensitive - Uwzględniaj wielkość liter - - - - Whole words - Wszystkie wyrazy - - - - <img src=":/trolltech/assistant/images/wrap.png">&nbsp;Search wrapped - <img src=":/trolltech/assistant/images/wrap.png">&nbsp;Szukanie od początku - - - - New Tab - Nowa karta - - - - Close Tab - Zamknij kartę - - - - Close Other Tabs - Zamknij pozostałe karty - - - - TopicChooser - - - Choose a topic for <b>%1</b> - Wybierz temat dla <b>%1</b> - - - - Choose Topic - Wybierz temat - - - - Select a topic from the list and click the <b>Display</b>-button to open the online help. - Wybierz temat z listy i kliknij przycisk <b>Pokaż</b> aby otworzyć pomoc (online). - - - - &Topics - &Tematy - - - - Displays a list of available help topics for the keyword. - Pokazuje listę dostępnych tematów pomocy dla szukanego wyrażenia. - - - - &Display - Pok&aż - - - - Open the topic selected in the list. - Otwórz wybrany na liście temat. - - - - &Close - Za&mknij - - - - Close the Dialog. - Zamknij okno. - - - diff --git a/translations/assistant_adp_ru.ts b/translations/assistant_adp_ru.ts deleted file mode 100644 index c47798b..0000000 --- a/translations/assistant_adp_ru.ts +++ /dev/null @@ -1,977 +0,0 @@ - - - - - AssistantServer - - - Failed to bind to port %1 - Не удалось открыть порт %1 - - - - Qt Assistant - Qt Assistant - - - - FontPanel - - - &Family - Се&мейство - - - - &Style - &Стиль - - - - Font - Шрифт - - - - &Writing system - Система &письма - - - - &Point size - &Размер в пикселях - - - - FontSettingsDialog - - - Application - Приложение - - - - Browser - Обозреватель - - - - Font settings for: - Настройки шрифта для: - - - - Use custom settings - Использование индивидуальных настроек - - - - Font Settings - Настройки шрифта - - - - HelpDialog - - - &Index - &Указатель - - - - &Look For: - &Искать: - - - - &New - &Новая - - - - - &Search - &Поиск - - - - <b>Enter a keyword.</b><p>The list will select an item that matches the entered string best.</p> - <b>Указание ключевого слова.</b><p>Список заполняется элементами, лучше соответствующими указанному ключевому слову.</p> - - - - <b>Enter search word(s).</b><p>Enter here the word(s) you are looking for. The words may contain wildcards (*). For a sequence of words quote them.</p> - <b>Указание слов для поиска.</b><p>Введите одно или несколько слов, по которым требуется осуществить поиск. Слова могут содержкать символы-заменители (*). Если требуется найти сочетание слов, заключите искомую фразу в кавычки.</p> - - - - <b>Found documents</b><p>This list contains all found documents from the last search. The documents are ordered, i.e. the first document has the most matches.</p> - <b>Найденные документы</b><p>В данном списке представлены все найденные при последнем поиске документы. Документы упорядочены по релевантности, т.е. чем выше в списке, тем чаще в нём встречаются искомые слова.</p> - - - - <b>Help topics organized by category.</b><p>Double-click an item to see the topics in that category. To view a topic, just double-click it.</p> - <b>Разделы справки, распределённые по категориям.</b><p>Дважды щёлкните по одному из пунктов для отображения разделов в данной категории. Для открытия раздела дважды щёлкните по нему.</p> - - - - <b>Help</b><p>Choose the topic you want help on from the contents list, or search the index for keywords.</p> - <b>Справка</b><p>Выберите раздел справки из содержания или воспользуйтесь поиском по предметному указателю.</p> - - - - <b>List of available help topics.</b><p>Double-click on an item to open its help page. If more than one is found, you must specify which page you want.</p> - <b>Список доступных разделов справки.</b><p>Дважды щёлкните по одному из пунктов для открытия страницы справки. Если найдено более одной страницы, выберите желаемую.</p> - - - - Add new bookmark - Добавить закладку - - - - Add the currently displayed page as a new bookmark. - Добавить отображаемую страницу в закладки. - - - - Cannot open the index file %1 - Не удаётся открыть файл индекса %1 - - - - Con&tents - Содер&жание - - - - Delete bookmark - Удалить закладку - - - - Delete the selected bookmark. - Удалить выбранную закладку. - - - - Display the help page for the full text search. - Показать справку по полнотекстовому поиску. - - - - Display the help page. - Показать страницу справки. - - - - Displays help topics organized by category, index or bookmarks. Another tab inherits the full text search. - Отображает список разделов, распредёленных по категориям, указатель или закладки. Последняя вкладка содержит панель полнотекстового поиска. - - - - Displays the list of bookmarks. - Отображает список закладок. - - - - - Documentation file %1 does not exist! -Skipping file. - Файл документации %1 не существует! -Пропущен. - - - - Documentation file %1 is not compatible! -Skipping file. - Несовместимый файл документации %1! -Пропущен. - - - - - Done - Готово - - - - Enter keyword - Введите ключевое слово - - - - Enter searchword(s). - Введите одно или несколько слов для поиска. - - - - Failed to load keyword index file -Assistant will not work! - Не удалось загрузить файл индекса ключевых слов -Qt Assistant не будет работать! - - - - Failed to save fulltext search index -Assistant will not work! - Не удалось сохранить индекс полнотекстового поиска -Qt Assistant не будет работать! - - - - Found &Documents: - Найденные &документы: - - - - - Full Text Search - Полнотекстовый поиск - - - - He&lp - &Справка - - - - Help - Справка - - - - Indexing files... - Индексирование файлов... - - - - Open Link in New Tab - Открыть ссылку в новой вкладке - - - - Open Link in New Window - Открыть ссылку в новом окне - - - - - Parse Error - Ошибка обработки - - - - - Prepare... - Подготовка... - - - - Preparing... - Подготовка... - - - - Pressing this button starts the search. - Нажатие на эту кнопку запустит процесс поиска. - - - - - - Qt Assistant - Qt Assistant - - - - Reading dictionary... - Чтение каталога... - - - - Searching f&or: - &Искать: - - - - Start searching. - Начать поиск. - - - - The closing quotation mark is missing. - Пропущена закрывающая кавычка. - - - - Using a wildcard within phrases is not allowed. - Использование символов-заменителей внутри фраз недопустимо. - - - - - - Warning - Предупреждение - - - - - column 1 - столбец 1 - - - - Open Link in Current Tab - Открыть ссылку в текущей вкладке - - - - %n document(s) found. - - Найден %n документ. - Найдено %n документа. - Найдено %n документов. - - - - - &Bookmarks - &Закладки - - - - &Delete - &Удалить - - - - HelpWindow - - - <div align="center"><h1>The page could not be found</h1><br><h3>'%1'</h3></div> - <div align="center"><h1>Страница не найдена</h1><br><h3>'%1'</h3></div> - - - - Copy &Link Location - Копировать &адрес ссылки - - - - Error... - Ошибка... - - - - Failed to open link: '%1' - Не удалось открыть ссылку: '%1' - - - - Help - Справка - - - - OK - Закрыть - - - - Open Link in New Tab - Открыть ссылку в новой вкладке - - - - Open Link in New Window Shift+LMB - Открыть ссылку в новом окне Shift+LMB - - - - Unable to launch web browser. - - Невозможно запустить вэб-браузер. - - - - - Index - - - Untitled - Неозаглавлено - - - - MainWindow - - - - "What's This?" context sensitive help. - Контекстная справка "Что это?". - - - - &Add Bookmark - &Добавить закладку - - - - &Close - &Закрыть - - - - &Copy - &Копировать - - - - &Edit - &Правка - - - - &File - &Файл - - - - &Find in Text... - П&оиск по тексту... - - - - &Go - &Перейти - - - - &Help - &Справка - - - - &Home - &Домой - - - - &Next - Сл&едующий - - - - &Previous - &Предыдущий - - - - &Print... - &Печать... - - - - &View - &Вид - - - - &Window - &Окно - - - - ... - ... - - - - About Qt - О Qt - - - - About Qt Assistant - О Qt Assistant - - - - Add Tab - Добавить вкладку - - - - Add the currently displayed page as a new bookmark. - Добавить отображаемую страницу в закладки. - - - - Boo&kmarks - &Закладки - - - - Cannot open file for writing! - Не удалось открыть файл для записи! - - - - Close Tab - Закрыть вкладку - - - - Close the current window. - Закрыть текущее окно. - - - - Display further information about Qt Assistant. - Показать дополнительную информацию о Qt Assistant. - - - - Displays the main page of a specific documentation set. - Открывает стартовую страницу выбранного набора документации. - - - - E&xit - В&ыход - - - - Failed to open about application contents in file: '%1' - Не удалось получить информацию о приложении из файла: '%1' - - - - Find &Next - Найти &следующее - - - - Find &Previous - Найти &предыдущее - - - - Font Settings... - Настройки шрифта... - - - - Go - Перейти - - - - Go to the home page. Qt Assistant's home page is the Qt Reference Documentation. - Перейти на домашнюю страницу. Домашная страница Qt Assistant - Справочная документация по Qt. - - - - Go to the next page. - Переход на следующую страницу. - - - - Initializing Qt Assistant... - Инициализация Qt Assistant... - - - - Minimize - Свернуть - - - - New Window - Новое окно - - - - Next Tab - Следующая вкладка - - - - Open a new window. - Открыть новое окно. - - - - Open the Find dialog. Qt Assistant will search the currently displayed page for the text you enter. - Открыть окно поиска. Qt Assistant произведёт поиск введённого текста на отображаемой странице. - - - - Previous Tab - Предыдущая вкладка - - - - Print the currently displayed page. - Печатать отображаемую страницу. - - - - - Qt Assistant - Qt Assistant - - - - Qt Assistant Manual - Руководство по Qt Assistant - - - - Qt Assistant by Nokia - Qt Assistant от Nokia - - - - Quit Qt Assistant. - Выйти из Qt Assistant. - - - - - Save Page - Сохранить страницу - - - - Save Page As... - Сохранить страницу как... - - - - Select the page in contents tab. - Выбрать страницу во вкладке содержания. - - - - Sidebar - Боковая панель - - - - Sync with Table of Contents - Синхронизировать с содержанием - - - - Toolbar - Панель инструментов - - - - Views - Виды - - - - What's This? - Что это? - - - - Zoom &in - У&величить - - - - Zoom &out - У&меньшить - - - - Zoom in on the document, i.e. increase the font size. - Увеличить размер шрифта. - - - - Zoom out on the document, i.e. decrease the font size. - Уменьшить размер шрифта. - - - - Ctrl+M - - - - - SHIFT+CTRL+= - - - - - Ctrl+T - - - - - Ctrl+I - - - - - Ctrl+B - - - - - Ctrl+S - - - - - Ctrl+] - - - - - Ctrl+[ - - - - - Ctrl+P - - - - - Ctrl+Q - - - - - Copy the selected text to the clipboard. - Скопировать выделенный текст в буфер обмена. - - - - Ctrl+C - - - - - Ctrl+F - - - - - F3 - - - - - Shift+F3 - - - - - Ctrl+Home - - - - - Go to the previous page. - Переход на предыдущую страницу. - - - - Alt+Left - - - - - Alt+Right - - - - - Ctrl++ - - - - - Ctrl+- - - - - - Ctrl+N - - - - - Ctrl+W - - - - - Shift+F1 - - - - - Ctrl+Alt+N - - - - - Ctrl+Alt+Right - - - - - Ctrl+Alt+Left - - - - - Ctrl+Alt+Q - - - - - F1 - - - - - Ctrl+Alt+S - - - - - QObject - - - Qt Assistant by Nokia - Qt Assistant от Nokia - - - - TabbedBrowser - - - ... - ... - - - - <img src=":/trolltech/assistant/images/wrap.png">&nbsp;Search wrapped - <img src=":/trolltech/assistant/images/wrap.png">&nbsp;Поиск с начала - - - - Add page - Добавить вкладку - - - - Case Sensitive - Учитывать регистр - - - - Close Other Tabs - Закрыть остальные вкладки - - - - Close Tab - Закрыть вкладку - - - - Close page - Закрыть вкладку - - - - New Tab - Новая вкладка - - - - Next - Следующее - - - - Previous - Предыдущее - - - - Untitled - Безымянный - - - - Whole words - Слова целиком - - - - TabbedBrowser - - - - - TopicChooser - - - &Close - &Закрыть - - - - &Display - &Показать - - - - &Topics - &Разделы - - - - Choose Topic - Выбор раздела - - - - Choose a topic for <b>%1</b> - Выберите раздел для <b>%1</b> - - - - Close the Dialog. - Закрыть диалог. - - - - Displays a list of available help topics for the keyword. - Показывает список доступных разделов справки, найденных по ключевому слову. - - - - Open the topic selected in the list. - Открыть выбранный раздел. - - - - Select a topic from the list and click the <b>Display</b>-button to open the online help. - Выберите раздел из списка и нажмите на кнопку <b>Показать</b> для открытия онлайн справки. - - - diff --git a/translations/assistant_adp_untranslated.ts b/translations/assistant_adp_untranslated.ts deleted file mode 100644 index e6c927a..0000000 --- a/translations/assistant_adp_untranslated.ts +++ /dev/null @@ -1,967 +0,0 @@ - - - - - AssistantServer - - - Qt Assistant - - - - - Failed to bind to port %1 - - - - - FontPanel - - - Font - - - - - &Writing system - - - - - &Family - - - - - &Style - - - - - &Point size - - - - - FontSettingsDialog - - - Font Settings - - - - - Font settings for: - - - - - Browser - - - - - Application - - - - - Use custom settings - - - - - HelpDialog - - - Con&tents - - - - - - - Qt Assistant - - - - - Open Link in Current Tab - - - - - Open Link in New Window - - - - - Open Link in New Tab - - - - - - Prepare... - - - - - Failed to load keyword index file -Assistant will not work! - - - - - Cannot open the index file %1 - - - - - - - Warning - - - - - - Documentation file %1 does not exist! -Skipping file. - - - - - - Parse Error - - - - - Documentation file %1 is not compatible! -Skipping file. - - - - - - Done - - - - - Failed to save fulltext search index -Assistant will not work! - - - - - Indexing files... - - - - - Reading dictionary... - - - - - - Full Text Search - - - - - Using a wildcard within phrases is not allowed. - - - - - The closing quotation mark is missing. - - - - - %n document(s) found. - - - - - - - Help - - - - - <b>Help</b><p>Choose the topic you want help on from the contents list, or search the index for keywords.</p> - - - - - Displays help topics organized by category, index or bookmarks. Another tab inherits the full text search. - - - - - <b>Help topics organized by category.</b><p>Double-click an item to see the topics in that category. To view a topic, just double-click it.</p> - - - - - column 1 - - - - - &Index - - - - - &Look For: - - - - - Enter keyword - - - - - <b>Enter a keyword.</b><p>The list will select an item that matches the entered string best.</p> - - - - - <b>List of available help topics.</b><p>Double-click on an item to open its help page. If more than one is found, you must specify which page you want.</p> - - - - - &Bookmarks - - - - - Displays the list of bookmarks. - - - - - Add new bookmark - - - - - Add the currently displayed page as a new bookmark. - - - - - &New - - - - - Delete bookmark - - - - - Delete the selected bookmark. - - - - - &Delete - - - - - &Search - - - - - Searching f&or: - - - - - Enter searchword(s). - - - - - <b>Enter search word(s).</b><p>Enter here the word(s) you are looking for. The words may contain wildcards (*). For a sequence of words quote them.</p> - - - - - <b>Found documents</b><p>This list contains all found documents from the last search. The documents are ordered, i.e. the first document has the most matches.</p> - - - - - Found &Documents: - - - - - Display the help page. - - - - - Display the help page for the full text search. - - - - - He&lp - - - - - Start searching. - - - - - Pressing this button starts the search. - - - - - Preparing... - - - - - HelpWindow - - - Help - - - - - Open Link in New Window Shift+LMB - - - - - Unable to launch web browser. - - - - - - OK - - - - - Failed to open link: '%1' - - - - - <div align="center"><h1>The page could not be found</h1><br><h3>'%1'</h3></div> - - - - - Error... - - - - - Copy &Link Location - - - - - Open Link in New Tab - - - - - Index - - - Untitled - - - - - MainWindow - - - Toolbar - - - - - &Print... - - - - - E&xit - - - - - &Copy - - - - - &Find in Text... - - - - - &Home - - - - - &Previous - - - - - &Next - - - - - About Qt - - - - - Zoom &in - - - - - Zoom &out - - - - - New Window - - - - - Ctrl+T - - - - - Ctrl+I - - - - - Ctrl+B - - - - - - Qt Assistant - - - - - &Add Bookmark - - - - - Sidebar - - - - - &Window - - - - - Minimize - - - - - Ctrl+M - - - - - Initializing Qt Assistant... - - - - - SHIFT+CTRL+= - - - - - Ctrl+S - - - - - Ctrl+W - - - - - Ctrl+] - - - - - Ctrl+[ - - - - - Views - - - - - Displays the main page of a specific documentation set. - - - - - Failed to open about application contents in file: '%1' - - - - - ... - - - - - - Save Page - - - - - Cannot open file for writing! - - - - - Qt Assistant by Nokia - - - - - Go - - - - - &Help - - - - - &File - - - - - Boo&kmarks - - - - - &Go - - - - - &View - - - - - &Edit - - - - - Print the currently displayed page. - - - - - Ctrl+P - - - - - Quit Qt Assistant. - - - - - Ctrl+Q - - - - - Copy the selected text to the clipboard. - - - - - Ctrl+C - - - - - Open the Find dialog. Qt Assistant will search the currently displayed page for the text you enter. - - - - - Ctrl+F - - - - - Find &Next - - - - - F3 - - - - - Find &Previous - - - - - Shift+F3 - - - - - Go to the home page. Qt Assistant's home page is the Qt Reference Documentation. - - - - - Ctrl+Home - - - - - Go to the previous page. - - - - - Alt+Left - - - - - Go to the next page. - - - - - Alt+Right - - - - - About Qt Assistant - - - - - Display further information about Qt Assistant. - - - - - Zoom in on the document, i.e. increase the font size. - - - - - Ctrl++ - - - - - Zoom out on the document, i.e. decrease the font size. - - - - - Ctrl+- - - - - - Open a new window. - - - - - Ctrl+N - - - - - &Close - - - - - Close the current window. - - - - - Add the currently displayed page as a new bookmark. - - - - - What's This? - - - - - "What's This?" context sensitive help. - - - - - Shift+F1 - - - - - Add Tab - - - - - Ctrl+Alt+N - - - - - Next Tab - - - - - Ctrl+Alt+Right - - - - - Previous Tab - - - - - Ctrl+Alt+Left - - - - - Close Tab - - - - - Ctrl+Alt+Q - - - - - Qt Assistant Manual - - - - - F1 - - - - - Save Page As... - - - - - Ctrl+Alt+S - - - - - Sync with Table of Contents - - - - - Select the page in contents tab. - - - - - Font Settings... - - - - - QObject - - - Qt Assistant by Nokia - - - - - TabbedBrowser - - - ... - - - - - Add page - - - - - Close page - - - - - New Tab - - - - - Close Tab - - - - - Close Other Tabs - - - - - TabbedBrowser - - - - - Untitled - - - - - Previous - - - - - Next - - - - - Case Sensitive - - - - - Whole words - - - - - <img src=":/trolltech/assistant/images/wrap.png">&nbsp;Search wrapped - - - - - TopicChooser - - - Choose a topic for <b>%1</b> - - - - - Choose Topic - - - - - Select a topic from the list and click the <b>Display</b>-button to open the online help. - - - - - &Topics - - - - - Displays a list of available help topics for the keyword. - - - - - &Display - - - - - Open the topic selected in the list. - - - - - &Close - - - - - Close the Dialog. - - - - diff --git a/translations/assistant_adp_zh_CN.ts b/translations/assistant_adp_zh_CN.ts deleted file mode 100644 index 2d8d85c9..0000000 --- a/translations/assistant_adp_zh_CN.ts +++ /dev/null @@ -1,999 +0,0 @@ - - - - - AssistantServer - - - Qt Assistant - Qt 助手 - - - - Failed to bind to port %1 - 绑定到端口%1失败 - - - - FontPanel - - - Font - 字体 - - - - &Writing system - 书写系统(&W) - - - - &Family - 字体族(&F) - - - - &Style - 风格(&S) - - - - &Point size - 点大小(&P) - - - - FontSettingsDialog - - - Font Settings - 字体设置 - - - - Font settings for: - 字体设置用于: - - - - Browser - 浏览器 - - - - Application - 应用程序 - - - - Use custom settings - 使用自定义设置 - - - - HelpDialog - - - Open Link in Current Tab - 在当前标签页打开链接 - - - - Open Link in New Window - 在新窗口中打开链接 - - - - Open Link in New Tab - 在新标签页中打开链接 - - - - - Prepare... - 准备... - - - - - - Qt Assistant - Qt 助手 - - - - Failed to load keyword index file -Assistant will not work! - 加载关键词索引文件失败 -Qt 助手将不能工作! - - - - Cannot open the index file %1 - 无法打开索引文件 %1 - - - - - - Warning - 警告 - - - - - Documentation file %1 does not exist! -Skipping file. - 文档文件 %1 不存在! -跳过文件。 - - - - - Parse Error - 解析错误 - - - - Documentation file %1 is not compatible! -Skipping file. - %1 文档文件不兼容! -跳过文件! - - - - - Done - 完成 - - - - Failed to save fulltext search index -Assistant will not work! - 保存全文搜索索引失败 Qt 助手将不能工作! - - - - Indexing files... - 正在索引文件... - - - - Reading dictionary... - 正在读取词典... - - - - - Full Text Search - 全文搜索 - - - - Using a wildcard within phrases is not allowed. - 不允许在短语中使用通配符。 - - - - The closing quotation mark is missing. - 缺少关闭标点。 - - - - Help - 帮助 - - - - <b>Help</b><p>Choose the topic you want help on from the contents list, or search the index for keywords.</p> - <b>帮助</b><p>在内容列表中选择您需要帮助的主题,或者在索引中搜索这个关键词。</p> - - - - Displays help topics organized by category, index or bookmarks. Another tab inherits the full text search. - 按种类、索引和标签显示帮助主题。另一个标签页中可以执行全文搜索。 - - - - Con&tents - 内容(&T) - - - - <b>Help topics organized by category.</b><p>Double-click an item to see the topics in that category. To view a topic, just double-click it.</p> - <b>按种类组织帮助主题。</b><p>双击一项可以查看那个种类中的主题。要查看一个主题,只要双击它就可以了。</p> - - - - column 1 - 列 1 - - - - &Index - 索引(&I) - - - - &Look For: - 查找(&L): - - - - Enter keyword - 输入关键词 - - - - <b>Enter a keyword.</b><p>The list will select an item that matches the entered string best.</p> - <b>输入一个关键词。</b><p>这个列表将会选择一个和已输入字符串最匹配的一项。</p> - - - - <b>List of available help topics.</b><p>Double-click on an item to open its help page. If more than one is found, you must specify which page you want.</p> - <b>可用的帮助主题列表。</b><p>双击一项打开它的帮助页面。如果找到一个以上的结果,你必须指定你想要打开哪一个。</p> - - - - &Bookmarks - 书签(&B) - - - - Displays the list of bookmarks. - 显示书签列表。 - - - - Add new bookmark - 添加新书签 - - - - Add the currently displayed page as a new bookmark. - 把当前显示的页面添加为一个新书签。 - - - - &New - 新建(&N) - - - - Delete bookmark - 删除书签 - - - - Delete the selected bookmark. - 删除被选中的书签。 - - - - &Delete - 删除(&D) - - - - &Search - 搜索(&S) - - - - Searching f&or: - 正在搜索(&O): - - - - Enter searchword(s). - 输入搜索词。 - - - - <b>Enter search word(s).</b><p>Enter here the word(s) you are looking for. The words may contain wildcards (*). For a sequence of words quote them.</p> - <b>输入搜索词。<b><p>在这里输入您要查找的词。这个词可以包含通配符(*)。如果是一个词的序列,请把它们放在英文引号内。</p> - - - - <b>Found documents</b><p>This list contains all found documents from the last search. The documents are ordered, i.e. the first document has the most matches.</p> - <b>发现文档</b><p>这个列表包含上此搜索发现的所有文档。这些文档已经排序,例如,第一个文档最为匹配。</p> - - - - Found &Documents: - 找到的文档(&D): - - - - Display the help page. - 显示帮助页面。 - - - - Display the help page for the full text search. - 显示全文文本搜索的帮助页面。 - - - - He&lp - 帮助(&L) - - - - Start searching. - 开始搜索。 - - - - Pressing this button starts the search. - 点击这个按钮开始搜索。 - - - - Preparing... - 正在准备... - - - - %n document(s) found. - - %n 个文档已经找到。 - - - - - HelpWindow - - - Help - 帮助 - - - - Unable to launch web browser. - - 不能启动网页浏览器。 - - - - - Failed to open link: '%1' - 打开链接失败:“%1” - - - - <div align="center"><h1>The page could not be found</h1><br><h3>'%1'</h3></div> - <div align="center"><h1>没有找到这个页面</h1><br><h3>“%1”</h3></div> - - - - Error... - 错误... - - - - Open Link in New Window Shift+LMB - 在新窗口中打开链接 Shift+LMB - - - - Open Link in New Tab - 在新标签页中打开链接 - - - - OK - 确定 - - - - Copy &Link Location - 复制链接地址(&L) - - - - Index - - - Untitled - 未命名的 - - - - MainWindow - - - Sidebar - 侧栏 - - - - &Window - 窗口(&W) - - - - Minimize - 最小化 - - - - Ctrl+M - Ctrl+M - - - - Initializing Qt Assistant... - 正在初始化 Qt 助手... - - - - SHIFT+CTRL+= - SHIFT+CTRL+= - - - - Ctrl+T - Ctrl+T - - - - Ctrl+I - Ctrl+I - - - - Ctrl+B - Ctrl+B - - - - Ctrl+S - Ctrl+S - - - - Ctrl+W - Ctrl+W - - - - Ctrl+] - Ctrl+] - - - - Ctrl+[ - Ctrl+[ - - - - Views - 视图 - - - - Displays the main page of a specific documentation set. - 显示一个指定文档集的主页面。 - - - Open Source Edition - 开源版本 - - - This version of Qt Assistant is part of the Qt Open Source Edition, for use in the development of Open Source applications. Qt is a comprehensive C++ framework for cross-platform application development. - 这个版本的 Qt 助手是 Qt 开源版本的一部分,用于开发开源应用程序。Qt 是一个用于跨平台应用程序开发的综合 C++ 框架。 - - - This program is licensed to you under the terms of the Qt Commercial License Agreement. For details, see the file LICENSE that came with this software distribution. - 我们已经允许您在 Qt 商业许可协议下使用本程序。有关细节,请阅读本软件发行中所带的 LICENSE 文件。 - - - - - Qt Assistant - Qt 助手 - - - - Failed to open about application contents in file: '%1' - 在“%1”文件中打开应用程序内容失败 - - - - ... - ... - - - - - Save Page - 保存页面 - - - - Cannot open file for writing! - 不能写打开文件! - - - Qt Assistant by Trolltech - Trolltech 的 Qt 助手 - - - - Qt Assistant by Nokia - Qt助手 - Nokia - - - - Toolbar - 工具栏 - - - - Go - 前往 - - - - &Help - 帮助(&H) - - - - &File - 文件(&F) - - - - Boo&kmarks - 书签(&K) - - - - &Go - 前往(&G) - - - - &View - 查看(&V) - - - - &Edit - 编辑(&E) - - - - &Print... - 打印(&P)... - - - - Print the currently displayed page. - 打印当前显示页面。 - - - - Ctrl+P - Ctrl+P - - - - E&xit - 退出(&X) - - - - Quit Qt Assistant. - 退出 Qt 助手。 - - - - Ctrl+Q - Ctrl+Q - - - - &Copy - 复制(&C) - - - - Copy the selected text to the clipboard. - 复制选中的文本到剪贴板。 - - - - Ctrl+C - Ctrl+C - - - - &Find in Text... - 在文本中查找(&F)... - - - - Open the Find dialog. Qt Assistant will search the currently displayed page for the text you enter. - 打开查找对话框。Qt 助手将会在当前显示页面中搜索您输入的文本。 - - - - Ctrl+F - Ctrl+F - - - - Find &Next - 查找下一个(&N) - - - - F3 - F3 - - - - Find &Previous - 查找上一个(&P) - - - - Shift+F3 - Shift+F3 - - - - &Home - 主页(&H) - - - - Go to the home page. Qt Assistant's home page is the Qt Reference Documentation. - 前往主页。Qt 助手的主页就是 Qt 参考文档。 - - - - Ctrl+Home - Ctrl+Home - - - - &Previous - 上一页(&P) - - - - Go to the previous page. - 前往上一页。 - - - - Alt+Left - Alt+Left - - - - &Next - 下一页(&N) - - - - Go to the next page. - 前往下一页。 - - - - Alt+Right - Alt+Right - - - - About Qt Assistant - 关于 Qt 助手 - - - - Display further information about Qt Assistant. - 显示有关 Qt 助手的更多信息。 - - - - About Qt - 关于 Qt - - - - Zoom &in - 放大(&I) - - - - Zoom in on the document, i.e. increase the font size. - 放大文档,也就是增大字体大小。 - - - - Ctrl++ - Ctrl++ - - - - Zoom &out - 缩小(&O) - - - - Zoom out on the document, i.e. decrease the font size. - 缩小文档,也就是减小字体大小。 - - - - Ctrl+- - Ctrl+- - - - - New Window - 新建窗口 - - - - Open a new window. - 打开一个新窗口。 - - - - Ctrl+N - Ctrl+N - - - - &Close - 关闭(&C) - - - - Close the current window. - 关闭当前窗口。 - - - - &Add Bookmark - 添加书签(&A) - - - - Add the currently displayed page as a new bookmark. - 把当前显示页面添加为一个新书签。 - - - - What's This? - 这是什么? - - - - "What's This?" context sensitive help. - “这是什么?”上下文敏感帮助。 - - - - Shift+F1 - Shift+F1 - - - - Add Tab - 添加标签页 - - - - Ctrl+Alt+N - Ctrl+Alt+N - - - - Next Tab - 下一个标签页 - - - - Ctrl+Alt+Right - Ctrl+Alt+Right - - - - Previous Tab - 前一个标签页 - - - - Ctrl+Alt+Left - Ctrl+Alt+Left - - - - Close Tab - 关闭标签页 - - - - Ctrl+Alt+Q - Ctrl+Alt+Q - - - - Qt Assistant Manual - Qt 助手手册 - - - - F1 - F1 - - - - Save Page As... - 页面另存为... - - - - Ctrl+Alt+S - Ctrl+Alt+S - - - - Sync with Table of Contents - 同步目录 - - - - Select the page in contents tab. - 选择内容标签页中的页面。 - - - - Font Settings... - 字体设置... - - - You need a commercial Qt license for development of proprietary (closed source) applications. Please see <a href="http://qt.nokia.com/company/model">qt.nokia.com/company/model</a> for an overview of Qt licensing. - 开发商业(闭源)应用程序,你需要商业 Qt 许可。对于 Qt 许可的概览,请参考<a href="http://qt.nokia.com/company/model">qt.nokia.com/company/model</a>。 - - - This program is licensed to you under the terms of the Qt %1 License Agreement. For details, see the license file that came with this software distribution. - 我们已经允许您在 Qt %1 许可协议下使用本程序。有关细节,请阅读本软件发行中所带的许可协议文件。 - - - - QObject - - Qt Assistant by Trolltech - Trolltech 的 Qt 助手 - - - - Qt Assistant by Nokia - Qt助手 - Nokia - - - - TabbedBrowser - - - ... - ... - - - - Add page - 添加页面 - - - - Close page - 关闭页面 - - - - TabbedBrowser - 标签页浏览器 - - - - Untitled - 未命名的 - - - - Previous - 上一个 - - - - Next - 下一个 - - - - Case Sensitive - 区分大小写 - - - - Whole words - 整词 - - - - <img src=":/trolltech/assistant/images/wrap.png">&nbsp;Search wrapped - <img src=":/trolltech/assistant/images/wrap.png">&nbsp;搜索已经回环 - - - - New Tab - 新标签页 - - - - Close Tab - 关闭标签页 - - - - Close Other Tabs - 关闭其它标签页 - - - - TopicChooser - - - Choose a topic for <b>%1</b> - 为<b>%1</b>选择一个主题 - - - - Choose Topic - 选择主题 - - - - Select a topic from the list and click the <b>Display</b>-button to open the online help. - 从列表中选择一个主题并且点击<b>显示</b>按钮打开在线帮助。 - - - - &Topics - 主题(&T) - - - - Displays a list of available help topics for the keyword. - 为这个关键词显示一个可用帮助主题的列表。 - - - - &Display - 显示(&D) - - - - Open the topic selected in the list. - 打开列表中选中的主题。 - - - - &Close - 关闭(&C) - - - - Close the Dialog. - 关闭对话框。 - - - diff --git a/translations/assistant_adp_zh_TW.ts b/translations/assistant_adp_zh_TW.ts deleted file mode 100644 index d622d11..0000000 --- a/translations/assistant_adp_zh_TW.ts +++ /dev/null @@ -1,1000 +0,0 @@ - - - - - AssistantServer - - - Qt Assistant - Qt 小幫手 - - - - Failed to bind to port %1 - 無法結合連接埠 %1 - - - - FontPanel - - - Font - 字型 - - - - &Writing system - 寫入系統(&W) - - - - &Family - 家族(&F) - - - - &Style - 風格(&S) - - - - &Point size - 點大小(&P) - - - - FontSettingsDialog - - - Font Settings - 字型設定 - - - - Font settings for: - 字型設定用於: - - - - Browser - 瀏覽器 - - - - Application - 應用程式 - - - - Use custom settings - 使用者自訂設定 - - - - HelpDialog - - - Con&tents - 內容(&T) - - - - - - Qt Assistant - Qt 小幫手 - - - - Open Link in Current Tab - 在目前的分頁開啟連結 - - - - Open Link in New Window - 在新視窗開啟連結 - - - - Open Link in New Tab - 在新分頁開啟連結 - - - - - Prepare... - 準備中... - - - - Failed to load keyword index file -Assistant will not work! - 無法載入關鍵字索引檔 -小幫手將無法運作! - - - - Cannot open the index file %1 - 無法開啟索引檔 %1 - - - - - - Warning - 警告 - - - - - Documentation file %1 does not exist! -Skipping file. - 文件檔 %1 不存在 -將跳過此檔案。 - - - - - Parse Error - 剖析錯誤 - - - - Documentation file %1 is not compatible! -Skipping file. - 文件檔 %1 不相容 -將跳過此檔案。 - - - - - Done - 完成 - - - - Failed to save fulltext search index -Assistant will not work! - 無法儲存全文檢索搜尋索引。 -小幫手將無法運作! - - - - Indexing files... - 建立檔案索引中... - - - - Reading dictionary... - 讀取字典中... - - - - - Full Text Search - 全文檢索 - - - - Using a wildcard within phrases is not allowed. - 在片語中不能使用萬用字元。 - - - - The closing quotation mark is missing. - 沒有關閉引號。 - - - - Help - 說明 - - - - <b>Help</b><p>Choose the topic you want help on from the contents list, or search the index for keywords.</p> - <b>說明</b><p>請從內容清單中選擇您需要說明的主題,或是在索引中搜尋關鍵字。</p> - - - - Displays help topics organized by category, index or bookmarks. Another tab inherits the full text search. - 依分類、索引或書籤來顯示說明主題。另一個分頁會繼承此全文檢索。 - - - - <b>Help topics organized by category.</b><p>Double-click an item to see the topics in that category. To view a topic, just double-click it.</p> - <b>依類別組織說明主題。</b><p>雙擊可以查看該類別中有哪些主題。雙擊該主題可以查看內容。</p> - - - - column 1 - 欄 1 - - - - &Index - 索引(&I) - - - - &Look For: - 搜尋(&L): - - - - Enter keyword - 輸入關鍵字 - - - - <b>Enter a keyword.</b><p>The list will select an item that matches the entered string best.</p> - <b>輸入關鍵字。</b><p>此清單可以選擇最能符合輸入字串的項目。</p> - - - - <b>List of available help topics.</b><p>Double-click on an item to open its help page. If more than one is found, you must specify which page you want.</p> - <b>可用說明主題清單。</b><p>雙擊可以開啟該說明頁面。如果找到一個以上,您必須指定您要看哪一個頁面。</p> - - - - &Bookmarks - 書籤(&B) - - - - Displays the list of bookmarks. - 顯示書籤的清單。 - - - - Add new bookmark - 新增書籤 - - - - Add the currently displayed page as a new bookmark. - 將目前顯示的頁面新增到書籤中。 - - - - &New - 新增(&N) - - - - Delete bookmark - 刪除書籤 - - - - Delete the selected bookmark. - 刪除選取的書籤。 - - - - &Delete - 刪除(&D) - - - - &Search - 搜尋(&S) - - - - Searching f&or: - 搜尋內容(&O): - - - - Enter searchword(s). - 請輸入搜尋關鍵字詞。 - - - - <b>Enter search word(s).</b><p>Enter here the word(s) you are looking for. The words may contain wildcards (*). For a sequence of words quote them.</p> - <b>輸入搜尋關鍵字詞。</b><p>在此輸入您要搜尋的關鍵字詞。可以使用萬用字元 (*)。如果是一個片語,請用引號括起來。</p> - - - - <b>Found documents</b><p>This list contains all found documents from the last search. The documents are ordered, i.e. the first document has the most matches.</p> - <b>找到的文件</b><p>這放清單包含了所有上次搜尋找到的文件。文件會依符合程度排序。</p> - - - - Found &Documents: - 找到的文件(&D): - - - - Display the help page. - 顯示說明頁面。 - - - - Display the help page for the full text search. - 顯示全文檢索的說明頁面。 - - - - He&lp - 說明(&L) - - - - Start searching. - 開始搜尋。 - - - - Pressing this button starts the search. - 按下此按鍵開始搜尋。 - - - - Preparing... - 準備中... - - - - %n document(s) found. - - 找到 %n 個文件。 - - - - - HelpWindow - - - Help - 說明 - - - - Open Link in New Window Shift+LMB - 在新視窗開啟連結 Shift+滑鼠左鍵 - - - - Unable to launch web browser. - - 無法啟動瀏覽器。 - - - - - OK - 確定 - - - - Failed to open link: '%1' - 無法開啟連結:%1 - - - - <div align="center"><h1>The page could not be found</h1><br><h3>'%1'</h3></div> - <div align="center"><h1>找不到該頁面</h1><br><h3>%1</h3></div> - - - - Error... - 錯誤... - - - - Open Link in New Tab - 在新分頁開啟連結 - - - - Copy &Link Location - 複製連結位置(&L) - - - - Index - - - Untitled - 未命名 - - - - MainWindow - - Qt Assistant by Trolltech - Qt 小幫手,Trolltech 公司提供 - - - - Toolbar - 工具列 - - - - &Print... - 列印(&P)... - - - - E&xit - 離開(&X) - - - - &Copy - 複製(&C) - - - - &Find in Text... - 在文字中尋找(&F)... - - - - &Home - 首頁(&H) - - - - &Previous - 前一個(&P) - - - - &Next - 下一個(&N) - - - - About Qt - 關於 Qt - - - - Zoom &in - 放大(&I) - - - - Zoom &out - 縮小(&O) - - - - New Window - 新視窗 - - - - Ctrl+T - Ctrl+T - - - - Ctrl+I - Ctrl+I - - - - Ctrl+B - Ctrl+B - - - - - Qt Assistant - Qt 小幫手 - - - - &Add Bookmark - 新增書籤(&A) - - - - Sidebar - 邊列 - - - - &Window - 視窗(&W) - - - - Minimize - 最小化 - - - - Ctrl+M - Ctrl+M - - - - Initializing Qt Assistant... - 初始化 Qt 小幫手中... - - - - SHIFT+CTRL+= - SHIFT+CTRL+= - - - - Ctrl+S - Ctrl+S - - - - Ctrl+W - Ctrl+W - - - - Ctrl+] - Ctrl+] - - - - Ctrl+[ - Ctrl+[ - - - - Views - 檢視 - - - - Displays the main page of a specific documentation set. - 顯示指定文件集的主頁面。 - - - Open Source Edition - 開放源碼版本 - - - This version of Qt Assistant is part of the Qt Open Source Edition, for use in the development of Open Source applications. Qt is a comprehensive C++ framework for cross-platform application development. - 此版本的 Qt 小幫手是 Qt 開放源碼版本的一部份,只能用於開發開放源碼的應用程式。Qt 為一個跨平台的,強大的 C++ 應用程式開發框架。 - - - This program is licensed to you under the terms of the Qt Commercial License Agreement. For details, see the file LICENSE that came with this software distribution. - 此程式以 Qt 商業授權同意書(Qt Commerical License Agreement)授權給您。詳情請參照 LICENSE 檔。 - - - - Failed to open about application contents in file: '%1' - 無法開啟檔案中應用程式的「關於」內容:%1 - - - - ... - ... - - - - - Save Page - 儲存頁面 - - - - Cannot open file for writing! - 無法開啟檔案以寫入! - - - - Qt Assistant by Nokia - Nokia 提供的 Qt 小幫手 - - - - Go - - - - - &Help - 說明(&H) - - - - &File - 檔案(&F) - - - - Boo&kmarks - 書籤(&K) - - - - &Go - 走(&G) - - - - &View - 檢視(&V) - - - - &Edit - 編輯(&E) - - - - Print the currently displayed page. - 列印目前顯示的頁面。 - - - - Ctrl+P - Ctrl+P - - - - Quit Qt Assistant. - 離開 Qt 小幫手。 - - - - Ctrl+Q - Ctrl+Q - - - - Copy the selected text to the clipboard. - 複製選取的文字到剪貼簿中。 - - - - Ctrl+C - Ctrl+C - - - - Open the Find dialog. Qt Assistant will search the currently displayed page for the text you enter. - 開啟「尋找」對話框。Qt 小幫手會在目前顯示的頁面中搜尋您所輸入的文字。 - - - - Ctrl+F - Ctrl+F - - - - Find &Next - 尋找下一筆(&N) - - - - F3 - F3 - - - - Find &Previous - 尋找上一筆(&P) - - - - Shift+F3 - Shift+F3 - - - - Go to the home page. Qt Assistant's home page is the Qt Reference Documentation. - 回到首頁。Qt 小幫手的首頁為 Qt 參考文件。 - - - - Ctrl+Home - Ctrl+Home - - - - Go to the previous page. - 跳到上一頁。 - - - - Alt+Left - Alt+Left - - - - Go to the next page. - 跳到下一頁。 - - - - Alt+Right - Alt+Right - - - - About Qt Assistant - 關於 Qt 小幫手 - - - - Display further information about Qt Assistant. - 顯示關於 Qt 小幫手的詳情。 - - - - Zoom in on the document, i.e. increase the font size. - 放大文件,也就是加大字型。 - - - - Ctrl++ - Ctrl++ - - - - Zoom out on the document, i.e. decrease the font size. - 縮小文件,也就是縮小字型。 - - - - Ctrl+- - Ctrl+- - - - - Open a new window. - 開啟新視窗。 - - - - Ctrl+N - Ctrl+N - - - - &Close - 關閉(&C) - - - - Close the current window. - 關閉目前的視窗。 - - - - Add the currently displayed page as a new bookmark. - 將目前顯示的頁面新增到書籤中。 - - - - What's This? - 這是什麼? - - - - "What's This?" context sensitive help. - 「這是什麼?」內文說明。 - - - - Shift+F1 - Shift+F1 - - - - Add Tab - 新增分頁 - - - - Ctrl+Alt+N - Ctrl+Alt+N - - - - Next Tab - 下一個分頁 - - - - Ctrl+Alt+Right - Ctrl+Alt+Right - - - - Previous Tab - 前一個分頁 - - - - Ctrl+Alt+Left - Ctrl+Alt+Left - - - - Close Tab - 關閉分頁 - - - - Ctrl+Alt+Q - Ctrl+Alt+Q - - - - Qt Assistant Manual - Qt 小幫手手冊 - - - - F1 - F1 - - - - Save Page As... - 另存頁面為... - - - - Ctrl+Alt+S - Ctrl+Alt+S - - - - Sync with Table of Contents - 與目錄同步 - - - - Select the page in contents tab. - 選擇在內容分頁中的頁面。 - - - - Font Settings... - 字型設定... - - - You need a commercial Qt license for development of proprietary (closed source) applications. Please see <a href="http://qt.nokia.com/company/model">qt.nokia.com/company/model</a> for an overview of Qt licensing. - 您需要商業版的 Qt 授權才能發展私有(封閉)應用程式軟體。關於 Qt 授權的概要,請參考 <a href="http://qt.nokia.com/company/model">qt.nokia.com/company/model</a>。 - - - This program is licensed to you under the terms of the Qt %1 License Agreement. For details, see the license file that came with this software distribution. - 此程式以 Qt %1 授權同意書授權給您。詳情請參照套件中的授權檔。 - - - - QObject - - Qt Assistant by Trolltech - Qt 小幫手,Trolltech 公司提供 - - - - Qt Assistant by Nokia - Nokia 提供的 Qt 小幫手 - - - - TabbedBrowser - - - ... - ... - - - - Add page - 新增頁面 - - - - Close page - 關閉頁面 - - - - New Tab - 新增分頁 - - - - Close Tab - 關閉分頁 - - - - Close Other Tabs - 關閉其他分頁 - - - - TabbedBrowser - 分頁式瀏覽器 - - - - Untitled - 未命名 - - - - Previous - 前一個 - - - - Next - 下一個 - - - - Case Sensitive - 區分大小寫 - - - - Whole words - 整個字詞 - - - - <img src=":/trolltech/assistant/images/wrap.png">&nbsp;Search wrapped - <img src=":/trolltech/assistant/images/wrap.png">&nbsp;搜尋已折回 - - - - TopicChooser - - - Choose a topic for <b>%1</b> - 請為 <b>%1</b> 選擇一個主題 - - - - Choose Topic - 選擇主題 - - - - Select a topic from the list and click the <b>Display</b>-button to open the online help. - 請從清單中選取一個主題,並按下「顯示」鍵開啟線上說明。 - - - - &Topics - 主題(&T) - - - - Displays a list of available help topics for the keyword. - 顯示此關鍵字可用的說明主題。 - - - - &Display - 顯示(&D) - - - - Open the topic selected in the list. - 開啟在清單中選取的主題。 - - - - &Close - 關閉(&C) - - - - Close the Dialog. - 關閉對話框。 - - - diff --git a/translations/translations.pri b/translations/translations.pri index 480849f..bd5f093 100644 --- a/translations/translations.pri +++ b/translations/translations.pri @@ -68,16 +68,11 @@ qm-linguist.depends = sub-tools ts-assistant.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \ ../tools/assistant/translations/translations.pro \ && $$LUPDATE \ - ../tools/assistant/translations/qt_help.pro \ - && $$LUPDATE \ - ../tools/assistant/translations/translations_adp.pro) + ../tools/assistant/translations/qt_help.pro)) ts-assistant.depends = sub-tools qm-assistant.commands = ($$LRELEASE $$QT_SOURCE_TREE/tools/assistant/translations/translations.pro \ - && $$LRELEASE \ - $$QT_SOURCE_TREE/tools/assistant/translations/qt_help.pro \ - && $$LRELEASE \ - $$QT_SOURCE_TREE/tools/assistant/translations/translations_adp.pro) + && $$LRELEASE $$QT_SOURCE_TREE/tools/assistant/translations/qt_help.pro) qm-assistant.depends = sub-tools ###### Qtconfig -- cgit v0.12 From 81be8823182ad9bbf058764eaac328c1009d2ac0 Mon Sep 17 00:00:00 2001 From: kh1 Date: Mon, 31 Aug 2009 17:56:50 +0200 Subject: Remove deprecated Assistant sample code. --- examples/assistant/README | 38 ---- examples/assistant/assistant.pro | 10 - .../simpletextviewer/documentation/about.txt | 9 - .../simpletextviewer/documentation/browse.html | 34 ---- .../simpletextviewer/documentation/filedialog.html | 48 ----- .../simpletextviewer/documentation/findfile.html | 32 --- .../documentation/images/browse.png | Bin 21553 -> 0 bytes .../documentation/images/fadedfilemenu.png | Bin 9589 -> 0 bytes .../documentation/images/filedialog.png | Bin 12318 -> 0 bytes .../documentation/images/handbook.png | Bin 1060 -> 0 bytes .../documentation/images/mainwindow.png | Bin 12769 -> 0 bytes .../simpletextviewer/documentation/images/open.png | Bin 11697 -> 0 bytes .../documentation/images/wildcard.png | Bin 11266 -> 0 bytes .../simpletextviewer/documentation/index.html | 41 ---- .../simpletextviewer/documentation/intro.html | 28 --- .../simpletextviewer/documentation/openfile.html | 36 ---- .../documentation/simpletextviewer.adp | 40 ---- .../documentation/wildcardmatching.html | 57 ------ .../assistant/simpletextviewer/findfiledialog.cpp | 221 --------------------- .../assistant/simpletextviewer/findfiledialog.h | 99 --------- examples/assistant/simpletextviewer/main.cpp | 52 ----- examples/assistant/simpletextviewer/mainwindow.cpp | 154 -------------- examples/assistant/simpletextviewer/mainwindow.h | 91 --------- .../simpletextviewer/simpletextviewer.pro | 18 -- examples/examples.pro | 6 +- 25 files changed, 3 insertions(+), 1011 deletions(-) delete mode 100644 examples/assistant/README delete mode 100644 examples/assistant/assistant.pro delete mode 100644 examples/assistant/simpletextviewer/documentation/about.txt delete mode 100644 examples/assistant/simpletextviewer/documentation/browse.html delete mode 100644 examples/assistant/simpletextviewer/documentation/filedialog.html delete mode 100644 examples/assistant/simpletextviewer/documentation/findfile.html delete mode 100644 examples/assistant/simpletextviewer/documentation/images/browse.png delete mode 100644 examples/assistant/simpletextviewer/documentation/images/fadedfilemenu.png delete mode 100644 examples/assistant/simpletextviewer/documentation/images/filedialog.png delete mode 100644 examples/assistant/simpletextviewer/documentation/images/handbook.png delete mode 100644 examples/assistant/simpletextviewer/documentation/images/mainwindow.png delete mode 100644 examples/assistant/simpletextviewer/documentation/images/open.png delete mode 100644 examples/assistant/simpletextviewer/documentation/images/wildcard.png delete mode 100644 examples/assistant/simpletextviewer/documentation/index.html delete mode 100644 examples/assistant/simpletextviewer/documentation/intro.html delete mode 100644 examples/assistant/simpletextviewer/documentation/openfile.html delete mode 100644 examples/assistant/simpletextviewer/documentation/simpletextviewer.adp delete mode 100644 examples/assistant/simpletextviewer/documentation/wildcardmatching.html delete mode 100644 examples/assistant/simpletextviewer/findfiledialog.cpp delete mode 100644 examples/assistant/simpletextviewer/findfiledialog.h delete mode 100644 examples/assistant/simpletextviewer/main.cpp delete mode 100644 examples/assistant/simpletextviewer/mainwindow.cpp delete mode 100644 examples/assistant/simpletextviewer/mainwindow.h delete mode 100644 examples/assistant/simpletextviewer/simpletextviewer.pro diff --git a/examples/assistant/README b/examples/assistant/README deleted file mode 100644 index 85f5a43..0000000 --- a/examples/assistant/README +++ /dev/null @@ -1,38 +0,0 @@ -Support for interactive help is provided by the Qt Assistant application. -Developers can take advantages of the facilities it offers to display -specially-prepared documentation to users of their applications. - - -The example launcher provided with Qt can be used to explore each of the -examples in this directory. - -Documentation for these examples can be found via the Tutorial and Examples -link in the main Qt documentation. - - -Finding the Qt Examples and Demos launcher -========================================== - -On Windows: - -The launcher can be accessed via the Windows Start menu. Select the menu -entry entitled "Qt Examples and Demos" entry in the submenu containing -the Qt tools. - -On Mac OS X: - -For the binary distribution, the qtdemo executable is installed in the -/Developer/Applications/Qt directory. For the source distribution, it is -installed alongside the other Qt tools on the path specified when Qt is -configured. - -On Unix/Linux: - -The qtdemo executable is installed alongside the other Qt tools on the path -specified when Qt is configured. - -On all platforms: - -The source code for the launcher can be found in the demos/qtdemo directory -in the Qt package. This example is built at the same time as the Qt libraries, -tools, examples, and demonstrations. diff --git a/examples/assistant/assistant.pro b/examples/assistant/assistant.pro deleted file mode 100644 index ff1f947..0000000 --- a/examples/assistant/assistant.pro +++ /dev/null @@ -1,10 +0,0 @@ -TEMPLATE = subdirs -SUBDIRS = simpletextviewer - -# install -target.path = $$[QT_INSTALL_EXAMPLES]/assistant -sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS assistant.pro README -sources.path = $$[QT_INSTALL_EXAMPLES]/assistant -INSTALLS += target sources - -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/assistant/simpletextviewer/documentation/about.txt b/examples/assistant/simpletextviewer/documentation/about.txt deleted file mode 100644 index eeab35f..0000000 --- a/examples/assistant/simpletextviewer/documentation/about.txt +++ /dev/null @@ -1,9 +0,0 @@ -The Simple Text Viewer enables the user to select and view existing -files. - -HTML files is displayed using rich text, while other files are -presented as plain text. The application provides a file dialog -allowing the user to search for files using wildcard matching. The -search is performed within in the specified directory, and the user is -given an option to browse the existing file system to find the -relevant directory. diff --git a/examples/assistant/simpletextviewer/documentation/browse.html b/examples/assistant/simpletextviewer/documentation/browse.html deleted file mode 100644 index 987abf3..0000000 --- a/examples/assistant/simpletextviewer/documentation/browse.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - Browse - - - -

Browse

- -

- The file dialog let you browse the current file system to - specify the directory in which the file you want to open - resides. - Note that only the specified directory will be searched, any - subdirectories will simply be ignored. -

- -
-
- - - - -
- -
-
-

- See also: File Dialog, Wildcard Matching, - Find File -

- - - diff --git a/examples/assistant/simpletextviewer/documentation/filedialog.html b/examples/assistant/simpletextviewer/documentation/filedialog.html deleted file mode 100644 index afa65ed..0000000 --- a/examples/assistant/simpletextviewer/documentation/filedialog.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - File Dialog - - - -

File Dialog

- -

- In the file dialog you can name a particular file name, or - search for files using wildcard matching, i.e. specify a - file name containing wildcards. In addition you must specify - the directory in which the file you search for resides. -

- -
-
- - - - -
- -
-
-

- By default the dialog will search for all files (*) in the - current directory (the directory the application is run from). -

- -

- When editing the file name and directory parameters, an - overview of the matching files are displayed in the - dialog. The overview is updated whenever the parameters - change. -

- -
-
-

- See also: Browse, Wildcard Matching, - Find File -

- - - - diff --git a/examples/assistant/simpletextviewer/documentation/findfile.html b/examples/assistant/simpletextviewer/documentation/findfile.html deleted file mode 100644 index 32e0147..0000000 --- a/examples/assistant/simpletextviewer/documentation/findfile.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - Find File - - - -

Find File

- -

- To open and view a file in the Simple Text Viewer, select the - 'Open...' option in the 'File' menu. The application will then - provide you with a file dialog that you can use to search for - any existing file. -

- -
-
- - - - -
- -
-
-

- See also: Open File, File Dialog -

- - - diff --git a/examples/assistant/simpletextviewer/documentation/images/browse.png b/examples/assistant/simpletextviewer/documentation/images/browse.png deleted file mode 100644 index 86db6b1..0000000 Binary files a/examples/assistant/simpletextviewer/documentation/images/browse.png and /dev/null differ diff --git a/examples/assistant/simpletextviewer/documentation/images/fadedfilemenu.png b/examples/assistant/simpletextviewer/documentation/images/fadedfilemenu.png deleted file mode 100644 index fde0e43..0000000 Binary files a/examples/assistant/simpletextviewer/documentation/images/fadedfilemenu.png and /dev/null differ diff --git a/examples/assistant/simpletextviewer/documentation/images/filedialog.png b/examples/assistant/simpletextviewer/documentation/images/filedialog.png deleted file mode 100644 index 883a33a..0000000 Binary files a/examples/assistant/simpletextviewer/documentation/images/filedialog.png and /dev/null differ diff --git a/examples/assistant/simpletextviewer/documentation/images/handbook.png b/examples/assistant/simpletextviewer/documentation/images/handbook.png deleted file mode 100644 index 3bd2b92..0000000 Binary files a/examples/assistant/simpletextviewer/documentation/images/handbook.png and /dev/null differ diff --git a/examples/assistant/simpletextviewer/documentation/images/mainwindow.png b/examples/assistant/simpletextviewer/documentation/images/mainwindow.png deleted file mode 100644 index c28d5e9..0000000 Binary files a/examples/assistant/simpletextviewer/documentation/images/mainwindow.png and /dev/null differ diff --git a/examples/assistant/simpletextviewer/documentation/images/open.png b/examples/assistant/simpletextviewer/documentation/images/open.png deleted file mode 100644 index 1e5bba3..0000000 Binary files a/examples/assistant/simpletextviewer/documentation/images/open.png and /dev/null differ diff --git a/examples/assistant/simpletextviewer/documentation/images/wildcard.png b/examples/assistant/simpletextviewer/documentation/images/wildcard.png deleted file mode 100644 index 6e83a56..0000000 Binary files a/examples/assistant/simpletextviewer/documentation/images/wildcard.png and /dev/null differ diff --git a/examples/assistant/simpletextviewer/documentation/index.html b/examples/assistant/simpletextviewer/documentation/index.html deleted file mode 100644 index 5a7b1d5..0000000 --- a/examples/assistant/simpletextviewer/documentation/index.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - Manual - - - -

Simple Text Viewer

- -

- The Simple Text Viewer enables the user to select and view - existing files. -

- -

- -

- -

- HTML files is displayed using rich text, while - other files are presented as plain text. The application - provides a file dialog allowing the user to search for files - using wildcard matching. The search is performed within in the - specified directory, and the user is given an option to browse - the existing file system to find the relevant directory. -

- - - - - - - diff --git a/examples/assistant/simpletextviewer/documentation/intro.html b/examples/assistant/simpletextviewer/documentation/intro.html deleted file mode 100644 index 2e2aa40..0000000 --- a/examples/assistant/simpletextviewer/documentation/intro.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - Manual - - - -

Simple Text Viewer

- -

- The Simple Text Viewer enables the user to select and view - existing files. -

- -

- -

- -

- The application provides its own custom documentation that is - available through the Help menu in the main window's menubar - and through the Help button in the application's find file - dialog. -

- - - - diff --git a/examples/assistant/simpletextviewer/documentation/openfile.html b/examples/assistant/simpletextviewer/documentation/openfile.html deleted file mode 100644 index e172de9..0000000 --- a/examples/assistant/simpletextviewer/documentation/openfile.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - Open File - - - -

Open File

- -

- Once the file you want to view appears in the dialog's - display, you can open it in two different ways. -

- -

- By pressing the 'Open' button the currently selected file will - be opened. By default, the first file in the list of matching - files is selected. Another way of opening a file is to simply - double click the displayed file name. -

- -
-
- - - - -
- -
-
-

- See also: Find File -

- - diff --git a/examples/assistant/simpletextviewer/documentation/simpletextviewer.adp b/examples/assistant/simpletextviewer/documentation/simpletextviewer.adp deleted file mode 100644 index 660df4f..0000000 --- a/examples/assistant/simpletextviewer/documentation/simpletextviewer.adp +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - simpletextviewer - Simple Text Viewer - images/handbook.png - index.html - About Simple Text Viewer - about.txt - . - - - -
- Display - Rich text - Plain text - Find - File menu - File name - File dialog - File globbing - Wildcard matching - Wildcard syntax - Browse - Directory - Open - Select - -
-
-
-
-
- - - - diff --git a/examples/assistant/simpletextviewer/documentation/wildcardmatching.html b/examples/assistant/simpletextviewer/documentation/wildcardmatching.html deleted file mode 100644 index eb1839a..0000000 --- a/examples/assistant/simpletextviewer/documentation/wildcardmatching.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - Wildcard Matching - - - -

Wildcard Matching

- -

- Most command shells such as bash or cmd.exe support "file - globbing", the ability to identify a group of files by using - wildcards. - -
-
- - - - -
- -
-
-

- Wildcard matching provides four features: -

- -
    -
  • Any character represents itself apart from those - mentioned below. Thus 'c' matches the character 'c'. -
  • -
  • The '?' character matches any single character.
  • -
  • The '*' matches zero or more of any characters.
  • -
  • Sets of characters can be represented in square brackets. - Within the character class, like outside, backslash - has no special meaning. -
  • -
- -

- For example we could identify HTML files with - *.html. This will match zero or more characters - followed by a dot followed by 'h', 't', 'm' and 'l'. -

- -
-
-

- See also: Browse, File Dialog, - Find File -

- - - - - diff --git a/examples/assistant/simpletextviewer/findfiledialog.cpp b/examples/assistant/simpletextviewer/findfiledialog.cpp deleted file mode 100644 index 81be206..0000000 --- a/examples/assistant/simpletextviewer/findfiledialog.cpp +++ /dev/null @@ -1,221 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -#include "findfiledialog.h" - -//! [0] -FindFileDialog::FindFileDialog(QTextEdit *editor, QAssistantClient *assistant, - QWidget *parent) - : QDialog(parent) -{ - currentAssistantClient = assistant; - currentEditor = editor; -//! [0] - - createButtons(); - createComboBoxes(); - createFilesTree(); - createLabels(); - createLayout(); - - directoryComboBox->addItem(QDir::toNativeSeparators(QDir::currentPath())); - fileNameComboBox->addItem("*"); - findFiles(); - - setWindowTitle(tr("Find File")); -//! [1] -} -//! [1] - -void FindFileDialog::browse() -{ - QString currentDirectory = directoryComboBox->currentText(); - QString newDirectory = QFileDialog::getExistingDirectory(this, - tr("Select Directory"), currentDirectory); - if (!newDirectory.isEmpty()) { - directoryComboBox->addItem(QDir::toNativeSeparators(newDirectory)); - directoryComboBox->setCurrentIndex(directoryComboBox->count() - 1); - update(); - } -} - -//! [2] -void FindFileDialog::help() -{ - currentAssistantClient->showPage(QLibraryInfo::location(QLibraryInfo::ExamplesPath) + - QDir::separator() + "assistant/simpletextviewer/documentation/filedialog.html"); -} -//! [2] - -void FindFileDialog::openFile(QTreeWidgetItem *item) -{ - if (!item) { - item = foundFilesTree->currentItem(); - if (!item) - return; - } - - QString fileName = item->text(0); - QString path = directoryComboBox->currentText() + QDir::separator(); - - QFile file(path + fileName); - if (file.open(QIODevice::ReadOnly)) { - QString data(file.readAll()); - - if (fileName.endsWith(".html")) - currentEditor->setHtml(data); - else - currentEditor->setPlainText(data); - } - close(); -} - -void FindFileDialog::update() -{ - findFiles(); - buttonBox->button(QDialogButtonBox::Open)->setEnabled( - foundFilesTree->topLevelItemCount() > 0); -} - -void FindFileDialog::findFiles() -{ - QRegExp filePattern(fileNameComboBox->currentText() + "*"); - filePattern.setPatternSyntax(QRegExp::Wildcard); - - QDir directory(directoryComboBox->currentText()); - - QStringList allFiles = directory.entryList(QDir::Files | QDir::NoSymLinks); - QStringList matchingFiles; - - foreach (QString file, allFiles) { - if (filePattern.exactMatch(file)) - matchingFiles << file; - } - showFiles(matchingFiles); -} - -void FindFileDialog::showFiles(const QStringList &files) -{ - foundFilesTree->clear(); - - for (int i = 0; i < files.count(); ++i) { - QTreeWidgetItem *item = new QTreeWidgetItem(foundFilesTree); - item->setText(0, files[i]); - } - - if (files.count() > 0) - foundFilesTree->setCurrentItem(foundFilesTree->topLevelItem(0)); -} - -void FindFileDialog::createButtons() -{ - browseButton = new QToolButton; - browseButton->setText(tr("...")); - connect(browseButton, SIGNAL(clicked()), this, SLOT(browse())); - - buttonBox = new QDialogButtonBox(QDialogButtonBox::Open - | QDialogButtonBox::Cancel - | QDialogButtonBox::Help); - connect(buttonBox, SIGNAL(accepted()), this, SLOT(openFile())); - connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); - connect(buttonBox, SIGNAL(helpRequested()), this, SLOT(help())); -} - -void FindFileDialog::createComboBoxes() -{ - directoryComboBox = new QComboBox; - fileNameComboBox = new QComboBox; - - fileNameComboBox->setEditable(true); - fileNameComboBox->setSizePolicy(QSizePolicy::Expanding, - QSizePolicy::Preferred); - - directoryComboBox->setMinimumContentsLength(30); - directoryComboBox->setSizeAdjustPolicy( - QComboBox::AdjustToMinimumContentsLength); - directoryComboBox->setSizePolicy(QSizePolicy::Expanding, - QSizePolicy::Preferred); - - connect(fileNameComboBox, SIGNAL(editTextChanged(const QString &)), - this, SLOT(update())); - connect(directoryComboBox, SIGNAL(currentIndexChanged(const QString &)), - this, SLOT(update())); -} - -void FindFileDialog::createFilesTree() -{ - foundFilesTree = new QTreeWidget; - foundFilesTree->setColumnCount(1); - foundFilesTree->setHeaderLabels(QStringList(tr("Matching Files"))); - foundFilesTree->setRootIsDecorated(false); - foundFilesTree->setSelectionMode(QAbstractItemView::SingleSelection); - - connect(foundFilesTree, SIGNAL(itemActivated(QTreeWidgetItem *, int)), - this, SLOT(openFile(QTreeWidgetItem *))); -} - -void FindFileDialog::createLabels() -{ - directoryLabel = new QLabel(tr("Search in:")); - fileNameLabel = new QLabel(tr("File name (including wildcards):")); -} - -void FindFileDialog::createLayout() -{ - QHBoxLayout *fileLayout = new QHBoxLayout; - fileLayout->addWidget(fileNameLabel); - fileLayout->addWidget(fileNameComboBox); - - QHBoxLayout *directoryLayout = new QHBoxLayout; - directoryLayout->addWidget(directoryLabel); - directoryLayout->addWidget(directoryComboBox); - directoryLayout->addWidget(browseButton); - - QVBoxLayout *mainLayout = new QVBoxLayout; - mainLayout->addLayout(fileLayout); - mainLayout->addLayout(directoryLayout); - mainLayout->addWidget(foundFilesTree); - mainLayout->addStretch(); - mainLayout->addWidget(buttonBox); - setLayout(mainLayout); -} diff --git a/examples/assistant/simpletextviewer/findfiledialog.h b/examples/assistant/simpletextviewer/findfiledialog.h deleted file mode 100644 index d8783ae..0000000 --- a/examples/assistant/simpletextviewer/findfiledialog.h +++ /dev/null @@ -1,99 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef FINDFILEDIALOG_H -#define FINDFILEDIALOG_H - -#include -#include - -QT_BEGIN_NAMESPACE -class QComboBox; -class QDialogButtonBox; -class QLabel; -class QTextEdit; -class QToolButton; -class QTreeWidget; -class QTreeWidgetItem; -QT_END_NAMESPACE - -//! [0] -class FindFileDialog : public QDialog -{ - Q_OBJECT - -public: - FindFileDialog(QTextEdit *editor, QAssistantClient *assistant, - QWidget *parent = 0); - -private slots: - void browse(); - void help(); - void openFile(QTreeWidgetItem *item = 0); - void update(); - -private: - void findFiles(); - void showFiles(const QStringList &files); - - void createButtons(); - void createComboBoxes(); - void createFilesTree(); - void createLabels(); - void createLayout(); - - QAssistantClient *currentAssistantClient; - QTextEdit *currentEditor; - QTreeWidget *foundFilesTree; - - QComboBox *directoryComboBox; - QComboBox *fileNameComboBox; - - QLabel *directoryLabel; - QLabel *fileNameLabel; - - QDialogButtonBox *buttonBox; - - QToolButton *browseButton; -}; -//! [0] - -#endif diff --git a/examples/assistant/simpletextviewer/main.cpp b/examples/assistant/simpletextviewer/main.cpp deleted file mode 100644 index 07e786f..0000000 --- a/examples/assistant/simpletextviewer/main.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -#include "mainwindow.h" - -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - MainWindow window; - window.show(); - return app.exec(); -} diff --git a/examples/assistant/simpletextviewer/mainwindow.cpp b/examples/assistant/simpletextviewer/mainwindow.cpp deleted file mode 100644 index 6046571..0000000 --- a/examples/assistant/simpletextviewer/mainwindow.cpp +++ /dev/null @@ -1,154 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -#include "mainwindow.h" -#include "findfiledialog.h" - -//! [0] -MainWindow::MainWindow() -{ - textViewer = new QTextEdit; - textViewer->setReadOnly(true); - QFile file("documentation/intro.html"); - if (file.open(QIODevice::ReadOnly)) - textViewer->setHtml(file.readAll()); - - setCentralWidget(textViewer); - - createActions(); - createMenus(); - - initializeAssistant(); - - setWindowTitle(tr("Simple Text Viewer")); - resize(750, 400); -} -//! [0] - -//! [1] -void MainWindow::closeEvent(QCloseEvent *) -{ - if (assistantClient) - assistantClient->closeAssistant(); -} -//! [1] - -void MainWindow::about() -{ - QMessageBox::about(this, tr("About Simple Text Viewer"), - tr("This example demonstrates how to use\n" \ - "Qt Assistant as help system for your\n" \ - "own application.")); -} - -//! [2] -void MainWindow::assistant() -{ - assistantClient->showPage(QLibraryInfo::location(QLibraryInfo::ExamplesPath) + - QDir::separator() + - "assistant/simpletextviewer/documentation/index.html"); -} -//! [2] - -//! [3] -void MainWindow::open() -{ - FindFileDialog dialog(textViewer, assistantClient); - dialog.exec(); -} -//! [3] - -void MainWindow::createActions() -{ - assistantAct = new QAction(tr("Help Contents"), this); - assistantAct->setShortcuts(QKeySequence::HelpContents); - connect(assistantAct, SIGNAL(triggered()), this, SLOT(assistant())); - - openAct = new QAction(tr("&Open..."), this); - openAct->setShortcuts(QKeySequence::Open); - connect(openAct, SIGNAL(triggered()), this, SLOT(open())); - - clearAct = new QAction(tr("&Clear"), this); - clearAct->setShortcut(tr("Ctrl+C")); - connect(clearAct, SIGNAL(triggered()), textViewer, SLOT(clear())); - - exitAct = new QAction(tr("E&xit"), this); - exitAct->setShortcuts(QKeySequence::Quit); - connect(exitAct, SIGNAL(triggered()), this, SLOT(close())); - - aboutAct = new QAction(tr("&About"), this); - connect(aboutAct, SIGNAL(triggered()), this, SLOT(about())); - - aboutQtAct = new QAction(tr("About &Qt"), this); - connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt())); -} - -void MainWindow::createMenus() -{ - fileMenu = new QMenu(tr("&File"), this); - fileMenu->addAction(openAct); - fileMenu->addAction(clearAct); - fileMenu->addSeparator(); - fileMenu->addAction(exitAct); - - helpMenu = new QMenu(tr("&Help"), this); - helpMenu->addAction(assistantAct); - helpMenu->addSeparator(); - helpMenu->addAction(aboutAct); - helpMenu->addAction(aboutQtAct); - - - menuBar()->addMenu(fileMenu); - menuBar()->addMenu(helpMenu); -} - -//! [4] -void MainWindow::initializeAssistant() -{ - assistantClient = new QAssistantClient(QLibraryInfo::location(QLibraryInfo::BinariesPath), this); - - QStringList arguments; - arguments << "-profile" << QString("documentation") + QDir::separator() + QString("simpletextviewer.adp"); - assistantClient->setArguments(arguments); -} -//! [4] diff --git a/examples/assistant/simpletextviewer/mainwindow.h b/examples/assistant/simpletextviewer/mainwindow.h deleted file mode 100644 index b68c0fd..0000000 --- a/examples/assistant/simpletextviewer/mainwindow.h +++ /dev/null @@ -1,91 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#include -#include -#include - -class MainWindow : public QMainWindow -{ - Q_OBJECT - -public: - MainWindow(); - -private slots: - void about(); -//! [0] - void assistant(); -//! [0] - void open(); - -protected: -//! [1] - void closeEvent(QCloseEvent *event); -//! [1] - -private: - void createActions(); - void createMenus(); -//! [2] - void initializeAssistant(); -//! [2] - -//! [3] - QAssistantClient *assistantClient; -//! [3] - QTextEdit *textViewer; - - QMenu *fileMenu; - QMenu *helpMenu; - - QAction *assistantAct; - QAction *clearAct; - QAction *openAct; - QAction *exitAct; - QAction *aboutAct; - QAction *aboutQtAct; -}; - -#endif diff --git a/examples/assistant/simpletextviewer/simpletextviewer.pro b/examples/assistant/simpletextviewer/simpletextviewer.pro deleted file mode 100644 index 2c0eada..0000000 --- a/examples/assistant/simpletextviewer/simpletextviewer.pro +++ /dev/null @@ -1,18 +0,0 @@ -CONFIG += assistant - -QT += network - -HEADERS = mainwindow.h \ - findfiledialog.h -SOURCES = main.cpp \ - mainwindow.cpp \ - findfiledialog.cpp - -# install -target.path = $$[QT_INSTALL_EXAMPLES]/assistant/simpletextviewer -sources.files = $$SOURCES $$HEADERS $$RESOURCES documentation *.pro -sources.path = $$[QT_INSTALL_EXAMPLES]/assistant/simpletextviewer -INSTALLS += target sources - -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) - diff --git a/examples/examples.pro b/examples/examples.pro index 7acd67b..feda04d 100644 --- a/examples/examples.pro +++ b/examples/examples.pro @@ -49,10 +49,10 @@ contains(QT_CONFIG, phonon):!static: SUBDIRS += phonon contains(QT_CONFIG, webkit): SUBDIRS += webkit embedded:SUBDIRS += qws !wince*:!symbian: { - !contains(QT_EDITION, Console):contains(QT_BUILD_PARTS, tools):SUBDIRS += designer - contains(QT_BUILD_PARTS, tools):SUBDIRS += assistant qtestlib help + !contains(QT_EDITION, Console):contains(QT_BUILD_PARTS, tools):SUBDIRS += designer + contains(QT_BUILD_PARTS, tools):SUBDIRS += qtestlib help } else { - contains(QT_BUILD_PARTS, tools):SUBDIRS += qtestlib + contains(QT_BUILD_PARTS, tools):SUBDIRS += qtestlib } contains(QT_CONFIG, opengl): SUBDIRS += opengl contains(QT_CONFIG, openvg): SUBDIRS += openvg -- cgit v0.12 From aba48884511d6f5b276b012d3e6346d9bd7bfd3a Mon Sep 17 00:00:00 2001 From: kh1 Date: Mon, 31 Aug 2009 18:01:21 +0200 Subject: Remove traces of deprecated Assistant and AssistantClient. --- doc/src/deployment/deployment.qdoc | 11 +-- doc/src/modules.qdoc | 154 +++++++++++++++----------------- doc/src/qt4-intro.qdoc | 4 +- tools/qdoc3/test/qt-build-docs.qdocconf | 8 +- tools/qdoc3/test/qt-inc.qdocconf | 10 +-- tools/qdoc3/test/qt.qdocconf | 6 +- 6 files changed, 92 insertions(+), 101 deletions(-) diff --git a/doc/src/deployment/deployment.qdoc b/doc/src/deployment/deployment.qdoc index 2acc69b..d8a03d6 100644 --- a/doc/src/deployment/deployment.qdoc +++ b/doc/src/deployment/deployment.qdoc @@ -87,29 +87,30 @@ \header \o {4,1} Qt's Libraries \row - \o \l {QtAssistant} \o \l {QAxContainer} \o \l {QAxServer} \o \l {QtCore} - \row \o \l {QtDBus} + \row \o \l {QtDesigner} \o \l {QtGui} \o \l {QtHelp} - \row \o \l {QtNetwork} + \row \o \l {QtOpenGL} \o \l {QtScript} \o \l {QtScriptTools} - \row \o \l {QtSql} + \row \o \l {QtSvg} \o \l {QtWebKit} \o \l {QtXml} - \row \o \l {QtXmlPatterns} + \row \o \l {Phonon Module}{Phonon} \o \l {Qt3Support} + \o \l {} + \o \l {} \endtable Since Qt is not a system library, it has to be redistributed along diff --git a/doc/src/modules.qdoc b/doc/src/modules.qdoc index 05ff6bc..c222268 100644 --- a/doc/src/modules.qdoc +++ b/doc/src/modules.qdoc @@ -288,33 +288,33 @@ */ /*! - \module QtScript - \title QtScript Module - \since 4.3 - \contentspage All Qt Modules - \previouspage QtOpenVG - \nextpage QtScriptTools - \ingroup modules + \module QtScript + \title QtScript Module + \since 4.3 + \contentspage All Qt Modules + \previouspage QtOpenVG + \nextpage QtScriptTools + \ingroup modules - \brief The QtScript module provides classes for making Qt applications scriptable. + \brief The QtScript module provides classes for making Qt applications scriptable. - The QtScript module only provides core scripting facilities; the - QtScriptTools module provides additional Qt Script-related - components that application developers may find useful. + The QtScript module only provides core scripting facilities; the + QtScriptTools module provides additional Qt Script-related + components that application developers may find useful. - \tableofcontents + \tableofcontents - To include the definitions of the module's classes, use the - following directive: + To include the definitions of the module's classes, use the + following directive: - \snippet doc/src/snippets/code/doc_src_qtscript.qdoc 0 + \snippet doc/src/snippets/code/doc_src_qtscript.qdoc 0 - To link against the module, add this line to your \l qmake \c .pro file: + To link against the module, add this line to your \l qmake \c .pro file: - \snippet doc/src/snippets/code/doc_src_qtscript.qdoc 1 + \snippet doc/src/snippets/code/doc_src_qtscript.qdoc 1 - The QtScript module is part of the \l{Qt Full Framework Edition} and the - \l{Open Source Versions of Qt}. + The QtScript module is part of the \l{Qt Full Framework Edition} and the + \l{Open Source Versions of Qt}. */ /*! @@ -370,59 +370,59 @@ */ /*! - \module QtSvg - \title QtSvg Module - \since 4.1 - \contentspage All Qt Modules - \previouspage QtSql - \nextpage QtWebKit - \ingroup modules - - \brief The QtSvg module provides classes for displaying the contents of SVG - files. - - To include the definitions of the module's classes, use the - following directive: - - \snippet doc/src/snippets/code/doc_src_qtsvg.qdoc 0 - - To link against the module, add this line to your \l qmake \c - .pro file: - - \snippet doc/src/snippets/code/doc_src_qtsvg.qdoc 1 - - The QtSvg module is part of the \l{Qt Full Framework Edition} and the - \l{Open Source Versions of Qt}. - - \section1 License Information - - Some code for arc handling in this module is derived from code with - the following license: - - \legalese - Copyright 2002 USC/Information Sciences Institute - - Permission to use, copy, modify, distribute, and sell this software - and its documentation for any purpose is hereby granted without - fee, provided that the above copyright notice appear in all copies - and that both that copyright notice and this permission notice - appear in supporting documentation, and that the name of - Information Sciences Institute not be used in advertising or - publicity pertaining to distribution of the software without - specific, written prior permission. Information Sciences Institute - makes no representations about the suitability of this software for - any purpose. It is provided "as is" without express or implied - warranty. - - INFORMATION SCIENCES INSTITUTE DISCLAIMS ALL WARRANTIES WITH REGARD - TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL INFORMATION SCIENCES - INSTITUTE BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL - DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA - OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. - \endlegalese + \module QtSvg + \title QtSvg Module + \since 4.1 + \contentspage All Qt Modules + \previouspage QtSql + \nextpage QtWebKit + \ingroup modules + + \brief The QtSvg module provides classes for displaying the contents of SVG + files. + + To include the definitions of the module's classes, use the + following directive: + + \snippet doc/src/snippets/code/doc_src_qtsvg.qdoc 0 + + To link against the module, add this line to your \l qmake \c + .pro file: + + \snippet doc/src/snippets/code/doc_src_qtsvg.qdoc 1 + + The QtSvg module is part of the \l{Qt Full Framework Edition} and the + \l{Open Source Versions of Qt}. + + \section1 License Information + + Some code for arc handling in this module is derived from code with + the following license: + + \legalese + Copyright 2002 USC/Information Sciences Institute + + Permission to use, copy, modify, distribute, and sell this software + and its documentation for any purpose is hereby granted without + fee, provided that the above copyright notice appear in all copies + and that both that copyright notice and this permission notice + appear in supporting documentation, and that the name of + Information Sciences Institute not be used in advertising or + publicity pertaining to distribution of the software without + specific, written prior permission. Information Sciences Institute + makes no representations about the suitability of this software for + any purpose. It is provided "as is" without express or implied + warranty. + + INFORMATION SCIENCES INSTITUTE DISCLAIMS ALL WARRANTIES WITH REGARD + TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL INFORMATION SCIENCES + INSTITUTE BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL + DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA + OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + \endlegalese */ /*! @@ -1000,13 +1000,3 @@ ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." \endlegalese */ - -/*! - \page qtassistant.html - \title QtAssistant - - This module is no longer needed. Use the QtHelp module to integrate documentation - into your application. - - \sa {QtHelp} -*/ diff --git a/doc/src/qt4-intro.qdoc b/doc/src/qt4-intro.qdoc index 13e57bc..789deab 100644 --- a/doc/src/qt4-intro.qdoc +++ b/doc/src/qt4-intro.qdoc @@ -225,9 +225,9 @@ \row \o \l{Qt3Support} \o Qt 3 support classes \row \o \l{QAxContainer} \o ActiveQt client extension \row \o \l{QAxServer} \o ActiveQt server extension - \row \o \l{QtAssistant} \o Classes for launching Qt Assistant + \row \o \l{QtHelp} \o Classes for integrating online documentation in applications \row \o \l{QtDesigner} \o Classes for extending and embedding Qt Designer - \row \o \l{QtUiTools} \o Classes for dynamic GUI generation + \row \o \l{QtUiTools} \o Classes for dynamic GUI generation \row \o \l{QtTest} \o Tool classes for unit testing \endtable diff --git a/tools/qdoc3/test/qt-build-docs.qdocconf b/tools/qdoc3/test/qt-build-docs.qdocconf index 70e3b4f..d8a9057 100644 --- a/tools/qdoc3/test/qt-build-docs.qdocconf +++ b/tools/qdoc3/test/qt-build-docs.qdocconf @@ -10,10 +10,10 @@ url = http://qt.nokia.com/doc/4.6 edition.Console.modules = QtCore QtDBus QtNetwork QtScript QtSql QtXml \ QtXmlPatterns QtTest -edition.Desktop.modules = QtCore QtDBus QtGui QtNetwork QtOpenGL QtScript QtSql QtSvg \ - QtWebKit QtXml QtXmlPatterns Qt3Support QtHelp \ - QtDesigner QtAssistant QAxContainer Phonon \ - QAxServer QtUiTools QtTest QtDBus +edition.Desktop.modules = QtCore QtDBus QtGui QtNetwork QtOpenGL QtScript QtSql \ + QtSvg QtWebKit QtXml QtXmlPatterns Qt3Support QtHelp \ + QtDesigner QAxContainer Phonon QAxServer QtUiTools \ + QtTest QtDBus edition.DesktopLight.modules = QtCore QtDBus QtGui Qt3SupportLight QtTest edition.DesktopLight.groups = -graphicsview-api diff --git a/tools/qdoc3/test/qt-inc.qdocconf b/tools/qdoc3/test/qt-inc.qdocconf index 4ef32b8..617a8ca 100644 --- a/tools/qdoc3/test/qt-inc.qdocconf +++ b/tools/qdoc3/test/qt-inc.qdocconf @@ -6,9 +6,9 @@ description = Qt Reference Documentation url = http://qt.nokia.com/doc/4.6 edition.Console = QtCore QtNetwork QtSql QtXml QtScript QtTest -edition.Desktop = QtCore QtGui QtNetwork QtOpenGL QtSql QtSvg QtXml QtScript \ - QtDesigner QtAssistant Qt3Support QAxContainer \ - QAxServer QtUiTools QtTest QtDBus +edition.Desktop = QtCore QtGui QtNetwork QtOpenGL QtSql QtSvg QtXml \ + QtScript QtDesigner Qt3Support QAxContainer QAxServer \ + QtUiTools QtTest QtDBus edition.DesktopLight = QtCore QtGui Qt3SupportLight QtTest language = Cpp @@ -100,8 +100,8 @@ Cpp.ignoretokens = QAXFACTORY_EXPORT \ Q_TYPENAME \ Q_XML_EXPORT \ QDBUS_EXPORT \ - Q_GADGET \ - QWEBKIT_EXPORT + Q_GADGET \ + QWEBKIT_EXPORT Cpp.ignoredirectives = Q_DECLARE_HANDLE \ Q_DECLARE_INTERFACE \ Q_DECLARE_METATYPE \ diff --git a/tools/qdoc3/test/qt.qdocconf b/tools/qdoc3/test/qt.qdocconf index 942d023..43e69d5 100644 --- a/tools/qdoc3/test/qt.qdocconf +++ b/tools/qdoc3/test/qt.qdocconf @@ -12,9 +12,9 @@ url = http://qt.nokia.com/doc/4.6 edition.Console.modules = QtCore QtDBus QtNetwork QtScript QtSql QtXml \ QtXmlPatterns QtTest -edition.Desktop.modules = QtCore QtDBus QtGui QtNetwork QtOpenGL QtScript QtScriptTools QtSql QtSvg \ - QtWebKit QtXml QtXmlPatterns Qt3Support QtHelp \ - QtDesigner QtAssistant QAxContainer Phonon \ +edition.Desktop.modules = QtCore QtDBus QtGui QtNetwork QtOpenGL QtScript \ + QtScriptTools QtSql QtSvg QtWebKit QtXml QtXmlPatterns \ + Qt3Support QtHelp QtDesigner QAxContainer Phonon \ QAxServer QtUiTools QtTest QtDBus edition.DesktopLight.modules = QtCore QtDBus QtGui Qt3SupportLight QtTest edition.DesktopLight.groups = -graphicsview-api -- cgit v0.12 From 005313b799037c7262c0cb0071b82b5f16236a6a Mon Sep 17 00:00:00 2001 From: kh1 Date: Mon, 31 Aug 2009 18:03:18 +0200 Subject: There will be no more Assistant and AssistantClient. --- tools/porting/src/q3porting.xml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tools/porting/src/q3porting.xml b/tools/porting/src/q3porting.xml index 5f4a160..f3fa0e5 100644 --- a/tools/porting/src/q3porting.xml +++ b/tools/porting/src/q3porting.xml @@ -1626,10 +1626,6 @@ Q3Wizard - QtAssistant - QAssistantClient - - QtCore QAbstractEventDispatcher -- cgit v0.12 From c8fa42b2475980763f24b0df17a6fde5fe4a0c86 Mon Sep 17 00:00:00 2001 From: kh1 Date: Mon, 31 Aug 2009 18:04:04 +0200 Subject: Remove deprecated Assistant and AssistantClient. --- bin/syncqt | 3 +- mkspecs/features/assistant.prf | 9 - tools/assistant/assistant.pro | 4 +- tools/assistant/compat/Info_mac.plist | 18 - tools/assistant/compat/LICENSE.GPL | 280 ---- tools/assistant/compat/assistant.icns | Bin 162568 -> 0 bytes tools/assistant/compat/assistant.ico | Bin 355574 -> 0 bytes tools/assistant/compat/assistant.pro | 84 -- tools/assistant/compat/assistant.qrc | 37 - tools/assistant/compat/assistant.rc | 1 - tools/assistant/compat/compat.pro | 84 -- tools/assistant/compat/config.cpp | 438 ------- tools/assistant/compat/config.h | 165 --- tools/assistant/compat/docuparser.cpp | 433 ------- tools/assistant/compat/docuparser.h | 166 --- tools/assistant/compat/fontsettingsdialog.cpp | 137 -- tools/assistant/compat/fontsettingsdialog.h | 77 -- tools/assistant/compat/helpdialog.cpp | 1331 -------------------- tools/assistant/compat/helpdialog.h | 184 --- tools/assistant/compat/helpdialog.ui | 404 ------ tools/assistant/compat/helpwindow.cpp | 247 ---- tools/assistant/compat/helpwindow.h | 100 -- tools/assistant/compat/images/assistant-128.png | Bin 6448 -> 0 bytes tools/assistant/compat/images/assistant.png | Bin 2034 -> 0 bytes tools/assistant/compat/images/close.png | Bin 406 -> 0 bytes tools/assistant/compat/images/designer.png | Bin 1282 -> 0 bytes tools/assistant/compat/images/linguist.png | Bin 1382 -> 0 bytes tools/assistant/compat/images/mac/addtab.png | Bin 469 -> 0 bytes tools/assistant/compat/images/mac/book.png | Bin 1477 -> 0 bytes tools/assistant/compat/images/mac/closetab.png | Bin 516 -> 0 bytes tools/assistant/compat/images/mac/editcopy.png | Bin 1468 -> 0 bytes tools/assistant/compat/images/mac/find.png | Bin 1836 -> 0 bytes tools/assistant/compat/images/mac/home.png | Bin 1807 -> 0 bytes tools/assistant/compat/images/mac/next.png | Bin 1310 -> 0 bytes tools/assistant/compat/images/mac/prev.png | Bin 1080 -> 0 bytes tools/assistant/compat/images/mac/print.png | Bin 2087 -> 0 bytes tools/assistant/compat/images/mac/synctoc.png | Bin 1838 -> 0 bytes tools/assistant/compat/images/mac/whatsthis.png | Bin 1586 -> 0 bytes tools/assistant/compat/images/mac/zoomin.png | Bin 1696 -> 0 bytes tools/assistant/compat/images/mac/zoomout.png | Bin 1662 -> 0 bytes tools/assistant/compat/images/qt.png | Bin 1422 -> 0 bytes tools/assistant/compat/images/win/addtab.png | Bin 314 -> 0 bytes tools/assistant/compat/images/win/book.png | Bin 1109 -> 0 bytes tools/assistant/compat/images/win/closetab.png | Bin 375 -> 0 bytes tools/assistant/compat/images/win/editcopy.png | Bin 1325 -> 0 bytes tools/assistant/compat/images/win/find.png | Bin 1944 -> 0 bytes tools/assistant/compat/images/win/home.png | Bin 1414 -> 0 bytes tools/assistant/compat/images/win/next.png | Bin 1038 -> 0 bytes tools/assistant/compat/images/win/previous.png | Bin 898 -> 0 bytes tools/assistant/compat/images/win/print.png | Bin 1456 -> 0 bytes tools/assistant/compat/images/win/synctoc.png | Bin 1235 -> 0 bytes tools/assistant/compat/images/win/whatsthis.png | Bin 1040 -> 0 bytes tools/assistant/compat/images/win/zoomin.png | Bin 1208 -> 0 bytes tools/assistant/compat/images/win/zoomout.png | Bin 1226 -> 0 bytes tools/assistant/compat/images/wrap.png | Bin 500 -> 0 bytes tools/assistant/compat/index.cpp | 581 --------- tools/assistant/compat/index.h | 133 -- tools/assistant/compat/lib/lib.pro | 78 -- tools/assistant/compat/lib/qassistantclient.cpp | 446 ------- tools/assistant/compat/lib/qassistantclient.h | 100 -- .../assistant/compat/lib/qassistantclient_global.h | 63 - tools/assistant/compat/main.cpp | 465 ------- tools/assistant/compat/mainwindow.cpp | 888 ------------- tools/assistant/compat/mainwindow.h | 137 -- tools/assistant/compat/mainwindow.ui | 459 ------- tools/assistant/compat/profile.cpp | 196 --- tools/assistant/compat/profile.h | 95 -- tools/assistant/compat/tabbedbrowser.cpp | 530 -------- tools/assistant/compat/tabbedbrowser.h | 122 -- tools/assistant/compat/tabbedbrowser.ui | 233 ---- tools/assistant/compat/topicchooser.cpp | 101 -- tools/assistant/compat/topicchooser.h | 77 -- tools/assistant/compat/topicchooser.ui | 162 --- .../assistant/compat/translations/translations.pro | 34 - 74 files changed, 2 insertions(+), 9100 deletions(-) delete mode 100644 mkspecs/features/assistant.prf delete mode 100644 tools/assistant/compat/Info_mac.plist delete mode 100644 tools/assistant/compat/LICENSE.GPL delete mode 100644 tools/assistant/compat/assistant.icns delete mode 100644 tools/assistant/compat/assistant.ico delete mode 100644 tools/assistant/compat/assistant.pro delete mode 100644 tools/assistant/compat/assistant.qrc delete mode 100644 tools/assistant/compat/assistant.rc delete mode 100644 tools/assistant/compat/compat.pro delete mode 100644 tools/assistant/compat/config.cpp delete mode 100644 tools/assistant/compat/config.h delete mode 100644 tools/assistant/compat/docuparser.cpp delete mode 100644 tools/assistant/compat/docuparser.h delete mode 100644 tools/assistant/compat/fontsettingsdialog.cpp delete mode 100644 tools/assistant/compat/fontsettingsdialog.h delete mode 100644 tools/assistant/compat/helpdialog.cpp delete mode 100644 tools/assistant/compat/helpdialog.h delete mode 100644 tools/assistant/compat/helpdialog.ui delete mode 100644 tools/assistant/compat/helpwindow.cpp delete mode 100644 tools/assistant/compat/helpwindow.h delete mode 100644 tools/assistant/compat/images/assistant-128.png delete mode 100644 tools/assistant/compat/images/assistant.png delete mode 100644 tools/assistant/compat/images/close.png delete mode 100644 tools/assistant/compat/images/designer.png delete mode 100644 tools/assistant/compat/images/linguist.png delete mode 100644 tools/assistant/compat/images/mac/addtab.png delete mode 100644 tools/assistant/compat/images/mac/book.png delete mode 100644 tools/assistant/compat/images/mac/closetab.png delete mode 100644 tools/assistant/compat/images/mac/editcopy.png delete mode 100644 tools/assistant/compat/images/mac/find.png delete mode 100644 tools/assistant/compat/images/mac/home.png delete mode 100644 tools/assistant/compat/images/mac/next.png delete mode 100644 tools/assistant/compat/images/mac/prev.png delete mode 100644 tools/assistant/compat/images/mac/print.png delete mode 100644 tools/assistant/compat/images/mac/synctoc.png delete mode 100644 tools/assistant/compat/images/mac/whatsthis.png delete mode 100644 tools/assistant/compat/images/mac/zoomin.png delete mode 100644 tools/assistant/compat/images/mac/zoomout.png delete mode 100644 tools/assistant/compat/images/qt.png delete mode 100644 tools/assistant/compat/images/win/addtab.png delete mode 100644 tools/assistant/compat/images/win/book.png delete mode 100644 tools/assistant/compat/images/win/closetab.png delete mode 100644 tools/assistant/compat/images/win/editcopy.png delete mode 100644 tools/assistant/compat/images/win/find.png delete mode 100644 tools/assistant/compat/images/win/home.png delete mode 100644 tools/assistant/compat/images/win/next.png delete mode 100644 tools/assistant/compat/images/win/previous.png delete mode 100644 tools/assistant/compat/images/win/print.png delete mode 100644 tools/assistant/compat/images/win/synctoc.png delete mode 100644 tools/assistant/compat/images/win/whatsthis.png delete mode 100644 tools/assistant/compat/images/win/zoomin.png delete mode 100644 tools/assistant/compat/images/win/zoomout.png delete mode 100644 tools/assistant/compat/images/wrap.png delete mode 100644 tools/assistant/compat/index.cpp delete mode 100644 tools/assistant/compat/index.h delete mode 100644 tools/assistant/compat/lib/lib.pro delete mode 100644 tools/assistant/compat/lib/qassistantclient.cpp delete mode 100644 tools/assistant/compat/lib/qassistantclient.h delete mode 100644 tools/assistant/compat/lib/qassistantclient_global.h delete mode 100644 tools/assistant/compat/main.cpp delete mode 100644 tools/assistant/compat/mainwindow.cpp delete mode 100644 tools/assistant/compat/mainwindow.h delete mode 100644 tools/assistant/compat/mainwindow.ui delete mode 100644 tools/assistant/compat/profile.cpp delete mode 100644 tools/assistant/compat/profile.h delete mode 100644 tools/assistant/compat/tabbedbrowser.cpp delete mode 100644 tools/assistant/compat/tabbedbrowser.h delete mode 100644 tools/assistant/compat/tabbedbrowser.ui delete mode 100644 tools/assistant/compat/topicchooser.cpp delete mode 100644 tools/assistant/compat/topicchooser.h delete mode 100644 tools/assistant/compat/topicchooser.ui delete mode 100644 tools/assistant/compat/translations/translations.pro diff --git a/bin/syncqt b/bin/syncqt index 01c519e..b83ab55 100755 --- a/bin/syncqt +++ b/bin/syncqt @@ -36,7 +36,6 @@ my %modules = ( # path to module name map "Qt3Support" => "$basedir/src/qt3support", "ActiveQt" => "$basedir/src/activeqt/container;$basedir/src/activeqt/control;$basedir/src/activeqt/shared", "QtTest" => "$basedir/src/testlib", - "QtAssistant" => "$basedir/tools/assistant/compat/lib", "QtHelp" => "$basedir/tools/assistant/lib", "QtDesigner" => "$basedir/tools/designer/src/lib", "QtUiTools" => "$basedir/tools/designer/src/uitools", @@ -653,7 +652,7 @@ my @ignore_for_master_contents = ( "qt.h", "qpaintdevicedefs.h" ); my @ignore_for_include_check = ( "qatomic.h" ); my @ignore_for_qt_begin_header_check = ( "qiconset.h", "qconfig.h", "qconfig-dist.h", "qconfig-large.h", "qconfig-medium.h", "qconfig-minimal.h", "qconfig-small.h", "qfeatures.h", "qt_windows.h" ); my @ignore_for_qt_begin_namespace_check = ( "qconfig.h", "qconfig-dist.h", "qconfig-large.h", "qconfig-medium.h", "qconfig-minimal.h", "qconfig-small.h", "qfeatures.h", "qatomic_arch.h", "qatomic_windowsce.h", "qt_windows.h", "qatomic_macosx.h" ); -my @ignore_for_qt_module_check = ( "$modules{QtCore}/arch", "$modules{QtCore}/global", "$modules{QtSql}/drivers", "$modules{QtTest}", "$modules{QtAssistant}", "$modules{QtDesigner}", "$modules{QtUiTools}", "$modules{QtDBus}", "$modules{phonon}" ); +my @ignore_for_qt_module_check = ( "$modules{QtCore}/arch", "$modules{QtCore}/global", "$modules{QtSql}/drivers", "$modules{QtTest}", "$modules{QtDesigner}", "$modules{QtUiTools}", "$modules{QtDBus}", "$modules{phonon}" ); foreach (@modules_to_sync) { #iteration info diff --git a/mkspecs/features/assistant.prf b/mkspecs/features/assistant.prf deleted file mode 100644 index 25e5d4d..0000000 --- a/mkspecs/features/assistant.prf +++ /dev/null @@ -1,9 +0,0 @@ - -INCLUDEPATH = $$QMAKE_INCDIR_QT/QtAssistant $$INCLUDEPATH - -mac:!static:contains(QT_CONFIG, qt_framework) { - qtAddLibrary(QtAssistant) -} else { - qtAddLibrary(QtAssistantClient) -} -QT += network diff --git a/tools/assistant/assistant.pro b/tools/assistant/assistant.pro index 08d0d4b..97196b2 100644 --- a/tools/assistant/assistant.pro +++ b/tools/assistant/assistant.pro @@ -3,6 +3,4 @@ CONFIG += ordered SUBDIRS += lib/fulltextsearch \ lib \ - tools \ - compat \ - compat/lib \ \ No newline at end of file + tools diff --git a/tools/assistant/compat/Info_mac.plist b/tools/assistant/compat/Info_mac.plist deleted file mode 100644 index b1e6336..0000000 --- a/tools/assistant/compat/Info_mac.plist +++ /dev/null @@ -1,18 +0,0 @@ - - - - - CFBundleIconFile - @ICON@ - CFBundlePackageType - APPL - CFBundleGetInfoString - Created by Qt/QMake - CFBundleSignature - ???? - CFBundleIdentifier - com.trolltech.assistant-compat - CFBundleExecutable - @EXECUTABLE@ - - diff --git a/tools/assistant/compat/LICENSE.GPL b/tools/assistant/compat/LICENSE.GPL deleted file mode 100644 index b6e1c33..0000000 --- a/tools/assistant/compat/LICENSE.GPL +++ /dev/null @@ -1,280 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS diff --git a/tools/assistant/compat/assistant.icns b/tools/assistant/compat/assistant.icns deleted file mode 100644 index 6291dd3..0000000 Binary files a/tools/assistant/compat/assistant.icns and /dev/null differ diff --git a/tools/assistant/compat/assistant.ico b/tools/assistant/compat/assistant.ico deleted file mode 100644 index 9e1b83f..0000000 Binary files a/tools/assistant/compat/assistant.ico and /dev/null differ diff --git a/tools/assistant/compat/assistant.pro b/tools/assistant/compat/assistant.pro deleted file mode 100644 index e865d6b..0000000 --- a/tools/assistant/compat/assistant.pro +++ /dev/null @@ -1,84 +0,0 @@ -include($$QT_SOURCE_TREE/tools/shared/fontpanel/fontpanel.pri) - -TEMPLATE = app -LANGUAGE = C++ -TARGET = assistant_adp - -CONFIG += qt warn_on - -unix:contains(QT_CONFIG, dbus):QT += dbus - -build_all:!build_pass { - CONFIG -= build_all - CONFIG += release -} -QT += xml network - -PROJECTNAME = Assistant -DESTDIR = ../../../bin - -FORMS += helpdialog.ui \ - mainwindow.ui \ - tabbedbrowser.ui \ - topicchooser.ui - -SOURCES += main.cpp \ - helpwindow.cpp \ - topicchooser.cpp \ - docuparser.cpp \ - index.cpp \ - profile.cpp \ - config.cpp \ - helpdialog.cpp \ - mainwindow.cpp \ - tabbedbrowser.cpp \ - fontsettingsdialog.cpp - -HEADERS += helpwindow.h \ - topicchooser.h \ - docuparser.h \ - index.h \ - profile.h \ - helpdialog.h \ - mainwindow.h \ - tabbedbrowser.h \ - config.h \ - fontsettingsdialog.h - -RESOURCES += assistant.qrc - -contains(QT_PRODUCT, OpenSource.*):DEFINES *= QT_OPENSOURCE -DEFINES += QT_KEYWORDS -#DEFINES += QT_PALMTOPCENTER_DOCS - -win32 { - !wince*:LIBS += -lshell32 - RC_FILE = assistant.rc -} - -mac { - ICON = assistant.icns - TARGET = Assistant_adp - QMAKE_INFO_PLIST = Info_mac.plist -} - -target.path=$$[QT_INSTALL_BINS] -INSTALLS += target - -TRANSLATIONS = assistant_de.ts - -unix:!contains(QT_CONFIG, zlib):LIBS += -lz - -contains(CONFIG, static): { - win32 { - exists($$[QT_INSTALL_PLUGINS]/imageformats/qjpeg.lib) { - QTPLUGIN += qjpeg - DEFINES += USE_STATIC_JPEG_PLUGIN - } - } else { - exists($$[QT_INSTALL_PLUGINS]/imageformats/qjpeg.a) { - QTPLUGIN += qjpeg - DEFINES += USE_STATIC_JPEG_PLUGIN - } - } -} diff --git a/tools/assistant/compat/assistant.qrc b/tools/assistant/compat/assistant.qrc deleted file mode 100644 index dae1f48..0000000 --- a/tools/assistant/compat/assistant.qrc +++ /dev/null @@ -1,37 +0,0 @@ - - - images/assistant-128.png - images/assistant.png - images/close.png - images/designer.png - images/linguist.png - images/mac/addtab.png - images/mac/book.png - images/mac/closetab.png - images/mac/editcopy.png - images/mac/find.png - images/mac/home.png - images/mac/next.png - images/mac/prev.png - images/mac/print.png - images/mac/synctoc.png - images/mac/whatsthis.png - images/mac/zoomin.png - images/mac/zoomout.png - images/qt.png - images/win/addtab.png - images/win/book.png - images/win/closetab.png - images/win/editcopy.png - images/win/find.png - images/win/home.png - images/win/next.png - images/win/previous.png - images/win/print.png - images/win/synctoc.png - images/win/whatsthis.png - images/win/zoomin.png - images/win/zoomout.png - images/wrap.png - - diff --git a/tools/assistant/compat/assistant.rc b/tools/assistant/compat/assistant.rc deleted file mode 100644 index b4786ce..0000000 --- a/tools/assistant/compat/assistant.rc +++ /dev/null @@ -1 +0,0 @@ -IDI_ICON1 ICON DISCARDABLE "assistant.ico" diff --git a/tools/assistant/compat/compat.pro b/tools/assistant/compat/compat.pro deleted file mode 100644 index 1086f4c..0000000 --- a/tools/assistant/compat/compat.pro +++ /dev/null @@ -1,84 +0,0 @@ -include($$QT_SOURCE_TREE/tools/shared/fontpanel/fontpanel.pri) - -TEMPLATE = app -LANGUAGE = C++ -TARGET = assistant_adp - -CONFIG += qt warn_on - -unix:contains(QT_CONFIG, dbus):QT += dbus - -build_all:!build_pass { - CONFIG -= build_all - CONFIG += release -} -QT += xml network - -PROJECTNAME = Assistant -DESTDIR = ../../../bin - -FORMS += helpdialog.ui \ - mainwindow.ui \ - tabbedbrowser.ui \ - topicchooser.ui - -SOURCES += main.cpp \ - helpwindow.cpp \ - topicchooser.cpp \ - docuparser.cpp \ - index.cpp \ - profile.cpp \ - config.cpp \ - helpdialog.cpp \ - mainwindow.cpp \ - tabbedbrowser.cpp \ - fontsettingsdialog.cpp - -HEADERS += helpwindow.h \ - topicchooser.h \ - docuparser.h \ - index.h \ - profile.h \ - helpdialog.h \ - mainwindow.h \ - tabbedbrowser.h \ - config.h \ - fontsettingsdialog.h - -RESOURCES += assistant.qrc - -contains(QT_PRODUCT, OpenSource.*):DEFINES *= QT_OPENSOURCE -DEFINES += QT_KEYWORDS -#DEFINES += QT_PALMTOPCENTER_DOCS - -win32 { - LIBS += -lshell32 - RC_FILE = assistant.rc -} - -mac { - ICON = assistant.icns - TARGET = Assistant_adp -# QMAKE_INFO_PLIST = Info_mac.plist -} - -target.path=$$[QT_INSTALL_BINS] -INSTALLS += target - -TRANSLATIONS = assistant_de.ts - -unix:!contains(QT_CONFIG, zlib):LIBS += -lz - -contains(CONFIG, static): { - win32 { - exists($$[QT_INSTALL_PLUGINS]/imageformats/qjpeg.lib) { - QTPLUGIN += qjpeg - DEFINES += USE_STATIC_JPEG_PLUGIN - } - } else { - exists($$[QT_INSTALL_PLUGINS]/imageformats/qjpeg.a) { - QTPLUGIN += qjpeg - DEFINES += USE_STATIC_JPEG_PLUGIN - } - } -} diff --git a/tools/assistant/compat/config.cpp b/tools/assistant/compat/config.cpp deleted file mode 100644 index 1ca0209..0000000 --- a/tools/assistant/compat/config.cpp +++ /dev/null @@ -1,438 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "config.h" -#include "profile.h" -#include "docuparser.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -static Config *static_configuration = 0; - -inline QString getVersionString() -{ - return QString::number( (QT_VERSION >> 16) & 0xff ) - + QLatin1String(".") + QString::number( (QT_VERSION >> 8) & 0xff ); -} - -Config::Config() - : profil( 0 ), hideSidebar( false ), rebuildDocs(true) -{ - if( !static_configuration ) { - static_configuration = this; - } else { - qWarning( "Multiple configurations not allowed!" ); - } -} - -Config *Config::loadConfig(const QString &profileFileName) -{ - Config *config = new Config(); - - if (profileFileName.isEmpty()) { // no profile - if (!config->defaultProfileExists()) { - config->profil = Profile::createDefaultProfile(); - config->saveProfile(config->profil); - } else { - config->profil = new Profile(); - } - config->loadDefaultProfile(); - config->load(); - return config; - } - - QFile file(profileFileName); - if (!file.exists()) { - qWarning( "File does not exist: %s", qPrintable(profileFileName) ); - return 0; - } - DocuParser *parser = DocuParser::createParser( profileFileName ); - if (!parser) { - qWarning( "Failed to create parser for file: %s", qPrintable(profileFileName) ); - return 0; - } - if (parser->parserVersion() < DocuParser::Qt320) { - qWarning( "File does not contain profile information" ); - return 0; - } - DocuParser320 *profileParser = static_cast(parser); - parser->parse(&file); - config->profil = profileParser->profile(); - if (!config->profil) { - qWarning( "Config::loadConfig(), no profile in: %s", qPrintable(profileFileName) ); - return 0; - } - config->profil->setProfileType(Profile::UserProfile); - config->profil->setDocuParser(profileParser); - config->load(); - return config; -} - -Config *Config::configuration() -{ - Q_ASSERT( static_configuration ); - return static_configuration; -} - -void Config::load() -{ - const QString key = getVersionString() + QLatin1String("/"); - - bool isDefaultProfile = profil->props[QLatin1String("name")] == QLatin1String("default"); - const QString pKey = isDefaultProfile ? QString::fromLatin1(QT_VERSION_STR) - : getVersionString(); - - const QString profkey = pKey + QLatin1String("/Profile/") + profil->props[QLatin1String("name")] + QLatin1String("/"); - - QSettings settings; - - home = profil->props[QLatin1String("startpage")];; - if (home.isEmpty() && isDefaultProfile) - home = QLibraryInfo::location(QLibraryInfo::DocumentationPath) + QLatin1String("/html/index.html"); - src = settings.value( profkey + QLatin1String("Source") ).toStringList(); - sideBar = settings.value( key + QLatin1String("SideBarPage") ).toInt(); - if (qApp->type() != QApplication::Tty) - winGeometry = settings.value(key + QLatin1String("windowGeometry")).toByteArray(); - - mainWinState = settings.value(key + QLatin1String("MainWindowState")).toByteArray(); - pointFntSize = settings.value(key + QLatin1String("FontSize"), qApp->font().pointSizeF()).toDouble(); - rebuildDocs = settings.value( key + QLatin1String("RebuildDocDB"), true ).toBool(); - - profileNames = settings.value( key + QLatin1String("Profile") ).toStringList(); - - m_fontSettings.windowFont = qVariantValue(settings.value(key + QLatin1String("windowfont"), qApp->font())); - m_fontSettings.browserFont = qVariantValue(settings.value(key + QLatin1String("browserfont"), qApp->font())); - m_fontSettings.useWindowFont = settings.value(key + QLatin1String("usewindowfont"), false).toBool(); - m_fontSettings.useBrowserFont = settings.value(key + QLatin1String("usebrowserfont"), false).toBool(); - m_fontSettings.windowWritingSystem = static_cast( - settings.value(key + QLatin1String("windowwritingsystem"), QFontDatabase::Latin).toInt()); - m_fontSettings.browserWritingSystem = static_cast( - settings.value(key + QLatin1String("browserwritingsystem"), QFontDatabase::Latin).toInt()); - - m_fontSettings.browserFont.setPointSizeF(pointFntSize); -} - -void Config::save() -{ - saveSettings(); - saveProfile( profil ); -} - -void Config::saveSettings() -{ - const QString key = getVersionString() + QLatin1String("/"); - - const QString pKey = (profil->props[QLatin1String("name")] == QLatin1String("default")) - ? QString::fromLatin1(QT_VERSION_STR) - : getVersionString(); - - const QString profkey = pKey + QLatin1String("/Profile/") + profil->props[QLatin1String("name")] + QLatin1String("/"); - - QSettings settings; - - settings.setValue( profkey + QLatin1String("Source"), src ); - settings.setValue( key + QLatin1String("SideBarPage"), sideBarPage() ); - if (qApp->type() != QApplication::Tty) - settings.setValue(key + QLatin1String("windowGeometry"), winGeometry); - - settings.setValue( key + QLatin1String("MainWindowState"), mainWinState ); - settings.setValue( key + QLatin1String("FontSize"), pointFntSize); - settings.setValue( key + QLatin1String("RebuildDocDB"), rebuildDocs ); - - settings.setValue(key + QLatin1String("windowfont"), m_fontSettings.windowFont); - settings.setValue(key + QLatin1String("browserfont"), m_fontSettings.browserFont); - settings.setValue(key + QLatin1String("usewindowfont"), m_fontSettings.useWindowFont); - settings.setValue(key + QLatin1String("usebrowserfont"), m_fontSettings.useBrowserFont); - settings.setValue(key + QLatin1String("windowwritingsystem"), m_fontSettings.windowWritingSystem); - settings.setValue(key + QLatin1String("browserwritingsystem"), m_fontSettings.browserWritingSystem); -} - -#ifdef ASSISTANT_DEBUG -static void dumpmap( const QMap &m, const QString &header ) -{ - qDebug( header ); - QMap::ConstIterator it = m.begin(); - while (it != m.end()) { - qDebug( " " + it.key() + ":\t\t" + *it ); - ++it; - } -} -#endif - -bool Config::defaultProfileExists() -{ - QSettings settings; - const QString profKey = QLatin1String(QT_VERSION_STR) + QLatin1String("/Profile/default/"); - - if (settings.contains(profKey + QLatin1String("DocFiles")) - && settings.contains(profKey + QLatin1String("Titles")) - && settings.contains(profKey + QLatin1String("ImageDirs"))) { - QStringList dcfs = settings.value(profKey + QLatin1String("DocFiles") ).toStringList(); - foreach (QString file, dcfs) { - if (file == Profile::storableFilePath(file)) - return true; - } - } - return false; -} - -void Config::loadDefaultProfile() -{ - QSettings settings; - const QString profKey = QLatin1String(QT_VERSION_STR) + QLatin1String("/Profile/default/"); - - if (!defaultProfileExists()) - return; - - // Override the defaults with settings in registry. - profil->icons.clear(); - profil->indexPages.clear(); - profil->imageDirs.clear(); - profil->docs.clear(); - profil->dcfTitles.clear(); - - QStringList titles = settings.value( profKey + QLatin1String("Titles") ).toStringList(); - QStringList iconLst = settings.value( profKey + QLatin1String("DocIcons") ).toStringList(); - QStringList indexLst = settings.value( profKey + QLatin1String("IndexPages") ).toStringList(); - QStringList imgDirLst = settings.value( profKey + QLatin1String("ImageDirs") ).toStringList(); - QStringList dcfs = settings.value( profKey + QLatin1String("DocFiles") ).toStringList(); - profil->props[QLatin1String("name")] = QLatin1String("default"); - - QString filePath; - QStringList::ConstIterator it = titles.constBegin(); - QStringList::ConstIterator iconIt = iconLst.constBegin(); - QStringList::ConstIterator indexIt = indexLst.constBegin(); - QStringList::ConstIterator imageIt = imgDirLst.constBegin(); - QStringList::ConstIterator dcfIt = dcfs.constBegin(); - while((it != titles.constEnd()) - && (iconIt != iconLst.constEnd()) - && (indexIt != indexLst.constEnd()) - && (imageIt != imgDirLst.constEnd()) - && (dcfIt != dcfs.constEnd())) { - profil->addDCFIcon( *it, *iconIt ); - profil->addDCFIndexPage(*it, Profile::loadableFilePath(*indexIt)); - profil->addDCFImageDir( *it, *imageIt ); - profil->addDCFTitle(Profile::loadableFilePath(*dcfIt), *it); - ++it, ++iconIt, ++indexIt, ++imageIt, ++dcfIt; - } -#if ASSISTANT_DEBUG - dumpmap( profil->icons, QLatin1String("Icons") ); - dumpmap( profil->indexPages, QLatin1String("IndexPages") ); - dumpmap( profil->imageDirs, QLatin1String("ImageDirs") ); - dumpmap( profil->dcfTitles, QLatin1String("dcfTitles") ); - qDebug( "Docfiles: \n " + profil->docs.join( "\n " ) ); -#endif -} - -void Config::saveProfile( Profile *profile ) -{ - if (profil->profileType() == Profile::UserProfile) - return; - - const QString key = (profile->props[QLatin1String("name")] == QLatin1String("default")) - ? QString::fromLatin1(QT_VERSION_STR) - : getVersionString(); - - const QString profKey = key + QLatin1String("/Profile/") + profile->props[QLatin1String("name")] + QLatin1String("/"); - - QString path = QLibraryInfo::location(QLibraryInfo::DocumentationPath).replace(QLatin1String("\\"), QLatin1String("/")); - QStringList indexes, icons, imgDirs, dcfs; - QStringList titles = profile->dcfTitles.keys(); - QStringList::ConstIterator it = titles.constBegin(); - QString filePath; - for ( ; it != titles.constEnd(); ++it ) { - - indexes << Profile::storableFilePath(profile->indexPages[*it]); - icons << profile->icons[*it]; - imgDirs << profile->imageDirs[*it]; - dcfs << Profile::storableFilePath(profile->dcfTitles[*it]); - } - - QSettings settings; - settings.setValue( profKey + QLatin1String("Titles"), titles ); - settings.setValue( profKey + QLatin1String("DocFiles"), dcfs ); - settings.setValue( profKey + QLatin1String("IndexPages"), indexes ); - settings.setValue( profKey + QLatin1String("DocIcons"), icons ); - settings.setValue( profKey + QLatin1String("ImageDirs"), imgDirs ); - -#if ASSISTANT_DEBUG - qDebug() << "Titles:\n - " << ((QStringList*)&titles)->join("\n - "); - qDebug() << "Docfiles:\n - " << dcfs.join("\n - " ); - qDebug() << "IndexPages:\n - " << indexes.join("\n - "); - qDebug() << "DocIcons:\n - " << icons.join("\n - " ); - qDebug() << "ImageDirs:\n - " << imgDirs.join("\n - " ); -#endif -} - -QStringList Config::mimePaths() -{ - static QStringList lst; - - if( lst.count() > 0 ) - return lst; - - for (QMap::ConstIterator it = profil->dcfTitles.constBegin(); - it != profil->dcfTitles.constEnd(); ++it ) { - - // Mime source for .dcf file path - QFileInfo info( *it ); - QString dcfPath = info.absolutePath(); - if (!lst.contains(dcfPath)) - lst << dcfPath; - - // Image dir for .dcf - QString imgDir = QDir::toNativeSeparators( dcfPath + QDir::separator() - + profil->imageDirs[it.key()] ); - if (!lst.contains(imgDir)) - lst << imgDir; - } - return lst; -} - -QStringList Config::profiles() const -{ - return profileNames; -} - -QString Config::title() const -{ - QString s = profil->props[QLatin1String("title")]; - if (s.isEmpty()) - s = QObject::tr("Qt Assistant by Nokia"); - return s; -} - -QString Config::aboutApplicationMenuText() const -{ - return profil->props[QLatin1String("aboutmenutext")]; -} - -QString Config::aboutURL() const -{ - return profil->props[QLatin1String("abouturl")]; -} - -QString Config::homePage() const -{ - return home.isEmpty() ? profil->props[QLatin1String("startpage")] : home; -} - -QStringList Config::source() const -{ - return src.size() == 0 ? QStringList(profil->props[QLatin1String("startpage")]) : src; -} - -QStringList Config::docFiles() const -{ - return profil->docs; -} - -QPixmap Config::docIcon( const QString &title ) const -{ - // ### To allow qdoc generated dcf files to reference the doc icons from qmake_image_col - QString name = profil->icons[title]; - QString resName = QLatin1String(":/trolltech/assistant/images/") + name; - - if (QFile::exists(resName)) - return QPixmap(resName); - - if (name.startsWith(QLatin1String("file:"))) - name = name.mid(5); - return QPixmap(name); -} - -QPixmap Config::applicationIcon() const -{ - QString name = profil->props[QLatin1String("applicationicon")]; - QString resName = QLatin1String(":/trolltech/assistant/images/") + name; - - if (QFile::exists(resName)) - return QPixmap(resName); - - if (name.startsWith(QLatin1String("file:"))) - name = name.mid(5); - return QPixmap(name); -} - -QStringList Config::docTitles() const -{ - return QStringList(profil->indexPages.keys()); -} - -QString Config::docImageDir( const QString &docfile ) const -{ - return profil->imageDirs[docfile]; -} - -QString Config::indexPage( const QString &title ) const -{ - return profil->indexPages[title]; -} - -void Config::hideSideBar( bool b ) -{ - hideSidebar = b; -} - -bool Config::sideBarHidden() const -{ - return hideSidebar; -} - -QString Config::assistantDocPath() const -{ - return profil->props[QLatin1String("assistantdocs")].isEmpty() - ? QLibraryInfo::location(QLibraryInfo::DocumentationPath) + QLatin1String("/html") - : profil->props[QLatin1String("assistantdocs")]; -} - -QT_END_NAMESPACE diff --git a/tools/assistant/compat/config.h b/tools/assistant/compat/config.h deleted file mode 100644 index 0cb295e..0000000 --- a/tools/assistant/compat/config.h +++ /dev/null @@ -1,165 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "profile.h" - -#include -#include -#include -#include - -#include -#include - -QT_BEGIN_NAMESPACE - -class Profile; - -struct FontSettings -{ - FontSettings() : useWindowFont(false), useBrowserFont(false), - windowWritingSystem(QFontDatabase::Latin), browserWritingSystem(QFontDatabase::Latin) - { } - - QFont windowFont; - QFont browserFont; - - bool useWindowFont; - bool useBrowserFont; - - QFontDatabase::WritingSystem windowWritingSystem; - QFontDatabase::WritingSystem browserWritingSystem; -}; - -class Config -{ -public: - - Config(); - - void load(); - void save(); - Profile *profile() const { return profil; } - QString profileName() const { return profil->props[QLatin1String("name")]; } - bool validProfileName() const; - void hideSideBar( bool b ); - bool sideBarHidden() const; - QStringList mimePaths(); - - // From profile, read only - QStringList docFiles() const; - QStringList docTitles() const; - QString indexPage( const QString &title ) const; - QString docImageDir( const QString &title ) const; - QPixmap docIcon( const QString &title ) const; - - QStringList profiles() const; - QString title() const; - QString aboutApplicationMenuText() const; - QString aboutURL() const; - QPixmap applicationIcon() const; - - // From QSettings, read / write - QString homePage() const; - void setHomePage( const QString &hom ) { home = hom; } - - QStringList source() const; - void setSource( const QStringList &s ) { src = s; } - - int sideBarPage() const { return sideBar; } - void setSideBarPage( int sbp ) { sideBar = sbp; } - - QByteArray windowGeometry() const { return winGeometry; } - void setWindowGeometry( const QByteArray &geometry ) { winGeometry = geometry; } - - QByteArray mainWindowState() const { return mainWinState; } - void setMainWindowState( const QByteArray &state ) { mainWinState = state; } - - qreal fontPointSize() const { return pointFntSize; } - void setFontPointSize(qreal size) - { - pointFntSize = size; - m_fontSettings.useBrowserFont = true; - m_fontSettings.browserFont.setPointSizeF(size); - } - - FontSettings fontSettings() { return m_fontSettings; } - void setFontSettings(const FontSettings &settings) { m_fontSettings = settings; } - - QString assistantDocPath() const; - - bool docRebuild() const { return rebuildDocs; } - void setDocRebuild( bool rb ) { rebuildDocs = rb; } - - void saveProfile( Profile *profile ); - void loadDefaultProfile(); - bool defaultProfileExists(); - - static Config *configuration(); - static Config *loadConfig(const QString &profileFileName); - -private: - Config( const Config &c ); - Config& operator=( const Config &c ); - - void saveSettings(); - -private: - Profile *profil; - - QStringList profileNames; - QString home; - QStringList src; - QByteArray mainWinState; - QByteArray winGeometry; - qreal pointFntSize; - int sideBar; - bool hideSidebar; - bool rebuildDocs; - FontSettings m_fontSettings; -}; - -QT_END_NAMESPACE - -#endif // CONFIG_H diff --git a/tools/assistant/compat/docuparser.cpp b/tools/assistant/compat/docuparser.cpp deleted file mode 100644 index addc425..0000000 --- a/tools/assistant/compat/docuparser.cpp +++ /dev/null @@ -1,433 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "docuparser.h" -#include "profile.h" - -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -QDataStream &operator>>(QDataStream &s, ContentItem &ci) -{ - s >> ci.title; - s >> ci.reference; - s >> ci.depth; - return s; -} - -QDataStream &operator<<(QDataStream &s, const ContentItem &ci) -{ - s << ci.title; - s << ci.reference; - s << ci.depth; - return s; -} - -const QString DocuParser::DocumentKey = QLatin1String("/Qt Assistant/") + QLatin1String(QT_VERSION_STR) + QLatin1String("/"); - -DocuParser *DocuParser::createParser(const QString &fileName) -{ - QFile file(fileName); - if(!file.open(QFile::ReadOnly)) { - return 0; - } - - QString str; - int maxlen = 1024; - int majVer = 0, minVer = 0, serVer = 0; - static QRegExp re(QLatin1String("assistantconfig +version=\"(\\d)\\.(\\d)\\.(\\d)\""), Qt::CaseInsensitive); - Q_ASSERT(re.isValid()); - while(!(str = QLatin1String(file.readLine(maxlen))).isEmpty()) { - if(re.indexIn(str) >= 0) { - majVer = re.cap(1).toInt(); - minVer = re.cap(2).toInt(); - serVer = re.cap(3).toInt(); - break; - } - } - - if (majVer < 3 || (majVer == 3 && minVer < 2)) { - return new DocuParser310; - } - - return new DocuParser320; -} - - -bool DocuParser::parse(QFile *file) -{ - QXmlInputSource source(file); - QXmlSimpleReader reader; - reader.setContentHandler(this); - reader.setErrorHandler(this); - setFileName(QFileInfo(*file).absoluteFilePath()); - return reader.parse(source); -} - - -QString DocuParser::errorProtocol() const -{ - return errorProt; -} - - -QList DocuParser::getContentItems() -{ - return contentList; -} - - -QList DocuParser::getIndexItems() -{ - return indexList; -} - -QString DocuParser::absolutify(const QString &name, bool makeUrl) const -{ - if (!name.isEmpty()) { - QString s = name; - s.replace(QLatin1String("\\"), QLatin1String("/")); - QFileInfo orgPath(name); - if(orgPath.isRelative()) - s = QFileInfo(fname).path() + QLatin1Char('/') + name; - if (makeUrl) - s.prepend(QLatin1String("file:")); - return s; - } - return name; -} - - -void DocuParser310::addTo(Profile *p) -{ - p->addDCFTitle(fname, docTitle); - p->addDCFIcon(docTitle, iconName); - p->addDCFIndexPage(docTitle, conURL); -} - - -bool DocuParser310::startDocument() -{ - state = StateInit; - errorProt = QLatin1String(""); - - contentRef = QLatin1String(""); - indexRef = QLatin1String(""); - depth = 0; - - contentList.clear(); - qDeleteAll(indexList); - indexList.clear(); - - return true; -} - - -bool DocuParser310::startElement(const QString &, const QString &, - const QString &qname, - const QXmlAttributes &attr) -{ - if (qname == QLatin1String("DCF") && state == StateInit) { - state = StateContent; - contentRef = absolutify(attr.value(QLatin1String("ref")), false); - conURL = contentRef; - docTitle = attr.value(QLatin1String("title")); - iconName = absolutify(attr.value(QLatin1String("icon")), false); - contentList.append(ContentItem(docTitle, absolutify(contentRef), depth)); - } else if (qname == QLatin1String("section") && (state == StateContent || state == StateSect)) { - state = StateSect; - contentRef = absolutify(attr.value(QLatin1String("ref"))); - title = attr.value(QLatin1String("title")); - depth++; - contentList.append(ContentItem(title, contentRef, depth)); - } else if (qname == QLatin1String("keyword") && state == StateSect) { - state = StateKeyword; - indexRef = absolutify(attr.value(QLatin1String("ref"))); - } else - return false; - return true; -} - -bool DocuParser310::endElement(const QString &nameSpace, const QString &localName, - const QString &qName) -{ - Q_UNUSED(nameSpace); - Q_UNUSED(localName); - Q_UNUSED(qName); - - switch(state) { - case StateInit: - break; - case StateContent: - state = StateInit; - break; - case StateSect: - state = --depth ? StateSect : StateContent; - break; - case StateKeyword: - state = StateSect; - break; - default: - break; - } - return true; -} - - -bool DocuParser310::characters(const QString& ch) -{ - QString str = ch.simplified(); - if (str.isEmpty()) - return true; - - switch (state) { - case StateInit: - case StateContent: - case StateSect: - return false; - break; - case StateKeyword: - indexList.append(new IndexItem(str, indexRef)); - break; - default: - return false; - } - return true; -} - - -bool DocuParser310::fatalError(const QXmlParseException& exception) -{ - errorProt += QString::fromLatin1("fatal parsing error: %1 in line %2, column %3\n") - .arg(exception.message()) - .arg(exception.lineNumber()) - .arg(exception.columnNumber()); - - return QXmlDefaultHandler::fatalError(exception); -} - - -DocuParser320::DocuParser320() - : prof(new Profile) -{ -} - - -void DocuParser320::addTo(Profile *p) -{ - QMap::ConstIterator it; - - for (it = prof->dcfTitles.constBegin(); it != prof->dcfTitles.constEnd(); ++it) - p->dcfTitles[it.key()] = *it; - - for (it = prof->icons.constBegin(); it != prof->icons.constEnd(); ++it) - p->icons[it.key()] = *it; - - for (it = prof->indexPages.constBegin(); it != prof->indexPages.constEnd(); ++it) - p->indexPages[it.key()] = *it; -} - - -bool DocuParser320::startDocument() -{ - state = StateInit; - errorProt = QLatin1String(""); - - contentRef = QLatin1String(""); - indexRef = QLatin1String(""); - depth = 0; - contentList.clear(); - indexList.clear(); - - prof->addDCF(fname); - - return true; -} - -bool DocuParser320::startElement(const QString &, const QString &, - const QString &qname, - const QXmlAttributes &attr) -{ - QString lower = qname.toLower(); - - switch(state) { - - case StateInit: - if(lower == QLatin1String("assistantconfig")) - state = StateDocRoot; - break; - - case StateDocRoot: - if(lower == QLatin1String("dcf")) { - state = StateContent; - contentRef = absolutify(attr.value(QLatin1String("ref"))); - conURL = contentRef; - docTitle = attr.value(QLatin1String("title")); - iconName = absolutify(attr.value(QLatin1String("icon"))); - contentList.append(ContentItem(docTitle, contentRef, depth)); - } else if(lower == QLatin1String("profile")) { - state = StateProfile; - } - break; - - case StateSect: - if (lower == QLatin1String("keyword") && state == StateSect) { - state = StateKeyword; - indexRef = absolutify(attr.value(QLatin1String("ref"))); - break; - } // else if (lower == "section") - case StateContent: - if(lower == QLatin1String("section")) { - state = StateSect; - contentRef = absolutify(attr.value(QLatin1String("ref"))); - title = attr.value(QLatin1String("title")); - depth++; - contentList.append(ContentItem(title, contentRef, depth)); - } - break; - - case StateProfile: - if(lower == QLatin1String("property")) { - state = StateProperty; - propertyName = attr.value(QLatin1String("name")); - } - break; - - case StateProperty: - break; - - default: - break; - } - - return true; -} - -bool DocuParser320::endElement(const QString &nameSpace, - const QString &localName, - const QString &qName) -{ - Q_UNUSED(nameSpace); - Q_UNUSED(localName); - Q_UNUSED(qName); - - switch(state) { - case StateInit: - break; - case StateDocRoot: - state = StateInit; - break; - case StateProfile: - state = StateDocRoot; - break; - case StateProperty: - state = StateProfile; - if(propertyName.isEmpty() || propertyValue.isEmpty()) - return false; - { - static const QStringList lst = QStringList() - << QLatin1String("startpage") << QLatin1String("abouturl") - << QLatin1String("applicationicon") << QLatin1String("assistantdocs"); - - if (lst.contains(propertyName)) - propertyValue = absolutify(propertyValue); - } - prof->addProperty(propertyName, propertyValue); - break; - case StateContent: - if(!iconName.isEmpty()) - prof->addDCFIcon(docTitle, iconName); - if(contentRef.isEmpty()) - return false; - prof->addDCFIndexPage(docTitle, conURL); - prof->addDCFTitle(fname, docTitle); - state = StateDocRoot; - break; - case StateSect: - state = --depth ? StateSect : StateContent; - break; - case StateKeyword: - state = StateSect; - break; - } - return true; -} - -bool DocuParser320::characters(const QString& ch) -{ - QString str = ch.simplified(); - if (str.isEmpty()) - return true; - - switch (state) { - case StateInit: - case StateContent: - case StateSect: - return false; - break; - case StateKeyword: - indexList.append(new IndexItem(str, indexRef)); - break; - case StateProperty: - propertyValue = ch; - break; - default: - return false; - } - return true; -} - -bool DocuParser320::fatalError(const QXmlParseException& exception) -{ - errorProt += QString::fromLatin1("fatal parsing error: %1 in line %2, column %3\n") - .arg(exception.message()) - .arg(exception.lineNumber()) - .arg(exception.columnNumber()); - return QXmlDefaultHandler::fatalError(exception); -} - -QT_END_NAMESPACE diff --git a/tools/assistant/compat/docuparser.h b/tools/assistant/compat/docuparser.h deleted file mode 100644 index ea8e892..0000000 --- a/tools/assistant/compat/docuparser.h +++ /dev/null @@ -1,166 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef DOCUPARSER_H -#define DOCUPARSER_H - -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class Profile; - -struct ContentItem { - ContentItem() - : title( QString() ), reference( QString() ), depth( 0 ) {} - ContentItem( const QString &t, const QString &r, int d ) - : title( t ), reference( r ), depth( d ) {} - QString title; - QString reference; - int depth; - Q_DUMMY_COMPARISON_OPERATOR(ContentItem) -}; - -QDataStream &operator>>( QDataStream &s, ContentItem &ci ); -QDataStream &operator<<( QDataStream &s, const ContentItem &ci ); - -struct IndexItem { - IndexItem( const QString &k, const QString &r ) - : keyword( k ), reference( r ) {} - QString keyword; - QString reference; -}; - - - -class DocuParser : public QXmlDefaultHandler -{ -public: - enum ParserVersion { Qt310, Qt320 }; - // Since We don't want problems with documentation - // from version to version, this string stores the correct - // version string to save documents. - static const QString DocumentKey; - - static DocuParser *createParser( const QString &fileName ); - - virtual bool parse( QFile *file ); - - QList getContentItems(); - QList getIndexItems(); - - QString errorProtocol() const; - QString contentsURL() const { return conURL; } - - virtual ParserVersion parserVersion() const = 0; - virtual void addTo( Profile *p ) = 0; - - QString fileName() const { return fname; } - void setFileName( const QString &file ) { fname = file; } - -protected: - QString absolutify( const QString &input, bool makeUrl = true ) const; - - QString contentRef, indexRef, errorProt, conURL; - QString docTitle, title, iconName; - QList contentList; - QList indexList; - QString fname; -}; - - -class DocuParser310 : public DocuParser -{ -public: - enum States{ StateInit, StateContent, StateSect, StateKeyword }; - - bool startDocument(); - bool startElement( const QString&, const QString&, const QString& , - const QXmlAttributes& ); - bool endElement( const QString&, const QString&, const QString& ); - bool characters( const QString & ); - bool fatalError( const QXmlParseException& exception ); - - virtual ParserVersion parserVersion() const { return Qt310; } - virtual void addTo( Profile *p ); - -private: - States state; - int depth; -}; - - -class DocuParser320 : public DocuParser -{ -public: - enum States { StateInit, StateDocRoot, StateProfile, StateProperty, - StateContent, StateSect, StateKeyword }; - - DocuParser320(); - - bool startDocument(); - bool startElement( const QString&, const QString&, const QString& , - const QXmlAttributes& ); - bool endElement( const QString&, const QString&, const QString& ); - bool characters( const QString & ); - bool fatalError( const QXmlParseException& exception ); - - virtual ParserVersion parserVersion() const { return Qt320; } - virtual void addTo( Profile *p ); - Profile *profile() const { return prof; } - -private: - - States state; - int depth; - int docfileCounter; - QString propertyValue; - QString propertyName; - Profile *prof; -}; - -QT_END_NAMESPACE - -#endif // DOCUPARSER_H diff --git a/tools/assistant/compat/fontsettingsdialog.cpp b/tools/assistant/compat/fontsettingsdialog.cpp deleted file mode 100644 index 6fc6997..0000000 --- a/tools/assistant/compat/fontsettingsdialog.cpp +++ /dev/null @@ -1,137 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "fontsettingsdialog.h" -#include "fontpanel.h" -#include "config.h" - -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -FontSettingsDialog::FontSettingsDialog(QWidget *parent) - : QDialog(parent) - , m_windowFontPanel(new FontPanel(this)) - , m_browserFontPanel(new FontPanel(this)) - , m_dialogButtonBox(new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel)) -{ - setModal(true); - setWindowTitle(tr("Font Settings")); - setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); - - QVBoxLayout *mainVLayout = new QVBoxLayout(this); - QHBoxLayout *hboxLayout = new QHBoxLayout; - mainVLayout->addLayout(hboxLayout); - - QLabel *label = new QLabel(tr("Font settings for:"), this); - label->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred); - hboxLayout->addWidget(label); - QComboBox *comboBox = new QComboBox(this); - comboBox->addItem(tr("Browser")); - comboBox->addItem(tr("Application")); - hboxLayout->addWidget(comboBox); - - m_windowFontPanel->setCheckable(true); - m_browserFontPanel->setCheckable(true); - - const QString customSettings(tr("Use custom settings")); - m_windowFontPanel->setTitle(customSettings); - m_browserFontPanel->setTitle(customSettings); - - QStackedWidget *stackWidget = new QStackedWidget(this); - stackWidget->addWidget(m_browserFontPanel); - stackWidget->addWidget(m_windowFontPanel); - - mainVLayout->addWidget(stackWidget); - mainVLayout->addWidget(m_dialogButtonBox); - - connect(m_dialogButtonBox , SIGNAL(rejected()), this, SLOT(reject())); - connect(m_dialogButtonBox , SIGNAL(accepted()), this, SLOT(accept())); - connect(comboBox, SIGNAL(activated(int)), stackWidget, SLOT(setCurrentIndex(int))); -} - -FontSettingsDialog::~FontSettingsDialog() -{ - // nothing todo -} - -bool FontSettingsDialog::showDialog(FontSettings *settings) -{ - setupFontSettingsDialog(settings); - - if (exec() != Accepted) - return false; - - updateFontSettings(settings); - return true; -} - -void FontSettingsDialog::updateFontSettings(FontSettings *settings) -{ - settings->useWindowFont = m_windowFontPanel->isChecked(); - settings->useBrowserFont = m_browserFontPanel->isChecked(); - - settings->windowFont = settings->useWindowFont ? m_windowFontPanel->selectedFont() : qApp->font(); - settings->browserFont = settings->useBrowserFont ? m_browserFontPanel->selectedFont() : qApp->font(); - - settings->windowWritingSystem = settings->useWindowFont ? m_windowFontPanel->writingSystem() : QFontDatabase::Latin; - settings->browserWritingSystem = settings->useBrowserFont ? m_browserFontPanel->writingSystem() : QFontDatabase::Latin; -} - -void FontSettingsDialog::setupFontSettingsDialog(const FontSettings *settings) -{ - m_windowFontPanel->setSelectedFont(settings->windowFont); - m_browserFontPanel->setSelectedFont(settings->browserFont); - - m_windowFontPanel->setWritingSystem(settings->windowWritingSystem); - m_browserFontPanel->setWritingSystem(settings->browserWritingSystem); - - m_windowFontPanel->setChecked(settings->useWindowFont); - m_browserFontPanel->setChecked(settings->useBrowserFont); -} - -QT_END_NAMESPACE diff --git a/tools/assistant/compat/fontsettingsdialog.h b/tools/assistant/compat/fontsettingsdialog.h deleted file mode 100644 index e341a4d..0000000 --- a/tools/assistant/compat/fontsettingsdialog.h +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef _FONT_SETTINGS_DIALOG_H_ -#define _FONT_SETTINGS_DIALOG_H_ - -#include -#include - -QT_BEGIN_NAMESPACE - -class FontPanel; -struct FontSettings; -class QDialogButtonBox; - -class FontSettingsDialog : public QDialog -{ - Q_OBJECT - -public: - FontSettingsDialog(QWidget *parent = 0); - ~FontSettingsDialog(); - - bool showDialog(FontSettings *settings); - -private: - void updateFontSettings(FontSettings *settings); - void setupFontSettingsDialog(const FontSettings *settings); - -private: - FontPanel *m_windowFontPanel; - FontPanel *m_browserFontPanel; - QDialogButtonBox *m_dialogButtonBox; -}; - -#endif // _FONT_SETTINGS_DIALOG_H_ - - -QT_END_NAMESPACE diff --git a/tools/assistant/compat/helpdialog.cpp b/tools/assistant/compat/helpdialog.cpp deleted file mode 100644 index afa6e6c..0000000 --- a/tools/assistant/compat/helpdialog.cpp +++ /dev/null @@ -1,1331 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "helpdialog.h" -#include "helpwindow.h" -#include "topicchooser.h" -#include "docuparser.h" -#include "mainwindow.h" -#include "config.h" -#include "tabbedbrowser.h" - -#include -#include -#include - -#include -#include - -QT_BEGIN_NAMESPACE - -enum -{ - LinkRole = Qt::UserRole + 1000 -}; - -static bool verifyDirectory(const QString &str) -{ - QFileInfo dirInfo(str); - if (!dirInfo.exists()) - return QDir().mkdir(str); - if (!dirInfo.isDir()) { - qWarning("'%s' exists but is not a directory", str.toLatin1().constData()); - return false; - } - return true; -} - -struct IndexKeyword { - IndexKeyword(const QString &kw, const QString &l) - : keyword(kw), link(l) {} - IndexKeyword() : keyword(QString()), link(QString()) {} - bool operator<(const IndexKeyword &ik) const { - return keyword.toLower() < ik.keyword.toLower(); - } - bool operator<=(const IndexKeyword &ik) const { - return keyword.toLower() <= ik.keyword.toLower(); - } - bool operator>(const IndexKeyword &ik) const { - return keyword.toLower() > ik.keyword.toLower(); - } - Q_DUMMY_COMPARISON_OPERATOR(IndexKeyword) - QString keyword; - QString link; -}; - -QDataStream &operator>>(QDataStream &s, IndexKeyword &ik) -{ - s >> ik.keyword; - s >> ik.link; - return s; -} - -QDataStream &operator<<(QDataStream &s, const IndexKeyword &ik) -{ - s << ik.keyword; - s << ik.link; - return s; -} - -QValidator::State SearchValidator::validate(QString &str, int &) const -{ - for (int i = 0; i < (int) str.length(); ++i) { - QChar c = str[i]; - if (!c.isLetterOrNumber() && c != QLatin1Char('\'') && c != QLatin1Char('`') - && c != QLatin1Char('\"') && c != QLatin1Char(' ') && c != QLatin1Char('-') && c != QLatin1Char('_') - && c!= QLatin1Char('*')) - return QValidator::Invalid; - } - return QValidator::Acceptable; -} - -class IndexListModel: public QStringListModel -{ -public: - IndexListModel(QObject *parent = 0) - : QStringListModel(parent) {} - - void clear() { contents.clear(); setStringList(QStringList()); } - - QString description(int index) const { return stringList().at(index); } - QStringList links(int index) const { return contents.values(stringList().at(index)); } - void addLink(const QString &description, const QString &link) { contents.insert(description, link); } - - void publish() { filter(QString(), QString()); } - - QModelIndex filter(const QString &s, const QString &real); - - virtual Qt::ItemFlags flags(const QModelIndex &index) const - { return QStringListModel::flags(index) & ~Qt::ItemIsEditable; } - -private: - QMultiMap contents; -}; - -bool caseInsensitiveLessThan(const QString &as, const QString &bs) -{ - const QChar *a = as.unicode(); - const QChar *b = bs.unicode(); - if (a == 0) - return true; - if (b == 0) - return false; - if (a == b) - return false; - int l=qMin(as.length(),bs.length()); - while (l-- && QChar::toLower(a->unicode()) == QChar::toLower(b->unicode())) - a++,b++; - if (l==-1) - return (as.length() < bs.length()); - return QChar::toLower(a->unicode()) < QChar::toLower(b->unicode()); -} - -/** - * \a real is kinda a hack for the smart search, need a way to match a regexp to an item - * How would you say the best match for Q.*Wiget is QWidget? - */ -QModelIndex IndexListModel::filter(const QString &s, const QString &real) -{ - QStringList list; - - int goodMatch = -1; - int perfectMatch = -1; - if (s.isEmpty()) - perfectMatch = 0; - - const QRegExp regExp(s, Qt::CaseInsensitive); - QMultiMap::iterator it = contents.begin(); - QString lastKey; - for (; it != contents.end(); ++it) { - if (it.key() == lastKey) - continue; - lastKey = it.key(); - const QString key = it.key(); - if (key.contains(regExp) || key.contains(s, Qt::CaseInsensitive)) { - list.append(key); - if (perfectMatch == -1 && (key.startsWith(real, Qt::CaseInsensitive))) { - if (goodMatch == -1) - goodMatch = list.count() - 1; - if (real.length() == key.length()){ - perfectMatch = list.count() - 1; - } - } else if (perfectMatch > -1 && s == key) { - perfectMatch = list.count() - 1; - } - } - } - - int bestMatch = perfectMatch; - if (bestMatch == -1) - bestMatch = goodMatch; - bestMatch = qMax(0, bestMatch); - - // sort the new list - QString match; - if (bestMatch >= 0 && list.count() > bestMatch) - match = list[bestMatch]; - qSort(list.begin(), list.end(), caseInsensitiveLessThan); - setStringList(list); - for (int i = 0; i < list.size(); ++i) { - if (list.at(i) == match){ - bestMatch = i; - break; - } - } - return index(bestMatch, 0, QModelIndex()); -} - -HelpNavigationListItem::HelpNavigationListItem(QListWidget *ls, const QString &txt) - : QListWidgetItem(txt, ls) -{ -} - -void HelpNavigationListItem::addLink(const QString &link) -{ - QString lnk = HelpDialog::removeAnchorFromLink(link); - if (linkList.filter(lnk, Qt::CaseInsensitive).count() > 0) - return; - linkList << link; -} - -HelpDialog::HelpDialog(QWidget *parent, MainWindow *h) - : QWidget(parent), lwClosed(false), help(h) -{ - ui.setupUi(this); - ui.listContents->setUniformRowHeights(true); - ui.listContents->header()->setStretchLastSection(false); - ui.listContents->header()->setResizeMode(QHeaderView::ResizeToContents); - ui.listBookmarks->setUniformRowHeights(true); - ui.listBookmarks->header()->setStretchLastSection(false); - ui.listBookmarks->header()->setResizeMode(QHeaderView::ResizeToContents); - - indexModel = new IndexListModel(this); - ui.listIndex->setModel(indexModel); - ui.listIndex->setLayoutMode(QListView::Batched); - ui.listBookmarks->setItemHidden(ui.listBookmarks->headerItem(), true); - ui.listContents->setItemHidden(ui.listContents->headerItem(), true); - ui.searchButton->setShortcut(QKeySequence(Qt::ALT|Qt::SHIFT|Qt::Key_S)); -} - -void HelpDialog::initialize() -{ - connect(ui.tabWidget, SIGNAL(currentChanged(int)), this, SLOT(currentTabChanged(int))); - - connect(ui.listContents, SIGNAL(itemActivated(QTreeWidgetItem*,int)), this, SLOT(showTopic(QTreeWidgetItem*))); - connect(ui.listContents, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showTreeItemMenu(QPoint))); - ui.listContents->viewport()->installEventFilter(this); - - connect(ui.editIndex, SIGNAL(returnPressed()), this, SLOT(showTopic())); - connect(ui.editIndex, SIGNAL(textEdited(QString)), this, SLOT(searchInIndex(QString))); - - connect(ui.listIndex, SIGNAL(activated(QModelIndex)), this, SLOT(showTopic())); - connect(ui.listIndex, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showIndexItemMenu(QPoint))); - - connect(ui.listBookmarks, SIGNAL(itemActivated(QTreeWidgetItem*,int)), this, SLOT(showTopic(QTreeWidgetItem*))); - connect(ui.listBookmarks, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showTreeItemMenu(QPoint))); - - connect(ui.termsEdit, SIGNAL(textChanged(const QString&)), this, SLOT(updateSearchButton(const QString&))); - - connect(ui.resultBox, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showListItemMenu(QPoint))); - - cacheFilesPath = QDir::homePath() + QLatin1String("/.assistant"); //### Find a better location for the dbs - - ui.editIndex->installEventFilter(this); - - ui.framePrepare->hide(); - connect(qApp, SIGNAL(lastWindowClosed()), SLOT(lastWinClosed())); - - ui.termsEdit->setValidator(new SearchValidator(ui.termsEdit)); - - actionOpenCurrentTab = new QAction(this); - actionOpenCurrentTab->setText(tr("Open Link in Current Tab")); - - actionOpenLinkInNewWindow = new QAction(this); - actionOpenLinkInNewWindow->setText(tr("Open Link in New Window")); - - actionOpenLinkInNewTab = new QAction(this); - actionOpenLinkInNewTab->setText(tr("Open Link in New Tab")); - - itemPopup = new QMenu(this); - itemPopup->addAction(actionOpenCurrentTab); - itemPopup->addAction(actionOpenLinkInNewWindow); - itemPopup->addAction(actionOpenLinkInNewTab); - - ui.tabWidget->setElideMode(Qt::ElideNone); - - contentList.clear(); - - initDoneMsgShown = false; - fullTextIndex = 0; - indexDone = false; - titleMapDone = false; - contentsInserted = false; - bookmarksInserted = false; - setupTitleMap(); - -} - -void HelpDialog::processEvents() -{ - qApp->processEvents(QEventLoop::ExcludeUserInputEvents); -} - - -void HelpDialog::lastWinClosed() -{ - lwClosed = true; -} - -void HelpDialog::removeOldCacheFiles(bool onlyFulltextSearchIndex) -{ - if (!verifyDirectory(cacheFilesPath)) { - qWarning("Failed to created assistant directory"); - return; - } - QString pname = QLatin1String(".") + Config::configuration()->profileName(); - - QStringList fileList; - fileList << QLatin1String("indexdb40.dict") - << QLatin1String("indexdb40.doc"); - - if (!onlyFulltextSearchIndex) - fileList << QLatin1String("indexdb40") << QLatin1String("contentdb40"); - - QStringList::iterator it = fileList.begin(); - for (; it != fileList.end(); ++it) { - if (QFile::exists(cacheFilesPath + QDir::separator() + *it + pname)) { - QFile f(cacheFilesPath + QDir::separator() + *it + pname); - f.remove(); - } - } -} - -void HelpDialog::timerEvent(QTimerEvent *e) -{ - Q_UNUSED(e); - static int opacity = 255; - help->setWindowOpacity((opacity-=4)/255.0); - if (opacity<=0) - qApp->quit(); -} - - -void HelpDialog::loadIndexFile() -{ - if (indexDone) - return; - - setCursor(Qt::WaitCursor); - indexDone = true; - ui.labelPrepare->setText(tr("Prepare...")); - ui.framePrepare->show(); - processEvents(); - - QProgressBar *bar = ui.progressPrepare; - bar->setMaximum(100); - bar->setValue(0); - - keywordDocuments.clear(); - QList lst; - QFile indexFile(cacheFilesPath + QDir::separator() + QLatin1String("indexdb40.") + - Config::configuration()->profileName()); - if (!indexFile.open(QFile::ReadOnly)) { - buildKeywordDB(); - processEvents(); - if (lwClosed) - return; - if (!indexFile.open(QFile::ReadOnly)) { - QMessageBox::warning(help, tr("Qt Assistant"), tr("Failed to load keyword index file\n" - "Assistant will not work!")); -#if defined Q_WS_WIN || defined Q_WS_MACX - startTimer(50); -#endif - return; - } - } - - QDataStream ds(&indexFile); - quint32 fileAges; - ds >> fileAges; - if (fileAges != getFileAges()) { - indexFile.close(); - buildKeywordDB(); - if (!indexFile.open(QFile::ReadOnly)) { - QMessageBox::warning(help, tr("Qt Assistant"), - tr("Cannot open the index file %1").arg(QFileInfo(indexFile).absoluteFilePath())); - return; - } - ds.setDevice(&indexFile); - ds >> fileAges; - } - ds >> lst; - indexFile.close(); - - bar->setValue(bar->maximum()); - processEvents(); - - for (int i=0; iaddLink(idx.keyword, idx.link); - - keywordDocuments << HelpDialog::removeAnchorFromLink(idx.link); - } - - indexModel->publish(); - - ui.framePrepare->hide(); - showInitDoneMessage(); - setCursor(Qt::ArrowCursor); -} - -quint32 HelpDialog::getFileAges() -{ - QStringList addDocuFiles = Config::configuration()->docFiles(); - QStringList::const_iterator i = addDocuFiles.constBegin(); - - quint32 fileAges = 0; - for (; i != addDocuFiles.constEnd(); ++i) { - QFileInfo fi(*i); - if (fi.exists()) - fileAges += fi.lastModified().toTime_t(); - } - - return fileAges; -} - -void HelpDialog::buildKeywordDB() -{ - QStringList addDocuFiles = Config::configuration()->docFiles(); - QStringList::iterator i = addDocuFiles.begin(); - - // Set up an indeterminate progress bar. - ui.labelPrepare->setText(tr("Prepare...")); - ui.progressPrepare->setMaximum(0); - ui.progressPrepare->setMinimum(0); - ui.progressPrepare->setValue(0); - processEvents(); - - QList lst; - quint32 fileAges = 0; - for (i = addDocuFiles.begin(); i != addDocuFiles.end(); ++i) { - QFile file(*i); - if (!file.exists()) { - QMessageBox::warning(this, tr("Warning"), - tr("Documentation file %1 does not exist!\n" - "Skipping file.").arg(QFileInfo(file).absoluteFilePath())); - continue; - } - fileAges += QFileInfo(file).lastModified().toTime_t(); - DocuParser *handler = DocuParser::createParser(*i); - bool ok = handler->parse(&file); - file.close(); - if (!ok){ - QString msg = QString::fromLatin1("In file %1:\n%2") - .arg(QFileInfo(file).absoluteFilePath()) - .arg(handler->errorProtocol()); - QMessageBox::critical(this, tr("Parse Error"), tr(msg.toUtf8())); - delete handler; - continue; - } - - QList indLst = handler->getIndexItems(); - int counter = 0; - foreach (IndexItem *indItem, indLst) { - QFileInfo fi(indItem->reference); - lst.append(IndexKeyword(indItem->keyword, indItem->reference)); - - if (++counter%100 == 0) { - if (ui.progressPrepare) - ui.progressPrepare->setValue(counter); - processEvents(); - if (lwClosed) { - return; - } - } - } - delete handler; - } - if (!lst.isEmpty()) - qSort(lst); - - QFile indexout(cacheFilesPath + QDir::separator() + QLatin1String("indexdb40.") - + Config::configuration()->profileName()); - if (verifyDirectory(cacheFilesPath) && indexout.open(QFile::WriteOnly)) { - QDataStream s(&indexout); - s << fileAges; - s << lst; - indexout.close(); - } -} - -void HelpDialog::setupTitleMap() -{ - if (titleMapDone) - return; - - bool needRebuild = false; - if (Config::configuration()->profileName() == QLatin1String("default")) { - const QStringList docuFiles = Config::configuration()->docFiles(); - for (QStringList::ConstIterator it = docuFiles.begin(); it != docuFiles.end(); ++it) { - if (!QFile::exists(*it)) { - Config::configuration()->saveProfile(Profile::createDefaultProfile()); - Config::configuration()->loadDefaultProfile(); - needRebuild = true; - break; - } - } - } - - if (Config::configuration()->docRebuild() || needRebuild) { - removeOldCacheFiles(); - Config::configuration()->setDocRebuild(false); - Config::configuration()->saveProfile(Config::configuration()->profile()); - } - if (contentList.isEmpty()) - getAllContents(); - - titleMapDone = true; - titleMap.clear(); - for (QList >::Iterator it = contentList.begin(); it != contentList.end(); ++it) { - ContentList lst = (*it).second; - foreach (ContentItem item, lst) { - titleMap[item.reference] = item.title.trimmed(); - } - } - processEvents(); -} - -void HelpDialog::getAllContents() -{ - QFile contentFile(cacheFilesPath + QDir::separator() + QLatin1String("contentdb40.") - + Config::configuration()->profileName()); - contentList.clear(); - if (!contentFile.open(QFile::ReadOnly)) { - buildContentDict(); - return; - } - - QDataStream ds(&contentFile); - quint32 fileAges; - ds >> fileAges; - if (fileAges != getFileAges()) { - contentFile.close(); - removeOldCacheFiles(true); - buildContentDict(); - return; - } - QString key; - QList lst; - while (!ds.atEnd()) { - ds >> key; - ds >> lst; - contentList += qMakePair(key, QList(lst)); - } - contentFile.close(); - processEvents(); - -} - -void HelpDialog::buildContentDict() -{ - QStringList docuFiles = Config::configuration()->docFiles(); - - quint32 fileAges = 0; - for (QStringList::iterator it = docuFiles.begin(); it != docuFiles.end(); ++it) { - QFile file(*it); - if (!file.exists()) { - QMessageBox::warning(this, tr("Warning"), - tr("Documentation file %1 does not exist!\n" - "Skipping file.").arg(QFileInfo(file).absoluteFilePath())); - continue; - } - fileAges += QFileInfo(file).lastModified().toTime_t(); - DocuParser *handler = DocuParser::createParser(*it); - if (!handler) { - QMessageBox::warning(this, tr("Warning"), - tr("Documentation file %1 is not compatible!\n" - "Skipping file.").arg(QFileInfo(file).absoluteFilePath())); - continue; - } - bool ok = handler->parse(&file); - file.close(); - if (ok) { - contentList += qMakePair(*it, QList(handler->getContentItems())); - delete handler; - } else { - QString msg = QString::fromLatin1("In file %1:\n%2") - .arg(QFileInfo(file).absoluteFilePath()) - .arg(handler->errorProtocol()); - QMessageBox::critical(this, tr("Parse Error"), tr(msg.toUtf8())); - continue; - } - } - - QFile contentOut(cacheFilesPath + QDir::separator() + QLatin1String("contentdb40.") - + Config::configuration()->profileName()); - if (contentOut.open(QFile::WriteOnly)) { - QDataStream s(&contentOut); - s << fileAges; - for (QList >::Iterator it = contentList.begin(); it != contentList.end(); ++it) { - s << *it; - } - contentOut.close(); - } -} - -void HelpDialog::currentTabChanged(int index) -{ - QString s = ui.tabWidget->widget(index)->objectName(); - if (s == QLatin1String("indexPage")) - QTimer::singleShot(0, this, SLOT(loadIndexFile())); - else if (s == QLatin1String("bookmarkPage")) - insertBookmarks(); - else if (s == QLatin1String("contentPage")) - QTimer::singleShot(0, this, SLOT(insertContents())); - else if (s == QLatin1String("searchPage")) - QTimer::singleShot(0, this, SLOT(setupFullTextIndex())); -} - -void HelpDialog::showInitDoneMessage() -{ - if (initDoneMsgShown) - return; - initDoneMsgShown = true; - help->statusBar()->showMessage(tr("Done"), 3000); -} - -void HelpDialog::showTopic(QTreeWidgetItem *item) -{ - if (item) - showTopic(); -} - -void HelpDialog::showTopic() -{ - QString tabName = ui.tabWidget->currentWidget()->objectName(); - - if (tabName == QLatin1String("indexPage")) - showIndexTopic(); - else if (tabName == QLatin1String("bookmarkPage")) - showBookmarkTopic(); - else if (tabName == QLatin1String("contentPage")) - showContentsTopic(); -} - -void HelpDialog::showIndexTopic() -{ - int row = ui.listIndex->currentIndex().row(); - if (row == -1 || row >= indexModel->rowCount()) - return; - - QString description = indexModel->description(row); - QStringList links = indexModel->links(row); - - bool blocked = ui.editIndex->blockSignals(true); - ui.editIndex->setText(description); - ui.editIndex->blockSignals(blocked); - - if (links.count() == 1) { - emit showLink(links.first()); - } else { - qSort(links); - QStringList::Iterator it = links.begin(); - QStringList linkList; - QStringList linkNames; - for (; it != links.end(); ++it) { - linkList << *it; - linkNames << titleOfLink(*it); - } - QString link = TopicChooser::getLink(this, linkNames, linkList, description); - if (!link.isEmpty()) - emit showLink(link); - } - - ui.listIndex->setCurrentIndex(indexModel->index(indexModel->stringList().indexOf(description))); - ui.listIndex->scrollTo(ui.listIndex->currentIndex(), QAbstractItemView::PositionAtTop); -} - -void HelpDialog::searchInIndex(const QString &searchString) -{ - QRegExp atoz(QLatin1String("[A-Z]")); - int matches = searchString.count(atoz); - if (matches > 0 && !searchString.contains(QLatin1String(".*"))) - { - int start = 0; - QString newSearch; - for (; matches > 0; --matches) { - int match = searchString.indexOf(atoz, start+1); - if (match <= start) - continue; - newSearch += searchString.mid(start, match-start); - newSearch += QLatin1String(".*"); - start = match; - } - newSearch += searchString.mid(start); - ui.listIndex->setCurrentIndex(indexModel->filter(newSearch, searchString)); - } - else - ui.listIndex->setCurrentIndex(indexModel->filter(searchString, searchString)); -} - -QString HelpDialog::titleOfLink(const QString &link) -{ - QString s = HelpDialog::removeAnchorFromLink(link); - s = titleMap[s]; - if (s.isEmpty()) - return link; - return s; -} - -bool HelpDialog::eventFilter(QObject * o, QEvent * e) -{ - if (o == ui.editIndex && e->type() == QEvent::KeyPress) { - switch (static_cast(e)->key()) { - case Qt::Key_Up: - case Qt::Key_Down: - case Qt::Key_PageDown: - case Qt::Key_PageUp: - QApplication::sendEvent(ui.listIndex, e); - break; - - default: - break; - } - } else if (o == ui.listContents->viewport()) { - if (e->type() == QEvent::MouseButtonRelease) { - QMouseEvent *me = static_cast(e); - if (me->button() == Qt::LeftButton) { - QTreeWidgetItem *item = ui.listContents->itemAt(me->pos()); - QRect vRect = ui.listContents->visualItemRect(item); - - // only show topic if we clicked an item - if (item && vRect.contains(me->pos())) - showTopic(item); - } - } - } - - return QWidget::eventFilter(o, e); -} - -void HelpDialog::addBookmark() -{ - if (!bookmarksInserted) - insertBookmarks(); - QString link = help->browsers()->currentBrowser()->source().toString(); - QString title = help->browsers()->currentBrowser()->documentTitle(); - if (title.isEmpty()) - title = titleOfLink(link); - - QTreeWidgetItem *i = new QTreeWidgetItem(ui.listBookmarks, 0); - i->setText(0, title); - i->setData(0, LinkRole, link); - ui.buttonRemove->setEnabled(true); - saveBookmarks(); - help->updateBookmarkMenu(); -} - -void HelpDialog::on_buttonAdd_clicked() -{ - addBookmark(); -} - -void HelpDialog::on_buttonRemove_clicked() -{ - if (!ui.listBookmarks->currentItem()) - return; - - delete ui.listBookmarks->currentItem(); - saveBookmarks(); - if (ui.listBookmarks->topLevelItemCount() != 0) { - ui.listBookmarks->setCurrentItem(ui.listBookmarks->topLevelItem(0)); - } - ui.buttonRemove->setEnabled(ui.listBookmarks->topLevelItemCount() > 0); - help->updateBookmarkMenu(); -} - -void HelpDialog::insertBookmarks() -{ - if (bookmarksInserted) - return; - bookmarksInserted = true; - ui.listBookmarks->clear(); - QFile f(cacheFilesPath + QDir::separator() + QLatin1String("bookmarks.") - + Config::configuration()->profileName()); - if (!f.open(QFile::ReadOnly)) - return; - QTextStream ts(&f); - while (!ts.atEnd()) { - QTreeWidgetItem *i = new QTreeWidgetItem(ui.listBookmarks, 0); - i->setText(0, ts.readLine()); - i->setData(0, LinkRole, ts.readLine()); - } - ui.buttonRemove->setEnabled(ui.listBookmarks->topLevelItemCount() > 0); - help->updateBookmarkMenu(); - showInitDoneMessage(); -} - -void HelpDialog::showBookmarkTopic() -{ - if (!ui.listBookmarks->currentItem()) - return; - - QTreeWidgetItem *i = (QTreeWidgetItem*)ui.listBookmarks->currentItem(); - emit showLink(i->data(0, LinkRole).toString()); -} - -static void store(QTreeWidgetItem *i, QTextStream &ts) -{ - ts << i->text(0) << endl; - ts << i->data(0, LinkRole).toString() << endl; - - for (int index = 0; index < i->childCount(); ++index) - store(i->child(index), ts); -} - -static void store(QTreeWidget *tw, QTextStream &ts) -{ - for (int index = 0; index < tw->topLevelItemCount(); ++index) - store(tw->topLevelItem(index), ts); -} - -void HelpDialog::saveBookmarks() -{ - QFile f(cacheFilesPath + QDir::separator() + QLatin1String("bookmarks.") - + Config::configuration()->profileName()); - if (!f.open(QFile::WriteOnly)) - return; - - QTextStream ts(&f); - store(ui.listBookmarks, ts); - f.close(); -} - -void HelpDialog::insertContents() -{ -#ifdef Q_WS_MAC - static const QLatin1String IconPath(":/trolltech/assistant/images/mac/book.png"); -#else - static const QLatin1String IconPath(":/trolltech/assistant/images/win/book.png"); -#endif - if (contentsInserted) - return; - - if (contentList.isEmpty()) - getAllContents(); - - contentsInserted = true; - ui.listContents->clear(); - setCursor(Qt::WaitCursor); - if (!titleMapDone) - setupTitleMap(); - -#if 0 // ### port me - ui.listContents->setSorting(-1); -#endif - - for (QList >::Iterator it = contentList.begin(); it != contentList.end(); ++it) { - QTreeWidgetItem *newEntry = 0; - - QTreeWidgetItem *contentEntry = 0; - QStack stack; - stack.clear(); - int depth = 0; - bool root = false; - - const int depthSize = 32; - QVarLengthArray lastItem(depthSize); - - ContentList lst = (*it).second; - for (ContentList::ConstIterator it = lst.constBegin(); it != lst.constEnd(); ++it) { - ContentItem item = *it; - if (item.depth == 0) { - lastItem[0] = 0; - newEntry = new QTreeWidgetItem(ui.listContents, 0); - newEntry->setIcon(0, QIcon(IconPath)); - newEntry->setText(0, item.title); - newEntry->setData(0, LinkRole, item.reference); - stack.push(newEntry); - depth = 1; - root = true; - } - else{ - if ((item.depth > depth) && root) { - depth = item.depth; - stack.push(contentEntry); - } - if (item.depth == depth) { - if (lastItem.capacity() == depth) - lastItem.resize(depth + depthSize); - contentEntry = new QTreeWidgetItem(stack.top(), lastItem[ depth ]); - lastItem[ depth ] = contentEntry; - contentEntry->setText(0, item.title); - contentEntry->setData(0, LinkRole, item.reference); - } - else if (item.depth < depth) { - stack.pop(); - depth--; - item = *(--it); - } - } - } - processEvents(); - } - setCursor(Qt::ArrowCursor); - showInitDoneMessage(); -} - -void HelpDialog::showContentsTopic() -{ - QTreeWidgetItem *i = (QTreeWidgetItem*)ui.listContents->currentItem(); - if (!i) - return; - emit showLink(i->data(0, LinkRole).toString()); -} - -QTreeWidgetItem * HelpDialog::locateLink(QTreeWidgetItem *item, const QString &link) -{ - QTreeWidgetItem *child = 0; -#ifdef Q_OS_WIN - Qt::CaseSensitivity checkCase = Qt::CaseInsensitive; -#else - Qt::CaseSensitivity checkCase = Qt::CaseSensitive; -#endif - for (int i = 0, childCount = item->childCount(); ichild(i); - ///check whether it is this item - if (link.startsWith(child->data(0, LinkRole).toString(), checkCase)) - break; - //check if the link is a child of this item - else if (child->childCount()) { - child = locateLink(child, link); - if (child) - break; - } - child = 0; - } - return child; -} - -void HelpDialog::locateContents(const QString &link) -{ - //ensure the TOC is filled - if (!contentsInserted) - insertContents(); -#ifdef Q_OS_WIN - Qt::CaseSensitivity checkCase = Qt::CaseInsensitive; -#else - Qt::CaseSensitivity checkCase = Qt::CaseSensitive; -#endif - QString findLink(link); - //Installations on a windows local drive will give the 'link' as - //and the contents in the TOC will be . - //But on others the 'link' of format - //and the contents in the TOC will be . - if (findLink.contains(QLatin1String("file:///"))) { - if (findLink[9] == QLatin1Char(':')) //on windows drives - findLink.replace(0, 8, QLatin1String("file:")); - else - findLink.replace(0, 8, QLatin1String("file:/")); - } - - bool topLevel = false; - QTreeWidgetItem *item = 0; - int totalItems = ui.listContents->topLevelItemCount(); - - for (int i = 0; i < totalItems; i++ ) { - // first see if we are one of the top level items - item = (QTreeWidgetItem*)ui.listContents->topLevelItem(i); - if (findLink.startsWith(item->data(0, LinkRole).toString(), checkCase)) { - topLevel = true; - break; - } - } - - if (!topLevel) { - // now try to find it in the sublevel items - for (int n = 0; n < totalItems; ++n) { - item = (QTreeWidgetItem*)ui.listContents->topLevelItem(n); - item = locateLink(item, findLink); - if (item) - break; - } - } - - //remove the old selection - QList selected = ui.listContents->selectedItems(); - foreach(QTreeWidgetItem *sel, selected) - ui.listContents->setItemSelected(sel, false); - - //set the TOC item and show - ui.listContents->setCurrentItem(item); - ui.listContents->setItemSelected(item, true); - ui.listContents->scrollToItem(item); -} - -void HelpDialog::toggleContents() -{ - if (!isVisible() || ui.tabWidget->currentIndex() != 0) { - ui.tabWidget->setCurrentIndex(0); - parentWidget()->show(); - } - else - parentWidget()->hide(); -} - -void HelpDialog::toggleIndex() -{ - if (!isVisible() || ui.tabWidget->currentIndex() != 1 || !ui.editIndex->hasFocus()) { - ui.tabWidget->setCurrentIndex(1); - parentWidget()->show(); - ui.editIndex->setFocus(); - } - else - parentWidget()->hide(); -} - -void HelpDialog::toggleBookmarks() -{ - if (!isVisible() || ui.tabWidget->currentIndex() != 2) { - ui.tabWidget->setCurrentIndex(2); - parentWidget()->show(); - } - else - parentWidget()->hide(); -} - -void HelpDialog::toggleSearch() -{ - if (!isVisible() || ui.tabWidget->currentIndex() != 3) { - ui.tabWidget->setCurrentIndex(3); - parentWidget()->show(); - } - else - parentWidget()->hide(); -} - -void HelpDialog::setupFullTextIndex() -{ - if (fullTextIndex) - return; - - QString pname = Config::configuration()->profileName(); - fullTextIndex = new Index(QStringList(), QDir::homePath()); // ### Is this correct ? - if (!verifyDirectory(cacheFilesPath)) { - QMessageBox::warning(help, tr("Qt Assistant"), - tr("Failed to save fulltext search index\n" - "Assistant will not work!")); - return; - } - fullTextIndex->setDictionaryFile(cacheFilesPath + QDir::separator() + QLatin1String("indexdb40.dict.") + pname); - fullTextIndex->setDocListFile(cacheFilesPath + QDir::separator() + QLatin1String("indexdb40.doc.") + pname); - processEvents(); - - connect(fullTextIndex, SIGNAL(indexingProgress(int)), - this, SLOT(setIndexingProgress(int))); - QFile f(cacheFilesPath + QDir::separator() + QLatin1String("indexdb40.dict.") + pname); - if (!f.exists()) { - QString doc; - QSet documentSet; - QMap::ConstIterator it = titleMap.constBegin(); - for (; it != titleMap.constEnd(); ++it) { - doc = HelpDialog::removeAnchorFromLink(it.key()); - if (!doc.isEmpty()) - documentSet.insert(doc); - } - loadIndexFile(); - for ( QStringList::Iterator it = keywordDocuments.begin(); it != keywordDocuments.end(); ++it ) { - if (!(*it).isEmpty()) - documentSet.insert(*it); - } - fullTextIndex->setDocList( documentSet.toList() ); - - help->statusBar()->clearMessage(); - setCursor(Qt::WaitCursor); - ui.labelPrepare->setText(tr("Indexing files...")); - ui.progressPrepare->setMaximum(100); - ui.progressPrepare->reset(); - ui.progressPrepare->show(); - ui.framePrepare->show(); - processEvents(); - if (fullTextIndex->makeIndex() == -1) - return; - fullTextIndex->writeDict(); - ui.progressPrepare->setValue(100); - ui.framePrepare->hide(); - setCursor(Qt::ArrowCursor); - showInitDoneMessage(); - } else { - setCursor(Qt::WaitCursor); - help->statusBar()->showMessage(tr("Reading dictionary...")); - processEvents(); - fullTextIndex->readDict(); - help->statusBar()->showMessage(tr("Done"), 3000); - setCursor(Qt::ArrowCursor); - } - keywordDocuments.clear(); -} - -void HelpDialog::setIndexingProgress(int prog) -{ - ui.progressPrepare->setValue(prog); - processEvents(); -} - -void HelpDialog::startSearch() -{ - QString str = ui.termsEdit->text(); - str = str.simplified(); - str = str.replace(QLatin1String("\'"), QLatin1String("\"")); - str = str.replace(QLatin1String("`"), QLatin1String("\"")); - QString buf = str; - str = str.replace(QLatin1String("-"), QLatin1String(" ")); - str = str.replace(QRegExp(QLatin1String("\\s[\\S]?\\s")), QLatin1String(" ")); - terms = str.split(QLatin1Char(' ')); - QStringList termSeq; - QStringList seqWords; - QStringList::iterator it = terms.begin(); - for (; it != terms.end(); ++it) { - (*it) = (*it).simplified(); - (*it) = (*it).toLower(); - (*it) = (*it).replace(QLatin1String("\""), QLatin1String("")); - } - if (str.contains(QLatin1Char('\"'))) { - if ((str.count(QLatin1Char('\"')))%2 == 0) { - int beg = 0; - int end = 0; - QString s; - beg = str.indexOf(QLatin1Char('\"'), beg); - while (beg != -1) { - beg++; - end = str.indexOf(QLatin1Char('\"'), beg); - s = str.mid(beg, end - beg); - s = s.toLower(); - s = s.simplified(); - if (s.contains(QLatin1Char('*'))) { - QMessageBox::warning(this, tr("Full Text Search"), - tr("Using a wildcard within phrases is not allowed.")); - return; - } - seqWords += s.split(QLatin1Char(' ')); - termSeq << s; - beg = str.indexOf(QLatin1Char('\"'), end + 1); - } - } else { - QMessageBox::warning(this, tr("Full Text Search"), - tr("The closing quotation mark is missing.")); - return; - } - } - setCursor(Qt::WaitCursor); - foundDocs.clear(); - foundDocs = fullTextIndex->query(terms, termSeq, seqWords); - QString msg = tr("%n document(s) found.", "", foundDocs.count()); - help->statusBar()->showMessage(tr(msg.toUtf8()), 3000); - ui.resultBox->clear(); - for (it = foundDocs.begin(); it != foundDocs.end(); ++it) - ui.resultBox->addItem(fullTextIndex->getDocumentTitle(*it)); - - terms.clear(); - bool isPhrase = false; - QString s; - for (int i = 0; i < (int)buf.length(); ++i) { - if (buf[i] == QLatin1Char('\"')) { - isPhrase = !isPhrase; - s = s.simplified(); - if (!s.isEmpty()) - terms << s; - s = QLatin1String(""); - } else if (buf[i] == QLatin1Char(' ') && !isPhrase) { - s = s.simplified(); - if (!s.isEmpty()) - terms << s; - s = QLatin1String(""); - } else - s += buf[i]; - } - if (!s.isEmpty()) - terms << s; - - setCursor(Qt::ArrowCursor); -} - -void HelpDialog::on_helpButton_clicked() -{ - emit showLink(MainWindow::urlifyFileName( - Config::configuration()->assistantDocPath() + - QLatin1String("/assistant-manual.html#full-text-searching"))); -} - -void HelpDialog::on_resultBox_itemActivated(QListWidgetItem *item) -{ - showResultPage(item); -} - -void HelpDialog::showResultPage(QListWidgetItem *item) -{ - if (item) - emit showSearchLink(foundDocs[ui.resultBox->row(item)], terms); -} - -void HelpDialog::showIndexItemMenu(const QPoint &pos) -{ - QListView *listView = qobject_cast(sender()); - if (!listView) - return; - - QModelIndex idx = listView->indexAt(pos); - if (!idx.isValid()) - return; - - QAction *action = itemPopup->exec(listView->viewport()->mapToGlobal(pos)); - if (action == actionOpenCurrentTab) { - showTopic(); - } else if (action) { - HelpWindow *hw = help->browsers()->currentBrowser(); - QString itemName = idx.data().toString(); - ui.editIndex->setText(itemName); - QStringList links = indexModel->links(idx.row()); - if (links.count() == 1) { - if (action == actionOpenLinkInNewWindow) - hw->openLinkInNewWindow(links.first()); - else - hw->openLinkInNewPage(links.first()); - } else { - QStringList::Iterator it = links.begin(); - QStringList linkList; - QStringList linkNames; - for (; it != links.end(); ++it) { - linkList << *it; - linkNames << titleOfLink(*it); - } - QString link = TopicChooser::getLink(this, linkNames, linkList, itemName); - if (!link.isEmpty()) { - if (action == actionOpenLinkInNewWindow) - hw->openLinkInNewWindow(link); - else - hw->openLinkInNewPage(link); - } - } - } -} - -void HelpDialog::showListItemMenu(const QPoint &pos) -{ - QListWidget *listWidget = qobject_cast(sender()); - if (!listWidget) - return; - QListWidgetItem *item = listWidget->itemAt(pos); - if (!item) - return; - - QAction *action = itemPopup->exec(listWidget->viewport()->mapToGlobal(pos)); - if (action == actionOpenCurrentTab) { - showResultPage(item); - } else if (action) { - HelpWindow *hw = help->browsers()->currentBrowser(); - QString link = foundDocs[ui.resultBox->row(item)]; - if (action == actionOpenLinkInNewWindow) - hw->openLinkInNewWindow(link); - else - hw->openLinkInNewPage(link); - } -} - -void HelpDialog::showTreeItemMenu(const QPoint &pos) -{ - QTreeWidget *treeWidget = qobject_cast(sender()); - - if (!treeWidget) - return; - - QTreeWidgetItem *item = treeWidget->itemAt(pos); - - if (!item) - return; - - QAction *action = itemPopup->exec(treeWidget->viewport()->mapToGlobal(pos)); - if (action == actionOpenCurrentTab) { - if (ui.tabWidget->currentWidget()->objectName() == QLatin1String("contentPage")) - showContentsTopic(); - else - showBookmarkTopic(); - } else if (action) { - QTreeWidgetItem *i = (QTreeWidgetItem*)item; - if (action == actionOpenLinkInNewWindow) - help->browsers()->currentBrowser()->openLinkInNewWindow(i->data(0, LinkRole).toString()); - else - help->browsers()->currentBrowser()->openLinkInNewPage(i->data(0, LinkRole).toString()); - } -} - -void HelpDialog::on_termsEdit_returnPressed() -{ - startSearch(); -} - -void HelpDialog::updateSearchButton(const QString &txt) -{ - ui.searchButton->setDisabled(txt.isEmpty()); -} - -void HelpDialog::on_searchButton_clicked() -{ - startSearch(); -} - -QString HelpDialog::removeAnchorFromLink(const QString &link) -{ - int i = link.length(); - int j = link.lastIndexOf(QLatin1Char('/')); - int l = link.lastIndexOf(QDir::separator()); - if (l > j) - j = l; - if (j > -1) { - QString fileName = link.mid(j+1); - int k = fileName.lastIndexOf(QLatin1Char('#')); - if (k > -1) - i = j + k + 1; - } - return link.left(i); -} - -QT_END_NAMESPACE diff --git a/tools/assistant/compat/helpdialog.h b/tools/assistant/compat/helpdialog.h deleted file mode 100644 index 26fccf1..0000000 --- a/tools/assistant/compat/helpdialog.h +++ /dev/null @@ -1,184 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef HELPDIALOG_H -#define HELPDIALOG_H - -#include "ui_helpdialog.h" -#include "index.h" -#include "helpwindow.h" -#include "docuparser.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QProgressBar; -class MainWindow; -class QTextBrowser; -class IndexListModel; - -class HelpNavigationListItem : public QListWidgetItem -{ -public: - HelpNavigationListItem(QListWidget *ls, const QString &txt); - - void addLink(const QString &link); - QStringList links() const { return linkList; } -private: - QStringList linkList; - -}; - -class SearchValidator : public QValidator -{ - Q_OBJECT -public: - SearchValidator(QObject *parent) - : QValidator(parent) {} - ~SearchValidator() {} - QValidator::State validate(QString &str, int &) const; -}; - -class HelpDialog : public QWidget -{ - Q_OBJECT -public: - HelpDialog(QWidget *parent, MainWindow *h); - - inline QTabWidget *tabWidget() const - { return ui.tabWidget; } - - QString titleOfLink(const QString &link); - bool eventFilter(QObject *, QEvent *); - bool lastWindowClosed() { return lwClosed; } - - void timerEvent(QTimerEvent *e); - static QString removeAnchorFromLink(const QString &link); - -signals: - void showLink(const QString &s); - void showSearchLink(const QString &s, const QStringList &terms); - -public slots: - void initialize(); - void startSearch(); - void addBookmark(); - void currentTabChanged(int index); - void locateContents(const QString &link); - -private slots: - void on_buttonAdd_clicked(); - void on_buttonRemove_clicked(); - void on_termsEdit_returnPressed(); - void on_helpButton_clicked(); - void on_searchButton_clicked(); - void on_resultBox_itemActivated(QListWidgetItem*); - void updateSearchButton(const QString &txt); - - void showResultPage(QListWidgetItem *); - - void showTopic(QTreeWidgetItem *); - void loadIndexFile(); - void insertContents(); - void setupFullTextIndex(); - void showTopic(); - void searchInIndex(const QString &s); - void toggleContents(); - void toggleIndex(); - void toggleBookmarks(); - void toggleSearch(); - void lastWinClosed(); - void setIndexingProgress(int prog); - void showListItemMenu(const QPoint &pos); - void showIndexItemMenu(const QPoint &pos); - void showTreeItemMenu(const QPoint &pos); - void insertBookmarks(); - void processEvents(); - -private: - typedef QList ContentList; - void removeOldCacheFiles(bool onlyFulltextSearchIndex = false); - void buildKeywordDB(); - quint32 getFileAges(); - void showIndexTopic(); - void showBookmarkTopic(); - void setupTitleMap(); - void saveBookmarks(); - void showContentsTopic(); - void showInitDoneMessage(); - void buildContentDict(); - QTreeWidgetItem * locateLink(QTreeWidgetItem *item, const QString &link); - -private: - Ui::HelpDialog ui; - - IndexListModel *indexModel; - QMap titleMap; - bool indexDone, bookmarksInserted, titleMapDone, contentsInserted; - bool lwClosed; - MainWindow *help; - QString documentationPath; - Index *fullTextIndex; - QStringList terms, foundDocs; - bool initDoneMsgShown; - void getAllContents(); - QList > contentList; - QMenu *itemPopup; - QString cacheFilesPath; - QStringList keywordDocuments; - - QAction *actionOpenCurrentTab; - QAction *actionOpenLinkInNewWindow; - QAction *actionOpenLinkInNewTab; -}; - -QT_END_NAMESPACE - -#endif // HELPDIALOG_H diff --git a/tools/assistant/compat/helpdialog.ui b/tools/assistant/compat/helpdialog.ui deleted file mode 100644 index 3940afe..0000000 --- a/tools/assistant/compat/helpdialog.ui +++ /dev/null @@ -1,404 +0,0 @@ - - - ********************************************************************* -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -********************************************************************* - - HelpDialog - - - - 0 - 0 - 274 - 417 - - - - Help - - - <b>Help</b><p>Choose the topic you want help on from the contents list, or search the index for keywords.</p> - - - - 0 - - - 6 - - - - - Displays help topics organized by category, index or bookmarks. Another tab inherits the full text search. - - - - Con&tents - - - - 5 - - - 6 - - - - - Qt::CustomContextMenu - - - <b>Help topics organized by category.</b><p>Double-click an item to see the topics in that category. To view a topic, just double-click it.</p> - - - true - - - true - - - - column 1 - - - - - - - - - &Index - - - - 5 - - - 6 - - - - - &Look For: - - - editIndex - - - - - - - Enter keyword - - - <b>Enter a keyword.</b><p>The list will select an item that matches the entered string best.</p> - - - - - - - Qt::CustomContextMenu - - - <b>List of available help topics.</b><p>Double-click on an item to open its help page. If more than one is found, you must specify which page you want.</p> - - - - - - - - &Bookmarks - - - - 5 - - - 6 - - - - - Qt::CustomContextMenu - - - Displays the list of bookmarks. - - - true - - - - column 1 - - - - - - - - 0 - - - 6 - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 20 - 20 - - - - - - - - Add new bookmark - - - Add the currently displayed page as a new bookmark. - - - &New - - - - - - - Delete bookmark - - - Delete the selected bookmark. - - - &Delete - - - - - - - - - - &Search - - - - 5 - - - 6 - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 20 - - - - - - - - Searching f&or: - - - termsEdit - - - - - - - Enter searchword(s) - - - <b>Enter search word(s).</b><p>Enter here the word(s) you are looking for. The words may contain wildcards (*). For a sequence of words quote them.</p> - - - - - - - Qt::CustomContextMenu - - - <b>Found documents</b><p>This list contains all found documents from the last search. The documents are ordered, i.e. the first document has the most matches.</p> - - - - - - - Found &Documents: - - - resultBox - - - - - - - 1 - - - 6 - - - - - Display the help page - - - Display the help page for the full text search. - - - He&lp - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 61 - 21 - - - - - - - - Start searching - - - Pressing this button starts the search. - - - &Search - - - false - - - - - - - - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - 3 - - - 6 - - - - - Preparing... - - - - - - - - - - - - - - tabWidget - listContents - editIndex - listIndex - listBookmarks - buttonAdd - buttonRemove - termsEdit - searchButton - helpButton - resultBox - - - - diff --git a/tools/assistant/compat/helpwindow.cpp b/tools/assistant/compat/helpwindow.cpp deleted file mode 100644 index a755bdc..0000000 --- a/tools/assistant/compat/helpwindow.cpp +++ /dev/null @@ -1,247 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "helpwindow.h" -#include "mainwindow.h" -#include "tabbedbrowser.h" -#include "helpdialog.h" -#include "config.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#if defined(Q_OS_WIN32) -# include -#endif - -QT_BEGIN_NAMESPACE - -HelpWindow::HelpWindow(MainWindow *w, QWidget *parent) - : QTextBrowser(parent) - , mw(w) - , blockScroll(false) - , shiftPressed(false) - , newWindow(false) -{ - FontSettings settings = Config::configuration()->fontSettings(); - setFont(settings.browserFont); - - connect(this, SIGNAL(copyAvailable(bool)), w, SLOT(copyAvailable(bool))); -} - -void HelpWindow::setSource(const QUrl &name) -{ - if (name.isValid()) { - if (name.scheme() == QLatin1String("http") || name.scheme() == QLatin1String("ftp") - || name.scheme() == QLatin1String("mailto") || name.path().endsWith(QLatin1String("pdf"))) { - bool launched = QDesktopServices::openUrl(name); - if (!launched) { - QMessageBox::information(mw, tr("Help"), - tr("Unable to launch web browser.\n"), - tr("OK")); - } - return; - } - - QFileInfo fi(name.toLocalFile()); - if (name.scheme() == QLatin1String("file") && fi.exists()) { - if (newWindow || (shiftPressed && hasFocus())) { - shiftPressed = false; - mw->saveSettings(); - MainWindow *nmw = new MainWindow; - nmw->move(mw->geometry().topLeft()); - nmw->show(); - - if (mw->isMaximized()) - nmw->showMaximized(); - - nmw->setup(); - nmw->showLink(name.toString()); - } else { - QTextBrowser::setSource(name); - QTextBrowser::scrollToAnchor(name.fragment()); - } - return; - } - } - - mw->statusBar()->showMessage(tr("Failed to open link: '%1'").arg(name.toString()), 5000); - setHtml(tr("

The page could not be found


" - "

'%1'

").arg(name.toString())); - mw->browsers()->updateTitle(tr("Error...")); -} - -void HelpWindow::openLinkInNewWindow() -{ - if (lastAnchor.isEmpty()) - return; - newWindow = true; - setSource(lastAnchor); - newWindow = false; -} - -void HelpWindow::openLinkInNewWindow(const QString &link) -{ - lastAnchor = link; - openLinkInNewWindow(); -} - -void HelpWindow::openLinkInNewPage() -{ - if(lastAnchor.isEmpty()) - return; - mw->browsers()->newTab(lastAnchor); - lastAnchor.clear(); -} - -void HelpWindow::openLinkInNewPage(const QString &link) -{ - lastAnchor = link; - openLinkInNewPage(); -} - -bool HelpWindow::hasAnchorAt(const QPoint& pos) -{ - lastAnchor = anchorAt(pos); - if (lastAnchor.isEmpty()) - return false; - lastAnchor = source().resolved(lastAnchor).toString(); - if (lastAnchor.at(0) == QLatin1Char('#')) { - QString src = source().toString(); - int hsh = src.indexOf(QLatin1Char('#')); - lastAnchor = (hsh>=0 ? src.left(hsh) : src) + lastAnchor; - } - return true; -} - -void HelpWindow::contextMenuEvent(QContextMenuEvent *e) -{ - QMenu menu(QLatin1String(""), 0); - - QUrl link; - QAction *copyAnchorAction = 0; - if (hasAnchorAt(e->pos())) { - link = anchorAt(e->pos()); - if (link.isRelative()) - link = source().resolved(link); - copyAnchorAction = menu.addAction(tr("Copy &Link Location")); - copyAnchorAction->setEnabled(!link.isEmpty() && link.isValid()); - - menu.addAction(tr("Open Link in New Tab"), - this, SLOT(openLinkInNewPage())); - menu.addAction(tr("Open Link in New Window\tShift+LMB"), - this, SLOT(openLinkInNewWindow())); - } - mw->setupPopupMenu(&menu); - QAction *action = menu.exec(e->globalPos()); - if (action == copyAnchorAction) - QApplication::clipboard()->setText(link.toString()); -} - -void HelpWindow::mouseReleaseEvent(QMouseEvent *e) -{ - if (e->button() == Qt::XButton1) { - QTextBrowser::backward(); - return; - } - - if (e->button() == Qt::XButton2) { - QTextBrowser::forward(); - return; - } - - if (e->button() == Qt::MidButton && hasAnchorAt(e->pos())) { - openLinkInNewPage(); - return; - } - QTextBrowser::mouseReleaseEvent(e); -} - -void HelpWindow::blockScrolling(bool b) -{ - blockScroll = b; -} - -void HelpWindow::ensureCursorVisible() -{ - if (!blockScroll) - QTextBrowser::ensureCursorVisible(); -} - -void HelpWindow::mousePressEvent(QMouseEvent *e) -{ - shiftPressed = e->modifiers() & Qt::ShiftModifier; - if (!(shiftPressed && hasAnchorAt(e->pos()))) - QTextBrowser::mousePressEvent(e); -} - -void HelpWindow::keyPressEvent(QKeyEvent *e) -{ - shiftPressed = e->modifiers() & Qt::ShiftModifier; - QTextBrowser::keyPressEvent(e); -} - -bool HelpWindow::isKDERunning() const -{ - return !qgetenv("KDE_FULL_SESSION").isEmpty(); -} - -QT_END_NAMESPACE diff --git a/tools/assistant/compat/helpwindow.h b/tools/assistant/compat/helpwindow.h deleted file mode 100644 index 78d7830..0000000 --- a/tools/assistant/compat/helpwindow.h +++ /dev/null @@ -1,100 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef HELPWINDOW_H -#define HELPWINDOW_H - -#include - -QT_BEGIN_NAMESPACE - -class MainWindow; -class QKeyEvent; -class QMime; -class QMouseEvent; -class QMenu; - -class HelpWindow : public QTextBrowser -{ - Q_OBJECT -public: - HelpWindow( MainWindow *m, QWidget *parent = 0); - void setSource( const QUrl &name ); - void blockScrolling( bool b ); - void openLinkInNewWindow( const QString &link ); - void openLinkInNewPage( const QString &link ); - void addMimePath( const QString &path ); - - void mousePressEvent(QMouseEvent *e); - void keyPressEvent(QKeyEvent *); - -signals: - void chooseWebBrowser(); - void choosePDFReader(); - -protected: - virtual void contextMenuEvent(QContextMenuEvent *e); - virtual void mouseReleaseEvent(QMouseEvent *e); - -protected slots: - void ensureCursorVisible(); - -private slots: - void openLinkInNewWindow(); - void openLinkInNewPage(); - - bool isKDERunning() const; - -private: - bool hasAnchorAt(const QPoint& pos); - - MainWindow *mw; - QString lastAnchor; - bool blockScroll; - bool shiftPressed; - bool newWindow; - bool fwdAvail; - bool backAvail; -}; - -QT_END_NAMESPACE - -#endif // HELPWINDOW_H diff --git a/tools/assistant/compat/images/assistant-128.png b/tools/assistant/compat/images/assistant-128.png deleted file mode 100644 index f05949f..0000000 Binary files a/tools/assistant/compat/images/assistant-128.png and /dev/null differ diff --git a/tools/assistant/compat/images/assistant.png b/tools/assistant/compat/images/assistant.png deleted file mode 100644 index ea4d1e7..0000000 Binary files a/tools/assistant/compat/images/assistant.png and /dev/null differ diff --git a/tools/assistant/compat/images/close.png b/tools/assistant/compat/images/close.png deleted file mode 100644 index 540694e..0000000 Binary files a/tools/assistant/compat/images/close.png and /dev/null differ diff --git a/tools/assistant/compat/images/designer.png b/tools/assistant/compat/images/designer.png deleted file mode 100644 index 72c42e7..0000000 Binary files a/tools/assistant/compat/images/designer.png and /dev/null differ diff --git a/tools/assistant/compat/images/linguist.png b/tools/assistant/compat/images/linguist.png deleted file mode 100644 index d388cbd..0000000 Binary files a/tools/assistant/compat/images/linguist.png and /dev/null differ diff --git a/tools/assistant/compat/images/mac/addtab.png b/tools/assistant/compat/images/mac/addtab.png deleted file mode 100644 index 20928fb..0000000 Binary files a/tools/assistant/compat/images/mac/addtab.png and /dev/null differ diff --git a/tools/assistant/compat/images/mac/book.png b/tools/assistant/compat/images/mac/book.png deleted file mode 100644 index 7a3204c..0000000 Binary files a/tools/assistant/compat/images/mac/book.png and /dev/null differ diff --git a/tools/assistant/compat/images/mac/closetab.png b/tools/assistant/compat/images/mac/closetab.png deleted file mode 100644 index ab9d669..0000000 Binary files a/tools/assistant/compat/images/mac/closetab.png and /dev/null differ diff --git a/tools/assistant/compat/images/mac/editcopy.png b/tools/assistant/compat/images/mac/editcopy.png deleted file mode 100644 index f551364..0000000 Binary files a/tools/assistant/compat/images/mac/editcopy.png and /dev/null differ diff --git a/tools/assistant/compat/images/mac/find.png b/tools/assistant/compat/images/mac/find.png deleted file mode 100644 index 3561745..0000000 Binary files a/tools/assistant/compat/images/mac/find.png and /dev/null differ diff --git a/tools/assistant/compat/images/mac/home.png b/tools/assistant/compat/images/mac/home.png deleted file mode 100644 index 78d94da..0000000 Binary files a/tools/assistant/compat/images/mac/home.png and /dev/null differ diff --git a/tools/assistant/compat/images/mac/next.png b/tools/assistant/compat/images/mac/next.png deleted file mode 100644 index a585cab..0000000 Binary files a/tools/assistant/compat/images/mac/next.png and /dev/null differ diff --git a/tools/assistant/compat/images/mac/prev.png b/tools/assistant/compat/images/mac/prev.png deleted file mode 100644 index 612fb34..0000000 Binary files a/tools/assistant/compat/images/mac/prev.png and /dev/null differ diff --git a/tools/assistant/compat/images/mac/print.png b/tools/assistant/compat/images/mac/print.png deleted file mode 100644 index 10ca56c..0000000 Binary files a/tools/assistant/compat/images/mac/print.png and /dev/null differ diff --git a/tools/assistant/compat/images/mac/synctoc.png b/tools/assistant/compat/images/mac/synctoc.png deleted file mode 100644 index 067fa94..0000000 Binary files a/tools/assistant/compat/images/mac/synctoc.png and /dev/null differ diff --git a/tools/assistant/compat/images/mac/whatsthis.png b/tools/assistant/compat/images/mac/whatsthis.png deleted file mode 100644 index 5b7078f..0000000 Binary files a/tools/assistant/compat/images/mac/whatsthis.png and /dev/null differ diff --git a/tools/assistant/compat/images/mac/zoomin.png b/tools/assistant/compat/images/mac/zoomin.png deleted file mode 100644 index d46f5af..0000000 Binary files a/tools/assistant/compat/images/mac/zoomin.png and /dev/null differ diff --git a/tools/assistant/compat/images/mac/zoomout.png b/tools/assistant/compat/images/mac/zoomout.png deleted file mode 100644 index 4632656..0000000 Binary files a/tools/assistant/compat/images/mac/zoomout.png and /dev/null differ diff --git a/tools/assistant/compat/images/qt.png b/tools/assistant/compat/images/qt.png deleted file mode 100644 index 2dc6716..0000000 Binary files a/tools/assistant/compat/images/qt.png and /dev/null differ diff --git a/tools/assistant/compat/images/win/addtab.png b/tools/assistant/compat/images/win/addtab.png deleted file mode 100644 index 4bb0feb..0000000 Binary files a/tools/assistant/compat/images/win/addtab.png and /dev/null differ diff --git a/tools/assistant/compat/images/win/book.png b/tools/assistant/compat/images/win/book.png deleted file mode 100644 index 09ec4d3..0000000 Binary files a/tools/assistant/compat/images/win/book.png and /dev/null differ diff --git a/tools/assistant/compat/images/win/closetab.png b/tools/assistant/compat/images/win/closetab.png deleted file mode 100644 index ef9e020..0000000 Binary files a/tools/assistant/compat/images/win/closetab.png and /dev/null differ diff --git a/tools/assistant/compat/images/win/editcopy.png b/tools/assistant/compat/images/win/editcopy.png deleted file mode 100644 index 1121b47..0000000 Binary files a/tools/assistant/compat/images/win/editcopy.png and /dev/null differ diff --git a/tools/assistant/compat/images/win/find.png b/tools/assistant/compat/images/win/find.png deleted file mode 100644 index 6ea35e9..0000000 Binary files a/tools/assistant/compat/images/win/find.png and /dev/null differ diff --git a/tools/assistant/compat/images/win/home.png b/tools/assistant/compat/images/win/home.png deleted file mode 100644 index b1c6ae1..0000000 Binary files a/tools/assistant/compat/images/win/home.png and /dev/null differ diff --git a/tools/assistant/compat/images/win/next.png b/tools/assistant/compat/images/win/next.png deleted file mode 100644 index 8df4127..0000000 Binary files a/tools/assistant/compat/images/win/next.png and /dev/null differ diff --git a/tools/assistant/compat/images/win/previous.png b/tools/assistant/compat/images/win/previous.png deleted file mode 100644 index 0780bc2..0000000 Binary files a/tools/assistant/compat/images/win/previous.png and /dev/null differ diff --git a/tools/assistant/compat/images/win/print.png b/tools/assistant/compat/images/win/print.png deleted file mode 100644 index ba7c02d..0000000 Binary files a/tools/assistant/compat/images/win/print.png and /dev/null differ diff --git a/tools/assistant/compat/images/win/synctoc.png b/tools/assistant/compat/images/win/synctoc.png deleted file mode 100644 index da301bc..0000000 Binary files a/tools/assistant/compat/images/win/synctoc.png and /dev/null differ diff --git a/tools/assistant/compat/images/win/whatsthis.png b/tools/assistant/compat/images/win/whatsthis.png deleted file mode 100644 index 623cad6..0000000 Binary files a/tools/assistant/compat/images/win/whatsthis.png and /dev/null differ diff --git a/tools/assistant/compat/images/win/zoomin.png b/tools/assistant/compat/images/win/zoomin.png deleted file mode 100644 index 2e586fc..0000000 Binary files a/tools/assistant/compat/images/win/zoomin.png and /dev/null differ diff --git a/tools/assistant/compat/images/win/zoomout.png b/tools/assistant/compat/images/win/zoomout.png deleted file mode 100644 index a736d39..0000000 Binary files a/tools/assistant/compat/images/win/zoomout.png and /dev/null differ diff --git a/tools/assistant/compat/images/wrap.png b/tools/assistant/compat/images/wrap.png deleted file mode 100644 index 90f18d9..0000000 Binary files a/tools/assistant/compat/images/wrap.png and /dev/null differ diff --git a/tools/assistant/compat/index.cpp b/tools/assistant/compat/index.cpp deleted file mode 100644 index 5bafdd3..0000000 --- a/tools/assistant/compat/index.cpp +++ /dev/null @@ -1,581 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "index.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -struct Term { - Term() : frequency(-1) {} - Term( const QString &t, int f, QVector l ) : term( t ), frequency( f ), documents( l ) {} - QString term; - int frequency; - QVectordocuments; - bool operator<( const Term &i2 ) const { return frequency < i2.frequency; } -}; - -QDataStream &operator>>( QDataStream &s, Document &l ) -{ - s >> l.docNumber; - s >> l.frequency; - return s; -} - -QDataStream &operator<<( QDataStream &s, const Document &l ) -{ - s << (qint16)l.docNumber; - s << (qint16)l.frequency; - return s; -} - -Index::Index( const QString &dp, const QString &hp ) - : QObject( 0 ), docPath( dp ) -{ - Q_UNUSED(hp); - - alreadyHaveDocList = false; - lastWindowClosed = false; - connect( qApp, SIGNAL(lastWindowClosed()), - this, SLOT(setLastWinClosed()) ); -} - -Index::Index( const QStringList &dl, const QString &hp ) - : QObject( 0 ) -{ - Q_UNUSED(hp); - docList = dl; - alreadyHaveDocList = true; - lastWindowClosed = false; - connect( qApp, SIGNAL(lastWindowClosed()), - this, SLOT(setLastWinClosed()) ); -} - -void Index::setLastWinClosed() -{ - lastWindowClosed = true; -} - -void Index::setDictionaryFile( const QString &f ) -{ - dictFile = f; -} - -void Index::setDocListFile( const QString &f ) -{ - docListFile = f; -} - -void Index::setDocList( const QStringList &lst ) -{ - docList = lst; -} - -int Index::makeIndex() -{ - if ( !alreadyHaveDocList ) - setupDocumentList(); - if ( docList.isEmpty() ) - return 1; - QStringList::Iterator it = docList.begin(); - int steps = docList.count() / 100; - if ( !steps ) - steps++; - int prog = 0; - for ( int i = 0; it != docList.end(); ++it, ++i ) { - if ( lastWindowClosed ) { - return -1; - } - QUrl url(*it); - parseDocument( url.toLocalFile(), i ); - if ( i%steps == 0 ) { - prog++; - emit indexingProgress( prog ); - } - } - return 0; -} - -void Index::setupDocumentList() -{ - QDir d( docPath ); - QStringList filters; - filters.append(QLatin1String("*.html")); - QStringList lst = d.entryList(filters); - QStringList::ConstIterator it = lst.constBegin(); - for ( ; it != lst.constEnd(); ++it ) - docList.append( QLatin1String("file:") + docPath + QLatin1String("/") + *it ); -} - -void Index::insertInDict( const QString &str, int docNum ) -{ - if ( str == QLatin1String("amp") || str == QLatin1String("nbsp")) - return; - Entry *e = 0; - if ( dict.count() ) - e = dict[ str ]; - - if ( e ) { - if ( e->documents.last().docNumber != docNum ) - e->documents.append( Document(docNum, 1 ) ); - else - e->documents.last().frequency++; - } else { - dict.insert( str, new Entry( docNum ) ); - } -} - -QString Index::getCharsetForDocument(QFile *file) -{ - QTextStream s(file); - QString contents = s.readAll(); - - QString encoding; - int start = contents.indexOf(QLatin1String(" 0) { - int end = contents.indexOf(QLatin1String(">"), start); - QString meta = contents.mid(start+5, end-start); - meta = meta.toLower(); - QRegExp r(QLatin1String("charset=([^\"\\s]+)")); - if (r.indexIn(meta) != -1) { - encoding = r.cap(1); - } - } - - file->seek(0); - if (encoding.isEmpty()) - return QLatin1String("utf-8"); - return encoding; -} - -void Index::parseDocument( const QString &filename, int docNum ) -{ - QFile file( filename ); - if ( !file.open(QFile::ReadOnly) ) { - qWarning( "can not open file %s", qPrintable(filename) ); - return; - } - - QTextStream s(&file); - QString en = getCharsetForDocument(&file); - s.setCodec(QTextCodec::codecForName(en.toLatin1().constData())); - - QString text = s.readAll(); - if (text.isNull()) - return; - - bool valid = true; - const QChar *buf = text.unicode(); - QChar str[64]; - QChar c = buf[0]; - int j = 0; - int i = 0; - while ( j < text.length() ) { - if ( c == QLatin1Char('<') || c == QLatin1Char('&') ) { - valid = false; - if ( i > 1 ) - insertInDict( QString(str,i), docNum ); - i = 0; - c = buf[++j]; - continue; - } - if ( ( c == QLatin1Char('>') || c == QLatin1Char(';') ) && !valid ) { - valid = true; - c = buf[++j]; - continue; - } - if ( !valid ) { - c = buf[++j]; - continue; - } - if ( ( c.isLetterOrNumber() || c == QLatin1Char('_') ) && i < 63 ) { - str[i] = c.toLower(); - ++i; - } else { - if ( i > 1 ) - insertInDict( QString(str,i), docNum ); - i = 0; - } - c = buf[++j]; - } - if ( i > 1 ) - insertInDict( QString(str,i), docNum ); - file.close(); -} - -void Index::writeDict() -{ - QFile f( dictFile ); - if ( !f.open(QFile::WriteOnly ) ) - return; - QDataStream s( &f ); - for(QHash::Iterator it = dict.begin(); it != dict.end(); ++it) { - s << it.key(); - s << it.value()->documents.count(); - s << it.value()->documents; - } - f.close(); - writeDocumentList(); -} - -void Index::writeDocumentList() -{ - QFile f( docListFile ); - if ( !f.open(QFile::WriteOnly ) ) - return; - QDataStream s( &f ); - s << docList; -} - -void Index::readDict() -{ - QFile f( dictFile ); - if ( !f.open(QFile::ReadOnly ) ) - return; - - dict.clear(); - QDataStream s( &f ); - QString key; - int numOfDocs; - QVector docs; - while ( !s.atEnd() ) { - s >> key; - s >> numOfDocs; - docs.resize(numOfDocs); - s >> docs; - dict.insert( key, new Entry( docs ) ); - } - f.close(); - readDocumentList(); -} - -void Index::readDocumentList() -{ - QFile f( docListFile ); - if ( !f.open(QFile::ReadOnly ) ) - return; - QDataStream s( &f ); - s >> docList; -} - -QStringList Index::query( const QStringList &terms, const QStringList &termSeq, const QStringList &seqWords ) -{ - QList termList; - for (QStringList::ConstIterator it = terms.begin(); it != terms.end(); ++it ) { - Entry *e = 0; - if ( (*it).contains(QLatin1Char('*')) ) { - QVector wcts = setupDummyTerm( getWildcardTerms( *it ) ); - termList.append( Term(QLatin1String("dummy"), wcts.count(), wcts ) ); - } else if ( dict[ *it ] ) { - e = dict[ *it ]; - termList.append( Term( *it, e->documents.count(), e->documents ) ); - } else { - return QStringList(); - } - } - if ( !termList.count() ) - return QStringList(); - qSort(termList); - - QVector minDocs = termList.takeFirst().documents; - for(QList::Iterator it = termList.begin(); it != termList.end(); ++it) { - Term *t = &(*it); - QVector docs = t->documents; - for(QVector::Iterator minDoc_it = minDocs.begin(); minDoc_it != minDocs.end(); ) { - bool found = false; - for (QVector::ConstIterator doc_it = docs.constBegin(); doc_it != docs.constEnd(); ++doc_it ) { - if ( (*minDoc_it).docNumber == (*doc_it).docNumber ) { - (*minDoc_it).frequency += (*doc_it).frequency; - found = true; - break; - } - } - if ( !found ) - minDoc_it = minDocs.erase( minDoc_it ); - else - ++minDoc_it; - } - } - - QStringList results; - qSort( minDocs ); - if ( termSeq.isEmpty() ) { - for(QVector::Iterator it = minDocs.begin(); it != minDocs.end(); ++it) - results << docList.at((int)(*it).docNumber); - return results; - } - - QString fileName; - for(QVector::Iterator it = minDocs.begin(); it != minDocs.end(); ++it) { - fileName = docList[ (int)(*it).docNumber ]; - if ( searchForPattern( termSeq, seqWords, fileName ) ) - results << fileName; - } - return results; -} - -QString Index::getDocumentTitle( const QString &fullFileName ) -{ - QUrl url(fullFileName); - QString fileName = url.toLocalFile(); - - if (documentTitleCache.contains(fileName)) - return documentTitleCache.value(fileName); - - QFile file( fileName ); - if ( !file.open( QFile::ReadOnly ) ) { - qWarning( "cannot open file %s", qPrintable(fileName) ); - return fileName; - } - QTextStream s( &file ); - QString text = s.readAll(); - - int start = text.indexOf(QLatin1String(""), 0, Qt::CaseInsensitive) + 7; - int end = text.indexOf(QLatin1String(""), 0, Qt::CaseInsensitive); - - QString title = tr("Untitled"); - if (end - start > 0) { - title = text.mid(start, end - start); - if (Qt::mightBeRichText(title)) { - QTextDocument doc; - doc.setHtml(title); - title = doc.toPlainText(); - } - } - documentTitleCache.insert(fileName, title); - return title; -} - -QStringList Index::getWildcardTerms( const QString &term ) -{ - QStringList lst; - QStringList terms = split( term ); - QStringList::Iterator iter; - - for(QHash::Iterator it = dict.begin(); it != dict.end(); ++it) { - int index = 0; - bool found = false; - QString text( it.key() ); - for ( iter = terms.begin(); iter != terms.end(); ++iter ) { - if ( *iter == QLatin1String("*") ) { - found = true; - continue; - } - if ( iter == terms.begin() && (*iter)[0] != text[0] ) { - found = false; - break; - } - index = text.indexOf( *iter, index ); - if ( *iter == terms.last() && index != (int)text.length()-1 ) { - index = text.lastIndexOf( *iter ); - if ( index != (int)text.length() - (int)(*iter).length() ) { - found = false; - break; - } - } - if ( index != -1 ) { - found = true; - index += (*iter).length(); - continue; - } else { - found = false; - break; - } - } - if ( found ) - lst << text; - } - - return lst; -} - -QStringList Index::split( const QString &str ) -{ - QStringList lst; - int j = 0; - int i = str.indexOf(QLatin1Char('*'), j ); - - if (str.startsWith(QLatin1String("*"))) - lst << QLatin1String("*"); - - while ( i != -1 ) { - if ( i > j && i <= (int)str.length() ) { - lst << str.mid( j, i - j ); - lst << QLatin1String("*"); - } - j = i + 1; - i = str.indexOf(QLatin1Char('*'), j ); - } - - int l = str.length() - 1; - if ( str.mid( j, l - j + 1 ).length() > 0 ) - lst << str.mid( j, l - j + 1 ); - - return lst; -} - -QVector Index::setupDummyTerm( const QStringList &terms ) -{ - QList termList; - for (QStringList::ConstIterator it = terms.begin(); it != terms.end(); ++it) { - Entry *e = 0; - if ( dict[ *it ] ) { - e = dict[ *it ]; - termList.append( Term( *it, e->documents.count(), e->documents ) ); - } - } - QVector maxList(0); - if ( !termList.count() ) - return maxList; - qSort(termList); - - maxList = termList.takeLast().documents; - for(QList::Iterator it = termList.begin(); it != termList.end(); ++it) { - Term *t = &(*it); - QVector docs = t->documents; - for (QVector::iterator docIt = docs.begin(); docIt != docs.end(); ++docIt ) { - if ( maxList.indexOf( *docIt ) == -1 ) - maxList.append( *docIt ); - } - } - return maxList; -} - -void Index::buildMiniDict( const QString &str ) -{ - if ( miniDict[ str ] ) - miniDict[ str ]->positions.append( wordNum ); - ++wordNum; -} - -bool Index::searchForPattern( const QStringList &patterns, const QStringList &words, const QString &fileName ) -{ - QUrl url(fileName); - QString fName = url.toLocalFile(); - QFile file( fName ); - if ( !file.open( QFile::ReadOnly ) ) { - qWarning( "cannot open file %s", qPrintable(fName) ); - return false; - } - - wordNum = 3; - miniDict.clear(); - QStringList::ConstIterator cIt = words.begin(); - for ( ; cIt != words.end(); ++cIt ) - miniDict.insert( *cIt, new PosEntry( 0 ) ); - - QTextStream s( &file ); - QString text = s.readAll(); - bool valid = true; - const QChar *buf = text.unicode(); - QChar str[64]; - QChar c = buf[0]; - int j = 0; - int i = 0; - while ( j < text.length() ) { - if ( c == QLatin1Char('<') || c == QLatin1Char('&') ) { - valid = false; - if ( i > 1 ) - buildMiniDict( QString(str,i) ); - i = 0; - c = buf[++j]; - continue; - } - if ( ( c == QLatin1Char('>') || c == QLatin1Char(';') ) && !valid ) { - valid = true; - c = buf[++j]; - continue; - } - if ( !valid ) { - c = buf[++j]; - continue; - } - if ( ( c.isLetterOrNumber() || c == QLatin1Char('_') ) && i < 63 ) { - str[i] = c.toLower(); - ++i; - } else { - if ( i > 1 ) - buildMiniDict( QString(str,i) ); - i = 0; - } - c = buf[++j]; - } - if ( i > 1 ) - buildMiniDict( QString(str,i) ); - file.close(); - - QStringList::ConstIterator patIt = patterns.begin(); - QStringList wordLst; - QList a, b; - QList::iterator aIt; - for ( ; patIt != patterns.end(); ++patIt ) { - wordLst = (*patIt).split(QLatin1Char(' ')); - a = miniDict[ wordLst[0] ]->positions; - for ( int j = 1; j < (int)wordLst.count(); ++j ) { - b = miniDict[ wordLst[j] ]->positions; - aIt = a.begin(); - while ( aIt != a.end() ) { - if ( b.contains( *aIt + 1 )) { - (*aIt)++; - ++aIt; - } else { - aIt = a.erase( aIt ); - } - } - } - } - if ( a.count() ) - return true; - return false; -} - -QT_END_NAMESPACE diff --git a/tools/assistant/compat/index.h b/tools/assistant/compat/index.h deleted file mode 100644 index f61276b..0000000 --- a/tools/assistant/compat/index.h +++ /dev/null @@ -1,133 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef INDEX_H -#define INDEX_H - -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -struct Document { - Document( int d, int f ) : docNumber( d ), frequency( f ) {} - Document() : docNumber( -1 ), frequency( 0 ) {} - bool operator==( const Document &doc ) const { - return docNumber == doc.docNumber; - } - bool operator<( const Document &doc ) const { - return frequency > doc.frequency; - } - bool operator<=( const Document &doc ) const { - return frequency >= doc.frequency; - } - bool operator>( const Document &doc ) const { - return frequency < doc.frequency; - } - qint16 docNumber; - qint16 frequency; -}; - -QDataStream &operator>>( QDataStream &s, Document &l ); -QDataStream &operator<<( QDataStream &s, const Document &l ); - -class Index : public QObject -{ - Q_OBJECT -public: - struct Entry { - Entry( int d ) { documents.append( Document( d, 1 ) ); } - Entry( QVector l ) : documents( l ) {} - QVector documents; - }; - struct PosEntry { - PosEntry( int p ) { positions.append( p ); } - QList positions; - }; - - Index( const QString &dp, const QString &hp ); - Index( const QStringList &dl, const QString &hp ); - void writeDict(); - void readDict(); - int makeIndex(); - QStringList query( const QStringList&, const QStringList&, const QStringList& ); - QString getDocumentTitle( const QString& ); - void setDictionaryFile( const QString& ); - void setDocListFile( const QString& ); - void setDocList( const QStringList & ); - -signals: - void indexingProgress( int ); - -private slots: - void setLastWinClosed(); - -private: - void setupDocumentList(); - void parseDocument( const QString&, int ); - void insertInDict( const QString&, int ); - void writeDocumentList(); - void readDocumentList(); - QStringList getWildcardTerms( const QString& ); - QStringList split( const QString& ); - QVector setupDummyTerm( const QStringList& ); - bool searchForPattern( const QStringList&, const QStringList&, const QString& ); - void buildMiniDict( const QString& ); - QString getCharsetForDocument(QFile *); - QStringList docList; - QHash dict; - QHash miniDict; - uint wordNum; - QString docPath; - QString dictFile, docListFile; - bool alreadyHaveDocList; - bool lastWindowClosed; - QHash documentTitleCache; -}; - -#endif - -QT_END_NAMESPACE diff --git a/tools/assistant/compat/lib/lib.pro b/tools/assistant/compat/lib/lib.pro deleted file mode 100644 index e50d470..0000000 --- a/tools/assistant/compat/lib/lib.pro +++ /dev/null @@ -1,78 +0,0 @@ -TEMPLATE = lib -QT += network -TARGET = QtAssistantClient -isEmpty(QT_MAJOR_VERSION) { - VERSION=4.3.0 -} else { - VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION} -} - -CONFIG += qt warn_on -mac|win32:CONFIG += debug_and_release -mac:unix:CONFIG += explicitlib -CONFIG -= dll - -HEADERS = qassistantclient.h \ - qassistantclient_global.h -SOURCES = qassistantclient.cpp - -DESTDIR = ../../../../lib -DLLDESTDIR = ../../../../bin - -unix { - QMAKE_CFLAGS += $$QMAKE_CFLAGS_SHLIB - QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_SHLIB -} - -DEFINES += QT_ASSISTANT_CLIENT_LIBRARY -contains(CONFIG, static) { - DEFINES += QT_ASSISTANT_CLIENT_STATIC -} - -#load up the headers info -CONFIG += qt_install_headers -HEADERS_PRI = $$QT_BUILD_TREE/include/QtAssistant/headers.pri -include($$HEADERS_PRI, "", true)|clear(HEADERS_PRI) - -#mac frameworks -mac:!static:contains(QT_CONFIG, qt_framework) { - TARGET = QtAssistant # Change the name to match the headers - QMAKE_FRAMEWORK_BUNDLE_NAME = $$TARGET - CONFIG += lib_bundle qt_no_framework_direct_includes qt_framework - CONFIG(debug, debug|release) { - !build_pass:CONFIG += build_all - } else { #release - !debug_and_release|build_pass { - CONFIG -= qt_install_headers #no need to install these as well - FRAMEWORK_HEADERS.version = Versions - FRAMEWORK_HEADERS.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES - FRAMEWORK_HEADERS.path = Headers - } - QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS - } -} - -TARGET = $$qtLibraryTarget($$TARGET$$QT_LIBINFIX) #done towards the end - -target.path=$$[QT_INSTALL_LIBS] -INSTALLS += target -win32 { - dlltarget.path=$$[QT_INSTALL_BINS] - INSTALLS += dlltarget -} - -qt_install_headers { - assistant_headers.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES - assistant_headers.path = $$[QT_INSTALL_HEADERS]/QtAssistant - INSTALLS += assistant_headers -} - -unix { - CONFIG += create_pc - QMAKE_PKGCONFIG_LIBDIR = $$[QT_INSTALL_LIBS] - QMAKE_PKGCONFIG_INCDIR = $$[QT_INSTALL_HEADERS]/QtAssistant - QMAKE_PKGCONFIG_CFLAGS = -I$$[QT_INSTALL_HEADERS] - QMAKE_PKGCONFIG_DESTDIR = pkgconfig - QMAKE_PKGCONFIG_REQUIRES += QtNetwork -} - diff --git a/tools/assistant/compat/lib/qassistantclient.cpp b/tools/assistant/compat/lib/qassistantclient.cpp deleted file mode 100644 index 2a8cc2d..0000000 --- a/tools/assistant/compat/lib/qassistantclient.cpp +++ /dev/null @@ -1,446 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qassistantclient.h" - -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QAssistantClientPrivate -{ - friend class QAssistantClient; - QStringList arguments; -}; - -static QMap *dpointers = 0; - -static QAssistantClientPrivate *data( const QAssistantClient *client, bool create=false ) -{ - if( !dpointers ) - dpointers = new QMap; - QAssistantClientPrivate *d = (*dpointers)[client]; - if( !d && create ) { - d = new QAssistantClientPrivate; - dpointers->insert( client, d ); - } - return d; -} - -/*! - \class QAssistantClient - \obsolete - \brief The QAssistantClient class provides a means of using Qt - Assistant as an application's help tool. - - \ingroup helpsystem - - \bold{Note:} \e{This class is obsolete and only required when using - the old Qt Assistant, now called assistant_adp. If you want to use - the new Qt Assistant as a remote help viewer, simple create a - QProcess instance and specify \tt{assistant} as its executable. - The following code shows how to start Qt Assistant and request a - certain page to be shown:} - - \snippet doc/src/snippets/code/tools_assistant_compat_lib_qassistantclient.cpp 0 - - \e{For a complete example using the Qt Assistant remotely, see the \l - {help/remotecontrol}{Remote Control} example.} - - In order to make Qt Assistant act as a customized help tool for - your application, you must provide your application with a - QAssistantClient object in addition to a \l - {assistant-manual.html} {Qt Assistant Document Profile} (\c .adp - file) and the associated documentation. - - Note that the QAssistantClient class is not included in the Qt - library. To use it you must add the following line to your pro - file: - - \snippet doc/src/snippets/code/tools_assistant_compat_lib_qassistantclient.cpp 1 - - A QAssistantClient instance can open or close Qt Assistant - whenever it is required. - - Once you have created a QAssistantClient instance, specifying the - path to the Qt Assistant executable, using Qt Assistant is - simple: You can either call the openAssistant() slot to show the - defined start page of the documentation, or you can call the - showPage() slot to show a particular help page. When you call - openAssistant() and showPage(), Qt Assistant will be launched if - it isn't already running. When Qt Assistant is running, the - isOpen() function returns true. - - When calling showPage() the Qt Assistant instance will also be - brought to the foreground if its hidden. The showPage() slot can - be called multiple times, while calling openAssistant() several - times without closing the application in between, will have no - effect. - - You can close Qt Assistant at any time using the closeAssistant() - slot. When you call openAssistant(), or you call showPage() - without a previous call to openAssistant(), the assistantOpened() - signal is emitted. Similarly when closeAssistant() is called, - assistantClosed() is emitted. In either case, if an error occurs, - error() is emitted. - - One QAssistantClient instance interacts with one Qt Assistant - instance, so every time you call openAssistant(), showPage() or - closeAssistant() they are applied to the particular Qt Assistant - instance associated with the QAssistantClient. - - Qt Assistant's documentation set can be altered using the command - line arguments that are passed to the application when it is - launched. When started without any options, Qt Assistant displays - a default set of documentation. When Qt is installed, the default - documentation set in Qt Assistant contains the Qt reference - documentation as well as the tools that come with Qt, such as \QD - and \c qmake. - - Use the setArguments() function to specify the command line - arguments. You can add or remove documentation from Qt Assistant - by adding and removing the relevant content files: The command - line arguments are \c {-addContentFile file.dcf} and \c - {-removeContentFile file.dcf} respectively. You can make Qt - Assistant run customized documentation sets that are separate from - the Qt documentation, by specifying a profile: \c {-profile - myapplication.adp}. The profile format can also be used to alter - several of Qt Assistant's properties such as its title and - startpage. - - The Documentation Content File (\c .dcf) and Qt Assistant - Documentation Profile (\c .adp) formats are documented in the \l - {assistant-manual.html}{Qt Assistant Manual}. - - For a complete example using the QAssistantClient class, see the - \e{Simple Text Viewer} example. The example shows how you can make - Qt Assistant act as a customized help tool for your application - using the QAssistantClient class combined with a Qt Assistant - Document Profile. - - \sa {Qt Assistant Manual}, {Simple Text Viewer Example} -*/ - -/*! - \fn void QAssistantClient::assistantOpened() - - This signal is emitted when Qt Assistant is opened and the - client-server communication is set up. - - \sa openAssistant(), showPage() -*/ - -/*! - \fn void QAssistantClient::assistantClosed() - - This signal is emitted when the connection to Qt Assistant is - closed. This happens when the user exits Qt Assistant, if an - error in the server or client occurs, or if closeAssistant() is - called. - - \sa closeAssistant() -*/ - -/*! - \fn void QAssistantClient::error( const QString &message ) - - This signal is emitted if Qt Assistant cannot be started, or if an - error occurs during the initialization of the connection between - Qt Assistant and the calling application. The \a message provides an - explanation of the error. -*/ - -/*! - Constructs an assistant client with the specified \a parent. For - systems other than Mac OS, \a path specifies the path to the Qt - Assistant executable. For Mac OS, \a path specifies a directory - containing a valid assistant.app bundle. If \a path is the empty - string, the system path (\c{%PATH%} or \c $PATH) is used. -*/ -QAssistantClient::QAssistantClient( const QString &path, QObject *parent ) - : QObject( parent ), host ( QLatin1String("localhost") ) -{ -#if defined(Q_OS_MAC) - const QString assistant = QLatin1String("Assistant_adp"); -#else - const QString assistant = QLatin1String("assistant_adp"); -#endif - - if ( path.isEmpty() ) - assistantCommand = assistant; - else { - QFileInfo fi( path ); - if ( fi.isDir() ) - assistantCommand = path + QLatin1String("/") + assistant; - else - assistantCommand = path; - } - -#if defined(Q_OS_MAC) - assistantCommand += QLatin1String(".app/Contents/MacOS/Assistant_adp"); -#endif - - socket = new QTcpSocket( this ); - connect( socket, SIGNAL(connected()), - SLOT(socketConnected()) ); - connect( socket, SIGNAL(disconnected()), - SLOT(socketConnectionClosed()) ); - connect( socket, SIGNAL(error(QAbstractSocket::SocketError)), - SLOT(socketError()) ); - opened = false; - proc = new QProcess( this ); - port = 0; - pageBuffer = QLatin1String(""); - connect( proc, SIGNAL(readyReadStandardError()), - this, SLOT(readStdError()) ); - connect( proc, SIGNAL(error(QProcess::ProcessError)), - this, SLOT(procError(QProcess::ProcessError)) ); -} - -/*! - Destroys the assistant client object. -*/ -QAssistantClient::~QAssistantClient() -{ - if ( proc->state() == QProcess::Running ) - proc->terminate(); - - if( dpointers ) { - QAssistantClientPrivate *d = (*dpointers)[ this ]; - if ( d ) { - dpointers->remove(this); - delete d; - if( dpointers->isEmpty() ) { - delete dpointers; - dpointers = 0; - } - } - } -} - -/*! - Opens Qt Assistant, i.e. sets up the client-server communication - between the application and Qt Assistant, and shows the start page - specified by the current \l {assistant-manual.html} - {Qt Assistant Document Profile}. If there is no specfied profile, - and Qt is installed, the default start page is the Qt Reference - Documentation's index page. - - If the connection is already established, this function does - nothing. Use the showPage() function to show another page. If an - error occurs, the error() signal is emitted. - - \sa showPage(), assistantOpened() -*/ -void QAssistantClient::openAssistant() -{ - if ( proc->state() == QProcess::Running ) - return; - - QStringList args; - args.append(QLatin1String("-server")); - if( !pageBuffer.isEmpty() ) { - args.append( QLatin1String("-file") ); - args.append( pageBuffer ); - } - - QAssistantClientPrivate *d = data( this ); - if( d ) { - QStringList::ConstIterator it = d->arguments.constBegin(); - while( it!=d->arguments.constEnd() ) { - args.append( *it ); - ++it; - } - } - - connect( proc, SIGNAL(readyReadStandardOutput()), - this, SLOT(readPort()) ); - - proc->start(assistantCommand, args); -} - -void QAssistantClient::procError(QProcess::ProcessError err) -{ - switch (err) - { - case QProcess::FailedToStart: - emit error( tr( "Failed to start Qt Assistant." ) ); - break; - case QProcess::Crashed: - emit error( tr( "Qt Assistant crashed." ) ); - break; - default: - emit error( tr( "Error while running Qt Assistant." ) ); - } -} - -void QAssistantClient::readPort() -{ - QString p(QString::fromLatin1(proc->readAllStandardOutput())); - quint16 port = p.toUShort(); - if ( port == 0 ) { - emit error( tr( "Cannot connect to Qt Assistant." ) ); - return; - } - socket->connectToHost( host, port ); - disconnect( proc, SIGNAL(readyReadStandardOutput()), - this, SLOT(readPort()) ); -} - -/*! - Closes the Qt Assistant instance. - - \sa openAssistant(), assistantClosed() -*/ -void QAssistantClient::closeAssistant() -{ - if ( !opened ) - return; - - bool blocked = proc->blockSignals(true); - proc->terminate(); - if (!proc->waitForFinished(2000)) { - // If the process hasn't died after 2 seconds, - // we kill it, causing it to exit immediately. - proc->kill(); - } - proc->blockSignals(blocked); -} - -/*! - Brings Qt Assistant to the foreground showing the given \a page. - The \a page parameter is a path to an HTML file - (e.g., QLatin1String("/home/pasquale/superproduct/docs/html/intro.html")). - - If Qt Assistant hasn't been opened yet, this function will call - the openAssistant() slot with the specified page as the start - page. - - \note The first time Qt Assistant is started, its window will open - in front of the application's windows. Subsequent calls to this function - will only load the specified pages in Qt Assistant and will not display - its window in front of the application's windows. - - \sa openAssistant() -*/ -void QAssistantClient::showPage( const QString &page ) -{ - if (opened) { - QTextStream os( socket ); - os << page << QLatin1String("\n"); - } else { - pageBuffer = page; - - if (proc->state() == QProcess::NotRunning) { - openAssistant(); - pageBuffer.clear(); - return; - } - } -} - -/*! - \property QAssistantClient::open - \brief whether Qt Assistant is open - -*/ -bool QAssistantClient::isOpen() const -{ - return opened; -} - -void QAssistantClient::socketConnected() -{ - opened = true; - if ( !pageBuffer.isEmpty() ) - showPage( pageBuffer ); - emit assistantOpened(); -} - -void QAssistantClient::socketConnectionClosed() -{ - opened = false; - emit assistantClosed(); -} - -void QAssistantClient::socketError() -{ - QAbstractSocket::SocketError err = socket->error(); - if (err == QTcpSocket::ConnectionRefusedError) - emit error( tr( "Could not connect to Assistant: Connection refused" ) ); - else if (err == QTcpSocket::HostNotFoundError) - emit error( tr( "Could not connect to Assistant: Host not found" ) ); - else if (err != QTcpSocket::RemoteHostClosedError) - emit error( tr( "Communication error" ) ); -} - -void QAssistantClient::readStdError() -{ - QString errmsg = QString::fromLatin1(proc->readAllStandardError()); - - if (!errmsg.isEmpty()) - emit error( errmsg.simplified() ); -} - -/*! - \fn void QAssistantClient::setArguments(const QStringList &arguments) - - Sets the command line \a arguments that are passed to Qt Assistant - when it is launched. - - The command line arguments can be used to alter Qt Assistant's - documentation set. When started without any options, Qt Assistant - displays a default set of documentation. When Qt is installed, the - default documentation set in Qt Assistant contains the Qt - reference documentation as well as the tools that come with Qt, - such as Qt Designer and qmake. -*/ -void QAssistantClient::setArguments( const QStringList &args ) -{ - QAssistantClientPrivate *d = data( this, true ); - d->arguments = args; -} - -QT_END_NAMESPACE diff --git a/tools/assistant/compat/lib/qassistantclient.h b/tools/assistant/compat/lib/qassistantclient.h deleted file mode 100644 index 35d140e..0000000 --- a/tools/assistant/compat/lib/qassistantclient.h +++ /dev/null @@ -1,100 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QASSISTANTCLIENT_H -#define QASSISTANTCLIENT_H - -#include -#include -#include -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -class QTcpSocket; - -class QT_ASSISTANT_CLIENT_EXPORT QAssistantClient : public QObject -{ - Q_OBJECT - Q_PROPERTY( bool open READ isOpen ) - -public: - QAssistantClient( const QString &path, QObject *parent = 0); - ~QAssistantClient(); - - bool isOpen() const; - - void setArguments( const QStringList &args ); - -public Q_SLOTS: - virtual void openAssistant(); - virtual void closeAssistant(); - virtual void showPage( const QString &page ); - -Q_SIGNALS: - void assistantOpened(); - void assistantClosed(); - void error( const QString &msg ); - -private Q_SLOTS: - void socketConnected(); - void socketConnectionClosed(); - void readPort(); - void procError(QProcess::ProcessError err); - void socketError(); - void readStdError(); - -private: - QTcpSocket *socket; - QProcess *proc; - quint16 port; - QString host, assistantCommand, pageBuffer; - bool opened; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif diff --git a/tools/assistant/compat/lib/qassistantclient_global.h b/tools/assistant/compat/lib/qassistantclient_global.h deleted file mode 100644 index 205455f..0000000 --- a/tools/assistant/compat/lib/qassistantclient_global.h +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QASSISTANTCLIENT_GLOBAL_H -#define QASSISTANTCLIENT_GLOBAL_H - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -#if defined(QT_ASSISTANT_CLIENT_STATIC) || (!defined(QT_SHARED) && !defined(QT_DLL)) -# define QT_ASSISTANT_CLIENT_EXPORT -#elif defined(QT_ASSISTANT_CLIENT_LIBRARY) -# define QT_ASSISTANT_CLIENT_EXPORT Q_DECL_EXPORT -#else -# define QT_ASSISTANT_CLIENT_EXPORT Q_DECL_IMPORT -#endif - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif diff --git a/tools/assistant/compat/main.cpp b/tools/assistant/compat/main.cpp deleted file mode 100644 index d09f358..0000000 --- a/tools/assistant/compat/main.cpp +++ /dev/null @@ -1,465 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "mainwindow.h" -#include "helpdialog.h" -#include "config.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if defined(USE_STATIC_JPEG_PLUGIN) - #include - Q_IMPORT_PLUGIN(qjpeg) -#endif - -#define INDEX_CHECK( text ) if( i+1 >= argc ) { fprintf(stderr, "%s\n", text); return 1; } - -QT_BEGIN_NAMESPACE - -#if !defined(QT_NO_DBUS) && defined(Q_OS_UNIX) -QT_BEGIN_INCLUDE_NAMESPACE -#include -#include -#include -#include "tabbedbrowser.h" -QT_END_INCLUDE_NAMESPACE - -class HelpWindowAdaptor : public QDBusAbstractAdaptor -{ - Q_OBJECT - Q_CLASSINFO("D-Bus Interface", "com.trolltech.Assistant.HelpWindow") - - Q_PROPERTY(QString source READ source WRITE setSource) - -public: - HelpWindowAdaptor(HelpWindow *w) : QDBusAbstractAdaptor(w), helpWindow(w) - { - setAutoRelaySignals(true); - } - -public Q_SLOTS: - inline QString source() const { return helpWindow->source().toString(); } - inline void setSource(const QString &src) { helpWindow->setSource(src); } - - inline void clearHistory() { helpWindow->clearHistory(); } - inline void backward() { helpWindow->backward(); } - inline void forward() { helpWindow->forward(); } - inline void reload() { helpWindow->reload(); } - inline void home() { helpWindow->home(); } - -private: - HelpWindow *helpWindow; -}; - -class AssistantAdaptor : public QDBusAbstractAdaptor -{ - Q_OBJECT - Q_CLASSINFO("D-Bus Interface", "com.trolltech.Assistant.HelpViewer") - -public: - AssistantAdaptor(MainWindow *mw) : QDBusAbstractAdaptor(mw), mw(mw) - { - QDBusConnection connection = QDBusConnection::sessionBus(); - connection.registerService(QLatin1String("com.trolltech.Assistant")); - connection.registerObject(QLatin1String("/Assistant"), mw); - } - -public slots: - void showLink(const QString &link) { mw->showLink(link); } - QDBusObjectPath createNewTab(); - QDBusObjectPath currentTab(); - -private: - QDBusObjectPath pathForBrowser(HelpWindow *window); - MainWindow *mw; -}; - -QDBusObjectPath AssistantAdaptor::createNewTab() -{ - HelpWindow *window = mw->browsers()->newBackgroundTab(); - return pathForBrowser(window); -} - -QDBusObjectPath AssistantAdaptor::currentTab() -{ - HelpWindow *window = mw->browsers()->currentBrowser(); - return pathForBrowser(window); -} - -QDBusObjectPath AssistantAdaptor::pathForBrowser(HelpWindow *window) -{ - int index = mw->browsers()->browsers().indexOf(window); - if (index == -1) - return QDBusObjectPath(); - - QString name(QLatin1String("/Assistant/Tabs/")); - name += QString::number(index); - QDBusObjectPath path(name); - - if (!window->findChild()) { - (void)new HelpWindowAdaptor(window); - QDBusConnection::sessionBus().registerObject(name, window); - } - - return path; -} - -#endif // QT_NO_DBUS - -class AssistantSocket : public QTcpSocket -{ - Q_OBJECT -public: - AssistantSocket( int sock, QObject *parent = 0 ); - ~AssistantSocket() {} - -signals: - void showLinkRequest( const QString& ); - -private slots: - void readClient(); - void connectionClosed(); -}; - - -class AssistantServer : public QTcpServer -{ - Q_OBJECT -public: - AssistantServer( QObject* parent = 0 ); - quint16 getPort() const; - -signals: - void showLinkRequest( const QString& ); - void newConnect(); - -public slots: - virtual void incomingConnection( int socket ); - -private: - quint16 p; -}; - -AssistantSocket::AssistantSocket( int sock, QObject *parent ) - : QTcpSocket( parent ) -{ - connect( this, SIGNAL(readyRead()), SLOT(readClient()) ); - connect( this, SIGNAL(disconnected()), SLOT(connectionClosed()) ); - setSocketDescriptor( sock ); -} - -void AssistantSocket::readClient() -{ - QString link = QString(); - while ( canReadLine() ) - link = QLatin1String(readLine()); - if ( !link.isNull() ) { - link = link.replace(QLatin1String("\n"), QLatin1String("")); - link = link.replace(QLatin1String("\r"), QLatin1String("")); - QFileInfo fi(link); - link = fi.absoluteFilePath(); - emit showLinkRequest( link ); - } -} - -void AssistantSocket::connectionClosed() -{ - deleteLater(); -} - -AssistantServer::AssistantServer( QObject *parent ) - : QTcpServer( parent ) -{ - listen(QHostAddress::LocalHost, 0); - if ( !isListening() ) { - QMessageBox::critical( 0, tr( "Qt Assistant" ), - tr( "Failed to bind to port %1" ).arg( serverPort() ) ); - exit( 1 ); - } - p = serverPort(); -} - -quint16 AssistantServer::getPort() const -{ - return p; -} - -void AssistantServer::incomingConnection( int socket ) -{ - AssistantSocket *as = new AssistantSocket( socket, this ); - connect( as, SIGNAL(showLinkRequest(QString)), - this, SIGNAL(showLinkRequest(QString)) ); - emit newConnect(); -} - -int runAssistant( int argc, char ** argv ) -{ - bool withGUI = true; -#ifndef Q_WS_WIN - if ( argc > 1 ) { - QString arg = QString::fromLocal8Bit(argv[1]); - arg = arg.toLower(); - if ( arg == QLatin1String("-addcontentfile") - || arg == QLatin1String("-removecontentfile") - || arg == QLatin1String("-help") - || arg == QLatin1String("/?") - ) - withGUI = false; - } -#endif - QApplication a(argc, argv, withGUI); - a.setOrganizationName(QLatin1String("Trolltech")); - a.setApplicationName(QLatin1String("Assistant")); - - QString resourceDir; - AssistantServer *as = 0; - QStringList catlist; - QString file, profileName, aDocPath; - bool server = false; - bool hideSidebar = false; - bool configLoaded = false; - if ( argc == 2 ) { - file = QString::fromLocal8Bit(argv[1]); - if (file.startsWith(QLatin1String("-")) || file == QLatin1String("/?")) { - file.clear(); - } else { - QFileInfo fi(file); - file = fi.absoluteFilePath(); - file = MainWindow::urlifyFileName(file); - } - } - if ( file.isEmpty() ) { - for ( int i = 1; i < argc; i++ ) { - QString opt = QString::fromLocal8Bit(argv[i]).toLower(); - if ( opt == QLatin1String("-file") ) { - INDEX_CHECK( "Missing file argument!" ); - i++; - file = QFile::decodeName(argv[i]); - } else if ( opt == QLatin1String("-server") ) { - server = true; - } else if ( opt == QLatin1String("-profile") ) { - INDEX_CHECK( "Missing profile argument!" ); - profileName = QFile::decodeName(argv[++i]); - } else if ( opt == QLatin1String("-addcontentfile") ) { - INDEX_CHECK( "Missing content file!" ); - Config *c = Config::loadConfig(QString()); - QFileInfo file( QFile::decodeName(argv[i+1]) ); - if( !file.exists() ) { - fprintf(stderr, "Could not locate content file: %s\n", qPrintable(file.absoluteFilePath())); - return 1; - } - DocuParser *parser = DocuParser::createParser( file.absoluteFilePath() ); - if( parser ) { - QFile f( QFile::decodeName(argv[i+1]) ); - if( !parser->parse( &f ) ) { - fprintf(stderr, "Failed to parse file: %s\n", qPrintable(file.absoluteFilePath())); - return 1; - } - parser->addTo( c->profile() ); - c->setDocRebuild( true ); - c->save(); - } - return 0; - } else if ( opt == QLatin1String("-removecontentfile") ) { - INDEX_CHECK("Missing content file!"); - Config *c = Config::loadConfig(QString()); - Profile *profile = c->profile(); - QString contentFile = QString::fromLocal8Bit(argv[i+i]); - QStringList entries; -#ifdef Q_WS_WIN - contentFile.replace(QLatin1Char('\\'), QLatin1Char('/')); - entries = profile->docs.filter(contentFile, Qt::CaseInsensitive); -#else - entries = profile->docs.filter(contentFile); -#endif - if (entries.count() == 0) { - fprintf(stderr, "Could not locate content file: %s\n", qPrintable(contentFile)); - return 1; - } else if (entries.count() > 1) { - fprintf(stderr, "More than one entry matching file name found, " - "please specify full path to file"); - return 1; - } else { - QFileInfo file(entries[0]); - if( !file.exists() ) { - fprintf(stderr, "Could not locate content file: %s\n", qPrintable(file.absoluteFilePath())); - return 1; - } - profile->removeDocFileEntry( file.absoluteFilePath() ); - c->setDocRebuild( true ); - c->save(); - } - return 0; - } else if ( QString( QLatin1String(argv[i]) ).toLower() == QLatin1String("-docpath") ) { - INDEX_CHECK( "Missing path!" ); - QDir dir(QString::fromLocal8Bit(argv[i+1])); - if ( dir.exists() ) { - Config *c = Config::loadConfig(QString()); - c->saveProfile(Profile::createDefaultProfile(dir.absolutePath())); - c->loadDefaultProfile(); - c->setDocRebuild(true); - c->save(); - configLoaded = true; - ++i; - } else { - fprintf(stderr, "The specified path does not exist!\n"); - return 1; - } - } else if ( opt == QLatin1String("-hidesidebar") ) { - hideSidebar = true; - } else if ( opt == QLatin1String("-help") || opt == QLatin1String("/?") ) { - QString helpText = QLatin1String( "Usage: assistant [option]\n" - "Options:\n" - " -file Filename assistant opens the specified file\n" - " -server reads commands from a socket after\n" - " assistant has started\n" - " -profile fileName starts assistant and displays the\n" - " profile specified in the file fileName.\n" - " -addContentFile file adds the content file 'file' to the set of\n" - " documentation available by default\n" - " -removeContentFile file removes the content file 'file' from the\n" - " documentation available by default\n" - " -docPath path sets the Qt documentation root path to\n" - " 'path' and starts assistant\n" - " -hideSidebar assistant will hide the sidebar.\n" - " -resourceDir assistant will load translations from\n" - " this directory.\n" - " -help shows this help."); -#ifdef Q_WS_WIN - QMessageBox::information( 0, QLatin1String("Qt Assistant"), - QLatin1String("
") + helpText + QLatin1String("
") ); -#else - fprintf(stdout, "%s\n", qPrintable(helpText)); -#endif - exit( 0 ); - } else if ( opt == QLatin1String("-resourcedir") ) { - INDEX_CHECK( "Missing resource directory argument!" ); - resourceDir = QFile::decodeName( argv[++i] ); - } else { - fprintf(stderr, "Unrecognized option %s. Try -help to get help.\n", qPrintable(opt)); - return 1; - } - } - } - - if( resourceDir.isNull() ) - resourceDir = QLibraryInfo::location(QLibraryInfo::TranslationsPath); - - QTranslator translator( 0 ); - translator.load( QLatin1String("assistant_adp_") + QLocale::system().name(), resourceDir ); - a.installTranslator( &translator ); - - QTranslator qtTranslator( 0 ); - qtTranslator.load( QLatin1String("qt_") + QLocale::system().name(), resourceDir ); - a.installTranslator( &qtTranslator ); - - Config *conf = 0; - if (configLoaded) - conf = Config::configuration(); - else - conf = Config::loadConfig( profileName ); - if (!conf) { - fprintf( stderr, "Profile '%s' does not exist!\n", profileName.toLatin1().constData() ); - fflush( stderr ); - return -1; - } - - QStringList links = conf->source(); - conf->hideSideBar( hideSidebar ); - - QPointer mw = new MainWindow(); - mw->setObjectName(QLatin1String("Assistant")); - - if ( server ) { - as = new AssistantServer(); - printf("%d\n", as->serverPort() ); - fflush( stdout ); - as->connect( as, SIGNAL(showLinkRequest(QString)), - mw, SLOT(showLinkFromClient(QString)) ); - } - -#if !defined(QT_NO_DBUS) && defined(Q_OS_UNIX) - new AssistantAdaptor(mw); -#endif // QT_NO_DBUS - - FontSettings settings = conf->fontSettings(); - if (mw->font() != settings.windowFont) - a.setFont(settings.windowFont, "QWidget"); - -#ifdef Q_WS_MAC - // Make sure AssitantClient shows the window in front. - mw->raise(); -#endif - mw->show(); - - if (!file.isEmpty()) - mw->showLink( MainWindow::urlifyFileName(file) ); - else if (file.isEmpty()) - mw->showLinks( links ); - - a.connect( &a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()) ); - - int appExec = a.exec(); - delete (MainWindow*)mw; - return appExec; -} - -QT_END_NAMESPACE - -int main( int argc, char ** argv ) -{ - Q_INIT_RESOURCE(assistant); - return QT_PREPEND_NAMESPACE(runAssistant)(argc, argv); -} - -#include "main.moc" diff --git a/tools/assistant/compat/mainwindow.cpp b/tools/assistant/compat/mainwindow.cpp deleted file mode 100644 index 325be8a..0000000 --- a/tools/assistant/compat/mainwindow.cpp +++ /dev/null @@ -1,888 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "mainwindow.h" -#include "tabbedbrowser.h" -#include "helpdialog.h" -#include "config.h" -#include "fontsettingsdialog.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -QList MainWindow::windows; - -#if defined(Q_WS_WIN) -extern Q_CORE_EXPORT int qt_ntfs_permission_lookup; -#endif - -MainWindow::MainWindow() -{ - setUnifiedTitleAndToolBarOnMac(true); - ui.setupUi(this); - -#if defined(Q_WS_WIN) - // Workaround for QMimeSourceFactory failing in QFileInfo::isReadable() for - // certain user configs. See task: 34372 - qt_ntfs_permission_lookup = 0; -#endif - setupCompleted = false; - - goActions = QList(); - goActionDocFiles = new QMap; - - windows.append(this); - tabs = new TabbedBrowser(this); - connect(tabs, SIGNAL(tabCountChanged(int)), this, SLOT(updateTabActions(int))); - setCentralWidget(tabs); - - Config *config = Config::configuration(); - - updateProfileSettings(); - - dw = new QDockWidget(this); - dw->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); - dw->setWindowTitle(tr("Sidebar")); - dw->setObjectName(QLatin1String("sidebar")); - helpDock = new HelpDialog(dw, this); - dw->setWidget(helpDock); - - addDockWidget(Qt::LeftDockWidgetArea, dw); - - // read geometry configuration - setupGoActions(); - - restoreGeometry(config->windowGeometry()); - restoreState(config->mainWindowState()); - if (config->sideBarHidden()) - dw->hide(); - - tabs->setup(); - QTimer::singleShot(0, this, SLOT(setup())); -#if defined(Q_WS_MAC) - QMenu *windowMenu = new QMenu(tr("&Window"), this); - menuBar()->insertMenu(ui.helpMenu->menuAction(), windowMenu); - windowMenu->addAction(tr("Minimize"), this, - SLOT(showMinimized()), QKeySequence(tr("Ctrl+M"))); - // Use the same forward and backward browser shortcuts as Safari and Internet Explorer do - // on the Mac. This means that if you have access to one of those cool Intellimice, the thing - // works just fine, since that's how Microsoft hacked it. - ui.actionGoPrevious->setShortcut(QKeySequence(Qt::CTRL|Qt::Key_Left)); - ui.actionGoNext->setShortcut(QKeySequence(Qt::CTRL|Qt::Key_Right)); - - static const QLatin1String MacIconPath(":/trolltech/assistant/images/mac"); - ui.actionGoNext->setIcon(QIcon(MacIconPath + QLatin1String("/next.png"))); - ui.actionGoPrevious->setIcon(QIcon(MacIconPath + QLatin1String("/prev.png"))); - ui.actionGoHome->setIcon(QIcon(MacIconPath + QLatin1String("/home.png"))); - ui.actionEditCopy->setIcon(QIcon(MacIconPath + QLatin1String("/editcopy.png"))); - ui.actionEditCopy->setIcon(QIcon(MacIconPath + QLatin1String("/editcopy.png"))); - ui.actionEditFind->setIcon(QIcon(MacIconPath + QLatin1String("/find.png"))); - ui.actionFilePrint->setIcon(QIcon(MacIconPath + QLatin1String("/print.png"))); - ui.actionZoomOut->setIcon(QIcon(MacIconPath + QLatin1String("/zoomout.png"))); - ui.actionZoomIn->setIcon(QIcon(MacIconPath + QLatin1String("/zoomin.png"))); - ui.actionSyncToc->setIcon(QIcon(MacIconPath + QLatin1String("/synctoc.png"))); - ui.actionHelpWhatsThis->setIcon(QIcon(MacIconPath + QLatin1String("/whatsthis.png"))); -#elif defined(Q_WS_X11) - ui.actionGoNext->setIcon(QIcon::fromTheme("go-next" , ui.actionGoNext->icon())); - ui.actionGoPrevious->setIcon(QIcon::fromTheme("go-previous" , ui.actionGoPrevious->icon())); - ui.actionGoHome->setIcon(QIcon::fromTheme("user-home" , ui.actionGoHome->icon())); - ui.actionEditCopy->setIcon(QIcon::fromTheme("edit-copy" , ui.actionEditCopy->icon())); - ui.actionEditFind->setIcon(QIcon::fromTheme("edit-find" , ui.actionEditFind->icon())); - ui.actionFilePrint->setIcon(QIcon::fromTheme("document-print" , ui.actionFilePrint->icon())); - ui.actionZoomOut->setIcon(QIcon::fromTheme("zoom-out" , ui.actionZoomOut->icon())); - ui.actionZoomIn->setIcon(QIcon::fromTheme("zoom-in" , ui.actionZoomIn->icon())); - ui.actionSyncToc->setIcon(QIcon::fromTheme("view-refresh" , ui.actionSyncToc->icon())); -#endif -} - -MainWindow::~MainWindow() -{ - windows.removeAll(this); - delete goActionDocFiles; -} - -void MainWindow::setup() -{ - if(setupCompleted) - return; - - qApp->setOverrideCursor(QCursor(Qt::WaitCursor)); - statusBar()->showMessage(tr("Initializing Qt Assistant...")); - setupCompleted = true; - helpDock->initialize(); - connect(ui.actionGoPrevious, SIGNAL(triggered()), tabs, SLOT(backward())); - connect(ui.actionGoNext, SIGNAL(triggered()), tabs, SLOT(forward())); - connect(ui.actionEditCopy, SIGNAL(triggered()), tabs, SLOT(copy())); - connect(ui.actionFileExit, SIGNAL(triggered()), qApp, SLOT(closeAllWindows())); - connect(ui.actionAddBookmark, SIGNAL(triggered()), - helpDock, SLOT(addBookmark())); - connect(helpDock, SIGNAL(showLink(QString)), - this, SLOT(showLink(QString))); - connect(helpDock, SIGNAL(showSearchLink(QString,QStringList)), - this, SLOT(showSearchLink(QString,QStringList))); - - connect(ui.bookmarkMenu, SIGNAL(triggered(QAction*)), - this, SLOT(showBookmark(QAction*))); - connect(ui.actionZoomIn, SIGNAL(triggered()), tabs, SLOT(zoomIn())); - connect(ui.actionZoomOut, SIGNAL(triggered()), tabs, SLOT(zoomOut())); - - connect(ui.actionOpenPage, SIGNAL(triggered()), tabs, SLOT(newTab())); - connect(ui.actionClosePage, SIGNAL(triggered()), tabs, SLOT(closeTab())); - connect(ui.actionNextPage, SIGNAL(triggered()), tabs, SLOT(nextTab())); - connect(ui.actionPrevPage, SIGNAL(triggered()), tabs, SLOT(previousTab())); - - -#if defined(Q_OS_WIN32) || defined(Q_OS_WIN64) - QShortcut *acc = new QShortcut(tr("SHIFT+CTRL+="), this); - connect(acc, SIGNAL(activated()), ui.actionZoomIn, SIGNAL(triggered())); -#endif - - connect(new QShortcut(tr("Ctrl+T"), this), SIGNAL(activated()), helpDock, SLOT(toggleContents())); - connect(new QShortcut(tr("Ctrl+I"), this), SIGNAL(activated()), helpDock, SLOT(toggleIndex())); - connect(new QShortcut(tr("Ctrl+B"), this), SIGNAL(activated()), helpDock, SLOT(toggleBookmarks())); - connect(new QShortcut(tr("Ctrl+S"), this), SIGNAL(activated()), helpDock, SLOT(toggleSearch())); - connect(new QShortcut(tr("Ctrl+]"), this), SIGNAL(activated()), tabs, SLOT(nextTab())); - connect(new QShortcut(tr("Ctrl+["), this), SIGNAL(activated()), tabs, SLOT(previousTab())); - - Config *config = Config::configuration(); - - setupBookmarkMenu(); - - QAction *viewsAction = createPopupMenu()->menuAction(); - viewsAction->setText(tr("Views")); - ui.viewMenu->addAction(viewsAction); - - const int tabIndex = config->sideBarPage(); - helpDock->tabWidget()->setCurrentIndex(tabIndex); - // The tab index is 0 by default, so we need to force an upate - // to poulate the contents in this case. - if (tabIndex == 0) - helpDock->currentTabChanged(tabIndex); - - ui.actionEditFind->setShortcut(QKeySequence::Find); - ui.actionEditFindNext->setShortcut(QKeySequence::FindNext); - ui.actionEditFindPrev->setShortcut(QKeySequence::FindPrevious); - - QObject::connect(ui.actionEditFind, SIGNAL(triggered()), tabs, SLOT(find())); - QObject::connect(ui.actionEditFindNext, SIGNAL(triggered()), tabs, SLOT(findNext())); - QObject::connect(ui.actionEditFindPrev, SIGNAL(triggered()), tabs, SLOT(findPrevious())); - connect(ui.actionEditFont_Settings, SIGNAL(triggered()), this, SLOT(showFontSettingsDialog())); - - qApp->restoreOverrideCursor(); - ui.actionGoPrevious->setEnabled(false); - ui.actionGoNext->setEnabled(false); - ui.actionEditCopy->setEnabled(false); - - // set the current selected item in the treeview - helpDialog()->locateContents(tabs->currentBrowser()->source().toString()); - connect(tabs, SIGNAL(browserUrlChanged(QString)), helpDock, SLOT(locateContents(QString))); -} - -void MainWindow::browserTabChanged() -{ - HelpWindow *win = tabs->currentBrowser(); - if (win) { - QTextCursor cursor(win->textCursor()); - ui.actionEditCopy->setEnabled(cursor.hasSelection()); - ui.actionGoPrevious->setEnabled(win->isBackwardAvailable()); - ui.actionGoNext->setEnabled(win->isForwardAvailable()); - } -} - -void MainWindow::copyAvailable(bool yes) -{ - ui.actionEditCopy->setEnabled(yes); -} - -void MainWindow::updateTabActions(int index) -{ - bool enabled = (index > 1) ? true : false; - ui.actionPrevPage->setEnabled(enabled); - ui.actionNextPage->setEnabled(enabled); - ui.actionClosePage->setEnabled(enabled); -} - -void MainWindow::setupGoActions() -{ - Config *config = Config::configuration(); - QStringList titles = config->docTitles(); - QAction *action = 0; - - static bool separatorInserted = false; - - foreach (QAction *a, goActions) { - ui.goMenu->removeAction(a); - ui.goActionToolbar->removeAction(a); - } - qDeleteAll(goActions); - goActions.clear(); - goActionDocFiles->clear(); - - int addCount = 0; - - foreach (QString title, titles) { - QPixmap pix = config->docIcon(title); - if(!pix.isNull()) { - if(!separatorInserted) { - ui.goMenu->addSeparator(); - separatorInserted = true; - } - action = new QAction(this); - action->setText(title); - action->setWhatsThis(tr("Displays the main page of a specific documentation set.")); - action->setIcon(QIcon(pix)); - ui.goMenu->addAction(action); - ui.goActionToolbar->addAction(action); - goActions.append(action); - goActionDocFiles->insert(action, config->indexPage(title)); - connect(action, SIGNAL(triggered()), - this, SLOT(showGoActionLink())); - ++addCount; - } - } - if(!addCount) - ui.goActionToolbar->hide(); - else - ui.goActionToolbar->show(); - -} - -bool MainWindow::insertActionSeparator() -{ - ui.goMenu->addSeparator(); - ui.Toolbar->addSeparator(); - return true; -} - -void MainWindow::closeEvent(QCloseEvent *e) -{ - saveSettings(); - e->accept(); -} - -void MainWindow::about() -{ - QMessageBox box(this); - - box.setText(QString::fromLatin1("
" - "

%1

" - "

Version %2

" - "

Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).

" - "

The program is provided AS IS with NO WARRANTY OF ANY KIND," - " INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A" - " PARTICULAR PURPOSE.

") - .arg(tr("Qt Assistant")).arg(QLatin1String(QT_VERSION_STR))); - box.setWindowTitle(tr("Qt Assistant")); - box.setIcon(QMessageBox::NoIcon); - box.exec(); -} - -void MainWindow::on_actionAboutApplication_triggered() -{ - QString url = Config::configuration()->aboutURL(); - if (url == QLatin1String("about_qt")) { - QMessageBox::aboutQt(this, QLatin1String("Qt Assistant")); - return; - } - QString text; - if (url.startsWith(QLatin1String("file:"))) - url = url.mid(5); - QFile file(url); - if(file.exists() && file.open(QFile::ReadOnly)) - text = QString::fromUtf8(file.readAll()); - if(text.isNull()) - text = tr("Failed to open about application contents in file: '%1'").arg(url); - - QFileInfo fi(file); - QString path = QDir::cleanPath(fi.absolutePath()); - if (!QDir::searchPaths(QLatin1String("aboutImages")).contains(path)) - QDir::addSearchPath(QLatin1String("aboutImages"), path); - - QMessageBox box(this); - box.setText(text); - box.setWindowTitle(Config::configuration()->aboutApplicationMenuText()); - box.setIcon(QMessageBox::NoIcon); - box.exec(); -} - -void MainWindow::on_actionAboutAssistant_triggered() -{ - about(); -} - -void MainWindow::on_actionGoHome_triggered() -{ - QString home = MainWindow::urlifyFileName(Config::configuration()->homePage()); - showLink(home); -} - -QString MainWindow::urlifyFileName(const QString &fileName) -{ - QString name = fileName; - QUrl url(name); - -#if defined(Q_OS_WIN32) - if (!url.isValid() || url.scheme().isEmpty() || url.scheme().toLower() != QLatin1String("file:")) { - int i = name.indexOf(QLatin1Char('#')); - QString anchor = name.mid(i); - name = name.toLower(); - if (i > -1) - name.replace(i, anchor.length(), anchor); - name.replace(QLatin1Char('\\'), QLatin1Char('/')); - foreach (QFileInfo drive, QDir::drives()) { - if (name.startsWith(drive.absolutePath().toLower())) { - name = QLatin1String("file:") + name; - break; - } - } - } -#else - if (!url.isValid() || url.scheme().isEmpty()) - name.prepend(QLatin1String("file:")); -#endif - return name; -} - -#ifndef QT_NO_PRINTER -class PrintThread : public QThread -{ - QPrinter _printer; - QTextDocument *_document; - -public: - PrintThread(QObject *parent) - : QThread(parent), _printer(QPrinter::HighResolution), _document(0) - { - } - ~PrintThread() - { - wait(); - } - - QPrinter *printer() - { - return &_printer; - } - - void start(QTextDocument *document) - { - _document = document->clone(); - _document->moveToThread(this); - QThread::start(); - } - -protected: - void run() - { - _document->print(printer()); - delete _document; - _document = 0; - } -}; -#endif //QT_NO_PRINTER - -void MainWindow::on_actionFilePrint_triggered() -{ -#ifndef QT_NO_PRINTER - if (!QFontDatabase::supportsThreadedFontRendering()) { - QPrinter printer(QPrinter::HighResolution); - - QPrintDialog dlg(&printer, this); - if (dlg.exec() == QDialog::Accepted) { - qApp->setOverrideCursor(Qt::WaitCursor); - tabs->currentBrowser()->document()->print(&printer); - qApp->restoreOverrideCursor(); - } - return; - } - - PrintThread *thread = new PrintThread(this); - - QPrintDialog dlg(thread->printer(), this); - if (dlg.exec() == QDialog::Accepted) { - connect(thread, SIGNAL(finished()), SLOT(printingFinished())); - connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater())); - - qApp->setOverrideCursor(Qt::BusyCursor); - thread->start(tabs->currentBrowser()->document()); - } else { - delete thread; - } -#else - Q_ASSERT("No printing support"); -#endif -} - -void MainWindow::printingFinished() -{ - qApp->restoreOverrideCursor(); -} - -void MainWindow::updateBookmarkMenu() -{ - for(QList::Iterator it = windows.begin(); it != windows.end(); ++it) - (*it)->setupBookmarkMenu(); -} - -void MainWindow::setupBookmarkMenu() -{ - ui.bookmarkMenu->clear(); - bookmarks.clear(); - ui.bookmarkMenu->addAction(ui.actionAddBookmark); - - QFile f(QDir::homePath() + QLatin1String("/.assistant/bookmarks.") + - Config::configuration()->profileName()); - if (!f.open(QFile::ReadOnly)) - return; - QTextStream ts(&f); - ui.bookmarkMenu->addSeparator(); - while (!ts.atEnd()) { - QString title = ts.readLine(); - QString link = ts.readLine(); - bookmarks.insert(ui.bookmarkMenu->addAction(title), link); - } -} - -void MainWindow::showBookmark(QAction *action) -{ - if (bookmarks.contains(action)) - showLink(bookmarks.value(action)); -} - -void MainWindow::showLinkFromClient(const QString &link) -{ - setWindowState(windowState() & ~Qt::WindowMinimized); - raise(); - activateWindow(); - QString l = MainWindow::urlifyFileName(link); - showLink(l); - if (isMinimized()) - showNormal(); -} - -void MainWindow::showLink(const QString &link) -{ - if(link.isEmpty()) - qWarning("The link is empty!"); - - // don't fill the history with the same url more then once - if (link == tabs->currentBrowser()->source().toString()) - return; - - QUrl url(link); - QFileInfo fi(url.toLocalFile()); - tabs->setSource(url.toString()); - tabs->currentBrowser()->setFocus(); -} - -void MainWindow::showLinks(const QStringList &links) -{ - if (links.size() == 0) { - qWarning("MainWindow::showLinks() - Empty link"); - return; - } - - if (links.size() == 1) { - showLink(MainWindow::urlifyFileName(links.first())); - return; - } - - QStringList::ConstIterator it = links.begin(); - // Initial showing, The tab is empty so update that without creating it first - if (!tabs->currentBrowser()->source().isValid()) { - QPair browser; - browser.first = tabs->currentBrowser(); - browser.second = links.first(); - pendingBrowsers.append(browser); - tabs->setTitle(tabs->currentBrowser(), tr("...")); - } - ++it; - - while(it != links.end()) { - QPair browser; - browser.first = tabs->newBackgroundTab(); - browser.second = *it; - pendingBrowsers.append(browser); - ++it; - } - - startTimer(50); - return; -} - -void MainWindow::removePendingBrowser(HelpWindow *win) -{ - if (!pendingBrowsers.count()) - return; - - QMutableListIterator > it(pendingBrowsers); - while (it.hasNext()) { - QPair browser = it.next(); - if (browser.first == win) { - it.remove(); - break; - } - } -} - -void MainWindow::timerEvent(QTimerEvent *e) -{ - QPair browser = pendingBrowsers.first(); - pendingBrowsers.pop_front(); - - if (pendingBrowsers.size() == 0) - killTimer(e->timerId()); - - browser.first->setSource(MainWindow::urlifyFileName(browser.second)); -} - -void MainWindow::showQtHelp() -{ - showLink(QLibraryInfo::location(QLibraryInfo::DocumentationPath) + - QLatin1String("/html/index.html")); -} - -MainWindow* MainWindow::newWindow() -{ - saveSettings(); - MainWindow *mw = new MainWindow; - mw->move(geometry().topLeft()); - if (isMaximized()) - mw->showMaximized(); - else - mw->show(); - mw->on_actionGoHome_triggered(); - return mw; -} - -void MainWindow::saveSettings() -{ - Config *config = Config::configuration(); - - config->setSideBarPage(helpDock->tabWidget()->currentIndex()); - config->setWindowGeometry(saveGeometry()); - config->setMainWindowState(saveState()); - - // Create list of the tab urls - QStringList lst; - QList browsers = tabs->browsers(); - foreach (HelpWindow *browser, browsers) - lst << browser->source().toString(); - config->setSource(lst); - config->save(); -} - -TabbedBrowser* MainWindow::browsers() const -{ - return tabs; -} - -void MainWindow::showSearchLink(const QString &link, const QStringList &terms) -{ - HelpWindow * hw = tabs->currentBrowser(); - hw->blockScrolling(true); - hw->setCursor(Qt::WaitCursor); - if (hw->source() == link) - hw->reload(); - else - showLink(link); - hw->setCursor(Qt::ArrowCursor); - - hw->viewport()->setUpdatesEnabled(false); - - QTextCharFormat marker; - marker.setForeground(Qt::red); - - QTextCursor firstHit; - - QTextCursor c = hw->textCursor(); - c.beginEditBlock(); - foreach (QString term, terms) { - c.movePosition(QTextCursor::Start); - hw->setTextCursor(c); - - bool found = hw->find(term, QTextDocument::FindWholeWords); - while (found) { - QTextCursor hit = hw->textCursor(); - if (firstHit.isNull() || hit.position() < firstHit.position()) - firstHit = hit; - - hit.mergeCharFormat(marker); - found = hw->find(term, QTextDocument::FindWholeWords); - } - } - - if (firstHit.isNull()) { - firstHit = hw->textCursor(); - firstHit.movePosition(QTextCursor::Start); - } - firstHit.clearSelection(); - c.endEditBlock(); - hw->setTextCursor(firstHit); - - hw->blockScrolling(false); - hw->viewport()->setUpdatesEnabled(true); -} - - -void MainWindow::showGoActionLink() -{ - const QObject *origin = sender(); - if(!origin || - QString::fromLatin1(origin->metaObject()->className()) != QString::fromLatin1("QAction")) - return; - - QAction *action = (QAction*) origin; - QString docfile = *(goActionDocFiles->find(action)); - showLink(MainWindow::urlifyFileName(docfile)); -} - -void MainWindow::on_actionHelpAssistant_triggered() -{ - showLink(Config::configuration()->assistantDocPath() + QLatin1String("/assistant-manual.html")); -} - -HelpDialog* MainWindow::helpDialog() const -{ - return helpDock; -} - -void MainWindow::backwardAvailable(bool enable) -{ - ui.actionGoPrevious->setEnabled(enable); -} - -void MainWindow::forwardAvailable(bool enable) -{ - ui.actionGoNext->setEnabled(enable); -} - -void MainWindow::updateProfileSettings() -{ - Config *config = Config::configuration(); -#ifndef Q_WS_MAC - setWindowIcon(config->applicationIcon()); -#endif - ui.helpMenu->clear(); - //ui.helpMenu->addAction(ui.actionHelpAssistant); - //ui.helpMenu->addSeparator(); - ui.helpMenu->addAction(ui.actionAboutAssistant); - if (!config->aboutApplicationMenuText().isEmpty()) - ui.helpMenu->addAction(ui.actionAboutApplication); - ui.helpMenu->addSeparator(); - ui.helpMenu->addAction(ui.actionHelpWhatsThis); - - ui.actionAboutApplication->setText(config->aboutApplicationMenuText()); - - if(!config->title().isNull()) - setWindowTitle(config->title()); -} - -void MainWindow::setupPopupMenu(QMenu *m) -{ - m->addAction(ui.actionNewWindow); - m->addAction(ui.actionOpenPage); - m->addAction(ui.actionClosePage); - m->addSeparator(); - m->addAction(ui.actionSaveAs); - m->addSeparator(); - m->addAction(ui.actionGoPrevious); - m->addAction(ui.actionGoNext); - m->addAction(ui.actionGoHome); - m->addSeparator(); - m->addAction(ui.actionZoomIn); - m->addAction(ui.actionZoomOut); - m->addSeparator(); - m->addAction(ui.actionEditCopy); - m->addAction(ui.actionEditFind); -} - -void MainWindow::on_actionSyncToc_triggered() -{ - HelpWindow *w = tabs->currentBrowser(); - if(w) { - qApp->setOverrideCursor(QCursor(Qt::WaitCursor)); - QString link = w->source().toString(); - helpDock->locateContents(link); - helpDock->tabWidget()->setCurrentIndex(0); - qApp->restoreOverrideCursor(); - } -} - -void MainWindow::on_actionNewWindow_triggered() -{ - newWindow()->show(); -} - -void MainWindow::on_actionClose_triggered() -{ - close(); -} - -void MainWindow::on_actionHelpWhatsThis_triggered() -{ - QWhatsThis::enterWhatsThisMode(); -} - -void MainWindow::on_actionSaveAs_triggered() -{ - QString fileName; - QUrl url = tabs->currentBrowser()->source(); - if (url.isValid()) { - QFileInfo fi(url.toLocalFile()); - fileName = fi.fileName(); - } - fileName = QFileDialog::getSaveFileName(this, tr("Save Page"), fileName); - if (fileName.isEmpty()) - return; - - QFile file(fileName); - if (!file.open(QIODevice::WriteOnly)) { - QMessageBox::critical(this, tr("Save Page"), tr("Cannot open file for writing!")); - return; - } - - QFileInfo fi(fileName); - QString fn = fi.fileName(); - int i = fn.lastIndexOf(QLatin1Char('.')); - if (i > -1) - fn = fn.left(i); - QString relativeDestPath = fn + QLatin1String("_images"); - QDir destDir(fi.absolutePath() + QDir::separator() + relativeDestPath); - bool imgDirAvailable = destDir.exists(); - if (!imgDirAvailable) - imgDirAvailable = destDir.mkdir(destDir.absolutePath()); - - // save images - QTextDocument *doc = tabs->currentBrowser()->document()->clone(); - if (url.isValid() && imgDirAvailable) { - QTextBlock::iterator it; - for (QTextBlock block = doc->begin(); block != doc->end(); block = block.next()) { - for (it = block.begin(); !(it.atEnd()); ++it) { - QTextFragment fragment = it.fragment(); - if (fragment.isValid()) { - QTextImageFormat fm = fragment.charFormat().toImageFormat(); - if (fm.isValid() && !fm.name().isEmpty()) { - QUrl imagePath = tabs->currentBrowser()->source().resolved(fm.name()); - if (!imagePath.isValid()) - continue; - QString from = imagePath.toLocalFile(); - QString destName = fm.name(); - int j = destName.lastIndexOf(QLatin1Char('/')); - if (j > -1) - destName = destName.mid(j+1); - QFileInfo info(from); - if (info.exists()) { - if (!QFile::copy(from, destDir.absolutePath() - + QDir::separator() + destName)) - continue; - fm.setName(QLatin1String("./") + relativeDestPath + QLatin1String("/") + destName); - QTextCursor cursor(doc); - cursor.setPosition(fragment.position()); - cursor.setPosition(fragment.position() + fragment.length(), - QTextCursor::KeepAnchor); - cursor.setCharFormat(fm); - } - } - } - } - } - } - QString src = doc->toHtml(QByteArray("utf-8")); - QTextStream s(&file); - s.setCodec("utf-8"); - s << src; - s.flush(); - file.close(); -} - -void MainWindow::showFontSettingsDialog() -{ - Config *config = Config::configuration(); - FontSettings settings = config->fontSettings(); - - { // It is important that the dialog be deleted before UI mode changes. - FontSettingsDialog dialog; - if (!dialog.showDialog(&settings)) - return; - } - - config->setFontPointSize(settings.browserFont.pointSizeF()); - config->setFontSettings(settings); - - updateApplicationFontSettings(settings); -} - -void MainWindow::updateApplicationFontSettings(FontSettings &settings) -{ - QFont font = settings.windowFont; - if (this->font() != font) - qApp->setFont(font, "QWidget"); - - font = settings.browserFont; - QList browsers = tabs->browsers(); - foreach (HelpWindow *browser, browsers) { - if (browser->font() != font) - browser->setFont(font); - } -} - -QT_END_NAMESPACE diff --git a/tools/assistant/compat/mainwindow.h b/tools/assistant/compat/mainwindow.h deleted file mode 100644 index 53969d6..0000000 --- a/tools/assistant/compat/mainwindow.h +++ /dev/null @@ -1,137 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#include "ui_mainwindow.h" -#include "config.h" - -#include -#include - -QT_BEGIN_NAMESPACE - -class TabbedBrowser; -class HelpDialog; -class HelpWindow; -class QMenu; -class QDockWidget; - -class MainWindow : public QMainWindow -{ - Q_OBJECT -public: - MainWindow(); - virtual ~MainWindow(); - - TabbedBrowser *browsers() const; - HelpDialog *helpDialog() const; - - void setupPopupMenu(QMenu *menu); - static QString urlifyFileName(const QString &fileName); - - void removePendingBrowser(HelpWindow *win); - -public slots: - MainWindow *newWindow(); - - void setup(); - void showLink(const QString &link); - void showLinks(const QStringList &links); - void saveSettings(); - void updateBookmarkMenu(); - void printingFinished(); - -private slots: - void on_actionNewWindow_triggered(); - void on_actionGoHome_triggered(); - void on_actionFilePrint_triggered(); - void on_actionClose_triggered(); - void on_actionHelpWhatsThis_triggered(); - void on_actionHelpAssistant_triggered(); - void on_actionAboutApplication_triggered(); - void on_actionAboutAssistant_triggered(); - void on_actionSaveAs_triggered(); - void on_actionSyncToc_triggered(); - - void about(); - void setupBookmarkMenu(); - void showBookmark(QAction *action); - void showLinkFromClient(const QString &link); - void showQtHelp(); - void showSearchLink(const QString &link, const QStringList &terms); - void showGoActionLink(); - void updateProfileSettings(); - void backwardAvailable(bool); - void forwardAvailable(bool); - - void browserTabChanged(); - void copyAvailable(bool yes); - void updateTabActions(int index); - void showFontSettingsDialog(); - -protected: - void closeEvent(QCloseEvent *); - void timerEvent(QTimerEvent *); - -private: - void setupGoActions(); - bool insertActionSeparator(); - void updateApplicationFontSettings(FontSettings &settings); - -private: - Ui::MainWindow ui; - - QList goActions; - uint setupCompleted:1; - TabbedBrowser *tabs; - QMap bookmarks; - HelpDialog *helpDock; - QDockWidget *dw; - static QList windows; - QMap *goActionDocFiles; - QList > pendingBrowsers; -}; - -#endif // MAINWINDOW_H - -QT_END_NAMESPACE diff --git a/tools/assistant/compat/mainwindow.ui b/tools/assistant/compat/mainwindow.ui deleted file mode 100644 index 6375adc..0000000 --- a/tools/assistant/compat/mainwindow.ui +++ /dev/null @@ -1,459 +0,0 @@ - - ********************************************************************* -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -********************************************************************* - MainWindow - - - - 0 - 0 - 949 - 670 - - - - Qt Assistant by Nokia - - - - - Toolbar - - - Qt::Horizontal - - - TopToolBarArea - - - false - - - - - - - - - - - - - - - - - - Go - - - Qt::Horizontal - - - TopToolBarArea - - - false - - - - - - 0 - 0 - 949 - 29 - - - - - &Help - - - - - - - - - - - &File - - - - - - - - - - - - - - - Boo&kmarks - - - - - &Go - - - - - - - - - - - - &View - - - - - - - &Edit - - - - - - - - - - - - - - - - - - :/trolltech/assistant/images/win/print.png - - - &Print... - - - Print the currently displayed page. - - - Ctrl+P - - - - - E&xit - - - Quit Qt Assistant. - - - Ctrl+Q - - - QAction::QuitRole - - - - - :/trolltech/assistant/images/win/editcopy.png - - - &Copy - - - Copy the selected text to the clipboard. - - - Ctrl+C - - - - - :/trolltech/assistant/images/win/find.png - - - &Find in Text... - - - Open the Find dialog. Qt Assistant will search the currently displayed page for the text you enter. - - - Ctrl+F - - - - - Find &Next - - - F3 - - - - - Find &Previous - - - Shift+F3 - - - - - :/trolltech/assistant/images/win/home.png - - - &Home - - - Go to the home page. Qt Assistant's home page is the Qt Reference Documentation. - - - Ctrl+Home - - - - - :/trolltech/assistant/images/win/previous.png - - - &Previous - - - Go to the previous page. - - - Alt+Left - - - - - :/trolltech/assistant/images/win/next.png - - - &Next - - - Go to the next page. - - - Alt+Right - - - - - About Qt Assistant - - - Display further information about Qt Assistant. - - - QAction::AboutRole - - - - - About Qt - - - QAction::AboutQtRole - - - - - :/trolltech/assistant/images/win/zoomin.png - - - Zoom &in - - - Zoom in on the document, i.e. increase the font size. - - - Ctrl++ - - - - - :/trolltech/assistant/images/win/zoomout.png - - - Zoom &out - - - Zoom out on the document, i.e. decrease the font size. - - - Ctrl+- - - - - - New Window - - - Open a new window. - - - Ctrl+N - - - - - &Close - - - Close the current window. - - - Ctrl+W - - - - - &Add Bookmark - - - Add the currently displayed page as a new bookmark. - - - - - :/trolltech/assistant/images/win/whatsthis.png - - - What's This? - - - "What's This?" context sensitive help. - - - "What's This?" context sensitive help. - - - Shift+F1 - - - - - Add Tab - - - Ctrl+Alt+N - - - - - Next Tab - - - Ctrl+Alt+Right - - - - - Previous Tab - - - Ctrl+Alt+Left - - - - - Close Tab - - - Ctrl+Alt+Q - - - - - :/trolltech/assistant/images/assistant.png - - - Qt Assistant Manual - - - F1 - - - - - Save Page As... - - - Ctrl+Alt+S - - - - - :/trolltech/assistant/images/win/synctoc.png - - - Sync with Table of Contents - - - Select the page in contents tab. - - - - - Font Settings... - - - QAction::PreferencesRole - - - - - - - - diff --git a/tools/assistant/compat/profile.cpp b/tools/assistant/compat/profile.cpp deleted file mode 100644 index 55a1f9d..0000000 --- a/tools/assistant/compat/profile.cpp +++ /dev/null @@ -1,196 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "profile.h" -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -#define QT_TITLE QLatin1String("Qt Reference Documentation") -#define DESIGNER_TITLE QLatin1String("Qt Designer Manual") -#define ASSISTANT_TITLE QLatin1String("Qt Assistant Manual") -#define LINGUIST_TITLE QLatin1String("Qt Linguist Manual") -#define QMAKE_TITLE QLatin1String("qmake Manual") - -Profile *Profile::createDefaultProfile(const QString &docPath) -{ - QString path = QLibraryInfo::location(QLibraryInfo::DocumentationPath); - if (!docPath.isEmpty()) - path = docPath; - path = QDir::cleanPath(path) + QLatin1String("/html/"); - - Profile *profile = new Profile; - profile->valid = true; - profile->type = DefaultProfile; - profile->props[QLatin1String("name")] = QLatin1String("default"); - profile->props[QLatin1String("applicationicon")] = QLatin1String("assistant.png"); - profile->props[QLatin1String("aboutmenutext")] = QLatin1String("About Qt"); - profile->props[QLatin1String("abouturl")] = QLatin1String("about_qt"); - profile->props[QLatin1String("basepath")] = path; - profile->props[QLatin1String("startpage")] = path + QLatin1String("index.html"); - - profile->addDCFTitle( path + QLatin1String("qt.dcf"), QT_TITLE ); - profile->addDCFTitle( path + QLatin1String("designer.dcf"), DESIGNER_TITLE ); - profile->addDCFTitle( path + QLatin1String("assistant.dcf"), ASSISTANT_TITLE ); - profile->addDCFTitle( path + QLatin1String("linguist.dcf"), LINGUIST_TITLE ); - profile->addDCFTitle( path + QLatin1String("qmake.dcf"), QMAKE_TITLE ); - - profile->addDCFIcon( QT_TITLE, QLatin1String("qt.png") ); - profile->addDCFIcon( DESIGNER_TITLE, QLatin1String("designer.png") ); - profile->addDCFIcon( ASSISTANT_TITLE, QLatin1String("assistant.png") ); - profile->addDCFIcon( LINGUIST_TITLE, QLatin1String("linguist.png") ); - - profile->addDCFIndexPage( QT_TITLE, path + QLatin1String("index.html") ); - profile->addDCFIndexPage( DESIGNER_TITLE, path + QLatin1String("designer-manual.html") ); - profile->addDCFIndexPage( ASSISTANT_TITLE, path + QLatin1String("assistant-manual.html") ); - profile->addDCFIndexPage( LINGUIST_TITLE, path + QLatin1String("linguist-manual.html") ); - profile->addDCFIndexPage( QMAKE_TITLE, path + QLatin1String("qmake-manual.html") ); - - profile->addDCFImageDir( QT_TITLE, QLatin1String("../../gif/") ); - profile->addDCFImageDir( DESIGNER_TITLE, QLatin1String("../../gif/") ); - profile->addDCFImageDir( ASSISTANT_TITLE, QLatin1String("../../gif/") ); - profile->addDCFImageDir( LINGUIST_TITLE, QLatin1String("../../gif/") ); - profile->addDCFImageDir( QMAKE_TITLE, QLatin1String("../../gif/") ); - - return profile; -} - -Profile::Profile() - : valid( true ), dparser( 0 ) -{ - type = DefaultProfile; -} - -bool Profile::isValid() const -{ - return valid; -} - -void Profile::addDCFTitle(const QString &dcf, const QString &title) -{ - QString absdcf = QFileInfo(dcf).absoluteFilePath(); - dcfTitles[title] = absdcf; - if (!docs.contains(absdcf)) - docs << absdcf; -} - -void Profile::addDCF(const QString &docfile) -{ - if( !docs.contains( docfile ) == 0 ) - docs << docfile; -} - -void Profile::addDCFIcon(const QString docfile, const QString &icon) -{ - icons[docfile] = icon; -} - -void Profile::addDCFIndexPage(const QString title, const QString &indexPage) -{ - indexPages[title] = indexPage; -} - -void Profile::addDCFImageDir(const QString docfile, const QString &imgDir) -{ - imageDirs[docfile] = imgDir; -} - -void Profile::addProperty(const QString &name, const QString &value) -{ - props[name] = value; -} - -bool Profile::hasDocFile(const QString &name) -{ - return docs.contains( name ); -} - -void Profile::removeDocFileEntry(const QString &docfile) -{ - docs.removeAll(docfile); - QStringList titles; - - for( QMap::Iterator it = dcfTitles.begin(); - it != dcfTitles.end(); ++it ) { - if( (*it) == docfile ) { - indexPages.remove( *it ); - icons.remove( *it ); - imageDirs.remove( *it ); - titles << it.key(); - } - } - - for( QStringList::ConstIterator title = titles.constBegin(); - title != titles.constEnd(); ++title ) - dcfTitles.remove( *title ); - -#ifdef ASSISTANT_DEBUG - qDebug() << "docs:\n - " << docs.join("\n - "); - qDebug() << "titles:\n - " << titles.join("\n - "); - qDebug() << "keys:\n - " << ((QStringList*)&(dcfTitles.keys()))->join("\n - "); - qDebug() << "values:\n - " << ((QStringList*)&(dcfTitles.values()))->join("\n - "); -#endif -} - -QString Profile::storableFilePath(const QString &fileName) -{ - QString path = QLibraryInfo::location(QLibraryInfo::DocumentationPath).replace(QLatin1String("\\"), QLatin1String("/")); - QString fName = fileName; - if (fName.startsWith(path)) - fName.replace(0, path.length(), QLatin1String("$DOCPATH$")); - return fName; -} - -QString Profile::loadableFilePath(const QString &fileName) -{ - QString path = QLibraryInfo::location(QLibraryInfo::DocumentationPath).replace(QLatin1String("\\"), QLatin1String("/")); - QString fName = fileName; - if (fName.startsWith(QLatin1String("$DOCPATH$"))) - fName.replace(0, 9, path); - return fName; -} - -QT_END_NAMESPACE diff --git a/tools/assistant/compat/profile.h b/tools/assistant/compat/profile.h deleted file mode 100644 index f7245f7..0000000 --- a/tools/assistant/compat/profile.h +++ /dev/null @@ -1,95 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef PROFILE_H -#define PROFILE_H - -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class DocuParser; - -class Profile -{ -public: - enum ProfileType { DefaultProfile, UserProfile }; - Profile(); - - bool isValid() const; - - void addDCF( const QString &docfile ); - void addDCFIcon( const QString title, const QString &icon ); - void addDCFIndexPage( const QString title, const QString &indexPage ); - void addDCFImageDir( const QString title, const QString &imgDir ); - void addDCFTitle( const QString &dcf, const QString &title ); - void addProperty( const QString &name, const QString &value ); - bool hasDocFile( const QString &docFile ); - void removeDocFileEntry( const QString &title ); - - ProfileType profileType() const { return type; } - void setProfileType( ProfileType t ) { type = t; } - - DocuParser *docuParser() const { return dparser; } - void setDocuParser( DocuParser *dp ) { dparser = dp; } - - static Profile* createDefaultProfile(const QString &docPath = QString()); - static QString makeRelativePath(const QString &base, const QString &path); - static QString storableFilePath(const QString &fileName); - static QString loadableFilePath(const QString &fileName); - - uint valid:1; - ProfileType type; - DocuParser *dparser; - QMap props; - QMap icons; - QMap indexPages; - QMap imageDirs; - QMap dcfTitles; - QStringList docs; -}; - -QT_END_NAMESPACE - -#endif // PROFILE_H diff --git a/tools/assistant/compat/tabbedbrowser.cpp b/tools/assistant/compat/tabbedbrowser.cpp deleted file mode 100644 index 9edb031..0000000 --- a/tools/assistant/compat/tabbedbrowser.cpp +++ /dev/null @@ -1,530 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "tabbedbrowser.h" -#include "mainwindow.h" -#include "helpwindow.h" -#include "config.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -#ifdef Q_WS_MAC -const QLatin1String ImageLocation(":trolltech/assistant/images/mac/"); -#else -const QLatin1String ImageLocation(":trolltech/assistant/images/win/"); -#endif - -TabbedBrowser::TabbedBrowser(MainWindow *parent) - : QWidget(parent) -{ - ui.setupUi(this); - init(); - - QStackedWidget *stack = qFindChild(ui.tab); - Q_ASSERT(stack); - stack->setContentsMargins(0, 0, 0, 0); - connect(stack, SIGNAL(currentChanged(int)), parent, SLOT(browserTabChanged())); - - QPalette p = palette(); - p.setColor(QPalette::Inactive, QPalette::Highlight, - p.color(QPalette::Active, QPalette::Highlight)); - p.setColor(QPalette::Inactive, QPalette::HighlightedText, - p.color(QPalette::Active, QPalette::HighlightedText)); - setPalette(p); -} - -TabbedBrowser::~TabbedBrowser() -{ -} - -MainWindow *TabbedBrowser::mainWindow() const -{ - return static_cast(parentWidget()); -} - -void TabbedBrowser::forward() -{ - currentBrowser()->forward(); - emit browserUrlChanged(currentBrowser()->source().toString()); -} - -void TabbedBrowser::backward() -{ - currentBrowser()->backward(); - emit browserUrlChanged(currentBrowser()->source().toString()); -} - -void TabbedBrowser::setSource( const QString &ref ) -{ - HelpWindow * win = currentBrowser(); - win->setSource(ref); -} - -void TabbedBrowser::reload() -{ - currentBrowser()->reload(); -} - -void TabbedBrowser::home() -{ - currentBrowser()->home(); -} - -HelpWindow *TabbedBrowser::currentBrowser() const -{ - return static_cast(ui.tab->currentWidget()); -} - -void TabbedBrowser::nextTab() -{ - if(ui.tab->currentIndex()<=ui.tab->count()-1) - ui.tab->setCurrentIndex(ui.tab->currentIndex()+1); -} - -void TabbedBrowser::previousTab() -{ - int idx = ui.tab->currentIndex()-1; - if(idx>=0) - ui.tab->setCurrentIndex(idx); -} - -HelpWindow *TabbedBrowser::createHelpWindow() -{ - MainWindow *mainWin = mainWindow(); - HelpWindow *win = new HelpWindow(mainWin, 0); - win->setFrameStyle(QFrame::NoFrame); - win->setPalette(palette()); - win->setSearchPaths(Config::configuration()->mimePaths()); - ui.tab->addTab(win, tr("...")); - connect(win, SIGNAL(highlighted(QString)), - (const QObject*) (mainWin->statusBar()), SLOT(showMessage(QString))); - connect(win, SIGNAL(backwardAvailable(bool)), - mainWin, SLOT(backwardAvailable(bool))); - connect(win, SIGNAL(forwardAvailable(bool)), - mainWin, SLOT(forwardAvailable(bool))); - connect(win, SIGNAL(sourceChanged(QUrl)), this, SLOT(sourceChanged())); - - ui.tab->cornerWidget(Qt::TopRightCorner)->setEnabled(ui.tab->count() > 1); - win->installEventFilter(this); - win->viewport()->installEventFilter(this); - ui.editFind->installEventFilter(this); - return win; -} - -HelpWindow *TabbedBrowser::newBackgroundTab() -{ - HelpWindow *win = createHelpWindow(); - emit tabCountChanged(ui.tab->count()); - return win; -} - -void TabbedBrowser::newTab(const QString &lnk) -{ - QString link(lnk); - if(link.isNull()) { - HelpWindow *w = currentBrowser(); - if(w) - link = w->source().toString(); - } - HelpWindow *win = createHelpWindow(); - ui.tab->setCurrentIndex(ui.tab->indexOf(win)); - if(!link.isNull()) { - win->setSource(link); - } - - emit tabCountChanged(ui.tab->count()); -} - -void TabbedBrowser::zoomIn() -{ - currentBrowser()->zoomIn(); - Config::configuration()->setFontPointSize(currentBrowser()->font().pointSizeF()); -} - -void TabbedBrowser::zoomOut() -{ - currentBrowser()->zoomOut(); - Config::configuration()->setFontPointSize(currentBrowser()->font().pointSizeF()); -} - -void TabbedBrowser::init() -{ - - lastCurrentTab = 0; - while(ui.tab->count()) { - QWidget *page = ui.tab->widget(0); - ui.tab->removeTab(0); - delete page; - } - - connect(ui.tab, SIGNAL(currentChanged(int)), - this, SLOT(transferFocus())); - - QTabBar *tabBar = qFindChild(ui.tab); - QStyleOptionTab opt; - if (tabBar) { - opt.init(tabBar); - opt.shape = tabBar->shape(); - tabBar->setContextMenuPolicy(Qt::CustomContextMenu); - connect(tabBar, SIGNAL(customContextMenuRequested(const QPoint&)), SLOT(openTabMenu(const QPoint&))); - } - - // workaround for sgi style - QPalette pal = palette(); - pal.setColor(QPalette::Active, QPalette::Button, pal.color(QPalette::Active, QPalette::Window)); - pal.setColor(QPalette::Disabled, QPalette::Button, pal.color(QPalette::Disabled, QPalette::Window)); - pal.setColor(QPalette::Inactive, QPalette::Button, pal.color(QPalette::Inactive, QPalette::Window)); - - QToolButton *newTabButton = new QToolButton(this); - ui.tab->setCornerWidget(newTabButton, Qt::TopLeftCorner); - newTabButton->setCursor(Qt::ArrowCursor); - newTabButton->setAutoRaise(true); - newTabButton->setIcon(QIcon(ImageLocation + QLatin1String("addtab.png"))); - QObject::connect(newTabButton, SIGNAL(clicked()), this, SLOT(newTab())); - newTabButton->setToolTip(tr("Add page")); - - QToolButton *closeTabButton = new QToolButton(this); - closeTabButton->setPalette(pal); - ui.tab->setCornerWidget(closeTabButton, Qt::TopRightCorner); - closeTabButton->setCursor(Qt::ArrowCursor); - closeTabButton->setAutoRaise(true); - closeTabButton->setIcon(QIcon(ImageLocation + QLatin1String("closetab.png"))); - QObject::connect(closeTabButton, SIGNAL(clicked()), this, SLOT(closeTab())); - closeTabButton->setToolTip(tr("Close page")); - closeTabButton->setEnabled(false); - - QObject::connect(ui.toolClose, SIGNAL(clicked()), ui.frameFind, SLOT(hide())); - QObject::connect(ui.toolPrevious, SIGNAL(clicked()), this, SLOT(findPrevious())); - QObject::connect(ui.toolNext, SIGNAL(clicked()), this, SLOT(findNext())); - QObject::connect(ui.editFind, SIGNAL(returnPressed()), this, SLOT(findNext())); - QObject::connect(ui.editFind, SIGNAL(textEdited(const QString&)), - this, SLOT(find(QString))); - ui.frameFind->setVisible(false); - ui.labelWrapped->setVisible(false); - autoHideTimer = new QTimer(this); - autoHideTimer->setInterval(5000); - autoHideTimer->setSingleShot(true); - QObject::connect(autoHideTimer, SIGNAL(timeout()), ui.frameFind, SLOT(hide())); -} - -void TabbedBrowser::updateTitle(const QString &title) -{ - ui.tab->setTabText(ui.tab->indexOf(currentBrowser()), title.trimmed()); -} - -void TabbedBrowser::newTab() -{ - newTab(QString()); -} - -void TabbedBrowser::transferFocus() -{ - if(currentBrowser()) { - currentBrowser()->setFocus(); - } - mainWindow()->setWindowTitle(Config::configuration()->title() - + QLatin1String(" - ") - + currentBrowser()->documentTitle()); -} - -void TabbedBrowser::initHelpWindow(HelpWindow * /*win*/) -{ -} - -void TabbedBrowser::setup() -{ - newTab(QString()); -} - -void TabbedBrowser::copy() -{ - currentBrowser()->copy(); -} - -void TabbedBrowser::closeTab() -{ - if(ui.tab->count()==1) - return; - HelpWindow *win = currentBrowser(); - mainWindow()->removePendingBrowser(win); - ui.tab->removeTab(ui.tab->indexOf(win)); - QTimer::singleShot(0, win, SLOT(deleteLater())); - ui.tab->cornerWidget(Qt::TopRightCorner)->setEnabled(ui.tab->count() > 1); - emit tabCountChanged(ui.tab->count()); -} - -QStringList TabbedBrowser::sources() const -{ - QStringList lst; - int cnt = ui.tab->count(); - for(int i=0; iwidget(i))->source().toString()); - } - return lst; -} - -QList TabbedBrowser::browsers() const -{ - QList list; - for (int i=0; icount(); ++i) { - Q_ASSERT(qobject_cast(ui.tab->widget(i))); - list.append(static_cast(ui.tab->widget(i))); - } - return list; -} - -void TabbedBrowser::sourceChanged() -{ - HelpWindow *win = qobject_cast(QObject::sender()); - Q_ASSERT(win); - QString docTitle(win->documentTitle()); - if (docTitle.isEmpty()) - docTitle = QLatin1String("..."); - // Make the classname in the title a bit more visible (otherwise - // we just see the "Qt 4.0 : Q..." which isn't really helpful ;-) - QString qtTitle = QLatin1String("Qt ") + QString::number( (QT_VERSION >> 16) & 0xff ) - + QLatin1String(".") + QString::number( (QT_VERSION >> 8) & 0xff ) - + QLatin1String(": "); - if (docTitle.startsWith(qtTitle)) - docTitle = docTitle.mid(qtTitle.length()); - setTitle(win, docTitle); - ui.frameFind->hide(); - ui.labelWrapped->hide(); - win->setTextCursor(win->cursorForPosition(QPoint(0, 0))); -} - -void TabbedBrowser::setTitle(HelpWindow *win, const QString &title) -{ - const QString tt = title.trimmed(); - ui.tab->setTabText(ui.tab->indexOf(win), tt); - if (win == currentBrowser()) - mainWindow()->setWindowTitle(Config::configuration()->title() + QLatin1String(" - ") + tt); -} - -void TabbedBrowser::keyPressEvent(QKeyEvent *e) -{ - int key = e->key(); - QString ttf = ui.editFind->text(); - QString text = e->text(); - - if (ui.frameFind->isVisible()) { - switch (key) { - case Qt::Key_Escape: - ui.frameFind->hide(); - ui.labelWrapped->hide(); - return; - case Qt::Key_Backspace: - ttf.chop(1); - break; - case Qt::Key_Return: - case Qt::Key_Enter: - // Return/Enter key events are not accepted by QLineEdit - return; - default: - if (text.isEmpty()) { - QWidget::keyPressEvent(e); - return; - } - ttf += text; - } - } else { - if (text.isEmpty() || text[0].isSpace() || !text[0].isPrint()) { - QWidget::keyPressEvent(e); - return; - } - if (text.startsWith(QLatin1Char('/'))) { - ui.editFind->clear(); - find(); - return; - } - ttf = text; - ui.frameFind->show(); - } - - ui.editFind->setText(ttf); - find(ttf, false, false); -} - -void TabbedBrowser::findNext() -{ - find(ui.editFind->text(), true, false); -} - -void TabbedBrowser::findPrevious() -{ - find(ui.editFind->text(), false, true); -} - -void TabbedBrowser::find() -{ - ui.frameFind->show(); - ui.editFind->setFocus(Qt::ShortcutFocusReason); - ui.editFind->selectAll(); - autoHideTimer->stop(); -} - -void TabbedBrowser::find(QString ttf, bool forward, bool backward) -{ - HelpWindow *browser = currentBrowser(); - QTextDocument *doc = browser->document(); - QString oldText = ui.editFind->text(); - QTextCursor c = browser->textCursor(); - QTextDocument::FindFlags options; - QPalette p = ui.editFind->palette(); - p.setColor(QPalette::Active, QPalette::Base, Qt::white); - - if (c.hasSelection()) - c.setPosition(forward ? c.position() : c.anchor(), QTextCursor::MoveAnchor); - - QTextCursor newCursor = c; - - if (!ttf.isEmpty()) { - if (backward) - options |= QTextDocument::FindBackward; - - if (ui.checkCase->isChecked()) - options |= QTextDocument::FindCaseSensitively; - - if (ui.checkWholeWords->isChecked()) - options |= QTextDocument::FindWholeWords; - - newCursor = doc->find(ttf, c, options); - ui.labelWrapped->hide(); - - if (newCursor.isNull()) { - QTextCursor ac(doc); - ac.movePosition(options & QTextDocument::FindBackward - ? QTextCursor::End : QTextCursor::Start); - newCursor = doc->find(ttf, ac, options); - if (newCursor.isNull()) { - p.setColor(QPalette::Active, QPalette::Base, QColor(255, 102, 102)); - newCursor = c; - } else - ui.labelWrapped->show(); - } - } - - if (!ui.frameFind->isVisible()) - ui.frameFind->show(); - browser->setTextCursor(newCursor); - ui.editFind->setPalette(p); - if (!ui.editFind->hasFocus()) - autoHideTimer->start(); -} - -bool TabbedBrowser::eventFilter(QObject *o, QEvent *e) -{ - if (o == ui.editFind) { - if (e->type() == QEvent::FocusIn && autoHideTimer->isActive()) - autoHideTimer->stop(); - } else if (e->type() == QEvent::KeyPress && ui.frameFind->isVisible()) { // assume textbrowser - QKeyEvent *ke = static_cast(e); - if (ke->key() == Qt::Key_Space) { - keyPressEvent(ke); - return true; - } - } - - return QWidget::eventFilter(o, e); -} - -void TabbedBrowser::openTabMenu(const QPoint& pos) -{ - QTabBar *tabBar = qFindChild(ui.tab); - - QMenu m(QLatin1String(""), tabBar); - QAction *new_action = m.addAction(tr("New Tab")); - QAction *close_action = m.addAction(tr("Close Tab")); - QAction *close_others_action = m.addAction(tr("Close Other Tabs")); - - if (tabBar->count() == 1) { - close_action->setEnabled(false); - close_others_action->setEnabled(false); - } - - QAction *action_picked = m.exec(tabBar->mapToGlobal(pos)); - if (!action_picked) - return; - - if (action_picked == new_action) { - newTab(); - return; - } - - QList windowList = browsers(); - for (int i = 0; i < tabBar->count(); ++i) { - if (tabBar->tabRect(i).contains(pos)) { - HelpWindow *win = static_cast(ui.tab->widget(i)); - if (action_picked == close_action) { - mainWindow()->removePendingBrowser(win); - QTimer::singleShot(0, win, SLOT(deleteLater())); - } - windowList.removeOne(win); - break; - } - } - - if (action_picked == close_others_action) { - foreach (HelpWindow* win, windowList) { - mainWindow()->removePendingBrowser(win); - QTimer::singleShot(0, win, SLOT(deleteLater())); - windowList.removeOne(win); - } - } - - ui.tab->cornerWidget(Qt::TopRightCorner)->setEnabled(windowList.count() > 1); - emit tabCountChanged(windowList.count()); -} - -QT_END_NAMESPACE diff --git a/tools/assistant/compat/tabbedbrowser.h b/tools/assistant/compat/tabbedbrowser.h deleted file mode 100644 index 5de7c25..0000000 --- a/tools/assistant/compat/tabbedbrowser.h +++ /dev/null @@ -1,122 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef TABBEDBROWSER_H -#define TABBEDBROWSER_H - -#include "ui_tabbedbrowser.h" - -QT_BEGIN_NAMESPACE - -class MainWindow; -class HelpWindow; -class QStyleSheet; -class QMimeSourceFactory; -class QTimer; - -class TabbedBrowser : public QWidget -{ - Q_OBJECT -public: - TabbedBrowser(MainWindow *parent); - virtual ~TabbedBrowser(); - - MainWindow *mainWindow() const; - HelpWindow *currentBrowser() const; - QStringList sources() const; - QList browsers() const; - - HelpWindow* newBackgroundTab(); - HelpWindow* createHelpWindow(); - - void setTitle(HelpWindow*, const QString &); - -signals: - void tabCountChanged(int count); - void browserUrlChanged(const QString &link); - -protected: - void keyPressEvent(QKeyEvent *); - bool eventFilter(QObject *o, QEvent *e); - -public slots: - void init(); - void forward(); - void backward(); - void setSource(const QString &ref); - void reload(); - void home(); - void nextTab(); - void previousTab(); - void newTab(const QString &lnk); - void zoomIn(); - void zoomOut(); - void updateTitle(const QString &title); - void newTab(); - void transferFocus(); - void initHelpWindow(HelpWindow *win); - void setup(); - void copy(); - void closeTab(); - void sourceChanged(); - - void find(); - void findNext(); - void findPrevious(); - -private slots: - void find(QString, bool forward = false, bool backward = false); - void openTabMenu(const QPoint& pos); - -private: - Ui::TabbedBrowser ui; - QWidget *lastCurrentTab; - QFont tabFont; - - QString fixedFontFam; - QColor lnkColor; - bool underlineLnk; - QTimer *autoHideTimer; -}; - -QT_END_NAMESPACE - -#endif // TABBEDBROWSER_H diff --git a/tools/assistant/compat/tabbedbrowser.ui b/tools/assistant/compat/tabbedbrowser.ui deleted file mode 100644 index 5cb780a..0000000 --- a/tools/assistant/compat/tabbedbrowser.ui +++ /dev/null @@ -1,233 +0,0 @@ - - - ********************************************************************* -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -********************************************************************* - - TabbedBrowser - - - - 0 - 0 - 710 - 664 - - - - TabbedBrowser - - - - 0 - - - 0 - - - - - - Untitled - - - - 8 - - - 6 - - - - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - 0 - - - 6 - - - - - - - - :/trolltech/assistant/images/close.png - - - true - - - - - - - - 0 - 0 - 0 - 0 - - - - - 150 - 0 - - - - - - - - Previous - - - :/trolltech/assistant/images/win/previous.png - - - Qt::ToolButtonTextBesideIcon - - - true - - - - - - - - 0 - 0 - - - - Next - - - :/trolltech/assistant/images/win/next.png - - - Qt::ToolButtonTextBesideIcon - - - true - - - Qt::NoArrow - - - - - - - Case Sensitive - - - - - - - Whole words - - - - - - - - 0 - 20 - - - - - 105 - 20 - - - - <img src=":/trolltech/assistant/images/wrap.png">&nbsp;Search wrapped - - - Qt::RichText - - - true - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - Qt::Horizontal - - - - 81 - 21 - - - - - - - - - - - - - - - diff --git a/tools/assistant/compat/topicchooser.cpp b/tools/assistant/compat/topicchooser.cpp deleted file mode 100644 index a65755b..0000000 --- a/tools/assistant/compat/topicchooser.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "topicchooser.h" - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -TopicChooser::TopicChooser(QWidget *parent, const QStringList &lnkNames, - const QStringList &lnks, const QString &title) - : QDialog(parent), links(lnks), linkNames(lnkNames) -{ - ui.setupUi(this); - - ui.label->setText(tr("Choose a topic for %1").arg(title)); - ui.listbox->addItems(linkNames); - if (ui.listbox->count() != 0) - ui.listbox->setCurrentRow(0); - ui.listbox->setFocus(); -} - -QString TopicChooser::link() const -{ - if (ui.listbox->currentRow() == -1) - return QString(); - QString s = ui.listbox->item(ui.listbox->currentRow())->text(); - if (s.isEmpty()) - return s; - int i = linkNames.indexOf(s); - return links[i]; -} - -QString TopicChooser::getLink(QWidget *parent, const QStringList &lnkNames, - const QStringList &lnks, const QString &title) -{ - TopicChooser *dlg = new TopicChooser(parent, lnkNames, lnks, title); - QString lnk; - if (dlg->exec() == QDialog::Accepted) - lnk = dlg->link(); - delete dlg; - return lnk; -} - -void TopicChooser::on_buttonDisplay_clicked() -{ - accept(); -} - -void TopicChooser::on_buttonCancel_clicked() -{ - reject(); -} - -void TopicChooser::on_listbox_itemActivated(QListWidgetItem *item) -{ - Q_UNUSED(item); - accept(); -} - -QT_END_NAMESPACE diff --git a/tools/assistant/compat/topicchooser.h b/tools/assistant/compat/topicchooser.h deleted file mode 100644 index 13dc9c0..0000000 --- a/tools/assistant/compat/topicchooser.h +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef TOPICCHOOSER_H -#define TOPICCHOOSER_H - -#include "ui_topicchooser.h" - -#include -#include - -QT_BEGIN_NAMESPACE - -class TopicChooser : public QDialog -{ - Q_OBJECT -public: - TopicChooser(QWidget *parent, const QStringList &lnkNames, - const QStringList &lnks, const QString &title); - - QString link() const; - - static QString getLink(QWidget *parent, const QStringList &lnkNames, - const QStringList &lnks, const QString &title); - -private slots: - void on_buttonDisplay_clicked(); - void on_buttonCancel_clicked(); - void on_listbox_itemActivated(QListWidgetItem *item); - -private: - Ui::TopicChooser ui; - QString theLink; - QStringList links, linkNames; -}; - -#endif // TOPICCHOOSER_H - -QT_END_NAMESPACE diff --git a/tools/assistant/compat/topicchooser.ui b/tools/assistant/compat/topicchooser.ui deleted file mode 100644 index b836fc1..0000000 --- a/tools/assistant/compat/topicchooser.ui +++ /dev/null @@ -1,162 +0,0 @@ - - ********************************************************************* -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -********************************************************************* - TopicChooser - - - - 0 - 0 - 391 - 223 - - - - Choose Topic - - - Select a topic from the list and click the <b>Display</b>-button to open the online help. - - - true - - - - 6 - - - 11 - - - 11 - - - 11 - - - 11 - - - - - &Topics - - - listbox - - - - - - - Displays a list of available help topics for the keyword. - - - - - - - 6 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 20 - 20 - - - - - - - - Open the topic selected in the list. - - - &Display - - - true - - - true - - - - - - - Close the Dialog. - - - &Close - - - true - - - - - - - - - - diff --git a/tools/assistant/compat/translations/translations.pro b/tools/assistant/compat/translations/translations.pro deleted file mode 100644 index 19fcc06..0000000 --- a/tools/assistant/compat/translations/translations.pro +++ /dev/null @@ -1,34 +0,0 @@ -# Include those manually as they do not contain any directory specification - -FORMS += ../helpdialog.ui \ - ../mainwindow.ui \ - ../tabbedbrowser.ui \ - ../topicchooser.ui - -SOURCES += ../main.cpp \ - ../helpwindow.cpp \ - ../topicchooser.cpp \ - ../docuparser.cpp \ - ../index.cpp \ - ../profile.cpp \ - ../config.cpp \ - ../helpdialog.cpp \ - ../mainwindow.cpp \ - ../tabbedbrowser.cpp \ - ../fontsettingsdialog.cpp - -SOURCES += ../../../shared/fontpanel/fontpanel.cpp - -HEADERS += ../helpwindow.h \ - ../topicchooser.h \ - ../docuparser.h \ - ../index.h \ - ../profile.h \ - ../helpdialog.h \ - ../mainwindow.h \ - ../tabbedbrowser.h \ - ../config.h \ - ../fontsettingsdialog.h - - -TRANSLATIONS=$$[QT_INSTALL_TRANSLATIONS]/assistant_de.ts $$[QT_INSTALL_TRANSLATIONS]/assistant_untranslated.ts -- cgit v0.12 From 35d05651d3eabeb981f0ffa0251410df4d991d36 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 1 Sep 2009 18:36:51 +0200 Subject: Long live Qt 4.7 Update Qt version markers to indicate Qt 4.7.0. The Qt 4.6 branch point was actually 6 commits ago... --- src/corelib/global/qglobal.h | 4 ++-- src/corelib/io/qdatastream.h | 7 ++++--- src/qbase.pri | 2 +- tools/qdoc3/test/assistant.qdocconf | 2 +- tools/qdoc3/test/designer.qdocconf | 2 +- tools/qdoc3/test/linguist.qdocconf | 2 +- tools/qdoc3/test/qmake.qdocconf | 2 +- tools/qdoc3/test/qt-build-docs.qdocconf | 6 +++--- tools/qdoc3/test/qt.qdocconf | 6 +++--- 9 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index c34fc31..da53289 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -44,11 +44,11 @@ #include -#define QT_VERSION_STR "4.6.0" +#define QT_VERSION_STR "4.7.0" /* QT_VERSION is (major << 16) + (minor << 8) + patch. */ -#define QT_VERSION 0x040600 +#define QT_VERSION 0x040700 /* can be used like #if (QT_VERSION >= QT_VERSION_CHECK(4, 4, 0)) */ diff --git a/src/corelib/io/qdatastream.h b/src/corelib/io/qdatastream.h index 0cb21f0..367e5fb 100644 --- a/src/corelib/io/qdatastream.h +++ b/src/corelib/io/qdatastream.h @@ -83,10 +83,11 @@ public: Qt_4_3 = 9, Qt_4_4 = 10, Qt_4_5 = 11, - Qt_4_6 = Qt_4_5 -#if QT_VERSION >= 0x040700 -#error Add the datastream version for this Qt version + Qt_4_6 = Qt_4_5, Qt_4_7 = Qt_4_6 +#if QT_VERSION >= 0x040800 +#error Add the datastream version for this Qt version + Qt_4_8 = Qt_4_7 #endif }; diff --git a/src/qbase.pri b/src/qbase.pri index 27e4992..2edb376 100644 --- a/src/qbase.pri +++ b/src/qbase.pri @@ -4,7 +4,7 @@ INCLUDEPATH *= $$QMAKE_INCDIR_QT/$$TARGET #just for today to have some compat isEmpty(QT_ARCH):!isEmpty(ARCH):QT_ARCH=$$ARCH #another compat that will rot for change #215700 TEMPLATE = lib isEmpty(QT_MAJOR_VERSION) { - VERSION=4.6.0 + VERSION=4.7.0 } else { VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION} } diff --git a/tools/qdoc3/test/assistant.qdocconf b/tools/qdoc3/test/assistant.qdocconf index 9ee8965..79b6f0e 100644 --- a/tools/qdoc3/test/assistant.qdocconf +++ b/tools/qdoc3/test/assistant.qdocconf @@ -17,7 +17,7 @@ qhp.Assistant.namespace = com.trolltech.assistant.460 qhp.Assistant.virtualFolder = qdoc qhp.Assistant.indexTitle = Qt Assistant Manual qhp.Assistant.extraFiles = classic.css images/qt-logo.png images/trolltech-logo.png -qhp.Assistant.filterAttributes = qt 4.6.0 tools assistant +qhp.Assistant.filterAttributes = qt 4.7.0 tools assistant qhp.Assistant.customFilters.Assistant.name = Qt Assistant Manual qhp.Assistant.customFilters.Assistant.filterAttributes = qt tools assistant qhp.Assistant.subprojects = manual examples diff --git a/tools/qdoc3/test/designer.qdocconf b/tools/qdoc3/test/designer.qdocconf index 2a65184..a5c63ed 100644 --- a/tools/qdoc3/test/designer.qdocconf +++ b/tools/qdoc3/test/designer.qdocconf @@ -17,7 +17,7 @@ qhp.Designer.namespace = com.trolltech.designer.460 qhp.Designer.virtualFolder = qdoc qhp.Designer.indexTitle = Qt Designer Manual qhp.Designer.extraFiles = classic.css images/qt-logo.png images/trolltech-logo.png -qhp.Designer.filterAttributes = qt 4.6.0 tools designer +qhp.Designer.filterAttributes = qt 4.7.0 tools designer qhp.Designer.customFilters.Designer.name = Qt Designer Manual qhp.Designer.customFilters.Designer.filterAttributes = qt tools designer qhp.Designer.subprojects = manual examples diff --git a/tools/qdoc3/test/linguist.qdocconf b/tools/qdoc3/test/linguist.qdocconf index 6c71993..7d02638 100644 --- a/tools/qdoc3/test/linguist.qdocconf +++ b/tools/qdoc3/test/linguist.qdocconf @@ -17,7 +17,7 @@ qhp.Linguist.namespace = com.trolltech.linguist.460 qhp.Linguist.virtualFolder = qdoc qhp.Linguist.indexTitle = Qt Linguist Manual qhp.Linguist.extraFiles = classic.css images/qt-logo.png images/trolltech-logo.png -qhp.Linguist.filterAttributes = qt 4.6.0 tools linguist +qhp.Linguist.filterAttributes = qt 4.7.0 tools linguist qhp.Linguist.customFilters.Linguist.name = Qt Linguist Manual qhp.Linguist.customFilters.Linguist.filterAttributes = qt tools linguist qhp.Linguist.subprojects = manual examples diff --git a/tools/qdoc3/test/qmake.qdocconf b/tools/qdoc3/test/qmake.qdocconf index 3dc1d3b..e2e65f2 100644 --- a/tools/qdoc3/test/qmake.qdocconf +++ b/tools/qdoc3/test/qmake.qdocconf @@ -17,7 +17,7 @@ qhp.qmake.namespace = com.trolltech.qmake.460 qhp.qmake.virtualFolder = qdoc qhp.qmake.indexTitle = QMake Manual qhp.qmake.extraFiles = classic.css images/qt-logo.png images/trolltech-logo.png -qhp.qmake.filterAttributes = qt 4.6.0 tools qmake +qhp.qmake.filterAttributes = qt 4.7.0 tools qmake qhp.qmake.customFilters.qmake.name = qmake Manual qhp.qmake.customFilters.qmake.filterAttributes = qt tools qmake qhp.qmake.subprojects = manual diff --git a/tools/qdoc3/test/qt-build-docs.qdocconf b/tools/qdoc3/test/qt-build-docs.qdocconf index d8a9057..37aa36c 100644 --- a/tools/qdoc3/test/qt-build-docs.qdocconf +++ b/tools/qdoc3/test/qt-build-docs.qdocconf @@ -34,9 +34,9 @@ qhp.Qt.extraFiles = classic.css \ images/dynamiclayouts-example.png \ images/stylesheet-coffee-plastique.png -qhp.Qt.filterAttributes = qt 4.6.0 qtrefdoc -qhp.Qt.customFilters.Qt.name = Qt 4.6.0 -qhp.Qt.customFilters.Qt.filterAttributes = qt 4.6.0 +qhp.Qt.filterAttributes = qt 4.7.0 qtrefdoc +qhp.Qt.customFilters.Qt.name = Qt 4.7.0 +qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.0 qhp.Qt.subprojects = classes overviews examples qhp.Qt.subprojects.classes.title = Classes qhp.Qt.subprojects.classes.indexTitle = Qt's Classes diff --git a/tools/qdoc3/test/qt.qdocconf b/tools/qdoc3/test/qt.qdocconf index 43e69d5..5cfb4df 100644 --- a/tools/qdoc3/test/qt.qdocconf +++ b/tools/qdoc3/test/qt.qdocconf @@ -36,9 +36,9 @@ qhp.Qt.extraFiles = classic.css \ images/dynamiclayouts-example.png \ images/stylesheet-coffee-plastique.png -qhp.Qt.filterAttributes = qt 4.6.0 qtrefdoc -qhp.Qt.customFilters.Qt.name = Qt 4.6.0 -qhp.Qt.customFilters.Qt.filterAttributes = qt 4.6.0 +qhp.Qt.filterAttributes = qt 4.7.0 qtrefdoc +qhp.Qt.customFilters.Qt.name = Qt 4.7.0 +qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.0 qhp.Qt.subprojects = classes overviews examples qhp.Qt.subprojects.classes.title = Classes qhp.Qt.subprojects.classes.indexTitle = Qt's Classes -- cgit v0.12 From 1c694286a8e7311737f9733ebcf63c3ab45eace6 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Wed, 2 Sep 2009 13:39:04 +1000 Subject: Finish bumping version number to 4.7.0 Reviewed-by: Trust Me --- doc/src/getting-started/demos.qdoc | 2 +- doc/src/index.qdoc | 2 +- doc/src/qt4-intro.qdoc | 340 +-------------------- src/plugins/qpluginbase.pri | 2 +- tests/auto/selftests/expected_cmptest.txt | 2 +- tests/auto/selftests/expected_crashes_3.txt | 2 +- tests/auto/selftests/expected_longstring.txt | 2 +- tests/auto/selftests/expected_maxwarnings.txt | 2 +- tests/auto/selftests/expected_skip.txt | 2 +- .../tools/assistant/doc/assistant.qdocconf | 2 +- tools/qdoc3/test/assistant.qdocconf | 4 +- tools/qdoc3/test/designer.qdocconf | 4 +- tools/qdoc3/test/linguist.qdocconf | 4 +- tools/qdoc3/test/qmake.qdocconf | 4 +- tools/qdoc3/test/qt-build-docs.qdocconf | 4 +- tools/qdoc3/test/qt-inc.qdocconf | 2 +- tools/qdoc3/test/qt.qdocconf | 4 +- 17 files changed, 32 insertions(+), 352 deletions(-) diff --git a/doc/src/getting-started/demos.qdoc b/doc/src/getting-started/demos.qdoc index feea281..7ac25c7 100644 --- a/doc/src/getting-started/demos.qdoc +++ b/doc/src/getting-started/demos.qdoc @@ -46,7 +46,7 @@ \previouspage Qt Examples \contentspage How to Learn Qt - \nextpage What's New in Qt 4.6 + \nextpage What's New in Qt 4.7 This is the list of demonstrations in Qt's \c demos directory. These are larger and more complicated programs than the diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc index 8b317b1..45f1639 100644 --- a/doc/src/index.qdoc +++ b/doc/src/index.qdoc @@ -76,7 +76,7 @@

diff --git a/doc/src/qt4-intro.qdoc b/doc/src/qt4-intro.qdoc index 789deab..046e293 100644 --- a/doc/src/qt4-intro.qdoc +++ b/doc/src/qt4-intro.qdoc @@ -457,16 +457,16 @@ */ /*! - \page qt4-6-intro.html - \title What's New in Qt 4.6 + \page qt4-7-intro.html + \title What's New in Qt 4.7 - Qt 4.6 provides many improvements and enhancements over the + Qt 4.7 provides many improvements and enhancements over the previous releases in the Qt 4 series. This document covers the most important features in this release, separated by category. - A comprehensive list of changes between Qt 4.5 and Qt 4.6 is - included in the \c changes-4.6.0 file - \l{http://qt.nokia.com/developer/changes/changes-4.6.0}{available + A comprehensive list of changes between Qt 4.6 and Qt 4.7 is + included in the \c changes-4.7.0 file + \l{http://qt.nokia.com/developer/changes/changes-4.7.0}{available online}. A \l{Known Issues in %VERSION%}{list of known issues} for this release is also available. @@ -481,333 +481,13 @@ \tableofcontents - \section1 Animation Framework + \section1 New Feature 1 - The animation framework helps build highly animated, - high-performance GUIs without the hassle of managing complex - structures, timers, and easing curves, not to mention the large - state graphs that all animated GUIs tend to be full of. + Describe New Feature 1. - The framework makes it easy to animate \l{QObject}s, including - QWidgets, by allowing Qt properties to be animated. It also allows - creating custom animations and interpolation functions. Graphics - views are not left out--one can animate \l{QGraphicsWidget}s, - which inherits from QObject (and thereby enables properties). - Animations are controlled using easing curves and can be grouped - together. This enables animations of arbitrary complexity. + \section1 New Feature 2 - The API is easy to grasp with functions such as start(), stop(), - pause(), and currentTime(). Here is an image from one of the - examples that come with the framework: + Describe New Feature 2. - \image whatsnewanimatedtiles.png - - The animation framework also plugs into the new Qt Statemachine by - allowing an animation to be played when transitions are triggered. - The state machine framework is introduced in 4.6 and is described - below. - - \section1 State Machine Framework - - The state machine framework provides a robust state chart - implementation based on Harel statecharts and SCXML. Qt's API lets - you construct such state graphs and execute them. The key benefits - of a state machine are: - - \list - \o Simplify complex application semantics. - \o Use of states to reduce code bloat. - \o Use states to improve maintainability. - \o Makes event-driven programming robust and more - reusable. - \endlist - - It is especially the last item here that makes using a state - machine worthwhile. A key characteristic of event-driven systems - (such as Qt applications) is that behavior often depends not only - on the last or current event, but also the events that preceded - it. With statecharts, this information is easy to express. - - The framework fits neatly into Qt by allowing transitions to - trigger on signals and \l{QEvent}s. By inserting animations into - the state machine, it is also easier to use the framework for - animating GUIs, for instance. - - \section1 Multi-touch & Gestures - - The new multi-touch and gestures support enables user interaction - with more than one finger, and combines sequential touch inputs to - a 'gesture'. - - \image gestures.png - - The main benefits of this new functionality are: - - \list - \o Allow users to interact with applications in better ways. - \o Simplify finger-based interaction with UI components. - \o Allowing common basic gestures and multi-touch - gestures. - \o Enable extensibility. - \endlist - - \section1 DOM access API - - Web pages and XML both have very complex document object models. - The W3C selector API provides a very simple way to access and - manipulate such structures. This API makes it intuitive to access - DOM, helps reuse CSS selector knowledge, and gives little - maintenance or footprint overhead. - - \code - QWebElement document = frame->documentElement(); - QList allSpans = document.findAll("span"); - QList introSpans = document.findAll("p.intro span"); - \endcode - - \section1 Qt3D enablers - - As more of Qt, and more of the applications built on Qt go 3D, - API's should be provided to simplify this. Mainly, the new API - aims to make it more easy to create 3D applications with OpenGL. - It will also unify the Qt OpenGL codebase, and enable - cross-platform 3D codebase. - - The main features of the Qt3D enablers are currently: Math - primitives for matrix multiplication, vectors, quaternions - (client-side), and API for vertex and fragment shaders, GLSL/ES. - Future research will, among other things include stencils, -scissors, vertex buffers and arrays, texture manipulation, and - geometry shaders. - - \section1 Performance Optimizations - - As always, Qt continuously strive to optimize its performance. - For this release, we have: - - \list - \o Rewritten the QGraphicsView rendering algorithm. - \o Made QPixmapCache support efficient Key datastructure. - \o Reduced overhead in QNetworkAccessManager. - \o Added the QContiguousCache class, which provides efficient caching of - contiguous data. - \o Removed Win9x support. - \endlist - - \section1 Multimedia Audio Services - - Qt 4.6 comes with new classes for handling audio. These classes - provide low-level access to the system's audio system. By - specifying the audio format (QAudioFormat) and supplying audio - data through a QIODevice, you get direct access to the - functionality of the sound device. The API also comes with - functions to query audio devices for which audio formats they - support. - -*/ - -/* - \page qt4-5-intro.html - \title What's New in Qt 4.5 - - Qt 4.5 provides many improvements and enhancements over the previous releases - in the Qt 4 series. This document covers the most important features in this - release, separated by category. - - A comprehensive list of changes between Qt 4.4 and Qt 4.5 is included - in the \c changes-4.5.0 file - \l{http://qt.nokia.com/developer/changes/changes-4.5.0}{available online}. - A \l{Known Issues in %VERSION%}{list of known issues} for this release is also - available. - - Changes between this release and the previous release are provided - in the \c{changes-%VERSION%} file (also - \l{http://qt.nokia.com/developer/changes/changes-%VERSION%}{available online}). - - A list of other Qt 4 features can be found on the - \bold{\l{What's New in Qt 4}} page. - - \bold{Highlights} - - \tableofcontents - - \section1 Qt WebKit Integration - - \image webkit-netscape-plugin.png - - The WebKit browser engine included with Qt has been upgraded to the latest - upstream (trunk) version of WebKit, bringing the latest features and - improvements to Qt applications. These include: - - \list - \o Support for full page zooming, with appropriate rescaling of images and fonts. - \o The CSS-based transformation and animation features provided by a WebKit - extension. - \o Performance improvements due to faster JavaScript engine and optimized - page loading. - \endlist - - Standards compatibility improvements include provision for the Netscape plugin - API, allowing most Netscape plugins to be used in-process, support for HTML 5 - audio and video elements using Qt's Phonon integration, and - \l{Web Application Support}{facilities for client-side storage of Web content}. - - \section1 Performance Improvements - - The introduction of the QtBenchLib performance benchmarking library enables - performance benchmarking and regression testing. Core parts of Qt itself have - undergone focused re-engineering for improved graphics performance, including - paint engine and text rendering improvements, Graphics View and style sheet - performance improvements. - - The X11 paint engine now uses XSHM (the X shared memory extension), resulting - in reduced overhead for painting operations. - - A new OpenGL ES 2.0-based paint engine complements the existing OpenGL paint - engine, but with a focus on embedded devices. - - Qt now features a pluggable graphics system, making it possible for users - and developers to select raster, OpenGL or native graphics systems to take - into account the specific needs of their applications and get the best - performance out of them. - - \section1 Mac OS X Cocoa Support - - \image mac-cocoa.png - - Qt for Mac OS X has been substantially rewritten to use Apple's Cocoa API, - enabling Qt applications to be deployed on 64-bit Macintosh hardware. - In addition, the new QMacCocoaViewContainer and QMacNativeWidget classes - provide integration with Cocoa's own features and controls. - - For many applications, a simple recompilation is all that is required - to produce an executable for 64-bit systems. Applications that use - specific features may require a few changes first. - - \section1 Windows CE Feature Parity - - Qt for Windows CE has been updated to bring features of Qt 4.4 and Qt 4.5 - to the Windows CE platform, including: - - \list - \o Phonon Multimedia Framework, using a Direct-Show based backend for audio - and video playback and a Simple WaveOut backend for devices without DirectShow. - \o The inclusion of Qt WebKit integration features previously unavailable for - Qt 4.4 on Windows CE. - \endlist - - Support on all Windows CE platforms; recommended for WinCE 6 and higher. - - The inclusion of these features enables developers to easily integrate Web and - multimedia content into Qt applications on Windows CE Standard Edition while - retaining full cross-platform compatibility with other Qt platforms. - - \section1 XML Transformations with XSLT - - The QtXmlPatterns module has been extended to cover XSLT, a transformation language - for XML documents. A common application of this is the transformation of XML data - into human-readable formats for reporting purposes. - - XSLT makes it simple to reformat XML content without changing data structures, - removes the need for an intermediate DOM layer for presentation, and enables - rapid solutions to be created; for example, creating reports as HTML or PDF. - - \section1 Qt Script Debugger - - \image qtscript-debugger-small.png - - Developers using Qt Script in their applications can take advantage of - the new \l{Qt Script Debugger Manual}{Qt Script Debugger} to provide - error reporting for scripts, and to let users track down bugs in their - own scripts. - - Many standard features of GUI debugging tools are present, allowing the - developer to step through running script code, inspect variables, - automatically catch exceptions, and set conditional breakpoints. - - \section1 OpenDocument File Format Support - - Qt 4.5 includes support for writing rich text documents as OpenDocument files via - the newly-introduced QTextDocumentWriter class. This provides an generic mechanism - for file export that can be used to introduce support for additional formats in - future releases. - - \section1 Improved Network Proxy Support - - Qt's networking classes have been updated with - \l{QtNetwork Module#Support for Network Proxies}{improved proxy support}. - This includes improved integration with system proxy settings and the added - ability to handle non-trivial proxy cases. - - \section1 Qt Designer Improvements - - \image designer-screenshot-small.png - - Qt Designer 4.5 boasts some improvements on usability, for example: - - \list - \o \bold{Icon Mode} for the widget box which substantially reduces - scrolling. - \o \bold{Morphing Widgets} which lets you morph similar widget types, - e.g., a QWidget to a QFrame, types via the context menu's - \e{Morph into} entry. - \o \bold{Filters} for the \gui{Property Editor} that lets you find - properties or widgets quickly. - \o \bold{Find option} for the \gui{Object Inspector} that performs an - incremental search on the form's widgets. Also, the objects' layout - state is displayed here with using an icon on the left. Broken - layouts are represented with the same icon used for the - \e{Break Layout} action. - \endlist - - In addition, Qt Designer now features an \gui{Embedded Design} tab that can - be found in the \gui Preferences dialog. Within this tab, you can define - embedded device profiles. These profiles contains screen settings, e.g., - display resolution, default font and default style. Qt Designer will use - these settings when you edit forms. - - More information about these improvements can be found in the - \l{What's New in Qt Designer 4.5} overview. - - \section1 Qt Linguist Improvements - - Qt Linguist can now load and edit multiple translation files simultaneously. - - Support for XML Localization Interchange File Format (XLIFF) files, previously added - to the \c lupdate tool in Qt 4.3, has been improved and extended to the rest of the - Qt Linguist toolchain. This enables files stored in Qt's TS translation format to - be exported for use with other tools. - - The GNU Gettext PO format, which is commonly used in Open Source projects, - is now supported by Qt Linguist. - - Support for a new way to annotate messages, using comments in the source code, - has been added to the toolchain. See the QObject::tr() documentation for a detailed - description and examples. - - The new \c lconvert filter tool facilitates conversion between file formats and - can be used to perform other transformations on collections of translatable strings. - - \section1 Graphics Enhancements - - In addition to the performance improvements in this release, a number of graphics - enhancements extend support for existing features to more platforms and expand Qt's - core set of features with successful add-ons. - - Widget style sheets can now be used on Mac OS X, making this approach to theming - and styling viable for truly cross-platform applications. - - Support for ARGB top-level widgets, previously available as a separate solution, - is now provided as an integral part of Qt. This makes it possible to create windows - with translucent regions on systems with the appropriate support from the user's - window system. See the \l{QWidget#Creating Translucent Windows}{Creating Translucent - Windows} section of the QWidget documentation for details of this feature. - - - \image gtk-style-screenshot.png - - Improved GTK+ integration provided by the QGtkStyle class improves the look and feel - of Qt applications in GNOME and other GTK-based environments. The screenshot above - illustrates this clearly. */ diff --git a/src/plugins/qpluginbase.pri b/src/plugins/qpluginbase.pri index 10563c1..3dd3d2e 100644 --- a/src/plugins/qpluginbase.pri +++ b/src/plugins/qpluginbase.pri @@ -1,6 +1,6 @@ TEMPLATE = lib isEmpty(QT_MAJOR_VERSION) { - VERSION=4.5.3 + VERSION=4.7.0 } else { VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION} } diff --git a/tests/auto/selftests/expected_cmptest.txt b/tests/auto/selftests/expected_cmptest.txt index f70eba5..e9f94c9 100644 --- a/tests/auto/selftests/expected_cmptest.txt +++ b/tests/auto/selftests/expected_cmptest.txt @@ -1,5 +1,5 @@ ********* Start testing of tst_Cmptest ********* -Config: Using QTest library 4.6.0, Qt 4.6.0 +Config: Using QTest library 4.7.0, Qt 4.7.0 PASS : tst_Cmptest::initTestCase() PASS : tst_Cmptest::compare_boolfuncs() PASS : tst_Cmptest::compare_pointerfuncs() diff --git a/tests/auto/selftests/expected_crashes_3.txt b/tests/auto/selftests/expected_crashes_3.txt index 55cd0b4..3aced25 100644 --- a/tests/auto/selftests/expected_crashes_3.txt +++ b/tests/auto/selftests/expected_crashes_3.txt @@ -1,5 +1,5 @@ ********* Start testing of tst_Crashes ********* -Config: Using QTest library 4.6.0, Qt 4.6.0 +Config: Using QTest library 4.7.0, Qt 4.7.0 PASS : tst_Crashes::initTestCase() QFATAL : tst_Crashes::crash() Received signal 11 FAIL! : tst_Crashes::crash() Received a fatal error. diff --git a/tests/auto/selftests/expected_longstring.txt b/tests/auto/selftests/expected_longstring.txt index 4abdb23..a6ad5d0 100644 --- a/tests/auto/selftests/expected_longstring.txt +++ b/tests/auto/selftests/expected_longstring.txt @@ -1,5 +1,5 @@ ********* Start testing of tst_LongString ********* -Config: Using QTest library 4.6.0, Qt 4.6.0 +Config: Using QTest library 4.7.0, Qt 4.7.0 PASS : tst_LongString::initTestCase() FAIL! : tst_LongString::failWithLongString() Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui. diff --git a/tests/auto/selftests/expected_maxwarnings.txt b/tests/auto/selftests/expected_maxwarnings.txt index 8dae5f7..908bd5d 100644 --- a/tests/auto/selftests/expected_maxwarnings.txt +++ b/tests/auto/selftests/expected_maxwarnings.txt @@ -1,5 +1,5 @@ ********* Start testing of MaxWarnings ********* -Config: Using QTest library 4.6.0, Qt 4.6.0 +Config: Using QTest library 4.7.0, Qt 4.7.0 PASS : MaxWarnings::initTestCase() QWARN : MaxWarnings::warn() 0 QWARN : MaxWarnings::warn() 1 diff --git a/tests/auto/selftests/expected_skip.txt b/tests/auto/selftests/expected_skip.txt index 88c0426..4345a6c 100644 --- a/tests/auto/selftests/expected_skip.txt +++ b/tests/auto/selftests/expected_skip.txt @@ -1,5 +1,5 @@ ********* Start testing of tst_Skip ********* -Config: Using QTest library 4.6.0, Qt 4.6.0 +Config: Using QTest library 4.7.0, Qt 4.7.0 PASS : tst_Skip::initTestCase() SKIP : tst_Skip::test() skipping all Loc: [/home/rmcgover/depot/qt-git/mainline/tests/auto/selftests/skip/tst_skip.cpp(68)] diff --git a/tools/assistant/tools/assistant/doc/assistant.qdocconf b/tools/assistant/tools/assistant/doc/assistant.qdocconf index 9566e90..08f8e28 100644 --- a/tools/assistant/tools/assistant/doc/assistant.qdocconf +++ b/tools/assistant/tools/assistant/doc/assistant.qdocconf @@ -12,5 +12,5 @@ HTML.footer = "


\n" \ "\n" \ "\n" \ "\n" \ - "\n" \ + "\n" \ "
Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies)Trademarks
Qt 4.5.3
Qt 4.7.0
" diff --git a/tools/qdoc3/test/assistant.qdocconf b/tools/qdoc3/test/assistant.qdocconf index 79b6f0e..74995e8 100644 --- a/tools/qdoc3/test/assistant.qdocconf +++ b/tools/qdoc3/test/assistant.qdocconf @@ -6,14 +6,14 @@ include(qt-defines.qdocconf) project = Qt Assistant description = Qt Assistant Manual -url = http://qt.nokia.com/doc/4.6 +url = http://qt.nokia.com/doc/4.7 indexes = $QT_BUILD_TREE/doc-build/html-qt/qt.index qhp.projects = Assistant qhp.Assistant.file = assistant.qhp -qhp.Assistant.namespace = com.trolltech.assistant.460 +qhp.Assistant.namespace = com.trolltech.assistant.470 qhp.Assistant.virtualFolder = qdoc qhp.Assistant.indexTitle = Qt Assistant Manual qhp.Assistant.extraFiles = classic.css images/qt-logo.png images/trolltech-logo.png diff --git a/tools/qdoc3/test/designer.qdocconf b/tools/qdoc3/test/designer.qdocconf index a5c63ed..7744a0c 100644 --- a/tools/qdoc3/test/designer.qdocconf +++ b/tools/qdoc3/test/designer.qdocconf @@ -6,14 +6,14 @@ include(qt-defines.qdocconf) project = Qt Designer description = Qt Designer Manual -url = http://qt.nokia.com/doc/4.6 +url = http://qt.nokia.com/doc/4.7 indexes = $QT_BUILD_TREE/doc-build/html-qt/qt.index qhp.projects = Designer qhp.Designer.file = designer.qhp -qhp.Designer.namespace = com.trolltech.designer.460 +qhp.Designer.namespace = com.trolltech.designer.470 qhp.Designer.virtualFolder = qdoc qhp.Designer.indexTitle = Qt Designer Manual qhp.Designer.extraFiles = classic.css images/qt-logo.png images/trolltech-logo.png diff --git a/tools/qdoc3/test/linguist.qdocconf b/tools/qdoc3/test/linguist.qdocconf index 7d02638..8e27980 100644 --- a/tools/qdoc3/test/linguist.qdocconf +++ b/tools/qdoc3/test/linguist.qdocconf @@ -6,14 +6,14 @@ include(qt-defines.qdocconf) project = Qt Linguist description = Qt Linguist Manual -url = http://qt.nokia.com/doc/4.6 +url = http://qt.nokia.com/doc/4.7 indexes = $QT_BUILD_TREE/doc-build/html-qt/qt.index qhp.projects = Linguist qhp.Linguist.file = linguist.qhp -qhp.Linguist.namespace = com.trolltech.linguist.460 +qhp.Linguist.namespace = com.trolltech.linguist.470 qhp.Linguist.virtualFolder = qdoc qhp.Linguist.indexTitle = Qt Linguist Manual qhp.Linguist.extraFiles = classic.css images/qt-logo.png images/trolltech-logo.png diff --git a/tools/qdoc3/test/qmake.qdocconf b/tools/qdoc3/test/qmake.qdocconf index e2e65f2..f6e8b2e 100644 --- a/tools/qdoc3/test/qmake.qdocconf +++ b/tools/qdoc3/test/qmake.qdocconf @@ -6,14 +6,14 @@ include(qt-defines.qdocconf) project = QMake description = QMake Manual -url = http://qt.nokia.com/doc/4.6 +url = http://qt.nokia.com/doc/4.7 indexes = $QT_BUILD_TREE/doc-build/html-qt/qt.index qhp.projects = qmake qhp.qmake.file = qmake.qhp -qhp.qmake.namespace = com.trolltech.qmake.460 +qhp.qmake.namespace = com.trolltech.qmake.470 qhp.qmake.virtualFolder = qdoc qhp.qmake.indexTitle = QMake Manual qhp.qmake.extraFiles = classic.css images/qt-logo.png images/trolltech-logo.png diff --git a/tools/qdoc3/test/qt-build-docs.qdocconf b/tools/qdoc3/test/qt-build-docs.qdocconf index 37aa36c..3b96bff 100644 --- a/tools/qdoc3/test/qt-build-docs.qdocconf +++ b/tools/qdoc3/test/qt-build-docs.qdocconf @@ -6,7 +6,7 @@ include(qt-defines.qdocconf) project = Qt description = Qt Reference Documentation -url = http://qt.nokia.com/doc/4.6 +url = http://qt.nokia.com/doc/4.7 edition.Console.modules = QtCore QtDBus QtNetwork QtScript QtSql QtXml \ QtXmlPatterns QtTest @@ -20,7 +20,7 @@ edition.DesktopLight.groups = -graphicsview-api qhp.projects = Qt qhp.Qt.file = qt.qhp -qhp.Qt.namespace = com.trolltech.qt.460 +qhp.Qt.namespace = com.trolltech.qt.470 qhp.Qt.virtualFolder = qdoc qhp.Qt.indexTitle = Qt Reference Documentation qhp.Qt.indexRoot = diff --git a/tools/qdoc3/test/qt-inc.qdocconf b/tools/qdoc3/test/qt-inc.qdocconf index 617a8ca..635e033 100644 --- a/tools/qdoc3/test/qt-inc.qdocconf +++ b/tools/qdoc3/test/qt-inc.qdocconf @@ -3,7 +3,7 @@ include(macros.qdocconf) project = Qt description = Qt Reference Documentation -url = http://qt.nokia.com/doc/4.6 +url = http://qt.nokia.com/doc/4.7 edition.Console = QtCore QtNetwork QtSql QtXml QtScript QtTest edition.Desktop = QtCore QtGui QtNetwork QtOpenGL QtSql QtSvg QtXml \ diff --git a/tools/qdoc3/test/qt.qdocconf b/tools/qdoc3/test/qt.qdocconf index 5cfb4df..90cf49a 100644 --- a/tools/qdoc3/test/qt.qdocconf +++ b/tools/qdoc3/test/qt.qdocconf @@ -8,7 +8,7 @@ project = Qt versionsym = version = %VERSION% description = Qt Reference Documentation -url = http://qt.nokia.com/doc/4.6 +url = http://qt.nokia.com/doc/4.7 edition.Console.modules = QtCore QtDBus QtNetwork QtScript QtSql QtXml \ QtXmlPatterns QtTest @@ -22,7 +22,7 @@ edition.DesktopLight.groups = -graphicsview-api qhp.projects = Qt qhp.Qt.file = qt.qhp -qhp.Qt.namespace = com.trolltech.qt.460 +qhp.Qt.namespace = com.trolltech.qt.470 qhp.Qt.virtualFolder = qdoc qhp.Qt.indexTitle = Qt Reference Documentation qhp.Qt.indexRoot = -- cgit v0.12 From 4cb700883dbb8d76165641dc4d003fcc85882dfe Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Wed, 2 Sep 2009 14:54:38 +1000 Subject: Add skeleton changes file for 4.7.0 Reviewed-by: Trust Me --- dist/changes-4.7.0 | 122 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 dist/changes-4.7.0 diff --git a/dist/changes-4.7.0 b/dist/changes-4.7.0 new file mode 100644 index 0000000..92f5244 --- /dev/null +++ b/dist/changes-4.7.0 @@ -0,0 +1,122 @@ +Qt 4.7 introduces many new features and improvements as well as bugfixes +over the 4.6.x series. For more details, refer to the online documentation +included in this distribution. The documentation is also available online: + + http://doc.trolltech.com/4.7 + +The Qt version 4.7 series is binary compatible with the 4.6.x series. +Applications compiled for 4.6 will continue to run with 4.7. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Task Tracker: + + http://www.qtsoftware.com/developer/task-tracker + +Each of these identifiers can be entered in the task tracker to obtain more +information about a particular change. + +**************************************************************************** +* General * +**************************************************************************** + +General Improvements +-------------------- + +- Documentation and Examples + +Third party components +---------------------- + + +**************************************************************************** +* Library * +**************************************************************************** + + +**************************************************************************** +* Database Drivers * +**************************************************************************** + + +**************************************************************************** +* Platform Specific Changes * +**************************************************************************** + +Qt for Linux/X11 +---------------- + + +Qt for Windows +-------------- + + +Qt for Mac OS X +--------------- + + +Qt for Embedded Linux +--------------------- + + +Qt for Windows CE +----------------- + + +**************************************************************************** +* Compiler Specific Changes * +**************************************************************************** + + +**************************************************************************** +* Tools * +**************************************************************************** + +- Build System + +- Assistant + + +- Designer + + +- Linguist + - Linguist GUI + + - lupdate + + - lrelease + + +- rcc + + +- moc + + +- uic + + +- uic3 + + +- qmake + + +- configure + + +- qtconfig + + +- qt3to4 + + +**************************************************************************** +* Plugins * +**************************************************************************** + + +**************************************************************************** +* Important Behavior Changes * +**************************************************************************** + -- cgit v0.12 From 714e0f17aa3d26ddfd9ce6ff8b9f5efbae7a11e5 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Thu, 3 Sep 2009 13:26:14 +1000 Subject: Update license header. Reviewed-by: Trust Me --- .../tst_qgraphicsanchorlayout.cpp | 28 +++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/benchmarks/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp b/tests/benchmarks/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp index e419bae..6c7edfb 100644 --- a/tests/benchmarks/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp +++ b/tests/benchmarks/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp @@ -3,14 +3,14 @@ ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtOpenGL module of the Qt Toolkit. +** This file is part of the test suite of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage ** This file contains pre-release code and may not be distributed. ** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. +** contained in the Technology Preview License Agreement accompanying +** this package. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -21,20 +21,20 @@ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this ** package. ** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** ** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://qt.nokia.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ -- cgit v0.12 From 01f48343efd58df74a14e89eb5ead6be5d532c64 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 7 Sep 2009 15:58:27 +0200 Subject: Only depend on phonon when building webkit if phonon was configured for Reviewed-by: Denis --- src/src.pro | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/src.pro b/src/src.pro index 780e56e..240e1f7 100644 --- a/src/src.pro +++ b/src/src.pro @@ -120,7 +120,8 @@ src_webkit.target = sub-webkit src_tools_activeqt.depends = src_tools_idc src_gui src_plugins.depends = src_gui src_sql src_svg contains(QT_CONFIG, webkit) { - src_webkit.depends = src_gui src_sql src_network src_xml src_phonon + src_webkit.depends = src_gui src_sql src_network src_xml + contains(QT_CONFIG, phonon):src_webkit.depends += src_phonon #exists($$QT_SOURCE_TREE/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pro): src_webkit.depends += src_javascriptcore } contains(QT_CONFIG, qt3support): src_plugins.depends += src_qt3support -- cgit v0.12 From 36ec92315aaf9f155fc12fd09d1fa7d80338a2b8 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 9 Sep 2009 10:44:06 +0200 Subject: More robust implementation of qt_x11_wait_for_window_manager Make sure we recieve both ReparentNotify and MapNotify events. Also change the timeout to 2 seconds to cope with slow machines Reviewed-by: Denis --- src/gui/kernel/qwidget_x11.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp index 43a6bad..58fb3e8d 100644 --- a/src/gui/kernel/qwidget_x11.cpp +++ b/src/gui/kernel/qwidget_x11.cpp @@ -358,12 +358,17 @@ Q_GUI_EXPORT void qt_x11_wait_for_window_manager(QWidget* w) if (!w->testAttribute(Qt::WA_WState_Created)) return; while (!XCheckTypedWindowEvent(X11->display, w->effectiveWinId(), ReparentNotify, &ev)) { - if (XCheckTypedWindowEvent(X11->display, w->effectiveWinId(), MapNotify, &ev)) - break; - if (t.elapsed() > 500) - return; // give up, no event available + if (t.elapsed() > 2000) + return; qApp->syncX(); // non-busy wait } + + while (!XCheckTypedWindowEvent(X11->display, w->effectiveWinId(), MapNotify, &ev)) { + if (t.elapsed() > 2000) + return; + qApp->syncX(); // non-busy wait + } + qApp->x11ProcessEvent(&ev); if (XCheckTypedWindowEvent(X11->display, w->effectiveWinId(), ConfigureNotify, &ev)) qApp->x11ProcessEvent(&ev); -- cgit v0.12 From 934a67b42bfa21c2a4328b02b5a9d781166914c1 Mon Sep 17 00:00:00 2001 From: Robert Griebl Date: Thu, 10 Sep 2009 16:14:59 +0200 Subject: Out of memory fix for qUncompress qUncompress shouldn't crash when running out of memory, since it might deal with buffers which are not under user control (same behavior as Qt 4.5). It will however throw a std::bad_alloc exception if Qt is compiled with exception handling. Reviewed-by: Harald Fernengel Reviewed-by: Ralf Engels Reviewed-by: Lars Knoll --- src/corelib/tools/qbytearray.cpp | 54 +++++++++++++++++++------------- src/corelib/tools/qbytearray.h | 1 + tests/auto/qbytearray/tst_qbytearray.cpp | 16 ++++++++-- 3 files changed, 48 insertions(+), 23 deletions(-) diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp index 6d55ef9..d8557e5 100644 --- a/src/corelib/tools/qbytearray.cpp +++ b/src/corelib/tools/qbytearray.cpp @@ -47,6 +47,7 @@ #include "qlocale.h" #include "qlocale_p.h" #include "qunicodetables_p.h" +#include "qscopedpointer.h" #ifndef QT_NO_DATASTREAM #include #endif @@ -535,38 +536,49 @@ QByteArray qUncompress(const uchar* data, int nbytes) ulong expectedSize = (data[0] << 24) | (data[1] << 16) | (data[2] << 8) | (data[3] ); ulong len = qMax(expectedSize, 1ul); - QByteArray baunzip; - int res; - do { - QT_TRY { - baunzip.resize(len); - res = ::uncompress((uchar*)baunzip.data(), &len, - (uchar*)data+4, nbytes-4); - } QT_CATCH (const std::bad_alloc &) { - res = Z_MEM_ERROR; + QScopedPointer d; + + forever { + ulong alloc = len; + d.reset(q_check_ptr(static_cast(qRealloc(d.data(), sizeof(QByteArray::Data) + alloc)))); + if (!d) { + // we are not allowed to crash here when compiling with QT_NO_EXCEPTIONS + qWarning("qUncompress: could not allocate enough memory to uncompress data"); + return QByteArray(); } + int res = ::uncompress((uchar*)d->array, &len, + (uchar*)data+4, nbytes-4); + switch (res) { case Z_OK: - if ((int)len != baunzip.size()) - baunzip.resize(len); - break; + if (len != alloc) { + d.reset(q_check_ptr(static_cast(qRealloc(d.data(), sizeof(QByteArray::Data) + len)))); + if (!d) { + // we are not allowed to crash here when compiling with QT_NO_EXCEPTIONS + qWarning("qUncompress: could not allocate enough memory to uncompress data"); + return QByteArray(); + } + } + d->ref = 1; + d->alloc = d->size = len; + d->data = d->array; + + return QByteArray(d.take(), 0, 0); + case Z_MEM_ERROR: qWarning("qUncompress: Z_MEM_ERROR: Not enough memory"); - break; + return QByteArray(); + case Z_BUF_ERROR: len *= 2; - break; + continue; + case Z_DATA_ERROR: qWarning("qUncompress: Z_DATA_ERROR: Input data is corrupted"); - break; + return QByteArray(); } - } while (res == Z_BUF_ERROR); - - if (res != Z_OK) - baunzip = QByteArray(); - - return baunzip; + } } #endif diff --git a/src/corelib/tools/qbytearray.h b/src/corelib/tools/qbytearray.h index 191f6a2..9621dbf 100644 --- a/src/corelib/tools/qbytearray.h +++ b/src/corelib/tools/qbytearray.h @@ -372,6 +372,7 @@ private: friend class QByteRef; friend class QString; + friend QByteArray qUncompress(const uchar *data, int nbytes); public: typedef Data * DataPtr; inline DataPtr &data_ptr() { return d; } diff --git a/tests/auto/qbytearray/tst_qbytearray.cpp b/tests/auto/qbytearray/tst_qbytearray.cpp index 44cfe4a..b0bf3df 100644 --- a/tests/auto/qbytearray/tst_qbytearray.cpp +++ b/tests/auto/qbytearray/tst_qbytearray.cpp @@ -236,6 +236,7 @@ void tst_QByteArray::qUncompress_data() void tst_QByteArray::qUncompress() { QFETCH(QByteArray, in); + QFETCH(QByteArray, out); #if defined Q_OS_HPUX && !defined __ia64 && defined Q_CC_GNU QSKIP("Corrupt data causes this tests to lock up on HP-UX / PA-RISC with gcc", SkipAll); @@ -245,9 +246,20 @@ void tst_QByteArray::qUncompress() QSKIP("Corrupt data causes this test to lock up on QNX", SkipAll); #endif - QTEST(::qUncompress(in), "out"); + QByteArray res; + QT_TRY { + res = ::qUncompress(in); + } QT_CATCH(const std::bad_alloc &) { + res = QByteArray(); + } + QCOMPARE(res, out); - QTEST(::qUncompress(in + "blah"), "out"); + QT_TRY { + res = ::qUncompress(in + "blah"); + } QT_CATCH(const std::bad_alloc &) { + res = QByteArray(); + } + QCOMPARE(res, out); } #endif -- cgit v0.12 From 5f885e684a59944549fff563c3e4dd7c50a668b4 Mon Sep 17 00:00:00 2001 From: Robert Griebl Date: Fri, 11 Sep 2009 14:35:34 +0200 Subject: Compile fix for windows Reviewed-by: TrustMe --- src/corelib/tools/qbytearray.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/tools/qbytearray.h b/src/corelib/tools/qbytearray.h index 9621dbf..14425ba 100644 --- a/src/corelib/tools/qbytearray.h +++ b/src/corelib/tools/qbytearray.h @@ -372,7 +372,7 @@ private: friend class QByteRef; friend class QString; - friend QByteArray qUncompress(const uchar *data, int nbytes); + friend Q_CORE_EXPORT QByteArray qUncompress(const uchar *data, int nbytes); public: typedef Data * DataPtr; inline DataPtr &data_ptr() { return d; } -- cgit v0.12 From 29dac8ad61fbb14885f9ebc07461227e470a3a0a Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Tue, 15 Sep 2009 08:53:22 +1000 Subject: Don't crash when no focus Hard to reproduce, but all other similar code checks in this way. Reviewed-by: Simon Hausmann --- src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp index f2fe108..41e73fc 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp @@ -1022,7 +1022,8 @@ qreal QWebFrame::zoomFactor() const */ bool QWebFrame::hasFocus() const { - return QWebFramePrivate::kit(d->frame->page()->focusController()->focusedFrame()) == this; + WebCore::Frame* ff = d->frame->page()->focusController()->focusedFrame(); + return QWebFramePrivate::kit(ff) == this; } /*! -- cgit v0.12 From 9f80bac10f1ab5155999cb554559cd3dacab2bb9 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Fri, 18 Sep 2009 09:58:47 +1000 Subject: Test console output works. --- .../WebKit/qt/tests/qwebpage/tst_qwebpage.cpp | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp index 966f049..340663d 100644 --- a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp +++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp @@ -111,6 +111,8 @@ private slots: void requestCache(); void protectBindingsRuntimeObjectsFromCollector(); + void consoleOutput(); + private: @@ -238,6 +240,31 @@ void tst_QWebPage::loadFinished() QCOMPARE(spyLoadFinished.count(), 1); } +class ConsolePage : public QWebPage +{ +public: + ConsolePage(QObject* parent = 0) : QWebPage(parent) {} + + virtual void javaScriptConsoleMessage(const QString& message, int lineNumber, const QString& sourceID) + { + messages.append(message); + lineNumbers.append(lineNumber); + sourceIDs.append(sourceID); + } + + QStringList messages; + QList lineNumbers; + QStringList sourceIDs; +}; + +void tst_QWebPage::consoleOutput() +{ + ConsolePage page; + page.mainFrame()->evaluateJavaScript("this is not valid JavaScript"); + QCOMPARE(page.messages.count(), 1); + QCOMPARE(page.lineNumbers.at(0), 1); +} + class TestPage : public QWebPage { public: -- cgit v0.12 From 8972f99ed6c9f97d059a0c9f8f642545286648e6 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 18 Sep 2009 16:43:27 +0200 Subject: Fix up these QtWebKit files after the merge from 4.6. I should've used checkout --theirs src/3rdparty/webkit after the merge, instead of permitting git's auto-merge for these files. Reviewed-by: Paul --- src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp | 12 +++++++----- .../webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp | 2 -- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp index 41e73fc..fe813b8 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp @@ -540,8 +540,12 @@ QUrl QWebFrame::url() const */ QUrl QWebFrame::requestedUrl() const { + // In the following edge cases (where the failing document + // loader does not get commited by the frame loader) it is + // safer to rely on outgoingReferrer than originalRequest. if (!d->frame->loader()->activeDocumentLoader() - || !d->frameLoaderClient->m_loadSucceeded) + || (!d->frameLoaderClient->m_loadError.isNull() + && !d->frame->loader()->outgoingReferrer().isEmpty())) return QUrl(d->frame->loader()->outgoingReferrer()); return d->frame->loader()->originalRequest().url(); @@ -799,13 +803,11 @@ void QWebFrame::setScrollBarPolicy(Qt::Orientation orientation, Qt::ScrollBarPol d->horizontalScrollBarPolicy = policy; if (d->frame->view()) { d->frame->view()->setHorizontalScrollbarMode((ScrollbarMode)policy); - d->frame->view()->updateDefaultScrollbarState(); } } else { d->verticalScrollBarPolicy = policy; if (d->frame->view()) { d->frame->view()->setVerticalScrollbarMode((ScrollbarMode)policy); - d->frame->view()->updateDefaultScrollbarState(); } } } @@ -1023,7 +1025,7 @@ qreal QWebFrame::zoomFactor() const bool QWebFrame::hasFocus() const { WebCore::Frame* ff = d->frame->page()->focusController()->focusedFrame(); - return QWebFramePrivate::kit(ff) == this; + return ff && QWebFramePrivate::kit(ff) == this; } /*! @@ -1245,7 +1247,7 @@ QVariant QWebFrame::evaluateJavaScript(const QString& scriptSource) ScriptController *proxy = d->frame->script(); QVariant rc; if (proxy) { - JSC::JSValue v = proxy->evaluate(ScriptSourceCode(scriptSource)).jsValue(); + JSC::JSValue v = d->frame->loader()->executeScript(ScriptSourceCode(scriptSource)).jsValue(); int distance = 0; rc = JSC::Bindings::convertValueToQVariant(proxy->globalObject()->globalExec(), v, QMetaType::Void, &distance); } diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp index 9023047..c575137 100644 --- a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp +++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp @@ -116,8 +116,6 @@ private slots: void consoleOutput(); - void consoleOutput(); - private: -- cgit v0.12 From 8a441f3cf8a2cbc92861b7c55dd4664da4e8130b Mon Sep 17 00:00:00 2001 From: Daniel Molkentin Date: Fri, 18 Sep 2009 18:17:29 +0200 Subject: Fix spelling and reword. --- doc/src/howtos/appicon.qdoc | 8 ++++---- mkspecs/features/symbian/application_icon.prf | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/src/howtos/appicon.qdoc b/doc/src/howtos/appicon.qdoc index ba567b7..0d44324 100644 --- a/doc/src/howtos/appicon.qdoc +++ b/doc/src/howtos/appicon.qdoc @@ -215,12 +215,12 @@ \section1 Setting the Application Icon on S60 platforms - In order to set application icon for S60 application you need SVG-T icon. - How to create such SVG-T, please refer to + In order to set the application icon for S60 application you need + anSVG-T icon. For information on how to create such SVG-T, please refer to \l{http://wiki.forum.nokia.com/index.php/How_to_create_application_icon(SVG)_in_S60_3rd_edition/} - Once you have icon in correct format and assuming you are using - \c qmake to generate your makefiles, you only need to add a single + Once the icon is available in the correct format and assuming you are + using \c qmake to generate your makefiles, you only need to add a single line to your \c .pro project file. For example, if the name of your icon file is \c{myapp.svg}, and your project file is \c{myapp.pro}, add this line to \c{myapp.pro}: diff --git a/mkspecs/features/symbian/application_icon.prf b/mkspecs/features/symbian/application_icon.prf index 97b99a5..fcf5324 100644 --- a/mkspecs/features/symbian/application_icon.prf +++ b/mkspecs/features/symbian/application_icon.prf @@ -6,7 +6,7 @@ contains( CONFIG, no_icon ) { symbian:RSS_RULES ="hidden = KAppIsHidden;" CONFIG -= no_icon } else { -# There is no sense to compile MIF icon is no_icon CONFIGS is set +# There is no sense to compile MIF icon if no_icon CONFIGS is set !isEmpty(ICON) { !count(ICON, $$size(TRANSLATIONS)):!count(ICON, 1) { @@ -36,4 +36,4 @@ contains( CONFIG, no_icon ) { RSS_RULES.number_of_icons = $$size(ICON) RSS_RULES.icon_file = $$replace( APP_RESOURCE_DIR, /, \\\\ )\\\\$${TARGET.UID3}.mif } -} \ No newline at end of file +} -- cgit v0.12 From 56b3d8462f31d6afcf315e4dadb21929da5ea1f2 Mon Sep 17 00:00:00 2001 From: Daniel Molkentin Date: Tue, 22 Sep 2009 17:54:20 +0200 Subject: Revert "Fix spelling and reword." This is fixed better in 4.6. Don't make merging harder than it has to be. This reverts commit 8a441f3cf8a2cbc92861b7c55dd4664da4e8130b. --- doc/src/howtos/appicon.qdoc | 8 ++++---- mkspecs/features/symbian/application_icon.prf | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/src/howtos/appicon.qdoc b/doc/src/howtos/appicon.qdoc index 0d44324..ba567b7 100644 --- a/doc/src/howtos/appicon.qdoc +++ b/doc/src/howtos/appicon.qdoc @@ -215,12 +215,12 @@ \section1 Setting the Application Icon on S60 platforms - In order to set the application icon for S60 application you need - anSVG-T icon. For information on how to create such SVG-T, please refer to + In order to set application icon for S60 application you need SVG-T icon. + How to create such SVG-T, please refer to \l{http://wiki.forum.nokia.com/index.php/How_to_create_application_icon(SVG)_in_S60_3rd_edition/} - Once the icon is available in the correct format and assuming you are - using \c qmake to generate your makefiles, you only need to add a single + Once you have icon in correct format and assuming you are using + \c qmake to generate your makefiles, you only need to add a single line to your \c .pro project file. For example, if the name of your icon file is \c{myapp.svg}, and your project file is \c{myapp.pro}, add this line to \c{myapp.pro}: diff --git a/mkspecs/features/symbian/application_icon.prf b/mkspecs/features/symbian/application_icon.prf index fcf5324..97b99a5 100644 --- a/mkspecs/features/symbian/application_icon.prf +++ b/mkspecs/features/symbian/application_icon.prf @@ -6,7 +6,7 @@ contains( CONFIG, no_icon ) { symbian:RSS_RULES ="hidden = KAppIsHidden;" CONFIG -= no_icon } else { -# There is no sense to compile MIF icon if no_icon CONFIGS is set +# There is no sense to compile MIF icon is no_icon CONFIGS is set !isEmpty(ICON) { !count(ICON, $$size(TRANSLATIONS)):!count(ICON, 1) { @@ -36,4 +36,4 @@ contains( CONFIG, no_icon ) { RSS_RULES.number_of_icons = $$size(ICON) RSS_RULES.icon_file = $$replace( APP_RESOURCE_DIR, /, \\\\ )\\\\$${TARGET.UID3}.mif } -} +} \ No newline at end of file -- cgit v0.12 From 36304a764fb4ee0cc7cc26033c05c8d70c87b4b5 Mon Sep 17 00:00:00 2001 From: Iain Date: Thu, 24 Sep 2009 17:10:30 +0200 Subject: Update patch_capabilities.pl help to be a little bit clearer I certainly didn't read it well enough to notice I needed the third parameter with template pkg files. Reviewed-by: Jason Barron --- bin/patch_capabilities.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/patch_capabilities.pl b/bin/patch_capabilities.pl index 2fcf703..bfd34f0 100644 --- a/bin/patch_capabilities.pl +++ b/bin/patch_capabilities.pl @@ -51,8 +51,8 @@ sub Usage() { print("specified for deployment in a .pkg file.\n"); print("If no capabilities are given, the binaries will be given the\n"); print("capabilities supported by self-signed certificates.\n"); - print("\nUsage: patch_capabilities.pl pkg_filename [target-platform] [capability list]\n"); - print(" If template .pkg file is given, next agrument must be 'target-platform'.\n"); + print("\n *** NOTE: If *_template.pkg file is given, 'target-platform' is REQUIRED. ***\n"); + print("\nUsage: patch_capabilities.pl pkg_filename [capability list]\n"); print("\nE.g. patch_capabilities.pl myapp_template.pkg release-armv5 \"All -TCB\"\n"); exit(); } -- cgit v0.12 From 67b794d91589f4ec68c6b55ea52d4f7e905d942c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Arve=20S=C3=A6ther?= Date: Fri, 2 Oct 2009 21:35:14 +0200 Subject: Remove trailing whitespace --- tests/auto/qeasingcurve/tst_qeasingcurve.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/auto/qeasingcurve/tst_qeasingcurve.cpp b/tests/auto/qeasingcurve/tst_qeasingcurve.cpp index 8cf686e..1acd495 100644 --- a/tests/auto/qeasingcurve/tst_qeasingcurve.cpp +++ b/tests/auto/qeasingcurve/tst_qeasingcurve.cpp @@ -417,18 +417,18 @@ void tst_QEasingCurve::valueForProgress() // the least significant digit it is still subject to rounding errors qreal error = easeConv - ex; - qreal errorbound = 0.00001; + qreal errorbound = 0.00001; #if defined( Q_OS_WINCE ) || defined( Q_OS_SYMBIAN ) // exception values for WINCE(this test should be rewritten, as it only freezes the status quo of QEasingCurve // The failing (2) values are explicitly excepted here: // The source values for the comparison table should remain untruncated double and the // error bound checking function dynamic. Also the source values should come from a "trusted" source and not - // from QEasingCurve itself. + // from QEasingCurve itself. if ((type == int(QEasingCurve::InOutBounce) && (i == 8 || i == 6) ) || (type == int(QEasingCurve::OutExpo) && i == 2)) - errorbound = 0.0002; -#endif + errorbound = 0.0002; +#endif // accept the potential rounding error in the least significant digit - QVERIFY(error <= errorbound ); + QVERIFY(error <= errorbound ); } #endif } -- cgit v0.12 From ab35c0b07a214744519a78854e4c6290c1d18662 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Arve=20S=C3=A6ther?= Date: Fri, 2 Oct 2009 22:36:12 +0200 Subject: Fix the valueForProgress to pass. The reference data had some errors due to bugs in QString::setNum(). We now serialize the number ourselves, and at the same time always generate all 4 digits, just to emphasize the precision we want. It now also passes if sizeof(qreal) == sizeof(float). --- tests/auto/qeasingcurve/tst_qeasingcurve.cpp | 139 ++++++++++++++------------- 1 file changed, 74 insertions(+), 65 deletions(-) diff --git a/tests/auto/qeasingcurve/tst_qeasingcurve.cpp b/tests/auto/qeasingcurve/tst_qeasingcurve.cpp index 1acd495..6acc241 100644 --- a/tests/auto/qeasingcurve/tst_qeasingcurve.cpp +++ b/tests/auto/qeasingcurve/tst_qeasingcurve.cpp @@ -193,186 +193,208 @@ void tst_QEasingCurve::valueForProgress_data() // integer values and avoid fp inaccuracies QTest::newRow("Linear") << int(QEasingCurve::Linear) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.1 << 0.2 << 0.3 << 0.4 << 0.5 << 0.6 << 0.7 << 0.8 << 0.9 << 1); + << (RealList() << 0.0000 << 0.1000 << 0.2000 << 0.3000 << 0.4000 << 0.5000 << 0.6000 << 0.7000 << 0.8000 << 0.9000 << 1.0000); QTest::newRow("InQuad") << int(QEasingCurve::InQuad) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.01 << 0.04 << 0.09 << 0.16 << 0.25 << 0.36 << 0.49 << 0.64 << 0.81 << 1); + << (RealList() << 0.0000 << 0.0100 << 0.0400 << 0.0900 << 0.1600 << 0.2500 << 0.3600 << 0.4900 << 0.6400 << 0.8100 << 1.0000); QTest::newRow("OutQuad") << int(QEasingCurve::OutQuad) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.19 << 0.36 << 0.51 << 0.64 << 0.75 << 0.84 << 0.91 << 0.96 << 0.99 << 1); + << (RealList() << 0.0000 << 0.1900 << 0.3600 << 0.5100 << 0.6400 << 0.7500 << 0.8400 << 0.9100 << 0.9600 << 0.9900 << 1.0000); QTest::newRow("InOutQuad") << int(QEasingCurve::InOutQuad) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.02 << 0.08 << 0.18 << 0.32 << 0.5 << 0.68 << 0.82 << 0.92 << 0.98 << 1); + << (RealList() << 0.0000 << 0.0200 << 0.0800 << 0.1800 << 0.3200 << 0.5000 << 0.6800 << 0.8200 << 0.9200 << 0.9800 << 1.0000); QTest::newRow("OutInQuad") << int(QEasingCurve::OutInQuad) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.18 << 0.32 << 0.42 << 0.48 << 0.5 << 0.52 << 0.58 << 0.68 << 0.82 << 1); + << (RealList() << 0.0000 << 0.1800 << 0.3200 << 0.4200 << 0.4800 << 0.5000 << 0.5200 << 0.5800 << 0.6800 << 0.8200 << 1.0000); QTest::newRow("InCubic") << int(QEasingCurve::InCubic) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.001 << 0.008 << 0.027 << 0.064 << 0.125 << 0.216 << 0.343 << 0.512 << 0.729 << 1); + << (RealList() << 0.0000 << 0.0010 << 0.0080 << 0.0270 << 0.0640 << 0.1250 << 0.2160 << 0.3430 << 0.5120 << 0.7290 << 1.0000); QTest::newRow("OutCubic") << int(QEasingCurve::OutCubic) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.271 << 0.488 << 0.657 << 0.784 << 0.875 << 0.936 << 0.973 << 0.992 << 0.999 << 1); + << (RealList() << 0.0000 << 0.2710 << 0.4880 << 0.6570 << 0.7840 << 0.8750 << 0.9360 << 0.9730 << 0.9920 << 0.9990 << 1.0000); QTest::newRow("InOutCubic") << int(QEasingCurve::InOutCubic) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.004 << 0.032 << 0.108 << 0.256 << 0.5 << 0.744 << 0.892 << 0.968 << 0.996 << 1); + << (RealList() << 0.0000 << 0.0040 << 0.0320 << 0.1080 << 0.2560 << 0.5000 << 0.7440 << 0.8920 << 0.9680 << 0.9960 << 1.0000); QTest::newRow("OutInCubic") << int(QEasingCurve::OutInCubic) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.244 << 0.392 << 0.468 << 0.496 << 0.5 << 0.504 << 0.532 << 0.608 << 0.756 << 1); + << (RealList() << 0.0000 << 0.2440 << 0.3920 << 0.4680 << 0.4960 << 0.5000 << 0.5040 << 0.5320 << 0.6080 << 0.7560 << 1.0000); QTest::newRow("InQuart") << int(QEasingCurve::InQuart) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.0001 << 0.0016 << 0.0081 << 0.0256 << 0.0625 << 0.1296 << 0.2401 << 0.4096 << 0.6561 << 1); + << (RealList() << 0.0000 << 0.0001 << 0.0016 << 0.0081 << 0.0256 << 0.0625 << 0.1296 << 0.2401 << 0.4096 << 0.6561 << 1.0000); QTest::newRow("OutQuart") << int(QEasingCurve::OutQuart) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.3439 << 0.5904 << 0.7599 << 0.8704 << 0.9375 << 0.9744 << 0.9919 << 0.9984 << 0.9999 << 1); + << (RealList() << 0.0000 << 0.3439 << 0.5904 << 0.7599 << 0.8704 << 0.9375 << 0.9744 << 0.9919 << 0.9984 << 0.9999 << 1.0000); QTest::newRow("InOutQuart") << int(QEasingCurve::InOutQuart) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.0008 << 0.0128 << 0.0648 << 0.2048 << 0.5 << 0.7952 << 0.9352 << 0.9872 << 0.9992 << 1); + << (RealList() << 0.0000 << 0.0008 << 0.0128 << 0.0648 << 0.2048 << 0.5000 << 0.7952 << 0.9352 << 0.9872 << 0.9992 << 1.0000); QTest::newRow("OutInQuart") << int(QEasingCurve::OutInQuart) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.2952 << 0.4352 << 0.4872 << 0.4992 << 0.5 << 0.5008 << 0.5128 << 0.5648 << 0.7048 << 1); + << (RealList() << 0.0000 << 0.2952 << 0.4352 << 0.4872 << 0.4992 << 0.5000 << 0.5008 << 0.5128 << 0.5648 << 0.7048 << 1.0000); QTest::newRow("InQuint") << int(QEasingCurve::InQuint) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 1e-05 << 0.00032 << 0.00243 << 0.01024 << 0.03125 << 0.07776 << 0.1681 << 0.3277 << 0.5905 << 1); + << (RealList() << 0.0000 << 0.0000 << 0.0003 << 0.0024 << 0.0102 << 0.0313 << 0.0778 << 0.1681 << 0.3277 << 0.5905 << 1.0000); QTest::newRow("OutQuint") << int(QEasingCurve::OutQuint) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.4095 << 0.6723 << 0.8319 << 0.9222 << 0.9688 << 0.9898 << 0.9976 << 0.9997 << 1 << 1); + << (RealList() << 0.0000 << 0.4095 << 0.6723 << 0.8319 << 0.9222 << 0.9688 << 0.9898 << 0.9976 << 0.9997 << 1.0000 << 1.0000); QTest::newRow("InOutQuint") << int(QEasingCurve::InOutQuint) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.00016 << 0.00512 << 0.03888 << 0.1638 << 0.5 << 0.8362 << 0.9611 << 0.9949 << 0.9998 << 1); + << (RealList() << 0.0000 << 0.0002 << 0.0051 << 0.0389 << 0.1638 << 0.5000 << 0.8362 << 0.9611 << 0.9949 << 0.9998 << 1.0000); QTest::newRow("OutInQuint") << int(QEasingCurve::OutInQuint) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.3362 << 0.4611 << 0.4949 << 0.4998 << 0.5 << 0.5002 << 0.5051 << 0.5389 << 0.6638 << 1); + << (RealList() << 0.0000 << 0.3362 << 0.4611 << 0.4949 << 0.4998 << 0.5000 << 0.5002 << 0.5051 << 0.5389 << 0.6638 << 1.0000); QTest::newRow("InSine") << int(QEasingCurve::InSine) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.01231 << 0.04894 << 0.109 << 0.191 << 0.2929 << 0.4122 << 0.546 << 0.691 << 0.8436 << 1); + << (RealList() << 0.0000 << 0.0123 << 0.0489 << 0.1090 << 0.1910 << 0.2929 << 0.4122 << 0.5460 << 0.6910 << 0.8436 << 1.0000); QTest::newRow("OutSine") << int(QEasingCurve::OutSine) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.1564 << 0.309 << 0.454 << 0.5878 << 0.7071 << 0.809 << 0.891 << 0.9511 << 0.9877 << 1); + << (RealList() << 0.0000 << 0.1564 << 0.3090 << 0.4540 << 0.5878 << 0.7071 << 0.8090 << 0.8910 << 0.9511 << 0.9877 << 1.0000); QTest::newRow("InOutSine") << int(QEasingCurve::InOutSine) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.02447 << 0.09549 << 0.2061 << 0.3455 << 0.5 << 0.6545 << 0.7939 << 0.9045 << 0.9755 << 1); + << (RealList() << 0.0000 << 0.0245 << 0.0955 << 0.2061 << 0.3455 << 0.5000 << 0.6545 << 0.7939 << 0.9045 << 0.9755 << 1.0000); QTest::newRow("OutInSine") << int(QEasingCurve::OutInSine) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.1545 << 0.2939 << 0.4045 << 0.4755 << 0.5 << 0.5245 << 0.5955 << 0.7061 << 0.8455 << 1); + << (RealList() << 0.0000 << 0.1545 << 0.2939 << 0.4045 << 0.4755 << 0.5000 << 0.5245 << 0.5955 << 0.7061 << 0.8455 << 1.0000); QTest::newRow("InExpo") << int(QEasingCurve::InExpo) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.0009531 << 0.002906 << 0.006812 << 0.01462 << 0.03025 << 0.0615 << 0.124 << 0.249 << 0.499 << 1); + << (RealList() << 0.0000 << 0.0010 << 0.0029 << 0.0068 << 0.0146 << 0.0303 << 0.0615 << 0.1240 << 0.2490 << 0.4990 << 1.0000); QTest::newRow("OutExpo") << int(QEasingCurve::OutExpo) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.5005 << 0.7507 << 0.8759 << 0.9384 << 0.9697 << 0.9854 << 0.9932 << 0.9971 << 0.999 << 1); + << (RealList() << 0.0000 << 0.5005 << 0.7507 << 0.8759 << 0.9384 << 0.9697 << 0.9854 << 0.9932 << 0.9971 << 0.9990 << 1.0000); QTest::newRow("InOutExpo") << int(QEasingCurve::InOutExpo) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.001453 << 0.007312 << 0.03075 << 0.1245 << 0.5002 << 0.8754 << 0.9692 << 0.9927 << 0.9985 << 1); + << (RealList() << 0.0000 << 0.0015 << 0.0073 << 0.0308 << 0.1245 << 0.5003 << 0.8754 << 0.9692 << 0.9927 << 0.9985 << 1.0000); QTest::newRow("OutInExpo") << int(QEasingCurve::OutInExpo) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.3754 << 0.4692 << 0.4927 << 0.4985 << 0.5 << 0.5015 << 0.5073 << 0.5308 << 0.6245 << 1); + << (RealList() << 0.0000 << 0.3754 << 0.4692 << 0.4927 << 0.4985 << 0.5000 << 0.5015 << 0.5073 << 0.5308 << 0.6245 << 1.0000); QTest::newRow("InCirc") << int(QEasingCurve::InCirc) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.005013 << 0.0202 << 0.04606 << 0.08348 << 0.134 << 0.2 << 0.2859 << 0.4 << 0.5641 << 1); + << (RealList() << 0.0000 << 0.0050 << 0.0202 << 0.0461 << 0.0835 << 0.1340 << 0.2000 << 0.2859 << 0.4000 << 0.5641 << 1.0000); QTest::newRow("OutCirc") << int(QEasingCurve::OutCirc) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.4359 << 0.6 << 0.7141 << 0.8 << 0.866 << 0.9165 << 0.9539 << 0.9798 << 0.995 << 1); + << (RealList() << 0.0000 << 0.4359 << 0.6000 << 0.7141 << 0.8000 << 0.8660 << 0.9165 << 0.9539 << 0.9798 << 0.9950 << 1.0000); QTest::newRow("InOutCirc") << int(QEasingCurve::InOutCirc) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.0101 << 0.04174 << 0.1 << 0.2 << 0.5 << 0.8 << 0.9 << 0.9583 << 0.9899 << 1); + << (RealList() << 0.0000 << 0.0101 << 0.0417 << 0.1000 << 0.2000 << 0.5000 << 0.8000 << 0.9000 << 0.9583 << 0.9899 << 1.0000); QTest::newRow("OutInCirc") << int(QEasingCurve::OutInCirc) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.3 << 0.4 << 0.4583 << 0.4899 << 0.5 << 0.5101 << 0.5417 << 0.6 << 0.7 << 1); + << (RealList() << 0.0000 << 0.3000 << 0.4000 << 0.4583 << 0.4899 << 0.5000 << 0.5101 << 0.5417 << 0.6000 << 0.7000 << 1.0000); QTest::newRow("InElastic") << int(QEasingCurve::InElastic) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.001953 << -0.001953 << -0.003906 << 0.01562 << -0.01562 << -0.03125 << 0.125 << -0.125 << -0.25 << 1); + << (RealList() << 0.0000 << 0.0020 << -0.0020 << -0.0039 << 0.0156 << -0.0156 << -0.0313 << 0.1250 << -0.1250 << -0.2500 << 1.0000); QTest::newRow("OutElastic") << int(QEasingCurve::OutElastic) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 1.25 << 1.125 << 0.875 << 1.031 << 1.016 << 0.9844 << 1.004 << 1.002 << 0.998 << 1); + << (RealList() << 0.0000 << 1.2500 << 1.1250 << 0.8750 << 1.0313 << 1.0156 << 0.9844 << 1.0039 << 1.0020 << 0.9980 << 1.0000); QTest::newRow("InOutElastic") << int(QEasingCurve::InOutElastic) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << -0.0009766 << 0.007812 << -0.01563 << -0.0625 << 0.5 << 1.062 << 1.016 << 0.9922 << 1.001 << 1); + << (RealList() << 0.0000 << -0.0010 << 0.0078 << -0.0156 << -0.0625 << 0.5000 << 1.0625 << 1.0156 << 0.9922 << 1.0010 << 1.0000); QTest::newRow("OutInElastic") << int(QEasingCurve::OutInElastic) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.375 << 0.5625 << 0.4922 << 0.498 << 0.5 << 0.4961 << 0.5078 << 0.5313 << 0.25 << 1); + << (RealList() << 0.0000 << 0.3750 << 0.5625 << 0.4922 << 0.4980 << 0.5000 << 0.4961 << 0.5078 << 0.5313 << 0.2500 << 1.0000); QTest::newRow("InBack") << int(QEasingCurve::InBack) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << -0.01431 << -0.04645 << -0.0802 << -0.09935 << -0.0877 << -0.02903 << 0.09287 << 0.2942 << 0.5912 << 1); + << (RealList() << 0.0000 << -0.0143 << -0.0465 << -0.0802 << -0.0994 << -0.0877 << -0.0290 << 0.0929 << 0.2942 << 0.5912 << 1.0000); QTest::newRow("OutBack") << int(QEasingCurve::OutBack) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.4088 << 0.7058 << 0.9071 << 1.029 << 1.088 << 1.099 << 1.08 << 1.046 << 1.014 << 1); + << (RealList() << 0.0000 << 0.4088 << 0.7058 << 0.9071 << 1.0290 << 1.0877 << 1.0994 << 1.0802 << 1.0465 << 1.0143 << 1.0000); QTest::newRow("InOutBack") << int(QEasingCurve::InOutBack) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << -0.03752 << -0.09256 << -0.07883 << 0.08993 << 0.5 << 0.9101 << 1.079 << 1.093 << 1.038 << 1); + << (RealList() << 0.0000 << -0.0375 << -0.0926 << -0.0788 << 0.0899 << 0.5000 << 0.9101 << 1.0788 << 1.0926 << 1.0375 << 1.0000); QTest::newRow("OutInBack") << int(QEasingCurve::OutInBack) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.3529 << 0.5145 << 0.5497 << 0.5232 << 0.5 << 0.4768 << 0.4503 << 0.4855 << 0.6471 << 1); + << (RealList() << 0.0000 << 0.3529 << 0.5145 << 0.5497 << 0.5232 << 0.5000 << 0.4768 << 0.4503 << 0.4855 << 0.6471 << 1.0000); QTest::newRow("InBounce") << int(QEasingCurve::InBounce) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.01188 << 0.06 << 0.06937 << 0.2275 << 0.2344 << 0.09 << 0.3194 << 0.6975 << 0.9244 << 1); + << (RealList() << 0.0000 << 0.0119 << 0.0600 << 0.0694 << 0.2275 << 0.2344 << 0.0900 << 0.3194 << 0.6975 << 0.9244 << 1.0000); QTest::newRow("OutBounce") << int(QEasingCurve::OutBounce) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.07563 << 0.3025 << 0.6806 << 0.91 << 0.7656 << 0.7725 << 0.9306 << 0.94 << 0.9881 << 1); + << (RealList() << 0.0000 << 0.0756 << 0.3025 << 0.6806 << 0.9100 << 0.7656 << 0.7725 << 0.9306 << 0.9400 << 0.9881 << 1.0000); QTest::newRow("InOutBounce") << int(QEasingCurve::InOutBounce) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.03 << 0.1138 << 0.045 << 0.3488 << 0.5 << 0.6512 << 0.955 << 0.8862 << 0.97 << 1); + << (RealList() << 0.0000 << 0.0300 << 0.1138 << 0.0450 << 0.3488 << 0.5000 << 0.6512 << 0.9550 << 0.8863 << 0.9700 << 1.0000); QTest::newRow("OutInBounce") << int(QEasingCurve::OutInBounce) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.1513 << 0.41 << 0.2725 << 0.44 << 0.5 << 0.56 << 0.7275 << 0.59 << 0.8488 << 1); + << (RealList() << 0.0000 << 0.1513 << 0.4100 << 0.2725 << 0.4400 << 0.5000 << 0.5600 << 0.7275 << 0.5900 << 0.8488 << 1.0000); QTest::newRow("InCurve") << int(QEasingCurve::InCurve) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.02447 << 0.1059 << 0.2343 << 0.3727 << 0.5 << 0.6055 << 0.7 << 0.8 << 0.9 << 1); + << (RealList() << 0.0000 << 0.0245 << 0.1059 << 0.2343 << 0.3727 << 0.5000 << 0.6055 << 0.7000 << 0.8000 << 0.9000 << 1.0000); QTest::newRow("OutCurve") << int(QEasingCurve::OutCurve) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.1 << 0.2 << 0.3 << 0.3945 << 0.5 << 0.6273 << 0.7657 << 0.8941 << 0.9755 << 1); + << (RealList() << 0.0000 << 0.1000 << 0.2000 << 0.3000 << 0.3945 << 0.5000 << 0.6273 << 0.7657 << 0.8941 << 0.9755 << 1.0000); QTest::newRow("SineCurve") << int(QEasingCurve::SineCurve) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.09549 << 0.3455 << 0.6545 << 0.9045 << 1 << 0.9045 << 0.6545 << 0.3455 << 0.09549 << 0); + << (RealList() << 0.0000 << 0.0955 << 0.3455 << 0.6545 << 0.9045 << 1.0000 << 0.9045 << 0.6545 << 0.3455 << 0.0955 << 0.0000); QTest::newRow("CosineCurve") << int(QEasingCurve::CosineCurve) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0.5 << 0.7939 << 0.9755 << 0.9755 << 0.7939 << 0.5 << 0.2061 << 0.02447 << 0.02447 << 0.2061 << 0.5); + << (RealList() << 0.5000 << 0.7939 << 0.9755 << 0.9755 << 0.7939 << 0.5000 << 0.2061 << 0.0245 << 0.0245 << 0.2061 << 0.5000); } +/* + "fixedpoint" number that is scaled up by 10000. + This is to work around two bugs (precision and rounding error) in QString::setNum(). + It does not trim off trailing zeros. This is good, just to emphasize the precision. +*/ +QString fixedToString(int value) +{ + QString str; + if (value < 0) { + str+= QLatin1Char('-'); + value = -value; + } + + QString digitArg(QLatin1String("%1.")); + for (int i = 10000; i >= 1; i/=10) { + int digit = value/i; + value -= digit*i; + str.append(digitArg.arg(digit)); + digitArg = QLatin1String("%1"); + } + return str; +} void tst_QEasingCurve::valueForProgress() { @@ -390,7 +412,7 @@ void tst_QEasingCurve::valueForProgress() for (int t = 0; t <= 100; t+= 10) { qreal ease = curve.valueForProgress(t/qreal(100)); strInputs += QString::fromAscii(" << %1").arg(t); - strOutputs += " << " + QString().setNum(ease, 'g', 4); + strOutputs += " << " + fixedToString(qRound(ease*10000)); } QString str = QString::fromAscii(" QTest::newRow(\"%1\") << int(QEasingCurve::%2)\n" " << (IntList() %3)\n" @@ -409,26 +431,13 @@ void tst_QEasingCurve::valueForProgress() QFETCH(RealList, expected); QEasingCurve curve((QEasingCurve::Type)type); + // in theory the baseline should't have an error of more than 0.00005 due to how its rounded, + // but due to FP imprecision, we have to adjust the error a bit more. + const qreal errorBound = 0.00006; for (int i = 0; i < at.count(); ++i) { - qreal ease = curve.valueForProgress(at.at(i)/qreal(100)); - // converting ease to 4 precision qreal to match the generated samples - qreal easeConv = qreal(QString().setNum(ease, 'g', 4).toDouble()); - qreal ex = expected.at(i); - - // the least significant digit it is still subject to rounding errors - qreal error = easeConv - ex; - qreal errorbound = 0.00001; -#if defined( Q_OS_WINCE ) || defined( Q_OS_SYMBIAN ) - // exception values for WINCE(this test should be rewritten, as it only freezes the status quo of QEasingCurve - // The failing (2) values are explicitly excepted here: - // The source values for the comparison table should remain untruncated double and the - // error bound checking function dynamic. Also the source values should come from a "trusted" source and not - // from QEasingCurve itself. - if ((type == int(QEasingCurve::InOutBounce) && (i == 8 || i == 6) ) || (type == int(QEasingCurve::OutExpo) && i == 2)) - errorbound = 0.0002; -#endif - // accept the potential rounding error in the least significant digit - QVERIFY(error <= errorbound ); + const qreal ex = expected.at(i); + const qreal error = qAbs(ex - curve.valueForProgress(at.at(i)/qreal(100))); + QVERIFY(error <= errorBound); } #endif } -- cgit v0.12 From 564f65bdcf42bcdaceea902b99bcbfafef5b97f3 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 6 Oct 2009 10:42:47 +0200 Subject: Add missing #endif. Pointed out by David Faure --- src/corelib/io/qdatastream.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/corelib/io/qdatastream.h b/src/corelib/io/qdatastream.h index f2efcd3..bd418b9 100644 --- a/src/corelib/io/qdatastream.h +++ b/src/corelib/io/qdatastream.h @@ -88,6 +88,7 @@ public: #if QT_VERSION >= 0x040800 #error Add the datastream version for this Qt version Qt_4_8 = Qt_4_7 +#endif }; enum ByteOrder { -- cgit v0.12 From 97dbf38496b36ba283f9d21d5ab1e806590e00e9 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 5 Oct 2009 18:25:21 +0200 Subject: Patched qmake to try to resolve a directory argument in makefile mode. Merge-request: 1674 Reviewed-by: Oswald Buddenhagen --- qmake/option.cpp | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/qmake/option.cpp b/qmake/option.cpp index c503b08..e851e79 100644 --- a/qmake/option.cpp +++ b/qmake/option.cpp @@ -136,6 +136,20 @@ static Option::QMAKE_MODE default_mode(QString progname) return Option::QMAKE_GENERATE_MAKEFILE; } +static QString detectProjectFile(const QString &path) +{ + QString ret; + QDir dir(path); + if(dir.exists(dir.dirName() + Option::pro_ext)) { + ret = dir.filePath(dir.dirName()) + Option::pro_ext; + } else { //last try.. + QStringList profiles = dir.entryList(QStringList("*" + Option::pro_ext)); + if(profiles.count() == 1) + ret = dir.filePath(profiles.at(0)); + } + return ret; +} + QString project_builtin_regx(); bool usage(const char *a0) { @@ -322,12 +336,18 @@ Option::parseCommandLine(int argc, char **argv, int skip) if(!fi.makeAbsolute()) //strange arg = fi.filePath(); if(Option::qmake_mode == Option::QMAKE_GENERATE_MAKEFILE || - Option::qmake_mode == Option::QMAKE_GENERATE_PRL) + Option::qmake_mode == Option::QMAKE_GENERATE_PRL) { + if(fi.isDir()) { + QString proj = detectProjectFile(arg); + if (!proj.isNull()) + arg = proj; + } Option::mkfile::project_files.append(arg); - else if(Option::qmake_mode == Option::QMAKE_GENERATE_PROJECT) + } else if(Option::qmake_mode == Option::QMAKE_GENERATE_PROJECT) { Option::projfile::project_dirs.append(arg); - else + } else { handled = false; + } } if(!handled) { return Option::QMAKE_CMDLINE_SHOW_USAGE | Option::QMAKE_CMDLINE_ERROR; @@ -494,15 +514,9 @@ Option::init(int argc, char **argv) //try REALLY hard to do it for them, lazy.. if(Option::mkfile::project_files.isEmpty()) { - QString pwd = qmake_getpwd(), - proj = pwd + "/" + pwd.right(pwd.length() - (pwd.lastIndexOf('/') + 1)) + Option::pro_ext; - if(QFile::exists(proj)) { + QString proj = detectProjectFile(qmake_getpwd()); + if(!proj.isNull()) Option::mkfile::project_files.append(proj); - } else { //last try.. - QStringList profiles = QDir(pwd).entryList(QStringList("*" + Option::pro_ext)); - if(profiles.count() == 1) - Option::mkfile::project_files.append(pwd + "/" + profiles[0]); - } #ifndef QT_BUILD_QMAKE_LIBRARY if(Option::mkfile::project_files.isEmpty()) { usage(argv[0]); -- cgit v0.12 From fd7188e9f07204b39da2cc6c3b605311517561d0 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Tue, 6 Oct 2009 15:22:17 +0200 Subject: Changing S60 to Symbian in the Docs Changing names to Symbian platform Task-number: QT-2268 Rev-by: Espen Riskedal --- doc/src/development/qmake-manual.qdoc | 87 +++++++++++++++------------- doc/src/getting-started/installation.qdoc | 48 +++++++-------- doc/src/howtos/appicon.qdoc | 4 +- doc/src/images/qt-embedded-architecture.png | Bin 22388 -> 8511 bytes doc/src/platforms/qt-embedded.qdoc | 7 ++- doc/src/platforms/s60-introduction.qdoc | 23 ++++---- 6 files changed, 89 insertions(+), 80 deletions(-) diff --git a/doc/src/development/qmake-manual.qdoc b/doc/src/development/qmake-manual.qdoc index f2cae5b..87132cc 100644 --- a/doc/src/development/qmake-manual.qdoc +++ b/doc/src/development/qmake-manual.qdoc @@ -920,7 +920,7 @@ {deployment guide for Windows}. - \section1 S60 + \section1 Symbian platform Features specific to this platform include handling of static data, capabilities, stack and heap size, compiler specific options, and unique @@ -940,7 +940,7 @@ \section2 Stack and heap size - Symbian uses predefined sizes for stacks and heaps. If an + The Symbian platform uses predefined sizes for stacks and heaps. If an application exceeds either limit, it may crash or fail to complete its task. Crashes that seem to have no reason can often be traced back to insufficient stack and/or heap sizes. @@ -1095,7 +1095,7 @@ \target BLD_INF_RULES \section1 BLD_INF_RULES - \e {This is only used on Symbian.} + \e {This is only used on the Symbian platform.} Generic \c bld.inf file content can be specified with \c BLD_INF_RULES variables. The section of \c bld.inf file where each rule goes is appended to @@ -1288,7 +1288,7 @@ The build process for bundles is also influenced by the contents of the \l{#QMAKE_BUNDLE_DATA}{QMAKE_BUNDLE_DATA} variable. - These options only have an effect on Symbian: + These options only have an effect on the Symbian platform: \table 95% \header \o Option \o Description @@ -1345,7 +1345,7 @@ \target DEPLOYMENT \section1 DEPLOYMENT - \e {This is only used on Windows CE and Symbian.} + \e {This is only used on Windows CE and the Symbian platform.} Specifies which additional files will be deployed. Deployment means the transfer of files from the development system to the target device or @@ -1363,8 +1363,8 @@ The default deployment target path for Windows CE is \c{%CSIDL_PROGRAM_FILES%\target}, which usually gets expanded to - \c{\Program Files\target}. For Symbian, the default target is the application - private directory on the drive it is installed to. + \c{\Program Files\target}. For the Symbian platform, the default target +is the application private directory on the drive it is installed to. It is also possible to specify multiple \c sources to be deployed on target \c paths. In addition, different variables can be used for @@ -1375,10 +1375,10 @@ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 29 \note In Windows CE all linked Qt libraries will be deployed to the path - specified by \c{myFiles.path}. In Symbian all libraries and executables + specified by \c{myFiles.path}. On Symbian platform all libraries and executables will always be deployed to the \\sys\\bin of the installation drive. - Since the Symbian build system automatically moves binaries to certain + Since the Symbian platform build system automatically moves binaries to certain directories under the epoc32 directory, custom plugins, executables or dynamically loadable libraries need special handling. When deploying extra executables or dynamically loadable libraries, the target path @@ -1393,13 +1393,13 @@ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 128 - In Symbian, generic PKG file content can also be specified with this + On the Symbian platform, generic PKG file content can also be specified with this variable. You can use either \c pkg_prerules or \c pkg_postrules to pass raw data to PKG file. The strings in \c pkg_prerules are added before package-body and \c pkg_postrules after. The strings defined in \c pkg_postrules or \c pkg_prerules are not parsed by qmake, so they should be in a format understood by Symbian package generation tools. - Please consult Symbian documentation for correct syntax. + Please consult the Symbian platform documentation for correct syntax. For example, to deploy DLL and add a new dependency: @@ -1424,7 +1424,7 @@ override languages statement, you must override also package-header statement and all other statements which are language specific. - In Symbian, the \c default_deployment item specifies + On the Symbian platform, the \c default_deployment item specifies default platform dependencies. It can be overwritten if a more restrictive set is needed - e.g. if a specific device is required to run the application. @@ -1436,7 +1436,7 @@ \target DEPLOYMENT_PLUGIN \section1 DEPLOYMENT_PLUGIN - \e {This is only used on Windows CE and Symbian.} + \e {This is only used on Windows CE and the Symbian platform.} This variable specifies the Qt plugins that will be deployed. All plugins available in Qt can be explicitly deployed to the device. See @@ -1446,9 +1446,9 @@ If the application depends on plugins, these plugins have to be specified manually. - \note In Symbian, all plugins supported by this variable will be deployed - by default with Qt libraries, so generally using this variable is not - needed. + \note On the Symbian platform, all plugins supported by this variable +will be deployed by default with Qt libraries, so generally using this +variable is not needed. For example: @@ -1556,7 +1556,7 @@ \target ICON \section1 ICON - This variable is used only in MAC and S60 to set the application icon. + This variable is used only in MAC and the Symbian platform to set the application icon. Please see \l{Setting the Application Icon}{the application icon documentation} for more information. @@ -1623,10 +1623,10 @@ This variable contains a list of libraries to be linked into the project. You can use the Unix \c -l (library) and -L (library path) flags and qmake - will do the correct thing with these libraries on Windows and Symbian - (namely this means passing the full path of the library to the linker). The - only limitation to this is the library must exist, for qmake to find which - directory a \c -l lib lives in. + will do the correct thing with these libraries on Windows and the + Symbian platform (namely this means passing the full path of the library to + the linker). The only limitation to this is the library must exist, for + qmake to find which directory a \c -l lib lives in. For example: @@ -1647,7 +1647,8 @@ explicitly specify the library to be used by including the \c{.lib} file name suffix. - \bold{Note:} On S60, the build system makes a distinction between shared and + \bold{Note:} On the Symbian platform, the build system makes a +distinction between shared and static libraries. In most cases, qmake will figure out which library you are refering to, but in some cases you may have to specify it explicitly to get the expected behavior. This typically happens if you are building a @@ -1693,7 +1694,7 @@ \target MMP_RULES \section1 MMP_RULES - \e {This is only used on Symbian.} + \e {This is only used on the Symbian platform.} Generic MMP file content can be specified with this variable. @@ -2013,8 +2014,9 @@ the \c QMAKE_CXXFLAGS_DEBUG and \c QMAKE_CXXFLAGS_RELEASE variables, respectively. - \bold{Note:} On S60, this variable can be used to pass architecture specific - options to each compiler in the Symbian build system. For example: + \bold{Note:} On the Symbian platform, this variable can be used to pass +architecture specific options to each compiler in the Symbian build system. +For example: \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 131 @@ -2812,7 +2814,7 @@ \target RSS_RULES \section1 RSS_RULES - \e {This is only used on Symbian.} + \e {This is only used on the Symbian platform.} Generic RSS file content can be specified with this variable. The syntax is similar to \c MMP_RULES and \c BLD_INF_RULES. @@ -2832,10 +2834,12 @@ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 145 - This example will install the application to MyFolder in S60 application - shell. In addition it will make the application to be launched in background. + This example will install the application to MyFolder in the Symbian + platform application shell. In addition it will make the application to + be launched in background. - For detailed list of possible RSS statements, please refer to Symbian OS help. + For detailed list of possible RSS statements, please refer to the + Symbian platform help. \note You should not use \c RSS_RULES variable to set the following RSS statements: @@ -2848,7 +2852,7 @@ \target S60_VERSION \section1 S60_VERSION - \e {This is only used on Symbian.} + \e {This is only used on the Symbian platform.} Contains the version number of the underlying S60 SDK; e.g. "5.0". @@ -2918,7 +2922,7 @@ \target TARGET.CAPABILITY \section1 TARGET.CAPABILITY - \e {This is only used on Symbian.} + \e {This is only used on the Symbian platform.} Specifies which platform capabilities the application should have. For more information, please refer to the S60 SDK documentation. @@ -2926,7 +2930,7 @@ \target TARGET.EPOCALLOWDLLDATA \section1 TARGET.EPOCALLOWDLLDATA - \e {This is only used on Symbian.} + \e {This is only used on the Symbian platform.} Specifies whether static data should be allowed in the application. Symbian disallows this by default in order to save memory. To use it, set this to 1. @@ -2934,7 +2938,7 @@ \target TARGET.EPOCHEAPSIZE \section1 TARGET.EPOCHEAPSIZE - \e {This is only used on Symbian.} + \e {This is only used on the Symbian platform.} Specifies the minimum and maximum heap size of the application. The program will refuse to run if the minimum size is not available when it starts. For @@ -2945,7 +2949,7 @@ \target TARGET.EPOCSTACKSIZE \section1 TARGET.EPOCSTACKSIZE - \e {This is only used on Symbian.} + \e {This is only used on the Symbian platform.} Specifies the maximum stack size of the application. For example: @@ -2954,7 +2958,7 @@ \target TARGET.SID \section1 TARGET.SID - \e {This is only used on Symbian.} + \e {This is only used on the Symbian platform.} Specifies which secure identifier to use for the target application or library. For more information, see the S60 SDK documentation. @@ -2962,7 +2966,7 @@ \target TARGET.UID2 \section1 TARGET.UID2 - \e {This is only used on Symbian.} + \e {This is only used on the Symbian platform.} Specifies which unique identifier 2 to use for the target application or library. If this variable is not specified, it defaults to the same value @@ -2971,7 +2975,7 @@ \target TARGET.UID3 \section1 TARGET.UID3 - \e {This is only used on Symbian.} + \e {This is only used on the Symbian platform.} Specifies which unique identifier 3 to use for the target application or library. If this variable is not specified, a UID3 suitable for development @@ -2982,7 +2986,7 @@ \target TARGET.VID \section1 TARGET.VID - \e {This is only used on Symbian.} + \e {This is only used on the Symbian platform.} Specifies which vendor identifier to use for the target application or library. For more information, see the S60 SDK documentation. @@ -3862,9 +3866,10 @@ \o Indicates that the output should not be added to the list of objects to be linked in. \endtable - \note Symbian specific: Generating objects to be linked in is not supported in Symbian, - so either the \c CONFIG option \c no_link or variable \c variable_out - should always be defined for extra compilers. + \note Symbian platform specific: Generating objects to be linked in is + not supported on the Symbian platform, so either the \c CONFIG option + \c no_link or variable \c variable_out should always be defined for + extra compilers. */ diff --git a/doc/src/getting-started/installation.qdoc b/doc/src/getting-started/installation.qdoc index 2ace8de..366a906 100644 --- a/doc/src/getting-started/installation.qdoc +++ b/doc/src/getting-started/installation.qdoc @@ -497,14 +497,14 @@ in the \l{Qt for Windows CE Requirements} document. We hope you will enjoy using Qt. Good luck! */ -/*! \page install-S60-installer.html +/*! \page install-Symbian-installer.html -\title Installing Qt on S60 using binary package +\title Installing Qt on the Symbian platform using binary package \ingroup qts60 -\brief How to install Qt on S60 using the binary package. +\brief How to install Qt on the Symbian platform using the binary package. -\note Qt for S60 has some requirements that are given in more detail -in the \l{Qt for S60 Requirements} document. +\note Qt for Symbian platform has some requirements that are given in more detail +in the \l{Qt for Symbian platform Requirements} document. \list 1 @@ -527,7 +527,7 @@ in the \l{Qt for S60 Requirements} document. and follow the instructions. To run the demos and examples on the emulator, you need to build them first. - Open the "Qt for S60 Command Prompt" from the Start menu and type: + Open the "Qt for Symbian platform Command Prompt" from the Start menu and type: \snippet doc/src/snippets/code/doc_src_installation.qdoc 25 @@ -536,27 +536,29 @@ in the \l{Qt for S60 Requirements} document. \snippet doc/src/snippets/code/doc_src_installation.qdoc 27 - For more information about building and running Qt programs on S60, - see \l{S60 - Introduction to using Qt}. + For more information about building and running Qt programs on the +Symbian platform, + see \l{Symbian platform - Introduction to using Qt}. We hope you will enjoy using Qt. \endlist */ -/*! \page install-S60.html +/*! \page install-Symbian.html -\title Installing Qt on S60 +\title Installing Qt on the Symbian platform \ingroup installation \ingroup qts60 -\brief How to install Qt on S60 +\brief How to install Qt for the Symbian platform -\note Qt for S60 has some requirements that are given in more detail -in the \l{Qt for S60 Requirements} document. +\note Qt for the Symbian platform has some requirements that are given in more detail +in the \l{Qt for Symbian platform Requirements} document. -\note \bold {This document describes how to install and configure Qt for S60 from scratch. +\note \bold {This document describes how to install and configure Qt for +the Symbian platform from scratch. If you are using pre-built binaries, follow the instructions -\l{Installing Qt on S60 using binary package}{here}.} +\l{Installing Qt on the Symbian platform using binary package}{here}.} \list 1 @@ -586,7 +588,7 @@ If you are using pre-built binaries, follow the instructions \o Configure Qt - To configure Qt for S60, do: + To configure Qt for the Symbian platform, do: \snippet doc/src/snippets/code/doc_src_installation.qdoc 23 to build the tools using MinGW, and the libraries using abld. @@ -633,8 +635,8 @@ If you are using pre-built binaries, follow the instructions \snippet doc/src/snippets/code/doc_src_installation.qdoc 27 - For more information about building and running Qt programs on S60, - see \l{S60 - Introduction to using Qt}. + For more information about building and running Qt programs on the +Symbian platform, see \l{Symbian platform - Introduction to using Qt}. We hope you will enjoy using Qt. @@ -669,7 +671,7 @@ If you are using pre-built binaries, follow the instructions \list \o \l{Qt for Embedded Linux Requirements} \o \l{Qt for Mac OS X Requirements} - \o \l{Qt for S60 Requirements} + \o \l{Qt for Symbian platform Requirements} \o \l{Qt for Windows CE Requirements} \o \l{Qt for Windows Requirements} \o \l{Qt for X11 Requirements} @@ -953,13 +955,13 @@ If you are using pre-built binaries, follow the instructions */ /*! - \page requirements-s60.html - \title Qt for S60 Requirements + \page requirements-symbian.html + \title Qt for Symbian platform Requirements \ingroup installation - \brief Setting up the S60 environment for Qt. + \brief Setting up the Symbian platform environment for Qt. \previouspage General Qt Requirements - Qt for S60 requires the following software installed on your development PC: + Qt for Symbian platform requires the following software installed on your development PC: \list \o \l{http://www.mingw.org/}{MinGW 3.4.5 or higher}, or another windows compiler to build the tools. \o \l{http://www.forum.nokia.com/main/resources/tools_and_sdks/carbide_cpp/}{Carbide.c++ v2.0.0 or higher} diff --git a/doc/src/howtos/appicon.qdoc b/doc/src/howtos/appicon.qdoc index ece2dcf..4108c11 100644 --- a/doc/src/howtos/appicon.qdoc +++ b/doc/src/howtos/appicon.qdoc @@ -213,9 +213,9 @@ The GNOME developer website is at \l{http://developer.gnome.org/}. - \section1 Setting the Application Icon on S60 platforms + \section1 Setting the Application Icon on the Symbian platform - In order to set the application icon for S60 applications, you need + In order to set the application icon for Symbian platform applications, you need an SVG-T icon. For information on how to create SVG-T compliant icons, please refer to \l{http://wiki.forum.nokia.com/index.php/How_to_create_application_icon(SVG)_in_S60_3rd_edition/} diff --git a/doc/src/images/qt-embedded-architecture.png b/doc/src/images/qt-embedded-architecture.png index d3f8edc..20b3e7f 100644 Binary files a/doc/src/images/qt-embedded-architecture.png and b/doc/src/images/qt-embedded-architecture.png differ diff --git a/doc/src/platforms/qt-embedded.qdoc b/doc/src/platforms/qt-embedded.qdoc index 0b2c2ac..c39a967 100644 --- a/doc/src/platforms/qt-embedded.qdoc +++ b/doc/src/platforms/qt-embedded.qdoc @@ -54,7 +54,7 @@ Currently, three embedded platforms are supported by Qt: \table 90% - \header \o Embedded Linux \o Windows CE \o S60 + \header \o Embedded Linux \o Windows CE \o Symbian platform \row \o \l{Qt for Embedded Linux} is designed to be used on Linux devices without X11 or existing graphical environments. This flavor of @@ -67,8 +67,9 @@ Applications use the appropriate style for the embedded environment and use native features, such as menus, to conform to the native style guidelines. - \o \l{S60 - Introduction to using Qt}{Qt for S60} is used to create - applications running in existing S60 environments. + \o \l{Symbian platform - Introduction to using Qt}{Qt for the Symbian +platform} is used to create + applications running in existing Symbian platform environments. Applications use the appropriate style for the embedded environment and use native features, such as menus, to conform to the native style guidelines. diff --git a/doc/src/platforms/s60-introduction.qdoc b/doc/src/platforms/s60-introduction.qdoc index d0a1976..d145a82 100644 --- a/doc/src/platforms/s60-introduction.qdoc +++ b/doc/src/platforms/s60-introduction.qdoc @@ -40,10 +40,10 @@ ****************************************************************************/ /*! - \page s60-with-qt-introduction.html + \page symbian-with-qt-introduction.html - \title S60 - Introduction to using Qt - \brief An introduction to Qt for S60 developers. + \title Symbian platform - Introduction to using Qt + \brief An introduction to Qt for Symbian platform developers. \ingroup howto \ingroup qts60 @@ -51,21 +51,22 @@ \section1 Required tools - See \l{Qt for S60 Requirements} to see what tools are required to use Qt for S60. + See \l{Qt for Symbian platform Requirements} to see what tools are +required to use Qt for Symbian platform. \section1 Installing Qt and running demos - Follow the instructions found in \l{Installing Qt on S60 using binary package} to learn how + Follow the instructions found in \l{Installing Qt on the Symbian platform using binary package} to learn how to install Qt using binary package and how to build and run Qt demos. - Follow the instructions found in \l{Installing Qt on S60} to learn how to install Qt using + Follow the instructions found in \l{Installing Qt on the Symbian platform} to learn how to install Qt using using source package and how to build and run the Qt demos. \section1 Building your own applications If you are new to Qt development, have a look at \l{How to Learn Qt}. In general, the difference between developing a - Qt application on S60 compared to any of the other platforms supported + Qt application on the Symbian platform compared to any of the other platforms supported by Qt is not that big. Once you have crated a \c .pro file for your project, generate the @@ -76,10 +77,10 @@ For more information on how to use qmake have a look at the \l {qmake Tutorial}. - Now you can build the Qt on S60 application with standard build - tools. By default, running \c make will produce binaries for the - emulator. However, S60 comes with several alternative build targets, - as shown in the table below: + Now you can build the Qt for the Symbian platform application with +standard build tools. By default, running \c make will produce binaries for +the emulator. However, the Symbian platform comes with several alternative +build targets, as shown in the table below: \table \row \o \c debug-winscw \o Build debug binaries for the emulator (default). -- cgit v0.12 From b2cf158459da1647d86579a28f1435334aa85e3d Mon Sep 17 00:00:00 2001 From: Morten Sorvig Date: Mon, 12 Oct 2009 12:45:58 +0200 Subject: Prevent cross-talk between different Qt builds on OS X. /Library/Frameworks/ is hardcoded as a .prl file lookup path, which sometimes wreaks havoc when depot builds pick up settings and binaries from an installed binary package. Remove /Library/Frameworks from the qmake sources. The binary package build script already adds -F /Library/Frameworks explicitly. /Library/Frameworks is still kept as a default _framework_ search path, since it does not seem to cause trouble, and people may be relying on that path being searched by default. --- qmake/generators/unix/unixmake.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp index faa6415..ec3b5d8 100644 --- a/qmake/generators/unix/unixmake.cpp +++ b/qmake/generators/unix/unixmake.cpp @@ -544,7 +544,6 @@ UnixMakefileGenerator::processPrlFiles() { QList libdirs, frameworkdirs; frameworkdirs.append(QMakeLocalFileName("/System/Library/Frameworks")); - frameworkdirs.append(QMakeLocalFileName("/Library/Frameworks")); const QString lflags[] = { "QMAKE_LIBDIR_FLAGS", "QMAKE_FRAMEWORKPATH_FLAGS", "QMAKE_LFLAGS", "QMAKE_LIBS", QString() }; for(int i = 0; !lflags[i].isNull(); i++) { QStringList &l = project->values(lflags[i]); -- cgit v0.12 From 7915d20f64a835961c20d0b0ccd587dba8d5c2ae Mon Sep 17 00:00:00 2001 From: Martin Pejcoch Date: Thu, 15 Oct 2009 16:07:02 +0200 Subject: Set OFN_PATHMUSTEXIT as a default parameter This will result in a warning if the path entered doesn't exist, which is the behavior of native applications. Reviewed-by: Prasanth --- src/gui/dialogs/qfiledialog_win.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/dialogs/qfiledialog_win.cpp b/src/gui/dialogs/qfiledialog_win.cpp index b59c28b..8089b43 100644 --- a/src/gui/dialogs/qfiledialog_win.cpp +++ b/src/gui/dialogs/qfiledialog_win.cpp @@ -251,10 +251,10 @@ static OPENFILENAME* qt_win_make_OFN(QWidget *parent, ofn->nMaxFile = maxLen; ofn->lpstrInitialDir = (wchar_t*)tInitDir.utf16(); ofn->lpstrTitle = (wchar_t*)tTitle.utf16(); - ofn->Flags = (OFN_NOCHANGEDIR | OFN_HIDEREADONLY | OFN_EXPLORER); + ofn->Flags = (OFN_NOCHANGEDIR | OFN_HIDEREADONLY | OFN_EXPLORER | OFN_PATHMUSTEXIST); if (mode == QFileDialog::ExistingFile || mode == QFileDialog::ExistingFiles) - ofn->Flags |= (OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST); + ofn->Flags |= (OFN_FILEMUSTEXIST); if (mode == QFileDialog::ExistingFiles) ofn->Flags |= (OFN_ALLOWMULTISELECT); if (!(options & QFileDialog::DontConfirmOverwrite)) -- cgit v0.12 From 1118181c5c675f9072d94b1713d69d672e810eb2 Mon Sep 17 00:00:00 2001 From: Andrew den Exter Date: Thu, 15 Oct 2009 14:40:33 +1000 Subject: Move audio and video examples into the common multimedia directory. Brings the video examples into multimedia directory, and removes the audio sub-directory so the directory structure is in line with the other example categories. Task-number: QT-667 Reviewed-by: Kurt Korbatits --- demos/qtdemo/xml/examples.xml | 2 +- doc/src/examples/audiodevices.qdoc | 2 +- doc/src/examples/audioinput.qdoc | 2 +- doc/src/examples/audiooutput.qdoc | 2 +- doc/src/examples/videographicsitem.qdoc | 2 +- doc/src/examples/videowidget.qdoc | 30 +-- doc/src/getting-started/examples.qdoc | 10 +- examples/examples.pro | 3 +- examples/multimedia/audio/audio.pro | 10 - .../multimedia/audio/audiodevices/audiodevices.cpp | 274 ------------------- .../multimedia/audio/audiodevices/audiodevices.h | 78 ------ .../multimedia/audio/audiodevices/audiodevices.pro | 17 -- .../audio/audiodevices/audiodevicesbase.ui | 233 ---------------- examples/multimedia/audio/audiodevices/main.cpp | 55 ---- .../multimedia/audio/audioinput/audioinput.cpp | 296 --------------------- examples/multimedia/audio/audioinput/audioinput.h | 124 --------- .../multimedia/audio/audioinput/audioinput.pro | 16 -- examples/multimedia/audio/audioinput/main.cpp | 55 ---- .../multimedia/audio/audiooutput/audiooutput.cpp | 270 ------------------- .../multimedia/audio/audiooutput/audiooutput.h | 110 -------- .../multimedia/audio/audiooutput/audiooutput.pro | 16 -- examples/multimedia/audio/audiooutput/main.cpp | 56 ---- examples/multimedia/audiodevices/audiodevices.cpp | 274 +++++++++++++++++++ examples/multimedia/audiodevices/audiodevices.h | 78 ++++++ examples/multimedia/audiodevices/audiodevices.pro | 17 ++ .../multimedia/audiodevices/audiodevicesbase.ui | 233 ++++++++++++++++ examples/multimedia/audiodevices/main.cpp | 55 ++++ examples/multimedia/audioinput/audioinput.cpp | 296 +++++++++++++++++++++ examples/multimedia/audioinput/audioinput.h | 124 +++++++++ examples/multimedia/audioinput/audioinput.pro | 16 ++ examples/multimedia/audioinput/main.cpp | 55 ++++ examples/multimedia/audiooutput/audiooutput.cpp | 270 +++++++++++++++++++ examples/multimedia/audiooutput/audiooutput.h | 110 ++++++++ examples/multimedia/audiooutput/audiooutput.pro | 16 ++ examples/multimedia/audiooutput/main.cpp | 56 ++++ examples/multimedia/multimedia.pro | 14 +- examples/multimedia/videographicsitem/main.cpp | 55 ++++ .../videographicsitem/videographicsitem.pro | 21 ++ .../multimedia/videographicsitem/videoitem.cpp | 144 ++++++++++ examples/multimedia/videographicsitem/videoitem.h | 79 ++++++ .../multimedia/videographicsitem/videoplayer.cpp | 210 +++++++++++++++ .../multimedia/videographicsitem/videoplayer.h | 86 ++++++ examples/multimedia/videowidget/main.cpp | 54 ++++ examples/multimedia/videowidget/videoplayer.cpp | 183 +++++++++++++ examples/multimedia/videowidget/videoplayer.h | 79 ++++++ examples/multimedia/videowidget/videowidget.cpp | 114 ++++++++ examples/multimedia/videowidget/videowidget.h | 76 ++++++ examples/multimedia/videowidget/videowidget.pro | 25 ++ .../multimedia/videowidget/videowidgetsurface.cpp | 175 ++++++++++++ .../multimedia/videowidget/videowidgetsurface.h | 81 ++++++ examples/video/video.pro | 6 - examples/video/videographicsitem/main.cpp | 55 ---- .../video/videographicsitem/videographicsitem.pro | 21 -- examples/video/videographicsitem/videoitem.cpp | 144 ---------- examples/video/videographicsitem/videoitem.h | 79 ------ examples/video/videographicsitem/videoplayer.cpp | 210 --------------- examples/video/videographicsitem/videoplayer.h | 86 ------ examples/video/videowidget/main.cpp | 54 ---- examples/video/videowidget/videoplayer.cpp | 183 ------------- examples/video/videowidget/videoplayer.h | 79 ------ examples/video/videowidget/videowidget.cpp | 114 -------- examples/video/videowidget/videowidget.h | 76 ------ examples/video/videowidget/videowidget.pro | 19 -- examples/video/videowidget/videowidgetsurface.cpp | 175 ------------ examples/video/videowidget/videowidgetsurface.h | 81 ------ 65 files changed, 3020 insertions(+), 3021 deletions(-) delete mode 100644 examples/multimedia/audio/audio.pro delete mode 100644 examples/multimedia/audio/audiodevices/audiodevices.cpp delete mode 100644 examples/multimedia/audio/audiodevices/audiodevices.h delete mode 100644 examples/multimedia/audio/audiodevices/audiodevices.pro delete mode 100644 examples/multimedia/audio/audiodevices/audiodevicesbase.ui delete mode 100644 examples/multimedia/audio/audiodevices/main.cpp delete mode 100644 examples/multimedia/audio/audioinput/audioinput.cpp delete mode 100644 examples/multimedia/audio/audioinput/audioinput.h delete mode 100644 examples/multimedia/audio/audioinput/audioinput.pro delete mode 100644 examples/multimedia/audio/audioinput/main.cpp delete mode 100644 examples/multimedia/audio/audiooutput/audiooutput.cpp delete mode 100644 examples/multimedia/audio/audiooutput/audiooutput.h delete mode 100644 examples/multimedia/audio/audiooutput/audiooutput.pro delete mode 100644 examples/multimedia/audio/audiooutput/main.cpp create mode 100644 examples/multimedia/audiodevices/audiodevices.cpp create mode 100644 examples/multimedia/audiodevices/audiodevices.h create mode 100644 examples/multimedia/audiodevices/audiodevices.pro create mode 100644 examples/multimedia/audiodevices/audiodevicesbase.ui create mode 100644 examples/multimedia/audiodevices/main.cpp create mode 100644 examples/multimedia/audioinput/audioinput.cpp create mode 100644 examples/multimedia/audioinput/audioinput.h create mode 100644 examples/multimedia/audioinput/audioinput.pro create mode 100644 examples/multimedia/audioinput/main.cpp create mode 100644 examples/multimedia/audiooutput/audiooutput.cpp create mode 100644 examples/multimedia/audiooutput/audiooutput.h create mode 100644 examples/multimedia/audiooutput/audiooutput.pro create mode 100644 examples/multimedia/audiooutput/main.cpp create mode 100644 examples/multimedia/videographicsitem/main.cpp create mode 100644 examples/multimedia/videographicsitem/videographicsitem.pro create mode 100644 examples/multimedia/videographicsitem/videoitem.cpp create mode 100644 examples/multimedia/videographicsitem/videoitem.h create mode 100644 examples/multimedia/videographicsitem/videoplayer.cpp create mode 100644 examples/multimedia/videographicsitem/videoplayer.h create mode 100644 examples/multimedia/videowidget/main.cpp create mode 100644 examples/multimedia/videowidget/videoplayer.cpp create mode 100644 examples/multimedia/videowidget/videoplayer.h create mode 100644 examples/multimedia/videowidget/videowidget.cpp create mode 100644 examples/multimedia/videowidget/videowidget.h create mode 100644 examples/multimedia/videowidget/videowidget.pro create mode 100644 examples/multimedia/videowidget/videowidgetsurface.cpp create mode 100644 examples/multimedia/videowidget/videowidgetsurface.h delete mode 100644 examples/video/video.pro delete mode 100644 examples/video/videographicsitem/main.cpp delete mode 100644 examples/video/videographicsitem/videographicsitem.pro delete mode 100644 examples/video/videographicsitem/videoitem.cpp delete mode 100644 examples/video/videographicsitem/videoitem.h delete mode 100644 examples/video/videographicsitem/videoplayer.cpp delete mode 100644 examples/video/videographicsitem/videoplayer.h delete mode 100644 examples/video/videowidget/main.cpp delete mode 100644 examples/video/videowidget/videoplayer.cpp delete mode 100644 examples/video/videowidget/videoplayer.h delete mode 100644 examples/video/videowidget/videowidget.cpp delete mode 100644 examples/video/videowidget/videowidget.h delete mode 100644 examples/video/videowidget/videowidget.pro delete mode 100644 examples/video/videowidget/videowidgetsurface.cpp delete mode 100644 examples/video/videowidget/videowidgetsurface.h diff --git a/demos/qtdemo/xml/examples.xml b/demos/qtdemo/xml/examples.xml index 2c31484..83bd200 100644 --- a/demos/qtdemo/xml/examples.xml +++ b/demos/qtdemo/xml/examples.xml @@ -154,7 +154,7 @@ - + diff --git a/doc/src/examples/audiodevices.qdoc b/doc/src/examples/audiodevices.qdoc index 0d0932e..1505846 100644 --- a/doc/src/examples/audiodevices.qdoc +++ b/doc/src/examples/audiodevices.qdoc @@ -40,7 +40,7 @@ ****************************************************************************/ /*! - \example multimedia/audio/audiodevices + \example multimedia/audiodevices \title Audio Devices Example The Audio Devices example demonstrates the basic use of QAudioDeviceInfo class diff --git a/doc/src/examples/audioinput.qdoc b/doc/src/examples/audioinput.qdoc index ac44d75..8553e92 100644 --- a/doc/src/examples/audioinput.qdoc +++ b/doc/src/examples/audioinput.qdoc @@ -40,7 +40,7 @@ ****************************************************************************/ /*! - \example multimedia/audio/audioinput + \example multimedia/audioinput \title AudioInput Example The Audio Input example demonstrates the basic use of QAudioInput class diff --git a/doc/src/examples/audiooutput.qdoc b/doc/src/examples/audiooutput.qdoc index 2ed6ce4..58b8ea9 100644 --- a/doc/src/examples/audiooutput.qdoc +++ b/doc/src/examples/audiooutput.qdoc @@ -40,7 +40,7 @@ ****************************************************************************/ /*! - \example multimedia/audio/audiooutput + \example multimedia/audiooutput \title Audio Output Example The Audio Output example demonstrates the basic use of the QAudioOutput class diff --git a/doc/src/examples/videographicsitem.qdoc b/doc/src/examples/videographicsitem.qdoc index ce24f09..e1cb6ed 100644 --- a/doc/src/examples/videographicsitem.qdoc +++ b/doc/src/examples/videographicsitem.qdoc @@ -40,7 +40,7 @@ ****************************************************************************/ /*! - \example video/videographicsitem + \example multimedia/videographicsitem \title Video Graphics Item Example The Video Graphics Item example shows how to implement a QGraphicsItem that displays video on a diff --git a/doc/src/examples/videowidget.qdoc b/doc/src/examples/videowidget.qdoc index 1b214d2..4223c1f 100644 --- a/doc/src/examples/videowidget.qdoc +++ b/doc/src/examples/videowidget.qdoc @@ -40,7 +40,7 @@ ****************************************************************************/ /*! - \example video/videowidget + \example multimedia/videowidget \title Video Widget Example The Video Widget example shows how to implement a video widget using @@ -50,7 +50,7 @@ \section1 VideoWidgetSurface Class Definition - \snippet examples/video/videowidget/videowidgetsurface.h 0 + \snippet examples/multimedia/videowidget/videowidgetsurface.h 0 The VideoWidgetSurface class inherits QAbstractVideoSurface and paints video frames on a QWidget. This is a separate class to VideoWidget as both @@ -62,7 +62,7 @@ \section1 VideoWidgetSurface Class Implementation - \snippet examples/video/videowidget/videowidgetsurface.cpp 0 + \snippet examples/multimedia/videowidget/videowidgetsurface.cpp 0 From the supportedPixelFormats() function we return a list of pixel formats the surface can paint. The order of the list hints at which formats are @@ -74,7 +74,7 @@ return any pixel formats if handleType is not QAbstractVideoBuffer::NoHandle. - \snippet examples/video/videowidget/videowidgetsurface.cpp 1 + \snippet examples/multimedia/videowidget/videowidgetsurface.cpp 1 In isFormatSupported() we test if the frame type of a surface format maps to a valid QImage format, that the frame size is not empty, and the handle @@ -85,7 +85,7 @@ that the size is not empty so a reimplementation wasn't strictly necessary in this case. - \snippet examples/video/videowidget/videowidgetsurface.cpp 2 + \snippet examples/multimedia/videowidget/videowidgetsurface.cpp 2 To start our surface we'll extract the image format and size from the selected video format and save it for use in the paint() function. If the @@ -94,7 +94,7 @@ by calling QAbstractVideoSurface::start(). Finally since the video size may have changed we'll trigger an update of the widget, and video geometry. - \snippet examples/video/videowidget/videowidgetsurface.cpp 5 + \snippet examples/multimedia/videowidget/videowidgetsurface.cpp 5 The updateVideoRect() function calculates the region within the widget the video occupies. The \l {QVideoSurfaceFormat::sizeHint()}{size hint} of the @@ -105,7 +105,7 @@ size in the center of the widget. Otherwise we shrink the size maintaining the aspect ratio so that it does fit. - \snippet examples/video/videowidget/videowidgetsurface.cpp 4 + \snippet examples/multimedia/videowidget/videowidgetsurface.cpp 4 We can't paint from outside a paint event, so when a new frame is received in present() we save a reference to it and force an immediate repaint of @@ -118,7 +118,7 @@ \l {QAbstractVideoSurface::UnsupportedFormatError}{UnsupportedFormatError} on our surface and stop it immediately. - \snippet examples/video/videowidget/videowidgetsurface.cpp 6 + \snippet examples/multimedia/videowidget/videowidgetsurface.cpp 6 The paint() function is called by the video widget to paint the current video frame. Before we draw the frame first we'll check the format for @@ -128,7 +128,7 @@ construct a new QImage from the current video frame, and draw it to the the widget. - \snippet examples/video/videowidget/videowidgetsurface.cpp 3 + \snippet examples/multimedia/videowidget/videowidgetsurface.cpp 3 When the surface is stopped we need to release the current frame and invalidate the video region. Then we confirm the surface has been @@ -141,7 +141,7 @@ The VideoWidget class uses the VideoWidgetSurface class to implement a video widget. - \snippet examples/video/videowidget/videowidget.h 0 + \snippet examples/multimedia/videowidget/videowidget.h 0 The VideoWidget QWidget implementation is minimal with just the sizeHint(), paintEvent(), and resizeEvent() functions in addition to the constructor, @@ -149,7 +149,7 @@ \section1 VideoWidget Class Implementation - \snippet examples/video/videowidget/videowidget.cpp 0 + \snippet examples/multimedia/videowidget/videowidget.cpp 0 In the VideoWidget constructor we set some flags to speed up re-paints a little. Setting the Qt::WA_NoSystemBackground flag and disabling automatic @@ -162,17 +162,17 @@ Finally we construct an instance of the VideoWidgetSurface class. - \snippet examples/video/videowidget/videowidget.cpp 1 + \snippet examples/multimedia/videowidget/videowidget.cpp 1 In the destructor we simply delete the VideoWidgetSurface instance. - \snippet examples/video/videowidget/videowidget.cpp 2 + \snippet examples/multimedia/videowidget/videowidget.cpp 2 We get the size hint for the widget from the video format of the surface which is calculated from viewport and pixel aspect ratio of the video format. - \snippet examples/video/videowidget/videowidget.cpp 3 + \snippet examples/multimedia/videowidget/videowidget.cpp 3 When the video widget receives a paint event we first check if the surface is started, if not then we simply fill the widget with the background @@ -180,7 +180,7 @@ by the paint region, before calling paint on the video surface to draw the current frame. - \snippet examples/video/videowidget/videowidget.cpp 4 + \snippet examples/multimedia/videowidget/videowidget.cpp 4 The resizeEvent() function is reimplemented to trigger an update of the video region when the widget is resized. diff --git a/doc/src/getting-started/examples.qdoc b/doc/src/getting-started/examples.qdoc index 2ad730a7..a36debb 100644 --- a/doc/src/getting-started/examples.qdoc +++ b/doc/src/getting-started/examples.qdoc @@ -806,16 +806,16 @@ Audio API in Qt applications. \list - \o \l{multimedia/audio/audiodevices}{Audio Devices} - \o \l{multimedia/audio/audiooutput}{Audio Output} - \o \l{multimedia/audio/audioinput}{Audio Input} + \o \l{multimedia/audiodevices}{Audio Devices} + \o \l{multimedia/audiooutput}{Audio Output} + \o \l{multimedia/audioinput}{Audio Input} \endlist \section1 Video Output \list - \o \l{video/videowidget}{Video Widget}\raisedaster - \o \l{video/videographicsitem}{Video Graphics Item} + \o \l{multimedia/videowidget}{Video Widget}\raisedaster + \o \l{multimedia/videographicsitem}{Video Graphics Item} \endlist \section1 Phonon diff --git a/examples/examples.pro b/examples/examples.pro index feda04d..3678cc0 100644 --- a/examples/examples.pro +++ b/examples/examples.pro @@ -39,8 +39,7 @@ symbian: SUBDIRS = \ xml contains(QT_CONFIG, multimedia) { - SUBDIRS += video - !static: SUBDIRS += multimedia + SUBDIRS += multimedia } contains(QT_CONFIG, script): SUBDIRS += script diff --git a/examples/multimedia/audio/audio.pro b/examples/multimedia/audio/audio.pro deleted file mode 100644 index c64bb34..0000000 --- a/examples/multimedia/audio/audio.pro +++ /dev/null @@ -1,10 +0,0 @@ -TEMPLATE = subdirs -SUBDIRS = audioinput \ - audiooutput \ - audiodevices - -# install -target.path = $$[QT_INSTALL_EXAMPLES]/multimedia/audio -sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS audio.pro README -sources.path = $$[QT_INSTALL_EXAMPLES]/multimedia/audio -INSTALLS += target sources diff --git a/examples/multimedia/audio/audiodevices/audiodevices.cpp b/examples/multimedia/audio/audiodevices/audiodevices.cpp deleted file mode 100644 index 4198605..0000000 --- a/examples/multimedia/audio/audiodevices/audiodevices.cpp +++ /dev/null @@ -1,274 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - - -#include -#include - -#include "audiodevices.h" - -AudioDevicesBase::AudioDevicesBase( QMainWindow *parent, Qt::WFlags f ) -{ - Q_UNUSED(parent) - Q_UNUSED(f) - setupUi( this ); -} - -AudioDevicesBase::~AudioDevicesBase() {} - - -AudioTest::AudioTest( QMainWindow *parent, Qt::WFlags f ) - : AudioDevicesBase( parent, f ) -{ - nearestFreq->setDisabled(true); - nearestChannel->setDisabled(true); - nearestCodec->setDisabled(true); - nearestSampleSize->setDisabled(true); - nearestSampleType->setDisabled(true); - nearestEndian->setDisabled(true); - logOutput->setDisabled(true); - - mode = QAudio::AudioOutput; - modeBox->addItem("Input"); - modeBox->addItem("Output"); - - connect(testButton,SIGNAL(clicked()),SLOT(test())); - connect(modeBox,SIGNAL(activated(int)),SLOT(modeChanged(int))); - connect(deviceBox,SIGNAL(activated(int)),SLOT(deviceChanged(int))); - connect(frequencyBox,SIGNAL(activated(int)),SLOT(freqChanged(int))); - connect(channelsBox,SIGNAL(activated(int)),SLOT(channelChanged(int))); - connect(codecsBox,SIGNAL(activated(int)),SLOT(codecChanged(int))); - connect(sampleSizesBox,SIGNAL(activated(int)),SLOT(sampleSizeChanged(int))); - connect(sampleTypesBox,SIGNAL(activated(int)),SLOT(sampleTypeChanged(int))); - connect(endianBox,SIGNAL(activated(int)),SLOT(endianChanged(int))); - - modeBox->setCurrentIndex(0); - modeChanged(0); - deviceBox->setCurrentIndex(0); - deviceChanged(0); -} - -AudioTest::~AudioTest() -{ -} - -void AudioTest::test() -{ - // tries to set all the settings picked. - logOutput->clear(); - logOutput->append("NOTE: an invalid codec audio/test exists for testing, to get a fail condition."); - - if (!deviceInfo.isNull()) { - if (deviceInfo.isFormatSupported(settings)) { - logOutput->append("Success"); - nearestFreq->setText(""); - nearestChannel->setText(""); - nearestCodec->setText(""); - nearestSampleSize->setText(""); - nearestSampleType->setText(""); - nearestEndian->setText(""); - } else { - QAudioFormat nearest = deviceInfo.nearestFormat(settings); - logOutput->append(tr("Failed")); - nearestFreq->setText(QString("%1").arg(nearest.frequency())); - nearestChannel->setText(QString("%1").arg(nearest.channels())); - nearestCodec->setText(nearest.codec()); - nearestSampleSize->setText(QString("%1").arg(nearest.sampleSize())); - - switch(nearest.sampleType()) { - case QAudioFormat::SignedInt: - nearestSampleType->setText("SignedInt"); - break; - case QAudioFormat::UnSignedInt: - nearestSampleType->setText("UnSignedInt"); - break; - case QAudioFormat::Float: - nearestSampleType->setText("Float"); - break; - case QAudioFormat::Unknown: - nearestSampleType->setText("Unknown"); - } - switch(nearest.byteOrder()) { - case QAudioFormat::LittleEndian: - nearestEndian->setText("LittleEndian"); - break; - case QAudioFormat::BigEndian: - nearestEndian->setText("BigEndian"); - } - } - } - else - logOutput->append("No Device"); -} - -void AudioTest::modeChanged(int idx) -{ - // mode has changed - if(idx == 0) - mode=QAudio::AudioInput; - else - mode=QAudio::AudioOutput; - - deviceBox->clear(); - foreach (const QAudioDeviceInfo &deviceInfo, QAudioDeviceInfo::deviceList(mode)) - deviceBox->addItem(deviceInfo.deviceName(), qVariantFromValue(deviceInfo)); -} - -void AudioTest::deviceChanged(int idx) -{ - if (deviceBox->count() == 0) - return; - - // device has changed - deviceInfo = deviceBox->itemData(idx).value(); - - frequencyBox->clear(); - QList freqz = deviceInfo.supportedFrequencies(); - for(int i = 0; i < freqz.size(); ++i) - frequencyBox->addItem(QString("%1").arg(freqz.at(i))); - if(freqz.size()) - settings.setFrequency(freqz.at(0)); - - channelsBox->clear(); - QList chz = deviceInfo.supportedChannels(); - for(int i = 0; i < chz.size(); ++i) - channelsBox->addItem(QString("%1").arg(chz.at(i))); - if(chz.size()) - settings.setChannels(chz.at(0)); - - codecsBox->clear(); - QStringList codecz = deviceInfo.supportedCodecs(); - for(int i = 0; i < codecz.size(); ++i) - codecsBox->addItem(QString("%1").arg(codecz.at(i))); - if(codecz.size()) - settings.setCodec(codecz.at(0)); - // Add false to create failed condition! - codecsBox->addItem("audio/test"); - - sampleSizesBox->clear(); - QList sampleSizez = deviceInfo.supportedSampleSizes(); - for(int i = 0; i < sampleSizez.size(); ++i) - sampleSizesBox->addItem(QString("%1").arg(sampleSizez.at(i))); - if(sampleSizez.size()) - settings.setSampleSize(sampleSizez.at(0)); - - sampleTypesBox->clear(); - QList sampleTypez = deviceInfo.supportedSampleTypes(); - for(int i = 0; i < sampleTypez.size(); ++i) { - switch(sampleTypez.at(i)) { - case QAudioFormat::SignedInt: - sampleTypesBox->addItem("SignedInt"); - break; - case QAudioFormat::UnSignedInt: - sampleTypesBox->addItem("UnSignedInt"); - break; - case QAudioFormat::Float: - sampleTypesBox->addItem("Float"); - break; - case QAudioFormat::Unknown: - sampleTypesBox->addItem("Unknown"); - } - if(sampleTypez.size()) - settings.setSampleType(sampleTypez.at(0)); - } - - endianBox->clear(); - QList endianz = deviceInfo.supportedByteOrders(); - for(int i = 0; i < endianz.size(); ++i) { - switch(endianz.at(i)) { - case QAudioFormat::LittleEndian: - endianBox->addItem("Little Endian"); - break; - case QAudioFormat::BigEndian: - endianBox->addItem("Big Endian"); - break; - } - } - if(endianz.size()) - settings.setByteOrder(endianz.at(0)); -} - -void AudioTest::freqChanged(int idx) -{ - // freq has changed - settings.setFrequency(frequencyBox->itemText(idx).toInt()); -} - -void AudioTest::channelChanged(int idx) -{ - settings.setChannels(channelsBox->itemText(idx).toInt()); -} - -void AudioTest::codecChanged(int idx) -{ - settings.setCodec(codecsBox->itemText(idx)); -} - -void AudioTest::sampleSizeChanged(int idx) -{ - settings.setSampleSize(sampleSizesBox->itemText(idx).toInt()); -} - -void AudioTest::sampleTypeChanged(int idx) -{ - switch(sampleTypesBox->itemText(idx).toInt()) { - case QAudioFormat::SignedInt: - settings.setSampleType(QAudioFormat::SignedInt); - break; - case QAudioFormat::UnSignedInt: - settings.setSampleType(QAudioFormat::UnSignedInt); - break; - case QAudioFormat::Float: - settings.setSampleType(QAudioFormat::Float); - } -} - -void AudioTest::endianChanged(int idx) -{ - switch(endianBox->itemText(idx).toInt()) { - case QAudioFormat::LittleEndian: - settings.setByteOrder(QAudioFormat::LittleEndian); - break; - case QAudioFormat::BigEndian: - settings.setByteOrder(QAudioFormat::BigEndian); - } -} - diff --git a/examples/multimedia/audio/audiodevices/audiodevices.h b/examples/multimedia/audio/audiodevices/audiodevices.h deleted file mode 100644 index 5fe5547..0000000 --- a/examples/multimedia/audio/audiodevices/audiodevices.h +++ /dev/null @@ -1,78 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - - -#include -#include -#include - -#include "ui_audiodevicesbase.h" - -class AudioDevicesBase : public QMainWindow, public Ui::AudioDevicesBase -{ -public: - AudioDevicesBase( QMainWindow *parent = 0, Qt::WFlags f = 0 ); - virtual ~AudioDevicesBase(); -}; - -class AudioTest : public AudioDevicesBase -{ - Q_OBJECT -public: - AudioTest( QMainWindow *parent = 0, Qt::WFlags f = 0 ); - virtual ~AudioTest(); - - QAudioDeviceInfo deviceInfo; - QAudioFormat settings; - QAudio::Mode mode; - -private slots: - void modeChanged(int idx); - void deviceChanged(int idx); - void freqChanged(int idx); - void channelChanged(int idx); - void codecChanged(int idx); - void sampleSizeChanged(int idx); - void sampleTypeChanged(int idx); - void endianChanged(int idx); - void test(); -}; - diff --git a/examples/multimedia/audio/audiodevices/audiodevices.pro b/examples/multimedia/audio/audiodevices/audiodevices.pro deleted file mode 100644 index 173aa8f..0000000 --- a/examples/multimedia/audio/audiodevices/audiodevices.pro +++ /dev/null @@ -1,17 +0,0 @@ -HEADERS = audiodevices.h -SOURCES = audiodevices.cpp \ - main.cpp -FORMS += audiodevicesbase.ui - -QT += multimedia - -# install -target.path = $$[QT_INSTALL_EXAMPLES]/multimedia/audio/audiodevices -sources.files = $$SOURCES *.h $$RESOURCES $$FORMS audiodevices.pro -sources.path = $$[QT_INSTALL_EXAMPLES]/multimedia/audio/audiodevices -INSTALLS += target sources - -symbian { - TARGET.UID3 = 0xA000D7BE - include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -} diff --git a/examples/multimedia/audio/audiodevices/audiodevicesbase.ui b/examples/multimedia/audio/audiodevices/audiodevicesbase.ui deleted file mode 100644 index 5207338..0000000 --- a/examples/multimedia/audio/audiodevices/audiodevicesbase.ui +++ /dev/null @@ -1,233 +0,0 @@ - - - AudioDevicesBase - - - - 0 - 0 - 504 - 702 - - - - AudioDevicesBase - - - - - - - - - - 1 - 0 - - - - Device - - - - - - - Mode - - - - - - - - - - - - - QFrame::Panel - - - QFrame::Raised - - - Actual Settings - - - Qt::AlignCenter - - - - - - - QFrame::Panel - - - QFrame::Raised - - - Nearest Settings - - - Qt::AlignCenter - - - - - - - Frequency - - - - - - - Frequency - - - - - - - - - - - - - Channels - - - - - - - Channel - - - - - - - - - - - - - Codecs - - - - - - - Codec - - - - - - - - - - - - - SampleSize - - - - - - - SampleSize - - - - - - - - - - - - - SampleType - - - - - - - SampleType - - - - - - - - - - - - - Endianess - - - - - - - Endianess - - - - - - - - - - - - - - 0 - 40 - - - - - - - - Test - - - - - - - - - - - 0 - 0 - 504 - 19 - - - - - - - - diff --git a/examples/multimedia/audio/audiodevices/main.cpp b/examples/multimedia/audio/audiodevices/main.cpp deleted file mode 100644 index d5ddd4f..0000000 --- a/examples/multimedia/audio/audiodevices/main.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -#include "audiodevices.h" - -int main(int argv, char **args) -{ - QApplication app(argv, args); - app.setApplicationName("Audio Device Test"); - - AudioTest audio; - audio.show(); - - return app.exec(); -} diff --git a/examples/multimedia/audio/audioinput/audioinput.cpp b/examples/multimedia/audio/audioinput/audioinput.cpp deleted file mode 100644 index 05723ae..0000000 --- a/examples/multimedia/audio/audioinput/audioinput.cpp +++ /dev/null @@ -1,296 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include - -#include -#include -#include - -#include -#include -#include "audioinput.h" - -#define BUFFER_SIZE 4096 - -AudioInfo::AudioInfo(QObject* parent, QAudioInput* device) - :QIODevice( parent ) -{ - input = device; - - m_maxValue = 0; -} - -AudioInfo::~AudioInfo() -{ -} - -void AudioInfo::start() -{ - open(QIODevice::WriteOnly); -} - -void AudioInfo::stop() -{ - close(); -} - -qint64 AudioInfo::readData(char *data, qint64 maxlen) -{ - Q_UNUSED(data) - Q_UNUSED(maxlen) - - return 0; -} - -qint64 AudioInfo::writeData(const char *data, qint64 len) -{ - int samples = len/2; // 2 bytes per sample - int maxAmp = 32768; // max for S16 samples - bool clipping = false; - - m_maxValue = 0; - - qint16* s = (qint16*)data; - - // sample format is S16LE, only! - - for(int i=0;i m_maxValue) m_maxValue = abs(sample); - } - // check for clipping - if(m_maxValue>=(maxAmp-1)) clipping = true; - - float value = ((float)m_maxValue/(float)maxAmp); - if(clipping) m_maxValue = 100; - else m_maxValue = (int)(value*100); - - emit update(); - - return len; -} - -int AudioInfo::LinearMax() -{ - return m_maxValue; -} - -RenderArea::RenderArea(QWidget *parent) - : QWidget(parent) -{ - setBackgroundRole(QPalette::Base); - setAutoFillBackground(true); - - level = 0; - setMinimumHeight(30); - setMinimumWidth(200); -} - -void RenderArea::paintEvent(QPaintEvent * /* event */) -{ - QPainter painter(this); - - painter.setPen(Qt::black); - painter.drawRect(QRect(painter.viewport().left()+10, painter.viewport().top()+10, - painter.viewport().right()-20, painter.viewport().bottom()-20)); - - if(level == 0) - return; - - painter.setPen(Qt::red); - - int pos = ((painter.viewport().right()-20)-(painter.viewport().left()+11))*level/100; - int x1,y1,x2,y2; - for(int i=0;i<10;i++) { - x1 = painter.viewport().left()+11; - y1 = painter.viewport().top()+10+i; - x2 = painter.viewport().left()+20+pos; - y2 = painter.viewport().top()+10+i; - if(x2 < painter.viewport().left()+10) - x2 = painter.viewport().left()+10; - - painter.drawLine(QPoint(x1,y1),QPoint(x2,y2)); - } -} - -void RenderArea::setLevel(int value) -{ - level = value; - repaint(); -} - - -InputTest::InputTest() -{ - QWidget *window = new QWidget; - QVBoxLayout* layout = new QVBoxLayout; - - canvas = new RenderArea; - layout->addWidget(canvas); - - deviceBox = new QComboBox(this); - QList devices = QAudioDeviceInfo::deviceList(QAudio::AudioInput); - for(int i = 0; i < devices.size(); ++i) { - deviceBox->addItem(devices.at(i).deviceName(), qVariantFromValue(devices.at(i))); - } - connect(deviceBox,SIGNAL(activated(int)),SLOT(deviceChanged(int))); - layout->addWidget(deviceBox); - - button = new QPushButton(this); - button->setText(tr("Click for Push Mode")); - connect(button,SIGNAL(clicked()),SLOT(toggleMode())); - layout->addWidget(button); - - button2 = new QPushButton(this); - button2->setText(tr("Click To Suspend")); - connect(button2,SIGNAL(clicked()),SLOT(toggleSuspend())); - layout->addWidget(button2); - - window->setLayout(layout); - setCentralWidget(window); - window->show(); - - buffer = new char[BUFFER_SIZE]; - - pullMode = true; - - // AudioInfo class only supports mono S16LE samples! - format.setFrequency(8000); - format.setChannels(1); - format.setSampleSize(16); - format.setSampleType(QAudioFormat::SignedInt); - format.setByteOrder(QAudioFormat::LittleEndian); - format.setCodec("audio/pcm"); - - audioInput = new QAudioInput(format,this); - connect(audioInput,SIGNAL(notify()),SLOT(status())); - connect(audioInput,SIGNAL(stateChanged(QAudio::State)),SLOT(state(QAudio::State))); - audioinfo = new AudioInfo(this,audioInput); - connect(audioinfo,SIGNAL(update()),SLOT(refreshDisplay())); - audioinfo->start(); - audioInput->start(audioinfo); -} - -InputTest::~InputTest() {} - -void InputTest::status() -{ - qWarning()<<"bytesReady = "<bytesReady()<<" bytes, clock = "<clock()<<"ms, totalTime = "<totalTime()/1000<<"ms"; -} - -void InputTest::readMore() -{ - if(!audioInput) - return; - qint64 len = audioInput->bytesReady(); - if(len > 4096) - len = 4096; - qint64 l = input->read(buffer,len); - if(l > 0) { - audioinfo->write(buffer,l); - } -} - -void InputTest::toggleMode() -{ - // Change bewteen pull and push modes - audioInput->stop(); - - if (pullMode) { - button->setText(tr("Click for Pull Mode")); - input = audioInput->start(0); - connect(input,SIGNAL(readyRead()),SLOT(readMore())); - pullMode = false; - } else { - button->setText(tr("Click for Push Mode")); - pullMode = true; - audioInput->start(audioinfo); - } -} - -void InputTest::toggleSuspend() -{ - // toggle suspend/resume - if(audioInput->state() == QAudio::SuspendState) { - qWarning()<<"status: Suspended, resume()"; - audioInput->resume(); - button2->setText("Click To Suspend"); - } else if (audioInput->state() == QAudio::ActiveState) { - qWarning()<<"status: Active, suspend()"; - audioInput->suspend(); - button2->setText("Click To Resume"); - } else if (audioInput->state() == QAudio::StopState) { - qWarning()<<"status: Stopped, resume()"; - audioInput->resume(); - button2->setText("Click To Suspend"); - } else if (audioInput->state() == QAudio::IdleState) { - qWarning()<<"status: IdleState"; - } -} - -void InputTest::state(QAudio::State state) -{ - qWarning()<<" state="<setLevel(audioinfo->LinearMax()); - canvas->repaint(); -} - -void InputTest::deviceChanged(int idx) -{ - audioinfo->stop(); - audioInput->stop(); - audioInput->disconnect(this); - delete audioInput; - - device = deviceBox->itemData(idx).value(); - audioInput = new QAudioInput(device, format, this); - connect(audioInput,SIGNAL(notify()),SLOT(status())); - connect(audioInput,SIGNAL(stateChanged(QAudio::State)),SLOT(state(QAudio::State))); - audioinfo->start(); - audioInput->start(audioinfo); -} diff --git a/examples/multimedia/audio/audioinput/audioinput.h b/examples/multimedia/audio/audioinput/audioinput.h deleted file mode 100644 index 14e1bac..0000000 --- a/examples/multimedia/audio/audioinput/audioinput.h +++ /dev/null @@ -1,124 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include -#include -#include -#include -#include - -#include - -class AudioInfo : public QIODevice -{ - Q_OBJECT -public: - AudioInfo(QObject* parent, QAudioInput* device); - ~AudioInfo(); - - void start(); - void stop(); - - int LinearMax(); - - qint64 readData(char *data, qint64 maxlen); - qint64 writeData(const char *data, qint64 len); - - QAudioInput* input; - -private: - int m_maxValue; - -signals: - void update(); -}; - - -class RenderArea : public QWidget -{ - Q_OBJECT - -public: - RenderArea(QWidget *parent = 0); - - void setLevel(int value); - -protected: - void paintEvent(QPaintEvent *event); - -private: - int level; - QPixmap pixmap; -}; - -class InputTest : public QMainWindow -{ - Q_OBJECT -public: - InputTest(); - ~InputTest(); - - QAudioDeviceInfo device; - QAudioFormat format; - QAudioInput* audioInput; - AudioInfo* audioinfo; - QIODevice* input; - RenderArea* canvas; - - bool pullMode; - - QPushButton* button; - QPushButton* button2; - QComboBox* deviceBox; - - char* buffer; - -private slots: - void refreshDisplay(); - void status(); - void readMore(); - void toggleMode(); - void toggleSuspend(); - void state(QAudio::State s); - void deviceChanged(int idx); -}; - diff --git a/examples/multimedia/audio/audioinput/audioinput.pro b/examples/multimedia/audio/audioinput/audioinput.pro deleted file mode 100644 index 0d6198d..0000000 --- a/examples/multimedia/audio/audioinput/audioinput.pro +++ /dev/null @@ -1,16 +0,0 @@ -HEADERS = audioinput.h -SOURCES = audioinput.cpp \ - main.cpp - -QT += multimedia - -# install -target.path = $$[QT_INSTALL_EXAMPLES]/multimedia/audio/audioinput -sources.files = $$SOURCES *.h $$RESOURCES $$FORMS audioinput.pro -sources.path = $$[QT_INSTALL_EXAMPLES]/multimedia/audio/audioinput -INSTALLS += target sources - -symbian { - TARGET.UID3 = 0xA000D7BF - include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -} diff --git a/examples/multimedia/audio/audioinput/main.cpp b/examples/multimedia/audio/audioinput/main.cpp deleted file mode 100644 index d7e9c6c..0000000 --- a/examples/multimedia/audio/audioinput/main.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -#include "audioinput.h" - -int main(int argv, char **args) -{ - QApplication app(argv, args); - app.setApplicationName("Audio Input Test"); - - InputTest input; - input.show(); - - return app.exec(); -} diff --git a/examples/multimedia/audio/audiooutput/audiooutput.cpp b/examples/multimedia/audio/audiooutput/audiooutput.cpp deleted file mode 100644 index 9e532cd..0000000 --- a/examples/multimedia/audio/audiooutput/audiooutput.cpp +++ /dev/null @@ -1,270 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include - -#include -#include -#include "audiooutput.h" - -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif - -#define SECONDS 1 -#define FREQ 600 -#define SYSTEM_FREQ 44100 - -Generator::Generator(QObject *parent) - :QIODevice( parent ) -{ - finished = false; - buffer = new char[SECONDS*SYSTEM_FREQ*4+1000]; - t=buffer; - len=fillData(t,FREQ,SECONDS); /* mono FREQHz sine */ - pos = 0; - total = len; -} - -Generator::~Generator() -{ - delete [] buffer; -} - -void Generator::start() -{ - open(QIODevice::ReadOnly); -} - -void Generator::stop() -{ - close(); -} - -int Generator::putShort(char *t, unsigned int value) -{ - *(unsigned char *)(t++)=value&255; - *(unsigned char *)(t)=(value/256)&255; - return 2; -} - -int Generator::fillData(char *start, int frequency, int seconds) -{ - int i, len=0; - int value; - for(i=0; i 16384) - len = 16384; - - if(len < (SECONDS*SYSTEM_FREQ*2)-pos) { - // Normal - memcpy(data,t+pos,len); - pos+=len; - return len; - } else { - // Whats left and reset to start - qint64 left = (SECONDS*SYSTEM_FREQ*2)-pos; - memcpy(data,t+pos,left); - pos=0; - return left; - } -} - -qint64 Generator::writeData(const char *data, qint64 len) -{ - Q_UNUSED(data); - Q_UNUSED(len); - - return 0; -} - -AudioTest::AudioTest() -{ - QWidget *window = new QWidget; - QVBoxLayout* layout = new QVBoxLayout; - - deviceBox = new QComboBox(this); - foreach (const QAudioDeviceInfo &deviceInfo, QAudioDeviceInfo::deviceList(QAudio::AudioOutput)) - deviceBox->addItem(deviceInfo.deviceName(), qVariantFromValue(deviceInfo)); - connect(deviceBox,SIGNAL(activated(int)),SLOT(deviceChanged(int))); - layout->addWidget(deviceBox); - - button = new QPushButton(this); - button->setText(tr("Click for Push Mode")); - connect(button,SIGNAL(clicked()),SLOT(toggle())); - layout->addWidget(button); - - button2 = new QPushButton(this); - button2->setText(tr("Click To Suspend")); - connect(button2,SIGNAL(clicked()),SLOT(togglePlay())); - layout->addWidget(button2); - - window->setLayout(layout); - setCentralWidget(window); - window->show(); - - buffer = new char[BUFFER_SIZE]; - - gen = new Generator(this); - - pullMode = true; - - timer = new QTimer(this); - connect(timer,SIGNAL(timeout()),SLOT(writeMore())); - - gen->start(); - - settings.setFrequency(SYSTEM_FREQ); - settings.setChannels(1); - settings.setSampleSize(16); - settings.setCodec("audio/pcm"); - settings.setByteOrder(QAudioFormat::LittleEndian); - settings.setSampleType(QAudioFormat::SignedInt); - audioOutput = new QAudioOutput(settings,this); - connect(audioOutput,SIGNAL(notify()),SLOT(status())); - connect(audioOutput,SIGNAL(stateChanged(QAudio::State)),SLOT(state(QAudio::State))); - - audioOutput->start(gen); -} - -AudioTest::~AudioTest() -{ - delete [] buffer; -} - -void AudioTest::deviceChanged(int idx) -{ - timer->stop(); - gen->stop(); - audioOutput->stop(); - audioOutput->disconnect(this); - delete audioOutput; - - device = deviceBox->itemData(idx).value(); - audioOutput = new QAudioOutput(device,settings,this); - connect(audioOutput,SIGNAL(notify()),SLOT(status())); - connect(audioOutput,SIGNAL(stateChanged(QAudio::State)),SLOT(state(QAudio::State))); - gen->start(); - audioOutput->start(gen); -} - -void AudioTest::status() -{ - qWarning()<<"byteFree = "<bytesFree()<<" bytes, clock = "<clock()<<"ms, totalTime = "<totalTime()/1000<<"ms"; -} - -void AudioTest::writeMore() -{ - if(!audioOutput) - return; - - if(audioOutput->state() == QAudio::StopState) - return; - - int l; - int out; - - int chunks = audioOutput->bytesFree()/audioOutput->periodSize(); - while(chunks) { - l = gen->read(buffer,audioOutput->periodSize()); - if(l > 0) - out = output->write(buffer,l); - if(l != audioOutput->periodSize()) - break; - chunks--; - } -} - -void AudioTest::toggle() -{ - // Change between pull and push modes - - timer->stop(); - audioOutput->stop(); - - if (pullMode) { - button->setText("Click for Pull Mode"); - output = audioOutput->start(0); - pullMode = false; - timer->start(20); - } else { - button->setText("Click for Push Mode"); - pullMode = true; - audioOutput->start(gen); - } -} - -void AudioTest::togglePlay() -{ - // toggle suspend/resume - if(audioOutput->state() == QAudio::SuspendState) { - qWarning()<<"status: Suspended, resume()"; - audioOutput->resume(); - button2->setText("Click To Suspend"); - } else if (audioOutput->state() == QAudio::ActiveState) { - qWarning()<<"status: Active, suspend()"; - audioOutput->suspend(); - button2->setText("Click To Resume"); - } else if (audioOutput->state() == QAudio::StopState) { - qWarning()<<"status: Stopped, resume()"; - audioOutput->resume(); - button2->setText("Click To Suspend"); - } else if (audioOutput->state() == QAudio::IdleState) { - qWarning()<<"status: IdleState"; - } -} - -void AudioTest::state(QAudio::State state) -{ - qWarning()<<" state="< - -#define BUFFER_SIZE 32768 - -#include -#include -#include -#include -#include -#include - -#include - -class Generator : public QIODevice -{ - Q_OBJECT -public: - Generator(QObject *parent); - ~Generator(); - - void start(); - void stop(); - - char *t; - int len; - int pos; - int total; - char *buffer; - bool finished; - int chunk_size; - - qint64 readData(char *data, qint64 maxlen); - qint64 writeData(const char *data, qint64 len); - -private: - int putShort(char *t, unsigned int value); - int fillData(char *start, int frequency, int seconds); -}; - -class AudioTest : public QMainWindow -{ - Q_OBJECT -public: - AudioTest(); - ~AudioTest(); - - QAudioDeviceInfo device; - Generator* gen; - QAudioOutput* audioOutput; - QIODevice* output; - QTimer* timer; - QAudioFormat settings; - - bool pullMode; - char* buffer; - - QPushButton* button; - QPushButton* button2; - QComboBox* deviceBox; - -private slots: - void status(); - void writeMore(); - void toggle(); - void togglePlay(); - void state(QAudio::State s); - void deviceChanged(int idx); -}; - diff --git a/examples/multimedia/audio/audiooutput/audiooutput.pro b/examples/multimedia/audio/audiooutput/audiooutput.pro deleted file mode 100644 index b43763c..0000000 --- a/examples/multimedia/audio/audiooutput/audiooutput.pro +++ /dev/null @@ -1,16 +0,0 @@ -HEADERS = audiooutput.h -SOURCES = audiooutput.cpp \ - main.cpp - -QT += multimedia - -# install -target.path = $$[QT_INSTALL_EXAMPLES]/multimedia/audio/audiooutput -sources.files = $$SOURCES *.h $$RESOURCES $$FORMS audiooutput.pro -sources.path = $$[QT_INSTALL_EXAMPLES]/multimedia/audio/audiooutput -INSTALLS += target sources - -symbian { - TARGET.UID3 = 0xA000D7C0 - include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -} diff --git a/examples/multimedia/audio/audiooutput/main.cpp b/examples/multimedia/audio/audiooutput/main.cpp deleted file mode 100644 index 79ec99e..0000000 --- a/examples/multimedia/audio/audiooutput/main.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - - -#include - -#include "audiooutput.h" - -int main(int argv, char **args) -{ - QApplication app(argv, args); - app.setApplicationName("Audio Output Test"); - - AudioTest audio; - audio.show(); - - return app.exec(); -} diff --git a/examples/multimedia/audiodevices/audiodevices.cpp b/examples/multimedia/audiodevices/audiodevices.cpp new file mode 100644 index 0000000..4198605 --- /dev/null +++ b/examples/multimedia/audiodevices/audiodevices.cpp @@ -0,0 +1,274 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#include +#include + +#include "audiodevices.h" + +AudioDevicesBase::AudioDevicesBase( QMainWindow *parent, Qt::WFlags f ) +{ + Q_UNUSED(parent) + Q_UNUSED(f) + setupUi( this ); +} + +AudioDevicesBase::~AudioDevicesBase() {} + + +AudioTest::AudioTest( QMainWindow *parent, Qt::WFlags f ) + : AudioDevicesBase( parent, f ) +{ + nearestFreq->setDisabled(true); + nearestChannel->setDisabled(true); + nearestCodec->setDisabled(true); + nearestSampleSize->setDisabled(true); + nearestSampleType->setDisabled(true); + nearestEndian->setDisabled(true); + logOutput->setDisabled(true); + + mode = QAudio::AudioOutput; + modeBox->addItem("Input"); + modeBox->addItem("Output"); + + connect(testButton,SIGNAL(clicked()),SLOT(test())); + connect(modeBox,SIGNAL(activated(int)),SLOT(modeChanged(int))); + connect(deviceBox,SIGNAL(activated(int)),SLOT(deviceChanged(int))); + connect(frequencyBox,SIGNAL(activated(int)),SLOT(freqChanged(int))); + connect(channelsBox,SIGNAL(activated(int)),SLOT(channelChanged(int))); + connect(codecsBox,SIGNAL(activated(int)),SLOT(codecChanged(int))); + connect(sampleSizesBox,SIGNAL(activated(int)),SLOT(sampleSizeChanged(int))); + connect(sampleTypesBox,SIGNAL(activated(int)),SLOT(sampleTypeChanged(int))); + connect(endianBox,SIGNAL(activated(int)),SLOT(endianChanged(int))); + + modeBox->setCurrentIndex(0); + modeChanged(0); + deviceBox->setCurrentIndex(0); + deviceChanged(0); +} + +AudioTest::~AudioTest() +{ +} + +void AudioTest::test() +{ + // tries to set all the settings picked. + logOutput->clear(); + logOutput->append("NOTE: an invalid codec audio/test exists for testing, to get a fail condition."); + + if (!deviceInfo.isNull()) { + if (deviceInfo.isFormatSupported(settings)) { + logOutput->append("Success"); + nearestFreq->setText(""); + nearestChannel->setText(""); + nearestCodec->setText(""); + nearestSampleSize->setText(""); + nearestSampleType->setText(""); + nearestEndian->setText(""); + } else { + QAudioFormat nearest = deviceInfo.nearestFormat(settings); + logOutput->append(tr("Failed")); + nearestFreq->setText(QString("%1").arg(nearest.frequency())); + nearestChannel->setText(QString("%1").arg(nearest.channels())); + nearestCodec->setText(nearest.codec()); + nearestSampleSize->setText(QString("%1").arg(nearest.sampleSize())); + + switch(nearest.sampleType()) { + case QAudioFormat::SignedInt: + nearestSampleType->setText("SignedInt"); + break; + case QAudioFormat::UnSignedInt: + nearestSampleType->setText("UnSignedInt"); + break; + case QAudioFormat::Float: + nearestSampleType->setText("Float"); + break; + case QAudioFormat::Unknown: + nearestSampleType->setText("Unknown"); + } + switch(nearest.byteOrder()) { + case QAudioFormat::LittleEndian: + nearestEndian->setText("LittleEndian"); + break; + case QAudioFormat::BigEndian: + nearestEndian->setText("BigEndian"); + } + } + } + else + logOutput->append("No Device"); +} + +void AudioTest::modeChanged(int idx) +{ + // mode has changed + if(idx == 0) + mode=QAudio::AudioInput; + else + mode=QAudio::AudioOutput; + + deviceBox->clear(); + foreach (const QAudioDeviceInfo &deviceInfo, QAudioDeviceInfo::deviceList(mode)) + deviceBox->addItem(deviceInfo.deviceName(), qVariantFromValue(deviceInfo)); +} + +void AudioTest::deviceChanged(int idx) +{ + if (deviceBox->count() == 0) + return; + + // device has changed + deviceInfo = deviceBox->itemData(idx).value(); + + frequencyBox->clear(); + QList freqz = deviceInfo.supportedFrequencies(); + for(int i = 0; i < freqz.size(); ++i) + frequencyBox->addItem(QString("%1").arg(freqz.at(i))); + if(freqz.size()) + settings.setFrequency(freqz.at(0)); + + channelsBox->clear(); + QList chz = deviceInfo.supportedChannels(); + for(int i = 0; i < chz.size(); ++i) + channelsBox->addItem(QString("%1").arg(chz.at(i))); + if(chz.size()) + settings.setChannels(chz.at(0)); + + codecsBox->clear(); + QStringList codecz = deviceInfo.supportedCodecs(); + for(int i = 0; i < codecz.size(); ++i) + codecsBox->addItem(QString("%1").arg(codecz.at(i))); + if(codecz.size()) + settings.setCodec(codecz.at(0)); + // Add false to create failed condition! + codecsBox->addItem("audio/test"); + + sampleSizesBox->clear(); + QList sampleSizez = deviceInfo.supportedSampleSizes(); + for(int i = 0; i < sampleSizez.size(); ++i) + sampleSizesBox->addItem(QString("%1").arg(sampleSizez.at(i))); + if(sampleSizez.size()) + settings.setSampleSize(sampleSizez.at(0)); + + sampleTypesBox->clear(); + QList sampleTypez = deviceInfo.supportedSampleTypes(); + for(int i = 0; i < sampleTypez.size(); ++i) { + switch(sampleTypez.at(i)) { + case QAudioFormat::SignedInt: + sampleTypesBox->addItem("SignedInt"); + break; + case QAudioFormat::UnSignedInt: + sampleTypesBox->addItem("UnSignedInt"); + break; + case QAudioFormat::Float: + sampleTypesBox->addItem("Float"); + break; + case QAudioFormat::Unknown: + sampleTypesBox->addItem("Unknown"); + } + if(sampleTypez.size()) + settings.setSampleType(sampleTypez.at(0)); + } + + endianBox->clear(); + QList endianz = deviceInfo.supportedByteOrders(); + for(int i = 0; i < endianz.size(); ++i) { + switch(endianz.at(i)) { + case QAudioFormat::LittleEndian: + endianBox->addItem("Little Endian"); + break; + case QAudioFormat::BigEndian: + endianBox->addItem("Big Endian"); + break; + } + } + if(endianz.size()) + settings.setByteOrder(endianz.at(0)); +} + +void AudioTest::freqChanged(int idx) +{ + // freq has changed + settings.setFrequency(frequencyBox->itemText(idx).toInt()); +} + +void AudioTest::channelChanged(int idx) +{ + settings.setChannels(channelsBox->itemText(idx).toInt()); +} + +void AudioTest::codecChanged(int idx) +{ + settings.setCodec(codecsBox->itemText(idx)); +} + +void AudioTest::sampleSizeChanged(int idx) +{ + settings.setSampleSize(sampleSizesBox->itemText(idx).toInt()); +} + +void AudioTest::sampleTypeChanged(int idx) +{ + switch(sampleTypesBox->itemText(idx).toInt()) { + case QAudioFormat::SignedInt: + settings.setSampleType(QAudioFormat::SignedInt); + break; + case QAudioFormat::UnSignedInt: + settings.setSampleType(QAudioFormat::UnSignedInt); + break; + case QAudioFormat::Float: + settings.setSampleType(QAudioFormat::Float); + } +} + +void AudioTest::endianChanged(int idx) +{ + switch(endianBox->itemText(idx).toInt()) { + case QAudioFormat::LittleEndian: + settings.setByteOrder(QAudioFormat::LittleEndian); + break; + case QAudioFormat::BigEndian: + settings.setByteOrder(QAudioFormat::BigEndian); + } +} + diff --git a/examples/multimedia/audiodevices/audiodevices.h b/examples/multimedia/audiodevices/audiodevices.h new file mode 100644 index 0000000..5fe5547 --- /dev/null +++ b/examples/multimedia/audiodevices/audiodevices.h @@ -0,0 +1,78 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#include +#include +#include + +#include "ui_audiodevicesbase.h" + +class AudioDevicesBase : public QMainWindow, public Ui::AudioDevicesBase +{ +public: + AudioDevicesBase( QMainWindow *parent = 0, Qt::WFlags f = 0 ); + virtual ~AudioDevicesBase(); +}; + +class AudioTest : public AudioDevicesBase +{ + Q_OBJECT +public: + AudioTest( QMainWindow *parent = 0, Qt::WFlags f = 0 ); + virtual ~AudioTest(); + + QAudioDeviceInfo deviceInfo; + QAudioFormat settings; + QAudio::Mode mode; + +private slots: + void modeChanged(int idx); + void deviceChanged(int idx); + void freqChanged(int idx); + void channelChanged(int idx); + void codecChanged(int idx); + void sampleSizeChanged(int idx); + void sampleTypeChanged(int idx); + void endianChanged(int idx); + void test(); +}; + diff --git a/examples/multimedia/audiodevices/audiodevices.pro b/examples/multimedia/audiodevices/audiodevices.pro new file mode 100644 index 0000000..232da09 --- /dev/null +++ b/examples/multimedia/audiodevices/audiodevices.pro @@ -0,0 +1,17 @@ +HEADERS = audiodevices.h +SOURCES = audiodevices.cpp \ + main.cpp +FORMS += audiodevicesbase.ui + +QT += multimedia + +# install +target.path = $$[QT_INSTALL_EXAMPLES]/multimedia/audiodevices +sources.files = $$SOURCES *.h $$RESOURCES $$FORMS audiodevices.pro +sources.path = $$[QT_INSTALL_EXAMPLES]/multimedia/audiodevices +INSTALLS += target sources + +symbian { + TARGET.UID3 = 0xA000D7BE + include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +} diff --git a/examples/multimedia/audiodevices/audiodevicesbase.ui b/examples/multimedia/audiodevices/audiodevicesbase.ui new file mode 100644 index 0000000..5207338 --- /dev/null +++ b/examples/multimedia/audiodevices/audiodevicesbase.ui @@ -0,0 +1,233 @@ + + + AudioDevicesBase + + + + 0 + 0 + 504 + 702 + + + + AudioDevicesBase + + + + + + + + + + 1 + 0 + + + + Device + + + + + + + Mode + + + + + + + + + + + + + QFrame::Panel + + + QFrame::Raised + + + Actual Settings + + + Qt::AlignCenter + + + + + + + QFrame::Panel + + + QFrame::Raised + + + Nearest Settings + + + Qt::AlignCenter + + + + + + + Frequency + + + + + + + Frequency + + + + + + + + + + + + + Channels + + + + + + + Channel + + + + + + + + + + + + + Codecs + + + + + + + Codec + + + + + + + + + + + + + SampleSize + + + + + + + SampleSize + + + + + + + + + + + + + SampleType + + + + + + + SampleType + + + + + + + + + + + + + Endianess + + + + + + + Endianess + + + + + + + + + + + + + + 0 + 40 + + + + + + + + Test + + + + + + + + + + + 0 + 0 + 504 + 19 + + + + + + + + diff --git a/examples/multimedia/audiodevices/main.cpp b/examples/multimedia/audiodevices/main.cpp new file mode 100644 index 0000000..d5ddd4f --- /dev/null +++ b/examples/multimedia/audiodevices/main.cpp @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +#include "audiodevices.h" + +int main(int argv, char **args) +{ + QApplication app(argv, args); + app.setApplicationName("Audio Device Test"); + + AudioTest audio; + audio.show(); + + return app.exec(); +} diff --git a/examples/multimedia/audioinput/audioinput.cpp b/examples/multimedia/audioinput/audioinput.cpp new file mode 100644 index 0000000..05723ae --- /dev/null +++ b/examples/multimedia/audioinput/audioinput.cpp @@ -0,0 +1,296 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include + +#include +#include +#include + +#include +#include +#include "audioinput.h" + +#define BUFFER_SIZE 4096 + +AudioInfo::AudioInfo(QObject* parent, QAudioInput* device) + :QIODevice( parent ) +{ + input = device; + + m_maxValue = 0; +} + +AudioInfo::~AudioInfo() +{ +} + +void AudioInfo::start() +{ + open(QIODevice::WriteOnly); +} + +void AudioInfo::stop() +{ + close(); +} + +qint64 AudioInfo::readData(char *data, qint64 maxlen) +{ + Q_UNUSED(data) + Q_UNUSED(maxlen) + + return 0; +} + +qint64 AudioInfo::writeData(const char *data, qint64 len) +{ + int samples = len/2; // 2 bytes per sample + int maxAmp = 32768; // max for S16 samples + bool clipping = false; + + m_maxValue = 0; + + qint16* s = (qint16*)data; + + // sample format is S16LE, only! + + for(int i=0;i m_maxValue) m_maxValue = abs(sample); + } + // check for clipping + if(m_maxValue>=(maxAmp-1)) clipping = true; + + float value = ((float)m_maxValue/(float)maxAmp); + if(clipping) m_maxValue = 100; + else m_maxValue = (int)(value*100); + + emit update(); + + return len; +} + +int AudioInfo::LinearMax() +{ + return m_maxValue; +} + +RenderArea::RenderArea(QWidget *parent) + : QWidget(parent) +{ + setBackgroundRole(QPalette::Base); + setAutoFillBackground(true); + + level = 0; + setMinimumHeight(30); + setMinimumWidth(200); +} + +void RenderArea::paintEvent(QPaintEvent * /* event */) +{ + QPainter painter(this); + + painter.setPen(Qt::black); + painter.drawRect(QRect(painter.viewport().left()+10, painter.viewport().top()+10, + painter.viewport().right()-20, painter.viewport().bottom()-20)); + + if(level == 0) + return; + + painter.setPen(Qt::red); + + int pos = ((painter.viewport().right()-20)-(painter.viewport().left()+11))*level/100; + int x1,y1,x2,y2; + for(int i=0;i<10;i++) { + x1 = painter.viewport().left()+11; + y1 = painter.viewport().top()+10+i; + x2 = painter.viewport().left()+20+pos; + y2 = painter.viewport().top()+10+i; + if(x2 < painter.viewport().left()+10) + x2 = painter.viewport().left()+10; + + painter.drawLine(QPoint(x1,y1),QPoint(x2,y2)); + } +} + +void RenderArea::setLevel(int value) +{ + level = value; + repaint(); +} + + +InputTest::InputTest() +{ + QWidget *window = new QWidget; + QVBoxLayout* layout = new QVBoxLayout; + + canvas = new RenderArea; + layout->addWidget(canvas); + + deviceBox = new QComboBox(this); + QList devices = QAudioDeviceInfo::deviceList(QAudio::AudioInput); + for(int i = 0; i < devices.size(); ++i) { + deviceBox->addItem(devices.at(i).deviceName(), qVariantFromValue(devices.at(i))); + } + connect(deviceBox,SIGNAL(activated(int)),SLOT(deviceChanged(int))); + layout->addWidget(deviceBox); + + button = new QPushButton(this); + button->setText(tr("Click for Push Mode")); + connect(button,SIGNAL(clicked()),SLOT(toggleMode())); + layout->addWidget(button); + + button2 = new QPushButton(this); + button2->setText(tr("Click To Suspend")); + connect(button2,SIGNAL(clicked()),SLOT(toggleSuspend())); + layout->addWidget(button2); + + window->setLayout(layout); + setCentralWidget(window); + window->show(); + + buffer = new char[BUFFER_SIZE]; + + pullMode = true; + + // AudioInfo class only supports mono S16LE samples! + format.setFrequency(8000); + format.setChannels(1); + format.setSampleSize(16); + format.setSampleType(QAudioFormat::SignedInt); + format.setByteOrder(QAudioFormat::LittleEndian); + format.setCodec("audio/pcm"); + + audioInput = new QAudioInput(format,this); + connect(audioInput,SIGNAL(notify()),SLOT(status())); + connect(audioInput,SIGNAL(stateChanged(QAudio::State)),SLOT(state(QAudio::State))); + audioinfo = new AudioInfo(this,audioInput); + connect(audioinfo,SIGNAL(update()),SLOT(refreshDisplay())); + audioinfo->start(); + audioInput->start(audioinfo); +} + +InputTest::~InputTest() {} + +void InputTest::status() +{ + qWarning()<<"bytesReady = "<bytesReady()<<" bytes, clock = "<clock()<<"ms, totalTime = "<totalTime()/1000<<"ms"; +} + +void InputTest::readMore() +{ + if(!audioInput) + return; + qint64 len = audioInput->bytesReady(); + if(len > 4096) + len = 4096; + qint64 l = input->read(buffer,len); + if(l > 0) { + audioinfo->write(buffer,l); + } +} + +void InputTest::toggleMode() +{ + // Change bewteen pull and push modes + audioInput->stop(); + + if (pullMode) { + button->setText(tr("Click for Pull Mode")); + input = audioInput->start(0); + connect(input,SIGNAL(readyRead()),SLOT(readMore())); + pullMode = false; + } else { + button->setText(tr("Click for Push Mode")); + pullMode = true; + audioInput->start(audioinfo); + } +} + +void InputTest::toggleSuspend() +{ + // toggle suspend/resume + if(audioInput->state() == QAudio::SuspendState) { + qWarning()<<"status: Suspended, resume()"; + audioInput->resume(); + button2->setText("Click To Suspend"); + } else if (audioInput->state() == QAudio::ActiveState) { + qWarning()<<"status: Active, suspend()"; + audioInput->suspend(); + button2->setText("Click To Resume"); + } else if (audioInput->state() == QAudio::StopState) { + qWarning()<<"status: Stopped, resume()"; + audioInput->resume(); + button2->setText("Click To Suspend"); + } else if (audioInput->state() == QAudio::IdleState) { + qWarning()<<"status: IdleState"; + } +} + +void InputTest::state(QAudio::State state) +{ + qWarning()<<" state="<setLevel(audioinfo->LinearMax()); + canvas->repaint(); +} + +void InputTest::deviceChanged(int idx) +{ + audioinfo->stop(); + audioInput->stop(); + audioInput->disconnect(this); + delete audioInput; + + device = deviceBox->itemData(idx).value(); + audioInput = new QAudioInput(device, format, this); + connect(audioInput,SIGNAL(notify()),SLOT(status())); + connect(audioInput,SIGNAL(stateChanged(QAudio::State)),SLOT(state(QAudio::State))); + audioinfo->start(); + audioInput->start(audioinfo); +} diff --git a/examples/multimedia/audioinput/audioinput.h b/examples/multimedia/audioinput/audioinput.h new file mode 100644 index 0000000..14e1bac --- /dev/null +++ b/examples/multimedia/audioinput/audioinput.h @@ -0,0 +1,124 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include +#include +#include +#include + +#include + +class AudioInfo : public QIODevice +{ + Q_OBJECT +public: + AudioInfo(QObject* parent, QAudioInput* device); + ~AudioInfo(); + + void start(); + void stop(); + + int LinearMax(); + + qint64 readData(char *data, qint64 maxlen); + qint64 writeData(const char *data, qint64 len); + + QAudioInput* input; + +private: + int m_maxValue; + +signals: + void update(); +}; + + +class RenderArea : public QWidget +{ + Q_OBJECT + +public: + RenderArea(QWidget *parent = 0); + + void setLevel(int value); + +protected: + void paintEvent(QPaintEvent *event); + +private: + int level; + QPixmap pixmap; +}; + +class InputTest : public QMainWindow +{ + Q_OBJECT +public: + InputTest(); + ~InputTest(); + + QAudioDeviceInfo device; + QAudioFormat format; + QAudioInput* audioInput; + AudioInfo* audioinfo; + QIODevice* input; + RenderArea* canvas; + + bool pullMode; + + QPushButton* button; + QPushButton* button2; + QComboBox* deviceBox; + + char* buffer; + +private slots: + void refreshDisplay(); + void status(); + void readMore(); + void toggleMode(); + void toggleSuspend(); + void state(QAudio::State s); + void deviceChanged(int idx); +}; + diff --git a/examples/multimedia/audioinput/audioinput.pro b/examples/multimedia/audioinput/audioinput.pro new file mode 100644 index 0000000..a54d452 --- /dev/null +++ b/examples/multimedia/audioinput/audioinput.pro @@ -0,0 +1,16 @@ +HEADERS = audioinput.h +SOURCES = audioinput.cpp \ + main.cpp + +QT += multimedia + +# install +target.path = $$[QT_INSTALL_EXAMPLES]/multimedia/audioinput +sources.files = $$SOURCES *.h $$RESOURCES $$FORMS audioinput.pro +sources.path = $$[QT_INSTALL_EXAMPLES]/multimedia/audioinput +INSTALLS += target sources + +symbian { + TARGET.UID3 = 0xA000D7BF + include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +} diff --git a/examples/multimedia/audioinput/main.cpp b/examples/multimedia/audioinput/main.cpp new file mode 100644 index 0000000..d7e9c6c --- /dev/null +++ b/examples/multimedia/audioinput/main.cpp @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +#include "audioinput.h" + +int main(int argv, char **args) +{ + QApplication app(argv, args); + app.setApplicationName("Audio Input Test"); + + InputTest input; + input.show(); + + return app.exec(); +} diff --git a/examples/multimedia/audiooutput/audiooutput.cpp b/examples/multimedia/audiooutput/audiooutput.cpp new file mode 100644 index 0000000..9e532cd --- /dev/null +++ b/examples/multimedia/audiooutput/audiooutput.cpp @@ -0,0 +1,270 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include + +#include +#include +#include "audiooutput.h" + +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#endif + +#define SECONDS 1 +#define FREQ 600 +#define SYSTEM_FREQ 44100 + +Generator::Generator(QObject *parent) + :QIODevice( parent ) +{ + finished = false; + buffer = new char[SECONDS*SYSTEM_FREQ*4+1000]; + t=buffer; + len=fillData(t,FREQ,SECONDS); /* mono FREQHz sine */ + pos = 0; + total = len; +} + +Generator::~Generator() +{ + delete [] buffer; +} + +void Generator::start() +{ + open(QIODevice::ReadOnly); +} + +void Generator::stop() +{ + close(); +} + +int Generator::putShort(char *t, unsigned int value) +{ + *(unsigned char *)(t++)=value&255; + *(unsigned char *)(t)=(value/256)&255; + return 2; +} + +int Generator::fillData(char *start, int frequency, int seconds) +{ + int i, len=0; + int value; + for(i=0; i 16384) + len = 16384; + + if(len < (SECONDS*SYSTEM_FREQ*2)-pos) { + // Normal + memcpy(data,t+pos,len); + pos+=len; + return len; + } else { + // Whats left and reset to start + qint64 left = (SECONDS*SYSTEM_FREQ*2)-pos; + memcpy(data,t+pos,left); + pos=0; + return left; + } +} + +qint64 Generator::writeData(const char *data, qint64 len) +{ + Q_UNUSED(data); + Q_UNUSED(len); + + return 0; +} + +AudioTest::AudioTest() +{ + QWidget *window = new QWidget; + QVBoxLayout* layout = new QVBoxLayout; + + deviceBox = new QComboBox(this); + foreach (const QAudioDeviceInfo &deviceInfo, QAudioDeviceInfo::deviceList(QAudio::AudioOutput)) + deviceBox->addItem(deviceInfo.deviceName(), qVariantFromValue(deviceInfo)); + connect(deviceBox,SIGNAL(activated(int)),SLOT(deviceChanged(int))); + layout->addWidget(deviceBox); + + button = new QPushButton(this); + button->setText(tr("Click for Push Mode")); + connect(button,SIGNAL(clicked()),SLOT(toggle())); + layout->addWidget(button); + + button2 = new QPushButton(this); + button2->setText(tr("Click To Suspend")); + connect(button2,SIGNAL(clicked()),SLOT(togglePlay())); + layout->addWidget(button2); + + window->setLayout(layout); + setCentralWidget(window); + window->show(); + + buffer = new char[BUFFER_SIZE]; + + gen = new Generator(this); + + pullMode = true; + + timer = new QTimer(this); + connect(timer,SIGNAL(timeout()),SLOT(writeMore())); + + gen->start(); + + settings.setFrequency(SYSTEM_FREQ); + settings.setChannels(1); + settings.setSampleSize(16); + settings.setCodec("audio/pcm"); + settings.setByteOrder(QAudioFormat::LittleEndian); + settings.setSampleType(QAudioFormat::SignedInt); + audioOutput = new QAudioOutput(settings,this); + connect(audioOutput,SIGNAL(notify()),SLOT(status())); + connect(audioOutput,SIGNAL(stateChanged(QAudio::State)),SLOT(state(QAudio::State))); + + audioOutput->start(gen); +} + +AudioTest::~AudioTest() +{ + delete [] buffer; +} + +void AudioTest::deviceChanged(int idx) +{ + timer->stop(); + gen->stop(); + audioOutput->stop(); + audioOutput->disconnect(this); + delete audioOutput; + + device = deviceBox->itemData(idx).value(); + audioOutput = new QAudioOutput(device,settings,this); + connect(audioOutput,SIGNAL(notify()),SLOT(status())); + connect(audioOutput,SIGNAL(stateChanged(QAudio::State)),SLOT(state(QAudio::State))); + gen->start(); + audioOutput->start(gen); +} + +void AudioTest::status() +{ + qWarning()<<"byteFree = "<bytesFree()<<" bytes, clock = "<clock()<<"ms, totalTime = "<totalTime()/1000<<"ms"; +} + +void AudioTest::writeMore() +{ + if(!audioOutput) + return; + + if(audioOutput->state() == QAudio::StopState) + return; + + int l; + int out; + + int chunks = audioOutput->bytesFree()/audioOutput->periodSize(); + while(chunks) { + l = gen->read(buffer,audioOutput->periodSize()); + if(l > 0) + out = output->write(buffer,l); + if(l != audioOutput->periodSize()) + break; + chunks--; + } +} + +void AudioTest::toggle() +{ + // Change between pull and push modes + + timer->stop(); + audioOutput->stop(); + + if (pullMode) { + button->setText("Click for Pull Mode"); + output = audioOutput->start(0); + pullMode = false; + timer->start(20); + } else { + button->setText("Click for Push Mode"); + pullMode = true; + audioOutput->start(gen); + } +} + +void AudioTest::togglePlay() +{ + // toggle suspend/resume + if(audioOutput->state() == QAudio::SuspendState) { + qWarning()<<"status: Suspended, resume()"; + audioOutput->resume(); + button2->setText("Click To Suspend"); + } else if (audioOutput->state() == QAudio::ActiveState) { + qWarning()<<"status: Active, suspend()"; + audioOutput->suspend(); + button2->setText("Click To Resume"); + } else if (audioOutput->state() == QAudio::StopState) { + qWarning()<<"status: Stopped, resume()"; + audioOutput->resume(); + button2->setText("Click To Suspend"); + } else if (audioOutput->state() == QAudio::IdleState) { + qWarning()<<"status: IdleState"; + } +} + +void AudioTest::state(QAudio::State state) +{ + qWarning()<<" state="< + +#define BUFFER_SIZE 32768 + +#include +#include +#include +#include +#include +#include + +#include + +class Generator : public QIODevice +{ + Q_OBJECT +public: + Generator(QObject *parent); + ~Generator(); + + void start(); + void stop(); + + char *t; + int len; + int pos; + int total; + char *buffer; + bool finished; + int chunk_size; + + qint64 readData(char *data, qint64 maxlen); + qint64 writeData(const char *data, qint64 len); + +private: + int putShort(char *t, unsigned int value); + int fillData(char *start, int frequency, int seconds); +}; + +class AudioTest : public QMainWindow +{ + Q_OBJECT +public: + AudioTest(); + ~AudioTest(); + + QAudioDeviceInfo device; + Generator* gen; + QAudioOutput* audioOutput; + QIODevice* output; + QTimer* timer; + QAudioFormat settings; + + bool pullMode; + char* buffer; + + QPushButton* button; + QPushButton* button2; + QComboBox* deviceBox; + +private slots: + void status(); + void writeMore(); + void toggle(); + void togglePlay(); + void state(QAudio::State s); + void deviceChanged(int idx); +}; + diff --git a/examples/multimedia/audiooutput/audiooutput.pro b/examples/multimedia/audiooutput/audiooutput.pro new file mode 100644 index 0000000..26f68fe --- /dev/null +++ b/examples/multimedia/audiooutput/audiooutput.pro @@ -0,0 +1,16 @@ +HEADERS = audiooutput.h +SOURCES = audiooutput.cpp \ + main.cpp + +QT += multimedia + +# install +target.path = $$[QT_INSTALL_EXAMPLES]/multimedia/audiooutput +sources.files = $$SOURCES *.h $$RESOURCES $$FORMS audiooutput.pro +sources.path = $$[QT_INSTALL_EXAMPLES]/multimedia/audiooutput +INSTALLS += target sources + +symbian { + TARGET.UID3 = 0xA000D7C0 + include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +} diff --git a/examples/multimedia/audiooutput/main.cpp b/examples/multimedia/audiooutput/main.cpp new file mode 100644 index 0000000..79ec99e --- /dev/null +++ b/examples/multimedia/audiooutput/main.cpp @@ -0,0 +1,56 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#include + +#include "audiooutput.h" + +int main(int argv, char **args) +{ + QApplication app(argv, args); + app.setApplicationName("Audio Output Test"); + + AudioTest audio; + audio.show(); + + return app.exec(); +} diff --git a/examples/multimedia/multimedia.pro b/examples/multimedia/multimedia.pro index ac78b15..4a764f2 100644 --- a/examples/multimedia/multimedia.pro +++ b/examples/multimedia/multimedia.pro @@ -1,5 +1,15 @@ -TEMPLATE = subdirs -SUBDIRS = audio +TEMPLATE = subdirs + +!static { + SUBDIRS += \ + audiodevices \ + audioinput \ + audiooutput +} + +SUBDIRS += \ + videographicsitem \ + videowidget # install target.path = $$[QT_INSTALL_EXAMPLES]/multimedia diff --git a/examples/multimedia/videographicsitem/main.cpp b/examples/multimedia/videographicsitem/main.cpp new file mode 100644 index 0000000..3bf4c6d --- /dev/null +++ b/examples/multimedia/videographicsitem/main.cpp @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "videoplayer.h" + +#include + +int main(int argc, char **argv) +{ + QApplication app(argc, argv); + + VideoPlayer player; + player.show(); + + return app.exec(); +} + diff --git a/examples/multimedia/videographicsitem/videographicsitem.pro b/examples/multimedia/videographicsitem/videographicsitem.pro new file mode 100644 index 0000000..7c118cc --- /dev/null +++ b/examples/multimedia/videographicsitem/videographicsitem.pro @@ -0,0 +1,21 @@ +QT += multimedia + +contains(QT_CONFIG, opengl): QT += opengl + +HEADERS += videoplayer.h \ + videoitem.h + +SOURCES += main.cpp \ + videoplayer.cpp \ + videoitem.cpp + +# install +target.path = $$[QT_INSTALL_EXAMPLES]/multimedia/videographicsitem +sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro *.png images +sources.path = $$[QT_INSTALL_EXAMPLES]/multimedia/videographicsitem +INSTALLS += target sources + +symbian { + TARGET.UID3 = 0xA000D7C2 + include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +} diff --git a/examples/multimedia/videographicsitem/videoitem.cpp b/examples/multimedia/videographicsitem/videoitem.cpp new file mode 100644 index 0000000..c95e335 --- /dev/null +++ b/examples/multimedia/videographicsitem/videoitem.cpp @@ -0,0 +1,144 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "videoitem.h" + +#include + +VideoItem::VideoItem(QGraphicsItem *parent) + : QGraphicsItem(parent) + , imageFormat(QImage::Format_Invalid) + , framePainted(false) +{ +} + +VideoItem::~VideoItem() +{ +} + +QRectF VideoItem::boundingRect() const +{ + return QRectF(QPointF(0,0), surfaceFormat().sizeHint()); +} + +void VideoItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) +{ + Q_UNUSED(option); + Q_UNUSED(widget); + + if (currentFrame.map(QAbstractVideoBuffer::ReadOnly)) { + const QTransform oldTransform = painter->transform(); + + if (surfaceFormat().scanLineDirection() == QVideoSurfaceFormat::BottomToTop) { + painter->scale(1, -1); + painter->translate(0, -boundingRect().height()); + } + + painter->drawImage(boundingRect(), QImage( + currentFrame.bits(), + imageSize.width(), + imageSize.height(), + imageFormat)); + + painter->setTransform(oldTransform); + + framePainted = true; + + currentFrame.unmap(); + } +} + +QList VideoItem::supportedPixelFormats( + QAbstractVideoBuffer::HandleType handleType) const +{ + if (handleType == QAbstractVideoBuffer::NoHandle) { + return QList() + << QVideoFrame::Format_RGB32 + << QVideoFrame::Format_ARGB32 + << QVideoFrame::Format_ARGB32_Premultiplied + << QVideoFrame::Format_RGB565 + << QVideoFrame::Format_RGB555; + } else { + return QList(); + } +} + +bool VideoItem::start(const QVideoSurfaceFormat &format) +{ + if (isFormatSupported(format)) { + imageFormat = QVideoFrame::equivalentImageFormat(format.pixelFormat()); + imageSize = format.frameSize(); + framePainted = true; + + QAbstractVideoSurface::start(format); + + prepareGeometryChange(); + + return true; + } else { + return false; + } +} + +void VideoItem::stop() +{ + currentFrame = QVideoFrame(); + framePainted = false; + + QAbstractVideoSurface::stop(); +} + +bool VideoItem::present(const QVideoFrame &frame) +{ + if (!framePainted) { + if (!isStarted()) + setError(StoppedError); + + return false; + } else { + currentFrame = frame; + framePainted = false; + + update(); + + return true; + } +} diff --git a/examples/multimedia/videographicsitem/videoitem.h b/examples/multimedia/videographicsitem/videoitem.h new file mode 100644 index 0000000..96f578a --- /dev/null +++ b/examples/multimedia/videographicsitem/videoitem.h @@ -0,0 +1,79 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef VIDEOITEM_H +#define VIDEOITEM_H + +#include +#include + +class VideoItem + : public QAbstractVideoSurface, + public QGraphicsItem +{ + Q_OBJECT + Q_INTERFACES(QGraphicsItem) +public: + explicit VideoItem(QGraphicsItem *parentItem = 0); + ~VideoItem(); + + QRectF boundingRect() const; + void paint( + QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); + + //video surface + QList supportedPixelFormats( + QAbstractVideoBuffer::HandleType handleType = QAbstractVideoBuffer::NoHandle) const; + + bool start(const QVideoSurfaceFormat &format); + void stop(); + bool present(const QVideoFrame &frame); + +private: + QImage::Format imageFormat; + QSize imageSize; + + QVideoFrame currentFrame; + bool framePainted; +}; + +#endif + diff --git a/examples/multimedia/videographicsitem/videoplayer.cpp b/examples/multimedia/videographicsitem/videoplayer.cpp new file mode 100644 index 0000000..83644db --- /dev/null +++ b/examples/multimedia/videographicsitem/videoplayer.cpp @@ -0,0 +1,210 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "videoplayer.h" +#include "videoitem.h" + +#include + +#ifndef QT_NO_OPENGL +# include +#endif + +VideoPlayer::VideoPlayer(QWidget *parent, Qt::WindowFlags flags) + : QWidget(parent, flags) + , videoItem(0) + , playButton(0) + , positionSlider(0) +{ + connect(&movie, SIGNAL(stateChanged(QMovie::MovieState)), + this, SLOT(movieStateChanged(QMovie::MovieState))); + connect(&movie, SIGNAL(frameChanged(int)), + this, SLOT(frameChanged(int))); + + videoItem = new VideoItem; + + QGraphicsScene *scene = new QGraphicsScene(this); + QGraphicsView *graphicsView = new QGraphicsView(scene); + +#ifndef QT_NO_OPENGL + graphicsView->setViewport(new QGLWidget); +#endif + + scene->addItem(videoItem); + + QSlider *rotateSlider = new QSlider(Qt::Horizontal); + rotateSlider->setRange(-180, 180); + rotateSlider->setValue(0); + + connect(rotateSlider, SIGNAL(valueChanged(int)), + this, SLOT(rotateVideo(int))); + + QAbstractButton *openButton = new QPushButton(tr("Open...")); + connect(openButton, SIGNAL(clicked()), this, SLOT(openFile())); + + playButton = new QPushButton; + playButton->setEnabled(false); + playButton->setIcon(style()->standardIcon(QStyle::SP_MediaPlay)); + + connect(playButton, SIGNAL(clicked()), + this, SLOT(play())); + + positionSlider = new QSlider(Qt::Horizontal); + positionSlider->setRange(0, 0); + + connect(positionSlider, SIGNAL(sliderMoved(int)), + this, SLOT(setPosition(int))); + + connect(&movie, SIGNAL(frameChanged(int)), + positionSlider, SLOT(setValue(int))); + + QBoxLayout *controlLayout = new QHBoxLayout; + controlLayout->setMargin(0); + controlLayout->addWidget(openButton); + controlLayout->addWidget(playButton); + controlLayout->addWidget(positionSlider); + + QBoxLayout *layout = new QVBoxLayout; + layout->addWidget(graphicsView); + layout->addWidget(rotateSlider); + layout->addLayout(controlLayout); + + setLayout(layout); +} + +VideoPlayer::~VideoPlayer() +{ +} + +void VideoPlayer::openFile() +{ + QString fileName = QFileDialog::getOpenFileName(this, tr("Open Movie")); + + if (!fileName.isEmpty()) { + if (videoItem->isStarted()) + videoItem->stop(); + + movie.setFileName(fileName); + + playButton->setEnabled(true); + positionSlider->setMaximum(movie.frameCount()); + + movie.jumpToFrame(0); + } +} + +void VideoPlayer::play() +{ + switch(movie.state()) { + case QMovie::NotRunning: + movie.start(); + break; + case QMovie::Paused: + movie.setPaused(false); + break; + case QMovie::Running: + movie.setPaused(true); + break; + } +} + +void VideoPlayer::movieStateChanged(QMovie::MovieState state) +{ + switch(state) { + case QMovie::NotRunning: + case QMovie::Paused: + playButton->setIcon(style()->standardIcon(QStyle::SP_MediaPlay)); + break; + case QMovie::Running: + playButton->setIcon(style()->standardIcon(QStyle::SP_MediaPause)); + break; + } +} + +void VideoPlayer::frameChanged(int frame) +{ + if (!presentImage(movie.currentImage())) { + movie.stop(); + playButton->setEnabled(false); + positionSlider->setMaximum(0); + } else { + positionSlider->setValue(frame); + } +} + +void VideoPlayer::setPosition(int frame) +{ + movie.jumpToFrame(frame); +} + +void VideoPlayer::rotateVideo(int angle) +{ + //rotate around the center of video element + qreal x = videoItem->boundingRect().width() / 2.0; + qreal y = videoItem->boundingRect().height() / 2.0; + videoItem->setTransform(QTransform().translate(x, y).rotate(angle).translate(-x, -y)); +} + +bool VideoPlayer::presentImage(const QImage &image) +{ + QVideoFrame frame(image); + + if (!frame.isValid()) + return false; + + QVideoSurfaceFormat currentFormat = videoItem->surfaceFormat(); + + if (frame.pixelFormat() != currentFormat.pixelFormat() + || frame.size() != currentFormat.frameSize()) { + QVideoSurfaceFormat format(frame.size(), frame.pixelFormat()); + + if (!videoItem->start(format)) + return false; + } + + if (!videoItem->present(frame)) { + videoItem->stop(); + + return false; + } else { + return true; + } +} diff --git a/examples/multimedia/videographicsitem/videoplayer.h b/examples/multimedia/videographicsitem/videoplayer.h new file mode 100644 index 0000000..8e73e4c --- /dev/null +++ b/examples/multimedia/videographicsitem/videoplayer.h @@ -0,0 +1,86 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef VIDEOPLAYER_H +#define VIDEOPLAYER_H + +#include +#include + +QT_BEGIN_NAMESPACE +class QAbstractButton; +class QAbstractVideoSurface; +class QSlider; +QT_END_NAMESPACE + + +class VideoItem; + +class VideoPlayer : public QWidget +{ + Q_OBJECT +public: + VideoPlayer(QWidget *parent = 0, Qt::WindowFlags flags = 0); + ~VideoPlayer(); + + QSize sizeHint() const { return QSize(800, 600); } + +public slots: + void openFile(); + void play(); + +private slots: + void movieStateChanged(QMovie::MovieState state); + void frameChanged(int frame); + void setPosition(int frame); + void rotateVideo(int angle); + +private: + bool presentImage(const QImage &image); + + QMovie movie; + VideoItem *videoItem; + QAbstractButton *playButton; + QSlider *positionSlider; +}; + +#endif + diff --git a/examples/multimedia/videowidget/main.cpp b/examples/multimedia/videowidget/main.cpp new file mode 100644 index 0000000..f5edf73 --- /dev/null +++ b/examples/multimedia/videowidget/main.cpp @@ -0,0 +1,54 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "videoplayer.h" + +#include + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + VideoPlayer player; + player.show(); + + return app.exec(); +} diff --git a/examples/multimedia/videowidget/videoplayer.cpp b/examples/multimedia/videowidget/videoplayer.cpp new file mode 100644 index 0000000..ed24714 --- /dev/null +++ b/examples/multimedia/videowidget/videoplayer.cpp @@ -0,0 +1,183 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "videoplayer.h" + +#include "videowidget.h" + +#include + +VideoPlayer::VideoPlayer(QWidget *parent) + : QWidget(parent) + , surface(0) + , playButton(0) + , positionSlider(0) +{ + connect(&movie, SIGNAL(stateChanged(QMovie::MovieState)), + this, SLOT(movieStateChanged(QMovie::MovieState))); + connect(&movie, SIGNAL(frameChanged(int)), + this, SLOT(frameChanged(int))); + + VideoWidget *videoWidget = new VideoWidget; + surface = videoWidget->videoSurface(); + + QAbstractButton *openButton = new QPushButton(tr("Open...")); + connect(openButton, SIGNAL(clicked()), this, SLOT(openFile())); + + playButton = new QPushButton; + playButton->setEnabled(false); + playButton->setIcon(style()->standardIcon(QStyle::SP_MediaPlay)); + + connect(playButton, SIGNAL(clicked()), + this, SLOT(play())); + + positionSlider = new QSlider(Qt::Horizontal); + positionSlider->setRange(0, 0); + + connect(positionSlider, SIGNAL(sliderMoved(int)), + this, SLOT(setPosition(int))); + + connect(&movie, SIGNAL(frameChanged(int)), + positionSlider, SLOT(setValue(int))); + + QBoxLayout *controlLayout = new QHBoxLayout; + controlLayout->setMargin(0); + controlLayout->addWidget(openButton); + controlLayout->addWidget(playButton); + controlLayout->addWidget(positionSlider); + + QBoxLayout *layout = new QVBoxLayout; + layout->addWidget(videoWidget); + layout->addLayout(controlLayout); + + setLayout(layout); +} + +VideoPlayer::~VideoPlayer() +{ +} + +void VideoPlayer::openFile() +{ + QString fileName = QFileDialog::getOpenFileName(this, tr("Open Movie")); + + if (!fileName.isEmpty()) { + if (surface->isStarted()) + surface->stop(); + + movie.setFileName(fileName); + + playButton->setEnabled(true); + positionSlider->setMaximum(movie.frameCount()); + + movie.jumpToFrame(0); + } +} + +void VideoPlayer::play() +{ + switch(movie.state()) { + case QMovie::NotRunning: + movie.start(); + break; + case QMovie::Paused: + movie.setPaused(false); + break; + case QMovie::Running: + movie.setPaused(true); + break; + } +} + +void VideoPlayer::movieStateChanged(QMovie::MovieState state) +{ + switch(state) { + case QMovie::NotRunning: + case QMovie::Paused: + playButton->setIcon(style()->standardIcon(QStyle::SP_MediaPlay)); + break; + case QMovie::Running: + playButton->setIcon(style()->standardIcon(QStyle::SP_MediaPause)); + break; + } +} + +void VideoPlayer::frameChanged(int frame) +{ + if (!presentImage(movie.currentImage())) { + movie.stop(); + playButton->setEnabled(false); + positionSlider->setMaximum(0); + } else { + positionSlider->setValue(frame); + } +} + +void VideoPlayer::setPosition(int frame) +{ + movie.jumpToFrame(frame); +} + +bool VideoPlayer::presentImage(const QImage &image) +{ + QVideoFrame frame(image); + + if (!frame.isValid()) + return false; + + QVideoSurfaceFormat currentFormat = surface->surfaceFormat(); + + if (frame.pixelFormat() != currentFormat.pixelFormat() + || frame.size() != currentFormat.frameSize()) { + QVideoSurfaceFormat format(frame.size(), frame.pixelFormat()); + + if (!surface->start(format)) + return false; + } + + if (!surface->present(frame)) { + surface->stop(); + + return false; + } else { + return true; + } +} diff --git a/examples/multimedia/videowidget/videoplayer.h b/examples/multimedia/videowidget/videoplayer.h new file mode 100644 index 0000000..6547415 --- /dev/null +++ b/examples/multimedia/videowidget/videoplayer.h @@ -0,0 +1,79 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef VIDEOPLAYER_H +#define VIDEOPLAYER_H + +#include +#include + +QT_BEGIN_NAMESPACE +class QAbstractButton; +class QAbstractVideoSurface; +class QSlider; +QT_END_NAMESPACE + +class VideoPlayer : public QWidget +{ + Q_OBJECT +public: + VideoPlayer(QWidget *parent = 0); + ~VideoPlayer(); + +public slots: + void openFile(); + void play(); + +private slots: + void movieStateChanged(QMovie::MovieState state); + void frameChanged(int frame); + void setPosition(int frame); + +private: + bool presentImage(const QImage &image); + + QMovie movie; + QAbstractVideoSurface *surface; + QAbstractButton *playButton; + QSlider *positionSlider; +}; + +#endif diff --git a/examples/multimedia/videowidget/videowidget.cpp b/examples/multimedia/videowidget/videowidget.cpp new file mode 100644 index 0000000..80688e1 --- /dev/null +++ b/examples/multimedia/videowidget/videowidget.cpp @@ -0,0 +1,114 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "videowidget.h" + +#include "videowidgetsurface.h" + +#include + +//! [0] +VideoWidget::VideoWidget(QWidget *parent) + : QWidget(parent) + , surface(0) +{ + setAutoFillBackground(false); + setAttribute(Qt::WA_NoSystemBackground, true); + setAttribute(Qt::WA_PaintOnScreen, true); + + QPalette palette = this->palette(); + palette.setColor(QPalette::Background, Qt::black); + setPalette(palette); + + setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); + + surface = new VideoWidgetSurface(this); +} +//! [0] + +//! [1] +VideoWidget::~VideoWidget() +{ + delete surface; +} +//! [1] + +//! [2] +QSize VideoWidget::sizeHint() const +{ + return surface->surfaceFormat().sizeHint(); +} +//! [2] + + +//! [3] +void VideoWidget::paintEvent(QPaintEvent *event) +{ + QPainter painter(this); + + if (surface->isStarted()) { + const QRect videoRect = surface->videoRect(); + + if (!videoRect.contains(event->rect())) { + QRegion region = event->region(); + region.subtract(videoRect); + + QBrush brush = palette().background(); + + foreach (const QRect &rect, region.rects()) + painter.fillRect(rect, brush); + } + + surface->paint(&painter); + } else { + painter.fillRect(event->rect(), palette().background()); + } +} +//! [3] + +//! [4] +void VideoWidget::resizeEvent(QResizeEvent *event) +{ + QWidget::resizeEvent(event); + + surface->updateVideoRect(); +} +//! [4] diff --git a/examples/multimedia/videowidget/videowidget.h b/examples/multimedia/videowidget/videowidget.h new file mode 100644 index 0000000..8c343bf --- /dev/null +++ b/examples/multimedia/videowidget/videowidget.h @@ -0,0 +1,76 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef VIDEOWIDGET_H +#define VIDEOWIDGET_H + +#include "videowidgetsurface.h" + +#include + +QT_BEGIN_NAMESPACE +class QAbstractVideoSurface; +QT_END_NAMESPACE + +class VideoWidgetSurface; + +//! [0] +class VideoWidget : public QWidget +{ + Q_OBJECT +public: + VideoWidget(QWidget *parent = 0); + ~VideoWidget(); + + QAbstractVideoSurface *videoSurface() const { return surface; } + + QSize sizeHint() const; + +protected: + void paintEvent(QPaintEvent *event); + void resizeEvent(QResizeEvent *event); + +private: + VideoWidgetSurface *surface; +}; +//! [0] + +#endif diff --git a/examples/multimedia/videowidget/videowidget.pro b/examples/multimedia/videowidget/videowidget.pro new file mode 100644 index 0000000..3f93745 --- /dev/null +++ b/examples/multimedia/videowidget/videowidget.pro @@ -0,0 +1,25 @@ +TEMPLATE = app + +QT += multimedia + +HEADERS = \ + videoplayer.h \ + videowidget.h \ + videowidgetsurface.h + +SOURCES = \ + main.cpp \ + videoplayer.cpp \ + videowidget.cpp \ + videowidgetsurface.cpp + +# install +target.path = $$[QT_INSTALL_EXAMPLES]/multimedia/videowidget +sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro *.png images +sources.path = $$[QT_INSTALL_EXAMPLES]/multimedia/videowidget +INSTALLS += target sources + +symbian { + TARGET.UID3 = 0xA000D7C3 + include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +} diff --git a/examples/multimedia/videowidget/videowidgetsurface.cpp b/examples/multimedia/videowidget/videowidgetsurface.cpp new file mode 100644 index 0000000..ec9b8b5 --- /dev/null +++ b/examples/multimedia/videowidget/videowidgetsurface.cpp @@ -0,0 +1,175 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "videowidgetsurface.h" + +#include + +VideoWidgetSurface::VideoWidgetSurface(QWidget *widget, QObject *parent) + : QAbstractVideoSurface(parent) + , widget(widget) + , imageFormat(QImage::Format_Invalid) +{ +} + +//! [0] +QList VideoWidgetSurface::supportedPixelFormats( + QAbstractVideoBuffer::HandleType handleType) const +{ + if (handleType == QAbstractVideoBuffer::NoHandle) { + return QList() + << QVideoFrame::Format_RGB32 + << QVideoFrame::Format_ARGB32 + << QVideoFrame::Format_ARGB32_Premultiplied + << QVideoFrame::Format_RGB565 + << QVideoFrame::Format_RGB555; + } else { + return QList(); + } +} +//! [0] + +//! [1] +bool VideoWidgetSurface::isFormatSupported( + const QVideoSurfaceFormat &format, QVideoSurfaceFormat *similar) const +{ + Q_UNUSED(similar); + + const QImage::Format imageFormat = QVideoFrame::equivalentImageFormat(format.pixelFormat()); + const QSize size = format.frameSize(); + + return imageFormat != QImage::Format_Invalid + && !size.isEmpty() + && format.handleType() == QAbstractVideoBuffer::NoHandle; +} +//! [1] + +//! [2] +bool VideoWidgetSurface::start(const QVideoSurfaceFormat &format) +{ + const QImage::Format imageFormat = QVideoFrame::equivalentImageFormat(format.pixelFormat()); + const QSize size = format.frameSize(); + + if (imageFormat != QImage::Format_Invalid && !size.isEmpty()) { + this->imageFormat = imageFormat; + imageSize = size; + sourceRect = format.viewport(); + + QAbstractVideoSurface::start(format); + + widget->updateGeometry(); + updateVideoRect(); + + return true; + } else { + return false; + } +} +//! [2] + +//! [3] +void VideoWidgetSurface::stop() +{ + currentFrame = QVideoFrame(); + targetRect = QRect(); + + QAbstractVideoSurface::stop(); + + widget->update(); +} +//! [3] + +//! [4] +bool VideoWidgetSurface::present(const QVideoFrame &frame) +{ + if (surfaceFormat().pixelFormat() != frame.pixelFormat() + || surfaceFormat().frameSize() != frame.size()) { + setError(IncorrectFormatError); + stop(); + + return false; + } else { + currentFrame = frame; + + widget->repaint(targetRect); + + return true; + } +} +//! [4] + +//! [5] +void VideoWidgetSurface::updateVideoRect() +{ + QSize size = surfaceFormat().sizeHint(); + size.scale(widget->size().boundedTo(size), Qt::KeepAspectRatio); + + targetRect = QRect(QPoint(0, 0), size); + targetRect.moveCenter(widget->rect().center()); +} +//! [5] + +//! [6] +void VideoWidgetSurface::paint(QPainter *painter) +{ + if (currentFrame.map(QAbstractVideoBuffer::ReadOnly)) { + const QTransform oldTransform = painter->transform(); + + if (surfaceFormat().scanLineDirection() == QVideoSurfaceFormat::BottomToTop) { + painter->scale(1, -1); + painter->translate(0, -widget->height()); + } + + QImage image( + currentFrame.bits(), + currentFrame.width(), + currentFrame.height(), + currentFrame.bytesPerLine(), + imageFormat); + + painter->drawImage(targetRect, image, sourceRect); + + painter->setTransform(oldTransform); + + currentFrame.unmap(); + } +} +//! [6] diff --git a/examples/multimedia/videowidget/videowidgetsurface.h b/examples/multimedia/videowidget/videowidgetsurface.h new file mode 100644 index 0000000..83439d3 --- /dev/null +++ b/examples/multimedia/videowidget/videowidgetsurface.h @@ -0,0 +1,81 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef VIDEOWIDGETSURFACE_H +#define VIDEOWIDGETSURFACE_H + +#include +#include +#include +#include + +//! [0] +class VideoWidgetSurface : public QAbstractVideoSurface +{ + Q_OBJECT +public: + VideoWidgetSurface(QWidget *widget, QObject *parent = 0); + + QList supportedPixelFormats( + QAbstractVideoBuffer::HandleType handleType = QAbstractVideoBuffer::NoHandle) const; + bool isFormatSupported(const QVideoSurfaceFormat &format, QVideoSurfaceFormat *similar) const; + + bool start(const QVideoSurfaceFormat &format); + void stop(); + + bool present(const QVideoFrame &frame); + + QRect videoRect() const { return targetRect; } + void updateVideoRect(); + + void paint(QPainter *painter); + +private: + QWidget *widget; + QImage::Format imageFormat; + QRect targetRect; + QSize imageSize; + QRect sourceRect; + QVideoFrame currentFrame; +}; +//! [0] + +#endif diff --git a/examples/video/video.pro b/examples/video/video.pro deleted file mode 100644 index f0b63b6..0000000 --- a/examples/video/video.pro +++ /dev/null @@ -1,6 +0,0 @@ -TEMPLATE = subdirs - -SUBDIRS += \ - videographicsitem \ - videowidget - diff --git a/examples/video/videographicsitem/main.cpp b/examples/video/videographicsitem/main.cpp deleted file mode 100644 index 3bf4c6d..0000000 --- a/examples/video/videographicsitem/main.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "videoplayer.h" - -#include - -int main(int argc, char **argv) -{ - QApplication app(argc, argv); - - VideoPlayer player; - player.show(); - - return app.exec(); -} - diff --git a/examples/video/videographicsitem/videographicsitem.pro b/examples/video/videographicsitem/videographicsitem.pro deleted file mode 100644 index d79c3fb..0000000 --- a/examples/video/videographicsitem/videographicsitem.pro +++ /dev/null @@ -1,21 +0,0 @@ -QT += multimedia - -contains(QT_CONFIG, opengl): QT += opengl - -HEADERS += videoplayer.h \ - videoitem.h - -SOURCES += main.cpp \ - videoplayer.cpp \ - videoitem.cpp - -# install -target.path = $$[QT_INSTALL_EXAMPLES]/video/videographicsitem -sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro *.png images -sources.path = $$[QT_INSTALL_EXAMPLES]/video/videographicsitem -INSTALLS += target sources - -symbian { - TARGET.UID3 = 0xA000D7C2 - include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -} diff --git a/examples/video/videographicsitem/videoitem.cpp b/examples/video/videographicsitem/videoitem.cpp deleted file mode 100644 index c95e335..0000000 --- a/examples/video/videographicsitem/videoitem.cpp +++ /dev/null @@ -1,144 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "videoitem.h" - -#include - -VideoItem::VideoItem(QGraphicsItem *parent) - : QGraphicsItem(parent) - , imageFormat(QImage::Format_Invalid) - , framePainted(false) -{ -} - -VideoItem::~VideoItem() -{ -} - -QRectF VideoItem::boundingRect() const -{ - return QRectF(QPointF(0,0), surfaceFormat().sizeHint()); -} - -void VideoItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) -{ - Q_UNUSED(option); - Q_UNUSED(widget); - - if (currentFrame.map(QAbstractVideoBuffer::ReadOnly)) { - const QTransform oldTransform = painter->transform(); - - if (surfaceFormat().scanLineDirection() == QVideoSurfaceFormat::BottomToTop) { - painter->scale(1, -1); - painter->translate(0, -boundingRect().height()); - } - - painter->drawImage(boundingRect(), QImage( - currentFrame.bits(), - imageSize.width(), - imageSize.height(), - imageFormat)); - - painter->setTransform(oldTransform); - - framePainted = true; - - currentFrame.unmap(); - } -} - -QList VideoItem::supportedPixelFormats( - QAbstractVideoBuffer::HandleType handleType) const -{ - if (handleType == QAbstractVideoBuffer::NoHandle) { - return QList() - << QVideoFrame::Format_RGB32 - << QVideoFrame::Format_ARGB32 - << QVideoFrame::Format_ARGB32_Premultiplied - << QVideoFrame::Format_RGB565 - << QVideoFrame::Format_RGB555; - } else { - return QList(); - } -} - -bool VideoItem::start(const QVideoSurfaceFormat &format) -{ - if (isFormatSupported(format)) { - imageFormat = QVideoFrame::equivalentImageFormat(format.pixelFormat()); - imageSize = format.frameSize(); - framePainted = true; - - QAbstractVideoSurface::start(format); - - prepareGeometryChange(); - - return true; - } else { - return false; - } -} - -void VideoItem::stop() -{ - currentFrame = QVideoFrame(); - framePainted = false; - - QAbstractVideoSurface::stop(); -} - -bool VideoItem::present(const QVideoFrame &frame) -{ - if (!framePainted) { - if (!isStarted()) - setError(StoppedError); - - return false; - } else { - currentFrame = frame; - framePainted = false; - - update(); - - return true; - } -} diff --git a/examples/video/videographicsitem/videoitem.h b/examples/video/videographicsitem/videoitem.h deleted file mode 100644 index 96f578a..0000000 --- a/examples/video/videographicsitem/videoitem.h +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef VIDEOITEM_H -#define VIDEOITEM_H - -#include -#include - -class VideoItem - : public QAbstractVideoSurface, - public QGraphicsItem -{ - Q_OBJECT - Q_INTERFACES(QGraphicsItem) -public: - explicit VideoItem(QGraphicsItem *parentItem = 0); - ~VideoItem(); - - QRectF boundingRect() const; - void paint( - QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); - - //video surface - QList supportedPixelFormats( - QAbstractVideoBuffer::HandleType handleType = QAbstractVideoBuffer::NoHandle) const; - - bool start(const QVideoSurfaceFormat &format); - void stop(); - bool present(const QVideoFrame &frame); - -private: - QImage::Format imageFormat; - QSize imageSize; - - QVideoFrame currentFrame; - bool framePainted; -}; - -#endif - diff --git a/examples/video/videographicsitem/videoplayer.cpp b/examples/video/videographicsitem/videoplayer.cpp deleted file mode 100644 index 83644db..0000000 --- a/examples/video/videographicsitem/videoplayer.cpp +++ /dev/null @@ -1,210 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "videoplayer.h" -#include "videoitem.h" - -#include - -#ifndef QT_NO_OPENGL -# include -#endif - -VideoPlayer::VideoPlayer(QWidget *parent, Qt::WindowFlags flags) - : QWidget(parent, flags) - , videoItem(0) - , playButton(0) - , positionSlider(0) -{ - connect(&movie, SIGNAL(stateChanged(QMovie::MovieState)), - this, SLOT(movieStateChanged(QMovie::MovieState))); - connect(&movie, SIGNAL(frameChanged(int)), - this, SLOT(frameChanged(int))); - - videoItem = new VideoItem; - - QGraphicsScene *scene = new QGraphicsScene(this); - QGraphicsView *graphicsView = new QGraphicsView(scene); - -#ifndef QT_NO_OPENGL - graphicsView->setViewport(new QGLWidget); -#endif - - scene->addItem(videoItem); - - QSlider *rotateSlider = new QSlider(Qt::Horizontal); - rotateSlider->setRange(-180, 180); - rotateSlider->setValue(0); - - connect(rotateSlider, SIGNAL(valueChanged(int)), - this, SLOT(rotateVideo(int))); - - QAbstractButton *openButton = new QPushButton(tr("Open...")); - connect(openButton, SIGNAL(clicked()), this, SLOT(openFile())); - - playButton = new QPushButton; - playButton->setEnabled(false); - playButton->setIcon(style()->standardIcon(QStyle::SP_MediaPlay)); - - connect(playButton, SIGNAL(clicked()), - this, SLOT(play())); - - positionSlider = new QSlider(Qt::Horizontal); - positionSlider->setRange(0, 0); - - connect(positionSlider, SIGNAL(sliderMoved(int)), - this, SLOT(setPosition(int))); - - connect(&movie, SIGNAL(frameChanged(int)), - positionSlider, SLOT(setValue(int))); - - QBoxLayout *controlLayout = new QHBoxLayout; - controlLayout->setMargin(0); - controlLayout->addWidget(openButton); - controlLayout->addWidget(playButton); - controlLayout->addWidget(positionSlider); - - QBoxLayout *layout = new QVBoxLayout; - layout->addWidget(graphicsView); - layout->addWidget(rotateSlider); - layout->addLayout(controlLayout); - - setLayout(layout); -} - -VideoPlayer::~VideoPlayer() -{ -} - -void VideoPlayer::openFile() -{ - QString fileName = QFileDialog::getOpenFileName(this, tr("Open Movie")); - - if (!fileName.isEmpty()) { - if (videoItem->isStarted()) - videoItem->stop(); - - movie.setFileName(fileName); - - playButton->setEnabled(true); - positionSlider->setMaximum(movie.frameCount()); - - movie.jumpToFrame(0); - } -} - -void VideoPlayer::play() -{ - switch(movie.state()) { - case QMovie::NotRunning: - movie.start(); - break; - case QMovie::Paused: - movie.setPaused(false); - break; - case QMovie::Running: - movie.setPaused(true); - break; - } -} - -void VideoPlayer::movieStateChanged(QMovie::MovieState state) -{ - switch(state) { - case QMovie::NotRunning: - case QMovie::Paused: - playButton->setIcon(style()->standardIcon(QStyle::SP_MediaPlay)); - break; - case QMovie::Running: - playButton->setIcon(style()->standardIcon(QStyle::SP_MediaPause)); - break; - } -} - -void VideoPlayer::frameChanged(int frame) -{ - if (!presentImage(movie.currentImage())) { - movie.stop(); - playButton->setEnabled(false); - positionSlider->setMaximum(0); - } else { - positionSlider->setValue(frame); - } -} - -void VideoPlayer::setPosition(int frame) -{ - movie.jumpToFrame(frame); -} - -void VideoPlayer::rotateVideo(int angle) -{ - //rotate around the center of video element - qreal x = videoItem->boundingRect().width() / 2.0; - qreal y = videoItem->boundingRect().height() / 2.0; - videoItem->setTransform(QTransform().translate(x, y).rotate(angle).translate(-x, -y)); -} - -bool VideoPlayer::presentImage(const QImage &image) -{ - QVideoFrame frame(image); - - if (!frame.isValid()) - return false; - - QVideoSurfaceFormat currentFormat = videoItem->surfaceFormat(); - - if (frame.pixelFormat() != currentFormat.pixelFormat() - || frame.size() != currentFormat.frameSize()) { - QVideoSurfaceFormat format(frame.size(), frame.pixelFormat()); - - if (!videoItem->start(format)) - return false; - } - - if (!videoItem->present(frame)) { - videoItem->stop(); - - return false; - } else { - return true; - } -} diff --git a/examples/video/videographicsitem/videoplayer.h b/examples/video/videographicsitem/videoplayer.h deleted file mode 100644 index 8e73e4c..0000000 --- a/examples/video/videographicsitem/videoplayer.h +++ /dev/null @@ -1,86 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef VIDEOPLAYER_H -#define VIDEOPLAYER_H - -#include -#include - -QT_BEGIN_NAMESPACE -class QAbstractButton; -class QAbstractVideoSurface; -class QSlider; -QT_END_NAMESPACE - - -class VideoItem; - -class VideoPlayer : public QWidget -{ - Q_OBJECT -public: - VideoPlayer(QWidget *parent = 0, Qt::WindowFlags flags = 0); - ~VideoPlayer(); - - QSize sizeHint() const { return QSize(800, 600); } - -public slots: - void openFile(); - void play(); - -private slots: - void movieStateChanged(QMovie::MovieState state); - void frameChanged(int frame); - void setPosition(int frame); - void rotateVideo(int angle); - -private: - bool presentImage(const QImage &image); - - QMovie movie; - VideoItem *videoItem; - QAbstractButton *playButton; - QSlider *positionSlider; -}; - -#endif - diff --git a/examples/video/videowidget/main.cpp b/examples/video/videowidget/main.cpp deleted file mode 100644 index f5edf73..0000000 --- a/examples/video/videowidget/main.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "videoplayer.h" - -#include - -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - - VideoPlayer player; - player.show(); - - return app.exec(); -} diff --git a/examples/video/videowidget/videoplayer.cpp b/examples/video/videowidget/videoplayer.cpp deleted file mode 100644 index ed24714..0000000 --- a/examples/video/videowidget/videoplayer.cpp +++ /dev/null @@ -1,183 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "videoplayer.h" - -#include "videowidget.h" - -#include - -VideoPlayer::VideoPlayer(QWidget *parent) - : QWidget(parent) - , surface(0) - , playButton(0) - , positionSlider(0) -{ - connect(&movie, SIGNAL(stateChanged(QMovie::MovieState)), - this, SLOT(movieStateChanged(QMovie::MovieState))); - connect(&movie, SIGNAL(frameChanged(int)), - this, SLOT(frameChanged(int))); - - VideoWidget *videoWidget = new VideoWidget; - surface = videoWidget->videoSurface(); - - QAbstractButton *openButton = new QPushButton(tr("Open...")); - connect(openButton, SIGNAL(clicked()), this, SLOT(openFile())); - - playButton = new QPushButton; - playButton->setEnabled(false); - playButton->setIcon(style()->standardIcon(QStyle::SP_MediaPlay)); - - connect(playButton, SIGNAL(clicked()), - this, SLOT(play())); - - positionSlider = new QSlider(Qt::Horizontal); - positionSlider->setRange(0, 0); - - connect(positionSlider, SIGNAL(sliderMoved(int)), - this, SLOT(setPosition(int))); - - connect(&movie, SIGNAL(frameChanged(int)), - positionSlider, SLOT(setValue(int))); - - QBoxLayout *controlLayout = new QHBoxLayout; - controlLayout->setMargin(0); - controlLayout->addWidget(openButton); - controlLayout->addWidget(playButton); - controlLayout->addWidget(positionSlider); - - QBoxLayout *layout = new QVBoxLayout; - layout->addWidget(videoWidget); - layout->addLayout(controlLayout); - - setLayout(layout); -} - -VideoPlayer::~VideoPlayer() -{ -} - -void VideoPlayer::openFile() -{ - QString fileName = QFileDialog::getOpenFileName(this, tr("Open Movie")); - - if (!fileName.isEmpty()) { - if (surface->isStarted()) - surface->stop(); - - movie.setFileName(fileName); - - playButton->setEnabled(true); - positionSlider->setMaximum(movie.frameCount()); - - movie.jumpToFrame(0); - } -} - -void VideoPlayer::play() -{ - switch(movie.state()) { - case QMovie::NotRunning: - movie.start(); - break; - case QMovie::Paused: - movie.setPaused(false); - break; - case QMovie::Running: - movie.setPaused(true); - break; - } -} - -void VideoPlayer::movieStateChanged(QMovie::MovieState state) -{ - switch(state) { - case QMovie::NotRunning: - case QMovie::Paused: - playButton->setIcon(style()->standardIcon(QStyle::SP_MediaPlay)); - break; - case QMovie::Running: - playButton->setIcon(style()->standardIcon(QStyle::SP_MediaPause)); - break; - } -} - -void VideoPlayer::frameChanged(int frame) -{ - if (!presentImage(movie.currentImage())) { - movie.stop(); - playButton->setEnabled(false); - positionSlider->setMaximum(0); - } else { - positionSlider->setValue(frame); - } -} - -void VideoPlayer::setPosition(int frame) -{ - movie.jumpToFrame(frame); -} - -bool VideoPlayer::presentImage(const QImage &image) -{ - QVideoFrame frame(image); - - if (!frame.isValid()) - return false; - - QVideoSurfaceFormat currentFormat = surface->surfaceFormat(); - - if (frame.pixelFormat() != currentFormat.pixelFormat() - || frame.size() != currentFormat.frameSize()) { - QVideoSurfaceFormat format(frame.size(), frame.pixelFormat()); - - if (!surface->start(format)) - return false; - } - - if (!surface->present(frame)) { - surface->stop(); - - return false; - } else { - return true; - } -} diff --git a/examples/video/videowidget/videoplayer.h b/examples/video/videowidget/videoplayer.h deleted file mode 100644 index 6547415..0000000 --- a/examples/video/videowidget/videoplayer.h +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef VIDEOPLAYER_H -#define VIDEOPLAYER_H - -#include -#include - -QT_BEGIN_NAMESPACE -class QAbstractButton; -class QAbstractVideoSurface; -class QSlider; -QT_END_NAMESPACE - -class VideoPlayer : public QWidget -{ - Q_OBJECT -public: - VideoPlayer(QWidget *parent = 0); - ~VideoPlayer(); - -public slots: - void openFile(); - void play(); - -private slots: - void movieStateChanged(QMovie::MovieState state); - void frameChanged(int frame); - void setPosition(int frame); - -private: - bool presentImage(const QImage &image); - - QMovie movie; - QAbstractVideoSurface *surface; - QAbstractButton *playButton; - QSlider *positionSlider; -}; - -#endif diff --git a/examples/video/videowidget/videowidget.cpp b/examples/video/videowidget/videowidget.cpp deleted file mode 100644 index 80688e1..0000000 --- a/examples/video/videowidget/videowidget.cpp +++ /dev/null @@ -1,114 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "videowidget.h" - -#include "videowidgetsurface.h" - -#include - -//! [0] -VideoWidget::VideoWidget(QWidget *parent) - : QWidget(parent) - , surface(0) -{ - setAutoFillBackground(false); - setAttribute(Qt::WA_NoSystemBackground, true); - setAttribute(Qt::WA_PaintOnScreen, true); - - QPalette palette = this->palette(); - palette.setColor(QPalette::Background, Qt::black); - setPalette(palette); - - setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); - - surface = new VideoWidgetSurface(this); -} -//! [0] - -//! [1] -VideoWidget::~VideoWidget() -{ - delete surface; -} -//! [1] - -//! [2] -QSize VideoWidget::sizeHint() const -{ - return surface->surfaceFormat().sizeHint(); -} -//! [2] - - -//! [3] -void VideoWidget::paintEvent(QPaintEvent *event) -{ - QPainter painter(this); - - if (surface->isStarted()) { - const QRect videoRect = surface->videoRect(); - - if (!videoRect.contains(event->rect())) { - QRegion region = event->region(); - region.subtract(videoRect); - - QBrush brush = palette().background(); - - foreach (const QRect &rect, region.rects()) - painter.fillRect(rect, brush); - } - - surface->paint(&painter); - } else { - painter.fillRect(event->rect(), palette().background()); - } -} -//! [3] - -//! [4] -void VideoWidget::resizeEvent(QResizeEvent *event) -{ - QWidget::resizeEvent(event); - - surface->updateVideoRect(); -} -//! [4] diff --git a/examples/video/videowidget/videowidget.h b/examples/video/videowidget/videowidget.h deleted file mode 100644 index 8c343bf..0000000 --- a/examples/video/videowidget/videowidget.h +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef VIDEOWIDGET_H -#define VIDEOWIDGET_H - -#include "videowidgetsurface.h" - -#include - -QT_BEGIN_NAMESPACE -class QAbstractVideoSurface; -QT_END_NAMESPACE - -class VideoWidgetSurface; - -//! [0] -class VideoWidget : public QWidget -{ - Q_OBJECT -public: - VideoWidget(QWidget *parent = 0); - ~VideoWidget(); - - QAbstractVideoSurface *videoSurface() const { return surface; } - - QSize sizeHint() const; - -protected: - void paintEvent(QPaintEvent *event); - void resizeEvent(QResizeEvent *event); - -private: - VideoWidgetSurface *surface; -}; -//! [0] - -#endif diff --git a/examples/video/videowidget/videowidget.pro b/examples/video/videowidget/videowidget.pro deleted file mode 100644 index 4a1d717..0000000 --- a/examples/video/videowidget/videowidget.pro +++ /dev/null @@ -1,19 +0,0 @@ -TEMPLATE = app - -QT += multimedia - -HEADERS = \ - videoplayer.h \ - videowidget.h \ - videowidgetsurface.h - -SOURCES = \ - main.cpp \ - videoplayer.cpp \ - videowidget.cpp \ - videowidgetsurface.cpp - -symbian { - TARGET.UID3 = 0xA000D7C3 - include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -} diff --git a/examples/video/videowidget/videowidgetsurface.cpp b/examples/video/videowidget/videowidgetsurface.cpp deleted file mode 100644 index ec9b8b5..0000000 --- a/examples/video/videowidget/videowidgetsurface.cpp +++ /dev/null @@ -1,175 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "videowidgetsurface.h" - -#include - -VideoWidgetSurface::VideoWidgetSurface(QWidget *widget, QObject *parent) - : QAbstractVideoSurface(parent) - , widget(widget) - , imageFormat(QImage::Format_Invalid) -{ -} - -//! [0] -QList VideoWidgetSurface::supportedPixelFormats( - QAbstractVideoBuffer::HandleType handleType) const -{ - if (handleType == QAbstractVideoBuffer::NoHandle) { - return QList() - << QVideoFrame::Format_RGB32 - << QVideoFrame::Format_ARGB32 - << QVideoFrame::Format_ARGB32_Premultiplied - << QVideoFrame::Format_RGB565 - << QVideoFrame::Format_RGB555; - } else { - return QList(); - } -} -//! [0] - -//! [1] -bool VideoWidgetSurface::isFormatSupported( - const QVideoSurfaceFormat &format, QVideoSurfaceFormat *similar) const -{ - Q_UNUSED(similar); - - const QImage::Format imageFormat = QVideoFrame::equivalentImageFormat(format.pixelFormat()); - const QSize size = format.frameSize(); - - return imageFormat != QImage::Format_Invalid - && !size.isEmpty() - && format.handleType() == QAbstractVideoBuffer::NoHandle; -} -//! [1] - -//! [2] -bool VideoWidgetSurface::start(const QVideoSurfaceFormat &format) -{ - const QImage::Format imageFormat = QVideoFrame::equivalentImageFormat(format.pixelFormat()); - const QSize size = format.frameSize(); - - if (imageFormat != QImage::Format_Invalid && !size.isEmpty()) { - this->imageFormat = imageFormat; - imageSize = size; - sourceRect = format.viewport(); - - QAbstractVideoSurface::start(format); - - widget->updateGeometry(); - updateVideoRect(); - - return true; - } else { - return false; - } -} -//! [2] - -//! [3] -void VideoWidgetSurface::stop() -{ - currentFrame = QVideoFrame(); - targetRect = QRect(); - - QAbstractVideoSurface::stop(); - - widget->update(); -} -//! [3] - -//! [4] -bool VideoWidgetSurface::present(const QVideoFrame &frame) -{ - if (surfaceFormat().pixelFormat() != frame.pixelFormat() - || surfaceFormat().frameSize() != frame.size()) { - setError(IncorrectFormatError); - stop(); - - return false; - } else { - currentFrame = frame; - - widget->repaint(targetRect); - - return true; - } -} -//! [4] - -//! [5] -void VideoWidgetSurface::updateVideoRect() -{ - QSize size = surfaceFormat().sizeHint(); - size.scale(widget->size().boundedTo(size), Qt::KeepAspectRatio); - - targetRect = QRect(QPoint(0, 0), size); - targetRect.moveCenter(widget->rect().center()); -} -//! [5] - -//! [6] -void VideoWidgetSurface::paint(QPainter *painter) -{ - if (currentFrame.map(QAbstractVideoBuffer::ReadOnly)) { - const QTransform oldTransform = painter->transform(); - - if (surfaceFormat().scanLineDirection() == QVideoSurfaceFormat::BottomToTop) { - painter->scale(1, -1); - painter->translate(0, -widget->height()); - } - - QImage image( - currentFrame.bits(), - currentFrame.width(), - currentFrame.height(), - currentFrame.bytesPerLine(), - imageFormat); - - painter->drawImage(targetRect, image, sourceRect); - - painter->setTransform(oldTransform); - - currentFrame.unmap(); - } -} -//! [6] diff --git a/examples/video/videowidget/videowidgetsurface.h b/examples/video/videowidget/videowidgetsurface.h deleted file mode 100644 index 83439d3..0000000 --- a/examples/video/videowidget/videowidgetsurface.h +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef VIDEOWIDGETSURFACE_H -#define VIDEOWIDGETSURFACE_H - -#include -#include -#include -#include - -//! [0] -class VideoWidgetSurface : public QAbstractVideoSurface -{ - Q_OBJECT -public: - VideoWidgetSurface(QWidget *widget, QObject *parent = 0); - - QList supportedPixelFormats( - QAbstractVideoBuffer::HandleType handleType = QAbstractVideoBuffer::NoHandle) const; - bool isFormatSupported(const QVideoSurfaceFormat &format, QVideoSurfaceFormat *similar) const; - - bool start(const QVideoSurfaceFormat &format); - void stop(); - - bool present(const QVideoFrame &frame); - - QRect videoRect() const { return targetRect; } - void updateVideoRect(); - - void paint(QPainter *painter); - -private: - QWidget *widget; - QImage::Format imageFormat; - QRect targetRect; - QSize imageSize; - QRect sourceRect; - QVideoFrame currentFrame; -}; -//! [0] - -#endif -- cgit v0.12 From c5bfbe27f5bbdb1f3e76af8ca5e0f4df27875a06 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Fri, 16 Oct 2009 17:22:36 +1000 Subject: qdoc: Fix misinterpretation of // in strings as a single-line-comment. Mainly fixes quoted URLs, but a few other cases too. --- tools/qdoc3/cppcodemarker.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/qdoc3/cppcodemarker.cpp b/tools/qdoc3/cppcodemarker.cpp index ed3d150..917faa2 100644 --- a/tools/qdoc3/cppcodemarker.cpp +++ b/tools/qdoc3/cppcodemarker.cpp @@ -875,6 +875,7 @@ QString CppCodeMarker::addMarkUp(const QString& protectedCode, static QRegExp globalX("[\n{()=] *([a-zA-Z_][a-zA-Z_0-9]*)[ \n]*\\("); static QRegExp multiLineComment("/(?:( )?\\*(?:[^*]+|\\*(?! /))*\\*\\1/)"); multiLineComment.setMinimal(true); + static QRegExp singleLineCommentLine("(?:^|\n)(?:[^&]|&(?!quot;)|"(?:[^&\\\\]|&(?!quot;)|\\\\"|\\\\(?!"))*")*//(?!!)[^!\n]*"); static QRegExp singleLineComment("//(?!!)[^!\n]*"); static QRegExp preprocessor("(?:^|\n)(#[ \t]*(?:include|if|elif|endif|error|pragma|define" "|warning)(?:(?:\\\\\n|\\n#)[^\n]*)*)"); @@ -1050,7 +1051,8 @@ QString CppCodeMarker::addMarkUp(const QString& protectedCode, int mlpos; int slpos; int len; - slpos = singleLineComment.indexIn(result, pos); + int sllpos = singleLineCommentLine.indexIn(result, pos); + slpos = sllpos == -1 ? -1 : singleLineComment.indexIn(result, sllpos); mlpos = multiLineComment.indexIn(result, pos); if (slpos == -1 && mlpos == -1) -- cgit v0.12 From 511c434b959be96c992e59f4a2748ac251d5c72a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Tue, 20 Oct 2009 10:31:34 +0200 Subject: Make the raster graphics system default on Mac. The plan is to make this default for Cocoa on Qt 4.7. Switching it over now will give us time to find regressions. Use "-graphicssystem native" to escape back to CoreGraphics. --- src/gui/kernel/qapplication.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index 6f6d706..ce5796b 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -936,6 +936,14 @@ void QApplicationPrivate::initialize() // Set up which span functions should be used in raster engine... qInitDrawhelperAsm(); +#ifdef QT_MAC_USE_COCOA + // Use the rater graphics system by default on Cocoa, override with + // -graphicssystem raster + if (graphics_system_name.isEmpty()) { + graphics_system_name = QLatin1String("raster"); + } +#endif + #if !defined(Q_WS_X11) && !defined(Q_WS_QWS) // initialize the graphics system - on X11 this is initialized inside // qt_init() in qapplication_x11.cpp because of several reasons. -- cgit v0.12 From b7ba4ccf9017281c48b47be5988f2fb46dee2c1f Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Tue, 20 Oct 2009 13:40:05 +0200 Subject: Fixed crash in Lance under Mac OS X without graphics system --- tests/arthur/lance/widgets.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/arthur/lance/widgets.h b/tests/arthur/lance/widgets.h index ea1482f..7c17bc5 100644 --- a/tests/arthur/lance/widgets.h +++ b/tests/arthur/lance/widgets.h @@ -236,7 +236,12 @@ public: } if (m_render_view.isNull()) { - m_render_view = T::window()->windowSurface()->grabWidget(this); + + if (T::window()->windowSurface()) + m_render_view = T::window()->windowSurface()->grabWidget(this); + else + m_render_view = QPixmap::grabWidget(this); + m_render_view.save("renderView.png"); } } -- cgit v0.12 From 0fec70a232f9a97acc70e96a32d8a39c6c27c408 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Fri, 23 Oct 2009 07:03:05 +0200 Subject: Fix raster/native graphicssystem comment. --- src/gui/kernel/qapplication.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index 4ad28e2..873f321 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -934,8 +934,8 @@ void QApplicationPrivate::initialize() qInitDrawhelperAsm(); #ifdef QT_MAC_USE_COCOA - // Use the rater graphics system by default on Cocoa, override with - // -graphicssystem raster + // Use the raster graphics system by default on Cocoa, override with + // -graphicssystem native if (graphics_system_name.isEmpty()) { graphics_system_name = QLatin1String("raster"); } -- cgit v0.12 From c05220038d50f26cb5da03b13b82372297f99c83 Mon Sep 17 00:00:00 2001 From: Anderson Lizardo Date: Sun, 6 Sep 2009 17:09:25 -0400 Subject: Fix portability problems in bin/createpackage.pl. * Use File::Spec functions to manipulate path components. * Keep $targetplatform lower case for case sensitive systems. Signed-off-by: axis --- bin/createpackage.pl | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/bin/createpackage.pl b/bin/createpackage.pl index 4597b04..3480702 100755 --- a/bin/createpackage.pl +++ b/bin/createpackage.pl @@ -145,10 +145,8 @@ my $signed_sis_name = $pkgoutputbasename.".sis"; # Store some utility variables my $scriptpath = dirname(__FILE__); my $certtext = $certificate; -my $certpath = $scriptpath; -$certpath =~ s-^(.*[^\\])$-$1\\-o; # ensure path ends with a backslash -$certpath = $certpath."../"; # certificates are one step up in hierarcy -$certpath =~ s-/-\\-go; # for those working with UNIX shells +# certificates are one step up in hierarchy +my $certpath = File::Spec->catdir($scriptpath, File::Spec->updir()); # Check some pre-conditions and print error messages if needed unless (length($templatepkg) && length($platform) && length($target)) { @@ -172,14 +170,14 @@ if (length($certificate)) { } else { #If no certificate is given, check default options $certtext = "RnD"; - $certificate = $certpath."rd.cer"; - $key = $certpath."rd-key.pem"; + $certificate = File::Spec->catfile($certpath, "rd.cer"); + $key = File::Spec->catfile($certpath, "rd-key.pem"); stat($certificate); unless( -e _ ) { $certtext = "Self Signed"; - $certificate = $certpath."selfsigned.cer"; - $key = $certpath."selfsigned.key"; + $certificate = File::Spec->catfile($certpath, "selfsigned.cer"); + $key = File::Spec->catfile($certpath, "selfsigned.key"); } } -- cgit v0.12 From 131d2387436d05aec95bdddeb571930b2a55cf73 Mon Sep 17 00:00:00 2001 From: Anderson Lizardo Date: Thu, 17 Sep 2009 16:38:31 -0400 Subject: mkspecs: fix warning when calling qmake Signed-off-by: axis --- mkspecs/common/symbian/symbian.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/common/symbian/symbian.conf b/mkspecs/common/symbian/symbian.conf index 38e955a..fe698fb 100644 --- a/mkspecs/common/symbian/symbian.conf +++ b/mkspecs/common/symbian/symbian.conf @@ -104,7 +104,7 @@ QMAKE_STRIP = strip QMAKE_STRIPFLAGS_LIB += --strip-unneeded load(qt_config) -load(platform_paths) +load(symbian/platform_paths) MMP_RULES_DONT_EXPORT_ALL_CLASS_IMPEDIMENTA = "OPTION_REPLACE ARMCC --export_all_vtbl // don't use --export_all_vtbl" MMP_RULES += PAGED -- cgit v0.12 From 8c61bb163a13b1e2b78df0060103546a31c16ed6 Mon Sep 17 00:00:00 2001 From: Anderson Lizardo Date: Sun, 6 Sep 2009 20:05:13 -0400 Subject: Make all Symbian #includes lower case. Signed-off-by: axis --- src/gui/kernel/qapplication_s60.cpp | 2 +- src/gui/kernel/qdnd_s60.cpp | 2 +- src/gui/kernel/qsound_s60.cpp | 2 +- src/gui/styles/qs60style_s60.cpp | 4 ++-- src/gui/text/qfontdatabase_s60.cpp | 2 +- src/gui/text/qfontengine_s60.cpp | 4 ++-- src/gui/text/qfontengine_s60_p.h | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 27e8602..cdc028b 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -62,7 +62,7 @@ #include "private/qsoftkeymanager_p.h" #include "apgwgnam.h" // For CApaWindowGroupName -#include // For CMdaAudioToneUtility +#include // For CMdaAudioToneUtility #if defined(Q_WS_S60) # if !defined(QT_NO_IM) diff --git a/src/gui/kernel/qdnd_s60.cpp b/src/gui/kernel/qdnd_s60.cpp index 3d6ecd2..24ae7ce 100644 --- a/src/gui/kernel/qdnd_s60.cpp +++ b/src/gui/kernel/qdnd_s60.cpp @@ -52,7 +52,7 @@ #include "qdnd_p.h" #include "qt_s60_p.h" -#include +#include // pointer cursor #include #include diff --git a/src/gui/kernel/qsound_s60.cpp b/src/gui/kernel/qsound_s60.cpp index 352580e..ee5227a 100644 --- a/src/gui/kernel/qsound_s60.cpp +++ b/src/gui/kernel/qsound_s60.cpp @@ -51,7 +51,7 @@ #include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp index 131d8bc..4fa009c 100644 --- a/src/gui/styles/qs60style_s60.cpp +++ b/src/gui/styles/qs60style_s60.cpp @@ -58,8 +58,8 @@ #include #include #include -#include -#include +#include +#include #include #if !defined(QT_NO_STYLE_S60) || defined(QT_PLUGIN) diff --git a/src/gui/text/qfontdatabase_s60.cpp b/src/gui/text/qfontdatabase_s60.cpp index 1a6bb11..b51d828 100644 --- a/src/gui/text/qfontdatabase_s60.cpp +++ b/src/gui/text/qfontdatabase_s60.cpp @@ -50,7 +50,7 @@ #include "qendian.h" #include #if defined(QT_NO_FREETYPE) -#include +#include #endif QT_BEGIN_NAMESPACE diff --git a/src/gui/text/qfontengine_s60.cpp b/src/gui/text/qfontengine_s60.cpp index 88ae8f6..69ac7a1 100644 --- a/src/gui/text/qfontengine_s60.cpp +++ b/src/gui/text/qfontengine_s60.cpp @@ -49,8 +49,8 @@ #include #include -#include -#include +#include +#include QT_BEGIN_NAMESPACE diff --git a/src/gui/text/qfontengine_s60_p.h b/src/gui/text/qfontengine_s60_p.h index 44f8122..746f929 100644 --- a/src/gui/text/qfontengine_s60_p.h +++ b/src/gui/text/qfontengine_s60_p.h @@ -56,7 +56,7 @@ #include "qconfig.h" #include "qfontengine_p.h" #include "qsize.h" -#include +#include class CFbsBitmap; class CFbsBitmapDevice; -- cgit v0.12 From d0be442d96f780465eff0be3afbf543e5d3e82ab Mon Sep 17 00:00:00 2001 From: Anderson Lizardo Date: Sun, 6 Sep 2009 19:14:20 -0400 Subject: Add createpackage.bat equivalent for Unix systems. Signed-off-by: axis --- bin/createpackage.sh | 3 +++ 1 file changed, 3 insertions(+) create mode 100755 bin/createpackage.sh diff --git a/bin/createpackage.sh b/bin/createpackage.sh new file mode 100755 index 0000000..fdd4eeb --- /dev/null +++ b/bin/createpackage.sh @@ -0,0 +1,3 @@ +#!/bin/sh +scriptpath=`dirname $0` +perl $scriptpath/createpackage.pl "$@" -- cgit v0.12 From 1609689ad1b9672fd4598aa30a7429b9d37bc3ca Mon Sep 17 00:00:00 2001 From: Anderson Lizardo Date: Sun, 6 Sep 2009 20:29:51 -0400 Subject: Linux support for platform specific commands in .pro files. Signed-off-by: axis --- projects.pro | 15 +++++++++++++-- src/s60main/s60main.pro | 5 +++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/projects.pro b/projects.pro index 2a6a956..10cff2a 100644 --- a/projects.pro +++ b/projects.pro @@ -107,7 +107,8 @@ win32 { } symbian { confclean.depends += distclean - confclean.commands += \ + win32 { + confclean.commands += \ (cd src\tools\moc && $(MAKE) distclean) $$escape_expand(\n\t) \ (cd src\tools\rcc && $(MAKE) distclean) $$escape_expand(\n\t) \ (cd src\tools\uic && $(MAKE) distclean) $$escape_expand(\n\t) \ @@ -116,7 +117,17 @@ symbian { -$(DEL_FILE) mkspecs\qconfig.pri $$escape_expand(\n\t) \ -$(DEL_FILE) .qmake.cache $$escape_expand(\n\t) \ (cd qmake && $(MAKE) distclean) - + } else { + confclean.commands += \ + (cd src/tools/moc && $(MAKE) distclean) $$escape_expand(\n\t) \ + (cd src/tools/rcc && $(MAKE) distclean) $$escape_expand(\n\t) \ + (cd src/tools/uic && $(MAKE) distclean) $$escape_expand(\n\t) \ + -$(DEL_FILE) src/corelib/global/qconfig.h $$escape_expand(\n\t) \ + -$(DEL_FILE) src/corelib/global/qconfig.cpp $$escape_expand(\n\t) \ + -$(DEL_FILE) mkspecs/qconfig.pri $$escape_expand(\n\t) \ + -$(DEL_FILE) .qmake.cache $$escape_expand(\n\t) \ + (cd qmake && $(MAKE) distclean) + } } QMAKE_EXTRA_TARGETS += confclean qmakeclean.commands += (cd qmake && $(MAKE) clean) diff --git a/src/s60main/s60main.pro b/src/s60main/s60main.pro index cc3c547..d6b5ac8 100644 --- a/src/s60main/s60main.pro +++ b/src/s60main/s60main.pro @@ -40,8 +40,13 @@ symbian-abld: { # abld build commands generated resources after the static library is built, and # we have dependency to resource from static lib -> resources need to be generated # explicitly before library +win32: { rsgFix2.commands = "-$(DEL_FILE) $(EPOCROOT)Epoc32\Data\z\resource\apps\s60main.rsc >NUL 2>&1" rsgFix.commands = "-$(ABLD) resource $(PLATFORM) $(CFG) 2>NUL" +} else { + rsgFix2.commands = "-$(DEL_FILE) $(EPOCROOT)epoc32/data/z/resource/apps/s60main.rsc >/dev/null 2>&1" + rsgFix.commands = "-$(ABLD) resource $(PLATFORM) $(CFG) 2>/dev/null" +} QMAKE_EXTRA_TARGETS += rsgFix rsgFix2 PRE_TARGETDEPS += rsgFix rsgFix2 } -- cgit v0.12 From 732bd6893a9e65d33927b9083fe5e30c0864e409 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 28 Oct 2009 14:06:39 +0100 Subject: Simplify byte swapping in QDataStream's stream operators. This makes the code a lot more readable and allows for some centralized platform-specific optimizations. Reviewed-by: Leonardo Sobral Cunha --- src/corelib/io/qdatastream.cpp | 231 ++++++++++------------------------------- src/corelib/tools/qstring.cpp | 3 +- 2 files changed, 59 insertions(+), 175 deletions(-) diff --git a/src/corelib/io/qdatastream.cpp b/src/corelib/io/qdatastream.cpp index 19e86a6..308e847 100644 --- a/src/corelib/io/qdatastream.cpp +++ b/src/corelib/io/qdatastream.cpp @@ -48,6 +48,7 @@ #include #include #include +#include "qendian.h" QT_BEGIN_NAMESPACE @@ -670,24 +671,12 @@ QDataStream &QDataStream::operator>>(qint16 &i) { i = 0; CHECK_STREAM_PRECOND(*this) - if (noswap) { - if (dev->read((char *)&i, 2) != 2) { - i = 0; - setStatus(ReadPastEnd); - } + if (dev->read((char *)&i, 2) != 2) { + i = 0; + setStatus(ReadPastEnd); } else { - union { - qint16 val1; - char val2[2]; - } x; - char *p = x.val2; - char b[2]; - if (dev->read(b, 2) == 2) { - *p++ = b[1]; - *p = b[0]; - i = x.val1; - } else { - setStatus(ReadPastEnd); + if (!noswap) { + i = qbswap(i); } } return *this; @@ -713,26 +702,12 @@ QDataStream &QDataStream::operator>>(qint32 &i) { i = 0; CHECK_STREAM_PRECOND(*this) - if (noswap) { - if (dev->read((char *)&i, 4) != 4) { - i = 0; - setStatus(ReadPastEnd); - } - } else { // swap bytes - union { - qint32 val1; - char val2[4]; - } x; - char *p = x.val2; - char b[4]; - if (dev->read(b, 4) == 4) { - *p++ = b[3]; - *p++ = b[2]; - *p++ = b[1]; - *p = b[0]; - i = x.val1; - } else { - setStatus(ReadPastEnd); + if (dev->read((char *)&i, 4) != 4) { + i = 0; + setStatus(ReadPastEnd); + } else { + if (!noswap) { + i = qbswap(i); } } return *this; @@ -761,31 +736,14 @@ QDataStream &QDataStream::operator>>(qint64 &i) quint32 i1, i2; *this >> i2 >> i1; i = ((quint64)i1 << 32) + i2; - } else if (noswap) { // no conversion needed + } else { if (dev->read((char *)&i, 8) != 8) { i = qint64(0); setStatus(ReadPastEnd); - } - } else { // swap bytes - union { - qint64 val1; - char val2[8]; - } x; - - char *p = x.val2; - char b[8]; - if (dev->read(b, 8) == 8) { - *p++ = b[7]; - *p++ = b[6]; - *p++ = b[5]; - *p++ = b[4]; - *p++ = b[3]; - *p++ = b[2]; - *p++ = b[1]; - *p = b[0]; - i = x.val1; } else { - setStatus(ReadPastEnd); + if (!noswap) { + i = qbswap(i); + } } } return *this; @@ -825,27 +783,17 @@ QDataStream &QDataStream::operator>>(float &f) f = 0.0f; CHECK_STREAM_PRECOND(*this) - if (noswap) { - if (dev->read((char *)&f, 4) != 4) { - f = 0.0f; - setStatus(ReadPastEnd); - } - } else { // swap bytes - union { - float val1; - char val2[4]; - } x; - - char *p = x.val2; - char b[4]; - if (dev->read(b, 4) == 4) { - *p++ = b[3]; - *p++ = b[2]; - *p++ = b[1]; - *p = b[0]; + if (dev->read((char *)&f, 4) != 4) { + f = 0.0f; + setStatus(ReadPastEnd); + } else { + if (!noswap) { + union { + float val1; + quint32 val2; + } x; + x.val2 = qbswap(*reinterpret_cast(&f)); f = x.val1; - } else { - setStatus(ReadPastEnd); } } return *this; @@ -878,30 +826,17 @@ QDataStream &QDataStream::operator>>(double &f) f = 0.0; CHECK_STREAM_PRECOND(*this) #ifndef Q_DOUBLE_FORMAT - if (noswap) { - if (dev->read((char *)&f, 8) != 8) { - f = 0.0; - setStatus(ReadPastEnd); - } - } else { // swap bytes - union { - double val1; - char val2[8]; - } x; - char *p = x.val2; - char b[8]; - if (dev->read(b, 8) == 8) { - *p++ = b[7]; - *p++ = b[6]; - *p++ = b[5]; - *p++ = b[4]; - *p++ = b[3]; - *p++ = b[2]; - *p++ = b[1]; - *p = b[0]; + if (dev->read((char *)&f, 8) != 8) { + f = 0.0; + setStatus(ReadPastEnd); + } else { + if (!noswap) { + union { + double val1; + quint64 val2; + } x; + x.val2 = qbswap(*reinterpret_cast(&f)); f = x.val1; - } else { - setStatus(ReadPastEnd); } } #else @@ -1073,20 +1008,10 @@ QDataStream &QDataStream::operator<<(qint8 i) QDataStream &QDataStream::operator<<(qint16 i) { CHECK_STREAM_PRECOND(*this) - if (noswap) { - dev->write((char *)&i, sizeof(qint16)); - } else { // swap bytes - union { - qint16 val1; - char val2[2]; - } x; - x.val1 = i; - char *p = x.val2; - char b[2]; - b[1] = *p++; - b[0] = *p; - dev->write(b, 2); + if (!noswap) { + i = qbswap(i); } + dev->write((char *)&i, sizeof(qint16)); return *this; } @@ -1100,22 +1025,10 @@ QDataStream &QDataStream::operator<<(qint16 i) QDataStream &QDataStream::operator<<(qint32 i) { CHECK_STREAM_PRECOND(*this) - if (noswap) { - dev->write((char *)&i, sizeof(qint32)); - } else { // swap bytes - union { - qint32 val1; - char val2[4]; - } x; - x.val1 = i; - char *p = x.val2; - char b[4]; - b[3] = *p++; - b[2] = *p++; - b[1] = *p++; - b[0] = *p; - dev->write(b, 4); + if (!noswap) { + i = qbswap(i); } + dev->write((char *)&i, sizeof(qint32)); return *this; } @@ -1141,25 +1054,11 @@ QDataStream &QDataStream::operator<<(qint64 i) quint32 i1 = i & 0xffffffff; quint32 i2 = i >> 32; *this << i2 << i1; - } else if (noswap) { // no conversion needed + } else { + if (!noswap) { + i = qbswap(i); + } dev->write((char *)&i, sizeof(qint64)); - } else { // swap bytes - union { - qint64 val1; - char val2[8]; - } x; - x.val1 = i; - char *p = x.val2; - char b[8]; - b[7] = *p++; - b[6] = *p++; - b[5] = *p++; - b[4] = *p++; - b[3] = *p++; - b[2] = *p++; - b[1] = *p++; - b[0] = *p; - dev->write(b, 8); } return *this; } @@ -1203,22 +1102,16 @@ QDataStream &QDataStream::operator<<(float f) CHECK_STREAM_PRECOND(*this) float g = f; // fixes float-on-stack problem - if (noswap) { // no conversion needed - dev->write((char *)&g, sizeof(float)); - } else { // swap bytes + if (!noswap) { union { float val1; - char val2[4]; + quint32 val2; } x; - x.val1 = f; - char *p = x.val2; - char b[4]; - b[3] = *p++; - b[2] = *p++; - b[1] = *p++; - b[0] = *p; - dev->write(b, 4); + x.val1 = g; + x.val2 = qbswap(x.val2); + g = x.val1; } + dev->write((char *)&g, sizeof(float)); return *this; } @@ -1242,26 +1135,16 @@ QDataStream &QDataStream::operator<<(double f) CHECK_STREAM_PRECOND(*this) #ifndef Q_DOUBLE_FORMAT - if (noswap) { - dev->write((char *)&f, sizeof(double)); - } else { + if (!noswap) { union { double val1; - char val2[8]; + quint64 val2; } x; x.val1 = f; - char *p = x.val2; - char b[8]; - b[7] = *p++; - b[6] = *p++; - b[5] = *p++; - b[4] = *p++; - b[3] = *p++; - b[2] = *p++; - b[1] = *p++; - b[0] = *p; - dev->write(b, 8); + x.val2 = qbswap(x.val2); + f = x.val1; } + dev->write((char *)&f, sizeof(double)); #else union { double val1; diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index a996f30..3af53f5 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -55,6 +55,7 @@ #include "qtools_p.h" #include "qhash.h" #include "qdebug.h" +#include "qendian.h" #ifdef Q_OS_MAC #include @@ -7306,7 +7307,7 @@ QDataStream &operator>>(QDataStream &in, QString &str) != (QSysInfo::ByteOrder == QSysInfo::BigEndian)) { ushort *data = reinterpret_cast(str.data()); while (len--) { - *data = (*data >> 8) | (*data << 8); + *data = qbswap(*data); ++data; } } -- cgit v0.12 From e535343ee9502d48cdc282a6c91da9655d8205c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Fri, 30 Oct 2009 13:22:45 +0100 Subject: Improve the message box icon selection on Mac. Use a question mark for SP_MessageBoxQuestion, and then increasingly scary exclamation marks for Information, Warning, and Critical. --- src/gui/styles/qcommonstyle.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gui/styles/qcommonstyle.cpp b/src/gui/styles/qcommonstyle.cpp index 70d130a..6ce0f9d 100644 --- a/src/gui/styles/qcommonstyle.cpp +++ b/src/gui/styles/qcommonstyle.cpp @@ -5664,10 +5664,16 @@ QIcon QCommonStyle::standardIconImplementation(StandardPixmap standardIcon, cons OSType iconType = 0; switch (standardIcon) { case QStyle::SP_MessageBoxQuestion: + iconType = kQuestionMarkIcon; + break; case QStyle::SP_MessageBoxInformation: + iconType = kAlertNoteIcon; + break; case QStyle::SP_MessageBoxWarning: + iconType = kAlertCautionIcon; + break; case QStyle::SP_MessageBoxCritical: - iconType = kGenericApplicationIcon; + iconType = kAlertStopIcon; break; case SP_DesktopIcon: iconType = kDesktopIcon; -- cgit v0.12 From 187be1cdbac3ec9dd2b748f25a5d6198c7a7ed87 Mon Sep 17 00:00:00 2001 From: ck Date: Tue, 3 Nov 2009 10:55:44 +0100 Subject: Introduce symbolic constants for CLucene field names. Reviewed-by: kh1 --- tools/assistant/lib/lib.pro | 7 ++- tools/assistant/lib/qclucenefieldnames.cpp | 59 ++++++++++++++++++++ tools/assistant/lib/qclucenefieldnames_p.h | 65 ++++++++++++++++++++++ .../lib/qhelpsearchindexreader_clucene.cpp | 43 +++++++------- .../lib/qhelpsearchindexwriter_clucene.cpp | 20 +++---- 5 files changed, 158 insertions(+), 36 deletions(-) create mode 100644 tools/assistant/lib/qclucenefieldnames.cpp create mode 100644 tools/assistant/lib/qclucenefieldnames_p.h diff --git a/tools/assistant/lib/lib.pro b/tools/assistant/lib/lib.pro index 011dec2..322320a 100644 --- a/tools/assistant/lib/lib.pro +++ b/tools/assistant/lib/lib.pro @@ -23,7 +23,6 @@ unix:QMAKE_PKGCONFIG_REQUIRES += QtNetwork \ QtSql \ QtXml LIBS_PRIVATE += -l$$qclucene - RESOURCES += helpsystem.qrc SOURCES += qhelpenginecore.cpp \ qhelpengine.cpp \ @@ -40,7 +39,8 @@ SOURCES += qhelpenginecore.cpp \ qhelpsearchindex_default.cpp \ qhelpsearchindexwriter_default.cpp \ qhelpsearchindexreader_default.cpp \ - qhelpsearchindexreader.cpp + qhelpsearchindexreader.cpp \ + qclucenefieldnames.cpp # access to clucene SOURCES += qhelpsearchindexwriter_clucene.cpp \ @@ -62,7 +62,8 @@ HEADERS += qhelpenginecore.h \ qhelpsearchindex_default_p.h \ qhelpsearchindexwriter_default_p.h \ qhelpsearchindexreader_default_p.h \ - qhelpsearchindexreader_p.h + qhelpsearchindexreader_p.h \ + qclucenefieldnames_p.h # access to clucene HEADERS += qhelpsearchindexwriter_clucene_p.h \ diff --git a/tools/assistant/lib/qclucenefieldnames.cpp b/tools/assistant/lib/qclucenefieldnames.cpp new file mode 100644 index 0000000..df01d1a --- /dev/null +++ b/tools/assistant/lib/qclucenefieldnames.cpp @@ -0,0 +1,59 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qclucenefieldnames_p.h" + +QT_BEGIN_NAMESPACE + +namespace qt { +namespace fulltextsearch { +namespace clucene { +const QString AttributeField(QLatin1String("attribute")); +const QString ContentField(QLatin1String("content")); +const QString NamespaceField(QLatin1String("namespace")); +const QString PathField(QLatin1String("path")); +const QString TitleField(QLatin1String("title")); +const QString TitleTokenizedField(QLatin1String("titleTokenized")); +} // namespace clucene +} // namespace fulltextsearch +} // namespace qt + +QT_END_NAMESPACE diff --git a/tools/assistant/lib/qclucenefieldnames_p.h b/tools/assistant/lib/qclucenefieldnames_p.h new file mode 100644 index 0000000..57b85f8 --- /dev/null +++ b/tools/assistant/lib/qclucenefieldnames_p.h @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QCLUCENEFIELDNAMES_P_H +#define QCLUCENEFIELDNAMES_P_H + +#include +#include + +QT_BEGIN_NAMESPACE + +namespace qt { +namespace fulltextsearch { +namespace clucene { + extern const QString AttributeField; + extern const QString ContentField; + extern const QString NamespaceField; + extern const QString PathField; + extern const QString TitleField; + extern const QString TitleTokenizedField; +} // namespace clucene +} // namespace fulltextsearch +} // namespace qt + +QT_END_NAMESPACE + +#endif // QCLUCENEFIELDNAMES_P_H diff --git a/tools/assistant/lib/qhelpsearchindexreader_clucene.cpp b/tools/assistant/lib/qhelpsearchindexreader_clucene.cpp index 954f41f..0d46d8e 100644 --- a/tools/assistant/lib/qhelpsearchindexreader_clucene.cpp +++ b/tools/assistant/lib/qhelpsearchindexreader_clucene.cpp @@ -39,6 +39,7 @@ ** ****************************************************************************/ +#include "qclucenefieldnames_p.h" #include "qhelpenginecore.h" #include "fulltextsearch/qsearchable_p.h" #include "fulltextsearch/qqueryparser_p.h" @@ -118,7 +119,7 @@ void QHelpSearchIndexReaderClucene::run() const QStringList attribList = engine.filterAttributes(engine.currentFilter()); if (!attribList.isEmpty()) { QCLuceneQuery* query = QCLuceneQueryParser::parse(QLatin1String("+") - + attribList.join(QLatin1String(" +")), QLatin1String("attribute"), analyzer); + + attribList.join(QLatin1String(" +")), AttributeField, analyzer); if (!query) { emit searchingFinished(0); @@ -136,7 +137,7 @@ void QHelpSearchIndexReaderClucene::run() if (buildTryHarderQuery(tryHarderQuery, queryList, analyzer)) { if (!attribList.isEmpty()) { QCLuceneQuery* query = QCLuceneQueryParser::parse(QLatin1String("+") - + attribList.join(QLatin1String(" +")), QLatin1String("attribute"), + + attribList.join(QLatin1String(" +")), AttributeField, analyzer); tryHarderQuery.add(query, true, true, false); } @@ -151,11 +152,11 @@ void QHelpSearchIndexReaderClucene::run() for (qint32 i = 0; i < hits.length(); i++) { document = hits.document(i); - const QString path = document.get(QLatin1String("path")); + const QString path = document.get(PathField); if (!pathSet.contains(path) && namespaceList.contains( - document.get(QLatin1String("namespace")), Qt::CaseInsensitive)) { + document.get(NamespaceField), Qt::CaseInsensitive)) { pathSet.insert(path); - hitList.append(qMakePair(path, document.get(QLatin1String("title")))); + hitList.append(qMakePair(path, document.get(TitleField))); } document.clear(); @@ -188,11 +189,8 @@ void QHelpSearchIndexReaderClucene::run() bool QHelpSearchIndexReaderClucene::defaultQuery(const QString &term, QCLuceneBooleanQuery &booleanQuery, QCLuceneStandardAnalyzer &analyzer) { - const QLatin1String c("content"); - const QLatin1String t("titleTokenized"); - - QCLuceneQuery *query = QCLuceneQueryParser::parse(term, c, analyzer); - QCLuceneQuery *query2 = QCLuceneQueryParser::parse(term, t, analyzer); + QCLuceneQuery *query = QCLuceneQueryParser::parse(term, ContentField, analyzer); + QCLuceneQuery *query2 = QCLuceneQueryParser::parse(term, TitleTokenizedField, analyzer); if (query && query2) { booleanQuery.add(query, true, false, false); booleanQuery.add(query2, true, false, false); @@ -224,9 +222,9 @@ bool QHelpSearchIndexReaderClucene::buildQuery(QCLuceneBooleanQuery &booleanQuer continue; QCLuceneQuery *query = new QCLuceneTermQuery(QCLuceneTerm( - QLatin1String("content"), term.toLower())); + ContentField, term.toLower())); QCLuceneQuery *query2 = new QCLuceneTermQuery(QCLuceneTerm( - QLatin1String("titleTokenized"), term.toLower())); + TitleTokenizedField, term.toLower())); if (query && query2) { booleanQuery.add(query, true, false, true); @@ -245,14 +243,14 @@ bool QHelpSearchIndexReaderClucene::buildQuery(QCLuceneBooleanQuery &booleanQuer QStringList stopWords = QCLuceneStopAnalyzer().englishStopWords(); foreach (const QString &term, termList) { if (!stopWords.contains(term, Qt::CaseInsensitive)) - q->addTerm(QCLuceneTerm(QLatin1String("content"), term.toLower())); + q->addTerm(QCLuceneTerm(ContentField, term.toLower())); } booleanQuery.add(q, true, true, false); } else { QCLuceneQuery *query = new QCLuceneTermQuery(QCLuceneTerm( - QLatin1String("content"), term.toLower())); + ContentField, term.toLower())); QCLuceneQuery *query2 = new QCLuceneTermQuery(QCLuceneTerm( - QLatin1String("titleTokenized"), term.toLower())); + TitleTokenizedField, term.toLower())); if (query && query2) { booleanQuery.add(query, true, true, false); @@ -270,7 +268,7 @@ bool QHelpSearchIndexReaderClucene::buildQuery(QCLuceneBooleanQuery &booleanQuer continue; QCLuceneQuery *query = new QCLuceneTermQuery(QCLuceneTerm( - QLatin1String("content"), term.toLower())); + ContentField, term.toLower())); if (query) { booleanQuery.add(query, true, true, false); @@ -283,7 +281,7 @@ bool QHelpSearchIndexReaderClucene::buildQuery(QCLuceneBooleanQuery &booleanQuer case QHelpSearchQuery::DEFAULT: { foreach (const QString &term, query.wordList) { QCLuceneQuery *query = QCLuceneQueryParser::parse(term.toLower(), - QLatin1String("content"), analyzer); + ContentField, analyzer); if (query) booleanQuery.add(query, true, true, false); @@ -312,7 +310,7 @@ bool QHelpSearchIndexReaderClucene::buildTryHarderQuery(QCLuceneBooleanQuery &bo case QHelpSearchQuery::DEFAULT: { foreach (const QString &term, query.wordList) { QCLuceneQuery *query = QCLuceneQueryParser::parse(term.toLower(), - QLatin1String("content"), analyzer); + ContentField, analyzer); if (query) { retVal = true; @@ -336,21 +334,22 @@ void QHelpSearchIndexReaderClucene::boostSearchHits(const QHelpEngineCore &engin QCLuceneStandardAnalyzer analyzer; QCLuceneQuery *parsedQuery = QCLuceneQueryParser::parse( - joinedQuery, QLatin1String("content"), analyzer); + joinedQuery, ContentField, analyzer); if (parsedQuery) { joinedQuery = parsedQuery->toString(); delete parsedQuery; } - int length = QString(QLatin1String("content:")).length(); - int index = joinedQuery.indexOf(QLatin1String("content:")); + const QString contentString(ContentField + QLatin1String(":")); + int length = contentString.length(); + int index = joinedQuery.indexOf(contentString); QString term; int nextIndex = 0; QStringList searchTerms; while (index != -1) { - nextIndex = joinedQuery.indexOf(QLatin1String("content:"), index + 1); + nextIndex = joinedQuery.indexOf(contentString, index + 1); term = joinedQuery.mid(index + length, nextIndex - (length + index)).simplified(); if (term.startsWith(QLatin1String("\"")) && term.endsWith(QLatin1String("\""))) { diff --git a/tools/assistant/lib/qhelpsearchindexwriter_clucene.cpp b/tools/assistant/lib/qhelpsearchindexwriter_clucene.cpp index 284cbd3..80ee933 100644 --- a/tools/assistant/lib/qhelpsearchindexwriter_clucene.cpp +++ b/tools/assistant/lib/qhelpsearchindexwriter_clucene.cpp @@ -39,6 +39,7 @@ ** ****************************************************************************/ +#include "qclucenefieldnames_p.h" #include "qhelpenginecore.h" #include "qhelp_global.h" #include "fulltextsearch/qhits_p.h" @@ -407,17 +408,17 @@ public: QString parsedTitle = QHelpGlobal::documentTitle(data); if(!parsedData.isEmpty()) { - document->add(new QCLuceneField(QLatin1String("content"), + document->add(new QCLuceneField(ContentField, parsedData,QCLuceneField::INDEX_TOKENIZED)); - document->add(new QCLuceneField(QLatin1String("path"), fileName, + document->add(new QCLuceneField(PathField, fileName, QCLuceneField::STORE_YES | QCLuceneField::INDEX_UNTOKENIZED)); - document->add(new QCLuceneField(QLatin1String("title"), parsedTitle, + document->add(new QCLuceneField(TitleField, parsedTitle, QCLuceneField::STORE_YES | QCLuceneField::INDEX_UNTOKENIZED)); - document->add(new QCLuceneField(QLatin1String("titleTokenized"), parsedTitle, + document->add(new QCLuceneField(TitleTokenizedField, parsedTitle, QCLuceneField::STORE_YES | QCLuceneField::INDEX_TOKENIZED)); - document->add(new QCLuceneField(QLatin1String("namespace"), namespaceName, + document->add(new QCLuceneField(NamespaceField, namespaceName, QCLuceneField::STORE_YES | QCLuceneField::INDEX_UNTOKENIZED)); - document->add(new QCLuceneField(QLatin1String("attribute"), attributes, + document->add(new QCLuceneField(AttributeField, attributes, QCLuceneField::STORE_YES | QCLuceneField::INDEX_TOKENIZED)); return true; } @@ -712,9 +713,7 @@ void QHelpSearchIndexWriter::run() if (indexMap.contains(namespaceName)) { // make sure we really have content indexed for namespace - // NOTE: Extra variable just for GCC 3.3.5 - QLatin1String key("namespace"); - QCLuceneTermQuery query(QCLuceneTerm(key, namespaceName)); + QCLuceneTermQuery query(QCLuceneTerm(NamespaceField, namespaceName)); QCLuceneIndexSearcher indexSearcher(indexPath); QCLuceneHits hits = indexSearcher.search(query); if (hits.length() <= 0) @@ -857,8 +856,7 @@ void QHelpSearchIndexWriter::removeDocuments(const QString &indexPath, return; QCLuceneIndexReader reader = QCLuceneIndexReader::open(indexPath); - reader.deleteDocuments(QCLuceneTerm(QLatin1String("namespace"), - namespaceName)); + reader.deleteDocuments(QCLuceneTerm(NamespaceField, namespaceName)); reader.close(); } -- cgit v0.12 From b1aa8738a32fbda60f3973ee968ff395fd8af924 Mon Sep 17 00:00:00 2001 From: ck Date: Wed, 4 Nov 2009 14:56:22 +0100 Subject: Assistant: Improve search results. We now give precedence to matches in document titles. Task-number: QT-666 Reviewed-by: kh1 --- .../lib/qhelpsearchindexreader_clucene.cpp | 406 +++++++++++++-------- .../lib/qhelpsearchindexreader_clucene_p.h | 45 ++- 2 files changed, 282 insertions(+), 169 deletions(-) diff --git a/tools/assistant/lib/qhelpsearchindexreader_clucene.cpp b/tools/assistant/lib/qhelpsearchindexreader_clucene.cpp index 0d46d8e..e180375 100644 --- a/tools/assistant/lib/qhelpsearchindexreader_clucene.cpp +++ b/tools/assistant/lib/qhelpsearchindexreader_clucene.cpp @@ -39,17 +39,19 @@ ** ****************************************************************************/ +#include "fulltextsearch/qindexreader_p.h" +#include "fulltextsearch/qqueryparser_p.h" +#include "fulltextsearch/qsearchable_p.h" #include "qclucenefieldnames_p.h" #include "qhelpenginecore.h" -#include "fulltextsearch/qsearchable_p.h" -#include "fulltextsearch/qqueryparser_p.h" -#include "fulltextsearch/qindexreader_p.h" + #include "qhelpsearchindexreader_clucene_p.h" #include #include #include #include +#include #include #include #include @@ -109,64 +111,88 @@ void QHelpSearchIndexReaderClucene::run() #if !defined(QT_NO_EXCEPTIONS) try { #endif - QCLuceneBooleanQuery booleanQuery; + QCLuceneBooleanQuery booleanQueryTitle; + QCLuceneBooleanQuery booleanQueryContent; QCLuceneStandardAnalyzer analyzer; - if (!buildQuery(booleanQuery, queryList, analyzer)) { + const QStringList& attribList = + engine.filterAttributes(engine.currentFilter()); + bool titleQueryIsValid = buildQuery(queryList, TitleTokenizedField, + attribList, booleanQueryTitle, analyzer); + bool contentQueryIsValid = buildQuery(queryList, ContentField, + attribList, booleanQueryContent, analyzer); + if (!titleQueryIsValid && !contentQueryIsValid) { emit searchingFinished(0); return; } - const QStringList attribList = engine.filterAttributes(engine.currentFilter()); - if (!attribList.isEmpty()) { - QCLuceneQuery* query = QCLuceneQueryParser::parse(QLatin1String("+") - + attribList.join(QLatin1String(" +")), AttributeField, analyzer); + QCLuceneIndexSearcher indexSearcher(indexPath); - if (!query) { + // QCLuceneHits object must be allocated on the heap, because + // there is no default constructor. + QSharedPointer titleHits; + QSharedPointer contentHits; + if (titleQueryIsValid) { + titleHits = QSharedPointer(new QCLuceneHits( + indexSearcher.search(booleanQueryTitle))); + } + if (contentQueryIsValid) { + contentHits = QSharedPointer(new QCLuceneHits( + indexSearcher.search(booleanQueryContent))); + } + bool boost = true; + if ((titleHits.isNull() || titleHits->length() == 0) + && (contentHits.isNull() || contentHits->length() == 0)) { + booleanQueryTitle = QCLuceneBooleanQuery(); + booleanQueryContent = QCLuceneBooleanQuery(); + titleQueryIsValid = + buildTryHarderQuery(queryList, TitleTokenizedField, + attribList, booleanQueryTitle, analyzer); + contentQueryIsValid = + buildTryHarderQuery(queryList, ContentField, attribList, + booleanQueryContent, analyzer); + if (!titleQueryIsValid && !contentQueryIsValid) { emit searchingFinished(0); return; } - booleanQuery.add(query, true, true, false); - } - - QCLuceneIndexSearcher indexSearcher(indexPath); - QCLuceneHits hits = indexSearcher.search(booleanQuery); - - bool boost = true; - QCLuceneBooleanQuery tryHarderQuery; - if (hits.length() == 0) { - if (buildTryHarderQuery(tryHarderQuery, queryList, analyzer)) { - if (!attribList.isEmpty()) { - QCLuceneQuery* query = QCLuceneQueryParser::parse(QLatin1String("+") - + attribList.join(QLatin1String(" +")), AttributeField, - analyzer); - tryHarderQuery.add(query, true, true, false); - } - hits = indexSearcher.search(tryHarderQuery); - boost = (hits.length() == 0); + if (titleQueryIsValid) { + titleHits = QSharedPointer(new QCLuceneHits( + indexSearcher.search(booleanQueryTitle))); + } + if (contentQueryIsValid) { + contentHits = QSharedPointer(new QCLuceneHits( + indexSearcher.search(booleanQueryContent))); } + boost = false; } + QList > cluceneHitsList; + if (!titleHits.isNull()) + cluceneHitsList.append(titleHits); + if (!contentHits.isNull()) + cluceneHitsList.append(contentHits); QSet pathSet; QCLuceneDocument document; const QStringList namespaceList = engine.registeredDocumentations(); - for (qint32 i = 0; i < hits.length(); i++) { - document = hits.document(i); - const QString path = document.get(PathField); - if (!pathSet.contains(path) && namespaceList.contains( - document.get(NamespaceField), Qt::CaseInsensitive)) { - pathSet.insert(path); - hitList.append(qMakePair(path, document.get(TitleField))); - } - document.clear(); + foreach (QSharedPointer hits, cluceneHitsList) { + for (qint32 i = 0; i < hits->length(); i++) { + document = hits->document(i); + const QString path = document.get(PathField); + if (!pathSet.contains(path) && namespaceList.contains( + document.get(NamespaceField), Qt::CaseInsensitive)) { + pathSet.insert(path); + hitList.append(qMakePair(path, document.get(TitleField))); + } + document.clear(); - mutex.lock(); - if (m_cancel) { + mutex.lock(); + if (m_cancel) { + mutex.unlock(); + emit searchingFinished(0); + return; + } mutex.unlock(); - emit searchingFinished(0); - return; } - mutex.unlock(); } indexSearcher.close(); @@ -186,141 +212,205 @@ void QHelpSearchIndexReaderClucene::run() } } -bool QHelpSearchIndexReaderClucene::defaultQuery(const QString &term, QCLuceneBooleanQuery &booleanQuery, - QCLuceneStandardAnalyzer &analyzer) +bool QHelpSearchIndexReaderClucene::buildQuery( + const QList &queries, const QString &fieldName, + const QStringList &filterAttributes, QCLuceneBooleanQuery &booleanQuery, + QCLuceneAnalyzer &analyzer) { - QCLuceneQuery *query = QCLuceneQueryParser::parse(term, ContentField, analyzer); - QCLuceneQuery *query2 = QCLuceneQueryParser::parse(term, TitleTokenizedField, analyzer); - if (query && query2) { - booleanQuery.add(query, true, false, false); - booleanQuery.add(query2, true, false, false); - return true; + bool queryIsValid = false; + foreach (const QHelpSearchQuery &query, queries) { + if (fieldName != ContentField && isNegativeQuery(query)) { + queryIsValid = false; + break; + } + switch (query.fieldName) { + case QHelpSearchQuery::FUZZY: + if (addFuzzyQuery(query, fieldName, booleanQuery, analyzer)) + queryIsValid = true; + break; + case QHelpSearchQuery::WITHOUT: + if (fieldName != ContentField) + return false; + if (addWithoutQuery(query, fieldName, booleanQuery)) + queryIsValid = true; + break; + case QHelpSearchQuery::PHRASE: + if (addPhraseQuery(query, fieldName, booleanQuery)) + queryIsValid = true; + break; + case QHelpSearchQuery::ALL: + if (addAllQuery(query, fieldName, booleanQuery)) + queryIsValid = true; + break; + case QHelpSearchQuery::DEFAULT: + if (addDefaultQuery(query, fieldName, true, booleanQuery, analyzer)) + queryIsValid = true; + break; + case QHelpSearchQuery::ATLEAST: + if (addAtLeastQuery(query, fieldName, booleanQuery, analyzer)) + queryIsValid = true; + break; + default: + Q_ASSERT(!"Invalid field name"); + } } - return false; + if (queryIsValid && !filterAttributes.isEmpty()) { + queryIsValid = + addAttributesQuery(filterAttributes, booleanQuery, analyzer); + } + + return queryIsValid; } -bool QHelpSearchIndexReaderClucene::buildQuery(QCLuceneBooleanQuery &booleanQuery, - const QList &queryList, QCLuceneStandardAnalyzer &analyzer) +bool QHelpSearchIndexReaderClucene::buildTryHarderQuery( + const QList &queries, const QString &fieldName, + const QStringList &filterAttributes, QCLuceneBooleanQuery &booleanQuery, + QCLuceneAnalyzer &analyzer) { - foreach (const QHelpSearchQuery query, queryList) { - switch (query.fieldName) { - case QHelpSearchQuery::FUZZY: { - const QLatin1String fuzzy("~"); - foreach (const QString &term, query.wordList) { - if (term.isEmpty() - || !defaultQuery(term.toLower() + fuzzy, booleanQuery, analyzer)) { - return false; - } - } - } break; - - case QHelpSearchQuery::WITHOUT: { - QStringList stopWords = QCLuceneStopAnalyzer().englishStopWords(); - foreach (const QString &term, query.wordList) { - if (stopWords.contains(term, Qt::CaseInsensitive)) - continue; - - QCLuceneQuery *query = new QCLuceneTermQuery(QCLuceneTerm( - ContentField, term.toLower())); - QCLuceneQuery *query2 = new QCLuceneTermQuery(QCLuceneTerm( - TitleTokenizedField, term.toLower())); - - if (query && query2) { - booleanQuery.add(query, true, false, true); - booleanQuery.add(query2, true, false, true); - } else { - return false; - } - } - } break; - - case QHelpSearchQuery::PHRASE: { - const QString &term = query.wordList.at(0).toLower(); - if (term.contains(QLatin1Char(' '))) { - QStringList termList = term.split(QLatin1String(" ")); - QCLucenePhraseQuery *q = new QCLucenePhraseQuery(); - QStringList stopWords = QCLuceneStopAnalyzer().englishStopWords(); - foreach (const QString &term, termList) { - if (!stopWords.contains(term, Qt::CaseInsensitive)) - q->addTerm(QCLuceneTerm(ContentField, term.toLower())); - } - booleanQuery.add(q, true, true, false); - } else { - QCLuceneQuery *query = new QCLuceneTermQuery(QCLuceneTerm( - ContentField, term.toLower())); - QCLuceneQuery *query2 = new QCLuceneTermQuery(QCLuceneTerm( - TitleTokenizedField, term.toLower())); - - if (query && query2) { - booleanQuery.add(query, true, true, false); - booleanQuery.add(query2, true, false, false); - } else { - return false; - } - } - } break; + if (queries.isEmpty()) + return false; + const QHelpSearchQuery &query = queries.front(); + if (query.fieldName != QHelpSearchQuery::DEFAULT) + return false; + if (isNegativeQuery(query)) + return false; + if (!addDefaultQuery(query, fieldName, false, booleanQuery, analyzer)) + return false; + if (filterAttributes.isEmpty()) + return true; + return addAttributesQuery(filterAttributes, booleanQuery, analyzer); +} - case QHelpSearchQuery::ALL: { - QStringList stopWords = QCLuceneStopAnalyzer().englishStopWords(); - foreach (const QString &term, query.wordList) { - if (stopWords.contains(term, Qt::CaseInsensitive)) - continue; +bool QHelpSearchIndexReaderClucene::isNegativeQuery(const QHelpSearchQuery &query) const +{ + const QString &search = query.wordList.join(" "); + return search.contains('!') || search.contains('-') + || search.contains(QLatin1String(" NOT ")); +} - QCLuceneQuery *query = new QCLuceneTermQuery(QCLuceneTerm( - ContentField, term.toLower())); +bool QHelpSearchIndexReaderClucene::addFuzzyQuery(const QHelpSearchQuery &query, + const QString &fieldName, QCLuceneBooleanQuery &booleanQuery, + QCLuceneAnalyzer &analyzer) +{ + bool queryIsValid = false; + const QLatin1String fuzzy("~"); + foreach (const QString &term, query.wordList) { + if (!term.isEmpty()) { + QCLuceneQuery *lQuery = + QCLuceneQueryParser::parse(term + fuzzy, fieldName, analyzer); + if (lQuery != 0) { + booleanQuery.add(lQuery, true, false, false); + queryIsValid = true; + } + } + } + return queryIsValid; +} - if (query) { - booleanQuery.add(query, true, true, false); - } else { - return false; - } - } - } break; +bool QHelpSearchIndexReaderClucene::addWithoutQuery(const QHelpSearchQuery &query, + const QString &fieldName, QCLuceneBooleanQuery &booleanQuery) +{ + bool queryIsValid = false; + const QStringList &stopWords = QCLuceneStopAnalyzer().englishStopWords(); + foreach (const QString &term, query.wordList) { + if (stopWords.contains(term, Qt::CaseInsensitive)) + continue; + QCLuceneQuery *lQuery = new QCLuceneTermQuery(QCLuceneTerm( + fieldName, term.toLower())); + booleanQuery.add(lQuery, true, false, true); + queryIsValid = true; + } + return queryIsValid; +} - case QHelpSearchQuery::DEFAULT: { - foreach (const QString &term, query.wordList) { - QCLuceneQuery *query = QCLuceneQueryParser::parse(term.toLower(), - ContentField, analyzer); +bool QHelpSearchIndexReaderClucene::addPhraseQuery(const QHelpSearchQuery &query, + const QString &fieldName, QCLuceneBooleanQuery &booleanQuery) +{ + bool queryIsValid = false; + const QString &term = query.wordList.at(0).toLower(); + if (term.contains(QLatin1Char(' '))) { + const QStringList termList = term.split(QLatin1String(" ")); + QCLucenePhraseQuery *q = new QCLucenePhraseQuery(); + const QStringList stopWords = QCLuceneStopAnalyzer().englishStopWords(); + foreach (const QString &term, termList) { + if (!stopWords.contains(term, Qt::CaseInsensitive)) + q->addTerm(QCLuceneTerm(fieldName, term.toLower())); + } + if (!q->getTerms().isEmpty()) { + booleanQuery.add(q, true, true, false); + queryIsValid = true; + } + } else { + QCLuceneQuery *lQuery = new QCLuceneTermQuery(QCLuceneTerm( + fieldName, term.toLower())); + booleanQuery.add(lQuery, true, true, false); + queryIsValid = true; + } + return queryIsValid; +} - if (query) - booleanQuery.add(query, true, true, false); - } - } break; +bool QHelpSearchIndexReaderClucene::addAllQuery(const QHelpSearchQuery &query, + const QString &fieldName, QCLuceneBooleanQuery &booleanQuery) +{ + bool queryIsValid = false; + const QStringList &stopWords = QCLuceneStopAnalyzer().englishStopWords(); + foreach (const QString &term, query.wordList) { + if (stopWords.contains(term, Qt::CaseInsensitive)) + continue; + QCLuceneQuery *lQuery = new QCLuceneTermQuery(QCLuceneTerm( + fieldName, term.toLower())); + booleanQuery.add(lQuery, true, true, false); + queryIsValid = true; + } + return queryIsValid; +} - case QHelpSearchQuery::ATLEAST: { - foreach (const QString &term, query.wordList) { - if (term.isEmpty() || !defaultQuery(term.toLower(), booleanQuery, analyzer)) - return false; - } - } +bool QHelpSearchIndexReaderClucene::addDefaultQuery(const QHelpSearchQuery &query, + const QString &fieldName, bool allTermsRequired, + QCLuceneBooleanQuery &booleanQuery, + QCLuceneAnalyzer &analyzer) +{ + bool queryIsValid = false; + foreach (const QString &term, query.wordList) { + QCLuceneQuery *lQuery = + QCLuceneQueryParser::parse(term.toLower(), fieldName, analyzer); + if (lQuery) { + booleanQuery.add(lQuery, true, allTermsRequired, false); + queryIsValid = true; } } - - return true; + return queryIsValid; } -bool QHelpSearchIndexReaderClucene::buildTryHarderQuery(QCLuceneBooleanQuery &booleanQuery, - const QList &queryList, QCLuceneStandardAnalyzer &analyzer) +bool QHelpSearchIndexReaderClucene::addAtLeastQuery( + const QHelpSearchQuery &query, const QString &fieldName, + QCLuceneBooleanQuery &booleanQuery, QCLuceneAnalyzer &analyzer) { - bool retVal = false; - foreach (const QHelpSearchQuery query, queryList) { - switch (query.fieldName) { - default: break; - case QHelpSearchQuery::DEFAULT: { - foreach (const QString &term, query.wordList) { - QCLuceneQuery *query = QCLuceneQueryParser::parse(term.toLower(), - ContentField, analyzer); - - if (query) { - retVal = true; - booleanQuery.add(query, true, false, false); - } - } - } break; + bool queryIsValid = false; + foreach (const QString &term, query.wordList) { + if (!term.isEmpty()) { + QCLuceneQuery *lQuery = + QCLuceneQueryParser::parse(term, fieldName, analyzer); + if (lQuery) { + booleanQuery.add(lQuery, true, false, false); + queryIsValid = true; + } } } - return retVal; + return queryIsValid; +} + +bool QHelpSearchIndexReaderClucene::addAttributesQuery( + const QStringList &filterAttributes, QCLuceneBooleanQuery &booleanQuery, + QCLuceneAnalyzer &analyzer) +{ + QCLuceneQuery* lQuery = QCLuceneQueryParser::parse(QLatin1String("+") + + filterAttributes.join(QLatin1String(" +")), AttributeField, analyzer); + if (!lQuery) + return false; + booleanQuery.add(lQuery, true, true, false); + return true; } void QHelpSearchIndexReaderClucene::boostSearchHits(const QHelpEngineCore &engine, diff --git a/tools/assistant/lib/qhelpsearchindexreader_clucene_p.h b/tools/assistant/lib/qhelpsearchindexreader_clucene_p.h index d7b539a..608668f 100644 --- a/tools/assistant/lib/qhelpsearchindexreader_clucene_p.h +++ b/tools/assistant/lib/qhelpsearchindexreader_clucene_p.h @@ -53,16 +53,19 @@ // We mean it. // -#include "qhelpsearchindexreader_p.h" +#include +#include +#include #include "fulltextsearch/qanalyzer_p.h" #include "fulltextsearch/qquery_p.h" +#include "qhelpsearchindexreader_p.h" QT_BEGIN_NAMESPACE namespace qt { - namespace fulltextsearch { - namespace clucene { +namespace fulltextsearch { +namespace clucene { class QHelpSearchIndexReaderClucene : public QHelpSearchIndexReader { @@ -74,18 +77,38 @@ public: private: void run(); - bool defaultQuery(const QString &term, QCLuceneBooleanQuery &booleanQuery, - QCLuceneStandardAnalyzer &analyzer); - bool buildQuery(QCLuceneBooleanQuery &booleanQuery, const QList &queryList, - QCLuceneStandardAnalyzer &analyzer); - bool buildTryHarderQuery(QCLuceneBooleanQuery &booleanQuery, - const QList &queryList, QCLuceneStandardAnalyzer &analyzer); void boostSearchHits(const QHelpEngineCore &engine, QList &hitList, const QList &queryList); + bool buildQuery(const QList &queries, + const QString &fieldName, + const QStringList &filterAttributes, + QCLuceneBooleanQuery &booleanQuery, + QCLuceneAnalyzer &analyzer); + bool buildTryHarderQuery(const QList &queries, + const QString &fieldName, + const QStringList &filterAttributes, + QCLuceneBooleanQuery &booleanQuery, + QCLuceneAnalyzer &analyzer); + bool addFuzzyQuery(const QHelpSearchQuery &query, const QString &fieldName, + QCLuceneBooleanQuery &booleanQuery, QCLuceneAnalyzer &analyzer); + bool addWithoutQuery(const QHelpSearchQuery &query, const QString &fieldName, + QCLuceneBooleanQuery &booleanQuery); + bool addPhraseQuery(const QHelpSearchQuery &query, const QString &fieldName, + QCLuceneBooleanQuery &booleanQuery); + bool addAllQuery(const QHelpSearchQuery &query, const QString &fieldName, + QCLuceneBooleanQuery &booleanQuery); + bool addDefaultQuery(const QHelpSearchQuery &query, const QString &fieldName, + bool allTermsRequired, QCLuceneBooleanQuery &booleanQuery, + QCLuceneAnalyzer &analyzer); + bool addAtLeastQuery(const QHelpSearchQuery &query, const QString &fieldName, + QCLuceneBooleanQuery &booleanQuery, QCLuceneAnalyzer &analyzer); + bool addAttributesQuery(const QStringList &filterAttributes, + QCLuceneBooleanQuery &booleanQuery, QCLuceneAnalyzer &analyzer); + bool isNegativeQuery(const QHelpSearchQuery &query) const; }; - } // namespace clucene - } // namespace fulltextsearch +} // namespace clucene +} // namespace fulltextsearch } // namespace qt QT_END_NAMESPACE -- cgit v0.12 From 58ed656207f6bcde316568a80e8fec378fcd58bb Mon Sep 17 00:00:00 2001 From: kh1 Date: Tue, 3 Nov 2009 16:46:24 +0100 Subject: Fix missing quit shortcut on windows. Reviewed-by: kh --- tools/assistant/tools/assistant/mainwindow.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/assistant/tools/assistant/mainwindow.cpp b/tools/assistant/tools/assistant/mainwindow.cpp index de3f695..2fc34d9 100644 --- a/tools/assistant/tools/assistant/mainwindow.cpp +++ b/tools/assistant/tools/assistant/mainwindow.cpp @@ -445,8 +445,12 @@ void MainWindow::setupActions() m_closeTabAction->setShortcuts(QKeySequence::Close); QAction *tmp = menu->addAction(tr("&Quit"), this, SLOT(close())); - tmp->setShortcut(QKeySequence::Quit); tmp->setMenuRole(QAction::QuitRole); +#ifdef Q_OS_WIN + tmp->setShortcut(QKeySequence(tr("CTRL+Q"))); +#else + tmp->setShortcut(QKeySequence::Quit); +#endif menu = menuBar()->addMenu(tr("&Edit")); m_copyAction = menu->addAction(tr("&Copy selected Text"), m_centralWidget, -- cgit v0.12 From bb19f071fe400474363688b350225d896cb19140 Mon Sep 17 00:00:00 2001 From: kh1 Date: Tue, 3 Nov 2009 16:54:50 +0100 Subject: Fix internal help versioning number. --- tools/assistant/tools/assistant/assistant.qch | Bin 368640 -> 364544 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/tools/assistant/tools/assistant/assistant.qch b/tools/assistant/tools/assistant/assistant.qch index 3e66bd9..e6d5299 100644 Binary files a/tools/assistant/tools/assistant/assistant.qch and b/tools/assistant/tools/assistant/assistant.qch differ -- cgit v0.12 From 8e70c556dd46b7295f17108953daa0025b4c69ab Mon Sep 17 00:00:00 2001 From: kh1 Date: Wed, 4 Nov 2009 14:52:29 +0100 Subject: Implement bookmark export/import. Task-number: QTBUG-4125 Reviewed-by: ck --- tools/assistant/tools/assistant/assistant.pro | 6 +- .../assistant/tools/assistant/assistant_images.qrc | 1 + .../assistant/tools/assistant/bookmarkmanager.cpp | 16 +- tools/assistant/tools/assistant/bookmarkmanager.h | 1 + .../assistant/tools/assistant/images/bookmark.png | Bin 0 -> 1266 bytes tools/assistant/tools/assistant/mainwindow.cpp | 51 ++++- tools/assistant/tools/assistant/mainwindow.h | 5 + tools/assistant/tools/assistant/xbelsupport.cpp | 234 +++++++++++++++++++++ tools/assistant/tools/assistant/xbelsupport.h | 87 ++++++++ 9 files changed, 390 insertions(+), 11 deletions(-) create mode 100644 tools/assistant/tools/assistant/images/bookmark.png create mode 100644 tools/assistant/tools/assistant/xbelsupport.cpp create mode 100644 tools/assistant/tools/assistant/xbelsupport.h diff --git a/tools/assistant/tools/assistant/assistant.pro b/tools/assistant/tools/assistant/assistant.pro index 1cbd1d3..00d0060 100644 --- a/tools/assistant/tools/assistant/assistant.pro +++ b/tools/assistant/tools/assistant/assistant.pro @@ -38,7 +38,8 @@ HEADERS += helpviewer.h \ remotecontrol.h \ cmdlineparser.h \ aboutdialog.h \ - qtdocinstaller.h + qtdocinstaller.h \ + xbelsupport.h win32 { HEADERS += remotecontrol_win.h @@ -59,7 +60,8 @@ SOURCES += helpviewer.cpp \ remotecontrol.cpp \ cmdlineparser.cpp \ aboutdialog.cpp \ - qtdocinstaller.cpp + qtdocinstaller.cpp \ + xbelsupport.cpp FORMS += topicchooser.ui \ preferencesdialog.ui \ diff --git a/tools/assistant/tools/assistant/assistant_images.qrc b/tools/assistant/tools/assistant/assistant_images.qrc index 58e03b5..34918c0 100644 --- a/tools/assistant/tools/assistant/assistant_images.qrc +++ b/tools/assistant/tools/assistant/assistant_images.qrc @@ -4,6 +4,7 @@ images/assistant-128.png images/assistant.png images/wrap.png + images/bookmark.png #mac images/mac/addtab.png images/mac/book.png diff --git a/tools/assistant/tools/assistant/bookmarkmanager.cpp b/tools/assistant/tools/assistant/bookmarkmanager.cpp index 9cccd82..881525c 100644 --- a/tools/assistant/tools/assistant/bookmarkmanager.cpp +++ b/tools/assistant/tools/assistant/bookmarkmanager.cpp @@ -301,7 +301,7 @@ bool BookmarkDialog::eventFilter(QObject *object, QEvent *e) } -// #pragma mark -- BookmarkWidget +// BookmarkWidget BookmarkWidget::BookmarkWidget(BookmarkManager *manager, QWidget *parent, @@ -587,7 +587,7 @@ bool BookmarkWidget::eventFilter(QObject *object, QEvent *e) } -// #pragma mark -- BookmarkModel +// BookmarkModel BookmarkModel::BookmarkModel(int rows, int columns, QObject *parent) @@ -615,7 +615,7 @@ Qt::ItemFlags BookmarkModel::flags(const QModelIndex &index) const } -// #pragma mark -- BookmarkManager +// BookmarkManager BookmarkManager::BookmarkManager(QHelpEngineCore *_helpEngine) @@ -624,6 +624,7 @@ BookmarkManager::BookmarkManager(QHelpEngineCore *_helpEngine) , helpEngine(_helpEngine) { folderIcon = QApplication::style()->standardIcon(QStyle::SP_DirClosedIcon); + bookmarkIcon = QIcon(QLatin1String(":/trolltech/assistant/images/bookmark.png")); connect(treeModel, SIGNAL(itemChanged(QStandardItem*)), this, SLOT(itemChanged(QStandardItem*))); @@ -733,6 +734,7 @@ void BookmarkManager::addNewBookmark(const QModelIndex &index, { QStandardItem *item = new QStandardItem(name); item->setEditable(false); + item->setIcon(bookmarkIcon); item->setData(false, Qt::UserRole + 11); item->setData(url, Qt::UserRole + 10); @@ -832,10 +834,12 @@ void BookmarkManager::setupBookmarkModels() } } - if (type == QLatin1String("Folder")) - item->setIcon(folderIcon); - else + if (type != QLatin1String("Folder")) { + item->setIcon(bookmarkIcon); listModel->appendRow(item->clone()); + } else { + item->setIcon(folderIcon); + } } } diff --git a/tools/assistant/tools/assistant/bookmarkmanager.h b/tools/assistant/tools/assistant/bookmarkmanager.h index aba7da0..fab8790 100644 --- a/tools/assistant/tools/assistant/bookmarkmanager.h +++ b/tools/assistant/tools/assistant/bookmarkmanager.h @@ -202,6 +202,7 @@ private: private: QString oldText; QIcon folderIcon; + QIcon bookmarkIcon; BookmarkModel *treeModel; BookmarkModel *listModel; diff --git a/tools/assistant/tools/assistant/images/bookmark.png b/tools/assistant/tools/assistant/images/bookmark.png new file mode 100644 index 0000000..57e57e3 Binary files /dev/null and b/tools/assistant/tools/assistant/images/bookmark.png differ diff --git a/tools/assistant/tools/assistant/mainwindow.cpp b/tools/assistant/tools/assistant/mainwindow.cpp index 2fc34d9..84b1407 100644 --- a/tools/assistant/tools/assistant/mainwindow.cpp +++ b/tools/assistant/tools/assistant/mainwindow.cpp @@ -52,6 +52,7 @@ #include "aboutdialog.h" #include "searchwidget.h" #include "qtdocinstaller.h" +#include "xbelsupport.h" #include #include @@ -76,6 +77,7 @@ #include #include #include +#include #include #include @@ -382,13 +384,17 @@ void MainWindow::checkInitState() void MainWindow::updateBookmarkMenu() { if (m_bookmarkManager) { + m_bookmarkMenu->removeAction(m_importBookmarkAction); + m_bookmarkMenu->removeAction(m_exportBookmarkAction); m_bookmarkMenu->removeAction(m_bookmarkMenuAction); - + m_bookmarkMenu->clear(); - + + m_bookmarkMenu->addAction(m_importBookmarkAction); + m_bookmarkMenu->addAction(m_exportBookmarkAction); m_bookmarkMenu->addAction(m_bookmarkMenuAction); m_bookmarkMenu->addSeparator(); - + m_bookmarkManager->fillBookmarkMenu(m_bookmarkMenu); } } @@ -541,6 +547,10 @@ void MainWindow::setupActions() << QKeySequence(Qt::CTRL + Qt::Key_PageUp)); m_bookmarkMenu = menuBar()->addMenu(tr("&Bookmarks")); + m_importBookmarkAction = m_bookmarkMenu->addAction(tr("Import..."), + this, SLOT(importBookmarks())); + m_exportBookmarkAction = m_bookmarkMenu->addAction(tr("Export..."), + this, SLOT(exportBookmarks())); m_bookmarkMenuAction = m_bookmarkMenu->addAction(tr("Add Bookmark..."), this, SLOT(addBookmark())); m_bookmarkMenuAction->setShortcut(tr("CTRL+D")); @@ -1045,4 +1055,39 @@ QString MainWindow::defaultHelpCollectionFileName() arg(QLatin1String(QT_VERSION_STR)); } +void MainWindow::importBookmarks() +{ + const QString &fileName = QFileDialog::getOpenFileName(0, tr("Open File"), + QDir::currentPath(), tr("Files (*.xbel)")); + + if (fileName.isEmpty()) + return; + + QFile file(fileName); + if (file.open(QIODevice::ReadOnly)) { + XbelReader reader(m_bookmarkManager->treeBookmarkModel(), + m_bookmarkManager->listBookmarkModel()); + reader.readFromFile(&file); + } +} + +void MainWindow::exportBookmarks() +{ + QString fileName = QFileDialog::getSaveFileName(0, tr("Save File"), + "untitled.xbel", tr("Files (*.xbel)")); + + QLatin1String suffix(".xbel"); + if (!fileName.endsWith(suffix)) + fileName.append(suffix); + + QFile file(fileName); + if (file.open(QIODevice::WriteOnly)) { + XbelWriter writer(m_bookmarkManager->treeBookmarkModel()); + writer.writeToFile(&file); + } else { + QMessageBox::information(this, tr("Qt Assistant"), + tr("Unable to save bookmarks."), tr("OK")); + } +} + QT_END_NAMESPACE diff --git a/tools/assistant/tools/assistant/mainwindow.h b/tools/assistant/tools/assistant/mainwindow.h index 6b858e9..8e7618a 100644 --- a/tools/assistant/tools/assistant/mainwindow.h +++ b/tools/assistant/tools/assistant/mainwindow.h @@ -122,6 +122,9 @@ private slots: void updateBookmarkMenu(); void showBookmark(QAction *action); + void importBookmarks(); + void exportBookmarks(); + private: bool initHelpDB(); void setupActions(); @@ -162,6 +165,8 @@ private: QMenu *m_toolBarMenu; QMenu *m_bookmarkMenu; QAction *m_bookmarkMenuAction; + QAction *m_importBookmarkAction; + QAction *m_exportBookmarkAction; CmdLineParser *m_cmdLine; diff --git a/tools/assistant/tools/assistant/xbelsupport.cpp b/tools/assistant/tools/assistant/xbelsupport.cpp new file mode 100644 index 0000000..545be6c --- /dev/null +++ b/tools/assistant/tools/assistant/xbelsupport.cpp @@ -0,0 +1,234 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "xbelsupport.h" +#include "bookmarkmanager.h" + +#include + +struct Bookmark { + QString title; + QString url; + bool folded; +}; + +XbelWriter::XbelWriter(BookmarkModel *model) + : QXmlStreamWriter() + , treeModel(model) +{ + setAutoFormatting(true); +} + +void XbelWriter::writeToFile(QIODevice *device) +{ + setDevice(device); + + writeStartDocument(); + writeDTD(QLatin1String("")); + writeStartElement(QLatin1String("xbel")); + writeAttribute(QLatin1String("version"), QLatin1String("1.0")); + + QStandardItem *root = treeModel->invisibleRootItem(); + for (int i = 0; i < root->rowCount(); ++i) + writeData(root->child(i)); + + writeEndDocument(); +} + +void XbelWriter::writeData(QStandardItem *child) +{ + Bookmark entry; + entry.title = child->data(Qt::DisplayRole).toString(); + entry.url = child->data(Qt::UserRole + 10).toString(); + + if (entry.url == QLatin1String("Folder")) { + writeStartElement(QLatin1String("folder")); + + entry.folded = !child->data(Qt::UserRole + 11).toBool(); + writeAttribute(QLatin1String("folded"), + entry.folded ? QLatin1String("yes") : QLatin1String("no")); + + writeTextElement(QLatin1String("title"), entry.title); + + for (int i = 0; i < child->rowCount(); ++i) + writeData(child->child(i)); + + writeEndElement(); + } else { + writeStartElement(QLatin1String("bookmark")); + writeAttribute(QLatin1String("href"), entry.url); + writeTextElement(QLatin1String("title"), entry.title); + writeEndElement(); + } +} + + +// XbelReader + + +XbelReader::XbelReader(BookmarkModel *tree, BookmarkModel *list) + : QXmlStreamReader() + , treeModel(tree) + , listModel(list) +{ + folderIcon = QApplication::style()->standardIcon(QStyle::SP_DirClosedIcon); + bookmarkIcon = QIcon(QLatin1String(":/trolltech/assistant/images/bookmark.png")); +} + +bool XbelReader::readFromFile(QIODevice *device) +{ + setDevice(device); + + while (!atEnd()) { + readNext(); + + if (isStartElement()) { + if (name() == QLatin1String("xbel") + && attributes().value(QLatin1String("version")) + == QLatin1String("1.0")) { + readXBEL(); + } else { + raiseError(QLatin1String("The file is not an XBEL version 1.0 file.")); + } + } + } + + return !error(); +} + +void XbelReader::readXBEL() +{ + while (!atEnd()) { + readNext(); + + if (isEndElement()) + break; + + if (isStartElement()) { + if (name() == QLatin1String("folder")) + readFolder(0); + else if (name() == QLatin1String("bookmark")) + readBookmark(0); + else + readUnknownElement(); + } + } +} + +void XbelReader::readUnknownElement() +{ + while (!atEnd()) { + readNext(); + + if (isEndElement()) + break; + + if (isStartElement()) + readUnknownElement(); + } +} + +void XbelReader::readFolder(QStandardItem *item) +{ + QStandardItem *folder = createChildItem(item); + folder->setIcon(folderIcon); + folder->setData(QLatin1String("Folder"), Qt::UserRole + 10); + + bool expanded = + (attributes().value(QLatin1String("folded")) != QLatin1String("no")); + folder->setData(expanded, Qt::UserRole + 11); + + while (!atEnd()) { + readNext(); + + if (isEndElement()) + break; + + if (isStartElement()) { + if (name() == QLatin1String("title")) + folder->setText(readElementText()); + else if (name() == QLatin1String("folder")) + readFolder(folder); + else if (name() == QLatin1String("bookmark")) + readBookmark(folder); + else + readUnknownElement(); + } + } +} + +void XbelReader::readBookmark(QStandardItem *item) +{ + QStandardItem *bookmark = createChildItem(item); + bookmark->setIcon(bookmarkIcon); + bookmark->setText(QCoreApplication::tr("Unknown title")); + bookmark->setData(attributes().value(QLatin1String("href")).toString(), + Qt::UserRole + 10); + + while (!atEnd()) { + readNext(); + + if (isEndElement()) + break; + + if (isStartElement()) { + if (name() == QLatin1String("title")) + bookmark->setText(readElementText()); + else + readUnknownElement(); + } + } + + listModel->appendRow(bookmark->clone()); +} + +QStandardItem *XbelReader::createChildItem(QStandardItem *item) +{ + QStandardItem *childItem = new QStandardItem(); + childItem->setEditable(false); + + if (item) + item->appendRow(childItem); + else + treeModel->appendRow(childItem); + + return childItem; +} diff --git a/tools/assistant/tools/assistant/xbelsupport.h b/tools/assistant/tools/assistant/xbelsupport.h new file mode 100644 index 0000000..177b04b --- /dev/null +++ b/tools/assistant/tools/assistant/xbelsupport.h @@ -0,0 +1,87 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef XBELSUPPORT_H +#define XBELSUPPORT_H + +#include +#include + +QT_FORWARD_DECLARE_CLASS(QIODevice) +QT_FORWARD_DECLARE_CLASS(QStandardItem) + +class BookmarkModel; + +class XbelWriter : public QXmlStreamWriter +{ +public: + XbelWriter(BookmarkModel *model); + void writeToFile(QIODevice *device); + +private: + void writeData(QStandardItem *item); + +private: + BookmarkModel *treeModel; +}; + +class XbelReader : public QXmlStreamReader +{ +public: + XbelReader(BookmarkModel *tree, BookmarkModel *list); + bool readFromFile(QIODevice *device); + +private: + void readXBEL(); + void readUnknownElement(); + void readFolder(QStandardItem *item); + void readBookmark(QStandardItem *item); + QStandardItem* createChildItem(QStandardItem *item); + +private: + QIcon folderIcon; + QIcon bookmarkIcon; + + BookmarkModel *treeModel; + BookmarkModel *listModel; +}; + +#endif // XBELSUPPORT_H -- cgit v0.12 From 43d654e4d38b998972fa97ab2c23720db3fef8bb Mon Sep 17 00:00:00 2001 From: Daron Edie Date: Tue, 3 Nov 2009 17:08:16 +1000 Subject: Fixes: nil Task: add directory tests/auto/networkdata and README as a directory to contain network test data for autotests RevBy: Daron Edie AutoTest: - Details: This directory will be a repositry of data for network autotests such as streaming data etc --- tests/auto/networkdata/README | 1 + 1 file changed, 1 insertion(+) create mode 100644 tests/auto/networkdata/README diff --git a/tests/auto/networkdata/README b/tests/auto/networkdata/README new file mode 100644 index 0000000..e8748cc --- /dev/null +++ b/tests/auto/networkdata/README @@ -0,0 +1 @@ +This directory contains network test data -- cgit v0.12 From 8d989dc8984161d93dd03bdc370c5b59df3d39db Mon Sep 17 00:00:00 2001 From: ck Date: Thu, 5 Nov 2009 11:16:21 +0100 Subject: Assistant: Look for document encoding in XML headers as well. Task-number: QTBUG-1770 Reviewed-by: kh1 --- tools/assistant/lib/lib.pro | 3 +- tools/assistant/lib/qhelp_global.cpp | 112 +++++++++++++++++++++ tools/assistant/lib/qhelp_global.h | 58 ++--------- tools/assistant/lib/qhelpgenerator.cpp | 2 +- .../lib/qhelpsearchindexwriter_clucene.cpp | 4 +- .../lib/qhelpsearchindexwriter_default.cpp | 2 +- 6 files changed, 124 insertions(+), 57 deletions(-) create mode 100644 tools/assistant/lib/qhelp_global.cpp diff --git a/tools/assistant/lib/lib.pro b/tools/assistant/lib/lib.pro index 322320a..26d3456 100644 --- a/tools/assistant/lib/lib.pro +++ b/tools/assistant/lib/lib.pro @@ -40,7 +40,8 @@ SOURCES += qhelpenginecore.cpp \ qhelpsearchindexwriter_default.cpp \ qhelpsearchindexreader_default.cpp \ qhelpsearchindexreader.cpp \ - qclucenefieldnames.cpp + qclucenefieldnames.cpp \ + qhelp_global.cpp # access to clucene SOURCES += qhelpsearchindexwriter_clucene.cpp \ diff --git a/tools/assistant/lib/qhelp_global.cpp b/tools/assistant/lib/qhelp_global.cpp new file mode 100644 index 0000000..980de27 --- /dev/null +++ b/tools/assistant/lib/qhelp_global.cpp @@ -0,0 +1,112 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include + +#include "qhelp_global.h" + +QString QHelpGlobal::uniquifyConnectionName(const QString &name, void *pointer) +{ + static int counter = 0; + static QMutex mutex; + + QMutexLocker locker(&mutex); + if (++counter > 1000) + counter = 0; + + return QString::fromLatin1("%1-%2-%3"). + arg(name).arg(long(pointer)).arg(counter); +} + +QString QHelpGlobal::documentTitle(const QString &content) +{ + QString title = QObject::tr("Untitled"); + if (!content.isEmpty()) { + int start = content.indexOf(QLatin1String(""), 0, Qt::CaseInsensitive) + 7; + int end = content.indexOf(QLatin1String(""), 0, Qt::CaseInsensitive); + if ((end - start) > 0) { + title = content.mid(start, end - start); + if (Qt::mightBeRichText(title) || title.contains(QLatin1Char('&'))) { + QTextDocument doc; + doc.setHtml(title); + title = doc.toPlainText(); + } + } + } + return title; +} + +QString QHelpGlobal::codecFromData(const QByteArray &data) +{ + QString codec = codecFromXmlData(data); + if (codec.isEmpty()) + codec = codecFromHtmlData(data); + return codec.isEmpty() ? QLatin1String("utf-8") : codec; +} + +QString QHelpGlobal::codecFromHtmlData(const QByteArray &data) +{ + QString content = QString::fromUtf8(data.constData(), data.size()); + int start = content.indexOf(QLatin1String(" 0) { + int end; + QRegExp r(QLatin1String("charset=([^\"\\s]+)")); + while (start != -1) { + end = content.indexOf(QLatin1Char('>'), start) + 1; + const QString &meta = content.mid(start, end - start).toLower(); + if (r.indexIn(meta) != -1) + return r.cap(1); + start = content.indexOf(QLatin1String(".*")); + return encodingExp.exactMatch(content) ? encodingExp.cap(1) : QString(); +} diff --git a/tools/assistant/lib/qhelp_global.h b/tools/assistant/lib/qhelp_global.h index 723d867..4e31d67 100644 --- a/tools/assistant/lib/qhelp_global.h +++ b/tools/assistant/lib/qhelp_global.h @@ -45,9 +45,6 @@ #include #include #include -#include -#include -#include QT_BEGIN_HEADER @@ -65,56 +62,13 @@ QT_MODULE(Help) class QHelpGlobal { public: - static QString uniquifyConnectionName(const QString &name, void *pointer) - { - static int counter = 0; - static QMutex mutex; + static QString uniquifyConnectionName(const QString &name, void *pointer); + static QString documentTitle(const QString &content); + static QString codecFromData(const QByteArray &data); - QMutexLocker locker(&mutex); - if (++counter > 1000) - counter = 0; - - return QString::fromLatin1("%1-%2-%3") - .arg(name).arg(long(pointer)).arg(counter); - }; - - static QString documentTitle(const QString &content) - { - QString title = QObject::tr("Untitled"); - if (!content.isEmpty()) { - int start = content.indexOf(QLatin1String(""), 0, Qt::CaseInsensitive) + 7; - int end = content.indexOf(QLatin1String(""), 0, Qt::CaseInsensitive); - if ((end - start) > 0) { - title = content.mid(start, end - start); - if (Qt::mightBeRichText(title) || title.contains(QLatin1Char('&'))) { - QTextDocument doc; - doc.setHtml(title); - title = doc.toPlainText(); - } - } - } - return title; - }; - - static QString charsetFromData(const QByteArray &data) - { - QString content = QString::fromUtf8(data.constData(), data.size()); - int start = - content.indexOf(QLatin1String(" 0) { - int end; - QRegExp r(QLatin1String("charset=([^\"\\s]+)")); - while (start != -1) { - end = content.indexOf(QLatin1Char('>'), start) + 1; - const QString &meta = content.mid(start, end - start).toLower(); - if (r.indexIn(meta) != -1) - return r.cap(1); - start = content.indexOf(QLatin1String(" Date: Thu, 5 Nov 2009 13:42:45 +0100 Subject: Assistant: Speed up document encoding detection. We now only take the head of the file into account for XML and HTML documents. Reviewed-by: kh1 --- tools/assistant/lib/qhelp_global.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/assistant/lib/qhelp_global.cpp b/tools/assistant/lib/qhelp_global.cpp index 980de27..aa9f0dd 100644 --- a/tools/assistant/lib/qhelp_global.cpp +++ b/tools/assistant/lib/qhelp_global.cpp @@ -86,17 +86,17 @@ QString QHelpGlobal::codecFromData(const QByteArray &data) QString QHelpGlobal::codecFromHtmlData(const QByteArray &data) { - QString content = QString::fromUtf8(data.constData(), data.size()); - int start = content.indexOf(QLatin1String(" 0) { int end; QRegExp r(QLatin1String("charset=([^\"\\s]+)")); while (start != -1) { - end = content.indexOf(QLatin1Char('>'), start) + 1; - const QString &meta = content.mid(start, end - start).toLower(); + end = head.indexOf(QLatin1Char('>'), start) + 1; + const QString &meta = head.mid(start, end - start).toLower(); if (r.indexIn(meta) != -1) return r.cap(1); - start = content.indexOf(QLatin1String(".*")); - return encodingExp.exactMatch(content) ? encodingExp.cap(1) : QString(); + return encodingExp.exactMatch(head) ? encodingExp.cap(1) : QString(); } -- cgit v0.12 From 51ae9111c899fd0c9351aa419c9c6a042259e971 Mon Sep 17 00:00:00 2001 From: ck Date: Thu, 5 Nov 2009 15:48:20 +0100 Subject: Assistant: Give internal linkage to file-scope functions in main.cpp. Reviewed-by: kh1 --- tools/assistant/tools/assistant/main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/assistant/tools/assistant/main.cpp b/tools/assistant/tools/assistant/main.cpp index 4d7fe10..f43c49c 100644 --- a/tools/assistant/tools/assistant/main.cpp +++ b/tools/assistant/tools/assistant/main.cpp @@ -66,6 +66,8 @@ QT_USE_NAMESPACE Q_IMPORT_PLUGIN(qsqlite) #endif +namespace { + void updateLastPagesOnUnregister(QHelpEngineCore& helpEngine, const QString& nsName) { @@ -179,6 +181,8 @@ QString indexFilesFolder(const QString &collectionFile) return indexFilesFolder; } +} // Anonymous namespace. + int main(int argc, char *argv[]) { // First do a quick search for arguments that imply command-line mode. -- cgit v0.12 From e1c68e8288628f8ad8907a3f300178d81393cb15 Mon Sep 17 00:00:00 2001 From: ck Date: Fri, 6 Nov 2009 12:37:59 +0100 Subject: Assistant: Don't escape special characters in search fields. Reviewed-by: kh1 --- tools/assistant/lib/qhelpsearchquerywidget.cpp | 39 ++++---------------------- 1 file changed, 6 insertions(+), 33 deletions(-) diff --git a/tools/assistant/lib/qhelpsearchquerywidget.cpp b/tools/assistant/lib/qhelpsearchquerywidget.cpp index f2f40ec..10d5470 100644 --- a/tools/assistant/lib/qhelpsearchquerywidget.cpp +++ b/tools/assistant/lib/qhelpsearchquerywidget.cpp @@ -120,33 +120,6 @@ private: // nothing todo } - QString escapeString(const QString &text) - { - QString retValue = text; - const QString escape(QLatin1String("\\")); - QStringList escapableCharsList; - escapableCharsList << QLatin1String("\\") << QLatin1String("+") - << QLatin1String("-") << QLatin1String("!") << QLatin1String("(") - << QLatin1String(")") << QLatin1String(":") << QLatin1String("^") - << QLatin1String("[") << QLatin1String("]") << QLatin1String("{") - << QLatin1String("}") << QLatin1String("~"); - - // make sure we won't end up with an empty string - foreach (const QString escapeChar, escapableCharsList) { - if (retValue.contains(escapeChar)) - retValue.replace(escapeChar, QLatin1String("")); - } - if (retValue.trimmed().isEmpty()) - return retValue; - - retValue = text; // now realy escape the string... - foreach (const QString escapeChar, escapableCharsList) { - if (retValue.contains(escapeChar)) - retValue.replace(escapeChar, escape + escapeChar); - } - return retValue; - } - QStringList buildTermList(const QString query) { bool s = false; @@ -295,14 +268,14 @@ private slots: #else if (defaultQuery->isEnabled()) { queryList.append(QHelpSearchQuery(QHelpSearchQuery::DEFAULT, - buildTermList(escapeString(defaultQuery->text())))); + buildTermList(defaultQuery->text()))); } else { const QRegExp exp(QLatin1String("\\s+")); QStringList lst = similarQuery->text().split(exp, QString::SkipEmptyParts); if (!lst.isEmpty()) { QStringList fuzzy; foreach (const QString term, lst) - fuzzy += buildTermList(escapeString(term)); + fuzzy += buildTermList(term); queryList.append(QHelpSearchQuery(QHelpSearchQuery::FUZZY, fuzzy)); } @@ -310,13 +283,13 @@ private slots: if (!lst.isEmpty()) { QStringList without; foreach (const QString term, lst) - without.append(escapeString(term)); + without.append(term); queryList.append(QHelpSearchQuery(QHelpSearchQuery::WITHOUT, without)); } if (!exactQuery->text().isEmpty()) { QString phrase = exactQuery->text().remove(QLatin1Char('\"')); - phrase = escapeString(phrase.simplified()); + phrase = phrase.simplified(); queryList.append(QHelpSearchQuery(QHelpSearchQuery::PHRASE, QStringList(phrase))); } @@ -324,7 +297,7 @@ private slots: if (!lst.isEmpty()) { QStringList all; foreach (const QString term, lst) - all.append(escapeString(term)); + all.append(term); queryList.append(QHelpSearchQuery(QHelpSearchQuery::ALL, all)); } @@ -332,7 +305,7 @@ private slots: if (!lst.isEmpty()) { QStringList atLeast; foreach (const QString term, lst) - atLeast += buildTermList(escapeString(term)); + atLeast += buildTermList(term); queryList.append(QHelpSearchQuery(QHelpSearchQuery::ATLEAST, atLeast)); } } -- cgit v0.12 From 6982e18e1523ac6c5001cc07f2b8042a712b0954 Mon Sep 17 00:00:00 2001 From: ck Date: Fri, 6 Nov 2009 14:06:06 +0100 Subject: Assisant: Allow absolute path names in collection project files. Task-number: QTBUG-2499 Reviewed-by: kh1 --- tools/assistant/tools/qcollectiongenerator/main.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/tools/assistant/tools/qcollectiongenerator/main.cpp b/tools/assistant/tools/qcollectiongenerator/main.cpp index 18a59d1..a2df6ab 100644 --- a/tools/assistant/tools/qcollectiongenerator/main.cpp +++ b/tools/assistant/tools/qcollectiongenerator/main.cpp @@ -322,6 +322,14 @@ void CollectionConfigReader::readRegister() } } +namespace { + QString absoluteFileName(const QString &basePath, const QString &fileName) + { + return QFileInfo(fileName).isAbsolute() ? + fileName : basePath + QDir::separator() + fileName; + } +} + int main(int argc, char *argv[]) { QString error; @@ -403,13 +411,13 @@ int main(int argc, char *argv[]) while (it != config.filesToGenerate().constEnd()) { fprintf(stdout, "Generating help for %s...\n", qPrintable(it.key())); QHelpProjectData helpData; - if (!helpData.readData(basePath + QDir::separator() + it.key())) { + if (!helpData.readData(absoluteFileName(basePath, it.key()))) { fprintf(stderr, "%s\n", qPrintable(helpData.errorMessage())); return -1; } HelpGenerator helpGenerator; - if (!helpGenerator.generate(&helpData, basePath + QDir::separator() + it.value())) { + if (!helpGenerator.generate(&helpData, absoluteFileName(basePath, it.value()))) { fprintf(stderr, "%s\n", qPrintable(helpGenerator.error())); return -1; } @@ -433,7 +441,7 @@ int main(int argc, char *argv[]) } foreach (const QString &file, config.filesToRegister()) { - if (!helpEngine.registerDocumentation(basePath + QDir::separator() + file)) { + if (!helpEngine.registerDocumentation(absoluteFileName(basePath, file))) { fprintf(stderr, "%s\n", qPrintable(helpEngine.error())); return -1; } @@ -470,7 +478,7 @@ int main(int argc, char *argv[]) QDateTime::currentDateTime().toTime_t()); if (!config.applicationIcon().isEmpty()) { - QFile icon(basePath + QDir::separator() + config.applicationIcon()); + QFile icon(absoluteFileName(basePath, config.applicationIcon())); if (!icon.open(QIODevice::ReadOnly)) { fprintf(stderr, "Cannot open %s!\n", qPrintable(icon.fileName())); return -1; @@ -491,7 +499,7 @@ int main(int argc, char *argv[]) } if (!config.aboutIcon().isEmpty()) { - QFile icon(basePath + QDir::separator() + config.aboutIcon()); + QFile icon(absoluteFileName(basePath, config.aboutIcon())); if (!icon.open(QIODevice::ReadOnly)) { fprintf(stderr, "Cannot open %s!\n", qPrintable(icon.fileName())); return -1; @@ -512,7 +520,7 @@ int main(int argc, char *argv[]) while (it != config.aboutTextFiles().constEnd()) { s << it.key(); - QFileInfo fi(basePath + QDir::separator() + it.value()); + QFileInfo fi(absoluteFileName(basePath, it.value())); QFile f(fi.absoluteFilePath()); if (!f.open(QIODevice::ReadOnly)) { fprintf(stderr, "Cannot open %s!\n", qPrintable(f.fileName())); -- cgit v0.12 From 9c0196d1b6fa98d9463dd9e8a0cb571a232bf685 Mon Sep 17 00:00:00 2001 From: David Faure Date: Fri, 6 Nov 2009 11:48:44 +0100 Subject: Add "View Page Source" and support for URL on the command line This example app is useful for debugging QtWebKit problems, it was just missing a way to load the url from the command-line (to avoid loading google first), and a "view page source" action. Reviewed-By: Markus Goetz Merge-Request: 2021 --- examples/webkit/fancybrowser/main.cpp | 7 ++++++- examples/webkit/fancybrowser/mainwindow.cpp | 28 ++++++++++++++++++++++++++-- examples/webkit/fancybrowser/mainwindow.h | 5 ++++- 3 files changed, 36 insertions(+), 4 deletions(-) diff --git a/examples/webkit/fancybrowser/main.cpp b/examples/webkit/fancybrowser/main.cpp index 7f3c983..2245788 100644 --- a/examples/webkit/fancybrowser/main.cpp +++ b/examples/webkit/fancybrowser/main.cpp @@ -45,7 +45,12 @@ int main(int argc, char * argv[]) { QApplication app(argc, argv); - MainWindow *browser = new MainWindow; + QUrl url; + if (argc > 1) + url = QUrl(argv[1]); + else + url = QUrl("http://www.google.com/ncr"); + MainWindow *browser = new MainWindow(url); browser->show(); return app.exec(); } diff --git a/examples/webkit/fancybrowser/mainwindow.cpp b/examples/webkit/fancybrowser/mainwindow.cpp index a3293b8..06af62e 100644 --- a/examples/webkit/fancybrowser/mainwindow.cpp +++ b/examples/webkit/fancybrowser/mainwindow.cpp @@ -45,7 +45,7 @@ //! [1] -MainWindow::MainWindow() +MainWindow::MainWindow(const QUrl& url) { progress = 0; @@ -60,7 +60,7 @@ MainWindow::MainWindow() //! [2] view = new QWebView(this); - view->load(QUrl("http://www.google.com/ncr")); + view->load(url); connect(view, SIGNAL(loadFinished(bool)), SLOT(adjustLocation())); connect(view, SIGNAL(titleChanged(const QString&)), SLOT(adjustTitle())); connect(view, SIGNAL(loadProgress(int)), SLOT(setProgress(int))); @@ -78,6 +78,11 @@ MainWindow::MainWindow() toolBar->addWidget(locationEdit); //! [2] + QMenu *viewMenu = menuBar()->addMenu(tr("&View")); + QAction* viewSourceAction = new QAction("Page Source", this); + connect(viewSourceAction, SIGNAL(triggered()), SLOT(viewSource())); + viewMenu->addAction(viewSourceAction); + //! [3] QMenu *effectMenu = menuBar()->addMenu(tr("&Effect")); effectMenu->addAction("Highlight all links", this, SLOT(highlightAllLinks())); @@ -100,6 +105,23 @@ MainWindow::MainWindow() } //! [3] +void MainWindow::viewSource() +{ + QNetworkAccessManager* accessManager = view->page()->networkAccessManager(); + QNetworkRequest request(view->url()); + QNetworkReply* reply = accessManager->get(request); + connect(reply, SIGNAL(finished()), this, SLOT(slotSourceDownloaded())); +} + +void MainWindow::slotSourceDownloaded() +{ + QNetworkReply* reply = qobject_cast(const_cast(sender())); + QTextEdit* textEdit = new QTextEdit(NULL); + textEdit->setAttribute(Qt::WA_DeleteOnClose); + textEdit->show(); + textEdit->setPlainText(reply->readAll()); +} + //! [4] void MainWindow::adjustLocation() { @@ -136,6 +158,8 @@ void MainWindow::finishLoading(bool) progress = 100; adjustTitle(); view->page()->mainFrame()->evaluateJavaScript(jQuery); + // Enable this to see the dump of the internal render tree + //qDebug() << view->page()->mainFrame()->renderTreeDump(); } //! [6] diff --git a/examples/webkit/fancybrowser/mainwindow.h b/examples/webkit/fancybrowser/mainwindow.h index 33fd8f5..be95614 100644 --- a/examples/webkit/fancybrowser/mainwindow.h +++ b/examples/webkit/fancybrowser/mainwindow.h @@ -52,7 +52,7 @@ class MainWindow : public QMainWindow Q_OBJECT public: - MainWindow(); + MainWindow(const QUrl& url); protected slots: @@ -62,6 +62,9 @@ protected slots: void setProgress(int p); void finishLoading(bool); + void viewSource(); + void slotSourceDownloaded(); + void highlightAllLinks(); void rotateImages(bool toggle); void removeGifImages(); -- cgit v0.12 From 2f9222f87e6fe6ee9a61d0bee453fb3f51357c78 Mon Sep 17 00:00:00 2001 From: ck Date: Tue, 10 Nov 2009 11:34:05 +0100 Subject: Assistant: Allocate print dialog on the stack. Reviewed-by: kh1 --- tools/assistant/tools/assistant/centralwidget.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tools/assistant/tools/assistant/centralwidget.cpp b/tools/assistant/tools/assistant/centralwidget.cpp index 04739d4..dcad3e1 100644 --- a/tools/assistant/tools/assistant/centralwidget.cpp +++ b/tools/assistant/tools/assistant/centralwidget.cpp @@ -549,18 +549,17 @@ void CentralWidget::print() initPrinter(); - QPrintDialog *dlg = new QPrintDialog(printer, this); + QPrintDialog dlg(printer, this); #if defined(QT_NO_WEBKIT) if (viewer->textCursor().hasSelection()) - dlg->addEnabledOption(QAbstractPrintDialog::PrintSelection); + dlg.addEnabledOption(QAbstractPrintDialog::PrintSelection); #endif - dlg->addEnabledOption(QAbstractPrintDialog::PrintPageRange); - dlg->addEnabledOption(QAbstractPrintDialog::PrintCollateCopies); - dlg->setWindowTitle(tr("Print Document")); - if (dlg->exec() == QDialog::Accepted) { + dlg.addEnabledOption(QAbstractPrintDialog::PrintPageRange); + dlg.addEnabledOption(QAbstractPrintDialog::PrintCollateCopies); + dlg.setWindowTitle(tr("Print Document")); + if (dlg.exec() == QDialog::Accepted) { viewer->print(printer); } - delete dlg; #endif } -- cgit v0.12 From 1a693bc373167f9d76cd9842c4d8cc2531e741ff Mon Sep 17 00:00:00 2001 From: ck Date: Tue, 10 Nov 2009 15:14:07 +0100 Subject: Assistant: Make Edit name of a bookmark folder right after creation. Task-number: Qt-5540 Reviewed-by: kh1 --- tools/assistant/tools/assistant/bookmarkmanager.cpp | 21 +++++++++++++-------- tools/assistant/tools/assistant/bookmarkmanager.h | 1 + 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/tools/assistant/tools/assistant/bookmarkmanager.cpp b/tools/assistant/tools/assistant/bookmarkmanager.cpp index 881525c..9dd5b8b 100644 --- a/tools/assistant/tools/assistant/bookmarkmanager.cpp +++ b/tools/assistant/tools/assistant/bookmarkmanager.cpp @@ -150,8 +150,8 @@ void BookmarkDialog::addNewFolder() const QString &name = index.data().toString(); ui.bookmarkFolders->setCurrentIndex(ui.bookmarkFolders->findText(name)); + renameFolder(index, newFolder); } - ui.treeView->setFocus(); } void BookmarkDialog::toolButtonClicked() @@ -243,14 +243,19 @@ void BookmarkDialog::customContextMenuRequested(const QPoint &point) if (index.isValid()) name = index.data().toString(); ui.bookmarkFolders->setCurrentIndex(ui.bookmarkFolders->findText(name)); + } else if (picked == renameItem) { + renameFolder(index, proxyIndex); } - else if (picked == renameItem) { - BookmarkModel *model = bookmarkManager->treeBookmarkModel(); - if (QStandardItem *item = model->itemFromIndex(proxyIndex)) { - item->setEditable(true); - ui.treeView->edit(index); - item->setEditable(false); - } +} + +void BookmarkDialog::renameFolder(const QModelIndex &index, + const QModelIndex &proxyIndex) +{ + const BookmarkModel * const model = bookmarkManager->treeBookmarkModel(); + if (QStandardItem *item = model->itemFromIndex(proxyIndex)) { + item->setEditable(true); + ui.treeView->edit(index); + item->setEditable(false); } } diff --git a/tools/assistant/tools/assistant/bookmarkmanager.h b/tools/assistant/tools/assistant/bookmarkmanager.h index fab8790..c6be134 100644 --- a/tools/assistant/tools/assistant/bookmarkmanager.h +++ b/tools/assistant/tools/assistant/bookmarkmanager.h @@ -90,6 +90,7 @@ private slots: private: bool eventFilter(QObject *object, QEvent *e); + void renameFolder(const QModelIndex &index, const QModelIndex &proxyIndex); private: QString m_url; -- cgit v0.12 From 3458ccf3a1b744f14b293bb1d2ce4d187930c09c Mon Sep 17 00:00:00 2001 From: ck Date: Tue, 10 Nov 2009 16:43:30 +0100 Subject: Assistant: Replace a "while" with an "if". Reviewed-by: kh1 --- tools/assistant/lib/qhelpcollectionhandler.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/assistant/lib/qhelpcollectionhandler.cpp b/tools/assistant/lib/qhelpcollectionhandler.cpp index 4aa7ab6..9092259 100644 --- a/tools/assistant/lib/qhelpcollectionhandler.cpp +++ b/tools/assistant/lib/qhelpcollectionhandler.cpp @@ -308,10 +308,8 @@ bool QHelpCollectionHandler::addCustomFilter(const QString &filterName, m_query.prepare(QLatin1String("SELECT Id FROM FilterNameTable WHERE Name=?")); m_query.bindValue(0, filterName); m_query.exec(); - while (m_query.next()) { + if (m_query.next()) nameId = m_query.value(0).toInt(); - break; - } m_query.exec(QLatin1String("SELECT Id, Name FROM FilterAttributeTable")); QStringList idsToInsert = attributes; -- cgit v0.12 From d895af5713a7b7ee011b2b29cb5844fbf964df5e Mon Sep 17 00:00:00 2001 From: ck Date: Tue, 10 Nov 2009 18:09:31 +0100 Subject: Assistant: Fix documentation for QHelpEngineCore::addCustomFilter(). Task-number: QT-2498 Reviewed-by: David Boddie --- tools/assistant/lib/qhelpenginecore.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/assistant/lib/qhelpenginecore.cpp b/tools/assistant/lib/qhelpenginecore.cpp index 8c6c2fe..80b92fd 100644 --- a/tools/assistant/lib/qhelpenginecore.cpp +++ b/tools/assistant/lib/qhelpenginecore.cpp @@ -405,8 +405,9 @@ QStringList QHelpEngineCore::customFilters() const /*! Adds the new custom filter \a filterName. The filter attributes - are specified by \a attributes. The function returns false if - the filter can not be added, e.g. when the filter already exists. + are specified by \a attributes. If the filter already exists, + its attribute set is replaced. The function returns true if + the operation succeeded, otherwise it returns false. \sa customFilters(), removeCustomFilter() */ -- cgit v0.12 From 55b8a57350fee26783b379d3897d38759903824f Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Mon, 21 Sep 2009 22:48:25 +0200 Subject: QNAM: Add direct access to the RawHeader Provide direct access to the header fields. This makes QNetworkReplyHandler::sendResponseIfNedded drop out of the profile on the loading_standalone test case. Reviewed-By: Markus Goetz --- src/network/access/qnetworkreply.cpp | 6 ++++++ src/network/access/qnetworkreply.h | 3 +++ 2 files changed, 9 insertions(+) diff --git a/src/network/access/qnetworkreply.cpp b/src/network/access/qnetworkreply.cpp index 9ab4057..0792cea 100644 --- a/src/network/access/qnetworkreply.cpp +++ b/src/network/access/qnetworkreply.cpp @@ -530,6 +530,12 @@ QByteArray QNetworkReply::rawHeader(const QByteArray &headerName) const return QByteArray(); } +const QList& QNetworkReply::rawHeaderPairs() const +{ + Q_D(const QNetworkReply); + return d->rawHeaders; +} + /*! Returns a list of headers fields that were sent by the remote server, in the order that they were sent. Duplicate headers are diff --git a/src/network/access/qnetworkreply.h b/src/network/access/qnetworkreply.h index c624810..82086c4 100644 --- a/src/network/access/qnetworkreply.h +++ b/src/network/access/qnetworkreply.h @@ -128,6 +128,9 @@ public: QList rawHeaderList() const; QByteArray rawHeader(const QByteArray &headerName) const; + typedef QPair RawHeaderPair; + const QList& rawHeaderPairs() const; + // attributes QVariant attribute(QNetworkRequest::Attribute code) const; -- cgit v0.12 From 7af4abab649d1ea4f9c8289a58b9d479237bd815 Mon Sep 17 00:00:00 2001 From: kh1 Date: Wed, 11 Nov 2009 15:05:28 +0100 Subject: On windows we need to pass the length read to function properly. The buffer might still contain garbage from an already received command. Reviewed-by: ck --- tools/assistant/tools/assistant/remotecontrol.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/assistant/tools/assistant/remotecontrol.cpp b/tools/assistant/tools/assistant/remotecontrol.cpp index 474a681..ac7e16f 100644 --- a/tools/assistant/tools/assistant/remotecontrol.cpp +++ b/tools/assistant/tools/assistant/remotecontrol.cpp @@ -97,9 +97,9 @@ void StdInListenerWin::run() #endif while (ok) { - ok = ReadFile(hStdinDup, chBuf, 4096, &dwRead, NULL); + ok = ReadFile(hStdinDup, chBuf, sizeof(chBuf), &dwRead, NULL); if (ok && dwRead != 0) - emit receivedCommand(QString::fromLocal8Bit(chBuf)); + emit receivedCommand(QString::fromLocal8Bit(chBuf, dwRead)); } } #endif -- cgit v0.12 From 96592943598151ea3f64364eab3475904931ca16 Mon Sep 17 00:00:00 2001 From: ck Date: Wed, 11 Nov 2009 14:35:17 +0100 Subject: Assistant: Update documentation for remote commands. - Assistant understands a newline character as well as '\0' to mark the end of a remote command. Since the former is considerably less complicated to do and to explain, the documentation now uses that approach. - The related examples have been updated accordingly. - The qdoc file now uses the encoding it promises in the header. Reviewed-by: kh1 Reviewed-by: David Boddie --- doc/src/development/assistant-manual.qdoc | 6 +++--- doc/src/snippets/code/doc_src_assistant-manual.qdoc | 8 +++----- examples/help/remotecontrol/remotecontrol.cpp | 2 +- examples/help/simpletextviewer/assistant.cpp | 2 +- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/doc/src/development/assistant-manual.qdoc b/doc/src/development/assistant-manual.qdoc index 8de500e..3ecadc7 100644 --- a/doc/src/development/assistant-manual.qdoc +++ b/doc/src/development/assistant-manual.qdoc @@ -672,9 +672,6 @@ to make Assistant listen to your application, turn on its remote control functionality by passing the \c{-enableRemoteControl} command line option. - \warning The trailing '\0' must be appended separately to the QByteArray, - e.g., \c{QByteArray("command" + '\0')}. - The following example shows how this can be done: \snippet doc/src/snippets/code/doc_src_assistant-manual.qdoc 2 @@ -685,6 +682,9 @@ \snippet doc/src/snippets/code/doc_src_assistant-manual.qdoc 3 + Note that the trailing newline character is required to mark the end + of the input. + The following commands can be used to control \QA: \table diff --git a/doc/src/snippets/code/doc_src_assistant-manual.qdoc b/doc/src/snippets/code/doc_src_assistant-manual.qdoc index 24870b4..700d755 100644 --- a/doc/src/snippets/code/doc_src_assistant-manual.qdoc +++ b/doc/src/snippets/code/doc_src_assistant-manual.qdoc @@ -58,7 +58,7 @@ assistant -collectionFile file mycompany/myapplication About My Application - ber meine Applikation... + Über meine Applikation... about.txt @@ -95,8 +95,7 @@ if (!process->waitForStarted()) //! [3] QByteArray ba; -ba.append("setSource qthelp://com.mycompany.1_0_0/doc/index.html"); -ba.append('\0'); +ba.append("setSource qthelp://com.mycompany.1_0_0/doc/index.html\n"); process->write(ba); //! [3] @@ -105,8 +104,7 @@ process->write(ba); QByteArray ba; ba.append("hide bookmarks;"); ba.append("hide index;"); -ba.append("setSource qthelp://com.mycompany.1_0_0/doc/index.html"); -ba.append('\0'); +ba.append("setSource qthelp://com.mycompany.1_0_0/doc/index.html\n"); process->write(ba); //! [4] diff --git a/examples/help/remotecontrol/remotecontrol.cpp b/examples/help/remotecontrol/remotecontrol.cpp index adb92d0..9dc166e 100644 --- a/examples/help/remotecontrol/remotecontrol.cpp +++ b/examples/help/remotecontrol/remotecontrol.cpp @@ -123,7 +123,7 @@ void RemoteControl::sendCommand(const QString &cmd) { if (process->state() != QProcess::Running) return; - process->write(cmd.toLocal8Bit() + '\0'); + process->write(cmd.toLocal8Bit() + '\n'); } void RemoteControl::on_indexButton_clicked() diff --git a/examples/help/simpletextviewer/assistant.cpp b/examples/help/simpletextviewer/assistant.cpp index ab20f3e..2807365 100644 --- a/examples/help/simpletextviewer/assistant.cpp +++ b/examples/help/simpletextviewer/assistant.cpp @@ -73,7 +73,7 @@ void Assistant::showDocumentation(const QString &page) QByteArray ba("SetSource "); ba.append("qthelp://com.trolltech.examples.simpletextviewer/doc/"); - proc->write(ba + page.toLocal8Bit() + '\0'); + proc->write(ba + page.toLocal8Bit() + '\n'); } //! [1] -- cgit v0.12 From e59578eb338b7374a361e4eca55589996c74ecbb Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 11 Nov 2009 16:34:41 +0100 Subject: QObjectPrivate/!QT3_SUPPORT: replace an unused QList by an unused void* There is no need to bump reference counts for unused place holders. Reviewed-by: mae --- src/corelib/kernel/qobject_p.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/kernel/qobject_p.h b/src/corelib/kernel/qobject_p.h index f087407..425a1df 100644 --- a/src/corelib/kernel/qobject_p.h +++ b/src/corelib/kernel/qobject_p.h @@ -189,8 +189,8 @@ public: QList pendingChildInsertedEvents; #else // preserve binary compatibility with code compiled without Qt 3 support - // ### why? - QList unused; + // keeping the binary layout stable helps the Qt Creator debugger + void *unused; #endif QList > eventFilters; -- cgit v0.12 From b60ed9f084e45314787b84b686231ae68e0d39ba Mon Sep 17 00:00:00 2001 From: ck Date: Thu, 12 Nov 2009 14:26:52 +0100 Subject: Assistant: Allow (un)registering documentation files remotely. Task-number: QT-2903 Reviewed-by: kh1 --- tools/assistant/tools/assistant/centralwidget.cpp | 13 ++++++++++++- tools/assistant/tools/assistant/centralwidget.h | 2 ++ .../tools/assistant/preferencesdialog.cpp | 7 +------ tools/assistant/tools/assistant/remotecontrol.cpp | 22 +++++++++++++++++++--- 4 files changed, 34 insertions(+), 10 deletions(-) diff --git a/tools/assistant/tools/assistant/centralwidget.cpp b/tools/assistant/tools/assistant/centralwidget.cpp index b708343..1c62954 100644 --- a/tools/assistant/tools/assistant/centralwidget.cpp +++ b/tools/assistant/tools/assistant/centralwidget.cpp @@ -1001,7 +1001,7 @@ void CentralWidget::updateBrowserFont() int i = searchAttached ? 1 : 0; getBrowserFontFor(tabWidget->widget(i), &font); - for (i; i < tabWidget->count(); ++i) + for (; i < tabWidget->count(); ++i) setBrowserFontFor(tabWidget->widget(i), font); } @@ -1142,6 +1142,17 @@ CentralWidget::highlightSearchTerms() #endif } + +void CentralWidget::closeTabs(const QList &indices) +{ + QList sortedIndices = indices; + qSort(sortedIndices); + for (int i = sortedIndices.count(); --i >= 0;) + closeTabAt(sortedIndices.at(i)); + if (availableHelpViewer() == 0) + setSource(QUrl(QLatin1String("about:blank"))); +} + void CentralWidget::closeTabAt(int index) { HelpViewer *viewer = qobject_cast(tabWidget->widget(index)); diff --git a/tools/assistant/tools/assistant/centralwidget.h b/tools/assistant/tools/assistant/centralwidget.h index 8c186f0..c348abf 100644 --- a/tools/assistant/tools/assistant/centralwidget.h +++ b/tools/assistant/tools/assistant/centralwidget.h @@ -42,6 +42,7 @@ #ifndef CENTRALWIDGET_H #define CENTRALWIDGET_H +#include #include #include #include @@ -134,6 +135,7 @@ public: int availableHelpViewer() const; bool enableTabCloseAction() const; + void closeTabs(const QList &indices); void closeTabAt(int index); QMap currentSourceFileList() const; diff --git a/tools/assistant/tools/assistant/preferencesdialog.cpp b/tools/assistant/tools/assistant/preferencesdialog.cpp index d964015..2aa451e 100644 --- a/tools/assistant/tools/assistant/preferencesdialog.cpp +++ b/tools/assistant/tools/assistant/preferencesdialog.cpp @@ -378,12 +378,7 @@ void PreferencesDialog::applyChanges() } } - qSort(m_TabsToClose); - CentralWidget* widget = CentralWidget::instance(); - for (int i = m_TabsToClose.count(); --i >= 0;) - widget->closeTabAt(m_TabsToClose.at(i)); - if (widget->availableHelpViewer()== 0) - widget->setSource(QUrl(QLatin1String("about:blank"))); + CentralWidget::instance()->closeTabs(m_TabsToClose); if (m_unregDocs.count()) { foreach (const QString &doc, m_unregDocs) diff --git a/tools/assistant/tools/assistant/remotecontrol.cpp b/tools/assistant/tools/assistant/remotecontrol.cpp index ac7e16f..c1b995d 100644 --- a/tools/assistant/tools/assistant/remotecontrol.cpp +++ b/tools/assistant/tools/assistant/remotecontrol.cpp @@ -44,6 +44,7 @@ #include "centralwidget.h" #include +#include #include #include #include @@ -236,15 +237,30 @@ void RemoteControl::handleCommandString(const QString &cmdString) m_expandTOC = depth; else m_mainWindow->expandTOC(depth); - } else if (cmd == QLatin1String("setcurrentfilter")) { - if (!m_helpEngine->customFilters().contains(arg)) - return; + } else if (cmd == QLatin1String("setcurrentfilter") + && m_helpEngine->customFilters().contains(arg)) { if (m_caching) { clearCache(); m_currentFilter = arg; } else { m_helpEngine->setCurrentFilter(arg); } + } else if (cmd == QLatin1String("register")) { + const QString &absFileName = QFileInfo(arg).absoluteFilePath(); + if (m_helpEngine->registeredDocumentations(). + contains(QHelpEngineCore::namespaceName(absFileName))) + return; + m_helpEngine->registerDocumentation(absFileName); + m_helpEngine->setupData(); + } else if (cmd == QLatin1String("unregister")) { + const QString &absFileName = QFileInfo(arg).absoluteFilePath(); + const QString &ns = QHelpEngineCore::namespaceName(absFileName); + if (m_helpEngine->registeredDocumentations().contains(ns)) { + CentralWidget* widget = CentralWidget::instance(); + widget->closeTabs(widget->currentSourceFileList().keys(ns)); + m_helpEngine->unregisterDocumentation(ns); + m_helpEngine->setupData(); + } } else { return; } -- cgit v0.12 From 951cceac68b4a6cf38da83b69dcde2c8109342a2 Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Thu, 12 Nov 2009 14:48:04 +0100 Subject: Fixed QPixmap::grabWidget() on widgets that have not yet been shown. Fixed bug where QPixmap::grabWidget() would return a pixmap of a different size that the widget if the widget had not yet been shown or resized. Updated the qpixmap autotest. Task-number: QTBUG-4149 Reviewed-by: Trond --- src/gui/image/qpixmap.cpp | 7 +- src/gui/kernel/qwidget.cpp | 176 +++++++++++++++++++------------------ src/gui/kernel/qwidget_p.h | 2 + tests/auto/qpixmap/tst_qpixmap.cpp | 27 +++++- 4 files changed, 122 insertions(+), 90 deletions(-) diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index 985a20b..b085c09 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -1076,6 +1076,9 @@ QPixmap QPixmap::grabWidget(QWidget * widget, const QRect &rect) if (widget->testAttribute(Qt::WA_PendingResizeEvent) || !widget->testAttribute(Qt::WA_WState_Created)) sendResizeEvents(widget); + widget->d_func()->prepareToRender(QRegion(), + QWidget::DrawWindowBackground | QWidget::DrawChildren | QWidget::IgnoreMask); + QRect r(rect); if (r.width() < 0) r.setWidth(widget->width() - rect.x()); @@ -1086,8 +1089,8 @@ QPixmap QPixmap::grabWidget(QWidget * widget, const QRect &rect) return QPixmap(); QPixmap res(r.size()); - widget->render(&res, QPoint(), r, - QWidget::DrawWindowBackground | QWidget::DrawChildren | QWidget::IgnoreMask); + widget->d_func()->render(&res, QPoint(), r, QWidget::DrawWindowBackground + | QWidget::DrawChildren | QWidget::IgnoreMask, true); return res; } diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index c776c36..f1b90f0 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -4838,90 +4838,7 @@ void QWidget::unsetCursor() void QWidget::render(QPaintDevice *target, const QPoint &targetOffset, const QRegion &sourceRegion, RenderFlags renderFlags) { - Q_D(QWidget); - if (!target) { - qWarning("QWidget::render: null pointer to paint device"); - return; - } - - const bool inRenderWithPainter = d->extra && d->extra->inRenderWithPainter; - QRegion paintRegion = !inRenderWithPainter ? d->prepareToRender(sourceRegion, renderFlags) - : sourceRegion; - if (paintRegion.isEmpty()) - return; - -#ifndef Q_WS_MAC - QPainter *oldSharedPainter = inRenderWithPainter ? d->sharedPainter() : 0; - - // Use the target's shared painter if set (typically set when doing - // "other->render(widget);" in the widget's paintEvent. - if (target->devType() == QInternal::Widget) { - QWidgetPrivate *targetPrivate = static_cast(target)->d_func(); - if (targetPrivate->extra && targetPrivate->extra->inRenderWithPainter) { - QPainter *targetPainter = targetPrivate->sharedPainter(); - if (targetPainter && targetPainter->isActive()) - d->setSharedPainter(targetPainter); - } - } -#endif - - // Use the target's redirected device if set and adjust offset and paint - // region accordingly. This is typically the case when people call render - // from the paintEvent. - QPoint offset = targetOffset; - offset -= paintRegion.boundingRect().topLeft(); - QPoint redirectionOffset; - QPaintDevice *redirected = 0; - - if (target->devType() == QInternal::Widget) - redirected = static_cast(target)->d_func()->redirected(&redirectionOffset); - if (!redirected) - redirected = QPainter::redirected(target, &redirectionOffset); - - if (redirected) { - target = redirected; - offset -= redirectionOffset; - } - - if (!inRenderWithPainter) { // Clip handled by shared painter (in qpainter.cpp). - if (QPaintEngine *targetEngine = target->paintEngine()) { - const QRegion targetSystemClip = targetEngine->systemClip(); - if (!targetSystemClip.isEmpty()) - paintRegion &= targetSystemClip.translated(-offset); - } - } - - // Set backingstore flags. - int flags = QWidgetPrivate::DrawPaintOnScreen | QWidgetPrivate::DrawInvisible; - if (renderFlags & DrawWindowBackground) - flags |= QWidgetPrivate::DrawAsRoot; - - if (renderFlags & DrawChildren) - flags |= QWidgetPrivate::DrawRecursive; - else - flags |= QWidgetPrivate::DontSubtractOpaqueChildren; - -#ifdef Q_WS_QWS - flags |= QWidgetPrivate::DontSetCompositionMode; -#endif - - if (target->devType() == QInternal::Printer) { - QPainter p(target); - d->render_helper(&p, targetOffset, paintRegion, renderFlags); - return; - } - -#ifndef Q_WS_MAC - // Render via backingstore. - d->drawWidget(target, paintRegion, offset, flags, d->sharedPainter()); - - // Restore shared painter. - if (oldSharedPainter) - d->setSharedPainter(oldSharedPainter); -#else - // Render via backingstore (no shared painter). - d->drawWidget(target, paintRegion, offset, flags, 0); -#endif + d_func()->render(target, targetOffset, sourceRegion, renderFlags, false); } /*! @@ -5371,6 +5288,97 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP } } +void QWidgetPrivate::render(QPaintDevice *target, const QPoint &targetOffset, + const QRegion &sourceRegion, QWidget::RenderFlags renderFlags, + bool readyToRender) +{ + Q_Q(QWidget); + if (!target) { + qWarning("QWidget::render: null pointer to paint device"); + return; + } + + const bool inRenderWithPainter = extra && extra->inRenderWithPainter; + QRegion paintRegion = !inRenderWithPainter && !readyToRender + ? prepareToRender(sourceRegion, renderFlags) + : sourceRegion; + if (paintRegion.isEmpty()) + return; + +#ifndef Q_WS_MAC + QPainter *oldSharedPainter = inRenderWithPainter ? sharedPainter() : 0; + + // Use the target's shared painter if set (typically set when doing + // "other->render(widget);" in the widget's paintEvent. + if (target->devType() == QInternal::Widget) { + QWidgetPrivate *targetPrivate = static_cast(target)->d_func(); + if (targetPrivate->extra && targetPrivate->extra->inRenderWithPainter) { + QPainter *targetPainter = targetPrivate->sharedPainter(); + if (targetPainter && targetPainter->isActive()) + setSharedPainter(targetPainter); + } + } +#endif + + // Use the target's redirected device if set and adjust offset and paint + // region accordingly. This is typically the case when people call render + // from the paintEvent. + QPoint offset = targetOffset; + offset -= paintRegion.boundingRect().topLeft(); + QPoint redirectionOffset; + QPaintDevice *redirected = 0; + + if (target->devType() == QInternal::Widget) + redirected = static_cast(target)->d_func()->redirected(&redirectionOffset); + if (!redirected) + redirected = QPainter::redirected(target, &redirectionOffset); + + if (redirected) { + target = redirected; + offset -= redirectionOffset; + } + + if (!inRenderWithPainter) { // Clip handled by shared painter (in qpainter.cpp). + if (QPaintEngine *targetEngine = target->paintEngine()) { + const QRegion targetSystemClip = targetEngine->systemClip(); + if (!targetSystemClip.isEmpty()) + paintRegion &= targetSystemClip.translated(-offset); + } + } + + // Set backingstore flags. + int flags = DrawPaintOnScreen | DrawInvisible; + if (renderFlags & QWidget::DrawWindowBackground) + flags |= DrawAsRoot; + + if (renderFlags & QWidget::DrawChildren) + flags |= DrawRecursive; + else + flags |= DontSubtractOpaqueChildren; + +#ifdef Q_WS_QWS + flags |= DontSetCompositionMode; +#endif + + if (target->devType() == QInternal::Printer) { + QPainter p(target); + render_helper(&p, targetOffset, paintRegion, renderFlags); + return; + } + +#ifndef Q_WS_MAC + // Render via backingstore. + drawWidget(target, paintRegion, offset, flags, sharedPainter()); + + // Restore shared painter. + if (oldSharedPainter) + setSharedPainter(oldSharedPainter); +#else + // Render via backingstore (no shared painter). + drawWidget(target, paintRegion, offset, flags, 0); +#endif +} + void QWidgetPrivate::paintSiblingsRecursive(QPaintDevice *pdev, const QObjectList& siblings, int index, const QRegion &rgn, const QPoint &offset, int flags #ifdef Q_BACKINGSTORE_SUBSURFACES diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h index df28bac..220dc7c 100644 --- a/src/gui/kernel/qwidget_p.h +++ b/src/gui/kernel/qwidget_p.h @@ -353,6 +353,8 @@ public: QRegion prepareToRender(const QRegion ®ion, QWidget::RenderFlags renderFlags); void render_helper(QPainter *painter, const QPoint &targetOffset, const QRegion &sourceRegion, QWidget::RenderFlags renderFlags); + void render(QPaintDevice *target, const QPoint &targetOffset, const QRegion &sourceRegion, + QWidget::RenderFlags renderFlags, bool readyToRender); void drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QPoint &offset, int flags, QPainter *sharedPainter = 0, QWidgetBackingStore *backingStore = 0); diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp index d7f042e..fcb59f9 100644 --- a/tests/auto/qpixmap/tst_qpixmap.cpp +++ b/tests/auto/qpixmap/tst_qpixmap.cpp @@ -47,6 +47,7 @@ #include #include #include +#include #include @@ -791,14 +792,32 @@ void tst_QPixmap::drawBitmap() void tst_QPixmap::grabWidget() { QWidget widget; - widget.setPalette(Qt::green); - widget.resize(128, 128); + QImage image(128, 128, QImage::Format_ARGB32_Premultiplied); + for (int row = 0; row < image.height(); ++row) { + QRgb *line = reinterpret_cast(image.scanLine(row)); + for (int col = 0; col < image.width(); ++col) + line[col] = qRgb(rand() & 255, row, col); + } - QPixmap expected(64, 64); - expected.fill(Qt::green); + QPalette pal = widget.palette(); + pal.setBrush(QPalette::Window, QBrush(image)); + widget.setPalette(pal); + widget.resize(128, 128); + QPixmap expected = QPixmap::fromImage(QImage(image.scanLine(64) + 64 * 4, 64, 64, image.bytesPerLine(), image.format())); QPixmap actual = QPixmap::grabWidget(&widget, QRect(64, 64, 64, 64)); QVERIFY(lenientCompare(actual, expected)); + + actual = QPixmap::grabWidget(&widget, 64, 64); + QVERIFY(lenientCompare(actual, expected)); + + // Make sure a widget that is not yet shown is grabbed correctly. + QTreeWidget widget2; + actual = QPixmap::grabWidget(&widget2); + widget2.show(); + expected = QPixmap::grabWidget(&widget2); + + QVERIFY(lenientCompare(actual, expected)); } void tst_QPixmap::grabWindow() -- cgit v0.12 From 45a5c5e2ba0ddc841629d99ee9929f5213293728 Mon Sep 17 00:00:00 2001 From: ck Date: Thu, 12 Nov 2009 17:28:40 +0100 Subject: Assistant: Refactor the handleCommand() function. RemoteControl::handleCommand() was too long and has been split up. Reviewed-by: kh1 --- tools/assistant/tools/assistant/remotecontrol.cpp | 271 +++++++++++++--------- tools/assistant/tools/assistant/remotecontrol.h | 13 ++ 2 files changed, 175 insertions(+), 109 deletions(-) diff --git a/tools/assistant/tools/assistant/remotecontrol.cpp b/tools/assistant/tools/assistant/remotecontrol.cpp index c1b995d..ee37b5e 100644 --- a/tools/assistant/tools/assistant/remotecontrol.cpp +++ b/tools/assistant/tools/assistant/remotecontrol.cpp @@ -148,128 +148,181 @@ void RemoteControl::handleCommandString(const QString &cmdString) { QStringList cmds = cmdString.split(QLatin1Char(';')); QStringList::const_iterator it = cmds.constBegin(); - QString cmdLine, cmd, arg; while (it != cmds.constEnd()) { - cmdLine = (*it).trimmed(); - cmd = cmdLine; - arg.clear(); - int i = cmdLine.indexOf(QLatin1Char(' ')); - if (i > 0) { - cmd = cmdLine.left(i); - arg = cmdLine.mid(i+1); - } - cmd = cmd.toLower(); + QString cmd, arg; + splitInputString(*it, cmd, arg); if (m_debug) QMessageBox::information(0, tr("Debugging Remote Control"), tr("Received Command: %1 %2").arg(cmd).arg(arg)); - if (cmd == QLatin1String("debug")) { - if (arg == QLatin1String("on")) - m_debug = true; - else - m_debug = false; - } else if (cmd == QLatin1String("show")) { - if (arg.toLower() == QLatin1String("contents")) { - m_mainWindow->showContents(); - } else if (arg.toLower() == QLatin1String("index")) { - m_mainWindow->showIndex(); - } else if (arg.toLower() == QLatin1String("bookmarks")) { - m_mainWindow->showBookmarks(); - } else if (arg.toLower() == QLatin1String("search")) { - m_mainWindow->showSearch(); - } - } else if (cmd == QLatin1String("hide")) { - if (arg.toLower() == QLatin1String("contents")) { - m_mainWindow->hideContents(); - } else if (arg.toLower() == QLatin1String("index")) { - m_mainWindow->hideIndex(); - } else if (arg.toLower() == QLatin1String("bookmarks")) { - m_mainWindow->hideBookmarks(); - } else if (arg.toLower() == QLatin1String("search")) { - m_mainWindow->hideSearch(); - } - } else if (cmd == QLatin1String("setsource")) { - QUrl url(arg); - if (url.isValid()) { - if (url.isRelative()) - url = CentralWidget::instance()->currentSource().resolved(url); - if (m_caching) { - clearCache(); - m_setSource = url; - } else { - CentralWidget::instance()->setSource(url); - } - } - } else if (cmd == QLatin1String("synccontents")) { - if (m_caching) - m_syncContents = true; - else - m_mainWindow->syncContents(); - } else if (cmd == QLatin1String("activatekeyword")) { - if (m_caching) { - clearCache(); - m_activateKeyword = arg; - } else { - m_mainWindow->setIndexString(arg); - if (!arg.isEmpty()) - m_helpEngine->indexWidget()->activateCurrentItem(); - } - } else if (cmd == QLatin1String("activateidentifier")) { - if (m_caching) { - clearCache(); - m_activateIdentifier = arg; - } else { - QMap links = - m_helpEngine->linksForIdentifier(arg); - if (links.count()) - CentralWidget::instance()->setSource(links.constBegin().value()); - } - } else if (cmd == QLatin1String("expandtoc")) { - bool ok = false; - int depth = -1; - if (!arg.isEmpty()) - depth = arg.toInt(&ok); - if (!ok) - depth = -1; - - if (m_caching) - m_expandTOC = depth; - else - m_mainWindow->expandTOC(depth); - } else if (cmd == QLatin1String("setcurrentfilter") - && m_helpEngine->customFilters().contains(arg)) { - if (m_caching) { - clearCache(); - m_currentFilter = arg; - } else { - m_helpEngine->setCurrentFilter(arg); - } - } else if (cmd == QLatin1String("register")) { - const QString &absFileName = QFileInfo(arg).absoluteFilePath(); - if (m_helpEngine->registeredDocumentations(). - contains(QHelpEngineCore::namespaceName(absFileName))) - return; - m_helpEngine->registerDocumentation(absFileName); - m_helpEngine->setupData(); - } else if (cmd == QLatin1String("unregister")) { - const QString &absFileName = QFileInfo(arg).absoluteFilePath(); - const QString &ns = QHelpEngineCore::namespaceName(absFileName); - if (m_helpEngine->registeredDocumentations().contains(ns)) { - CentralWidget* widget = CentralWidget::instance(); - widget->closeTabs(widget->currentSourceFileList().keys(ns)); - m_helpEngine->unregisterDocumentation(ns); - m_helpEngine->setupData(); - } - } else { + if (cmd == QLatin1String("debug")) + handleDebugCommand(arg); + else if (cmd == QLatin1String("show")) + handleShowCommand(arg); + else if (cmd == QLatin1String("hide")) + handleHideCommand(arg); + else if (cmd == QLatin1String("setsource")) + handleSetSourceCommand(arg); + else if (cmd == QLatin1String("synccontents")) + handleSyncContentsCommand(); + else if (cmd == QLatin1String("activatekeyword")) + handleActivateKeywordCommand(arg); + else if (cmd == QLatin1String("activateidentifier")) + handleActivateIdentifierCommand(arg); + else if (cmd == QLatin1String("expandtoc")) + handleExpandTocCommand(arg); + else if (cmd == QLatin1String("setcurrentfilter")) + handleSetCurrentFilterCommand(arg); + else if (cmd == QLatin1String("register")) + handleRegisterCommand(arg); + else if (cmd == QLatin1String("unregister")) + handleUnregisterCommand(arg); + else return; - } + ++it; } m_mainWindow->raise(); m_mainWindow->activateWindow(); } +void RemoteControl::splitInputString(const QString &input, QString &cmd, + QString &arg) +{ + QString cmdLine = input.trimmed(); + int i = cmdLine.indexOf(QLatin1Char(' ')); + cmd = cmdLine.left(i); + arg = cmdLine.mid(i+1); + cmd = cmd.toLower(); +} + +void RemoteControl::handleDebugCommand(const QString &arg) +{ + m_debug = arg == QLatin1String("on"); +} + +void RemoteControl::handleShowCommand(const QString &arg) +{ + if (arg.toLower() == QLatin1String("contents")) + m_mainWindow->showContents(); + else if (arg.toLower() == QLatin1String("index")) + m_mainWindow->showIndex(); + else if (arg.toLower() == QLatin1String("bookmarks")) + m_mainWindow->showBookmarks(); + else if (arg.toLower() == QLatin1String("search")) + m_mainWindow->showSearch(); +} + +void RemoteControl::handleHideCommand(const QString &arg) +{ + if (arg.toLower() == QLatin1String("contents")) + m_mainWindow->hideContents(); + else if (arg.toLower() == QLatin1String("index")) + m_mainWindow->hideIndex(); + else if (arg.toLower() == QLatin1String("bookmarks")) + m_mainWindow->hideBookmarks(); + else if (arg.toLower() == QLatin1String("search")) + m_mainWindow->hideSearch(); +} + +void RemoteControl::handleSetSourceCommand(const QString &arg) +{ + QUrl url(arg); + if (url.isValid()) { + if (url.isRelative()) + url = CentralWidget::instance()->currentSource().resolved(url); + if (m_caching) { + clearCache(); + m_setSource = url; + } else { + CentralWidget::instance()->setSource(url); + } + } +} + +void RemoteControl::handleSyncContentsCommand() +{ + if (m_caching) + m_syncContents = true; + else + m_mainWindow->syncContents(); +} + +void RemoteControl::handleActivateKeywordCommand(const QString &arg) +{ + if (m_caching) { + clearCache(); + m_activateKeyword = arg; + } else { + m_mainWindow->setIndexString(arg); + if (!arg.isEmpty()) + m_helpEngine->indexWidget()->activateCurrentItem(); + } +} + +void RemoteControl::handleActivateIdentifierCommand(const QString &arg) +{ + if (m_caching) { + clearCache(); + m_activateIdentifier = arg; + } else { + const QMap &links = + m_helpEngine->linksForIdentifier(arg); + if (!links.isEmpty()) + CentralWidget::instance()->setSource(links.constBegin().value()); + } +} + +void RemoteControl::handleExpandTocCommand(const QString &arg) +{ + bool ok = false; + int depth = -1; + if (!arg.isEmpty()) + depth = arg.toInt(&ok); + if (!ok) + depth = -1; + + if (m_caching) + m_expandTOC = depth; + else + m_mainWindow->expandTOC(depth); +} + +void RemoteControl::handleSetCurrentFilterCommand(const QString &arg) +{ + if (m_helpEngine->customFilters().contains(arg)) { + if (m_caching) { + clearCache(); + m_currentFilter = arg; + } else { + m_helpEngine->setCurrentFilter(arg); + } + } +} + +void RemoteControl::handleRegisterCommand(const QString &arg) +{ + const QString &absFileName = QFileInfo(arg).absoluteFilePath(); + if (m_helpEngine->registeredDocumentations(). + contains(QHelpEngineCore::namespaceName(absFileName))) + return; + m_helpEngine->registerDocumentation(absFileName); + m_helpEngine->setupData(); +} + +void RemoteControl::handleUnregisterCommand(const QString &arg) +{ + const QString &absFileName = QFileInfo(arg).absoluteFilePath(); + const QString &ns = QHelpEngineCore::namespaceName(absFileName); + if (m_helpEngine->registeredDocumentations().contains(ns)) { + CentralWidget* widget = CentralWidget::instance(); + widget->closeTabs(widget->currentSourceFileList().keys(ns)); + m_helpEngine->unregisterDocumentation(ns); + m_helpEngine->setupData(); + } +} + void RemoteControl::applyCache() { if (m_setSource.isValid()) { diff --git a/tools/assistant/tools/assistant/remotecontrol.h b/tools/assistant/tools/assistant/remotecontrol.h index 710712c..07d0479 100644 --- a/tools/assistant/tools/assistant/remotecontrol.h +++ b/tools/assistant/tools/assistant/remotecontrol.h @@ -43,6 +43,7 @@ #define REMOTECONTROL_H #include +#include #include QT_BEGIN_NAMESPACE @@ -64,6 +65,18 @@ private slots: private: void clearCache(); + void splitInputString(const QString &input, QString &cmd, QString &arg); + void handleDebugCommand(const QString &arg); + void handleShowCommand(const QString &arg); + void handleHideCommand(const QString &arg); + void handleSetSourceCommand(const QString &arg); + void handleSyncContentsCommand(); + void handleActivateKeywordCommand(const QString &arg); + void handleActivateIdentifierCommand(const QString &arg); + void handleExpandTocCommand(const QString &arg); + void handleSetCurrentFilterCommand(const QString &arg); + void handleRegisterCommand(const QString &arg); + void handleUnregisterCommand(const QString &arg); private: MainWindow *m_mainWindow; -- cgit v0.12 From fc0403dd7c6d282882909fae32f729f5c855d55b Mon Sep 17 00:00:00 2001 From: ck Date: Thu, 12 Nov 2009 18:01:07 +0100 Subject: Assistant: Refactoring of remote show/hide handling. Got rid of some ugly code redundancy. Reviewed-by: kh1 --- tools/assistant/tools/assistant/mainwindow.cpp | 73 ++++++++++++++++------- tools/assistant/tools/assistant/mainwindow.h | 20 ++++--- tools/assistant/tools/assistant/remotecontrol.cpp | 26 +++----- tools/assistant/tools/assistant/remotecontrol.h | 3 +- 4 files changed, 73 insertions(+), 49 deletions(-) diff --git a/tools/assistant/tools/assistant/mainwindow.cpp b/tools/assistant/tools/assistant/mainwindow.cpp index 4b75387..08feb4e 100644 --- a/tools/assistant/tools/assistant/mainwindow.cpp +++ b/tools/assistant/tools/assistant/mainwindow.cpp @@ -875,41 +875,84 @@ void MainWindow::showAboutDialog() aboutDia.exec(); } +void MainWindow::setContentsVisible(bool visible) +{ + if (visible) + showContents(); + else + hideContents(); +} + void MainWindow::showContents() { activateDockWidget(m_contentWindow); } +void MainWindow::hideContents() +{ + m_contentWindow->parentWidget()->hide(); +} + +void MainWindow::setIndexVisible(bool visible) +{ + if (visible) + showIndex(); + else + hideIndex(); +} + void MainWindow::showIndex() { activateDockWidget(m_indexWindow); } +void MainWindow::hideIndex() +{ + m_indexWindow->parentWidget()->hide(); +} + +void MainWindow::setBookmarksVisible(bool visible) +{ + if (visible) + showBookmarks(); + else + hideBookmarks(); +} + + void MainWindow::showBookmarks() { activateDockWidget(m_bookmarkWidget); } -void MainWindow::activateDockWidget(QWidget *w) +void MainWindow::hideBookmarks() { - w->parentWidget()->show(); - w->parentWidget()->raise(); - w->setFocus(); + m_bookmarkWidget->parentWidget()->hide(); } -void MainWindow::hideContents() +void MainWindow::setSearchVisible(bool visible) { - m_contentWindow->parentWidget()->hide(); + if (visible) + showSearch(); + else + hideSearch(); } -void MainWindow::hideIndex() +void MainWindow::showSearch() { - m_indexWindow->parentWidget()->hide(); + m_centralWidget->activateSearchWidget(); } -void MainWindow::hideBookmarks() +void MainWindow::hideSearch() { - m_bookmarkWidget->parentWidget()->hide(); + m_centralWidget->removeSearchWidget(); +} + +void MainWindow::activateDockWidget(QWidget *w) +{ + w->parentWidget()->show(); + w->parentWidget()->raise(); + w->setFocus(); } void MainWindow::setIndexString(const QString &str) @@ -930,21 +973,11 @@ void MainWindow::activateCurrentCentralWidgetTab() m_centralWidget->activateTab(); } -void MainWindow::showSearch() -{ - m_centralWidget->activateSearchWidget(); -} - void MainWindow::showSearchWidget() { m_centralWidget->activateSearchWidget(true); } -void MainWindow::hideSearch() -{ - m_centralWidget->removeSearchWidget(); -} - void MainWindow::updateApplicationFont() { QFont font = qApp->font(); diff --git a/tools/assistant/tools/assistant/mainwindow.h b/tools/assistant/tools/assistant/mainwindow.h index 3ab9403..96daf99 100644 --- a/tools/assistant/tools/assistant/mainwindow.h +++ b/tools/assistant/tools/assistant/mainwindow.h @@ -76,10 +76,6 @@ public: static QString defaultHelpCollectionFileName(); public: - void hideContents(); - void hideIndex(); - void hideBookmarks(); - void hideSearch(); void setIndexString(const QString &str); void expandTOC(int depth); bool usesDefaultCollection() const; @@ -88,16 +84,20 @@ signals: void initDone(); public slots: - void showContents(); - void showIndex(); - void showBookmarks(); - void showSearch(); + void setContentsVisible(bool visible); + void setIndexVisible(bool visible); + void setBookmarksVisible(bool visible); + void setSearchVisible(bool visible); void showSearchWidget(); void syncContents(); void activateCurrentCentralWidgetTab(); void currentFilterChanged(const QString &filter); private slots: + void showContents(); + void showIndex(); + void showBookmarks(); + void showSearch(); void insertLastPages(); void addBookmark(); void gotoAddress(); @@ -136,6 +136,10 @@ private: void setupAddressToolbar(); QMenu *toolBarMenu(); QWidget *setupBookmarkWidget(); + void hideContents(); + void hideIndex(); + void hideBookmarks(); + void hideSearch(); QHelpEngine *m_helpEngine; CentralWidget *m_centralWidget; diff --git a/tools/assistant/tools/assistant/remotecontrol.cpp b/tools/assistant/tools/assistant/remotecontrol.cpp index ee37b5e..55780e1 100644 --- a/tools/assistant/tools/assistant/remotecontrol.cpp +++ b/tools/assistant/tools/assistant/remotecontrol.cpp @@ -159,9 +159,9 @@ void RemoteControl::handleCommandString(const QString &cmdString) if (cmd == QLatin1String("debug")) handleDebugCommand(arg); else if (cmd == QLatin1String("show")) - handleShowCommand(arg); + handleShowOrHideCommand(arg, true); else if (cmd == QLatin1String("hide")) - handleHideCommand(arg); + handleShowOrHideCommand(arg, false); else if (cmd == QLatin1String("setsource")) handleSetSourceCommand(arg); else if (cmd == QLatin1String("synccontents")) @@ -202,28 +202,16 @@ void RemoteControl::handleDebugCommand(const QString &arg) m_debug = arg == QLatin1String("on"); } -void RemoteControl::handleShowCommand(const QString &arg) +void RemoteControl::handleShowOrHideCommand(const QString &arg, bool show) { if (arg.toLower() == QLatin1String("contents")) - m_mainWindow->showContents(); + m_mainWindow->setContentsVisible(show); else if (arg.toLower() == QLatin1String("index")) - m_mainWindow->showIndex(); + m_mainWindow->setIndexVisible(show); else if (arg.toLower() == QLatin1String("bookmarks")) - m_mainWindow->showBookmarks(); + m_mainWindow->setBookmarksVisible(show); else if (arg.toLower() == QLatin1String("search")) - m_mainWindow->showSearch(); -} - -void RemoteControl::handleHideCommand(const QString &arg) -{ - if (arg.toLower() == QLatin1String("contents")) - m_mainWindow->hideContents(); - else if (arg.toLower() == QLatin1String("index")) - m_mainWindow->hideIndex(); - else if (arg.toLower() == QLatin1String("bookmarks")) - m_mainWindow->hideBookmarks(); - else if (arg.toLower() == QLatin1String("search")) - m_mainWindow->hideSearch(); + m_mainWindow->setSearchVisible(show); } void RemoteControl::handleSetSourceCommand(const QString &arg) diff --git a/tools/assistant/tools/assistant/remotecontrol.h b/tools/assistant/tools/assistant/remotecontrol.h index 07d0479..c1c3105 100644 --- a/tools/assistant/tools/assistant/remotecontrol.h +++ b/tools/assistant/tools/assistant/remotecontrol.h @@ -67,8 +67,7 @@ private: void clearCache(); void splitInputString(const QString &input, QString &cmd, QString &arg); void handleDebugCommand(const QString &arg); - void handleShowCommand(const QString &arg); - void handleHideCommand(const QString &arg); + void handleShowOrHideCommand(const QString &arg, bool show); void handleSetSourceCommand(const QString &arg); void handleSyncContentsCommand(); void handleActivateKeywordCommand(const QString &arg); -- cgit v0.12 From 2107870f75362eed07d353b6b171878713c7cfd3 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 11 Nov 2009 15:12:42 +0100 Subject: Fix S60 input method not showing up in editable QGraphicsTextItems Correctly set the ItemAcceptsInputMethod flag in setTextInteractionFlags. Reviewed-by: Andreas Reviewed-by: axis Reviewed-by: Janne Koskinen --- src/gui/graphicsview/qgraphicsitem.cpp | 5 +++-- tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 2685b86..cf2e2b1 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -10046,9 +10046,10 @@ bool QGraphicsTextItemPrivate::_q_mouseOnEdge(QGraphicsSceneMouseEvent *event) void QGraphicsTextItem::setTextInteractionFlags(Qt::TextInteractionFlags flags) { if (flags == Qt::NoTextInteraction) - setFlags(this->flags() & ~QGraphicsItem::ItemIsFocusable); + setFlags(this->flags() & ~(QGraphicsItem::ItemIsFocusable | QGraphicsItem::ItemAcceptsInputMethod)); else - setFlags(this->flags() | QGraphicsItem::ItemIsFocusable); + setFlags(this->flags() | QGraphicsItem::ItemIsFocusable | QGraphicsItem::ItemAcceptsInputMethod); + dd->textControl()->setTextInteractionFlags(flags); } diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index dcad8e1..6c32138 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -4074,8 +4074,11 @@ void tst_QGraphicsItem::defaultItemTest_QGraphicsTextItem() QCOMPARE(text->pos(), QPointF(10, 10)); + text->setTextInteractionFlags(Qt::NoTextInteraction); + QVERIFY(!(text->flags() & QGraphicsItem::ItemAcceptsInputMethod)); text->setTextInteractionFlags(Qt::TextEditorInteraction); QCOMPARE(text->textInteractionFlags(), Qt::TextInteractionFlags(Qt::TextEditorInteraction)); + QVERIFY(text->flags() & QGraphicsItem::ItemAcceptsInputMethod); { QGraphicsSceneMouseEvent event2(QEvent::GraphicsSceneMouseMove); -- cgit v0.12 From 88412920c58286d22aaa1e121b1030298adf86eb Mon Sep 17 00:00:00 2001 From: ck Date: Fri, 13 Nov 2009 11:13:04 +0100 Subject: Assistant: Fix some license headers. --- tools/assistant/lib/qclucenefieldnames.cpp | 2 +- tools/assistant/lib/qclucenefieldnames_p.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/assistant/lib/qclucenefieldnames.cpp b/tools/assistant/lib/qclucenefieldnames.cpp index df01d1a..84e3a1a 100644 --- a/tools/assistant/lib/qclucenefieldnames.cpp +++ b/tools/assistant/lib/qclucenefieldnames.cpp @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the Qt Assistant. +** This file is part of the Qt Assistant of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage diff --git a/tools/assistant/lib/qclucenefieldnames_p.h b/tools/assistant/lib/qclucenefieldnames_p.h index 57b85f8..489832f 100644 --- a/tools/assistant/lib/qclucenefieldnames_p.h +++ b/tools/assistant/lib/qclucenefieldnames_p.h @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the Qt Assistant. +** This file is part of the Qt Assistant of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage -- cgit v0.12 From 9cd0edaa07d469df4daa7b071031d58cf0baaee3 Mon Sep 17 00:00:00 2001 From: ck Date: Fri, 13 Nov 2009 13:42:14 +0100 Subject: Assistant: Fix expandToc logic. Documentation and implementation for the expandToc remote command did not agree. Fixed both. Also added documentation for recently implemented register/unregister remote commands. Reviewed-by: kh1 Reviewed-by: David Boddie --- doc/src/development/assistant-manual.qdoc | 11 +++++++++-- tools/assistant/tools/assistant/contentwindow.cpp | 6 +++++- tools/assistant/tools/assistant/mainwindow.cpp | 1 + tools/assistant/tools/assistant/remotecontrol.cpp | 13 +++++++------ 4 files changed, 22 insertions(+), 9 deletions(-) diff --git a/doc/src/development/assistant-manual.qdoc b/doc/src/development/assistant-manual.qdoc index 3ecadc7..9b52df4 100644 --- a/doc/src/development/assistant-manual.qdoc +++ b/doc/src/development/assistant-manual.qdoc @@ -722,13 +722,20 @@ \o Selects the item in the contents widget which corresponds to the currently displayed page. \row - \o \c{setCurrentFilter} + \o \c{setCurrentFilter } \o Selects the specified filter and updates the visual representation accordingly. \row \o \c{expandToc } \o Expands the table of contents tree to the given depth. If depth - is less than 1, the tree will be collapsed completely. + is 0, the tree will be collapsed completely. If depth is -1, + the tree will be expanded completely. + \row + \o \c{register } + \o Adds the given Qt compressed help file to the collection. + \row + \o \c{unregister } + \o Removes the given Qt compressed help file from the collection. \endtable If you want to send several commands within a short period of time, it is diff --git a/tools/assistant/tools/assistant/contentwindow.cpp b/tools/assistant/tools/assistant/contentwindow.cpp index 3ae7702..1e3953a 100644 --- a/tools/assistant/tools/assistant/contentwindow.cpp +++ b/tools/assistant/tools/assistant/contentwindow.cpp @@ -89,6 +89,7 @@ bool ContentWindow::syncToContent(const QUrl& url) void ContentWindow::expandTOC() { + Q_ASSERT(m_expandDepth >= -2); if (m_expandDepth > -2) { expandToDepth(m_expandDepth); m_expandDepth = -2; @@ -97,11 +98,14 @@ void ContentWindow::expandTOC() void ContentWindow::expandToDepth(int depth) { + Q_ASSERT(depth >= -2); m_expandDepth = depth; if (depth == -1) m_contentWidget->expandAll(); + else if (depth == 0) + m_contentWidget->collapseAll(); else - m_contentWidget->expandToDepth(depth); + m_contentWidget->expandToDepth(depth - 1); } void ContentWindow::focusInEvent(QFocusEvent *e) diff --git a/tools/assistant/tools/assistant/mainwindow.cpp b/tools/assistant/tools/assistant/mainwindow.cpp index 08feb4e..4f99714 100644 --- a/tools/assistant/tools/assistant/mainwindow.cpp +++ b/tools/assistant/tools/assistant/mainwindow.cpp @@ -1007,6 +1007,7 @@ void MainWindow::filterDocumentation(const QString &customFilter) void MainWindow::expandTOC(int depth) { + Q_ASSERT(depth >= -1); m_contentWindow->expandToDepth(depth); } diff --git a/tools/assistant/tools/assistant/remotecontrol.cpp b/tools/assistant/tools/assistant/remotecontrol.cpp index 55780e1..0ccf743 100644 --- a/tools/assistant/tools/assistant/remotecontrol.cpp +++ b/tools/assistant/tools/assistant/remotecontrol.cpp @@ -112,7 +112,7 @@ RemoteControl::RemoteControl(MainWindow *mainWindow, QHelpEngine *helpEngine) , m_debug(false) , m_caching(true) , m_syncContents(false) - , m_expandTOC(-3) + , m_expandTOC(-2) { connect(m_mainWindow, SIGNAL(initDone()), this, SLOT(applyCache())); @@ -265,15 +265,15 @@ void RemoteControl::handleActivateIdentifierCommand(const QString &arg) void RemoteControl::handleExpandTocCommand(const QString &arg) { bool ok = false; - int depth = -1; + int depth = -2; if (!arg.isEmpty()) depth = arg.toInt(&ok); - if (!ok) - depth = -1; + if (!ok || depth < -2) + depth = -2; if (m_caching) m_expandTOC = depth; - else + else if (depth != -2) m_mainWindow->expandTOC(depth); } @@ -330,7 +330,8 @@ void RemoteControl::applyCache() if (m_syncContents) m_mainWindow->syncContents(); - if (m_expandTOC != -3) + Q_ASSERT(m_expandTOC >= -2); + if (m_expandTOC != -2) m_mainWindow->expandTOC(m_expandTOC); m_caching = false; -- cgit v0.12 From cf44101e03eb33caa7c37fbd8023c2948b7f0249 Mon Sep 17 00:00:00 2001 From: ck Date: Fri, 13 Nov 2009 16:25:37 +0100 Subject: Assistant: Refactor command line parser. Reviewed-by: kh1 --- tools/assistant/tools/assistant/cmdlineparser.cpp | 302 +++++++++++----------- tools/assistant/tools/assistant/cmdlineparser.h | 26 +- tools/assistant/tools/assistant/main.cpp | 4 +- 3 files changed, 173 insertions(+), 159 deletions(-) diff --git a/tools/assistant/tools/assistant/cmdlineparser.cpp b/tools/assistant/tools/assistant/cmdlineparser.cpp index 1245d7c..b17909c 100644 --- a/tools/assistant/tools/assistant/cmdlineparser.cpp +++ b/tools/assistant/tools/assistant/cmdlineparser.cpp @@ -46,21 +46,7 @@ QT_BEGIN_NAMESPACE -#define CHECK_NEXT_ARG \ - ++i < arguments.count() && !arguments.at(i).startsWith(QLatin1String("-")) - -CmdLineParser::CmdLineParser() - : m_enableRemoteControl(false), - m_contents(Untouched), - m_index(Untouched), - m_bookmarks(Untouched), - m_search(Untouched), - m_register(None), - m_removeSearchIndex(false), - m_copy(false), - m_quiet(false) -{ - m_helpMessage = QLatin1String( +const QString CmdLineParser::m_helpMessage = QLatin1String( "Usage: assistant [Options]\n\n" "-collectionFile file Uses the specified collection\n" " file instead of the default one\n" @@ -89,152 +75,62 @@ CmdLineParser::CmdLineParser() " status message.\n" "-help Displays this help.\n" ); -} -CmdLineParser::Result CmdLineParser::parse(const QStringList &arguments) -{ - QString error; - bool showHelp = false; - for (int j=1; j #include #include @@ -49,13 +50,14 @@ QT_BEGIN_NAMESPACE class CmdLineParser { + Q_DECLARE_TR_FUNCTIONS(CmdLineParser) public: enum Result {Ok, Help, Error}; enum ShowState {Untouched, Show, Hide, Activate}; enum RegisterState {None, Register, Unregister}; - CmdLineParser(); - Result parse(const QStringList &arguments); + CmdLineParser(const QStringList &arguments); + Result parse(); void setCollectionFile(const QString &file); QString collectionFile() const; @@ -71,14 +73,26 @@ public: RegisterState registerRequest() const; QString helpFile() const; - bool copy() const { return m_copy; } - void showMessage(const QString &msg, bool error); private: QString getFileName(const QString &fileName); + bool hasMoreArgs() const; + const QString &nextArg(); + void handleCollectionFileOption(); + void handleShowUrlOption(); + void handleShowOption(); + void handleHideOption(); + void handleActivateOption(); + void handleShowOrHideOrActivateOption(ShowState state); + void handleRegisterOption(); + void handleUnregisterOption(); + void handleRegisterOrUnregisterOption(RegisterState state); + void handleSetCurrentFilterOption(); - QString m_helpMessage; + QStringList m_arguments; + int m_pos; + static const QString m_helpMessage; QString m_collectionFile; QString m_cloneFile; QString m_helpFile; @@ -92,8 +106,8 @@ private: RegisterState m_register; QString m_currentFilter; bool m_removeSearchIndex; - bool m_copy; bool m_quiet; + QString m_error; }; QT_END_NAMESPACE diff --git a/tools/assistant/tools/assistant/main.cpp b/tools/assistant/tools/assistant/main.cpp index 2df7a6b..1b3a5f9 100644 --- a/tools/assistant/tools/assistant/main.cpp +++ b/tools/assistant/tools/assistant/main.cpp @@ -210,8 +210,8 @@ int main(int argc, char *argv[]) QApplication a(argc, argv, useGui); a.addLibraryPath(a.applicationDirPath() + QLatin1String("/plugins")); - CmdLineParser cmd; - CmdLineParser::Result res = cmd.parse(a.arguments()); + CmdLineParser cmd(a.arguments()); + CmdLineParser::Result res = cmd.parse(); if (res == CmdLineParser::Help) return 0; else if (res == CmdLineParser::Error) -- cgit v0.12 From d0fb8557f3fc3e7c9305662d118228ceca9df72b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Fri, 13 Nov 2009 17:38:02 +0100 Subject: Character spacing when drawing a QPicture to a high DPI device. Drawing some text into a QPicture, and then drawing that QPicture to e.g. a QPrinter, would make the character spacing all wrong. The old approach that tried to fix this adjusted the DPI of the font that was used, so that the text size would be correct. It seems this is not enough, since it will lay out the text in the default resolution, and then scale that up, which may/may not introduce errors. Task-number: QTBUG-4974, 256481 Reviewed-by: Kim --- src/gui/image/qpicture.cpp | 49 +++++++++------------------------------------- 1 file changed, 9 insertions(+), 40 deletions(-) diff --git a/src/gui/image/qpicture.cpp b/src/gui/image/qpicture.cpp index f502827..6c5fb02 100644 --- a/src/gui/image/qpicture.cpp +++ b/src/gui/image/qpicture.cpp @@ -440,36 +440,6 @@ bool QPicture::play(QPainter *painter) return true; // no end-command } - -// -// QFakeDevice is used to create fonts with a custom DPI -// -class QFakeDevice : public QPaintDevice -{ -public: - QFakeDevice() { dpi_x = qt_defaultDpiX(); dpi_y = qt_defaultDpiY(); } - void setDpiX(int dpi) { dpi_x = dpi; } - void setDpiY(int dpi) { dpi_y = dpi; } - QPaintEngine *paintEngine() const { return 0; } - int metric(PaintDeviceMetric m) const - { - switch(m) { - case PdmPhysicalDpiX: - case PdmDpiX: - return dpi_x; - case PdmPhysicalDpiY: - case PdmDpiY: - return dpi_y; - default: - return QPaintDevice::metric(m); - } - } - -private: - int dpi_x; - int dpi_y; -}; - /*! \internal Iterates over the internal picture data and draws the picture using @@ -679,30 +649,29 @@ bool QPicture::exec(QPainter *painter, QDataStream &s, int nrecords) if (d->formatMajor >= 9) { s >> dbl; - QFont fnt(font); - if (dbl != 1.0) { - QFakeDevice fake; - fake.setDpiX(qRound(dbl*qt_defaultDpiX())); - fake.setDpiY(qRound(dbl*qt_defaultDpiY())); - fnt = QFont(font, &fake); - } + QFont fnt(font, painter->device()); + + qreal scale = painter->device()->logicalDpiY() / (dbl*qt_defaultDpiY()); + painter->save(); + painter->scale(1/scale, 1/scale); qreal justificationWidth; s >> justificationWidth; int flags = Qt::TextSingleLine | Qt::TextDontClip | Qt::TextForceLeftToRight; - QSizeF size(1, 1); + QSizeF size(scale, scale); if (justificationWidth > 0) { - size.setWidth(justificationWidth); + size.setWidth(justificationWidth*scale); flags |= Qt::TextJustificationForced; flags |= Qt::AlignJustify; } QFontMetrics fm(fnt); - QPointF pt(p.x(), p.y() - fm.ascent()); + QPointF pt(p.x()*scale, p.y()*scale - fm.ascent()); qt_format_text(fnt, QRectF(pt, size), flags, /*opt*/0, str, /*brect=*/0, /*tabstops=*/0, /*...*/0, /*tabarraylen=*/0, painter); + painter->restore(); } else { qt_format_text(font, QRectF(p, QSizeF(1, 1)), Qt::TextSingleLine | Qt::TextDontClip, /*opt*/0, str, /*brect=*/0, /*tabstops=*/0, /*...*/0, /*tabarraylen=*/0, painter); -- cgit v0.12 From 01733c6c00b2fd2d5ee95b3d0837bc6c993162f3 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 16 Nov 2009 10:45:57 +0100 Subject: Designer: Filter on classname in Widget Box. Introduce special filter string containing name plus class name if it is different and not a layout. Task-number: QTBUG-5492 --- .../widgetbox/widgetboxcategorylistview.cpp | 26 +++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/tools/designer/src/components/widgetbox/widgetboxcategorylistview.cpp b/tools/designer/src/components/widgetbox/widgetboxcategorylistview.cpp index a4cd977..8155405 100644 --- a/tools/designer/src/components/widgetbox/widgetboxcategorylistview.cpp +++ b/tools/designer/src/components/widgetbox/widgetboxcategorylistview.cpp @@ -88,11 +88,15 @@ namespace qdesigner_internal { struct WidgetBoxCategoryEntry { WidgetBoxCategoryEntry(); - explicit WidgetBoxCategoryEntry(const QDesignerWidgetBoxInterface::Widget &widget, const QIcon &icon, bool editable); + explicit WidgetBoxCategoryEntry(const QDesignerWidgetBoxInterface::Widget &widget, + const QString &filter, + const QIcon &icon, + bool editable); QDesignerWidgetBoxInterface::Widget widget; QString toolTip; QString whatsThis; + QString filter; QIcon icon; bool editable; }; @@ -103,8 +107,11 @@ WidgetBoxCategoryEntry::WidgetBoxCategoryEntry() : { } -WidgetBoxCategoryEntry::WidgetBoxCategoryEntry(const QDesignerWidgetBoxInterface::Widget &w, const QIcon &i, bool e) : +WidgetBoxCategoryEntry::WidgetBoxCategoryEntry(const QDesignerWidgetBoxInterface::Widget &w, + const QString &filterIn, + const QIcon &i, bool e) : widget(w), + filter(filterIn), icon(i), editable(e) { @@ -142,6 +149,7 @@ public: private: typedef QList WidgetBoxCategoryEntrys; + QRegExp m_classNameRegExp; QDesignerFormEditorInterface *m_core; WidgetBoxCategoryEntrys m_items; QListView::ViewMode m_viewMode; @@ -149,9 +157,11 @@ private: WidgetBoxCategoryModel::WidgetBoxCategoryModel(QDesignerFormEditorInterface *core, QObject *parent) : QAbstractListModel(parent), + m_classNameRegExp(QLatin1String("widgetDataBase(); const int dbIndex = db->indexOfClassName(widget.name()); if (dbIndex != -1) { @@ -255,7 +271,7 @@ QVariant WidgetBoxCategoryModel::data(const QModelIndex &index, int role) const case Qt::WhatsThisRole: return QVariant(item.whatsThis); case FilterRole: - return item.widget.name(); + return item.filter; } return QVariant(); } -- cgit v0.12 From b4790f30d62b00bd1a91ca9de78b3c5738de5fd1 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Mon, 16 Nov 2009 11:48:32 +0100 Subject: Make SSE/SSE2 and 3dnow autodetectable with mingw by configure.exe Mingw-g++ 4.4 supports those SIMD instructions --- tools/configure/configureapp.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 735e030..7e3182e 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -1853,8 +1853,16 @@ bool Configure::findFile( const QString &fileName ) QString paths; if (file.endsWith(".h")) { - if (!mingwPath.isNull() && !findFileInPaths(file, mingwPath + QLatin1String("/../include")).isNull()) - return true; + if (!mingwPath.isNull()) { + if (!findFileInPaths(file, mingwPath + QLatin1String("/../include")).isNull()) + return true; + //now let's try the additional compiler path + QDir mingwLibDir = mingwPath + QLatin1String("/../lib/gcc/mingw32"); + foreach(const QFileInfo &version, mingwLibDir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot)) { + if (!findFileInPaths(file, version.absoluteFilePath() + QLatin1String("/include")).isNull()) + return true; + } + } paths = QString::fromLocal8Bit(getenv("INCLUDE")); } else if ( file.endsWith( ".lib" ) || file.endsWith( ".a" ) ) { if (!mingwPath.isNull() && !findFileInPaths(file, mingwPath + QLatin1String("/../lib")).isNull()) @@ -1991,11 +1999,11 @@ bool Configure::checkAvailability(const QString &part) else if (part == "DIRECTSHOW") available = (dictionary[ "ARCHITECTURE" ] == "windowsce"); else if (part == "SSE2") - available = (dictionary.value("QMAKESPEC") != "win32-msvc") && (dictionary.value("QMAKESPEC") != "win32-g++"); + available = (dictionary.value("QMAKESPEC") != "win32-msvc"); else if (part == "3DNOW" ) - available = (dictionary.value("QMAKESPEC") != "win32-msvc") && (dictionary.value("QMAKESPEC") != "win32-icc") && findFile("mm3dnow.h") && (dictionary.value("QMAKESPEC") != "win32-g++"); + available = (dictionary.value("QMAKESPEC") != "win32-msvc") && (dictionary.value("QMAKESPEC") != "win32-icc") && findFile("mm3dnow.h"); else if (part == "MMX" || part == "SSE") - available = (dictionary.value("QMAKESPEC") != "win32-msvc") && (dictionary.value("QMAKESPEC") != "win32-g++"); + available = (dictionary.value("QMAKESPEC") != "win32-msvc"); else if (part == "OPENSSL") available = findFile("openssl\\ssl.h"); else if (part == "DBUS") -- cgit v0.12 From 4c34411151516badbf0e286c9a477845cb02b1cc Mon Sep 17 00:00:00 2001 From: APTX Date: Fri, 25 Sep 2009 02:45:20 +0200 Subject: Add EVR to the Phonon DirectShow9 (ds9) backend as the default. EVR stands for Enhanced Video Renderer and uses DXVA2. It was introduced in Windows Vista. Merge-Request: 1606 Reviewed-By: Thierry --- src/3rdparty/phonon/ds9/videorenderer_evr.cpp | 197 ++++++++++++++++++++++++++ src/3rdparty/phonon/ds9/videorenderer_evr.h | 70 +++++++++ src/3rdparty/phonon/ds9/videowidget.cpp | 16 ++- src/plugins/phonon/ds9/ds9.pro | 4 +- 4 files changed, 282 insertions(+), 5 deletions(-) create mode 100644 src/3rdparty/phonon/ds9/videorenderer_evr.cpp create mode 100644 src/3rdparty/phonon/ds9/videorenderer_evr.h diff --git a/src/3rdparty/phonon/ds9/videorenderer_evr.cpp b/src/3rdparty/phonon/ds9/videorenderer_evr.cpp new file mode 100644 index 0000000..3c6ee0d --- /dev/null +++ b/src/3rdparty/phonon/ds9/videorenderer_evr.cpp @@ -0,0 +1,197 @@ +/* This file is part of the KDE project. + +Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + +This library is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation, either version 2.1 or 3 of the License. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this library. If not, see . +*/ + + +#include "videorenderer_evr.h" + +#ifndef QT_NO_PHONON_VIDEO + +#include +#include +#include + +#include +#include + +QT_BEGIN_NAMESPACE + +namespace Phonon +{ + namespace DS9 + { + VideoRendererEVR::~VideoRendererEVR() + { + } + + bool VideoRendererEVR::isNative() const + { + return true; + } + + VideoRendererEVR::VideoRendererEVR(QWidget *target) : m_target(target) + { + m_filter = Filter(CLSID_EnhancedVideoRenderer, IID_IBaseFilter); + if (!m_filter) { + qWarning("the video widget could not be initialized correctly"); + return; + } + + ComPointer filterControl = getService(MR_VIDEO_RENDER_SERVICE, IID_IMFVideoDisplayControl); + + filterControl->SetVideoWindow(reinterpret_cast(target->winId())); + filterControl->SetAspectRatioMode(MFVideoARMode_None); // We're in control of the size + } + + QImage VideoRendererEVR::snapshot() const + { + // TODO test + // This will always capture black areas where no video is drawn, if any are present. + // Due to the hack in notifyResize() + ComPointer filterControl = getService(MR_VIDEO_RENDER_SERVICE, IID_IMFVideoDisplayControl); + if (filterControl) { + BITMAPINFOHEADER bmi; + BYTE *buffer = 0; + DWORD bufferSize; + LONGLONG timeStamp; + + bmi.biSize = sizeof(BITMAPINFOHEADER); + + HRESULT hr = filterControl->GetCurrentImage(&bmi, &buffer, &bufferSize, &timeStamp); + if (SUCCEEDED(hr)) { + + const int w = qAbs(bmi.biWidth), + h = qAbs(bmi.biHeight); + + // Create image and copy data into image. + QImage ret(w, h, QImage::Format_RGB32); + + if (!ret.isNull()) { + uchar *data = buffer; + const int bytes_per_line = w * sizeof(QRgb); + for (int y = h - 1; y >= 0; --y) { + qMemCopy(ret.scanLine(y), //destination + data, //source + bytes_per_line); + data += bytes_per_line; + } + } + ::CoTaskMemFree(buffer); + return ret; + } + } + return QImage(); + } + + QSize VideoRendererEVR::videoSize() const + { + SIZE nativeSize; + SIZE aspectRatioSize; + + ComPointer filterControl = getService(MR_VIDEO_RENDER_SERVICE, IID_IMFVideoDisplayControl); + + filterControl->GetNativeVideoSize(&nativeSize, &aspectRatioSize); + + return QSize(nativeSize.cx, nativeSize.cy); + } + + void VideoRendererEVR::repaintCurrentFrame(QWidget *target, const QRect &rect) + { + // repaint the video + ComPointer filterControl = getService(MR_VIDEO_RENDER_SERVICE, IID_IMFVideoDisplayControl); + // All failed results can be safely ignored + filterControl->RepaintVideo(); + } + + void VideoRendererEVR::notifyResize(const QSize &size, Phonon::VideoWidget::AspectRatio aspectRatio, + Phonon::VideoWidget::ScaleMode scaleMode) + { + if (!isActive()) { + RECT dummyRect = { 0, 0, 0, 0}; + ComPointer filterControl = getService(MR_VIDEO_RENDER_SERVICE, IID_IMFVideoDisplayControl); + filterControl->SetVideoPosition(0, &dummyRect); + return; + } + + const QSize vsize = videoSize(); + internalNotifyResize(size, vsize, aspectRatio, scaleMode); + + RECT dstRectWin = { 0, 0, size.width(), size.height()}; + + // Resize the Stream output rect instead of the destination rect. + // Hacky workaround for flicker in the areas outside of the destination rect + // This way these areas don't exist + MFVideoNormalizedRect streamOutputRect = { float(m_dstX) / float(size.width()), float(m_dstY) / float(size.height()), + float(m_dstWidth + m_dstX) / float(size.width()), float(m_dstHeight + m_dstY) / float(size.height())}; + + ComPointer filterMixer = getService(MR_VIDEO_MIXER_SERVICE, IID_IMFVideoMixerControl); + ComPointer filterControl = getService(MR_VIDEO_RENDER_SERVICE, IID_IMFVideoDisplayControl); + + filterMixer->SetStreamOutputRect(0, &streamOutputRect); + filterControl->SetVideoPosition(0, &dstRectWin); + } + + void VideoRendererEVR::applyMixerSettings(qreal brightness, qreal contrast, qreal hue, qreal saturation) + { + InputPin sink = BackendNode::pins(m_filter, PINDIR_INPUT).first(); + OutputPin source; + if (FAILED(sink->ConnectedTo(source.pparam()))) { + return; //it must be connected to work + } + + // Get the "Video Processor" (used for brightness/contrast/saturation/hue) + ComPointer processor = getService(MR_VIDEO_MIXER_SERVICE, IID_IMFVideoProcessor); + Q_ASSERT(processor); + + DXVA2_ValueRange contrastRange; + DXVA2_ValueRange brightnessRange; + DXVA2_ValueRange saturationRange; + DXVA2_ValueRange hueRange; + + if (FAILED(processor->GetProcAmpRange(DXVA2_ProcAmp_Contrast, &contrastRange))) + return; + if (FAILED(processor->GetProcAmpRange(DXVA2_ProcAmp_Brightness, &brightnessRange))) + return; + if (FAILED(processor->GetProcAmpRange(DXVA2_ProcAmp_Saturation, &saturationRange))) + return; + if (FAILED(processor->GetProcAmpRange(DXVA2_ProcAmp_Hue, &hueRange))) + return; + + DXVA2_ProcAmpValues values; + + values.Contrast = DXVA2FloatToFixed(((contrast < 0 + ? DXVA2FixedToFloat(contrastRange.MinValue) : DXVA2FixedToFloat(contrastRange.MaxValue)) + - DXVA2FixedToFloat(contrastRange.DefaultValue)) * qAbs(contrast) + DXVA2FixedToFloat(contrastRange.DefaultValue)); + values.Brightness = DXVA2FloatToFixed(((brightness < 0 + ? DXVA2FixedToFloat(brightnessRange.MinValue) : DXVA2FixedToFloat(brightnessRange.MaxValue)) + - DXVA2FixedToFloat(brightnessRange.DefaultValue)) * qAbs(brightness) + DXVA2FixedToFloat(brightnessRange.DefaultValue)); + values.Saturation = DXVA2FloatToFixed(((saturation < 0 + ? DXVA2FixedToFloat(saturationRange.MinValue) : DXVA2FixedToFloat(saturationRange.MaxValue)) + - DXVA2FixedToFloat(saturationRange.DefaultValue)) * qAbs(saturation) + DXVA2FixedToFloat(saturationRange.DefaultValue)); + values.Hue = DXVA2FloatToFixed(((hue < 0 + ? DXVA2FixedToFloat(hueRange.MinValue) : DXVA2FixedToFloat(hueRange.MaxValue)) + - DXVA2FixedToFloat(hueRange.DefaultValue)) * qAbs(hue) + DXVA2FixedToFloat(hueRange.DefaultValue)); + + //finally set the settings + processor->SetProcAmpValues(DXVA2_ProcAmp_Contrast | DXVA2_ProcAmp_Brightness | DXVA2_ProcAmp_Saturation | DXVA2_ProcAmp_Hue, &values); + + } + } +} + +QT_END_NAMESPACE + +#endif //QT_NO_PHONON_VIDEO diff --git a/src/3rdparty/phonon/ds9/videorenderer_evr.h b/src/3rdparty/phonon/ds9/videorenderer_evr.h new file mode 100644 index 0000000..055e618 --- /dev/null +++ b/src/3rdparty/phonon/ds9/videorenderer_evr.h @@ -0,0 +1,70 @@ +/* This file is part of the KDE project. + +Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + +This library is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation, either version 2.1 or 3 of the License. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this library. If not, see . +*/ + +#ifndef PHONON_VIDEORENDERER_EVR_H +#define PHONON_VIDEORENDERER_EVR_H + +#include "abstractvideorenderer.h" +#include "compointer.h" + +#include + +QT_BEGIN_NAMESPACE + +#ifndef QT_NO_PHONON_VIDEO + +namespace Phonon +{ + namespace DS9 + { + class VideoRendererEVR : public AbstractVideoRenderer + { + public: + VideoRendererEVR(QWidget *target); + ~VideoRendererEVR(); + + //Implementation from AbstractVideoRenderer + void repaintCurrentFrame(QWidget *target, const QRect &rect); + void notifyResize(const QSize&, Phonon::VideoWidget::AspectRatio, Phonon::VideoWidget::ScaleMode); + QSize videoSize() const; + QImage snapshot() const; + void applyMixerSettings(qreal brightness, qreal contrast, qreal m_hue, qreal saturation); + bool isNative() const; + private: + QWidget *m_target; + + template ComPointer getService(REFGUID guidService, REFIID riid) const + { + ComPointer getService(m_filter, IID_IMFGetService); + Q_ASSERT(getService); + T *ptr = 0; + HRESULT hr = getService->GetService(guidService, riid, (void **) &ptr); + if (!SUCCEEDED(hr) || ptr == 0) + Q_ASSERT(!SUCCEEDED(hr) && ptr != 0); + ComPointer service(ptr); + return service; + } + }; + } +} + +#endif //QT_NO_PHONON_VIDEO + +QT_END_NAMESPACE + +#endif + diff --git a/src/3rdparty/phonon/ds9/videowidget.cpp b/src/3rdparty/phonon/ds9/videowidget.cpp index 091be16..f71eb6f 100644 --- a/src/3rdparty/phonon/ds9/videowidget.cpp +++ b/src/3rdparty/phonon/ds9/videowidget.cpp @@ -24,6 +24,7 @@ along with this library. If not, see . #include "mediaobject.h" +#include "videorenderer_evr.h" #include "videorenderer_vmr9.h" #include "videorenderer_soft.h" @@ -349,14 +350,21 @@ namespace Phonon int index = graphIndex * 2 + type; if (m_renderers[index] == 0 && autoCreate) { AbstractVideoRenderer *renderer = 0; - if (type == Native) { - renderer = new VideoRendererVMR9(m_widget); + if (type == Native) { + renderer = new VideoRendererEVR(m_widget); if (renderer->getFilter() == 0) { - //instanciating the renderer might fail with error VFW_E_DDRAW_CAPS_NOT_SUITABLE (0x80040273) - m_noNativeRendererSupported = true; delete renderer; renderer = 0; } + if (renderer == 0) { + renderer = new VideoRendererVMR9(m_widget); + if (renderer->getFilter() == 0) { + //instanciating the renderer might fail with error VFW_E_DDRAW_CAPS_NOT_SUITABLE (0x80040273) + m_noNativeRendererSupported = true; + delete renderer; + renderer = 0; + } + } } if (renderer == 0) { diff --git a/src/plugins/phonon/ds9/ds9.pro b/src/plugins/phonon/ds9/ds9.pro index 786338a..440f2c5 100644 --- a/src/plugins/phonon/ds9/ds9.pro +++ b/src/plugins/phonon/ds9/ds9.pro @@ -3,7 +3,7 @@ QT += phonon win32:!wince*:contains(QT_CONFIG,opengl):LIBS += -lopengl32 win32:!wince*:LIBS += -lgdi32 win32-msvc2005:DEFINES += _CRT_SECURE_NO_WARNINGS -LIBS += -lstrmiids -ldmoguids -luuid -lmsdmo -lole32 -loleaut32 +LIBS += -lstrmiids -ldmoguids -luuid -lmsdmo -lole32 -loleaut32 -lMfuuid -lStrmiids TARGET = phonon_ds9 DEFINES += PHONON_MAKE_QT_ONLY_BACKEND @@ -23,6 +23,7 @@ HEADERS += \ $$PHONON_DS9_DIR/videowidget.h \ $$PHONON_DS9_DIR/videorenderer_soft.h \ $$PHONON_DS9_DIR/videorenderer_vmr9.h \ + $$PHONON_DS9_DIR/videorenderer_evr.h \ $$PHONON_DS9_DIR/volumeeffect.h \ $$PHONON_DS9_DIR/qbasefilter.h \ $$PHONON_DS9_DIR/qpin.h \ @@ -46,6 +47,7 @@ SOURCES += \ $$PHONON_DS9_DIR/videowidget.cpp \ $$PHONON_DS9_DIR/videorenderer_soft.cpp \ $$PHONON_DS9_DIR/videorenderer_vmr9.cpp \ + $$PHONON_DS9_DIR/videorenderer_evr.cpp \ $$PHONON_DS9_DIR/volumeeffect.cpp \ $$PHONON_DS9_DIR/qbasefilter.cpp \ $$PHONON_DS9_DIR/qpin.cpp \ -- cgit v0.12 From c89baf194c976a16d4865955b4583caa3b337a8d Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Mon, 16 Nov 2009 12:32:06 +0100 Subject: Phonon: make EVR also the default for mingw and fix build with wince --- src/3rdparty/phonon/ds9/qevr9.h | 143 ++++++++ src/3rdparty/phonon/ds9/videorenderer_default.cpp | 153 ++++++++ src/3rdparty/phonon/ds9/videorenderer_default.h | 55 +++ src/3rdparty/phonon/ds9/videorenderer_evr.cpp | 412 +++++++++++----------- src/3rdparty/phonon/ds9/videorenderer_evr.h | 126 +++---- src/3rdparty/phonon/ds9/videorenderer_vmr9.cpp | 112 ------ src/3rdparty/phonon/ds9/videorenderer_vmr9.h | 1 - src/3rdparty/phonon/ds9/videowidget.cpp | 20 +- src/plugins/phonon/ds9/ds9.pro | 14 +- 9 files changed, 647 insertions(+), 389 deletions(-) create mode 100644 src/3rdparty/phonon/ds9/qevr9.h create mode 100644 src/3rdparty/phonon/ds9/videorenderer_default.cpp create mode 100644 src/3rdparty/phonon/ds9/videorenderer_default.h diff --git a/src/3rdparty/phonon/ds9/qevr9.h b/src/3rdparty/phonon/ds9/qevr9.h new file mode 100644 index 0000000..8599fce --- /dev/null +++ b/src/3rdparty/phonon/ds9/qevr9.h @@ -0,0 +1,143 @@ +/* This file is part of the KDE project. + +Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + +This library is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation, either version 2.1 or 3 of the License. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this library. If not, see . +*/ + +#include + +#define DXVA2_ProcAmp_Brightness 1 +#define DXVA2_ProcAmp_Contrast 2 +#define DXVA2_ProcAmp_Hue 4 +#define DXVA2_ProcAmp_Saturation 8 + +typedef enum { + MFVideoARMode_None = 0x00000000, + MFVideoARMode_PreservePicture = 0x00000001, + MFVideoARMode_PreservePixel = 0x00000002, + MFVideoARMode_NonLinearStretch = 0x00000004, + MFVideoARMode_Mask = 0x00000007 +} MFVideoAspectRatioMode; + +typedef struct { + float left; + float top; + float right; + float bottom; +} MFVideoNormalizedRect; + +typedef struct { + UINT DeviceCaps; + D3DPOOL InputPool; + UINT NumForwardRefSamples; + UINT NumBackwardRefSamples; + UINT Reserved; + UINT DeinterlaceTechnology; + UINT ProcAmpControlCaps; + UINT VideoProcessorOperations; + UINT NoiseFilterTechnology; + UINT DetailFilterTechnology; +} DXVA2_VideoProcessorCaps; + +typedef struct { + union { + struct { + USHORT Fraction; + SHORT Value; + }; + LONG ll; + }; +} DXVA2_Fixed32; + +typedef struct { + DXVA2_Fixed32 MinValue; + DXVA2_Fixed32 MaxValue; + DXVA2_Fixed32 DefaultValue; + DXVA2_Fixed32 StepSize; +} DXVA2_ValueRange; + +typedef struct { + DXVA2_Fixed32 Brightness; + DXVA2_Fixed32 Contrast; + DXVA2_Fixed32 Hue; + DXVA2_Fixed32 Saturation; +} DXVA2_ProcAmpValues; + +DXVA2_Fixed32 DXVA2FloatToFixed(const float _float_) +{ + DXVA2_Fixed32 _fixed_; + _fixed_.Fraction = LOWORD(_float_ * 0x10000); + _fixed_.Value = HIWORD(_float_ * 0x10000); + return _fixed_; +} + +float DXVA2FixedToFloat(const DXVA2_Fixed32 _fixed_) +{ + return (FLOAT)_fixed_.Value + (FLOAT)_fixed_.Fraction / 0x10000; +} + +#undef INTERFACE +#define INTERFACE IMFVideoDisplayControl +DECLARE_INTERFACE_(IMFVideoDisplayControl, IUnknown) +{ + STDMETHOD(GetNativeVideoSize)(THIS_ SIZE* pszVideo, SIZE* pszARVideo) PURE; + STDMETHOD(GetIdealVideoSize)(THIS_ SIZE* pszMin, SIZE* pszMax) PURE; + STDMETHOD(SetVideoPosition)(THIS_ const MFVideoNormalizedRect* pnrcSource, const LPRECT prcDest) PURE; + STDMETHOD(GetVideoPosition)(THIS_ MFVideoNormalizedRect* pnrcSource, LPRECT prcDest) PURE; + STDMETHOD(SetAspectRatioMode)(THIS_ DWORD dwAspectRatioMode) PURE; + STDMETHOD(GetAspectRatioMode)(THIS_ DWORD* pdwAspectRatioMode) PURE; + STDMETHOD(SetVideoWindow)(THIS_ HWND hwndVideo) PURE; + STDMETHOD(GetVideoWindow)(THIS_ HWND* phwndVideo) PURE; + STDMETHOD(RepaintVideo)(THIS_) PURE; + STDMETHOD(GetCurrentImage)(THIS_ BITMAPINFOHEADER* pBih, BYTE** pDib, DWORD* pcbDib, LONGLONG* pTimeStamp) PURE; + STDMETHOD(SetBorderColor)(THIS_ COLORREF Clr) PURE; + STDMETHOD(GetBorderColor)(THIS_ COLORREF* pClr) PURE; + STDMETHOD(SetRenderingPrefs)(THIS_ DWORD dwRenderFlags) PURE; + STDMETHOD(GetRenderingPrefs)(THIS_ DWORD* pdwRenderFlags) PURE; + STDMETHOD(SetFullScreen)(THIS_ BOOL fFullscreen) PURE; + STDMETHOD(GetFullScreen)(THIS_ BOOL* pfFullscreen) PURE; +}; +#undef INTERFACE +#define INTERFACE IMFVideoMixerControl +DECLARE_INTERFACE_(IMFVideoMixerControl, IUnknown) +{ + STDMETHOD(SetStreamZOrder)(THIS_ DWORD dwStreamID, DWORD dwZ) PURE; + STDMETHOD(GetStreamZOrder)(THIS_ DWORD dwStreamID, DWORD* pdwZ) PURE; + STDMETHOD(SetStreamOutputRect)(THIS_ DWORD dwStreamID, const MFVideoNormalizedRect* pnrcOutput) PURE; + STDMETHOD(GetStreamOutputRect)(THIS_ DWORD dwStreamID, MFVideoNormalizedRect* pnrcOutput) PURE; +}; +#undef INTERFACE +#define INTERFACE IMFVideoProcessor +DECLARE_INTERFACE_(IMFVideoProcessor, IUnknown) +{ + STDMETHOD(GetAvailableVideoProcessorModes)(THIS_ UINT* lpdwNumProcessingModes, GUID** ppVideoProcessingModes) PURE; + STDMETHOD(GetVideoProcessorCaps)(THIS_ LPGUID lpVideoProcessorMode, DXVA2_VideoProcessorCaps* lpVideoProcessorCaps) PURE; + STDMETHOD(GetVideoProcessorMode)(THIS_ LPGUID lpMode) PURE; + STDMETHOD(SetVideoProcessorMode)(THIS_ LPGUID lpMode) PURE; + STDMETHOD(GetProcAmpRange)(THIS_ DWORD dwProperty, DXVA2_ValueRange* pPropRange) PURE; + STDMETHOD(GetProcAmpValues)(THIS_ DWORD dwFlags, DXVA2_ProcAmpValues* Values) PURE; + STDMETHOD(SetProcAmpValues)(THIS_ DWORD dwFlags, DXVA2_ProcAmpValues* pValues) PURE; + STDMETHOD(GetFilteringRange)(THIS_ DWORD dwProperty, DXVA2_ValueRange* pPropRange) PURE; + STDMETHOD(GetFilteringValue)(THIS_ DWORD dwProperty, DXVA2_Fixed32* pValue) PURE; + STDMETHOD(SetFilteringValue)(THIS_ DWORD dwProperty, DXVA2_Fixed32* pValue) PURE; + STDMETHOD(GetBackgroundColor)(THIS_ COLORREF* lpClrBkg) PURE; + STDMETHOD(SetBackgroundColor)(THIS_ COLORREF ClrBkg) PURE; +}; +#undef INTERFACE +#define INTERFACE IMFGetService +DECLARE_INTERFACE_(IMFGetService, IUnknown) +{ + STDMETHOD(GetService)(THIS_ REFGUID guidService, REFIID riid, LPVOID* ppvObject) PURE; +}; +#undef INTERFACE diff --git a/src/3rdparty/phonon/ds9/videorenderer_default.cpp b/src/3rdparty/phonon/ds9/videorenderer_default.cpp new file mode 100644 index 0000000..9d82255 --- /dev/null +++ b/src/3rdparty/phonon/ds9/videorenderer_default.cpp @@ -0,0 +1,153 @@ +/* This file is part of the KDE project. + +Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + +This library is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation, either version 2.1 or 3 of the License. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this library. If not, see . +*/ + + +#include "videorenderer_default.h" + +#ifndef QT_NO_PHONON_VIDEO + +#include +#include + +#include + +QT_BEGIN_NAMESPACE + + +namespace Phonon +{ + namespace DS9 + { + VideoRendererDefault::~VideoRendererVMR9() + { + } + + bool VideoRendererDefault::isNative() const + { + return true; + } + + + VideoRendererDefault::VideoRendererDefault(QWidget *target) : m_target(target) + { + m_target->setAttribute(Qt::WA_PaintOnScreen, true); + m_filter = Filter(CLSID_VideoRenderer, IID_IBaseFilter); + } + + QSize VideoRendererDefault::videoSize() const + { + LONG w = 0, + h = 0; + ComPointer basic(m_filter, IID_IBasicVideo); + if (basic) { + basic->GetVideoSize( &w, &h); + } + return QSize(w, h); + } + + void VideoRendererDefault::repaintCurrentFrame(QWidget * /*target*/, const QRect & /*rect*/) + { + //nothing to do here: the renderer paints everything + } + + void VideoRendererDefault::notifyResize(const QSize &size, Phonon::VideoWidget::AspectRatio aspectRatio, + Phonon::VideoWidget::ScaleMode scaleMode) + { + if (!isActive()) { + ComPointer basic(m_filter, IID_IBasicVideo); + if (basic) { + basic->SetDestinationPosition(0, 0, 0, 0); + } + return; + } + + ComPointer video(m_filter, IID_IVideoWindow); + + OAHWND owner; + HRESULT hr = video->get_Owner(&owner); + if (FAILED(hr)) { + return; + } + + const OAHWND newOwner = reinterpret_cast(m_target->winId()); + if (owner != newOwner) { + video->put_Owner(newOwner); + video->put_MessageDrain(newOwner); + video->put_WindowStyle(WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS); + } + + //make sure the widget takes the whole size of the parent + video->SetWindowPosition(0, 0, size.width(), size.height()); + + const QSize vsize = videoSize(); + internalNotifyResize(size, vsize, aspectRatio, scaleMode); + + ComPointer basic(m_filter, IID_IBasicVideo); + if (basic) { + basic->SetDestinationPosition(m_dstX, m_dstY, m_dstWidth, m_dstHeight); + } + } + + void VideoRendererDefault::applyMixerSettings(qreal /*brightness*/, qreal /*contrast*/, qreal /*m_hue*/, qreal /*saturation*/) + { + //this can't be supported for the default renderer + } + + QImage VideoRendererDefault::snapshot() const + { + ComPointer basic(m_filter, IID_IBasicVideo); + if (basic) { + LONG bufferSize = 0; + //1st we get the buffer size + basic->GetCurrentImage(&bufferSize, 0); + + QByteArray buffer; + buffer.resize(bufferSize); + HRESULT hr = basic->GetCurrentImage(&bufferSize, reinterpret_cast(buffer.data())); + + if (SUCCEEDED(hr)) { + + const BITMAPINFOHEADER *bmi = reinterpret_cast(buffer.constData()); + + const int w = qAbs(bmi->biWidth), + h = qAbs(bmi->biHeight); + + // Create image and copy data into image. + QImage ret(w, h, QImage::Format_RGB32); + + if (!ret.isNull()) { + const char *data = buffer.constData() + bmi->biSize; + const int bytes_per_line = w * sizeof(QRgb); + for (int y = h - 1; y >= 0; --y) { + qMemCopy(ret.scanLine(y), //destination + data, //source + bytes_per_line); + data += bytes_per_line; + } + } + return ret; + } + } + return QImage(); + } + + } +} + +QT_END_NAMESPACE + +#endif //QT_NO_PHONON_VIDEO diff --git a/src/3rdparty/phonon/ds9/videorenderer_default.h b/src/3rdparty/phonon/ds9/videorenderer_default.h new file mode 100644 index 0000000..43768d9 --- /dev/null +++ b/src/3rdparty/phonon/ds9/videorenderer_default.h @@ -0,0 +1,55 @@ +/* This file is part of the KDE project. + +Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + +This library is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation, either version 2.1 or 3 of the License. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this library. If not, see . +*/ + +#ifndef PHONON_VIDEORENDERER_DEFAULT_H +#define PHONON_VIDEORENDERER_DEFAULT_H + +#include "abstractvideorenderer.h" + +QT_BEGIN_NAMESPACE + +#ifndef QT_NO_PHONON_VIDEO + +namespace Phonon +{ + namespace DS9 + { + class VideoRendererDefault : public AbstractVideoRenderer + { + public: + VideoRendererDefault(QWidget *target); + ~VideoRendererDefault(); + + //Implementation from AbstractVideoRenderer + void repaintCurrentFrame(QWidget *target, const QRect &rect); + void notifyResize(const QSize&, Phonon::VideoWidget::AspectRatio, Phonon::VideoWidget::ScaleMode); + QSize videoSize() const; + QImage snapshot() const; + void applyMixerSettings(qreal brightness, qreal contrast, qreal m_hue, qreal saturation); + bool isNative() const; + private: + QWidget *m_target; + }; + } +} + +#endif //QT_NO_PHONON_VIDEO + +QT_END_NAMESPACE + +#endif + diff --git a/src/3rdparty/phonon/ds9/videorenderer_evr.cpp b/src/3rdparty/phonon/ds9/videorenderer_evr.cpp index 3c6ee0d..d23d9ce 100644 --- a/src/3rdparty/phonon/ds9/videorenderer_evr.cpp +++ b/src/3rdparty/phonon/ds9/videorenderer_evr.cpp @@ -1,197 +1,215 @@ -/* This file is part of the KDE project. - -Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). - -This library is free software: you can redistribute it and/or modify -it under the terms of the GNU Lesser General Public License as published by -the Free Software Foundation, either version 2.1 or 3 of the License. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public License -along with this library. If not, see . -*/ - - -#include "videorenderer_evr.h" - -#ifndef QT_NO_PHONON_VIDEO - -#include -#include -#include - -#include -#include - -QT_BEGIN_NAMESPACE - -namespace Phonon -{ - namespace DS9 - { - VideoRendererEVR::~VideoRendererEVR() - { - } - - bool VideoRendererEVR::isNative() const - { - return true; - } - - VideoRendererEVR::VideoRendererEVR(QWidget *target) : m_target(target) - { - m_filter = Filter(CLSID_EnhancedVideoRenderer, IID_IBaseFilter); - if (!m_filter) { - qWarning("the video widget could not be initialized correctly"); - return; - } - - ComPointer filterControl = getService(MR_VIDEO_RENDER_SERVICE, IID_IMFVideoDisplayControl); - - filterControl->SetVideoWindow(reinterpret_cast(target->winId())); - filterControl->SetAspectRatioMode(MFVideoARMode_None); // We're in control of the size - } - - QImage VideoRendererEVR::snapshot() const - { - // TODO test - // This will always capture black areas where no video is drawn, if any are present. - // Due to the hack in notifyResize() - ComPointer filterControl = getService(MR_VIDEO_RENDER_SERVICE, IID_IMFVideoDisplayControl); - if (filterControl) { - BITMAPINFOHEADER bmi; - BYTE *buffer = 0; - DWORD bufferSize; - LONGLONG timeStamp; - - bmi.biSize = sizeof(BITMAPINFOHEADER); - - HRESULT hr = filterControl->GetCurrentImage(&bmi, &buffer, &bufferSize, &timeStamp); - if (SUCCEEDED(hr)) { - - const int w = qAbs(bmi.biWidth), - h = qAbs(bmi.biHeight); - - // Create image and copy data into image. - QImage ret(w, h, QImage::Format_RGB32); - - if (!ret.isNull()) { - uchar *data = buffer; - const int bytes_per_line = w * sizeof(QRgb); - for (int y = h - 1; y >= 0; --y) { - qMemCopy(ret.scanLine(y), //destination - data, //source - bytes_per_line); - data += bytes_per_line; - } - } - ::CoTaskMemFree(buffer); - return ret; - } - } - return QImage(); - } - - QSize VideoRendererEVR::videoSize() const - { - SIZE nativeSize; - SIZE aspectRatioSize; - - ComPointer filterControl = getService(MR_VIDEO_RENDER_SERVICE, IID_IMFVideoDisplayControl); - - filterControl->GetNativeVideoSize(&nativeSize, &aspectRatioSize); - - return QSize(nativeSize.cx, nativeSize.cy); - } - - void VideoRendererEVR::repaintCurrentFrame(QWidget *target, const QRect &rect) - { - // repaint the video - ComPointer filterControl = getService(MR_VIDEO_RENDER_SERVICE, IID_IMFVideoDisplayControl); - // All failed results can be safely ignored - filterControl->RepaintVideo(); - } - - void VideoRendererEVR::notifyResize(const QSize &size, Phonon::VideoWidget::AspectRatio aspectRatio, - Phonon::VideoWidget::ScaleMode scaleMode) - { - if (!isActive()) { - RECT dummyRect = { 0, 0, 0, 0}; - ComPointer filterControl = getService(MR_VIDEO_RENDER_SERVICE, IID_IMFVideoDisplayControl); - filterControl->SetVideoPosition(0, &dummyRect); - return; - } - - const QSize vsize = videoSize(); - internalNotifyResize(size, vsize, aspectRatio, scaleMode); - - RECT dstRectWin = { 0, 0, size.width(), size.height()}; - - // Resize the Stream output rect instead of the destination rect. - // Hacky workaround for flicker in the areas outside of the destination rect - // This way these areas don't exist - MFVideoNormalizedRect streamOutputRect = { float(m_dstX) / float(size.width()), float(m_dstY) / float(size.height()), - float(m_dstWidth + m_dstX) / float(size.width()), float(m_dstHeight + m_dstY) / float(size.height())}; - - ComPointer filterMixer = getService(MR_VIDEO_MIXER_SERVICE, IID_IMFVideoMixerControl); - ComPointer filterControl = getService(MR_VIDEO_RENDER_SERVICE, IID_IMFVideoDisplayControl); - - filterMixer->SetStreamOutputRect(0, &streamOutputRect); - filterControl->SetVideoPosition(0, &dstRectWin); - } - - void VideoRendererEVR::applyMixerSettings(qreal brightness, qreal contrast, qreal hue, qreal saturation) - { - InputPin sink = BackendNode::pins(m_filter, PINDIR_INPUT).first(); - OutputPin source; - if (FAILED(sink->ConnectedTo(source.pparam()))) { - return; //it must be connected to work - } - - // Get the "Video Processor" (used for brightness/contrast/saturation/hue) - ComPointer processor = getService(MR_VIDEO_MIXER_SERVICE, IID_IMFVideoProcessor); - Q_ASSERT(processor); - - DXVA2_ValueRange contrastRange; - DXVA2_ValueRange brightnessRange; - DXVA2_ValueRange saturationRange; - DXVA2_ValueRange hueRange; - - if (FAILED(processor->GetProcAmpRange(DXVA2_ProcAmp_Contrast, &contrastRange))) - return; - if (FAILED(processor->GetProcAmpRange(DXVA2_ProcAmp_Brightness, &brightnessRange))) - return; - if (FAILED(processor->GetProcAmpRange(DXVA2_ProcAmp_Saturation, &saturationRange))) - return; - if (FAILED(processor->GetProcAmpRange(DXVA2_ProcAmp_Hue, &hueRange))) - return; - - DXVA2_ProcAmpValues values; - - values.Contrast = DXVA2FloatToFixed(((contrast < 0 - ? DXVA2FixedToFloat(contrastRange.MinValue) : DXVA2FixedToFloat(contrastRange.MaxValue)) - - DXVA2FixedToFloat(contrastRange.DefaultValue)) * qAbs(contrast) + DXVA2FixedToFloat(contrastRange.DefaultValue)); - values.Brightness = DXVA2FloatToFixed(((brightness < 0 - ? DXVA2FixedToFloat(brightnessRange.MinValue) : DXVA2FixedToFloat(brightnessRange.MaxValue)) - - DXVA2FixedToFloat(brightnessRange.DefaultValue)) * qAbs(brightness) + DXVA2FixedToFloat(brightnessRange.DefaultValue)); - values.Saturation = DXVA2FloatToFixed(((saturation < 0 - ? DXVA2FixedToFloat(saturationRange.MinValue) : DXVA2FixedToFloat(saturationRange.MaxValue)) - - DXVA2FixedToFloat(saturationRange.DefaultValue)) * qAbs(saturation) + DXVA2FixedToFloat(saturationRange.DefaultValue)); - values.Hue = DXVA2FloatToFixed(((hue < 0 - ? DXVA2FixedToFloat(hueRange.MinValue) : DXVA2FixedToFloat(hueRange.MaxValue)) - - DXVA2FixedToFloat(hueRange.DefaultValue)) * qAbs(hue) + DXVA2FixedToFloat(hueRange.DefaultValue)); - - //finally set the settings - processor->SetProcAmpValues(DXVA2_ProcAmp_Contrast | DXVA2_ProcAmp_Brightness | DXVA2_ProcAmp_Saturation | DXVA2_ProcAmp_Hue, &values); - - } - } -} - -QT_END_NAMESPACE - -#endif //QT_NO_PHONON_VIDEO +/* This file is part of the KDE project. + +Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + +This library is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation, either version 2.1 or 3 of the License. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this library. If not, see . +*/ + + +#include "videorenderer_evr.h" +#include "qevr9.h" + +#ifndef QT_NO_PHONON_VIDEO + +#include +#include + +QT_BEGIN_NAMESPACE + +namespace Phonon +{ + namespace DS9 + { + //we have to define them here because not all compilers/sdk have them + static const GUID MR_VIDEO_RENDER_SERVICE = {0x1092a86c, 0xab1a, 0x459a, {0xa3, 0x36, 0x83, 0x1f, 0xbc, 0x4d, 0x11, 0xff} }; + static const GUID MR_VIDEO_MIXER_SERVICE = { 0x73cd2fc, 0x6cf4, 0x40b7, {0x88, 0x59, 0xe8, 0x95, 0x52, 0xc8, 0x41, 0xf8} }; + static const IID IID_IMFVideoDisplayControl = {0xa490b1e4, 0xab84, 0x4d31, {0xa1, 0xb2, 0x18, 0x1e, 0x03, 0xb1, 0x07, 0x7a} }; + static const IID IID_IMFVideoMixerControl = {0xA5C6C53F, 0xC202, 0x4aa5, {0x96, 0x95, 0x17, 0x5B, 0xA8, 0xC5, 0x08, 0xA5} }; + static const IID IID_IMFVideoProcessor = {0x6AB0000C, 0xFECE, 0x4d1f, {0xA2, 0xAC, 0xA9, 0x57, 0x35, 0x30, 0x65, 0x6E} }; + static const IID IID_IMFGetService = {0xFA993888, 0x4383, 0x415A, {0xA9, 0x30, 0xDD, 0x47, 0x2A, 0x8C, 0xF6, 0xF7} }; + static const GUID CLSID_EnhancedVideoRenderer = {0xfa10746c, 0x9b63, 0x4b6c, {0xbc, 0x49, 0xfc, 0x30, 0xe, 0xa5, 0xf2, 0x56} }; + + template ComPointer getService(const Filter &filter, REFGUID guidService, REFIID riid) + { + //normally we should use IID_IMFGetService but this introduces another dependency + //so here we simply define our own IId with the same value + ComPointer getService(filter, IID_IMFGetService); + Q_ASSERT(getService); + T *ptr = 0; + HRESULT hr = getService->GetService(guidService, riid, reinterpret_cast(&ptr)); + if (!SUCCEEDED(hr) || ptr == 0) + Q_ASSERT(!SUCCEEDED(hr) && ptr != 0); + ComPointer service(ptr); + return service; + } + + VideoRendererEVR::~VideoRendererEVR() + { + } + + bool VideoRendererEVR::isNative() const + { + return true; + } + + VideoRendererEVR::VideoRendererEVR(QWidget *target) : m_target(target) + { + m_filter = Filter(CLSID_EnhancedVideoRenderer, IID_IBaseFilter); + if (!m_filter) { + return; + } + + ComPointer filterControl = getService(m_filter, MR_VIDEO_RENDER_SERVICE, IID_IMFVideoDisplayControl); + + filterControl->SetVideoWindow(reinterpret_cast(target->winId())); + filterControl->SetAspectRatioMode(MFVideoARMode_None); // We're in control of the size + } + + QImage VideoRendererEVR::snapshot() const + { + // This will always capture black areas where no video is drawn, if any are present. + // Due to the hack in notifyResize() + ComPointer filterControl = getService(m_filter, MR_VIDEO_RENDER_SERVICE, IID_IMFVideoDisplayControl); + if (filterControl) { + BITMAPINFOHEADER bmi; + BYTE *buffer = 0; + DWORD bufferSize; + LONGLONG timeStamp; + + bmi.biSize = sizeof(BITMAPINFOHEADER); + + HRESULT hr = filterControl->GetCurrentImage(&bmi, &buffer, &bufferSize, &timeStamp); + if (SUCCEEDED(hr)) { + + const int w = qAbs(bmi.biWidth), + h = qAbs(bmi.biHeight); + + // Create image and copy data into image. + QImage ret(w, h, QImage::Format_RGB32); + + if (!ret.isNull()) { + uchar *data = buffer; + const int bytes_per_line = w * sizeof(QRgb); + for (int y = h - 1; y >= 0; --y) { + qMemCopy(ret.scanLine(y), //destination + data, //source + bytes_per_line); + data += bytes_per_line; + } + } + ::CoTaskMemFree(buffer); + return ret; + } + } + return QImage(); + } + + QSize VideoRendererEVR::videoSize() const + { + SIZE nativeSize; + SIZE aspectRatioSize; + + ComPointer filterControl = getService(m_filter, MR_VIDEO_RENDER_SERVICE, IID_IMFVideoDisplayControl); + + filterControl->GetNativeVideoSize(&nativeSize, &aspectRatioSize); + + return QSize(nativeSize.cx, nativeSize.cy); + } + + void VideoRendererEVR::repaintCurrentFrame(QWidget *target, const QRect &rect) + { + // repaint the video + ComPointer filterControl = getService(m_filter, MR_VIDEO_RENDER_SERVICE, IID_IMFVideoDisplayControl); + // All failed results can be safely ignored + filterControl->RepaintVideo(); + } + + void VideoRendererEVR::notifyResize(const QSize &size, Phonon::VideoWidget::AspectRatio aspectRatio, + Phonon::VideoWidget::ScaleMode scaleMode) + { + if (!isActive()) { + RECT dummyRect = { 0, 0, 0, 0}; + ComPointer filterControl = getService(m_filter, MR_VIDEO_RENDER_SERVICE, IID_IMFVideoDisplayControl); + filterControl->SetVideoPosition(0, &dummyRect); + return; + } + + const QSize vsize = videoSize(); + internalNotifyResize(size, vsize, aspectRatio, scaleMode); + + RECT dstRectWin = { 0, 0, size.width(), size.height()}; + + // Resize the Stream output rect instead of the destination rect. + // Hacky workaround for flicker in the areas outside of the destination rect + // This way these areas don't exist + MFVideoNormalizedRect streamOutputRect = { float(m_dstX) / float(size.width()), float(m_dstY) / float(size.height()), + float(m_dstWidth + m_dstX) / float(size.width()), float(m_dstHeight + m_dstY) / float(size.height())}; + + ComPointer filterMixer = getService(m_filter, MR_VIDEO_MIXER_SERVICE, IID_IMFVideoMixerControl); + ComPointer filterControl = getService(m_filter, MR_VIDEO_RENDER_SERVICE, IID_IMFVideoDisplayControl); + + filterMixer->SetStreamOutputRect(0, &streamOutputRect); + filterControl->SetVideoPosition(0, &dstRectWin); + } + + void VideoRendererEVR::applyMixerSettings(qreal brightness, qreal contrast, qreal hue, qreal saturation) + { + InputPin sink = BackendNode::pins(m_filter, PINDIR_INPUT).first(); + OutputPin source; + if (FAILED(sink->ConnectedTo(source.pparam()))) { + return; //it must be connected to work + } + + // Get the "Video Processor" (used for brightness/contrast/saturation/hue) + ComPointer processor = getService(m_filter, MR_VIDEO_MIXER_SERVICE, IID_IMFVideoProcessor); + Q_ASSERT(processor); + + DXVA2_ValueRange contrastRange; + DXVA2_ValueRange brightnessRange; + DXVA2_ValueRange saturationRange; + DXVA2_ValueRange hueRange; + + if (FAILED(processor->GetProcAmpRange(DXVA2_ProcAmp_Contrast, &contrastRange))) + return; + if (FAILED(processor->GetProcAmpRange(DXVA2_ProcAmp_Brightness, &brightnessRange))) + return; + if (FAILED(processor->GetProcAmpRange(DXVA2_ProcAmp_Saturation, &saturationRange))) + return; + if (FAILED(processor->GetProcAmpRange(DXVA2_ProcAmp_Hue, &hueRange))) + return; + + DXVA2_ProcAmpValues values; + + values.Contrast = DXVA2FloatToFixed(((contrast < 0 + ? DXVA2FixedToFloat(contrastRange.MinValue) : DXVA2FixedToFloat(contrastRange.MaxValue)) + - DXVA2FixedToFloat(contrastRange.DefaultValue)) * qAbs(contrast) + DXVA2FixedToFloat(contrastRange.DefaultValue)); + values.Brightness = DXVA2FloatToFixed(((brightness < 0 + ? DXVA2FixedToFloat(brightnessRange.MinValue) : DXVA2FixedToFloat(brightnessRange.MaxValue)) + - DXVA2FixedToFloat(brightnessRange.DefaultValue)) * qAbs(brightness) + DXVA2FixedToFloat(brightnessRange.DefaultValue)); + values.Saturation = DXVA2FloatToFixed(((saturation < 0 + ? DXVA2FixedToFloat(saturationRange.MinValue) : DXVA2FixedToFloat(saturationRange.MaxValue)) + - DXVA2FixedToFloat(saturationRange.DefaultValue)) * qAbs(saturation) + DXVA2FixedToFloat(saturationRange.DefaultValue)); + values.Hue = DXVA2FloatToFixed(((hue < 0 + ? DXVA2FixedToFloat(hueRange.MinValue) : DXVA2FixedToFloat(hueRange.MaxValue)) + - DXVA2FixedToFloat(hueRange.DefaultValue)) * qAbs(hue) + DXVA2FixedToFloat(hueRange.DefaultValue)); + + //finally set the settings + processor->SetProcAmpValues(DXVA2_ProcAmp_Contrast | DXVA2_ProcAmp_Brightness | DXVA2_ProcAmp_Saturation | DXVA2_ProcAmp_Hue, &values); + + } + } +} + +QT_END_NAMESPACE + +#endif //QT_NO_PHONON_VIDEO diff --git a/src/3rdparty/phonon/ds9/videorenderer_evr.h b/src/3rdparty/phonon/ds9/videorenderer_evr.h index 055e618..229c36d 100644 --- a/src/3rdparty/phonon/ds9/videorenderer_evr.h +++ b/src/3rdparty/phonon/ds9/videorenderer_evr.h @@ -1,70 +1,56 @@ -/* This file is part of the KDE project. - -Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). - -This library is free software: you can redistribute it and/or modify -it under the terms of the GNU Lesser General Public License as published by -the Free Software Foundation, either version 2.1 or 3 of the License. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public License -along with this library. If not, see . -*/ - -#ifndef PHONON_VIDEORENDERER_EVR_H -#define PHONON_VIDEORENDERER_EVR_H - -#include "abstractvideorenderer.h" -#include "compointer.h" - -#include - -QT_BEGIN_NAMESPACE - -#ifndef QT_NO_PHONON_VIDEO - -namespace Phonon -{ - namespace DS9 - { - class VideoRendererEVR : public AbstractVideoRenderer - { - public: - VideoRendererEVR(QWidget *target); - ~VideoRendererEVR(); - - //Implementation from AbstractVideoRenderer - void repaintCurrentFrame(QWidget *target, const QRect &rect); - void notifyResize(const QSize&, Phonon::VideoWidget::AspectRatio, Phonon::VideoWidget::ScaleMode); - QSize videoSize() const; - QImage snapshot() const; - void applyMixerSettings(qreal brightness, qreal contrast, qreal m_hue, qreal saturation); - bool isNative() const; - private: - QWidget *m_target; - - template ComPointer getService(REFGUID guidService, REFIID riid) const - { - ComPointer getService(m_filter, IID_IMFGetService); - Q_ASSERT(getService); - T *ptr = 0; - HRESULT hr = getService->GetService(guidService, riid, (void **) &ptr); - if (!SUCCEEDED(hr) || ptr == 0) - Q_ASSERT(!SUCCEEDED(hr) && ptr != 0); - ComPointer service(ptr); - return service; - } - }; - } -} - -#endif //QT_NO_PHONON_VIDEO - -QT_END_NAMESPACE - -#endif - +/* This file is part of the KDE project. + +Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + +This library is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation, either version 2.1 or 3 of the License. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this library. If not, see . +*/ + +#ifndef PHONON_VIDEORENDERER_EVR_H +#define PHONON_VIDEORENDERER_EVR_H + +#include "abstractvideorenderer.h" +#include "compointer.h" + +QT_BEGIN_NAMESPACE + +#ifndef QT_NO_PHONON_VIDEO + +namespace Phonon +{ + namespace DS9 + { + class VideoRendererEVR : public AbstractVideoRenderer + { + public: + VideoRendererEVR(QWidget *target); + ~VideoRendererEVR(); + + //Implementation from AbstractVideoRenderer + void repaintCurrentFrame(QWidget *target, const QRect &rect); + void notifyResize(const QSize&, Phonon::VideoWidget::AspectRatio, Phonon::VideoWidget::ScaleMode); + QSize videoSize() const; + QImage snapshot() const; + void applyMixerSettings(qreal brightness, qreal contrast, qreal m_hue, qreal saturation); + bool isNative() const; + private: + QWidget *m_target; + }; + } +} + +#endif //QT_NO_PHONON_VIDEO + +QT_END_NAMESPACE + +#endif + diff --git a/src/3rdparty/phonon/ds9/videorenderer_vmr9.cpp b/src/3rdparty/phonon/ds9/videorenderer_vmr9.cpp index 81ebb8b..545b31e 100644 --- a/src/3rdparty/phonon/ds9/videorenderer_vmr9.cpp +++ b/src/3rdparty/phonon/ds9/videorenderer_vmr9.cpp @@ -22,14 +22,9 @@ along with this library. If not, see . #include #include -#include -#ifndef Q_OS_WINCE #include #include -#else -#include -#endif QT_BEGIN_NAMESPACE @@ -48,116 +43,10 @@ namespace Phonon } -#ifdef Q_OS_WINCE - VideoRendererVMR9::VideoRendererVMR9(QWidget *target) : m_target(target) - { - m_target->setAttribute(Qt::WA_PaintOnScreen, true); - m_filter = Filter(CLSID_VideoRenderer, IID_IBaseFilter); - } - - QSize VideoRendererVMR9::videoSize() const - { - LONG w = 0, - h = 0; - ComPointer basic(m_filter, IID_IBasicVideo); - if (basic) { - basic->GetVideoSize( &w, &h); - } - return QSize(w, h); - } - - void VideoRendererVMR9::repaintCurrentFrame(QWidget * /*target*/, const QRect & /*rect*/) - { - //nothing to do here: the renderer paints everything - } - - void VideoRendererVMR9::notifyResize(const QSize &size, Phonon::VideoWidget::AspectRatio aspectRatio, - Phonon::VideoWidget::ScaleMode scaleMode) - { - if (!isActive()) { - ComPointer basic(m_filter, IID_IBasicVideo); - if (basic) { - basic->SetDestinationPosition(0, 0, 0, 0); - } - return; - } - - ComPointer video(m_filter, IID_IVideoWindow); - - OAHWND owner; - HRESULT hr = video->get_Owner(&owner); - if (FAILED(hr)) { - return; - } - - const OAHWND newOwner = reinterpret_cast(m_target->winId()); - if (owner != newOwner) { - video->put_Owner(newOwner); - video->put_MessageDrain(newOwner); - video->put_WindowStyle(WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS); - } - - //make sure the widget takes the whole size of the parent - video->SetWindowPosition(0, 0, size.width(), size.height()); - - const QSize vsize = videoSize(); - internalNotifyResize(size, vsize, aspectRatio, scaleMode); - - ComPointer basic(m_filter, IID_IBasicVideo); - if (basic) { - basic->SetDestinationPosition(m_dstX, m_dstY, m_dstWidth, m_dstHeight); - } - } - - void VideoRendererVMR9::applyMixerSettings(qreal /*brightness*/, qreal /*contrast*/, qreal /*m_hue*/, qreal /*saturation*/) - { - //this can't be supported for WinCE - } - - QImage VideoRendererVMR9::snapshot() const - { - ComPointer basic(m_filter, IID_IBasicVideo); - if (basic) { - LONG bufferSize = 0; - //1st we get the buffer size - basic->GetCurrentImage(&bufferSize, 0); - - QByteArray buffer; - buffer.resize(bufferSize); - HRESULT hr = basic->GetCurrentImage(&bufferSize, reinterpret_cast(buffer.data())); - - if (SUCCEEDED(hr)) { - - const BITMAPINFOHEADER *bmi = reinterpret_cast(buffer.constData()); - - const int w = qAbs(bmi->biWidth), - h = qAbs(bmi->biHeight); - - // Create image and copy data into image. - QImage ret(w, h, QImage::Format_RGB32); - - if (!ret.isNull()) { - const char *data = buffer.constData() + bmi->biSize; - const int bytes_per_line = w * sizeof(QRgb); - for (int y = h - 1; y >= 0; --y) { - qMemCopy(ret.scanLine(y), //destination - data, //source - bytes_per_line); - data += bytes_per_line; - } - } - return ret; - } - } - return QImage(); - } - -#else VideoRendererVMR9::VideoRendererVMR9(QWidget *target) : m_target(target) { m_filter = Filter(CLSID_VideoMixingRenderer9, IID_IBaseFilter); if (!m_filter) { - qWarning("the video widget could not be initialized correctly"); return; } @@ -325,7 +214,6 @@ namespace Phonon //finally set the settings mixer->SetProcAmpControl(0, &ctrl); } -#endif } } diff --git a/src/3rdparty/phonon/ds9/videorenderer_vmr9.h b/src/3rdparty/phonon/ds9/videorenderer_vmr9.h index 4eb237e..516d79d 100644 --- a/src/3rdparty/phonon/ds9/videorenderer_vmr9.h +++ b/src/3rdparty/phonon/ds9/videorenderer_vmr9.h @@ -19,7 +19,6 @@ along with this library. If not, see . #define PHONON_VIDEORENDERER_VMR9_H #include "abstractvideorenderer.h" -#include "compointer.h" QT_BEGIN_NAMESPACE diff --git a/src/3rdparty/phonon/ds9/videowidget.cpp b/src/3rdparty/phonon/ds9/videowidget.cpp index f71eb6f..59abb04 100644 --- a/src/3rdparty/phonon/ds9/videowidget.cpp +++ b/src/3rdparty/phonon/ds9/videowidget.cpp @@ -24,8 +24,12 @@ along with this library. If not, see . #include "mediaobject.h" +#ifndef Q_OS_WINCE #include "videorenderer_evr.h" #include "videorenderer_vmr9.h" +#else +#include "videorenderer_default.h" +#endif #include "videorenderer_soft.h" QT_BEGIN_NAMESPACE @@ -351,20 +355,28 @@ namespace Phonon if (m_renderers[index] == 0 && autoCreate) { AbstractVideoRenderer *renderer = 0; if (type == Native) { +#ifndef Q_OS_WINCE renderer = new VideoRendererEVR(m_widget); if (renderer->getFilter() == 0) { delete renderer; - renderer = 0; - } - if (renderer == 0) { + //EVR not present, let's try VMR renderer = new VideoRendererVMR9(m_widget); if (renderer->getFilter() == 0) { - //instanciating the renderer might fail with error VFW_E_DDRAW_CAPS_NOT_SUITABLE (0x80040273) + //instanciating the renderer might fail m_noNativeRendererSupported = true; delete renderer; renderer = 0; } } +#else + renderer = new VideoRendererVMR9(m_widget); + if (renderer->getFilter() == 0) { + //instanciating the renderer might fail + m_noNativeRendererSupported = true; + delete renderer; + renderer = 0; + } +#endif } if (renderer == 0) { diff --git a/src/plugins/phonon/ds9/ds9.pro b/src/plugins/phonon/ds9/ds9.pro index 440f2c5..301808e 100644 --- a/src/plugins/phonon/ds9/ds9.pro +++ b/src/plugins/phonon/ds9/ds9.pro @@ -3,7 +3,7 @@ QT += phonon win32:!wince*:contains(QT_CONFIG,opengl):LIBS += -lopengl32 win32:!wince*:LIBS += -lgdi32 win32-msvc2005:DEFINES += _CRT_SECURE_NO_WARNINGS -LIBS += -lstrmiids -ldmoguids -luuid -lmsdmo -lole32 -loleaut32 -lMfuuid -lStrmiids +LIBS += -lstrmiids -ldmoguids -luuid -lmsdmo -lole32 -loleaut32 TARGET = phonon_ds9 DEFINES += PHONON_MAKE_QT_ONLY_BACKEND @@ -22,8 +22,6 @@ HEADERS += \ $$PHONON_DS9_DIR/mediaobject.h \ $$PHONON_DS9_DIR/videowidget.h \ $$PHONON_DS9_DIR/videorenderer_soft.h \ - $$PHONON_DS9_DIR/videorenderer_vmr9.h \ - $$PHONON_DS9_DIR/videorenderer_evr.h \ $$PHONON_DS9_DIR/volumeeffect.h \ $$PHONON_DS9_DIR/qbasefilter.h \ $$PHONON_DS9_DIR/qpin.h \ @@ -46,8 +44,6 @@ SOURCES += \ $$PHONON_DS9_DIR/mediaobject.cpp \ $$PHONON_DS9_DIR/videowidget.cpp \ $$PHONON_DS9_DIR/videorenderer_soft.cpp \ - $$PHONON_DS9_DIR/videorenderer_vmr9.cpp \ - $$PHONON_DS9_DIR/videorenderer_evr.cpp \ $$PHONON_DS9_DIR/volumeeffect.cpp \ $$PHONON_DS9_DIR/qbasefilter.cpp \ $$PHONON_DS9_DIR/qpin.cpp \ @@ -55,6 +51,14 @@ SOURCES += \ $$PHONON_DS9_DIR/qaudiocdreader.cpp \ $$PHONON_DS9_DIR/qmeminputpin.cpp +#the EVR renderer (only available on desktop) +!wince*:SOURCES += $$PHONON_DS9_DIR/videorenderer_evr.cpp \ + $$PHONON_DS9_DIR/videorenderer_vmr9.cpp +!wince*:HEADERS += $$PHONON_DS9_DIR/qevr9.h \ + $$PHONON_DS9_DIR/videorenderer_evr.h \ + $$PHONON_DS9_DIR/videorenderer_vmr9.h +wince*:SOURCES += $$PHONON_DS9_DIR/videorenderer_default.cpp +wince*:HEADERS += $$PHONON_DS9_DIR/videorenderer_default.h target.path = $$[QT_INSTALL_PLUGINS]/phonon_backend INSTALLS += target -- cgit v0.12 From d84e070b57d8657fd0d8ac39bd5862b30791a115 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Mon, 16 Nov 2009 13:10:47 +0100 Subject: Phonon: cleanup for mingw 3.X ifdefs --- src/3rdparty/phonon/phonon/objectdescriptionmodel.cpp | 7 ------- src/3rdparty/phonon/phonon/objectdescriptionmodel.h | 8 -------- 2 files changed, 15 deletions(-) diff --git a/src/3rdparty/phonon/phonon/objectdescriptionmodel.cpp b/src/3rdparty/phonon/phonon/objectdescriptionmodel.cpp index 7237e91..bf5be6d 100644 --- a/src/3rdparty/phonon/phonon/objectdescriptionmodel.cpp +++ b/src/3rdparty/phonon/phonon/objectdescriptionmodel.cpp @@ -67,8 +67,6 @@ static const char qt_meta_stringdata_Phonon__ObjectDescriptionModel_Visualizatio namespace Phonon { -#if !defined(Q_CC_MINGW) || __MINGW32_MAJOR_VERSION >= 4 - template<> const QMetaObject ObjectDescriptionModel::staticMetaObject = { { &QAbstractListModel::staticMetaObject, qt_meta_stringdata_Phonon__ObjectDescriptionModel_AudioOutputDeviceType, qt_meta_data_Phonon__ObjectDescriptionModel, 0 } @@ -139,7 +137,6 @@ int ObjectDescriptionModel::qt_metacall(QMetaObject::Call _c, int _id, voi return QAbstractListModel::qt_metacall(_c, _id, _a); } */ -#endif int ObjectDescriptionModelData::rowCount(const QModelIndex &parent) const { @@ -365,8 +362,6 @@ QStringList ObjectDescriptionModelData::mimeTypes(ObjectDescriptionType type) co return QStringList(QLatin1String("application/x-phonon-objectdescription") + QString::number(static_cast(type))); } -#if !defined(Q_CC_MINGW) || __MINGW32_MAJOR_VERSION >= 4 -#if !defined(Q_CC_MSVC) || _MSC_VER > 1300 || defined(Q_CC_INTEL) #define INSTANTIATE_META_FUNCTIONS(type) \ template const QMetaObject *ObjectDescriptionModel::metaObject() const; \ template void *ObjectDescriptionModel::qt_metacast(const char *) @@ -376,7 +371,6 @@ INSTANTIATE_META_FUNCTIONS(AudioCaptureDeviceType); INSTANTIATE_META_FUNCTIONS(EffectType); INSTANTIATE_META_FUNCTIONS(AudioChannelType); INSTANTIATE_META_FUNCTIONS(SubtitleType); -#endif /*INSTANTIATE_META_FUNCTIONS(VideoOutputDeviceType); INSTANTIATE_META_FUNCTIONS(VideoCaptureDeviceType); INSTANTIATE_META_FUNCTIONS(AudioCodecType); @@ -384,7 +378,6 @@ INSTANTIATE_META_FUNCTIONS(VideoCodecType); INSTANTIATE_META_FUNCTIONS(ContainerFormatType); INSTANTIATE_META_FUNCTIONS(VisualizationType); */ -#endif //Q_CC_MINGW } // namespace Phonon #endif //QT_NO_PHONON_OBJECTDESCRIPTIONMODEL diff --git a/src/3rdparty/phonon/phonon/objectdescriptionmodel.h b/src/3rdparty/phonon/phonon/objectdescriptionmodel.h index 96187c3..8fd622f 100644 --- a/src/3rdparty/phonon/phonon/objectdescriptionmodel.h +++ b/src/3rdparty/phonon/phonon/objectdescriptionmodel.h @@ -195,13 +195,6 @@ and existing builds. */ public: Q_OBJECT_CHECK -/* MinGW 3.4.x gives an ICE when trying to instantiate one of the - ObjectDescriptionModel classes because it can't handle - half exported classes correct. gcc 4.3.x has a fix for this but - we currently there's no official gcc 4.3 on windows available. - Because of this we need this little hack - */ -#if !defined(Q_CC_MINGW) || __MINGW32_MAJOR_VERSION >= 4 /** \internal */ static PHONON_TEMPLATE_CLASS_MEMBER_EXPORT const QMetaObject staticMetaObject; /** \internal */ @@ -209,7 +202,6 @@ and existing builds. */ /** \internal */ PHONON_TEMPLATE_CLASS_MEMBER_EXPORT void *qt_metacast(const char *_clname); //int qt_metacall(QMetaObject::Call _c, int _id, void **_a); -#endif /** * Returns the number of rows in the model. This value corresponds -- cgit v0.12 From 7cc0f75a3572cd001df7150faf04dc59e6b95edc Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Mon, 16 Nov 2009 15:27:14 +0100 Subject: Make de file dialog completely compatible with mingw-g++ Some COM interfaces were not defined. Now they are. --- src/corelib/io/qfsfileengine_win.cpp | 4 - src/gui/dialogs/dialogs.pri | 3 +- src/gui/dialogs/qfiledialog_win.cpp | 36 ++---- src/gui/dialogs/qfiledialog_win_p.h | 200 +++++++++++++++++++++++++++++++ src/gui/dialogs/qprintdialog_win.cpp | 2 +- src/gui/inputmethod/qwininputcontext_p.h | 2 +- 6 files changed, 217 insertions(+), 30 deletions(-) create mode 100644 src/gui/dialogs/qfiledialog_win_p.h diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp index a6cb5a9..10a7c54 100644 --- a/src/corelib/io/qfsfileengine_win.cpp +++ b/src/corelib/io/qfsfileengine_win.cpp @@ -66,10 +66,6 @@ #include #include #define SECURITY_WIN32 -#ifdef Q_CC_MINGW -// A workaround for a certain version of MinGW, the define UNICODE_STRING. -#include -#endif #include #ifndef _INTPTR_T_DEFINED diff --git a/src/gui/dialogs/dialogs.pri b/src/gui/dialogs/dialogs.pri index b9fad41..65ffccf 100644 --- a/src/gui/dialogs/dialogs.pri +++ b/src/gui/dialogs/dialogs.pri @@ -36,7 +36,8 @@ HEADERS += \ dialogs/qprintdialog_mac.mm } win32 { - HEADERS += dialogs/qwizard_win_p.h + HEADERS += dialogs/qwizard_win_p.h \ + dialogs/qfiledialog_win_p.h SOURCES += dialogs/qdialogsbinarycompat_win.cpp \ dialogs/qfiledialog_win.cpp \ dialogs/qpagesetupdialog_win.cpp \ diff --git a/src/gui/dialogs/qfiledialog_win.cpp b/src/gui/dialogs/qfiledialog_win.cpp index 8089b43..3822f16 100644 --- a/src/gui/dialogs/qfiledialog_win.cpp +++ b/src/gui/dialogs/qfiledialog_win.cpp @@ -58,19 +58,6 @@ # include #endif -#include -//At some point we can hope that mingw will support that interface -#if !defined(Q_WS_WINCE) && !defined(Q_CC_MINGW) -#include -#endif - -#include - -#if defined(__IFileDialog_INTERFACE_DEFINED__) \ - && defined(__IFileOpenDialog_INTERFACE_DEFINED__) -#define USE_COMMON_ITEM_DIALOG -#endif - #ifdef Q_WS_WINCE #include # ifndef BFFM_SETSELECTION @@ -89,6 +76,12 @@ typedef struct qt_priv_browseinfo { int iImage; } qt_BROWSEINFO; bool qt_priv_ptr_valid = false; +#else +#include "qfiledialog_win_p.h" +//we have to declare them here because they're not present for all SDK/compilers +static const IID QT_IID_IFileOpenDialog = {0xd57c7288, 0xd4ad, 0x4768, {0xbe, 0x02, 0x9d, 0x96, 0x95, 0x32, 0xd9, 0x60} }; +static const IID QT_IID_IShellItem = {0x43826d1e, 0xe718, 0x42ee, {0xbc, 0x55, 0xa1, 0xe2, 0x61, 0xc3, 0x7b, 0xfe} }; +static const CLSID QT_CLSID_FileOpenDialog = {0xdc1c5a9c, 0xe88a, 0x4dde, {0xa5, 0xa1, 0x60, 0xf8, 0x2a, 0x20, 0xae, 0xf7} }; #endif @@ -421,7 +414,7 @@ QString qt_win_get_save_file_name(const QFileDialogArgs &args, } -#if defined(USE_COMMON_ITEM_DIALOG) +#ifndef Q_WS_WINCE typedef HRESULT (WINAPI *PtrSHCreateItemFromParsingName)(PCWSTR pszPath, IBindCtx *pbc, REFIID riid, void **ppv); static PtrSHCreateItemFromParsingName pSHCreateItemFromParsingName = 0; @@ -481,9 +474,8 @@ static bool qt_win_set_IFileDialogOptions(IFileDialog *pfd, tInitDir = QDir::toNativeSeparators(initialDirectory); if (!tInitDir.isEmpty()) { IShellItem *psiDefaultFolder; - hr = pSHCreateItemFromParsingName((wchar_t*)tInitDir.utf16(), - NULL, - IID_PPV_ARGS(&psiDefaultFolder)); + hr = pSHCreateItemFromParsingName((wchar_t*)tInitDir.utf16(), NULL, QT_IID_IShellItem, + reinterpret_cast(&psiDefaultFolder)); if (SUCCEEDED(hr)) { hr = pfd->SetFolder(psiDefaultFolder); @@ -522,7 +514,7 @@ static bool qt_win_set_IFileDialogOptions(IFileDialog *pfd, return SUCCEEDED(hr); } -QStringList qt_win_CID_get_open_file_names(const QFileDialogArgs &args, +static QStringList qt_win_CID_get_open_file_names(const QFileDialogArgs &args, QString *initialDirectory, const QStringList &filterList, QString *selectedFilter, @@ -535,10 +527,8 @@ QStringList qt_win_CID_get_open_file_names(const QFileDialogArgs &args, QApplicationPrivate::enterModal(&modal_widget); // Multiple selection is allowed only in IFileOpenDialog. IFileOpenDialog *pfd; - HRESULT hr = CoCreateInstance(CLSID_FileOpenDialog, - NULL, - CLSCTX_INPROC_SERVER, - IID_PPV_ARGS(&pfd)); + HRESULT hr = CoCreateInstance(QT_CLSID_FileOpenDialog, NULL, CLSCTX_INPROC_SERVER, QT_IID_IFileOpenDialog, + reinterpret_cast(&pfd)); if (SUCCEEDED(hr)) { qt_win_set_IFileDialogOptions(pfd, args.selection, @@ -641,7 +631,7 @@ QStringList qt_win_get_open_file_names(const QFileDialogArgs &args, // multiple files belonging to different folders from these search results, the // GetOpenFileName() will return only one folder name for all the files. To retrieve // the correct path for all selected files, we have to use Common Item Dialog interfaces. -#if defined(USE_COMMON_ITEM_DIALOG) +#ifndef Q_WS_WINCE if (QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA && QSysInfo::WindowsVersion < QSysInfo::WV_NT_based) return qt_win_CID_get_open_file_names(args, initialDirectory, filterLst, selectedFilter, idx); #endif diff --git a/src/gui/dialogs/qfiledialog_win_p.h b/src/gui/dialogs/qfiledialog_win_p.h new file mode 100644 index 0000000..68e6a13 --- /dev/null +++ b/src/gui/dialogs/qfiledialog_win_p.h @@ -0,0 +1,200 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QFILEDIAG_WIN_P_H + +#include +#include + +//these are the interface declarations needed for the file dialog on Vista and up + +//At some point we can hope that all compilers/sdk will support that interface +//and we won't have to declare it ourselves + +//declarations +typedef DWORD SICHINTF; +#define FOS_OVERWRITEPROMPT 0x2 +#define FOS_STRICTFILETYPES 0x4 +#define FOS_NOCHANGEDIR 0x8 +#define FOS_PICKFOLDERS 0x20 +#define FOS_FORCEFILESYSTEM 0x40 +#define FOS_ALLNONSTORAGEITEMS 0x80 +#define FOS_NOVALIDATE 0x100 +#define FOS_ALLOWMULTISELECT 0x200 +#define FOS_PATHMUSTEXIST 0x800 +#define FOS_FILEMUSTEXIST 0x1000 +#define FOS_CREATEPROMPT 0x2000 +#define FOS_SHAREAWARE 0x4000 +#define FOS_NOREADONLYRETURN 0x8000 +#define FOS_NOTESTFILECREATE 0x10000 +#define FOS_HIDEMRUPLACES 0x20000 +#define FOS_HIDEPINNEDPLACES 0x40000 +#define FOS_NODEREFERENCELINKS 0x100000 +#define FOS_DONTADDTORECENT 0x2000000 +#define FOS_FORCESHOWHIDDEN 0x10000000 +#define FOS_DEFAULTNOMINIMODE 0x20000000 +#define FOS_FORCEPREVIEWPANEON 0x40000000 + +typedef int GETPROPERTYSTOREFLAGS; +#define GPS_DEFAULT 0x00000000 +#define GPS_HANDLERPROPERTIESONLY 0x00000001 +#define GPS_READWRITE 0x00000002 +#define GPS_TEMPORARY 0x00000004 +#define GPS_FASTPROPERTIESONLY 0x00000008 +#define GPS_OPENSLOWITEM 0x00000010 +#define GPS_DELAYCREATION 0x00000020 +#define GPS_BESTEFFORT 0x00000040 +#define GPS_MASK_VALID 0x0000007F + +//the enums +typedef enum { + SIATTRIBFLAGS_AND = 0x1, + SIATTRIBFLAGS_OR = 0x2, + SIATTRIBFLAGS_APPCOMPAT = 0x3, + SIATTRIBFLAGS_MASK = 0x3 +} SIATTRIBFLAGS; +typedef enum { + SIGDN_NORMALDISPLAY = 0x00000000, + SIGDN_PARENTRELATIVEPARSING = 0x80018001, + SIGDN_PARENTRELATIVEFORADDRESSBAR = 0x8001c001, + SIGDN_DESKTOPABSOLUTEPARSING = 0x80028000, + SIGDN_PARENTRELATIVEEDITING = 0x80031001, + SIGDN_DESKTOPABSOLUTEEDITING = 0x8004c000, + SIGDN_FILESYSPATH = 0x80058000, + SIGDN_URL = 0x80068000 +} SIGDN; +typedef enum { + FDAP_BOTTOM = 0x00000000, + FDAP_TOP = 0x00000001 +} FDAP; +typedef enum { + FDESVR_DEFAULT = 0x00000000, + FDESVR_ACCEPT = 0x00000001, + FDESVR_REFUSE = 0x00000002 +} FDE_SHAREVIOLATION_RESPONSE; +typedef FDE_SHAREVIOLATION_RESPONSE FDE_OVERWRITE_RESPONSE; + +//the structs +typedef struct { + LPCWSTR pszName; + LPCWSTR pszSpec; +} COMDLG_FILTERSPEC; +typedef struct { + GUID fmtid; + DWORD pid; +} PROPERTYKEY; +DECLARE_INTERFACE(IFileDialogEvents); +DECLARE_INTERFACE_(IShellItem, IUnknown) +{ + STDMETHOD(BindToHandler)(THIS_ IBindCtx *pbc, REFGUID bhid, REFIID riid, void **ppv) PURE; + STDMETHOD(GetParent)(THIS_ IShellItem **ppsi) PURE; + STDMETHOD(GetDisplayName)(THIS_ SIGDN sigdnName, LPWSTR *ppszName) PURE; + STDMETHOD(GetAttributes)(THIS_ SFGAOF sfgaoMask, SFGAOF *psfgaoAttribs) PURE; + STDMETHOD(Compare)(THIS_ IShellItem *psi, SICHINTF hint, int *piOrder) PURE; +}; +DECLARE_INTERFACE_(IShellItemFilter, IUnknown) +{ + STDMETHOD(IncludeItem)(THIS_ IShellItem *psi) PURE; + STDMETHOD(GetEnumFlagsForItem)(THIS_ IShellItem *psi, SHCONTF *pgrfFlags) PURE; +}; +DECLARE_INTERFACE_(IEnumShellItems, IUnknown) +{ + STDMETHOD(Next)(THIS_ ULONG celt, IShellItem **rgelt, ULONG *pceltFetched) PURE; + STDMETHOD(Skip)(THIS_ ULONG celt) PURE; + STDMETHOD(Reset)(THIS_) PURE; + STDMETHOD(Clone)(THIS_ IEnumShellItems **ppenum) PURE; +}; +DECLARE_INTERFACE_(IShellItemArray, IUnknown) +{ + STDMETHOD(BindToHandler)(THIS_ IBindCtx *pbc, REFGUID rbhid, REFIID riid, void **ppvOut) PURE; + STDMETHOD(GetPropertyStore)(THIS_ GETPROPERTYSTOREFLAGS flags, REFIID riid, void **ppv) PURE; + STDMETHOD(GetPropertyDescriptionList)(THIS_ const PROPERTYKEY *keyType, REFIID riid, void **ppv) PURE; + STDMETHOD(GetAttributes)(THIS_ SIATTRIBFLAGS dwAttribFlags, SFGAOF sfgaoMask, SFGAOF *psfgaoAttribs) PURE; + STDMETHOD(GetCount)(THIS_ DWORD *pdwNumItems) PURE; + STDMETHOD(GetItemAt)(THIS_ DWORD dwIndex, IShellItem **ppsi) PURE; + STDMETHOD(EnumItems)(THIS_ IEnumShellItems **ppenumShellItems) PURE; +}; +DECLARE_INTERFACE_(IModalWindow, IUnknown) +{ + STDMETHOD(Show)(THIS_ HWND hwndParent) PURE; +}; +DECLARE_INTERFACE_(IFileDialog, IModalWindow) +{ + STDMETHOD(SetFileTypes)(THIS_ UINT cFileTypes, const COMDLG_FILTERSPEC *rgFilterSpec) PURE; + STDMETHOD(SetFileTypeIndex)(THIS_ UINT iFileType) PURE; + STDMETHOD(GetFileTypeIndex)(THIS_ UINT *piFileType) PURE; + STDMETHOD(Advise)(THIS_ IFileDialogEvents *pfde, DWORD *pdwCookie) PURE; + STDMETHOD(Unadvise)(THIS_ DWORD dwCookie) PURE; + STDMETHOD(SetOptions)(THIS_ DWORD fos) PURE; + STDMETHOD(GetOptions)(THIS_ DWORD *pfos) PURE; + STDMETHOD(SetDefaultFolder)(THIS_ IShellItem *psi) PURE; + STDMETHOD(SetFolder)(THIS_ IShellItem *psi) PURE; + STDMETHOD(GetFolder)(THIS_ IShellItem **ppsi) PURE; + STDMETHOD(GetCurrentSelection)(THIS_ IShellItem **ppsi) PURE; + STDMETHOD(SetFileName)(THIS_ LPCWSTR pszName) PURE; + STDMETHOD(GetFileName)(THIS_ LPWSTR *pszName) PURE; + STDMETHOD(SetTitle)(THIS_ LPCWSTR pszTitle) PURE; + STDMETHOD(SetOkButtonLabel)(THIS_ LPCWSTR pszText) PURE; + STDMETHOD(SetFileNameLabel)(THIS_ LPCWSTR pszLabel) PURE; + STDMETHOD(GetResult)(THIS_ IShellItem **ppsi) PURE; + STDMETHOD(AddPlace)(THIS_ IShellItem *psi, FDAP fdap) PURE; + STDMETHOD(SetDefaultExtension)(THIS_ LPCWSTR pszDefaultExtension) PURE; + STDMETHOD(Close)(THIS_ HRESULT hr) PURE; + STDMETHOD(SetClientGuid)(THIS_ REFGUID guid) PURE; + STDMETHOD(ClearClientData)(THIS_) PURE; + STDMETHOD(SetFilter)(THIS_ IShellItemFilter *pFilter) PURE; +}; +DECLARE_INTERFACE_(IFileDialogEvents, IUnknown) +{ + STDMETHOD(OnFileOk)(THIS_ IFileDialog *pfd) PURE; + STDMETHOD(OnFolderChanging)(THIS_ IFileDialog *pfd, IShellItem *psiFolder) PURE; + STDMETHOD(OnFolderChange)(THIS_ IFileDialog *pfd) PURE; + STDMETHOD(OnSelectionChange)(THIS_ IFileDialog *pfd) PURE; + STDMETHOD(OnShareViolation)(THIS_ IFileDialog *pfd, IShellItem *psi, FDE_SHAREVIOLATION_RESPONSE *pResponse) PURE; + STDMETHOD(OnTypeChange)(THIS_ IFileDialog *pfd) PURE; + STDMETHOD(OnOverwrite)(THIS_ IFileDialog *pfd, IShellItem *psi, FDE_OVERWRITE_RESPONSE *pResponse) PURE; +}; +DECLARE_INTERFACE_(IFileOpenDialog, IFileDialog) +{ + STDMETHOD(GetResults)(THIS_ IShellItemArray **ppenum) PURE; + STDMETHOD(GetSelectedItems)(THIS_ IShellItemArray **ppsai) PURE; +}; +#endif \ No newline at end of file diff --git a/src/gui/dialogs/qprintdialog_win.cpp b/src/gui/dialogs/qprintdialog_win.cpp index 51e83ac..6ab1cb1 100644 --- a/src/gui/dialogs/qprintdialog_win.cpp +++ b/src/gui/dialogs/qprintdialog_win.cpp @@ -52,7 +52,7 @@ #include #include -#if defined(Q_CC_MINGW) && !defined(PD_NOCURRENTPAGE) +#if !defined(PD_NOCURRENTPAGE) #define PD_NOCURRENTPAGE 0x00800000 #define PD_RESULT_PRINT 1 #define PD_RESULT_APPLY 2 diff --git a/src/gui/inputmethod/qwininputcontext_p.h b/src/gui/inputmethod/qwininputcontext_p.h index dd0490d..f7c1c0f 100644 --- a/src/gui/inputmethod/qwininputcontext_p.h +++ b/src/gui/inputmethod/qwininputcontext_p.h @@ -56,7 +56,7 @@ #include "QtGui/qinputcontext.h" #include "QtCore/qt_windows.h" -#if defined(Q_CC_MINGW) && !defined(IMR_RECONVERTSTRING) +#if !defined(IMR_RECONVERTSTRING) typedef struct tagRECONVERTSTRING { DWORD dwSize; DWORD dwVersion; -- cgit v0.12 From f3556c2afa373cd37cb64e35b4b1d990558396c8 Mon Sep 17 00:00:00 2001 From: ck Date: Mon, 16 Nov 2009 16:10:46 +0100 Subject: Assistant: Display "Page not found" message for invalid URLs. Reviewed-by: kh1 --- tools/assistant/tools/assistant/helpviewer.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tools/assistant/tools/assistant/helpviewer.cpp b/tools/assistant/tools/assistant/helpviewer.cpp index 3547652..157f5ab 100644 --- a/tools/assistant/tools/assistant/helpviewer.cpp +++ b/tools/assistant/tools/assistant/helpviewer.cpp @@ -63,6 +63,12 @@ QT_BEGIN_NAMESPACE +namespace { + const QString PageNotFoundMessage = + QObject::tr("Error 404...


" + "

The page could not be found


'%1'

"); +} + #if !defined(QT_NO_WEBKIT) class HelpNetworkReply : public QNetworkReply @@ -151,7 +157,10 @@ QNetworkReply *HelpNetworkAccessManager::createRequest(Operation /*op*/, mimeType = QLatin1String("text/html"); } - return new HelpNetworkReply(request, helpEngine->fileData(url), mimeType); + const QByteArray &data = helpEngine->findFile(url).isValid() + ? helpEngine->fileData(url) + : PageNotFoundMessage.arg(url.toString()).toUtf8(); + return new HelpNetworkReply(request, data, mimeType); } class HelpPage : public QWebPage @@ -425,9 +434,7 @@ void HelpViewer::setSource(const QUrl &url) "assistantinternal-1.0.0/assistant/assistant.html"))); } else { QTextBrowser::setSource(url); - setHtml(tr("Error 404...


" - "

The page could not be found


'%1'

") - .arg(url.toString())); + setHtml(PageNotFoundMessage.arg(url.toString())); emit sourceChanged(url); } } -- cgit v0.12 From f7dbb28ca4fcb56e01dc79cec7df77f80fe530a8 Mon Sep 17 00:00:00 2001 From: ck Date: Mon, 16 Nov 2009 17:42:39 +0100 Subject: Assistant/Designer: Fix handling of oblique font styles. Task-number: QT-1764 Reviewed-by: kh1 --- tools/shared/fontpanel/fontpanel.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/shared/fontpanel/fontpanel.cpp b/tools/shared/fontpanel/fontpanel.cpp index 46ce144..c2defc7 100644 --- a/tools/shared/fontpanel/fontpanel.cpp +++ b/tools/shared/fontpanel/fontpanel.cpp @@ -96,8 +96,12 @@ QFont FontPanel::selectedFont() const const QString family = rc.family(); rc.setPointSize(pointSize()); const QString styleDescription = styleString(); - rc.setItalic(m_fontDatabase.italic(family, styleDescription)); - + if (styleDescription.contains(QLatin1String("Italic"))) + rc.setStyle(QFont::StyleItalic); + else if (styleDescription.contains(QLatin1String("Oblique"))) + rc.setStyle(QFont::StyleOblique); + else + rc.setStyle(QFont::StyleNormal); rc.setBold(m_fontDatabase.bold(family, styleDescription)); // Weight < 0 asserts... -- cgit v0.12 From 5c4fce677e58b17fdc7ee19803b9939f56530b06 Mon Sep 17 00:00:00 2001 From: kh1 Date: Mon, 16 Nov 2009 15:59:52 +0100 Subject: Sync with latest clucene source. Fixes at least two crash bugs. --- .../clucene/src/CLucene/index/SegmentTermDocs.cpp | 72 ++++++++++++---------- src/3rdparty/clucene/src/CLucene/index/Term.cpp | 5 +- .../CLucene/queryParser/MultiFieldQueryParser.cpp | 61 ++++++++++-------- .../clucene/src/CLucene/store/FSDirectory.cpp | 33 ++++++++-- .../clucene/src/CLucene/store/FSDirectory.h | 4 +- .../clucene/src/CLucene/util/bufferedstream.h | 2 + 6 files changed, 111 insertions(+), 66 deletions(-) diff --git a/src/3rdparty/clucene/src/CLucene/index/SegmentTermDocs.cpp b/src/3rdparty/clucene/src/CLucene/index/SegmentTermDocs.cpp index f4c5e3a..50951e9 100644 --- a/src/3rdparty/clucene/src/CLucene/index/SegmentTermDocs.cpp +++ b/src/3rdparty/clucene/src/CLucene/index/SegmentTermDocs.cpp @@ -112,47 +112,51 @@ CL_NS_DEF(index) return _freq; } - bool SegmentTermDocs::next() { - while (true) { - if (count == df) - return false; - uint32_t docCode = freqStream->readVInt(); - _doc += docCode >> 1; //unsigned shift - if ((docCode & 1) != 0) // if low bit is set - _freq = 1; // _freq is one - else - _freq = freqStream->readVInt(); // else read _freq - count++; - - if ( (deletedDocs == NULL) || (deletedDocs->get(_doc) == false ) ) - break; - skippingDoc(); +bool SegmentTermDocs::next() +{ + while (true) { + if (count == df) + return false; + + uint32_t docCode = freqStream->readVInt(); + _doc += docCode >> 1; //unsigned shift + if ((docCode & 1) != 0) // if low bit is set + _freq = 1; // _freq is one + else + _freq = freqStream->readVInt(); // else read _freq + count++; + + if (deletedDocs == NULL || (_doc >= 0 && !deletedDocs->get(_doc))) + break; + skippingDoc(); } return true; - } +} - int32_t SegmentTermDocs::read(int32_t* docs, int32_t* freqs, int32_t length) { + +int32_t SegmentTermDocs::read(int32_t* docs, int32_t* freqs, int32_t length) +{ int32_t i = 0; -//todo: one optimization would be to get the pointer buffer for ram or mmap dirs -//and iterate over them instead of using readByte() intensive functions. - while (ireadVInt(); - _doc += docCode >> 1; - if ((docCode & 1) != 0) // if low bit is set - _freq = 1; // _freq is one - else - _freq = freqStream->readVInt(); // else read _freq - count++; - - if (deletedDocs == NULL || !deletedDocs->get(_doc)) { - docs[i] = _doc; - freqs[i] = _freq; - i++; - } + // TODO: one optimization would be to get the pointer buffer for ram or mmap + // dirs and iterate over them instead of using readByte() intensive functions. + while (i < length && count < df) { + uint32_t docCode = freqStream->readVInt(); + _doc += docCode >> 1; + if ((docCode & 1) != 0) // if low bit is set + _freq = 1; // _freq is one + else + _freq = freqStream->readVInt(); // else read _freq + count++; + + if (deletedDocs == NULL || (_doc >= 0 && !deletedDocs->get(_doc))) { + docs[i] = _doc; + freqs[i] = _freq; + i++; + } } return i; - } +} bool SegmentTermDocs::skipTo(const int32_t target){ if (df >= skipInterval) { // optimized case diff --git a/src/3rdparty/clucene/src/CLucene/index/Term.cpp b/src/3rdparty/clucene/src/CLucene/index/Term.cpp index fc32e44..5ff7bb2 100644 --- a/src/3rdparty/clucene/src/CLucene/index/Term.cpp +++ b/src/3rdparty/clucene/src/CLucene/index/Term.cpp @@ -153,7 +153,10 @@ int32_t Term::compareTo(const Term* other) const if (_field == other->_field) return _tcscmp(_text, other->_text); - return _tcscmp(_field, other->_field); + int32_t ret = _tcscmp(_field, other->_field); + if (ret == 0) + ret = _tcscmp(_text, other->_text); + return ret; } TCHAR* Term::toString() const diff --git a/src/3rdparty/clucene/src/CLucene/queryParser/MultiFieldQueryParser.cpp b/src/3rdparty/clucene/src/CLucene/queryParser/MultiFieldQueryParser.cpp index ea93ec4..b57896b 100644 --- a/src/3rdparty/clucene/src/CLucene/queryParser/MultiFieldQueryParser.cpp +++ b/src/3rdparty/clucene/src/CLucene/queryParser/MultiFieldQueryParser.cpp @@ -21,51 +21,62 @@ CL_NS_USE(analysis) CL_NS_DEF(queryParser) -MultiFieldQueryParser::MultiFieldQueryParser(const TCHAR** fields, CL_NS(analysis)::Analyzer* a, BoostMap* boosts): - QueryParser(NULL,a) +MultiFieldQueryParser::MultiFieldQueryParser(const TCHAR** fields, + CL_NS(analysis)::Analyzer* analyzer, BoostMap* boosts) + : QueryParser(NULL, analyzer) { this->fields = fields; this->boosts = boosts; } -MultiFieldQueryParser::~MultiFieldQueryParser(){ + +MultiFieldQueryParser::~MultiFieldQueryParser() +{ } //static -Query* MultiFieldQueryParser::parse(const TCHAR* query, const TCHAR** fields, Analyzer* analyzer) +Query* MultiFieldQueryParser::parse(const TCHAR* query, const TCHAR** fields, + Analyzer* analyzer) { BooleanQuery* bQuery = _CLNEW BooleanQuery(); int32_t i = 0; - while ( fields[i] != NULL ){ - Query* q = QueryParser::parse(query, fields[i], analyzer); - bQuery->add(q, true, false, false); - + while (fields[i] != NULL){ + Query* q = QueryParser::parse(query, fields[i], analyzer); + if (q && (q->getQueryName() != _T("BooleanQuery") + || ((BooleanQuery*)q)->getClauseCount() > 0)) { + bQuery->add(q , true, false, false); + } else { + _CLDELETE(q); + } i++; } return bQuery; } //static -Query* MultiFieldQueryParser::parse(const TCHAR* query, const TCHAR** fields, const uint8_t* flags, Analyzer* analyzer) +Query* MultiFieldQueryParser::parse(const TCHAR* query, const TCHAR** fields, + const uint8_t* flags, Analyzer* analyzer) { BooleanQuery* bQuery = _CLNEW BooleanQuery(); int32_t i = 0; - while ( fields[i] != NULL ) - { - Query* q = QueryParser::parse(query, fields[i], analyzer); - uint8_t flag = flags[i]; - switch (flag) - { - case MultiFieldQueryParser::REQUIRED_FIELD: - bQuery->add(q, true, true, false); - break; - case MultiFieldQueryParser::PROHIBITED_FIELD: - bQuery->add(q, true, false, true); - break; - default: - bQuery->add(q, true, false, false); - break; + while ( fields[i] != NULL ) { + Query* q = QueryParser::parse(query, fields[i], analyzer); + if (q && (q->getQueryName() != _T("BooleanQuery") + || ((BooleanQuery*)q)->getClauseCount() > 0)) { + uint8_t flag = flags[i]; + switch (flag) { + case MultiFieldQueryParser::REQUIRED_FIELD: + bQuery->add(q, true, true, false); + break; + case MultiFieldQueryParser::PROHIBITED_FIELD: + bQuery->add(q, true, false, true); + break; + default: + bQuery->add(q, true, false, false); + break; + } + } else { + _CLDELETE(q); } - i++; } return bQuery; diff --git a/src/3rdparty/clucene/src/CLucene/store/FSDirectory.cpp b/src/3rdparty/clucene/src/CLucene/store/FSDirectory.cpp index e9659cf..5f96e91 100644 --- a/src/3rdparty/clucene/src/CLucene/store/FSDirectory.cpp +++ b/src/3rdparty/clucene/src/CLucene/store/FSDirectory.cpp @@ -91,7 +91,7 @@ QString FSDirectory::FSLock::toString() const // # pragma mark -- FSDirectory::FSIndexInput FSDirectory::FSIndexInput::FSIndexInput(const QString& path, int32_t bufferSize) - : BufferedIndexInput(bufferSize) + : BufferedIndexInput(bufferSize) { CND_PRECONDITION(!path.isEmpty(), "path is NULL"); @@ -155,7 +155,7 @@ FSDirectory::FSIndexInput::FSIndexInput(const FSIndexInput& other) if (other.handle == NULL) _CLTHROWA(CL_ERR_NullPointer, "other handle is null"); - SCOPED_LOCK_MUTEX(other.handle->THIS_LOCK) + SCOPED_LOCK_MUTEX(*other.handle->THIS_LOCK) _pos = other.handle->_fpos; handle = _CL_POINTER(other.handle); @@ -169,7 +169,30 @@ FSDirectory::FSIndexInput::~FSIndexInput() void FSDirectory::FSIndexInput::close() { BufferedIndexInput::close(); +#ifdef _LUCENE_THREADMUTEX + if (handle != NULL) { + // Here we have a bit of a problem... We need to lock the handle to + // ensure that we can safely delete the handle... But if we delete the + // handle, then the scoped unlock, won't be able to unlock the mutex... + + // take a reference of the lock object... + _LUCENE_THREADMUTEX* mutex = handle->THIS_LOCK; + //lock the mutex + mutex->lock(); + + // determine if we are about to delete the handle... + bool doUnlock = (handle->__cl_refcount > 1); + // decdelete (deletes if refcount is down to 0) + _CLDECDELETE(handle); + + if (doUnlock) + mutex->unlock(); + else + delete mutex; + } +#else _CLDECDELETE(handle); +#endif } IndexInput* FSDirectory::FSIndexInput::clone() const @@ -186,7 +209,7 @@ void FSDirectory::FSIndexInput::seekInternal(const int64_t position) void FSDirectory::FSIndexInput::readInternal(uint8_t* b, const int32_t len) { - SCOPED_LOCK_MUTEX(handle->THIS_LOCK) + SCOPED_LOCK_MUTEX(*handle->THIS_LOCK) CND_PRECONDITION(handle != NULL, "shared file handle has closed"); CND_PRECONDITION(handle->fhandle.isOpen(), "file is not open"); @@ -214,8 +237,10 @@ void FSDirectory::FSIndexInput::readInternal(uint8_t* b, const int32_t len) FSDirectory::FSIndexInput::SharedHandle::SharedHandle() : _fpos(0) , _length(0) - { +#ifdef _LUCENE_THREADMUTEX + THIS_LOCK = new _LUCENE_THREADMUTEX; +#endif } FSDirectory::FSIndexInput::SharedHandle::~SharedHandle() diff --git a/src/3rdparty/clucene/src/CLucene/store/FSDirectory.h b/src/3rdparty/clucene/src/CLucene/store/FSDirectory.h index 1302edf..e967380 100644 --- a/src/3rdparty/clucene/src/CLucene/store/FSDirectory.h +++ b/src/3rdparty/clucene/src/CLucene/store/FSDirectory.h @@ -147,7 +147,7 @@ private: void close(); IndexInput* clone() const; - + int64_t length() { return handle->_length; } @@ -174,7 +174,7 @@ private: int64_t _length; QFile fhandle; - DEFINE_MUTEX(THIS_LOCK) + DEFINE_MUTEX(*THIS_LOCK) }; SharedHandle* handle; int64_t _pos; diff --git a/src/3rdparty/clucene/src/CLucene/util/bufferedstream.h b/src/3rdparty/clucene/src/CLucene/util/bufferedstream.h index 2455d5e..b73ad98 100644 --- a/src/3rdparty/clucene/src/CLucene/util/bufferedstream.h +++ b/src/3rdparty/clucene/src/CLucene/util/bufferedstream.h @@ -28,7 +28,9 @@ #include "streambase.h" #include "inputstreambuffer.h" + #include +#include namespace jstreams { -- cgit v0.12 From 415c9a230a957f17c759468c5333266968f74b96 Mon Sep 17 00:00:00 2001 From: Anderson Lizardo Date: Sun, 6 Sep 2009 20:03:55 -0400 Subject: Add Linux host support to Symbian mkspecs. Signed-off-by: axis --- mkspecs/common/symbian/symbian.conf | 12 +++++++++--- mkspecs/features/symbian/application_icon.prf | 6 +++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/mkspecs/common/symbian/symbian.conf b/mkspecs/common/symbian/symbian.conf index fe698fb..0bd15fc 100644 --- a/mkspecs/common/symbian/symbian.conf +++ b/mkspecs/common/symbian/symbian.conf @@ -73,7 +73,7 @@ QMAKE_LIBS_COMPAT = QMAKE_LIBS_QT_ENTRY = -llibcrt0.lib QMAKE_LIBS_S60 = -lavkon -!isEmpty(QMAKE_SH) { +win32:!isEmpty(QMAKE_SH) | unix { QMAKE_COPY = cp QMAKE_COPY_DIR = cp -r QMAKE_MOVE = mv @@ -91,9 +91,15 @@ QMAKE_LIBS_S60 = -lavkon QMAKE_CHK_DIR_EXISTS = if not exist } +win32 { QMAKE_MOC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}moc.exe QMAKE_UIC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}uic.exe QMAKE_IDC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}idc.exe +} else { +QMAKE_MOC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}moc +QMAKE_UIC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}uic +QMAKE_IDC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}idc +} QMAKE_IDL = midl QMAKE_LIB = ar -ru @@ -130,10 +136,10 @@ default_deployment.pkg_prerules = \ DEPLOYMENT += default_deployment -exists($${EPOCROOT}epoc32/release/winscw/udeb/z/system/install/Series60v5.0.sis )|exists($${EPOCROOT}epoc32/data/z/system/install/Series60v5.0.sis) { +exists($${EPOCROOT}epoc32/release/winscw/udeb/z/system/install/series60v5.0.sis )|exists($${EPOCROOT}epoc32/data/z/system/install/series60v5.0.sis) { S60_VERSION = 5.0 } else { - exists($${EPOCROOT}epoc32/release/winscw/udeb/z/system/install/Series60v3.2.sis )|exists($${EPOCROOT}epoc32/data/z/system/install/Series60v3.2.sis) { + exists($${EPOCROOT}epoc32/release/winscw/udeb/z/system/install/series60v3.2.sis )|exists($${EPOCROOT}epoc32/data/z/system/install/series60v3.2.sis) { S60_VERSION = 3.2 } else { S60_VERSION = 3.1 diff --git a/mkspecs/features/symbian/application_icon.prf b/mkspecs/features/symbian/application_icon.prf index b0c1bb1..a8c3acc 100644 --- a/mkspecs/features/symbian/application_icon.prf +++ b/mkspecs/features/symbian/application_icon.prf @@ -19,7 +19,7 @@ contains( CONFIG, no_icon ) { # Note: symbian-sbsv2 builds can't utilize extra compiler for mifconv, so ICON handling is done in code symbian-abld { #Makefile: requires paths with backslash - ICON = $$replace( ICON, /, \\) + win32:ICON = $$replace(ICON, /, \\) # Extra compiler rules for mifconv mifconv.output = ${ZDIR}$$APP_RESOURCE_DIR/$${TARGET.UID3}.mif @@ -34,7 +34,7 @@ contains( CONFIG, no_icon ) { } # Rules to use generated MIF file from symbian resources RSS_RULES.number_of_icons = $$size(ICON) - RSS_RULES.icon_file = $$replace( APP_RESOURCE_DIR, /, \\\\ )\\\\$${TARGET.UID3}.mif + RSS_RULES.icon_file = APP_RESOURCE_DIR/$${TARGET.UID3}.mif + win32:RSS_RULES.icon_file = $$replace(RSS_RULES.icon_file, /, \\) } } - -- cgit v0.12 From 0d6b62e1a31f564b0ad68e3060fb3910d9025791 Mon Sep 17 00:00:00 2001 From: axis Date: Tue, 17 Nov 2009 10:28:19 +0100 Subject: Fixed indentation. --- mkspecs/common/symbian/symbian.conf | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mkspecs/common/symbian/symbian.conf b/mkspecs/common/symbian/symbian.conf index 0bd15fc..a9f458c 100644 --- a/mkspecs/common/symbian/symbian.conf +++ b/mkspecs/common/symbian/symbian.conf @@ -92,13 +92,13 @@ win32:!isEmpty(QMAKE_SH) | unix { } win32 { -QMAKE_MOC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}moc.exe -QMAKE_UIC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}uic.exe -QMAKE_IDC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}idc.exe + QMAKE_MOC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}moc.exe + QMAKE_UIC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}uic.exe + QMAKE_IDC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}idc.exe } else { -QMAKE_MOC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}moc -QMAKE_UIC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}uic -QMAKE_IDC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}idc + QMAKE_MOC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}moc + QMAKE_UIC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}uic + QMAKE_IDC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}idc } QMAKE_IDL = midl -- cgit v0.12 From 2d8d855de79a38e16b9229f3ef9400661e8e3259 Mon Sep 17 00:00:00 2001 From: Anderson Lizardo Date: Sun, 6 Sep 2009 20:39:04 -0400 Subject: qmake: add Linux host support to Symbian generator Signed-off-by: axis --- qmake/generators/makefile.cpp | 10 ++++-- .../symbian/initprojectdeploy_symbian.cpp | 10 +++--- qmake/generators/symbian/symmake.cpp | 14 +++++--- qmake/generators/symbian/symmake_abld.cpp | 42 +++++++++++++++------- 4 files changed, 53 insertions(+), 23 deletions(-) diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 388e64f..f9340f9 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -65,6 +65,12 @@ #include #include +#ifdef Q_OS_WIN32 +#define NO_STDERR "2> NUL" +#else +#define NO_STDERR "2>/dev/null" +#endif + QT_BEGIN_NAMESPACE // Well, Windows doesn't have this, so here's the macro @@ -1796,7 +1802,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) if(tmp_clean.indexOf("${QMAKE_") == -1) { t << "\n\t" << "-$(DEL_FILE) " << tmp_clean; if (isForSymbian()) - t << " 2> NUL"; // Eliminate unnecessary warnings + t << " " << NO_STDERR; // Eliminate unnecessary warnings wrote_clean = true; } if(!wrote_clean_cmds || !wrote_clean) { @@ -1826,7 +1832,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) } if(!cleans.isEmpty()) if (isForSymbian()) - t << valGlue(cleans, "\n\t" + del_statement, " 2> NUL\n\t" + del_statement, " 2> NUL"); + t << valGlue(cleans, "\n\t" + del_statement, " " NO_STDERR "\n\t" + del_statement, " " NO_STDERR); else t << valGlue(cleans, "\n\t" + del_statement, "\n\t" + del_statement, ""); if(!wrote_clean_cmds) { diff --git a/qmake/generators/symbian/initprojectdeploy_symbian.cpp b/qmake/generators/symbian/initprojectdeploy_symbian.cpp index f27d1ba..676cea5 100644 --- a/qmake/generators/symbian/initprojectdeploy_symbian.cpp +++ b/qmake/generators/symbian/initprojectdeploy_symbian.cpp @@ -176,12 +176,12 @@ static void createPluginStub(const QFileInfo& info, QStringList& generatedDirs, QStringList& generatedFiles) { - QDir().mkpath(QLatin1String(PLUGIN_STUB_DIR "\\")); + QDir().mkpath(PLUGIN_STUB_DIR); if (!generatedDirs.contains(PLUGIN_STUB_DIR)) generatedDirs << PLUGIN_STUB_DIR; // Plugin stubs must have different name from the actual plugins, because // the toolchain for creating ROM images cannot handle non-binary .dll files properly. - QFile stubFile(QLatin1String(PLUGIN_STUB_DIR "\\") + info.completeBaseName() + "." SUFFIX_QTPLUGIN); + QFile stubFile(QDir(PLUGIN_STUB_DIR).filePath(info.completeBaseName() + "." SUFFIX_QTPLUGIN)); if (stubFile.open(QIODevice::WriteOnly)) { if (!generatedFiles.contains(stubFile.fileName())) generatedFiles << stubFile.fileName(); @@ -330,12 +330,12 @@ void initProjectDeploySymbian(QMakeProject* project, if (isBinary(info)) { if (deployBinaries) { // Executables and libraries are deployed to \sys\bin - QFileInfo releasePath(epocRoot() + "epoc32\\release\\" + platform + "\\" + build + "\\"); + QFileInfo releasePath(epocRoot() + QDir::toNativeSeparators("epoc32/release/" + platform + "/" + build + "/")); if(devicePathHasDriveLetter) { - deploymentList.append(CopyItem(Option::fixPathToLocalOS(releasePath.absolutePath() + "\\" + info.fileName(), false, true), + deploymentList.append(CopyItem(Option::fixPathToLocalOS(QDir(releasePath.absolutePath()).filePath(info.fileName()), false, true), Option::fixPathToLocalOS(devicePath.left(2) + QLatin1String(SYSBIN_DIR "\\") + info.fileName()))); } else { - deploymentList.append(CopyItem(Option::fixPathToLocalOS(releasePath.absolutePath() + "\\" + info.fileName(), false, true), + deploymentList.append(CopyItem(Option::fixPathToLocalOS(QDir(releasePath.absolutePath()).filePath(info.fileName()), false, true), Option::fixPathToLocalOS(deploymentDrive + QLatin1String(SYSBIN_DIR "\\") + info.fileName()))); } } diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp index dd1dd5f..208da59 100644 --- a/qmake/generators/symbian/symmake.cpp +++ b/qmake/generators/symbian/symmake.cpp @@ -50,11 +50,17 @@ #include #include +#ifdef Q_OS_WIN +#define SCRIPT_EXT ".bat" +#else +#define SCRIPT_EXT ".sh" +#endif + #define RESOURCE_DIRECTORY_MMP "/resource/apps" #define RESOURCE_DIRECTORY_RESOURCE "\\\\resource\\\\apps\\\\" #define REGISTRATION_RESOURCE_DIRECTORY_HW "/private/10003a3f/import/apps" #define PLUGIN_COMMON_DEF_FILE_FOR_MMP "./plugin_common.def" -#define PLUGIN_COMMON_DEF_FILE_ACTUAL "plugin_commonU.def" +#define PLUGIN_COMMON_DEF_FILE_ACTUAL "plugin_commonu.def" #define BLD_INF_FILENAME_LEN (sizeof(BLD_INF_FILENAME) - 1) #define BLD_INF_RULES_BASE "BLD_INF_RULES." @@ -395,7 +401,7 @@ void SymbianMakefileGenerator::generatePkgFile(const QString &iconFile) for (int i = 0; i < depList.size(); ++i) { t << QString("\"%1\" - \"%2\"") .arg(QString(depList.at(i).from).replace('\\','/')) - .arg(depList.at(i).to) << endl; + .arg(QString(depList.at(i).to).replace('/','\\')) << endl; } t << endl; @@ -1634,7 +1640,7 @@ void SymbianMakefileGenerator::generateCleanCommands(QTextStream& t, t << "\t-@ if EXIST \"" << QDir::toNativeSeparators(item) << "\" "; t << cmd << " " << cmdOptions << " \"" << QDir::toNativeSeparators(item) << "\"" << endl; #else - t << "\t-if test -f " << QDir::toNativeSeparators(item) << "; then "; + t << "\t-if test -e " << QDir::toNativeSeparators(item) << "; then "; t << cmd << " " << cmdOptions << " " << QDir::toNativeSeparators(item) << "; fi" << endl; #endif } @@ -1667,7 +1673,7 @@ void SymbianMakefileGenerator::writeSisTargets(QTextStream &t) t << OK_SIS_TARGET ":" << endl; - QString pkgcommand = QString("\tcreatepackage.bat $(QT_SIS_OPTIONS) %1_template.%2 $(QT_SIS_TARGET) " \ + QString pkgcommand = QString("\tcreatepackage" SCRIPT_EXT " $(QT_SIS_OPTIONS) %1_template.%2 $(QT_SIS_TARGET) " \ "$(QT_SIS_CERTIFICATE) $(QT_SIS_KEY) $(QT_SIS_PASSPHRASE)") .arg(fixedTarget) .arg("pkg"); diff --git a/qmake/generators/symbian/symmake_abld.cpp b/qmake/generators/symbian/symmake_abld.cpp index 4d1673b..b06db2f 100644 --- a/qmake/generators/symbian/symmake_abld.cpp +++ b/qmake/generators/symbian/symmake_abld.cpp @@ -195,16 +195,21 @@ void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl; t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << endl; t << "MOVE = " << var("QMAKE_MOVE") << endl; +#ifdef Q_OS_WIN32 t << "XCOPY = xcopy /d /f /h /r /y /i" << endl; t << "ABLD = ABLD.BAT" << endl; +#else + t << "XCOPY = cp -u -v" << endl; + t << "ABLD = abld" << endl; +#endif t << "DEBUG_PLATFORMS = " << debugPlatforms.join(" ") << endl; t << "RELEASE_PLATFORMS = " << releasePlatforms.join(" ") << endl; t << "MAKE = make" << endl; t << endl; t << "ifeq (WINS,$(findstring WINS, $(PLATFORM)))" << endl; - t << "ZDIR=$(EPOCROOT)epoc32\\release\\$(PLATFORM)\\$(CFG)\\Z" << endl; + t << "ZDIR=$(EPOCROOT)" << QDir::toNativeSeparators("epoc32/release/$(PLATFORM)/$(CFG)/z") << endl; t << "else" << endl; - t << "ZDIR=$(EPOCROOT)epoc32\\data\\z" << endl; + t << "ZDIR=$(EPOCROOT)" << QDir::toNativeSeparators("epoc32/data/z") << endl; t << "endif" << endl; t << endl; t << "DEFINES" << '\t' << " = " @@ -304,8 +309,13 @@ void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool if (values.at(i).endsWith("/" QT_EXTRA_INCLUDE_DIR)) { QString fixedValue(QDir::toNativeSeparators(values.at(i))); dirsToClean << fixedValue; +#ifdef Q_OS_WIN32 t << "\t-@ if NOT EXIST \"" << fixedValue << "\" mkdir \"" << fixedValue << "\"" << endl; +#else + t << "\t-@ if test ! -d \"" << fixedValue << "\"; then mkdir \"" + << fixedValue << "\"" << "; fi" < NUL" gets appended to generated clean targets in makefile.cpp. t << EXTENSION_CLEAN ": " COMPILER_CLEAN_TARGET << endl; +#ifdef Q_OS_WIN32 generateCleanCommands(t, dirsToClean, var("QMAKE_DEL_DIR"), " /S /Q ", "", ""); +#else + generateCleanCommands(t, dirsToClean, "rm", " -rf ", "", ""); +#endif t << endl; t << PRE_TARGETDEPS_TARGET ":" @@ -375,7 +389,11 @@ void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool // Create execution target if (debugPlatforms.contains("winscw") && targetType == TypeExe) { t << "run:" << endl; +#ifdef Q_OS_WIN32 t << "\t-call " << epocRoot() << "epoc32\\release\\winscw\\udeb\\" << removePathSeparators(escapeFilePath(fileFixify(project->first("TARGET"))).append(".exe")) << endl << endl; +#else + t << "\t-wine " << epocRoot() << "epoc32/release/winscw/udeb/" << removePathSeparators(escapeFilePath(fileFixify(project->first("TARGET"))).append(".exe")) << endl << endl; +#endif } } @@ -423,16 +441,16 @@ bool SymbianAbldMakefileGenerator::writeDeploymentTargets(QTextStream &t) void SymbianAbldMakefileGenerator::writeStoreBuildTarget(QTextStream &t) { t << STORE_BUILD_TARGET ":" << endl; - t << "\t@echo # ============================================================================== > " MAKE_CACHE_NAME << endl; - t << "\t@echo # This file is generated by make and should not be modified by the user >> " MAKE_CACHE_NAME << endl; - t << "\t@echo # Name : " << MAKE_CACHE_NAME << " >> " MAKE_CACHE_NAME << endl; - t << "\t@echo # Part of : " << project->values("TARGET").join(" ") << " >> " MAKE_CACHE_NAME << endl; - t << "\t@echo # Description : This file is used to cache last build target for >> " MAKE_CACHE_NAME << endl; - t << "\t@echo # make sis target. >> " MAKE_CACHE_NAME << endl; - t << "\t@echo # Version : >> " MAKE_CACHE_NAME << endl; - t << "\t@echo # >> " MAKE_CACHE_NAME << endl; - t << "\t@echo # ============================================================================== >> " MAKE_CACHE_NAME << endl; - t << "\t@echo. >> " MAKE_CACHE_NAME << endl; + t << "\t@echo \\# ============================================================================== > " MAKE_CACHE_NAME << endl; + t << "\t@echo \\# This file is generated by make and should not be modified by the user >> " MAKE_CACHE_NAME << endl; + t << "\t@echo \\# Name : " << MAKE_CACHE_NAME << " >> " MAKE_CACHE_NAME << endl; + t << "\t@echo \\# Part of : " << project->values("TARGET").join(" ") << " >> " MAKE_CACHE_NAME << endl; + t << "\t@echo \\# Description : This file is used to cache last build target for >> " MAKE_CACHE_NAME << endl; + t << "\t@echo \\# make sis target. >> " MAKE_CACHE_NAME << endl; + t << "\t@echo \\# Version : >> " MAKE_CACHE_NAME << endl; + t << "\t@echo \\# >> " MAKE_CACHE_NAME << endl; + t << "\t@echo \\# ============================================================================== >> " MAKE_CACHE_NAME << endl; + t << "\t@echo >> " MAKE_CACHE_NAME << endl; t << "\t@echo QT_SIS_TARGET ?= $(QT_SIS_TARGET) >> " MAKE_CACHE_NAME << endl; t << endl; -- cgit v0.12 From 4c7d869bc103de36b5a97dd50f323f7af680656e Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Tue, 17 Nov 2009 13:22:11 +0100 Subject: Fix for tabwidget elidemode being overriden by stylesheet Setting a stylesheet or reparenting a widget into a widget using style sheet would cause the elidemode to be reset. Instead we now keep the elidemode whenever it has been explicitly set by the user rather than querying from the style again. Task-number: QT-1914 Reviewed-by: ogoffart --- src/gui/widgets/qtabbar.cpp | 4 +++- src/gui/widgets/qtabbar_p.h | 3 ++- tests/auto/qtabbar/tst_qtabbar.cpp | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/gui/widgets/qtabbar.cpp b/src/gui/widgets/qtabbar.cpp index 3935c55..98c69c0 100644 --- a/src/gui/widgets/qtabbar.cpp +++ b/src/gui/widgets/qtabbar.cpp @@ -1947,7 +1947,8 @@ void QTabBar::changeEvent(QEvent *event) { Q_D(QTabBar); if (event->type() == QEvent::StyleChange) { - d->elideMode = Qt::TextElideMode(style()->styleHint(QStyle::SH_TabBar_ElideMode, 0, this)); + if (!d->elideModeSetByUser) + d->elideMode = Qt::TextElideMode(style()->styleHint(QStyle::SH_TabBar_ElideMode, 0, this)); d->useScrollButtons = !style()->styleHint(QStyle::SH_TabBar_PreferNoArrows, 0, this); d->refresh(); } else if (event->type() == QEvent::FontChange) { @@ -1979,6 +1980,7 @@ void QTabBar::setElideMode(Qt::TextElideMode mode) { Q_D(QTabBar); d->elideMode = mode; + d->elideModeSetByUser = true; d->refresh(); } diff --git a/src/gui/widgets/qtabbar_p.h b/src/gui/widgets/qtabbar_p.h index 9f3285b..2854cde 100644 --- a/src/gui/widgets/qtabbar_p.h +++ b/src/gui/widgets/qtabbar_p.h @@ -75,7 +75,7 @@ class QTabBarPrivate : public QWidgetPrivate public: QTabBarPrivate() :currentIndex(-1), pressedIndex(-1), shape(QTabBar::RoundedNorth), layoutDirty(false), - drawBase(true), scrollOffset(0), expanding(true), closeButtonOnTabs(false), + drawBase(true), scrollOffset(0), elideModeSetByUser(false), expanding(true), closeButtonOnTabs(false), selectionBehaviorOnRemove(QTabBar::SelectRightTab), paintWithOffsets(true), movable(false), dragInProgress(false), documentMode(false), movingTab(0) #ifdef Q_WS_MAC @@ -186,6 +186,7 @@ public: void makeVisible(int index); QSize iconSize; Qt::TextElideMode elideMode; + bool elideModeSetByUser; bool useScrollButtons; bool expanding; diff --git a/tests/auto/qtabbar/tst_qtabbar.cpp b/tests/auto/qtabbar/tst_qtabbar.cpp index 2db72b9..78c65ae 100644 --- a/tests/auto/qtabbar/tst_qtabbar.cpp +++ b/tests/auto/qtabbar/tst_qtabbar.cpp @@ -273,6 +273,9 @@ void tst_QTabBar::setElideMode() if (tabElideMode != -128) tabBar.setElideMode(Qt::TextElideMode(tabElideMode)); QTEST(int(tabBar.elideMode()), "expectedMode"); + // Make sure style sheet does not override user set mode + tabBar.setStyleSheet("QWidget { background-color: #ABA8A6;}"); + QTEST(int(tabBar.elideMode()), "expectedMode"); } void tst_QTabBar::setUsesScrollButtons_data() -- cgit v0.12 From 78474a65e4f61e9d1ae8116d5b690cf78729aa71 Mon Sep 17 00:00:00 2001 From: axis Date: Tue, 17 Nov 2009 10:39:08 +0100 Subject: Improving parts of commit 2d8d855d. It breaks Symbian on Windows, so instead use an approach that works on all platforms. --- qmake/generators/symbian/symmake_abld.cpp | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/qmake/generators/symbian/symmake_abld.cpp b/qmake/generators/symbian/symmake_abld.cpp index b06db2f..8e6c4fa 100644 --- a/qmake/generators/symbian/symmake_abld.cpp +++ b/qmake/generators/symbian/symmake_abld.cpp @@ -440,21 +440,31 @@ bool SymbianAbldMakefileGenerator::writeDeploymentTargets(QTextStream &t) void SymbianAbldMakefileGenerator::writeStoreBuildTarget(QTextStream &t) { +#ifdef Q_OS_WIN +#define HASH "#" +#define EMPTYECHO "." +#else +#define HASH "\\#" +#define EMPTYECHO +#endif + t << STORE_BUILD_TARGET ":" << endl; - t << "\t@echo \\# ============================================================================== > " MAKE_CACHE_NAME << endl; - t << "\t@echo \\# This file is generated by make and should not be modified by the user >> " MAKE_CACHE_NAME << endl; - t << "\t@echo \\# Name : " << MAKE_CACHE_NAME << " >> " MAKE_CACHE_NAME << endl; - t << "\t@echo \\# Part of : " << project->values("TARGET").join(" ") << " >> " MAKE_CACHE_NAME << endl; - t << "\t@echo \\# Description : This file is used to cache last build target for >> " MAKE_CACHE_NAME << endl; - t << "\t@echo \\# make sis target. >> " MAKE_CACHE_NAME << endl; - t << "\t@echo \\# Version : >> " MAKE_CACHE_NAME << endl; - t << "\t@echo \\# >> " MAKE_CACHE_NAME << endl; - t << "\t@echo \\# ============================================================================== >> " MAKE_CACHE_NAME << endl; - t << "\t@echo >> " MAKE_CACHE_NAME << endl; + t << "\t@echo " HASH " ============================================================================== > " MAKE_CACHE_NAME << endl; + t << "\t@echo " HASH " This file is generated by make and should not be modified by the user >> " MAKE_CACHE_NAME << endl; + t << "\t@echo " HASH " Name : " << MAKE_CACHE_NAME << " >> " MAKE_CACHE_NAME << endl; + t << "\t@echo " HASH " Part of : " << project->values("TARGET").join(" ") << " >> " MAKE_CACHE_NAME << endl; + t << "\t@echo " HASH " Description : This file is used to cache last build target for >> " MAKE_CACHE_NAME << endl; + t << "\t@echo " HASH " make sis target. >> " MAKE_CACHE_NAME << endl; + t << "\t@echo " HASH " Version : >> " MAKE_CACHE_NAME << endl; + t << "\t@echo " HASH " >> " MAKE_CACHE_NAME << endl; + t << "\t@echo " HASH " ============================================================================== >> " MAKE_CACHE_NAME << endl; + t << "\t@echo" EMPTYECHO " >> " MAKE_CACHE_NAME << endl; t << "\t@echo QT_SIS_TARGET ?= $(QT_SIS_TARGET) >> " MAKE_CACHE_NAME << endl; t << endl; generatedFiles << MAKE_CACHE_NAME; +#undef HASH +#undef EMPTYECHO } void SymbianAbldMakefileGenerator::writeBldInfMkFilePart(QTextStream& t, bool addDeploymentExtension) -- cgit v0.12 From f784f862a0242961d88650dd119becfb1a439072 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Tue, 17 Nov 2009 14:41:30 +0100 Subject: Remove mingw specific ifdefs after upgrade to mingw-gcc 4.4 --- demos/browser/browsermainwindow.cpp | 2 -- src/gui/util/qdesktopservices_win.cpp | 2 +- tests/auto/qdom/tst_qdom.cpp | 6 +----- tests/auto/qxmlsimplereader/tst_qxmlsimplereader.cpp | 2 +- 4 files changed, 3 insertions(+), 9 deletions(-) diff --git a/demos/browser/browsermainwindow.cpp b/demos/browser/browsermainwindow.cpp index fba3ac5..7bb27d5 100644 --- a/demos/browser/browsermainwindow.cpp +++ b/demos/browser/browsermainwindow.cpp @@ -433,10 +433,8 @@ void BrowserMainWindow::setupMenu() QMenu *toolsMenu = menuBar()->addMenu(tr("&Tools")); toolsMenu->addAction(tr("Web &Search"), this, SLOT(slotWebSearch()), QKeySequence(tr("Ctrl+K", "Web Search"))); -#ifndef Q_CC_MINGW a = toolsMenu->addAction(tr("Enable Web &Inspector"), this, SLOT(slotToggleInspector(bool))); a->setCheckable(true); -#endif QMenu *helpMenu = menuBar()->addMenu(tr("&Help")); helpMenu->addAction(tr("About &Qt"), qApp, SLOT(aboutQt())); diff --git a/src/gui/util/qdesktopservices_win.cpp b/src/gui/util/qdesktopservices_win.cpp index c0bd5e7..39443f2 100644 --- a/src/gui/util/qdesktopservices_win.cpp +++ b/src/gui/util/qdesktopservices_win.cpp @@ -59,7 +59,7 @@ # endif #endif -#if defined(Q_CC_MINGW) && !defined(CSIDL_MYMUSIC) +#ifndef CSIDL_MYMUSIC #define CSIDL_MYMUSIC 13 #define CSIDL_MYVIDEO 14 #endif diff --git a/tests/auto/qdom/tst_qdom.cpp b/tests/auto/qdom/tst_qdom.cpp index 6637202..786802e 100644 --- a/tests/auto/qdom/tst_qdom.cpp +++ b/tests/auto/qdom/tst_qdom.cpp @@ -476,10 +476,6 @@ void tst_QDom::save() void tst_QDom::initTestCase() { -#ifdef Q_CC_MINGW - QSKIP("Our current test machine, arsia, is too slow for this auto test.", SkipAll); -#endif - QFile file(SRCDIR "testdata/excludedCodecs.txt"); QVERIFY(file.open(QIODevice::ReadOnly|QIODevice::Text)); @@ -1676,7 +1672,7 @@ void tst_QDom::appendDocumentNode() const doc.appendChild(elem); - Q_ASSERT(!xml.isNull()); + QVERIFY(!xml.isNull()); const QString expected(QLatin1String("\n\n\n")); elem.appendChild(xml); diff --git a/tests/auto/qxmlsimplereader/tst_qxmlsimplereader.cpp b/tests/auto/qxmlsimplereader/tst_qxmlsimplereader.cpp index acbae2b..58f5cc1 100644 --- a/tests/auto/qxmlsimplereader/tst_qxmlsimplereader.cpp +++ b/tests/auto/qxmlsimplereader/tst_qxmlsimplereader.cpp @@ -580,7 +580,7 @@ void tst_QXmlSimpleReader::inputFromSocket() QSKIP("Symbian: Skipped due to problems in Open C and QtNetwork", SkipAll); #endif -#if defined(Q_OS_WIN32) && (defined(Q_CC_INTEL) || defined(Q_CC_MINGW) || defined(Q_CC_MSVC_NET)) +#if defined(Q_OS_WIN32) && (defined(Q_CC_INTEL) || defined(Q_CC_MSVC_NET)) QSKIP("Regression caused by QHOstInfo change 294548, see task 202231.", SkipAll); #endif QTcpSocket sock; -- cgit v0.12 From 2136c98b93fe8ea480d6ad34344213635b44039b Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Tue, 17 Nov 2009 14:47:40 +0100 Subject: small simplification of code to run the platform make tool in an autotest --- tests/auto/qsharedpointer/externaltests.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/tests/auto/qsharedpointer/externaltests.cpp b/tests/auto/qsharedpointer/externaltests.cpp index 3ca70c4..83cbb2a 100644 --- a/tests/auto/qsharedpointer/externaltests.cpp +++ b/tests/auto/qsharedpointer/externaltests.cpp @@ -671,14 +671,9 @@ namespace QTest { make.setProcessChannelMode(channelMode); -#if defined(Q_OS_WIN) && !defined(Q_CC_MINGW) - make.start(QLatin1String("nmake.exe"), args); - make.waitForStarted(); -#else static const char makes[] = -# ifdef Q_CC_MINGW - "mingw32-make.exe\0" -# endif + "nmake.exe\0" //for visual c++ + "mingw32-make.exe\0" //for mingw "gmake\0" "make\0"; for (const char *p = makes; *p; p += strlen(p) + 1) { @@ -686,7 +681,6 @@ namespace QTest { if (make.waitForStarted()) break; } -#endif if (make.state() != QProcess::Running) { exitCode = 255; -- cgit v0.12 From 24673c675db41411548e252d3718829f60149ba2 Mon Sep 17 00:00:00 2001 From: ck Date: Tue, 17 Nov 2009 15:42:07 +0100 Subject: Assistant: Add minimal documentation for as-yet-undocumented example. Task-number: QT-2455 Reviewed-by: David Boddie --- doc/src/examples/contextsensitivehelp.qdoc | 47 ++++++++++++++++++++++++++++++ doc/src/getting-started/examples.qdoc | 2 ++ 2 files changed, 49 insertions(+) create mode 100644 doc/src/examples/contextsensitivehelp.qdoc diff --git a/doc/src/examples/contextsensitivehelp.qdoc b/doc/src/examples/contextsensitivehelp.qdoc new file mode 100644 index 0000000..668fa36 --- /dev/null +++ b/doc/src/examples/contextsensitivehelp.qdoc @@ -0,0 +1,47 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example help/contextsensitivehelp + \title Context-Sensitive Help Example + + This example shows how to use the services of the QHelpEngineCore class. +*/ diff --git a/doc/src/getting-started/examples.qdoc b/doc/src/getting-started/examples.qdoc index eec0492..dd256d9 100644 --- a/doc/src/getting-started/examples.qdoc +++ b/doc/src/getting-started/examples.qdoc @@ -1057,6 +1057,8 @@ \list \o \l{help/simpletextviewer}{Simple Text Viewer}\raisedaster + \o \l{help/remotecontrol}{Remote Control} + \o \l{help/contextsensitivehelp}{Context-Sensitive Help} \endlist Examples marked with an asterisk (*) are fully documented. -- cgit v0.12 From 06ae2e3589752e1ad915759ac68841f92c2aa2c5 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Wed, 18 Nov 2009 11:28:59 +0100 Subject: Compilation fix for VC and file dialog --- src/gui/dialogs/qfiledialog_win_p.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gui/dialogs/qfiledialog_win_p.h b/src/gui/dialogs/qfiledialog_win_p.h index 68e6a13..6d8c7c9 100644 --- a/src/gui/dialogs/qfiledialog_win_p.h +++ b/src/gui/dialogs/qfiledialog_win_p.h @@ -39,10 +39,9 @@ ** ****************************************************************************/ -#ifndef QFILEDIAG_WIN_P_H - #include #include +#if !defined(QFILEDIAG_WIN_P_H) && !defined(__shobjidl_h__) //these are the interface declarations needed for the file dialog on Vista and up -- cgit v0.12 From b96112479788a9893eb2e908e922a4f6963006d6 Mon Sep 17 00:00:00 2001 From: ck Date: Wed, 18 Nov 2009 15:11:01 +0100 Subject: Assistant: Cache directory can be given relative to collection file. Task-number: QT-2286 Reviewed-by: kh1 --- tools/assistant/tools/assistant/main.cpp | 9 +++++++-- tools/assistant/tools/qcollectiongenerator/main.cpp | 10 +++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/tools/assistant/tools/assistant/main.cpp b/tools/assistant/tools/assistant/main.cpp index 1b3a5f9..a5a9ef5 100644 --- a/tools/assistant/tools/assistant/main.cpp +++ b/tools/assistant/tools/assistant/main.cpp @@ -293,9 +293,14 @@ int main(int argc, char *argv[]) } QString fileName = QFileInfo(cmdCollectionFile).fileName(); - QString dir = MainWindow::collectionFileDirectory(false, + const QString &cacheDir = caller.customValue(QLatin1String("CacheDirectory"), - QString()).toString()); + QString()).toString(); + const QString dir = !cacheDir.isEmpty() + && caller.customValue(QLatin1String("CacheDirRelativeToCollection")).toBool() + ? QFileInfo(cmdCollectionFile).dir().absolutePath() + + QDir::separator() + cacheDir + : MainWindow::collectionFileDirectory(false, cacheDir); bool collectionFileExists = true; QFileInfo fi(dir + QDir::separator() + fileName); diff --git a/tools/assistant/tools/qcollectiongenerator/main.cpp b/tools/assistant/tools/qcollectiongenerator/main.cpp index a2df6ab..a92cc56 100644 --- a/tools/assistant/tools/qcollectiongenerator/main.cpp +++ b/tools/assistant/tools/qcollectiongenerator/main.cpp @@ -87,6 +87,7 @@ public: QStringList filesToRegister() const { return m_filesToRegister; } QString cacheDirectory() const { return m_cacheDirectory; } + bool cacheDirRelativeToCollection() const { return m_cacheDirRelativeToCollection; } private: void raiseErrorWithLine(); @@ -115,6 +116,7 @@ private: QMap m_filesToGenerate; QStringList m_filesToRegister; QString m_cacheDirectory; + bool m_cacheDirRelativeToCollection; }; void CollectionConfigReader::raiseErrorWithLine() @@ -198,6 +200,9 @@ void CollectionConfigReader::readAssistantSettings() } else if (name() == QLatin1String("aboutDialog")) { readAboutDialog(); } else if (name() == "cacheDirectory") { + m_cacheDirRelativeToCollection = + attributes().value(QLatin1String("base")) + == QLatin1String("collection"); m_cacheDirectory = readElementText(); } else { raiseErrorWithLine(); @@ -461,8 +466,11 @@ int main(int argc, char *argv[]) if (!config.currentFilter().isEmpty()) helpEngine.setCustomValue(QLatin1String("CurrentFilter"), config.currentFilter()); - if (!config.cacheDirectory().isEmpty()) + if (!config.cacheDirectory().isEmpty()) { helpEngine.setCustomValue(QLatin1String("CacheDirectory"), config.cacheDirectory()); + helpEngine.setCustomValue(QLatin1String("CacheDirRelativeToCollection"), + config.cacheDirRelativeToCollection()); + } helpEngine.setCustomValue(QLatin1String("EnableFilterFunctionality"), config.enableFilterFunctionality()); -- cgit v0.12 From 49e351729c061e1b8988d9fd80d5c4fdcf7f4d84 Mon Sep 17 00:00:00 2001 From: ck Date: Wed, 18 Nov 2009 15:14:23 +0100 Subject: Assistant: Documentation update for commit b961124. Task-number: QT-2286 Reviewed-by: David Boddie --- doc/src/development/assistant-manual.qdoc | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/doc/src/development/assistant-manual.qdoc b/doc/src/development/assistant-manual.qdoc index 9b52df4..be721f7 100644 --- a/doc/src/development/assistant-manual.qdoc +++ b/doc/src/development/assistant-manual.qdoc @@ -633,12 +633,19 @@ file in the \c{file} tags. It is possible to specify a different file or any language. The icon defined by the \c{icon} tags is applied to any language. \row - \o \c{} - \o Specified as a path relative to the directory given by - QDesktopServices::DataLocation, the cache path is used to store index files + \o \c{} + \o The cache directory is used to store index files needed for the full text search and a copy of the collection file. - The copy is needed because \QA stores all its settings in the collection file; - i.e., it must be writable for the user. + The copy is needed because \QA stores all its settings in the collection file; i.e., it must be writable for the user. + The directory is specified as a relative path. + If the \c{base} attribute is set to "collection", the path is + relative to the directory the collection file resides in. + If the attribute is set to "default" or if it is missing, + the path is relative to the directory given by + QDesktopServices::DataLocation. The first form is useful for + collections that are used in a "mobile" way, e.g. carried around + on a USB stick. + \endtable In addition to those \QA specific tags, the tags for generating and registering -- cgit v0.12 From ceec6c8cc7613b555cfe4f70c335dd4494ccc727 Mon Sep 17 00:00:00 2001 From: ck Date: Wed, 18 Nov 2009 15:19:11 +0100 Subject: Help generator: Add option to check HTML links. We look up all "a href" and "img src" link in the project's HTML files and give a warning if the link target does not exist or is not listed in the project's filter sections. Task-number: QTBUG-2485 Reviewed-by: kh1 --- tools/assistant/lib/qhelpgenerator.cpp | 65 ++++++++++++++++++++++++++ tools/assistant/lib/qhelpgenerator_p.h | 1 + tools/assistant/tools/qhelpgenerator/main.cpp | 19 ++++++-- tools/assistant/tools/shared/helpgenerator.cpp | 5 ++ tools/assistant/tools/shared/helpgenerator.h | 1 + 5 files changed, 87 insertions(+), 4 deletions(-) diff --git a/tools/assistant/lib/qhelpgenerator.cpp b/tools/assistant/lib/qhelpgenerator.cpp index 48d73aa..1bb4cc8 100644 --- a/tools/assistant/lib/qhelpgenerator.cpp +++ b/tools/assistant/lib/qhelpgenerator.cpp @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include @@ -824,4 +825,68 @@ bool QHelpGenerator::insertMetaData(const QMap &metaData) return true; } +bool QHelpGenerator::checkLinks(const QHelpDataInterface &helpData) +{ + /* + * Step 1: Gather the canoncal file paths of all files in the project. + * We use a set, because there will be a lot of look-ups. + */ + QSet files; + foreach (const QHelpDataFilterSection &filterSection, helpData.filterSections()) { + foreach (const QString &file, filterSection.files()) { + QFileInfo fileInfo(helpData.rootPath() + QDir::separator() + file); + const QString &canonicalFileName = fileInfo.canonicalFilePath(); + if (!fileInfo.exists()) + emit warning(tr("File '%1' does not exist.").arg(file)); + else + files.insert(canonicalFileName); + } + } + + /* + * Step 2: Check the hypertext and image references of all HTML files. + * Note that we don't parse the files, but simply grep for the + * respective HTML elements. Therefore. contents that are e.g. + * commented out can cause false warning. + */ + bool allLinksOk = true; + foreach (const QString &fileName, files) { + if (!fileName.endsWith(QLatin1String("html")) + && !fileName.endsWith(QLatin1String("htm"))) + continue; + QFile htmlFile(fileName); + if (!htmlFile.open(QIODevice::ReadOnly)) { + emit warning(tr("File '%1' cannot be opened.").arg(fileName)); + continue; + } + const QRegExp linkPattern(QLatin1String("<(?:a href|img src)=\"?([^#\">]+)[#\">]")); + QTextStream stream(&htmlFile); + const QString codec = QHelpGlobal::codecFromData(htmlFile.read(1000)); + stream.setCodec(QTextCodec::codecForName(codec.toLatin1().constData())); + const QString &content = stream.readAll(); + QStringList invalidLinks; + for (int pos = linkPattern.indexIn(content); pos != -1; + pos = linkPattern.indexIn(content, pos + 1)) { + const QString& linkedFileName = linkPattern.cap(1); + if (linkedFileName.contains(QLatin1String("://"))) + continue; + const QString curDir = QFileInfo(fileName).dir().path(); + const QString &canonicalLinkedFileName = + QFileInfo(curDir + QDir::separator() + linkedFileName).canonicalFilePath(); + if (!files.contains(canonicalLinkedFileName) + && !invalidLinks.contains(canonicalLinkedFileName)) { + emit warning(tr("File '%1' contains an invalid link to file '%2'"). + arg(fileName).arg(linkedFileName)); + allLinksOk = false; + invalidLinks.append(canonicalLinkedFileName); + } + } + } + + if (!allLinksOk) + d->error = tr("Invalid links in HTML files."); + return allLinksOk; +} + QT_END_NAMESPACE + diff --git a/tools/assistant/lib/qhelpgenerator_p.h b/tools/assistant/lib/qhelpgenerator_p.h index 849e724..77189b0 100644 --- a/tools/assistant/lib/qhelpgenerator_p.h +++ b/tools/assistant/lib/qhelpgenerator_p.h @@ -74,6 +74,7 @@ public: bool generate(QHelpDataInterface *helpData, const QString &outputFileName); + bool checkLinks(const QHelpDataInterface &helpData); QString error() const; Q_SIGNALS: diff --git a/tools/assistant/tools/qhelpgenerator/main.cpp b/tools/assistant/tools/qhelpgenerator/main.cpp index 367d895..5866bc8 100644 --- a/tools/assistant/tools/qhelpgenerator/main.cpp +++ b/tools/assistant/tools/qhelpgenerator/main.cpp @@ -58,6 +58,7 @@ int main(int argc, char *argv[]) QString basePath; bool showHelp = false; bool showVersion = false; + bool checkLinks = false; for (int i = 1; i < argc; ++i) { arg = QString::fromLocal8Bit(argv[i]); @@ -72,6 +73,8 @@ int main(int argc, char *argv[]) showVersion = true; } else if (arg == QLatin1String("-h")) { showHelp = true; + } else if (arg == QLatin1String("-c")) { + checkLinks = true; } else { QFileInfo fi(arg); projectFile = fi.absoluteFilePath(); @@ -93,6 +96,8 @@ int main(int argc, char *argv[]) " file called .\n" " If this option is not specified\n" " a default name will be used.\n" + " -c Checks whether all links in HTML files\n" + " point to files in this help project.\n" " -v Displays the version of \n" " qhelpgenerator.\n\n"); @@ -111,9 +116,11 @@ int main(int argc, char *argv[]) } if (compressedFile.isEmpty()) { - QFileInfo fi(projectFile); - compressedFile = basePath + QDir::separator() - + fi.baseName() + QLatin1String(".qch"); + if (!checkLinks) { + QFileInfo fi(projectFile); + compressedFile = basePath + QDir::separator() + + fi.baseName() + QLatin1String(".qch"); + } } else { // check if the output dir exists -- create if it doesn't QFileInfo fi(compressedFile); @@ -134,7 +141,11 @@ int main(int argc, char *argv[]) QCoreApplication app(argc, argv); HelpGenerator generator; - bool success = generator.generate(helpData, compressedFile); + bool success = true; + if (checkLinks) + success = generator.checkLinks(*helpData); + if (success && !compressedFile.isEmpty()) + success = generator.generate(helpData, compressedFile); delete helpData; if (!success) { fprintf(stderr, "%s\n", qPrintable(generator.error())); diff --git a/tools/assistant/tools/shared/helpgenerator.cpp b/tools/assistant/tools/shared/helpgenerator.cpp index 956a22a..68b714e 100644 --- a/tools/assistant/tools/shared/helpgenerator.cpp +++ b/tools/assistant/tools/shared/helpgenerator.cpp @@ -61,6 +61,11 @@ bool HelpGenerator::generate(QHelpDataInterface *helpData, return generator->generate(helpData, outputFileName); } +bool HelpGenerator::checkLinks(const QHelpDataInterface &helpData) +{ + return generator->checkLinks(helpData); +} + QString HelpGenerator::error() const { return generator->error(); diff --git a/tools/assistant/tools/shared/helpgenerator.h b/tools/assistant/tools/shared/helpgenerator.h index ffb31bc..83a8195 100644 --- a/tools/assistant/tools/shared/helpgenerator.h +++ b/tools/assistant/tools/shared/helpgenerator.h @@ -57,6 +57,7 @@ public: HelpGenerator(); bool generate(QHelpDataInterface *helpData, const QString &outputFileName); + bool checkLinks(const QHelpDataInterface &helpData); QString error() const; private slots: -- cgit v0.12 From 5daca044cf8d185d9a09b2ec87cba10244e425e4 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 16 Nov 2009 08:54:12 +0100 Subject: add a benchmark comparing QVector and std::vector performance This also includes a QRawVector class template mimicing a QVector without reference counting. --- tests/benchmarks/qvector/main.cpp | 426 +++++++++++++++++++ tests/benchmarks/qvector/outofline.cpp | 41 ++ tests/benchmarks/qvector/qrawvector.h | 742 +++++++++++++++++++++++++++++++++ tests/benchmarks/qvector/qvector.pro | 6 + 4 files changed, 1215 insertions(+) create mode 100644 tests/benchmarks/qvector/main.cpp create mode 100644 tests/benchmarks/qvector/outofline.cpp create mode 100644 tests/benchmarks/qvector/qrawvector.h create mode 100644 tests/benchmarks/qvector/qvector.pro diff --git a/tests/benchmarks/qvector/main.cpp b/tests/benchmarks/qvector/main.cpp new file mode 100644 index 0000000..65e7609 --- /dev/null +++ b/tests/benchmarks/qvector/main.cpp @@ -0,0 +1,426 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include + +#include "qrawvector.h" + +#include + +/* + +Code generated by g++ 4.3.3. The lines marked with '!' are the ones that get +executed inside the loop. Using the external 's' causes some load making the +loop resembling a 'simple inner loop' in 'real' applications. + + +qvector_mutable_read_access: + +.L166: +! movl -16(%ebp), %edx +! movl (%edx), %eax +! subl $1, %eax +! je .L165 + movl 4(%edx), %eax + movl %eax, 8(%esp) + movl 8(%edx), %eax + movl %esi, (%esp) + movl %eax, 4(%esp) + call _ZN4myns7QVectorIdE7reallocEii +.L165: +! movl -16(%ebp), %eax +! fldl s +! faddl 16(%eax,%ebx,8) +! addl $1, %ebx +! cmpl $10000, %ebx +! fstpl s +! jne .L166 + + +qvector_const_read_access: + + movl -16(%ebp), %edx + xorl %eax, %eax +.L183: +! fldl s +! faddl 16(%edx,%eax,8) +! addl $1, %eax +! cmpl $10000, %eax +! fstpl s +! jne .L183 + + +stdvector_const_read_access and stdvector_mutable_read_access and +qrawvector_const_read_access and qrawvector_mutable_read_access: + + xorl %eax, %eax +.L64: +! fldl s +! faddl (%ebx,%eax,8) +! addl $1, %eax +! cmpl $10000, %eax +! fstpl s +! jne .L64 + + + +Behaviour varies with small modifications, but total is more or +less stable: + +qrawvector_mutable_read_access, using size() instead of N: + +.L145: +! faddl (%edx,%eax,8) +! addl $1, %eax +! cmpl %ecx, %eax +! fstl s +! jne .L145 +! fstp %st(0) + + +qrawvector_mutable_read_access, counting backward: + +.L145: +! faddl (%edx,%eax,8) +! subl $1, %eax +! cmpl $-1, %eax +! fstl s +! jne .L145 + + +qrawvector_mutable_read_access, counting backward, using size(): + +.L146: +! faddl (%edx) +! addl $1, %eax +! subl $8, %edx +! cmpl %ecx, %eax +! fstl s +! jne .L146 + + + +*/ + + +/* + +//////////////////////////////////////////////////////////////////// + +time ./tst_vector qvector_const_read_access +real 0m12.912s +user 0m12.401s +sys 0m0.016s + +time ./tst_vector qvector_mutable_read_access +real 0m38.566s +user 0m36.754s +sys 0m0.008s + + +time ./tst_vector stdvector_mutable_read_access +real 0m12.736s +user 0m12.665s +sys 0m0.004s + + +//////////////////////////////////////////////////////////////////// + +time ./tst_vector qvector_fill_and_return +real 0m28.778s +user 0m28.522s +sys 0m0.012s + +time ./tst_vector stdvector_fill_and_return +real 0m26.675s +user 0m26.558s +sys 0m0.012s + +time ./tst_vector qrawvector_fill_and_return +real 0m23.370s +user 0m23.269s +sys 0m0.008s + + + +*/ + + + +#define TEST_RETURN 1 + +// For some reason, both 'plain' and '-callgrind' create strange results +// (like varying instruction count for the same assembly code) +// So replace it by a plain loop and measure wall clock time. +//#undef QBENCHMARK +//#define QBENCHMARK for (int j = 0; j != 10000; ++j) + +class tst_QVector: public QObject +{ + Q_OBJECT + +private slots: + void calibration(); + + // Pure Qt solution + void qvector_separator() { qWarning() << "QVector results: "; } + void qvector_const_read_access(); + void qvector_mutable_read_access(); + #ifdef TEST_RETURN + void qvector_fill_and_return(); + void qvector_fill_and_return2(); + #endif + + // Purre Standard solution + void stdvector() { qWarning() << "std::vector results: "; } + void stdvector_const_read_access(); + void stdvector_mutable_read_access(); + #ifdef TEST_RETURN + void stdvector_fill_and_return(); + void stdvector_fill_and_return2(); + #endif + + // Build using std, pass as QVector + void mixedvector() { qWarning() << "mixed results: "; } + #ifdef TEST_RETURN + void mixedvector_fill_and_return(); + void mixedvector_fill_and_return2(); + #endif + + // Alternative implementation + void qrawvector_separator() { qWarning() << "QRawVector results: "; } + void qrawvector_const_read_access(); + void qrawvector_mutable_read_access(); + #ifdef TEST_RETURN + void qrawvector_fill_and_return(); + void qrawvector_fill_and_return2(); + #endif +}; + +const int N = 1000000; +extern double s; + +void tst_QVector::calibration() +{ + QVector v(N); + for (int i = 0; i != N; ++i) + v[i] = i; + QBENCHMARK { + for (int i = 0; i != N; ++i) + s += i; + } +} + +///////////////////// QVector ///////////////////// + +void tst_QVector::qvector_const_read_access() +{ + QVector v(N); + for (int i = 0; i != N; ++i) + v[i] = i; + + const QVector &vc = v; + QBENCHMARK { + for (int i = 0; i != N; ++i) + s += vc[i]; + } +} + +void tst_QVector::qvector_mutable_read_access() +{ + QVector v(N); + for (int i = 0; i != N; ++i) + v[i] = i; + + QBENCHMARK { + for (int i = 0; i != N; ++i) + s += v[i]; + } +} + +#ifdef TEST_RETURN +extern QVector qvector_fill_and_return_helper(); +extern QVector qvector_fill_and_return_helper2(); + +void tst_QVector::qvector_fill_and_return() +{ + QBENCHMARK { + QVector v = qvector_fill_and_return_helper(); + s += v[1]; + } +} + +void tst_QVector::qvector_fill_and_return2() +{ + QBENCHMARK { + QVector v = qvector_fill_and_return_helper2(); + s += v[1]; + } +} +#endif + + +///////////////////// QRawVector ///////////////////// + +void tst_QVector::qrawvector_const_read_access() +{ + QRawVector v(N); + for (int i = 0; i != N; ++i) + v[i] = i; + + const QRawVector &vc = v; + QBENCHMARK { + for (int i = vc.size(); --i >= 0;) + s += vc[i]; + } +} + +void tst_QVector::qrawvector_mutable_read_access() +{ + QRawVector v(N); + for (int i = 0; i != N; ++i) + v[i] = i; + + QBENCHMARK { + for (int i = 0; i != N; ++i) + s += v[i]; + } +} + +#ifdef TEST_RETURN +extern QVector qrawvector_fill_and_return_helper(); +extern QVector qrawvector_fill_and_return_helper2(); + +void tst_QVector::qrawvector_fill_and_return() +{ + QBENCHMARK { + QVector v = qrawvector_fill_and_return_helper(); + s += v[1]; + } +} + +void tst_QVector::qrawvector_fill_and_return2() +{ + QBENCHMARK { + QVector v = qrawvector_fill_and_return_helper(); + s += v[1]; + } +} +#endif + + +///////////////////// std::vector ///////////////////// + +void tst_QVector::stdvector_const_read_access() +{ + std::vector v(N); + for (int i = 0; i != N; ++i) + v[i] = i; + + const std::vector &vc = v; + QBENCHMARK { + for (int i = 0; i != N; ++i) + s += vc[i]; + } +} + +void tst_QVector::stdvector_mutable_read_access() +{ + std::vector v(N); + for (int i = 0; i != N; ++i) + v[i] = i; + + QBENCHMARK { + for (int i = 0; i != N; ++i) + s += v[i]; + } +} + +#ifdef TEST_RETURN +extern std::vector stdvector_fill_and_return_helper(); +extern std::vector stdvector_fill_and_return_helper2(); + +void tst_QVector::stdvector_fill_and_return() +{ + QBENCHMARK { + std::vector v = stdvector_fill_and_return_helper(); + s += v[1]; + } +} + +void tst_QVector::stdvector_fill_and_return2() +{ + QBENCHMARK { + std::vector v = stdvector_fill_and_return_helper2(); + s += v[1]; + } +} +#endif + +///////////////////// mixed vector ///////////////////// + + +#ifdef TEST_RETURN +extern QVector mixedvector_fill_and_return_helper(); +extern QVector mixedvector_fill_and_return_helper2(); + +void tst_QVector::mixedvector_fill_and_return() +{ + QBENCHMARK { + std::vector v = stdvector_fill_and_return_helper(); + s += v[1]; + } +} + +void tst_QVector::mixedvector_fill_and_return2() +{ + QBENCHMARK { + std::vector v = stdvector_fill_and_return_helper2(); + s += v[1]; + } +} +#endif + +QTEST_MAIN(tst_QVector) + +#include "main.moc" diff --git a/tests/benchmarks/qvector/outofline.cpp b/tests/benchmarks/qvector/outofline.cpp new file mode 100644 index 0000000..d1d72b0 --- /dev/null +++ b/tests/benchmarks/qvector/outofline.cpp @@ -0,0 +1,41 @@ + +#include +#include +#include "qrawvector.h" + +const int N = 1000000; +double s = 0; + +QVector qvector_fill_and_return_helper() +{ + QVector v(N); + for (int i = 0; i != N; ++i) + v[i] = i; + return v; +} + +QVector qrawvector_fill_and_return_helper() +{ + QRawVector v(N); + for (int i = 0; i != N; ++i) + v[i] = i; + return v.mutateToVector(); +} + +QVector mixedvector_fill_and_return_helper() +{ + std::vector v(N); + for (int i = 0; i != N; ++i) + v[i] = i; + return QVector::fromStdVector(v); +} + + +std::vector stdvector_fill_and_return_helper() +{ + std::vector v(N); + for (int i = 0; i != N; ++i) + v[i] = i; + return v; +} + diff --git a/tests/benchmarks/qvector/qrawvector.h b/tests/benchmarks/qvector/qrawvector.h new file mode 100644 index 0000000..15421eb --- /dev/null +++ b/tests/benchmarks/qvector/qrawvector.h @@ -0,0 +1,742 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QRAWVECTOR_H +#define QRAWVECTOR_H + +#include +#include +#include +#include +#include + +#ifndef QT_NO_STL +#include +#include +#endif +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Core) + + + +template +class QRawVector +{ + struct Data : QVectorData { T array[1]; }; + + T *m_begin; + int m_size; + int m_alloc; + +public: + //static Data dummy; + //int headerOffset() { return (char*)&dummy.array - (char*)&dummy; } + inline int headerOffset() const { + // gcc complains about: return offsetof(Data, array); and also + // does not like '0' in the expression below. + return (char *)&(((Data *)(1))->array) - (char *)1; + } + inline Data *toBase(T *begin) const + { return (Data*)((char*)begin - headerOffset()); } + inline T *fromBase(void *d) const + { return (T*)((char*)d + headerOffset()); } + inline QRawVector() + { m_begin = fromBase(0); m_alloc = m_size = 0; realloc(m_size, m_alloc, true); } + explicit QRawVector(int size); + QRawVector(int size, const T &t); + inline QRawVector(const QRawVector &v) + { m_begin = v.m_begin; m_alloc = v.m_alloc; m_size = v.m_size; realloc(m_size, m_alloc, true); } + inline ~QRawVector() { free(m_begin, m_size); } + QRawVector &operator=(const QRawVector &v); + bool operator==(const QRawVector &v) const; + inline bool operator!=(const QRawVector &v) const { return !(*this == v); } + + inline int size() const { return m_size; } + + inline bool isEmpty() const { return m_size == 0; } + + void resize(int size); + + inline int capacity() const { return m_alloc; } + void reserve(int size); + inline void squeeze() { realloc(m_size, m_size, false); } + + inline T *data() { return m_begin; } + inline const T *data() const { return m_begin; } + inline const T *constData() const { return m_begin; } + void clear(); + + const T &at(int i) const; + T &operator[](int i); + const T &operator[](int i) const; + void append(const T &t); + void prepend(const T &t); + void insert(int i, const T &t); + void insert(int i, int n, const T &t); + void replace(int i, const T &t); + void remove(int i); + void remove(int i, int n); + + QRawVector &fill(const T &t, int size = -1); + + int indexOf(const T &t, int from = 0) const; + int lastIndexOf(const T &t, int from = -1) const; + bool contains(const T &t) const; + int count(const T &t) const; + +#ifdef QT_STRICT_ITERATORS + class iterator { + public: + T *i; + typedef std::random_access_iterator_tag iterator_category; + typedef ptrdiff_t difference_type; + typedef T value_type; + typedef T *pointer; + typedef T &reference; + + inline iterator() : i(0) {} + inline iterator(T *n) : i(n) {} + inline iterator(const iterator &o): i(o.i){} + inline T &operator*() const { return *i; } + inline T *operator->() const { return i; } + inline T &operator[](int j) const { return *(i + j); } + inline bool operator==(const iterator &o) const { return i == o.i; } + inline bool operator!=(const iterator &o) const { return i != o.i; } + inline bool operator<(const iterator& other) const { return i < other.i; } + inline bool operator<=(const iterator& other) const { return i <= other.i; } + inline bool operator>(const iterator& other) const { return i > other.i; } + inline bool operator>=(const iterator& other) const { return i >= other.i; } + inline iterator &operator++() { ++i; return *this; } + inline iterator operator++(int) { T *n = i; ++i; return n; } + inline iterator &operator--() { i--; return *this; } + inline iterator operator--(int) { T *n = i; i--; return n; } + inline iterator &operator+=(int j) { i+=j; return *this; } + inline iterator &operator-=(int j) { i-=j; return *this; } + inline iterator operator+(int j) const { return iterator(i+j); } + inline iterator operator-(int j) const { return iterator(i-j); } + inline int operator-(iterator j) const { return i - j.i; } + }; + friend class iterator; + + class const_iterator { + public: + T *i; + typedef std::random_access_iterator_tag iterator_category; + typedef ptrdiff_t difference_type; + typedef T value_type; + typedef const T *pointer; + typedef const T &reference; + + inline const_iterator() : i(0) {} + inline const_iterator(T *n) : i(n) {} + inline const_iterator(const const_iterator &o): i(o.i) {} + inline explicit const_iterator(const iterator &o): i(o.i) {} + inline const T &operator*() const { return *i; } + inline const T *operator->() const { return i; } + inline const T &operator[](int j) const { return *(i + j); } + inline bool operator==(const const_iterator &o) const { return i == o.i; } + inline bool operator!=(const const_iterator &o) const { return i != o.i; } + inline bool operator<(const const_iterator& other) const { return i < other.i; } + inline bool operator<=(const const_iterator& other) const { return i <= other.i; } + inline bool operator>(const const_iterator& other) const { return i > other.i; } + inline bool operator>=(const const_iterator& other) const { return i >= other.i; } + inline const_iterator &operator++() { ++i; return *this; } + inline const_iterator operator++(int) { T *n = i; ++i; return n; } + inline const_iterator &operator--() { i--; return *this; } + inline const_iterator operator--(int) { T *n = i; i--; return n; } + inline const_iterator &operator+=(int j) { i+=j; return *this; } + inline const_iterator &operator-=(int j) { i+=j; return *this; } + inline const_iterator operator+(int j) const { return const_iterator(i+j); } + inline const_iterator operator-(int j) const { return const_iterator(i-j); } + inline int operator-(const_iterator j) const { return i - j.i; } + }; + friend class const_iterator; +#else + // STL-style + typedef T *iterator; + typedef const T *const_iterator; +#endif + inline iterator begin() { return m_begin; } + inline const_iterator begin() const { return m_begin; } + inline const_iterator constBegin() const { return m_begin; } + inline iterator end() { return m_begin + m_size; } + inline const_iterator end() const { return m_begin + m_size; } + inline const_iterator constEnd() const { return m_begin + m_size; } + iterator insert(iterator before, int n, const T &x); + inline iterator insert(iterator before, const T &x) { return insert(before, 1, x); } + iterator erase(iterator begin, iterator end); + inline iterator erase(iterator pos) { return erase(pos, pos+1); } + + // more Qt + inline int count() const { return m_size; } + inline T& first() { Q_ASSERT(!isEmpty()); return *begin(); } + inline const T &first() const { Q_ASSERT(!isEmpty()); return *begin(); } + inline T& last() { Q_ASSERT(!isEmpty()); return *(end()-1); } + inline const T &last() const { Q_ASSERT(!isEmpty()); return *(end()-1); } + inline bool startsWith(const T &t) const { return !isEmpty() && first() == t; } + inline bool endsWith(const T &t) const { return !isEmpty() && last() == t; } + QRawVector mid(int pos, int length = -1) const; + + T value(int i) const; + T value(int i, const T &defaultValue) const; + + // STL compatibility + typedef T value_type; + typedef value_type *pointer; + typedef const value_type *const_pointer; + typedef value_type &reference; + typedef const value_type &const_reference; + typedef ptrdiff_t difference_type; + typedef iterator Iterator; + typedef const_iterator ConstIterator; + typedef int size_type; + inline void push_back(const T &t) { append(t); } + inline void push_front(const T &t) { prepend(t); } + void pop_back() { Q_ASSERT(!isEmpty()); erase(end()-1); } + void pop_front() { Q_ASSERT(!isEmpty()); erase(begin()); } + inline bool empty() const { return m_size == 0; } + inline T &front() { return first(); } + inline const_reference front() const { return first(); } + inline reference back() { return last(); } + inline const_reference back() const { return last(); } + + // comfort + QRawVector &operator+=(const QRawVector &l); + inline QRawVector operator+(const QRawVector &l) const + { QRawVector n = *this; n += l; return n; } + inline QRawVector &operator+=(const T &t) + { append(t); return *this; } + inline QRawVector &operator<< (const T &t) + { append(t); return *this; } + inline QRawVector &operator<<(const QRawVector &l) + { *this += l; return *this; } + + QList toList() const; + + //static QRawVector fromList(const QList &list); + +#ifndef QT_NO_STL + static inline QRawVector fromStdVector(const std::vector &vector) + { QRawVector tmp; qCopy(vector.begin(), vector.end(), std::back_inserter(tmp)); return tmp; } + inline std::vector toStdVector() const + { std::vector tmp; qCopy(constBegin(), constEnd(), std::back_inserter(tmp)); return tmp; } +#endif + +private: + T *allocate(int alloc); + void realloc(int size, int alloc, bool ref); + void free(T *begin, int size); + int sizeOfTypedData() { + // this is more or less the same as sizeof(Data), except that it doesn't + // count the padding at the end + return reinterpret_cast(&(reinterpret_cast(this))->array[1]) - reinterpret_cast(this); + } + static inline int alignOfTypedData() + { +#ifdef Q_ALIGNOF + return qMax(sizeof(void*), Q_ALIGNOF(Data)); +#else + return 0; +#endif + } + +public: + QVector mutateToVector() + { + Data *d = toBase(m_begin); + d->ref = 1; + d->alloc = m_alloc; + d->size = m_size; + d->sharable = 0; + d->capacity = 0; + + QVector v; + *reinterpret_cast(&v) = d; + m_begin = fromBase(0); + m_size = m_alloc = 0; + return v; + } +}; + + +template +void QRawVector::reserve(int asize) +{ if (asize > m_alloc) realloc(m_size, asize, false); } +template +void QRawVector::resize(int asize) +{ realloc(asize, (asize > m_alloc || (asize < m_size && asize < (m_alloc >> 1))) + ? QVectorData::grow(sizeOfTypedData(), asize, sizeof(T), QTypeInfo::isStatic) + : m_alloc, false); } +template +inline void QRawVector::clear() +{ *this = QRawVector(); } +template +inline const T &QRawVector::at(int i) const +{ Q_ASSERT_X(i >= 0 && i < m_size, "QRawVector::at", "index out of range"); + return m_begin[i]; } +template +inline const T &QRawVector::operator[](int i) const +{ Q_ASSERT_X(i >= 0 && i < m_size, "QRawVector::operator[]", "index out of range"); + return m_begin[i]; } +template +inline T &QRawVector::operator[](int i) +{ Q_ASSERT_X(i >= 0 && i < m_size, "QRawVector::operator[]", "index out of range"); + return data()[i]; } +template +inline void QRawVector::insert(int i, const T &t) +{ Q_ASSERT_X(i >= 0 && i <= m_size, "QRawVector::insert", "index out of range"); + insert(begin() + i, 1, t); } +template +inline void QRawVector::insert(int i, int n, const T &t) +{ Q_ASSERT_X(i >= 0 && i <= m_size, "QRawVector::insert", "index out of range"); + insert(begin() + i, n, t); } +template +inline void QRawVector::remove(int i, int n) +{ Q_ASSERT_X(i >= 0 && n >= 0 && i + n <= m_size, "QRawVector::remove", "index out of range"); + erase(begin() + i, begin() + i + n); } +template +inline void QRawVector::remove(int i) +{ Q_ASSERT_X(i >= 0 && i < m_size, "QRawVector::remove", "index out of range"); + erase(begin() + i, begin() + i + 1); } +template +inline void QRawVector::prepend(const T &t) +{ insert(begin(), 1, t); } + +template +inline void QRawVector::replace(int i, const T &t) +{ + Q_ASSERT_X(i >= 0 && i < m_size, "QRawVector::replace", "index out of range"); + const T copy(t); + data()[i] = copy; +} + +template +QRawVector &QRawVector::operator=(const QRawVector &v) +{ + if (this != &v) { + free(m_begin, m_size); + m_alloc = v.m_alloc; + m_size = v.m_size; + m_begin = v.m_begin; + realloc(m_size, m_alloc, true); + } + return *this; +} + +template +inline T *QRawVector::allocate(int aalloc) +{ + QVectorData *d = QVectorData::allocate(sizeOfTypedData() + (aalloc - 1) * sizeof(T), alignOfTypedData()); + Q_CHECK_PTR(d); + return fromBase(d); +} + +template +QRawVector::QRawVector(int asize) +{ + m_size = m_alloc = asize; + m_begin = allocate(asize); + if (QTypeInfo::isComplex) { + T *b = m_begin; + T *i = m_begin + m_size; + while (i != b) + new (--i) T; + } else { + qMemSet(m_begin, 0, asize * sizeof(T)); + } +} + +template +QRawVector::QRawVector(int asize, const T &t) +{ + m_size = m_alloc = asize; + m_begin = allocate(asize); + T *i = m_begin + m_size; + while (i != m_begin) + new (--i) T(t); +} + +template +void QRawVector::free(T *begin, int size) +{ + if (QTypeInfo::isComplex) { + T *i = begin + size; + while (i-- != begin) + i->~T(); + } + Data *x = toBase(begin); + x->free(x, alignOfTypedData()); +} + +template +void QRawVector::realloc(int asize, int aalloc, bool ref) +{ + if (QTypeInfo::isComplex && asize < m_size && !ref) { + // call the destructor on all objects that need to be + // destroyed when shrinking + T *pOld = m_begin + m_size; + while (asize < m_size) { + (--pOld)->~T(); + --m_size; + } + } + + int xalloc = m_alloc; + int xsize = m_size; + bool changed = false; + T *xbegin = m_begin; + if (aalloc != xalloc || ref) { + // (re)allocate memory + if (QTypeInfo::isStatic) { + xbegin = allocate(aalloc); + xsize = 0; + changed = true; + } else if (ref) { + xbegin = allocate(aalloc); + if (QTypeInfo::isComplex) { + xsize = 0; + } else { + ::memcpy(xbegin, m_begin, qMin(aalloc, xalloc) * sizeof(T)); + xsize = m_size; + } + changed = true; + } else { + QT_TRY { + QVectorData *mem = QVectorData::reallocate( + toBase(m_begin), sizeOfTypedData() + (aalloc - 1) * sizeof(T), + sizeOfTypedData() ++ (xalloc - 1) * sizeof(T), alignOfTypedData()); + Q_CHECK_PTR(mem); + xbegin = fromBase(mem); + xsize = m_size; + } QT_CATCH (const std::bad_alloc &) { + if (aalloc > xalloc) // ignore the error in case we are just shrinking. + QT_RETHROW; + } + } + xalloc = aalloc; + } + + if (QTypeInfo::isComplex) { + QT_TRY { + T *pOld = m_begin + xsize; + T *pNew = xbegin + xsize; + // copy objects from the old array into the new array + while (xsize < qMin(asize, m_size)) { + new (pNew++) T(*pOld++); + ++xsize; + } + // construct all new objects when growing + while (xsize < asize) { + new (pNew++) T; + ++xsize; + } + } QT_CATCH (...) { + free(xbegin, xsize); + QT_RETHROW; + } + + } else if (asize > xsize) { + // initialize newly allocated memory to 0 + qMemSet(xbegin + xsize, 0, (asize - xsize) * sizeof(T)); + } + xsize = asize; + + if (changed) { + if (!ref) + free(m_begin, m_size); + } + m_alloc = xalloc; + m_size = xsize; + m_begin = xbegin; +} + +template +Q_OUTOFLINE_TEMPLATE T QRawVector::value(int i) const +{ + return (i < 0 || i >= m_size) ? T() : m_begin[i]; +} +template +Q_OUTOFLINE_TEMPLATE T QRawVector::value(int i, const T &defaultValue) const +{ + return (i < 0 || i >= m_size) ? defaultValue : m_begin[i]; +} + +template +void QRawVector::append(const T &t) +{ + if (m_size + 1 > m_alloc) { + const T copy(t); + realloc(m_size, QVectorData::grow(sizeOfTypedData(), m_size + 1, sizeof(T), + QTypeInfo::isStatic), false); + if (QTypeInfo::isComplex) + new (m_begin + m_size) T(copy); + else + m_begin[m_size] = copy; + } else { + if (QTypeInfo::isComplex) + new (m_begin + m_size) T(t); + else + m_begin[m_size] = t; + } + ++m_size; +} + +template +Q_TYPENAME QRawVector::iterator QRawVector::insert(iterator before, size_type n, const T &t) +{ + int offset = int(before - m_begin); + if (n != 0) { + const T copy(t); + if (m_size + n > m_alloc) + realloc(m_size, QVectorData::grow(sizeOfTypedData(), m_size + n, sizeof(T), + QTypeInfo::isStatic), false); + if (QTypeInfo::isStatic) { + T *b = m_begin + m_size; + T *i = m_begin + m_size + n; + while (i != b) + new (--i) T; + i = m_begin + m_size; + T *j = i + n; + b = m_begin + offset; + while (i != b) + *--j = *--i; + i = b+n; + while (i != b) + *--i = copy; + } else { + T *b = m_begin + offset; + T *i = b + n; + memmove(i, b, (m_size - offset) * sizeof(T)); + while (i != b) + new (--i) T(copy); + } + m_size += n; + } + return m_begin + offset; +} + +template +Q_TYPENAME QRawVector::iterator QRawVector::erase(iterator abegin, iterator aend) +{ + int f = int(abegin - m_begin); + int l = int(aend - m_begin); + int n = l - f; + if (QTypeInfo::isComplex) { + qCopy(m_begin + l, m_begin + m_size, m_begin + f); + T *i = m_begin + m_size; + T *b = m_begin + m_size - n; + while (i != b) { + --i; + i->~T(); + } + } else { + memmove(m_begin + f, m_begin + l, (m_size - l) * sizeof(T)); + } + m_size -= n; + return m_begin + f; +} + +template +bool QRawVector::operator==(const QRawVector &v) const +{ + if (m_size != v.m_size) + return false; + T* b = m_begin; + T* i = b + m_size; + T* j = v.m_begin + m_size; + while (i != b) + if (!(*--i == *--j)) + return false; + return true; +} + +template +QRawVector &QRawVector::fill(const T &from, int asize) +{ + const T copy(from); + resize(asize < 0 ? m_size : asize); + if (m_size) { + T *i = m_begin + m_size; + T *b = m_begin; + while (i != b) + *--i = copy; + } + return *this; +} + +template +QRawVector &QRawVector::operator+=(const QRawVector &l) +{ + int newSize = m_size + l.m_size; + realloc(m_size, newSize, false); + + T *w = m_begin + newSize; + T *i = l.m_begin + l.m_size; + T *b = l.m_begin; + while (i != b) { + if (QTypeInfo::isComplex) + new (--w) T(*--i); + else + *--w = *--i; + } + m_size = newSize; + return *this; +} + +template +int QRawVector::indexOf(const T &t, int from) const +{ + if (from < 0) + from = qMax(from + m_size, 0); + if (from < m_size) { + T* n = m_begin + from - 1; + T* e = m_begin + m_size; + while (++n != e) + if (*n == t) + return n - m_begin; + } + return -1; +} + +template +int QRawVector::lastIndexOf(const T &t, int from) const +{ + if (from < 0) + from += m_size; + else if (from >= m_size) + from = m_size-1; + if (from >= 0) { + T* b = m_begin; + T* n = m_begin + from + 1; + while (n != b) { + if (*--n == t) + return n - b; + } + } + return -1; +} + +template +bool QRawVector::contains(const T &t) const +{ + T* b = m_begin; + T* i = m_begin + m_size; + while (i != b) + if (*--i == t) + return true; + return false; +} + +template +int QRawVector::count(const T &t) const +{ + int c = 0; + T* b = m_begin; + T* i = m_begin + m_size; + while (i != b) + if (*--i == t) + ++c; + return c; +} + +template +Q_OUTOFLINE_TEMPLATE QRawVector QRawVector::mid(int pos, int length) const +{ + if (length < 0) + length = size() - pos; + if (pos == 0 && length == size()) + return *this; + QRawVector copy; + if (pos + length > size()) + length = size() - pos; + for (int i = pos; i < pos + length; ++i) + copy += at(i); + return copy; +} + +template +Q_OUTOFLINE_TEMPLATE QList QRawVector::toList() const +{ + QList result; + for (int i = 0; i < size(); ++i) + result.append(at(i)); + return result; +} + + +/*template +Q_OUTOFLINE_TEMPLATE QRawVector QList::toVector() const +{ + QRawVector result(size()); + for (int i = 0; i < size(); ++i) + result[i] = at(i); + return result; +} + +template +QRawVector QRawVector::fromList(const QList &list) +{ + return list.toVector(); +} + +template +QList QList::fromVector(const QRawVector &vector) +{ + return vector.toList(); +} +*/ + +Q_DECLARE_SEQUENTIAL_ITERATOR(RawVector) +Q_DECLARE_MUTABLE_SEQUENTIAL_ITERATOR(RawVector) + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QRAWVECTOR_H diff --git a/tests/benchmarks/qvector/qvector.pro b/tests/benchmarks/qvector/qvector.pro new file mode 100644 index 0000000..adb30c9 --- /dev/null +++ b/tests/benchmarks/qvector/qvector.pro @@ -0,0 +1,6 @@ +load(qttest_p4) +TARGET = tst_vector +QT = core +INCLUDEPATH += . +SOURCES += main.cpp outofline.cpp outofline2.cpp +CONFIG += release -- cgit v0.12 From 079f090ffbb9af349b376d3a080304228eab43e6 Mon Sep 17 00:00:00 2001 From: ck Date: Thu, 19 Nov 2009 16:14:54 +0100 Subject: Assistant: Check qch files for update. We install watchers on the current collection's help files and react accordingly when they are deleted or replaced. Note that this has no effect on Windows, because opened files cannot be written or deleted by another application. Task-number: QTBUG-2348 Reviewed-by: kh1 --- tools/assistant/tools/assistant/mainwindow.cpp | 57 +++++++++++++++++++--- tools/assistant/tools/assistant/mainwindow.h | 3 ++ .../tools/assistant/preferencesdialog.cpp | 22 ++++++--- .../assistant/tools/assistant/preferencesdialog.h | 5 +- tools/assistant/tools/assistant/qtdocinstaller.cpp | 18 +++++-- tools/assistant/tools/assistant/qtdocinstaller.h | 4 +- tools/assistant/tools/assistant/remotecontrol.cpp | 22 ++++++--- tools/assistant/tools/assistant/remotecontrol.h | 5 +- 8 files changed, 112 insertions(+), 24 deletions(-) diff --git a/tools/assistant/tools/assistant/mainwindow.cpp b/tools/assistant/tools/assistant/mainwindow.cpp index bc8b86f..9a2a5bd 100644 --- a/tools/assistant/tools/assistant/mainwindow.cpp +++ b/tools/assistant/tools/assistant/mainwindow.cpp @@ -57,6 +57,7 @@ #include #include #include +#include #include #include #include @@ -93,6 +94,7 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent) , m_cmdLine(cmdLine) , m_progressWidget(0) , m_qtDocInstaller(0) + , m_qchWatcher(new QFileSystemWatcher(this)) , m_connectedInitSignals(false) { setToolButtonStyle(Qt::ToolButtonFollowStyle); @@ -198,7 +200,7 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent) QTimer::singleShot(0, this, SLOT(insertLastPages())); if (m_cmdLine->enableRemoteControl()) - (void)new RemoteControl(this, m_helpEngine); + (void)new RemoteControl(this, m_helpEngine, m_qchWatcher); if (m_cmdLine->contents() == CmdLineParser::Show) showContents(); @@ -237,6 +239,13 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent) QTimer::singleShot(0, this, SLOT(lookForNewQtDocumentation())); else checkInitState(); + + foreach(const QString &ns, m_helpEngine->registeredDocumentations()) { + const QString &docFile = m_helpEngine->documentationFileName(ns); + m_qchWatcher->addPath(docFile); + connect(m_qchWatcher, SIGNAL(fileChanged(QString)), this, + SLOT(qchFileChanged(QString))); + } } setTabPosition(Qt::AllDockWidgetAreas, QTabWidget::North); } @@ -297,8 +306,11 @@ bool MainWindow::initHelpDB() } QHelpEngineCore hc(fi.absoluteFilePath()); hc.setupData(); - hc.unregisterDocumentation(intern); - hc.registerDocumentation(helpFile); + const QString internalFile = hc.documentationFileName(intern); + if (hc.unregisterDocumentation(intern)) + m_qchWatcher->removePath(internalFile); + if (hc.registerDocumentation(helpFile)) + m_qchWatcher->addPath(helpFile); needsSetup = true; } @@ -317,14 +329,18 @@ bool MainWindow::initHelpDB() needsSetup = true; } - if (needsSetup) + if (needsSetup) { m_helpEngine->setupData(); + Q_ASSERT(m_qchWatcher->files().count() + == m_helpEngine->registeredDocumentations().count()); + } return true; } void MainWindow::lookForNewQtDocumentation() { - m_qtDocInstaller = new QtDocInstaller(m_helpEngine->collectionFile()); + m_qtDocInstaller = + new QtDocInstaller(m_helpEngine->collectionFile(), m_qchWatcher); connect(m_qtDocInstaller, SIGNAL(errorMessage(QString)), this, SLOT(displayInstallationError(QString))); connect(m_qtDocInstaller, SIGNAL(docsInstalled(bool)), this, @@ -783,7 +799,7 @@ void MainWindow::showTopicChooser(const QMap &links, void MainWindow::showPreferences() { - PreferencesDialog dia(m_helpEngine, this); + PreferencesDialog dia(m_helpEngine, m_qchWatcher, this); connect(&dia, SIGNAL(updateApplicationFont()), this, SLOT(updateApplicationFont())); @@ -1125,4 +1141,33 @@ void MainWindow::currentFilterChanged(const QString &filter) m_filterCombo->setCurrentIndex(index); } +void MainWindow::qchFileChanged(const QString &fileName) +{ + /* + * We don't use QHelpEngineCore::namespaceName(fileName), because the file + * may not exist anymore or contain a different namespace. + */ + QString ns; + foreach (const QString &curNs, m_helpEngine->registeredDocumentations()) { + if (m_helpEngine->documentationFileName(curNs) == fileName) { + ns = curNs; + break; + } + } + + /* + * We can't do an assertion here, because QFileSystemWatcher may send the + * signal more than once. + */ + if (ns.isEmpty()) + return; + + CentralWidget* widget = CentralWidget::instance(); + widget->closeTabs(widget->currentSourceFileList().keys(ns)); + if (m_helpEngine->unregisterDocumentation(ns) && + (!QFileInfo(fileName).exists() + || !m_helpEngine->registerDocumentation(fileName))) + m_qchWatcher->removePath(fileName); +} + QT_END_NAMESPACE diff --git a/tools/assistant/tools/assistant/mainwindow.h b/tools/assistant/tools/assistant/mainwindow.h index 96daf99..6a0ab58 100644 --- a/tools/assistant/tools/assistant/mainwindow.h +++ b/tools/assistant/tools/assistant/mainwindow.h @@ -48,6 +48,7 @@ QT_BEGIN_NAMESPACE class QAction; +class QFileSystemWatcher; class QLineEdit; class QComboBox; class QMenu; @@ -119,6 +120,7 @@ private slots: void displayInstallationError(const QString &errorMessage); void qtDocumentationInstalled(bool newDocsInstalled); void checkInitState(); + void qchFileChanged(const QString &fileName); void updateBookmarkMenu(); void showBookmark(QAction *action); @@ -177,6 +179,7 @@ private: QWidget *m_progressWidget; QtDocInstaller *m_qtDocInstaller; + QFileSystemWatcher * const m_qchWatcher; bool m_connectedInitSignals; }; diff --git a/tools/assistant/tools/assistant/preferencesdialog.cpp b/tools/assistant/tools/assistant/preferencesdialog.cpp index 2aa451e..d63c109 100644 --- a/tools/assistant/tools/assistant/preferencesdialog.cpp +++ b/tools/assistant/tools/assistant/preferencesdialog.cpp @@ -46,7 +46,8 @@ #include "centralwidget.h" #include "aboutdialog.h" -#include +#include +#include #include #include @@ -60,11 +61,13 @@ QT_BEGIN_NAMESPACE -PreferencesDialog::PreferencesDialog(QHelpEngineCore *helpEngine, QWidget *parent) +PreferencesDialog::PreferencesDialog(QHelpEngineCore *helpEngine, + QFileSystemWatcher *qchWatcher, QWidget *parent) : QDialog(parent) , m_helpEngine(helpEngine) , m_appFontChanged(false) , m_browserFontChanged(false) + , m_qchWatcher(qchWatcher) { m_ui.setupUi(this); @@ -275,7 +278,11 @@ void PreferencesDialog::addDocumentationLocal() continue; } - m_helpEngine->registerDocumentation(fileName); + if (m_helpEngine->registerDocumentation(fileName)) { + m_qchWatcher->addPath(fileName); + Q_ASSERT(m_qchWatcher->files().count() + == m_helpEngine->registeredDocumentations().count()); + } m_ui.registeredDocsListWidget->addItem(nameSpace); m_regDocs.append(nameSpace); m_unregDocs.removeAll(nameSpace); @@ -380,10 +387,13 @@ void PreferencesDialog::applyChanges() CentralWidget::instance()->closeTabs(m_TabsToClose); - if (m_unregDocs.count()) { - foreach (const QString &doc, m_unregDocs) - m_helpEngine->unregisterDocumentation(doc); + foreach (const QString &doc, m_unregDocs) { + const QString docFile = m_helpEngine->documentationFileName(doc); + if (m_helpEngine->unregisterDocumentation(doc)) + m_qchWatcher->removePath(docFile); } + Q_ASSERT(m_qchWatcher->files().count() + == m_helpEngine->registeredDocumentations().count()); if (filtersWereChanged || m_regDocs.count() || m_unregDocs.count()) m_helpEngine->setupData(); diff --git a/tools/assistant/tools/assistant/preferencesdialog.h b/tools/assistant/tools/assistant/preferencesdialog.h index c9d56ba..7abf431 100644 --- a/tools/assistant/tools/assistant/preferencesdialog.h +++ b/tools/assistant/tools/assistant/preferencesdialog.h @@ -48,6 +48,7 @@ QT_BEGIN_NAMESPACE class FontPanel; +class QFileSystemWatcher; class QHelpEngineCore; enum { @@ -61,7 +62,8 @@ class PreferencesDialog : public QDialog Q_OBJECT public: - PreferencesDialog(QHelpEngineCore *helpEngine, QWidget *parent = 0); + PreferencesDialog(QHelpEngineCore *helpEngine, + QFileSystemWatcher *qchWatcher, QWidget *parent = 0); ~PreferencesDialog(); void showDialog(); @@ -107,6 +109,7 @@ private: FontPanel *m_browserFontPanel; bool m_appFontChanged; bool m_browserFontChanged; + QFileSystemWatcher * const m_qchWatcher; }; QT_END_NAMESPACE diff --git a/tools/assistant/tools/assistant/qtdocinstaller.cpp b/tools/assistant/tools/assistant/qtdocinstaller.cpp index b37e588..42085cb 100644 --- a/tools/assistant/tools/assistant/qtdocinstaller.cpp +++ b/tools/assistant/tools/assistant/qtdocinstaller.cpp @@ -42,12 +42,15 @@ #include #include #include +#include #include #include "qtdocinstaller.h" QT_BEGIN_NAMESPACE -QtDocInstaller::QtDocInstaller(const QString &collectionFile) +QtDocInstaller::QtDocInstaller(const QString &collectionFile, + QFileSystemWatcher *qchWatcher) + : m_qchWatcher(qchWatcher) { m_abort = false; m_collectionFile = collectionFile; @@ -131,15 +134,24 @@ bool QtDocInstaller::installDoc(const QString &name, QHelpEngineCore *helpEngine if (namespaceName.isEmpty()) continue; - if (helpEngine->registeredDocumentations().contains(namespaceName)) - helpEngine->unregisterDocumentation(namespaceName); + if (helpEngine->registeredDocumentations().contains(namespaceName)) { + const QString docFile = + helpEngine->documentationFileName(namespaceName); + if (helpEngine->unregisterDocumentation(namespaceName)) + m_qchWatcher->removePath(docFile); + } if (!helpEngine->registerDocumentation(fi.absoluteFilePath())) { emit errorMessage( tr("The file %1 could not be registered successfully!\n\nReason: %2") .arg(fi.absoluteFilePath()).arg(helpEngine->error())); + } else { + m_qchWatcher->addPath(fi.absoluteFilePath()); } + Q_ASSERT(m_qchWatcher->files().count() + == helpEngine->registeredDocumentations().count()); + helpEngine->setCustomValue(versionKey, fi.lastModified().toString(Qt::ISODate) + QLatin1String("|") + fi.absoluteFilePath()); return true; diff --git a/tools/assistant/tools/assistant/qtdocinstaller.h b/tools/assistant/tools/assistant/qtdocinstaller.h index 987272b..0d503fd 100644 --- a/tools/assistant/tools/assistant/qtdocinstaller.h +++ b/tools/assistant/tools/assistant/qtdocinstaller.h @@ -47,6 +47,7 @@ QT_BEGIN_NAMESPACE +class QFileSystemWatcher; class QHelpEngineCore; class QtDocInstaller : public QThread @@ -54,7 +55,7 @@ class QtDocInstaller : public QThread Q_OBJECT public: - QtDocInstaller(const QString &collectionFile); + QtDocInstaller(const QString &collectionFile, QFileSystemWatcher *qchWatcher); ~QtDocInstaller(); void installDocs(); @@ -70,6 +71,7 @@ private: bool m_abort; QString m_collectionFile; QMutex m_mutex; + QFileSystemWatcher * const m_qchWatcher; }; QT_END_NAMESPACE diff --git a/tools/assistant/tools/assistant/remotecontrol.cpp b/tools/assistant/tools/assistant/remotecontrol.cpp index 0ccf743..3c123d6 100644 --- a/tools/assistant/tools/assistant/remotecontrol.cpp +++ b/tools/assistant/tools/assistant/remotecontrol.cpp @@ -45,6 +45,7 @@ #include #include +#include #include #include #include @@ -105,7 +106,8 @@ void StdInListenerWin::run() } #endif -RemoteControl::RemoteControl(MainWindow *mainWindow, QHelpEngine *helpEngine) +RemoteControl::RemoteControl(MainWindow *mainWindow, QHelpEngine *helpEngine, + QFileSystemWatcher *qchWatcher) : QObject(mainWindow) , m_mainWindow(mainWindow) , m_helpEngine(helpEngine) @@ -113,6 +115,7 @@ RemoteControl::RemoteControl(MainWindow *mainWindow, QHelpEngine *helpEngine) , m_caching(true) , m_syncContents(false) , m_expandTOC(-2) + , m_qchWatcher(qchWatcher) { connect(m_mainWindow, SIGNAL(initDone()), this, SLOT(applyCache())); @@ -293,10 +296,14 @@ void RemoteControl::handleRegisterCommand(const QString &arg) { const QString &absFileName = QFileInfo(arg).absoluteFilePath(); if (m_helpEngine->registeredDocumentations(). - contains(QHelpEngineCore::namespaceName(absFileName))) + contains(QHelpEngineCore::namespaceName(absFileName))) return; - m_helpEngine->registerDocumentation(absFileName); - m_helpEngine->setupData(); + if (m_helpEngine->registerDocumentation(absFileName)) { + m_qchWatcher->addPath(absFileName); + m_helpEngine->setupData(); + Q_ASSERT(m_qchWatcher->files().count() + == m_helpEngine->registeredDocumentations().count()); + } } void RemoteControl::handleUnregisterCommand(const QString &arg) @@ -306,8 +313,11 @@ void RemoteControl::handleUnregisterCommand(const QString &arg) if (m_helpEngine->registeredDocumentations().contains(ns)) { CentralWidget* widget = CentralWidget::instance(); widget->closeTabs(widget->currentSourceFileList().keys(ns)); - m_helpEngine->unregisterDocumentation(ns); - m_helpEngine->setupData(); + const QString docFile = m_helpEngine->documentationFileName(ns); + if (m_helpEngine->unregisterDocumentation(ns)) { + m_qchWatcher->removePath(docFile); + m_helpEngine->setupData(); + } } } diff --git a/tools/assistant/tools/assistant/remotecontrol.h b/tools/assistant/tools/assistant/remotecontrol.h index c1c3105..6f7eb5f 100644 --- a/tools/assistant/tools/assistant/remotecontrol.h +++ b/tools/assistant/tools/assistant/remotecontrol.h @@ -49,6 +49,7 @@ QT_BEGIN_NAMESPACE class MainWindow; +class QFileSystemWatcher; class QHelpEngine; class RemoteControl : public QObject @@ -56,7 +57,8 @@ class RemoteControl : public QObject Q_OBJECT public: - RemoteControl(MainWindow *mainWindow, QHelpEngine *helpEngine); + RemoteControl(MainWindow *mainWindow, QHelpEngine *helpEngine, + QFileSystemWatcher *qchWatcher); private slots: void receivedData(); @@ -89,6 +91,7 @@ private: QString m_activateIdentifier; int m_expandTOC; QString m_currentFilter; + QFileSystemWatcher * const m_qchWatcher; }; QT_END_NAMESPACE -- cgit v0.12 From af651b725ea2a666bff20a749d40549820a62050 Mon Sep 17 00:00:00 2001 From: ck Date: Mon, 23 Nov 2009 11:39:00 +0100 Subject: Assistant: Add dedicated class for access to custom values. Reviewed-by: kh1 --- tools/assistant/tools/assistant/assistant.pro | 115 +++-- .../assistant/tools/assistant/bookmarkmanager.cpp | 6 +- tools/assistant/tools/assistant/centralwidget.cpp | 78 ++-- tools/assistant/tools/assistant/helpviewer.cpp | 35 +- tools/assistant/tools/assistant/main.cpp | 97 +--- tools/assistant/tools/assistant/mainwindow.cpp | 68 ++- .../tools/assistant/preferencesdialog.cpp | 86 ++-- tools/assistant/tools/assistant/qtdocinstaller.cpp | 20 +- .../assistant/tools/qcollectiongenerator/main.cpp | 50 +- .../qcollectiongenerator/qcollectiongenerator.pro | 19 +- .../tools/shared/collectionconfiguration.cpp | 509 +++++++++++++++++++++ .../tools/shared/collectionconfiguration.h | 198 ++++++++ 12 files changed, 929 insertions(+), 352 deletions(-) create mode 100644 tools/assistant/tools/shared/collectionconfiguration.cpp create mode 100644 tools/assistant/tools/shared/collectionconfiguration.h diff --git a/tools/assistant/tools/assistant/assistant.pro b/tools/assistant/tools/assistant/assistant.pro index 4b69060..81677c3 100644 --- a/tools/assistant/tools/assistant/assistant.pro +++ b/tools/assistant/tools/assistant/assistant.pro @@ -1,88 +1,75 @@ include($$QT_SOURCE_TREE/tools/shared/fontpanel/fontpanel.pri) - TEMPLATE = app LANGUAGE = C++ TARGET = assistant - -contains(QT_CONFIG, webkit) { - QT += webkit -} - -CONFIG += qt warn_on help - +contains(QT_CONFIG, webkit):QT += webkit +CONFIG += qt \ + warn_on \ + help QT += network - PROJECTNAME = Assistant DESTDIR = ../../../../bin - -target.path=$$[QT_INSTALL_BINS] +target.path = $$[QT_INSTALL_BINS] INSTALLS += target -### Work around a qmake issue when statically linking to -### not-yet-installed plugins +# ## Work around a qmake issue when statically linking to +# ## not-yet-installed plugins LIBS += -L$$QT_BUILD_TREE/plugins/sqldrivers - HEADERS += helpviewer.h \ - mainwindow.h \ - indexwindow.h \ - topicchooser.h \ - contentwindow.h \ - searchwidget.h \ - preferencesdialog.h \ - filternamedialog.h \ - centralwidget.h \ - installdialog.h \ - bookmarkmanager.h \ - remotecontrol.h \ - cmdlineparser.h \ - aboutdialog.h \ - qtdocinstaller.h \ - xbelsupport.h - -win32 { - HEADERS += remotecontrol_win.h -} - + mainwindow.h \ + indexwindow.h \ + topicchooser.h \ + contentwindow.h \ + searchwidget.h \ + preferencesdialog.h \ + filternamedialog.h \ + centralwidget.h \ + installdialog.h \ + bookmarkmanager.h \ + remotecontrol.h \ + cmdlineparser.h \ + aboutdialog.h \ + qtdocinstaller.h \ + xbelsupport.h \ + ../shared/collectionconfiguration.h +win32:HEADERS += remotecontrol_win.h SOURCES += helpviewer.cpp \ - main.cpp \ - mainwindow.cpp \ - indexwindow.cpp \ - topicchooser.cpp \ - contentwindow.cpp \ - searchwidget.cpp \ - preferencesdialog.cpp \ - filternamedialog.cpp \ - centralwidget.cpp \ - installdialog.cpp \ - bookmarkmanager.cpp \ - remotecontrol.cpp \ - cmdlineparser.cpp \ - aboutdialog.cpp \ - qtdocinstaller.cpp \ - xbelsupport.cpp - + main.cpp \ + mainwindow.cpp \ + indexwindow.cpp \ + topicchooser.cpp \ + contentwindow.cpp \ + searchwidget.cpp \ + preferencesdialog.cpp \ + filternamedialog.cpp \ + centralwidget.cpp \ + installdialog.cpp \ + bookmarkmanager.cpp \ + remotecontrol.cpp \ + cmdlineparser.cpp \ + aboutdialog.cpp \ + qtdocinstaller.cpp \ + xbelsupport.cpp \ + ../shared/collectionconfiguration.cpp FORMS += topicchooser.ui \ - preferencesdialog.ui \ - filternamedialog.ui \ - installdialog.ui \ - bookmarkdialog.ui - -RESOURCES += assistant.qrc assistant_images.qrc - -win32 { + preferencesdialog.ui \ + filternamedialog.ui \ + installdialog.ui \ + bookmarkdialog.ui +RESOURCES += assistant.qrc \ + assistant_images.qrc +win32 { !wince*:LIBS += -lshell32 RC_FILE = assistant.rc } - -mac { +mac { ICON = assistant.icns TARGET = Assistant QMAKE_INFO_PLIST = Info_mac.plist } - -contains(CONFIG, static): { +contains(CONFIG, static): { SQLPLUGINS = $$unique(sql-plugins) - contains(SQLPLUGINS, sqlite): { + contains(SQLPLUGINS, sqlite): { QTPLUGIN += qsqlite DEFINES += USE_STATIC_SQLITE_PLUGIN } diff --git a/tools/assistant/tools/assistant/bookmarkmanager.cpp b/tools/assistant/tools/assistant/bookmarkmanager.cpp index 7c7029a..03fff96 100644 --- a/tools/assistant/tools/assistant/bookmarkmanager.cpp +++ b/tools/assistant/tools/assistant/bookmarkmanager.cpp @@ -41,6 +41,7 @@ #include "bookmarkmanager.h" #include "centralwidget.h" +#include "../shared/collectionconfiguration.h" #include #include @@ -662,7 +663,7 @@ void BookmarkManager::saveBookmarks() QDataStream stream(&bookmarks, QIODevice::WriteOnly); readBookmarksRecursive(treeModel->invisibleRootItem(), stream, 0); - helpEngine->setCustomValue(QLatin1String("Bookmarks"), bookmarks); + CollectionConfiguration::setBookmarks(*helpEngine, bookmarks); } QStringList BookmarkManager::bookmarkFolders() const @@ -814,8 +815,7 @@ void BookmarkManager::setupBookmarkModels() QList lastDepths; QList parents; - QByteArray ba = - helpEngine->customValue(QLatin1String("Bookmarks")).toByteArray(); + QByteArray ba = CollectionConfiguration::bookmarks(*helpEngine); QDataStream stream(ba); while (!stream.atEnd()) { stream >> depth >> name >> type >> expanded; diff --git a/tools/assistant/tools/assistant/centralwidget.cpp b/tools/assistant/tools/assistant/centralwidget.cpp index 1c62954..f8b8c44 100644 --- a/tools/assistant/tools/assistant/centralwidget.cpp +++ b/tools/assistant/tools/assistant/centralwidget.cpp @@ -44,6 +44,7 @@ #include "searchwidget.h" #include "mainwindow.h" #include "preferencesdialog.h" +#include "../shared/collectionconfiguration.h" #include #include @@ -296,28 +297,23 @@ CentralWidget::~CentralWidget() if (!engine.setupData()) return; - QString zoomCount; - QString currentPages; - QLatin1Char separator('|'); + QStringList zoomFactors; + QStringList currentPages; bool searchAttached = m_searchWidget->isAttached(); int i = searchAttached ? 1 : 0; for (; i < tabWidget->count(); ++i) { HelpViewer *viewer = qobject_cast(tabWidget->widget(i)); if (viewer && viewer->source().isValid()) { - currentPages += viewer->source().toString() + separator; - zoomCount += QString::number(viewer->zoom()) + separator; + currentPages << viewer->source().toString(); + zoomFactors << QString::number(viewer->zoom()); } } - engine.setCustomValue(QLatin1String("LastTabPage"), lastTabPage); - engine.setCustomValue(QLatin1String("LastShownPages"), currentPages); - engine.setCustomValue(QLatin1String("SearchWasAttached"), searchAttached); -#if !defined(QT_NO_WEBKIT) - engine.setCustomValue(QLatin1String("LastPagesZoomWebView"), zoomCount); -#else - engine.setCustomValue(QLatin1String("LastPagesZoomTextBrowser"), zoomCount); -#endif + CollectionConfiguration::setLastTabPage(engine, lastTabPage); + CollectionConfiguration::setLastShownPages(engine, currentPages); + CollectionConfiguration::setSearchWasAttached(engine, searchAttached); + CollectionConfiguration::setLastZoomFactors(engine, zoomFactors); } CentralWidget *CentralWidget::instance() @@ -427,16 +423,14 @@ void CentralWidget::setSource(const QUrl &url) void CentralWidget::setupWidget() { - int option = helpEngine->customValue(QLatin1String("StartOption"), - ShowLastPages).toInt(); - + int option = CollectionConfiguration::startOption(*helpEngine); if (option != ShowLastPages) { QString homePage; if (option == ShowHomePage) { - homePage = helpEngine->customValue(QLatin1String("defaultHomepage"), - QLatin1String("help")).toString(); - homePage = helpEngine->customValue(QLatin1String("homepage"), - homePage).toString(); + // TODO: Can this fall-back logic go into the wrapper class? + homePage = CollectionConfiguration::homePage(*helpEngine); + if (homePage.isEmpty()) + homePage = CollectionConfiguration::defaultHomePage(*helpEngine); } if (option == ShowBlankPage) homePage = QLatin1String("about:blank"); @@ -448,11 +442,8 @@ void CentralWidget::setupWidget() void CentralWidget::setLastShownPages() { - const QLatin1String key("LastShownPages"); - QString value = helpEngine->customValue(key, QString()).toString(); - const QStringList lastShownPageList = value.split(QLatin1Char('|'), - QString::SkipEmptyParts); - + const QStringList lastShownPageList = + CollectionConfiguration::lastShownPages(*helpEngine); const int pageCount = lastShownPageList.count(); if (pageCount == 0) { if (usesDefaultCollection) @@ -462,37 +453,27 @@ void CentralWidget::setLastShownPages() return; } -#if !defined(QT_NO_WEBKIT) - const QLatin1String zoom("LastPagesZoomWebView"); -#else - const QLatin1String zoom("LastPagesZoomTextBrowser"); -#endif - - value = helpEngine->customValue(zoom, QString()).toString(); - QVector zoomVector = value.split(QLatin1Char('|'), - QString::SkipEmptyParts).toVector(); - - const int zoomCount = zoomVector.count(); - zoomVector.insert(zoomCount, pageCount - zoomCount, QLatin1String("0.0")); + QStringList zoomFactors = + CollectionConfiguration::lastZoomFactors(*helpEngine); + while (zoomFactors.count() < pageCount) + zoomFactors.append(CollectionConfiguration::DefaultZoomFactor); - QVector::const_iterator zIt = zoomVector.constBegin(); + QStringList::const_iterator zIt = zoomFactors.constBegin(); QStringList::const_iterator it = lastShownPageList.constBegin(); for (; it != lastShownPageList.constEnd(); ++it, ++zIt) setSourceInNewTab((*it), (*zIt).toFloat()); - const QLatin1String lastTab("LastTabPage"); - int tab = helpEngine->customValue(lastTab, 1).toInt(); + int tab = CollectionConfiguration::lastTabPage(*helpEngine); - const QLatin1String searchKey("SearchWasAttached"); const bool searchIsAttached = m_searchWidget->isAttached(); - const bool searchWasAttached = helpEngine->customValue(searchKey).toBool(); + const bool searchWasAttached = + CollectionConfiguration::searchWasAttached(*helpEngine); if (searchWasAttached && !searchIsAttached) - tabWidget->setCurrentIndex(--tab); + --tab; else if (!searchWasAttached && searchIsAttached) - tabWidget->setCurrentIndex(++tab); - else - tabWidget->setCurrentIndex(tab); + ++tab; + tabWidget->setCurrentIndex(tab); } bool CentralWidget::hasSelection() const @@ -1174,7 +1155,7 @@ QMap CentralWidget::currentSourceFileList() const void CentralWidget::getBrowserFontFor(QWidget *viewer, QFont *font) { const QLatin1String key("useBrowserFont"); - if (!helpEngine->customValue(key, false).toBool()) { + if (!CollectionConfiguration::usesBrowserFont(*helpEngine)) { *font = qApp->font(); // case for QTextBrowser and SearchWidget #if !defined(QT_NO_WEBKIT) QWebView *view = qobject_cast (viewer); @@ -1185,8 +1166,7 @@ void CentralWidget::getBrowserFontFor(QWidget *viewer, QFont *font) } #endif } else { - *font = qVariantValue(helpEngine->customValue( - QLatin1String("browserFont"))); + *font = CollectionConfiguration::browserFont(*helpEngine); } } diff --git a/tools/assistant/tools/assistant/helpviewer.cpp b/tools/assistant/tools/assistant/helpviewer.cpp index 157f5ab..4b81d99 100644 --- a/tools/assistant/tools/assistant/helpviewer.cpp +++ b/tools/assistant/tools/assistant/helpviewer.cpp @@ -41,6 +41,7 @@ #include "helpviewer.h" #include "centralwidget.h" +#include "../shared/collectionconfiguration.h" #include #include @@ -333,19 +334,6 @@ void HelpViewer::zoomOut(qreal range) setTextSizeMultiplier(qMax(0.0, textSizeMultiplier() - range / 10.0)); } -void HelpViewer::home() -{ - QString homepage = helpEngine->customValue(QLatin1String("homepage"), - QLatin1String("")).toString(); - - if (homepage.isEmpty()) { - homepage = helpEngine->customValue(QLatin1String("defaultHomepage"), - QLatin1String("help")).toString(); - } - - setSource(homepage); -} - void HelpViewer::wheelEvent(QWheelEvent *e) { if (e->modifiers() & Qt::ControlModifier) { @@ -603,19 +591,6 @@ void HelpViewer::keyPressEvent(QKeyEvent *e) QTextBrowser::keyPressEvent(e); } -void HelpViewer::home() -{ - QString homepage = helpEngine->customValue(QLatin1String("homepage"), - QLatin1String("")).toString(); - - if (homepage.isEmpty()) { - homepage = helpEngine->customValue(QLatin1String("defaultHomepage"), - QLatin1String("help")).toString(); - } - - setSource(homepage); -} - void HelpViewer::wheelEvent(QWheelEvent *e) { if (e->modifiers() == Qt::CTRL) { @@ -629,4 +604,12 @@ void HelpViewer::wheelEvent(QWheelEvent *e) #endif // !defined(QT_NO_WEBKIT) +void HelpViewer::home() +{ + QString homePage = CollectionConfiguration::homePage(*helpEngine); + if (homePage.isEmpty()) + homePage = CollectionConfiguration::defaultHomePage(*helpEngine); + setSource(homePage); +} + QT_END_NAMESPACE diff --git a/tools/assistant/tools/assistant/main.cpp b/tools/assistant/tools/assistant/main.cpp index a5a9ef5..e259d4f 100644 --- a/tools/assistant/tools/assistant/main.cpp +++ b/tools/assistant/tools/assistant/main.cpp @@ -56,6 +56,7 @@ #include +#include "../shared/collectionconfiguration.h" #include "mainwindow.h" #include "cmdlineparser.h" @@ -71,94 +72,33 @@ namespace { void updateLastPagesOnUnregister(QHelpEngineCore& helpEngine, const QString& nsName) { - int lastPage = helpEngine.customValue(QLatin1String("LastTabPage")).toInt(); - - QLatin1String sep("|"); - QLatin1String pages("LastShownPages"); -#if !defined(QT_NO_WEBKIT) - QLatin1String zoom("LastPagesZoomWebView"); -#else - QLatin1String zoom("LastPagesZoomTextBrowser"); -#endif - - QStringList currentPages = - helpEngine.customValue(pages).toString(). - split(QLatin1Char('|'), QString::SkipEmptyParts); - + int lastPage = CollectionConfiguration::lastTabPage(helpEngine); + QStringList currentPages = CollectionConfiguration::lastShownPages(helpEngine); if (!currentPages.isEmpty()) { - QVectorzoomList = helpEngine.customValue(zoom).toString(). - split(sep, QString::SkipEmptyParts).toVector(); - if (zoomList.isEmpty()) - zoomList.fill(QLatin1String("0.0"), currentPages.size()); - else if(zoomList.count() < currentPages.count()) { - zoomList.insert(zoomList.count(), - currentPages.count() - zoomList.count(), QLatin1String("0.0")); - } + QStringList zoomList = CollectionConfiguration::lastZoomFactors(helpEngine); + while (zoomList.count() < currentPages.count()) + zoomList.append(CollectionConfiguration::DefaultZoomFactor); for (int i = currentPages.count(); --i >= 0;) { if (QUrl(currentPages.at(i)).host() == nsName) { - zoomList.remove(i); + zoomList.removeAt(i); currentPages.removeAt(i); lastPage = (lastPage == (i + 1)) ? 1 : lastPage; } } - helpEngine.setCustomValue(pages, currentPages.join(sep)); - helpEngine.setCustomValue(QLatin1String("LastTabPage"), lastPage); - helpEngine.setCustomValue(zoom, QStringList(zoomList.toList()).join(sep)); + CollectionConfiguration::setLastShownPages(helpEngine, currentPages); + CollectionConfiguration::setLastTabPage(helpEngine, lastPage); + CollectionConfiguration::setLastZoomFactors(helpEngine, zoomList); } } bool updateUserCollection(QHelpEngineCore& user, const QHelpEngineCore& caller) { - const uint callerCollectionCreationTime = caller. - customValue(QLatin1String("CreationTime"), 0).toUInt(); - const uint userCollectionCreationTime = user. - customValue(QLatin1String("CreationTime"), 1).toUInt(); - - if (callerCollectionCreationTime <= userCollectionCreationTime) + if (!CollectionConfiguration::isNewer(caller, user)) return false; - - user.setCustomValue(QLatin1String("CreationTime"), - callerCollectionCreationTime); - user.setCustomValue(QLatin1String("WindowTitle"), - caller.customValue(QLatin1String("WindowTitle"))); - user.setCustomValue(QLatin1String("LastShownPages"), - caller.customValue(QLatin1String("LastShownPages"))); -#if !defined(QT_NO_WEBKIT) - const QLatin1String zoomKey("LastPagesZoomWebView"); -#else - const QLatin1String zoomKey("LastPagesZoomTextBrowser"); -#endif - user.setCustomValue(zoomKey, caller.customValue(zoomKey)); - user.setCustomValue(QLatin1String("CurrentFilter"), - caller.customValue(QLatin1String("CurrentFilter"))); - user.setCustomValue(QLatin1String("CacheDirectory"), - caller.customValue(QLatin1String("CacheDirectory"))); - user.setCustomValue(QLatin1String("EnableFilterFunctionality"), - caller.customValue(QLatin1String("EnableFilterFunctionality"))); - user.setCustomValue(QLatin1String("HideFilterFunctionality"), - caller.customValue(QLatin1String("HideFilterFunctionality"))); - user.setCustomValue(QLatin1String("EnableDocumentationManager"), - caller.customValue(QLatin1String("EnableDocumentationManager"))); - user.setCustomValue(QLatin1String("EnableAddressBar"), - caller.customValue(QLatin1String("EnableAddressBar"))); - user.setCustomValue(QLatin1String("HideAddressBar"), - caller.customValue(QLatin1String("HideAddressBar"))); - user.setCustomValue(QLatin1String("ApplicationIcon"), - caller.customValue(QLatin1String("ApplicationIcon"))); - user.setCustomValue(QLatin1String("AboutMenuTexts"), - caller.customValue(QLatin1String("AboutMenuTexts"))); - user.setCustomValue(QLatin1String("AboutIcon"), - caller.customValue(QLatin1String("AboutIcon"))); - user.setCustomValue(QLatin1String("AboutTexts"), - caller.customValue(QLatin1String("AboutTexts"))); - user.setCustomValue(QLatin1String("AboutImages"), - caller.customValue(QLatin1String("AboutImages"))); - user.setCustomValue(QLatin1String("defaultHomepage"), - caller.customValue(QLatin1String("defaultHomepage"))); - + CollectionConfiguration::copyConfiguration(caller, user); return true; } @@ -247,7 +187,7 @@ int main(int argc, char *argv[]) return -1; } } - help.setCustomValue(QLatin1String("DocUpdate"), true); + CollectionConfiguration::setDocUpdatePending(help, true); return 0; } @@ -293,11 +233,9 @@ int main(int argc, char *argv[]) } QString fileName = QFileInfo(cmdCollectionFile).fileName(); - const QString &cacheDir = - caller.customValue(QLatin1String("CacheDirectory"), - QString()).toString(); + const QString &cacheDir = CollectionConfiguration::cacheDir(caller); const QString dir = !cacheDir.isEmpty() - && caller.customValue(QLatin1String("CacheDirRelativeToCollection")).toBool() + && CollectionConfiguration::cacheDirIsRelativeToCollection(caller) ? QFileInfo(cmdCollectionFile).dir().absolutePath() + QDir::separator() + cacheDir : MainWindow::collectionFileDirectory(false, cacheDir); @@ -316,8 +254,7 @@ int main(int argc, char *argv[]) QHelpEngineCore user(fi.absoluteFilePath()); if (user.setupData()) { // some docs might have been un/registered - bool docUpdate = caller. - customValue(QLatin1String("DocUpdate"), false).toBool(); + bool docUpdate = CollectionConfiguration::docUpdatePending(caller); // update in case the passed collection file changed if (updateUserCollection(user, caller)) @@ -343,7 +280,7 @@ int main(int argc, char *argv[]) user.unregisterDocumentation(doc); } - caller.setCustomValue(QLatin1String("DocUpdate"), false); + CollectionConfiguration::setDocUpdatePending(caller, false); } } } diff --git a/tools/assistant/tools/assistant/mainwindow.cpp b/tools/assistant/tools/assistant/mainwindow.cpp index 9a2a5bd..1a129c3 100644 --- a/tools/assistant/tools/assistant/mainwindow.cpp +++ b/tools/assistant/tools/assistant/mainwindow.cpp @@ -53,6 +53,7 @@ #include "searchwidget.h" #include "qtdocinstaller.h" #include "xbelsupport.h" +#include "../shared/collectionconfiguration.h" #include #include @@ -152,10 +153,11 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent) connect(m_bookmarkManager, SIGNAL(bookmarksChanged()), this, SLOT(updateBookmarkMenu())); - setWindowTitle(m_helpEngine->customValue(QLatin1String("WindowTitle"), - defWindowTitle).toString()); - QByteArray iconArray = m_helpEngine->customValue(QLatin1String("ApplicationIcon"), - QByteArray()).toByteArray(); + const QString windowTitle = + CollectionConfiguration::windowTitle(*m_helpEngine); + setWindowTitle(windowTitle.isEmpty() ? defWindowTitle : windowTitle); + QByteArray iconArray = + CollectionConfiguration::applicationIcon(*m_helpEngine); if (iconArray.size() > 0) { QPixmap pix; pix.loadFromData(iconArray); @@ -169,11 +171,11 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent) // Show the widget here, otherwise the restore geometry and state won't work // on x11. show(); - QByteArray ba(m_helpEngine->customValue(QLatin1String("MainWindow")).toByteArray()); + QByteArray ba(CollectionConfiguration::mainWindow(*m_helpEngine)); if (!ba.isEmpty()) restoreState(ba); - ba = m_helpEngine->customValue(QLatin1String("MainWindowGeometry")).toByteArray(); + ba = CollectionConfiguration::mainWindowGeometry(*m_helpEngine); if (!ba.isEmpty()) { restoreGeometry(ba); } else { @@ -183,14 +185,14 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent) resize(QSize(800, 600)); } - if (!m_helpEngine->customValue(QLatin1String("useAppFont")).isValid()) { - m_helpEngine->setCustomValue(QLatin1String("useAppFont"), false); - m_helpEngine->setCustomValue(QLatin1String("useBrowserFont"), false); - m_helpEngine->setCustomValue(QLatin1String("appFont"), qApp->font()); - m_helpEngine->setCustomValue(QLatin1String("appWritingSystem"), + if (!CollectionConfiguration::hasFontSettings(*m_helpEngine)) { + CollectionConfiguration::setUseAppFont(*m_helpEngine, false); + CollectionConfiguration::setUseBrowserFont(*m_helpEngine, false); + CollectionConfiguration::setAppFont(*m_helpEngine, qApp->font()); + CollectionConfiguration::setAppWritingSystem(*m_helpEngine, QFontDatabase::Latin); - m_helpEngine->setCustomValue(QLatin1String("browserFont"), qApp->font()); - m_helpEngine->setCustomValue(QLatin1String("browserWritingSystem"), + CollectionConfiguration::setBrowserFont(*m_helpEngine, qApp->font()); + CollectionConfiguration::setBrowserWritingSystem(*m_helpEngine, QFontDatabase::Latin); } else { updateApplicationFont(); @@ -264,8 +266,8 @@ bool MainWindow::usesDefaultCollection() const void MainWindow::closeEvent(QCloseEvent *e) { m_bookmarkManager->saveBookmarks(); - m_helpEngine->setCustomValue(QLatin1String("MainWindow"), saveState()); - m_helpEngine->setCustomValue(QLatin1String("MainWindowGeometry"), + CollectionConfiguration::setMainWindow(*m_helpEngine, saveState()); + CollectionConfiguration::setMainWindowGeometry(*m_helpEngine, saveGeometry()); QMainWindow::closeEvent(e); @@ -314,13 +316,12 @@ bool MainWindow::initHelpDB() needsSetup = true; } - const QLatin1String unfiltered("UnfilteredFilterInserted"); - if (1 != m_helpEngine->customValue(unfiltered).toInt()) { + if (!CollectionConfiguration::unfilteredInserted(*m_helpEngine)) { { QHelpEngineCore hc(collectionFile); hc.setupData(); hc.addCustomFilter(tr("Unfiltered"), QStringList()); - hc.setCustomValue(unfiltered, 1); + CollectionConfiguration::setUnfilteredInserted(hc); } m_helpEngine->blockSignals(true); @@ -346,9 +347,8 @@ void MainWindow::lookForNewQtDocumentation() connect(m_qtDocInstaller, SIGNAL(docsInstalled(bool)), this, SLOT(qtDocumentationInstalled(bool))); - QString versionKey = QString(QLatin1String("qtVersion%1$$$qt")). - arg(QLatin1String(QT_VERSION_STR)); - if (m_helpEngine->customValue(versionKey, 0).toInt() != 1) + if (CollectionConfiguration::qtDocInfo(*m_helpEngine, QLatin1String("qt")). + count() != 2) statusBar()->showMessage(tr("Looking for Qt Documentation...")); m_qtDocInstaller->installDocs(); } @@ -663,8 +663,7 @@ QMenu *MainWindow::toolBarMenu() void MainWindow::setupFilterToolbar() { - if (!m_helpEngine-> - customValue(QLatin1String("EnableFilterFunctionality"), true).toBool()) + if (!CollectionConfiguration::filterFunctionalityEnabled(*m_helpEngine)) return; m_filterCombo = new QComboBox(this); @@ -677,8 +676,7 @@ void MainWindow::setupFilterToolbar() this)); filterToolBar->addWidget(m_filterCombo); - const QLatin1String hideFilter("HideFilterFunctionality"); - if (m_helpEngine->customValue(hideFilter, true).toBool()) + if (!CollectionConfiguration::filterToolbarVisible(*m_helpEngine)) filterToolBar->hide(); toolBarMenu()->addAction(filterToolBar->toggleViewAction()); @@ -694,7 +692,7 @@ void MainWindow::setupFilterToolbar() void MainWindow::setupAddressToolbar() { - if (!m_helpEngine->customValue(QLatin1String("EnableAddressBar"), true).toBool()) + if (!CollectionConfiguration::addressBarEnabled(*m_helpEngine)) return; m_addressLineEdit = new QLineEdit(this); @@ -706,7 +704,7 @@ void MainWindow::setupAddressToolbar() this)); addressToolBar->addWidget(m_addressLineEdit); - if (m_helpEngine->customValue(QLatin1String("HideAddressBar"), true).toBool()) + if (!CollectionConfiguration::addressBarVisible(*m_helpEngine)) addressToolBar->hide(); toolBarMenu()->addAction(addressToolBar->toggleViewAction()); @@ -722,8 +720,7 @@ void MainWindow::setupAddressToolbar() void MainWindow::updateAboutMenuText() { if (m_helpEngine) { - QByteArray ba = m_helpEngine->customValue(QLatin1String("AboutMenuTexts"), - QByteArray()).toByteArray(); + QByteArray ba = CollectionConfiguration::aboutMenuTexts(*m_helpEngine); if (ba.size() > 0) { QString lang; QString str; @@ -837,8 +834,7 @@ void MainWindow::showAboutDialog() { QByteArray contents; if (m_helpEngine) { - QByteArray ba = m_helpEngine->customValue(QLatin1String("AboutTexts"), - QByteArray()).toByteArray(); + QByteArray ba = CollectionConfiguration::aboutTexts(*m_helpEngine); if (!ba.isEmpty()) { QString lang; QByteArray cba; @@ -864,11 +860,9 @@ void MainWindow::showAboutDialog() QByteArray iconArray; if (!contents.isEmpty()) { - iconArray = m_helpEngine->customValue(QLatin1String("AboutIcon"), - QByteArray()).toByteArray(); + iconArray = CollectionConfiguration::aboutIcon(*m_helpEngine); QByteArray resources = - m_helpEngine->customValue(QLatin1String("AboutImages"), - QByteArray()).toByteArray(); + CollectionConfiguration::aboutImages(*m_helpEngine); QPixmap pix; pix.loadFromData(iconArray); aboutDia.setText(QString::fromUtf8(contents), resources); @@ -997,8 +991,8 @@ void MainWindow::showSearchWidget() void MainWindow::updateApplicationFont() { QFont font = qApp->font(); - if (m_helpEngine->customValue(QLatin1String("useAppFont")).toBool()) - font = qVariantValue(m_helpEngine->customValue(QLatin1String("appFont"))); + if (CollectionConfiguration::usesAppFont(*m_helpEngine)) + font = CollectionConfiguration::appFont(*m_helpEngine); qApp->setFont(font, "QWidget"); } diff --git a/tools/assistant/tools/assistant/preferencesdialog.cpp b/tools/assistant/tools/assistant/preferencesdialog.cpp index d63c109..1fffacd 100644 --- a/tools/assistant/tools/assistant/preferencesdialog.cpp +++ b/tools/assistant/tools/assistant/preferencesdialog.cpp @@ -45,6 +45,7 @@ #include "fontpanel.h" #include "centralwidget.h" #include "aboutdialog.h" +#include "../shared/collectionconfiguration.h" #include #include @@ -76,11 +77,10 @@ PreferencesDialog::PreferencesDialog(QHelpEngineCore *helpEngine, connect(m_ui.buttonBox->button(QDialogButtonBox::Cancel), SIGNAL(clicked()), this, SLOT(reject())); - QLatin1String key("EnableFilterFunctionality"); - m_hideFiltersTab = !m_helpEngine->customValue(key, true).toBool(); - - key = QLatin1String("EnableDocumentationManager"); - m_hideDocsTab = !m_helpEngine->customValue(key, true).toBool(); + m_hideFiltersTab = + !CollectionConfiguration::filterFunctionalityEnabled(*m_helpEngine); + m_hideDocsTab = + !CollectionConfiguration::documentationManagerEnabled(*m_helpEngine); if (!m_hideFiltersTab) { m_ui.attributeWidget->header()->hide(); @@ -121,27 +121,22 @@ PreferencesDialog::PreferencesDialog(QHelpEngineCore *helpEngine, PreferencesDialog::~PreferencesDialog() { - QLatin1String key(""); if (m_appFontChanged) { - key = QLatin1String("appFont"); - m_helpEngine->setCustomValue(key, m_appFontPanel->selectedFont()); - - key = QLatin1String("useAppFont"); - m_helpEngine->setCustomValue(key, m_appFontPanel->isChecked()); - - key = QLatin1String("appWritingSystem"); - m_helpEngine->setCustomValue(key, m_appFontPanel->writingSystem()); + CollectionConfiguration::setAppFont(*m_helpEngine, + m_appFontPanel->selectedFont()); + CollectionConfiguration::setUseAppFont(*m_helpEngine, + m_appFontPanel->isChecked()); + CollectionConfiguration::setAppWritingSystem(*m_helpEngine, + m_appFontPanel->writingSystem()); } if (m_browserFontChanged) { - key = QLatin1String("browserFont"); - m_helpEngine->setCustomValue(key, m_browserFontPanel->selectedFont()); - - key = QLatin1String("useBrowserFont"); - m_helpEngine->setCustomValue(key, m_browserFontPanel->isChecked()); - - key = QLatin1String("browserWritingSystem"); - m_helpEngine->setCustomValue(key, m_browserFontPanel->writingSystem()); + CollectionConfiguration::setBrowserFont(*m_helpEngine, + m_browserFontPanel->selectedFont()); + CollectionConfiguration::setUseBrowserFont(*m_helpEngine, + m_browserFontPanel->isChecked()); + CollectionConfiguration::setBrowserWritingSystem(*m_helpEngine, + m_browserFontPanel->writingSystem()); } if (m_appFontChanged || m_browserFontChanged) { @@ -152,10 +147,10 @@ PreferencesDialog::~PreferencesDialog() QString homePage = m_ui.homePageLineEdit->text(); if (homePage.isEmpty()) homePage = QLatin1String("help"); - m_helpEngine->setCustomValue(QLatin1String("homepage"), homePage); + CollectionConfiguration::setHomePage(*m_helpEngine, homePage); int option = m_ui.helpStartComboBox->currentIndex(); - m_helpEngine->setCustomValue(QLatin1String("StartOption"), option); + CollectionConfiguration::setStartOption(*m_helpEngine, option); } void PreferencesDialog::showDialog() @@ -416,31 +411,26 @@ void PreferencesDialog::updateFontSettingsPage() const QString customSettings(tr("Use custom settings")); m_appFontPanel->setTitle(customSettings); - QLatin1String key = QLatin1String("appFont"); - QFont font = qVariantValue(m_helpEngine->customValue(key)); + QFont font = CollectionConfiguration::appFont(*m_helpEngine); m_appFontPanel->setSelectedFont(font); - key = QLatin1String("appWritingSystem"); - QFontDatabase::WritingSystem system = static_cast - (m_helpEngine->customValue(key).toInt()); + QFontDatabase::WritingSystem system = + CollectionConfiguration::appWritingSystem(*m_helpEngine); m_appFontPanel->setWritingSystem(system); - key = QLatin1String("useAppFont"); - m_appFontPanel->setChecked(m_helpEngine->customValue(key).toBool()); + m_appFontPanel->setChecked(CollectionConfiguration:: + usesAppFont(*m_helpEngine)); m_browserFontPanel->setTitle(customSettings); - key = QLatin1String("browserFont"); - font = qVariantValue(m_helpEngine->customValue(key)); + font = CollectionConfiguration::browserFont(*m_helpEngine); m_browserFontPanel->setSelectedFont(font); - key = QLatin1String("browserWritingSystem"); - system = static_cast - (m_helpEngine->customValue(key).toInt()); + system = CollectionConfiguration::browserWritingSystem(*m_helpEngine); m_browserFontPanel->setWritingSystem(system); - key = QLatin1String("useBrowserFont"); - m_browserFontPanel->setChecked(m_helpEngine->customValue(key).toBool()); + m_browserFontPanel->setChecked(CollectionConfiguration:: + usesBrowserFont(*m_helpEngine)); connect(m_appFontPanel, SIGNAL(toggled(bool)), this, SLOT(appFontSettingToggled(bool))); @@ -486,17 +476,12 @@ void PreferencesDialog::browserFontSettingChanged(int index) void PreferencesDialog::updateOptionsPage() { - QString homepage = m_helpEngine->customValue(QLatin1String("homepage"), - QLatin1String("")).toString(); - - if (homepage.isEmpty()) { - homepage = m_helpEngine->customValue(QLatin1String("defaultHomepage"), - QLatin1String("help")).toString(); - } - m_ui.homePageLineEdit->setText(homepage); + QString homePage = CollectionConfiguration::homePage(*m_helpEngine); + if (homePage.isEmpty()) + homePage = CollectionConfiguration::defaultHomePage(*m_helpEngine); + m_ui.homePageLineEdit->setText(homePage); - int option = m_helpEngine->customValue(QLatin1String("StartOption"), - ShowLastPages).toInt(); + int option = CollectionConfiguration::startOption(*m_helpEngine); m_ui.helpStartComboBox->setCurrentIndex(option); connect(m_ui.blankPageButton, SIGNAL(clicked()), this, SLOT(setBlankPage())); @@ -520,9 +505,8 @@ void PreferencesDialog::setCurrentPage() void PreferencesDialog::setDefaultPage() { - QString homepage = m_helpEngine->customValue(QLatin1String("defaultHomepage"), - QLatin1String("help")).toString(); - m_ui.homePageLineEdit->setText(homepage); + QString homePage = CollectionConfiguration::defaultHomePage(*m_helpEngine); + m_ui.homePageLineEdit->setText(homePage); } QT_END_NAMESPACE diff --git a/tools/assistant/tools/assistant/qtdocinstaller.cpp b/tools/assistant/tools/assistant/qtdocinstaller.cpp index 42085cb..3f82786 100644 --- a/tools/assistant/tools/assistant/qtdocinstaller.cpp +++ b/tools/assistant/tools/assistant/qtdocinstaller.cpp @@ -44,6 +44,7 @@ #include #include #include +#include "../shared/collectionconfiguration.h" #include "qtdocinstaller.h" QT_BEGIN_NAMESPACE @@ -100,14 +101,10 @@ void QtDocInstaller::run() bool QtDocInstaller::installDoc(const QString &name, QHelpEngineCore *helpEngine) { - QString versionKey = QString(QLatin1String("qtVersion%1$$$%2")). - arg(QLatin1String(QT_VERSION_STR)).arg(name); - - QString info = helpEngine->customValue(versionKey, QString()).toString(); - QStringList lst = info.split(QLatin1String("|")); + QStringList lst = CollectionConfiguration::qtDocInfo(*helpEngine, name); QDateTime dt; - if (lst.count() && !lst.first().isEmpty()) + if (!lst.isEmpty() && !lst.first().isEmpty()) dt = QDateTime::fromString(lst.first(), Qt::ISODate); QString qchFile; @@ -119,14 +116,14 @@ bool QtDocInstaller::installDoc(const QString &name, QHelpEngineCore *helpEngine const QStringList files = dir.entryList(QStringList() << QLatin1String("*.qch")); if (files.isEmpty()) { - helpEngine->setCustomValue(versionKey, QDateTime().toString(Qt::ISODate) - + QLatin1String("|")); + CollectionConfiguration::setQtDocInfo(*helpEngine, name, + QStringList(QDateTime().toString(Qt::ISODate))); return false; } foreach (const QString &f, files) { if (f.startsWith(name)) { QFileInfo fi(dir.absolutePath() + QDir::separator() + f); - if (dt.isValid() && fi.lastModified().toString(Qt::ISODate) == dt.toString(Qt::ISODate) + if (dt.isValid() && fi.lastModified().toTime_t() == dt.toTime_t() && qchFile == fi.absoluteFilePath()) return false; @@ -152,8 +149,9 @@ bool QtDocInstaller::installDoc(const QString &name, QHelpEngineCore *helpEngine Q_ASSERT(m_qchWatcher->files().count() == helpEngine->registeredDocumentations().count()); - helpEngine->setCustomValue(versionKey, fi.lastModified().toString(Qt::ISODate) - + QLatin1String("|") + fi.absoluteFilePath()); + CollectionConfiguration::setQtDocInfo(*helpEngine, name, + QStringList() << fi.lastModified().toString(Qt::ISODate) + << fi.absoluteFilePath()); return true; } } diff --git a/tools/assistant/tools/qcollectiongenerator/main.cpp b/tools/assistant/tools/qcollectiongenerator/main.cpp index a92cc56..2eb2b96 100644 --- a/tools/assistant/tools/qcollectiongenerator/main.cpp +++ b/tools/assistant/tools/qcollectiongenerator/main.cpp @@ -39,6 +39,7 @@ ** ****************************************************************************/ +#include "../shared/collectionconfiguration.h" #include "../shared/helpgenerator.h" #include @@ -453,36 +454,39 @@ int main(int argc, char *argv[]) } if (!config.title().isEmpty()) - helpEngine.setCustomValue(QLatin1String("WindowTitle"), config.title()); + CollectionConfiguration::setWindowTitle(helpEngine, config.title()); if (!config.homePage().isEmpty()) { - helpEngine.setCustomValue(QLatin1String("defaultHomepage"), - config.homePage()); + CollectionConfiguration::setDefaultHomePage(helpEngine, + config.homePage()); } - if (!config.startPage().isEmpty()) - helpEngine.setCustomValue(QLatin1String("LastShownPages"), config.startPage()); + if (!config.startPage().isEmpty()) { + CollectionConfiguration::setLastShownPages(helpEngine, + QStringList(config.startPage())); + } - if (!config.currentFilter().isEmpty()) - helpEngine.setCustomValue(QLatin1String("CurrentFilter"), config.currentFilter()); + if (!config.currentFilter().isEmpty()) { + CollectionConfiguration::setCurrentFilter(helpEngine, + config.currentFilter()); + } if (!config.cacheDirectory().isEmpty()) { - helpEngine.setCustomValue(QLatin1String("CacheDirectory"), config.cacheDirectory()); - helpEngine.setCustomValue(QLatin1String("CacheDirRelativeToCollection"), - config.cacheDirRelativeToCollection()); + CollectionConfiguration::setCacheDir(helpEngine, config.cacheDirectory(), + config.cacheDirRelativeToCollection()); } - helpEngine.setCustomValue(QLatin1String("EnableFilterFunctionality"), + CollectionConfiguration::setFilterFunctionalityEnabled(helpEngine, config.enableFilterFunctionality()); - helpEngine.setCustomValue(QLatin1String("HideFilterFunctionality"), - config.hideFilterFunctionality()); - helpEngine.setCustomValue(QLatin1String("EnableDocumentationManager"), + CollectionConfiguration::setFilterToolbarVisible(helpEngine, + !config.hideFilterFunctionality()); + CollectionConfiguration::setDocumentationManagerEnabled(helpEngine, config.enableDocumentationManager()); - helpEngine.setCustomValue(QLatin1String("EnableAddressBar"), + CollectionConfiguration::setAddressBarEnabled(helpEngine, config.enableAddressBar()); - helpEngine.setCustomValue(QLatin1String("HideAddressBar"), - config.hideAddressBar()); - helpEngine.setCustomValue(QLatin1String("CreationTime"), + CollectionConfiguration::setAddressBarVisible(helpEngine, + !config.hideAddressBar()); + CollectionConfiguration::setCreationTime(helpEngine, QDateTime::currentDateTime().toTime_t()); if (!config.applicationIcon().isEmpty()) { @@ -491,7 +495,7 @@ int main(int argc, char *argv[]) fprintf(stderr, "Cannot open %s!\n", qPrintable(icon.fileName())); return -1; } - helpEngine.setCustomValue(QLatin1String("ApplicationIcon"), icon.readAll()); + CollectionConfiguration::setApplicationIcon(helpEngine, icon.readAll()); } if (config.aboutMenuTexts().count()) { @@ -503,7 +507,7 @@ int main(int argc, char *argv[]) s << it.value(); ++it; } - helpEngine.setCustomValue(QLatin1String("AboutMenuTexts"), ba); + CollectionConfiguration::setAboutMenuTexts(helpEngine, ba); } if (!config.aboutIcon().isEmpty()) { @@ -512,7 +516,7 @@ int main(int argc, char *argv[]) fprintf(stderr, "Cannot open %s!\n", qPrintable(icon.fileName())); return -1; } - helpEngine.setCustomValue(QLatin1String("AboutIcon"), icon.readAll()); + CollectionConfiguration::setAboutIcon(helpEngine, icon.readAll()); } if (config.aboutTextFiles().count()) { @@ -560,14 +564,14 @@ int main(int argc, char *argv[]) } ++it; } - helpEngine.setCustomValue(QLatin1String("AboutTexts"), ba); + CollectionConfiguration::setAboutTexts(helpEngine, ba); if (imgData.count()) { QByteArray imageData; QBuffer buffer(&imageData); buffer.open(QIODevice::WriteOnly); QDataStream out(&buffer); out << imgData; - helpEngine.setCustomValue(QLatin1String("AboutImages"), imageData); + CollectionConfiguration::setAboutImages(helpEngine, imageData); } } diff --git a/tools/assistant/tools/qcollectiongenerator/qcollectiongenerator.pro b/tools/assistant/tools/qcollectiongenerator/qcollectiongenerator.pro index cf70e48..98e6a31 100644 --- a/tools/assistant/tools/qcollectiongenerator/qcollectiongenerator.pro +++ b/tools/assistant/tools/qcollectiongenerator/qcollectiongenerator.pro @@ -1,14 +1,17 @@ -QT += xml network +QT += xml \ + network TEMPLATE = app DESTDIR = ../../../../bin TARGET = qcollectiongenerator -CONFIG += qt warn_on help console +CONFIG += qt \ + warn_on \ + help \ + console CONFIG -= app_bundle - -target.path=$$[QT_INSTALL_BINS] +target.path = $$[QT_INSTALL_BINS] INSTALLS += target - SOURCES += ../shared/helpgenerator.cpp \ - main.cpp - -HEADERS += ../shared/helpgenerator.h + main.cpp \ + ../shared/collectionconfiguration.cpp +HEADERS += ../shared/helpgenerator.h \ + ../shared/collectionconfiguration.h diff --git a/tools/assistant/tools/shared/collectionconfiguration.cpp b/tools/assistant/tools/shared/collectionconfiguration.cpp new file mode 100644 index 0000000..d0650e4 --- /dev/null +++ b/tools/assistant/tools/shared/collectionconfiguration.cpp @@ -0,0 +1,509 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "collectionconfiguration.h" + +#include + +QT_BEGIN_NAMESPACE + +namespace { + const QString ListSeparator(QLatin1String("|")); + + const QString AboutIconKey(QLatin1String("AboutIcon")); + const QString AboutImagesKey(QLatin1String("AboutImages")); + const QString AboutMenuTextsKey(QLatin1String("AboutMenuTexts")); + const QString AboutTextsKey(QLatin1String("AboutTexts")); + const QString AppFontKey(QLatin1String("appFont")); + const QString ApplicationIconKey(QLatin1String("ApplicationIcon")); + const QString AppWritingSystemKey(QLatin1String("appWritingSystem")); + const QString BookmarksKey(QLatin1String("Bookmarks")); + const QString BrowserFontKey(QLatin1String("browserFont")); + const QString BrowserWritingSystemKey(QLatin1String("browserWritingSystem")); + const QString CacheDirKey(QLatin1String("CacheDirectory")); + const QString CacheDirRelativeToCollectionKey(QLatin1String("CacheDirRelativeToCollection")); + const QString CreationTimeKey(QLatin1String("CreationTime")); + const QString CurrentFilterKey(QLatin1String("CurrentFilter")); + const QString DefaultHomePageKey(QLatin1String("defaultHomepage")); + const QString DocUpdatePendingKey(QLatin1String("DocUpdate")); + const QString EnableAddressBarKey(QLatin1String("EnableAddressBar")); + const QString EnableDocManagerKey(QLatin1String("EnableDocumentationManager")); + const QString EnableFilterKey(QLatin1String("EnableFilterFunctionality")); + const QString FilterToolbarHiddenKey(QLatin1String("HideFilterFunctionality")); + const QString HideAddressBarKey(QLatin1String("HideAddressBar")); + const QString HomePageKey(QLatin1String("homepage")); + const QString LastPageKey(QLatin1String("LastTabPage")); + const QString LastShownPagesKey(QLatin1String("LastShownPages")); + const QString LastZoomFactorsKey(QLatin1String( +#if !defined(QT_NO_WEBKIT) + "LastPagesZoomWebView" +#else + "LastPagesZoomTextBrowser" +#endif + )); + const QString MainWindowKey(QLatin1String("MainWindow")); + const QString MainWindowGeometryKey(QLatin1String("MainWindowGeometry")); + const QString SearchWasAttachedKey(QLatin1String("SearchWasAttached")); + const QString StartOptionKey(QLatin1String("StartOption")); + const QString UnfilteredInsertedKey(QLatin1String("UnfilteredFilterInserted")); + const QString UseAppFontKey(QLatin1String("useAppFont")); + const QString UseBrowserFontKey(QLatin1String("useBrowserFont")); + const QString VersionKey(QString(QLatin1String("qtVersion%1$$$%2")). + arg(QLatin1String(QT_VERSION_STR))); + const QString WindowTitleKey(QLatin1String("WindowTitle")); +} // anonymous namespace + +const QString CollectionConfiguration::DefaultZoomFactor(QLatin1String("0.0")); + +uint CollectionConfiguration::creationTime(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(CreationTimeKey, 0).toUInt(); +} + +void CollectionConfiguration::setCreationTime(QHelpEngineCore &helpEngine, uint time) +{ + helpEngine.setCustomValue(CreationTimeKey, time); +} + +const QString CollectionConfiguration::windowTitle(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(WindowTitleKey).toString(); +} + +void CollectionConfiguration::setWindowTitle(QHelpEngineCore &helpEngine, + const QString &windowTitle) +{ + helpEngine.setCustomValue(WindowTitleKey, windowTitle); +} + + +int CollectionConfiguration::lastTabPage(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(LastPageKey, 1).toInt(); +} + +void CollectionConfiguration::setLastTabPage(QHelpEngineCore &helpEngine, int lastPage) +{ + helpEngine.setCustomValue(LastPageKey, lastPage); +} + + +const QStringList CollectionConfiguration::lastShownPages(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(LastShownPagesKey).toString(). + split(ListSeparator, QString::SkipEmptyParts); +} + +void CollectionConfiguration::setLastShownPages(QHelpEngineCore &helpEngine, + const QStringList &lastShownPages) +{ + helpEngine. + setCustomValue(LastShownPagesKey, lastShownPages.join(ListSeparator)); +} + +const QStringList CollectionConfiguration::lastZoomFactors(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(LastZoomFactorsKey).toString(). + split(ListSeparator, QString::SkipEmptyParts); +} + +void CollectionConfiguration::setLastZoomFactors(QHelpEngineCore &helpEngine, + const QStringList &lastZoomFactors) +{ + helpEngine.setCustomValue(LastZoomFactorsKey, lastZoomFactors.join(ListSeparator)); +} + +const QString CollectionConfiguration::currentFilter(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(CurrentFilterKey).toString(); +} + +void CollectionConfiguration::setCurrentFilter(QHelpEngineCore &helpEngine, + const QString ¤tFilter) +{ + helpEngine.setCustomValue(CurrentFilterKey, currentFilter); +} + +const QString CollectionConfiguration::cacheDir(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(CacheDirKey).toString(); +} + +bool CollectionConfiguration::cacheDirIsRelativeToCollection(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(CacheDirRelativeToCollectionKey).toBool(); +} + +void CollectionConfiguration::setCacheDir(QHelpEngineCore &helpEngine, + const QString &cacheDir, bool relativeToCollection) +{ + helpEngine.setCustomValue(CacheDirKey, cacheDir); + helpEngine.setCustomValue(CacheDirRelativeToCollectionKey, + relativeToCollection); +} + +bool CollectionConfiguration::filterFunctionalityEnabled(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(EnableFilterKey, true).toBool(); +} + +void CollectionConfiguration::setFilterFunctionalityEnabled(QHelpEngineCore &helpEngine, + bool enabled) +{ + helpEngine.setCustomValue(EnableFilterKey, enabled); +} + +bool CollectionConfiguration::filterToolbarVisible(const QHelpEngineCore &helpEngine) +{ + return !helpEngine.customValue(FilterToolbarHiddenKey, true).toBool(); +} + +void CollectionConfiguration::setFilterToolbarVisible(QHelpEngineCore &helpEngine, + bool visible) +{ + helpEngine.setCustomValue(FilterToolbarHiddenKey, !visible); +} + +bool CollectionConfiguration::addressBarEnabled(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(EnableAddressBarKey, true).toBool(); +} + +void CollectionConfiguration::setAddressBarEnabled(QHelpEngineCore &helpEngine, + bool enabled) +{ + helpEngine.setCustomValue(EnableAddressBarKey, enabled); +} + +bool CollectionConfiguration::addressBarVisible(const QHelpEngineCore &helpEngine) +{ + return !helpEngine.customValue(HideAddressBarKey, true).toBool(); +} + +void CollectionConfiguration::setAddressBarVisible(QHelpEngineCore &helpEngine, + bool visible) +{ + helpEngine.setCustomValue(HideAddressBarKey, !visible); +} + +bool CollectionConfiguration::documentationManagerEnabled(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(EnableDocManagerKey, true).toBool(); +} + +void CollectionConfiguration::setDocumentationManagerEnabled(QHelpEngineCore &helpEngine, + bool enabled) +{ + helpEngine.setCustomValue(EnableDocManagerKey, enabled); +} + +const QByteArray CollectionConfiguration::applicationIcon(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(ApplicationIconKey).toByteArray(); +} + +void CollectionConfiguration::setApplicationIcon(QHelpEngineCore &helpEngine, + const QByteArray &icon) +{ + helpEngine.setCustomValue(ApplicationIconKey, icon); +} + +const QByteArray CollectionConfiguration::aboutMenuTexts(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(AboutMenuTextsKey).toByteArray(); +} + +void CollectionConfiguration::setAboutMenuTexts(QHelpEngineCore &helpEngine, + const QByteArray &texts) +{ + helpEngine.setCustomValue(AboutMenuTextsKey, texts); +} + +const QByteArray CollectionConfiguration::aboutIcon(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(AboutIconKey).toByteArray(); +} + +void CollectionConfiguration::setAboutIcon(QHelpEngineCore &helpEngine, + const QByteArray &icon) +{ + helpEngine.setCustomValue(AboutIconKey, icon); +} + +const QByteArray CollectionConfiguration::aboutTexts(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(AboutTextsKey).toByteArray(); +} + +void CollectionConfiguration::setAboutTexts(QHelpEngineCore &helpEngine, + const QByteArray &texts) +{ + helpEngine.setCustomValue(AboutTextsKey, texts); +} + +const QByteArray CollectionConfiguration::aboutImages(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(AboutImagesKey).toByteArray(); +} + +void CollectionConfiguration::setAboutImages(QHelpEngineCore &helpEngine, + const QByteArray &images) +{ + helpEngine.setCustomValue(AboutImagesKey, images); +} + +const QString CollectionConfiguration::defaultHomePage(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(DefaultHomePageKey, QLatin1String("help")). + toString(); +} + +void CollectionConfiguration::setDefaultHomePage(QHelpEngineCore &helpEngine, + const QString &page) +{ + helpEngine.setCustomValue(DefaultHomePageKey, page); +} + +const QString CollectionConfiguration::homePage(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(HomePageKey).toString(); +} + +void CollectionConfiguration::setHomePage(QHelpEngineCore &helpEngine, + const QString &page) +{ + helpEngine.setCustomValue(HomePageKey, page); +} + +int CollectionConfiguration::startOption(const QHelpEngineCore &helpEngine) +{ + // TODO: After moving to helpengine wrapper, put LastPages in that header file + // and use it here as default value. + return helpEngine.customValue(StartOptionKey).toInt(); +} + +void CollectionConfiguration::setStartOption(QHelpEngineCore &helpEngine, + int option) +{ + helpEngine.setCustomValue(StartOptionKey, option); +} + +bool CollectionConfiguration::docUpdatePending(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(DocUpdatePendingKey, false).toBool(); +} + +void CollectionConfiguration::setDocUpdatePending(QHelpEngineCore &helpEngine, + bool pending) +{ + helpEngine.setCustomValue(DocUpdatePendingKey, pending); +} + +const QByteArray CollectionConfiguration::bookmarks(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(BookmarksKey).toByteArray(); +} + +void CollectionConfiguration::setBookmarks(QHelpEngineCore &helpEngine, + const QByteArray &bookmarks) +{ + helpEngine.setCustomValue(BookmarksKey, bookmarks); +} + +const QByteArray CollectionConfiguration::mainWindow(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(MainWindowKey).toByteArray(); +} + +void CollectionConfiguration::setMainWindow(QHelpEngineCore &helpEngine, + const QByteArray &mainWindow) +{ + helpEngine.setCustomValue(MainWindowKey, mainWindow); +} + +const QByteArray CollectionConfiguration::mainWindowGeometry(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(MainWindowGeometryKey).toByteArray(); +} + +void CollectionConfiguration::setMainWindowGeometry(QHelpEngineCore &helpEngine, + const QByteArray &geometry) +{ + helpEngine.setCustomValue(MainWindowGeometryKey, geometry); +} + +bool CollectionConfiguration::usesAppFont(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(UseAppFontKey).toBool(); +} + +void CollectionConfiguration::setUseAppFont(QHelpEngineCore &helpEngine, + bool useAppFont) +{ + helpEngine.setCustomValue(UseAppFontKey, useAppFont); +} + +bool CollectionConfiguration::usesBrowserFont(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(UseBrowserFontKey, false).toBool(); +} + +void CollectionConfiguration::setUseBrowserFont(QHelpEngineCore &helpEngine, + bool useBrowserFont) +{ + helpEngine.setCustomValue(UseBrowserFontKey, useBrowserFont); +} + +const QFont CollectionConfiguration::appFont(const QHelpEngineCore &helpEngine) +{ + return qVariantValue(helpEngine.customValue(AppFontKey)); +} + +void CollectionConfiguration::setAppFont(QHelpEngineCore &helpEngine, + const QFont &font) +{ + helpEngine.setCustomValue(AppFontKey, font); +} + +QFontDatabase::WritingSystem CollectionConfiguration::appWritingSystem(const QHelpEngineCore &helpEngine) +{ + return static_cast( + helpEngine.customValue(AppWritingSystemKey).toInt()); +} + +void CollectionConfiguration::setAppWritingSystem(QHelpEngineCore &helpEngine, + QFontDatabase::WritingSystem system) +{ + helpEngine.setCustomValue(AppWritingSystemKey, system); +} + +const QFont CollectionConfiguration::browserFont(const QHelpEngineCore &helpEngine) +{ + return qVariantValue(helpEngine.customValue(BrowserFontKey)); +} + +void CollectionConfiguration::setBrowserFont(QHelpEngineCore &helpEngine, + const QFont &font) +{ + helpEngine.setCustomValue(BrowserFontKey, font); +} + +QFontDatabase::WritingSystem CollectionConfiguration::browserWritingSystem(const QHelpEngineCore &helpEngine) +{ + return static_cast( + helpEngine.customValue(BrowserWritingSystemKey).toInt()); +} + +void CollectionConfiguration::setBrowserWritingSystem(QHelpEngineCore &helpEngine, + QFontDatabase::WritingSystem system) +{ + helpEngine.setCustomValue(BrowserWritingSystemKey, system); +} + +bool CollectionConfiguration::unfilteredInserted(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(UnfilteredInsertedKey).toInt() == 1; +} + +void CollectionConfiguration::setUnfilteredInserted(QHelpEngineCore &helpEngine) +{ + helpEngine.setCustomValue(UnfilteredInsertedKey, 1); +} + +const QStringList CollectionConfiguration::qtDocInfo(const QHelpEngineCore &helpEngine, + const QString &component) +{ + return helpEngine.customValue(VersionKey.arg(component)).toString(). + split(ListSeparator); +} + +void CollectionConfiguration::setQtDocInfo(QHelpEngineCore &helpEngine, + const QString &component, const QStringList &doc) +{ + helpEngine.setCustomValue(VersionKey.arg(component), + doc.join(ListSeparator)); +} + +bool CollectionConfiguration::searchWasAttached(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(SearchWasAttachedKey).toBool(); +} + +void CollectionConfiguration::setSearchWasAttached(QHelpEngineCore &helpEngine, + bool attached) +{ + helpEngine.setCustomValue(SearchWasAttachedKey, attached); +} + +bool CollectionConfiguration::hasFontSettings(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(UseAppFontKey).isValid(); +} + +bool CollectionConfiguration::isNewer(const QHelpEngineCore &newer, + const QHelpEngineCore &older) +{ + return creationTime(newer) > creationTime(older); +} + +void CollectionConfiguration::copyConfiguration(const QHelpEngineCore &source, + QHelpEngineCore &target) +{ + setCreationTime(target, creationTime(source)); + setWindowTitle(target, windowTitle(source)); + setLastShownPages(target, lastShownPages(source)); + setLastZoomFactors(target, lastZoomFactors(source)); + setCurrentFilter(target, currentFilter(source)); + setCacheDir(target, cacheDir(source), cacheDirIsRelativeToCollection(source)); + setFilterFunctionalityEnabled(target, filterFunctionalityEnabled(source)); + setFilterToolbarVisible(target, filterToolbarVisible(source)); + setAddressBarEnabled(target, addressBarEnabled(source)); + setAddressBarVisible(target, addressBarVisible(source)); + setDocumentationManagerEnabled(target, documentationManagerEnabled(source)); + setApplicationIcon(target, applicationIcon(source)); + setAboutMenuTexts(target, aboutMenuTexts(source)); + setAboutIcon(target, aboutIcon(source)); + setAboutTexts(target, aboutTexts(source)); + setAboutImages(target, aboutImages(source)); + setDefaultHomePage(target, defaultHomePage(source)); +} + +QT_END_NAMESPACE diff --git a/tools/assistant/tools/shared/collectionconfiguration.h b/tools/assistant/tools/shared/collectionconfiguration.h new file mode 100644 index 0000000..48d2803 --- /dev/null +++ b/tools/assistant/tools/shared/collectionconfiguration.h @@ -0,0 +1,198 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef COLLECTIONCONFIGURATION_H +#define COLLECTIONCONFIGURATION_H + +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class QHelpEngineCore; + +class CollectionConfiguration +{ +public: + static int lastTabPage(const QHelpEngineCore &helpEngine); + static void setLastTabPage(QHelpEngineCore &helpEngine, int lastPage); + + static const QStringList lastShownPages(const QHelpEngineCore &helpEngine); + static void setLastShownPages(QHelpEngineCore &helpEngine, + const QStringList &lastShownPages); + + + // TODO: Don't allow last pages and zoom factors to be set in isolation + // Perhaps also fill up missing elements automatically or assert. + static const QStringList lastZoomFactors(const QHelpEngineCore &helpEngine); + static void setLastZoomFactors(QHelpEngineCore &helpEngine, + const QStringList &lastZoomFactors); + + static const QString currentFilter(const QHelpEngineCore &helpEngine); + static void setCurrentFilter(QHelpEngineCore &helpEngine, + const QString ¤tFilter); + + static const QString cacheDir(const QHelpEngineCore &helpEngine); + static bool cacheDirIsRelativeToCollection(const QHelpEngineCore &helpEngine); + static void setCacheDir(QHelpEngineCore &helpEngine, + const QString &cacheDir, bool relativeToCollection); + + static bool filterFunctionalityEnabled(const QHelpEngineCore &helpEngine); + static void setFilterFunctionalityEnabled(QHelpEngineCore &helpEngine, + bool enabled); + + static bool filterToolbarVisible(const QHelpEngineCore &helpEngine); + static void setFilterToolbarVisible(QHelpEngineCore &helpEngine, + bool visible); + + static bool addressBarEnabled(const QHelpEngineCore &helpEngine); + static void setAddressBarEnabled(QHelpEngineCore &helpEngine, bool enabled); + + static bool addressBarVisible(const QHelpEngineCore &helpEngine); + static void setAddressBarVisible(QHelpEngineCore &helpEngine, bool visible); + + static uint creationTime(const QHelpEngineCore &helpEngine); + static void setCreationTime(QHelpEngineCore &helpEngine, uint time); + + static const QString windowTitle(const QHelpEngineCore &helpEngine); + static void setWindowTitle(QHelpEngineCore &helpEngine, + const QString &windowTitle); + + static bool documentationManagerEnabled(const QHelpEngineCore &helpEngine); + static void setDocumentationManagerEnabled(QHelpEngineCore &helpEngine, + bool enabled); + + static const QByteArray applicationIcon(const QHelpEngineCore &helpEngine); + static void setApplicationIcon(QHelpEngineCore &helpEngine, + const QByteArray &icon); + + static const QString homePage(const QHelpEngineCore &helpEngine); + static void setHomePage(QHelpEngineCore &helpEngine, const QString &page); + + static int startOption(const QHelpEngineCore &helpEngine); + static void setStartOption(QHelpEngineCore &helpEngine, int option); + + // TODO: Encapsulate encoding from/to QByteArray here + static const QByteArray aboutMenuTexts(const QHelpEngineCore &helpEngine); + static void setAboutMenuTexts(QHelpEngineCore &helpEngine, + const QByteArray &texts); + + static const QByteArray aboutIcon(const QHelpEngineCore &helpEngine); + static void setAboutIcon(QHelpEngineCore &helpEngine, + const QByteArray &icon); + + // TODO: Encapsulate encoding from/to QByteArray here + static const QByteArray aboutTexts(const QHelpEngineCore &helpEngine); + static void setAboutTexts(QHelpEngineCore &helpEngine, + const QByteArray &texts); + + static const QByteArray aboutImages(const QHelpEngineCore &helpEngine); + static void setAboutImages(QHelpEngineCore &helpEngine, + const QByteArray &images); + + static const QString defaultHomePage(const QHelpEngineCore &helpEngine); + static void setDefaultHomePage(QHelpEngineCore &helpEngine, + const QString &page); + + static bool docUpdatePending(const QHelpEngineCore &helpEngine); + static void setDocUpdatePending(QHelpEngineCore &helpEngine, bool pending); + + // TODO: Put these GUI-specific functions in the help engine wrapper + static const QByteArray bookmarks(const QHelpEngineCore &helpEngine); + static void setBookmarks(QHelpEngineCore &helpEngine, + const QByteArray &bookmarks); + + static const QByteArray mainWindow(const QHelpEngineCore &helpEngine); + static void setMainWindow(QHelpEngineCore &helpEngine, + const QByteArray &mainWindow); + + static const QByteArray mainWindowGeometry(const QHelpEngineCore &helpEngine); + static void setMainWindowGeometry(QHelpEngineCore &helpEngine, + const QByteArray &geometry); + + static bool usesAppFont(const QHelpEngineCore &helpEngine); + static void setUseAppFont(QHelpEngineCore &helpEngine, bool useAppFont); + + static bool usesBrowserFont(const QHelpEngineCore &helpEngine); + static void setUseBrowserFont(QHelpEngineCore &helpEngine, + bool useBrowserFont); + + static const QFont appFont(const QHelpEngineCore &helpEngine); + static void setAppFont(QHelpEngineCore &helpEngine, const QFont &font); + + static QFontDatabase::WritingSystem appWritingSystem(const QHelpEngineCore &helpEngine); + static void setAppWritingSystem(QHelpEngineCore &helpEngine, + QFontDatabase::WritingSystem system); + + static const QFont browserFont(const QHelpEngineCore &helpEngine); + static void setBrowserFont(QHelpEngineCore &helpEngine, const QFont &font); + + static QFontDatabase::WritingSystem browserWritingSystem(const QHelpEngineCore &helpEngine); + static void setBrowserWritingSystem(QHelpEngineCore &helpEngine, + QFontDatabase::WritingSystem system); + + static bool unfilteredInserted(const QHelpEngineCore &helpEngine); + static void setUnfilteredInserted(QHelpEngineCore &helpEngine); + + static const QStringList qtDocInfo(const QHelpEngineCore &helpEngine, + const QString &component); + static void setQtDocInfo(QHelpEngineCore &helpEngine, + const QString &component, const QStringList &doc); + + static bool searchWasAttached(const QHelpEngineCore &helpEngine); + static void setSearchWasAttached(QHelpEngineCore &helpEngine, bool attached); + + static bool hasFontSettings(const QHelpEngineCore &helpEngine); + static bool isNewer(const QHelpEngineCore &newer, + const QHelpEngineCore &older); + static void copyConfiguration(const QHelpEngineCore &source, + QHelpEngineCore &target); + + static const QString DefaultZoomFactor; +}; + +QT_END_NAMESPACE + +#endif // COLLECTIONCONFIGURATION_H -- cgit v0.12 From 8226392be3ea450f8b3f418fb4defd6dc36210f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Tue, 24 Nov 2009 10:40:26 +0100 Subject: Fix NSMenuDelegate protocol implementation. The member function is called menuDidClose, not menuWillClose. --- src/gui/widgets/qcocoamenu_mac.mm | 2 +- src/gui/widgets/qcocoamenu_mac_p.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/widgets/qcocoamenu_mac.mm b/src/gui/widgets/qcocoamenu_mac.mm index fb91aed..c442d5b 100644 --- a/src/gui/widgets/qcocoamenu_mac.mm +++ b/src/gui/widgets/qcocoamenu_mac.mm @@ -100,7 +100,7 @@ QT_USE_NAMESPACE qt_mac_menu_collapseSeparators(menu, qtmenu->separatorsCollapsible()); } -- (void)menuWillClose:(NSMenu*)menu; +- (void)menuDidClose:(NSMenu*)menu; { qt_mac_emit_menuSignals(((QT_MANGLE_NAMESPACE(QCocoaMenu) *)menu)->qmenu, false); } diff --git a/src/gui/widgets/qcocoamenu_mac_p.h b/src/gui/widgets/qcocoamenu_mac_p.h index 617f0e9..0c8989a 100644 --- a/src/gui/widgets/qcocoamenu_mac_p.h +++ b/src/gui/widgets/qcocoamenu_mac_p.h @@ -61,7 +61,7 @@ QT_FORWARD_DECLARE_CLASS(QMenu) @protocol NSMenuDelegate - (void)menu:(NSMenu*)menu willHighlightItem:(NSMenuItem*)item; - (void)menuWillOpen:(NSMenu*)menu; -- (void)menuWillClose:(NSMenu*)menu; +- (void)menuDidClose:(NSMenu*)menu; - (BOOL)hasShortcut:(NSMenu *)menu forKey:(NSString *)key forModifiers:(NSUInteger)modifier whichItem:(NSMenuItem**)outItem; @end -- cgit v0.12 From a51ccecc887c38fe9d067e52ca99d3ec78e64c2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Tue, 24 Nov 2009 10:56:54 +0100 Subject: Implement menu hovering for native Mac menus. Set the status text, emit QMenu::hovered and QAction::hovered. --- src/gui/kernel/qaction.h | 3 +++ src/gui/widgets/qcocoamenu_mac.mm | 31 ++++++++++++++++++++++++++++--- src/gui/widgets/qcocoamenu_mac_p.h | 2 ++ src/gui/widgets/qmenu.h | 1 + 4 files changed, 34 insertions(+), 3 deletions(-) diff --git a/src/gui/kernel/qaction.h b/src/gui/kernel/qaction.h index bfc7491..620ff7e 100644 --- a/src/gui/kernel/qaction.h +++ b/src/gui/kernel/qaction.h @@ -246,6 +246,9 @@ private: friend class QMenuBar; friend class QShortcutMap; friend class QToolButton; +#ifdef Q_WS_MAC + friend void qt_mac_clear_status_text(QAction *action); +#endif }; QT_BEGIN_INCLUDE_NAMESPACE diff --git a/src/gui/widgets/qcocoamenu_mac.mm b/src/gui/widgets/qcocoamenu_mac.mm index c442d5b..31f5020 100644 --- a/src/gui/widgets/qcocoamenu_mac.mm +++ b/src/gui/widgets/qcocoamenu_mac.mm @@ -46,6 +46,7 @@ #import #include #include +#include #include @@ -70,6 +71,7 @@ QT_USE_NAMESPACE self = [super init]; if (self) { qmenu = menu; + previousAction = 0; [self setAutoenablesItems:NO]; [self setDelegate:self]; } @@ -81,13 +83,20 @@ QT_USE_NAMESPACE Q_UNUSED(menu); if (!item) { - // ### According to the docs everything will be highlighted. Not sure what we should do in - // Qt, so just return. + if (previousAction) { + qt_mac_clear_status_text(previousAction); + previousAction = 0; + } return; } - if (QAction *action = reinterpret_cast([item tag])) + if (QAction *action = reinterpret_cast([item tag])) { + QMenu *qtmenu = static_cast(menu)->qmenu; + previousAction = action; action->activate(QAction::Hover); + qt_mac_menu_emit_hovered(qtmenu, action); + action->showStatusText(0); // 0 widget -> action's parent + } } - (void)menuWillOpen:(NSMenu*)menu; @@ -103,6 +112,10 @@ QT_USE_NAMESPACE - (void)menuDidClose:(NSMenu*)menu; { qt_mac_emit_menuSignals(((QT_MANGLE_NAMESPACE(QCocoaMenu) *)menu)->qmenu, false); + if (previousAction) { + qt_mac_clear_status_text(previousAction); + previousAction = 0; + } } - (BOOL)hasShortcut:(NSMenu *)menu forKey:(NSString *)key forModifiers:(NSUInteger)modifier @@ -194,6 +207,18 @@ void qt_mac_emit_menuSignals(QMenu *menu, bool show) } qt_mac_menus_open_count += delta; } + +void qt_mac_clear_status_text(QAction *action) +{ + action->d_func()->showStatusText(0, QString()); +} + +void qt_mac_menu_emit_hovered(QMenu *menu, QAction *action) +{ + emit menu->hovered(action); +} + + QT_END_NAMESPACE #endif diff --git a/src/gui/widgets/qcocoamenu_mac_p.h b/src/gui/widgets/qcocoamenu_mac_p.h index 0c8989a..3ad0ab8 100644 --- a/src/gui/widgets/qcocoamenu_mac_p.h +++ b/src/gui/widgets/qcocoamenu_mac_p.h @@ -52,6 +52,7 @@ #include "qmacdefines_mac.h" #ifdef QT_MAC_USE_COCOA +#include #import QT_FORWARD_DECLARE_CLASS(QMenu) @@ -71,6 +72,7 @@ QT_FORWARD_DECLARE_CLASS(QMenu) @interface QT_MANGLE_NAMESPACE(QCocoaMenu) : NSMenu { QMenu *qmenu; + QPointer previousAction; } - (id)initWithQMenu:(QMenu*)menu; - (BOOL)menuHasKeyEquivalent:(NSMenu *)menu forEvent:(NSEvent *)event target:(id *)target action:(SEL *)action; diff --git a/src/gui/widgets/qmenu.h b/src/gui/widgets/qmenu.h index 0346a55..5660301 100644 --- a/src/gui/widgets/qmenu.h +++ b/src/gui/widgets/qmenu.h @@ -415,6 +415,7 @@ private: friend OSStatus qt_mac_menu_event(EventHandlerCallRef, EventRef, void *); friend bool qt_mac_activate_action(OSMenuRef, uint, QAction::ActionEvent, bool); friend void qt_mac_emit_menuSignals(QMenu *, bool); + friend void qt_mac_menu_emit_hovered(QMenu *menu, QAction *action); #endif }; -- cgit v0.12 From 89478a911481a229bcc7d73071f274229ee12991 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Wed, 25 Nov 2009 11:04:18 +0100 Subject: Fix plugin mis-caching issues with universal binaries on Mac Add the current application architecture to the cache key in order to cache plugin information separately for each arch. This prevents Qt from wrongly caching plugin load failures when the archs don't match. --- src/corelib/plugin/qlibrary.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp index 6496876..1298a11 100644 --- a/src/corelib/plugin/qlibrary.cpp +++ b/src/corelib/plugin/qlibrary.cpp @@ -629,6 +629,22 @@ bool QLibraryPrivate::isPlugin(QSettings *settings) .arg((QT_VERSION & 0xff00) >> 8) .arg(QLIBRARY_AS_DEBUG ? QLatin1String("debug") : QLatin1String("false")) .arg(fileName); +#ifdef Q_WS_MAC + // On Mac, add the application arch to the reg key in order to + // cache plugin information separately for each arch. This prevents + // Qt from wrongly caching plugin load failures when the archs + // don't match. +#if defined(__x86_64__) + regkey += QLatin1String("-x86_64"); +#elif defined(__i386__) + regkey += QLatin1String("-i386"); +#elif defined(__ppc64__) + regkey += QLatin1String("-ppc64"); +#elif defined(__ppc__) + regkey += QLatin1String("-ppc"); +#endif +#endif // Q_WS_MAC + QStringList reg; #ifndef QT_NO_SETTINGS if (!settings) { -- cgit v0.12 From c2a4a1b1e06f8b0d02e7b56c9eb0c19fd2fae80a Mon Sep 17 00:00:00 2001 From: ck Date: Wed, 25 Nov 2009 11:38:35 +0100 Subject: Assistant: Add tracing functionality. Reviewed-by: kh1 --- tools/assistant/tools/assistant/tracer.h | 74 ++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 tools/assistant/tools/assistant/tracer.h diff --git a/tools/assistant/tools/assistant/tracer.h b/tools/assistant/tools/assistant/tracer.h new file mode 100644 index 0000000..913c961 --- /dev/null +++ b/tools/assistant/tools/assistant/tracer.h @@ -0,0 +1,74 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef TRACER_H +#define TRACER_H + +#include + +QT_BEGIN_NAMESPACE + +class Tracer +{ +public: + Tracer(const char *func) : m_func(func) + { + qDebug("Entering function %s.", m_func); + } + + ~Tracer() + { + qDebug("Leaving function %s.", m_func); + } + +private: + const char * const m_func; +}; + +QT_END_NAMESPACE + +#ifdef TRACING_REQUESTED +#define TRACE_OBJ Tracer traceObj__(Q_FUNC_INFO); +#else +#define TRACE_OBJ +#endif + +#endif // TRACER_H -- cgit v0.12 From ae2c1d308a461e9b27bd9217d34db398a56e4f70 Mon Sep 17 00:00:00 2001 From: Benjamin Poulain Date: Wed, 25 Nov 2009 12:56:18 +0100 Subject: Fix the tablet device recognition on Windows The unique ID was not taking into account the bits 4, 5, 6, 7 of CSR_TYPE. Those bytes identify similar devices with different flavor/color. The cursor data were also not updated correctly. The information were only updated if the pointer type changes (e.g.: pen to eraser) but not if the physical device change (e.g. stylus to brush). The information are now updated every time a proximity event has a new unique ID. Reviewed-by: Denis Dzyubenko Task-number: QTBUG-1930 --- src/gui/kernel/qapplication_win.cpp | 199 +++++++++++++++++++++--------------- 1 file changed, 115 insertions(+), 84 deletions(-) diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp index e84985e..a3ca01a 100644 --- a/src/gui/kernel/qapplication_win.cpp +++ b/src/gui/kernel/qapplication_win.cpp @@ -243,8 +243,12 @@ static PtrWTGet ptrWTGet = 0; static PACKET localPacketBuf[QT_TABLET_NPACKETQSIZE]; // our own tablet packet queue. HCTX qt_tablet_context; // the hardware context for the tablet (like a window handle) bool qt_tablet_tilt_support; -static void tabletInit(UINT wActiveCsr, HCTX hTab); + +#ifndef QT_NO_TABLETEVENT +static void tabletInit(const quint64 uniqueId, const UINT csr_type, HCTX hTab); +static void tabletUpdateCursor(QTabletDeviceData &tdd, const UINT currentCursor); static void initWinTabFunctions(); // resolve the WINTAB api functions +#endif // QT_NO_TABLETEVENT #ifndef QT_NO_ACCESSIBILITY @@ -256,7 +260,7 @@ extern QWidget* qt_get_tablet_widget(); extern bool qt_sendSpontaneousEvent(QObject*, QEvent*); extern QRegion qt_dirtyRegion(QWidget *); -typedef QHash QTabletCursorInfo; +typedef QHash QTabletCursorInfo; Q_GLOBAL_STATIC(QTabletCursorInfo, tCursorInfo) QTabletDeviceData currentTabletPointer; @@ -791,7 +795,9 @@ void qt_init(QApplicationPrivate *priv, int) if (QApplication::desktopSettingsAware()) qt_set_windows_resources(); +#ifndef QT_NO_TABLETEVENT initWinTabFunctions(); +#endif // QT_NO_TABLETEVENT QApplicationPrivate::inputContext = new QWinInputContext(0); // Read the initial cleartype settings... @@ -2325,25 +2331,43 @@ LRESULT CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam } break; case WT_PROXIMITY: - if (ptrWTPacketsGet) { - bool enteredProximity = LOWORD(lParam) != 0; - PACKET proximityBuffer[QT_TABLET_NPACKETQSIZE]; - int totalPacks = ptrWTPacketsGet(qt_tablet_context, QT_TABLET_NPACKETQSIZE, proximityBuffer); - if (totalPacks > 0 && enteredProximity) { - uint currentCursor = proximityBuffer[0].pkCursor; - if (!tCursorInfo()->contains(currentCursor)) - tabletInit(currentCursor, qt_tablet_context); - currentTabletPointer = tCursorInfo()->value(currentCursor); + + #ifndef QT_NO_TABLETEVENT + if (ptrWTPacketsGet && ptrWTInfo) { + const bool enteredProximity = LOWORD(lParam) != 0; + PACKET proximityBuffer[1]; // we are only interested in the first packet in this case + const int totalPacks = ptrWTPacketsGet(qt_tablet_context, 1, proximityBuffer); + if (totalPacks > 0) { + const UINT currentCursor = proximityBuffer[0].pkCursor; + + UINT csr_physid; + ptrWTInfo(WTI_CURSORS + currentCursor, CSR_PHYSID, &csr_physid); + UINT csr_type; + ptrWTInfo(WTI_CURSORS + currentCursor, CSR_TYPE, &csr_type); + const UINT deviceIdMask = 0xFF6; // device type mask && device color mask + quint64 uniqueId = (csr_type & deviceIdMask); + uniqueId = (uniqueId << 32) | csr_physid; + + // initialising and updating the cursor should be done in response to + // WT_CSRCHANGE. We do it in WT_PROXIMITY because some wintab never send + // the event WT_CSRCHANGE even if asked with CXO_CSRMESSAGES + const QTabletCursorInfo *const globalCursorInfo = tCursorInfo(); + if (!globalCursorInfo->contains(uniqueId)) + tabletInit(uniqueId, csr_type, qt_tablet_context); + + currentTabletPointer = globalCursorInfo->value(uniqueId); + tabletUpdateCursor(currentTabletPointer, currentCursor); } qt_tabletChokeMouse = false; -#ifndef QT_NO_TABLETEVENT + QTabletEvent tabletProximity(enteredProximity ? QEvent::TabletEnterProximity : QEvent::TabletLeaveProximity, QPoint(), QPoint(), QPointF(), currentTabletPointer.currentDevice, currentTabletPointer.currentPointerType, 0, 0, 0, 0, 0, 0, 0, currentTabletPointer.llId); QApplication::sendEvent(qApp, &tabletProximity); -#endif // QT_NO_TABLETEVENT } + #endif // QT_NO_TABLETEVENT + break; #ifdef Q_WS_WINCE_WM case WM_SETFOCUS: { @@ -3317,63 +3341,57 @@ bool QETWidget::translateWheelEvent(const MSG &msg) // the following is adapted from the wintab syspress example (public domain) /* -------------------------------------------------------------------------- */ -static void tabletInit(UINT wActiveCsr, HCTX hTab) +// Initialize the "static" information of a cursor device (pen, airbrush, etc). +// The QTabletDeviceData is initialized with the data that do not change in time +// (number of button, type of device, etc) but do not initialize the variable data +// (e.g.: pen or eraser) +#ifndef QT_NO_TABLETEVENT + +static void tabletInit(const quint64 uniqueId, const UINT csr_type, HCTX hTab) { + Q_ASSERT(ptrWTInfo); + Q_ASSERT(ptrWTGet); + + Q_ASSERT(!tCursorInfo()->contains(uniqueId)); + /* browse WinTab's many info items to discover pressure handling. */ - if (ptrWTInfo && ptrWTGet) { - AXIS np; - LOGCONTEXT lc; - BYTE wPrsBtn; - BYTE logBtns[32]; - UINT size; - - /* discover the LOGICAL button generated by the pressure channel. */ - /* get the PHYSICAL button from the cursor category and run it */ - /* through that cursor's button map (usually the identity map). */ - wPrsBtn = (BYTE)-1; - ptrWTInfo(WTI_CURSORS + wActiveCsr, CSR_NPBUTTON, &wPrsBtn); - size = ptrWTInfo(WTI_CURSORS + wActiveCsr, CSR_BUTTONMAP, &logBtns); - if ((UINT)wPrsBtn < size) - wPrsBtn = logBtns[wPrsBtn]; - - /* get the current context for its device variable. */ - ptrWTGet(hTab, &lc); - - /* get the size of the pressure axis. */ - QTabletDeviceData tdd; - ptrWTInfo(WTI_DEVICES + lc.lcDevice, DVC_NPRESSURE, &np); - tdd.minPressure = int(np.axMin); - tdd.maxPressure = int(np.axMax); - - ptrWTInfo(WTI_DEVICES + lc.lcDevice, DVC_TPRESSURE, &np); - tdd.minTanPressure = int(np.axMin); - tdd.maxTanPressure = int(np.axMax); - - LOGCONTEXT lcMine; - - /* get default region */ - ptrWTInfo(WTI_DEFCONTEXT, 0, &lcMine); - - tdd.minX = 0; - tdd.maxX = int(lcMine.lcInExtX) - int(lcMine.lcInOrgX); - - tdd.minY = 0; - tdd.maxY = int(lcMine.lcInExtY) - int(lcMine.lcInOrgY); - - tdd.minZ = 0; - tdd.maxZ = int(lcMine.lcInExtZ) - int(lcMine.lcInOrgZ); - - int csr_type, - csr_physid; - ptrWTInfo(WTI_CURSORS + wActiveCsr, CSR_TYPE, &csr_type); - ptrWTInfo(WTI_CURSORS + wActiveCsr, CSR_PHYSID, &csr_physid); - tdd.llId = csr_type & 0x0F06; - tdd.llId = (tdd.llId << 24) | csr_physid; -#ifndef QT_NO_TABLETEVENT - if (((csr_type & 0x0006) == 0x0002) && ((csr_type & 0x0F06) != 0x0902)) { - tdd.currentDevice = QTabletEvent::Stylus; - } else { - switch (csr_type & 0x0F06) { + AXIS np; + LOGCONTEXT lc; + + /* get the current context for its device variable. */ + ptrWTGet(hTab, &lc); + + /* get the size of the pressure axis. */ + QTabletDeviceData tdd; + tdd.llId = uniqueId; + + ptrWTInfo(WTI_DEVICES + lc.lcDevice, DVC_NPRESSURE, &np); + tdd.minPressure = int(np.axMin); + tdd.maxPressure = int(np.axMax); + + ptrWTInfo(WTI_DEVICES + lc.lcDevice, DVC_TPRESSURE, &np); + tdd.minTanPressure = int(np.axMin); + tdd.maxTanPressure = int(np.axMax); + + LOGCONTEXT lcMine; + + /* get default region */ + ptrWTInfo(WTI_DEFCONTEXT, 0, &lcMine); + + tdd.minX = 0; + tdd.maxX = int(lcMine.lcInExtX) - int(lcMine.lcInOrgX); + + tdd.minY = 0; + tdd.maxY = int(lcMine.lcInExtY) - int(lcMine.lcInOrgY); + + tdd.minZ = 0; + tdd.maxZ = int(lcMine.lcInExtZ) - int(lcMine.lcInOrgZ); + + const uint cursorTypeBitMask = 0x0F06; // bitmask to find the specific cursor type (see Wacom FAQ) + if (((csr_type & 0x0006) == 0x0002) && ((csr_type & cursorTypeBitMask) != 0x0902)) { + tdd.currentDevice = QTabletEvent::Stylus; + } else { + switch (csr_type & cursorTypeBitMask) { case 0x0802: tdd.currentDevice = QTabletEvent::Stylus; break; @@ -3391,26 +3409,34 @@ static void tabletInit(UINT wActiveCsr, HCTX hTab) break; default: tdd.currentDevice = QTabletEvent::NoDevice; - } - } - - switch (wActiveCsr % 3) { - case 2: - tdd.currentPointerType = QTabletEvent::Eraser; - break; - case 1: - tdd.currentPointerType = QTabletEvent::Pen; - break; - case 0: - tdd.currentPointerType = QTabletEvent::Cursor; - break; - default: - tdd.currentPointerType = QTabletEvent::UnknownPointer; } + } + tCursorInfo()->insert(uniqueId, tdd); +} #endif // QT_NO_TABLETEVENT - tCursorInfo()->insert(wActiveCsr, tdd); + +// Update the "dynamic" informations of a cursor device (pen, airbrush, etc). +// The dynamic information is the information of QTabletDeviceData that can change +// in time (eraser or pen if a device is turned around). +#ifndef QT_NO_TABLETEVENT + +static void tabletUpdateCursor(QTabletDeviceData &tdd, const UINT currentCursor) +{ + switch (currentCursor % 3) { // %3 for dual track + case 0: + tdd.currentPointerType = QTabletEvent::Cursor; + break; + case 1: + tdd.currentPointerType = QTabletEvent::Pen; + break; + case 2: + tdd.currentPointerType = QTabletEvent::Eraser; + break; + default: + tdd.currentPointerType = QTabletEvent::UnknownPointer; } } +#endif // QT_NO_TABLETEVENT bool QETWidget::translateTabletEvent(const MSG &msg, PACKET *localPacketBuf, int numPackets) @@ -3546,6 +3572,10 @@ bool QETWidget::translateTabletEvent(const MSG &msg, PACKET *localPacketBuf, } extern bool qt_is_gui_used; + + +#ifndef QT_NO_TABLETEVENT + static void initWinTabFunctions() { #if defined(Q_OS_WINCE) @@ -3564,6 +3594,7 @@ static void initWinTabFunctions() } #endif // Q_OS_WINCE } +#endif // QT_NO_TABLETEVENT // -- cgit v0.12 From b7e08e88b52f009cbbf3caed56cb8f507feeb3bb Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 26 Nov 2009 20:25:13 +0100 Subject: support @-style list files on the command line Task-number: QTBUG-4099 --- .../lupdate/testdata/good/respfile/lupdatecmd | 2 + .../testdata/good/respfile/project.ts.result | 17 +++ .../lupdate/testdata/good/respfile/source1.cpp | 49 ++++++++ .../lupdate/testdata/good/respfile/source2.cpp | 49 ++++++++ .../lupdate/testdata/good/respfile/sources.lst | 2 + .../lupdate/testdata/good/respfile/tsfiles.lst | 1 + tools/linguist/lupdate/main.cpp | 140 ++++++++++++--------- 7 files changed, 199 insertions(+), 61 deletions(-) create mode 100644 tests/auto/linguist/lupdate/testdata/good/respfile/lupdatecmd create mode 100644 tests/auto/linguist/lupdate/testdata/good/respfile/project.ts.result create mode 100644 tests/auto/linguist/lupdate/testdata/good/respfile/source1.cpp create mode 100644 tests/auto/linguist/lupdate/testdata/good/respfile/source2.cpp create mode 100644 tests/auto/linguist/lupdate/testdata/good/respfile/sources.lst create mode 100644 tests/auto/linguist/lupdate/testdata/good/respfile/tsfiles.lst diff --git a/tests/auto/linguist/lupdate/testdata/good/respfile/lupdatecmd b/tests/auto/linguist/lupdate/testdata/good/respfile/lupdatecmd new file mode 100644 index 0000000..6f198ab --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/respfile/lupdatecmd @@ -0,0 +1,2 @@ +# Add the command that lupdate should run here. If it can't find anything it will default to +lupdate -silent @sources.lst -ts @tsfiles.lst diff --git a/tests/auto/linguist/lupdate/testdata/good/respfile/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/respfile/project.ts.result new file mode 100644 index 0000000..3a864a2 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/respfile/project.ts.result @@ -0,0 +1,17 @@ + + + + + Dialog2 + + + func1 + + + + + func2 + + + + diff --git a/tests/auto/linguist/lupdate/testdata/good/respfile/source1.cpp b/tests/auto/linguist/lupdate/testdata/good/respfile/source1.cpp new file mode 100644 index 0000000..33642c4 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/respfile/source1.cpp @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +// IMPORTANT!!!! If you want to add testdata to this file, +// always add it to the end in order to not change the linenumbers of translations!!! + +void Dialog2::func3() +{ + tr("func1"); +} + diff --git a/tests/auto/linguist/lupdate/testdata/good/respfile/source2.cpp b/tests/auto/linguist/lupdate/testdata/good/respfile/source2.cpp new file mode 100644 index 0000000..8e496a8 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/respfile/source2.cpp @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +// IMPORTANT!!!! If you want to add testdata to this file, +// always add it to the end in order to not change the linenumbers of translations!!! + +void Dialog2::func3() +{ + tr("func2"); +} + diff --git a/tests/auto/linguist/lupdate/testdata/good/respfile/sources.lst b/tests/auto/linguist/lupdate/testdata/good/respfile/sources.lst new file mode 100644 index 0000000..430937e --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/respfile/sources.lst @@ -0,0 +1,2 @@ +source1.cpp +source2.cpp diff --git a/tests/auto/linguist/lupdate/testdata/good/respfile/tsfiles.lst b/tests/auto/linguist/lupdate/testdata/good/respfile/tsfiles.lst new file mode 100644 index 0000000..f3eb71f --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/respfile/tsfiles.lst @@ -0,0 +1 @@ +project.ts diff --git a/tools/linguist/lupdate/main.cpp b/tools/linguist/lupdate/main.cpp index 9a9af68..5be13e1 100644 --- a/tools/linguist/lupdate/main.cpp +++ b/tools/linguist/lupdate/main.cpp @@ -84,7 +84,7 @@ static void printUsage() printOut(QObject::tr( "Usage:\n" " lupdate [options] [project-file]...\n" - " lupdate [options] [source-file|path]... -ts ts-files\n\n" + " lupdate [options] [source-file|path|@lst-file]... -ts ts-files|@lst-file\n\n" "lupdate is part of Qt's Linguist tool chain. It extracts translatable\n" "messages from Qt UI files, C++, Java and JavaScript/QtScript source code.\n" "Extracted messages are stored in textual translation source files (typically\n" @@ -128,6 +128,8 @@ static void printUsage() " Guessed from the file name if not specified.\n" " -version\n" " Display the version of lupdate and exit.\n" + " @lst-file\n" + " Read additional file names (one per line) from lst-file.\n" ).arg(m_defaultExtensions)); } @@ -374,78 +376,94 @@ int main(int argc, char **argv) } numFiles++; - - QString fullText; + QStringList files; + if (arg.startsWith(QLatin1String("@"))) { + QFile lstFile(arg.mid(1)); + if (!lstFile.open(QIODevice::ReadOnly)) { + qWarning("lupdate error: List file '%s' is not readable", + qPrintable(lstFile.fileName())); + return 1; + } + while (!lstFile.atEnd()) + files << QString::fromLocal8Bit(lstFile.readLine().trimmed()); + } else { + files << arg; + } codecForTr.clear(); codecForSource.clear(); if (metTsFlag) { - bool found = false; - foreach (const Translator::FileFormat &fmt, Translator::registeredFileFormats()) { - if (arg.endsWith(QLatin1Char('.') + fmt.extension, Qt::CaseInsensitive)) { - QFileInfo fi(arg); - if (!fi.exists() || fi.isWritable()) { - tsFileNames.append(QFileInfo(arg).absoluteFilePath()); - } else { - qWarning("lupdate warning: For some reason, '%s' is not writable.\n", - qPrintable(arg)); + foreach (const QString &file, files) { + bool found = false; + foreach (const Translator::FileFormat &fmt, Translator::registeredFileFormats()) { + if (file.endsWith(QLatin1Char('.') + fmt.extension, Qt::CaseInsensitive)) { + QFileInfo fi(file); + if (!fi.exists() || fi.isWritable()) { + tsFileNames.append(QFileInfo(file).absoluteFilePath()); + } else { + qWarning("lupdate warning: For some reason, '%s' is not writable.\n", + qPrintable(file)); + } + found = true; + break; } - found = true; - break; + } + if (!found) { + qWarning("lupdate error: File '%s' has no recognized extension\n", + qPrintable(file)); + return 1; } } - if (!found) { - qWarning("lupdate error: File '%s' has no recognized extension\n", - qPrintable(arg)); - return 1; - } - } else if (arg.endsWith(QLatin1String(".pro"), Qt::CaseInsensitive) - || arg.endsWith(QLatin1String(".pri"), Qt::CaseInsensitive)) { - proFiles << arg; } else { - QFileInfo fi(arg); - if (!fi.exists()) { - qWarning("lupdate error: File '%s' does not exists\n", qPrintable(arg)); - return 1; - } else if (fi.isDir()) { - if (options & Verbose) - printOut(QObject::tr("Scanning directory '%1'...").arg(arg)); - QDir dir = QDir(fi.filePath()); - projectRoots.insert(dir.absolutePath() + QLatin1Char('/')); - if (extensionsNameFilters.isEmpty()) { - foreach (QString ext, extensions.split(QLatin1Char(','))) { - ext = ext.trimmed(); - if (ext.startsWith(QLatin1Char('.'))) - ext.remove(0, 1); - extensionsNameFilters.insert(ext); - } + foreach (const QString &file, files) { + QFileInfo fi(file); + if (!fi.exists()) { + qWarning("lupdate error: File '%s' does not exists\n", qPrintable(file)); + return 1; } - QDir::Filters filters = QDir::Files | QDir::NoSymLinks; - if (recursiveScan) - filters |= QDir::AllDirs | QDir::NoDotAndDotDot; - QFileInfoList fileinfolist; - recursiveFileInfoList(dir, extensionsNameFilters, filters, &fileinfolist); - int scanRootLen = dir.absolutePath().length(); - foreach (const QFileInfo &fi, fileinfolist) { - QString fn = QDir::cleanPath(fi.absoluteFilePath()); - sourceFiles << fn; - - if (!fn.endsWith(QLatin1String(".java")) - && !fn.endsWith(QLatin1String(".ui")) - && !fn.endsWith(QLatin1String(".js")) - && !fn.endsWith(QLatin1String(".qs"))) { - int offset = 0; - int depth = 0; - do { - offset = fn.lastIndexOf(QLatin1Char('/'), offset - 1); - QString ffn = fn.mid(offset + 1); - allCSources.insert(ffn, fn); - } while (++depth < 3 && offset > scanRootLen); + if (file.endsWith(QLatin1String(".pro"), Qt::CaseInsensitive) + || file.endsWith(QLatin1String(".pri"), Qt::CaseInsensitive)) { + proFiles << file; + } else if (fi.isDir()) { + if (options & Verbose) + printOut(QObject::tr("Scanning directory '%1'...").arg(file)); + QDir dir = QDir(fi.filePath()); + projectRoots.insert(dir.absolutePath() + QLatin1Char('/')); + if (extensionsNameFilters.isEmpty()) { + foreach (QString ext, extensions.split(QLatin1Char(','))) { + ext = ext.trimmed(); + if (ext.startsWith(QLatin1Char('.'))) + ext.remove(0, 1); + extensionsNameFilters.insert(ext); + } + } + QDir::Filters filters = QDir::Files | QDir::NoSymLinks; + if (recursiveScan) + filters |= QDir::AllDirs | QDir::NoDotAndDotDot; + QFileInfoList fileinfolist; + recursiveFileInfoList(dir, extensionsNameFilters, filters, &fileinfolist); + int scanRootLen = dir.absolutePath().length(); + foreach (const QFileInfo &fi, fileinfolist) { + QString fn = QDir::cleanPath(fi.absoluteFilePath()); + sourceFiles << fn; + + if (!fn.endsWith(QLatin1String(".java")) + && !fn.endsWith(QLatin1String(".ui")) + && !fn.endsWith(QLatin1String(".js")) + && !fn.endsWith(QLatin1String(".qs"))) { + int offset = 0; + int depth = 0; + do { + offset = fn.lastIndexOf(QLatin1Char('/'), offset - 1); + QString ffn = fn.mid(offset + 1); + allCSources.insert(ffn, fn); + } while (++depth < 3 && offset > scanRootLen); + } } + } else { + sourceFiles << QDir::cleanPath(fi.absoluteFilePath());; } - } else { - sourceFiles << QDir::cleanPath(fi.absoluteFilePath());; } } } // for args -- cgit v0.12 From 14fcc4890cf41c17e69853ca7cafd14c947ba7b1 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 27 Nov 2009 19:44:10 +0100 Subject: trolltech => nokia --- tools/linguist/linguist/mainwindow.ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/linguist/linguist/mainwindow.ui b/tools/linguist/linguist/mainwindow.ui index b182f27..108cbea 100644 --- a/tools/linguist/linguist/mainwindow.ui +++ b/tools/linguist/linguist/mainwindow.ui @@ -679,7 +679,7 @@ About Qt - Display information about the Qt toolkit by Trolltech. + Display information about the Qt toolkit by Nokia. QAction::AboutQtRole -- cgit v0.12 From 5c488b7e15dbd5ee08a909e4dcc997a58ba63a2d Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 23 Nov 2009 17:04:49 +0100 Subject: Adjust documentation on QCombobox::maxVisibleItems to mention that this does not work with gtk. Also fixed the fact that it would show one item to many. Task-number: QTBUG-760 Reviewed-by: jbache --- src/gui/widgets/qcombobox.cpp | 5 +++-- tests/auto/qcombobox/tst_qcombobox.cpp | 30 ++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/src/gui/widgets/qcombobox.cpp b/src/gui/widgets/qcombobox.cpp index bd1d8ba..ea65a40 100644 --- a/src/gui/widgets/qcombobox.cpp +++ b/src/gui/widgets/qcombobox.cpp @@ -1265,7 +1265,8 @@ QComboBox::~QComboBox() By default, this property has a value of 10. - \note This property is ignored for non-editable comboboxes in Mac style. + \note This property is ignored for non-editable comboboxes in styles that returns + false for QStyle::SH_ComboBox_Popup such as the Mac style or the Gtk+ Style. */ int QComboBox::maxVisibleItems() const { @@ -2345,7 +2346,7 @@ void QComboBox::showPopup() toCheck.push(idx); #endif ++count; - if (!usePopup && count > d->maxVisibleItems) { + if (!usePopup && count >= d->maxVisibleItems) { toCheck.clear(); break; } diff --git a/tests/auto/qcombobox/tst_qcombobox.cpp b/tests/auto/qcombobox/tst_qcombobox.cpp index af71961..941494f 100644 --- a/tests/auto/qcombobox/tst_qcombobox.cpp +++ b/tests/auto/qcombobox/tst_qcombobox.cpp @@ -156,6 +156,7 @@ private slots: void resetModel(); void keyBoardNavigationWithMouse(); void task_QTBUG_1071_changingFocusEmitsActivated(); + void maxVisibleItems(); protected slots: void onEditTextChanged( const QString &newString ); @@ -2527,5 +2528,34 @@ void tst_QComboBox::task_QTBUG_1071_changingFocusEmitsActivated() QTRY_COMPARE(spy.count(), 1); } +void tst_QComboBox::maxVisibleItems() +{ + QComboBox comboBox; + QCOMPARE(comboBox.maxVisibleItems(), 10); //default value. + + QStringList content; + for(int i = 1; i < 50; i++) + content += QString::number(i); + + comboBox.addItems(content); + comboBox.show(); + comboBox.resize(200, comboBox.height()); + QTRY_VERIFY(comboBox.isVisible()); + + comboBox.setMaxVisibleItems(5); + QCOMPARE(comboBox.maxVisibleItems(), 5); + + comboBox.showPopup(); + QTRY_VERIFY(comboBox.view()); + QTRY_VERIFY(comboBox.view()->isVisible()); + + QAbstractItemView *v = comboBox.view(); + int itemHeight = v->visualRect(v->model()->index(0,0)).height(); + if (v->style()->styleHint(QStyle::SH_ComboBox_Popup)) + QCOMPARE(v->viewport()->height(), itemHeight * comboBox.maxVisibleItems()); + // QCombobox without a popup does not work, see QTBUG-760 +} + + QTEST_MAIN(tst_QComboBox) #include "tst_qcombobox.moc" -- cgit v0.12 From f3ac20ac8100142cde0accfb72eab48590303c4a Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Sat, 28 Nov 2009 16:19:38 +0100 Subject: Reduce the code duplication within QMetaObject::indexOf{Signal,Slot,Method} This also change the bounds of the checked method by using the signalCount as a hint Reviewed-by: Brad --- src/corelib/kernel/qmetaobject.cpp | 66 ++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 34 deletions(-) diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp index 6e6da19..ad9db09 100644 --- a/src/corelib/kernel/qmetaobject.cpp +++ b/src/corelib/kernel/qmetaobject.cpp @@ -482,6 +482,31 @@ int QMetaObject::classInfoCount() const return n; } +/** \internal +* helper class for indexOf{Method,Slot,Signal}, returns the relative index of the method within +* the baseObject +* \a MethodType might be MethodSignal or MethodSlot, or 0 to match everything. +*/ +template +static inline int indexOfMethodRelative(const QMetaObject **baseObject, const char *method) +{ + while (*baseObject) { + const QMetaObject *const m = *baseObject; + int i = (MethodType == MethodSignal && priv(m->d.data)->revision >= 4) + ? (priv(m->d.data)->signalCount - 1) : (priv(m->d.data)->methodCount - 1); + const int end = (MethodType == MethodSlot && priv(m->d.data)->revision >= 4) + ? (priv(m->d.data)->signalCount - 1) : 0; + for (; i >= end; --i) { + if ((MethodType == 0 || (m->d.data[priv(m->d.data)->methodData + 5*i + 4] & MethodTypeMask) == MethodType) + && strcmp(method, m->d.stringdata + m->d.data[priv(m->d.data)->methodData + 5*i]) == 0) + return i; + } + *baseObject = m->d.superdata; + } + return -1; +} + + /*! \since 4.5 @@ -515,17 +540,10 @@ int QMetaObject::indexOfConstructor(const char *constructor) const */ int QMetaObject::indexOfMethod(const char *method) const { - int i = -1; const QMetaObject *m = this; - while (m && i < 0) { - for (i = priv(m->d.data)->methodCount-1; i >= 0; --i) - if (strcmp(method, m->d.stringdata - + m->d.data[priv(m->d.data)->methodData + 5*i]) == 0) { - i += m->methodOffset(); - break; - } - m = m->d.superdata; - } + int i = indexOfMethodRelative<0>(&m, method); + if (i >= 0) + i += m->methodOffset(); return i; } @@ -556,19 +574,7 @@ int QMetaObject::indexOfSignal(const char *signal) const */ int QMetaObjectPrivate::indexOfSignalRelative(const QMetaObject **baseObject, const char *signal) { - int i = -1; - while (*baseObject) { - const QMetaObject *const m = *baseObject; - for (i = priv(m->d.data)->methodCount-1; i >= 0; --i) - if ((m->d.data[priv(m->d.data)->methodData + 5*i + 4] & MethodTypeMask) == MethodSignal - && strcmp(signal, m->d.stringdata - + m->d.data[priv(m->d.data)->methodData + 5*i]) == 0) { - break; - } - if (i >= 0) - break; - *baseObject = m->d.superdata; - } + int i = indexOfMethodRelative(baseObject, signal); #ifndef QT_NO_DEBUG const QMetaObject *m = *baseObject; if (i >= 0 && m && m->d.superdata) { @@ -592,18 +598,10 @@ int QMetaObjectPrivate::indexOfSignalRelative(const QMetaObject **baseObject, co */ int QMetaObject::indexOfSlot(const char *slot) const { - int i = -1; const QMetaObject *m = this; - while (m && i < 0) { - for (i = priv(m->d.data)->methodCount-1; i >= 0; --i) - if ((m->d.data[priv(m->d.data)->methodData + 5*i + 4] & MethodTypeMask) == MethodSlot - && strcmp(slot, m->d.stringdata - + m->d.data[priv(m->d.data)->methodData + 5*i]) == 0) { - i += m->methodOffset(); - break; - } - m = m->d.superdata; - } + int i = indexOfMethodRelative(&m, slot); + if (i >= 0) + i += m->methodOffset(); return i; } -- cgit v0.12 From b881d8fb99972f1bd04ab4c84843cc8d43ddbeed Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Tue, 17 Nov 2009 12:51:16 +0100 Subject: Fix certain type-const-ref syntax not recognized by normalizedSignature() Normally, const Type & is normalized to just Type, but this didn't work for Templateconst& or Type*const& types. This now works as expected. However, this changes the way these types are normalized, and existing code using the old syntax will break. We can prevent this breakage by also normalizing the method signature in the metaobject when looking up signals and slots in QObject::connect(). I have added an autotest for this, which includes moc output generated by Qt 4.6's moc. This means we need to bump the metaobject revision number even though we are not adding any new data (only changing the normalized strings we store). Task-number: QTBUG-2407 Task-number: QTBUG-3722 Reviewed-by: ogoffart --- src/corelib/kernel/qmetaobject.cpp | 58 ++++++--- src/corelib/kernel/qmetaobject_p.h | 24 +++- src/corelib/kernel/qobject.cpp | 36 ++++-- src/tools/moc/generator.cpp | 2 +- tests/auto/qobject/moc_oldnormalizeobject.cpp | 118 ++++++++++++++++++ tests/auto/qobject/oldnormalizeobject.h | 28 +++++ tests/auto/qobject/tst_qobject.cpp | 172 ++++++++++++++++++++++++++ tests/auto/qobject/tst_qobject.pro | 22 ++-- 8 files changed, 424 insertions(+), 36 deletions(-) create mode 100644 tests/auto/qobject/moc_oldnormalizeobject.cpp create mode 100644 tests/auto/qobject/oldnormalizeobject.h diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp index ad9db09..bc1e8dcc 100644 --- a/src/corelib/kernel/qmetaobject.cpp +++ b/src/corelib/kernel/qmetaobject.cpp @@ -488,18 +488,30 @@ int QMetaObject::classInfoCount() const * \a MethodType might be MethodSignal or MethodSlot, or 0 to match everything. */ template -static inline int indexOfMethodRelative(const QMetaObject **baseObject, const char *method) +static inline int indexOfMethodRelative(const QMetaObject **baseObject, + const char *method, + bool normalizeStringData) { while (*baseObject) { const QMetaObject *const m = *baseObject; int i = (MethodType == MethodSignal && priv(m->d.data)->revision >= 4) - ? (priv(m->d.data)->signalCount - 1) : (priv(m->d.data)->methodCount - 1); + ? (priv(m->d.data)->signalCount - 1) : (priv(m->d.data)->methodCount - 1); const int end = (MethodType == MethodSlot && priv(m->d.data)->revision >= 4) - ? (priv(m->d.data)->signalCount - 1) : 0; - for (; i >= end; --i) { - if ((MethodType == 0 || (m->d.data[priv(m->d.data)->methodData + 5*i + 4] & MethodTypeMask) == MethodType) - && strcmp(method, m->d.stringdata + m->d.data[priv(m->d.data)->methodData + 5*i]) == 0) - return i; + ? (priv(m->d.data)->signalCount - 1) : 0; + if (!normalizeStringData) { + for (; i >= end; --i) { + if ((MethodType == 0 || (m->d.data[priv(m->d.data)->methodData + 5*i + 4] & MethodTypeMask) == MethodType) + && strcmp(method, m->d.stringdata + m->d.data[priv(m->d.data)->methodData + 5*i]) == 0) + return i; + } + } else if (priv(m->d.data)->revision < 5) { + const char *stringdata = (m->d.stringdata + m->d.data[priv(m->d.data)->methodData + 5 * i]); + const QByteArray normalizedSignature = QMetaObject::normalizedSignature(stringdata); + for (; i >= end; --i) { + if ((MethodType == 0|| (m->d.data[priv(m->d.data)->methodData + 5*i + 4] & MethodTypeMask) == MethodType) + && normalizedSignature == method) + return i; + } } *baseObject = m->d.superdata; } @@ -541,7 +553,11 @@ int QMetaObject::indexOfConstructor(const char *constructor) const int QMetaObject::indexOfMethod(const char *method) const { const QMetaObject *m = this; - int i = indexOfMethodRelative<0>(&m, method); + int i = indexOfMethodRelative<0>(&m, method, false); + if (i < 0) { + m = this; + i = indexOfMethodRelative<0>(&m, method, true); + } if (i >= 0) i += m->methodOffset(); return i; @@ -561,7 +577,11 @@ int QMetaObject::indexOfMethod(const char *method) const int QMetaObject::indexOfSignal(const char *signal) const { const QMetaObject *m = this; - int i = QMetaObjectPrivate::indexOfSignalRelative(&m, signal); + int i = QMetaObjectPrivate::indexOfSignalRelative(&m, signal, false); + if (i < 0) { + m = this; + i = QMetaObjectPrivate::indexOfSignalRelative(&m, signal, true); + } if (i >= 0) i += m->methodOffset(); return i; @@ -572,9 +592,11 @@ int QMetaObject::indexOfSignal(const char *signal) const \a baseObject will be adjusted to the enclosing QMetaObject, or 0 if the signal is not found */ -int QMetaObjectPrivate::indexOfSignalRelative(const QMetaObject **baseObject, const char *signal) +int QMetaObjectPrivate::indexOfSignalRelative(const QMetaObject **baseObject, + const char *signal, + bool normalizeStringData) { - int i = indexOfMethodRelative(baseObject, signal); + int i = indexOfMethodRelative(baseObject, signal, normalizeStringData); #ifndef QT_NO_DEBUG const QMetaObject *m = *baseObject; if (i >= 0 && m && m->d.superdata) { @@ -587,7 +609,6 @@ int QMetaObjectPrivate::indexOfSignalRelative(const QMetaObject **baseObject, co return i; } - /*! Finds \a slot and returns its index; otherwise returns -1. @@ -598,8 +619,17 @@ int QMetaObjectPrivate::indexOfSignalRelative(const QMetaObject **baseObject, co */ int QMetaObject::indexOfSlot(const char *slot) const { - const QMetaObject *m = this; - int i = indexOfMethodRelative(&m, slot); + int i = QMetaObjectPrivate::indexOfSlot(this, slot, false); + if (i < 0) + i = QMetaObjectPrivate::indexOfSlot(this, slot, true); + return i; +} + +int QMetaObjectPrivate::indexOfSlot(const QMetaObject *m, + const char *slot, + bool normalizeStringData) +{ + int i = indexOfMethodRelative(&m, slot, normalizeStringData); if (i >= 0) i += m->methodOffset(); return i; diff --git a/src/corelib/kernel/qmetaobject_p.h b/src/corelib/kernel/qmetaobject_p.h index b5a7530..7afb70b 100644 --- a/src/corelib/kernel/qmetaobject_p.h +++ b/src/corelib/kernel/qmetaobject_p.h @@ -115,11 +115,17 @@ struct QMetaObjectPrivate int constructorCount, constructorData; //since revision 2 int flags; //since revision 3 int signalCount; //since revision 4 + // revision 5 introduces changes in normalized signatures, no new members static inline const QMetaObjectPrivate *get(const QMetaObject *metaobject) { return reinterpret_cast(metaobject->d.data); } - static int indexOfSignalRelative(const QMetaObject **baseObject, const char* name); + static int indexOfSignalRelative(const QMetaObject **baseObject, + const char* name, + bool normalizeStringData); + static int indexOfSlot(const QMetaObject *m, + const char *slot, + bool normalizeStringData); static int originalClone(const QMetaObject *obj, int local_method_index); #ifndef QT_NO_QOBJECT @@ -245,6 +251,7 @@ static QByteArray normalizeTypeInternal(const char *t, const char *e, bool fixSc } while (optional[++i].keyword != 0); } + bool star = false; while (t != e) { char c = *t++; if (fixScope && c == ':' && *t == ':' ) { @@ -255,6 +262,7 @@ static QByteArray normalizeTypeInternal(const char *t, const char *e, bool fixSc --i; result.resize(i + 1); } + star = star || c == '*'; result += c; if (c == '<') { //template recursion @@ -275,6 +283,20 @@ static QByteArray normalizeTypeInternal(const char *t, const char *e, bool fixSc } } } + + // cv qualifers can appear after the type as well + if (t != e && (e - t >= 5 && strncmp("const", t, 5) == 0)) { + t += 5; + while (t != e && is_space(*t)) + ++t; + if (adjustConst && t != e && *t == '&') { + // treat const ref as value + ++t; + } else if (!star) { + // move const to the front (but not if const comes after a *) + result.prepend("const "); + } + } } return result; diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 95602d9..52c94e9 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -2522,20 +2522,25 @@ bool QObject::connect(const QObject *sender, const char *signal, const QMetaObject *smeta = sender->metaObject(); const char *signal_arg = signal; ++signal; //skip code - int signal_index = QMetaObjectPrivate::indexOfSignalRelative(&smeta, signal); + int signal_index = QMetaObjectPrivate::indexOfSignalRelative(&smeta, signal, false); if (signal_index < 0) { // check for normalized signatures tmp_signal_name = QMetaObject::normalizedSignature(signal - 1); signal = tmp_signal_name.constData() + 1; smeta = sender->metaObject(); - signal_index = QMetaObjectPrivate::indexOfSignalRelative(&smeta, signal); + signal_index = QMetaObjectPrivate::indexOfSignalRelative(&smeta, signal, false); + } + if (signal_index < 0) { + // re-use tmp_signal_name and signal from above - if (signal_index < 0) { - err_method_notfound(sender, signal_arg, "connect"); - err_info_about_objects("connect", sender, receiver); - return false; - } + smeta = sender->metaObject(); + signal_index = QMetaObjectPrivate::indexOfSignalRelative(&smeta, signal, true); + } + if (signal_index < 0) { + err_method_notfound(sender, signal_arg, "connect"); + err_info_about_objects("connect", sender, receiver); + return false; } signal_index = QMetaObjectPrivate::originalClone(smeta, signal_index); int signalOffset, methodOffset; @@ -2555,16 +2560,21 @@ bool QObject::connect(const QObject *sender, const char *signal, int method_index = -1; switch (membcode) { case QSLOT_CODE: - method_index = rmeta->indexOfSlot(method); + method_index = QMetaObjectPrivate::indexOfSlot(rmeta, method, false); break; case QSIGNAL_CODE: - method_index = rmeta->indexOfSignal(method); + method_index = QMetaObjectPrivate::indexOfSignalRelative(&rmeta, method, false); + if (method_index >= 0) + method_index += rmeta->methodOffset(); break; } if (method_index < 0) { // check for normalized methods tmp_method_name = QMetaObject::normalizedSignature(method); method = tmp_method_name.constData(); + + // rmeta may have been modified above + rmeta = receiver->metaObject(); switch (membcode) { case QSLOT_CODE: method_index = rmeta->indexOfSlot(method); @@ -2752,7 +2762,9 @@ bool QObject::disconnect(const QObject *sender, const char *signal, do { int signal_index = -1; if (signal) { - signal_index = QMetaObjectPrivate::indexOfSignalRelative(&smeta, signal); + signal_index = QMetaObjectPrivate::indexOfSignalRelative(&smeta, signal, false); + if (signal_index < 0) + signal_index = QMetaObjectPrivate::indexOfSignalRelative(&smeta, signal, true); if (signal_index < 0) break; signal_index = QMetaObjectPrivate::originalClone(smeta, signal_index); @@ -3361,7 +3373,9 @@ int QObjectPrivate::signalIndex(const char *signalName) const { Q_Q(const QObject); const QMetaObject *base = q->metaObject(); - int relative_index = QMetaObjectPrivate::indexOfSignalRelative(&base, signalName); + int relative_index = QMetaObjectPrivate::indexOfSignalRelative(&base, signalName, false); + if (relative_index < 0) + relative_index = QMetaObjectPrivate::indexOfSignalRelative(&base, signalName, true); if (relative_index < 0) return relative_index; relative_index = QMetaObjectPrivate::originalClone(base, relative_index); diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp index 1ed6586..b99cb28 100644 --- a/src/tools/moc/generator.cpp +++ b/src/tools/moc/generator.cpp @@ -173,7 +173,7 @@ void Generator::generateCode() int index = 14; fprintf(out, "static const uint qt_meta_data_%s[] = {\n", qualifiedClassNameIdentifier.constData()); fprintf(out, "\n // content:\n"); - fprintf(out, " %4d, // revision\n", 4); + fprintf(out, " %4d, // revision\n", 5); fprintf(out, " %4d, // classname\n", strreg(cdef->qualified)); fprintf(out, " %4d, %4d, // classinfo\n", cdef->classInfoList.count(), cdef->classInfoList.count() ? index : 0); index += cdef->classInfoList.count() * 2; diff --git a/tests/auto/qobject/moc_oldnormalizeobject.cpp b/tests/auto/qobject/moc_oldnormalizeobject.cpp new file mode 100644 index 0000000..4f590ae --- /dev/null +++ b/tests/auto/qobject/moc_oldnormalizeobject.cpp @@ -0,0 +1,118 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'oldnormalizeobject.h' +** +** Created: Wed Nov 18 11:43:05 2009 +** by: The Qt Meta Object Compiler version 62 (Qt 4.7.0) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "../../../../../../master/tests/auto/qobject/oldnormalizeobject.h" +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'oldnormalizeobject.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 62 +#error "This file was generated using the moc from 4.7.0. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +QT_BEGIN_MOC_NAMESPACE +static const uint qt_meta_data_OldNormalizeObject[] = { + + // content: + 4, // revision + 0, // classname + 0, 0, // classinfo + 6, 14, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 3, // signalCount + + // signals: signature, parameters, type, tag, flags + 24, 20, 19, 19, 0x05, + 57, 20, 19, 19, 0x05, + 100, 20, 19, 19, 0x05, + + // slots: signature, parameters, type, tag, flags + 149, 20, 19, 19, 0x0a, + 180, 20, 19, 19, 0x0a, + 221, 20, 19, 19, 0x0a, + + 0 // eod +}; + +static const char qt_meta_stringdata_OldNormalizeObject[] = { + "OldNormalizeObject\0\0ref\0" + "typeRefSignal(Template&)\0" + "constTypeRefSignal(Template)\0" + "typeConstRefSignal(Templateconst&)\0" + "typeRefSlot(Template&)\0" + "constTypeRefSlot(Template)\0" + "typeConstRefSlot(Templateconst&)\0" +}; + +const QMetaObject OldNormalizeObject::staticMetaObject = { + { &QObject::staticMetaObject, qt_meta_stringdata_OldNormalizeObject, + qt_meta_data_OldNormalizeObject, 0 } +}; + +#ifdef Q_NO_DATA_RELOCATION +const QMetaObject &OldNormalizeObject::getStaticMetaObject() { return staticMetaObject; } +#endif //Q_NO_DATA_RELOCATION + +const QMetaObject *OldNormalizeObject::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; +} + +void *OldNormalizeObject::qt_metacast(const char *_clname) +{ + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_OldNormalizeObject)) + return static_cast(const_cast< OldNormalizeObject*>(this)); + return QObject::qt_metacast(_clname); +} + +int OldNormalizeObject::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QObject::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + switch (_id) { + case 0: typeRefSignal((*reinterpret_cast< Template(*)>(_a[1]))); break; + case 1: constTypeRefSignal((*reinterpret_cast< const Template(*)>(_a[1]))); break; + case 2: typeConstRefSignal((*reinterpret_cast< Templateconst(*)>(_a[1]))); break; + case 3: typeRefSlot((*reinterpret_cast< Template(*)>(_a[1]))); break; + case 4: constTypeRefSlot((*reinterpret_cast< const Template(*)>(_a[1]))); break; + case 5: typeConstRefSlot((*reinterpret_cast< Templateconst(*)>(_a[1]))); break; + default: ; + } + _id -= 6; + } + return _id; +} + +// SIGNAL 0 +void OldNormalizeObject::typeRefSignal(Template & _t1) +{ + void *_a[] = { 0, const_cast(reinterpret_cast(&_t1)) }; + QMetaObject::activate(this, &staticMetaObject, 0, _a); +} + +// SIGNAL 1 +void OldNormalizeObject::constTypeRefSignal(const Template & _t1) +{ + void *_a[] = { 0, const_cast(reinterpret_cast(&_t1)) }; + QMetaObject::activate(this, &staticMetaObject, 1, _a); +} + +// SIGNAL 2 +void OldNormalizeObject::typeConstRefSignal(Template const & _t1) +{ + void *_a[] = { 0, const_cast(reinterpret_cast(&_t1)) }; + QMetaObject::activate(this, &staticMetaObject, 2, _a); +} +QT_END_MOC_NAMESPACE diff --git a/tests/auto/qobject/oldnormalizeobject.h b/tests/auto/qobject/oldnormalizeobject.h new file mode 100644 index 0000000..8420a3a --- /dev/null +++ b/tests/auto/qobject/oldnormalizeobject.h @@ -0,0 +1,28 @@ +#ifndef OLDNORMALIZEOBJECT_H +#define OLDNORMALIZEOBJECT_H + +#include + +struct Struct; +class Class; +template class Template; + +// An object with old moc output that incorrectly normalizes 'T const &' in the function +// signatures +class OldNormalizeObject : public QObject +{ + /* tmake ignore Q_OBJECT */ + Q_OBJECT + +signals: + void typeRefSignal(Template &ref); + void constTypeRefSignal(const Template &ref); + void typeConstRefSignal(Template const &ref); + +public slots: + void typeRefSlot(Template &) {} + void constTypeRefSlot(const Template &) {} + void typeConstRefSlot(Template const &) {} +}; + +#endif // OLDNORMALIZEOBJECT_H diff --git a/tests/auto/qobject/tst_qobject.cpp b/tests/auto/qobject/tst_qobject.cpp index 5035139..b296e1b 100644 --- a/tests/auto/qobject/tst_qobject.cpp +++ b/tests/auto/qobject/tst_qobject.cpp @@ -2017,6 +2017,7 @@ enum Enum { }; struct Struct { }; class Class { }; +template class Template { }; class NormalizeObject : public QObject { @@ -2054,6 +2055,12 @@ signals: void unsignedshortSignal(unsigned short); void unsignedcharSignal(unsigned char); + void typeRefSignal(Template &ref); + void constTypeRefSignal(const Template &ref); + void typeConstRefSignal(Template const &ref); + + void typePointerConstRefSignal(Class * const &); + public slots: void uintPointerSlot(uint *) { } void ulongPointerSlot(ulong *) { } @@ -2085,8 +2092,15 @@ public slots: void unsignedshortSlot(unsigned short) {}; void unsignedcharSlot(unsigned char) {}; + void typeRefSlot(Template &) {} + void constTypeRefSlot(const Template &) {} + void typeConstRefSlot(Template const &) {} + + void typePointerConstRefSlot(Class * const &) {} }; +#include "oldnormalizeobject.h" + void tst_QObject::normalize() { NormalizeObject object; @@ -2326,7 +2340,165 @@ void tst_QObject::normalize() SIGNAL(unsignedcharSignal(unsigned char)), SLOT(unsignedcharSlot(unsigned char)))); + // connect when original template signature and mixed usage of 'T const &', + // 'const T &', and 'T' + + QVERIFY(object.connect(&object, + SIGNAL(typeRefSignal(Template &)), + SLOT(typeRefSlot(Template &)))); + + QVERIFY(object.connect(&object, + SIGNAL(constTypeRefSignal(const Template &)), + SLOT(constTypeRefSlot(const Template &)))); + QVERIFY(object.connect(&object, + SIGNAL(constTypeRefSignal(const Template &)), + SLOT(constTypeRefSlot(const Template &)))); + QVERIFY(object.connect(&object, + SIGNAL(constTypeRefSignal(const Template &)), + SLOT(constTypeRefSlot(Template const &)))); + QVERIFY(object.connect(&object, + SIGNAL(constTypeRefSignal(Template const &)), + SLOT(constTypeRefSlot(Template const &)))); + QVERIFY(object.connect(&object, + SIGNAL(constTypeRefSignal(Template const &)), + SLOT(constTypeRefSlot(Template const &)))); + QVERIFY(object.connect(&object, + SIGNAL(constTypeRefSignal(const Template &)), + SLOT(typeConstRefSlot(const Template &)))); + QVERIFY(object.connect(&object, + SIGNAL(constTypeRefSignal(const Template &)), + SLOT(typeConstRefSlot(const Template &)))); + QVERIFY(object.connect(&object, + SIGNAL(constTypeRefSignal(const Template &)), + SLOT(typeConstRefSlot(Template const &)))); + QVERIFY(object.connect(&object, + SIGNAL(constTypeRefSignal(Template const &)), + SLOT(typeConstRefSlot(Template const &)))); + QVERIFY(object.connect(&object, + SIGNAL(constTypeRefSignal(Template const &)), + SLOT(typeConstRefSlot(Template const &)))); + + QVERIFY(object.connect(&object, + SIGNAL(typeConstRefSignal(const Template &)), + SLOT(constTypeRefSlot(const Template &)))); + QVERIFY(object.connect(&object, + SIGNAL(typeConstRefSignal(const Template &)), + SLOT(constTypeRefSlot(const Template &)))); + QVERIFY(object.connect(&object, + SIGNAL(typeConstRefSignal(const Template &)), + SLOT(constTypeRefSlot(Template const &)))); + QVERIFY(object.connect(&object, + SIGNAL(typeConstRefSignal(Template const &)), + SLOT(constTypeRefSlot(Template const &)))); + QVERIFY(object.connect(&object, + SIGNAL(typeConstRefSignal(Template const &)), + SLOT(constTypeRefSlot(Template const &)))); + + QVERIFY(object.connect(&object, + SIGNAL(typeConstRefSignal(const Template &)), + SLOT(typeConstRefSlot(const Template &)))); + QVERIFY(object.connect(&object, + SIGNAL(typeConstRefSignal(const Template &)), + SLOT(typeConstRefSlot(const Template &)))); + QVERIFY(object.connect(&object, + SIGNAL(typeConstRefSignal(const Template &)), + SLOT(typeConstRefSlot(Template const &)))); + QVERIFY(object.connect(&object, + SIGNAL(typeConstRefSignal(Template const &)), + SLOT(typeConstRefSlot(Template const &)))); + QVERIFY(object.connect(&object, + SIGNAL(typeConstRefSignal(Template const &)), + SLOT(typeConstRefSlot(Template const &)))); + + // same test again, this time with an object compiled with old moc output... we know that + // it is not possible to connect everything, whic is the purpose for this test + OldNormalizeObject oldobject; + + QVERIFY(oldobject.connect(&oldobject, + SIGNAL(constTypeRefSignal(const Template &)), + SLOT(constTypeRefSlot(const Template &)))); + QVERIFY(oldobject.connect(&oldobject, + SIGNAL(constTypeRefSignal(const Template &)), + SLOT(constTypeRefSlot(const Template &)))); + // this fails in older versions, but passes now due to proper normalizing + QVERIFY(oldobject.connect(&oldobject, + SIGNAL(constTypeRefSignal(const Template &)), + SLOT(constTypeRefSlot(Template const &)))); + // this fails in older versions, but passes now due to proper normalizing + QVERIFY(oldobject.connect(&oldobject, + SIGNAL(constTypeRefSignal(Template const &)), + SLOT(constTypeRefSlot(Template const &)))); + // this fails in older versions, but passes now due to proper normalizing + QVERIFY(oldobject.connect(&oldobject, + SIGNAL(constTypeRefSignal(Template const &)), + SLOT(constTypeRefSlot(Template const &)))); + + // these fail in older Qt versions, but pass now due to proper normalizing + QVERIFY(oldobject.connect(&oldobject, + SIGNAL(constTypeRefSignal(const Template &)), + SLOT(typeConstRefSlot(const Template &)))); + QVERIFY(oldobject.connect(&oldobject, + SIGNAL(constTypeRefSignal(const Template &)), + SLOT(typeConstRefSlot(const Template &)))); + QVERIFY(oldobject.connect(&oldobject, + SIGNAL(constTypeRefSignal(const Template &)), + SLOT(typeConstRefSlot(Template const &)))); + QVERIFY(oldobject.connect(&oldobject, + SIGNAL(constTypeRefSignal(Template const &)), + SLOT(typeConstRefSlot(Template const &)))); + QVERIFY(oldobject.connect(&oldobject, + SIGNAL(constTypeRefSignal(Template const &)), + SLOT(typeConstRefSlot(Template const &)))); + + // these also fail in older Qt versions, but pass now due to proper normalizing + QVERIFY(oldobject.connect(&oldobject, + SIGNAL(typeConstRefSignal(const Template &)), + SLOT(constTypeRefSlot(const Template &)))); + QVERIFY(oldobject.connect(&oldobject, + SIGNAL(typeConstRefSignal(const Template &)), + SLOT(constTypeRefSlot(const Template &)))); + QVERIFY(oldobject.connect(&oldobject, + SIGNAL(typeConstRefSignal(const Template &)), + SLOT(constTypeRefSlot(Template const &)))); + QVERIFY(oldobject.connect(&oldobject, + SIGNAL(typeConstRefSignal(Template const &)), + SLOT(constTypeRefSlot(Template const &)))); + QVERIFY(oldobject.connect(&oldobject, + SIGNAL(typeConstRefSignal(Template const &)), + SLOT(constTypeRefSlot(Template const &)))); + + // this fails in older versions, but passes now due to proper normalizing + QVERIFY(oldobject.connect(&oldobject, + SIGNAL(typeConstRefSignal(const Template &)), + SLOT(typeConstRefSlot(const Template &)))); + // this fails in older versions, but passes now due to proper normalizing + QVERIFY(oldobject.connect(&oldobject, + SIGNAL(typeConstRefSignal(const Template &)), + SLOT(typeConstRefSlot(const Template &)))); + // this fails in older versions, but passes now due to proper normalizing + QVERIFY(oldobject.connect(&oldobject, + SIGNAL(typeConstRefSignal(const Template &)), + SLOT(typeConstRefSlot(Template const &)))); + QVERIFY(oldobject.connect(&oldobject, + SIGNAL(typeConstRefSignal(Template const &)), + SLOT(typeConstRefSlot(Template const &)))); + QVERIFY(oldobject.connect(&oldobject, + SIGNAL(typeConstRefSignal(Template const &)), + SLOT(typeConstRefSlot(Template const &)))); + + QVERIFY(object.connect(&object, + SIGNAL(typePointerConstRefSignal(Class*const&)), + SLOT(typePointerConstRefSlot(Class*const&)))); + QVERIFY(object.connect(&object, + SIGNAL(typePointerConstRefSignal(Class*const&)), + SLOT(typePointerConstRefSlot(Class*)))); + QVERIFY(object.connect(&object, + SIGNAL(typePointerConstRefSignal(Class*)), + SLOT(typePointerConstRefSlot(Class*const&)))); + QVERIFY(object.connect(&object, + SIGNAL(typePointerConstRefSignal(Class*)), + SLOT(typePointerConstRefSlot(Class*)))); } class SiblingDeleter : public QObject diff --git a/tests/auto/qobject/tst_qobject.pro b/tests/auto/qobject/tst_qobject.pro index 003ee98..0200f3e 100644 --- a/tests/auto/qobject/tst_qobject.pro +++ b/tests/auto/qobject/tst_qobject.pro @@ -1,16 +1,20 @@ load(qttest_p4) -SOURCES += tst_qobject.cpp +SOURCES += tst_qobject.cpp -QT = core network gui -contains(QT_CONFIG, qt3support):DEFINES+=QT_HAS_QT3SUPPORT +# this is here for a reason, moc_oldnormalizedobject.cpp is not auto-generated, it was generated by +# moc from Qt 4.6, and should *not* be generated by the current moc +SOURCES += moc_oldnormalizeobject.cpp -wince*: { - addFiles.sources = signalbug.exe - addFiles.path = . - DEPLOYMENT += addFiles +QT = core \ + network \ + gui +contains(QT_CONFIG, qt3support):DEFINES += QT_HAS_QT3SUPPORT +wince*: { + addFiles.sources = signalbug.exe + addFiles.path = . + DEPLOYMENT += addFiles } - -symbian: { +symbian: { addFiles.sources = signalbug.exe addFiles.path = \sys\bin DEPLOYMENT += addFiles -- cgit v0.12 From 1a705e2c588f19ecf9a078d03a906da683378aec Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 2 Dec 2009 10:09:19 +0100 Subject: doc: added part of Andy's update. --- doc/src/getting-started/installation.qdoc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/src/getting-started/installation.qdoc b/doc/src/getting-started/installation.qdoc index e127429..807b83b 100644 --- a/doc/src/getting-started/installation.qdoc +++ b/doc/src/getting-started/installation.qdoc @@ -690,6 +690,10 @@ Symbian platform, see \l{Symbian platform - Introduction to using Qt}. \l{http://www.microsoft.com/downloads/details.aspx?FamilyId=BB4A75AB-E2D4-4C96-B39D-37BAF6B5B1DC&displaylang=en}{here} to avoid runtime conflicts. + If you are using a source edition of Qt, you must first install Perl so + that the syncqt script invoked by configure can be executed. You can download + this \l{http://www.activestate.com/downloads/}{here}. + To build Qt with Phonon on Windows, you require: \list -- cgit v0.12 From 1d037c582e2a832b55614641af912517d17e7604 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Wed, 2 Dec 2009 14:02:33 +0100 Subject: Revert back to using the native graphics system on Mac. The issues with raster are currently to visible and is preventing us from doing other work on Qt. --- src/gui/kernel/qapplication.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index 0853b32..c675c9e 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -922,14 +922,6 @@ void QApplicationPrivate::initialize() // Set up which span functions should be used in raster engine... qInitDrawhelperAsm(); - -#ifdef QT_MAC_USE_COCOA - // Use the raster graphics system by default on Cocoa, override with - // -graphicssystem native - if (graphics_system_name.isEmpty()) { - graphics_system_name = QLatin1String("raster"); - } -#endif #if !defined(Q_WS_X11) && !defined(Q_WS_QWS) // initialize the graphics system - on X11 this is initialized inside -- cgit v0.12 From ae0c72025c78e4fa4f8aa793e3b83f245a7837a7 Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Tue, 1 Dec 2009 15:58:58 +0100 Subject: Added QTriangulator. Task-number: QT-2594 --- src/gui/painting/qdatabuffer_p.h | 7 + src/opengl/gl2paintengineex/qtriangulator.cpp | 2981 +++++++++++++++++++++++++ src/opengl/gl2paintengineex/qtriangulator_p.h | 98 + src/opengl/opengl.pro | 6 +- 4 files changed, 3090 insertions(+), 2 deletions(-) create mode 100644 src/opengl/gl2paintengineex/qtriangulator.cpp create mode 100644 src/opengl/gl2paintengineex/qtriangulator_p.h diff --git a/src/gui/painting/qdatabuffer_p.h b/src/gui/painting/qdatabuffer_p.h index efe238e..41203ed 100644 --- a/src/gui/painting/qdatabuffer_p.h +++ b/src/gui/painting/qdatabuffer_p.h @@ -81,7 +81,9 @@ public: inline Type &at(int i) { Q_ASSERT(i >= 0 && i < siz); return buffer[i]; } inline const Type &at(int i) const { Q_ASSERT(i >= 0 && i < siz); return buffer[i]; } + inline Type &last() { Q_ASSERT(!isEmpty()); return buffer[siz-1]; } inline const Type &last() const { Q_ASSERT(!isEmpty()); return buffer[siz-1]; } + inline Type &first() { Q_ASSERT(!isEmpty()); return buffer[0]; } inline const Type &first() const { Q_ASSERT(!isEmpty()); return buffer[0]; } inline void add(const Type &t) { @@ -90,6 +92,11 @@ public: ++siz; } + inline void pop_back() { + Q_ASSERT(siz > 0); + --siz; + } + inline void resize(int size) { reserve(size); siz = size; diff --git a/src/opengl/gl2paintengineex/qtriangulator.cpp b/src/opengl/gl2paintengineex/qtriangulator.cpp new file mode 100644 index 0000000..21d4b2e --- /dev/null +++ b/src/opengl/gl2paintengineex/qtriangulator.cpp @@ -0,0 +1,2981 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtOpenGL module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qtriangulator_p.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +QT_BEGIN_NAMESPACE + +//#define Q_TRIANGULATOR_DEBUG + +#define Q_FIXED_POINT_SCALE 32 + +// Quick sort. +template +static void sort(T *array, int count, LessThan lessThan) +{ + // If the number of elements fall below some threshold, use insertion sort. + const int INSERTION_SORT_LIMIT = 7; // About 7 is fastest on my computer... + if (count <= INSERTION_SORT_LIMIT) { + for (int i = 1; i < count; ++i) { + T temp = array[i]; + int j = i; + while (j > 0 && lessThan(temp, array[j - 1])) { + array[j] = array[j - 1]; + --j; + } + array[j] = temp; + } + return; + } + + int high = count - 1; + int low = 0; + int mid = high / 2; + if (lessThan(array[mid], array[low])) + qSwap(array[mid], array[low]); + if (lessThan(array[high], array[mid])) + qSwap(array[high], array[mid]); + if (lessThan(array[mid], array[low])) + qSwap(array[mid], array[low]); + + --high; + ++low; + qSwap(array[mid], array[high]); + int pivot = high; + --high; + + while (low <= high) { + while (!lessThan(array[pivot], array[low])) { + ++low; + if (low > high) + goto sort_loop_end; + } + while (!lessThan(array[high], array[pivot])) { + --high; + if (low > high) + goto sort_loop_end; + } + qSwap(array[low], array[high]); + ++low; + --high; + } +sort_loop_end: + if (low != pivot) + qSwap(array[pivot], array[low]); + sort(array, low, lessThan); + sort(array + low + 1, count - low - 1, lessThan); +} + +// Quick sort. +template +static void sort(T *array, int count) +{ + // If the number of elements fall below some threshold, use insertion sort. + const int INSERTION_SORT_LIMIT = 25; // About 25 is fastest on my computer... + if (count <= INSERTION_SORT_LIMIT) { + for (int i = 1; i < count; ++i) { + T temp = array[i]; + int j = i; + while (j > 0 && (temp < array[j - 1])) { + array[j] = array[j - 1]; + --j; + } + array[j] = temp; + } + return; + } + + int high = count - 1; + int low = 0; + int mid = high / 2; + if ((array[mid] < array[low])) + qSwap(array[mid], array[low]); + if ((array[high] < array[mid])) + qSwap(array[high], array[mid]); + if ((array[mid] < array[low])) + qSwap(array[mid], array[low]); + + --high; + ++low; + qSwap(array[mid], array[high]); + int pivot = high; + --high; + + while (low <= high) { + while (!(array[pivot] < array[low])) { + ++low; + if (low > high) + goto sort_loop_end; + } + while (!(array[high] < array[pivot])) { + --high; + if (low > high) + goto sort_loop_end; + } + qSwap(array[low], array[high]); + ++low; + --high; + } +sort_loop_end: + if (low != pivot) + qSwap(array[pivot], array[low]); + sort(array, low); + sort(array + low + 1, count - low - 1); +} + +//============================================================================// +// QFraction // +//============================================================================// + +// Fraction must be in the range [0, 1) +struct QFraction +{ + // Comparison operators must not be called on invalid fractions. + inline bool operator < (const QFraction &other) const; + inline bool operator == (const QFraction &other) const; + inline bool operator != (const QFraction &other) const {return !(*this == other);} + inline bool operator > (const QFraction &other) const {return other < *this;} + inline bool operator >= (const QFraction &other) const {return !(*this < other);} + inline bool operator <= (const QFraction &other) const {return !(*this > other);} + + inline bool isValid() const {return denominator != 0;} + + // numerator and denominator must not have common denominators. + quint64 numerator, denominator; +}; + +static inline quint64 gcd(quint64 x, quint64 y) +{ + while (y != 0) { + quint64 z = y; + y = x % y; + x = z; + } + return x; +} + +static inline int compare(quint64 a, quint64 b) +{ + return (a > b) - (a < b); +} + +// Compare a/b with c/d. +// Return negative if less, 0 if equal, positive if greater. +// a < b, c < d +static int qCompareFractions(quint64 a, quint64 b, quint64 c, quint64 d) +{ + const quint64 LIMIT = Q_UINT64_C(0x100000000); + for (;;) { + // If the products 'ad' and 'bc' fit into 64 bits, they can be directly compared. + if (b < LIMIT && d < LIMIT) + return compare(a * d, b * c); + + if (a == 0 || c == 0) + return compare(a, c); + + // a/b < c/d <=> d/c < b/a + quint64 b_div_a = b / a; + quint64 d_div_c = d / c; + if (b_div_a != d_div_c) + return compare(d_div_c, b_div_a); + + // floor(d/c) == floor(b/a) + // frac(d/c) < frac(b/a) ? + // frac(x/y) = (x%y)/y + d -= d_div_c * c; //d %= c; + b -= b_div_a * a; //b %= a; + qSwap(a, d); + qSwap(b, c); + } +} + +// Fraction must be in the range [0, 1) +// Assume input is valid. +static QFraction qFraction(quint64 n, quint64 d) { + QFraction result; + if (n == 0) { + result.numerator = 0; + result.denominator = 1; + } else { + quint64 g = gcd(n, d); + result.numerator = n / g; + result.denominator = d / g; + } + return result; +} + +inline bool QFraction::operator < (const QFraction &other) const +{ + return qCompareFractions(numerator, denominator, other.numerator, other.denominator) < 0; +} + +inline bool QFraction::operator == (const QFraction &other) const +{ + return numerator == other.numerator && denominator == other.denominator; +} + +//============================================================================// +// QPodPoint // +//============================================================================// + +struct QPodPoint +{ + inline bool operator < (const QPodPoint &other) const + { + if (y != other.y) + return y < other.y; + return x < other.x; + } + + inline bool operator > (const QPodPoint &other) const {return other < *this;} + inline bool operator <= (const QPodPoint &other) const {return !(*this > other);} + inline bool operator >= (const QPodPoint &other) const {return !(*this < other);} + inline bool operator == (const QPodPoint &other) const {return x == other.x && y == other.y;} + inline bool operator != (const QPodPoint &other) const {return x != other.x || y != other.y;} + + inline QPodPoint &operator += (const QPodPoint &other) {x += other.x; y += other.y; return *this;} + inline QPodPoint &operator -= (const QPodPoint &other) {x -= other.x; y -= other.y; return *this;} + inline QPodPoint operator + (const QPodPoint &other) const {QPodPoint result = {x + other.x, y + other.y}; return result;} + inline QPodPoint operator - (const QPodPoint &other) const {QPodPoint result = {x - other.x, y - other.y}; return result;} + + int x; + int y; +}; + +static inline qint64 qCross(const QPodPoint &u, const QPodPoint &v) +{ + return qint64(u.x) * qint64(v.y) - qint64(u.y) * qint64(v.x); +} + +static inline qint64 qDot(const QPodPoint &u, const QPodPoint &v) +{ + return qint64(u.x) * qint64(v.x) + qint64(u.y) * qint64(v.y); +} + +// Return positive value if 'p' is to the right of the line 'v1'->'v2', negative if left of the +// line and zero if exactly on the line. +// The returned value is the z-component of the qCross product between 'v2-v1' and 'p-v1', +// which is twice the signed area of the triangle 'p'->'v1'->'v2' (positive for CW order). +static inline qint64 qPointDistanceFromLine(const QPodPoint &p, const QPodPoint &v1, const QPodPoint &v2) +{ + return qCross(v2 - v1, p - v1); +} + +static inline bool qPointIsLeftOfLine(const QPodPoint &p, const QPodPoint &v1, const QPodPoint &v2) +{ + return qPointDistanceFromLine(p, v1, v2) < 0; +} + +// Return: +// -1 if u < v +// 0 if u == v +// 1 if u > v +static int comparePoints(const QPodPoint &u, const QPodPoint &v) +{ + if (u.y < v.y) + return -1; + if (u.y > v.y) + return 1; + if (u.x < v.x) + return -1; + if (u.x > v.x) + return 1; + return 0; +} + +//============================================================================// +// QIntersectionPoint // +//============================================================================// + +struct QIntersectionPoint +{ + inline bool isValid() const {return xOffset.isValid() && yOffset.isValid();} + QPodPoint round() const; + inline bool isAccurate() const {return xOffset.numerator == 0 && yOffset.numerator == 0;} + bool operator < (const QIntersectionPoint &other) const; + bool operator == (const QIntersectionPoint &other) const; + inline bool operator != (const QIntersectionPoint &other) const {return !(*this == other);} + inline bool operator > (const QIntersectionPoint &other) const {return other < *this;} + inline bool operator >= (const QIntersectionPoint &other) const {return !(*this < other);} + inline bool operator <= (const QIntersectionPoint &other) const {return !(*this > other);} + bool isOnLine(const QPodPoint &u, const QPodPoint &v) const; + + QPodPoint upperLeft; + QFraction xOffset; + QFraction yOffset; +}; + +static inline QIntersectionPoint qIntersectionPoint(const QPodPoint &point) +{ + // m_upperLeft = point, m_xOffset = 0/1, m_yOffset = 0/1. + QIntersectionPoint p = {point, {0, 1}, {0, 1}}; + return p; +} + +static inline QIntersectionPoint qIntersectionPoint(int x, int y) +{ + // m_upperLeft = (x, y), m_xOffset = 0/1, m_yOffset = 0/1. + QIntersectionPoint p = {{x, y}, {0, 1}, {0, 1}}; + return p; +} + +static QIntersectionPoint qIntersectionPoint(const QPodPoint &u1, const QPodPoint &u2, const QPodPoint &v1, const QPodPoint &v2) +{ + QIntersectionPoint result = {{0, 0}, {0, 0}, {0, 0}}; + + QPodPoint u = u2 - u1; + QPodPoint v = v2 - v1; + qint64 d1 = qCross(u, v1 - u1); + qint64 d2 = qCross(u, v2 - u1); + qint64 det = d2 - d1; + qint64 d3 = qCross(v, u1 - v1); + qint64 d4 = d3 - det; //qCross(v, u2 - v1); + + // Check that the math is correct. + Q_ASSERT(d4 == qCross(v, u2 - v1)); + + // The intersection point can be expressed as: + // v1 - v * d1/det + // v2 - v * d2/det + // u1 + u * d3/det + // u2 + u * d4/det + + // I'm only interested in lines that are crossing, so ignore parallel lines even if they overlap. + if (det == 0) + return result; + + if (det < 0) { + det = -det; + d1 = -d1; + d2 = -d2; + d3 = -d3; + d4 = -d4; + } + + // I'm only interested in lines intersecting at their interior, not at their end points. + // The lines intersect at their interior if and only if 'd1 < 0', 'd2 > 0', 'd3 < 0' and 'd4 > 0'. + if (d1 >= 0 || d2 <= 0 || d3 <= 0 || d4 >= 0) + return result; + + // Calculate the intersection point as follows: + // v1 - v * d1/det | v1 <= v2 (component-wise) + // v2 - v * d2/det | v2 < v1 (component-wise) + + // Assuming 21 bits per vector component. + // TODO: Make code path for 31 bits per vector component. + if (v.x >= 0) { + result.upperLeft.x = v1.x + (-v.x * d1) / det; + result.xOffset = qFraction(quint64(-v.x * d1) % quint64(det), quint64(det)); + } else { + result.upperLeft.x = v2.x + (-v.x * d2) / det; + result.xOffset = qFraction(quint64(-v.x * d2) % quint64(det), quint64(det)); + } + + if (v.y >= 0) { + result.upperLeft.y = v1.y + (-v.y * d1) / det; + result.yOffset = qFraction(quint64(-v.y * d1) % quint64(det), quint64(det)); + } else { + result.upperLeft.y = v2.y + (-v.y * d2) / det; + result.yOffset = qFraction(quint64(-v.y * d2) % quint64(det), quint64(det)); + } + + Q_ASSERT(result.xOffset.isValid()); + Q_ASSERT(result.yOffset.isValid()); + return result; +} + +QPodPoint QIntersectionPoint::round() const +{ + QPodPoint result = upperLeft; + if (2 * xOffset.numerator >= xOffset.denominator) + ++result.x; + if (2 * yOffset.numerator >= yOffset.denominator) + ++result.y; + return result; +} + +bool QIntersectionPoint::operator < (const QIntersectionPoint &other) const +{ + if (upperLeft.y != other.upperLeft.y) + return upperLeft.y < other.upperLeft.y; + if (yOffset != other.yOffset) + return yOffset < other.yOffset; + if (upperLeft.x != other.upperLeft.x) + return upperLeft.x < other.upperLeft.x; + return xOffset < other.xOffset; +} + +bool QIntersectionPoint::operator == (const QIntersectionPoint &other) const +{ + return upperLeft == other.upperLeft && xOffset == other.xOffset && yOffset == other.yOffset; +} + +// Returns true if this point is on the infinite line passing through 'u' and 'v'. +bool QIntersectionPoint::isOnLine(const QPodPoint &u, const QPodPoint &v) const +{ + // TODO: Make code path for coordinates with more than 21 bits. + const QPodPoint p = upperLeft - u; + const QPodPoint q = v - u; + bool isHorizontal = p.y == 0 && yOffset.numerator == 0; + bool isVertical = p.x == 0 && xOffset.numerator == 0; + if (isHorizontal && isVertical) + return true; + if (isHorizontal) + return q.y == 0; + if (q.y == 0) + return false; + if (isVertical) + return q.x == 0; + if (q.x == 0) + return false; + + // At this point, 'p+offset' and 'q' cannot lie on the x or y axis. + + if (((q.x < 0) == (q.y < 0)) != ((p.x < 0) == (p.y < 0))) + return false; // 'p + offset' and 'q' pass through different quadrants. + + // Move all coordinates into the first quadrant. + quint64 nx, ny; + if (p.x < 0) + nx = quint64(-p.x) * xOffset.denominator - xOffset.numerator; + else + nx = quint64(p.x) * xOffset.denominator + xOffset.numerator; + if (p.y < 0) + ny = quint64(-p.y) * yOffset.denominator - yOffset.numerator; + else + ny = quint64(p.y) * yOffset.denominator + yOffset.numerator; + + return qFraction(quint64(qAbs(q.x)) * xOffset.denominator, quint64(qAbs(q.y)) * yOffset.denominator) == qFraction(nx, ny); +} + +//============================================================================// +// QMaxHeap // +//============================================================================// + +template +class QMaxHeap +{ +public: + inline int size() const {return m_data.size();} + inline bool empty() const {return m_data.isEmpty();} + inline bool isEmpty() const {return m_data.isEmpty();} + void push(const T &x); + T pop(); + inline const T &top() const {return m_data.first();} +private: + static inline int parent(int i) {return (i - 1) / 2;} + static inline int left(int i) {return 2 * i + 1;} + static inline int right(int i) {return 2 * i + 2;} + + QDataBuffer m_data; +}; + +template +void QMaxHeap::push(const T &x) +{ + int current = m_data.size(); + int parent = QMaxHeap::parent(current); + m_data.add(x); + while (current != 0 && m_data.at(parent) < x) { + m_data.at(current) = m_data.at(parent); + current = parent; + parent = QMaxHeap::parent(current); + } + m_data.at(current) = x; +} + +template +T QMaxHeap::pop() +{ + T result = m_data.first(); + T back = m_data.last(); + m_data.pop_back(); + if (!m_data.isEmpty()) { + int current = 0; + for (;;) { + int left = QMaxHeap::left(current); + int right = QMaxHeap::right(current); + if (left >= m_data.size()) + break; + int greater = left; + if (right < m_data.size() && m_data.at(left) < m_data.at(right)) + greater = right; + if (m_data.at(greater) < back) + break; + m_data.at(current) = m_data.at(greater); + current = greater; + } + m_data.at(current) = back; + } + return result; +} + +//============================================================================// +// QRBTree // +//============================================================================// + +template +struct QRBTree +{ + struct Node + { + inline Node() : parent(0), left(0), right(0), red(true) { } + inline ~Node() {if (left) delete left; if (right) delete right;} + T data; + Node *parent; + Node *left; + Node *right; + bool red; + }; + + inline QRBTree() : root(0), freeList(0) { } + inline ~QRBTree(); + + inline void clear(); + + void attachBefore(Node *parent, Node *child); + void attachAfter(Node *parent, Node *child); + + inline Node *front(Node *node) const; + inline Node *back(Node *node) const; + Node *next(Node *node) const; + Node *previous(Node *node) const; + + inline void deleteNode(Node *&node); + inline Node *newNode(); + + // Return 1 if 'left' comes after 'right', 0 if equal, and -1 otherwise. + // 'left' and 'right' cannot be null. + int order(Node *left, Node *right); + inline bool verify() const; + +private: + void rotateLeft(Node *node); + void rotateRight(Node *node); + void update(Node *node); + + inline void attachLeft(Node *parent, Node *child); + inline void attachRight(Node *parent, Node *child); + + int blackDepth(Node *top) const; + bool checkRedBlackProperty(Node *top) const; + + void swapNodes(Node *n1, Node *n2); + void detach(Node *node); + + // 'node' must be black. rebalance will reduce the depth of black nodes by one in the sibling tree. + void rebalance(Node *node); + +public: + Node *root; +private: + Node *freeList; +}; + +template +inline QRBTree::~QRBTree() +{ + clear(); + while (freeList) { + // Avoid recursively calling the destructor, as this list may become large. + Node *next = freeList->right; + freeList->right = 0; + delete freeList; + freeList = next; + } +} + +template +inline void QRBTree::clear() +{ + if (root) + delete root; + root = 0; +} + +template +void QRBTree::rotateLeft(Node *node) +{ + // | | + // N B + // / \ / \ + // A B ---> N D + // / \ / \ + // C D A C + + Node *&ref = (node->parent ? (node == node->parent->left ? node->parent->left : node->parent->right) : root); + ref = node->right; + node->right->parent = node->parent; + + // : + // N + // / :| + // A B + // / \ + // C D + + node->right = ref->left; + if (ref->left) + ref->left->parent = node; + + // : | + // N B + // / \ : \ + // A C D + + ref->left = node; + node->parent = ref; + + // | + // B + // / \ + // N D + // / \ + // A C +} + +template +void QRBTree::rotateRight(Node *node) +{ + // | | + // N A + // / \ / \ + // A B ---> C N + // / \ / \ + // C D D B + + Node *&ref = (node->parent ? (node == node->parent->left ? node->parent->left : node->parent->right) : root); + ref = node->left; + node->left->parent = node->parent; + + node->left = ref->right; + if (ref->right) + ref->right->parent = node; + + ref->right = node; + node->parent = ref; +} + +template +void QRBTree::update(Node *node) // call this after inserting a node +{ + for (;;) { + Node *parent = node->parent; + + // if the node is the root, color it black + if (!parent) { + node->red = false; + return; + } + + // if the parent is black, the node can be left red + if (!parent->red) + return; + + // at this point, the parent is red and cannot be the root + Node *grandpa = parent->parent; + Q_ASSERT(grandpa); + + Node *uncle = (parent == grandpa->left ? grandpa->right : grandpa->left); + if (uncle && uncle->red) { + // grandpa's black, parent and uncle are red. + // let parent and uncle be black, grandpa red and recursively update grandpa. + Q_ASSERT(!grandpa->red); + parent->red = false; + uncle->red = false; + grandpa->red = true; + node = grandpa; + continue; + } + + // at this point, uncle is black + if (node == parent->right && parent == grandpa->left) + rotateLeft(node = parent); + else if (node == parent->left && parent == grandpa->right) + rotateRight(node = parent); + parent = node->parent; + + if (parent == grandpa->left) { + rotateRight(grandpa); + parent->red = false; + grandpa->red = true; + } else { + rotateLeft(grandpa); + parent->red = false; + grandpa->red = true; + } + return; + } +} + +template +inline void QRBTree::attachLeft(Node *parent, Node *child) +{ + Q_ASSERT(!parent->left); + parent->left = child; + child->parent = parent; + update(child); +} + +template +inline void QRBTree::attachRight(Node *parent, Node *child) +{ + Q_ASSERT(!parent->right); + parent->right = child; + child->parent = parent; + update(child); +} + +template +void QRBTree::attachBefore(Node *parent, Node *child) +{ + if (!root) + update(root = child); + else if (!parent) + attachRight(back(root), child); + else if (parent->left) + attachRight(back(parent->left), child); + else + attachLeft(parent, child); +} + +template +void QRBTree::attachAfter(Node *parent, Node *child) +{ + if (!root) + update(root = child); + else if (!parent) + attachLeft(front(root), child); + else if (parent->right) + attachLeft(front(parent->right), child); + else + attachRight(parent, child); +} + +template +void QRBTree::swapNodes(Node *n1, Node *n2) +{ + // Since iterators must not be invalidated, it is not sufficient to only swap the data. + if (n1->parent == n2) { + n1->parent = n2->parent; + n2->parent = n1; + } else if (n2->parent == n1) { + n2->parent = n1->parent; + n1->parent = n2; + } else { + qSwap(n1->parent, n2->parent); + } + + qSwap(n1->left, n2->left); + qSwap(n1->right, n2->right); + qSwap(n1->red, n2->red); + + if (n1->parent) { + if (n1->parent->left == n2) + n1->parent->left = n1; + else + n1->parent->right = n1; + } else { + root = n1; + } + + if (n2->parent) { + if (n2->parent->left == n1) + n2->parent->left = n2; + else + n2->parent->right = n2; + } else { + root = n2; + } + + if (n1->left) + n1->left->parent = n1; + if (n1->right) + n1->right->parent = n1; + + if (n2->left) + n2->left->parent = n2; + if (n2->right) + n2->right->parent = n2; +} + +template +void QRBTree::detach(Node *node) // call this before removing a node. +{ + if (node->right) + swapNodes(node, front(node->right)); + + Node *child = (node->left ? node->left : node->right); + + if (!node->red) { + if (child && child->red) + child->red = false; + else + rebalance(node); + } + + Node *&ref = (node->parent ? (node == node->parent->left ? node->parent->left : node->parent->right) : root); + ref = child; + if (child) + child->parent = node->parent; + node->left = node->right = node->parent = 0; +} + +// 'node' must be black. rebalance will reduce the depth of black nodes by one in the sibling tree. +template +void QRBTree::rebalance(Node *node) +{ + Q_ASSERT(!node->red); + for (;;) { + if (!node->parent) + return; + + // at this point, node is not a parent, it is black, thus it must have a sibling. + Node *sibling = (node == node->parent->left ? node->parent->right : node->parent->left); + Q_ASSERT(sibling); + + if (sibling->red) { + sibling->red = false; + node->parent->red = true; + if (node == node->parent->left) + rotateLeft(node->parent); + else + rotateRight(node->parent); + sibling = (node == node->parent->left ? node->parent->right : node->parent->left); + Q_ASSERT(sibling); + } + + // at this point, the sibling is black. + Q_ASSERT(!sibling->red); + + if ((!sibling->left || !sibling->left->red) && (!sibling->right || !sibling->right->red)) { + bool parentWasRed = node->parent->red; + sibling->red = true; + node->parent->red = false; + if (parentWasRed) + return; + node = node->parent; + continue; + } + + // at this point, at least one of the sibling's children is red. + + if (node == node->parent->left) { + if (!sibling->right || !sibling->right->red) { + Q_ASSERT(sibling->left); + sibling->red = true; + sibling->left->red = false; + rotateRight(sibling); + + sibling = sibling->parent; + Q_ASSERT(sibling); + } + sibling->red = node->parent->red; + node->parent->red = false; + + Q_ASSERT(sibling->right->red); + sibling->right->red = false; + rotateLeft(node->parent); + } else { + if (!sibling->left || !sibling->left->red) { + Q_ASSERT(sibling->right); + sibling->red = true; + sibling->right->red = false; + rotateLeft(sibling); + + sibling = sibling->parent; + Q_ASSERT(sibling); + } + sibling->red = node->parent->red; + node->parent->red = false; + + Q_ASSERT(sibling->left->red); + sibling->left->red = false; + rotateRight(node->parent); + } + return; + } +} + +template +inline typename QRBTree::Node *QRBTree::front(Node *node) const +{ + while (node->left) + node = node->left; + return node; +} + +template +inline typename QRBTree::Node *QRBTree::back(Node *node) const +{ + while (node->right) + node = node->right; + return node; +} + +template +typename QRBTree::Node *QRBTree::next(Node *node) const +{ + if (node->right) + return front(node->right); + while (node->parent && node == node->parent->right) + node = node->parent; + return node->parent; +} + +template +typename QRBTree::Node *QRBTree::previous(Node *node) const +{ + if (node->left) + return back(node->left); + while (node->parent && node == node->parent->left) + node = node->parent; + return node->parent; +} + +template +int QRBTree::blackDepth(Node *top) const +{ + if (!top) + return 0; + int leftDepth = blackDepth(top->left); + int rightDepth = blackDepth(top->right); + if (leftDepth != rightDepth) + return -1; + if (!top->red) + ++leftDepth; + return leftDepth; +} + +template +bool QRBTree::checkRedBlackProperty(Node *top) const +{ + if (!top) + return true; + if (top->left && !checkRedBlackProperty(top->left)) + return false; + if (top->right && !checkRedBlackProperty(top->right)) + return false; + return !(top->red && ((top->left && top->left->red) || (top->right && top->right->red))); +} + +template +inline bool QRBTree::verify() const +{ + return checkRedBlackProperty(root) && blackDepth(root) != -1; +} + +template +inline void QRBTree::deleteNode(Node *&node) +{ + Q_ASSERT(node); + detach(node); + node->right = freeList; + freeList = node; + node = 0; +} + +template +inline typename QRBTree::Node *QRBTree::newNode() +{ + if (freeList) { + Node *node = freeList; + freeList = freeList->right; + node->parent = node->left = node->right = 0; + node->red = true; + return node; + } + return new Node; +} + +// Return 1 if 'left' comes after 'right', 0 if equal, and -1 otherwise. +// 'left' and 'right' cannot be null. +template +int QRBTree::order(Node *left, Node *right) +{ + Q_ASSERT(left && right); + if (left == right) + return 0; + + QVector leftAncestors; + QVector rightAncestors; + while (left) { + leftAncestors.push_back(left); + left = left->parent; + } + while (right) { + rightAncestors.push_back(right); + right = right->parent; + } + Q_ASSERT(leftAncestors.back() == root && rightAncestors.back() == root); + + while (!leftAncestors.empty() && !rightAncestors.empty() && leftAncestors.back() == rightAncestors.back()) { + leftAncestors.pop_back(); + rightAncestors.pop_back(); + } + + if (!leftAncestors.empty()) + return (leftAncestors.back() == leftAncestors.back()->parent->left ? -1 : 1); + + if (!rightAncestors.empty()) + return (rightAncestors.back() == rightAncestors.back()->parent->right ? -1 : 1); + + // The code should never reach this point. + Q_ASSERT(!leftAncestors.empty() || !rightAncestors.empty()); + return 0; +} + +//============================================================================// +// QInt64Hash // +//============================================================================// + +// Copied from qhash.cpp +static const uchar prime_deltas[] = { + 0, 0, 1, 3, 1, 5, 3, 3, 1, 9, 7, 5, 3, 9, 25, 3, + 1, 21, 3, 21, 7, 15, 9, 5, 3, 29, 15, 0, 0, 0, 0, 0 +}; + +// Copied from qhash.cpp +static inline int primeForNumBits(int numBits) +{ + return (1 << numBits) + prime_deltas[numBits]; +} + +static inline int primeForCount(int count) +{ + int low = 0; + int high = 32; + for (int i = 0; i < 5; ++i) { + int mid = (high + low) / 2; + if (count >= 1 << mid) + low = mid; + else + high = mid; + } + return primeForNumBits(high); +} + +// Hash set of quint64s. Elements cannot be removed without clearing the +// entire set. A value of -1 is used to mark unused entries. +class QInt64Set +{ +public: + inline QInt64Set(int capacity = 64); + inline ~QInt64Set() {if (m_array) delete[] m_array;} + inline bool isValid() const {return m_array;} + void insert(quint64 key); + bool contains(quint64 key) const; + inline void clear(); +private: + bool rehash(int capacity); + + static const quint64 UNUSED; + + quint64 *m_array; + int m_capacity; + int m_count; +}; + +const quint64 QInt64Set::UNUSED = quint64(-1); + +inline QInt64Set::QInt64Set(int capacity) +{ + m_capacity = primeForCount(capacity); + m_array = new quint64[m_capacity]; + if (m_array) + clear(); + else + m_capacity = 0; +} + +bool QInt64Set::rehash(int capacity) +{ + quint64 *oldArray = m_array; + int oldCapacity = m_capacity; + + m_capacity = capacity; + m_array = new quint64[m_capacity]; + if (m_array) { + clear(); + if (oldArray) { + for (int i = 0; i < oldCapacity; ++i) { + if (oldArray[i] != UNUSED) + insert(oldArray[i]); + } + delete[] oldArray; + } + return true; + } else { + m_capacity = oldCapacity; + m_array = oldArray; + return false; + } +} + +void QInt64Set::insert(quint64 key) +{ + if (m_count > 3 * m_capacity / 4) + rehash(primeForCount(2 * m_capacity)); + Q_ASSERT_X(m_array, "QInt64Hash::insert", "Hash set not allocated."); + int index = int(key % m_capacity); + for (int i = 0; i < m_capacity; ++i) { + index += i; + if (index >= m_capacity) + index -= m_capacity; + if (m_array[index] == key) + return; + if (m_array[index] == UNUSED) { + ++m_count; + m_array[index] = key; + return; + } + } + Q_ASSERT_X(0, "QInt64Hash::insert", "Hash set full."); +} + +bool QInt64Set::contains(quint64 key) const +{ + Q_ASSERT_X(m_array, "QInt64Hash::contains", "Hash set not allocated."); + int index = int(key % m_capacity); + for (int i = 0; i < m_capacity; ++i) { + index += i; + if (index >= m_capacity) + index -= m_capacity; + if (m_array[index] == key) + return true; + if (m_array[index] == UNUSED) + return false; + } + return false; +} + +inline void QInt64Set::clear() +{ + Q_ASSERT_X(m_array, "QInt64Hash::clear", "Hash set not allocated."); + for (int i = 0; i < m_capacity; ++i) + m_array[i] = UNUSED; + m_count = 0; +} + +//============================================================================// +// QRingBuffer // +//============================================================================// + +// T must be POD. +template +class QRingBuffer +{ +public: + inline QRingBuffer() : m_array(0), m_head(0), m_size(0), m_capacity(0) { } + inline ~QRingBuffer() {if (m_array) delete[] m_array;} + bool reallocate(int capacity); + inline const T &head() const {Q_ASSERT(m_size > 0); return m_array[m_head];} + inline const T &dequeue(); + inline void enqueue(const T &x); + inline bool isEmpty() const {return m_size == 0;} +private: + T *m_array; + int m_head; + int m_size; + int m_capacity; +}; + +template +bool QRingBuffer::reallocate(int capacity) +{ + T *oldArray = m_array; + m_array = new T[capacity]; + if (m_array) { + if (oldArray) { + if (m_head + m_size > m_capacity) { + memcpy(m_array, oldArray + m_head, (m_capacity - m_head) * sizeof(T)); + memcpy(m_array + (m_capacity - m_head), oldArray, (m_head + m_size - m_capacity) * sizeof(T)); + } else { + memcpy(m_array, oldArray + m_head, m_size * sizeof(T)); + } + delete[] oldArray; + } + m_capacity = capacity; + m_head = 0; + return true; + } else { + m_array = oldArray; + return false; + } +} + +template +inline const T &QRingBuffer::dequeue() +{ + Q_ASSERT(m_size > 0); + Q_ASSERT(m_array); + Q_ASSERT(m_capacity >= m_size); + int index = m_head; + if (++m_head >= m_capacity) + m_head -= m_capacity; + --m_size; + return m_array[index]; +} + +template +inline void QRingBuffer::enqueue(const T &x) +{ + if (m_size == m_capacity) + reallocate(qMax(2 * m_capacity, 64)); + int index = m_head + m_size; + if (index >= m_capacity) + index -= m_capacity; + m_array[index] = x; + ++m_size; +} + +//============================================================================// +// QTriangulator // +//============================================================================// + +class QTriangulator +{ +public: + typedef QVarLengthArray ShortArray; + + //================================// + // QTriangulator::ComplexToSimple // + //================================// + friend class ComplexToSimple; + class ComplexToSimple + { + public: + inline ComplexToSimple(QTriangulator *parent) : m_parent(parent) { } + void decompose(); + private: + struct Edge + { + inline int &upper() {return pointingUp ? to : from;} + inline int &lower() {return pointingUp ? from : to;} + inline int upper() const {return pointingUp ? to : from;} + inline int lower() const {return pointingUp ? from : to;} + + QRBTree::Node *node; + int from, to; // vertex + int next, previous; // edge + int winding; + bool mayIntersect; + bool pointingUp, originallyPointingUp; + }; + + friend class CompareEdges; + class CompareEdges + { + public: + inline CompareEdges(ComplexToSimple *parent) : m_parent(parent) { } + bool operator () (int i, int j) const; + private: + ComplexToSimple *m_parent; + }; + + struct Intersection + { + bool operator < (const Intersection &other) const {return other.intersectionPoint < intersectionPoint;} + + QIntersectionPoint intersectionPoint; + int vertex; + int leftEdge; + int rightEdge; + }; + + struct Split + { + int vertex; + int edge; + bool accurate; + }; + + struct Event + { + enum Type {Upper, Lower}; + inline bool operator < (const Event &other) const; + + QPodPoint point; + Type type; + int edge; + }; + +#ifdef Q_TRIANGULATOR_DEBUG + friend class DebugDialog; + friend class QTriangulator; + class DebugDialog : public QDialog + { + public: + DebugDialog(ComplexToSimple *parent, int currentVertex); + protected: + void paintEvent(QPaintEvent *); + void wheelEvent(QWheelEvent *); + void mouseMoveEvent(QMouseEvent *); + void mousePressEvent(QMouseEvent *); + private: + ComplexToSimple *m_parent; + QRectF m_window; + QPoint m_lastMousePos; + int m_vertex; + }; +#endif + + void initEdges(); + bool calculateIntersection(int left, int right); + bool edgeIsLeftOfEdge(int leftEdgeIndex, int rightEdgeIndex) const; + QRBTree::Node *searchEdgeLeftOf(int edgeIndex) const; + QRBTree::Node *searchEdgeLeftOf(int edgeIndex, QRBTree::Node *after) const; + QPair::Node *, QRBTree::Node *> bounds(const QPodPoint &point) const; + QPair::Node *, QRBTree::Node *> outerBounds(const QPodPoint &point) const; + void splitEdgeListRange(QRBTree::Node *leftmost, QRBTree::Node *rightmost, int vertex, const QIntersectionPoint &intersectionPoint); + void reorderEdgeListRange(QRBTree::Node *leftmost, QRBTree::Node *rightmost); + void sortEdgeList(const QPodPoint eventPoint); + void fillPriorityQueue(); + void calculateIntersections(); + int splitEdge(int splitIndex); + bool splitEdgesAtIntersections(); + void insertEdgeIntoVectorIfWanted(ShortArray &orderedEdges, int i); + void removeUnwantedEdgesAndConnect(); + void removeUnusedPoints(); + + QTriangulator *m_parent; + QDataBuffer m_edges; + QRBTree m_edgeList; + QDataBuffer m_events; + QDataBuffer m_splits; + QMaxHeap m_topIntersection; + QInt64Set m_processedEdgePairs; + int m_initialPointCount; + }; +#ifdef Q_TRIANGULATOR_DEBUG + friend class ComplexToSimple::DebugDialog; +#endif + + //=================================// + // QTriangulator::SimpleToMonotone // + //=================================// + friend class SimpleToMonotone; + class SimpleToMonotone + { + public: + inline SimpleToMonotone(QTriangulator *parent) : m_parent(parent) { } + void decompose(); + private: + enum VertexType {MergeVertex, EndVertex, RegularVertex, StartVertex, SplitVertex}; + + struct Edge + { + QRBTree::Node *node; + int helper, twin, next, previous; + quint32 from, to; + VertexType type; + bool pointingUp; + int upper() const {return (pointingUp ? to : from);} + int lower() const {return (pointingUp ? from : to);} + }; + + friend class CompareVertices; + class CompareVertices + { + public: + CompareVertices(SimpleToMonotone *parent) : m_parent(parent) { } + bool operator () (int i, int j) const; + private: + SimpleToMonotone *m_parent; + }; + + void setupDataStructures(); + void removeZeroLengthEdges(); + void fillPriorityQueue(); + bool edgeIsLeftOfEdge(int leftEdgeIndex, int rightEdgeIndex) const; + // Returns the rightmost edge not to the right of the given edge. + QRBTree::Node *searchEdgeLeftOfEdge(int edgeIndex) const; + // Returns the rightmost edge left of the given point. + QRBTree::Node *searchEdgeLeftOfPoint(int pointIndex) const; + void classifyVertex(int i); + void classifyVertices(); + bool pointIsInSector(const QPodPoint &p, const QPodPoint &v1, const QPodPoint &v2, const QPodPoint &v3); + bool pointIsInSector(int vertex, int sector); + int findSector(int edge, int vertex); + void createDiagonal(int lower, int upper); + void monotoneDecomposition(); + + QTriangulator *m_parent; + QRBTree m_edgeList; + QDataBuffer m_edges; + QDataBuffer m_upperVertex; + bool m_clockwiseOrder; + }; + + //====================================// + // QTriangulator::MonotoneToTriangles // + //====================================// + friend class MonotoneToTriangles; + class MonotoneToTriangles + { + public: + inline MonotoneToTriangles(QTriangulator *parent) : m_parent(parent) { } + void decompose(); + private: + inline quint32 indices(int index) const {return m_parent->m_indices.at(index + m_first);} + inline int next(int index) const {return (index + 1) % m_length;} + inline int previous(int index) const {return (index + m_length - 1) % m_length;} + inline bool less(int i, int j) const {return m_parent->m_vertices.at(indices(i)) < m_parent->m_vertices.at(indices(j));} + inline bool leftOfEdge(int i, int j, int k) const + { + return qPointIsLeftOfLine(m_parent->m_vertices.at(indices(i)), + m_parent->m_vertices.at(indices(j)), m_parent->m_vertices.at(indices(k))); + } + + QTriangulator *m_parent; + int m_first; + int m_length; + }; + + inline QTriangulator() { } + + // Call this only once. + void initialize(const qreal *polygon, int count, uint hint, const QTransform &matrix); + // Call this only once. + void initialize(const QVectorPath &path, const QTransform &matrix, qreal lod); + // Call this only once. + void initialize(const QPainterPath &path, const QTransform &matrix, qreal lod); + // Call either triangulate() or polyline() only once. + QTriangleSet triangulate(); + QPolylineSet polyline(); +private: + QDataBuffer m_vertices; + QVector m_indices; + uint m_hint; +}; + +//============================================================================// +// QTriangulator // +//============================================================================// + +QTriangleSet QTriangulator::triangulate() +{ + for (int i = 0; i < m_vertices.size(); ++i) { + Q_ASSERT(qAbs(m_vertices.at(i).x) < (1 << 21)); + Q_ASSERT(qAbs(m_vertices.at(i).y) < (1 << 21)); + } + + if (!(m_hint & (QVectorPath::OddEvenFill | QVectorPath::WindingFill))) + m_hint |= QVectorPath::OddEvenFill; + + if (m_hint & QVectorPath::NonConvexShapeMask) { + ComplexToSimple c2s(this); + c2s.decompose(); + SimpleToMonotone s2m(this); + s2m.decompose(); + } + MonotoneToTriangles m2t(this); + m2t.decompose(); + + QTriangleSet result; + result.indices = m_indices; + result.vertices.resize(2 * m_vertices.size()); + for (int i = 0; i < m_vertices.size(); ++i) { + result.vertices[2 * i + 0] = qreal(m_vertices.at(i).x) / Q_FIXED_POINT_SCALE; + result.vertices[2 * i + 1] = qreal(m_vertices.at(i).y) / Q_FIXED_POINT_SCALE; + } + return result; +} + +QPolylineSet QTriangulator::polyline() +{ + QPolylineSet result; + result.indices = m_indices; + result.vertices.resize(2 * m_vertices.size()); + for (int i = 0; i < m_vertices.size(); ++i) { + result.vertices[2 * i + 0] = qreal(m_vertices.at(i).x) / Q_FIXED_POINT_SCALE; + result.vertices[2 * i + 1] = qreal(m_vertices.at(i).y) / Q_FIXED_POINT_SCALE; + } + return result; +} + +void QTriangulator::initialize(const qreal *polygon, int count, uint hint, const QTransform &matrix) +{ + m_hint = hint; + m_vertices.resize(count); + m_indices.resize(count + 1); + for (int i = 0; i < count; ++i) { + qreal x, y; + matrix.map(polygon[2 * i + 0], polygon[2 * i + 1], &x, &y); + m_vertices.at(i).x = qRound(x * Q_FIXED_POINT_SCALE); + m_vertices.at(i).y = qRound(y * Q_FIXED_POINT_SCALE); + m_indices[i] = i; + } + m_indices[count] = Q_TRIANGULATE_END_OF_POLYGON; +} + +void QTriangulator::initialize(const QVectorPath &path, const QTransform &matrix, qreal lod) +{ + m_hint = path.hints(); + // Curved paths will be converted to complex polygons. + m_hint &= ~QVectorPath::CurvedShapeMask; + + const qreal *p = path.points(); + const QPainterPath::ElementType *e = path.elements(); + if (e) { + for (int i = 0; i < path.elementCount(); ++i, ++e, p += 2) { + switch (*e) { + case QPainterPath::MoveToElement: + if (!m_indices.isEmpty()) + m_indices.push_back(Q_TRIANGULATE_END_OF_POLYGON); + // Fall through. + case QPainterPath::LineToElement: + m_indices.push_back(quint32(m_vertices.size())); + m_vertices.resize(m_vertices.size() + 1); + qreal x, y; + matrix.map(p[0], p[1], &x, &y); + m_vertices.last().x = qRound(x * Q_FIXED_POINT_SCALE); + m_vertices.last().y = qRound(y * Q_FIXED_POINT_SCALE); + break; + case QPainterPath::CurveToElement: + { + qreal pts[8]; + for (int i = 0; i < 4; ++i) + matrix.map(p[2 * i - 2], p[2 * i - 1], &pts[2 * i + 0], &pts[2 * i + 1]); + for (int i = 0; i < 8; ++i) + pts[i] *= lod; + QBezier bezier = QBezier::fromPoints(QPointF(pts[0], pts[1]), QPointF(pts[2], pts[3]), QPointF(pts[4], pts[5]), QPointF(pts[6], pts[7])); + QPolygonF poly = bezier.toPolygon(); + // Skip first point, it already exists in 'm_vertices'. + for (int j = 1; j < poly.size(); ++j) { + m_indices.push_back(quint32(m_vertices.size())); + m_vertices.resize(m_vertices.size() + 1); + m_vertices.last().x = qRound(poly.at(j).x() * Q_FIXED_POINT_SCALE / lod); + m_vertices.last().y = qRound(poly.at(j).y() * Q_FIXED_POINT_SCALE / lod); + } + } + i += 2; + e += 2; + p += 4; + break; + default: + Q_ASSERT_X(0, "QTriangulator::triangulate", "Unexpected element type."); + break; + } + } + } else { + for (int i = 0; i < path.elementCount(); ++i, p += 2) { + m_indices.push_back(quint32(m_vertices.size())); + m_vertices.resize(m_vertices.size() + 1); + qreal x, y; + matrix.map(p[0], p[1], &x, &y); + m_vertices.last().x = qRound(x * Q_FIXED_POINT_SCALE); + m_vertices.last().y = qRound(y * Q_FIXED_POINT_SCALE); + } + } + m_indices.push_back(Q_TRIANGULATE_END_OF_POLYGON); +} + +void QTriangulator::initialize(const QPainterPath &path, const QTransform &matrix, qreal lod) +{ + initialize(qtVectorPathForPath(path), matrix, lod); +} + +//============================================================================// +// QTriangulator::ComplexToSimple // +//============================================================================// + +void QTriangulator::ComplexToSimple::decompose() +{ + m_initialPointCount = m_parent->m_vertices.size(); + initEdges(); + do { + calculateIntersections(); + } while (splitEdgesAtIntersections()); + + removeUnwantedEdgesAndConnect(); + removeUnusedPoints(); + + m_parent->m_indices.clear(); + QBitArray processed(m_edges.size(), false); + for (int first = 0; first < m_edges.size(); ++first) { + // If already processed, or if unused path, skip. + if (processed.at(first) || m_edges.at(first).next == -1) + continue; + + int i = first; + do { + Q_ASSERT(!processed.at(i)); + Q_ASSERT(m_edges.at(m_edges.at(i).next).previous == i); + m_parent->m_indices.push_back(m_edges.at(i).from); + processed.setBit(i); + i = m_edges.at(i).next; // CCW order + } while (i != first); + m_parent->m_indices.push_back(Q_TRIANGULATE_END_OF_POLYGON); + } +} + +void QTriangulator::ComplexToSimple::initEdges() +{ + // Initialize edge structure. + // 'next' and 'previous' are not being initialized at this point. + int first = 0; + for (int i = 0; i < m_parent->m_indices.size(); ++i) { + if (m_parent->m_indices.at(i) == Q_TRIANGULATE_END_OF_POLYGON) { + if (m_edges.size() != first) + m_edges.last().to = m_edges.at(first).from; + first = m_edges.size(); + } else { + Q_ASSERT(i + 1 < m_parent->m_indices.size()); + // {node, from, to, next, previous, winding, mayIntersect, pointingUp, originallyPointingUp} + Edge edge = {0, m_parent->m_indices.at(i), m_parent->m_indices.at(i + 1), -1, -1, 0, true, false, false}; + m_edges.add(edge); + } + } + if (first != m_edges.size()) + m_edges.last().to = m_edges.at(first).from; + for (int i = 0; i < m_edges.size(); ++i) { + m_edges.at(i).originallyPointingUp = m_edges.at(i).pointingUp = + m_parent->m_vertices.at(m_edges.at(i).to) < m_parent->m_vertices.at(m_edges.at(i).from); + } +} + +// Return true if new intersection was found +bool QTriangulator::ComplexToSimple::calculateIntersection(int left, int right) +{ + const Edge &e1 = m_edges.at(left); + const Edge &e2 = m_edges.at(right); + + const QPodPoint &u1 = m_parent->m_vertices.at(e1.from); + const QPodPoint &u2 = m_parent->m_vertices.at(e1.to); + const QPodPoint &v1 = m_parent->m_vertices.at(e2.from); + const QPodPoint &v2 = m_parent->m_vertices.at(e2.to); + if (qMax(u1.x, u2.x) <= qMin(v1.x, v2.x)) + return false; + + quint64 key = (left > right ? (quint64(right) << 32) | quint64(left) : (quint64(left) << 32) | quint64(right)); + if (m_processedEdgePairs.contains(key)) + return false; + m_processedEdgePairs.insert(key); + + Intersection intersection; + intersection.leftEdge = left; + intersection.rightEdge = right; + intersection.intersectionPoint = qIntersectionPoint(u1, u2, v1, v2); + + if (!intersection.intersectionPoint.isValid()) + return false; + + Q_ASSERT(intersection.intersectionPoint.isOnLine(u1, u2)); + Q_ASSERT(intersection.intersectionPoint.isOnLine(v1, v2)); + + intersection.vertex = m_parent->m_vertices.size(); + m_topIntersection.push(intersection); + m_parent->m_vertices.add(intersection.intersectionPoint.round()); + return true; +} + +bool QTriangulator::ComplexToSimple::edgeIsLeftOfEdge(int leftEdgeIndex, int rightEdgeIndex) const +{ + const Edge &leftEdge = m_edges.at(leftEdgeIndex); + const Edge &rightEdge = m_edges.at(rightEdgeIndex); + const QPodPoint &u = m_parent->m_vertices.at(rightEdge.upper()); + const QPodPoint &l = m_parent->m_vertices.at(rightEdge.lower()); + const QPodPoint &upper = m_parent->m_vertices.at(leftEdge.upper()); + if (upper.x < qMin(l.x, u.x)) + return true; + if (upper.x > qMax(l.x, u.x)) + return false; + qint64 d = qPointDistanceFromLine(upper, l, u); + // d < 0: left, d > 0: right, d == 0: on top + if (d == 0) + d = qPointDistanceFromLine(m_parent->m_vertices.at(leftEdge.lower()), l, u); + return d < 0; +} + +QRBTree::Node *QTriangulator::ComplexToSimple::searchEdgeLeftOf(int edgeIndex) const +{ + QRBTree::Node *current = m_edgeList.root; + QRBTree::Node *result = 0; + while (current) { + if (edgeIsLeftOfEdge(edgeIndex, current->data)) { + current = current->left; + } else { + result = current; + current = current->right; + } + } + return result; +} + +QRBTree::Node *QTriangulator::ComplexToSimple::searchEdgeLeftOf(int edgeIndex, QRBTree::Node *after) const +{ + if (!m_edgeList.root) + return after; + QRBTree::Node *result = after; + QRBTree::Node *current = (after ? m_edgeList.next(after) : m_edgeList.front(m_edgeList.root)); + while (current) { + if (edgeIsLeftOfEdge(edgeIndex, current->data)) + return result; + result = current; + current = m_edgeList.next(current); + } + return result; +} + +QPair::Node *, QRBTree::Node *> QTriangulator::ComplexToSimple::bounds(const QPodPoint &point) const +{ + QRBTree::Node *current = m_edgeList.root; + QPair::Node *, QRBTree::Node *> result(0, 0); + while (current) { + const QPodPoint &v1 = m_parent->m_vertices.at(m_edges.at(current->data).lower()); + const QPodPoint &v2 = m_parent->m_vertices.at(m_edges.at(current->data).upper()); + int d = qPointDistanceFromLine(point, v1, v2); + if (d == 0) { + result.first = result.second = current; + break; + } + current = (d < 0 ? current->left : current->right); + } + if (current == 0) + return result; + + current = result.first->left; + while (current) { + const QPodPoint &v1 = m_parent->m_vertices.at(m_edges.at(current->data).lower()); + const QPodPoint &v2 = m_parent->m_vertices.at(m_edges.at(current->data).upper()); + int d = qPointDistanceFromLine(point, v1, v2); + Q_ASSERT(d >= 0); + if (d == 0) { + result.first = current; + current = current->left; + } else { + current = current->right; + } + } + + current = result.second->right; + while (current) { + const QPodPoint &v1 = m_parent->m_vertices.at(m_edges.at(current->data).lower()); + const QPodPoint &v2 = m_parent->m_vertices.at(m_edges.at(current->data).upper()); + int d = qPointDistanceFromLine(point, v1, v2); + Q_ASSERT(d <= 0); + if (d == 0) { + result.second = current; + current = current->right; + } else { + current = current->left; + } + } + + return result; +} + +QPair::Node *, QRBTree::Node *> QTriangulator::ComplexToSimple::outerBounds(const QPodPoint &point) const +{ + QRBTree::Node *current = m_edgeList.root; + QPair::Node *, QRBTree::Node *> result(0, 0); + + while (current) { + const QPodPoint &v1 = m_parent->m_vertices.at(m_edges.at(current->data).lower()); + const QPodPoint &v2 = m_parent->m_vertices.at(m_edges.at(current->data).upper()); + int d = qPointDistanceFromLine(point, v1, v2); + if (d == 0) + break; + if (d < 0) { + result.second = current; + current = current->left; + } else { + result.first = current; + current = current->right; + } + } + + if (!current) + return result; + + QRBTree::Node *mid = current; + + current = mid->left; + while (current) { + const QPodPoint &v1 = m_parent->m_vertices.at(m_edges.at(current->data).lower()); + const QPodPoint &v2 = m_parent->m_vertices.at(m_edges.at(current->data).upper()); + int d = qPointDistanceFromLine(point, v1, v2); + Q_ASSERT(d >= 0); + if (d == 0) { + current = current->left; + } else { + result.first = current; + current = current->right; + } + } + + current = mid->right; + while (current) { + const QPodPoint &v1 = m_parent->m_vertices.at(m_edges.at(current->data).lower()); + const QPodPoint &v2 = m_parent->m_vertices.at(m_edges.at(current->data).upper()); + int d = qPointDistanceFromLine(point, v1, v2); + Q_ASSERT(d <= 0); + if (d == 0) { + current = current->right; + } else { + result.second = current; + current = current->left; + } + } + + return result; +} + +void QTriangulator::ComplexToSimple::splitEdgeListRange(QRBTree::Node *leftmost, QRBTree::Node *rightmost, int vertex, const QIntersectionPoint &intersectionPoint) +{ + Q_ASSERT(leftmost && rightmost); + + // Split. + for (;;) { + const QPodPoint &u = m_parent->m_vertices.at(m_edges.at(leftmost->data).from); + const QPodPoint &v = m_parent->m_vertices.at(m_edges.at(leftmost->data).to); + Q_ASSERT(intersectionPoint.isOnLine(u, v)); + const Split split = {vertex, leftmost->data, intersectionPoint.isAccurate()}; + if (intersectionPoint.xOffset.numerator != 0 || intersectionPoint.yOffset.numerator != 0 || (intersectionPoint.upperLeft != u && intersectionPoint.upperLeft != v)) + m_splits.add(split); + if (leftmost == rightmost) + break; + leftmost = m_edgeList.next(leftmost); + } +} + + +void QTriangulator::ComplexToSimple::reorderEdgeListRange(QRBTree::Node *leftmost, QRBTree::Node *rightmost) +{ + Q_ASSERT(leftmost && rightmost); + + QRBTree::Node *storeLeftmost = leftmost; + QRBTree::Node *storeRightmost = rightmost; + + // Reorder. + while (leftmost != rightmost) { + Edge &left = m_edges.at(leftmost->data); + Edge &right = m_edges.at(rightmost->data); + qSwap(left.node, right.node); + qSwap(leftmost->data, rightmost->data); + leftmost = m_edgeList.next(leftmost); + if (leftmost == rightmost) + break; + rightmost = m_edgeList.previous(rightmost); + } + + rightmost = m_edgeList.next(storeRightmost); + leftmost = m_edgeList.previous(storeLeftmost); + if (leftmost) + calculateIntersection(leftmost->data, storeLeftmost->data); + if (rightmost) + calculateIntersection(storeRightmost->data, rightmost->data); +} + +void QTriangulator::ComplexToSimple::sortEdgeList(const QPodPoint eventPoint) +{ + QIntersectionPoint eventPoint2 = qIntersectionPoint(eventPoint); + while (!m_topIntersection.isEmpty() && m_topIntersection.top().intersectionPoint < eventPoint2) { + Intersection intersection = m_topIntersection.pop(); + + QIntersectionPoint currentIntersectionPoint = intersection.intersectionPoint; + int currentVertex = intersection.vertex; + + QRBTree::Node *leftmost = m_edges.at(intersection.leftEdge).node; + QRBTree::Node *rightmost = m_edges.at(intersection.rightEdge).node; + + for (;;) { + QRBTree::Node *previous = m_edgeList.previous(leftmost); + if (!previous) + break; + const Edge &edge = m_edges.at(previous->data); + const QPodPoint &u = m_parent->m_vertices.at(edge.from); + const QPodPoint &v = m_parent->m_vertices.at(edge.to); + if (!currentIntersectionPoint.isOnLine(u, v)) { + Q_ASSERT(!currentIntersectionPoint.isAccurate() || qCross(currentIntersectionPoint.upperLeft - u, v - u) != 0); + break; + } + leftmost = previous; + } + + for (;;) { + QRBTree::Node *next = m_edgeList.next(rightmost); + if (!next) + break; + const Edge &edge = m_edges.at(next->data); + const QPodPoint &u = m_parent->m_vertices.at(edge.from); + const QPodPoint &v = m_parent->m_vertices.at(edge.to); + if (!currentIntersectionPoint.isOnLine(u, v)) { + Q_ASSERT(!currentIntersectionPoint.isAccurate() || qCross(currentIntersectionPoint.upperLeft - u, v - u) != 0); + break; + } + rightmost = next; + } + + Q_ASSERT(leftmost && rightmost); + splitEdgeListRange(leftmost, rightmost, currentVertex, currentIntersectionPoint); + reorderEdgeListRange(leftmost, rightmost); + + while (!m_topIntersection.isEmpty() && m_topIntersection.top().intersectionPoint <= currentIntersectionPoint) + m_topIntersection.pop(); + +#ifdef Q_TRIANGULATOR_DEBUG + DebugDialog dialog(this, intersection.vertex); + dialog.exec(); +#endif + + } +} + +void QTriangulator::ComplexToSimple::fillPriorityQueue() +{ + m_events.reset(); + m_events.reserve(m_edges.size() * 2); + for (int i = 0; i < m_edges.size(); ++i) { + Q_ASSERT(m_edges.at(i).previous == -1 && m_edges.at(i).next == -1); + Q_ASSERT(m_edges.at(i).node == 0); + Q_ASSERT(m_edges.at(i).pointingUp == m_edges.at(i).originallyPointingUp); + Q_ASSERT(m_edges.at(i).pointingUp == (m_parent->m_vertices.at(m_edges.at(i).to) < m_parent->m_vertices.at(m_edges.at(i).from))); + // Ignore zero-length edges. + if (m_parent->m_vertices.at(m_edges.at(i).to) != m_parent->m_vertices.at(m_edges.at(i).from)) { + Event upperEvent = {m_parent->m_vertices.at(m_edges.at(i).upper()), Event::Upper, i}; + Event lowerEvent = {m_parent->m_vertices.at(m_edges.at(i).lower()), Event::Lower, i}; + m_events.add(upperEvent); + m_events.add(lowerEvent); + } + } + //qSort(m_events.data(), m_events.data() + m_events.size()); + sort(m_events.data(), m_events.size()); +} + +void QTriangulator::ComplexToSimple::calculateIntersections() +{ + fillPriorityQueue(); + + Q_ASSERT(m_topIntersection.empty()); + Q_ASSERT(m_edgeList.root == 0); + + // Find all intersection points. + while (!m_events.isEmpty()) { + Event event = m_events.last(); + sortEdgeList(event.point); + + // Find all edges in the edge list that contain the current vertex and mark them to be split later. + QPair::Node *, QRBTree::Node *> range = bounds(event.point); + QRBTree::Node *leftNode = range.first ? m_edgeList.previous(range.first) : 0; + int vertex = (event.type == Event::Upper ? m_edges.at(event.edge).upper() : m_edges.at(event.edge).lower()); + QIntersectionPoint eventPoint = qIntersectionPoint(event.point); + + if (range.first != 0) { + splitEdgeListRange(range.first, range.second, vertex, eventPoint); + reorderEdgeListRange(range.first, range.second); + } + + // Handle the edges with start or end point in the current vertex. + while (!m_events.isEmpty() && m_events.last().point == event.point) { + event = m_events.last(); + m_events.pop_back(); + int i = event.edge; + + if (m_edges.at(i).node) { + // Remove edge from edge list. + Q_ASSERT(event.type == Event::Lower); + QRBTree::Node *left = m_edgeList.previous(m_edges.at(i).node); + QRBTree::Node *right = m_edgeList.next(m_edges.at(i).node); + m_edgeList.deleteNode(m_edges.at(i).node); + if (!left || !right) + continue; + calculateIntersection(left->data, right->data); + } else { + // Insert edge into edge list. + Q_ASSERT(event.type == Event::Upper); + QRBTree::Node *left = searchEdgeLeftOf(i, leftNode); + m_edgeList.attachAfter(left, m_edges.at(i).node = m_edgeList.newNode()); + m_edges.at(i).node->data = i; + QRBTree::Node *right = m_edgeList.next(m_edges.at(i).node); + if (left) + calculateIntersection(left->data, i); + if (right) + calculateIntersection(i, right->data); + } + } + while (!m_topIntersection.isEmpty() && m_topIntersection.top().intersectionPoint <= eventPoint) + m_topIntersection.pop(); +#ifdef Q_TRIANGULATOR_DEBUG + DebugDialog dialog(this, vertex); + dialog.exec(); +#endif + } + m_processedEdgePairs.clear(); +} + +// Split an edge into two pieces at the given point. +// The upper piece is pushed to the end of the 'm_edges' vector. +// The lower piece replaces the old edge. +// Return the edge whose 'from' is 'pointIndex'. +int QTriangulator::ComplexToSimple::splitEdge(int splitIndex) +{ + const Split &split = m_splits.at(splitIndex); + Edge &lowerEdge = m_edges.at(split.edge); + Q_ASSERT(lowerEdge.node == 0); + Q_ASSERT(lowerEdge.previous == -1 && lowerEdge.next == -1); + + if (lowerEdge.from == split.vertex) + return split.edge; + if (lowerEdge.to == split.vertex) + return lowerEdge.next; + + // Check that angle >= 90 degrees. + //Q_ASSERT(qDot(m_points.at(m_edges.at(edgeIndex).from) - m_points.at(pointIndex), + // m_points.at(m_edges.at(edgeIndex).to) - m_points.at(pointIndex)) <= 0); + + Edge upperEdge = lowerEdge; + upperEdge.mayIntersect |= !split.accurate; // The edge may have been split before at an inaccurate split point. + lowerEdge.mayIntersect = !split.accurate; + if (lowerEdge.pointingUp) { + lowerEdge.to = upperEdge.from = split.vertex; + m_edges.add(upperEdge); + return m_edges.size() - 1; + } else { + lowerEdge.from = upperEdge.to = split.vertex; + m_edges.add(upperEdge); + return split.edge; + } +} + +bool QTriangulator::ComplexToSimple::splitEdgesAtIntersections() +{ + for (int i = 0; i < m_edges.size(); ++i) + m_edges.at(i).mayIntersect = false; + bool checkForNewIntersections = false; + for (int i = 0; i < m_splits.size(); ++i) { + splitEdge(i); + checkForNewIntersections |= !m_splits.at(i).accurate; + } + for (int i = 0; i < m_edges.size(); ++i) { + m_edges.at(i).originallyPointingUp = m_edges.at(i).pointingUp = + m_parent->m_vertices.at(m_edges.at(i).to) < m_parent->m_vertices.at(m_edges.at(i).from); + } + m_splits.reset(); + return checkForNewIntersections; +} + +void QTriangulator::ComplexToSimple::insertEdgeIntoVectorIfWanted(ShortArray &orderedEdges, int i) +{ + // Edges with zero length should not reach this part. + Q_ASSERT(m_parent->m_vertices.at(m_edges.at(i).from) != m_parent->m_vertices.at(m_edges.at(i).to)); + + // Skip edges with unwanted winding number. + int windingNumber = m_edges.at(i).winding; + if (m_edges.at(i).originallyPointingUp) + ++windingNumber; + + // Make sure exactly one fill rule is specified. + Q_ASSERT(((m_parent->m_hint & QVectorPath::WindingFill) != 0) != ((m_parent->m_hint & QVectorPath::OddEvenFill) != 0)); + + if ((m_parent->m_hint & QVectorPath::WindingFill) && windingNumber != 0 && windingNumber != 1) + return; + + // Skip cancelling edges. + if (!orderedEdges.isEmpty()) { + int j = orderedEdges[orderedEdges.size() - 1]; + // If the last edge is already connected in one end, it should not be cancelled. + if (m_edges.at(j).next == -1 && m_edges.at(j).previous == -1 + && (m_parent->m_vertices.at(m_edges.at(i).from) == m_parent->m_vertices.at(m_edges.at(j).to)) + && (m_parent->m_vertices.at(m_edges.at(i).to) == m_parent->m_vertices.at(m_edges.at(j).from))) { + orderedEdges.removeLast(); + return; + } + } + orderedEdges.append(i); +} + +void QTriangulator::ComplexToSimple::removeUnwantedEdgesAndConnect() +{ + Q_ASSERT(m_edgeList.root == 0); + // Initialize priority queue. + fillPriorityQueue(); + + ShortArray orderedEdges; + + while (!m_events.isEmpty()) { + Event event = m_events.last(); + int edgeIndex = event.edge; + + // Check that all the edges in the list crosses the current scanline + //if (m_edgeList.root) { + // for (QRBTree::Node *node = m_edgeList.front(m_edgeList.root); node; node = m_edgeList.next(node)) { + // Q_ASSERT(event.point <= m_points.at(m_edges.at(node->data).lower())); + // } + //} + + orderedEdges.clear(); + QPair::Node *, QRBTree::Node *> b = outerBounds(event.point); + if (m_edgeList.root) { + QRBTree::Node *current = (b.first ? m_edgeList.next(b.first) : m_edgeList.front(m_edgeList.root)); + // Process edges that are going to be removed from the edge list at the current event point. + while (current != b.second) { + Q_ASSERT(current); + Q_ASSERT(m_edges.at(current->data).node == current); + Q_ASSERT(qIntersectionPoint(event.point).isOnLine(m_parent->m_vertices.at(m_edges.at(current->data).from), m_parent->m_vertices.at(m_edges.at(current->data).to))); + Q_ASSERT(m_parent->m_vertices.at(m_edges.at(current->data).from) == event.point || m_parent->m_vertices.at(m_edges.at(current->data).to) == event.point); + insertEdgeIntoVectorIfWanted(orderedEdges, current->data); + current = m_edgeList.next(current); + } + } + + // Remove edges above the event point, insert edges below the event point. + do { + event = m_events.last(); + m_events.pop_back(); + edgeIndex = event.edge; + + // Edges with zero length should not reach this part. + Q_ASSERT(m_parent->m_vertices.at(m_edges.at(edgeIndex).from) != m_parent->m_vertices.at(m_edges.at(edgeIndex).to)); + + if (m_edges.at(edgeIndex).node) { + Q_ASSERT(event.type == Event::Lower); + Q_ASSERT(event.point == m_parent->m_vertices.at(m_edges.at(event.edge).lower())); + m_edgeList.deleteNode(m_edges.at(edgeIndex).node); + } else { + Q_ASSERT(event.type == Event::Upper); + Q_ASSERT(event.point == m_parent->m_vertices.at(m_edges.at(event.edge).upper())); + QRBTree::Node *left = searchEdgeLeftOf(edgeIndex, b.first); + m_edgeList.attachAfter(left, m_edges.at(edgeIndex).node = m_edgeList.newNode()); + m_edges.at(edgeIndex).node->data = edgeIndex; + } + } while (!m_events.isEmpty() && m_events.last().point == event.point); + + if (m_edgeList.root) { + QRBTree::Node *current = (b.first ? m_edgeList.next(b.first) : m_edgeList.front(m_edgeList.root)); + + // Calculate winding number and turn counter-clockwise. + int currentWindingNumber = (b.first ? m_edges.at(b.first->data).winding : 0); + while (current != b.second) { + Q_ASSERT(current); + //Q_ASSERT(b.second == 0 || m_edgeList.order(current, b.second) < 0); + int i = current->data; + Q_ASSERT(m_edges.at(i).node == current); + + // Winding number. + int ccwWindingNumber = m_edges.at(i).winding = currentWindingNumber; + if (m_edges.at(i).originallyPointingUp) { + --m_edges.at(i).winding; + } else { + ++m_edges.at(i).winding; + ++ccwWindingNumber; + } + currentWindingNumber = m_edges.at(i).winding; + + // Turn counter-clockwise. + if ((ccwWindingNumber & 1) == 0) { + Q_ASSERT(m_edges.at(i).previous == -1 && m_edges.at(i).next == -1); + qSwap(m_edges.at(i).from, m_edges.at(i).to); + m_edges.at(i).pointingUp = !m_edges.at(i).pointingUp; + } + + current = m_edgeList.next(current); + } + + // Process edges that were inserted into the edge list at the current event point. + current = (b.second ? m_edgeList.previous(b.second) : m_edgeList.back(m_edgeList.root)); + while (current != b.first) { + Q_ASSERT(current); + Q_ASSERT(m_edges.at(current->data).node == current); + insertEdgeIntoVectorIfWanted(orderedEdges, current->data); + current = m_edgeList.previous(current); + } + } + if (orderedEdges.isEmpty()) + continue; + + Q_ASSERT((orderedEdges.size() & 1) == 0); + + // Connect edges. + // First make sure the first edge point towards the current point. + int i; + if (m_parent->m_vertices.at(m_edges.at(orderedEdges[0]).from) == event.point) { + i = 1; + int copy = orderedEdges[0]; // Make copy in case the append() will cause a reallocation. + orderedEdges.append(copy); + } else { + Q_ASSERT(m_parent->m_vertices.at(m_edges.at(orderedEdges[0]).to) == event.point); + i = 0; + } + + // Remove references to duplicate points. First find the point with lowest index. + int pointIndex = INT_MAX; + for (int j = i; j < orderedEdges.size(); j += 2) { + Q_ASSERT(j + 1 < orderedEdges.size()); + Q_ASSERT(m_parent->m_vertices.at(m_edges.at(orderedEdges[j]).to) == event.point); + Q_ASSERT(m_parent->m_vertices.at(m_edges.at(orderedEdges[j + 1]).from) == event.point); + if (m_edges.at(orderedEdges[j]).to < pointIndex) + pointIndex = m_edges.at(orderedEdges[j]).to; + if (m_edges.at(orderedEdges[j + 1]).from < pointIndex) + pointIndex = m_edges.at(orderedEdges[j + 1]).from; + } + + for (; i < orderedEdges.size(); i += 2) { + // Remove references to duplicate points by making all edges reference one common point. + m_edges.at(orderedEdges[i]).to = m_edges.at(orderedEdges[i + 1]).from = pointIndex; + + Q_ASSERT(m_edges.at(orderedEdges[i]).pointingUp || m_edges.at(orderedEdges[i]).previous != -1); + Q_ASSERT(!m_edges.at(orderedEdges[i + 1]).pointingUp || m_edges.at(orderedEdges[i + 1]).next != -1); + + m_edges.at(orderedEdges[i]).next = orderedEdges[i + 1]; + m_edges.at(orderedEdges[i + 1]).previous = orderedEdges[i]; + } + } // end while +} + +void QTriangulator::ComplexToSimple::removeUnusedPoints() { + QBitArray used(m_parent->m_vertices.size(), false); + for (int i = 0; i < m_edges.size(); ++i) { + Q_ASSERT((m_edges.at(i).previous == -1) == (m_edges.at(i).next == -1)); + if (m_edges.at(i).next != -1) + used.setBit(m_edges.at(i).from); + } + QDataBuffer newMapping(m_parent->m_vertices.size()); + newMapping.resize(m_parent->m_vertices.size()); + int count = 0; + for (int i = 0; i < m_parent->m_vertices.size(); ++i) { + if (used.at(i)) { + m_parent->m_vertices.at(count) = m_parent->m_vertices.at(i); + newMapping.at(i) = count; + ++count; + } + } + m_parent->m_vertices.resize(count); + for (int i = 0; i < m_edges.size(); ++i) { + m_edges.at(i).from = newMapping.at(m_edges.at(i).from); + m_edges.at(i).to = newMapping.at(m_edges.at(i).to); + } +} + +bool QTriangulator::ComplexToSimple::CompareEdges::operator () (int i, int j) const +{ + int cmp = comparePoints(m_parent->m_parent->m_vertices.at(m_parent->m_edges.at(i).from), + m_parent->m_parent->m_vertices.at(m_parent->m_edges.at(j).from)); + if (cmp == 0) { + cmp = comparePoints(m_parent->m_parent->m_vertices.at(m_parent->m_edges.at(i).to), + m_parent->m_parent->m_vertices.at(m_parent->m_edges.at(j).to)); + } + return cmp > 0; +} + +inline bool QTriangulator::ComplexToSimple::Event::operator < (const Event &other) const +{ + if (point == other.point) + return type < other.type; // 'Lower' has higher priority than 'Upper'. + return other.point < point; +} + +//============================================================================// +// QTriangulator::ComplexToSimple::DebugDialog // +//============================================================================// + +#ifdef Q_TRIANGULATOR_DEBUG + +QTriangulator::ComplexToSimple::DebugDialog::DebugDialog(ComplexToSimple *parent, int currentVertex) + : m_parent(parent), m_vertex(currentVertex) +{ + QDataBuffer &vertices = m_parent->m_parent->m_vertices; + if (vertices.isEmpty()) + return; + + int minX, maxX, minY, maxY; + minX = maxX = vertices.at(0).x; + minY = maxY = vertices.at(0).y; + for (int i = 1; i < vertices.size(); ++i) { + minX = qMin(minX, vertices.at(i).x); + maxX = qMax(maxX, vertices.at(i).x); + minY = qMin(minY, vertices.at(i).y); + maxY = qMax(maxY, vertices.at(i).y); + } + int w = maxX - minX; + int h = maxY - minY; + qreal border = qMin(w, h) / 10.0; + m_window = QRectF(minX - border, minY - border, (maxX - minX + 2 * border), (maxY - minY + 2 * border)); +} + +void QTriangulator::ComplexToSimple::DebugDialog::paintEvent(QPaintEvent *) +{ + QPainter p(this); + p.setRenderHint(QPainter::Antialiasing, true); + p.fillRect(rect(), Qt::black); + QDataBuffer &vertices = m_parent->m_parent->m_vertices; + if (vertices.isEmpty()) + return; + + qreal halfPointSize = qMin(m_window.width(), m_window.height()) / 300.0; + p.setWindow(m_window.toRect()); + + p.setPen(Qt::white); + + QDataBuffer &edges = m_parent->m_edges; + for (int i = 0; i < edges.size(); ++i) { + QPodPoint u = vertices.at(edges.at(i).from); + QPodPoint v = vertices.at(edges.at(i).to); + p.drawLine(u.x, u.y, v.x, v.y); + } + + for (int i = 0; i < vertices.size(); ++i) { + QPodPoint q = vertices.at(i); + p.fillRect(QRectF(q.x - halfPointSize, q.y - halfPointSize, 2 * halfPointSize, 2 * halfPointSize), Qt::red); + } + + Qt::GlobalColor colors[6] = {Qt::red, Qt::green, Qt::blue, Qt::cyan, Qt::magenta, Qt::yellow}; + p.setOpacity(0.5); + int count = 0; + if (m_parent->m_edgeList.root) { + QRBTree::Node *current = m_parent->m_edgeList.front(m_parent->m_edgeList.root); + while (current) { + p.setPen(colors[count++ % 6]); + QPodPoint u = vertices.at(edges.at(current->data).from); + QPodPoint v = vertices.at(edges.at(current->data).to); + p.drawLine(u.x, u.y, v.x, v.y); + current = m_parent->m_edgeList.next(current); + } + } + + p.setOpacity(1.0); + QPodPoint q = vertices.at(m_vertex); + p.fillRect(QRectF(q.x - halfPointSize, q.y - halfPointSize, 2 * halfPointSize, 2 * halfPointSize), Qt::green); + + p.setPen(Qt::gray); + QDataBuffer &splits = m_parent->m_splits; + for (int i = 0; i < splits.size(); ++i) { + QPodPoint q = vertices.at(splits.at(i).vertex); + QPodPoint u = vertices.at(edges.at(splits.at(i).edge).from) - q; + QPodPoint v = vertices.at(edges.at(splits.at(i).edge).to) - q; + qreal uLen = sqrt(qreal(qDot(u, u))); + qreal vLen = sqrt(qreal(qDot(v, v))); + if (uLen) { + u.x *= 2 * halfPointSize / uLen; + u.y *= 2 * halfPointSize / uLen; + } + if (vLen) { + v.x *= 2 * halfPointSize / vLen; + v.y *= 2 * halfPointSize / vLen; + } + u += q; + v += q; + p.drawLine(u.x, u.y, v.x, v.y); + } +} + +void QTriangulator::ComplexToSimple::DebugDialog::wheelEvent(QWheelEvent *event) +{ + qreal scale = exp(-0.001 * event->delta()); + QPointF center = m_window.center(); + QPointF delta = scale * (m_window.bottomRight() - center); + m_window = QRectF(center - delta, center + delta); + event->accept(); + update(); +} + +void QTriangulator::ComplexToSimple::DebugDialog::mouseMoveEvent(QMouseEvent *event) +{ + if (event->buttons() & Qt::LeftButton) { + QPointF delta = event->pos() - m_lastMousePos; + delta.setX(delta.x() * m_window.width() / width()); + delta.setY(delta.y() * m_window.height() / height()); + m_window.translate(-delta.x(), -delta.y()); + m_lastMousePos = event->pos(); + event->accept(); + update(); + } +} + +void QTriangulator::ComplexToSimple::DebugDialog::mousePressEvent(QMouseEvent *event) +{ + if (event->button() == Qt::LeftButton) + m_lastMousePos = event->pos(); + event->accept(); +} + + +#endif + +//============================================================================// +// QTriangulator::SimpleToMonotone // +//============================================================================// + +void QTriangulator::SimpleToMonotone::decompose() +{ + setupDataStructures(); + removeZeroLengthEdges(); + monotoneDecomposition(); + + m_parent->m_indices.clear(); + QBitArray processed(m_edges.size(), false); + for (int first = 0; first < m_edges.size(); ++first) { + if (processed.at(first)) + continue; + int i = first; + do { + Q_ASSERT(!processed.at(i)); + Q_ASSERT(m_edges.at(m_edges.at(i).next).previous == i); + m_parent->m_indices.push_back(m_edges.at(i).from); + processed.setBit(i); + i = m_edges.at(i).next; + } while (i != first); + if (m_parent->m_indices.size() > 0 && m_parent->m_indices.back() != Q_TRIANGULATE_END_OF_POLYGON) + m_parent->m_indices.push_back(Q_TRIANGULATE_END_OF_POLYGON); + } +} + +void QTriangulator::SimpleToMonotone::setupDataStructures() +{ + int i = 0; + Edge e; + e.node = 0; + e.twin = -1; + + while (i + 3 <= m_parent->m_indices.size()) { + int start = m_edges.size(); + + do { + e.from = m_parent->m_indices.at(i); + e.type = RegularVertex; + e.next = m_edges.size() + 1; + e.previous = m_edges.size() - 1; + m_edges.add(e); + ++i; + Q_ASSERT(i < m_parent->m_indices.size()); + } while (m_parent->m_indices.at(i) != Q_TRIANGULATE_END_OF_POLYGON); + + m_edges.last().next = start; + m_edges.at(start).previous = m_edges.size() - 1; + ++i; // Skip Q_TRIANGULATE_END_OF_POLYGON. + } + + for (i = 0; i < m_edges.size(); ++i) { + m_edges.at(i).to = m_edges.at(m_edges.at(i).next).from; + m_edges.at(i).pointingUp = m_parent->m_vertices.at(m_edges.at(i).to) < m_parent->m_vertices.at(m_edges.at(i).from); + m_edges.at(i).helper = -1; // Not initialized here. + } +} + +void QTriangulator::SimpleToMonotone::removeZeroLengthEdges() +{ + for (int i = 0; i < m_edges.size(); ++i) { + if (m_parent->m_vertices.at(m_edges.at(i).from) == m_parent->m_vertices.at(m_edges.at(i).to)) { + m_edges.at(m_edges.at(i).previous).next = m_edges.at(i).next; + m_edges.at(m_edges.at(i).next).previous = m_edges.at(i).previous; + m_edges.at(m_edges.at(i).next).from = m_edges.at(i).from; + m_edges.at(i).next = -1; // Mark as removed. + } + } + + QDataBuffer newMapping(m_edges.size()); + newMapping.resize(m_edges.size()); + int count = 0; + for (int i = 0; i < m_edges.size(); ++i) { + if (m_edges.at(i).next != -1) { + m_edges.at(count) = m_edges.at(i); + newMapping.at(i) = count; + ++count; + } + } + m_edges.resize(count); + for (int i = 0; i < m_edges.size(); ++i) { + m_edges.at(i).next = newMapping.at(m_edges.at(i).next); + m_edges.at(i).previous = newMapping.at(m_edges.at(i).previous); + } +} + +void QTriangulator::SimpleToMonotone::fillPriorityQueue() +{ + m_upperVertex.reset(); + m_upperVertex.reserve(m_edges.size()); + for (int i = 0; i < m_edges.size(); ++i) + m_upperVertex.add(i); + CompareVertices cmp(this); + //qSort(m_upperVertex.data(), m_upperVertex.data() + m_upperVertex.size(), cmp); + sort(m_upperVertex.data(), m_upperVertex.size(), cmp); + //for (int i = 1; i < m_upperVertex.size(); ++i) { + // Q_ASSERT(!cmp(m_upperVertex.at(i), m_upperVertex.at(i - 1))); + //} +} + +bool QTriangulator::SimpleToMonotone::edgeIsLeftOfEdge(int leftEdgeIndex, int rightEdgeIndex) const +{ + const Edge &leftEdge = m_edges.at(leftEdgeIndex); + const Edge &rightEdge = m_edges.at(rightEdgeIndex); + const QPodPoint &u = m_parent->m_vertices.at(rightEdge.upper()); + const QPodPoint &l = m_parent->m_vertices.at(rightEdge.lower()); + qint64 d = qPointDistanceFromLine(m_parent->m_vertices.at(leftEdge.upper()), l, u); + // d < 0: left, d > 0: right, d == 0: on top + if (d == 0) + d = qPointDistanceFromLine(m_parent->m_vertices.at(leftEdge.lower()), l, u); + return d < 0; +} + +// Returns the rightmost edge not to the right of the given edge. +QRBTree::Node *QTriangulator::SimpleToMonotone::searchEdgeLeftOfEdge(int edgeIndex) const +{ + QRBTree::Node *current = m_edgeList.root; + QRBTree::Node *result = 0; + while (current) { + if (edgeIsLeftOfEdge(edgeIndex, current->data)) { + current = current->left; + } else { + result = current; + current = current->right; + } + } + return result; +} + +// Returns the rightmost edge left of the given point. +QRBTree::Node *QTriangulator::SimpleToMonotone::searchEdgeLeftOfPoint(int pointIndex) const +{ + QRBTree::Node *current = m_edgeList.root; + QRBTree::Node *result = 0; + while (current) { + const QPodPoint &p1 = m_parent->m_vertices.at(m_edges.at(current->data).lower()); + const QPodPoint &p2 = m_parent->m_vertices.at(m_edges.at(current->data).upper()); + qint64 d = qPointDistanceFromLine(m_parent->m_vertices.at(pointIndex), p1, p2); + if (d <= 0) { + current = current->left; + } else { + result = current; + current = current->right; + } + } + return result; +} + +void QTriangulator::SimpleToMonotone::classifyVertex(int i) +{ + Edge &e2 = m_edges.at(i); + const Edge &e1 = m_edges.at(e2.previous); + + bool startOrSplit = (e1.pointingUp && !e2.pointingUp); + bool endOrMerge = (!e1.pointingUp && e2.pointingUp); + + const QPodPoint &p1 = m_parent->m_vertices.at(e1.from); + const QPodPoint &p2 = m_parent->m_vertices.at(e2.from); + const QPodPoint &p3 = m_parent->m_vertices.at(e2.to); + qint64 d = qPointDistanceFromLine(p1, p2, p3); + Q_ASSERT(d != 0 || (!startOrSplit && !endOrMerge)); + + e2.type = RegularVertex; + + if (m_clockwiseOrder) { + if (startOrSplit) + e2.type = (d < 0 ? SplitVertex : StartVertex); + else if (endOrMerge) + e2.type = (d < 0 ? MergeVertex : EndVertex); + } else { + if (startOrSplit) + e2.type = (d > 0 ? SplitVertex : StartVertex); + else if (endOrMerge) + e2.type = (d > 0 ? MergeVertex : EndVertex); + } +} + +void QTriangulator::SimpleToMonotone::classifyVertices() +{ + for (int i = 0; i < m_edges.size(); ++i) + classifyVertex(i); +} + +bool QTriangulator::SimpleToMonotone::pointIsInSector(const QPodPoint &p, const QPodPoint &v1, const QPodPoint &v2, const QPodPoint &v3) +{ + bool leftOfPreviousEdge = !qPointIsLeftOfLine(p, v2, v1); + bool leftOfNextEdge = !qPointIsLeftOfLine(p, v3, v2); + + if (qPointIsLeftOfLine(v1, v2, v3)) + return leftOfPreviousEdge && leftOfNextEdge; + else + return leftOfPreviousEdge || leftOfNextEdge; +} + +bool QTriangulator::SimpleToMonotone::pointIsInSector(int vertex, int sector) +{ + const QPodPoint ¢er = m_parent->m_vertices.at(m_edges.at(sector).from); + // Handle degenerate edges. + while (m_parent->m_vertices.at(m_edges.at(vertex).from) == center) + vertex = m_edges.at(vertex).next; + int next = m_edges.at(sector).next; + while (m_parent->m_vertices.at(m_edges.at(next).from) == center) + next = m_edges.at(next).next; + int previous = m_edges.at(sector).previous; + while (m_parent->m_vertices.at(m_edges.at(previous).from) == center) + previous = m_edges.at(previous).previous; + + const QPodPoint &p = m_parent->m_vertices.at(m_edges.at(vertex).from); + const QPodPoint &v1 = m_parent->m_vertices.at(m_edges.at(previous).from); + const QPodPoint &v3 = m_parent->m_vertices.at(m_edges.at(next).from); + if (m_clockwiseOrder) + return pointIsInSector(p, v3, center, v1); + else + return pointIsInSector(p, v1, center, v3); +} + +int QTriangulator::SimpleToMonotone::findSector(int edge, int vertex) +{ + while (!pointIsInSector(vertex, edge)) { + edge = m_edges.at(m_edges.at(edge).previous).twin; + Q_ASSERT(edge != -1); + } + return edge; +} + +void QTriangulator::SimpleToMonotone::createDiagonal(int lower, int upper) +{ + lower = findSector(lower, upper); + upper = findSector(upper, lower); + + int prevLower = m_edges.at(lower).previous; + int prevUpper = m_edges.at(upper).previous; + + Edge e; + + e.twin = m_edges.size() + 1; + e.next = upper; + e.previous = prevLower; + e.from = m_edges.at(lower).from; + e.to = m_edges.at(upper).from; + m_edges.at(upper).previous = m_edges.at(prevLower).next = int(m_edges.size()); + m_edges.add(e); + + e.twin = m_edges.size() - 1; + e.next = lower; + e.previous = prevUpper; + e.from = m_edges.at(upper).from; + e.to = m_edges.at(lower).from; + m_edges.at(lower).previous = m_edges.at(prevUpper).next = int(m_edges.size()); + m_edges.add(e); +} + +void QTriangulator::SimpleToMonotone::monotoneDecomposition() +{ + if (m_edges.isEmpty()) + return; + + Q_ASSERT(!m_edgeList.root); + QDataBuffer > diagonals; + + int i = 0; + for (int index = 1; index < m_edges.size(); ++index) { + if (m_parent->m_vertices.at(m_edges.at(index).from) < m_parent->m_vertices.at(m_edges.at(i).from)) + i = index; + } + Q_ASSERT(i < m_edges.size()); + int j = m_edges.at(i).previous; + Q_ASSERT(j < m_edges.size()); + m_clockwiseOrder = qPointIsLeftOfLine(m_parent->m_vertices.at(m_edges.at(i).from), + m_parent->m_vertices.at(m_edges.at(j).from), m_parent->m_vertices.at(m_edges.at(i).to)); + + classifyVertices(); + fillPriorityQueue(); + + // debug: set helpers explicitly (shouldn't be necessary) + //for (int i = 0; i < m_edges.size(); ++i) + // m_edges.at(i).helper = m_edges.at(i).upper(); + + while (!m_upperVertex.isEmpty()) { + i = m_upperVertex.last(); + Q_ASSERT(i < m_edges.size()); + m_upperVertex.pop_back(); + j = m_edges.at(i).previous; + Q_ASSERT(j < m_edges.size()); + + QRBTree::Node *leftEdgeNode = 0; + + switch (m_edges.at(i).type) { + case RegularVertex: + // If polygon interior is to the right of the vertex... + if (m_edges.at(i).pointingUp == m_clockwiseOrder) { + if (m_edges.at(i).node) { + Q_ASSERT(!m_edges.at(j).node); + if (m_edges.at(m_edges.at(i).helper).type == MergeVertex) + diagonals.add(std::pair(i, m_edges.at(i).helper)); + m_edges.at(j).node = m_edges.at(i).node; + m_edges.at(i).node = 0; + m_edges.at(j).node->data = j; + m_edges.at(j).helper = i; + } else if (m_edges.at(j).node) { + Q_ASSERT(!m_edges.at(i).node); + if (m_edges.at(m_edges.at(j).helper).type == MergeVertex) + diagonals.add(std::pair(i, m_edges.at(j).helper)); + m_edges.at(i).node = m_edges.at(j).node; + m_edges.at(j).node = 0; + m_edges.at(i).node->data = i; + m_edges.at(i).helper = i; + } else { + qWarning("Inconsistent polygon. (#1)"); + } + } else { + leftEdgeNode = searchEdgeLeftOfPoint(m_edges.at(i).from); + if (leftEdgeNode) { + if (m_edges.at(m_edges.at(leftEdgeNode->data).helper).type == MergeVertex) + diagonals.add(std::pair(i, m_edges.at(leftEdgeNode->data).helper)); + m_edges.at(leftEdgeNode->data).helper = i; + } else { + qWarning("Inconsistent polygon. (#2)"); + } + } + break; + case SplitVertex: + leftEdgeNode = searchEdgeLeftOfPoint(m_edges.at(i).from); + if (leftEdgeNode) { + diagonals.add(std::pair(i, m_edges.at(leftEdgeNode->data).helper)); + m_edges.at(leftEdgeNode->data).helper = i; + } else { + qWarning("Inconsistent polygon. (#3)"); + } + // Fall through. + case StartVertex: + if (m_clockwiseOrder) { + leftEdgeNode = searchEdgeLeftOfEdge(j); + QRBTree::Node *node = m_edgeList.newNode(); + node->data = j; + m_edges.at(j).node = node; + m_edges.at(j).helper = i; + m_edgeList.attachAfter(leftEdgeNode, node); + Q_ASSERT(m_edgeList.verify()); + } else { + leftEdgeNode = searchEdgeLeftOfEdge(i); + QRBTree::Node *node = m_edgeList.newNode(); + node->data = i; + m_edges.at(i).node = node; + m_edges.at(i).helper = i; + m_edgeList.attachAfter(leftEdgeNode, node); + Q_ASSERT(m_edgeList.verify()); + } + break; + case MergeVertex: + leftEdgeNode = searchEdgeLeftOfPoint(m_edges.at(i).from); + if (leftEdgeNode) { + if (m_edges.at(m_edges.at(leftEdgeNode->data).helper).type == MergeVertex) + diagonals.add(std::pair(i, m_edges.at(leftEdgeNode->data).helper)); + m_edges.at(leftEdgeNode->data).helper = i; + } else { + qWarning("Inconsistent polygon. (#4)"); + } + // Fall through. + case EndVertex: + if (m_clockwiseOrder) { + if (m_edges.at(m_edges.at(i).helper).type == MergeVertex) + diagonals.add(std::pair(i, m_edges.at(i).helper)); + if (m_edges.at(i).node) { + m_edgeList.deleteNode(m_edges.at(i).node); + Q_ASSERT(m_edgeList.verify()); + } else { + qWarning("Inconsistent polygon. (#5)"); + } + } else { + if (m_edges.at(m_edges.at(j).helper).type == MergeVertex) + diagonals.add(std::pair(i, m_edges.at(j).helper)); + if (m_edges.at(j).node) { + m_edgeList.deleteNode(m_edges.at(j).node); + Q_ASSERT(m_edgeList.verify()); + } else { + qWarning("Inconsistent polygon. (#6)"); + } + } + break; + } + } + + for (int i = 0; i < diagonals.size(); ++i) + createDiagonal(diagonals.at(i).first, diagonals.at(i).second); +} + +bool QTriangulator::SimpleToMonotone::CompareVertices::operator () (int i, int j) const +{ + if (m_parent->m_edges.at(i).from == m_parent->m_edges.at(j).from) + return m_parent->m_edges.at(i).type > m_parent->m_edges.at(j).type; + return m_parent->m_parent->m_vertices.at(m_parent->m_edges.at(i).from) > + m_parent->m_parent->m_vertices.at(m_parent->m_edges.at(j).from); +} + +//============================================================================// +// QTriangulator::MonotoneToTriangles // +//============================================================================// + +void QTriangulator::MonotoneToTriangles::decompose() +{ + QVector result; + QDataBuffer stack; + m_first = 0; + // Require at least three more indices. + while (m_first + 3 <= m_parent->m_indices.size()) { + m_length = 0; + while (m_parent->m_indices.at(m_first + m_length) != Q_TRIANGULATE_END_OF_POLYGON) { + ++m_length; + Q_ASSERT(m_first + m_length < m_parent->m_indices.size()); + } + if (m_length < 3) { + m_first += m_length + 1; + continue; + } + + int minimum = 0; + while (less(next(minimum), minimum)) + minimum = next(minimum); + while (less(previous(minimum), minimum)) + minimum = previous(minimum); + + stack.reset(); + stack.add(minimum); + int left = previous(minimum); + int right = next(minimum); + bool stackIsOnLeftSide; + bool clockwiseOrder = leftOfEdge(minimum, left, right); + + if (less(left, right)) { + stack.add(left); + left = previous(left); + stackIsOnLeftSide = true; + } else { + stack.add(right); + right = next(right); + stackIsOnLeftSide = false; + } + + for (int count = 0; count + 2 < m_length; ++count) + { + Q_ASSERT(stack.size() >= 2); + if (less(left, right)) { + if (stackIsOnLeftSide == false) { + for (int i = 0; i + 1 < stack.size(); ++i) { + result.push_back(indices(stack.at(i + 1))); + result.push_back(indices(left)); + result.push_back(indices(stack.at(i))); + } + stack.first() = stack.last(); + stack.resize(1); + } else { + while (stack.size() >= 2 && (clockwiseOrder ^ !leftOfEdge(left, stack.at(stack.size() - 2), stack.last()))) { + result.push_back(indices(stack.at(stack.size() - 2))); + result.push_back(indices(left)); + result.push_back(indices(stack.last())); + stack.pop_back(); + } + } + stack.add(left); + left = previous(left); + stackIsOnLeftSide = true; + } else { + if (stackIsOnLeftSide == true) { + for (int i = 0; i + 1 < stack.size(); ++i) { + result.push_back(indices(stack.at(i))); + result.push_back(indices(right)); + result.push_back(indices(stack.at(i + 1))); + } + stack.first() = stack.last(); + stack.resize(1); + } else { + while (stack.size() >= 2 && (clockwiseOrder ^ !leftOfEdge(right, stack.last(), stack.at(stack.size() - 2)))) { + result.push_back(indices(stack.last())); + result.push_back(indices(right)); + result.push_back(indices(stack.at(stack.size() - 2))); + stack.pop_back(); + } + } + stack.add(right); + right = next(right); + stackIsOnLeftSide = false; + } + } + + m_first += m_length + 1; + } + m_parent->m_indices = result; +} + +//============================================================================// +// qTriangulate // +//============================================================================// + +QTriangleSet qTriangulate(const qreal *polygon, int count, uint hint, const QTransform &matrix) +{ + QTriangulator triangulator; + triangulator.initialize(polygon, count, hint, matrix); + return triangulator.triangulate(); +} + +QTriangleSet qTriangulate(const QVectorPath &path, const QTransform &matrix, qreal lod) +{ + QTriangulator triangulator; + triangulator.initialize(path, matrix, lod); + return triangulator.triangulate(); +} + +QTriangleSet qTriangulate(const QPainterPath &path, const QTransform &matrix, qreal lod) +{ + QTriangulator triangulator; + triangulator.initialize(path, matrix, lod); + return triangulator.triangulate(); +} + +QPolylineSet qPolyline(const QVectorPath &path, const QTransform &matrix, qreal lod) +{ + QTriangulator triangulator; + triangulator.initialize(path, matrix, lod); + return triangulator.polyline(); +} + +QPolylineSet qPolyline(const QPainterPath &path, const QTransform &matrix, qreal lod) +{ + QTriangulator triangulator; + triangulator.initialize(path, matrix, lod); + return triangulator.polyline(); +} + +QT_END_NAMESPACE diff --git a/src/opengl/gl2paintengineex/qtriangulator_p.h b/src/opengl/gl2paintengineex/qtriangulator_p.h new file mode 100644 index 0000000..da47666 --- /dev/null +++ b/src/opengl/gl2paintengineex/qtriangulator_p.h @@ -0,0 +1,98 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtOpenGL module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QTRIANGULATOR_P_H +#define QTRIANGULATOR_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include +#include + +QT_BEGIN_NAMESPACE + +#define Q_TRIANGULATE_END_OF_POLYGON quint32(-1) + +struct QTriangleSet +{ + inline QTriangleSet() { } + inline QTriangleSet(const QTriangleSet &other) : vertices(other.vertices), indices(other.indices) { } + QTriangleSet &operator = (const QTriangleSet &other) {vertices = other.vertices; indices = other.indices; return *this;} + + // The vertices of a triangle are given by: (x[i[n]], y[i[n]]), (x[j[n]], y[j[n]]), (x[k[n]], y[k[n]]), n = 0, 1, ... + QVector vertices; // [x[0], y[0], x[1], y[1], x[2], ...] + QVector indices; // [i[0], j[0], k[0], i[1], j[1], k[1], i[2], ...] +}; + +struct QPolylineSet +{ + inline QPolylineSet() { } + inline QPolylineSet(const QPolylineSet &other) : vertices(other.vertices), indices(other.indices) { } + QPolylineSet &operator = (const QPolylineSet &other) {vertices = other.vertices; indices = other.indices; return *this;} + + QVector vertices; // [x[0], y[0], x[1], y[1], x[2], ...] + QVector indices; + +}; + +// The vertex coordinates of the returned triangle set will be rounded to a grid with a mesh size +// of 1/32. The polygon is first transformed, then scaled by 32, the coordinates are rounded to +// integers, the polygon is triangulated, and then scaled back by 1/32. +// 'hint' should be a combination of QVectorPath::Hints. +// 'lod' is the level of detail. Default is 1. Curves are split into more lines when 'lod' is higher. +QTriangleSet qTriangulate(const qreal *polygon, int count, uint hint = QVectorPath::PolygonHint | QVectorPath::OddEvenFill, const QTransform &matrix = QTransform()); +QTriangleSet qTriangulate(const QVectorPath &path, const QTransform &matrix = QTransform(), qreal lod = 1); +QTriangleSet qTriangulate(const QPainterPath &path, const QTransform &matrix = QTransform(), qreal lod = 1); +QPolylineSet qPolyline(const QVectorPath &path, const QTransform &matrix = QTransform(), qreal lod = 1); +QPolylineSet qPolyline(const QPainterPath &path, const QTransform &matrix = QTransform(), qreal lod = 1); + +QT_END_NAMESPACE + +#endif diff --git a/src/opengl/opengl.pro b/src/opengl/opengl.pro index b2474ed..ec01db0 100644 --- a/src/opengl/opengl.pro +++ b/src/opengl/opengl.pro @@ -54,7 +54,8 @@ SOURCES += qgl.cpp \ gl2paintengineex/qpaintengineex_opengl2_p.h \ gl2paintengineex/qglengineshadersource_p.h \ gl2paintengineex/qglcustomshaderstage_p.h \ - gl2paintengineex/qtriangulatingstroker_p.h + gl2paintengineex/qtriangulatingstroker_p.h \ + gl2paintengineex/qtriangulator_p.h SOURCES += qglshaderprogram.cpp \ qglpixmapfilter.cpp \ @@ -67,7 +68,8 @@ SOURCES += qgl.cpp \ gl2paintengineex/qgl2pexvertexarray.cpp \ gl2paintengineex/qpaintengineex_opengl2.cpp \ gl2paintengineex/qglcustomshaderstage.cpp \ - gl2paintengineex/qtriangulatingstroker.cpp + gl2paintengineex/qtriangulatingstroker.cpp \ + gl2paintengineex/qtriangulator.cpp } -- cgit v0.12 From 0fc7c731b47d7984ab8039f70561ad559a0bd36d Mon Sep 17 00:00:00 2001 From: Chani Armitage Date: Wed, 2 Dec 2009 17:56:40 +0100 Subject: fix QKeySequence::fromString now emacs-style shortcuts are parsed correctly, like in the constructor, and they share the code too. Merge-request: 1279 Reviewed-by: Leonardo Sobral Cunha --- src/gui/kernel/qkeysequence.cpp | 36 ++++++++++++++++++++++------ src/gui/kernel/qkeysequence.h | 12 ++++++---- tests/auto/qkeysequence/tst_qkeysequence.cpp | 13 ++++++++++ 3 files changed, 49 insertions(+), 12 deletions(-) diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp index e3af683..2a53a16 100644 --- a/src/gui/kernel/qkeysequence.cpp +++ b/src/gui/kernel/qkeysequence.cpp @@ -859,6 +859,8 @@ QKeySequence::QKeySequence() Up to four key codes may be entered by separating them with commas, e.g. "Alt+X,Ctrl+S,Q". + \a key should be in NativeText format. + This constructor is typically used with \link QObject::tr() tr \endlink(), so that shortcut keys can be replaced in translations: @@ -875,6 +877,16 @@ QKeySequence::QKeySequence(const QString &key) } /*! + \since 4.x + Creates a key sequence from the \a key string based on \a format. +*/ +QKeySequence::QKeySequence(const QString &key, QKeySequence::SequenceFormat format) +{ + d = new QKeySequencePrivate(); + assign(key, format); +} + +/*! Constructs a key sequence with up to 4 keys \a k1, \a k2, \a k3 and \a k4. @@ -1053,9 +1065,24 @@ QKeySequence QKeySequence::mnemonic(const QString &text) contain up to four key codes, provided they are separated by a comma; for example, "Alt+X,Ctrl+S,Z". The return value is the number of key codes added. + \a keys should be in NativeText format. */ int QKeySequence::assign(const QString &ks) { + return assign(ks, NativeText); +} + +/*! + \fn int QKeySequence::assign(const QString &keys, QKeySequence::SequenceFormat format) + \since 4.x + + Adds the given \a keys to the key sequence (based on \a format). + \a keys may contain up to four key codes, provided they are + separated by a comma; for example, "Alt+X,Ctrl+S,Z". The return + value is the number of key codes added. +*/ +int QKeySequence::assign(const QString &ks, QKeySequence::SequenceFormat format) +{ QString keyseq = ks; QString part; int n = 0; @@ -1084,7 +1111,7 @@ int QKeySequence::assign(const QString &ks) } part = keyseq.left(-1 == p ? keyseq.length() : p - diff); keyseq = keyseq.right(-1 == p ? 0 : keyseq.length() - (p + 1)); - d->key[n] = decodeString(part); + d->key[n] = QKeySequencePrivate::decodeString(part, format); ++n; } return n; @@ -1555,12 +1582,7 @@ QString QKeySequence::toString(SequenceFormat format) const */ QKeySequence QKeySequence::fromString(const QString &str, SequenceFormat format) { - QStringList sl = str.split(QLatin1String(", ")); - int keys[4] = {0, 0, 0, 0}; - int total = qMin(sl.count(), 4); - for (int i = 0; i < total; ++i) - keys[i] = QKeySequencePrivate::decodeString(sl[i], format); - return QKeySequence(keys[0], keys[1], keys[2], keys[3]); + return QKeySequence(str, format); } /***************************************************************************** diff --git a/src/gui/kernel/qkeysequence.h b/src/gui/kernel/qkeysequence.h index d41902b..591cc37 100644 --- a/src/gui/kernel/qkeysequence.h +++ b/src/gui/kernel/qkeysequence.h @@ -141,8 +141,14 @@ public: Quit }; + enum SequenceFormat { + NativeText, + PortableText + }; + QKeySequence(); QKeySequence(const QString &key); + QKeySequence(const QString &key, SequenceFormat format); QKeySequence(int k1, int k2 = 0, int k3 = 0, int k4 = 0); QKeySequence(const QKeySequence &ks); QKeySequence(StandardKey key); @@ -160,11 +166,6 @@ public: #endif }; - enum SequenceFormat { - NativeText, - PortableText - }; - QString toString(SequenceFormat format = PortableText) const; static QKeySequence fromString(const QString &str, SequenceFormat format = PortableText); @@ -194,6 +195,7 @@ private: static int decodeString(const QString &ks); static QString encodeString(int key); int assign(const QString &str); + int assign(const QString &str, SequenceFormat format); void setKey(int key, int index); QKeySequencePrivate *d; diff --git a/tests/auto/qkeysequence/tst_qkeysequence.cpp b/tests/auto/qkeysequence/tst_qkeysequence.cpp index bc9ae6c..a299d54 100644 --- a/tests/auto/qkeysequence/tst_qkeysequence.cpp +++ b/tests/auto/qkeysequence/tst_qkeysequence.cpp @@ -119,6 +119,7 @@ private slots: void symetricConstructors_data(); void symetricConstructors(); void checkMultipleNames(); + void checkMultipleCodes(); void mnemonic_data(); void mnemonic(); void toString_data(); @@ -265,6 +266,18 @@ void tst_QKeySequence::checkMultipleNames() QVERIFY( oldK == newK ); } +//TODO: could test third constructor, or test fromString on all constructor-data +void tst_QKeySequence::checkMultipleCodes() +{ + QKeySequence seq1("Alt+d, l"); + QKeySequence seq2 = QKeySequence::fromString("Alt+d, l"); + QVERIFY( seq1 == seq2 ); + + QKeySequence seq3("Alt+d,l"); + QKeySequence seq4 = QKeySequence::fromString("Alt+d,l"); + QVERIFY( seq3 == seq4 ); +} + /* * We must ensure that the keyBindings data is allways sorted * so that we can safely perform binary searches. -- cgit v0.12 From c0d237b7aa6e0257e3c3eee7336deaed1cf68252 Mon Sep 17 00:00:00 2001 From: Thorvald Natvig Date: Wed, 2 Dec 2009 20:26:38 +0100 Subject: Move data: decoding to function Merge-request: 1560 Reviewed-by: Thiago Macieira --- src/corelib/io/io.pri | 2 + src/corelib/io/qdataurl.cpp | 101 +++++++++++++++++++++++ src/corelib/io/qdataurl_p.h | 67 +++++++++++++++ src/network/access/qnetworkaccessdatabackend.cpp | 62 ++++---------- 4 files changed, 185 insertions(+), 47 deletions(-) create mode 100644 src/corelib/io/qdataurl.cpp create mode 100644 src/corelib/io/qdataurl_p.h diff --git a/src/corelib/io/io.pri b/src/corelib/io/io.pri index 02a1586..2ed0e46 100644 --- a/src/corelib/io/io.pri +++ b/src/corelib/io/io.pri @@ -6,6 +6,7 @@ HEADERS += \ io/qbuffer.h \ io/qdatastream.h \ io/qdatastream_p.h \ + io/qdataurl_p.h \ io/qdebug.h \ io/qdir.h \ io/qdiriterator.h \ @@ -34,6 +35,7 @@ SOURCES += \ io/qabstractfileengine.cpp \ io/qbuffer.cpp \ io/qdatastream.cpp \ + io/qdataurl.cpp \ io/qdebug.cpp \ io/qdir.cpp \ io/qdiriterator.cpp \ diff --git a/src/corelib/io/qdataurl.cpp b/src/corelib/io/qdataurl.cpp new file mode 100644 index 0000000..9bb896e --- /dev/null +++ b/src/corelib/io/qdataurl.cpp @@ -0,0 +1,101 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qplatformdefs.h" +#include "qurl.h" +#include "private/qdataurl_p.h" + +QT_BEGIN_NAMESPACE + +/*! + \internal + + Decode a data: URL into its mimetype and payload. Returns a null string if + the URL could not be decoded. +*/ +Q_CORE_EXPORT QPair qDecodeDataUrl(const QUrl &uri) +{ + QString mimeType; + QByteArray payload; + + if (uri.scheme() == QLatin1String("data") && uri.host().isEmpty()) { + mimeType = QLatin1String("text/plain;charset=US-ASCII"); + + // the following would have been the correct thing, but + // reality often differs from the specification. People have + // data: URIs with ? and # + //QByteArray data = QByteArray::fromPercentEncoding(uri.encodedPath()); + QByteArray data = QByteArray::fromPercentEncoding(uri.toEncoded()); + + // remove the data: scheme + data.remove(0, 5); + + // parse it: + int pos = data.indexOf(','); + if (pos != -1) { + payload = data.mid(pos + 1); + data.truncate(pos); + data = data.trimmed(); + + // find out if the payload is encoded in Base64 + if (data.endsWith(";base64")) { + payload = QByteArray::fromBase64(payload); + data.chop(7); + } + + if (data.toLower().startsWith("charset")) { + int i = 7; // strlen("charset") + while (data.at(i) == ' ') + ++i; + if (data.at(i) == '=') + data.prepend("text/plain;"); + } + + if (!data.isEmpty()) + mimeType = QLatin1String(data.trimmed()); + + } + } + + return QPair(mimeType,payload); +} + +QT_END_NAMESPACE diff --git a/src/corelib/io/qdataurl_p.h b/src/corelib/io/qdataurl_p.h new file mode 100644 index 0000000..be5b10d --- /dev/null +++ b/src/corelib/io/qdataurl_p.h @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QDATAURL_P_H +#define QDATAURL_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of qDecodeDataUrl. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "QtCore/qurl.h" +#include "QtCore/qbytearray.h" +#include "QtCore/qstring.h" +#include "QtCore/qpair.h" + +QT_BEGIN_NAMESPACE + +Q_CORE_EXPORT QPair qDecodeDataUrl(const QUrl &url); + +QT_END_NAMESPACE + +#endif // QDATAURL_P_H diff --git a/src/network/access/qnetworkaccessdatabackend.cpp b/src/network/access/qnetworkaccessdatabackend.cpp index feec5b6..cada338 100644 --- a/src/network/access/qnetworkaccessdatabackend.cpp +++ b/src/network/access/qnetworkaccessdatabackend.cpp @@ -43,6 +43,7 @@ #include "qnetworkrequest.h" #include "qnetworkreply.h" #include "qurlinfo.h" +#include "private/qdataurl_p.h" QT_BEGIN_NAMESPACE @@ -78,53 +79,20 @@ void QNetworkAccessDataBackend::open() return; } - if (uri.host().isEmpty()) { - setHeader(QNetworkRequest::ContentTypeHeader, QLatin1String("text/plain;charset=US-ASCII")); - - // the following would have been the correct thing, but - // reality often differs from the specification. People have - // data: URIs with ? and # - //QByteArray data = QByteArray::fromPercentEncoding(uri.encodedPath()); - QByteArray data = QByteArray::fromPercentEncoding(uri.toEncoded()); - - // remove the data: scheme - data.remove(0, 5); - - // parse it: - int pos = data.indexOf(','); - if (pos != -1) { - QByteArray payload = data.mid(pos + 1); - data.truncate(pos); - data = data.trimmed(); - - // find out if the payload is encoded in Base64 - if (data.endsWith(";base64")) { - payload = QByteArray::fromBase64(payload); - data.chop(7); - } - - if (data.toLower().startsWith("charset")) { - int i = 7; // strlen("charset") - while (data.at(i) == ' ') - ++i; - if (data.at(i) == '=') - data.prepend("text/plain;"); - } - - if (!data.isEmpty()) - setHeader(QNetworkRequest::ContentTypeHeader, data.trimmed()); - - setHeader(QNetworkRequest::ContentLengthHeader, payload.size()); - emit metaDataChanged(); - - QByteDataBuffer list; - list.append(payload); - payload.clear(); // important because of implicit sharing! - writeDownstreamData(list); - - finished(); - return; - } + QPair decoded = qDecodeDataUrl(uri); + + if (! decoded.first.isNull()) { + setHeader(QNetworkRequest::ContentTypeHeader, decoded.first); + setHeader(QNetworkRequest::ContentLengthHeader, decoded.second.size()); + emit metaDataChanged(); + + QByteDataBuffer list; + list.append(decoded.second); + decoded.second.clear(); // important because of implicit sharing! + writeDownstreamData(list); + + finished(); + return; } // something wrong with this URI -- cgit v0.12 From 2eb96bf5b68cbdcc1ebd2616b0b9e5f0f77eb257 Mon Sep 17 00:00:00 2001 From: Thorvald Natvig Date: Wed, 2 Dec 2009 20:26:39 +0100 Subject: Add data: URL handling to QTextDocument::loadResource Merge-request: 1560 Reviewed-by: Thiago Macieira --- src/gui/text/qtextdocument.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp index 523dd18..3b0a979 100644 --- a/src/gui/text/qtextdocument.cpp +++ b/src/gui/text/qtextdocument.cpp @@ -61,6 +61,7 @@ #include #include "qtextcontrol_p.h" #include "private/qtextedit_p.h" +#include "private/qdataurl_p.h" #include "qtextdocument_p.h" #include @@ -1924,6 +1925,10 @@ QVariant QTextDocument::loadResource(int type, const QUrl &name) } #endif + // handle data: URLs + if (r.isNull() && name.scheme() == QLatin1String("data")) + r = qDecodeDataUrl(name).second; + // if resource was not loaded try to load it here if (!doc && r.isNull() && name.isRelative()) { QUrl currentURL = d->url; -- cgit v0.12 From b93000823d11575b6c30490ea97a2649a0119f86 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 2 Dec 2009 20:37:28 +0100 Subject: Fixed typing error in a variable Merge-request: 1875 Reviewed-by: Thiago Macieira --- mkspecs/unsupported/qws/qnx-641/qmake.conf | 99 +++++++++++++++++++++++++ mkspecs/unsupported/qws/qnx-641/qplatformdefs.h | 42 +++++++++++ 2 files changed, 141 insertions(+) create mode 100644 mkspecs/unsupported/qws/qnx-641/qmake.conf create mode 100644 mkspecs/unsupported/qws/qnx-641/qplatformdefs.h diff --git a/mkspecs/unsupported/qws/qnx-641/qmake.conf b/mkspecs/unsupported/qws/qnx-641/qmake.conf new file mode 100644 index 0000000..db333b7 --- /dev/null +++ b/mkspecs/unsupported/qws/qnx-641/qmake.conf @@ -0,0 +1,99 @@ +# +# qmake configuration for qnx +# +# Written for QNX 6.4.1 without X11. +# + +MAKEFILE_GENERATOR = UNIX +TEMPLATE = app +CONFIG += qt warn_on release link_prl +QT += core gui +DEFINES += QT_NO_NIS QT_NO_TEXTODFWRITER QT_OPENGL + +QMAKE_CC = qcc +QMAKE_CFLAGS += -V4.3.3,gcc_ntox86_acpp-ne -pipe +QMAKE_CFLAGS_DEPS += -M +QMAKE_CFLAGS_WARN_ON += -Wall -W +QMAKE_CFLAGS_WARN_OFF += -w +QMAKE_CFLAGS_RELEASE += -O2 +QMAKE_CFLAGS_DEBUG += -g +QMAKE_CFLAGS_SHLIB += -fPIC +QMAKE_CFLAGS_STATIC_LIB += -fPIC +QMAKE_CFLAGS_YACC += -Wno-unused -Wno-parentheses +QMAKE_CFLAGS_HIDESYMS += -fvisibility=hidden +QMAKE_CFLAGS_PRECOMPILE += -x c-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT} +QMAKE_CFLAGS_USE_PRECOMPILE += -include ${QMAKE_PCH_OUTPUT_BASE} +QMAKE_COMPILER_DEFINES += __QNXNTO__ + +QMAKE_CXX = qcc +QMAKE_CXXFLAGS += $$QMAKE_CFLAGS +QMAKE_CXXFLAGS_DEPS += $$QMAKE_CFLAGS_DEPS +QMAKE_CXXFLAGS_WARN_ON += $$QMAKE_CFLAGS_WARN_ON +QMAKE_CXXFLAGS_WARN_OFF += $$QMAKE_CFLAGS_WARN_OFF +QMAKE_CXXFLAGS_RELEASE += $$QMAKE_CFLAGS_RELEASE +QMAKE_CXXFLAGS_DEBUG += $$QMAKE_CFLAGS_DEBUG +QMAKE_CXXFLAGS_SHLIB += $$QMAKE_CFLAGS_SHLIB +QMAKE_CXXFLAGS_STATIC_LIB += $$QMAKE_CFLAGS_STATIC_LIB +QMAKE_CXXFLAGS_YACC += $$QMAKE_CFLAGS_YACC +QMAKE_CXXFLAGS_HIDESYMS += $$QMAKE_CFLAGS_HIDESYMS -fvisibility-inlines-hidden +QMAKE_CXXFLAGS_PRECOMPILE += -x c++-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT} +QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE + +QMAKE_LINK = qcc +QMAKE_LINK_SHLIB = qcc +QMAKE_LINK_SHLIB_CMD = $(LINK) $(LFLAGS) -o ../../lib/$(TARGET) $(OBJECTS) $(LIBS) +QMAKE_LFLAGS = -V4.3.3,gcc_ntox86 -lang-c++ -Y_acpp-ne +QMAKE_LFLAGS_RELEASE = +QMAKE_LFLAGS_DEBUG = +QMAKE_LFLAGS_SHLIB = -shared +QMAKE_LFLAGS_PLUGIN = $$QMAKE_LFLAGS_SHLIB +QMAKE_LFLAGS_SONAME = -Wl,-soname, +QMAKE_LFLAGS_THREAD = +QMAKE_LN_SHLIB = -cp +QMAKE_RPATH = -Wl,-rpath, + +QMAKE_PCH_OUTPUT_EXT = .gch + +# -Bsymbolic-functions (ld) support +QMAKE_LFLAGS_BSYMBOLIC_FUNC = -Wl,-Bsymbolic-functions +QMAKE_LFLAGS_DYNAMIC_LIST = -Wl,--dynamic-list, + +include(../../common/unix.conf) + +QMAKE_CFLAGS_THREAD = -D_REENTRANT +QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD + +QMAKE_INCDIR = +QMAKE_LIBDIR = +QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] +QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] + + +QMAKE_LIBS = -lm -lz +QMAKE_LIBS_DYNLOAD = +QMAKE_LIBS_THREAD = +QMAKE_LIBS_NETWORK += -lsocket +QMAKE_LIBS_GUI += -lsocket +QMAKE_MOC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}moc.exe +QMAKE_UIC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}uic.exe +QMAKE_IDC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}idc.exe + +QMAKE_AR = ntox86-ar cqs +QMAKE_RANLIB = + +QMAKE_TAR = tar -cf +QMAKE_GZIP = gzip -9f + +QMAKE_COPY = cp -f +QMAKE_COPY_FILE = $(COPY) +QMAKE_COPY_DIR = $(COPY) -r +QMAKE_MOVE = mv -f +QMAKE_DEL_FILE = rm -f +QMAKE_DEL_DIR = rmdir +QMAKE_CHK_DIR_EXISTS = test -d +QMAKE_MKDIR = mkdir -p +QMAKE_STRIP = strip +QMAKE_STRIPFLAGS_LIB += --strip-unneeded +QMAKE_CHK_DIR_EXISTS = test -d +QMAKE_MKDIR = mkdir -p +load(qt_config) diff --git a/mkspecs/unsupported/qws/qnx-641/qplatformdefs.h b/mkspecs/unsupported/qws/qnx-641/qplatformdefs.h new file mode 100644 index 0000000..af04086 --- /dev/null +++ b/mkspecs/unsupported/qws/qnx-641/qplatformdefs.h @@ -0,0 +1,42 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the qmake spec of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "../../qnx-g++/qplatformdefs.h" -- cgit v0.12 From 3f18623dd8f26857d9af032c41095818f5346910 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 30 Sep 2009 21:18:23 +0300 Subject: Added QGraphicsWidget::autoFillBackground property. This add a property to QGraphicsWidget to fill its background. QWidget has the same. Merge-Request: 1656 Reviewed-by: Alexis Menard --- src/gui/graphicsview/qgraphicsscene.cpp | 2 ++ src/gui/graphicsview/qgraphicswidget.cpp | 30 ++++++++++++++++++++++ src/gui/graphicsview/qgraphicswidget.h | 4 +++ src/gui/graphicsview/qgraphicswidget_p.h | 2 ++ tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp | 27 +++++++++++++++++++ 5 files changed, 65 insertions(+) diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 8777cdc..82d2e2f 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -4187,6 +4187,8 @@ static void _q_paintItem(QGraphicsItem *item, QPainter *painter, widgetItem->paintWindowFrame(painter, option, widget); if (painterStateProtection) painter->restore(); + } else if (widgetItem->autoFillBackground()) { + painter->fillRect(option->exposedRect, widgetItem->palette().window()); } widgetItem->paint(painter, option, widget); diff --git a/src/gui/graphicsview/qgraphicswidget.cpp b/src/gui/graphicsview/qgraphicswidget.cpp index fe569f4..1bb6375 100644 --- a/src/gui/graphicsview/qgraphicswidget.cpp +++ b/src/gui/graphicsview/qgraphicswidget.cpp @@ -967,6 +967,36 @@ void QGraphicsWidget::setPalette(const QPalette &palette) } /*! + \property QGraphicsWidget::autoFillBackground + \brief whether the widget background is filled automatically + \since 4.7 + + If enabled, this property will cause Qt to fill the background of the + widget before invoking the paint() method. The color used is defined by the + QPalette::Window color role from the widget's \l{QPalette}{palette}. + + In addition, Windows are always filled with QPalette::Window, unless the + WA_OpaquePaintEvent or WA_NoSystemBackground attributes are set. + + By default, this property is false. + + \sa Qt::WA_OpaquePaintEvent, Qt::WA_NoSystemBackground, +*/ +bool QGraphicsWidget::autoFillBackground() const +{ + Q_D(const QGraphicsWidget); + return d->autoFillBackground; +} +void QGraphicsWidget::setAutoFillBackground(bool enabled) +{ + Q_D(QGraphicsWidget); + if (d->autoFillBackground != enabled) { + d->autoFillBackground = enabled; + update(); + } +} + +/*! If this widget is currently managed by a layout, this function notifies the layout that the widget's size hints have changed and the layout may need to resize and reposition the widget accordingly. diff --git a/src/gui/graphicsview/qgraphicswidget.h b/src/gui/graphicsview/qgraphicswidget.h index 05d3a49..d9723f8 100644 --- a/src/gui/graphicsview/qgraphicswidget.h +++ b/src/gui/graphicsview/qgraphicswidget.h @@ -82,6 +82,7 @@ class Q_GUI_EXPORT QGraphicsWidget : public QGraphicsObject, public QGraphicsLay Q_PROPERTY(Qt::WindowFlags windowFlags READ windowFlags WRITE setWindowFlags) Q_PROPERTY(QString windowTitle READ windowTitle WRITE setWindowTitle) Q_PROPERTY(QRectF geometry READ geometry WRITE setGeometry) + Q_PROPERTY(bool autoFillBackground READ autoFillBackground WRITE setAutoFillBackground) public: QGraphicsWidget(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0); ~QGraphicsWidget(); @@ -103,6 +104,9 @@ public: QPalette palette() const; void setPalette(const QPalette &palette); + bool autoFillBackground() const; + void setAutoFillBackground(bool enabled); + void resize(const QSizeF &size); inline void resize(qreal w, qreal h) { resize(QSizeF(w, h)); } QSizeF size() const; diff --git a/src/gui/graphicsview/qgraphicswidget_p.h b/src/gui/graphicsview/qgraphicswidget_p.h index eb53649..d2f898e 100644 --- a/src/gui/graphicsview/qgraphicswidget_p.h +++ b/src/gui/graphicsview/qgraphicswidget_p.h @@ -80,6 +80,7 @@ public: inSetGeometry(0), polished(0), inSetPos(0), + autoFillBackground(0), focusPolicy(Qt::NoFocus), focusNext(0), focusPrev(0), @@ -172,6 +173,7 @@ public: quint32 inSetGeometry : 1; quint32 polished: 1; quint32 inSetPos : 1; + quint32 autoFillBackground : 1; // Focus Qt::FocusPolicy focusPolicy; diff --git a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp index 3303df5..47e21b8 100644 --- a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp +++ b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp @@ -163,6 +163,7 @@ private slots: void addChildInpolishEvent(); void polishEvent(); void polishEvent2(); + void autoFillBackground(); // Task fixes void task236127_bspTreeIndexFails(); @@ -2855,6 +2856,32 @@ void tst_QGraphicsWidget::polishEvent2() QVERIFY(widget->events.contains(QEvent::Polish)); } +void tst_QGraphicsWidget::autoFillBackground() +{ + QGraphicsWidget *widget = new QGraphicsWidget; + QCOMPARE(widget->autoFillBackground(), false); + widget->setAutoFillBackground(true); + QCOMPARE(widget->autoFillBackground(), true); + + const QColor color(Qt::red); + const QRect rect(0, 0, 1, 1); + + QGraphicsScene scene; + scene.addItem(widget); + widget->setGeometry(rect); + + QPalette palette = widget->palette(); + palette.setColor(QPalette::Window, color); + widget->setPalette(palette); + + QImage image(rect.size(), QImage::Format_RGB32); + QPainter painter; + painter.begin(&image); + scene.render(&painter, rect, rect); + painter.end(); + QCOMPARE(image.pixel(0, 0), color.rgb()); +} + QTEST_MAIN(tst_QGraphicsWidget) #include "tst_qgraphicswidget.moc" -- cgit v0.12 From d6c21efa5b67fc55f9edfa4aabeb48adf68ee131 Mon Sep 17 00:00:00 2001 From: ck Date: Thu, 3 Dec 2009 14:35:51 +0100 Subject: Assistant: Encapsulate accesses to help engine. Reviewed-by: kh1 --- tools/assistant/tools/assistant/assistant.pro | 7 +- .../assistant/tools/assistant/bookmarkmanager.cpp | 10 +- tools/assistant/tools/assistant/bookmarkmanager.h | 3 +- tools/assistant/tools/assistant/centralwidget.cpp | 62 +-- tools/assistant/tools/assistant/centralwidget.h | 4 +- tools/assistant/tools/assistant/contentwindow.cpp | 8 +- tools/assistant/tools/assistant/contentwindow.h | 5 +- .../tools/assistant/helpenginewrapper.cpp | 591 +++++++++++++++++++++ .../assistant/tools/assistant/helpenginewrapper.h | 212 ++++++++ tools/assistant/tools/assistant/helpviewer.cpp | 50 +- tools/assistant/tools/assistant/helpviewer.h | 10 +- tools/assistant/tools/assistant/indexwindow.cpp | 16 +- tools/assistant/tools/assistant/indexwindow.h | 4 +- tools/assistant/tools/assistant/main.cpp | 18 +- tools/assistant/tools/assistant/mainwindow.cpp | 330 ++++++------ tools/assistant/tools/assistant/mainwindow.h | 9 +- .../tools/assistant/preferencesdialog.cpp | 104 ++-- .../assistant/tools/assistant/preferencesdialog.h | 14 +- tools/assistant/tools/assistant/qtdocinstaller.cpp | 87 +-- tools/assistant/tools/assistant/qtdocinstaller.h | 23 +- tools/assistant/tools/assistant/remotecontrol.cpp | 43 +- tools/assistant/tools/assistant/remotecontrol.h | 9 +- tools/assistant/tools/assistant/tracer.h | 1 + .../assistant/tools/qcollectiongenerator/main.cpp | 3 +- .../tools/shared/collectionconfiguration.cpp | 281 ++-------- .../tools/shared/collectionconfiguration.h | 92 +--- 26 files changed, 1224 insertions(+), 772 deletions(-) create mode 100644 tools/assistant/tools/assistant/helpenginewrapper.cpp create mode 100644 tools/assistant/tools/assistant/helpenginewrapper.h diff --git a/tools/assistant/tools/assistant/assistant.pro b/tools/assistant/tools/assistant/assistant.pro index 81677c3..ca2e52e 100644 --- a/tools/assistant/tools/assistant/assistant.pro +++ b/tools/assistant/tools/assistant/assistant.pro @@ -31,7 +31,9 @@ HEADERS += helpviewer.h \ aboutdialog.h \ qtdocinstaller.h \ xbelsupport.h \ - ../shared/collectionconfiguration.h + ../shared/collectionconfiguration.h \ + helpenginewrapper.h \ + tracer.h win32:HEADERS += remotecontrol_win.h SOURCES += helpviewer.cpp \ main.cpp \ @@ -50,7 +52,8 @@ SOURCES += helpviewer.cpp \ aboutdialog.cpp \ qtdocinstaller.cpp \ xbelsupport.cpp \ - ../shared/collectionconfiguration.cpp + ../shared/collectionconfiguration.cpp \ + helpenginewrapper.cpp FORMS += topicchooser.ui \ preferencesdialog.ui \ filternamedialog.ui \ diff --git a/tools/assistant/tools/assistant/bookmarkmanager.cpp b/tools/assistant/tools/assistant/bookmarkmanager.cpp index 3c473d7..f8cad4d 100644 --- a/tools/assistant/tools/assistant/bookmarkmanager.cpp +++ b/tools/assistant/tools/assistant/bookmarkmanager.cpp @@ -41,7 +41,7 @@ #include "bookmarkmanager.h" #include "centralwidget.h" -#include "../shared/collectionconfiguration.h" +#include "helpenginewrapper.h" #include #include @@ -57,7 +57,6 @@ #include #include #include -#include #include #include @@ -624,11 +623,10 @@ Qt::ItemFlags BookmarkModel::flags(const QModelIndex &index) const // BookmarkManager -BookmarkManager::BookmarkManager(QHelpEngineCore *_helpEngine) +BookmarkManager::BookmarkManager() : treeModel(new BookmarkModel(0, 1, this)) , listModel(new BookmarkModel(0, 1, this)) , renameItem(0) - , helpEngine(_helpEngine) { folderIcon = QApplication::style()->standardIcon(QStyle::SP_DirClosedIcon); bookmarkIcon = QIcon(QLatin1String(":/trolltech/assistant/images/bookmark.png")); @@ -663,7 +661,7 @@ void BookmarkManager::saveBookmarks() QDataStream stream(&bookmarks, QIODevice::WriteOnly); readBookmarksRecursive(treeModel->invisibleRootItem(), stream, 0); - CollectionConfiguration::setBookmarks(*helpEngine, bookmarks); + HelpEngineWrapper::instance().setBookmarks(bookmarks); } QStringList BookmarkManager::bookmarkFolders() const @@ -815,7 +813,7 @@ void BookmarkManager::setupBookmarkModels() QList lastDepths; QList parents; - QByteArray ba = CollectionConfiguration::bookmarks(*helpEngine); + QByteArray ba = HelpEngineWrapper::instance().bookmarks(); QDataStream stream(ba); while (!stream.atEnd()) { stream >> depth >> name >> type >> expanded; diff --git a/tools/assistant/tools/assistant/bookmarkmanager.h b/tools/assistant/tools/assistant/bookmarkmanager.h index c6be134..13d4b5c 100644 --- a/tools/assistant/tools/assistant/bookmarkmanager.h +++ b/tools/assistant/tools/assistant/bookmarkmanager.h @@ -168,7 +168,7 @@ class BookmarkManager : public QObject Q_OBJECT public: - BookmarkManager(QHelpEngineCore* helpEngine); + BookmarkManager(); ~BookmarkManager(); BookmarkModel* treeBookmarkModel(); @@ -208,7 +208,6 @@ private: BookmarkModel *treeModel; BookmarkModel *listModel; QStandardItem *renameItem; - QHelpEngineCore *helpEngine; QMap map; }; diff --git a/tools/assistant/tools/assistant/centralwidget.cpp b/tools/assistant/tools/assistant/centralwidget.cpp index d1cccc1..df28d63 100644 --- a/tools/assistant/tools/assistant/centralwidget.cpp +++ b/tools/assistant/tools/assistant/centralwidget.cpp @@ -40,6 +40,7 @@ ****************************************************************************/ #include "centralwidget.h" +#include "helpenginewrapper.h" #include "helpviewer.h" #include "searchwidget.h" #include "mainwindow.h" @@ -68,7 +69,6 @@ #include #include -#include #include QT_BEGIN_NAMESPACE @@ -206,14 +206,12 @@ QToolButton* FindWidget::setupToolButton(const QString &text, const QString &ico // -- -CentralWidget::CentralWidget(QHelpEngine *engine, MainWindow *parent) +CentralWidget::CentralWidget(MainWindow *parent) : QWidget(parent) , lastTabPage(0) - , collectionFile(engine->collectionFile()) , findBar(0) , tabWidget(0) , findWidget(0) - , helpEngine(engine) , printer(0) , usesDefaultCollection(parent->usesDefaultCollection()) , m_searchWidget(0) @@ -293,10 +291,6 @@ CentralWidget::~CentralWidget() delete printer; #endif - QHelpEngineCore engine(collectionFile, 0); - if (!engine.setupData()) - return; - QStringList zoomFactors; QStringList currentPages; bool searchAttached = m_searchWidget->isAttached(); @@ -310,10 +304,11 @@ CentralWidget::~CentralWidget() } } - CollectionConfiguration::setLastTabPage(engine, lastTabPage); - CollectionConfiguration::setLastShownPages(engine, currentPages); - CollectionConfiguration::setSearchWasAttached(engine, searchAttached); - CollectionConfiguration::setLastZoomFactors(engine, zoomFactors); + HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); + helpEngine.setLastTabPage(lastTabPage); + helpEngine.setLastShownPages(currentPages); + helpEngine.setSearchWasAttached(searchAttached); + helpEngine.setLastZoomFactors(zoomFactors); } CentralWidget *CentralWidget::instance() @@ -405,7 +400,7 @@ void CentralWidget::setSource(const QUrl &url) qobject_cast(tabWidget->widget(lastTabPage)); if (!viewer && !lastViewer) { - viewer = new HelpViewer(helpEngine, this); + viewer = new HelpViewer(this); viewer->installEventFilter(this); lastTabPage = tabWidget->addTab(viewer, QString()); tabWidget->setCurrentIndex(lastTabPage); @@ -423,16 +418,13 @@ void CentralWidget::setSource(const QUrl &url) void CentralWidget::setupWidget() { - int option = CollectionConfiguration::startOption(*helpEngine); + HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); + int option = helpEngine.startOption(); if (option != ShowLastPages) { QString homePage; - if (option == ShowHomePage) { - // TODO: Can this fall-back logic go into the wrapper class? - homePage = CollectionConfiguration::homePage(*helpEngine); - if (homePage.isEmpty()) - homePage = CollectionConfiguration::defaultHomePage(*helpEngine); - } - if (option == ShowBlankPage) + if (option == ShowHomePage) + homePage = helpEngine.homePage(); + else if (option == ShowBlankPage) homePage = QLatin1String("about:blank"); setSource(homePage); } else { @@ -442,8 +434,8 @@ void CentralWidget::setupWidget() void CentralWidget::setLastShownPages() { - const QStringList lastShownPageList = - CollectionConfiguration::lastShownPages(*helpEngine); + HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); + const QStringList lastShownPageList = helpEngine.lastShownPages(); const int pageCount = lastShownPageList.count(); if (pageCount == 0) { if (usesDefaultCollection) @@ -453,8 +445,7 @@ void CentralWidget::setLastShownPages() return; } - QStringList zoomFactors = - CollectionConfiguration::lastZoomFactors(*helpEngine); + QStringList zoomFactors = helpEngine.lastZoomFactors(); while (zoomFactors.count() < pageCount) zoomFactors.append(CollectionConfiguration::DefaultZoomFactor); @@ -463,12 +454,10 @@ void CentralWidget::setLastShownPages() for (; it != lastShownPageList.constEnd(); ++it, ++zIt) setSourceInNewTab((*it), (*zIt).toFloat()); - int tab = CollectionConfiguration::lastTabPage(*helpEngine); + int tab = helpEngine.lastTabPage(); const bool searchIsAttached = m_searchWidget->isAttached(); - const bool searchWasAttached = - CollectionConfiguration::searchWasAttached(*helpEngine); - + const bool searchWasAttached = helpEngine.searchWasAttached(); if (searchWasAttached && !searchIsAttached) --tab; else if (!searchWasAttached && searchIsAttached) @@ -639,7 +628,7 @@ void CentralWidget::setSourceInNewTab(const QUrl &url, qreal zoom) return; #endif - viewer = new HelpViewer(helpEngine, this); + viewer = new HelpViewer(this); viewer->installEventFilter(this); viewer->setSource(url); viewer->setFocus(Qt::OtherFocusReason); @@ -663,7 +652,7 @@ void CentralWidget::setSourceInNewTab(const QUrl &url, qreal zoom) HelpViewer *CentralWidget::newEmptyTab() { - HelpViewer *viewer = new HelpViewer(helpEngine, this); + HelpViewer *viewer = new HelpViewer(this); viewer->installEventFilter(this); viewer->setFocus(Qt::OtherFocusReason); #if defined(QT_NO_WEBKIT) @@ -1005,7 +994,7 @@ void CentralWidget::createSearchWidget(QHelpSearchEngine *searchEngine) void CentralWidget::activateSearchWidget(bool updateLastTabPage) { if (!m_searchWidget) - createSearchWidget(helpEngine->searchEngine()); + createSearchWidget(HelpEngineWrapper::instance().searchEngine()); if (!m_searchWidget->isAttached()) { tabWidget->insertTab(0, m_searchWidget, tr("Search")); @@ -1072,7 +1061,8 @@ CentralWidget::highlightSearchTerms() if (!viewer) return; - QHelpSearchEngine *searchEngine = helpEngine->searchEngine(); + QHelpSearchEngine *searchEngine = + HelpEngineWrapper::instance().searchEngine(); QList queryList = searchEngine->query(); QStringList terms; @@ -1154,8 +1144,8 @@ QMap CentralWidget::currentSourceFileList() const void CentralWidget::getBrowserFontFor(QWidget *viewer, QFont *font) { - const QLatin1String key("useBrowserFont"); - if (!CollectionConfiguration::usesBrowserFont(*helpEngine)) { + HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); + if (!helpEngine.usesBrowserFont()) { *font = qApp->font(); // case for QTextBrowser and SearchWidget #if !defined(QT_NO_WEBKIT) QWebView *view = qobject_cast (viewer); @@ -1166,7 +1156,7 @@ void CentralWidget::getBrowserFontFor(QWidget *viewer, QFont *font) } #endif } else { - *font = CollectionConfiguration::browserFont(*helpEngine); + *font = helpEngine.browserFont(); } } diff --git a/tools/assistant/tools/assistant/centralwidget.h b/tools/assistant/tools/assistant/centralwidget.h index c348abf..d90968e 100644 --- a/tools/assistant/tools/assistant/centralwidget.h +++ b/tools/assistant/tools/assistant/centralwidget.h @@ -110,7 +110,7 @@ class CentralWidget : public QWidget Q_OBJECT public: - CentralWidget(QHelpEngine *engine, MainWindow *parent); + CentralWidget(MainWindow *parent); ~CentralWidget(); void setupWidget(); @@ -201,13 +201,11 @@ private: private: int lastTabPage; - QString collectionFile; QList globalActionList; QWidget *findBar; QTabWidget *tabWidget; FindWidget *findWidget; - QHelpEngine *helpEngine; QPrinter *printer; bool usesDefaultCollection; diff --git a/tools/assistant/tools/assistant/contentwindow.cpp b/tools/assistant/tools/assistant/contentwindow.cpp index 1e3953a..17b19ba 100644 --- a/tools/assistant/tools/assistant/contentwindow.cpp +++ b/tools/assistant/tools/assistant/contentwindow.cpp @@ -41,22 +41,20 @@ #include "contentwindow.h" #include "centralwidget.h" +#include "helpenginewrapper.h" #include #include #include -#include #include QT_BEGIN_NAMESPACE -ContentWindow::ContentWindow(QHelpEngine *helpEngine) - : m_helpEngine(helpEngine) - , m_contentWidget(0) +ContentWindow::ContentWindow() + : m_contentWidget(HelpEngineWrapper::instance().contentWidget()) , m_expandDepth(-2) { - m_contentWidget = m_helpEngine->contentWidget(); m_contentWidget->viewport()->installEventFilter(this); m_contentWidget->setContextMenuPolicy(Qt::CustomContextMenu); diff --git a/tools/assistant/tools/assistant/contentwindow.h b/tools/assistant/tools/assistant/contentwindow.h index e5512f5..6395932 100644 --- a/tools/assistant/tools/assistant/contentwindow.h +++ b/tools/assistant/tools/assistant/contentwindow.h @@ -57,7 +57,7 @@ class ContentWindow : public QWidget Q_OBJECT public: - ContentWindow(QHelpEngine *helpEngine); + ContentWindow(); ~ContentWindow(); bool syncToContent(const QUrl &url); @@ -78,8 +78,7 @@ private: bool eventFilter(QObject *o, QEvent *e); bool isPdfFile(QHelpContentItem *item) const; - QHelpEngine *m_helpEngine; - QHelpContentWidget *m_contentWidget; + QHelpContentWidget * const m_contentWidget; int m_expandDepth; }; diff --git a/tools/assistant/tools/assistant/helpenginewrapper.cpp b/tools/assistant/tools/assistant/helpenginewrapper.cpp new file mode 100644 index 0000000..d399d1e --- /dev/null +++ b/tools/assistant/tools/assistant/helpenginewrapper.cpp @@ -0,0 +1,591 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "helpenginewrapper.h" +#include "../shared/collectionconfiguration.h" + +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +namespace { + const QString AppFontKey(QLatin1String("appFont")); + const QString AppWritingSystemKey(QLatin1String("appWritingSystem")); + const QString BookmarksKey(QLatin1String("Bookmarks")); + const QString BrowserFontKey(QLatin1String("browserFont")); + const QString BrowserWritingSystemKey(QLatin1String("browserWritingSystem")); + const QString HomePageKey(QLatin1String("homepage")); + const QString MainWindowKey(QLatin1String("MainWindow")); + const QString MainWindowGeometryKey(QLatin1String("MainWindowGeometry")); + const QString SearchWasAttachedKey(QLatin1String("SearchWasAttached")); + const QString StartOptionKey(QLatin1String("StartOption")); + const QString UnfilteredInsertedKey(QLatin1String("UnfilteredFilterInserted")); + const QString UseAppFontKey(QLatin1String("useAppFont")); + const QString UseBrowserFontKey(QLatin1String("useBrowserFont")); + const QString VersionKey(QString(QLatin1String("qtVersion%1$$$%2")). + arg(QLatin1String(QT_VERSION_STR))); +} // anonymous namespace + +HelpEngineWrapper *HelpEngineWrapper::helpEngineWrapper = 0; + +HelpEngineWrapper &HelpEngineWrapper::instance(const QString &collectionFile) +{ + /* + * Note that this Singleton cannot be static, because it has to be + * deleted before the QApplication. + */ + if (helpEngineWrapper == 0) + helpEngineWrapper = new HelpEngineWrapper(collectionFile); + return *helpEngineWrapper; +} + +void HelpEngineWrapper::removeInstance() +{ + delete helpEngineWrapper; + helpEngineWrapper = 0; +} + +HelpEngineWrapper::HelpEngineWrapper(const QString &collectionFile) + : m_helpEngine(new QHelpEngine(collectionFile, this)), + m_qchWatcher(new QFileSystemWatcher(this)) +{ + connect(m_helpEngine, SIGNAL(currentFilterChanged(QString)), + this, SIGNAL(currentFilterChanged(QString))); + connect(m_helpEngine, SIGNAL(setupFinished()), + this, SIGNAL(setupFinished())); +} + +void HelpEngineWrapper::initFileSystemWatchers() +{ + foreach(const QString &ns, m_helpEngine->registeredDocumentations()) { + const QString &docFile = m_helpEngine->documentationFileName(ns); + m_qchWatcher->addPath(docFile); + connect(m_qchWatcher, SIGNAL(fileChanged(QString)), + this, SLOT(qchFileChanged(QString))); + } + assertDocFilesWatched(); +} + +QHelpSearchEngine *HelpEngineWrapper::searchEngine() const +{ + return m_helpEngine->searchEngine(); +} + +QHelpContentModel *HelpEngineWrapper::contentModel() const +{ + return m_helpEngine->contentModel(); +} + +QHelpIndexModel *HelpEngineWrapper::indexModel() const +{ + return m_helpEngine->indexModel(); +} + +QHelpContentWidget *HelpEngineWrapper::contentWidget() +{ + return m_helpEngine->contentWidget(); +} + +QHelpIndexWidget *HelpEngineWrapper::indexWidget() +{ + return m_helpEngine->indexWidget(); +} + +const QStringList HelpEngineWrapper::registeredDocumentations() const +{ + return m_helpEngine->registeredDocumentations(); +} + +const QString HelpEngineWrapper::collectionFile() const +{ + return m_helpEngine->collectionFile(); +} + +bool HelpEngineWrapper::registerDocumentation(const QString &docFile) +{ + if (!m_helpEngine->registerDocumentation(docFile)) + return false; + m_qchWatcher->addPath(docFile); + assertDocFilesWatched(); + return true; +} + +bool HelpEngineWrapper::unregisterDocumentation(const QString &namespaceName) +{ + const QString &internalFile = + m_helpEngine->documentationFileName(namespaceName); + if (!m_helpEngine->unregisterDocumentation(namespaceName)) + return false; + m_qchWatcher->removePath(internalFile); + assertDocFilesWatched(); + return true; +} + +bool HelpEngineWrapper::setupData() +{ + return m_helpEngine->setupData(); +} + +bool HelpEngineWrapper::addCustomFilter(const QString &filterName, + const QStringList &attributes) +{ + return m_helpEngine->addCustomFilter(filterName, attributes); +} + +bool HelpEngineWrapper::removeCustomFilter(const QString &filterName) +{ + return m_helpEngine->removeCustomFilter(filterName); +} + +void HelpEngineWrapper::setCurrentFilter(const QString ¤tFilter) +{ + m_helpEngine->setCurrentFilter(currentFilter); +} + +const QString HelpEngineWrapper::currentFilter() const +{ + return m_helpEngine->currentFilter(); +} + +const QStringList HelpEngineWrapper::customFilters() const +{ + return m_helpEngine->customFilters(); +} + +QUrl HelpEngineWrapper::findFile(const QUrl &url) const +{ + return m_helpEngine->findFile(url); +} + +QByteArray HelpEngineWrapper::fileData(const QUrl &url) const +{ + return m_helpEngine->fileData(url); +} + +QMap HelpEngineWrapper::linksForIdentifier(const QString &id) const +{ + return m_helpEngine->linksForIdentifier(id); +} + +const QStringList HelpEngineWrapper::filterAttributes() const +{ + return m_helpEngine->filterAttributes(); +} + +const QStringList HelpEngineWrapper::filterAttributes(const QString &filterName) const +{ + return m_helpEngine->filterAttributes(filterName); +} + +QString HelpEngineWrapper::error() const +{ + return m_helpEngine->error(); +} + +bool HelpEngineWrapper::unfilteredInserted() const +{ + return m_helpEngine->customValue(UnfilteredInsertedKey).toInt() == 1; +} + +void HelpEngineWrapper::setUnfilteredInserted() +{ + m_helpEngine->setCustomValue(UnfilteredInsertedKey, 1); +} + +const QStringList HelpEngineWrapper::qtDocInfo(const QString &component) const +{ + return m_helpEngine->customValue(VersionKey.arg(component)).toString(). + split(CollectionConfiguration::ListSeparator); +} + +void HelpEngineWrapper::setQtDocInfo(const QString &component, + const QStringList &doc) +{ + m_helpEngine->setCustomValue(VersionKey.arg(component), + doc.join(CollectionConfiguration::ListSeparator)); +} + +const QStringList HelpEngineWrapper::lastShownPages() const +{ + return CollectionConfiguration::lastShownPages(*m_helpEngine); +} + +void HelpEngineWrapper::setLastShownPages(const QStringList &lastShownPages) +{ + CollectionConfiguration::setLastShownPages(*m_helpEngine, lastShownPages); +} + +const QStringList HelpEngineWrapper::lastZoomFactors() const +{ + return CollectionConfiguration::lastZoomFactors(*m_helpEngine); +} + +void HelpEngineWrapper::setLastZoomFactors(const QStringList &lastZoomFactors) +{ + CollectionConfiguration::setLastZoomFactors(*m_helpEngine, lastZoomFactors); +} + +const QString HelpEngineWrapper::cacheDir() const +{ + return CollectionConfiguration::cacheDir(*m_helpEngine); +} + +bool HelpEngineWrapper::cacheDirIsRelativeToCollection() const +{ + return CollectionConfiguration::cacheDirIsRelativeToCollection(*m_helpEngine); +} + +void HelpEngineWrapper::setCacheDir(const QString &cacheDir, + bool relativeToCollection) +{ + CollectionConfiguration::setCacheDir(*m_helpEngine, cacheDir, + relativeToCollection); +} + +bool HelpEngineWrapper::filterFunctionalityEnabled() const +{ + return CollectionConfiguration::filterFunctionalityEnabled(*m_helpEngine); +} + +void HelpEngineWrapper::setFilterFunctionalityEnabled(bool enabled) +{ + CollectionConfiguration::setFilterFunctionalityEnabled(*m_helpEngine, + enabled); +} + +bool HelpEngineWrapper::filterToolbarVisible() const +{ + return CollectionConfiguration::filterToolbarVisible(*m_helpEngine); +} + +void HelpEngineWrapper::setFilterToolbarVisible(bool visible) +{ + CollectionConfiguration::setFilterToolbarVisible(*m_helpEngine, visible); +} + +bool HelpEngineWrapper::addressBarEnabled() const +{ + return CollectionConfiguration::addressBarEnabled(*m_helpEngine); +} + +void HelpEngineWrapper::setAddressBarEnabled(bool enabled) +{ + CollectionConfiguration::setAddressBarEnabled(*m_helpEngine, enabled); +} + +bool HelpEngineWrapper::addressBarVisible() const +{ + return CollectionConfiguration::addressBarVisible(*m_helpEngine); +} + +void HelpEngineWrapper::setAddressBarVisible(bool visible) +{ + CollectionConfiguration::setAddressBarVisible(*m_helpEngine, visible); +} + +bool HelpEngineWrapper::documentationManagerEnabled() const +{ + return CollectionConfiguration::documentationManagerEnabled(*m_helpEngine); +} + +void HelpEngineWrapper::setDocumentationManagerEnabled(bool enabled) +{ + CollectionConfiguration::setDocumentationManagerEnabled(*m_helpEngine, + enabled); +} + +const QByteArray HelpEngineWrapper::aboutMenuTexts() const +{ + return CollectionConfiguration::aboutMenuTexts(*m_helpEngine); +} + +void HelpEngineWrapper::setAboutMenuTexts(const QByteArray &texts) +{ + CollectionConfiguration::setAboutMenuTexts(*m_helpEngine, texts); +} + +const QByteArray HelpEngineWrapper::aboutIcon() const +{ + return CollectionConfiguration::aboutIcon(*m_helpEngine); +} + +void HelpEngineWrapper::setAboutIcon(const QByteArray &icon) +{ + CollectionConfiguration::setAboutIcon(*m_helpEngine, icon); +} + +const QByteArray HelpEngineWrapper::aboutImages() const +{ + return CollectionConfiguration::aboutImages(*m_helpEngine); +} + +void HelpEngineWrapper::setAboutImages(const QByteArray &images) +{ + CollectionConfiguration::setAboutImages(*m_helpEngine, images); +} + +const QByteArray HelpEngineWrapper::aboutTexts() const +{ + return CollectionConfiguration::aboutTexts(*m_helpEngine); +} + +void HelpEngineWrapper::setAboutTexts(const QByteArray &texts) +{ + CollectionConfiguration::setAboutTexts(*m_helpEngine, texts); +} + +const QString HelpEngineWrapper::windowTitle() const +{ + return CollectionConfiguration::windowTitle(*m_helpEngine); +} + +void HelpEngineWrapper::setWindowTitle(const QString &windowTitle) +{ + CollectionConfiguration::setWindowTitle(*m_helpEngine, windowTitle); +} + +const QByteArray HelpEngineWrapper::applicationIcon() const +{ + return CollectionConfiguration::applicationIcon(*m_helpEngine); +} + +void HelpEngineWrapper::setApplicationIcon(const QByteArray &icon) +{ + CollectionConfiguration::setApplicationIcon(*m_helpEngine, icon); +} + +const QByteArray HelpEngineWrapper::mainWindow() const +{ + return m_helpEngine->customValue(MainWindowKey).toByteArray(); +} + +void HelpEngineWrapper::setMainWindow(const QByteArray &mainWindow) +{ + m_helpEngine->setCustomValue(MainWindowKey, mainWindow); +} + +const QByteArray HelpEngineWrapper::mainWindowGeometry() const +{ + return m_helpEngine->customValue(MainWindowGeometryKey).toByteArray(); +} + +void HelpEngineWrapper::setMainWindowGeometry(const QByteArray &geometry) +{ + m_helpEngine->setCustomValue(MainWindowGeometryKey, geometry); +} + +const QByteArray HelpEngineWrapper::bookmarks() const +{ + return m_helpEngine->customValue(BookmarksKey).toByteArray(); +} + +void HelpEngineWrapper::setBookmarks(const QByteArray &bookmarks) +{ + m_helpEngine->setCustomValue(BookmarksKey, bookmarks); +} + +int HelpEngineWrapper::lastTabPage() const +{ + return CollectionConfiguration::lastTabPage(*m_helpEngine); +} + +void HelpEngineWrapper::setLastTabPage(int lastPage) +{ + CollectionConfiguration::setLastTabPage(*m_helpEngine, lastPage); +} + +bool HelpEngineWrapper::searchWasAttached() const +{ + return m_helpEngine->customValue(SearchWasAttachedKey).toBool(); +} + +void HelpEngineWrapper::setSearchWasAttached(bool attached) +{ + m_helpEngine->setCustomValue(SearchWasAttachedKey, attached); +} + +int HelpEngineWrapper::startOption() const +{ + return m_helpEngine->customValue(StartOptionKey, ShowLastPages).toInt(); +} + +void HelpEngineWrapper::setStartOption(int option) +{ + m_helpEngine->setCustomValue(StartOptionKey, option); +} + +const QString HelpEngineWrapper::homePage() const +{ + const QString &homePage = m_helpEngine->customValue(HomePageKey).toString(); + if (!homePage.isEmpty()) + return homePage; + return defaultHomePage(); +} + +void HelpEngineWrapper::setHomePage(const QString &page) +{ + m_helpEngine->setCustomValue(HomePageKey, page); + +} + +const QString HelpEngineWrapper::defaultHomePage() const +{ + return CollectionConfiguration::defaultHomePage(*m_helpEngine); +} + +void HelpEngineWrapper::setDefaultHomePage(const QString &page) +{ + CollectionConfiguration::setDefaultHomePage(*m_helpEngine, page); +} + +bool HelpEngineWrapper::hasFontSettings() const +{ + return m_helpEngine->customValue(UseAppFontKey).isValid(); +} + +bool HelpEngineWrapper::usesAppFont() const +{ + return m_helpEngine->customValue(UseAppFontKey).toBool(); +} + +void HelpEngineWrapper::setUseAppFont(bool useAppFont) +{ + m_helpEngine->setCustomValue(UseAppFontKey, useAppFont); +} + +bool HelpEngineWrapper::usesBrowserFont() const +{ + return m_helpEngine->customValue(UseBrowserFontKey, false).toBool(); +} + +void HelpEngineWrapper::setUseBrowserFont(bool useBrowserFont) +{ + m_helpEngine->setCustomValue(UseBrowserFontKey, useBrowserFont); +} + +const QFont HelpEngineWrapper::appFont() const +{ + return qVariantValue(m_helpEngine->customValue(AppFontKey)); +} + +void HelpEngineWrapper::setAppFont(const QFont &font) +{ + m_helpEngine->setCustomValue(AppFontKey, font); +} + +QFontDatabase::WritingSystem HelpEngineWrapper::appWritingSystem() const +{ + return static_cast( + m_helpEngine->customValue(AppWritingSystemKey).toInt()); +} + +void HelpEngineWrapper::setAppWritingSystem(QFontDatabase::WritingSystem system) +{ + m_helpEngine->setCustomValue(AppWritingSystemKey, system); +} + +const QFont HelpEngineWrapper::browserFont() const +{ + return qVariantValue(m_helpEngine->customValue(BrowserFontKey)); +} + +void HelpEngineWrapper::setBrowserFont(const QFont &font) +{ + m_helpEngine->setCustomValue(BrowserFontKey, font); +} + +QFontDatabase::WritingSystem HelpEngineWrapper::browserWritingSystem() const +{ + return static_cast( + m_helpEngine->customValue(BrowserWritingSystemKey).toInt()); +} + +void HelpEngineWrapper::setBrowserWritingSystem(QFontDatabase::WritingSystem system) +{ + m_helpEngine->setCustomValue(BrowserWritingSystemKey, system); +} + + +void HelpEngineWrapper::assertDocFilesWatched() +{ + Q_ASSERT(m_qchWatcher->files().count() + == m_helpEngine->registeredDocumentations().count()); +} + +void HelpEngineWrapper::qchFileChanged(const QString &fileName) +{ + /* + * We don't use QHelpEngineCore::namespaceName(fileName), because the file + * may not exist anymore or contain a different namespace. + */ + QString ns; + foreach (const QString &curNs, m_helpEngine->registeredDocumentations()) { + if (m_helpEngine->documentationFileName(curNs) == fileName) { + ns = curNs; + break; + } + } + + /* + * We can't do an assertion here, because QFileSystemWatcher may send the + * signal more than once. + */ + if (ns.isEmpty()) + return; + + if (m_helpEngine->unregisterDocumentation(ns)) { + if (!QFileInfo(fileName).exists() + || !m_helpEngine->registerDocumentation(fileName)) { + m_qchWatcher->removePath(fileName); + emit documentationRemoved(ns); + } else { + emit documentationUpdated(ns); + } + m_helpEngine->setupData(); + } +} + +QT_END_NAMESPACE diff --git a/tools/assistant/tools/assistant/helpenginewrapper.h b/tools/assistant/tools/assistant/helpenginewrapper.h new file mode 100644 index 0000000..1fc9eb6 --- /dev/null +++ b/tools/assistant/tools/assistant/helpenginewrapper.h @@ -0,0 +1,212 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef HELPENGINEWRAPPER_H +#define HELPENGINEWRAPPER_H + +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class QFileSystemWatcher; +class QHelpContentModel; +class QHelpContentWidget; +class QHelpEngine; +class QHelpEngineCore; +class QHelpIndexModel; +class QHelpIndexWidget; +class QHelpSearchEngine; + +enum { + ShowHomePage = 0, + ShowBlankPage = 1, + ShowLastPages = 2 +}; + +class HelpEngineWrapper : public QObject +{ + Q_OBJECT + Q_DISABLE_COPY(HelpEngineWrapper) +public: + static HelpEngineWrapper &instance(const QString &collectionFile = QString()); + static void removeInstance(); + + void initFileSystemWatchers(); + + // Forwarded help engine member functions, possibly enriched. + QHelpSearchEngine *searchEngine() const; + QHelpContentModel *contentModel() const; + QHelpIndexModel *indexModel() const; + QHelpContentWidget *contentWidget(); + QHelpIndexWidget *indexWidget(); + bool setupData(); + const QStringList registeredDocumentations() const; + const QString collectionFile() const; + bool registerDocumentation(const QString &docFile); + bool unregisterDocumentation(const QString &namespaceName); + bool addCustomFilter(const QString &filterName, + const QStringList &attributes); + bool removeCustomFilter(const QString &filterName); + void setCurrentFilter(const QString &filterName); + const QString currentFilter() const; + const QStringList customFilters() const; + QUrl findFile(const QUrl &url) const; + QByteArray fileData(const QUrl &url) const; + QMap linksForIdentifier(const QString &id) const; + const QStringList filterAttributes() const; + const QStringList filterAttributes(const QString &filterName) const; + QString error() const; + + // Access to a collection's custom values. + bool unfilteredInserted() const; + void setUnfilteredInserted(); + + const QStringList qtDocInfo(const QString &component) const; + void setQtDocInfo(const QString &component, const QStringList &doc); + + const QString homePage() const; + void setHomePage(const QString &page); + const QString defaultHomePage() const; + void setDefaultHomePage(const QString &page); + + int lastTabPage() const; + void setLastTabPage(int lastPage); + + // TODO: Don't allow last pages and zoom factors to be set in isolation + // Perhaps also fill up missing elements automatically or assert. + const QStringList lastShownPages() const; + void setLastShownPages(const QStringList &lastShownPages); + const QStringList lastZoomFactors() const; + void setLastZoomFactors(const QStringList &lastZoomFactors); + + const QString cacheDir() const; + bool cacheDirIsRelativeToCollection() const; + void setCacheDir(const QString &cacheDir, bool relativeToCollection); + + bool filterFunctionalityEnabled() const; + void setFilterFunctionalityEnabled(bool enabled); + + bool filterToolbarVisible() const; + void setFilterToolbarVisible(bool visible); + + bool addressBarEnabled() const; + void setAddressBarEnabled(bool enabled); + + bool addressBarVisible() const; + void setAddressBarVisible(bool visible); + + bool documentationManagerEnabled() const; + void setDocumentationManagerEnabled(bool enabled); + + const QByteArray aboutMenuTexts() const; + void setAboutMenuTexts(const QByteArray &texts); + const QByteArray aboutTexts() const; + void setAboutTexts(const QByteArray &texts); + const QByteArray aboutIcon() const; + void setAboutIcon(const QByteArray &icon); + const QByteArray aboutImages() const; + void setAboutImages(const QByteArray &images); + + const QString windowTitle() const; + void setWindowTitle(const QString &windowTitle); + + const QByteArray applicationIcon() const; + void setApplicationIcon(const QByteArray &icon); + + const QByteArray mainWindow() const; + void setMainWindow(const QByteArray &mainWindow); + const QByteArray mainWindowGeometry() const; + void setMainWindowGeometry(const QByteArray &geometry); + + const QByteArray bookmarks() const; + void setBookmarks(const QByteArray &bookmarks); + + int startOption() const; + void setStartOption(int option); + + bool searchWasAttached() const; + void setSearchWasAttached(bool attached); + + bool hasFontSettings() const; + bool usesAppFont() const; + void setUseAppFont(bool useAppFont); + bool usesBrowserFont() const; + void setUseBrowserFont(bool useBrowserFont); + const QFont appFont() const; + void setAppFont(const QFont &font); + QFontDatabase::WritingSystem appWritingSystem() const; + void setAppWritingSystem(QFontDatabase::WritingSystem system); + const QFont browserFont() const; + void setBrowserFont(const QFont &font); + QFontDatabase::WritingSystem browserWritingSystem() const; + void setBrowserWritingSystem(QFontDatabase::WritingSystem system); + +signals: + + // For asynchronous doc updates triggered by external actions. + void documentationRemoved(const QString &namespaceName); + void documentationUpdated(const QString &namespaceName); + + // Forwarded from QHelpEngineCore. + void currentFilterChanged(const QString ¤tFilter); + void setupFinished(); + +private slots: + void qchFileChanged(const QString &fileName); + +private: + HelpEngineWrapper(const QString &collectionFile); + void assertDocFilesWatched(); + + static HelpEngineWrapper *helpEngineWrapper; + QHelpEngine * const m_helpEngine; + QFileSystemWatcher * const m_qchWatcher; +}; + +QT_END_NAMESPACE + +#endif // HELPENGINEWRAPPER_H diff --git a/tools/assistant/tools/assistant/helpviewer.cpp b/tools/assistant/tools/assistant/helpviewer.cpp index 2756753..5f2c02b 100644 --- a/tools/assistant/tools/assistant/helpviewer.cpp +++ b/tools/assistant/tools/assistant/helpviewer.cpp @@ -41,7 +41,7 @@ #include "helpviewer.h" #include "centralwidget.h" -#include "../shared/collectionconfiguration.h" +#include "helpenginewrapper.h" #include #include @@ -56,8 +56,6 @@ #include #include -#include - #include #include #include @@ -124,19 +122,15 @@ qint64 HelpNetworkReply::readData(char *buffer, qint64 maxlen) class HelpNetworkAccessManager : public QNetworkAccessManager { public: - HelpNetworkAccessManager(QHelpEngine *engine, QObject *parent); + HelpNetworkAccessManager(QObject *parent); protected: virtual QNetworkReply *createRequest(Operation op, const QNetworkRequest &request, QIODevice *outgoingData = 0); - -private: - QHelpEngine *helpEngine; }; -HelpNetworkAccessManager::HelpNetworkAccessManager(QHelpEngine *engine, - QObject *parent) - : QNetworkAccessManager(parent), helpEngine(engine) +HelpNetworkAccessManager::HelpNetworkAccessManager(QObject *parent) + : QNetworkAccessManager(parent) { } @@ -158,8 +152,9 @@ QNetworkReply *HelpNetworkAccessManager::createRequest(Operation /*op*/, mimeType = QLatin1String("text/html"); } - const QByteArray &data = helpEngine->findFile(url).isValid() - ? helpEngine->fileData(url) + HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); + const QByteArray &data = helpEngine.findFile(url).isValid() + ? helpEngine.fileData(url) : PageNotFoundMessage.arg(url.toString()).toUtf8(); return new HelpNetworkReply(request, data, mimeType); } @@ -167,7 +162,7 @@ QNetworkReply *HelpNetworkAccessManager::createRequest(Operation /*op*/, class HelpPage : public QWebPage { public: - HelpPage(CentralWidget *central, QHelpEngine *engine, QObject *parent); + HelpPage(CentralWidget *central, QObject *parent); protected: virtual QWebPage *createWindow(QWebPage::WebWindowType); @@ -178,7 +173,6 @@ protected: private: CentralWidget *centralWidget; - QHelpEngine *helpEngine; bool closeNewTabIfNeeded; friend class HelpViewer; @@ -186,10 +180,9 @@ private: Qt::KeyboardModifiers m_keyboardModifiers; }; -HelpPage::HelpPage(CentralWidget *central, QHelpEngine *engine, QObject *parent) +HelpPage::HelpPage(CentralWidget *central, QObject *parent) : QWebPage(parent) , centralWidget(central) - , helpEngine(engine) , closeNewTabIfNeeded(false) , m_pressedButtons(Qt::NoButton) , m_keyboardModifiers(Qt::NoModifier) @@ -248,7 +241,7 @@ bool HelpPage::acceptNavigationRequest(QWebFrame *, QFile tmpFile(QDir::cleanPath(fileName)); if (tmpFile.open(QIODevice::ReadWrite)) { - tmpFile.write(helpEngine->fileData(url)); + tmpFile.write(HelpEngineWrapper::instance().fileData(url)); tmpFile.close(); } QDesktopServices::openUrl(QUrl(tmpFile.fileName())); @@ -275,17 +268,17 @@ bool HelpPage::acceptNavigationRequest(QWebFrame *, return false; } -HelpViewer::HelpViewer(QHelpEngine *engine, CentralWidget *parent) +HelpViewer::HelpViewer(CentralWidget *parent) : QWebView(parent) - , helpEngine(engine) , parentWidget(parent) , loadFinished(false) + , helpEngine(HelpEngineWrapper::instance()) { setAcceptDrops(false); - setPage(new HelpPage(parent, helpEngine, this)); + setPage(new HelpPage(parent, this)); - page()->setNetworkAccessManager(new HelpNetworkAccessManager(engine, this)); + page()->setNetworkAccessManager(new HelpNetworkAccessManager(this)); QAction* action = pageAction(QWebPage::OpenLinkInNewWindow); action->setText(tr("Open Link in New Tab")); @@ -392,13 +385,13 @@ void HelpViewer::setLoadFinished(bool ok) #else // !defined(QT_NO_WEBKIT) -HelpViewer::HelpViewer(QHelpEngine *engine, CentralWidget *parent) +HelpViewer::HelpViewer(CentralWidget *parent) : QTextBrowser(parent) , zoomCount(0) , controlPressed(false) , lastAnchor(QString()) - , helpEngine(engine) , parentWidget(parent) + , helpEngine(HelpEngineWrapper::instance()) { document()->setDocumentMargin(8); } @@ -410,7 +403,7 @@ void HelpViewer::setSource(const QUrl &url) if (launchedWithExternalApp(url)) return; - QUrl u = helpEngine->findFile(url); + QUrl u = helpEngine.findFile(url); if (u.isValid()) { QTextBrowser::setSource(u); return; @@ -472,7 +465,7 @@ bool HelpViewer::launchedWithExternalApp(const QUrl &url) QFile tmpFile(QDir::cleanPath(fileName)); if (tmpFile.open(QIODevice::ReadWrite)) { - tmpFile.write(helpEngine->fileData(url)); + tmpFile.write(helpEngine.fileData(url)); tmpFile.close(); } launched = QDesktopServices::openUrl(QUrl(tmpFile.fileName())); @@ -493,7 +486,7 @@ QVariant HelpViewer::loadResource(int type, const QUrl &name) { QByteArray ba; if (type < 4) { - ba = helpEngine->fileData(name); + ba = helpEngine.fileData(name); if (name.toString().endsWith(QLatin1String(".svg"), Qt::CaseInsensitive)) { QImage image; image.loadFromData(ba, "svg"); @@ -606,10 +599,7 @@ void HelpViewer::wheelEvent(QWheelEvent *e) void HelpViewer::home() { - QString homePage = CollectionConfiguration::homePage(*helpEngine); - if (homePage.isEmpty()) - homePage = CollectionConfiguration::defaultHomePage(*helpEngine); - setSource(homePage); + setSource(helpEngine.homePage()); } QT_END_NAMESPACE diff --git a/tools/assistant/tools/assistant/helpviewer.h b/tools/assistant/tools/assistant/helpviewer.h index 350209b..64742b5 100644 --- a/tools/assistant/tools/assistant/helpviewer.h +++ b/tools/assistant/tools/assistant/helpviewer.h @@ -53,8 +53,8 @@ QT_BEGIN_NAMESPACE -class QHelpEngine; class CentralWidget; +class HelpEngineWrapper; class QPoint; class QString; @@ -69,7 +69,7 @@ class HelpViewer : public QWebView Q_OBJECT public: - HelpViewer(QHelpEngine *helpEngine, CentralWidget *parent); + HelpViewer(CentralWidget *parent); void setSource(const QUrl &url); inline QUrl source() const @@ -118,9 +118,9 @@ private Q_SLOTS: void setLoadFinished(bool ok); private: - QHelpEngine *helpEngine; CentralWidget* parentWidget; bool loadFinished; + HelpEngineWrapper &helpEngine; }; #else @@ -130,7 +130,7 @@ class HelpViewer : public QTextBrowser Q_OBJECT public: - HelpViewer(QHelpEngine *helpEngine, CentralWidget *parent); + HelpViewer(CentralWidget *parent); void setSource(const QUrl &url); void resetZoom(); @@ -165,8 +165,8 @@ private: int zoomCount; bool controlPressed; QString lastAnchor; - QHelpEngine *helpEngine; CentralWidget* parentWidget; + HelpEngineWrapper &helpEngine; }; #endif diff --git a/tools/assistant/tools/assistant/indexwindow.cpp b/tools/assistant/tools/assistant/indexwindow.cpp index 6d35649..757a641 100644 --- a/tools/assistant/tools/assistant/indexwindow.cpp +++ b/tools/assistant/tools/assistant/indexwindow.cpp @@ -41,6 +41,7 @@ #include "indexwindow.h" #include "centralwidget.h" +#include "helpenginewrapper.h" #include "topicchooser.h" #include @@ -51,22 +52,19 @@ #include #include -#include #include QT_BEGIN_NAMESPACE -IndexWindow::IndexWindow(QHelpEngine *helpEngine, QWidget *parent) +IndexWindow::IndexWindow(QWidget *parent) : QWidget(parent) - , m_searchLineEdit(0) - , m_indexWidget(0) - , m_helpEngine(helpEngine) + , m_searchLineEdit(new QLineEdit) + , m_indexWidget(HelpEngineWrapper::instance().indexWidget()) { QVBoxLayout *layout = new QVBoxLayout(this); QLabel *l = new QLabel(tr("&Look for:")); layout->addWidget(l); - m_searchLineEdit = new QLineEdit(); l->setBuddy(m_searchLineEdit); connect(m_searchLineEdit, SIGNAL(textChanged(QString)), this, SLOT(filterIndices(QString))); @@ -74,11 +72,11 @@ IndexWindow::IndexWindow(QHelpEngine *helpEngine, QWidget *parent) layout->setMargin(4); layout->addWidget(m_searchLineEdit); - m_indexWidget = m_helpEngine->indexWidget(); + HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); m_indexWidget->installEventFilter(this); - connect(m_helpEngine->indexModel(), SIGNAL(indexCreationStarted()), this, + connect(helpEngine.indexModel(), SIGNAL(indexCreationStarted()), this, SLOT(disableSearchLineEdit())); - connect(m_helpEngine->indexModel(), SIGNAL(indexCreated()), this, + connect(helpEngine.indexModel(), SIGNAL(indexCreated()), this, SLOT(enableSearchLineEdit())); connect(m_indexWidget, SIGNAL(linkActivated(QUrl,QString)), this, SIGNAL(linkActivated(QUrl))); diff --git a/tools/assistant/tools/assistant/indexwindow.h b/tools/assistant/tools/assistant/indexwindow.h index 5973e43..6fbb250 100644 --- a/tools/assistant/tools/assistant/indexwindow.h +++ b/tools/assistant/tools/assistant/indexwindow.h @@ -49,7 +49,6 @@ QT_BEGIN_NAMESPACE class QHelpIndexWidget; -class QHelpEngine; class QModelIndex; class IndexWindow : public QWidget @@ -57,7 +56,7 @@ class IndexWindow : public QWidget Q_OBJECT public: - IndexWindow(QHelpEngine *helpEngine, QWidget *parent = 0); + IndexWindow(QWidget *parent = 0); ~IndexWindow(); void setSearchLineEditText(const QString &text); @@ -84,7 +83,6 @@ private: QLineEdit *m_searchLineEdit; QHelpIndexWidget *m_indexWidget; - QHelpEngine *m_helpEngine; }; QT_END_NAMESPACE diff --git a/tools/assistant/tools/assistant/main.cpp b/tools/assistant/tools/assistant/main.cpp index ab7168c..4d93a41 100644 --- a/tools/assistant/tools/assistant/main.cpp +++ b/tools/assistant/tools/assistant/main.cpp @@ -57,9 +57,12 @@ #include #include "../shared/collectionconfiguration.h" +#include "helpenginewrapper.h" #include "mainwindow.h" #include "cmdlineparser.h" +// #define TRACING_REQUESTED + QT_USE_NAMESPACE #if defined(USE_STATIC_SQLITE_PLUGIN) @@ -317,8 +320,17 @@ int main(int argc, char *argv[]) qtHelpTranslator.load(QLatin1String("qt_help_") + locale, resourceDir); a.installTranslator(&qtHelpTranslator); - MainWindow w(&cmd); - w.show(); + /* + * We need to be careful here: The main window has to be deleted before + * the help engine wrapper, which has to be deleted before the + * QApplication. + */ + int retval; + MainWindow *w = new MainWindow(&cmd); + w->show(); a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); - return a.exec(); + retval = a.exec(); + delete w; + delete &HelpEngineWrapper::instance(); + return retval; } diff --git a/tools/assistant/tools/assistant/mainwindow.cpp b/tools/assistant/tools/assistant/mainwindow.cpp index 2760f1e..226ad51 100644 --- a/tools/assistant/tools/assistant/mainwindow.cpp +++ b/tools/assistant/tools/assistant/mainwindow.cpp @@ -47,18 +47,22 @@ #include "contentwindow.h" #include "preferencesdialog.h" #include "bookmarkmanager.h" +#include "helpenginewrapper.h" #include "remotecontrol.h" #include "cmdlineparser.h" #include "aboutdialog.h" #include "searchwidget.h" #include "qtdocinstaller.h" #include "xbelsupport.h" -#include "../shared/collectionconfiguration.h" + +// #define TRACING_REQUESTED #include #include +#include #include #include +#include #include #include #include @@ -81,7 +85,7 @@ #include #include -#include +#include #include #include #include @@ -95,29 +99,31 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent) , m_cmdLine(cmdLine) , m_progressWidget(0) , m_qtDocInstaller(0) - , m_qchWatcher(new QFileSystemWatcher(this)) , m_connectedInitSignals(false) { + setToolButtonStyle(Qt::ToolButtonFollowStyle); + QString collectionFile; if (usesDefaultCollection()) { MainWindow::collectionFileDirectory(true); - m_helpEngine = new QHelpEngine(MainWindow::defaultHelpCollectionFileName(), - this); + collectionFile = MainWindow::defaultHelpCollectionFileName(); } else { - m_helpEngine = new QHelpEngine(cmdLine->collectionFile(), this); + collectionFile = cmdLine->collectionFile(); } + HelpEngineWrapper &helpEngineWrapper = + HelpEngineWrapper::instance(collectionFile); - m_centralWidget = new CentralWidget(m_helpEngine, this); + m_centralWidget = new CentralWidget(this); setCentralWidget(m_centralWidget); - m_indexWindow = new IndexWindow(m_helpEngine); + m_indexWindow = new IndexWindow(this); QDockWidget *indexDock = new QDockWidget(tr("Index"), this); indexDock->setObjectName(QLatin1String("IndexWindow")); indexDock->setWidget(m_indexWindow); addDockWidget(Qt::LeftDockWidgetArea, indexDock); - m_contentWindow = new ContentWindow(m_helpEngine); + m_contentWindow = new ContentWindow; QDockWidget *contentDock = new QDockWidget(tr("Contents"), this); contentDock->setObjectName(QLatin1String("ContentWindow")); contentDock->setWidget(m_contentWindow); @@ -128,7 +134,7 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent) bookmarkDock->setWidget(setupBookmarkWidget()); addDockWidget(Qt::LeftDockWidgetArea, bookmarkDock); - QHelpSearchEngine *searchEngine = m_helpEngine->searchEngine(); + QHelpSearchEngine *searchEngine = helpEngineWrapper.searchEngine(); connect(searchEngine, SIGNAL(indexingStarted()), this, SLOT(indexingStarted())); connect(searchEngine, SIGNAL(indexingFinished()), this, SLOT(indexingFinished())); @@ -153,11 +159,9 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent) connect(m_bookmarkManager, SIGNAL(bookmarksChanged()), this, SLOT(updateBookmarkMenu())); - const QString windowTitle = - CollectionConfiguration::windowTitle(*m_helpEngine); + const QString windowTitle = helpEngineWrapper.windowTitle(); setWindowTitle(windowTitle.isEmpty() ? defWindowTitle : windowTitle); - QByteArray iconArray = - CollectionConfiguration::applicationIcon(*m_helpEngine); + QByteArray iconArray = helpEngineWrapper.applicationIcon(); if (iconArray.size() > 0) { QPixmap pix; pix.loadFromData(iconArray); @@ -171,11 +175,11 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent) // Show the widget here, otherwise the restore geometry and state won't work // on x11. show(); - QByteArray ba(CollectionConfiguration::mainWindow(*m_helpEngine)); + QByteArray ba(helpEngineWrapper.mainWindow()); if (!ba.isEmpty()) restoreState(ba); - ba = CollectionConfiguration::mainWindowGeometry(*m_helpEngine); + ba = helpEngineWrapper.mainWindowGeometry(); if (!ba.isEmpty()) { restoreGeometry(ba); } else { @@ -185,15 +189,13 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent) resize(QSize(800, 600)); } - if (!CollectionConfiguration::hasFontSettings(*m_helpEngine)) { - CollectionConfiguration::setUseAppFont(*m_helpEngine, false); - CollectionConfiguration::setUseBrowserFont(*m_helpEngine, false); - CollectionConfiguration::setAppFont(*m_helpEngine, qApp->font()); - CollectionConfiguration::setAppWritingSystem(*m_helpEngine, - QFontDatabase::Latin); - CollectionConfiguration::setBrowserFont(*m_helpEngine, qApp->font()); - CollectionConfiguration::setBrowserWritingSystem(*m_helpEngine, - QFontDatabase::Latin); + if (!helpEngineWrapper.hasFontSettings()) { + helpEngineWrapper.setUseAppFont(false); + helpEngineWrapper.setUseBrowserFont(false); + helpEngineWrapper.setAppFont(qApp->font()); + helpEngineWrapper.setAppWritingSystem(QFontDatabase::Latin); + helpEngineWrapper.setBrowserFont(qApp->font()); + helpEngineWrapper.setBrowserWritingSystem(QFontDatabase::Latin); } else { updateApplicationFont(); } @@ -202,7 +204,7 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent) QTimer::singleShot(0, this, SLOT(insertLastPages())); if (m_cmdLine->enableRemoteControl()) - (void)new RemoteControl(this, m_helpEngine, m_qchWatcher); + (void)new RemoteControl(this); if (m_cmdLine->contents() == CmdLineParser::Show) showContents(); @@ -233,8 +235,8 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent) if (!m_cmdLine->currentFilter().isEmpty()) { const QString &curFilter = m_cmdLine->currentFilter(); - if (m_helpEngine->customFilters().contains(curFilter)) - m_helpEngine->setCurrentFilter(curFilter); + if (helpEngineWrapper.customFilters().contains(curFilter)) + helpEngineWrapper.setCurrentFilter(curFilter); } if (usesDefaultCollection()) @@ -242,12 +244,11 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent) else checkInitState(); - foreach(const QString &ns, m_helpEngine->registeredDocumentations()) { - const QString &docFile = m_helpEngine->documentationFileName(ns); - m_qchWatcher->addPath(docFile); - connect(m_qchWatcher, SIGNAL(fileChanged(QString)), this, - SLOT(qchFileChanged(QString))); - } + helpEngineWrapper.initFileSystemWatchers(); + connect(&helpEngineWrapper, SIGNAL(documentationRemoved(QString)), + this, SLOT(documentationRemoved(QString))); + connect(&helpEngineWrapper, SIGNAL(documentationUpdated(QString)), + this, SLOT(documentationUpdated(QString))); } setTabPosition(Qt::AllDockWidgetAreas, QTabWidget::North); } @@ -266,21 +267,20 @@ bool MainWindow::usesDefaultCollection() const void MainWindow::closeEvent(QCloseEvent *e) { m_bookmarkManager->saveBookmarks(); - CollectionConfiguration::setMainWindow(*m_helpEngine, saveState()); - CollectionConfiguration::setMainWindowGeometry(*m_helpEngine, - saveGeometry()); - + HelpEngineWrapper::instance().setMainWindow(saveState()); + HelpEngineWrapper::instance().setMainWindowGeometry(saveGeometry()); QMainWindow::closeEvent(e); } bool MainWindow::initHelpDB() { - if (!m_helpEngine->setupData()) + HelpEngineWrapper &helpEngineWrapper = HelpEngineWrapper::instance(); + if (!helpEngineWrapper.setupData()) return false; bool assistantInternalDocRegistered = false; QString intern(QLatin1String("com.trolltech.com.assistantinternal-")); - foreach (const QString &ns, m_helpEngine->registeredDocumentations()) { + foreach (const QString &ns, helpEngineWrapper.registeredDocumentations()) { if (ns.startsWith(intern)) { intern = ns; assistantInternalDocRegistered = true; @@ -288,8 +288,7 @@ bool MainWindow::initHelpDB() } } - const QString &collectionFile = m_helpEngine->collectionFile(); - + const QString &collectionFile = helpEngineWrapper.collectionFile(); QFileInfo fi(collectionFile); QString helpFile; QTextStream(&helpFile) << fi.absolutePath() << QDir::separator() @@ -306,62 +305,52 @@ bool MainWindow::initHelpDB() file.close(); } - QHelpEngineCore hc(fi.absoluteFilePath()); - hc.setupData(); - const QString internalFile = hc.documentationFileName(intern); - if (hc.unregisterDocumentation(intern)) - m_qchWatcher->removePath(internalFile); - if (hc.registerDocumentation(helpFile)) - m_qchWatcher->addPath(helpFile); + helpEngineWrapper.unregisterDocumentation(intern); + helpEngineWrapper.registerDocumentation(helpFile); needsSetup = true; } - if (!CollectionConfiguration::unfilteredInserted(*m_helpEngine)) { - { - QHelpEngineCore hc(collectionFile); - hc.setupData(); - hc.addCustomFilter(tr("Unfiltered"), QStringList()); - CollectionConfiguration::setUnfilteredInserted(hc); - } - - m_helpEngine->blockSignals(true); - m_helpEngine->setCurrentFilter(tr("Unfiltered")); - m_helpEngine->blockSignals(false); + if (!helpEngineWrapper.unfilteredInserted()) { + helpEngineWrapper.addCustomFilter(tr("Unfiltered"), QStringList()); + helpEngineWrapper.setUnfilteredInserted(); + helpEngineWrapper.setCurrentFilter(tr("Unfiltered")); needsSetup = true; } - if (needsSetup) { - m_helpEngine->setupData(); - Q_ASSERT(m_qchWatcher->files().count() - == m_helpEngine->registeredDocumentations().count()); - } + if (needsSetup) + helpEngineWrapper.setupData(); return true; } void MainWindow::lookForNewQtDocumentation() { - m_qtDocInstaller = - new QtDocInstaller(m_helpEngine->collectionFile(), m_qchWatcher); - connect(m_qtDocInstaller, SIGNAL(errorMessage(QString)), this, - SLOT(displayInstallationError(QString))); + HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); + QStringList docs; + docs << QLatin1String("assistant") + << QLatin1String("designer") + << QLatin1String("linguist") + << QLatin1String("qmake") + << QLatin1String("qt"); + QList qtDocInfos; + foreach (const QString &doc, docs) + qtDocInfos.append(QtDocInstaller::DocInfo(doc, helpEngine.qtDocInfo(doc))); + + m_qtDocInstaller = new QtDocInstaller(qtDocInfos); connect(m_qtDocInstaller, SIGNAL(docsInstalled(bool)), this, SLOT(qtDocumentationInstalled(bool))); - - if (CollectionConfiguration::qtDocInfo(*m_helpEngine, QLatin1String("qt")). - count() != 2) + connect(m_qtDocInstaller, SIGNAL(qchFileNotFound(QString)), this, + SLOT(resetQtDocInfo(QString))); + connect(m_qtDocInstaller, SIGNAL(registerDocumentation(QString, QString)), + this, SLOT(registerDocumentation(QString, QString))); + if (helpEngine.qtDocInfo(QLatin1String("qt")).count() != 2) statusBar()->showMessage(tr("Looking for Qt Documentation...")); m_qtDocInstaller->installDocs(); } -void MainWindow::displayInstallationError(const QString &errorMessage) -{ - QMessageBox::warning(this, tr("Qt Assistant"), errorMessage); -} - void MainWindow::qtDocumentationInstalled(bool newDocsInstalled) { if (newDocsInstalled) - m_helpEngine->setupData(); + HelpEngineWrapper::instance().setupData(); statusBar()->clearMessage(); checkInitState(); } @@ -371,19 +360,20 @@ void MainWindow::checkInitState() if (!m_cmdLine->enableRemoteControl()) return; - if (m_helpEngine->contentModel()->isCreatingContents() - || m_helpEngine->indexModel()->isCreatingIndex()) { + HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); + if (helpEngine.contentModel()->isCreatingContents() + || helpEngine.indexModel()->isCreatingIndex()) { if (!m_connectedInitSignals) { - connect(m_helpEngine->contentModel(), SIGNAL(contentsCreated()), + connect(helpEngine.contentModel(), SIGNAL(contentsCreated()), this, SLOT(checkInitState())); - connect(m_helpEngine->indexModel(), SIGNAL(indexCreated()), this, + connect(helpEngine.indexModel(), SIGNAL(indexCreated()), this, SLOT(checkInitState())); m_connectedInitSignals = true; } } else { if (m_connectedInitSignals) { - disconnect(m_helpEngine->contentModel(), 0, this, 0); - disconnect(m_helpEngine->indexModel(), 0, this, 0); + disconnect(helpEngine.contentModel(), 0, this, 0); + disconnect(helpEngine.indexModel(), 0, this, 0); } emit initDone(); } @@ -663,7 +653,8 @@ QMenu *MainWindow::toolBarMenu() void MainWindow::setupFilterToolbar() { - if (!CollectionConfiguration::filterFunctionalityEnabled(*m_helpEngine)) + HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); + if (!helpEngine.filterFunctionalityEnabled()) return; m_filterCombo = new QComboBox(this); @@ -676,15 +667,15 @@ void MainWindow::setupFilterToolbar() this)); filterToolBar->addWidget(m_filterCombo); - if (!CollectionConfiguration::filterToolbarVisible(*m_helpEngine)) + if (!helpEngine.filterToolbarVisible()) filterToolBar->hide(); toolBarMenu()->addAction(filterToolBar->toggleViewAction()); - connect(m_helpEngine, SIGNAL(setupFinished()), this, - SLOT(setupFilterCombo())); + connect(&helpEngine, SIGNAL(setupFinished()), this, + SLOT(setupFilterCombo()), Qt::QueuedConnection); connect(m_filterCombo, SIGNAL(activated(QString)), this, SLOT(filterDocumentation(QString))); - connect(m_helpEngine, SIGNAL(currentFilterChanged(QString)), this, + connect(&helpEngine, SIGNAL(currentFilterChanged(QString)), this, SLOT(currentFilterChanged(QString))); setupFilterCombo(); @@ -692,7 +683,8 @@ void MainWindow::setupFilterToolbar() void MainWindow::setupAddressToolbar() { - if (!CollectionConfiguration::addressBarEnabled(*m_helpEngine)) + HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); + if (!helpEngine.addressBarEnabled()) return; m_addressLineEdit = new QLineEdit(this); @@ -704,7 +696,7 @@ void MainWindow::setupAddressToolbar() this)); addressToolBar->addWidget(m_addressLineEdit); - if (!CollectionConfiguration::addressBarVisible(*m_helpEngine)) + if (!helpEngine.addressBarVisible()) addressToolBar->hide(); toolBarMenu()->addAction(addressToolBar->toggleViewAction()); @@ -719,30 +711,28 @@ void MainWindow::setupAddressToolbar() void MainWindow::updateAboutMenuText() { - if (m_helpEngine) { - QByteArray ba = CollectionConfiguration::aboutMenuTexts(*m_helpEngine); - if (ba.size() > 0) { - QString lang; - QString str; - QString trStr; - QString currentLang = QLocale::system().name(); - int i = currentLang.indexOf(QLatin1Char('_')); - if (i > -1) - currentLang = currentLang.left(i); - QDataStream s(&ba, QIODevice::ReadOnly); - while (!s.atEnd()) { - s >> lang; - s >> str; - if (lang == QLatin1String("default") && trStr.isEmpty()) { - trStr = str; - } else if (lang == currentLang) { - trStr = str; - break; - } + QByteArray ba = HelpEngineWrapper::instance().aboutMenuTexts(); + if (ba.size() > 0) { + QString lang; + QString str; + QString trStr; + QString currentLang = QLocale::system().name(); + int i = currentLang.indexOf(QLatin1Char('_')); + if (i > -1) + currentLang = currentLang.left(i); + QDataStream s(&ba, QIODevice::ReadOnly); + while (!s.atEnd()) { + s >> lang; + s >> str; + if (lang == QLatin1String("default") && trStr.isEmpty()) { + trStr = str; + } else if (lang == currentLang) { + trStr = str; + break; } - if (!trStr.isEmpty()) - m_aboutAction->setText(trStr); } + if (!trStr.isEmpty()) + m_aboutAction->setText(trStr); } } @@ -796,7 +786,7 @@ void MainWindow::showTopicChooser(const QMap &links, void MainWindow::showPreferences() { - PreferencesDialog dia(m_helpEngine, m_qchWatcher, this); + PreferencesDialog dia(this); connect(&dia, SIGNAL(updateApplicationFont()), this, SLOT(updateApplicationFont())); @@ -832,26 +822,25 @@ void MainWindow::addNewBookmark(const QString &title, const QString &url) void MainWindow::showAboutDialog() { + HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); QByteArray contents; - if (m_helpEngine) { - QByteArray ba = CollectionConfiguration::aboutTexts(*m_helpEngine); - if (!ba.isEmpty()) { - QString lang; - QByteArray cba; - QString currentLang = QLocale::system().name(); - int i = currentLang.indexOf(QLatin1Char('_')); - if (i > -1) - currentLang = currentLang.left(i); - QDataStream s(&ba, QIODevice::ReadOnly); - while (!s.atEnd()) { - s >> lang; - s >> cba; - if (lang == QLatin1String("default") && contents.isEmpty()) { - contents = cba; - } else if (lang == currentLang) { - contents = cba; - break; - } + QByteArray ba = helpEngine.aboutTexts(); + if (!ba.isEmpty()) { + QString lang; + QByteArray cba; + QString currentLang = QLocale::system().name(); + int i = currentLang.indexOf(QLatin1Char('_')); + if (i > -1) + currentLang = currentLang.left(i); + QDataStream s(&ba, QIODevice::ReadOnly); + while (!s.atEnd()) { + s >> lang; + s >> cba; + if (lang == QLatin1String("default") && contents.isEmpty()) { + contents = cba; + } else if (lang == currentLang) { + contents = cba; + break; } } } @@ -860,9 +849,8 @@ void MainWindow::showAboutDialog() QByteArray iconArray; if (!contents.isEmpty()) { - iconArray = CollectionConfiguration::aboutIcon(*m_helpEngine); - QByteArray resources = - CollectionConfiguration::aboutImages(*m_helpEngine); + iconArray = helpEngine.aboutIcon(); + QByteArray resources = helpEngine.aboutImages(); QPixmap pix; pix.loadFromData(iconArray); aboutDia.setText(QString::fromUtf8(contents), resources); @@ -990,20 +978,22 @@ void MainWindow::showSearchWidget() void MainWindow::updateApplicationFont() { + HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); QFont font = qApp->font(); - if (CollectionConfiguration::usesAppFont(*m_helpEngine)) - font = CollectionConfiguration::appFont(*m_helpEngine); + if (helpEngine.usesAppFont()) + font = helpEngine.appFont(); qApp->setFont(font, "QWidget"); } void MainWindow::setupFilterCombo() { + HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); QString curFilter = m_filterCombo->currentText(); if (curFilter.isEmpty()) - curFilter = m_helpEngine->currentFilter(); + curFilter = helpEngine.currentFilter(); m_filterCombo->clear(); - m_filterCombo->addItems(m_helpEngine->customFilters()); + m_filterCombo->addItems(helpEngine.customFilters()); int idx = m_filterCombo->findText(curFilter); if (idx < 0) idx = 0; @@ -1012,7 +1002,7 @@ void MainWindow::setupFilterCombo() void MainWindow::filterDocumentation(const QString &customFilter) { - m_helpEngine->setCurrentFilter(customFilter); + HelpEngineWrapper::instance().setCurrentFilter(customFilter); } void MainWindow::expandTOC(int depth) @@ -1055,7 +1045,7 @@ void MainWindow::indexingFinished() QWidget* MainWindow::setupBookmarkWidget() { - m_bookmarkManager = new BookmarkManager(m_helpEngine); + m_bookmarkManager = new BookmarkManager; m_bookmarkWidget = new BookmarkWidget(m_bookmarkManager, this); connect(m_bookmarkWidget, SIGNAL(addBookmark()), this, SLOT(addBookmark())); return m_bookmarkWidget; @@ -1135,33 +1125,45 @@ void MainWindow::currentFilterChanged(const QString &filter) m_filterCombo->setCurrentIndex(index); } -void MainWindow::qchFileChanged(const QString &fileName) +void MainWindow::documentationRemoved(const QString &namespaceName) { - /* - * We don't use QHelpEngineCore::namespaceName(fileName), because the file - * may not exist anymore or contain a different namespace. - */ - QString ns; - foreach (const QString &curNs, m_helpEngine->registeredDocumentations()) { - if (m_helpEngine->documentationFileName(curNs) == fileName) { - ns = curNs; - break; - } - } + CentralWidget* widget = CentralWidget::instance(); + widget->closeTabs(widget->currentSourceFileList().keys(namespaceName)); +} + +void MainWindow::documentationUpdated(const QString &namespaceName) +{ + // TODO: Check whether the documents still exists and if they do, reload. + CentralWidget* widget = CentralWidget::instance(); + widget->closeTabs(widget->currentSourceFileList().keys(namespaceName)); +} - /* - * We can't do an assertion here, because QFileSystemWatcher may send the - * signal more than once. - */ +void MainWindow::resetQtDocInfo(const QString &component) +{ + HelpEngineWrapper::instance().setQtDocInfo(component, + QStringList(QDateTime().toString(Qt::ISODate))); +} + +void MainWindow::registerDocumentation(const QString &component, + const QString &absFileName) +{ + QString ns = QHelpEngineCore::namespaceName(absFileName); if (ns.isEmpty()) return; - CentralWidget* widget = CentralWidget::instance(); - widget->closeTabs(widget->currentSourceFileList().keys(ns)); - if (m_helpEngine->unregisterDocumentation(ns) && - (!QFileInfo(fileName).exists() - || !m_helpEngine->registerDocumentation(fileName))) - m_qchWatcher->removePath(fileName); + HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); + if (helpEngine.registeredDocumentations().contains(ns)) + helpEngine.unregisterDocumentation(ns); + if (!helpEngine.registerDocumentation(absFileName)) { + QMessageBox::warning(this, tr("Qt Assistant"), + tr("Could not register file '%1': %2"). + arg(absFileName).arg(helpEngine.error())); + } else { + QStringList docInfo; + docInfo << QFileInfo(absFileName).lastModified().toString(Qt::ISODate) + << absFileName; + helpEngine.setQtDocInfo(component, docInfo); + } } QT_END_NAMESPACE diff --git a/tools/assistant/tools/assistant/mainwindow.h b/tools/assistant/tools/assistant/mainwindow.h index 6a0ab58..65eadd7 100644 --- a/tools/assistant/tools/assistant/mainwindow.h +++ b/tools/assistant/tools/assistant/mainwindow.h @@ -117,10 +117,13 @@ private slots: void lookForNewQtDocumentation(); void indexingStarted(); void indexingFinished(); - void displayInstallationError(const QString &errorMessage); void qtDocumentationInstalled(bool newDocsInstalled); + void registerDocumentation(const QString &component, + const QString &absFileName); + void resetQtDocInfo(const QString &component); void checkInitState(); - void qchFileChanged(const QString &fileName); + void documentationRemoved(const QString &namespaceName); + void documentationUpdated(const QString &namespaceName); void updateBookmarkMenu(); void showBookmark(QAction *action); @@ -143,7 +146,6 @@ private: void hideBookmarks(); void hideSearch(); - QHelpEngine *m_helpEngine; CentralWidget *m_centralWidget; IndexWindow *m_indexWindow; ContentWindow *m_contentWindow; @@ -179,7 +181,6 @@ private: QWidget *m_progressWidget; QtDocInstaller *m_qtDocInstaller; - QFileSystemWatcher * const m_qchWatcher; bool m_connectedInitSignals; }; diff --git a/tools/assistant/tools/assistant/preferencesdialog.cpp b/tools/assistant/tools/assistant/preferencesdialog.cpp index 10d6dd9..2f282b1 100644 --- a/tools/assistant/tools/assistant/preferencesdialog.cpp +++ b/tools/assistant/tools/assistant/preferencesdialog.cpp @@ -45,7 +45,7 @@ #include "fontpanel.h" #include "centralwidget.h" #include "aboutdialog.h" -#include "../shared/collectionconfiguration.h" +#include "helpenginewrapper.h" #include #include @@ -62,13 +62,11 @@ QT_BEGIN_NAMESPACE -PreferencesDialog::PreferencesDialog(QHelpEngineCore *helpEngine, - QFileSystemWatcher *qchWatcher, QWidget *parent) +PreferencesDialog::PreferencesDialog(QWidget *parent) : QDialog(parent) - , m_helpEngine(helpEngine) , m_appFontChanged(false) , m_browserFontChanged(false) - , m_qchWatcher(qchWatcher) + , helpEngine(HelpEngineWrapper::instance()) { m_ui.setupUi(this); @@ -77,10 +75,8 @@ PreferencesDialog::PreferencesDialog(QHelpEngineCore *helpEngine, connect(m_ui.buttonBox->button(QDialogButtonBox::Cancel), SIGNAL(clicked()), this, SLOT(reject())); - m_hideFiltersTab = - !CollectionConfiguration::filterFunctionalityEnabled(*m_helpEngine); - m_hideDocsTab = - !CollectionConfiguration::documentationManagerEnabled(*m_helpEngine); + m_hideFiltersTab = !helpEngine.filterFunctionalityEnabled(); + m_hideDocsTab = !helpEngine.documentationManagerEnabled(); if (!m_hideFiltersTab) { m_ui.attributeWidget->header()->hide(); @@ -109,7 +105,7 @@ PreferencesDialog::PreferencesDialog(QHelpEngineCore *helpEngine, connect(m_ui.docRemoveButton, SIGNAL(clicked()), this, SLOT(removeDocumentation())); - m_docsBackup = m_helpEngine->registeredDocumentations(); + m_docsBackup = helpEngine.registeredDocumentations(); m_ui.registeredDocsListWidget->addItems(m_docsBackup); } else { m_ui.tabWidget->removeTab(m_ui.tabWidget->indexOf(m_ui.docsTab)); @@ -122,21 +118,15 @@ PreferencesDialog::PreferencesDialog(QHelpEngineCore *helpEngine, PreferencesDialog::~PreferencesDialog() { if (m_appFontChanged) { - CollectionConfiguration::setAppFont(*m_helpEngine, - m_appFontPanel->selectedFont()); - CollectionConfiguration::setUseAppFont(*m_helpEngine, - m_appFontPanel->isChecked()); - CollectionConfiguration::setAppWritingSystem(*m_helpEngine, - m_appFontPanel->writingSystem()); + helpEngine.setAppFont(m_appFontPanel->selectedFont()); + helpEngine.setUseAppFont(m_appFontPanel->isChecked()); + helpEngine.setAppWritingSystem(m_appFontPanel->writingSystem()); } if (m_browserFontChanged) { - CollectionConfiguration::setBrowserFont(*m_helpEngine, - m_browserFontPanel->selectedFont()); - CollectionConfiguration::setUseBrowserFont(*m_helpEngine, - m_browserFontPanel->isChecked()); - CollectionConfiguration::setBrowserWritingSystem(*m_helpEngine, - m_browserFontPanel->writingSystem()); + helpEngine.setBrowserFont(m_browserFontPanel->selectedFont()); + helpEngine.setUseBrowserFont(m_browserFontPanel->isChecked()); + helpEngine.setBrowserWritingSystem(m_browserFontPanel->writingSystem()); } if (m_appFontChanged || m_browserFontChanged) { @@ -147,10 +137,10 @@ PreferencesDialog::~PreferencesDialog() QString homePage = m_ui.homePageLineEdit->text(); if (homePage.isEmpty()) homePage = QLatin1String("help"); - CollectionConfiguration::setHomePage(*m_helpEngine, homePage); + helpEngine.setHomePage(homePage); int option = m_ui.helpStartComboBox->currentIndex(); - CollectionConfiguration::setStartOption(*m_helpEngine, option); + helpEngine.setStartOption(option); } void PreferencesDialog::showDialog() @@ -161,18 +151,13 @@ void PreferencesDialog::showDialog() void PreferencesDialog::updateFilterPage() { - if (!m_helpEngine) - return; - m_ui.filterWidget->clear(); m_ui.attributeWidget->clear(); - QHelpEngineCore help(m_helpEngine->collectionFile(), 0); - help.setupData(); m_filterMapBackup.clear(); - const QStringList filters = help.customFilters(); + const QStringList filters = helpEngine.customFilters(); foreach (const QString &filter, filters) { - QStringList atts = help.filterAttributes(filter); + QStringList atts = helpEngine.filterAttributes(filter); m_filterMapBackup.insert(filter, atts); if (!m_filterMap.contains(filter)) m_filterMap.insert(filter, atts); @@ -180,10 +165,10 @@ void PreferencesDialog::updateFilterPage() m_ui.filterWidget->addItems(m_filterMap.keys()); - foreach (const QString &a, help.filterAttributes()) + foreach (const QString &a, helpEngine.filterAttributes()) new QTreeWidgetItem(m_ui.attributeWidget, QStringList() << a); - if (m_filterMap.keys().count()) + if (!m_filterMap.keys().isEmpty()) m_ui.filterWidget->setCurrentRow(0); } @@ -273,14 +258,11 @@ void PreferencesDialog::addDocumentationLocal() continue; } - if (m_helpEngine->registerDocumentation(fileName)) { - m_qchWatcher->addPath(fileName); - Q_ASSERT(m_qchWatcher->files().count() - == m_helpEngine->registeredDocumentations().count()); + if (helpEngine.registerDocumentation(fileName)) { + m_ui.registeredDocsListWidget->addItem(nameSpace); + m_regDocs.append(nameSpace); + m_unregDocs.removeAll(nameSpace); } - m_ui.registeredDocsListWidget->addItem(nameSpace); - m_regDocs.append(nameSpace); - m_unregDocs.removeAll(nameSpace); } if (!invalidFiles.isEmpty() || !alreadyRegistered.isEmpty()) { @@ -372,26 +354,21 @@ void PreferencesDialog::applyChanges() if (filtersWereChanged) { foreach (const QString &filter, m_removedFilters) - m_helpEngine->removeCustomFilter(filter); + helpEngine.removeCustomFilter(filter); QMapIterator it(m_filterMap); while (it.hasNext()) { it.next(); - m_helpEngine->addCustomFilter(it.key(), it.value()); + helpEngine.addCustomFilter(it.key(), it.value()); } } CentralWidget::instance()->closeTabs(m_TabsToClose); - foreach (const QString &doc, m_unregDocs) { - const QString docFile = m_helpEngine->documentationFileName(doc); - if (m_helpEngine->unregisterDocumentation(doc)) - m_qchWatcher->removePath(docFile); - } - Q_ASSERT(m_qchWatcher->files().count() - == m_helpEngine->registeredDocumentations().count()); + foreach (const QString &doc, m_unregDocs) + helpEngine.unregisterDocumentation(doc); - if (filtersWereChanged || m_regDocs.count() || m_unregDocs.count()) - m_helpEngine->setupData(); + if (filtersWereChanged || !m_regDocs.isEmpty() || !m_unregDocs.isEmpty()) + helpEngine.setupData(); accept(); } @@ -411,26 +388,23 @@ void PreferencesDialog::updateFontSettingsPage() const QString customSettings(tr("Use custom settings")); m_appFontPanel->setTitle(customSettings); - QFont font = CollectionConfiguration::appFont(*m_helpEngine); + QFont font = helpEngine.appFont(); m_appFontPanel->setSelectedFont(font); - QFontDatabase::WritingSystem system = - CollectionConfiguration::appWritingSystem(*m_helpEngine); + QFontDatabase::WritingSystem system = helpEngine.appWritingSystem(); m_appFontPanel->setWritingSystem(system); - m_appFontPanel->setChecked(CollectionConfiguration:: - usesAppFont(*m_helpEngine)); + m_appFontPanel->setChecked(helpEngine.usesAppFont()); m_browserFontPanel->setTitle(customSettings); - font = CollectionConfiguration::browserFont(*m_helpEngine); + font = helpEngine.browserFont(); m_browserFontPanel->setSelectedFont(font); - system = CollectionConfiguration::browserWritingSystem(*m_helpEngine); + system = helpEngine.browserWritingSystem(); m_browserFontPanel->setWritingSystem(system); - m_browserFontPanel->setChecked(CollectionConfiguration:: - usesBrowserFont(*m_helpEngine)); + m_browserFontPanel->setChecked(helpEngine.usesBrowserFont()); connect(m_appFontPanel, SIGNAL(toggled(bool)), this, SLOT(appFontSettingToggled(bool))); @@ -476,12 +450,9 @@ void PreferencesDialog::browserFontSettingChanged(int index) void PreferencesDialog::updateOptionsPage() { - QString homePage = CollectionConfiguration::homePage(*m_helpEngine); - if (homePage.isEmpty()) - homePage = CollectionConfiguration::defaultHomePage(*m_helpEngine); - m_ui.homePageLineEdit->setText(homePage); + m_ui.homePageLineEdit->setText(helpEngine.homePage()); - int option = CollectionConfiguration::startOption(*m_helpEngine); + int option = helpEngine.startOption(); m_ui.helpStartComboBox->setCurrentIndex(option); connect(m_ui.blankPageButton, SIGNAL(clicked()), this, SLOT(setBlankPage())); @@ -505,8 +476,7 @@ void PreferencesDialog::setCurrentPage() void PreferencesDialog::setDefaultPage() { - QString homePage = CollectionConfiguration::defaultHomePage(*m_helpEngine); - m_ui.homePageLineEdit->setText(homePage); + m_ui.homePageLineEdit->setText(helpEngine.defaultHomePage()); } QT_END_NAMESPACE diff --git a/tools/assistant/tools/assistant/preferencesdialog.h b/tools/assistant/tools/assistant/preferencesdialog.h index 7abf431..1554a9f 100644 --- a/tools/assistant/tools/assistant/preferencesdialog.h +++ b/tools/assistant/tools/assistant/preferencesdialog.h @@ -48,22 +48,15 @@ QT_BEGIN_NAMESPACE class FontPanel; +class HelpEngineWrapper; class QFileSystemWatcher; -class QHelpEngineCore; - -enum { - ShowHomePage = 0, - ShowBlankPage = 1, - ShowLastPages = 2 -}; class PreferencesDialog : public QDialog { Q_OBJECT public: - PreferencesDialog(QHelpEngineCore *helpEngine, - QFileSystemWatcher *qchWatcher, QWidget *parent = 0); + PreferencesDialog(QWidget *parent = 0); ~PreferencesDialog(); void showDialog(); @@ -95,7 +88,6 @@ private: void updateOptionsPage(); Ui::PreferencesDialogClass m_ui; - QHelpEngineCore *m_helpEngine; bool m_hideFiltersTab; bool m_hideDocsTab; QMap m_filterMapBackup; @@ -109,7 +101,7 @@ private: FontPanel *m_browserFontPanel; bool m_appFontChanged; bool m_browserFontChanged; - QFileSystemWatcher * const m_qchWatcher; + HelpEngineWrapper &helpEngine; }; QT_END_NAMESPACE diff --git a/tools/assistant/tools/assistant/qtdocinstaller.cpp b/tools/assistant/tools/assistant/qtdocinstaller.cpp index 3f82786..3675aec 100644 --- a/tools/assistant/tools/assistant/qtdocinstaller.cpp +++ b/tools/assistant/tools/assistant/qtdocinstaller.cpp @@ -44,17 +44,14 @@ #include #include #include -#include "../shared/collectionconfiguration.h" +#include "helpenginewrapper.h" #include "qtdocinstaller.h" QT_BEGIN_NAMESPACE -QtDocInstaller::QtDocInstaller(const QString &collectionFile, - QFileSystemWatcher *qchWatcher) - : m_qchWatcher(qchWatcher) +QtDocInstaller::QtDocInstaller(const QList &docInfos) + : m_abort(false), m_docInfos(docInfos) { - m_abort = false; - m_collectionFile = collectionFile; } QtDocInstaller::~QtDocInstaller() @@ -74,87 +71,51 @@ void QtDocInstaller::installDocs() void QtDocInstaller::run() { - QHelpEngineCore *helpEngine = new QHelpEngineCore(m_collectionFile); - helpEngine->setupData(); - bool changes = false; - - QStringList docs; - docs << QLatin1String("assistant") - << QLatin1String("designer") - << QLatin1String("linguist") - << QLatin1String("qmake") - << QLatin1String("qt"); + m_qchDir = QLibraryInfo::location(QLibraryInfo::DocumentationPath) + + QDir::separator() + QLatin1String("qch"); + m_qchFiles = m_qchDir.entryList(QStringList() << QLatin1String("*.qch")); - foreach (const QString &doc, docs) { - changes |= installDoc(doc, helpEngine); + bool changes = false; + foreach (const DocInfo &docInfo, m_docInfos) { + changes |= installDoc(docInfo); m_mutex.lock(); if (m_abort) { - delete helpEngine; m_mutex.unlock(); return; } m_mutex.unlock(); } - delete helpEngine; emit docsInstalled(changes); } -bool QtDocInstaller::installDoc(const QString &name, QHelpEngineCore *helpEngine) +bool QtDocInstaller::installDoc(const DocInfo &docInfo) { - QStringList lst = CollectionConfiguration::qtDocInfo(*helpEngine, name); - + const QString &component = docInfo.first; + const QStringList &info = docInfo.second; QDateTime dt; - if (!lst.isEmpty() && !lst.first().isEmpty()) - dt = QDateTime::fromString(lst.first(), Qt::ISODate); + if (!info.isEmpty() && !info.first().isEmpty()) + dt = QDateTime::fromString(info.first(), Qt::ISODate); QString qchFile; - if (lst.count() == 2) - qchFile = lst.last(); - - QDir dir(QLibraryInfo::location(QLibraryInfo::DocumentationPath) - + QDir::separator() + QLatin1String("qch")); + if (info.count() == 2) + qchFile = info.last(); - const QStringList files = dir.entryList(QStringList() << QLatin1String("*.qch")); - if (files.isEmpty()) { - CollectionConfiguration::setQtDocInfo(*helpEngine, name, - QStringList(QDateTime().toString(Qt::ISODate))); + if (m_qchFiles.isEmpty()) { + emit qchFileNotFound(component); return false; } - foreach (const QString &f, files) { - if (f.startsWith(name)) { - QFileInfo fi(dir.absolutePath() + QDir::separator() + f); + foreach (const QString &f, m_qchFiles) { + if (f.startsWith(component)) { + QFileInfo fi(m_qchDir.absolutePath() + QDir::separator() + f); if (dt.isValid() && fi.lastModified().toTime_t() == dt.toTime_t() && qchFile == fi.absoluteFilePath()) return false; - - QString namespaceName = QHelpEngineCore::namespaceName(fi.absoluteFilePath()); - if (namespaceName.isEmpty()) - continue; - - if (helpEngine->registeredDocumentations().contains(namespaceName)) { - const QString docFile = - helpEngine->documentationFileName(namespaceName); - if (helpEngine->unregisterDocumentation(namespaceName)) - m_qchWatcher->removePath(docFile); - } - - if (!helpEngine->registerDocumentation(fi.absoluteFilePath())) { - emit errorMessage( - tr("The file %1 could not be registered successfully!\n\nReason: %2") - .arg(fi.absoluteFilePath()).arg(helpEngine->error())); - } else { - m_qchWatcher->addPath(fi.absoluteFilePath()); - } - - Q_ASSERT(m_qchWatcher->files().count() - == helpEngine->registeredDocumentations().count()); - - CollectionConfiguration::setQtDocInfo(*helpEngine, name, - QStringList() << fi.lastModified().toString(Qt::ISODate) - << fi.absoluteFilePath()); + emit registerDocumentation(component, fi.absoluteFilePath()); return true; } } + + emit qchFileNotFound(component); return false; } diff --git a/tools/assistant/tools/assistant/qtdocinstaller.h b/tools/assistant/tools/assistant/qtdocinstaller.h index 0d503fd..c64a5c3 100644 --- a/tools/assistant/tools/assistant/qtdocinstaller.h +++ b/tools/assistant/tools/assistant/qtdocinstaller.h @@ -42,36 +42,41 @@ #ifndef QTDOCINSTALLER #define QTDOCINSTALLER -#include +#include #include +#include +#include +#include QT_BEGIN_NAMESPACE -class QFileSystemWatcher; -class QHelpEngineCore; +class HelpEngineWrapper; class QtDocInstaller : public QThread { Q_OBJECT public: - QtDocInstaller(const QString &collectionFile, QFileSystemWatcher *qchWatcher); + typedef QPair DocInfo; + QtDocInstaller(const QList &docInfos); ~QtDocInstaller(); void installDocs(); signals: - void errorMessage(const QString &msg); + void qchFileNotFound(const QString &component); + void registerDocumentation(const QString &component, + const QString &absFileName); void docsInstalled(bool newDocsInstalled); private: void run(); - bool installDoc(const QString &name, - QHelpEngineCore *helpEngine); + bool installDoc(const DocInfo &docInfo); bool m_abort; - QString m_collectionFile; QMutex m_mutex; - QFileSystemWatcher * const m_qchWatcher; + QStringList m_qchFiles; + QDir m_qchDir; + QList m_docInfos; }; QT_END_NAMESPACE diff --git a/tools/assistant/tools/assistant/remotecontrol.cpp b/tools/assistant/tools/assistant/remotecontrol.cpp index ef13885..f4ae3b4 100644 --- a/tools/assistant/tools/assistant/remotecontrol.cpp +++ b/tools/assistant/tools/assistant/remotecontrol.cpp @@ -42,6 +42,7 @@ #include "remotecontrol.h" #include "mainwindow.h" #include "centralwidget.h" +#include "helpenginewrapper.h" #include #include @@ -106,16 +107,14 @@ void StdInListenerWin::run() } #endif -RemoteControl::RemoteControl(MainWindow *mainWindow, QHelpEngine *helpEngine, - QFileSystemWatcher *qchWatcher) +RemoteControl::RemoteControl(MainWindow *mainWindow) : QObject(mainWindow) , m_mainWindow(mainWindow) - , m_helpEngine(helpEngine) , m_debug(false) , m_caching(true) , m_syncContents(false) , m_expandTOC(-2) - , m_qchWatcher(qchWatcher) + , helpEngine(HelpEngineWrapper::instance()) { connect(m_mainWindow, SIGNAL(initDone()), this, SLOT(applyCache())); @@ -248,7 +247,7 @@ void RemoteControl::handleActivateKeywordCommand(const QString &arg) } else { m_mainWindow->setIndexString(arg); if (!arg.isEmpty()) - m_helpEngine->indexWidget()->activateCurrentItem(); + helpEngine.indexWidget()->activateCurrentItem(); } } @@ -258,8 +257,7 @@ void RemoteControl::handleActivateIdentifierCommand(const QString &arg) clearCache(); m_activateIdentifier = arg; } else { - const QMap &links = - m_helpEngine->linksForIdentifier(arg); + const QMap &links = helpEngine.linksForIdentifier(arg); if (!links.isEmpty()) CentralWidget::instance()->setSource(links.constBegin().value()); } @@ -282,12 +280,12 @@ void RemoteControl::handleExpandTocCommand(const QString &arg) void RemoteControl::handleSetCurrentFilterCommand(const QString &arg) { - if (m_helpEngine->customFilters().contains(arg)) { + if (helpEngine.customFilters().contains(arg)) { if (m_caching) { clearCache(); m_currentFilter = arg; } else { - m_helpEngine->setCurrentFilter(arg); + helpEngine.setCurrentFilter(arg); } } } @@ -295,29 +293,22 @@ void RemoteControl::handleSetCurrentFilterCommand(const QString &arg) void RemoteControl::handleRegisterCommand(const QString &arg) { const QString &absFileName = QFileInfo(arg).absoluteFilePath(); - if (m_helpEngine->registeredDocumentations(). + if (helpEngine.registeredDocumentations(). contains(QHelpEngineCore::namespaceName(absFileName))) return; - if (m_helpEngine->registerDocumentation(absFileName)) { - m_qchWatcher->addPath(absFileName); - m_helpEngine->setupData(); - Q_ASSERT(m_qchWatcher->files().count() - == m_helpEngine->registeredDocumentations().count()); - } + if (helpEngine.registerDocumentation(absFileName)) + helpEngine.setupData(); } void RemoteControl::handleUnregisterCommand(const QString &arg) { const QString &absFileName = QFileInfo(arg).absoluteFilePath(); const QString &ns = QHelpEngineCore::namespaceName(absFileName); - if (m_helpEngine->registeredDocumentations().contains(ns)) { + if (helpEngine.registeredDocumentations().contains(ns)) { CentralWidget* widget = CentralWidget::instance(); widget->closeTabs(widget->currentSourceFileList().keys(ns)); - const QString docFile = m_helpEngine->documentationFileName(ns); - if (m_helpEngine->unregisterDocumentation(ns)) { - m_qchWatcher->removePath(docFile); - m_helpEngine->setupData(); - } + if (helpEngine.unregisterDocumentation(ns)) + helpEngine.setupData(); } } @@ -327,14 +318,14 @@ void RemoteControl::applyCache() CentralWidget::instance()->setSource(m_setSource); } else if (!m_activateKeyword.isEmpty()) { m_mainWindow->setIndexString(m_activateKeyword); - m_helpEngine->indexWidget()->activateCurrentItem(); + helpEngine.indexWidget()->activateCurrentItem(); } else if (!m_activateIdentifier.isEmpty()) { QMap links = - m_helpEngine->linksForIdentifier(m_activateIdentifier); - if (links.count()) + helpEngine.linksForIdentifier(m_activateIdentifier); + if (!links.isEmpty()) CentralWidget::instance()->setSource(links.constBegin().value()); } else if (!m_currentFilter.isEmpty()) { - m_helpEngine->setCurrentFilter(m_currentFilter); + helpEngine.setCurrentFilter(m_currentFilter); } if (m_syncContents) diff --git a/tools/assistant/tools/assistant/remotecontrol.h b/tools/assistant/tools/assistant/remotecontrol.h index 6f7eb5f..5d74996 100644 --- a/tools/assistant/tools/assistant/remotecontrol.h +++ b/tools/assistant/tools/assistant/remotecontrol.h @@ -48,17 +48,15 @@ QT_BEGIN_NAMESPACE +class HelpEngineWrapper; class MainWindow; -class QFileSystemWatcher; -class QHelpEngine; class RemoteControl : public QObject { Q_OBJECT public: - RemoteControl(MainWindow *mainWindow, QHelpEngine *helpEngine, - QFileSystemWatcher *qchWatcher); + RemoteControl(MainWindow *mainWindow); private slots: void receivedData(); @@ -81,7 +79,6 @@ private: private: MainWindow *m_mainWindow; - QHelpEngine *m_helpEngine; bool m_debug; bool m_caching; @@ -91,7 +88,7 @@ private: QString m_activateIdentifier; int m_expandTOC; QString m_currentFilter; - QFileSystemWatcher * const m_qchWatcher; + HelpEngineWrapper &helpEngine; }; QT_END_NAMESPACE diff --git a/tools/assistant/tools/assistant/tracer.h b/tools/assistant/tools/assistant/tracer.h index 913c961..3d8b647 100644 --- a/tools/assistant/tools/assistant/tracer.h +++ b/tools/assistant/tools/assistant/tracer.h @@ -65,6 +65,7 @@ private: QT_END_NAMESPACE +// #define TRACING_REQUESTED #ifdef TRACING_REQUESTED #define TRACE_OBJ Tracer traceObj__(Q_FUNC_INFO); #else diff --git a/tools/assistant/tools/qcollectiongenerator/main.cpp b/tools/assistant/tools/qcollectiongenerator/main.cpp index 2eb2b96..467ee88 100644 --- a/tools/assistant/tools/qcollectiongenerator/main.cpp +++ b/tools/assistant/tools/qcollectiongenerator/main.cpp @@ -467,8 +467,7 @@ int main(int argc, char *argv[]) } if (!config.currentFilter().isEmpty()) { - CollectionConfiguration::setCurrentFilter(helpEngine, - config.currentFilter()); + helpEngine.setCurrentFilter(config.currentFilter()); } if (!config.cacheDirectory().isEmpty()) { diff --git a/tools/assistant/tools/shared/collectionconfiguration.cpp b/tools/assistant/tools/shared/collectionconfiguration.cpp index d0650e4..ba643c9 100644 --- a/tools/assistant/tools/shared/collectionconfiguration.cpp +++ b/tools/assistant/tools/shared/collectionconfiguration.cpp @@ -46,30 +46,21 @@ QT_BEGIN_NAMESPACE namespace { - const QString ListSeparator(QLatin1String("|")); - const QString AboutIconKey(QLatin1String("AboutIcon")); const QString AboutImagesKey(QLatin1String("AboutImages")); const QString AboutMenuTextsKey(QLatin1String("AboutMenuTexts")); const QString AboutTextsKey(QLatin1String("AboutTexts")); - const QString AppFontKey(QLatin1String("appFont")); const QString ApplicationIconKey(QLatin1String("ApplicationIcon")); - const QString AppWritingSystemKey(QLatin1String("appWritingSystem")); - const QString BookmarksKey(QLatin1String("Bookmarks")); - const QString BrowserFontKey(QLatin1String("browserFont")); - const QString BrowserWritingSystemKey(QLatin1String("browserWritingSystem")); const QString CacheDirKey(QLatin1String("CacheDirectory")); const QString CacheDirRelativeToCollectionKey(QLatin1String("CacheDirRelativeToCollection")); const QString CreationTimeKey(QLatin1String("CreationTime")); - const QString CurrentFilterKey(QLatin1String("CurrentFilter")); const QString DefaultHomePageKey(QLatin1String("defaultHomepage")); const QString DocUpdatePendingKey(QLatin1String("DocUpdate")); const QString EnableAddressBarKey(QLatin1String("EnableAddressBar")); const QString EnableDocManagerKey(QLatin1String("EnableDocumentationManager")); const QString EnableFilterKey(QLatin1String("EnableFilterFunctionality")); - const QString FilterToolbarHiddenKey(QLatin1String("HideFilterFunctionality")); const QString HideAddressBarKey(QLatin1String("HideAddressBar")); - const QString HomePageKey(QLatin1String("homepage")); + const QString FilterToolbarHiddenKey(QLatin1String("HideFilterFunctionality")); const QString LastPageKey(QLatin1String("LastTabPage")); const QString LastShownPagesKey(QLatin1String("LastShownPages")); const QString LastZoomFactorsKey(QLatin1String( @@ -79,19 +70,11 @@ namespace { "LastPagesZoomTextBrowser" #endif )); - const QString MainWindowKey(QLatin1String("MainWindow")); - const QString MainWindowGeometryKey(QLatin1String("MainWindowGeometry")); - const QString SearchWasAttachedKey(QLatin1String("SearchWasAttached")); - const QString StartOptionKey(QLatin1String("StartOption")); - const QString UnfilteredInsertedKey(QLatin1String("UnfilteredFilterInserted")); - const QString UseAppFontKey(QLatin1String("useAppFont")); - const QString UseBrowserFontKey(QLatin1String("useBrowserFont")); - const QString VersionKey(QString(QLatin1String("qtVersion%1$$$%2")). - arg(QLatin1String(QT_VERSION_STR))); const QString WindowTitleKey(QLatin1String("WindowTitle")); } // anonymous namespace const QString CollectionConfiguration::DefaultZoomFactor(QLatin1String("0.0")); +const QString CollectionConfiguration::ListSeparator(QLatin1String("|")); uint CollectionConfiguration::creationTime(const QHelpEngineCore &helpEngine) { @@ -109,84 +92,18 @@ const QString CollectionConfiguration::windowTitle(const QHelpEngineCore &helpEn } void CollectionConfiguration::setWindowTitle(QHelpEngineCore &helpEngine, - const QString &windowTitle) + const QString &windowTitle) { helpEngine.setCustomValue(WindowTitleKey, windowTitle); } - -int CollectionConfiguration::lastTabPage(const QHelpEngineCore &helpEngine) -{ - return helpEngine.customValue(LastPageKey, 1).toInt(); -} - -void CollectionConfiguration::setLastTabPage(QHelpEngineCore &helpEngine, int lastPage) -{ - helpEngine.setCustomValue(LastPageKey, lastPage); -} - - -const QStringList CollectionConfiguration::lastShownPages(const QHelpEngineCore &helpEngine) -{ - return helpEngine.customValue(LastShownPagesKey).toString(). - split(ListSeparator, QString::SkipEmptyParts); -} - -void CollectionConfiguration::setLastShownPages(QHelpEngineCore &helpEngine, - const QStringList &lastShownPages) -{ - helpEngine. - setCustomValue(LastShownPagesKey, lastShownPages.join(ListSeparator)); -} - -const QStringList CollectionConfiguration::lastZoomFactors(const QHelpEngineCore &helpEngine) -{ - return helpEngine.customValue(LastZoomFactorsKey).toString(). - split(ListSeparator, QString::SkipEmptyParts); -} - -void CollectionConfiguration::setLastZoomFactors(QHelpEngineCore &helpEngine, - const QStringList &lastZoomFactors) -{ - helpEngine.setCustomValue(LastZoomFactorsKey, lastZoomFactors.join(ListSeparator)); -} - -const QString CollectionConfiguration::currentFilter(const QHelpEngineCore &helpEngine) -{ - return helpEngine.customValue(CurrentFilterKey).toString(); -} - -void CollectionConfiguration::setCurrentFilter(QHelpEngineCore &helpEngine, - const QString ¤tFilter) -{ - helpEngine.setCustomValue(CurrentFilterKey, currentFilter); -} - -const QString CollectionConfiguration::cacheDir(const QHelpEngineCore &helpEngine) -{ - return helpEngine.customValue(CacheDirKey).toString(); -} - -bool CollectionConfiguration::cacheDirIsRelativeToCollection(const QHelpEngineCore &helpEngine) -{ - return helpEngine.customValue(CacheDirRelativeToCollectionKey).toBool(); -} - -void CollectionConfiguration::setCacheDir(QHelpEngineCore &helpEngine, - const QString &cacheDir, bool relativeToCollection) -{ - helpEngine.setCustomValue(CacheDirKey, cacheDir); - helpEngine.setCustomValue(CacheDirRelativeToCollectionKey, - relativeToCollection); -} - bool CollectionConfiguration::filterFunctionalityEnabled(const QHelpEngineCore &helpEngine) { return helpEngine.customValue(EnableFilterKey, true).toBool(); } void CollectionConfiguration::setFilterFunctionalityEnabled(QHelpEngineCore &helpEngine, - bool enabled) + bool enabled) { helpEngine.setCustomValue(EnableFilterKey, enabled); } @@ -197,7 +114,7 @@ bool CollectionConfiguration::filterToolbarVisible(const QHelpEngineCore &helpEn } void CollectionConfiguration::setFilterToolbarVisible(QHelpEngineCore &helpEngine, - bool visible) + bool visible) { helpEngine.setCustomValue(FilterToolbarHiddenKey, !visible); } @@ -224,6 +141,24 @@ void CollectionConfiguration::setAddressBarVisible(QHelpEngineCore &helpEngine, helpEngine.setCustomValue(HideAddressBarKey, !visible); } +const QString CollectionConfiguration::cacheDir(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(CacheDirKey).toString(); +} + +bool CollectionConfiguration::cacheDirIsRelativeToCollection(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(CacheDirRelativeToCollectionKey).toBool(); +} + +void CollectionConfiguration::setCacheDir(QHelpEngineCore &helpEngine, + const QString &cacheDir, bool relativeToCollection) +{ + helpEngine.setCustomValue(CacheDirKey, cacheDir); + helpEngine.setCustomValue(CacheDirRelativeToCollectionKey, + relativeToCollection); +} + bool CollectionConfiguration::documentationManagerEnabled(const QHelpEngineCore &helpEngine) { return helpEngine.customValue(EnableDocManagerKey, true).toBool(); @@ -302,30 +237,6 @@ void CollectionConfiguration::setDefaultHomePage(QHelpEngineCore &helpEngine, helpEngine.setCustomValue(DefaultHomePageKey, page); } -const QString CollectionConfiguration::homePage(const QHelpEngineCore &helpEngine) -{ - return helpEngine.customValue(HomePageKey).toString(); -} - -void CollectionConfiguration::setHomePage(QHelpEngineCore &helpEngine, - const QString &page) -{ - helpEngine.setCustomValue(HomePageKey, page); -} - -int CollectionConfiguration::startOption(const QHelpEngineCore &helpEngine) -{ - // TODO: After moving to helpengine wrapper, put LastPages in that header file - // and use it here as default value. - return helpEngine.customValue(StartOptionKey).toInt(); -} - -void CollectionConfiguration::setStartOption(QHelpEngineCore &helpEngine, - int option) -{ - helpEngine.setCustomValue(StartOptionKey, option); -} - bool CollectionConfiguration::docUpdatePending(const QHelpEngineCore &helpEngine) { return helpEngine.customValue(DocUpdatePendingKey, false).toBool(); @@ -337,145 +248,41 @@ void CollectionConfiguration::setDocUpdatePending(QHelpEngineCore &helpEngine, helpEngine.setCustomValue(DocUpdatePendingKey, pending); } -const QByteArray CollectionConfiguration::bookmarks(const QHelpEngineCore &helpEngine) -{ - return helpEngine.customValue(BookmarksKey).toByteArray(); -} - -void CollectionConfiguration::setBookmarks(QHelpEngineCore &helpEngine, - const QByteArray &bookmarks) -{ - helpEngine.setCustomValue(BookmarksKey, bookmarks); -} - -const QByteArray CollectionConfiguration::mainWindow(const QHelpEngineCore &helpEngine) -{ - return helpEngine.customValue(MainWindowKey).toByteArray(); -} - -void CollectionConfiguration::setMainWindow(QHelpEngineCore &helpEngine, - const QByteArray &mainWindow) -{ - helpEngine.setCustomValue(MainWindowKey, mainWindow); -} - -const QByteArray CollectionConfiguration::mainWindowGeometry(const QHelpEngineCore &helpEngine) -{ - return helpEngine.customValue(MainWindowGeometryKey).toByteArray(); -} - -void CollectionConfiguration::setMainWindowGeometry(QHelpEngineCore &helpEngine, - const QByteArray &geometry) -{ - helpEngine.setCustomValue(MainWindowGeometryKey, geometry); -} - -bool CollectionConfiguration::usesAppFont(const QHelpEngineCore &helpEngine) -{ - return helpEngine.customValue(UseAppFontKey).toBool(); -} - -void CollectionConfiguration::setUseAppFont(QHelpEngineCore &helpEngine, - bool useAppFont) -{ - helpEngine.setCustomValue(UseAppFontKey, useAppFont); -} - -bool CollectionConfiguration::usesBrowserFont(const QHelpEngineCore &helpEngine) -{ - return helpEngine.customValue(UseBrowserFontKey, false).toBool(); -} - -void CollectionConfiguration::setUseBrowserFont(QHelpEngineCore &helpEngine, - bool useBrowserFont) -{ - helpEngine.setCustomValue(UseBrowserFontKey, useBrowserFont); -} - -const QFont CollectionConfiguration::appFont(const QHelpEngineCore &helpEngine) -{ - return qVariantValue(helpEngine.customValue(AppFontKey)); -} - -void CollectionConfiguration::setAppFont(QHelpEngineCore &helpEngine, - const QFont &font) -{ - helpEngine.setCustomValue(AppFontKey, font); -} - -QFontDatabase::WritingSystem CollectionConfiguration::appWritingSystem(const QHelpEngineCore &helpEngine) -{ - return static_cast( - helpEngine.customValue(AppWritingSystemKey).toInt()); -} - -void CollectionConfiguration::setAppWritingSystem(QHelpEngineCore &helpEngine, - QFontDatabase::WritingSystem system) -{ - helpEngine.setCustomValue(AppWritingSystemKey, system); -} - -const QFont CollectionConfiguration::browserFont(const QHelpEngineCore &helpEngine) -{ - return qVariantValue(helpEngine.customValue(BrowserFontKey)); -} - -void CollectionConfiguration::setBrowserFont(QHelpEngineCore &helpEngine, - const QFont &font) -{ - helpEngine.setCustomValue(BrowserFontKey, font); -} - -QFontDatabase::WritingSystem CollectionConfiguration::browserWritingSystem(const QHelpEngineCore &helpEngine) -{ - return static_cast( - helpEngine.customValue(BrowserWritingSystemKey).toInt()); -} - -void CollectionConfiguration::setBrowserWritingSystem(QHelpEngineCore &helpEngine, - QFontDatabase::WritingSystem system) -{ - helpEngine.setCustomValue(BrowserWritingSystemKey, system); -} - -bool CollectionConfiguration::unfilteredInserted(const QHelpEngineCore &helpEngine) -{ - return helpEngine.customValue(UnfilteredInsertedKey).toInt() == 1; -} - -void CollectionConfiguration::setUnfilteredInserted(QHelpEngineCore &helpEngine) +const QStringList CollectionConfiguration::lastShownPages(const QHelpEngineCore &helpEngine) { - helpEngine.setCustomValue(UnfilteredInsertedKey, 1); + return helpEngine.customValue(LastShownPagesKey).toString(). + split(ListSeparator, QString::SkipEmptyParts); } -const QStringList CollectionConfiguration::qtDocInfo(const QHelpEngineCore &helpEngine, - const QString &component) +void CollectionConfiguration::setLastShownPages(QHelpEngineCore &helpEngine, + const QStringList &lastShownPages) { - return helpEngine.customValue(VersionKey.arg(component)).toString(). - split(ListSeparator); + helpEngine.setCustomValue(LastShownPagesKey, + lastShownPages.join(ListSeparator)); } -void CollectionConfiguration::setQtDocInfo(QHelpEngineCore &helpEngine, - const QString &component, const QStringList &doc) +const QStringList CollectionConfiguration::lastZoomFactors(const QHelpEngineCore &helpEngine) { - helpEngine.setCustomValue(VersionKey.arg(component), - doc.join(ListSeparator)); + return helpEngine.customValue(LastZoomFactorsKey).toString(). + split(ListSeparator, QString::SkipEmptyParts); } -bool CollectionConfiguration::searchWasAttached(const QHelpEngineCore &helpEngine) +void CollectionConfiguration::setLastZoomFactors(QHelpEngineCore &helpEngine, + const QStringList &lastZoomFactors) { - return helpEngine.customValue(SearchWasAttachedKey).toBool(); + helpEngine.setCustomValue(LastZoomFactorsKey, + lastZoomFactors.join(ListSeparator)); } -void CollectionConfiguration::setSearchWasAttached(QHelpEngineCore &helpEngine, - bool attached) +int CollectionConfiguration::lastTabPage(const QHelpEngineCore &helpEngine) { - helpEngine.setCustomValue(SearchWasAttachedKey, attached); + return helpEngine.customValue(LastPageKey, 1).toInt(); } -bool CollectionConfiguration::hasFontSettings(const QHelpEngineCore &helpEngine) +void CollectionConfiguration::setLastTabPage(QHelpEngineCore &helpEngine, + int lastPage) { - return helpEngine.customValue(UseAppFontKey).isValid(); + helpEngine.setCustomValue(LastPageKey, lastPage); } bool CollectionConfiguration::isNewer(const QHelpEngineCore &newer, @@ -489,9 +296,7 @@ void CollectionConfiguration::copyConfiguration(const QHelpEngineCore &source, { setCreationTime(target, creationTime(source)); setWindowTitle(target, windowTitle(source)); - setLastShownPages(target, lastShownPages(source)); - setLastZoomFactors(target, lastZoomFactors(source)); - setCurrentFilter(target, currentFilter(source)); + target.setCurrentFilter(source.currentFilter()); setCacheDir(target, cacheDir(source), cacheDirIsRelativeToCollection(source)); setFilterFunctionalityEnabled(target, filterFunctionalityEnabled(source)); setFilterToolbarVisible(target, filterToolbarVisible(source)); diff --git a/tools/assistant/tools/shared/collectionconfiguration.h b/tools/assistant/tools/shared/collectionconfiguration.h index 48d2803..4e77abe 100644 --- a/tools/assistant/tools/shared/collectionconfiguration.h +++ b/tools/assistant/tools/shared/collectionconfiguration.h @@ -46,8 +46,6 @@ #include #include #include -#include -#include QT_BEGIN_NAMESPACE @@ -56,29 +54,18 @@ class QHelpEngineCore; class CollectionConfiguration { public: - static int lastTabPage(const QHelpEngineCore &helpEngine); - static void setLastTabPage(QHelpEngineCore &helpEngine, int lastPage); - - static const QStringList lastShownPages(const QHelpEngineCore &helpEngine); - static void setLastShownPages(QHelpEngineCore &helpEngine, - const QStringList &lastShownPages); - - - // TODO: Don't allow last pages and zoom factors to be set in isolation - // Perhaps also fill up missing elements automatically or assert. - static const QStringList lastZoomFactors(const QHelpEngineCore &helpEngine); - static void setLastZoomFactors(QHelpEngineCore &helpEngine, - const QStringList &lastZoomFactors); - - static const QString currentFilter(const QHelpEngineCore &helpEngine); - static void setCurrentFilter(QHelpEngineCore &helpEngine, - const QString ¤tFilter); + static const QString windowTitle(const QHelpEngineCore &helpEngine); + static void setWindowTitle(QHelpEngineCore &helpEngine, + const QString &windowTitle); static const QString cacheDir(const QHelpEngineCore &helpEngine); static bool cacheDirIsRelativeToCollection(const QHelpEngineCore &helpEngine); static void setCacheDir(QHelpEngineCore &helpEngine, const QString &cacheDir, bool relativeToCollection); + static uint creationTime(const QHelpEngineCore &helpEngine); + static void setCreationTime(QHelpEngineCore &helpEngine, uint time); + static bool filterFunctionalityEnabled(const QHelpEngineCore &helpEngine); static void setFilterFunctionalityEnabled(QHelpEngineCore &helpEngine, bool enabled); @@ -93,12 +80,6 @@ public: static bool addressBarVisible(const QHelpEngineCore &helpEngine); static void setAddressBarVisible(QHelpEngineCore &helpEngine, bool visible); - static uint creationTime(const QHelpEngineCore &helpEngine); - static void setCreationTime(QHelpEngineCore &helpEngine, uint time); - - static const QString windowTitle(const QHelpEngineCore &helpEngine); - static void setWindowTitle(QHelpEngineCore &helpEngine, - const QString &windowTitle); static bool documentationManagerEnabled(const QHelpEngineCore &helpEngine); static void setDocumentationManagerEnabled(QHelpEngineCore &helpEngine, @@ -108,12 +89,6 @@ public: static void setApplicationIcon(QHelpEngineCore &helpEngine, const QByteArray &icon); - static const QString homePage(const QHelpEngineCore &helpEngine); - static void setHomePage(QHelpEngineCore &helpEngine, const QString &page); - - static int startOption(const QHelpEngineCore &helpEngine); - static void setStartOption(QHelpEngineCore &helpEngine, int option); - // TODO: Encapsulate encoding from/to QByteArray here static const QByteArray aboutMenuTexts(const QHelpEngineCore &helpEngine); static void setAboutMenuTexts(QHelpEngineCore &helpEngine, @@ -139,58 +114,25 @@ public: static bool docUpdatePending(const QHelpEngineCore &helpEngine); static void setDocUpdatePending(QHelpEngineCore &helpEngine, bool pending); - // TODO: Put these GUI-specific functions in the help engine wrapper - static const QByteArray bookmarks(const QHelpEngineCore &helpEngine); - static void setBookmarks(QHelpEngineCore &helpEngine, - const QByteArray &bookmarks); - - static const QByteArray mainWindow(const QHelpEngineCore &helpEngine); - static void setMainWindow(QHelpEngineCore &helpEngine, - const QByteArray &mainWindow); - - static const QByteArray mainWindowGeometry(const QHelpEngineCore &helpEngine); - static void setMainWindowGeometry(QHelpEngineCore &helpEngine, - const QByteArray &geometry); - - static bool usesAppFont(const QHelpEngineCore &helpEngine); - static void setUseAppFont(QHelpEngineCore &helpEngine, bool useAppFont); - - static bool usesBrowserFont(const QHelpEngineCore &helpEngine); - static void setUseBrowserFont(QHelpEngineCore &helpEngine, - bool useBrowserFont); - - static const QFont appFont(const QHelpEngineCore &helpEngine); - static void setAppFont(QHelpEngineCore &helpEngine, const QFont &font); - - static QFontDatabase::WritingSystem appWritingSystem(const QHelpEngineCore &helpEngine); - static void setAppWritingSystem(QHelpEngineCore &helpEngine, - QFontDatabase::WritingSystem system); - - static const QFont browserFont(const QHelpEngineCore &helpEngine); - static void setBrowserFont(QHelpEngineCore &helpEngine, const QFont &font); - - static QFontDatabase::WritingSystem browserWritingSystem(const QHelpEngineCore &helpEngine); - static void setBrowserWritingSystem(QHelpEngineCore &helpEngine, - QFontDatabase::WritingSystem system); - - static bool unfilteredInserted(const QHelpEngineCore &helpEngine); - static void setUnfilteredInserted(QHelpEngineCore &helpEngine); - - static const QStringList qtDocInfo(const QHelpEngineCore &helpEngine, - const QString &component); - static void setQtDocInfo(QHelpEngineCore &helpEngine, - const QString &component, const QStringList &doc); + // TODO: Don't allow last pages and zoom factors to be set in isolation + // Perhaps also fill up missing elements automatically or assert. + static const QStringList lastShownPages(const QHelpEngineCore &helpEngine); + static void setLastShownPages(QHelpEngineCore &helpEngine, + const QStringList &lastShownPages); + static const QStringList lastZoomFactors(const QHelpEngineCore &helpEngine); + static void setLastZoomFactors(QHelpEngineCore &helPEngine, + const QStringList &lastZoomFactors); - static bool searchWasAttached(const QHelpEngineCore &helpEngine); - static void setSearchWasAttached(QHelpEngineCore &helpEngine, bool attached); + static int lastTabPage(const QHelpEngineCore &helpEngine); + static void setLastTabPage(QHelpEngineCore &helpEngine, int lastPage); - static bool hasFontSettings(const QHelpEngineCore &helpEngine); static bool isNewer(const QHelpEngineCore &newer, const QHelpEngineCore &older); static void copyConfiguration(const QHelpEngineCore &source, QHelpEngineCore &target); static const QString DefaultZoomFactor; + static const QString ListSeparator; }; QT_END_NAMESPACE -- cgit v0.12 From 02c1e3324ad11ab7a1f1c601ab3ffdd18f1dc5f6 Mon Sep 17 00:00:00 2001 From: ck Date: Thu, 3 Dec 2009 15:25:06 +0100 Subject: Assistant: Compile fix for namespaced Qt. --- tools/assistant/tools/assistant/xbelsupport.cpp | 4 ++++ tools/assistant/tools/assistant/xbelsupport.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/tools/assistant/tools/assistant/xbelsupport.cpp b/tools/assistant/tools/assistant/xbelsupport.cpp index 545be6c..3c545ac 100644 --- a/tools/assistant/tools/assistant/xbelsupport.cpp +++ b/tools/assistant/tools/assistant/xbelsupport.cpp @@ -44,6 +44,8 @@ #include +QT_BEGIN_NAMESPACE + struct Bookmark { QString title; QString url; @@ -232,3 +234,5 @@ QStandardItem *XbelReader::createChildItem(QStandardItem *item) return childItem; } + +QT_END_NAMESPACE diff --git a/tools/assistant/tools/assistant/xbelsupport.h b/tools/assistant/tools/assistant/xbelsupport.h index 177b04b..f3bf102 100644 --- a/tools/assistant/tools/assistant/xbelsupport.h +++ b/tools/assistant/tools/assistant/xbelsupport.h @@ -48,6 +48,8 @@ QT_FORWARD_DECLARE_CLASS(QIODevice) QT_FORWARD_DECLARE_CLASS(QStandardItem) +QT_BEGIN_NAMESPACE + class BookmarkModel; class XbelWriter : public QXmlStreamWriter @@ -84,4 +86,6 @@ private: BookmarkModel *listModel; }; +QT_END_NAMESPACE + #endif // XBELSUPPORT_H -- cgit v0.12 From b15b08e1f09320299a13bd4344663d6efb44d53f Mon Sep 17 00:00:00 2001 From: ck Date: Thu, 3 Dec 2009 17:09:27 +0100 Subject: Assistant: Small refactoring to prepare for upcoming functional change. Reviewed-by: kh1 --- tools/assistant/tools/assistant/main.cpp | 42 ++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/tools/assistant/tools/assistant/main.cpp b/tools/assistant/tools/assistant/main.cpp index 4d93a41..a80b4cc 100644 --- a/tools/assistant/tools/assistant/main.cpp +++ b/tools/assistant/tools/assistant/main.cpp @@ -132,6 +132,24 @@ QString indexFilesFolder(const QString &collectionFile) return indexFilesFolder; } +/* + * Returns the expected absolute file path of the cached collection file + * correspondinging to the given collection's file. + * It may or may not exist yet. + */ +QString cachedCollectionFile(const QHelpEngineCore &collection) +{ + const QString &filePath = collection.collectionFile(); + const QString &fileName = QFileInfo(filePath).fileName(); + const QString &cacheDir = CollectionConfiguration::cacheDir(collection); + const QString &dir = !cacheDir.isEmpty() + && CollectionConfiguration::cacheDirIsRelativeToCollection(collection) + ? QFileInfo(filePath).dir().absolutePath() + + QDir::separator() + cacheDir + : MainWindow::collectionFileDirectory(false, cacheDir); + return dir + QDir::separator() + fileName; +} + } // Anonymous namespace. int main(int argc, char *argv[]) @@ -238,26 +256,14 @@ int main(int argc, char *argv[]) return -1; } - QString fileName = QFileInfo(cmdCollectionFile).fileName(); - const QString &cacheDir = CollectionConfiguration::cacheDir(caller); - const QString dir = !cacheDir.isEmpty() - && CollectionConfiguration::cacheDirIsRelativeToCollection(caller) - ? QFileInfo(cmdCollectionFile).dir().absolutePath() - + QDir::separator() + cacheDir - : MainWindow::collectionFileDirectory(false, cacheDir); - - bool collectionFileExists = true; - QFileInfo fi(dir + QDir::separator() + fileName); - if (!fi.exists()) { - collectionFileExists = false; - if (!caller.copyCollectionFile(fi.absoluteFilePath())) { + const QString &cachedCollectionFilePath = cachedCollectionFile(caller); + if (!QFileInfo(cachedCollectionFilePath).exists()) { + if (!caller.copyCollectionFile(cachedCollectionFilePath)) { cmd.showMessage(caller.error(), true); return -1; } - } - - if (collectionFileExists) { - QHelpEngineCore user(fi.absoluteFilePath()); + } else { + QHelpEngineCore user(cachedCollectionFilePath); if (user.setupData()) { // some docs might have been un/registered bool docUpdate = CollectionConfiguration::docUpdatePending(caller); @@ -290,7 +296,7 @@ int main(int argc, char *argv[]) } } } - cmd.setCollectionFile(fi.absoluteFilePath()); + cmd.setCollectionFile(cachedCollectionFilePath); } if (!cmd.currentFilter().isEmpty()) { -- cgit v0.12 From 7e80ffdf19946280fede44e39a9a740202d4e8e6 Mon Sep 17 00:00:00 2001 From: ck Date: Thu, 3 Dec 2009 18:23:08 +0100 Subject: Assistant: Another small refactoring. Reviewed-by: kh1 --- tools/assistant/tools/assistant/main.cpp | 47 ++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/tools/assistant/tools/assistant/main.cpp b/tools/assistant/tools/assistant/main.cpp index a80b4cc..d009210 100644 --- a/tools/assistant/tools/assistant/main.cpp +++ b/tools/assistant/tools/assistant/main.cpp @@ -150,6 +150,38 @@ QString cachedCollectionFile(const QHelpEngineCore &collection) return dir + QDir::separator() + fileName; } +bool synchronizeDocs(const QHelpEngineCore &collection, + QHelpEngineCore &cachedCollection) +{ + const QStringList &docs = collection.registeredDocumentations(); + const QStringList &cachedDocs = cachedCollection.registeredDocumentations(); + + /* + * Step 1: Ensure that the cached collection contains all docs that + * the collection contains. + */ + foreach (const QString &doc, docs) { + if (!cachedDocs.contains(doc)) { + if (!cachedCollection.registerDocumentation( + collection.documentationFileName(doc))) + return false; + } + } + + /* + * Step 2: Ensure that the cached collection contains no docs that + * the collection doesn't contain. + */ + QLatin1String intern("com.trolltech.com.assistantinternal-"); + foreach (const QString &doc, cachedDocs) { + if (!collection.contains(doc) && !doc.startsWith(intern) + && !cachedCollection.unregisterDocumentation(doc)) + return false; + } + + return true; +} + } // Anonymous namespace. int main(int argc, char *argv[]) @@ -278,20 +310,7 @@ int main(int argc, char *argv[]) docUpdate = true; if (docUpdate) { - QStringList callerDocs = caller.registeredDocumentations(); - foreach (const QString &doc, callerDocs) { - if (!userDocs.contains(doc)) { - user.registerDocumentation( - caller.documentationFileName(doc)); - } - } - - QLatin1String intern("com.trolltech.com.assistantinternal-"); - foreach (const QString &doc, userDocs) { - if (!callerDocs.contains(doc) && !doc.startsWith(intern)) - user.unregisterDocumentation(doc); - } - + synchronizeDocs(caller, user); CollectionConfiguration::setDocUpdatePending(caller, false); } } -- cgit v0.12 From c7739f7dd55a5a88e0efb00895f63d512cb16fe5 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 27 Nov 2009 14:08:24 +0100 Subject: Don't force a crash handler in QtTest. In some cases, it's best to just let the crash happen straight away. Reviewed-by: Harald Fernengel --- src/testlib/qtestcase.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index 9dea6dc..7ab7201 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -846,6 +846,9 @@ namespace QTest static int mouseDelay = -1; static int eventDelay = -1; static int keyVerbose = -1; +#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) + static bool noCrashHandler = false; +#endif void filter_unprintable(char *str) { @@ -976,6 +979,9 @@ static void qParseArgs(int argc, char *argv[]) " -keyevent-verbose : Turn on verbose messages for keyboard simulation\n" " -maxwarnings n : Sets the maximum amount of messages to output.\n" " 0 means unlimited, default: 2000\n" +#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) + " -nocrashhandler : Disables the crash handler\n" +#endif "\n" " Benchmark related options:\n" #ifdef QTESTLIB_USE_VALGRIND @@ -1056,6 +1062,10 @@ static void qParseArgs(int argc, char *argv[]) } else { QTestLog::setMaxWarnings(qToInt(argv[++i])); } +#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) + } else if (strcmp(argv[i], "-nocrashhandler") == 0) { + QTest::noCrashHandler = true; +#endif } else if (strcmp(argv[i], "-keyevent-verbose") == 0) { QTest::keyVerbose = 1; #ifdef QTESTLIB_USE_VALGRIND @@ -1661,7 +1671,8 @@ int QTest::qExec(QObject *testObject, int argc, char **argv) #endif { #if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) - FatalSignalHandler handler; + if (!noCrashHandler) + FatalSignalHandler handler; #endif qInvokeTestMethods(testObject); } -- cgit v0.12 From d1a28d167295958a4404fab37d60ef530c692590 Mon Sep 17 00:00:00 2001 From: mae Date: Thu, 3 Dec 2009 20:31:00 +0100 Subject: Fix QPlainTextEdit cursorUp/Down in combination with non-visible blocks QPlainTextEdit uses QTextCursor::movePosition to reposition the cursor after pageUp/Down. If this cursor happens to be in non-visual mode (the default), it might end up on an invisible block. This results in magically unfolding sections in Qt Creator. --- src/gui/widgets/qplaintextedit.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/widgets/qplaintextedit.cpp b/src/gui/widgets/qplaintextedit.cpp index 89fe7b8..b637c19 100644 --- a/src/gui/widgets/qplaintextedit.cpp +++ b/src/gui/widgets/qplaintextedit.cpp @@ -906,6 +906,7 @@ void QPlainTextEditPrivate::pageUpDown(QTextCursor::MoveOperation op, QTextCurso setTopBlock(block.blockNumber(), line); if (moveCursor) { + cursor.setVisualNavigation(true); // move using movePosition to keep the cursor's x lastY += verticalOffset(); bool moved = false; -- cgit v0.12 From 0a98247f5df26d9865a03fc6e5ad1ef7b88f9803 Mon Sep 17 00:00:00 2001 From: Ademar de Souza Reis Jr Date: Tue, 8 Sep 2009 09:54:41 -0300 Subject: doc: Fix qmake-manual warn_on/warn_off references Signed-off-by: Ademar de Souza Reis Jr --- doc/src/development/qmake-manual.qdoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/src/development/qmake-manual.qdoc b/doc/src/development/qmake-manual.qdoc index 9548848..549c801 100644 --- a/doc/src/development/qmake-manual.qdoc +++ b/doc/src/development/qmake-manual.qdoc @@ -1977,7 +1977,7 @@ distinction between shared and \section1 QMAKE_CFLAGS_WARN_OFF This variable is not empty if the warn_off - \l{#TEMPLATE}{TEMPLATE} option is specified. The value of this + \l{#CONFIG}{CONFIG} option is specified. The value of this variable is typically handled by \c qmake or \l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified. @@ -1985,7 +1985,7 @@ distinction between shared and \section1 QMAKE_CFLAGS_WARN_ON This variable is not empty if the warn_on - \l{#TEMPLATE}{TEMPLATE} option is specified. + \l{#CONFIG}{CONFIG} option is specified. The value of this variable is typically handled by \c qmake or \l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified. -- cgit v0.12 From 8364bfd6c4be53fba4aad41d5cbbc16ca02b2597 Mon Sep 17 00:00:00 2001 From: Ademar de Souza Reis Jr Date: Tue, 15 Sep 2009 11:18:23 -0300 Subject: doc: Fix typo in QEvent::ignore() documentation Signed-off-by: Ademar de Souza Reis Jr --- src/corelib/kernel/qcoreevent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/kernel/qcoreevent.cpp b/src/corelib/kernel/qcoreevent.cpp index 9098515..996c331 100644 --- a/src/corelib/kernel/qcoreevent.cpp +++ b/src/corelib/kernel/qcoreevent.cpp @@ -331,7 +331,7 @@ QEvent::~QEvent() equivalent of calling setAccepted(false). Clearing the accept parameter indicates that the event receiver - does not want the event. Unwanted events might be propgated to the + does not want the event. Unwanted events might be propagated to the parent widget. \sa accept() -- cgit v0.12 From af265e912fab8b7ed5369a4c91f5a7ffd516441b Mon Sep 17 00:00:00 2001 From: Ademar de Souza Reis Jr Date: Fri, 6 Nov 2009 16:19:15 -0300 Subject: examples/dbus: update dbus-chat adaptor/interface files The example was outdated, thus causing some confusion for someone who tries to follow it. --- examples/dbus/dbus-chat/chat_adaptor.cpp | 6 +++--- examples/dbus/dbus-chat/chat_adaptor.h | 27 ++++++++++++--------------- examples/dbus/dbus-chat/chat_interface.cpp | 6 +++--- examples/dbus/dbus-chat/chat_interface.h | 10 +++++----- 4 files changed, 23 insertions(+), 26 deletions(-) diff --git a/examples/dbus/dbus-chat/chat_adaptor.cpp b/examples/dbus/dbus-chat/chat_adaptor.cpp index dce5d07..9415e5a 100644 --- a/examples/dbus/dbus-chat/chat_adaptor.cpp +++ b/examples/dbus/dbus-chat/chat_adaptor.cpp @@ -38,10 +38,10 @@ ** $QT_END_LICENSE$ ** ** -** This file was generated by dbusxml2cpp version 0.6 -** Command line was: dbusxml2cpp -i chat_adaptor.h -a :chat_adaptor.cpp com.trolltech.chat.xml +** This file was generated by qdbusxml2cpp version 0.7 +** Command line was: qdbusxml2cpp -i chat_adaptor.h -a :chat_adaptor.cpp com.trolltech.chat.xml ** -** dbusxml2cpp is Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** qdbusxml2cpp is Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** ** This is an auto-generated file. ** Do not edit! All changes made to it will be lost. diff --git a/examples/dbus/dbus-chat/chat_adaptor.h b/examples/dbus/dbus-chat/chat_adaptor.h index 3266cef..9f0ad24 100644 --- a/examples/dbus/dbus-chat/chat_adaptor.h +++ b/examples/dbus/dbus-chat/chat_adaptor.h @@ -38,10 +38,10 @@ ** $QT_END_LICENSE$ ** ** -** This file was generated by dbusxml2cpp version 0.6 -** Command line was: dbusxml2cpp -a chat_adaptor.h: com.trolltech.chat.xml +** This file was generated by qdbusxml2cpp version 0.7 +** Command line was: qdbusxml2cpp -a chat_adaptor.h: com.trolltech.chat.xml ** -** dbusxml2cpp is Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** qdbusxml2cpp is Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** ** This is an auto-generated file. ** This file may have been hand-edited. Look for HAND-EDIT comments @@ -49,20 +49,17 @@ ** ****************************************************************************/ -#ifndef CHAT_ADAPTOR_H_142741156243605 -#define CHAT_ADAPTOR_H_142741156243605 +#ifndef CHAT_ADAPTOR_H_1257535021 +#define CHAT_ADAPTOR_H_1257535021 #include #include - -QT_BEGIN_NAMESPACE class QByteArray; template class QList; template class QMap; class QString; class QStringList; class QVariant; -QT_END_NAMESPACE /* * Adaptor class for interface com.trolltech.chat @@ -72,14 +69,14 @@ class ChatAdaptor: public QDBusAbstractAdaptor Q_OBJECT Q_CLASSINFO("D-Bus Interface", "com.trolltech.chat") Q_CLASSINFO("D-Bus Introspection", "" -" \n" -" \n" -" \n" -" \n" +" \n" +" \n" +" \n" +" \n" " \n" -" \n" -" \n" -" \n" +" \n" +" \n" +" \n" " \n" " \n" "") diff --git a/examples/dbus/dbus-chat/chat_interface.cpp b/examples/dbus/dbus-chat/chat_interface.cpp index bf652ea..3131ae9 100644 --- a/examples/dbus/dbus-chat/chat_interface.cpp +++ b/examples/dbus/dbus-chat/chat_interface.cpp @@ -38,10 +38,10 @@ ** $QT_END_LICENSE$ ** ** -** This file was generated by dbusxml2cpp version 0.6 -** Command line was: dbusxml2cpp -i chat_interface.h -p :chat_interface.cpp chat/com.trolltech.chat.xml +** This file was generated by qdbusxml2cpp version 0.7 +** Command line was: qdbusxml2cpp -i chat_interface.h -p :chat_interface.cpp com.trolltech.chat.xml ** -** dbusxml2cpp is Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** qdbusxml2cpp is Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** ** This is an auto-generated file. ** This file may have been hand-edited. Look for HAND-EDIT comments diff --git a/examples/dbus/dbus-chat/chat_interface.h b/examples/dbus/dbus-chat/chat_interface.h index 3962a23..e2798ed 100644 --- a/examples/dbus/dbus-chat/chat_interface.h +++ b/examples/dbus/dbus-chat/chat_interface.h @@ -38,18 +38,18 @@ ** $QT_END_LICENSE$ ** ** -** This file was generated by dbusxml2cpp version 0.6 -** Command line was: dbusxml2cpp -p chat_interface.h: com.trolltech.chat.xml +** This file was generated by qdbusxml2cpp version 0.7 +** Command line was: qdbusxml2cpp -p chat_interface.h: com.trolltech.chat.xml ** -** dbusxml2cpp is Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** qdbusxml2cpp is Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** ** This is an auto-generated file. ** Do not edit! All changes made to it will be lost. ** ****************************************************************************/ -#ifndef CHAT_INTERFACE_H_143021156243606 -#define CHAT_INTERFACE_H_143021156243606 +#ifndef CHAT_INTERFACE_H_1257535021 +#define CHAT_INTERFACE_H_1257535021 #include #include -- cgit v0.12 From 9fc350e8358f55c13169a9383bd2bd85592bb231 Mon Sep 17 00:00:00 2001 From: Ademar de Souza Reis Jr Date: Fri, 6 Nov 2009 16:49:12 -0300 Subject: examples/dbus: update remotecontrolledcar example The example was outdated, thus causing some confusion for someone who tries to follow it. --- examples/dbus/remotecontrolledcar/car/car.pro | 2 +- .../dbus/remotecontrolledcar/car/car_adaptor.cpp | 22 ++-- .../dbus/remotecontrolledcar/car/car_adaptor_p.h | 97 ------------------ examples/dbus/remotecontrolledcar/car/main.cpp | 4 +- .../controller/car_interface.cpp | 15 ++- .../controller/car_interface_p.h | 114 --------------------- .../remotecontrolledcar/controller/controller.cpp | 4 +- .../remotecontrolledcar/controller/controller.h | 5 +- .../remotecontrolledcar/controller/controller.pro | 2 +- 9 files changed, 26 insertions(+), 239 deletions(-) delete mode 100644 examples/dbus/remotecontrolledcar/car/car_adaptor_p.h delete mode 100644 examples/dbus/remotecontrolledcar/controller/car_interface_p.h diff --git a/examples/dbus/remotecontrolledcar/car/car.pro b/examples/dbus/remotecontrolledcar/car/car.pro index 9b426d3..d362dc9 100644 --- a/examples/dbus/remotecontrolledcar/car/car.pro +++ b/examples/dbus/remotecontrolledcar/car/car.pro @@ -10,7 +10,7 @@ CONFIG += qdbus # Input # DBUS_ADAPTORS += car.xml -HEADERS += car.h car_adaptor_p.h +HEADERS += car.h car_adaptor.h SOURCES += car.cpp main.cpp car_adaptor.cpp # install diff --git a/examples/dbus/remotecontrolledcar/car/car_adaptor.cpp b/examples/dbus/remotecontrolledcar/car/car_adaptor.cpp index 58f2ef0..8654663 100644 --- a/examples/dbus/remotecontrolledcar/car/car_adaptor.cpp +++ b/examples/dbus/remotecontrolledcar/car/car_adaptor.cpp @@ -38,17 +38,17 @@ ** $QT_END_LICENSE$ ** ** -** This file was generated by dbusxml2cpp version 0.6 -** Command line was: dbusxml2cpp -c CarAdaptor -a car_adaptor_p.h:car_adaptor.cpp car.xml +** This file was generated by qdbusxml2cpp version 0.7 +** Command line was: qdbusxml2cpp -i car_adaptor.h -a :car_adaptor.cpp car.xml ** -** dbusxml2cpp is Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** qdbusxml2cpp is Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** ** This is an auto-generated file. ** Do not edit! All changes made to it will be lost. ** ****************************************************************************/ -#include "car_adaptor_p.h" +#include "car_adaptor.h" #include #include #include @@ -58,40 +58,40 @@ #include /* - * Implementation of adaptor class CarAdaptor + * Implementation of adaptor class CarInterfaceAdaptor */ -CarAdaptor::CarAdaptor(QObject *parent) +CarInterfaceAdaptor::CarInterfaceAdaptor(QObject *parent) : QDBusAbstractAdaptor(parent) { // constructor setAutoRelaySignals(true); } -CarAdaptor::~CarAdaptor() +CarInterfaceAdaptor::~CarInterfaceAdaptor() { // destructor } -void CarAdaptor::accelerate() +void CarInterfaceAdaptor::accelerate() { // handle method call com.trolltech.Examples.CarInterface.accelerate QMetaObject::invokeMethod(parent(), "accelerate"); } -void CarAdaptor::decelerate() +void CarInterfaceAdaptor::decelerate() { // handle method call com.trolltech.Examples.CarInterface.decelerate QMetaObject::invokeMethod(parent(), "decelerate"); } -void CarAdaptor::turnLeft() +void CarInterfaceAdaptor::turnLeft() { // handle method call com.trolltech.Examples.CarInterface.turnLeft QMetaObject::invokeMethod(parent(), "turnLeft"); } -void CarAdaptor::turnRight() +void CarInterfaceAdaptor::turnRight() { // handle method call com.trolltech.Examples.CarInterface.turnRight QMetaObject::invokeMethod(parent(), "turnRight"); diff --git a/examples/dbus/remotecontrolledcar/car/car_adaptor_p.h b/examples/dbus/remotecontrolledcar/car/car_adaptor_p.h deleted file mode 100644 index 6d98c5b..0000000 --- a/examples/dbus/remotecontrolledcar/car/car_adaptor_p.h +++ /dev/null @@ -1,97 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -** -** This file was generated by dbusxml2cpp version 0.6 -** Command line was: dbusxml2cpp -c CarAdaptor -a car_adaptor_p.h:car_adaptor.cpp car.xml -** -** dbusxml2cpp is Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** -** This is an auto-generated file. -** This file may have been hand-edited. Look for HAND-EDIT comments -** before re-generating it. -** -****************************************************************************/ - -#ifndef CAR_ADAPTOR_P_H_1157030132 -#define CAR_ADAPTOR_P_H_1157030132 - -#include -#include - -QT_BEGIN_NAMESPACE -class QByteArray; -template class QList; -template class QMap; -class QString; -class QStringList; -class QVariant; -QT_END_NAMESPACE - -/* - * Adaptor class for interface com.trolltech.Examples.CarInterface - */ -class CarAdaptor: public QDBusAbstractAdaptor -{ - Q_OBJECT - Q_CLASSINFO("D-Bus Interface", "com.trolltech.Examples.CarInterface") - Q_CLASSINFO("D-Bus Introspection", "" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" - "") -public: - CarAdaptor(QObject *parent); - virtual ~CarAdaptor(); - -public: // PROPERTIES -public Q_SLOTS: // METHODS - void accelerate(); - void decelerate(); - void turnLeft(); - void turnRight(); -Q_SIGNALS: // SIGNALS - void crashed(); -}; - -#endif diff --git a/examples/dbus/remotecontrolledcar/car/main.cpp b/examples/dbus/remotecontrolledcar/car/main.cpp index c2ef91c..456ff11 100644 --- a/examples/dbus/remotecontrolledcar/car/main.cpp +++ b/examples/dbus/remotecontrolledcar/car/main.cpp @@ -40,7 +40,7 @@ ****************************************************************************/ #include "car.h" -#include "car_adaptor_p.h" +#include "car_adaptor.h" #include #include #include @@ -64,7 +64,7 @@ int main(int argc, char *argv[]) view.resize(400, 300); view.show(); - new CarAdaptor(car); + new CarInterfaceAdaptor(car); QDBusConnection connection = QDBusConnection::sessionBus(); connection.registerObject("/Car", car); connection.registerService("com.trolltech.CarExample"); diff --git a/examples/dbus/remotecontrolledcar/controller/car_interface.cpp b/examples/dbus/remotecontrolledcar/controller/car_interface.cpp index eeeb162..14258d6 100644 --- a/examples/dbus/remotecontrolledcar/controller/car_interface.cpp +++ b/examples/dbus/remotecontrolledcar/controller/car_interface.cpp @@ -38,10 +38,10 @@ ** $QT_END_LICENSE$ ** ** -** This file was generated by dbusxml2cpp version 0.6 -** Command line was: dbusxml2cpp -c CarInterface -p car_interface_p.h:car_interface.cpp car.xml +** This file was generated by qdbusxml2cpp version 0.7 +** Command line was: qdbusxml2cpp -i car_interface.h -p :car_interface.cpp car.xml ** -** dbusxml2cpp is Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** qdbusxml2cpp is Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** ** This is an auto-generated file. ** This file may have been hand-edited. Look for HAND-EDIT comments @@ -49,18 +49,17 @@ ** ****************************************************************************/ -#include "car_interface_p.h" - +#include "car_interface.h" /* - * Implementation of interface class CarInterface + * Implementation of interface class ComTrolltechExamplesCarInterfaceInterface */ -CarInterface::CarInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent) +ComTrolltechExamplesCarInterfaceInterface::ComTrolltechExamplesCarInterfaceInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent) : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent) { } -CarInterface::~CarInterface() +ComTrolltechExamplesCarInterfaceInterface::~ComTrolltechExamplesCarInterfaceInterface() { } diff --git a/examples/dbus/remotecontrolledcar/controller/car_interface_p.h b/examples/dbus/remotecontrolledcar/controller/car_interface_p.h deleted file mode 100644 index f7e22ac..0000000 --- a/examples/dbus/remotecontrolledcar/controller/car_interface_p.h +++ /dev/null @@ -1,114 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -** -** This file was generated by dbusxml2cpp version 0.6 -** Command line was: dbusxml2cpp -c CarInterface -p car_interface_p.h:car_interface.cpp car.xml -** -** dbusxml2cpp is Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** -** This is an auto-generated file. -** Do not edit! All changes made to it will be lost. -** -****************************************************************************/ - -#ifndef CAR_INTERFACE_P_H_1156853585 -#define CAR_INTERFACE_P_H_1156853585 - -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Proxy class for interface com.trolltech.Examples.CarInterface - */ -class CarInterface: public QDBusAbstractInterface -{ - Q_OBJECT -public: - static inline const char *staticInterfaceName() - { return "com.trolltech.Examples.CarInterface"; } - -public: - CarInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0); - - ~CarInterface(); - -public Q_SLOTS: // METHODS - inline QDBusReply accelerate() - { - QList argumentList; - return callWithArgumentList(QDBus::Block, QLatin1String("accelerate"), argumentList); - } - - inline QDBusReply decelerate() - { - QList argumentList; - return callWithArgumentList(QDBus::Block, QLatin1String("decelerate"), argumentList); - } - - inline QDBusReply turnLeft() - { - QList argumentList; - return callWithArgumentList(QDBus::Block, QLatin1String("turnLeft"), argumentList); - } - - inline QDBusReply turnRight() - { - QList argumentList; - return callWithArgumentList(QDBus::Block, QLatin1String("turnRight"), argumentList); - } - -Q_SIGNALS: // SIGNALS - void crashed(); -}; - -namespace com { - namespace trolltech { - namespace Examples { - typedef ::CarInterface CarInterface; - } - } -} -#endif diff --git a/examples/dbus/remotecontrolledcar/controller/controller.cpp b/examples/dbus/remotecontrolledcar/controller/controller.cpp index fd6aa13..a3d7c61 100644 --- a/examples/dbus/remotecontrolledcar/controller/controller.cpp +++ b/examples/dbus/remotecontrolledcar/controller/controller.cpp @@ -42,13 +42,13 @@ #include #include "controller.h" -#include "car_interface_p.h" +#include "car_interface.h" Controller::Controller(QWidget *parent) : QWidget(parent) { ui.setupUi(this); - car = new CarInterface("com.trolltech.CarExample", "/Car", + car = new com::trolltech::Examples::CarInterface("com.trolltech.CarExample", "/Car", QDBusConnection::sessionBus(), this); startTimer(1000); } diff --git a/examples/dbus/remotecontrolledcar/controller/controller.h b/examples/dbus/remotecontrolledcar/controller/controller.h index aa4cd43..b2265d2 100644 --- a/examples/dbus/remotecontrolledcar/controller/controller.h +++ b/examples/dbus/remotecontrolledcar/controller/controller.h @@ -43,8 +43,7 @@ #define CONTROLLER_H #include "ui_controller.h" - -class CarInterface; +#include "car_interface.h" class Controller : public QWidget { @@ -64,7 +63,7 @@ private slots: private: Ui::Controller ui; - CarInterface *car; + com::trolltech::Examples::CarInterface *car; }; #endif diff --git a/examples/dbus/remotecontrolledcar/controller/controller.pro b/examples/dbus/remotecontrolledcar/controller/controller.pro index 159e3b1..375b9d7 100644 --- a/examples/dbus/remotecontrolledcar/controller/controller.pro +++ b/examples/dbus/remotecontrolledcar/controller/controller.pro @@ -11,7 +11,7 @@ CONFIG += qdbus # Input # DBUS_INTERFACES += car.xml FORMS += controller.ui -HEADERS += car_interface_p.h controller.h +HEADERS += car_interface.h controller.h SOURCES += main.cpp car_interface.cpp controller.cpp # install -- cgit v0.12 From 7c5d48e84159abd0a72eadb2e14e4c3b1441fdfb Mon Sep 17 00:00:00 2001 From: ck Date: Fri, 4 Dec 2009 10:40:13 +0100 Subject: Assistant: More small refactorings + compile fix. --- tools/assistant/tools/assistant/main.cpp | 86 ++++++++++++++++++-------------- 1 file changed, 49 insertions(+), 37 deletions(-) diff --git a/tools/assistant/tools/assistant/main.cpp b/tools/assistant/tools/assistant/main.cpp index d009210..536095c 100644 --- a/tools/assistant/tools/assistant/main.cpp +++ b/tools/assistant/tools/assistant/main.cpp @@ -150,7 +150,7 @@ QString cachedCollectionFile(const QHelpEngineCore &collection) return dir + QDir::separator() + fileName; } -bool synchronizeDocs(const QHelpEngineCore &collection, +bool synchronizeDocs(QHelpEngineCore &collection, QHelpEngineCore &cachedCollection) { const QStringList &docs = collection.registeredDocumentations(); @@ -174,7 +174,7 @@ bool synchronizeDocs(const QHelpEngineCore &collection, */ QLatin1String intern("com.trolltech.com.assistantinternal-"); foreach (const QString &doc, cachedDocs) { - if (!collection.contains(doc) && !doc.startsWith(intern) + if (!docs.contains(doc) && !doc.startsWith(intern) && !cachedCollection.unregisterDocumentation(doc)) return false; } @@ -182,28 +182,62 @@ bool synchronizeDocs(const QHelpEngineCore &collection, return true; } -} // Anonymous namespace. +bool removeSearchIndex(const QString &collectionFile) +{ + QString path = QFileInfo(collectionFile).path(); + path += QLatin1Char('/') + indexFilesFolder(collectionFile); -int main(int argc, char *argv[]) + QLocalSocket localSocket; + localSocket.connectToServer(QString(QLatin1String("QtAssistant%1")) + .arg(QLatin1String(QT_VERSION_STR))); + + QDir dir(path); // check if there is no other instance ruinning + if (!dir.exists() || localSocket.waitForConnected()) + return false; + + QStringList lst = dir.entryList(QDir::Files | QDir::Hidden); + foreach (const QString &item, lst) + dir.remove(item); + return true; +} + +bool checkForSqlite(CmdLineParser &cmd) { -#ifndef Q_OS_WIN - // First do a quick search for arguments that imply command-line mode. + QSqlDatabase db; + QStringList sqlDrivers(db.drivers()); + if (!sqlDrivers.contains(QLatin1String("QSQLITE"))) { + cmd.showMessage(QObject::tr("Cannot load sqlite database driver!"), + true); + return false; + } + return true; +} + +bool useGui(int argc, char *argv[]) +{ + bool gui = true; +#ifndef Q_OS_WIN + // Look for arguments that imply command-line mode. const char * cmdModeArgs[] = { "-help", "-register", "-unregister", "-remove-search-index" }; - bool useGui = true; for (int i = 1; i < argc; ++i) { for (size_t j = 0; j < sizeof cmdModeArgs/sizeof *cmdModeArgs; ++j) { if(strcmp(argv[i], cmdModeArgs[j]) == 0) { - useGui = false; + gui = false; break; } } } - QApplication a(argc, argv, useGui); -#else - QApplication a(argc, argv); #endif + return gui; +} + +} // Anonymous namespace. + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv, useGui(argc, argv)); a.addLibraryPath(a.applicationDirPath() + QLatin1String("/plugins")); CmdLineParser cmd(a.arguments()); @@ -247,38 +281,16 @@ int main(int argc, char *argv[]) return 0; } + // TODO: Also remove search index of cached collection file? if (cmd.removeSearchIndex()) { QString file = cmdCollectionFile; if (file.isEmpty()) file = MainWindow::defaultHelpCollectionFileName(); - QString path = QFileInfo(file).path(); - path += QLatin1Char('/') + indexFilesFolder(file); - - QLocalSocket localSocket; - localSocket.connectToServer(QString(QLatin1String("QtAssistant%1")) - .arg(QLatin1String(QT_VERSION_STR))); - - QDir dir(path); // check if there is no other instance ruinning - if (!localSocket.waitForConnected() && dir.exists()) { - QStringList lst = dir.entryList(QDir::Files | QDir::Hidden); - foreach (const QString &item, lst) - dir.remove(item); - return 0; - } else { - return -1; - } + return removeSearchIndex(file) ? 0 : EXIT_FAILURE; } - { - QSqlDatabase db; - QStringList sqlDrivers(db.drivers()); - if (sqlDrivers.isEmpty() - || !sqlDrivers.contains(QLatin1String("QSQLITE"))) { - cmd.showMessage(QObject::tr("Cannot load sqlite database driver!"), - true); - return -1; - } - } + if (!checkForSqlite(cmd)) + return EXIT_FAILURE; if (!cmdCollectionFile.isEmpty()) { QHelpEngineCore caller(cmdCollectionFile); -- cgit v0.12 From 067cab5af9172335c07b48c42e6a665d5da9b54d Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Fri, 4 Dec 2009 10:53:51 +0100 Subject: Cocoa: impl. performance boost for dnd It turns out that registering drag types for each NSView that can receive drop events is _really_ slow. And many widget in Qt subscribe for DnD (QTextEdit, QScrollArea, etc), so the result is an application that will spend startup time preparing for DnD. For some edge cases, we're talking several seconds! This patch removes this overhead by moving drag type registering out of NSView, and into NSWindow (that is, QCocoaWindow and QCocoaPanel). Task-number: QT-1586 Reviewed-by: Prasanth --- src/gui/kernel/qcocoapanel_mac_p.h | 6 ++ src/gui/kernel/qcocoasharedwindowmethods_mac_p.h | 126 +++++++++++++++++++++++ src/gui/kernel/qcocoaview_mac.mm | 68 ++---------- src/gui/kernel/qcocoaview_mac_p.h | 2 - src/gui/kernel/qcocoawindow_mac_p.h | 3 + src/gui/kernel/qnsthemeframe_mac_p.h | 2 +- src/gui/kernel/qwidget_mac.mm | 9 +- 7 files changed, 151 insertions(+), 65 deletions(-) diff --git a/src/gui/kernel/qcocoapanel_mac_p.h b/src/gui/kernel/qcocoapanel_mac_p.h index 69dca1e..f35d9fb 100644 --- a/src/gui/kernel/qcocoapanel_mac_p.h +++ b/src/gui/kernel/qcocoapanel_mac_p.h @@ -54,10 +54,16 @@ #ifdef QT_MAC_USE_COCOA #import +QT_FORWARD_DECLARE_CLASS(QStringList); + @interface QT_MANGLE_NAMESPACE(QCocoaPanel) : NSPanel { bool leftButtonIsRightButton; + QStringList *currentCustomDragTypes; } + (Class)frameViewClassForStyleMask:(NSUInteger)styleMask; +- (void)registerDragTypes; + @end #endif + diff --git a/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h b/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h index f347240..8dd03aa 100644 --- a/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h +++ b/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h @@ -54,8 +54,31 @@ QT_BEGIN_NAMESPACE extern Qt::MouseButton cocoaButton2QtButton(NSInteger buttonNum); // qcocoaview.mm extern QPointer qt_button_down; //qapplication_mac.cpp +extern const QStringList& qEnabledDraggedTypes(); // qmime_mac.cpp + +Q_GLOBAL_STATIC(QPointer, currentDragTarget); + QT_END_NAMESPACE +- (id)initWithContentRect:(NSRect)contentRect + styleMask:(NSUInteger)windowStyle + backing:(NSBackingStoreType)bufferingType + defer:(BOOL)deferCreation +{ + self = [super initWithContentRect:contentRect styleMask:windowStyle + backing:bufferingType defer:deferCreation]; + if (self) { + currentCustomDragTypes = 0; + } + return self; +} + +- (void)dealloc +{ + delete currentCustomDragTypes; + [super dealloc]; +} + - (BOOL)canBecomeKeyWindow { QWidget *widget = [self QT_MANGLE_NAMESPACE(qt_qwidget)]; @@ -185,3 +208,106 @@ QT_END_NAMESPACE return [super frameViewClassForStyleMask:styleMask]; } +-(void)registerDragTypes +{ + // Calling registerForDraggedTypes below is slow, so only do + // it once for each window, or when the custom types change. + QMacCocoaAutoReleasePool pool; + const QStringList& customTypes = qEnabledDraggedTypes(); + if (currentCustomDragTypes == 0 || *currentCustomDragTypes != customTypes) { + if (currentCustomDragTypes == 0) + currentCustomDragTypes = new QStringList(); + *currentCustomDragTypes = customTypes; + const NSString* mimeTypeGeneric = @"com.trolltech.qt.MimeTypeName"; + NSMutableArray *supportedTypes = [NSMutableArray arrayWithObjects:NSColorPboardType, + NSFilenamesPboardType, NSStringPboardType, + NSFilenamesPboardType, NSPostScriptPboardType, NSTIFFPboardType, + NSRTFPboardType, NSTabularTextPboardType, NSFontPboardType, + NSRulerPboardType, NSFileContentsPboardType, NSColorPboardType, + NSRTFDPboardType, NSHTMLPboardType, NSPICTPboardType, + NSURLPboardType, NSPDFPboardType, NSVCardPboardType, + NSFilesPromisePboardType, NSInkTextPboardType, + NSMultipleTextSelectionPboardType, mimeTypeGeneric, nil]; + // Add custom types supported by the application. + for (int i = 0; i < customTypes.size(); i++) { + [supportedTypes addObject:reinterpret_cast(QCFString::toCFStringRef(customTypes[i]))]; + } + [self registerForDraggedTypes:supportedTypes]; + } +} + +- (QWidget *)dragTargetHitTest:(id )sender +{ + // Do a hittest to find the NSView under the + // mouse, and return the corresponding QWidget: + NSPoint windowPoint = [sender draggingLocation]; + NSView *candidateView = [[self contentView] hitTest:windowPoint]; + if (![candidateView isKindOfClass:[QT_MANGLE_NAMESPACE(QCocoaView) class]]) + return 0; + return [static_cast(candidateView) qt_qwidget]; +} + +- (NSDragOperation)draggingEntered:(id )sender +{ + // The user dragged something into the window. Send a draggingEntered message + // to the QWidget under the mouse. As the drag moves over the window, and over + // different widgets, we will handle enter and leave events from within + // draggingUpdated below. The reason why we handle this ourselves rather than + // subscribing for drag events directly in QCocoaView is that calling + // registerForDraggedTypes on the views will severly degrade initialization time + // for an application that uses a lot of drag subscribing widgets. + + QWidget *target = [self dragTargetHitTest:sender]; + if (!target) + return [super draggingEntered:sender]; + if (target->testAttribute(Qt::WA_DropSiteRegistered) == false) + return NSDragOperationNone; + + *currentDragTarget() = target; + return [reinterpret_cast((*currentDragTarget())->winId()) draggingEntered:sender]; + } + +- (NSDragOperation)draggingUpdated:(id < NSDraggingInfo >)sender +{ + QWidget *target = [self dragTargetHitTest:sender]; + if (!target) + return [super draggingUpdated:sender]; + + if (target == *currentDragTarget()) { + // The drag continues to move over the widget that we have sendt + // a draggingEntered message to. So just update the view: + return [reinterpret_cast((*currentDragTarget())->winId()) draggingUpdated:sender]; + } else { + // The widget under the mouse has changed. + // So we need to fake enter/leave events: + if (*currentDragTarget()) + [reinterpret_cast((*currentDragTarget())->winId()) draggingExited:sender]; + if (target->testAttribute(Qt::WA_DropSiteRegistered) == false) { + *currentDragTarget() = 0; + return NSDragOperationNone; + } + *currentDragTarget() = target; + return [reinterpret_cast((*currentDragTarget())->winId()) draggingEntered:sender]; + } +} + +- (void)draggingExited:(id < NSDraggingInfo >)sender +{ + if (*currentDragTarget()) + [reinterpret_cast((*currentDragTarget())->winId()) draggingExited:sender]; + else + [super draggingExited:sender]; + *currentDragTarget() = 0; +} + +- (BOOL)performDragOperation:(id < NSDraggingInfo >)sender +{ + BOOL dropAccepted = NO; + if (*currentDragTarget()) + dropAccepted = [reinterpret_cast((*currentDragTarget())->winId()) performDragOperation:sender]; + else + return [super performDragOperation:sender]; + *currentDragTarget() = 0; + return dropAccepted; +} + diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm index ddd8ca6..212684b 100644 --- a/src/gui/kernel/qcocoaview_mac.mm +++ b/src/gui/kernel/qcocoaview_mac.mm @@ -81,7 +81,6 @@ Q_GLOBAL_STATIC(DnDParams, qMacDnDParams); extern void qt_mac_update_cursor_at_global_pos(const QPoint &globalPos); // qcursor_mac.mm extern bool qt_sendSpontaneousEvent(QObject *, QEvent *); // qapplication.cpp extern OSViewRef qt_mac_nativeview_for(const QWidget *w); // qwidget_mac.mm -extern const QStringList& qEnabledDraggedTypes(); // qmime_mac.cpp extern QPointer qt_mouseover; //qapplication_mac.mm extern QPointer qt_button_down; //qapplication_mac.cpp @@ -212,7 +211,6 @@ extern "C" { composingText = new QString(); composing = false; sendKeyEvents = true; - currentCustomTypes = 0; [self setHidden:YES]; return self; } @@ -227,34 +225,6 @@ extern "C" { object:self]; } --(void)registerDragTypes -{ - QMacCocoaAutoReleasePool pool; - // Calling registerForDraggedTypes is slow, so only do it once for each widget - // or when the custom types change. - const QStringList& customTypes = qEnabledDraggedTypes(); - if (currentCustomTypes == 0 || *currentCustomTypes != customTypes) { - if (currentCustomTypes == 0) - currentCustomTypes = new QStringList(); - *currentCustomTypes = customTypes; - const NSString* mimeTypeGeneric = @"com.trolltech.qt.MimeTypeName"; - NSMutableArray *supportedTypes = [NSMutableArray arrayWithObjects:NSColorPboardType, - NSFilenamesPboardType, NSStringPboardType, - NSFilenamesPboardType, NSPostScriptPboardType, NSTIFFPboardType, - NSRTFPboardType, NSTabularTextPboardType, NSFontPboardType, - NSRulerPboardType, NSFileContentsPboardType, NSColorPboardType, - NSRTFDPboardType, NSHTMLPboardType, NSPICTPboardType, - NSURLPboardType, NSPDFPboardType, NSVCardPboardType, - NSFilesPromisePboardType, NSInkTextPboardType, - NSMultipleTextSelectionPboardType, mimeTypeGeneric, nil]; - // Add custom types supported by the application. - for (int i = 0; i < customTypes.size(); i++) { - [supportedTypes addObject:reinterpret_cast(QCFString::toCFStringRef(customTypes[i]))]; - } - [self registerForDraggedTypes:supportedTypes]; - } -} - - (void)resetCursorRects { QWidget *cursorWidget = qwidget; @@ -300,15 +270,9 @@ extern "C" { - (NSDragOperation)draggingEntered:(id )sender { - if (qwidget->testAttribute(Qt::WA_DropSiteRegistered) == false) - return NSDragOperationNone; + // NB: This function is called from QCoocaWindow/QCocoaPanel rather than directly + // from Cocoa. They modify the drag target, and might fake enter/leave events. NSPoint windowPoint = [sender draggingLocation]; - if (qwidget->testAttribute(Qt::WA_TransparentForMouseEvents)) { - // pass the drag enter event to the view underneath. - NSView *candidateView = [[[self window] contentView] hitTest:windowPoint]; - if (candidateView && candidateView != self) - return [candidateView draggingEntered:sender]; - } dragEnterSequence = [sender draggingSequenceNumber]; [self addDropData:sender]; QMimeData *mimeData = dropData; @@ -360,13 +324,9 @@ extern "C" { - (NSDragOperation)draggingUpdated:(id < NSDraggingInfo >)sender { + // NB: This function is called from QCoocaWindow/QCocoaPanel rather than directly + // from Cocoa. They modify the drag target, and might fake enter/leave events. NSPoint windowPoint = [sender draggingLocation]; - if (qwidget->testAttribute(Qt::WA_TransparentForMouseEvents)) { - // pass the drag move event to the view underneath. - NSView *candidateView = [[[self window] contentView] hitTest:windowPoint]; - if (candidateView && candidateView != self) - return [candidateView draggingUpdated:sender]; - } // in cases like QFocusFrame, the view under the mouse might // not have received the drag enter. Generate a synthetic // drag enter event for that view. @@ -414,14 +374,10 @@ extern "C" { - (void)draggingExited:(id < NSDraggingInfo >)sender { + // NB: This function is called from QCoocaWindow/QCocoaPanel rather than directly + // from Cocoa. They modify the drag target, and might fake enter/leave events. + Q_UNUSED(sender); dragEnterSequence = -1; - if (qwidget->testAttribute(Qt::WA_TransparentForMouseEvents)) { - // try sending the leave event to the last view which accepted drag enter. - DnDParams *dndParams = [QT_MANGLE_NAMESPACE(QCocoaView) currentMouseEvent]; - NSView *candidateView = [[[self window] contentView] hitTest:dndParams->activeDragEnterPos]; - if (candidateView && candidateView != self) - return [candidateView draggingExited:sender]; - } // drag enter event was rejected, so ignore the move event. if (dropData) { QDragLeaveEvent de; @@ -432,14 +388,10 @@ extern "C" { - (BOOL)performDragOperation:(id )sender { + // NB: This function is called from QCoocaWindow/QCocoaPanel rather than directly + // from Cocoa. They modify the drag target, and might fake enter/leave events. NSPoint windowPoint = [sender draggingLocation]; dragEnterSequence = -1; - if (qwidget->testAttribute(Qt::WA_TransparentForMouseEvents)) { - // pass the drop event to the view underneath. - NSView *candidateView = [[[self window] contentView] hitTest:windowPoint]; - if (candidateView && candidateView != self) - return [candidateView performDragOperation:sender]; - } [self addDropData:sender]; NSPoint globalPoint = [[sender draggingDestinationWindow] convertBaseToScreen:windowPoint]; @@ -469,8 +421,6 @@ extern "C" { { delete composingText; [[NSNotificationCenter defaultCenter] removeObserver:self]; - delete currentCustomTypes; - [self unregisterDraggedTypes]; [super dealloc]; } diff --git a/src/gui/kernel/qcocoaview_mac_p.h b/src/gui/kernel/qcocoaview_mac_p.h index d549177..e6ff423 100644 --- a/src/gui/kernel/qcocoaview_mac_p.h +++ b/src/gui/kernel/qcocoaview_mac_p.h @@ -87,7 +87,6 @@ Q_GUI_EXPORT int composingLength; bool sendKeyEvents; QString *composingText; - QStringList *currentCustomTypes; NSInteger dragEnterSequence; } - (id)initWithQWidget:(QWidget *)widget widgetPrivate:(QWidgetPrivate *)widgetprivate; @@ -97,7 +96,6 @@ Q_GUI_EXPORT - (NSDragOperation)draggingUpdated:(id < NSDraggingInfo >)sender; - (void)draggingExited:(id < NSDraggingInfo >)sender; - (BOOL)performDragOperation:(id )sender; -- (void)registerDragTypes; - (void)removeDropData; - (void)addDropData:(id )sender; - (void)setSupportedActions:(NSDragOperation)actions; diff --git a/src/gui/kernel/qcocoawindow_mac_p.h b/src/gui/kernel/qcocoawindow_mac_p.h index 91c5d4e..ea3461c 100644 --- a/src/gui/kernel/qcocoawindow_mac_p.h +++ b/src/gui/kernel/qcocoawindow_mac_p.h @@ -70,9 +70,12 @@ QT_FORWARD_DECLARE_CLASS(QStringList); @interface QT_MANGLE_NAMESPACE(QCocoaWindow) : NSWindow { bool leftButtonIsRightButton; + QStringList *currentCustomDragTypes; } + (Class)frameViewClassForStyleMask:(NSUInteger)styleMask; +- (void)registerDragTypes; + @end #endif diff --git a/src/gui/kernel/qnsthemeframe_mac_p.h b/src/gui/kernel/qnsthemeframe_mac_p.h index af1406b..c8c7f4a 100644 --- a/src/gui/kernel/qnsthemeframe_mac_p.h +++ b/src/gui/kernel/qnsthemeframe_mac_p.h @@ -157,7 +157,7 @@ - (void)resetCursorRects; - (char)shouldBeTreatedAsInkEvent:fp8; - (char)_shouldBeTreatedAsInkEventInInactiveWindow:fp8; -- hitTest:(struct _NSPoint)fp8; +//- hitTest:(struct _NSPoint)fp8; // collides with hittest in qcocoasharedwindowmethods_mac_p.h - (NSRect)_leftGroupRect; - (NSRect)_rightGroupRect; - (void)_updateWidgets; diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index 1907cca..c75358d 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -4554,9 +4554,12 @@ void QWidgetPrivate::registerDropSite(bool on) #ifndef QT_MAC_USE_COCOA SetControlDragTrackingEnabled(qt_mac_nativeview_for(q), on); #else - NSView *view = qt_mac_nativeview_for(q); - if (on && [view isKindOfClass:[QT_MANGLE_NAMESPACE(QCocoaView) class]]) { - [static_cast(view) registerDragTypes]; + NSWindow *win = qt_mac_window_for(q); + if (on) { + if ([win isKindOfClass:[QT_MANGLE_NAMESPACE(QCocoaWindow) class]]) + [static_cast(win) registerDragTypes]; + else if ([win isKindOfClass:[QT_MANGLE_NAMESPACE(QCocoaPanel) class]]) + [static_cast(win) registerDragTypes]; } #endif } -- cgit v0.12 From 08de984f0ed5b6e13cd802256df859778f842bbd Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Fri, 4 Dec 2009 11:35:14 +0100 Subject: Cocoa: amend dnd optimization: 067cab5af A couple of minutes after commiting 067cab5af, I realized I need to act a bit more nice to native NSViews that also might exist in the window: Let NSWindow handle the dnd drop if the view is not a QWidget (and not also if it is a QWidget, but not subscribing to dnd) Task-number: QT-1586 --- src/gui/kernel/qcocoasharedwindowmethods_mac_p.h | 26 +++++++++++++++--------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h b/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h index 8dd03aa..cc5839c 100644 --- a/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h +++ b/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h @@ -293,21 +293,27 @@ QT_END_NAMESPACE - (void)draggingExited:(id < NSDraggingInfo >)sender { - if (*currentDragTarget()) + QWidget *target = [self dragTargetHitTest:sender]; + if (!target) + return [super draggingExited:sender]; + + if (*currentDragTarget()) { [reinterpret_cast((*currentDragTarget())->winId()) draggingExited:sender]; - else - [super draggingExited:sender]; - *currentDragTarget() = 0; + *currentDragTarget() = 0; + } } - (BOOL)performDragOperation:(id < NSDraggingInfo >)sender { - BOOL dropAccepted = NO; - if (*currentDragTarget()) - dropAccepted = [reinterpret_cast((*currentDragTarget())->winId()) performDragOperation:sender]; - else + QWidget *target = [self dragTargetHitTest:sender]; + if (!target) return [super performDragOperation:sender]; - *currentDragTarget() = 0; - return dropAccepted; + + BOOL dropResult = NO; + if (*currentDragTarget()) { + dropResult = [reinterpret_cast((*currentDragTarget())->winId()) performDragOperation:sender]; + *currentDragTarget() = 0; + } + return dropResult; } -- cgit v0.12 From cbdf3dc7508131e31f1d221e7b6f44d4714d3caa Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Fri, 4 Dec 2009 15:54:49 +0100 Subject: Fix compilation of the QObject test The hardcoded generated include patch was wrong. Also don't error if the MOC_OUTPUT_REVISION change. The file will be updated if needed if ever the test start failing. --- tests/auto/qobject/moc_oldnormalizeobject.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/tests/auto/qobject/moc_oldnormalizeobject.cpp b/tests/auto/qobject/moc_oldnormalizeobject.cpp index 4f590ae..bde9c39 100644 --- a/tests/auto/qobject/moc_oldnormalizeobject.cpp +++ b/tests/auto/qobject/moc_oldnormalizeobject.cpp @@ -2,19 +2,14 @@ ** Meta object code from reading C++ file 'oldnormalizeobject.h' ** ** Created: Wed Nov 18 11:43:05 2009 -** by: The Qt Meta Object Compiler version 62 (Qt 4.7.0) +** by: The Qt Meta Object Compiler version 62 (Qt 4.6.0) ** -** WARNING! All changes made in this file will be lost! *****************************************************************************/ -#include "../../../../../../master/tests/auto/qobject/oldnormalizeobject.h" -#if !defined(Q_MOC_OUTPUT_REVISION) -#error "The header file 'oldnormalizeobject.h' doesn't include ." -#elif Q_MOC_OUTPUT_REVISION != 62 -#error "This file was generated using the moc from 4.7.0. It" -#error "cannot be used with the include files from this version of Qt." -#error "(The moc has changed too much.)" -#endif +// Yhis file was generated from moc version 4.6 to test binary compatibility +// It should *not* be generated by the current moc + +#include "oldnormalizeobject.h" QT_BEGIN_MOC_NAMESPACE static const uint qt_meta_data_OldNormalizeObject[] = { -- cgit v0.12 From 35a740fa663d4669a45ada9c37c46546e59bbb82 Mon Sep 17 00:00:00 2001 From: kh1 Date: Mon, 7 Dec 2009 13:12:59 +0100 Subject: Cleanup, no functional change. --- tools/assistant/lib/qhelpsearchquerywidget.cpp | 53 +++++++++++++++----------- 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/tools/assistant/lib/qhelpsearchquerywidget.cpp b/tools/assistant/lib/qhelpsearchquerywidget.cpp index 10d5470..4d1b336 100644 --- a/tools/assistant/lib/qhelpsearchquerywidget.cpp +++ b/tools/assistant/lib/qhelpsearchquerywidget.cpp @@ -41,8 +41,6 @@ #include "qhelpsearchquerywidget.h" -#include - #include #include #include @@ -101,8 +99,9 @@ private: }; QHelpSearchQueryWidgetPrivate() - : QObject(), simpleSearch(true), - searchCompleter(new CompleterModel(this), this) + : QObject() + , simpleSearch(true) + , searchCompleter(new CompleterModel(this), this) { searchButton = 0; advancedSearchWidget = 0; @@ -179,8 +178,8 @@ private: } } - void nextOrPrevQuery(int maxOrMinIndex, int addend, - QToolButton *thisButton, QToolButton *otherButton) + void nextOrPrevQuery(int maxOrMinIndex, int addend, QToolButton *thisButton, + QToolButton *otherButton) { QueryHistory *queryHist; QList lineEdits; @@ -190,7 +189,7 @@ private: } else { queryHist = &complexQueries; lineEdits << allQuery << atLeastQuery << similarQuery - << withoutQuery << exactQuery; + << withoutQuery << exactQuery; } foreach (QLineEdit *lineEdit, lineEdits) lineEdit->clear(); @@ -235,11 +234,11 @@ private: void enableOrDisableToolButtons() { - const QueryHistory &queryHist = - simpleSearch ? simpleQueries : complexQueries; + const QueryHistory &queryHist = simpleSearch ? simpleQueries + : complexQueries; prevQueryButton->setEnabled(queryHist.curQuery > 0); - nextQueryButton->setEnabled(queryHist.curQuery < - queryHist.queries.size() - 1); + nextQueryButton->setEnabled(queryHist.curQuery + < queryHist.queries.size() - 1); } private slots: @@ -263,20 +262,22 @@ private slots: QList queryList; #if !defined(QT_CLUCENE_SUPPORT) queryList.append(QHelpSearchQuery(QHelpSearchQuery::DEFAULT, - QStringList(defaultQuery->text()))); + QStringList(defaultQuery->text()))); #else if (defaultQuery->isEnabled()) { queryList.append(QHelpSearchQuery(QHelpSearchQuery::DEFAULT, - buildTermList(defaultQuery->text()))); + buildTermList(defaultQuery->text()))); } else { const QRegExp exp(QLatin1String("\\s+")); - QStringList lst = similarQuery->text().split(exp, QString::SkipEmptyParts); + QStringList lst = similarQuery->text().split(exp, + QString::SkipEmptyParts); if (!lst.isEmpty()) { QStringList fuzzy; foreach (const QString term, lst) fuzzy += buildTermList(term); - queryList.append(QHelpSearchQuery(QHelpSearchQuery::FUZZY, fuzzy)); + queryList.append(QHelpSearchQuery(QHelpSearchQuery::FUZZY, + fuzzy)); } lst = withoutQuery->text().split(exp, QString::SkipEmptyParts); @@ -284,13 +285,15 @@ private slots: QStringList without; foreach (const QString term, lst) without.append(term); - queryList.append(QHelpSearchQuery(QHelpSearchQuery::WITHOUT, without)); + queryList.append(QHelpSearchQuery(QHelpSearchQuery::WITHOUT, + without)); } if (!exactQuery->text().isEmpty()) { QString phrase = exactQuery->text().remove(QLatin1Char('\"')); phrase = phrase.simplified(); - queryList.append(QHelpSearchQuery(QHelpSearchQuery::PHRASE, QStringList(phrase))); + queryList.append(QHelpSearchQuery(QHelpSearchQuery::PHRASE, + QStringList(phrase))); } lst = allQuery->text().split(exp, QString::SkipEmptyParts); @@ -306,7 +309,8 @@ private slots: QStringList atLeast; foreach (const QString term, lst) atLeast += buildTermList(term); - queryList.append(QHelpSearchQuery(QHelpSearchQuery::ATLEAST, atLeast)); + queryList.append(QHelpSearchQuery(QHelpSearchQuery::ATLEAST, + atLeast)); } } #endif @@ -320,8 +324,9 @@ private slots: void nextQuery() { - nextOrPrevQuery((simpleSearch ? simpleQueries : complexQueries).queries.size() - 1, - 1, nextQueryButton, prevQueryButton); + nextOrPrevQuery((simpleSearch ? simpleQueries + : complexQueries).queries.size() - 1, 1, nextQueryButton, + prevQueryButton); } void prevQuery() @@ -365,8 +370,9 @@ private: \fn void QHelpSearchQueryWidget::search() This signal is emitted when a the user has the search button invoked. - After reciving the signal you can ask the QHelpSearchQueryWidget for the build list - of QHelpSearchQuery's that you may pass to the QHelpSearchEngine's search() function. + After reciving the signal you can ask the QHelpSearchQueryWidget for the + build list of QHelpSearchQuery's that you may pass to the QHelpSearchEngine's + search() function. */ /*! @@ -494,7 +500,8 @@ QList QHelpSearchQueryWidget::query() const QList() : queryHist.queries.last(); } -/*! \reimp +/*! + \reimp */ void QHelpSearchQueryWidget::focusInEvent(QFocusEvent *focusEvent) { -- cgit v0.12 From 5cd4bad136878af59d368b1749a76b9cbbd246ec Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Mon, 7 Dec 2009 15:02:01 +0100 Subject: Fix performance issue with live resize Calling [NSView addTrackingArea] is slow. So doing this for views that are not even visible on screen is unnecesary. This patch will greatly improve the speed for some (perhaps extreme) cases. Task-number: QT-1610 Reviewed-by: MortenS --- src/gui/kernel/qcocoaview_mac.mm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm index 212684b..1039a75 100644 --- a/src/gui/kernel/qcocoaview_mac.mm +++ b/src/gui/kernel/qcocoaview_mac.mm @@ -555,6 +555,10 @@ extern "C" { - (void)updateTrackingAreas { + // [NSView addTrackingArea] is slow, so bail out early if we can: + if (NSIsEmptyRect([self visibleRect])) + return; + QMacCocoaAutoReleasePool pool; if (NSArray *trackingArray = [self trackingAreas]) { NSUInteger size = [trackingArray count]; -- cgit v0.12 From e413a4fee2c09448e9498b000a7ff88e68c823d3 Mon Sep 17 00:00:00 2001 From: ck Date: Mon, 7 Dec 2009 15:26:20 +0100 Subject: Assistant: Logical re-structuring of start-up code. Reviewed-by: kh1 --- .../tools/assistant/helpenginewrapper.cpp | 8 +- .../assistant/tools/assistant/helpenginewrapper.h | 3 +- tools/assistant/tools/assistant/main.cpp | 274 +++++++++++---------- tools/assistant/tools/assistant/mainwindow.cpp | 1 - .../tools/shared/collectionconfiguration.cpp | 23 +- .../tools/shared/collectionconfiguration.h | 11 +- 6 files changed, 172 insertions(+), 148 deletions(-) diff --git a/tools/assistant/tools/assistant/helpenginewrapper.cpp b/tools/assistant/tools/assistant/helpenginewrapper.cpp index d399d1e..3835a63 100644 --- a/tools/assistant/tools/assistant/helpenginewrapper.cpp +++ b/tools/assistant/tools/assistant/helpenginewrapper.cpp @@ -96,6 +96,7 @@ HelpEngineWrapper::HelpEngineWrapper(const QString &collectionFile) this, SIGNAL(currentFilterChanged(QString))); connect(m_helpEngine, SIGNAL(setupFinished()), this, SIGNAL(setupFinished())); + initFileSystemWatchers(); } void HelpEngineWrapper::initFileSystemWatchers() @@ -146,6 +147,7 @@ const QString HelpEngineWrapper::collectionFile() const bool HelpEngineWrapper::registerDocumentation(const QString &docFile) { + assertDocFilesWatched(); if (!m_helpEngine->registerDocumentation(docFile)) return false; m_qchWatcher->addPath(docFile); @@ -155,11 +157,11 @@ bool HelpEngineWrapper::registerDocumentation(const QString &docFile) bool HelpEngineWrapper::unregisterDocumentation(const QString &namespaceName) { - const QString &internalFile = - m_helpEngine->documentationFileName(namespaceName); + assertDocFilesWatched(); + const QString &file = m_helpEngine->documentationFileName(namespaceName); if (!m_helpEngine->unregisterDocumentation(namespaceName)) return false; - m_qchWatcher->removePath(internalFile); + m_qchWatcher->removePath(file); assertDocFilesWatched(); return true; } diff --git a/tools/assistant/tools/assistant/helpenginewrapper.h b/tools/assistant/tools/assistant/helpenginewrapper.h index 1fc9eb6..f827d95 100644 --- a/tools/assistant/tools/assistant/helpenginewrapper.h +++ b/tools/assistant/tools/assistant/helpenginewrapper.h @@ -75,8 +75,6 @@ public: static HelpEngineWrapper &instance(const QString &collectionFile = QString()); static void removeInstance(); - void initFileSystemWatchers(); - // Forwarded help engine member functions, possibly enriched. QHelpSearchEngine *searchEngine() const; QHelpContentModel *contentModel() const; @@ -200,6 +198,7 @@ private slots: private: HelpEngineWrapper(const QString &collectionFile); + void initFileSystemWatchers(); void assertDocFilesWatched(); static HelpEngineWrapper *helpEngineWrapper; diff --git a/tools/assistant/tools/assistant/main.cpp b/tools/assistant/tools/assistant/main.cpp index 536095c..be13b0a 100644 --- a/tools/assistant/tools/assistant/main.cpp +++ b/tools/assistant/tools/assistant/main.cpp @@ -41,11 +41,12 @@ #include #include +#include #include +#include +#include #include -#include #include -#include #include #include @@ -105,20 +106,14 @@ updateUserCollection(QHelpEngineCore& user, const QHelpEngineCore& caller) return true; } -bool -referencedHelpFilesExistAll(QHelpEngineCore& user, QStringList& nameSpaces) +void stripNonexistingDocs(QHelpEngineCore& collection) { - QFileInfo fi; - int counter = nameSpaces.count(); - for (int i = counter; --i >= 0;) { - const QString& nameSpace = nameSpaces.at(i); - fi.setFile(user.documentationFileName(nameSpace)); - if (!fi.exists() || !fi.isFile()) { - user.unregisterDocumentation(nameSpace); - nameSpaces.removeAll(nameSpace); - } + const QStringList &namespaces = collection.registeredDocumentations(); + foreach (const QString &ns, namespaces) { + QFileInfo fi(collection.documentationFileName(ns)); + if (!fi.exists() || !fi.isFile()) + collection.unregisterDocumentation(ns); } - return (counter != nameSpaces.count()) ? false : true; } QString indexFilesFolder(const QString &collectionFile) @@ -137,7 +132,7 @@ QString indexFilesFolder(const QString &collectionFile) * correspondinging to the given collection's file. * It may or may not exist yet. */ -QString cachedCollectionFile(const QHelpEngineCore &collection) +QString constructCachedCollectionFilePath(const QHelpEngineCore &collection) { const QString &filePath = collection.collectionFile(); const QString &fileName = QFileInfo(filePath).fileName(); @@ -151,33 +146,34 @@ QString cachedCollectionFile(const QHelpEngineCore &collection) } bool synchronizeDocs(QHelpEngineCore &collection, - QHelpEngineCore &cachedCollection) + QHelpEngineCore &cachedCollection, + CmdLineParser &cmd) { + const QDateTime &lastCollectionRegisterTime = + CollectionConfiguration::lastRegisterTime(collection); + if (!lastCollectionRegisterTime.isValid() || lastCollectionRegisterTime + < CollectionConfiguration::lastRegisterTime(cachedCollection)) + return true; + const QStringList &docs = collection.registeredDocumentations(); const QStringList &cachedDocs = cachedCollection.registeredDocumentations(); /* - * Step 1: Ensure that the cached collection contains all docs that - * the collection contains. + * Ensure that the cached collection contains all docs that + * the collection contains. */ foreach (const QString &doc, docs) { if (!cachedDocs.contains(doc)) { - if (!cachedCollection.registerDocumentation( - collection.documentationFileName(doc))) + const QString &docFile = collection.documentationFileName(doc); + if (!cachedCollection.registerDocumentation(docFile)) { + cmd.showMessage(QObject::tr("Error registering documentation file '%1': %2"). + arg(docFile).arg(cachedCollection.error()), true); return false; + } } } - /* - * Step 2: Ensure that the cached collection contains no docs that - * the collection doesn't contain. - */ - QLatin1String intern("com.trolltech.com.assistantinternal-"); - foreach (const QString &doc, cachedDocs) { - if (!docs.contains(doc) && !doc.startsWith(intern) - && !cachedCollection.unregisterDocumentation(doc)) - return false; - } + CollectionConfiguration::updateLastRegisterTime(cachedCollection); return true; } @@ -233,6 +229,56 @@ bool useGui(int argc, char *argv[]) return gui; } +bool registerDocumentation(QHelpEngineCore &collection, CmdLineParser &cmd, + bool printSuccess) +{ + if (!collection.registerDocumentation(cmd.helpFile())) { + cmd.showMessage( + QObject::tr("Could not register documentation file\n%1\n\nReason:\n%2") + .arg(cmd.helpFile()).arg(collection.error()), true); + return false; + } + if (printSuccess) + cmd.showMessage(QObject::tr("Documentation successfully registered."), + false); + CollectionConfiguration::updateLastRegisterTime(collection); + return true; +} + +bool unregisterDocumentation(QHelpEngineCore &collection, + const QString &namespaceName, CmdLineParser &cmd, bool printSuccess) +{ + if (!collection.unregisterDocumentation(namespaceName)) { + cmd.showMessage(QObject::tr("Could not unregister documentation" + " file\n%1\n\nReason:\n%2"). + arg(cmd.helpFile()).arg(collection.error()), true); + return false; + } + updateLastPagesOnUnregister(collection, namespaceName); + if (printSuccess) + cmd.showMessage(QObject::tr("Documentation successfully unregistered."), + false); + return true; +} + +void setupTranslations(QApplication &app) +{ + const QString& locale = QLocale::system().name(); + QString resourceDir = QLibraryInfo::location(QLibraryInfo::TranslationsPath); + + QTranslator translator(0); + translator.load(QLatin1String("assistant_") + locale, resourceDir); + app.installTranslator(&translator); + + QTranslator qtTranslator(0); + qtTranslator.load(QLatin1String("qt_") + locale, resourceDir); + app.installTranslator(&qtTranslator); + + QTranslator qtHelpTranslator(0); + qtHelpTranslator.load(QLatin1String("qt_help_") + locale, resourceDir); + app.installTranslator(&qtHelpTranslator); +} + } // Anonymous namespace. int main(int argc, char *argv[]) @@ -240,6 +286,7 @@ int main(int argc, char *argv[]) QApplication a(argc, argv, useGui(argc, argv)); a.addLibraryPath(a.applicationDirPath() + QLatin1String("/plugins")); + // Parse arguments. CmdLineParser cmd(a.arguments()); CmdLineParser::Result res = cmd.parse(); if (res == CmdLineParser::Help) @@ -247,126 +294,99 @@ int main(int argc, char *argv[]) else if (res == CmdLineParser::Error) return -1; - QString cmdCollectionFile = cmd.collectionFile(); + /* + * Create the collection objects that we need. We always have the + * cached collection file. Depending on whether the user specified + * one, we also may have an input collection file. + */ + const QString collectionFile = cmd.collectionFile(); + const bool collectionFileGiven = !collectionFile.isEmpty(); + QScopedPointer collection; + if (collectionFileGiven) { + collection.reset(new QHelpEngineCore(collectionFile)); + if (!collection->setupData()) { + cmd.showMessage(QObject::tr("Error reading collection file '%1': %2."). + arg(collectionFile).arg(collection->error()), true); + return EXIT_FAILURE; + } + } + const QString &cachedCollectionFile = collectionFileGiven + ? constructCachedCollectionFilePath(*collection) + : MainWindow::defaultHelpCollectionFileName(); + if (collectionFileGiven && !QFileInfo(cachedCollectionFile).exists() + && !collection->copyCollectionFile(cachedCollectionFile)) { + cmd.showMessage(QObject::tr("Error creating collection file '%1': %2."). + arg(cachedCollectionFile).arg(collection->error()), true); + return EXIT_FAILURE; + } + QHelpEngineCore cachedCollection(cachedCollectionFile); + if (!cachedCollection.setupData()) { + cmd.showMessage(QObject::tr("Error reading collection file '%1': %2"). + arg(cachedCollectionFile). + arg(cachedCollection.error()), true); + return EXIT_FAILURE; + } + + stripNonexistingDocs(cachedCollection); + if (collectionFileGiven) { + if (CollectionConfiguration::isNewer(*collection, cachedCollection)) + CollectionConfiguration::copyConfiguration(*collection, + cachedCollection); + if (!synchronizeDocs(*collection, cachedCollection, cmd)) + return EXIT_FAILURE; + } + if (cmd.registerRequest() != CmdLineParser::None) { - if (cmdCollectionFile.isEmpty()) - cmdCollectionFile = MainWindow::defaultHelpCollectionFileName(); - QHelpEngineCore help(cmdCollectionFile); - help.setupData(); + const QStringList &cachedDocs = + cachedCollection.registeredDocumentations(); + const QString &namespaceName = + QHelpEngineCore::namespaceName(cmd.helpFile()); if (cmd.registerRequest() == CmdLineParser::Register) { - if (!help.registerDocumentation(cmd.helpFile())) { - cmd.showMessage( - QObject::tr("Could not register documentation file\n%1\n\nReason:\n%2") - .arg(cmd.helpFile()).arg(help.error()), true); - return -1; - } else { - cmd.showMessage(QObject::tr("Documentation successfully registered."), - false); - } - } else { - QString nsName = QHelpEngineCore::namespaceName(cmd.helpFile()); - if (help.unregisterDocumentation(nsName)) { - updateLastPagesOnUnregister(help, nsName); - cmd.showMessage( - QObject::tr("Documentation successfully unregistered."), - false); - } else { - cmd.showMessage(QObject::tr("Could not unregister documentation" - " file\n%1\n\nReason:\n%2").arg(cmd.helpFile()). - arg(help.error()), true); - return -1; - } + if (collectionFileGiven && !registerDocumentation(*collection, cmd, true)) + return EXIT_FAILURE; + if (!cachedDocs.contains(namespaceName) + && !registerDocumentation(cachedCollection, cmd, !collectionFileGiven)) + return EXIT_FAILURE; + return EXIT_SUCCESS; + } + if (cmd.registerRequest() == CmdLineParser::Unregister) { + if (collectionFileGiven + && !unregisterDocumentation(*collection, namespaceName, cmd, true)) + return EXIT_FAILURE; + if (cachedDocs.contains(namespaceName) + && !unregisterDocumentation(cachedCollection, namespaceName, + cmd, !collectionFileGiven)) + return EXIT_FAILURE; + return EXIT_SUCCESS; } - CollectionConfiguration::setDocUpdatePending(help, true); - return 0; } - // TODO: Also remove search index of cached collection file? if (cmd.removeSearchIndex()) { - QString file = cmdCollectionFile; - if (file.isEmpty()) - file = MainWindow::defaultHelpCollectionFileName(); - return removeSearchIndex(file) ? 0 : EXIT_FAILURE; + return removeSearchIndex(cachedCollectionFile) ? EXIT_SUCCESS : EXIT_FAILURE; } if (!checkForSqlite(cmd)) return EXIT_FAILURE; - if (!cmdCollectionFile.isEmpty()) { - QHelpEngineCore caller(cmdCollectionFile); - if (!caller.setupData()) { - cmd.showMessage(QObject::tr("The specified collection file could " - "not be read!"), true); - return -1; - } - - const QString &cachedCollectionFilePath = cachedCollectionFile(caller); - if (!QFileInfo(cachedCollectionFilePath).exists()) { - if (!caller.copyCollectionFile(cachedCollectionFilePath)) { - cmd.showMessage(caller.error(), true); - return -1; - } - } else { - QHelpEngineCore user(cachedCollectionFilePath); - if (user.setupData()) { - // some docs might have been un/registered - bool docUpdate = CollectionConfiguration::docUpdatePending(caller); - - // update in case the passed collection file changed - if (updateUserCollection(user, caller)) - docUpdate = true; - - QStringList userDocs = user.registeredDocumentations(); - // update user collection file, docs might have been (re)moved - if (!referencedHelpFilesExistAll(user, userDocs)) - docUpdate = true; - - if (docUpdate) { - synchronizeDocs(caller, user); - CollectionConfiguration::setDocUpdatePending(caller, false); - } - } - } - cmd.setCollectionFile(cachedCollectionFilePath); - } - if (!cmd.currentFilter().isEmpty()) { - QString collectionFile; - if (cmdCollectionFile.isEmpty()) { - MainWindow::collectionFileDirectory(true); - cmdCollectionFile = MainWindow::defaultHelpCollectionFileName(); - } - - QHelpEngineCore user(cmdCollectionFile); - if (user.setupData()) - user.setCurrentFilter(cmd.currentFilter()); + if (collectionFileGiven) + collection->setCurrentFilter(cmd.currentFilter()); + cachedCollection.setCurrentFilter(cmd.currentFilter()); } - const QString& locale = QLocale::system().name(); - QString resourceDir = QLibraryInfo::location(QLibraryInfo::TranslationsPath); - - QTranslator translator(0); - translator.load(QLatin1String("assistant_") + locale, resourceDir); - a.installTranslator(&translator); - - QTranslator qtTranslator(0); - qtTranslator.load(QLatin1String("qt_") + locale, resourceDir); - a.installTranslator(&qtTranslator); - - QTranslator qtHelpTranslator(0); - qtHelpTranslator.load(QLatin1String("qt_help_") + locale, resourceDir); - a.installTranslator(&qtHelpTranslator); + setupTranslations(a); /* * We need to be careful here: The main window has to be deleted before * the help engine wrapper, which has to be deleted before the * QApplication. */ - int retval; + if (collectionFileGiven) + cmd.setCollectionFile(cachedCollectionFile); MainWindow *w = new MainWindow(&cmd); w->show(); a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); - retval = a.exec(); + const int retval = a.exec(); delete w; delete &HelpEngineWrapper::instance(); return retval; diff --git a/tools/assistant/tools/assistant/mainwindow.cpp b/tools/assistant/tools/assistant/mainwindow.cpp index 226ad51..9955c65 100644 --- a/tools/assistant/tools/assistant/mainwindow.cpp +++ b/tools/assistant/tools/assistant/mainwindow.cpp @@ -244,7 +244,6 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent) else checkInitState(); - helpEngineWrapper.initFileSystemWatchers(); connect(&helpEngineWrapper, SIGNAL(documentationRemoved(QString)), this, SLOT(documentationRemoved(QString))); connect(&helpEngineWrapper, SIGNAL(documentationUpdated(QString)), diff --git a/tools/assistant/tools/shared/collectionconfiguration.cpp b/tools/assistant/tools/shared/collectionconfiguration.cpp index ba643c9..896afaf 100644 --- a/tools/assistant/tools/shared/collectionconfiguration.cpp +++ b/tools/assistant/tools/shared/collectionconfiguration.cpp @@ -55,13 +55,13 @@ namespace { const QString CacheDirRelativeToCollectionKey(QLatin1String("CacheDirRelativeToCollection")); const QString CreationTimeKey(QLatin1String("CreationTime")); const QString DefaultHomePageKey(QLatin1String("defaultHomepage")); - const QString DocUpdatePendingKey(QLatin1String("DocUpdate")); const QString EnableAddressBarKey(QLatin1String("EnableAddressBar")); const QString EnableDocManagerKey(QLatin1String("EnableDocumentationManager")); const QString EnableFilterKey(QLatin1String("EnableFilterFunctionality")); const QString HideAddressBarKey(QLatin1String("HideAddressBar")); const QString FilterToolbarHiddenKey(QLatin1String("HideFilterFunctionality")); const QString LastPageKey(QLatin1String("LastTabPage")); + const QString LastRegisterTime(QLatin1String("LastRegisterTime")); const QString LastShownPagesKey(QLatin1String("LastShownPages")); const QString LastZoomFactorsKey(QLatin1String( #if !defined(QT_NO_WEBKIT) @@ -237,17 +237,6 @@ void CollectionConfiguration::setDefaultHomePage(QHelpEngineCore &helpEngine, helpEngine.setCustomValue(DefaultHomePageKey, page); } -bool CollectionConfiguration::docUpdatePending(const QHelpEngineCore &helpEngine) -{ - return helpEngine.customValue(DocUpdatePendingKey, false).toBool(); -} - -void CollectionConfiguration::setDocUpdatePending(QHelpEngineCore &helpEngine, - bool pending) -{ - helpEngine.setCustomValue(DocUpdatePendingKey, pending); -} - const QStringList CollectionConfiguration::lastShownPages(const QHelpEngineCore &helpEngine) { return helpEngine.customValue(LastShownPagesKey).toString(). @@ -285,6 +274,16 @@ void CollectionConfiguration::setLastTabPage(QHelpEngineCore &helpEngine, helpEngine.setCustomValue(LastPageKey, lastPage); } +const QDateTime CollectionConfiguration::lastRegisterTime(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(LastRegisterTime, QDateTime()).toDateTime(); +} + +void CollectionConfiguration::updateLastRegisterTime(QHelpEngineCore &helpEngine) +{ + helpEngine.setCustomValue(LastRegisterTime, QDateTime::currentDateTime()); +} + bool CollectionConfiguration::isNewer(const QHelpEngineCore &newer, const QHelpEngineCore &older) { diff --git a/tools/assistant/tools/shared/collectionconfiguration.h b/tools/assistant/tools/shared/collectionconfiguration.h index 4e77abe..d897adb 100644 --- a/tools/assistant/tools/shared/collectionconfiguration.h +++ b/tools/assistant/tools/shared/collectionconfiguration.h @@ -44,6 +44,7 @@ #include #include +#include #include #include @@ -111,9 +112,6 @@ public: static void setDefaultHomePage(QHelpEngineCore &helpEngine, const QString &page); - static bool docUpdatePending(const QHelpEngineCore &helpEngine); - static void setDocUpdatePending(QHelpEngineCore &helpEngine, bool pending); - // TODO: Don't allow last pages and zoom factors to be set in isolation // Perhaps also fill up missing elements automatically or assert. static const QStringList lastShownPages(const QHelpEngineCore &helpEngine); @@ -131,6 +129,13 @@ public: static void copyConfiguration(const QHelpEngineCore &source, QHelpEngineCore &target); + /* + * Note that this only reflects register actions caused by the + * "-register" command line switch, not GUI or remote control actions. + */ + static const QDateTime lastRegisterTime(const QHelpEngineCore &helpEngine); + static void updateLastRegisterTime(QHelpEngineCore &helpEngine); + static const QString DefaultZoomFactor; static const QString ListSeparator; }; -- cgit v0.12 From 20d65deb30d3286481402880ff6f646579b687c2 Mon Sep 17 00:00:00 2001 From: ck Date: Mon, 7 Dec 2009 15:50:50 +0100 Subject: Assistant: Use tracing macro in all functions. Reviewed-by: kh1 --- tools/assistant/tools/assistant/aboutdialog.cpp | 11 +++ .../assistant/tools/assistant/bookmarkmanager.cpp | 46 +++++++++++ tools/assistant/tools/assistant/centralwidget.cpp | 68 ++++++++++++++++ tools/assistant/tools/assistant/cmdlineparser.cpp | 29 +++++++ tools/assistant/tools/assistant/contentwindow.cpp | 12 +++ .../assistant/tools/assistant/filternamedialog.cpp | 4 + .../tools/assistant/helpenginewrapper.cpp | 90 ++++++++++++++++++++++ tools/assistant/tools/assistant/helpviewer.cpp | 36 +++++++++ tools/assistant/tools/assistant/indexwindow.cpp | 10 +++ tools/assistant/tools/assistant/installdialog.cpp | 15 ++++ tools/assistant/tools/assistant/main.cpp | 14 ++++ tools/assistant/tools/assistant/mainwindow.cpp | 62 +++++++++++++++ .../tools/assistant/preferencesdialog.cpp | 21 +++++ tools/assistant/tools/assistant/qtdocinstaller.cpp | 6 ++ tools/assistant/tools/assistant/remotecontrol.cpp | 20 +++++ tools/assistant/tools/assistant/searchwidget.cpp | 14 ++++ tools/assistant/tools/assistant/topicchooser.cpp | 3 + tools/assistant/tools/assistant/xbelsupport.cpp | 11 +++ 18 files changed, 472 insertions(+) diff --git a/tools/assistant/tools/assistant/aboutdialog.cpp b/tools/assistant/tools/assistant/aboutdialog.cpp index d8fd37c..6afb375 100644 --- a/tools/assistant/tools/assistant/aboutdialog.cpp +++ b/tools/assistant/tools/assistant/aboutdialog.cpp @@ -38,6 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#include "tracer.h" #include @@ -56,6 +57,7 @@ QT_BEGIN_NAMESPACE AboutLabel::AboutLabel(QWidget *parent) : QTextBrowser(parent) { + TRACE_OBJ setFrameStyle(QFrame::NoFrame); QPalette p; p.setColor(QPalette::Base, p.color(QPalette::Background)); @@ -64,6 +66,7 @@ AboutLabel::AboutLabel(QWidget *parent) void AboutLabel::setText(const QString &text, const QByteArray &resources) { + TRACE_OBJ QDataStream in(resources); in >> m_resourceMap; @@ -72,6 +75,7 @@ void AboutLabel::setText(const QString &text, const QByteArray &resources) QSize AboutLabel::minimumSizeHint() const { + TRACE_OBJ QTextDocument *doc = document(); doc->adjustSize(); return QSize(int(doc->size().width()), int(doc->size().height())); @@ -79,6 +83,7 @@ QSize AboutLabel::minimumSizeHint() const QVariant AboutLabel::loadResource(int type, const QUrl &name) { + TRACE_OBJ if (type == 2 || type == 3) { if (m_resourceMap.contains(name.toString())) { return m_resourceMap.value(name.toString()); @@ -89,6 +94,7 @@ QVariant AboutLabel::loadResource(int type, const QUrl &name) void AboutLabel::setSource(const QUrl &url) { + TRACE_OBJ if (url.isValid() && (url.scheme() == QLatin1String("http") || url.scheme() == QLatin1String("ftp") || url.scheme() == QLatin1String("mailto") || url.path().endsWith(QLatin1String("pdf")))) { @@ -103,6 +109,7 @@ void AboutLabel::setSource(const QUrl &url) AboutDialog::AboutDialog(QWidget *parent) : QDialog(parent, Qt::MSWindowsFixedSizeDialogHint|Qt::WindowTitleHint|Qt::WindowSystemMenuHint) { + TRACE_OBJ m_pixmapLabel = 0; m_aboutLabel = new AboutLabel(); @@ -121,12 +128,14 @@ AboutDialog::AboutDialog(QWidget *parent) void AboutDialog::setText(const QString &text, const QByteArray &resources) { + TRACE_OBJ m_aboutLabel->setText(text, resources); updateSize(); } void AboutDialog::setPixmap(const QPixmap &pixmap) { + TRACE_OBJ if (!m_pixmapLabel) { m_pixmapLabel = new QLabel(); m_layout->addWidget(m_pixmapLabel, 0, 0, 1, -1, Qt::AlignCenter); @@ -137,11 +146,13 @@ void AboutDialog::setPixmap(const QPixmap &pixmap) QString AboutDialog::documentTitle() const { + TRACE_OBJ return m_aboutLabel->documentTitle(); } void AboutDialog::updateSize() { + TRACE_OBJ QSize screenSize = QApplication::desktop()->availableGeometry(QCursor::pos()).size(); int limit = qMin(screenSize.width()/2, 500); diff --git a/tools/assistant/tools/assistant/bookmarkmanager.cpp b/tools/assistant/tools/assistant/bookmarkmanager.cpp index f8cad4d..592c643 100644 --- a/tools/assistant/tools/assistant/bookmarkmanager.cpp +++ b/tools/assistant/tools/assistant/bookmarkmanager.cpp @@ -38,6 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#include "tracer.h" #include "bookmarkmanager.h" #include "centralwidget.h" @@ -69,6 +70,7 @@ BookmarkDialog::BookmarkDialog(BookmarkManager *manager, const QString &title, , m_title(title) , bookmarkManager(manager) { + TRACE_OBJ installEventFilter(this); ui.setupUi(this); @@ -114,10 +116,12 @@ BookmarkDialog::BookmarkDialog(BookmarkManager *manager, const QString &title, BookmarkDialog::~BookmarkDialog() { + TRACE_OBJ } void BookmarkDialog::addAccepted() { + TRACE_OBJ QItemSelectionModel *model = ui.treeView->selectionModel(); const QModelIndexList &list = model->selection().indexes(); @@ -131,6 +135,7 @@ void BookmarkDialog::addAccepted() void BookmarkDialog::addNewFolder() { + TRACE_OBJ QItemSelectionModel *model = ui.treeView->selectionModel(); const QModelIndexList &list = model->selection().indexes(); @@ -156,6 +161,7 @@ void BookmarkDialog::addNewFolder() void BookmarkDialog::toolButtonClicked() { + TRACE_OBJ bool visible = !ui.treeView->isVisible(); ui.treeView->setVisible(visible); ui.newFolderButton->setVisible(visible); @@ -171,6 +177,7 @@ void BookmarkDialog::toolButtonClicked() void BookmarkDialog::itemChanged(QStandardItem *item) { + TRACE_OBJ if (renameItem != item) { renameItem = item; oldText = item->text(); @@ -191,11 +198,13 @@ void BookmarkDialog::itemChanged(QStandardItem *item) void BookmarkDialog::textChanged(const QString &string) { + TRACE_OBJ ui.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(!string.isEmpty()); } void BookmarkDialog::selectBookmarkFolder(const QString &folderName) { + TRACE_OBJ if (folderName.isEmpty()) return; @@ -219,6 +228,7 @@ void BookmarkDialog::selectBookmarkFolder(const QString &folderName) void BookmarkDialog::customContextMenuRequested(const QPoint &point) { + TRACE_OBJ QModelIndex index = ui.treeView->indexAt(point); if (!index.isValid()) return; @@ -251,6 +261,7 @@ void BookmarkDialog::customContextMenuRequested(const QPoint &point) void BookmarkDialog::renameFolder(const QModelIndex &index, const QModelIndex &proxyIndex) { + TRACE_OBJ const BookmarkModel * const model = bookmarkManager->treeBookmarkModel(); if (QStandardItem *item = model->itemFromIndex(proxyIndex)) { item->setEditable(true); @@ -261,6 +272,7 @@ void BookmarkDialog::renameFolder(const QModelIndex &index, void BookmarkDialog::currentChanged(const QModelIndex ¤t) { + TRACE_OBJ QString text = tr("Bookmarks"); if (current.isValid()) text = current.data().toString(); @@ -269,6 +281,7 @@ void BookmarkDialog::currentChanged(const QModelIndex ¤t) bool BookmarkDialog::eventFilter(QObject *object, QEvent *e) { + TRACE_OBJ if (object == this && e->type() == QEvent::KeyPress) { QKeyEvent *ke = static_cast(e); @@ -316,16 +329,19 @@ BookmarkWidget::BookmarkWidget(BookmarkManager *manager, QWidget *parent, , removeButton(0) , bookmarkManager(manager) { + TRACE_OBJ setup(showButtons); installEventFilter(this); } BookmarkWidget::~BookmarkWidget() { + TRACE_OBJ } void BookmarkWidget::removeClicked() { + TRACE_OBJ const QModelIndex &index = treeView->currentIndex(); if (searchField->text().isEmpty()) { bookmarkManager->removeBookmarkItem(treeView, @@ -335,6 +351,7 @@ void BookmarkWidget::removeClicked() void BookmarkWidget::filterChanged() { + TRACE_OBJ bool searchBookmarks = searchField->text().isEmpty(); if (!searchBookmarks) { regExp.setPattern(searchField->text()); @@ -362,6 +379,7 @@ void BookmarkWidget::filterChanged() void BookmarkWidget::expand(const QModelIndex &index) { + TRACE_OBJ const QModelIndex &source = filterBookmarkModel->mapToSource(index); QStandardItem *item = bookmarkManager->treeBookmarkModel()->itemFromIndex(source); @@ -371,6 +389,7 @@ void BookmarkWidget::expand(const QModelIndex &index) void BookmarkWidget::activated(const QModelIndex &index) { + TRACE_OBJ if (!index.isValid()) return; @@ -381,6 +400,7 @@ void BookmarkWidget::activated(const QModelIndex &index) void BookmarkWidget::customContextMenuRequested(const QPoint &point) { + TRACE_OBJ QModelIndex index = treeView->indexAt(point); if (!index.isValid()) return; @@ -433,6 +453,7 @@ void BookmarkWidget::customContextMenuRequested(const QPoint &point) void BookmarkWidget::setup(bool showButtons) { + TRACE_OBJ regExp.setPatternSyntax(QRegExp::FixedString); regExp.setCaseSensitivity(Qt::CaseInsensitive); @@ -510,6 +531,7 @@ void BookmarkWidget::setup(bool showButtons) void BookmarkWidget::expandItems() { + TRACE_OBJ QStandardItemModel *model = bookmarkManager->treeBookmarkModel(); QListlist = model->findItems(QLatin1String("*"), Qt::MatchWildcard | Qt::MatchRecursive, 0); @@ -522,6 +544,7 @@ void BookmarkWidget::expandItems() void BookmarkWidget::focusInEvent(QFocusEvent *e) { + TRACE_OBJ if (e->reason() != Qt::MouseFocusReason) { searchField->selectAll(); searchField->setFocus(); @@ -535,6 +558,7 @@ void BookmarkWidget::focusInEvent(QFocusEvent *e) bool BookmarkWidget::eventFilter(QObject *object, QEvent *e) { + TRACE_OBJ if ((object == this) || (object == treeView->viewport())) { QModelIndex index = treeView->currentIndex(); if (e->type() == QEvent::KeyPress) { @@ -598,19 +622,23 @@ bool BookmarkWidget::eventFilter(QObject *object, QEvent *e) BookmarkModel::BookmarkModel(int rows, int columns, QObject *parent) : QStandardItemModel(rows, columns, parent) { + TRACE_OBJ } BookmarkModel::~BookmarkModel() { + TRACE_OBJ } Qt::DropActions BookmarkModel::supportedDropActions() const { + TRACE_OBJ return Qt::MoveAction; } Qt::ItemFlags BookmarkModel::flags(const QModelIndex &index) const { + TRACE_OBJ Qt::ItemFlags defaultFlags = QStandardItemModel::flags(index); if ((!index.isValid()) // can only happen for the invisible root item || index.data(Qt::UserRole + 10).toString() == QLatin1String("Folder")) @@ -628,6 +656,7 @@ BookmarkManager::BookmarkManager() , listModel(new BookmarkModel(0, 1, this)) , renameItem(0) { + TRACE_OBJ folderIcon = QApplication::style()->standardIcon(QStyle::SP_DirClosedIcon); bookmarkIcon = QIcon(QLatin1String(":/trolltech/assistant/images/bookmark.png")); @@ -641,22 +670,26 @@ BookmarkManager::BookmarkManager() BookmarkManager::~BookmarkManager() { + TRACE_OBJ treeModel->clear(); listModel->clear(); } BookmarkModel* BookmarkManager::treeBookmarkModel() { + TRACE_OBJ return treeModel; } BookmarkModel* BookmarkManager::listBookmarkModel() { + TRACE_OBJ return listModel; } void BookmarkManager::saveBookmarks() { + TRACE_OBJ QByteArray bookmarks; QDataStream stream(&bookmarks, QIODevice::WriteOnly); @@ -666,6 +699,7 @@ void BookmarkManager::saveBookmarks() QStringList BookmarkManager::bookmarkFolders() const { + TRACE_OBJ QStringList folders(tr("Bookmarks")); QListlist = treeModel->findItems(QLatin1String("*"), @@ -682,6 +716,7 @@ QStringList BookmarkManager::bookmarkFolders() const QModelIndex BookmarkManager::addNewFolder(const QModelIndex &index) { + TRACE_OBJ QStandardItem *item = new QStandardItem(uniqueFolderName()); item->setEditable(false); item->setData(false, Qt::UserRole + 11); @@ -699,6 +734,7 @@ QModelIndex BookmarkManager::addNewFolder(const QModelIndex &index) void BookmarkManager::removeBookmarkItem(QTreeView *treeView, const QModelIndex &index) { + TRACE_OBJ QStandardItem *item = treeModel->itemFromIndex(index); if (item) { QString data = index.data(Qt::UserRole + 10).toString(); @@ -730,6 +766,7 @@ void BookmarkManager::removeBookmarkItem(QTreeView *treeView, void BookmarkManager::showBookmarkDialog(QWidget *parent, const QString &name, const QString &url) { + TRACE_OBJ BookmarkDialog dialog(this, name, url, parent); dialog.exec(); } @@ -737,6 +774,7 @@ void BookmarkManager::showBookmarkDialog(QWidget *parent, const QString &name, void BookmarkManager::addNewBookmark(const QModelIndex &index, const QString &name, const QString &url) { + TRACE_OBJ QStandardItem *item = new QStandardItem(name); item->setEditable(false); item->setIcon(bookmarkIcon); @@ -753,6 +791,7 @@ void BookmarkManager::addNewBookmark(const QModelIndex &index, void BookmarkManager::fillBookmarkMenu(QMenu *menu) { + TRACE_OBJ if (!menu || !treeModel) return; @@ -762,6 +801,7 @@ void BookmarkManager::fillBookmarkMenu(QMenu *menu) void BookmarkManager::fillBookmarkMenu(QMenu *menu, QStandardItem *root) { + TRACE_OBJ for (int i = 0; i < root->rowCount(); ++i) { QStandardItem *item = root->child(i); if (item && item->data(Qt::UserRole + 10) @@ -777,6 +817,7 @@ void BookmarkManager::fillBookmarkMenu(QMenu *menu, QStandardItem *root) QUrl BookmarkManager::urlForAction(QAction* action) const { + TRACE_OBJ if (map.contains(action)) { const QModelIndex &index = map.value(action); if (QStandardItem* item = treeModel->itemFromIndex(index)) @@ -787,6 +828,7 @@ QUrl BookmarkManager::urlForAction(QAction* action) const void BookmarkManager::itemChanged(QStandardItem *item) { + TRACE_OBJ if (renameItem != item) { renameItem = item; oldText = item->text(); @@ -804,6 +846,7 @@ void BookmarkManager::itemChanged(QStandardItem *item) void BookmarkManager::setupBookmarkModels() { + TRACE_OBJ treeModel->clear(); listModel->clear(); @@ -849,6 +892,7 @@ void BookmarkManager::setupBookmarkModels() QString BookmarkManager::uniqueFolderName() const { + TRACE_OBJ QString folderName = tr("New Folder"); QList list = treeModel->findItems(folderName, Qt::MatchContains | Qt::MatchRecursive, 0); @@ -868,6 +912,7 @@ QString BookmarkManager::uniqueFolderName() const void BookmarkManager::removeBookmarkFolderItems(QStandardItem *item) { + TRACE_OBJ for (int j = 0; j < item->rowCount(); ++j) { QStandardItem *child = item->child(j); if (child->rowCount() > 0) @@ -887,6 +932,7 @@ void BookmarkManager::removeBookmarkFolderItems(QStandardItem *item) void BookmarkManager::readBookmarksRecursive(const QStandardItem *item, QDataStream &stream, const qint32 depth) const { + TRACE_OBJ for (int j = 0; j < item->rowCount(); ++j) { const QStandardItem *child = item->child(j); stream << depth; diff --git a/tools/assistant/tools/assistant/centralwidget.cpp b/tools/assistant/tools/assistant/centralwidget.cpp index 7117b76..8343ad1 100644 --- a/tools/assistant/tools/assistant/centralwidget.cpp +++ b/tools/assistant/tools/assistant/centralwidget.cpp @@ -38,6 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#include "tracer.h" #include "centralwidget.h" #include "helpenginewrapper.h" @@ -91,6 +92,7 @@ FindWidget::FindWidget(QWidget *parent) : QWidget(parent) , appPalette(qApp->palette()) { + TRACE_OBJ QHBoxLayout *hboxLayout = new QHBoxLayout(this); QString resourcePath = QLatin1String(":/trolltech/assistant/images/"); @@ -149,10 +151,12 @@ FindWidget::FindWidget(QWidget *parent) FindWidget::~FindWidget() { + TRACE_OBJ } void FindWidget::hideEvent(QHideEvent* event) { + TRACE_OBJ #if !defined(QT_NO_WEBKIT) // TODO: remove this once webkit supports setting the palette if (!event->spontaneous()) @@ -164,6 +168,7 @@ void FindWidget::hideEvent(QHideEvent* event) void FindWidget::showEvent(QShowEvent* event) { + TRACE_OBJ #if !defined(QT_NO_WEBKIT) // TODO: remove this once webkit supports setting the palette if (!event->spontaneous()) { @@ -181,6 +186,7 @@ void FindWidget::showEvent(QShowEvent* event) void FindWidget::updateButtons() { + TRACE_OBJ if (editFind->text().isEmpty()) { toolPrevious->setEnabled(false); toolNext->setEnabled(false); @@ -192,6 +198,7 @@ void FindWidget::updateButtons() QToolButton* FindWidget::setupToolButton(const QString &text, const QString &icon) { + TRACE_OBJ QToolButton *toolButton = new QToolButton(this); toolButton->setText(text); @@ -216,6 +223,7 @@ CentralWidget::CentralWidget(MainWindow *parent) , usesDefaultCollection(parent->usesDefaultCollection()) , m_searchWidget(0) { + TRACE_OBJ globalActionList.clear(); staticCentralWidget = this; QVBoxLayout *vboxLayout = new QVBoxLayout(this); @@ -287,6 +295,7 @@ CentralWidget::CentralWidget(MainWindow *parent) CentralWidget::~CentralWidget() { + TRACE_OBJ #ifndef QT_NO_PRINTER delete printer; #endif @@ -313,11 +322,13 @@ CentralWidget::~CentralWidget() CentralWidget *CentralWidget::instance() { + TRACE_OBJ return staticCentralWidget; } void CentralWidget::newTab() { + TRACE_OBJ HelpViewer *viewer = currentHelpViewer(); #if !defined(QT_NO_WEBKIT) if (viewer && viewer->hasLoadFinished()) @@ -329,6 +340,7 @@ void CentralWidget::newTab() void CentralWidget::zoomIn() { + TRACE_OBJ HelpViewer *viewer = currentHelpViewer(); if (viewer) viewer->zoomIn(); @@ -339,6 +351,7 @@ void CentralWidget::zoomIn() void CentralWidget::zoomOut() { + TRACE_OBJ HelpViewer *viewer = currentHelpViewer(); if (viewer) viewer->zoomOut(); @@ -349,11 +362,13 @@ void CentralWidget::zoomOut() void CentralWidget::findNext() { + TRACE_OBJ find(findWidget->editFind->text(), true, false); } void CentralWidget::nextPage() { + TRACE_OBJ int index = tabWidget->currentIndex() + 1; if (index >= tabWidget->count()) index = 0; @@ -362,6 +377,7 @@ void CentralWidget::nextPage() void CentralWidget::resetZoom() { + TRACE_OBJ HelpViewer *viewer = currentHelpViewer(); if (viewer) viewer->resetZoom(); @@ -372,6 +388,7 @@ void CentralWidget::resetZoom() void CentralWidget::previousPage() { + TRACE_OBJ int index = tabWidget->currentIndex() -1; if (index < 0) index = tabWidget->count() -1; @@ -380,11 +397,13 @@ void CentralWidget::previousPage() void CentralWidget::findPrevious() { + TRACE_OBJ find(findWidget->editFind->text(), false, true); } void CentralWidget::closeTab() { + TRACE_OBJ HelpViewer *viewer = currentHelpViewer(); if (!viewer|| tabWidget->count() == 1) return; @@ -395,6 +414,7 @@ void CentralWidget::closeTab() void CentralWidget::setSource(const QUrl &url) { + TRACE_OBJ HelpViewer *viewer = currentHelpViewer(); HelpViewer *lastViewer = qobject_cast(tabWidget->widget(lastTabPage)); @@ -418,6 +438,7 @@ void CentralWidget::setSource(const QUrl &url) void CentralWidget::setupWidget() { + TRACE_OBJ HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); int option = helpEngine.startOption(); if (option != ShowLastPages) { @@ -434,6 +455,7 @@ void CentralWidget::setupWidget() void CentralWidget::setLastShownPages() { + TRACE_OBJ HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); const QStringList lastShownPageList = helpEngine.lastShownPages(); const int pageCount = lastShownPageList.count(); @@ -467,12 +489,14 @@ void CentralWidget::setLastShownPages() bool CentralWidget::hasSelection() const { + TRACE_OBJ const HelpViewer *viewer = currentHelpViewer(); return viewer ? viewer->hasSelection() : false; } QUrl CentralWidget::currentSource() const { + TRACE_OBJ const HelpViewer *viewer = currentHelpViewer(); if (viewer) return viewer->source(); @@ -482,6 +506,7 @@ QUrl CentralWidget::currentSource() const QString CentralWidget::currentTitle() const { + TRACE_OBJ const HelpViewer *viewer = currentHelpViewer(); if (viewer) return viewer->documentTitle(); @@ -491,6 +516,7 @@ QString CentralWidget::currentTitle() const void CentralWidget::copySelection() { + TRACE_OBJ HelpViewer *viewer = currentHelpViewer(); if (viewer) viewer->copy(); @@ -498,6 +524,7 @@ void CentralWidget::copySelection() void CentralWidget::showTextSearch() { + TRACE_OBJ findBar->show(); findWidget->editFind->selectAll(); findWidget->editFind->setFocus(Qt::ShortcutFocusReason); @@ -505,6 +532,7 @@ void CentralWidget::showTextSearch() void CentralWidget::initPrinter() { + TRACE_OBJ #ifndef QT_NO_PRINTER if (!printer) printer = new QPrinter(QPrinter::HighResolution); @@ -513,6 +541,7 @@ void CentralWidget::initPrinter() void CentralWidget::print() { + TRACE_OBJ #ifndef QT_NO_PRINTER HelpViewer *viewer = currentHelpViewer(); if (!viewer) @@ -536,6 +565,7 @@ void CentralWidget::print() void CentralWidget::printPreview() { + TRACE_OBJ #ifndef QT_NO_PRINTER initPrinter(); QPrintPreviewDialog preview(printer, this); @@ -547,6 +577,7 @@ void CentralWidget::printPreview() void CentralWidget::printPreview(QPrinter *p) { + TRACE_OBJ #ifndef QT_NO_PRINTER HelpViewer *viewer = currentHelpViewer(); if (viewer) @@ -556,6 +587,7 @@ void CentralWidget::printPreview(QPrinter *p) void CentralWidget::pageSetup() { + TRACE_OBJ #ifndef QT_NO_PRINTER initPrinter(); QPageSetupDialog dlg(printer); @@ -565,11 +597,13 @@ void CentralWidget::pageSetup() bool CentralWidget::isHomeAvailable() const { + TRACE_OBJ return currentHelpViewer() ? true : false; } void CentralWidget::home() { + TRACE_OBJ HelpViewer *viewer = currentHelpViewer(); if (viewer) viewer->home(); @@ -577,6 +611,7 @@ void CentralWidget::home() bool CentralWidget::isForwardAvailable() const { + TRACE_OBJ const HelpViewer *viewer = currentHelpViewer(); if (viewer) return viewer->isForwardAvailable(); @@ -586,6 +621,7 @@ bool CentralWidget::isForwardAvailable() const void CentralWidget::forward() { + TRACE_OBJ HelpViewer *viewer = currentHelpViewer(); if (viewer) viewer->forward(); @@ -593,6 +629,7 @@ void CentralWidget::forward() bool CentralWidget::isBackwardAvailable() const { + TRACE_OBJ const HelpViewer *viewer = currentHelpViewer(); if (viewer) return viewer->isBackwardAvailable(); @@ -602,6 +639,7 @@ bool CentralWidget::isBackwardAvailable() const void CentralWidget::backward() { + TRACE_OBJ HelpViewer *viewer = currentHelpViewer(); if (viewer) viewer->backward(); @@ -610,16 +648,19 @@ void CentralWidget::backward() QList CentralWidget::globalActions() const { + TRACE_OBJ return globalActionList; } void CentralWidget::setGlobalActions(const QList &actions) { + TRACE_OBJ globalActionList = actions; } void CentralWidget::setSourceInNewTab(const QUrl &url, qreal zoom) { + TRACE_OBJ HelpViewer *viewer; #if defined(QT_NO_WEBKIT) @@ -652,6 +693,7 @@ void CentralWidget::setSourceInNewTab(const QUrl &url, qreal zoom) HelpViewer *CentralWidget::newEmptyTab() { + TRACE_OBJ HelpViewer *viewer = new HelpViewer(this); viewer->installEventFilter(this); viewer->setFocus(Qt::OtherFocusReason); @@ -666,11 +708,13 @@ HelpViewer *CentralWidget::newEmptyTab() void CentralWidget::findCurrentText(const QString &text) { + TRACE_OBJ find(text, false, false); } void CentralWidget::connectSignals() { + TRACE_OBJ const HelpViewer *viewer = currentHelpViewer(); if (viewer) { connect(viewer, SIGNAL(copyAvailable(bool)), this, @@ -690,11 +734,13 @@ void CentralWidget::connectSignals() HelpViewer *CentralWidget::currentHelpViewer() const { + TRACE_OBJ return qobject_cast(tabWidget->currentWidget()); } void CentralWidget::activateTab(bool onlyHelpViewer) { + TRACE_OBJ if (currentHelpViewer()) { currentHelpViewer()->setFocus(); } else { @@ -708,6 +754,7 @@ void CentralWidget::activateTab(bool onlyHelpViewer) void CentralWidget::setTabTitle(const QUrl &url) { + TRACE_OBJ Q_UNUSED(url) #if !defined(QT_NO_WEBKIT) QTabBar *tabBar = qFindChild(tabWidget); @@ -729,6 +776,7 @@ void CentralWidget::setTabTitle(const QUrl &url) void CentralWidget::currentPageChanged(int index) { + TRACE_OBJ const HelpViewer *viewer = currentHelpViewer(); if (viewer) lastTabPage = index; @@ -744,6 +792,7 @@ void CentralWidget::currentPageChanged(int index) void CentralWidget::showTabBarContextMenu(const QPoint &point) { + TRACE_OBJ HelpViewer *viewer = helpViewerFromTabPosition(tabWidget, point); if (!viewer) return; @@ -796,6 +845,7 @@ void CentralWidget::showTabBarContextMenu(const QPoint &point) bool CentralWidget::eventFilter(QObject *object, QEvent *e) { + TRACE_OBJ if (e->type() == QEvent::KeyPress) { QKeyEvent *ke = static_cast(e); switch (ke->key()) { @@ -851,6 +901,7 @@ bool CentralWidget::eventFilter(QObject *object, QEvent *e) void CentralWidget::keyPressEvent(QKeyEvent *e) { + TRACE_OBJ const QString &text = e->text(); if (text.startsWith(QLatin1Char('/'))) { if (!findBar->isVisible()) { @@ -867,6 +918,7 @@ void CentralWidget::keyPressEvent(QKeyEvent *e) void CentralWidget::find(const QString &ttf, bool forward, bool backward) { + TRACE_OBJ QPalette p = findWidget->editFind->palette(); p.setColor(QPalette::Active, QPalette::Base, Qt::white); @@ -915,6 +967,7 @@ void CentralWidget::find(const QString &ttf, bool forward, bool backward) bool CentralWidget::findInTextBrowser(QTextBrowser* browser, const QString &ttf, bool forward, bool backward) { + TRACE_OBJ if (!browser) return false; @@ -962,6 +1015,7 @@ bool CentralWidget::findInTextBrowser(QTextBrowser* browser, const QString &ttf, void CentralWidget::updateBrowserFont() { + TRACE_OBJ QFont font; bool searchAttached = searchWidgetAttached(); if (searchAttached) { @@ -977,6 +1031,7 @@ void CentralWidget::updateBrowserFont() void CentralWidget::createSearchWidget(QHelpSearchEngine *searchEngine) { + TRACE_OBJ if (m_searchWidget) return; @@ -993,6 +1048,7 @@ void CentralWidget::createSearchWidget(QHelpSearchEngine *searchEngine) void CentralWidget::activateSearchWidget(bool updateLastTabPage) { + TRACE_OBJ if (!m_searchWidget) createSearchWidget(HelpEngineWrapper::instance().searchEngine()); @@ -1010,6 +1066,7 @@ void CentralWidget::activateSearchWidget(bool updateLastTabPage) void CentralWidget::removeSearchWidget() { + TRACE_OBJ if (searchWidgetAttached()) { tabWidget->removeTab(0); m_searchWidget->setAttached(false); @@ -1018,6 +1075,7 @@ void CentralWidget::removeSearchWidget() int CentralWidget::availableHelpViewer() const { + TRACE_OBJ int count = tabWidget->count(); if (searchWidgetAttached()) count--; @@ -1026,6 +1084,7 @@ int CentralWidget::availableHelpViewer() const bool CentralWidget::enableTabCloseAction() const { + TRACE_OBJ int minTabCount = 1; if (searchWidgetAttached()) minTabCount = 2; @@ -1035,6 +1094,7 @@ bool CentralWidget::enableTabCloseAction() const QString CentralWidget::quoteTabTitle(const QString &title) const { + TRACE_OBJ QString s = title; return s.replace(QLatin1Char('&'), QLatin1String("&&")); } @@ -1042,6 +1102,7 @@ QString CentralWidget::quoteTabTitle(const QString &title) const void CentralWidget::setSourceFromSearch(const QUrl &url) { + TRACE_OBJ setSource(url); highlightSearchTerms(); } @@ -1049,6 +1110,7 @@ CentralWidget::setSourceFromSearch(const QUrl &url) void CentralWidget::setSourceFromSearchInNewTab(const QUrl &url) { + TRACE_OBJ setSourceInNewTab(url); highlightSearchTerms(); } @@ -1056,6 +1118,7 @@ CentralWidget::setSourceFromSearchInNewTab(const QUrl &url) void CentralWidget::highlightSearchTerms() { + TRACE_OBJ #if defined(QT_NO_WEBKIT) HelpViewer *viewer = currentHelpViewer(); if (!viewer) @@ -1116,6 +1179,7 @@ CentralWidget::highlightSearchTerms() void CentralWidget::closeTabs(const QList &indices) { + TRACE_OBJ QList sortedIndices = indices; qSort(sortedIndices); for (int i = sortedIndices.count(); --i >= 0;) @@ -1126,6 +1190,7 @@ void CentralWidget::closeTabs(const QList &indices) void CentralWidget::closeTabAt(int index) { + TRACE_OBJ HelpViewer *viewer = qobject_cast(tabWidget->widget(index)); tabWidget->removeTab(index); QTimer::singleShot(0, viewer, SLOT(deleteLater())); @@ -1133,6 +1198,7 @@ void CentralWidget::closeTabAt(int index) QMap CentralWidget::currentSourceFileList() const { + TRACE_OBJ QMap sourceList; for (int i = 1; i < tabWidget->count(); ++i) { HelpViewer *viewer = qobject_cast(tabWidget->widget(i)); @@ -1144,6 +1210,7 @@ QMap CentralWidget::currentSourceFileList() const void CentralWidget::getBrowserFontFor(QWidget *viewer, QFont *font) { + TRACE_OBJ HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); if (!helpEngine.usesBrowserFont()) { *font = qApp->font(); // case for QTextBrowser and SearchWidget @@ -1162,6 +1229,7 @@ void CentralWidget::getBrowserFontFor(QWidget *viewer, QFont *font) void CentralWidget::setBrowserFontFor(QWidget *widget, const QFont &font) { + TRACE_OBJ #if !defined(QT_NO_WEBKIT) QWebView *view = qobject_cast (widget); if (view) { diff --git a/tools/assistant/tools/assistant/cmdlineparser.cpp b/tools/assistant/tools/assistant/cmdlineparser.cpp index b17909c..733e2ff 100644 --- a/tools/assistant/tools/assistant/cmdlineparser.cpp +++ b/tools/assistant/tools/assistant/cmdlineparser.cpp @@ -38,6 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#include "tracer.h" #include #include @@ -88,6 +89,7 @@ CmdLineParser::CmdLineParser(const QStringList &arguments) m_removeSearchIndex(false), m_quiet(false) { + TRACE_OBJ for (int i = 1; i < arguments.count(); ++i) { const QString &arg = arguments.at(i); if (arg.toLower() == "-quiet") @@ -99,6 +101,7 @@ CmdLineParser::CmdLineParser(const QStringList &arguments) CmdLineParser::Result CmdLineParser::parse() { + TRACE_OBJ bool showHelp = false; while (m_error.isEmpty() && hasMoreArgs()) { @@ -141,17 +144,20 @@ CmdLineParser::Result CmdLineParser::parse() bool CmdLineParser::hasMoreArgs() const { + TRACE_OBJ return m_pos < m_arguments.count(); } const QString &CmdLineParser::nextArg() { + TRACE_OBJ Q_ASSERT(hasMoreArgs()); return m_arguments.at(m_pos++); } void CmdLineParser::handleCollectionFileOption() { + TRACE_OBJ if (hasMoreArgs()) { const QString &fileName = nextArg(); m_collectionFile = getFileName(fileName); @@ -165,6 +171,7 @@ void CmdLineParser::handleCollectionFileOption() void CmdLineParser::handleShowUrlOption() { + TRACE_OBJ if (hasMoreArgs()) { const QString &urlString = nextArg(); QUrl url(urlString); @@ -179,21 +186,25 @@ void CmdLineParser::handleShowUrlOption() void CmdLineParser::handleShowOption() { + TRACE_OBJ handleShowOrHideOrActivateOption(Show); } void CmdLineParser::handleHideOption() { + TRACE_OBJ handleShowOrHideOrActivateOption(Hide); } void CmdLineParser::handleActivateOption() { + TRACE_OBJ handleShowOrHideOrActivateOption(Activate); } void CmdLineParser::handleShowOrHideOrActivateOption(ShowState state) { + TRACE_OBJ if (hasMoreArgs()) { const QString &widget = nextArg().toLower(); if (widget == QLatin1String("contents")) @@ -213,16 +224,19 @@ void CmdLineParser::handleShowOrHideOrActivateOption(ShowState state) void CmdLineParser::handleRegisterOption() { + TRACE_OBJ handleRegisterOrUnregisterOption(Register); } void CmdLineParser::handleUnregisterOption() { + TRACE_OBJ handleRegisterOrUnregisterOption(Unregister); } void CmdLineParser::handleRegisterOrUnregisterOption(RegisterState state) { + TRACE_OBJ if (hasMoreArgs()) { const QString &fileName = nextArg(); m_helpFile = getFileName(fileName); @@ -237,6 +251,7 @@ void CmdLineParser::handleRegisterOrUnregisterOption(RegisterState state) void CmdLineParser::handleSetCurrentFilterOption() { + TRACE_OBJ if (hasMoreArgs()) m_currentFilter = nextArg(); else @@ -245,6 +260,7 @@ void CmdLineParser::handleSetCurrentFilterOption() QString CmdLineParser::getFileName(const QString &fileName) { + TRACE_OBJ QFileInfo fi(fileName); if (!fi.exists()) return QString(); @@ -253,6 +269,7 @@ QString CmdLineParser::getFileName(const QString &fileName) void CmdLineParser::showMessage(const QString &msg, bool error) { + TRACE_OBJ if (m_quiet) return; #ifdef Q_OS_WIN @@ -268,61 +285,73 @@ void CmdLineParser::showMessage(const QString &msg, bool error) void CmdLineParser::setCollectionFile(const QString &file) { + TRACE_OBJ m_collectionFile = file; } QString CmdLineParser::collectionFile() const { + TRACE_OBJ return m_collectionFile; } QUrl CmdLineParser::url() const { + TRACE_OBJ return m_url; } bool CmdLineParser::enableRemoteControl() const { + TRACE_OBJ return m_enableRemoteControl; } CmdLineParser::ShowState CmdLineParser::contents() const { + TRACE_OBJ return m_contents; } CmdLineParser::ShowState CmdLineParser::index() const { + TRACE_OBJ return m_index; } CmdLineParser::ShowState CmdLineParser::bookmarks() const { + TRACE_OBJ return m_bookmarks; } CmdLineParser::ShowState CmdLineParser::search() const { + TRACE_OBJ return m_search; } QString CmdLineParser::currentFilter() const { + TRACE_OBJ return m_currentFilter; } bool CmdLineParser::removeSearchIndex() const { + TRACE_OBJ return m_removeSearchIndex; } CmdLineParser::RegisterState CmdLineParser::registerRequest() const { + TRACE_OBJ return m_register; } QString CmdLineParser::helpFile() const { + TRACE_OBJ return m_helpFile; } diff --git a/tools/assistant/tools/assistant/contentwindow.cpp b/tools/assistant/tools/assistant/contentwindow.cpp index 17b19ba..d93040a 100644 --- a/tools/assistant/tools/assistant/contentwindow.cpp +++ b/tools/assistant/tools/assistant/contentwindow.cpp @@ -38,6 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#include "tracer.h" #include "contentwindow.h" #include "centralwidget.h" @@ -55,6 +56,7 @@ ContentWindow::ContentWindow() : m_contentWidget(HelpEngineWrapper::instance().contentWidget()) , m_expandDepth(-2) { + TRACE_OBJ m_contentWidget->viewport()->installEventFilter(this); m_contentWidget->setContextMenuPolicy(Qt::CustomContextMenu); @@ -74,10 +76,12 @@ ContentWindow::ContentWindow() ContentWindow::~ContentWindow() { + TRACE_OBJ } bool ContentWindow::syncToContent(const QUrl& url) { + TRACE_OBJ QModelIndex idx = m_contentWidget->indexOf(url); if (!idx.isValid()) return false; @@ -87,6 +91,7 @@ bool ContentWindow::syncToContent(const QUrl& url) void ContentWindow::expandTOC() { + TRACE_OBJ Q_ASSERT(m_expandDepth >= -2); if (m_expandDepth > -2) { expandToDepth(m_expandDepth); @@ -96,6 +101,7 @@ void ContentWindow::expandTOC() void ContentWindow::expandToDepth(int depth) { + TRACE_OBJ Q_ASSERT(depth >= -2); m_expandDepth = depth; if (depth == -1) @@ -108,18 +114,21 @@ void ContentWindow::expandToDepth(int depth) void ContentWindow::focusInEvent(QFocusEvent *e) { + TRACE_OBJ if (e->reason() != Qt::MouseFocusReason) m_contentWidget->setFocus(); } void ContentWindow::keyPressEvent(QKeyEvent *e) { + TRACE_OBJ if (e->key() == Qt::Key_Escape) emit escapePressed(); } bool ContentWindow::eventFilter(QObject *o, QEvent *e) { + TRACE_OBJ if (m_contentWidget && o == m_contentWidget->viewport() && e->type() == QEvent::MouseButtonRelease) { QMouseEvent *me = static_cast(e); @@ -148,6 +157,7 @@ bool ContentWindow::eventFilter(QObject *o, QEvent *e) void ContentWindow::showContextMenu(const QPoint &pos) { + TRACE_OBJ if (!m_contentWidget->indexAt(pos).isValid()) return; @@ -173,6 +183,7 @@ void ContentWindow::showContextMenu(const QPoint &pos) void ContentWindow::itemClicked(const QModelIndex &index) { + TRACE_OBJ QHelpContentModel *contentModel = qobject_cast(m_contentWidget->model()); @@ -185,6 +196,7 @@ void ContentWindow::itemClicked(const QModelIndex &index) bool ContentWindow::isPdfFile(QHelpContentItem *item) const { + TRACE_OBJ const QString &path = item->url().path(); return path.endsWith(QLatin1String(".pdf"), Qt::CaseInsensitive); } diff --git a/tools/assistant/tools/assistant/filternamedialog.cpp b/tools/assistant/tools/assistant/filternamedialog.cpp index 781171e..27b7baf 100644 --- a/tools/assistant/tools/assistant/filternamedialog.cpp +++ b/tools/assistant/tools/assistant/filternamedialog.cpp @@ -38,6 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#include "tracer.h" #include @@ -48,6 +49,7 @@ QT_BEGIN_NAMESPACE FilterNameDialog::FilterNameDialog(QWidget *parent) : QDialog(parent) { + TRACE_OBJ m_ui.setupUi(this); connect(m_ui.buttonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked()), this, SLOT(accept())); @@ -61,11 +63,13 @@ FilterNameDialog::FilterNameDialog(QWidget *parent) QString FilterNameDialog::filterName() const { + TRACE_OBJ return m_ui.lineEdit->text(); } void FilterNameDialog::updateOkButton() { + TRACE_OBJ m_ui.buttonBox->button(QDialogButtonBox::Ok) ->setDisabled(m_ui.lineEdit->text().isEmpty()); } diff --git a/tools/assistant/tools/assistant/helpenginewrapper.cpp b/tools/assistant/tools/assistant/helpenginewrapper.cpp index 3835a63..899954c 100644 --- a/tools/assistant/tools/assistant/helpenginewrapper.cpp +++ b/tools/assistant/tools/assistant/helpenginewrapper.cpp @@ -38,6 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#include "tracer.h" #include "helpenginewrapper.h" #include "../shared/collectionconfiguration.h" @@ -73,6 +74,7 @@ HelpEngineWrapper *HelpEngineWrapper::helpEngineWrapper = 0; HelpEngineWrapper &HelpEngineWrapper::instance(const QString &collectionFile) { + TRACE_OBJ /* * Note that this Singleton cannot be static, because it has to be * deleted before the QApplication. @@ -84,6 +86,7 @@ HelpEngineWrapper &HelpEngineWrapper::instance(const QString &collectionFile) void HelpEngineWrapper::removeInstance() { + TRACE_OBJ delete helpEngineWrapper; helpEngineWrapper = 0; } @@ -92,6 +95,7 @@ HelpEngineWrapper::HelpEngineWrapper(const QString &collectionFile) : m_helpEngine(new QHelpEngine(collectionFile, this)), m_qchWatcher(new QFileSystemWatcher(this)) { + TRACE_OBJ connect(m_helpEngine, SIGNAL(currentFilterChanged(QString)), this, SIGNAL(currentFilterChanged(QString))); connect(m_helpEngine, SIGNAL(setupFinished()), @@ -101,6 +105,7 @@ HelpEngineWrapper::HelpEngineWrapper(const QString &collectionFile) void HelpEngineWrapper::initFileSystemWatchers() { + TRACE_OBJ foreach(const QString &ns, m_helpEngine->registeredDocumentations()) { const QString &docFile = m_helpEngine->documentationFileName(ns); m_qchWatcher->addPath(docFile); @@ -112,41 +117,49 @@ void HelpEngineWrapper::initFileSystemWatchers() QHelpSearchEngine *HelpEngineWrapper::searchEngine() const { + TRACE_OBJ return m_helpEngine->searchEngine(); } QHelpContentModel *HelpEngineWrapper::contentModel() const { + TRACE_OBJ return m_helpEngine->contentModel(); } QHelpIndexModel *HelpEngineWrapper::indexModel() const { + TRACE_OBJ return m_helpEngine->indexModel(); } QHelpContentWidget *HelpEngineWrapper::contentWidget() { + TRACE_OBJ return m_helpEngine->contentWidget(); } QHelpIndexWidget *HelpEngineWrapper::indexWidget() { + TRACE_OBJ return m_helpEngine->indexWidget(); } const QStringList HelpEngineWrapper::registeredDocumentations() const { + TRACE_OBJ return m_helpEngine->registeredDocumentations(); } const QString HelpEngineWrapper::collectionFile() const { + TRACE_OBJ return m_helpEngine->collectionFile(); } bool HelpEngineWrapper::registerDocumentation(const QString &docFile) { + TRACE_OBJ assertDocFilesWatched(); if (!m_helpEngine->registerDocumentation(docFile)) return false; @@ -157,6 +170,7 @@ bool HelpEngineWrapper::registerDocumentation(const QString &docFile) bool HelpEngineWrapper::unregisterDocumentation(const QString &namespaceName) { + TRACE_OBJ assertDocFilesWatched(); const QString &file = m_helpEngine->documentationFileName(namespaceName); if (!m_helpEngine->unregisterDocumentation(namespaceName)) @@ -168,77 +182,92 @@ bool HelpEngineWrapper::unregisterDocumentation(const QString &namespaceName) bool HelpEngineWrapper::setupData() { + TRACE_OBJ return m_helpEngine->setupData(); } bool HelpEngineWrapper::addCustomFilter(const QString &filterName, const QStringList &attributes) { + TRACE_OBJ return m_helpEngine->addCustomFilter(filterName, attributes); } bool HelpEngineWrapper::removeCustomFilter(const QString &filterName) { + TRACE_OBJ return m_helpEngine->removeCustomFilter(filterName); } void HelpEngineWrapper::setCurrentFilter(const QString ¤tFilter) { + TRACE_OBJ m_helpEngine->setCurrentFilter(currentFilter); } const QString HelpEngineWrapper::currentFilter() const { + TRACE_OBJ return m_helpEngine->currentFilter(); } const QStringList HelpEngineWrapper::customFilters() const { + TRACE_OBJ return m_helpEngine->customFilters(); } QUrl HelpEngineWrapper::findFile(const QUrl &url) const { + TRACE_OBJ return m_helpEngine->findFile(url); } QByteArray HelpEngineWrapper::fileData(const QUrl &url) const { + TRACE_OBJ return m_helpEngine->fileData(url); } QMap HelpEngineWrapper::linksForIdentifier(const QString &id) const { + TRACE_OBJ return m_helpEngine->linksForIdentifier(id); } const QStringList HelpEngineWrapper::filterAttributes() const { + TRACE_OBJ return m_helpEngine->filterAttributes(); } const QStringList HelpEngineWrapper::filterAttributes(const QString &filterName) const { + TRACE_OBJ return m_helpEngine->filterAttributes(filterName); } QString HelpEngineWrapper::error() const { + TRACE_OBJ return m_helpEngine->error(); } bool HelpEngineWrapper::unfilteredInserted() const { + TRACE_OBJ return m_helpEngine->customValue(UnfilteredInsertedKey).toInt() == 1; } void HelpEngineWrapper::setUnfilteredInserted() { + TRACE_OBJ m_helpEngine->setCustomValue(UnfilteredInsertedKey, 1); } const QStringList HelpEngineWrapper::qtDocInfo(const QString &component) const { + TRACE_OBJ return m_helpEngine->customValue(VersionKey.arg(component)).toString(). split(CollectionConfiguration::ListSeparator); } @@ -246,221 +275,264 @@ const QStringList HelpEngineWrapper::qtDocInfo(const QString &component) const void HelpEngineWrapper::setQtDocInfo(const QString &component, const QStringList &doc) { + TRACE_OBJ m_helpEngine->setCustomValue(VersionKey.arg(component), doc.join(CollectionConfiguration::ListSeparator)); } const QStringList HelpEngineWrapper::lastShownPages() const { + TRACE_OBJ return CollectionConfiguration::lastShownPages(*m_helpEngine); } void HelpEngineWrapper::setLastShownPages(const QStringList &lastShownPages) { + TRACE_OBJ CollectionConfiguration::setLastShownPages(*m_helpEngine, lastShownPages); } const QStringList HelpEngineWrapper::lastZoomFactors() const { + TRACE_OBJ return CollectionConfiguration::lastZoomFactors(*m_helpEngine); } void HelpEngineWrapper::setLastZoomFactors(const QStringList &lastZoomFactors) { + TRACE_OBJ CollectionConfiguration::setLastZoomFactors(*m_helpEngine, lastZoomFactors); } const QString HelpEngineWrapper::cacheDir() const { + TRACE_OBJ return CollectionConfiguration::cacheDir(*m_helpEngine); } bool HelpEngineWrapper::cacheDirIsRelativeToCollection() const { + TRACE_OBJ return CollectionConfiguration::cacheDirIsRelativeToCollection(*m_helpEngine); } void HelpEngineWrapper::setCacheDir(const QString &cacheDir, bool relativeToCollection) { + TRACE_OBJ CollectionConfiguration::setCacheDir(*m_helpEngine, cacheDir, relativeToCollection); } bool HelpEngineWrapper::filterFunctionalityEnabled() const { + TRACE_OBJ return CollectionConfiguration::filterFunctionalityEnabled(*m_helpEngine); } void HelpEngineWrapper::setFilterFunctionalityEnabled(bool enabled) { + TRACE_OBJ CollectionConfiguration::setFilterFunctionalityEnabled(*m_helpEngine, enabled); } bool HelpEngineWrapper::filterToolbarVisible() const { + TRACE_OBJ return CollectionConfiguration::filterToolbarVisible(*m_helpEngine); } void HelpEngineWrapper::setFilterToolbarVisible(bool visible) { + TRACE_OBJ CollectionConfiguration::setFilterToolbarVisible(*m_helpEngine, visible); } bool HelpEngineWrapper::addressBarEnabled() const { + TRACE_OBJ return CollectionConfiguration::addressBarEnabled(*m_helpEngine); } void HelpEngineWrapper::setAddressBarEnabled(bool enabled) { + TRACE_OBJ CollectionConfiguration::setAddressBarEnabled(*m_helpEngine, enabled); } bool HelpEngineWrapper::addressBarVisible() const { + TRACE_OBJ return CollectionConfiguration::addressBarVisible(*m_helpEngine); } void HelpEngineWrapper::setAddressBarVisible(bool visible) { + TRACE_OBJ CollectionConfiguration::setAddressBarVisible(*m_helpEngine, visible); } bool HelpEngineWrapper::documentationManagerEnabled() const { + TRACE_OBJ return CollectionConfiguration::documentationManagerEnabled(*m_helpEngine); } void HelpEngineWrapper::setDocumentationManagerEnabled(bool enabled) { + TRACE_OBJ CollectionConfiguration::setDocumentationManagerEnabled(*m_helpEngine, enabled); } const QByteArray HelpEngineWrapper::aboutMenuTexts() const { + TRACE_OBJ return CollectionConfiguration::aboutMenuTexts(*m_helpEngine); } void HelpEngineWrapper::setAboutMenuTexts(const QByteArray &texts) { + TRACE_OBJ CollectionConfiguration::setAboutMenuTexts(*m_helpEngine, texts); } const QByteArray HelpEngineWrapper::aboutIcon() const { + TRACE_OBJ return CollectionConfiguration::aboutIcon(*m_helpEngine); } void HelpEngineWrapper::setAboutIcon(const QByteArray &icon) { + TRACE_OBJ CollectionConfiguration::setAboutIcon(*m_helpEngine, icon); } const QByteArray HelpEngineWrapper::aboutImages() const { + TRACE_OBJ return CollectionConfiguration::aboutImages(*m_helpEngine); } void HelpEngineWrapper::setAboutImages(const QByteArray &images) { + TRACE_OBJ CollectionConfiguration::setAboutImages(*m_helpEngine, images); } const QByteArray HelpEngineWrapper::aboutTexts() const { + TRACE_OBJ return CollectionConfiguration::aboutTexts(*m_helpEngine); } void HelpEngineWrapper::setAboutTexts(const QByteArray &texts) { + TRACE_OBJ CollectionConfiguration::setAboutTexts(*m_helpEngine, texts); } const QString HelpEngineWrapper::windowTitle() const { + TRACE_OBJ return CollectionConfiguration::windowTitle(*m_helpEngine); } void HelpEngineWrapper::setWindowTitle(const QString &windowTitle) { + TRACE_OBJ CollectionConfiguration::setWindowTitle(*m_helpEngine, windowTitle); } const QByteArray HelpEngineWrapper::applicationIcon() const { + TRACE_OBJ return CollectionConfiguration::applicationIcon(*m_helpEngine); } void HelpEngineWrapper::setApplicationIcon(const QByteArray &icon) { + TRACE_OBJ CollectionConfiguration::setApplicationIcon(*m_helpEngine, icon); } const QByteArray HelpEngineWrapper::mainWindow() const { + TRACE_OBJ return m_helpEngine->customValue(MainWindowKey).toByteArray(); } void HelpEngineWrapper::setMainWindow(const QByteArray &mainWindow) { + TRACE_OBJ m_helpEngine->setCustomValue(MainWindowKey, mainWindow); } const QByteArray HelpEngineWrapper::mainWindowGeometry() const { + TRACE_OBJ return m_helpEngine->customValue(MainWindowGeometryKey).toByteArray(); } void HelpEngineWrapper::setMainWindowGeometry(const QByteArray &geometry) { + TRACE_OBJ m_helpEngine->setCustomValue(MainWindowGeometryKey, geometry); } const QByteArray HelpEngineWrapper::bookmarks() const { + TRACE_OBJ return m_helpEngine->customValue(BookmarksKey).toByteArray(); } void HelpEngineWrapper::setBookmarks(const QByteArray &bookmarks) { + TRACE_OBJ m_helpEngine->setCustomValue(BookmarksKey, bookmarks); } int HelpEngineWrapper::lastTabPage() const { + TRACE_OBJ return CollectionConfiguration::lastTabPage(*m_helpEngine); } void HelpEngineWrapper::setLastTabPage(int lastPage) { + TRACE_OBJ CollectionConfiguration::setLastTabPage(*m_helpEngine, lastPage); } bool HelpEngineWrapper::searchWasAttached() const { + TRACE_OBJ return m_helpEngine->customValue(SearchWasAttachedKey).toBool(); } void HelpEngineWrapper::setSearchWasAttached(bool attached) { + TRACE_OBJ m_helpEngine->setCustomValue(SearchWasAttachedKey, attached); } int HelpEngineWrapper::startOption() const { + TRACE_OBJ return m_helpEngine->customValue(StartOptionKey, ShowLastPages).toInt(); } void HelpEngineWrapper::setStartOption(int option) { + TRACE_OBJ m_helpEngine->setCustomValue(StartOptionKey, option); } const QString HelpEngineWrapper::homePage() const { + TRACE_OBJ const QString &homePage = m_helpEngine->customValue(HomePageKey).toString(); if (!homePage.isEmpty()) return homePage; @@ -469,96 +541,114 @@ const QString HelpEngineWrapper::homePage() const void HelpEngineWrapper::setHomePage(const QString &page) { + TRACE_OBJ m_helpEngine->setCustomValue(HomePageKey, page); } const QString HelpEngineWrapper::defaultHomePage() const { + TRACE_OBJ return CollectionConfiguration::defaultHomePage(*m_helpEngine); } void HelpEngineWrapper::setDefaultHomePage(const QString &page) { + TRACE_OBJ CollectionConfiguration::setDefaultHomePage(*m_helpEngine, page); } bool HelpEngineWrapper::hasFontSettings() const { + TRACE_OBJ return m_helpEngine->customValue(UseAppFontKey).isValid(); } bool HelpEngineWrapper::usesAppFont() const { + TRACE_OBJ return m_helpEngine->customValue(UseAppFontKey).toBool(); } void HelpEngineWrapper::setUseAppFont(bool useAppFont) { + TRACE_OBJ m_helpEngine->setCustomValue(UseAppFontKey, useAppFont); } bool HelpEngineWrapper::usesBrowserFont() const { + TRACE_OBJ return m_helpEngine->customValue(UseBrowserFontKey, false).toBool(); } void HelpEngineWrapper::setUseBrowserFont(bool useBrowserFont) { + TRACE_OBJ m_helpEngine->setCustomValue(UseBrowserFontKey, useBrowserFont); } const QFont HelpEngineWrapper::appFont() const { + TRACE_OBJ return qVariantValue(m_helpEngine->customValue(AppFontKey)); } void HelpEngineWrapper::setAppFont(const QFont &font) { + TRACE_OBJ m_helpEngine->setCustomValue(AppFontKey, font); } QFontDatabase::WritingSystem HelpEngineWrapper::appWritingSystem() const { + TRACE_OBJ return static_cast( m_helpEngine->customValue(AppWritingSystemKey).toInt()); } void HelpEngineWrapper::setAppWritingSystem(QFontDatabase::WritingSystem system) { + TRACE_OBJ m_helpEngine->setCustomValue(AppWritingSystemKey, system); } const QFont HelpEngineWrapper::browserFont() const { + TRACE_OBJ return qVariantValue(m_helpEngine->customValue(BrowserFontKey)); } void HelpEngineWrapper::setBrowserFont(const QFont &font) { + TRACE_OBJ m_helpEngine->setCustomValue(BrowserFontKey, font); } QFontDatabase::WritingSystem HelpEngineWrapper::browserWritingSystem() const { + TRACE_OBJ return static_cast( m_helpEngine->customValue(BrowserWritingSystemKey).toInt()); } void HelpEngineWrapper::setBrowserWritingSystem(QFontDatabase::WritingSystem system) { + TRACE_OBJ m_helpEngine->setCustomValue(BrowserWritingSystemKey, system); } void HelpEngineWrapper::assertDocFilesWatched() { + TRACE_OBJ Q_ASSERT(m_qchWatcher->files().count() == m_helpEngine->registeredDocumentations().count()); } void HelpEngineWrapper::qchFileChanged(const QString &fileName) { + TRACE_OBJ /* * We don't use QHelpEngineCore::namespaceName(fileName), because the file * may not exist anymore or contain a different namespace. diff --git a/tools/assistant/tools/assistant/helpviewer.cpp b/tools/assistant/tools/assistant/helpviewer.cpp index 5f2c02b..99c84c5 100644 --- a/tools/assistant/tools/assistant/helpviewer.cpp +++ b/tools/assistant/tools/assistant/helpviewer.cpp @@ -38,6 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#include "tracer.h" #include "helpviewer.h" #include "centralwidget.h" @@ -93,6 +94,7 @@ HelpNetworkReply::HelpNetworkReply(const QNetworkRequest &request, const QByteArray &fileData, const QString& mimeType) : data(fileData), origLen(fileData.length()) { + TRACE_OBJ setRequest(request); setOpenMode(QIODevice::ReadOnly); @@ -104,11 +106,13 @@ HelpNetworkReply::HelpNetworkReply(const QNetworkRequest &request, void HelpNetworkReply::abort() { + TRACE_OBJ // nothing to do } qint64 HelpNetworkReply::readData(char *buffer, qint64 maxlen) { + TRACE_OBJ qint64 len = qMin(qint64(data.length()), maxlen); if (len) { qMemCopy(buffer, data.constData(), len); @@ -132,11 +136,13 @@ protected: HelpNetworkAccessManager::HelpNetworkAccessManager(QObject *parent) : QNetworkAccessManager(parent) { + TRACE_OBJ } QNetworkReply *HelpNetworkAccessManager::createRequest(Operation /*op*/, const QNetworkRequest &request, QIODevice* /*outgoingData*/) { + TRACE_OBJ const QUrl& url = request.url(); QString mimeType = url.toString(); if (mimeType.endsWith(QLatin1String(".svg")) @@ -187,10 +193,12 @@ HelpPage::HelpPage(CentralWidget *central, QObject *parent) , m_pressedButtons(Qt::NoButton) , m_keyboardModifiers(Qt::NoModifier) { + TRACE_OBJ } QWebPage *HelpPage::createWindow(QWebPage::WebWindowType) { + TRACE_OBJ HelpPage* newPage = static_cast(centralWidget->newEmptyTab()->page()); if (newPage) newPage->closeNewTabIfNeeded = closeNewTabIfNeeded; @@ -200,6 +208,7 @@ QWebPage *HelpPage::createWindow(QWebPage::WebWindowType) static bool isLocalUrl(const QUrl &url) { + TRACE_OBJ const QString scheme = url.scheme(); if (scheme.isEmpty() || scheme == QLatin1String("file") @@ -213,6 +222,7 @@ static bool isLocalUrl(const QUrl &url) void HelpPage::triggerAction(WebAction action, bool checked) { + TRACE_OBJ switch (action) { case OpenLinkInNewWindow: closeNewTabIfNeeded = true; @@ -225,6 +235,7 @@ void HelpPage::triggerAction(WebAction action, bool checked) bool HelpPage::acceptNavigationRequest(QWebFrame *, const QNetworkRequest &request, QWebPage::NavigationType type) { + TRACE_OBJ const QUrl &url = request.url(); const bool closeNewTab = closeNewTabIfNeeded; closeNewTabIfNeeded = false; @@ -274,6 +285,7 @@ HelpViewer::HelpViewer(CentralWidget *parent) , loadFinished(false) , helpEngine(HelpEngineWrapper::instance()) { + TRACE_OBJ setAcceptDrops(false); setPage(new HelpPage(parent, this)); @@ -303,6 +315,7 @@ HelpViewer::HelpViewer(CentralWidget *parent) void HelpViewer::setSource(const QUrl &url) { + TRACE_OBJ loadFinished = false; if (url.toString() == QLatin1String("help")) { load(QUrl(QLatin1String("qthelp://com.trolltech.com." @@ -314,21 +327,25 @@ void HelpViewer::setSource(const QUrl &url) void HelpViewer::resetZoom() { + TRACE_OBJ setTextSizeMultiplier(1.0); } void HelpViewer::zoomIn(qreal range) { + TRACE_OBJ setTextSizeMultiplier(textSizeMultiplier() + range / 10.0); } void HelpViewer::zoomOut(qreal range) { + TRACE_OBJ setTextSizeMultiplier(qMax(0.0, textSizeMultiplier() - range / 10.0)); } void HelpViewer::wheelEvent(QWheelEvent *e) { + TRACE_OBJ if (e->modifiers() & Qt::ControlModifier) { const int delta = e->delta(); if (delta > 0) @@ -343,6 +360,7 @@ void HelpViewer::wheelEvent(QWheelEvent *e) void HelpViewer::mouseReleaseEvent(QMouseEvent *e) { + TRACE_OBJ if (e->button() == Qt::XButton1) { triggerPageAction(QWebPage::Back); return; @@ -358,6 +376,7 @@ void HelpViewer::mouseReleaseEvent(QMouseEvent *e) void HelpViewer::actionChanged() { + TRACE_OBJ QAction *a = qobject_cast(sender()); if (a == pageAction(QWebPage::Copy)) emit copyAvailable(a->isEnabled()); @@ -369,6 +388,7 @@ void HelpViewer::actionChanged() void HelpViewer::mousePressEvent(QMouseEvent *event) { + TRACE_OBJ HelpPage *currentPage = static_cast(page()); if (currentPage) { currentPage->m_pressedButtons = event->buttons(); @@ -379,6 +399,7 @@ void HelpViewer::mousePressEvent(QMouseEvent *event) void HelpViewer::setLoadFinished(bool ok) { + TRACE_OBJ loadFinished = ok; emit sourceChanged(url()); } @@ -393,11 +414,13 @@ HelpViewer::HelpViewer(CentralWidget *parent) , parentWidget(parent) , helpEngine(HelpEngineWrapper::instance()) { + TRACE_OBJ document()->setDocumentMargin(8); } void HelpViewer::setSource(const QUrl &url) { + TRACE_OBJ bool help = url.toString() == QLatin1String("help"); if (url.isValid() && !help) { if (launchedWithExternalApp(url)) @@ -422,6 +445,7 @@ void HelpViewer::setSource(const QUrl &url) void HelpViewer::resetZoom() { + TRACE_OBJ if (zoomCount == 0) return; @@ -431,6 +455,7 @@ void HelpViewer::resetZoom() void HelpViewer::zoomIn(int range) { + TRACE_OBJ if (zoomCount == 10) return; @@ -440,6 +465,7 @@ void HelpViewer::zoomIn(int range) void HelpViewer::zoomOut(int range) { + TRACE_OBJ if (zoomCount == -5) return; @@ -449,6 +475,7 @@ void HelpViewer::zoomOut(int range) bool HelpViewer::launchedWithExternalApp(const QUrl &url) { + TRACE_OBJ bool isPdf = url.path().endsWith(QLatin1String(".pdf")); if (url.scheme() == QLatin1String("http") || url.scheme() == QLatin1String("ftp") @@ -484,6 +511,7 @@ bool HelpViewer::launchedWithExternalApp(const QUrl &url) QVariant HelpViewer::loadResource(int type, const QUrl &name) { + TRACE_OBJ QByteArray ba; if (type < 4) { ba = helpEngine.fileData(name); @@ -499,6 +527,7 @@ QVariant HelpViewer::loadResource(int type, const QUrl &name) void HelpViewer::openLinkInNewTab() { + TRACE_OBJ if(lastAnchor.isEmpty()) return; @@ -508,12 +537,14 @@ void HelpViewer::openLinkInNewTab() void HelpViewer::openLinkInNewTab(const QString &link) { + TRACE_OBJ lastAnchor = link; openLinkInNewTab(); } bool HelpViewer::hasAnchorAt(const QPoint& pos) { + TRACE_OBJ lastAnchor = anchorAt(pos); if (lastAnchor.isEmpty()) return false; @@ -530,6 +561,7 @@ bool HelpViewer::hasAnchorAt(const QPoint& pos) void HelpViewer::contextMenuEvent(QContextMenuEvent *e) { + TRACE_OBJ QMenu menu(QLatin1String(""), 0); QUrl link; @@ -553,6 +585,7 @@ void HelpViewer::contextMenuEvent(QContextMenuEvent *e) void HelpViewer::mouseReleaseEvent(QMouseEvent *e) { + TRACE_OBJ if (e->button() == Qt::XButton1) { QTextBrowser::backward(); return; @@ -575,6 +608,7 @@ void HelpViewer::mouseReleaseEvent(QMouseEvent *e) void HelpViewer::keyPressEvent(QKeyEvent *e) { + TRACE_OBJ if ((e->key() == Qt::Key_Home && e->modifiers() != Qt::NoModifier) || (e->key() == Qt::Key_End && e->modifiers() != Qt::NoModifier)) { QKeyEvent* event = new QKeyEvent(e->type(), e->key(), Qt::NoModifier, @@ -586,6 +620,7 @@ void HelpViewer::keyPressEvent(QKeyEvent *e) void HelpViewer::wheelEvent(QWheelEvent *e) { + TRACE_OBJ if (e->modifiers() == Qt::CTRL) { e->accept(); (e->delta() > 0) ? zoomIn() : zoomOut(); @@ -599,6 +634,7 @@ void HelpViewer::wheelEvent(QWheelEvent *e) void HelpViewer::home() { + TRACE_OBJ setSource(helpEngine.homePage()); } diff --git a/tools/assistant/tools/assistant/indexwindow.cpp b/tools/assistant/tools/assistant/indexwindow.cpp index 78cc238..4b25846 100644 --- a/tools/assistant/tools/assistant/indexwindow.cpp +++ b/tools/assistant/tools/assistant/indexwindow.cpp @@ -38,6 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#include "tracer.h" #include "indexwindow.h" #include "centralwidget.h" @@ -61,6 +62,7 @@ IndexWindow::IndexWindow(QWidget *parent) , m_searchLineEdit(new QLineEdit) , m_indexWidget(HelpEngineWrapper::instance().indexWidget()) { + TRACE_OBJ QVBoxLayout *layout = new QVBoxLayout(this); QLabel *l = new QLabel(tr("&Look for:")); layout->addWidget(l); @@ -91,10 +93,12 @@ IndexWindow::IndexWindow(QWidget *parent) IndexWindow::~IndexWindow() { + TRACE_OBJ } void IndexWindow::filterIndices(const QString &filter) { + TRACE_OBJ if (filter.contains(QLatin1Char('*'))) m_indexWidget->filterIndices(filter, filter); else @@ -103,6 +107,7 @@ void IndexWindow::filterIndices(const QString &filter) bool IndexWindow::eventFilter(QObject *obj, QEvent *e) { + TRACE_OBJ if (obj == m_searchLineEdit && e->type() == QEvent::KeyPress) { QKeyEvent *ke = static_cast(e); QModelIndex idx = m_indexWidget->currentIndex(); @@ -168,22 +173,26 @@ bool IndexWindow::eventFilter(QObject *obj, QEvent *e) void IndexWindow::enableSearchLineEdit() { + TRACE_OBJ m_searchLineEdit->setDisabled(false); filterIndices(m_searchLineEdit->text()); } void IndexWindow::disableSearchLineEdit() { + TRACE_OBJ m_searchLineEdit->setDisabled(true); } void IndexWindow::setSearchLineEditText(const QString &text) { + TRACE_OBJ m_searchLineEdit->setText(text); } void IndexWindow::focusInEvent(QFocusEvent *e) { + TRACE_OBJ if (e->reason() != Qt::MouseFocusReason) { m_searchLineEdit->selectAll(); m_searchLineEdit->setFocus(); @@ -192,6 +201,7 @@ void IndexWindow::focusInEvent(QFocusEvent *e) void IndexWindow::open(QHelpIndexWidget* indexWidget, const QModelIndex &index) { + TRACE_OBJ QHelpIndexModel *model = qobject_cast(indexWidget->model()); if (model) { QString keyword = model->data(index, Qt::DisplayRole).toString(); diff --git a/tools/assistant/tools/assistant/installdialog.cpp b/tools/assistant/tools/assistant/installdialog.cpp index ea0bd29..4a3500f 100644 --- a/tools/assistant/tools/assistant/installdialog.cpp +++ b/tools/assistant/tools/assistant/installdialog.cpp @@ -38,6 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#include "tracer.h" #include "installdialog.h" @@ -66,6 +67,7 @@ InstallDialog::InstallDialog(QHelpEngineCore *helpEngine, QWidget *parent, const QString &host, int port) : QDialog(parent), m_helpEngine(helpEngine), m_host(host), m_port(port) { + TRACE_OBJ m_ui.setupUi(this); m_ui.installButton->setEnabled(false); @@ -94,15 +96,18 @@ InstallDialog::InstallDialog(QHelpEngineCore *helpEngine, QWidget *parent, InstallDialog::~InstallDialog() { + TRACE_OBJ } QStringList InstallDialog::installedDocumentations() const { + TRACE_OBJ return m_installedDocumentations; } void InstallDialog::init() { + TRACE_OBJ m_ui.statusLabel->setText(tr("Downloading documentation info...")); m_ui.progressBar->show(); @@ -122,6 +127,7 @@ void InstallDialog::init() void InstallDialog::updateInstallButton() { + TRACE_OBJ QListWidgetItem *item = 0; for (int i=0; icount(); ++i) { item = m_ui.listWidget->item(i); @@ -136,6 +142,7 @@ void InstallDialog::updateInstallButton() void InstallDialog::updateDocItemList() { + TRACE_OBJ QStringList registeredDocs = m_helpEngine->registeredDocumentations(); QListWidgetItem *item = 0; for (int i=0; icount(); ++i) { @@ -151,6 +158,7 @@ void InstallDialog::updateDocItemList() void InstallDialog::cancelDownload() { + TRACE_OBJ m_ui.statusLabel->setText(tr("Download canceled.")); m_httpAborted = true; m_itemsToInstall.clear(); @@ -162,6 +170,7 @@ void InstallDialog::cancelDownload() void InstallDialog::install() { + TRACE_OBJ QListWidgetItem *item = 0; for (int i=0; icount(); ++i) { item = m_ui.listWidget->item(i); @@ -174,6 +183,7 @@ void InstallDialog::install() void InstallDialog::downloadNextFile() { + TRACE_OBJ if (!m_itemsToInstall.count()) { m_ui.cancelButton->setEnabled(false); m_ui.closeButton->setEnabled(true); @@ -226,6 +236,7 @@ void InstallDialog::downloadNextFile() void InstallDialog::httpRequestFinished(int requestId, bool error) { + TRACE_OBJ if (requestId == m_docInfoId && m_buffer) { m_ui.progressBar->hide(); if (error) { @@ -296,6 +307,7 @@ void InstallDialog::httpRequestFinished(int requestId, bool error) void InstallDialog::installFile(const QString &fileName) { + TRACE_OBJ if (m_helpEngine->registerDocumentation(fileName)) { m_installedDocumentations .append(QHelpEngineCore::namespaceName(fileName)); @@ -308,6 +320,7 @@ void InstallDialog::installFile(const QString &fileName) void InstallDialog::readResponseHeader(const QHttpResponseHeader &responseHeader) { + TRACE_OBJ if (responseHeader.statusCode() != 200) { QMessageBox::information(this, m_windowTitle, tr("Download failed: %1.") @@ -321,6 +334,7 @@ void InstallDialog::readResponseHeader(const QHttpResponseHeader &responseHeader void InstallDialog::updateDataReadProgress(int bytesRead, int totalBytes) { + TRACE_OBJ if (m_httpAborted) return; @@ -330,6 +344,7 @@ void InstallDialog::updateDataReadProgress(int bytesRead, int totalBytes) void InstallDialog::browseDirectories() { + TRACE_OBJ QString dir = QFileDialog::getExistingDirectory(this, m_windowTitle, m_ui.pathLineEdit->text()); if (!dir.isEmpty()) diff --git a/tools/assistant/tools/assistant/main.cpp b/tools/assistant/tools/assistant/main.cpp index be13b0a..79ed2c8 100644 --- a/tools/assistant/tools/assistant/main.cpp +++ b/tools/assistant/tools/assistant/main.cpp @@ -38,6 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#include "tracer.h" #include #include @@ -76,6 +77,7 @@ namespace { void updateLastPagesOnUnregister(QHelpEngineCore& helpEngine, const QString& nsName) { + TRACE_OBJ int lastPage = CollectionConfiguration::lastTabPage(helpEngine); QStringList currentPages = CollectionConfiguration::lastShownPages(helpEngine); if (!currentPages.isEmpty()) { @@ -100,6 +102,7 @@ updateLastPagesOnUnregister(QHelpEngineCore& helpEngine, const QString& nsName) bool updateUserCollection(QHelpEngineCore& user, const QHelpEngineCore& caller) { + TRACE_OBJ if (!CollectionConfiguration::isNewer(caller, user)) return false; CollectionConfiguration::copyConfiguration(caller, user); @@ -108,6 +111,7 @@ updateUserCollection(QHelpEngineCore& user, const QHelpEngineCore& caller) void stripNonexistingDocs(QHelpEngineCore& collection) { + TRACE_OBJ const QStringList &namespaces = collection.registeredDocumentations(); foreach (const QString &ns, namespaces) { QFileInfo fi(collection.documentationFileName(ns)); @@ -118,6 +122,7 @@ void stripNonexistingDocs(QHelpEngineCore& collection) QString indexFilesFolder(const QString &collectionFile) { + TRACE_OBJ QString indexFilesFolder = QLatin1String(".fulltextsearch"); if (!collectionFile.isEmpty()) { QFileInfo fi(collectionFile); @@ -134,6 +139,7 @@ QString indexFilesFolder(const QString &collectionFile) */ QString constructCachedCollectionFilePath(const QHelpEngineCore &collection) { + TRACE_OBJ const QString &filePath = collection.collectionFile(); const QString &fileName = QFileInfo(filePath).fileName(); const QString &cacheDir = CollectionConfiguration::cacheDir(collection); @@ -149,6 +155,7 @@ bool synchronizeDocs(QHelpEngineCore &collection, QHelpEngineCore &cachedCollection, CmdLineParser &cmd) { + TRACE_OBJ const QDateTime &lastCollectionRegisterTime = CollectionConfiguration::lastRegisterTime(collection); if (!lastCollectionRegisterTime.isValid() || lastCollectionRegisterTime @@ -180,6 +187,7 @@ bool synchronizeDocs(QHelpEngineCore &collection, bool removeSearchIndex(const QString &collectionFile) { + TRACE_OBJ QString path = QFileInfo(collectionFile).path(); path += QLatin1Char('/') + indexFilesFolder(collectionFile); @@ -199,6 +207,7 @@ bool removeSearchIndex(const QString &collectionFile) bool checkForSqlite(CmdLineParser &cmd) { + TRACE_OBJ QSqlDatabase db; QStringList sqlDrivers(db.drivers()); if (!sqlDrivers.contains(QLatin1String("QSQLITE"))) { @@ -211,6 +220,7 @@ bool checkForSqlite(CmdLineParser &cmd) bool useGui(int argc, char *argv[]) { + TRACE_OBJ bool gui = true; #ifndef Q_OS_WIN // Look for arguments that imply command-line mode. @@ -232,6 +242,7 @@ bool useGui(int argc, char *argv[]) bool registerDocumentation(QHelpEngineCore &collection, CmdLineParser &cmd, bool printSuccess) { + TRACE_OBJ if (!collection.registerDocumentation(cmd.helpFile())) { cmd.showMessage( QObject::tr("Could not register documentation file\n%1\n\nReason:\n%2") @@ -248,6 +259,7 @@ bool registerDocumentation(QHelpEngineCore &collection, CmdLineParser &cmd, bool unregisterDocumentation(QHelpEngineCore &collection, const QString &namespaceName, CmdLineParser &cmd, bool printSuccess) { + TRACE_OBJ if (!collection.unregisterDocumentation(namespaceName)) { cmd.showMessage(QObject::tr("Could not unregister documentation" " file\n%1\n\nReason:\n%2"). @@ -263,6 +275,7 @@ bool unregisterDocumentation(QHelpEngineCore &collection, void setupTranslations(QApplication &app) { + TRACE_OBJ const QString& locale = QLocale::system().name(); QString resourceDir = QLibraryInfo::location(QLibraryInfo::TranslationsPath); @@ -283,6 +296,7 @@ void setupTranslations(QApplication &app) int main(int argc, char *argv[]) { + TRACE_OBJ QApplication a(argc, argv, useGui(argc, argv)); a.addLibraryPath(a.applicationDirPath() + QLatin1String("/plugins")); diff --git a/tools/assistant/tools/assistant/mainwindow.cpp b/tools/assistant/tools/assistant/mainwindow.cpp index 9955c65..ce4ab7f 100644 --- a/tools/assistant/tools/assistant/mainwindow.cpp +++ b/tools/assistant/tools/assistant/mainwindow.cpp @@ -38,6 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#include "tracer.h" #include "mainwindow.h" #include "centralwidget.h" @@ -101,6 +102,7 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent) , m_qtDocInstaller(0) , m_connectedInitSignals(false) { + TRACE_OBJ setToolButtonStyle(Qt::ToolButtonFollowStyle); @@ -254,17 +256,20 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent) MainWindow::~MainWindow() { + TRACE_OBJ if (m_qtDocInstaller) delete m_qtDocInstaller; } bool MainWindow::usesDefaultCollection() const { + TRACE_OBJ return m_cmdLine->collectionFile().isEmpty(); } void MainWindow::closeEvent(QCloseEvent *e) { + TRACE_OBJ m_bookmarkManager->saveBookmarks(); HelpEngineWrapper::instance().setMainWindow(saveState()); HelpEngineWrapper::instance().setMainWindowGeometry(saveGeometry()); @@ -273,6 +278,7 @@ void MainWindow::closeEvent(QCloseEvent *e) bool MainWindow::initHelpDB() { + TRACE_OBJ HelpEngineWrapper &helpEngineWrapper = HelpEngineWrapper::instance(); if (!helpEngineWrapper.setupData()) return false; @@ -323,6 +329,7 @@ bool MainWindow::initHelpDB() void MainWindow::lookForNewQtDocumentation() { + TRACE_OBJ HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); QStringList docs; docs << QLatin1String("assistant") @@ -348,6 +355,7 @@ void MainWindow::lookForNewQtDocumentation() void MainWindow::qtDocumentationInstalled(bool newDocsInstalled) { + TRACE_OBJ if (newDocsInstalled) HelpEngineWrapper::instance().setupData(); statusBar()->clearMessage(); @@ -356,6 +364,7 @@ void MainWindow::qtDocumentationInstalled(bool newDocsInstalled) void MainWindow::checkInitState() { + TRACE_OBJ if (!m_cmdLine->enableRemoteControl()) return; @@ -380,6 +389,7 @@ void MainWindow::checkInitState() void MainWindow::updateBookmarkMenu() { + TRACE_OBJ if (m_bookmarkManager) { m_bookmarkMenu->removeAction(m_importBookmarkAction); m_bookmarkMenu->removeAction(m_exportBookmarkAction); @@ -398,6 +408,7 @@ void MainWindow::updateBookmarkMenu() void MainWindow::showBookmark(QAction *action) { + TRACE_OBJ if (m_bookmarkManager) { const QUrl &url = m_bookmarkManager->urlForAction(action); if (url.isValid()) @@ -407,6 +418,7 @@ void MainWindow::showBookmark(QAction *action) void MainWindow::insertLastPages() { + TRACE_OBJ if (m_cmdLine->url().isValid()) m_centralWidget->setSource(m_cmdLine->url()); else @@ -418,6 +430,7 @@ void MainWindow::insertLastPages() void MainWindow::setupActions() { + TRACE_OBJ QString resourcePath = QLatin1String(":/trolltech/assistant/images/"); #ifdef Q_OS_MAC setUnifiedTitleAndToolBarOnMac(true); @@ -643,6 +656,7 @@ void MainWindow::setupActions() QMenu *MainWindow::toolBarMenu() { + TRACE_OBJ if (!m_toolBarMenu) { m_viewMenu->addSeparator(); m_toolBarMenu = m_viewMenu->addMenu(tr("Toolbars")); @@ -652,6 +666,7 @@ QMenu *MainWindow::toolBarMenu() void MainWindow::setupFilterToolbar() { + TRACE_OBJ HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); if (!helpEngine.filterFunctionalityEnabled()) return; @@ -682,6 +697,7 @@ void MainWindow::setupFilterToolbar() void MainWindow::setupAddressToolbar() { + TRACE_OBJ HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); if (!helpEngine.addressBarEnabled()) return; @@ -710,6 +726,7 @@ void MainWindow::setupAddressToolbar() void MainWindow::updateAboutMenuText() { + TRACE_OBJ QByteArray ba = HelpEngineWrapper::instance().aboutMenuTexts(); if (ba.size() > 0) { QString lang; @@ -737,27 +754,32 @@ void MainWindow::updateAboutMenuText() void MainWindow::showNewAddress() { + TRACE_OBJ showNewAddress(m_centralWidget->currentSource()); } void MainWindow::showNewAddress(const QUrl &url) { + TRACE_OBJ m_addressLineEdit->setText(url.toString()); } void MainWindow::addBookmark() { + TRACE_OBJ addNewBookmark(m_centralWidget->currentTitle(), m_centralWidget->currentSource().toString()); } void MainWindow::gotoAddress() { + TRACE_OBJ m_centralWidget->setSource(m_addressLineEdit->text()); } void MainWindow::updateNavigationItems() { + TRACE_OBJ bool hasCurrentViewer = m_centralWidget->isHomeAvailable(); m_copyAction->setEnabled(m_centralWidget->hasSelection()); m_homeAction->setEnabled(hasCurrentViewer); @@ -771,12 +793,14 @@ void MainWindow::updateNavigationItems() void MainWindow::updateTabCloseAction() { + TRACE_OBJ m_closeTabAction->setEnabled(m_centralWidget->enableTabCloseAction()); } void MainWindow::showTopicChooser(const QMap &links, const QString &keyword) { + TRACE_OBJ TopicChooser tc(this, keyword, links); if (tc.exec() == QDialog::Accepted) { m_centralWidget->setSource(tc.link()); @@ -785,6 +809,7 @@ void MainWindow::showTopicChooser(const QMap &links, void MainWindow::showPreferences() { + TRACE_OBJ PreferencesDialog dia(this); connect(&dia, SIGNAL(updateApplicationFont()), this, @@ -797,6 +822,7 @@ void MainWindow::showPreferences() void MainWindow::syncContents() { + TRACE_OBJ qApp->setOverrideCursor(QCursor(Qt::WaitCursor)); const QUrl url = m_centralWidget->currentSource(); showContents(); @@ -808,11 +834,13 @@ void MainWindow::syncContents() void MainWindow::copyAvailable(bool yes) { + TRACE_OBJ m_copyAction->setEnabled(yes); } void MainWindow::addNewBookmark(const QString &title, const QString &url) { + TRACE_OBJ if (url.isEmpty() || url == QLatin1String("about:blank")) return; @@ -821,6 +849,7 @@ void MainWindow::addNewBookmark(const QString &title, const QString &url) void MainWindow::showAboutDialog() { + TRACE_OBJ HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); QByteArray contents; QByteArray ba = helpEngine.aboutTexts(); @@ -874,6 +903,7 @@ void MainWindow::showAboutDialog() void MainWindow::setContentsVisible(bool visible) { + TRACE_OBJ if (visible) showContents(); else @@ -882,16 +912,19 @@ void MainWindow::setContentsVisible(bool visible) void MainWindow::showContents() { + TRACE_OBJ activateDockWidget(m_contentWindow); } void MainWindow::hideContents() { + TRACE_OBJ m_contentWindow->parentWidget()->hide(); } void MainWindow::setIndexVisible(bool visible) { + TRACE_OBJ if (visible) showIndex(); else @@ -900,16 +933,19 @@ void MainWindow::setIndexVisible(bool visible) void MainWindow::showIndex() { + TRACE_OBJ activateDockWidget(m_indexWindow); } void MainWindow::hideIndex() { + TRACE_OBJ m_indexWindow->parentWidget()->hide(); } void MainWindow::setBookmarksVisible(bool visible) { + TRACE_OBJ if (visible) showBookmarks(); else @@ -919,16 +955,19 @@ void MainWindow::setBookmarksVisible(bool visible) void MainWindow::showBookmarks() { + TRACE_OBJ activateDockWidget(m_bookmarkWidget); } void MainWindow::hideBookmarks() { + TRACE_OBJ m_bookmarkWidget->parentWidget()->hide(); } void MainWindow::setSearchVisible(bool visible) { + TRACE_OBJ if (visible) showSearch(); else @@ -937,16 +976,19 @@ void MainWindow::setSearchVisible(bool visible) void MainWindow::showSearch() { + TRACE_OBJ m_centralWidget->activateSearchWidget(); } void MainWindow::hideSearch() { + TRACE_OBJ m_centralWidget->removeSearchWidget(); } void MainWindow::activateDockWidget(QWidget *w) { + TRACE_OBJ w->parentWidget()->show(); w->parentWidget()->raise(); w->setFocus(); @@ -954,11 +996,13 @@ void MainWindow::activateDockWidget(QWidget *w) void MainWindow::setIndexString(const QString &str) { + TRACE_OBJ m_indexWindow->setSearchLineEditText(str); } void MainWindow::activateCurrentBrowser() { + TRACE_OBJ CentralWidget *cw = CentralWidget::instance(); if (cw) { cw->activateTab(true); @@ -967,16 +1011,19 @@ void MainWindow::activateCurrentBrowser() void MainWindow::activateCurrentCentralWidgetTab() { + TRACE_OBJ m_centralWidget->activateTab(); } void MainWindow::showSearchWidget() { + TRACE_OBJ m_centralWidget->activateSearchWidget(true); } void MainWindow::updateApplicationFont() { + TRACE_OBJ HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); QFont font = qApp->font(); if (helpEngine.usesAppFont()) @@ -987,6 +1034,7 @@ void MainWindow::updateApplicationFont() void MainWindow::setupFilterCombo() { + TRACE_OBJ HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); QString curFilter = m_filterCombo->currentText(); if (curFilter.isEmpty()) @@ -1001,17 +1049,20 @@ void MainWindow::setupFilterCombo() void MainWindow::filterDocumentation(const QString &customFilter) { + TRACE_OBJ HelpEngineWrapper::instance().setCurrentFilter(customFilter); } void MainWindow::expandTOC(int depth) { + TRACE_OBJ Q_ASSERT(depth >= -1); m_contentWindow->expandToDepth(depth); } void MainWindow::indexingStarted() { + TRACE_OBJ if (!m_progressWidget) { m_progressWidget = new QWidget(); QLayout* hlayout = new QHBoxLayout(m_progressWidget); @@ -1037,6 +1088,7 @@ void MainWindow::indexingStarted() void MainWindow::indexingFinished() { + TRACE_OBJ statusBar()->removeWidget(m_progressWidget); delete m_progressWidget; m_progressWidget = 0; @@ -1044,6 +1096,7 @@ void MainWindow::indexingFinished() QWidget* MainWindow::setupBookmarkWidget() { + TRACE_OBJ m_bookmarkManager = new BookmarkManager; m_bookmarkWidget = new BookmarkWidget(m_bookmarkManager, this); connect(m_bookmarkWidget, SIGNAL(addBookmark()), this, SLOT(addBookmark())); @@ -1052,6 +1105,7 @@ QWidget* MainWindow::setupBookmarkWidget() QString MainWindow::collectionFileDirectory(bool createDir, const QString &cacheDir) { + TRACE_OBJ QString collectionPath = QDesktopServices::storageLocation(QDesktopServices::DataLocation); if (collectionPath.isEmpty()) { @@ -1077,6 +1131,7 @@ QString MainWindow::collectionFileDirectory(bool createDir, const QString &cache QString MainWindow::defaultHelpCollectionFileName() { + TRACE_OBJ return collectionFileDirectory() + QDir::separator() + QString(QLatin1String("qthelpcollection_%1.qhc")). arg(QLatin1String(QT_VERSION_STR)); @@ -1084,6 +1139,7 @@ QString MainWindow::defaultHelpCollectionFileName() void MainWindow::importBookmarks() { + TRACE_OBJ const QString &fileName = QFileDialog::getOpenFileName(0, tr("Open File"), QDir::currentPath(), tr("Files (*.xbel)")); @@ -1100,6 +1156,7 @@ void MainWindow::importBookmarks() void MainWindow::exportBookmarks() { + TRACE_OBJ QString fileName = QFileDialog::getSaveFileName(0, tr("Save File"), "untitled.xbel", tr("Files (*.xbel)")); @@ -1119,6 +1176,7 @@ void MainWindow::exportBookmarks() void MainWindow::currentFilterChanged(const QString &filter) { + TRACE_OBJ const int index = m_filterCombo->findText(filter); Q_ASSERT(index != -1); m_filterCombo->setCurrentIndex(index); @@ -1126,12 +1184,14 @@ void MainWindow::currentFilterChanged(const QString &filter) void MainWindow::documentationRemoved(const QString &namespaceName) { + TRACE_OBJ CentralWidget* widget = CentralWidget::instance(); widget->closeTabs(widget->currentSourceFileList().keys(namespaceName)); } void MainWindow::documentationUpdated(const QString &namespaceName) { + TRACE_OBJ // TODO: Check whether the documents still exists and if they do, reload. CentralWidget* widget = CentralWidget::instance(); widget->closeTabs(widget->currentSourceFileList().keys(namespaceName)); @@ -1139,6 +1199,7 @@ void MainWindow::documentationUpdated(const QString &namespaceName) void MainWindow::resetQtDocInfo(const QString &component) { + TRACE_OBJ HelpEngineWrapper::instance().setQtDocInfo(component, QStringList(QDateTime().toString(Qt::ISODate))); } @@ -1146,6 +1207,7 @@ void MainWindow::resetQtDocInfo(const QString &component) void MainWindow::registerDocumentation(const QString &component, const QString &absFileName) { + TRACE_OBJ QString ns = QHelpEngineCore::namespaceName(absFileName); if (ns.isEmpty()) return; diff --git a/tools/assistant/tools/assistant/preferencesdialog.cpp b/tools/assistant/tools/assistant/preferencesdialog.cpp index 2f282b1..aac26f1 100644 --- a/tools/assistant/tools/assistant/preferencesdialog.cpp +++ b/tools/assistant/tools/assistant/preferencesdialog.cpp @@ -38,6 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#include "tracer.h" #include "preferencesdialog.h" #include "filternamedialog.h" @@ -68,6 +69,7 @@ PreferencesDialog::PreferencesDialog(QWidget *parent) , m_browserFontChanged(false) , helpEngine(HelpEngineWrapper::instance()) { + TRACE_OBJ m_ui.setupUi(this); connect(m_ui.buttonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked()), @@ -117,6 +119,7 @@ PreferencesDialog::PreferencesDialog(QWidget *parent) PreferencesDialog::~PreferencesDialog() { + TRACE_OBJ if (m_appFontChanged) { helpEngine.setAppFont(m_appFontPanel->selectedFont()); helpEngine.setUseAppFont(m_appFontPanel->isChecked()); @@ -145,12 +148,14 @@ PreferencesDialog::~PreferencesDialog() void PreferencesDialog::showDialog() { + TRACE_OBJ if (exec() != Accepted) m_appFontChanged = m_browserFontChanged = false; } void PreferencesDialog::updateFilterPage() { + TRACE_OBJ m_ui.filterWidget->clear(); m_ui.attributeWidget->clear(); @@ -174,6 +179,7 @@ void PreferencesDialog::updateFilterPage() void PreferencesDialog::updateAttributes(QListWidgetItem *item) { + TRACE_OBJ QStringList checkedList; if (item) checkedList = m_filterMap.value(item->text()); @@ -189,6 +195,7 @@ void PreferencesDialog::updateAttributes(QListWidgetItem *item) void PreferencesDialog::updateFilterMap() { + TRACE_OBJ if (!m_ui.filterWidget->currentItem()) return; QString filter = m_ui.filterWidget->currentItem()->text(); @@ -207,6 +214,7 @@ void PreferencesDialog::updateFilterMap() void PreferencesDialog::addFilter() { + TRACE_OBJ FilterNameDialog dia(this); if (dia.exec() == QDialog::Rejected) return; @@ -224,6 +232,7 @@ void PreferencesDialog::addFilter() void PreferencesDialog::removeFilter() { + TRACE_OBJ QListWidgetItem *item = m_ui.filterWidget ->takeItem(m_ui.filterWidget->currentRow()); if (!item) @@ -238,6 +247,7 @@ void PreferencesDialog::removeFilter() void PreferencesDialog::addDocumentationLocal() { + TRACE_OBJ const QStringList fileNames = QFileDialog::getOpenFileNames(this, tr("Add Documentation"), QString(), tr("Qt Compressed Help Files (*.qch)")); if (fileNames.isEmpty()) @@ -291,6 +301,7 @@ void PreferencesDialog::addDocumentationLocal() void PreferencesDialog::removeDocumentation() { + TRACE_OBJ bool foundBefore = false; CentralWidget* widget = CentralWidget::instance(); QMap openedDocList = widget->currentSourceFileList(); @@ -322,6 +333,7 @@ void PreferencesDialog::removeDocumentation() void PreferencesDialog::applyChanges() { + TRACE_OBJ bool filtersWereChanged = false; if (!m_hideFiltersTab) { if (m_filterMap.count() != m_filterMapBackup.count()) { @@ -375,6 +387,7 @@ void PreferencesDialog::applyChanges() void PreferencesDialog::updateFontSettingsPage() { + TRACE_OBJ m_browserFontPanel = new FontPanel(this); m_browserFontPanel->setCheckable(true); m_ui.stackedWidget_2->insertWidget(0, m_browserFontPanel); @@ -426,30 +439,35 @@ void PreferencesDialog::updateFontSettingsPage() void PreferencesDialog::appFontSettingToggled(bool on) { + TRACE_OBJ Q_UNUSED(on) m_appFontChanged = true; } void PreferencesDialog::appFontSettingChanged(int index) { + TRACE_OBJ Q_UNUSED(index) m_appFontChanged = true; } void PreferencesDialog::browserFontSettingToggled(bool on) { + TRACE_OBJ Q_UNUSED(on) m_browserFontChanged = true; } void PreferencesDialog::browserFontSettingChanged(int index) { + TRACE_OBJ Q_UNUSED(index) m_browserFontChanged = true; } void PreferencesDialog::updateOptionsPage() { + TRACE_OBJ m_ui.homePageLineEdit->setText(helpEngine.homePage()); int option = helpEngine.startOption(); @@ -462,11 +480,13 @@ void PreferencesDialog::updateOptionsPage() void PreferencesDialog::setBlankPage() { + TRACE_OBJ m_ui.homePageLineEdit->setText(QLatin1String("about:blank")); } void PreferencesDialog::setCurrentPage() { + TRACE_OBJ QString homepage = CentralWidget::instance()->currentSource().toString(); if (homepage.isEmpty()) homepage = QLatin1String("help"); @@ -476,6 +496,7 @@ void PreferencesDialog::setCurrentPage() void PreferencesDialog::setDefaultPage() { + TRACE_OBJ m_ui.homePageLineEdit->setText(helpEngine.defaultHomePage()); } diff --git a/tools/assistant/tools/assistant/qtdocinstaller.cpp b/tools/assistant/tools/assistant/qtdocinstaller.cpp index 3675aec..44272a0 100644 --- a/tools/assistant/tools/assistant/qtdocinstaller.cpp +++ b/tools/assistant/tools/assistant/qtdocinstaller.cpp @@ -38,6 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#include "tracer.h" #include #include @@ -52,10 +53,12 @@ QT_BEGIN_NAMESPACE QtDocInstaller::QtDocInstaller(const QList &docInfos) : m_abort(false), m_docInfos(docInfos) { + TRACE_OBJ } QtDocInstaller::~QtDocInstaller() { + TRACE_OBJ if (!isRunning()) return; m_mutex.lock(); @@ -66,11 +69,13 @@ QtDocInstaller::~QtDocInstaller() void QtDocInstaller::installDocs() { + TRACE_OBJ start(LowPriority); } void QtDocInstaller::run() { + TRACE_OBJ m_qchDir = QLibraryInfo::location(QLibraryInfo::DocumentationPath) + QDir::separator() + QLatin1String("qch"); m_qchFiles = m_qchDir.entryList(QStringList() << QLatin1String("*.qch")); @@ -90,6 +95,7 @@ void QtDocInstaller::run() bool QtDocInstaller::installDoc(const DocInfo &docInfo) { + TRACE_OBJ const QString &component = docInfo.first; const QStringList &info = docInfo.second; QDateTime dt; diff --git a/tools/assistant/tools/assistant/remotecontrol.cpp b/tools/assistant/tools/assistant/remotecontrol.cpp index f4ae3b4..f8eef4c 100644 --- a/tools/assistant/tools/assistant/remotecontrol.cpp +++ b/tools/assistant/tools/assistant/remotecontrol.cpp @@ -38,6 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#include "tracer.h" #include "remotecontrol.h" #include "mainwindow.h" @@ -68,16 +69,19 @@ QT_BEGIN_NAMESPACE StdInListenerWin::StdInListenerWin(QObject *parent) : QThread(parent) { + TRACE_OBJ } StdInListenerWin::~StdInListenerWin() { + TRACE_OBJ terminate(); wait(); } void StdInListenerWin::run() { + TRACE_OBJ bool ok = true; char chBuf[4096]; DWORD dwRead; @@ -117,6 +121,7 @@ RemoteControl::RemoteControl(MainWindow *mainWindow) , helpEngine(HelpEngineWrapper::instance()) { + TRACE_OBJ connect(m_mainWindow, SIGNAL(initDone()), this, SLOT(applyCache())); #ifdef Q_OS_WIN StdInListenerWin *l = new StdInListenerWin(this); @@ -133,6 +138,7 @@ RemoteControl::RemoteControl(MainWindow *mainWindow) void RemoteControl::receivedData() { + TRACE_OBJ QByteArray ba; while (true) { char c = getc(stdin); @@ -148,6 +154,7 @@ void RemoteControl::receivedData() void RemoteControl::handleCommandString(const QString &cmdString) { + TRACE_OBJ QStringList cmds = cmdString.split(QLatin1Char(';')); QStringList::const_iterator it = cmds.constBegin(); while (it != cmds.constEnd()) { @@ -192,6 +199,7 @@ void RemoteControl::handleCommandString(const QString &cmdString) void RemoteControl::splitInputString(const QString &input, QString &cmd, QString &arg) { + TRACE_OBJ QString cmdLine = input.trimmed(); int i = cmdLine.indexOf(QLatin1Char(' ')); cmd = cmdLine.left(i); @@ -201,11 +209,13 @@ void RemoteControl::splitInputString(const QString &input, QString &cmd, void RemoteControl::handleDebugCommand(const QString &arg) { + TRACE_OBJ m_debug = arg == QLatin1String("on"); } void RemoteControl::handleShowOrHideCommand(const QString &arg, bool show) { + TRACE_OBJ if (arg.toLower() == QLatin1String("contents")) m_mainWindow->setContentsVisible(show); else if (arg.toLower() == QLatin1String("index")) @@ -218,6 +228,7 @@ void RemoteControl::handleShowOrHideCommand(const QString &arg, bool show) void RemoteControl::handleSetSourceCommand(const QString &arg) { + TRACE_OBJ QUrl url(arg); if (url.isValid()) { if (url.isRelative()) @@ -233,6 +244,7 @@ void RemoteControl::handleSetSourceCommand(const QString &arg) void RemoteControl::handleSyncContentsCommand() { + TRACE_OBJ if (m_caching) m_syncContents = true; else @@ -241,6 +253,7 @@ void RemoteControl::handleSyncContentsCommand() void RemoteControl::handleActivateKeywordCommand(const QString &arg) { + TRACE_OBJ if (m_caching) { clearCache(); m_activateKeyword = arg; @@ -253,6 +266,7 @@ void RemoteControl::handleActivateKeywordCommand(const QString &arg) void RemoteControl::handleActivateIdentifierCommand(const QString &arg) { + TRACE_OBJ if (m_caching) { clearCache(); m_activateIdentifier = arg; @@ -265,6 +279,7 @@ void RemoteControl::handleActivateIdentifierCommand(const QString &arg) void RemoteControl::handleExpandTocCommand(const QString &arg) { + TRACE_OBJ bool ok = false; int depth = -2; if (!arg.isEmpty()) @@ -280,6 +295,7 @@ void RemoteControl::handleExpandTocCommand(const QString &arg) void RemoteControl::handleSetCurrentFilterCommand(const QString &arg) { + TRACE_OBJ if (helpEngine.customFilters().contains(arg)) { if (m_caching) { clearCache(); @@ -292,6 +308,7 @@ void RemoteControl::handleSetCurrentFilterCommand(const QString &arg) void RemoteControl::handleRegisterCommand(const QString &arg) { + TRACE_OBJ const QString &absFileName = QFileInfo(arg).absoluteFilePath(); if (helpEngine.registeredDocumentations(). contains(QHelpEngineCore::namespaceName(absFileName))) @@ -302,6 +319,7 @@ void RemoteControl::handleRegisterCommand(const QString &arg) void RemoteControl::handleUnregisterCommand(const QString &arg) { + TRACE_OBJ const QString &absFileName = QFileInfo(arg).absoluteFilePath(); const QString &ns = QHelpEngineCore::namespaceName(absFileName); if (helpEngine.registeredDocumentations().contains(ns)) { @@ -314,6 +332,7 @@ void RemoteControl::handleUnregisterCommand(const QString &arg) void RemoteControl::applyCache() { + TRACE_OBJ if (m_setSource.isValid()) { CentralWidget::instance()->setSource(m_setSource); } else if (!m_activateKeyword.isEmpty()) { @@ -340,6 +359,7 @@ void RemoteControl::applyCache() void RemoteControl::clearCache() { + TRACE_OBJ m_currentFilter.clear(); m_setSource.clear(); m_syncContents = false; diff --git a/tools/assistant/tools/assistant/searchwidget.cpp b/tools/assistant/tools/assistant/searchwidget.cpp index 3b456a3..06cf4b0 100644 --- a/tools/assistant/tools/assistant/searchwidget.cpp +++ b/tools/assistant/tools/assistant/searchwidget.cpp @@ -38,6 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#include "tracer.h" #include "mainwindow.h" #include "searchwidget.h" @@ -65,6 +66,7 @@ SearchWidget::SearchWidget(QHelpSearchEngine *engine, QWidget *parent) , attached(false) , searchEngine(engine) { + TRACE_OBJ QVBoxLayout *vLayout = new QVBoxLayout(this); resultWidget = searchEngine->resultWidget(); @@ -91,11 +93,13 @@ SearchWidget::SearchWidget(QHelpSearchEngine *engine, QWidget *parent) SearchWidget::~SearchWidget() { + TRACE_OBJ // nothing todo } void SearchWidget::zoomIn() { + TRACE_OBJ QTextBrowser* browser = qFindChild(resultWidget); if (browser && zoomCount != 10) { zoomCount++; @@ -105,6 +109,7 @@ void SearchWidget::zoomIn() void SearchWidget::zoomOut() { + TRACE_OBJ QTextBrowser* browser = qFindChild(resultWidget); if (browser && zoomCount != -5) { zoomCount--; @@ -114,6 +119,7 @@ void SearchWidget::zoomOut() void SearchWidget::resetZoom() { + TRACE_OBJ if (zoomCount == 0) return; @@ -126,33 +132,39 @@ void SearchWidget::resetZoom() bool SearchWidget::isAttached() const { + TRACE_OBJ return attached; } void SearchWidget::setAttached(bool state) { + TRACE_OBJ attached = state; } void SearchWidget::search() const { + TRACE_OBJ QList query = searchEngine->queryWidget()->query(); searchEngine->search(query); } void SearchWidget::searchingStarted() { + TRACE_OBJ qApp->setOverrideCursor(QCursor(Qt::WaitCursor)); } void SearchWidget::searchingFinished(int hits) { + TRACE_OBJ Q_UNUSED(hits) qApp->restoreOverrideCursor(); } bool SearchWidget::eventFilter(QObject* o, QEvent *e) { + TRACE_OBJ QTextBrowser* browser = qFindChild(resultWidget); if (browser && o == browser->viewport() && e->type() == QEvent::MouseButtonRelease){ @@ -171,6 +183,7 @@ bool SearchWidget::eventFilter(QObject* o, QEvent *e) void SearchWidget::keyPressEvent(QKeyEvent *keyEvent) { + TRACE_OBJ if (keyEvent->key() == Qt::Key_Escape) MainWindow::activateCurrentBrowser(); else @@ -179,6 +192,7 @@ void SearchWidget::keyPressEvent(QKeyEvent *keyEvent) void SearchWidget::contextMenuEvent(QContextMenuEvent *contextMenuEvent) { + TRACE_OBJ QMenu menu; QPoint point = contextMenuEvent->globalPos(); diff --git a/tools/assistant/tools/assistant/topicchooser.cpp b/tools/assistant/tools/assistant/topicchooser.cpp index 0382fe2..803ea04 100644 --- a/tools/assistant/tools/assistant/topicchooser.cpp +++ b/tools/assistant/tools/assistant/topicchooser.cpp @@ -38,6 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#include "tracer.h" #include #include @@ -50,6 +51,7 @@ TopicChooser::TopicChooser(QWidget *parent, const QString &keyword, const QMap &links) : QDialog(parent) { + TRACE_OBJ ui.setupUi(this); ui.label->setText(tr("Choose a topic for %1:").arg(keyword)); @@ -72,6 +74,7 @@ TopicChooser::TopicChooser(QWidget *parent, const QString &keyword, QUrl TopicChooser::link() const { + TRACE_OBJ QListWidgetItem *item = ui.listWidget->currentItem(); if (!item) return QUrl(); diff --git a/tools/assistant/tools/assistant/xbelsupport.cpp b/tools/assistant/tools/assistant/xbelsupport.cpp index 3c545ac..f2c0bcb 100644 --- a/tools/assistant/tools/assistant/xbelsupport.cpp +++ b/tools/assistant/tools/assistant/xbelsupport.cpp @@ -38,6 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#include "tracer.h" #include "xbelsupport.h" #include "bookmarkmanager.h" @@ -56,11 +57,13 @@ XbelWriter::XbelWriter(BookmarkModel *model) : QXmlStreamWriter() , treeModel(model) { + TRACE_OBJ setAutoFormatting(true); } void XbelWriter::writeToFile(QIODevice *device) { + TRACE_OBJ setDevice(device); writeStartDocument(); @@ -77,6 +80,7 @@ void XbelWriter::writeToFile(QIODevice *device) void XbelWriter::writeData(QStandardItem *child) { + TRACE_OBJ Bookmark entry; entry.title = child->data(Qt::DisplayRole).toString(); entry.url = child->data(Qt::UserRole + 10).toString(); @@ -111,12 +115,14 @@ XbelReader::XbelReader(BookmarkModel *tree, BookmarkModel *list) , treeModel(tree) , listModel(list) { + TRACE_OBJ folderIcon = QApplication::style()->standardIcon(QStyle::SP_DirClosedIcon); bookmarkIcon = QIcon(QLatin1String(":/trolltech/assistant/images/bookmark.png")); } bool XbelReader::readFromFile(QIODevice *device) { + TRACE_OBJ setDevice(device); while (!atEnd()) { @@ -138,6 +144,7 @@ bool XbelReader::readFromFile(QIODevice *device) void XbelReader::readXBEL() { + TRACE_OBJ while (!atEnd()) { readNext(); @@ -157,6 +164,7 @@ void XbelReader::readXBEL() void XbelReader::readUnknownElement() { + TRACE_OBJ while (!atEnd()) { readNext(); @@ -170,6 +178,7 @@ void XbelReader::readUnknownElement() void XbelReader::readFolder(QStandardItem *item) { + TRACE_OBJ QStandardItem *folder = createChildItem(item); folder->setIcon(folderIcon); folder->setData(QLatin1String("Folder"), Qt::UserRole + 10); @@ -199,6 +208,7 @@ void XbelReader::readFolder(QStandardItem *item) void XbelReader::readBookmark(QStandardItem *item) { + TRACE_OBJ QStandardItem *bookmark = createChildItem(item); bookmark->setIcon(bookmarkIcon); bookmark->setText(QCoreApplication::tr("Unknown title")); @@ -224,6 +234,7 @@ void XbelReader::readBookmark(QStandardItem *item) QStandardItem *XbelReader::createChildItem(QStandardItem *item) { + TRACE_OBJ QStandardItem *childItem = new QStandardItem(); childItem->setEditable(false); -- cgit v0.12 From 44aa42960ad8e1df5499b515d23041bdffce6988 Mon Sep 17 00:00:00 2001 From: David Faure Date: Mon, 7 Dec 2009 16:34:45 +0100 Subject: Fix memory leak Merge-request: 391 Reviewed-by: Eskil Abrahamsen Blomfeldt --- examples/webkit/fancybrowser/mainwindow.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/webkit/fancybrowser/mainwindow.cpp b/examples/webkit/fancybrowser/mainwindow.cpp index cfc5500..6b3f983 100644 --- a/examples/webkit/fancybrowser/mainwindow.cpp +++ b/examples/webkit/fancybrowser/mainwindow.cpp @@ -120,6 +120,7 @@ void MainWindow::slotSourceDownloaded() textEdit->setAttribute(Qt::WA_DeleteOnClose); textEdit->show(); textEdit->setPlainText(reply->readAll()); + reply->deleteLater(); } //! [4] -- cgit v0.12 From 0c9aa0cc58e3cf3f477024b35291b407be059c01 Mon Sep 17 00:00:00 2001 From: ck Date: Mon, 7 Dec 2009 16:44:34 +0100 Subject: Assistant: Add "shared" directory to dependency list. --- tools/assistant/tools/assistant/assistant.pro | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/assistant/tools/assistant/assistant.pro b/tools/assistant/tools/assistant/assistant.pro index ca2e52e..980f078 100644 --- a/tools/assistant/tools/assistant/assistant.pro +++ b/tools/assistant/tools/assistant/assistant.pro @@ -11,6 +11,7 @@ PROJECTNAME = Assistant DESTDIR = ../../../../bin target.path = $$[QT_INSTALL_BINS] INSTALLS += target +DEPENDPATH += ../shared # ## Work around a qmake issue when statically linking to # ## not-yet-installed plugins -- cgit v0.12 From e1c515f73eca4e85211fffc718b3d9e27f21eb19 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 1 Oct 2009 21:41:44 +0300 Subject: Added QToolBar::visibilityChanged(bool) signal. Reviewed-By: Thierry --- src/gui/widgets/qtoolbar.cpp | 9 +++++++++ src/gui/widgets/qtoolbar.h | 1 + tests/auto/qtoolbar/tst_qtoolbar.cpp | 31 +++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+) diff --git a/src/gui/widgets/qtoolbar.cpp b/src/gui/widgets/qtoolbar.cpp index 58a3d28..47c4698 100644 --- a/src/gui/widgets/qtoolbar.cpp +++ b/src/gui/widgets/qtoolbar.cpp @@ -534,6 +534,14 @@ void QToolBarPrivate::plug(const QRect &r) /*! + \fn void QToolBar::visibilityChanged(bool visible) + \since 4.7 + + This signal is emitted when the toolbar becomes \a visible (or + invisible). This happens when the widget is hidden or shown. +*/ + +/*! Constructs a QToolBar with the given \a parent. */ QToolBar::QToolBar(QWidget *parent) @@ -1123,6 +1131,7 @@ bool QToolBar::event(QEvent *event) // fallthrough intended case QEvent::Show: d->toggleViewAction->setChecked(event->type() == QEvent::Show); + emit visibilityChanged(event->type() == QEvent::Show); #if defined(Q_WS_MAC) if (toolbarInUnifiedToolBar(this)) { // I can static_cast because I did the qobject_cast in the if above, therefore diff --git a/src/gui/widgets/qtoolbar.h b/src/gui/widgets/qtoolbar.h index a1a24f0..9712637 100644 --- a/src/gui/widgets/qtoolbar.h +++ b/src/gui/widgets/qtoolbar.h @@ -143,6 +143,7 @@ Q_SIGNALS: void iconSizeChanged(const QSize &iconSize); void toolButtonStyleChanged(Qt::ToolButtonStyle toolButtonStyle); void topLevelChanged(bool topLevel); + void visibilityChanged(bool visible); protected: void actionEvent(QActionEvent *event); diff --git a/tests/auto/qtoolbar/tst_qtoolbar.cpp b/tests/auto/qtoolbar/tst_qtoolbar.cpp index ac86fd9..93dfca5 100644 --- a/tests/auto/qtoolbar/tst_qtoolbar.cpp +++ b/tests/auto/qtoolbar/tst_qtoolbar.cpp @@ -102,6 +102,7 @@ private slots: void orientationChanged(); void iconSizeChanged(); void toolButtonStyleChanged(); + void visibilityChanged(); void actionOwnership(); void widgetAction(); void accel(); @@ -998,6 +999,36 @@ void tst_QToolBar::iconSizeChanged() void tst_QToolBar::toolButtonStyleChanged() { DEPENDS_ON("toolButtonStyle()"); } +void tst_QToolBar::visibilityChanged() +{ + QMainWindow mw; + QToolBar tb; + QSignalSpy spy(&tb, SIGNAL(visibilityChanged(bool))); + + mw.addToolBar(&tb); + mw.show(); + + QCOMPARE(spy.count(), 1); + QCOMPARE(spy.at(0).at(0).toBool(), true); + spy.clear(); + + tb.hide(); + QCOMPARE(spy.count(), 1); + QCOMPARE(spy.at(0).at(0).toBool(), false); + spy.clear(); + + tb.hide(); + QCOMPARE(spy.count(), 0); + + tb.show(); + QCOMPARE(spy.count(), 1); + QCOMPARE(spy.at(0).at(0).toBool(), true); + spy.clear(); + + tb.show(); + QCOMPARE(spy.count(), 0); +} + void tst_QToolBar::actionOwnership() { { -- cgit v0.12 From d3dbb40fa67cf566288dce71834213dbe8e119e9 Mon Sep 17 00:00:00 2001 From: ck Date: Tue, 8 Dec 2009 14:51:43 +0100 Subject: Assistant: Don't re-load saved pages that don't exist anymore. Reviewed-by: kh1 --- tools/assistant/tools/assistant/centralwidget.cpp | 24 ++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/tools/assistant/tools/assistant/centralwidget.cpp b/tools/assistant/tools/assistant/centralwidget.cpp index 8343ad1..10495ad 100644 --- a/tools/assistant/tools/assistant/centralwidget.cpp +++ b/tools/assistant/tools/assistant/centralwidget.cpp @@ -466,25 +466,27 @@ void CentralWidget::setLastShownPages() setSource(QUrl(QLatin1String("about:blank"))); return; } - QStringList zoomFactors = helpEngine.lastZoomFactors(); while (zoomFactors.count() < pageCount) zoomFactors.append(CollectionConfiguration::DefaultZoomFactor); - QStringList::const_iterator zIt = zoomFactors.constBegin(); - QStringList::const_iterator it = lastShownPageList.constBegin(); - for (; it != lastShownPageList.constEnd(); ++it, ++zIt) - setSourceInNewTab((*it), (*zIt).toFloat()); - - int tab = helpEngine.lastTabPage(); - const bool searchIsAttached = m_searchWidget->isAttached(); const bool searchWasAttached = helpEngine.searchWasAttached(); + int tabToShow = helpEngine.lastTabPage(); if (searchWasAttached && !searchIsAttached) - --tab; + --tabToShow; else if (!searchWasAttached && searchIsAttached) - ++tab; - tabWidget->setCurrentIndex(tab); + ++tabToShow; + + for (int curTab = 0; curTab < pageCount; ++curTab) { + const QString &curFile = lastShownPageList.at(curTab); + if (helpEngine.findFile(curFile).isValid()) + setSourceInNewTab(curFile, zoomFactors.at(curTab).toFloat()); + else if (curTab + searchIsAttached <= tabToShow) + --tabToShow; + } + + tabWidget->setCurrentIndex(tabToShow); } bool CentralWidget::hasSelection() const -- cgit v0.12 From c4cd151801d4322c694609b5d12a5dd3f59422e9 Mon Sep 17 00:00:00 2001 From: ck Date: Tue, 8 Dec 2009 15:49:48 +0100 Subject: Assistant: Allow search tab to be displayed on start-up. Reviewed-by: kh1 --- tools/assistant/tools/assistant/centralwidget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/assistant/tools/assistant/centralwidget.cpp b/tools/assistant/tools/assistant/centralwidget.cpp index 10495ad..d148095 100644 --- a/tools/assistant/tools/assistant/centralwidget.cpp +++ b/tools/assistant/tools/assistant/centralwidget.cpp @@ -314,7 +314,7 @@ CentralWidget::~CentralWidget() } HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); - helpEngine.setLastTabPage(lastTabPage); + helpEngine.setLastTabPage(tabWidget->currentIndex()); helpEngine.setLastShownPages(currentPages); helpEngine.setSearchWasAttached(searchAttached); helpEngine.setLastZoomFactors(zoomFactors); @@ -473,7 +473,7 @@ void CentralWidget::setLastShownPages() const bool searchIsAttached = m_searchWidget->isAttached(); const bool searchWasAttached = helpEngine.searchWasAttached(); int tabToShow = helpEngine.lastTabPage(); - if (searchWasAttached && !searchIsAttached) + if (searchWasAttached && !searchIsAttached && tabToShow != 0) --tabToShow; else if (!searchWasAttached && searchIsAttached) ++tabToShow; -- cgit v0.12 From 2bfb839c3ff90b52e52ef032e513b70789139d5c Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 8 Dec 2009 16:57:41 +0100 Subject: Disable some code in normal build. Q_AUTOTEST_EXPORT is always defined. (it is defined empty if not internal build) Reviewed-by: Brad --- src/corelib/kernel/qobject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index a922022..7669ee1 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -882,7 +882,7 @@ QObject::~QObject() // all the signal/slots connections are still in place - if we don't // quit now, we will crash pretty soon. qWarning("Detected an unexpected exception in ~QObject while emitting destroyed()."); -#if defined(Q_AUTOTEST_EXPORT) && !defined(QT_NO_EXCEPTIONS) +#if defined(Q_BUILD_INTERNAL) && !defined(QT_NO_EXCEPTIONS) struct AutotestException : public std::exception { const char *what() const throw() { return "autotest swallow"; } -- cgit v0.12 From ccc3497c8815c1bc686a85a88ca2810f99a0c1eb Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 8 Dec 2009 16:59:00 +0100 Subject: Small optimisations in ~QObject Avoid calling signalSlotMutex while there is a very small probability that the node will be different or that the mutex are the same for two different object. Reviewed-by: brad --- src/corelib/kernel/qobject.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 7669ee1..91bf4ae 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -914,7 +914,8 @@ QObject::~QObject() // disconnect all receivers if (d->connectionLists) { ++d->connectionLists->inUse; - for (int signal = -1; signal < d->connectionLists->count(); ++signal) { + int connectionListsCount = d->connectionLists->count(); + for (int signal = -1; signal < connectionListsCount; ++signal) { QObjectPrivate::ConnectionList &connectionList = (*d->connectionLists)[signal]; @@ -951,16 +952,17 @@ QObject::~QObject() // disconnect all senders QObjectPrivate::Connection *node = d->senders; while (node) { - QMutex *m = signalSlotLock(node->sender); + QObject *sender = node->sender; + QMutex *m = signalSlotLock(sender); node->prev = &node; bool needToUnlock = QOrderedMutexLocker::relock(locker.mutex(), m); //the node has maybe been removed while the mutex was unlocked in relock? - if (!node || signalSlotLock(node->sender) != m) { + if (!node || node->sender != sender) { m->unlock(); continue; } node->receiver = 0; - QObjectConnectionListVector *senderLists = node->sender->d_func()->connectionLists; + QObjectConnectionListVector *senderLists = sender->d_func()->connectionLists; if (senderLists) senderLists->dirty = true; -- cgit v0.12 From 3bce78f6e143883fdba413e134504485594e73b3 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 8 Dec 2009 16:59:36 +0100 Subject: Optimize QOrderedMutexLocker try first to lock without releasing the second mutex. If it succees at first (likely), we should not have deadlock, and we do not need to unlock and relock the first mutex Should help in ~QObject Reviewed-by: brad --- src/corelib/thread/qorderedmutexlocker_p.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/corelib/thread/qorderedmutexlocker_p.h b/src/corelib/thread/qorderedmutexlocker_p.h index c22ee5c..946d306 100644 --- a/src/corelib/thread/qorderedmutexlocker_p.h +++ b/src/corelib/thread/qorderedmutexlocker_p.h @@ -103,9 +103,11 @@ public: mtx2->lock(); return true; } - mtx1->unlock(); - mtx2->lock(); - mtx1->lock(); + if (!mtx2->tryLock()) { + mtx1->unlock(); + mtx2->lock(); + mtx1->lock(); + } return true; } -- cgit v0.12 From b81b8e43ad57183ed66086ec90cabef5906ab9a2 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Wed, 9 Dec 2009 10:59:10 +0100 Subject: Fix the int validator not handling the locale Task-number: QTBUG-3179 Reviewed-by: ogoffart --- src/corelib/tools/qlocale.cpp | 11 +++++++++-- src/gui/widgets/qvalidator.cpp | 20 ++++++++++++++++++-- src/gui/widgets/qvalidator.h | 1 + tests/auto/qintvalidator/tst_qintvalidator.cpp | 26 ++++++++++++++++++++++++++ 4 files changed, 54 insertions(+), 4 deletions(-) diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index 4a66b92..c2280c6 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -4293,6 +4293,7 @@ bool QLocalePrivate::validateChars(const QString &str, NumberMode numMode, QByte const bool scientific = numMode == DoubleScientificMode; bool lastWasE = false; + bool lastWasDigit = false; int eCnt = 0; int decPointCnt = 0; bool dec = false; @@ -4307,6 +4308,7 @@ bool QLocalePrivate::validateChars(const QString &str, NumberMode numMode, QByte if (dec && decDigits != -1 && decDigits < ++decDigitCnt) return false; } + lastWasDigit = true; } else { switch (c) { case '.': @@ -4344,7 +4346,10 @@ bool QLocalePrivate::validateChars(const QString &str, NumberMode numMode, QByte break; case ',': - return false; + //it can only be placed after a digit which is before the decimal point + if (!lastWasDigit || decPointCnt > 0) + return false; + break; case 'e': if (scientific) { @@ -4362,10 +4367,12 @@ bool QLocalePrivate::validateChars(const QString &str, NumberMode numMode, QByte // If it's not a valid digit, it shall be Invalid. return false; } + lastWasDigit = false; } lastWasE = c == 'e'; - buff->append(c); + if (c != ',') + buff->append(c); } return true; diff --git a/src/gui/widgets/qvalidator.cpp b/src/gui/widgets/qvalidator.cpp index 405bf04..83f603d 100644 --- a/src/gui/widgets/qvalidator.cpp +++ b/src/gui/widgets/qvalidator.cpp @@ -400,8 +400,10 @@ QValidator::State QIntValidator::validate(QString & input, int&) const qlonglong entered = QLocalePrivate::bytearrayToLongLong(buff.constData(), 10, &ok, &overflow); if (overflow || !ok) return Invalid; - if (entered >= b && entered <= t) - return Acceptable; + if (entered >= b && entered <= t) { + locale().toInt(input, &ok); + return ok ? Acceptable : Intermediate; + } if (entered >= 0) { // the -entered < b condition is necessary to allow people to type @@ -412,6 +414,20 @@ QValidator::State QIntValidator::validate(QString & input, int&) const } } +/*! \reimp */ +void QIntValidator::fixup(QString &input) const +{ + QByteArray buff; + if (!locale().d()->validateChars(input, QLocalePrivate::IntegerMode, &buff)) { + QLocale cl(QLocale::C); + if (!cl.d()->validateChars(input, QLocalePrivate::IntegerMode, &buff)) + return; + } + bool ok, overflow; + qlonglong entered = QLocalePrivate::bytearrayToLongLong(buff.constData(), 10, &ok, &overflow); + if (ok && !overflow) + input = locale().toString(entered); +} /*! Sets the range of the validator to only accept integers between \a diff --git a/src/gui/widgets/qvalidator.h b/src/gui/widgets/qvalidator.h index a0d9534..caf0c01 100644 --- a/src/gui/widgets/qvalidator.h +++ b/src/gui/widgets/qvalidator.h @@ -105,6 +105,7 @@ public: ~QIntValidator(); QValidator::State validate(QString &, int &) const; + void fixup(QString &input) const; void setBottom(int); void setTop(int); diff --git a/tests/auto/qintvalidator/tst_qintvalidator.cpp b/tests/auto/qintvalidator/tst_qintvalidator.cpp index 3e0bd14..292a0cb 100644 --- a/tests/auto/qintvalidator/tst_qintvalidator.cpp +++ b/tests/auto/qintvalidator/tst_qintvalidator.cpp @@ -50,6 +50,7 @@ private slots: void validate_data(); void validate(); void validateArabic(); + void validateFrench(); }; Q_DECLARE_METATYPE(QValidator::State); @@ -182,6 +183,30 @@ void tst_QIntValidator::validateArabic() } + +void tst_QIntValidator::validateFrench() +{ + QIntValidator validator(-2000, 2000, 0); + validator.setLocale(QLocale::French); + int i; + + QString s = QLatin1String("1 "); + QCOMPARE(validator.validate(s, i), QValidator::Acceptable); + validator.fixup(s); + QCOMPARE(s, s); + + s = QLatin1String("1 000"); + QCOMPARE(validator.validate(s, i), QValidator::Acceptable); + validator.fixup(s); + QCOMPARE(s, s); + + + s = QLatin1String("1 0 00"); + QCOMPARE(validator.validate(s, i), QValidator::Intermediate); + validator.fixup(s); + QCOMPARE(s, validator.locale().toString(1000)); +} + void tst_QIntValidator::validate() { QFETCH(int, minimum); @@ -190,6 +215,7 @@ void tst_QIntValidator::validate() QFETCH(QValidator::State, state); QIntValidator iv(minimum, maximum, 0); + iv.setLocale(QLocale::C); int dummy; QCOMPARE((int)iv.validate(value, dummy), (int)state); } -- cgit v0.12 From 5b2cdd7cdeec0bb77e331d6ef78ecf3b678b0764 Mon Sep 17 00:00:00 2001 From: ck Date: Wed, 9 Dec 2009 12:23:13 +0100 Subject: Assistant: Try to reload open pages on doc file update. Reviewed-by: kh1 --- tools/assistant/tools/assistant/centralwidget.cpp | 20 ++++++++++++++++---- tools/assistant/tools/assistant/centralwidget.h | 2 +- tools/assistant/tools/assistant/mainwindow.cpp | 7 ++++--- .../assistant/tools/assistant/preferencesdialog.cpp | 2 +- tools/assistant/tools/assistant/remotecontrol.cpp | 2 +- 5 files changed, 23 insertions(+), 10 deletions(-) diff --git a/tools/assistant/tools/assistant/centralwidget.cpp b/tools/assistant/tools/assistant/centralwidget.cpp index d148095..638b8d2 100644 --- a/tools/assistant/tools/assistant/centralwidget.cpp +++ b/tools/assistant/tools/assistant/centralwidget.cpp @@ -1179,13 +1179,25 @@ CentralWidget::highlightSearchTerms() } -void CentralWidget::closeTabs(const QList &indices) +void CentralWidget::closeOrReloadTabs(const QList &indices, bool tryReload) { TRACE_OBJ QList sortedIndices = indices; qSort(sortedIndices); - for (int i = sortedIndices.count(); --i >= 0;) - closeTabAt(sortedIndices.at(i)); + for (int i = sortedIndices.count(); --i >= 0;) { + const int tab = sortedIndices.at(i); + bool close = true; + if (tryReload) { + HelpViewer *viewer = + qobject_cast(tabWidget->widget(tab)); + if (HelpEngineWrapper::instance().findFile(viewer->url()).isValid()) { + viewer->reload(); + close = false; + } + } + if (close) + closeTabAt(tab); + } if (availableHelpViewer() == 0) setSource(QUrl(QLatin1String("about:blank"))); } @@ -1202,7 +1214,7 @@ QMap CentralWidget::currentSourceFileList() const { TRACE_OBJ QMap sourceList; - for (int i = 1; i < tabWidget->count(); ++i) { + for (int i = 0; i < tabWidget->count(); ++i) { HelpViewer *viewer = qobject_cast(tabWidget->widget(i)); if (viewer && viewer->source().isValid()) sourceList.insert(i, viewer->source().host()); diff --git a/tools/assistant/tools/assistant/centralwidget.h b/tools/assistant/tools/assistant/centralwidget.h index d90968e..c6e9fc8 100644 --- a/tools/assistant/tools/assistant/centralwidget.h +++ b/tools/assistant/tools/assistant/centralwidget.h @@ -135,7 +135,7 @@ public: int availableHelpViewer() const; bool enableTabCloseAction() const; - void closeTabs(const QList &indices); + void closeOrReloadTabs(const QList &indices, bool tryReload); void closeTabAt(int index); QMap currentSourceFileList() const; diff --git a/tools/assistant/tools/assistant/mainwindow.cpp b/tools/assistant/tools/assistant/mainwindow.cpp index ce4ab7f..163d9b9 100644 --- a/tools/assistant/tools/assistant/mainwindow.cpp +++ b/tools/assistant/tools/assistant/mainwindow.cpp @@ -1186,15 +1186,16 @@ void MainWindow::documentationRemoved(const QString &namespaceName) { TRACE_OBJ CentralWidget* widget = CentralWidget::instance(); - widget->closeTabs(widget->currentSourceFileList().keys(namespaceName)); + widget->closeOrReloadTabs(widget->currentSourceFileList(). + keys(namespaceName), false); } void MainWindow::documentationUpdated(const QString &namespaceName) { TRACE_OBJ - // TODO: Check whether the documents still exists and if they do, reload. CentralWidget* widget = CentralWidget::instance(); - widget->closeTabs(widget->currentSourceFileList().keys(namespaceName)); + widget->closeOrReloadTabs(widget->currentSourceFileList(). + keys(namespaceName), true); } void MainWindow::resetQtDocInfo(const QString &component) diff --git a/tools/assistant/tools/assistant/preferencesdialog.cpp b/tools/assistant/tools/assistant/preferencesdialog.cpp index aac26f1..7141ec5 100644 --- a/tools/assistant/tools/assistant/preferencesdialog.cpp +++ b/tools/assistant/tools/assistant/preferencesdialog.cpp @@ -374,7 +374,7 @@ void PreferencesDialog::applyChanges() } } - CentralWidget::instance()->closeTabs(m_TabsToClose); + CentralWidget::instance()->closeOrReloadTabs(m_TabsToClose, false); foreach (const QString &doc, m_unregDocs) helpEngine.unregisterDocumentation(doc); diff --git a/tools/assistant/tools/assistant/remotecontrol.cpp b/tools/assistant/tools/assistant/remotecontrol.cpp index f8eef4c..1f02ef9 100644 --- a/tools/assistant/tools/assistant/remotecontrol.cpp +++ b/tools/assistant/tools/assistant/remotecontrol.cpp @@ -324,7 +324,7 @@ void RemoteControl::handleUnregisterCommand(const QString &arg) const QString &ns = QHelpEngineCore::namespaceName(absFileName); if (helpEngine.registeredDocumentations().contains(ns)) { CentralWidget* widget = CentralWidget::instance(); - widget->closeTabs(widget->currentSourceFileList().keys(ns)); + widget->closeOrReloadTabs(widget->currentSourceFileList().keys(ns), false); if (helpEngine.unregisterDocumentation(ns)) helpEngine.setupData(); } -- cgit v0.12 From 6135da7c97830ea46ca807b7cf5944dc74fdb960 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Tue, 8 Dec 2009 11:42:57 +0100 Subject: Use realpath only on OS we know it works on. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As far as we know realpath(X,0) extenstion is only supported on Linux, Mac OS X starting with 10.6 and on Symbian. Here goes the trick: realpath() on Mac properly handles file systems case-sensitivity, meaning two files with different cases will are the same file if the file system is case insensitive (which is the default on Mac). However the QFSFileEngine will still say that the file system is case sensitive because on Mac you can have several drives with different file systems (with different case sensitivity), and QFSFileEngine doesn't allow to return different values depending on the file path, so we still say that the file system is case-sensitive, which is the safiest behavior. This changes the behavior on Mac, but changes it to be correct. Reviewed-by: Markus Goetz Reviewed-by: João Abecasis --- src/corelib/io/qfsfileengine.cpp | 12 +++++++++--- tests/auto/qfileinfo/tst_qfileinfo.cpp | 15 ++++++++++++++- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/corelib/io/qfsfileengine.cpp b/src/corelib/io/qfsfileengine.cpp index 37b0ea1..f874052 100644 --- a/src/corelib/io/qfsfileengine.cpp +++ b/src/corelib/io/qfsfileengine.cpp @@ -143,9 +143,15 @@ QString QFSFileEnginePrivate::canonicalized(const QString &path) if (path.size() == 1 && path.at(0) == QLatin1Char('/')) return path; #endif - // Mac OS X 10.5.x doesn't support the realpath(X,0) extenstion we use here. -#if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC)) || defined(Q_OS_SYMBIAN) - char *ret = realpath(path.toLocal8Bit().constData(), (char*)0); +#if defined(Q_OS_LINUX) || defined(Q_OS_SYMBIAN) || defined(Q_OS_MAC) + char *ret = 0; +#if defined(Q_OS_MAC) + // Mac OS X 10.5.x doesn't support the realpath(X,0) extension we use here. + if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_6) + ret = realpath(path.toLocal8Bit().constData(), (char*)0); +#else + ret = realpath(path.toLocal8Bit().constData(), (char*)0); +#endif if (ret) { QString canonicalPath = QDir::cleanPath(QString::fromLocal8Bit(ret)); free(ret); diff --git a/tests/auto/qfileinfo/tst_qfileinfo.cpp b/tests/auto/qfileinfo/tst_qfileinfo.cpp index cd58fd6..b49395f 100644 --- a/tests/auto/qfileinfo/tst_qfileinfo.cpp +++ b/tests/auto/qfileinfo/tst_qfileinfo.cpp @@ -826,6 +826,17 @@ void tst_QFileInfo::compare_data() QTest::addColumn("file2"); QTest::addColumn("same"); +#if defined(Q_OS_MAC) + // Since 10.6 we use realpath() in qfsfileengine, and it properly handles + // file system case sensitivity. However here in the autotest we don't + // check if the file system is case sensitive, so to make it pass in the + // default OS X installation we assume we are running on a case insensitive + // file system if on 10.6 and on a case sensitive file system if on 10.5 + bool caseSensitiveOnMac = true; + if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_6) + caseSensitiveOnMac = false; +#endif + QTest::newRow("data0") << QString::fromLatin1(SRCDIR "tst_qfileinfo.cpp") << QString::fromLatin1(SRCDIR "tst_qfileinfo.cpp") @@ -843,6 +854,8 @@ void tst_QFileInfo::compare_data() << QString::fromLatin1(SRCDIR "tst_qfileinfo.cpp") #if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) << true; +#elif defined(Q_OS_MAC) + << !caseSensitiveOnMac; #else << false; #endif @@ -854,7 +867,7 @@ void tst_QFileInfo::compare() QFETCH(QString, file2); QFETCH(bool, same); QFileInfo fi1(file1), fi2(file2); - QCOMPARE(same, fi1 == fi2); + QCOMPARE(fi1 == fi2, same); } void tst_QFileInfo::consistent_data() -- cgit v0.12 From 4184664b3886ff03acc193b3302229e76fae3ad9 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Wed, 9 Dec 2009 10:43:14 +0100 Subject: Implemented getting a canonical file name on Mac OS X 10.5 Using FSRef to get a canonical file path on OS X 10.5 which doesn't support realpath(X,0) extension. Reviewed-by: Prasanth --- src/corelib/io/qfsfileengine.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/corelib/io/qfsfileengine.cpp b/src/corelib/io/qfsfileengine.cpp index f874052..b4611f1 100644 --- a/src/corelib/io/qfsfileengine.cpp +++ b/src/corelib/io/qfsfileengine.cpp @@ -56,6 +56,9 @@ #endif #include #include +#if defined(Q_OS_MAC) +# include +#endif QT_BEGIN_NAMESPACE @@ -147,8 +150,20 @@ QString QFSFileEnginePrivate::canonicalized(const QString &path) char *ret = 0; #if defined(Q_OS_MAC) // Mac OS X 10.5.x doesn't support the realpath(X,0) extension we use here. - if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_6) + if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_6) { ret = realpath(path.toLocal8Bit().constData(), (char*)0); + } else { + // on 10.5 we can use FSRef to resolve the file path. + FSRef fsref; + if (FSPathMakeRef((const UInt8 *)QDir::cleanPath(path).toUtf8().data(), &fsref, 0) == noErr) { + CFURLRef urlref = CFURLCreateFromFSRef(NULL, &fsref); + CFStringRef canonicalPath = CFURLCopyFileSystemPath(urlref, kCFURLPOSIXPathStyle); + QString ret = QCFString::toQString(canonicalPath); + CFRelease(canonicalPath); + CFRelease(urlref); + return ret; + } + } #else ret = realpath(path.toLocal8Bit().constData(), (char*)0); #endif -- cgit v0.12 From fc73e6e67b4048a7fa79d041ee609bea508aff07 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Tue, 8 Dec 2009 21:19:30 +0100 Subject: Re-enabled support for the FSEvents-based QFileSystemWatcher. Also fixed it to use canonicalFilePath instead of absoluteFilePath since when we get notification from the system, it gives us the canonical path with resolved symlinks (for example when watching for /tmp, the notification that we get says that /private/tmp was modified). Reviewed-by: Prasanth --- src/corelib/io/qfilesystemwatcher.cpp | 2 +- src/corelib/io/qfilesystemwatcher_fsevents.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/corelib/io/qfilesystemwatcher.cpp b/src/corelib/io/qfilesystemwatcher.cpp index d9b994e..e9f413c 100644 --- a/src/corelib/io/qfilesystemwatcher.cpp +++ b/src/corelib/io/qfilesystemwatcher.cpp @@ -248,7 +248,7 @@ QFileSystemWatcherEngine *QFileSystemWatcherPrivate::createNativeEngine() eng = QDnotifyFileSystemWatcherEngine::create(); return eng; #elif defined(Q_OS_FREEBSD) || defined(Q_OS_MAC) -# if 0 && (defined Q_OS_MAC) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +# if defined(Q_OS_MAC) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5) return QFSEventsFileSystemWatcherEngine::create(); else diff --git a/src/corelib/io/qfilesystemwatcher_fsevents.cpp b/src/corelib/io/qfilesystemwatcher_fsevents.cpp index be2125a..bbf7f99 100644 --- a/src/corelib/io/qfilesystemwatcher_fsevents.cpp +++ b/src/corelib/io/qfilesystemwatcher_fsevents.cpp @@ -94,7 +94,7 @@ static void addPathToHash(PathHash &pathHash, const QString &key, const QFileInf { PathInfoList &list = pathHash[key]; list.push_back(PathInfo(path, - fileInfo.absoluteFilePath().normalized(QString::NormalizationForm_D).toUtf8())); + fileInfo.canonicalFilePath().normalized(QString::NormalizationForm_D).toUtf8())); pathHash.insert(key, list); } @@ -206,7 +206,7 @@ QStringList QFSEventsFileSystemWatcherEngine::addPaths(const QStringList &paths, } else { directories->append(path); // Full file path for dirs. - QCFString cfpath(createFSStreamPath(fileInfo.absoluteFilePath())); + QCFString cfpath(createFSStreamPath(fileInfo.canonicalFilePath())); addPathToHash(dirPathInfoHash, cfpath, fileInfo, path); CFArrayAppendValue(tmpArray, cfpath); } @@ -216,7 +216,7 @@ QStringList QFSEventsFileSystemWatcherEngine::addPaths(const QStringList &paths, continue; } else { // Just the absolute path (minus it's filename) for files. - QCFString cfpath(createFSStreamPath(fileInfo.absolutePath())); + QCFString cfpath(createFSStreamPath(fileInfo.canonicalPath())); files->append(path); addPathToHash(filePathInfoHash, cfpath, fileInfo, path); CFArrayAppendValue(tmpArray, cfpath); @@ -293,7 +293,7 @@ QStringList QFSEventsFileSystemWatcherEngine::removePaths(const QStringList &pat itemCount = CFArrayGetCount(tmpArray); const QString &path = paths.at(i); QFileInfo fi(path); - QCFString cfpath(createFSStreamPath(fi.absolutePath())); + QCFString cfpath(createFSStreamPath(fi.canonicalPath())); CFIndex index = CFArrayGetFirstIndexOfValue(tmpArray, CFRangeMake(0, itemCount), cfpath); if (index != -1) { @@ -302,7 +302,7 @@ QStringList QFSEventsFileSystemWatcherEngine::removePaths(const QStringList &pat removePathFromHash(filePathInfoHash, cfpath, path); } else { // Could be a directory we are watching instead. - QCFString cfdirpath(createFSStreamPath(fi.absoluteFilePath())); + QCFString cfdirpath(createFSStreamPath(fi.canonicalFilePath())); index = CFArrayGetFirstIndexOfValue(tmpArray, CFRangeMake(0, itemCount), cfdirpath); if (index != -1) { CFArrayRemoveValueAtIndex(tmpArray, index); -- cgit v0.12 From 445f8bbd9709b712fa253fe1833bbf9416429603 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Wed, 9 Dec 2009 15:30:10 +0100 Subject: Cocoa: scrolling viewports containing many widgets is slow One of the reasons is that [NSView resetCursorRects] is called for each view, also the ones not actually visible. And the function is slow. This patch does an early check, and bails out if this is the case. Reviewed-by: Prasanth --- src/gui/kernel/qcocoaview_mac.mm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm index 1039a75..311cf24 100644 --- a/src/gui/kernel/qcocoaview_mac.mm +++ b/src/gui/kernel/qcocoaview_mac.mm @@ -227,6 +227,10 @@ extern "C" { - (void)resetCursorRects { + // [NSView addCursorRect] is slow, so bail out early if we can: + if (NSIsEmptyRect([self visibleRect])) + return; + QWidget *cursorWidget = qwidget; if (cursorWidget->testAttribute(Qt::WA_TransparentForMouseEvents)) -- cgit v0.12 From bc8e87016cfeb4a63151425bcd0f69f21a5fc1c1 Mon Sep 17 00:00:00 2001 From: ck Date: Wed, 9 Dec 2009 15:47:26 +0100 Subject: Assistant: Make doc file watching work for the intended use case. The QFileSystemWatcher signals the changing of a file several times, with the first one coming too early. As a result, we are likely checking a file that is not yet fully constructed. The workaround/solution is to delay reacting to the change until after the (hopefully) last signal from the QFileSystemWatcher. Reviewed-by: kh1 --- .../tools/assistant/helpenginewrapper.cpp | 53 +++++++++++++++++++++- .../assistant/tools/assistant/helpenginewrapper.h | 23 ++++++++++ 2 files changed, 75 insertions(+), 1 deletion(-) diff --git a/tools/assistant/tools/assistant/helpenginewrapper.cpp b/tools/assistant/tools/assistant/helpenginewrapper.cpp index 899954c..79a25ec 100644 --- a/tools/assistant/tools/assistant/helpenginewrapper.cpp +++ b/tools/assistant/tools/assistant/helpenginewrapper.cpp @@ -45,6 +45,7 @@ #include #include +#include #include #include #include @@ -646,9 +647,28 @@ void HelpEngineWrapper::assertDocFilesWatched() == m_helpEngine->registeredDocumentations().count()); } +TimeoutForwarder::TimeoutForwarder(const QString &fileName) + : m_fileName(fileName) +{ + TRACE_OBJ +} + +void TimeoutForwarder::forward() +{ + TRACE_OBJ + HelpEngineWrapper::instance().qchFileChanged(m_fileName, true); +} + void HelpEngineWrapper::qchFileChanged(const QString &fileName) { TRACE_OBJ + qchFileChanged(fileName, false); +} + +void HelpEngineWrapper::qchFileChanged(const QString &fileName, bool fromTimeout) +{ + TRACE_OBJ + /* * We don't use QHelpEngineCore::namespaceName(fileName), because the file * may not exist anymore or contain a different namespace. @@ -665,9 +685,39 @@ void HelpEngineWrapper::qchFileChanged(const QString &fileName) * We can't do an assertion here, because QFileSystemWatcher may send the * signal more than once. */ - if (ns.isEmpty()) + if (ns.isEmpty()) { + m_recentQchUpdates.remove(fileName); + return; + } + + /* + * Since the QFileSystemWatcher typically sends the signal more than once, + * we repeatedly delay our reaction a bit until we think the last signal + * was sent. + */ + + QMap::Iterator it = m_recentQchUpdates.find(fileName); + const QDateTime &now = QDateTime::currentDateTime(); + + // Case 1: This is the first recent signal for the file. + if (it == m_recentQchUpdates.end()) { + QSharedPointer forwarder(new TimeoutForwarder(fileName)); + m_recentQchUpdates.insert(fileName, RecentSignal(now, forwarder)); + QTimer::singleShot(UpdateGracePeriod, forwarder.data(), SLOT(forward())); + return; + } + + // Case 2: The last signal for this file has not expired yet. + if (it.value().first > now.addMSecs(-UpdateGracePeriod)) { + if (!fromTimeout) + it.value().first = now; + else + QTimer::singleShot(UpdateGracePeriod, it.value().second.data(), + SLOT(forward())); return; + } + // Case 3: The last signal for this file has expired. if (m_helpEngine->unregisterDocumentation(ns)) { if (!QFileInfo(fileName).exists() || !m_helpEngine->registerDocumentation(fileName)) { @@ -678,6 +728,7 @@ void HelpEngineWrapper::qchFileChanged(const QString &fileName) } m_helpEngine->setupData(); } + m_recentQchUpdates.erase(it); } QT_END_NAMESPACE diff --git a/tools/assistant/tools/assistant/helpenginewrapper.h b/tools/assistant/tools/assistant/helpenginewrapper.h index f827d95..348479e 100644 --- a/tools/assistant/tools/assistant/helpenginewrapper.h +++ b/tools/assistant/tools/assistant/helpenginewrapper.h @@ -42,8 +42,11 @@ #ifndef HELPENGINEWRAPPER_H #define HELPENGINEWRAPPER_H +#include #include #include +#include +#include #include #include #include @@ -67,6 +70,20 @@ enum { ShowLastPages = 2 }; + +class TimeoutForwarder : public QObject +{ + Q_OBJECT +public: + TimeoutForwarder(const QString &fileName); +private slots: + void forward(); +private: + friend class HelpEngineWrapper; + + const QString m_fileName; +}; + class HelpEngineWrapper : public QObject { Q_OBJECT @@ -197,13 +214,19 @@ private slots: void qchFileChanged(const QString &fileName); private: + friend class TimeoutForwarder; + HelpEngineWrapper(const QString &collectionFile); void initFileSystemWatchers(); void assertDocFilesWatched(); + void qchFileChanged(const QString &fileName, bool fromTimeout); + static const int UpdateGracePeriod = 2000; static HelpEngineWrapper *helpEngineWrapper; QHelpEngine * const m_helpEngine; QFileSystemWatcher * const m_qchWatcher; + typedef QPair > RecentSignal; + QMap m_recentQchUpdates; }; QT_END_NAMESPACE -- cgit v0.12 From 9215506e6a057d8aef7415c2921214e1ba1c760d Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Thu, 10 Dec 2009 09:15:34 +0100 Subject: Prevent posted event starvation by native Windows messages Avoid live-lock if native messages are generated quickly enough by allowing posted events to be sent if more than 10ms has passed since we last sent them. This means that we can allow multiple calls to sendPostedEvents() during a single call to processEvents(), but only when the QEventLoop::EventLoopExec flag is passed to processEvents(). Task-number: QTBUG-1697 --- src/corelib/kernel/qeventdispatcher_win.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp index c6eef5e..105cf28 100644 --- a/src/corelib/kernel/qeventdispatcher_win.cpp +++ b/src/corelib/kernel/qeventdispatcher_win.cpp @@ -341,6 +341,7 @@ public: // for controlling when to send posted events QAtomicInt serialNumber; int lastSerialNumber; + int lastMessageTime; QAtomicInt wakeUps; // timers @@ -364,7 +365,8 @@ public: }; QEventDispatcherWin32Private::QEventDispatcherWin32Private() - : threadId(GetCurrentThreadId()), interrupt(false), internalHwnd(0), getMessageHook(0), serialNumber(0), lastSerialNumber(0), wakeUps(0) + : threadId(GetCurrentThreadId()), interrupt(false), internalHwnd(0), getMessageHook(0), + serialNumber(0), lastSerialNumber(0), lastMessageTime(0), wakeUps(0) { resolveTimerAPI(); } @@ -479,6 +481,7 @@ LRESULT CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPARAM lp) int localSerialNumber = d->serialNumber; if (localSerialNumber != d->lastSerialNumber) { d->lastSerialNumber = localSerialNumber; + d->lastMessageTime = GetMessageTime(); QCoreApplicationPrivate::sendPostedEvents(0, 0, d->threadData); } return 0; @@ -495,9 +498,10 @@ LRESULT CALLBACK qt_GetMessageHook(int code, WPARAM wp, LPARAM lp) if (q) { QEventDispatcherWin32Private *d = q->d_func(); int localSerialNumber = d->serialNumber; - if (HIWORD(GetQueueStatus(QS_INPUT | QS_RAWINPUT | QS_TIMER)) == 0) { - // no more input or timer events in the message queue, we can allow posted events to be - // sent now + if (HIWORD(GetQueueStatus(QS_INPUT | QS_RAWINPUT | QS_TIMER)) == 0 + || GetMessageTime() - d->lastMessageTime >= 10) { + // no more input or timer events in the message queue or more than 10ms has elapsed since + // we send posted events, we can allow posted events to be sent now (void) d->wakeUps.fetchAndStoreRelease(0); MSG *msg = (MSG *) lp; if (localSerialNumber != d->lastSerialNumber @@ -732,7 +736,9 @@ bool QEventDispatcherWin32::processEvents(QEventLoop::ProcessEventsFlags flags) } if (haveMessage) { if (d->internalHwnd == msg.hwnd && msg.message == WM_QT_SENDPOSTEDEVENTS) { - if (seenWM_QT_SENDPOSTEDEVENTS) { + if (seenWM_QT_SENDPOSTEDEVENTS && !(flags & QEventLoop::EventLoopExec)) { + // when calling processEvents() "manually", we only want to send posted + // events once needWM_QT_SENDPOSTEDEVENTS = true; continue; } -- cgit v0.12 From d7159b1aa1c24cc320a3ba013c9d0f3cf97b6684 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Thu, 10 Dec 2009 11:32:33 +0100 Subject: Mac: add support for public.vcard UTI (DnD) Added a QMacPasteboard converter for data dragged from the address book on Mac. It is an easy piece of code, and will make it easier for Mac people to work with standard Mac apps. --- src/gui/kernel/qmime_mac.cpp | 57 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/src/gui/kernel/qmime_mac.cpp b/src/gui/kernel/qmime_mac.cpp index 4d842df..c68cdde 100644 --- a/src/gui/kernel/qmime_mac.cpp +++ b/src/gui/kernel/qmime_mac.cpp @@ -154,6 +154,7 @@ CFStringRef qt_mac_mime_typeUTI = CFSTR("com.pasteboard.trolltech.marker"); \i public.url - converts to "text/uri-list" \i public.file-url - converts to "text/uri-list" \i public.tiff - converts to "application/x-qt-image" + \i public.vcard - converts to "text/plain" \i com.apple.traditional-mac-plain-text - converts to "text/plain" \i com.apple.pict - converts to "application/x-qt-image" \endlist @@ -909,6 +910,61 @@ QList QMacPasteboardMimeUrl::convertFromMime(const QString &mime, QV return ret; } +class QMacPasteboardMimeVCard : public QMacPasteboardMime +{ +public: + QMacPasteboardMimeVCard() : QMacPasteboardMime(MIME_ALL){ } + QString convertorName(); + + QString flavorFor(const QString &mime); + QString mimeFor(QString flav); + bool canConvert(const QString &mime, QString flav); + QVariant convertToMime(const QString &mime, QList data, QString flav); + QList convertFromMime(const QString &mime, QVariant data, QString flav); +}; + +QString QMacPasteboardMimeVCard::convertorName() +{ + return QString("VCard"); +} + +bool QMacPasteboardMimeVCard::canConvert(const QString &mime, QString flav) +{ + return mimeFor(flav) == mime; +} + +QString QMacPasteboardMimeVCard::flavorFor(const QString &mime) +{ + if(mime.startsWith(QLatin1String("text/plain"))) + return QLatin1String("public.vcard"); + return QString(); +} + +QString QMacPasteboardMimeVCard::mimeFor(QString flav) +{ + if (flav == QLatin1String("public.vcard")) + return QLatin1String("text/plain"); + return QString(); +} + +QVariant QMacPasteboardMimeVCard::convertToMime(const QString &mime, QList data, QString) +{ + QByteArray cards; + if (mime == QLatin1String("text/plain")) { + for (int i=0; i QMacPasteboardMimeVCard::convertFromMime(const QString &mime, QVariant data, QString) +{ + QList ret; + if (mime == QLatin1String("text/plain")) + ret.append(data.toString().toUtf8()); + return ret; +} + #ifdef QT3_SUPPORT class QMacPasteboardMimeQt3Any : public QMacPasteboardMime { private: @@ -1116,6 +1172,7 @@ void QMacPasteboardMime::initialize() new QMacPasteboardMimeFileUri; new QMacPasteboardMimeUrl; new QMacPasteboardMimeTypeName; + new QMacPasteboardMimeVCard; //make sure our "non-standard" types are always last! --Sam new QMacPasteboardMimeAny; #ifdef QT3_SUPPORT -- cgit v0.12 From 4a982617bf6de92df118ecac024f415770a7bbb6 Mon Sep 17 00:00:00 2001 From: ck Date: Thu, 10 Dec 2009 15:20:35 +0100 Subject: Assistant: Added rebuild-search-index command line option. Reviewed-by: kh1 --- tools/assistant/tools/assistant/cmdlineparser.cpp | 10 ++++++++ tools/assistant/tools/assistant/cmdlineparser.h | 2 ++ tools/assistant/tools/assistant/main.cpp | 31 ++++++++++++++++++++--- 3 files changed, 40 insertions(+), 3 deletions(-) diff --git a/tools/assistant/tools/assistant/cmdlineparser.cpp b/tools/assistant/tools/assistant/cmdlineparser.cpp index 733e2ff..a93d63f 100644 --- a/tools/assistant/tools/assistant/cmdlineparser.cpp +++ b/tools/assistant/tools/assistant/cmdlineparser.cpp @@ -72,6 +72,7 @@ const QString CmdLineParser::m_helpMessage = QLatin1String( " file.\n" "-setCurrentFilter filter Set the filter as the active filter.\n" "-remove-search-index Removes the full text search index.\n" + "-rebuild-search-index Re-builds the full text search index (potentially slow)\n." "-quiet Does not display any error or\n" " status message.\n" "-help Displays this help.\n" @@ -87,6 +88,7 @@ CmdLineParser::CmdLineParser(const QStringList &arguments) m_search(Untouched), m_register(None), m_removeSearchIndex(false), + m_rebuildSearchIndex(false), m_quiet(false) { TRACE_OBJ @@ -126,6 +128,8 @@ CmdLineParser::Result CmdLineParser::parse() handleSetCurrentFilterOption(); else if (arg == QLatin1String("-remove-search-index")) m_removeSearchIndex = true; + else if (arg == QLatin1String("-rebuild-search-index")) + m_rebuildSearchIndex = true; else if (arg == QLatin1String("-help")) showHelp = true; else @@ -343,6 +347,12 @@ bool CmdLineParser::removeSearchIndex() const return m_removeSearchIndex; } +bool CmdLineParser::rebuildSearchIndex() const +{ + TRACE_OBJ + return m_rebuildSearchIndex; +} + CmdLineParser::RegisterState CmdLineParser::registerRequest() const { TRACE_OBJ diff --git a/tools/assistant/tools/assistant/cmdlineparser.h b/tools/assistant/tools/assistant/cmdlineparser.h index c1621d6..2bc7f2a 100644 --- a/tools/assistant/tools/assistant/cmdlineparser.h +++ b/tools/assistant/tools/assistant/cmdlineparser.h @@ -70,6 +70,7 @@ public: ShowState search() const; QString currentFilter() const; bool removeSearchIndex() const; + bool rebuildSearchIndex() const; RegisterState registerRequest() const; QString helpFile() const; @@ -106,6 +107,7 @@ private: RegisterState m_register; QString m_currentFilter; bool m_removeSearchIndex; + bool m_rebuildSearchIndex; bool m_quiet; QString m_error; }; diff --git a/tools/assistant/tools/assistant/main.cpp b/tools/assistant/tools/assistant/main.cpp index 79ed2c8..ce85854 100644 --- a/tools/assistant/tools/assistant/main.cpp +++ b/tools/assistant/tools/assistant/main.cpp @@ -52,7 +52,8 @@ #include #include -#include +#include +#include #include @@ -205,6 +206,23 @@ bool removeSearchIndex(const QString &collectionFile) return true; } +bool rebuildSearchIndex(QCoreApplication &app, const QString &collectionFile, + CmdLineParser &cmd) +{ + TRACE_OBJ + QHelpEngine engine(collectionFile); + if (!engine.setupData()) { + cmd.showMessage(QObject::tr("Error: %1").arg(engine.error()), true); + return false; + } + + QHelpSearchEngine * const searchEngine = engine.searchEngine(); + QObject::connect(searchEngine, SIGNAL(indexingFinished()), &app, + SLOT(quit())); + searchEngine->reindexDocumentation(); + return app.exec() == 0; +} + bool checkForSqlite(CmdLineParser &cmd) { TRACE_OBJ @@ -225,7 +243,8 @@ bool useGui(int argc, char *argv[]) #ifndef Q_OS_WIN // Look for arguments that imply command-line mode. const char * cmdModeArgs[] = { - "-help", "-register", "-unregister", "-remove-search-index" + "-help", "-register", "-unregister", "-remove-search-index", + "-rebuild-search-index" }; for (int i = 1; i < argc; ++i) { for (size_t j = 0; j < sizeof cmdModeArgs/sizeof *cmdModeArgs; ++j) { @@ -376,7 +395,13 @@ int main(int argc, char *argv[]) } if (cmd.removeSearchIndex()) { - return removeSearchIndex(cachedCollectionFile) ? EXIT_SUCCESS : EXIT_FAILURE; + return removeSearchIndex(cachedCollectionFile) + ? EXIT_SUCCESS : EXIT_FAILURE; + } + + if (cmd.rebuildSearchIndex()) { + return rebuildSearchIndex(a, cachedCollectionFile, cmd) + ? EXIT_SUCCESS : EXIT_FAILURE; } if (!checkForSqlite(cmd)) -- cgit v0.12 From 46e080ba1b0b7fdb67eda60002991f6b20e0f0ab Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 10 Dec 2009 12:58:06 +0100 Subject: fix (internal) apidoc --- src/corelib/tools/qstring.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 33c45c4..98d88ac 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -1092,7 +1092,7 @@ QString::QString(QChar ch) \internal */ -/*! \fn void QString::isDetached() const +/*! \fn bool QString::isDetached() const \internal */ -- cgit v0.12 From b6352d487491e4d25db8a008de75280a666b0fce Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 10 Dec 2009 15:38:17 +0100 Subject: add {QString,QByteArray,QList,QLinkedList,QHash,QMap,QVector}::isSharedWith() these functions just compare the d pointers of two objects. this can be used to verify the validity of cached data: you keep a copy of the original data in your cache. consequently, any changes to the original data must detach, so this function reflects whether the cached data is still up-to-date. of course, this is not thread safe, as the data might change right after you check it, but that's a general problem of cache coherency which needs to be handled further up the stack. the functions are internal because the other detaching-related functions are internal as well for reasons beyond me. Reviewed-by: brad --- src/corelib/tools/qbytearray.cpp | 5 +++++ src/corelib/tools/qbytearray.h | 1 + src/corelib/tools/qhash.cpp | 5 +++++ src/corelib/tools/qhash.h | 1 + src/corelib/tools/qlinkedlist.cpp | 5 +++++ src/corelib/tools/qlinkedlist.h | 1 + src/corelib/tools/qlist.cpp | 5 +++++ src/corelib/tools/qlist.h | 1 + src/corelib/tools/qmap.cpp | 5 +++++ src/corelib/tools/qmap.h | 1 + src/corelib/tools/qstring.cpp | 5 +++++ src/corelib/tools/qstring.h | 1 + src/corelib/tools/qvector.cpp | 5 +++++ src/corelib/tools/qvector.h | 1 + 14 files changed, 42 insertions(+) diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp index bf9b6bd..e43c2b5 100644 --- a/src/corelib/tools/qbytearray.cpp +++ b/src/corelib/tools/qbytearray.cpp @@ -1048,6 +1048,11 @@ QByteArray &QByteArray::operator=(const char *str) \internal */ +/*! \fn bool QByteArray::isSharedWith(const QByteArray &other) + + \internal +*/ + /*! \fn char QByteArray::at(int i) const Returns the character at index position \a i in the byte array. diff --git a/src/corelib/tools/qbytearray.h b/src/corelib/tools/qbytearray.h index 7dd6f4f..ba344cb 100644 --- a/src/corelib/tools/qbytearray.h +++ b/src/corelib/tools/qbytearray.h @@ -164,6 +164,7 @@ public: inline const char *constData() const; inline void detach(); bool isDetached() const; + inline bool isSharedWith(const QByteArray &other) const { return d == other.d; } void clear(); #ifdef Q_COMPILER_MANGLES_RETURN_TYPE diff --git a/src/corelib/tools/qhash.cpp b/src/corelib/tools/qhash.cpp index c82c389..a616ac2 100644 --- a/src/corelib/tools/qhash.cpp +++ b/src/corelib/tools/qhash.cpp @@ -847,6 +847,11 @@ void QHashData::checkSanity() \internal */ +/*! \fn bool QHash::isSharedWith(const QHash &other) const + + \internal +*/ + /*! \fn void QHash::clear() Removes all items from the hash. diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h index 2de03dc..66e9cde 100644 --- a/src/corelib/tools/qhash.h +++ b/src/corelib/tools/qhash.h @@ -299,6 +299,7 @@ public: inline void detach() { if (d->ref != 1) detach_helper(); } inline bool isDetached() const { return d->ref == 1; } inline void setSharable(bool sharable) { if (!sharable) detach(); d->sharable = sharable; } + inline bool isSharedWith(const QHash &other) const { return d == other.d; } void clear(); diff --git a/src/corelib/tools/qlinkedlist.cpp b/src/corelib/tools/qlinkedlist.cpp index 281508e..987e538 100644 --- a/src/corelib/tools/qlinkedlist.cpp +++ b/src/corelib/tools/qlinkedlist.cpp @@ -197,6 +197,11 @@ QLinkedListData QLinkedListData::shared_null = { \internal */ +/*! \fn bool QLinkedList::isSharedWith(const QLinkedList &other) const + + \internal +*/ + /*! \fn bool QLinkedList::isEmpty() const Returns true if the list contains no items; otherwise returns diff --git a/src/corelib/tools/qlinkedlist.h b/src/corelib/tools/qlinkedlist.h index e119a50..395adf2 100644 --- a/src/corelib/tools/qlinkedlist.h +++ b/src/corelib/tools/qlinkedlist.h @@ -93,6 +93,7 @@ public: { if (d->ref != 1) detach_helper(); } inline bool isDetached() const { return d->ref == 1; } inline void setSharable(bool sharable) { if (!sharable) detach(); d->sharable = sharable; } + inline bool isSharedWith(const QLinkedList &other) const { return d == other.d; } inline bool isEmpty() const { return d->size == 0; } diff --git a/src/corelib/tools/qlist.cpp b/src/corelib/tools/qlist.cpp index 9b20c82..da93d5f 100644 --- a/src/corelib/tools/qlist.cpp +++ b/src/corelib/tools/qlist.cpp @@ -599,6 +599,11 @@ void **QListData::erase(void **xi) \internal */ +/*! \fn bool QList::isSharedWith(const QList &other) const + + \internal +*/ + /*! \fn bool QList::isEmpty() const Returns true if the list contains no items; otherwise returns diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h index 49b5c0d..e65ee15 100644 --- a/src/corelib/tools/qlist.h +++ b/src/corelib/tools/qlist.h @@ -130,6 +130,7 @@ public: inline bool isDetached() const { return d->ref == 1; } inline void setSharable(bool sharable) { if (!sharable) detach(); d->sharable = sharable; } + inline bool isSharedWith(const QList &other) const { return d == other.d; } inline bool isEmpty() const { return p.isEmpty(); } diff --git a/src/corelib/tools/qmap.cpp b/src/corelib/tools/qmap.cpp index 3b48c3f..432b5a5 100644 --- a/src/corelib/tools/qmap.cpp +++ b/src/corelib/tools/qmap.cpp @@ -473,6 +473,11 @@ void QMapData::dump() \internal */ +/*! \fn bool QMap::isSharedWith(const QMap &other) const + + \internal +*/ + /*! \fn void QMap::setInsertInOrder(bool sharable) \internal diff --git a/src/corelib/tools/qmap.h b/src/corelib/tools/qmap.h index 0441107..ce97178 100644 --- a/src/corelib/tools/qmap.h +++ b/src/corelib/tools/qmap.h @@ -182,6 +182,7 @@ public: inline void detach() { if (d->ref != 1) detach_helper(); } inline bool isDetached() const { return d->ref == 1; } inline void setSharable(bool sharable) { if (!sharable) detach(); d->sharable = sharable; } + inline bool isSharedWith(const QMap &other) const { return d == other.d; } inline void setInsertInOrder(bool ordered) { d->insertInOrder = ordered; } void clear(); diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 98d88ac..f3355df 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -1097,6 +1097,11 @@ QString::QString(QChar ch) \internal */ +/*! \fn bool QString::isSharedWith(const QString &other) const + + \internal +*/ + // ### Qt 5: rename freeData() to avoid confusion. See task 197625. void QString::free(Data *d) { diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h index 668be35..c6fd80a 100644 --- a/src/corelib/tools/qstring.h +++ b/src/corelib/tools/qstring.h @@ -122,6 +122,7 @@ public: inline void detach(); inline bool isDetached() const; + inline bool isSharedWith(const QString &other) const { return d == other.d; } void clear(); inline const QChar at(int i) const; diff --git a/src/corelib/tools/qvector.cpp b/src/corelib/tools/qvector.cpp index 8bb1074..00d663b 100644 --- a/src/corelib/tools/qvector.cpp +++ b/src/corelib/tools/qvector.cpp @@ -392,6 +392,11 @@ int QVectorData::grow(int sizeofTypedData, int size, int sizeofT, bool excessive \internal */ +/*! \fn bool QVector::isSharedWith(const QVector &other) const + + \internal +*/ + /*! \fn T *QVector::data() Returns a pointer to the data stored in the vector. The pointer diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h index e00cf3f..043617f 100644 --- a/src/corelib/tools/qvector.h +++ b/src/corelib/tools/qvector.h @@ -134,6 +134,7 @@ public: inline void detach() { if (d->ref != 1) detach_helper(); } inline bool isDetached() const { return d->ref == 1; } inline void setSharable(bool sharable) { if (!sharable) detach(); d->sharable = sharable; } + inline bool isSharedWith(const QVector &other) const { return d == other.d; } inline T *data() { detach(); return p->array; } inline const T *data() const { return p->array; } -- cgit v0.12 From d99a9ffed96ac26ddada3eeb61c44e6ff8b93895 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Fri, 11 Dec 2009 10:32:37 +0100 Subject: Avoid crash in QObject::connect() if class has no signals If signalCount was 0, then indexOfSlotRelative would use -1 as the lookup and read unitialized memory in the loop. This would cause a crash in release on Windows. Done-with: Olivier --- src/corelib/kernel/qmetaobject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp index bc1e8dcc..a29f4d2 100644 --- a/src/corelib/kernel/qmetaobject.cpp +++ b/src/corelib/kernel/qmetaobject.cpp @@ -497,7 +497,7 @@ static inline int indexOfMethodRelative(const QMetaObject **baseObject, int i = (MethodType == MethodSignal && priv(m->d.data)->revision >= 4) ? (priv(m->d.data)->signalCount - 1) : (priv(m->d.data)->methodCount - 1); const int end = (MethodType == MethodSlot && priv(m->d.data)->revision >= 4) - ? (priv(m->d.data)->signalCount - 1) : 0; + ? (priv(m->d.data)->signalCount) : 0; if (!normalizeStringData) { for (; i >= end; --i) { if ((MethodType == 0 || (m->d.data[priv(m->d.data)->methodData + 5*i + 4] & MethodTypeMask) == MethodType) -- cgit v0.12 From 9364907eb92a51d054b54fe543c62df3bd203deb Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Fri, 11 Dec 2009 11:03:26 +0100 Subject: Compile on Windows CE. GetMessageTime() is not available, so 9215506e6a057d8aef7415c2921214e1ba1c760d is not possible on Windows CE --- src/corelib/kernel/qeventdispatcher_win.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp index 105cf28..b98d08e 100644 --- a/src/corelib/kernel/qeventdispatcher_win.cpp +++ b/src/corelib/kernel/qeventdispatcher_win.cpp @@ -341,7 +341,9 @@ public: // for controlling when to send posted events QAtomicInt serialNumber; int lastSerialNumber; +#ifndef Q_OS_WINCE int lastMessageTime; +#endif QAtomicInt wakeUps; // timers @@ -366,7 +368,11 @@ public: QEventDispatcherWin32Private::QEventDispatcherWin32Private() : threadId(GetCurrentThreadId()), interrupt(false), internalHwnd(0), getMessageHook(0), - serialNumber(0), lastSerialNumber(0), lastMessageTime(0), wakeUps(0) + serialNumber(0), lastSerialNumber(0), +#ifndef Q_OS_WINCE + lastMessageTime(0), +#endif + wakeUps(0) { resolveTimerAPI(); } @@ -481,7 +487,9 @@ LRESULT CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPARAM lp) int localSerialNumber = d->serialNumber; if (localSerialNumber != d->lastSerialNumber) { d->lastSerialNumber = localSerialNumber; +#ifndef Q_OS_WINCE d->lastMessageTime = GetMessageTime(); +#endif QCoreApplicationPrivate::sendPostedEvents(0, 0, d->threadData); } return 0; @@ -499,7 +507,10 @@ LRESULT CALLBACK qt_GetMessageHook(int code, WPARAM wp, LPARAM lp) QEventDispatcherWin32Private *d = q->d_func(); int localSerialNumber = d->serialNumber; if (HIWORD(GetQueueStatus(QS_INPUT | QS_RAWINPUT | QS_TIMER)) == 0 - || GetMessageTime() - d->lastMessageTime >= 10) { +#ifndef Q_OS_WINCE + || GetMessageTime() - d->lastMessageTime >= 10 +#endif + ) { // no more input or timer events in the message queue or more than 10ms has elapsed since // we send posted events, we can allow posted events to be sent now (void) d->wakeUps.fetchAndStoreRelease(0); -- cgit v0.12 From 38181f227d3c35a543b1df5b5440ae3bac3b6513 Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Fri, 11 Dec 2009 12:01:06 +0100 Subject: Make sure posted events are always sent. Commit 9215506e6a057d8aef7415c2921214e1ba1c760d introduced one small delta that would cause a certain example to stop working. This example called update() from a paintEvent(), which now works again. --- src/corelib/kernel/qeventdispatcher_win.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp index b98d08e..115049f 100644 --- a/src/corelib/kernel/qeventdispatcher_win.cpp +++ b/src/corelib/kernel/qeventdispatcher_win.cpp @@ -747,7 +747,7 @@ bool QEventDispatcherWin32::processEvents(QEventLoop::ProcessEventsFlags flags) } if (haveMessage) { if (d->internalHwnd == msg.hwnd && msg.message == WM_QT_SENDPOSTEDEVENTS) { - if (seenWM_QT_SENDPOSTEDEVENTS && !(flags & QEventLoop::EventLoopExec)) { + if (seenWM_QT_SENDPOSTEDEVENTS) { // when calling processEvents() "manually", we only want to send posted // events once needWM_QT_SENDPOSTEDEVENTS = true; -- cgit v0.12 From f2321e217976042403adfb74bffa7dceffa6febd Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Fri, 11 Dec 2009 15:18:37 +0100 Subject: Don't react to X errors on displays that are not the Qt display. Even though Qt doesn't support multiple displays, it is possible for people to have code that uses multiple displays (either by using Xlib directly or when integrating with another toolkit). Task-number: QTBUG-3337 --- src/gui/kernel/qapplication_x11.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp index b71ae73..eb35c10 100644 --- a/src/gui/kernel/qapplication_x11.cpp +++ b/src/gui/kernel/qapplication_x11.cpp @@ -614,6 +614,11 @@ static int (*original_xio_errhandler)(Display *dpy); static int qt_x_errhandler(Display *dpy, XErrorEvent *err) { + if (X11->display != dpy) { + // only handle X errors for our display + return 0; + } + switch (err->error_code) { case BadAtom: if (err->request_code == 20 /* X_GetProperty */ -- cgit v0.12 From 1908e12284e1f6f25bfb46df3ce9659c6e19a50c Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Fri, 11 Dec 2009 15:37:38 +0100 Subject: QGuiEventDispatcherGlib::flush() does nothing despite documentation otherwise. The documentation for flush() is that it flushes the outgoing command queue on X11, but not when using Glib. Fix this by implementing flush() in the GUI Glib dispatcher. Task-number: QTBUG-3185 --- src/gui/kernel/qguieventdispatcher_glib.cpp | 5 +++++ src/gui/kernel/qguieventdispatcher_glib_p.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/gui/kernel/qguieventdispatcher_glib.cpp b/src/gui/kernel/qguieventdispatcher_glib.cpp index f8a638c..fc6bc54 100644 --- a/src/gui/kernel/qguieventdispatcher_glib.cpp +++ b/src/gui/kernel/qguieventdispatcher_glib.cpp @@ -214,4 +214,9 @@ void QGuiEventDispatcherGlib::startingUp() g_source_add_poll(&d->x11EventSource->source, &d->x11EventSource->pollfd); } +void QGuiEventDispatcherGlib::flush() +{ + XFlush(X11->display); +} + QT_END_NAMESPACE diff --git a/src/gui/kernel/qguieventdispatcher_glib_p.h b/src/gui/kernel/qguieventdispatcher_glib_p.h index 4574df9..32fcbd3 100644 --- a/src/gui/kernel/qguieventdispatcher_glib_p.h +++ b/src/gui/kernel/qguieventdispatcher_glib_p.h @@ -71,6 +71,7 @@ public: bool processEvents(QEventLoop::ProcessEventsFlags flags); void startingUp(); + void flush(); }; QT_END_NAMESPACE -- cgit v0.12 From 454e87a57b6876b8db2180236082d7c7bc408a0e Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Fri, 11 Dec 2009 16:13:00 +0100 Subject: Fix normalization of Type * const After commit b881d8fb99972f1bd04ab4c84843cc8d43ddbeed, we would no longer append "const" when seeing it after a *. This commit fixes the regression. Reviewed-by: ogoffart --- src/corelib/kernel/qmetaobject_p.h | 3 +++ tests/auto/qmetaobject/tst_qmetaobject.cpp | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/corelib/kernel/qmetaobject_p.h b/src/corelib/kernel/qmetaobject_p.h index 7afb70b..83ca9af 100644 --- a/src/corelib/kernel/qmetaobject_p.h +++ b/src/corelib/kernel/qmetaobject_p.h @@ -295,6 +295,9 @@ static QByteArray normalizeTypeInternal(const char *t, const char *e, bool fixSc } else if (!star) { // move const to the front (but not if const comes after a *) result.prepend("const "); + } else { + // keep const after a * + result += "const"; } } } diff --git a/tests/auto/qmetaobject/tst_qmetaobject.cpp b/tests/auto/qmetaobject/tst_qmetaobject.cpp index 8331ca1..fb62312 100644 --- a/tests/auto/qmetaobject/tst_qmetaobject.cpp +++ b/tests/auto/qmetaobject/tst_qmetaobject.cpp @@ -664,7 +664,7 @@ void tst_QMetaObject::normalizedSignature_data() QTest::newRow("const rettype") << "const QString *foo()" << "const QString*foo()"; QTest::newRow("const ref") << "const QString &foo()" << "const QString&foo()"; QTest::newRow("reference") << "QString &foo()" << "QString&foo()"; - QTest::newRow("const2") << "void foo(QString const *)" << "void foo(const QString*)"; + QTest::newRow("const1") << "void foo(QString const *)" << "void foo(const QString*)"; QTest::newRow("const2") << "void foo(QString * const)" << "void foo(QString*const)"; QTest::newRow("const3") << "void foo(QString const &)" << "void foo(QString)"; QTest::newRow("const4") << "void foo(const int)" << "void foo(int)"; @@ -672,7 +672,7 @@ void tst_QMetaObject::normalizedSignature_data() << "void foo(int,int,int,int)"; QTest::newRow("const6") << "void foo(QList)" << "void foo(QList)"; QTest::newRow("const7") << "void foo(QList)" << "void foo(QList)"; - QTest::newRow("const7") << "void foo(QList)" << "void foo(QList)"; + QTest::newRow("const8") << "void foo(QList)" << "void foo(QList)"; } void tst_QMetaObject::normalizedSignature() -- cgit v0.12 From bff37a821728615d5b1c766d1fbcb80bdccfb9fd Mon Sep 17 00:00:00 2001 From: ck Date: Mon, 14 Dec 2009 16:51:39 +0100 Subject: Assistant: Performance improvements in qhelpgenerator. - Get rid of double container lookups for conditional access. - count() == 0 => isEmpty(). Reviewed-by: kh1 --- tools/assistant/lib/qhelpgenerator.cpp | 27 +++++++++++++++------------ tools/assistant/lib/qhelpgenerator_p.h | 2 +- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/tools/assistant/lib/qhelpgenerator.cpp b/tools/assistant/lib/qhelpgenerator.cpp index 1bb4cc8..8f1b780 100644 --- a/tools/assistant/lib/qhelpgenerator.cpp +++ b/tools/assistant/lib/qhelpgenerator.cpp @@ -538,7 +538,8 @@ bool QHelpGenerator::insertFiles(const QStringList &files, const QString &rootPa } int fileId = -1; - if (!d->fileMap.contains(fileName)) { + QMap::Iterator fileMapIt = d->fileMap.find(fileName); + if (fileMapIt == d->fileMap.end()) { fileDataList.append(qCompress(data)); fileNameData.name = fileName; @@ -552,18 +553,20 @@ bool QHelpGenerator::insertFiles(const QStringList &files, const QString &rootPa ++tableFileId; } else { - fileId = d->fileMap.value(fileName); + fileId = fileMapIt.value(); + QSet &fileFilterSet = d->fileFilterMap[fileId]; + QSet &tmpFileFilterSet = tmpFileFilterMap[fileId]; foreach (const int &filter, filterAtts) { - if (!d->fileFilterMap.value(fileId).contains(filter) - && !tmpFileFilterMap.value(fileId).contains(filter)) { - d->fileFilterMap[fileId].insert(filter); - tmpFileFilterMap[fileId].insert(filter); + if (!fileFilterSet.contains(filter) + && !tmpFileFilterSet.contains(filter)) { + fileFilterSet.insert(filter); + tmpFileFilterSet.insert(filter); } } } } - if (tmpFileFilterMap.count()) { + if (!tmpFileFilterMap.isEmpty()) { d->query->exec(QLatin1String("BEGIN")); QMap >::const_iterator it = tmpFileFilterMap.constBegin(); while (it != tmpFileFilterMap.constEnd()) { @@ -626,8 +629,7 @@ bool QHelpGenerator::registerCustomFilter(const QString &filterName, while (d->query->next()) { attributeMap.insert(d->query->value(1).toString(), d->query->value(0).toInt()); - if (idsToInsert.contains(d->query->value(1).toString())) - idsToInsert.removeAll(d->query->value(1).toString()); + idsToInsert.removeAll(d->query->value(1).toString()); } foreach (QString id, idsToInsert) { @@ -675,7 +677,7 @@ bool QHelpGenerator::registerCustomFilter(const QString &filterName, return true; } -bool QHelpGenerator::insertKeywords(const QList keywords, +bool QHelpGenerator::insertKeywords(const QList &keywords, const QStringList &filterAttributes) { if (!d->query) @@ -717,8 +719,9 @@ bool QHelpGenerator::insertKeywords(const QList keywords, if (fName.startsWith(QLatin1String("./"))) fName = fName.mid(2); - if (d->fileMap.contains(fName)) - fileId = d->fileMap.value(fName); + QMap::ConstIterator it = d->fileMap.find(fName); + if (it != d->fileMap.end()) + fileId = it.value(); else fileId = 1; diff --git a/tools/assistant/lib/qhelpgenerator_p.h b/tools/assistant/lib/qhelpgenerator_p.h index 77189b0..de991e7 100644 --- a/tools/assistant/lib/qhelpgenerator_p.h +++ b/tools/assistant/lib/qhelpgenerator_p.h @@ -97,7 +97,7 @@ private: const QStringList &filterAttribs, bool forceUpdate = false); bool registerVirtualFolder(const QString &folderName, const QString &ns); bool insertFilterAttributes(const QStringList &attributes); - bool insertKeywords(const QList keywords, + bool insertKeywords(const QList &keywords, const QStringList &filterAttributes); bool insertFiles(const QStringList &files, const QString &rootPath, const QStringList &filterAttributes); -- cgit v0.12 From 764c4a456526ea07ce6c264139457f0e62968731 Mon Sep 17 00:00:00 2001 From: mae Date: Mon, 14 Dec 2009 17:13:23 +0100 Subject: QPlainTextEdit scrolling issue with folded paragraphs With Qt Creator, we could reproduce scrolling problems when paragraphs were folded away. Effectively the first "visible" block could be an invisible one, resulting in firstVisibleBlock() returning something bogus. The result were drawing errors. Reviewed-by: con --- src/gui/widgets/qplaintextedit.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/gui/widgets/qplaintextedit.cpp b/src/gui/widgets/qplaintextedit.cpp index b637c19..be24012 100644 --- a/src/gui/widgets/qplaintextedit.cpp +++ b/src/gui/widgets/qplaintextedit.cpp @@ -684,8 +684,12 @@ void QPlainTextEditPrivate::ensureVisible(int position, bool center, bool forceC qreal h = center ? line.naturalTextRect().center().y() : line.naturalTextRect().bottom(); + QTextBlock previousVisibleBlock = block; while (h < height && block.previous().isValid()) { - block = block.previous(); + previousVisibleBlock = block; + do { + block = block.previous(); + } while (!block.isVisible() && block.previous().isValid()); h += q->blockBoundingRect(block).height(); } @@ -699,8 +703,8 @@ void QPlainTextEditPrivate::ensureVisible(int position, bool center, bool forceC ++l; } - if (block.next().isValid() && l >= lineCount) { - block = block.next(); + if (l >= lineCount) { + block = previousVisibleBlock; l = 0; } setTopBlock(block.blockNumber(), l); -- cgit v0.12 From 91f03a835150984fb4a2accf1246327e3d82e1fe Mon Sep 17 00:00:00 2001 From: ck Date: Mon, 14 Dec 2009 17:55:53 +0100 Subject: qhelpgenerator: Don't insert identical indices. Reviewed-by: kh1 --- tools/assistant/lib/qhelpgenerator.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tools/assistant/lib/qhelpgenerator.cpp b/tools/assistant/lib/qhelpgenerator.cpp index 8f1b780..3adf7ac 100644 --- a/tools/assistant/lib/qhelpgenerator.cpp +++ b/tools/assistant/lib/qhelpgenerator.cpp @@ -707,7 +707,17 @@ bool QHelpGenerator::insertKeywords(const QList &keywords, int i = 0; d->query->exec(QLatin1String("BEGIN")); - foreach (QHelpDataIndexItem itm, keywords) { + QSet indices; + foreach (const QHelpDataIndexItem &itm, keywords) { + + /* + * Identical ids make no sense and just confuse the Assistant user, + * so we ignore all repetitions. + */ + if (indices.contains(itm.identifier)) + continue; + indices.insert(itm.identifier); + pos = itm.reference.indexOf(QLatin1Char('#')); fileName = itm.reference.left(pos); if (pos > -1) @@ -753,7 +763,7 @@ bool QHelpGenerator::insertKeywords(const QList &keywords, d->query->exec(QLatin1String("COMMIT")); d->query->exec(QLatin1String("SELECT COUNT(Id) FROM IndexTable")); - if (d->query->next() && d->query->value(0).toInt() >= keywords.count()) + if (d->query->next() && d->query->value(0).toInt() >= indices.count()) return true; return false; } -- cgit v0.12 From 2e0fb5914f5dcb58681ec4d5a2709e33fda80f37 Mon Sep 17 00:00:00 2001 From: ck Date: Mon, 14 Dec 2009 18:13:13 +0100 Subject: Assistant: Topic chooser links correctly to Urls with identical titles. --- tools/assistant/tools/assistant/topicchooser.cpp | 16 ++++++++-------- tools/assistant/tools/assistant/topicchooser.h | 9 +++++---- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/tools/assistant/tools/assistant/topicchooser.cpp b/tools/assistant/tools/assistant/topicchooser.cpp index 803ea04..e860ce4 100644 --- a/tools/assistant/tools/assistant/topicchooser.cpp +++ b/tools/assistant/tools/assistant/topicchooser.cpp @@ -40,9 +40,6 @@ ****************************************************************************/ #include "tracer.h" -#include -#include - #include "topicchooser.h" QT_BEGIN_NAMESPACE @@ -55,10 +52,11 @@ TopicChooser::TopicChooser(QWidget *parent, const QString &keyword, ui.setupUi(this); ui.label->setText(tr("Choose a topic for %1:").arg(keyword)); - m_links = links; - QMap::const_iterator it = m_links.constBegin(); - for (; it != m_links.constEnd(); ++it) + QMap::const_iterator it = links.constBegin(); + for (; it != links.constEnd(); ++it) { ui.listWidget->addItem(it.key()); + m_links.append(it.value()); + } if (ui.listWidget->count() != 0) ui.listWidget->setCurrentRow(0); @@ -80,10 +78,12 @@ QUrl TopicChooser::link() const return QUrl(); QString title = item->text(); - if (title.isEmpty() || !m_links.contains(title)) + if (title.isEmpty()) return QUrl(); - return m_links.value(title); + const int row = ui.listWidget->row(item); + Q_ASSERT(row < m_links.count()); + return m_links.at(row); } QT_END_NAMESPACE diff --git a/tools/assistant/tools/assistant/topicchooser.h b/tools/assistant/tools/assistant/topicchooser.h index 949c7da..d3ca96e 100644 --- a/tools/assistant/tools/assistant/topicchooser.h +++ b/tools/assistant/tools/assistant/topicchooser.h @@ -44,9 +44,10 @@ #include "ui_topicchooser.h" -#include -#include -#include +#include +#include +#include +#include #include @@ -64,7 +65,7 @@ public: private: Ui::TopicChooser ui; - QMap m_links; + QList m_links; }; QT_END_NAMESPACE -- cgit v0.12 From efa48b0a5dba8c8c93612e534d04b5b04629b75c Mon Sep 17 00:00:00 2001 From: jasplin Date: Tue, 15 Dec 2009 10:11:40 +0100 Subject: Added missing include file. --- src/network/access/qnetworkrequest.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/network/access/qnetworkrequest.cpp b/src/network/access/qnetworkrequest.cpp index c91c608..9a72b00 100644 --- a/src/network/access/qnetworkrequest.cpp +++ b/src/network/access/qnetworkrequest.cpp @@ -49,6 +49,7 @@ #include "QtCore/qdatetime.h" #include +#include QT_BEGIN_NAMESPACE -- cgit v0.12 From 7cd3470c65cd17c4511d757daf1506932d77db13 Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 15 Dec 2009 11:58:19 +0100 Subject: work on QStringList split/join benchmark --- tests/benchmarks/qstringlist/main.cpp | 67 ++++++++++++++++++---------- tests/benchmarks/qstringlist/qstringlist.pro | 2 + 2 files changed, 46 insertions(+), 23 deletions(-) diff --git a/tests/benchmarks/qstringlist/main.cpp b/tests/benchmarks/qstringlist/main.cpp index a2a1dd5..85bfb5f 100644 --- a/tests/benchmarks/qstringlist/main.cpp +++ b/tests/benchmarks/qstringlist/main.cpp @@ -54,17 +54,21 @@ private slots: void join() const; void join_data() const; - void split() const; + void split_qlist_qbytearray() const; + void split_qlist_qbytearray_data() const { return split_data(); } + void split_data() const; + void split_qlist_qstring() const; + void split_qlist_qstring_data() const { return split_data(); } - void split_std() const; - void split_std_data() const { return split_data(); } + void split_stdvector_stdstring() const; + void split_stdvector_stdstring_data() const { return split_data(); } - void split_stdw() const; - void split_stdw_data() const { return split_data(); } + void split_stdvector_stdwstring() const; + void split_stdvector_stdwstring_data() const { return split_data(); } - void split_ba() const; - void split_ba_data() const { return split_data(); } + void split_stdlist_stdstring() const; + void split_stdlist_stdstring_data() const { return split_data(); } private: static QStringList populateList(const int count, const QString &unit); @@ -125,27 +129,39 @@ void tst_QStringList::join_data() const << QString(); } -void tst_QStringList::split() const +void tst_QStringList::split_data() const +{ + QTest::addColumn("input"); + QString unit = QLatin1String("unit") + QString(100, QLatin1Char('s')); + //QTest::newRow("") << populateString(10, unit); + QTest::newRow("") << populateString(100, unit); + //QTest::newRow("") << populateString(100, unit); + //QTest::newRow("") << populateString(1000, unit); + //QTest::newRow("") << populateString(10000, unit); +} + +void tst_QStringList::split_qlist_qbytearray() const { QFETCH(QString, input); - const QChar splitChar = ':'; + const char splitChar = ':'; + QByteArray ba = input.toLatin1(); QBENCHMARK { - input.split(splitChar); + ba.split(splitChar); } } -void tst_QStringList::split_data() const +void tst_QStringList::split_qlist_qstring() const { - QTest::addColumn("input"); - QString unit = QLatin1String("unit"); - QTest::newRow("") << populateString(10, unit); - QTest::newRow("") << populateString(100, unit); - QTest::newRow("") << populateString(1000, unit); - QTest::newRow("") << populateString(10000, unit); + QFETCH(QString, input); + const QChar splitChar = ':'; + + QBENCHMARK { + input.split(splitChar); + } } -void tst_QStringList::split_std() const +void tst_QStringList::split_stdvector_stdstring() const { QFETCH(QString, input); const char split_char = ':'; @@ -161,7 +177,7 @@ void tst_QStringList::split_std() const } } -void tst_QStringList::split_stdw() const +void tst_QStringList::split_stdvector_stdwstring() const { QFETCH(QString, input); const wchar_t split_char = ':'; @@ -177,14 +193,19 @@ void tst_QStringList::split_stdw() const } } -void tst_QStringList::split_ba() const +void tst_QStringList::split_stdlist_stdstring() const { QFETCH(QString, input); - const char splitChar = ':'; - QByteArray ba = input.toLatin1(); + const char split_char = ':'; + std::string stdinput = input.toStdString(); QBENCHMARK { - ba.split(splitChar); + std::istringstream split(stdinput); + std::list token; + for (std::string each; + std::getline(split, each, split_char); + token.push_back(each)) + ; } } diff --git a/tests/benchmarks/qstringlist/qstringlist.pro b/tests/benchmarks/qstringlist/qstringlist.pro index f9ebd59..86c1508 100644 --- a/tests/benchmarks/qstringlist/qstringlist.pro +++ b/tests/benchmarks/qstringlist/qstringlist.pro @@ -1,4 +1,6 @@ load(qttest_p4) TARGET = tst_qstringlist +CONFIG -= debug +CONFIG += release QT -= gui SOURCES += main.cpp -- cgit v0.12 From ac41c7da1e7da954e48ebdcefb1de53ce2911e75 Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Mon, 14 Dec 2009 15:54:44 +0100 Subject: Fixed QGL2PEXVertexArray to interpolate within the range [0, 1]. Because of numerical inaccuracy, the interpolation factor could exceed 1 by a small amount which would cause an assert failure. --- src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp b/src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp index ee1a797..b731a9f 100644 --- a/src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp +++ b/src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp @@ -145,7 +145,7 @@ void QGL2PEXVertexArray::addPath(const QVectorPath &path, GLfloat curveInverseSc // threshold based on same algorithm as in qtriangulatingstroker.cpp int threshold = qMin(64, qMax(bounds.width(), bounds.height()) * 3.14f / (curveInverseScale * 6)); if (threshold < 3) threshold = 3; - qreal one_over_threshold_minus_1 = 1.f / (threshold - 1); + qreal one_over_threshold_minus_1 = qreal(1) / (threshold - 1); for (int t=0; t Date: Mon, 14 Dec 2009 16:33:09 +0100 Subject: Fixed integer overflow in QTriangulator. The result of a function returning qint64 was stored in an int. --- src/opengl/gl2paintengineex/qtriangulator.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/opengl/gl2paintengineex/qtriangulator.cpp b/src/opengl/gl2paintengineex/qtriangulator.cpp index 21d4b2e..6a1112b 100644 --- a/src/opengl/gl2paintengineex/qtriangulator.cpp +++ b/src/opengl/gl2paintengineex/qtriangulator.cpp @@ -1779,7 +1779,7 @@ QPair::Node *, QRBTree::Node *> QTriangulator::ComplexToSimple while (current) { const QPodPoint &v1 = m_parent->m_vertices.at(m_edges.at(current->data).lower()); const QPodPoint &v2 = m_parent->m_vertices.at(m_edges.at(current->data).upper()); - int d = qPointDistanceFromLine(point, v1, v2); + qint64 d = qPointDistanceFromLine(point, v1, v2); if (d == 0) { result.first = result.second = current; break; @@ -1793,7 +1793,7 @@ QPair::Node *, QRBTree::Node *> QTriangulator::ComplexToSimple while (current) { const QPodPoint &v1 = m_parent->m_vertices.at(m_edges.at(current->data).lower()); const QPodPoint &v2 = m_parent->m_vertices.at(m_edges.at(current->data).upper()); - int d = qPointDistanceFromLine(point, v1, v2); + qint64 d = qPointDistanceFromLine(point, v1, v2); Q_ASSERT(d >= 0); if (d == 0) { result.first = current; @@ -1807,7 +1807,7 @@ QPair::Node *, QRBTree::Node *> QTriangulator::ComplexToSimple while (current) { const QPodPoint &v1 = m_parent->m_vertices.at(m_edges.at(current->data).lower()); const QPodPoint &v2 = m_parent->m_vertices.at(m_edges.at(current->data).upper()); - int d = qPointDistanceFromLine(point, v1, v2); + qint64 d = qPointDistanceFromLine(point, v1, v2); Q_ASSERT(d <= 0); if (d == 0) { result.second = current; @@ -1828,7 +1828,7 @@ QPair::Node *, QRBTree::Node *> QTriangulator::ComplexToSimple while (current) { const QPodPoint &v1 = m_parent->m_vertices.at(m_edges.at(current->data).lower()); const QPodPoint &v2 = m_parent->m_vertices.at(m_edges.at(current->data).upper()); - int d = qPointDistanceFromLine(point, v1, v2); + qint64 d = qPointDistanceFromLine(point, v1, v2); if (d == 0) break; if (d < 0) { @@ -1849,7 +1849,7 @@ QPair::Node *, QRBTree::Node *> QTriangulator::ComplexToSimple while (current) { const QPodPoint &v1 = m_parent->m_vertices.at(m_edges.at(current->data).lower()); const QPodPoint &v2 = m_parent->m_vertices.at(m_edges.at(current->data).upper()); - int d = qPointDistanceFromLine(point, v1, v2); + qint64 d = qPointDistanceFromLine(point, v1, v2); Q_ASSERT(d >= 0); if (d == 0) { current = current->left; @@ -1863,7 +1863,7 @@ QPair::Node *, QRBTree::Node *> QTriangulator::ComplexToSimple while (current) { const QPodPoint &v1 = m_parent->m_vertices.at(m_edges.at(current->data).lower()); const QPodPoint &v2 = m_parent->m_vertices.at(m_edges.at(current->data).upper()); - int d = qPointDistanceFromLine(point, v1, v2); + qint64 d = qPointDistanceFromLine(point, v1, v2); Q_ASSERT(d <= 0); if (d == 0) { current = current->right; -- cgit v0.12 From c9a1070f71f18b051f574854c0cfd61f658d9b50 Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Mon, 14 Dec 2009 16:36:36 +0100 Subject: Added missing OpenGL defines. --- src/opengl/qglextensions_p.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/opengl/qglextensions_p.h b/src/opengl/qglextensions_p.h index 62e216c..488e752 100644 --- a/src/opengl/qglextensions_p.h +++ b/src/opengl/qglextensions_p.h @@ -599,6 +599,20 @@ struct QGLExtensionFuncs #define GL_DECR_WRAP 0x8508 #endif +#ifndef GL_VERSION_1_5 +#define GL_ARRAY_BUFFER 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER 0x8893 +#define GL_STREAM_DRAW 0x88E0 +#define GL_STREAM_READ 0x88E1 +#define GL_STREAM_COPY 0x88E2 +#define GL_STATIC_DRAW 0x88E4 +#define GL_STATIC_READ 0x88E5 +#define GL_STATIC_COPY 0x88E6 +#define GL_DYNAMIC_DRAW 0x88E8 +#define GL_DYNAMIC_READ 0x88E9 +#define GL_DYNAMIC_COPY 0x88EA +#endif + #ifndef GL_VERSION_2_0 #define GL_FRAGMENT_SHADER 0x8B30 #define GL_VERTEX_SHADER 0x8B31 -- cgit v0.12 From 3e9d2ca2c31626d5c9a4b16372928637c9d0610f Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Mon, 14 Dec 2009 16:46:44 +0100 Subject: Implemented caching of concave vector paths in the GL2 engine. Reviewed-by: Gunnar --- src/gui/painting/qpainterpath.cpp | 2 + .../gl2paintengineex/qpaintengineex_opengl2.cpp | 155 +++++++++++++++++---- .../gl2paintengineex/qpaintengineex_opengl2_p.h | 1 + 3 files changed, 132 insertions(+), 26 deletions(-) diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp index 8133793..c760882 100644 --- a/src/gui/painting/qpainterpath.cpp +++ b/src/gui/painting/qpainterpath.cpp @@ -1257,6 +1257,8 @@ Qt::FillRule QPainterPath::fillRule() const void QPainterPath::setFillRule(Qt::FillRule fillRule) { ensureData(); + if (d_func()->fillRule == fillRule) + return; detach(); d_func()->fillRule = fillRule; diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index fb9bcb4..8fa8171 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -78,6 +78,7 @@ #include #include #include +#include #include "qglgradientcache_p.h" #include "qglengineshadermanager_p.h" @@ -832,10 +833,13 @@ struct QGL2PEVectorPathCache { #ifdef QT_OPENGL_CACHE_AS_VBOS GLuint vbo; + GLuint ibo; #else float *vertices; + quint32 *indices; #endif int vertexCount; + int indexCount; GLenum primitiveType; qreal iscale; }; @@ -846,8 +850,11 @@ void qopengl2paintengine_cleanup_vectorpath(QPaintEngineEx *engine, void *data) #ifdef QT_OPENGL_CACHE_AS_VBOS QGL2PaintEngineExPrivate *d = QGL2PaintEngineExPrivate::getData((QGL2PaintEngineEx *) engine); d->unusedVBOSToClean << c->vbo; + if (c->ibo) + d->unusedIBOSToClean << c->ibo; #else qFree(c->vertices); + qFree(c->indices); #endif delete c; } @@ -863,6 +870,9 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path) const QPointF* const points = reinterpret_cast(path.points()); + // ### Remove before release... + static bool do_vectorpath_cache = qgetenv("QT_OPENGL_NO_PATH_CACHE").isEmpty(); + // Check to see if there's any hints if (path.shape() == QVectorPath::RectangleHint) { QGLRect rect(points[0].x(), points[0].y(), points[2].x(), points[2].y()); @@ -883,8 +893,10 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path) #ifdef QT_OPENGL_CACHE_AS_VBOS glDeleteBuffers(1, &cache->vbo); cache->vbo = 0; + Q_ASSERT(cache->ibo == 0); #else qFree(cache->vertices); + Q_ASSERT(cache->indices == 0); #endif cache->vertexCount = 0; } @@ -892,6 +904,7 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path) } else { cache = new QGL2PEVectorPathCache; cache->vertexCount = 0; + cache->indexCount = 0; data = const_cast(path).addCacheData(q, cache, qopengl2paintengine_cleanup_vectorpath); } @@ -908,9 +921,11 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path) glGenBuffers(1, &cache->vbo); glBindBuffer(GL_ARRAY_BUFFER, cache->vbo); glBufferData(GL_ARRAY_BUFFER, floatSizeInBytes, vertexCoordinateArray.data(), GL_STATIC_DRAW); + cache->ibo = 0; #else cache->vertices = (float *) qMalloc(floatSizeInBytes); memcpy(cache->vertices, vertexCoordinateArray.data(), floatSizeInBytes); + cache->indices = 0; #endif } @@ -927,8 +942,6 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path) } else { // printf(" - Marking path as cachable...\n"); // Tag it for later so that if the same path is drawn twice, it is assumed to be static and thus cachable - // ### Remove before release... - static bool do_vectorpath_cache = qgetenv("QT_OPENGL_NO_PATH_CACHE").isEmpty(); if (do_vectorpath_cache) path.makeCacheable(); vertexCoordinateArray.clear(); @@ -938,40 +951,126 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path) } } else { - // The path is too complicated & needs the stencil technique - vertexCoordinateArray.clear(); - vertexCoordinateArray.addPath(path, inverseScale, false); - fillStencilWithVertexArray(vertexCoordinateArray, path.hasWindingFill()); + QRectF bbox = path.controlPointRect(); + // If the path doesn't fit within these limits, it is possible that the triangulation will fail. + bool pathIsWithinLimits = (bbox.left() > -0x8000 * inverseScale) + && (bbox.right() < 0x8000 * inverseScale) + && (bbox.top() > -0x8000 * inverseScale) + && (bbox.bottom() < 0x8000 * inverseScale); - glStencilMask(0xff); - glStencilOp(GL_KEEP, GL_REPLACE, GL_REPLACE); + if (path.isCacheable() && pathIsWithinLimits) { + QVectorPath::CacheEntry *data = path.lookupCacheData(q); + QGL2PEVectorPathCache *cache; + + if (data) { + cache = (QGL2PEVectorPathCache *) data->data; + // Check if scale factor is exceeded for curved paths and generate curves if so... + if (path.isCurved()) { + qreal scaleFactor = cache->iscale / inverseScale; + if (scaleFactor < 0.5 || scaleFactor > 2.0) { +#ifdef QT_OPENGL_CACHE_AS_VBOS + glDeleteBuffers(1, &cache->vbo); + glDeleteBuffers(1, &cache->ibo); + cache->vbo = cache->ibo = 0; +#else + qFree(cache->vertices); + qFree(cache->indices); +#endif + cache->vertexCount = 0; + cache->indexCount = 0; + } + } + } else { + cache = new QGL2PEVectorPathCache; + cache->vertexCount = 0; + cache->indexCount = 0; + data = const_cast(path).addCacheData(q, cache, qopengl2paintengine_cleanup_vectorpath); + } + + // Flatten the path at the current scale factor and fill it into the cache struct. + if (!cache->vertexCount) { + QTriangleSet polys = qTriangulate(path, QTransform().scale(1 / inverseScale, 1 / inverseScale)); + cache->vertexCount = polys.vertices.size() / 2; + cache->indexCount = polys.indices.size(); + cache->primitiveType = GL_TRIANGLES; + cache->iscale = inverseScale; + +#ifdef QT_OPENGL_CACHE_AS_VBOS + glGenBuffers(1, &cache->vbo); + glGenBuffers(1, &cache->ibo); + glBindBuffer(GL_ARRAY_BUFFER, cache->vbo); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, cache->ibo); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(quint32) * polys.indices.size(), polys.indices.data(), GL_STATIC_DRAW); + + QVarLengthArray vertices(polys.vertices.size()); + for (int i = 0; i < polys.vertices.size(); ++i) + vertices[i] = float(inverseScale * polys.vertices.at(i)); + glBufferData(GL_ARRAY_BUFFER, sizeof(float) * vertices.size(), vertices.data(), GL_STATIC_DRAW); +#else + cache->vertices = (float *) qMalloc(sizeof(float) * polys.vertices.size()); + cache->indices = (quint32 *) qMalloc(sizeof(quint32) * polys.indices.size()); + memcpy(cache->indices, polys.indices.data(), sizeof(quint32) * polys.indices.size()); + for (int i = 0; i < polys.vertices.size(); ++i) + cache->vertices[i] = float(inverseScale * polys.vertices.at(i)); +#endif + } + + prepareForDraw(currentBrush->isOpaque()); + glEnableVertexAttribArray(QT_VERTEX_COORDS_ATTR); +#ifdef QT_OPENGL_CACHE_AS_VBOS + glBindBuffer(GL_ARRAY_BUFFER, cache->vbo); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, cache->ibo); + glVertexAttribPointer(QT_VERTEX_COORDS_ATTR, 2, GL_FLOAT, false, 0, 0); + glDrawElements(cache->primitiveType, cache->indexCount, GL_UNSIGNED_INT, 0); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); + glBindBuffer(GL_ARRAY_BUFFER, 0); +#else + glVertexAttribPointer(QT_VERTEX_COORDS_ATTR, 2, GL_FLOAT, false, 0, cache->vertices); + glDrawElements(cache->primitiveType, cache->indexCount, GL_UNSIGNED_INT, cache->indices); +#endif - if (q->state()->clipTestEnabled) { - // Pass when high bit is set, replace stencil value with current clip - glStencilFunc(GL_NOTEQUAL, q->state()->currentClip, GL_STENCIL_HIGH_BIT); - } else if (path.hasWindingFill()) { - // Pass when any bit is set, replace stencil value with 0 - glStencilFunc(GL_NOTEQUAL, 0, 0xff); } else { - // Pass when high bit is set, replace stencil value with 0 - glStencilFunc(GL_NOTEQUAL, 0, GL_STENCIL_HIGH_BIT); - } + // printf(" - Marking path as cachable...\n"); + // Tag it for later so that if the same path is drawn twice, it is assumed to be static and thus cachable + if (do_vectorpath_cache) + path.makeCacheable(); - prepareForDraw(currentBrush->isOpaque()); + // The path is too complicated & needs the stencil technique + vertexCoordinateArray.clear(); + vertexCoordinateArray.addPath(path, inverseScale, false); - if (inRenderText) - prepareDepthRangeForRenderText(); + fillStencilWithVertexArray(vertexCoordinateArray, path.hasWindingFill()); - // Stencil the brush onto the dest buffer - composite(vertexCoordinateArray.boundingRect()); + glStencilMask(0xff); + glStencilOp(GL_KEEP, GL_REPLACE, GL_REPLACE); - if (inRenderText) - restoreDepthRangeForRenderText(); + if (q->state()->clipTestEnabled) { + // Pass when high bit is set, replace stencil value with current clip + glStencilFunc(GL_NOTEQUAL, q->state()->currentClip, GL_STENCIL_HIGH_BIT); + } else if (path.hasWindingFill()) { + // Pass when any bit is set, replace stencil value with 0 + glStencilFunc(GL_NOTEQUAL, 0, 0xff); + } else { + // Pass when high bit is set, replace stencil value with 0 + glStencilFunc(GL_NOTEQUAL, 0, GL_STENCIL_HIGH_BIT); + } - glStencilMask(0); + prepareForDraw(currentBrush->isOpaque()); - updateClipScissorTest(); + if (inRenderText) + prepareDepthRangeForRenderText(); + + // Stencil the brush onto the dest buffer + composite(vertexCoordinateArray.boundingRect()); + + if (inRenderText) + restoreDepthRangeForRenderText(); + + glStencilMask(0); + + updateClipScissorTest(); + } } } @@ -1892,6 +1991,10 @@ bool QGL2PaintEngineEx::end() glDeleteBuffers(d->unusedVBOSToClean.size(), d->unusedVBOSToClean.constData()); d->unusedVBOSToClean.clear(); } + if (!d->unusedIBOSToClean.isEmpty()) { + glDeleteBuffers(d->unusedIBOSToClean.size(), d->unusedIBOSToClean.constData()); + d->unusedIBOSToClean.clear(); + } #endif return false; diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h index 0084476..844d42b 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h @@ -298,6 +298,7 @@ public: QSet pathCaches; QVector unusedVBOSToClean; + QVector unusedIBOSToClean; }; QT_END_NAMESPACE -- cgit v0.12 From da89e73abcc8f4a1d19163fd6d39bb86e1ff0b53 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Fri, 7 Aug 2009 15:26:06 +0200 Subject: qdbus: short forms to get/set properties Allow a property to be given as third parameter instead of a method. If no other parameter is given, the property value is returned; if a fourth parameter is given, the property is set to the given value. This allows the syntax qdbus service path property as a short form of qdbus service path org.freedesktop.DBus.Properties.Get property and the syntax qdbus service path property value as a short form of qdbus service path org.freedesktop.DBus.Properties.Set property value If the third parameter is neither a method nor a property, the error message for the missing method is returned. Merge-Request: 1143 Reviewed-By: Thiago Macieira --- tools/qdbus/qdbus/qdbus.cpp | 48 +++++++++++++++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 12 deletions(-) diff --git a/tools/qdbus/qdbus/qdbus.cpp b/tools/qdbus/qdbus/qdbus.cpp index 2441240..e126abf 100644 --- a/tools/qdbus/qdbus/qdbus.cpp +++ b/tools/qdbus/qdbus/qdbus.cpp @@ -248,8 +248,8 @@ static QStringList readList(QStringList &args) return retval; } -static void placeCall(const QString &service, const QString &path, const QString &interface, - const QString &member, QStringList args) +static int placeCall(const QString &service, const QString &path, const QString &interface, + const QString &member, QStringList args, bool try_prop=true) { QDBusInterface iface(service, path, interface, connection); @@ -273,10 +273,22 @@ static void placeCall(const QString &service, const QString &path, const QString } if (midx == -1) { + // Failed to set property after falling back? + // Bail out without displaying an error + if (!try_prop) + return 1; + if (try_prop && args.size() == 1) { + QStringList proparg; + proparg += interface; + proparg += member; + proparg += args.first(); + if (!placeCall(service, path, "org.freedesktop.DBus.Properties", "Set", proparg, false)) + return 0; + } fprintf(stderr, "Cannot find '%s.%s' in object %s at %s\n", qPrintable(interface), qPrintable(member), qPrintable(path), qPrintable(service)); - exit(1); + return 1; } QMetaMethod mm = mo->method(midx); @@ -314,7 +326,7 @@ static void placeCall(const QString &service, const QString &path, const QString if (p.type() == QVariant::Invalid) { fprintf(stderr, "Could not convert '%s' to type '%s'.\n", qPrintable(argument), types.at(i).constData()); - exit(1); + return 1 ; } } else if (id == qMetaTypeId()) { QDBusVariant tmp(p); @@ -324,7 +336,7 @@ static void placeCall(const QString &service, const QString &path, const QString if (path.path().isNull()) { fprintf(stderr, "Cannot pass argument '%s' because it is not a valid object path.\n", qPrintable(argument)); - exit(1); + return 1; } p = qVariantFromValue(path); } else if (id == qMetaTypeId()) { @@ -332,39 +344,50 @@ static void placeCall(const QString &service, const QString &path, const QString if (sig.signature().isNull()) { fprintf(stderr, "Cannot pass argument '%s' because it is not a valid signature.\n", qPrintable(argument)); - exit(1); + return 1; } p = qVariantFromValue(sig); } else { fprintf(stderr, "Sorry, can't pass arg of type '%s'.\n", types.at(i).constData()); - exit(1); + return 1; } params += p; } if (params.count() != types.count() || !args.isEmpty()) { fprintf(stderr, "Invalid number of parameters\n"); - exit(1); + return 1; } } QDBusMessage reply = iface.callWithArgumentList(QDBus::Block, member, params); if (reply.type() == QDBusMessage::ErrorMessage) { QDBusError err = reply; + // Failed to retrieve property after falling back? + // Bail out without displaying an error + if (!try_prop) + return 1; + if (err.type() == QDBusError::UnknownMethod && try_prop) { + QStringList proparg; + proparg += interface; + proparg += member; + if (!placeCall(service, path, "org.freedesktop.DBus.Properties", "Get", proparg, false)) + return 0; + } if (err.type() == QDBusError::ServiceUnknown) fprintf(stderr, "Service '%s' does not exist.\n", qPrintable(service)); else printf("Error: %s\n%s\n", qPrintable(err.name()), qPrintable(err.message())); - exit(2); + return 2; } else if (reply.type() != QDBusMessage::ReplyMessage) { fprintf(stderr, "Invalid reply type %d\n", int(reply.type())); - exit(1); + return 1; } foreach (QVariant v, reply.arguments()) printArg(v); - exit(0); + return 0; } static bool globServices(QDBusConnectionInterface *bus, const QString &glob) @@ -483,6 +506,7 @@ int main(int argc, char **argv) exit(1); } - placeCall(service, path, interface, member, args); + int ret = placeCall(service, path, interface, member, args); + exit(ret); } -- cgit v0.12 From bba8f557f59d17e68ec0d9707e66c5324bb4bd33 Mon Sep 17 00:00:00 2001 From: Bill King Date: Wed, 16 Dec 2009 10:22:06 +1000 Subject: Remove obsolete code for unsupported platforms This code was apparently put in for OSX10.3. ODBC2 is over 10 years old now, and even microsoft doesn't support any fashion to link to the ansi versions of the functions. Remove the #define so that we don't have to support it any more. Reviewed-by: Justin McPherson --- src/sql/drivers/odbc/qsql_odbc.cpp | 20 -------------------- src/sql/drivers/odbc/qsql_odbc.h | 10 ---------- 2 files changed, 30 deletions(-) diff --git a/src/sql/drivers/odbc/qsql_odbc.cpp b/src/sql/drivers/odbc/qsql_odbc.cpp index e686873..445570a 100644 --- a/src/sql/drivers/odbc/qsql_odbc.cpp +++ b/src/sql/drivers/odbc/qsql_odbc.cpp @@ -62,13 +62,6 @@ QT_BEGIN_NAMESPACE // undefine this to prevent initial check of the ODBC driver #define ODBC_CHECK_DRIVER -#if defined(Q_ODBC_VERSION_2) -//crude hack to get non-unicode capable driver managers to work -# undef UNICODE -# define SQLTCHAR SQLCHAR -# define SQL_C_WCHAR SQL_C_CHAR -#endif - // newer platform SDKs use SQLLEN instead of SQLINTEGER #if defined(WIN32) && (_MSC_VER < 1300) # define QSQLLEN SQLINTEGER @@ -287,13 +280,11 @@ static QVariant::Type qDecodeODBCType(SQLSMALLINT sqltype, const T* p, bool isSi case SQL_TYPE_TIMESTAMP: type = QVariant::DateTime; break; -#ifndef Q_ODBC_VERSION_2 case SQL_WCHAR: case SQL_WVARCHAR: case SQL_WLONGVARCHAR: type = QVariant::String; break; -#endif case SQL_CHAR: case SQL_VARCHAR: case SQL_GUID: @@ -566,10 +557,8 @@ static QSqlField qMakeFieldInfo(const QODBCPrivate* p, int i ) static int qGetODBCVersion(const QString &connOpts) { -#ifndef Q_ODBC_VERSION_2 if (connOpts.contains(QLatin1String("SQL_ATTR_ODBC_VERSION=SQL_OV_ODBC3"), Qt::CaseInsensitive)) return SQL_OV_ODBC3; -#endif return SQL_OV_ODBC2; } @@ -668,7 +657,6 @@ bool QODBCDriverPrivate::setConnectionOptions(const QString& connOpts) continue; } r = SQLSetConnectAttr(hDbc, SQL_ATTR_TRACE, (SQLPOINTER) v, 0); -#ifndef Q_ODBC_VERSION_2 } else if (opt.toUpper() == QLatin1String("SQL_ATTR_CONNECTION_POOLING")) { if (val == QLatin1String("SQL_CP_OFF")) v = SQL_CP_OFF; @@ -695,7 +683,6 @@ bool QODBCDriverPrivate::setConnectionOptions(const QString& connOpts) continue; } r = SQLSetConnectAttr(hDbc, SQL_ATTR_CP_MATCH, (SQLPOINTER)v, 0); -#endif } else if (opt.toUpper() == QLatin1String("SQL_ATTR_ODBC_VERSION")) { // Already handled in QODBCDriver::open() continue; @@ -1416,7 +1403,6 @@ bool QODBCResult::exec() *ind == SQL_NULL_DATA ? ind : NULL); break; case QVariant::String: -#ifndef Q_ODBC_VERSION_2 if (d->unicode) { QString str = val.toString(); str.utf16(); @@ -1453,7 +1439,6 @@ bool QODBCResult::exec() break; } else -#endif { QByteArray str = val.toString().toAscii(); if (*ind != SQL_NULL_DATA) @@ -1854,11 +1839,6 @@ void QODBCDriver::cleanup() // as two byte unicode characters void QODBCDriverPrivate::checkUnicode() { -#if defined(Q_ODBC_VERSION_2) - unicode = false; - return; -#endif - SQLRETURN r; SQLUINTEGER fFunc; diff --git a/src/sql/drivers/odbc/qsql_odbc.h b/src/sql/drivers/odbc/qsql_odbc.h index 8bd7660..aa96feb 100644 --- a/src/sql/drivers/odbc/qsql_odbc.h +++ b/src/sql/drivers/odbc/qsql_odbc.h @@ -49,13 +49,6 @@ #include #endif -#if defined (Q_OS_MAC) && (MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_3) -// assume we use iodbc on MACX -// comment next line out if you use a -// unicode compatible manager -# define Q_ODBC_VERSION_2 -#endif - #ifdef QT_PLUGIN #define Q_EXPORT_SQLDRIVER_ODBC #else @@ -75,10 +68,7 @@ # undef _MSC_VER #endif -#ifndef Q_ODBC_VERSION_2 #include -#endif - #include QT_BEGIN_HEADER -- cgit v0.12 From 63c8293b60bb997d370a4ec343b7f04808969393 Mon Sep 17 00:00:00 2001 From: ck Date: Wed, 16 Dec 2009 14:55:56 +0100 Subject: Assistant: Fix console output glitch. --- tools/assistant/tools/assistant/cmdlineparser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/assistant/tools/assistant/cmdlineparser.cpp b/tools/assistant/tools/assistant/cmdlineparser.cpp index a93d63f..2b1296c 100644 --- a/tools/assistant/tools/assistant/cmdlineparser.cpp +++ b/tools/assistant/tools/assistant/cmdlineparser.cpp @@ -72,7 +72,7 @@ const QString CmdLineParser::m_helpMessage = QLatin1String( " file.\n" "-setCurrentFilter filter Set the filter as the active filter.\n" "-remove-search-index Removes the full text search index.\n" - "-rebuild-search-index Re-builds the full text search index (potentially slow)\n." + "-rebuild-search-index Re-builds the full text search index (potentially slow).\n" "-quiet Does not display any error or\n" " status message.\n" "-help Displays this help.\n" -- cgit v0.12 From a66af3b563a90e55015f7cfe7f04f8704ee7d402 Mon Sep 17 00:00:00 2001 From: jasplin Date: Thu, 17 Dec 2009 07:43:05 +0100 Subject: Added QTest::setBenchmarkResult() to public API. A benchmark result can now be registered explicitly using the QTest::setBenchmarkResult() function as an alternative to using a QBENCHMARK* macro. This gives benchmark writers the freedom to compute the benchmark result however they like and not be dependent on the automatic iteration/accumulation algorithm of a QBENCHMARK* macro. The function takes two arguments: a value and a metric. The value must be a non-negative real, while the metric is an enum type. WARNING: The set of available metrics include metrics for which a high value is considered better (i.e. faster) than a low value (one example is 'frames per second'). QTestLib currently does not distinguish between the two cases of "higher is better" and "lower is better", and leaves it to external tools (parsing the QTestLib output) to recognize them and do any necessary conversion. A tool that plots benchmark result history could e.g. convert all "higher is better" to "lower is better". For the 'frames per second' case, this would typically mean converting FPS to SPF (= 1/FPS). Reviewed-by: MortenS --- src/testlib/qbenchmark.cpp | 51 ++++++++++---------- src/testlib/qbenchmark.h | 10 ++++ src/testlib/qbenchmark_p.h | 26 +++++++---- src/testlib/qbenchmarkevent.cpp | 10 ++-- src/testlib/qbenchmarkevent_p.h | 3 +- src/testlib/qbenchmarkmeasurement.cpp | 20 +++----- src/testlib/qbenchmarkmeasurement_p.h | 10 ++-- src/testlib/qbenchmarkmetric.cpp | 87 +++++++++++++++++++++++++++++++++++ src/testlib/qbenchmarkmetric.h | 71 ++++++++++++++++++++++++++++ src/testlib/qbenchmarkmetric_p.h | 63 +++++++++++++++++++++++++ src/testlib/qbenchmarkvalgrind.cpp | 9 +--- src/testlib/qbenchmarkvalgrind_p.h | 4 +- src/testlib/qplaintestlogger.cpp | 30 ++++++++---- src/testlib/qtestcoreelement.h | 5 ++ src/testlib/qtestlogger.cpp | 4 +- src/testlib/qxmltestlogger.cpp | 3 +- src/testlib/testlib.pro | 1 + 17 files changed, 323 insertions(+), 84 deletions(-) create mode 100644 src/testlib/qbenchmarkmetric.cpp create mode 100644 src/testlib/qbenchmarkmetric.h create mode 100644 src/testlib/qbenchmarkmetric_p.h diff --git a/src/testlib/qbenchmark.cpp b/src/testlib/qbenchmark.cpp index 3bd9054..b2f388e 100644 --- a/src/testlib/qbenchmark.cpp +++ b/src/testlib/qbenchmark.cpp @@ -41,6 +41,7 @@ #include "QtTest/qbenchmark.h" #include "QtTest/private/qbenchmark_p.h" +#include "QtTest/private/qbenchmarkmetric_p.h" #ifdef QT_GUI_LIB #include @@ -138,7 +139,7 @@ void QBenchmarkTestMethodData::endDataRun() int QBenchmarkTestMethodData::adjustIterationCount(int suggestion) { - // Let the -iteration-count option override the measurer. + // Let the -iterations option override the measurer. if (QBenchmarkGlobalData::current->iterationCount != -1) { iterationCount = QBenchmarkGlobalData::current->iterationCount; } else { @@ -148,12 +149,13 @@ int QBenchmarkTestMethodData::adjustIterationCount(int suggestion) return iterationCount; } -void QBenchmarkTestMethodData::setResult(qint64 value) +void QBenchmarkTestMethodData::setResult( + qreal value, QTest::QBenchmarkMetric metric, bool setByMacro) { bool accepted = false; // Always accept the result if the iteration count has been - // specified on the command line with -iteartion-count. + // specified on the command line with -iterations. if (QBenchmarkGlobalData::current->iterationCount != -1) accepted = true; @@ -161,7 +163,7 @@ void QBenchmarkTestMethodData::setResult(qint64 value) iterationCount = 1; accepted = true; } - + // Test the result directly without calling the measurer if the minimum time // has been specifed on the command line with -minimumvalue. else if (QBenchmarkGlobalData::current->walltimeMinimum != -1) @@ -175,8 +177,8 @@ void QBenchmarkTestMethodData::setResult(qint64 value) else iterationCount *= 2; - this->result = - QBenchmarkResult(QBenchmarkGlobalData::current->context, value, iterationCount); + this->result = QBenchmarkResult( + QBenchmarkGlobalData::current->context, value, iterationCount, metric, setByMacro); } /*! @@ -208,7 +210,8 @@ QTest::QBenchmarkIterationController::QBenchmarkIterationController() */ QTest::QBenchmarkIterationController::~QBenchmarkIterationController() { - QBenchmarkTestMethodData::current->setResult(QTest::endBenchmarkMeasurement()); + const qreal result = QTest::endBenchmarkMeasurement(); + QBenchmarkTestMethodData::current->setResult(result, QBenchmarkGlobalData::current->measurer->metricType()); } /*! \internal @@ -259,28 +262,30 @@ void QTest::beginBenchmarkMeasurement() /*! \internal */ -qint64 QTest::endBenchmarkMeasurement() +quint64 QTest::endBenchmarkMeasurement() { // the clock is ticking before the line below, don't add code here. return QBenchmarkGlobalData::current->measurer->stop(); } -/*! \internal -*/ -void QTest::setResult(qint64 result) -{ - QBenchmarkTestMethodData::current->setResult(result); -} - -/*! \internal +/*! + Sets the benchmark result for this test function to \a result. + + Use this function if you want to report benchmark results without + using the QBENCHMARK macro. Use \a metric to specify how QTestLib + should interpret the results. + + The context for the result will be the test function name and any + data tag from the _data function. This function can only be called + once in each test function, subsequent calls will replace the + earlier reported results. + + Note that the -iterations command line argument has no effect + on test functions without the QBENCHMARK macro. */ -void QTest::setResult(const QString &tag, qint64 result) +void QTest::setBenchmarkResult(qreal result, QTest::QBenchmarkMetric metric) { - QBenchmarkContext context = QBenchmarkGlobalData::current->context; - context.tag = tag; - QBenchmarkTestMethodData::current->result = - QBenchmarkResult( context, result, - QBenchmarkTestMethodData::current->iterationCount); + QBenchmarkTestMethodData::current->setResult(result, metric, false); } template @@ -298,6 +303,4 @@ Q_TYPENAME T::value_type qAverage(const T &container) return acc / count; } - QT_END_NAMESPACE - diff --git a/src/testlib/qbenchmark.h b/src/testlib/qbenchmark.h index 3fb1336..16263fe 100644 --- a/src/testlib/qbenchmark.h +++ b/src/testlib/qbenchmark.h @@ -43,6 +43,7 @@ #define QBENCHMARK_H #include +#include QT_BEGIN_HEADER @@ -75,6 +76,8 @@ public: } +// --- BEGIN public API --- + #define QBENCHMARK \ for (QTest::QBenchmarkIterationController __iteration_controller; \ __iteration_controller.isDone() == false; __iteration_controller.next()) @@ -83,6 +86,13 @@ public: for (QTest::QBenchmarkIterationController __iteration_controller(QTest::QBenchmarkIterationController::RunOnce); \ __iteration_controller.isDone() == false; __iteration_controller.next()) +namespace QTest +{ + void Q_TESTLIB_EXPORT setBenchmarkResult(qreal result, QBenchmarkMetric metric); +} + +// --- END public API --- + QT_END_NAMESPACE QT_END_HEADER diff --git a/src/testlib/qbenchmark_p.h b/src/testlib/qbenchmark_p.h index 2f0900b..e294d69 100644 --- a/src/testlib/qbenchmark_p.h +++ b/src/testlib/qbenchmark_p.h @@ -42,6 +42,8 @@ #ifndef QBENCHMARK_P_H #define QBENCHMARK_P_H +#include + // // W A R N I N G // ------------- @@ -68,6 +70,7 @@ #include "QtTest/private/qbenchmarkvalgrind_p.h" #endif #include "QtTest/private/qbenchmarkevent_p.h" +#include "QtTest/private/qbenchmarkmetric_p.h" QT_BEGIN_NAMESPACE @@ -92,23 +95,29 @@ class QBenchmarkResult { public: QBenchmarkContext context; - qint64 value; + qreal value; int iterations; + QTest::QBenchmarkMetric metric; + bool setByMacro; bool valid; QBenchmarkResult() : value(-1) , iterations(-1) + , setByMacro(true) , valid(false) - { } + { } - QBenchmarkResult(const QBenchmarkContext &context, const qint64 value, const int iterations) + QBenchmarkResult( + const QBenchmarkContext &context, const qreal value, const int iterations, + QTest::QBenchmarkMetric metric, bool setByMacro) : context(context) , value(value) , iterations(iterations) + , metric(metric) + , setByMacro(setByMacro) , valid(true) - { - } + { } bool operator<(const QBenchmarkResult &other) const { @@ -167,7 +176,7 @@ public: bool isBenchmark() const { return result.valid; } bool resultsAccepted() const { return resultAccepted; } int adjustIterationCount(int suggestion); - void setResult(qint64 value); + void setResult(qreal value, QTest::QBenchmarkMetric metric, bool setByMacro = true); QBenchmarkResult result; bool resultAccepted; @@ -183,10 +192,7 @@ namespace QTest void setIterationCount(int count); Q_TESTLIB_EXPORT void beginBenchmarkMeasurement(); - Q_TESTLIB_EXPORT qint64 endBenchmarkMeasurement(); - - void setResult(qint64 result); - void setResult(const QString &tag, qint64 result); + Q_TESTLIB_EXPORT quint64 endBenchmarkMeasurement(); } QT_END_NAMESPACE diff --git a/src/testlib/qbenchmarkevent.cpp b/src/testlib/qbenchmarkevent.cpp index 60cd302..4f4e203 100644 --- a/src/testlib/qbenchmarkevent.cpp +++ b/src/testlib/qbenchmarkevent.cpp @@ -41,6 +41,7 @@ #include "QtTest/private/qbenchmarkevent_p.h" #include "QtTest/private/qbenchmark_p.h" +#include "QtTest/private/qbenchmarkmetric_p.h" #include QT_BEGIN_NAMESPACE @@ -91,14 +92,9 @@ int QBenchmarkEvent::adjustMedianCount(int suggestion) return 1; } -QString QBenchmarkEvent::unitText() +QTest::QBenchmarkMetric QBenchmarkEvent::metricType() { - return QLatin1String("events"); -} - -QString QBenchmarkEvent::metricText() -{ - return QLatin1String("events"); + return QTest::Events; } // This could be done in a much better way, this is just the beginning. diff --git a/src/testlib/qbenchmarkevent_p.h b/src/testlib/qbenchmarkevent_p.h index f191a0d..2d625eb 100644 --- a/src/testlib/qbenchmarkevent_p.h +++ b/src/testlib/qbenchmarkevent_p.h @@ -70,8 +70,7 @@ public: int adjustIterationCount(int suggestion); int adjustMedianCount(int suggestion); bool repeatCount() { return 1; } - QString unitText(); - QString metricText(); + QTest::QBenchmarkMetric metricType(); static bool eventCountingMechanism(void *message); static qint64 eventCounter; }; diff --git a/src/testlib/qbenchmarkmeasurement.cpp b/src/testlib/qbenchmarkmeasurement.cpp index f860454..6107b98 100644 --- a/src/testlib/qbenchmarkmeasurement.cpp +++ b/src/testlib/qbenchmarkmeasurement.cpp @@ -41,6 +41,8 @@ #include "QtTest/private/qbenchmarkmeasurement_p.h" #include "QtTest/private/qbenchmark_p.h" +#include "QtTest/private/qbenchmarkmetric_p.h" +#include "qbenchmark.h" #include QT_BEGIN_NAMESPACE @@ -77,14 +79,9 @@ int QBenchmarkTimeMeasurer::adjustMedianCount(int) return 1; } -QString QBenchmarkTimeMeasurer::unitText() +QTest::QBenchmarkMetric QBenchmarkTimeMeasurer::metricType() { - return QLatin1String("msec"); -} - -QString QBenchmarkTimeMeasurer::metricText() -{ - return QLatin1String("walltime"); + return QTest::WalltimeMilliseconds; } #ifdef HAVE_TICK_COUNTER // defined in 3rdparty/cycle_p.h @@ -126,14 +123,9 @@ bool QBenchmarkTickMeasurer::needsWarmupIteration() return true; } -QString QBenchmarkTickMeasurer::unitText() -{ - return QLatin1String("ticks"); -} - -QString QBenchmarkTickMeasurer::metricText() +QTest::QBenchmarkMetric QBenchmarkTickMeasurer::metricType() { - return QLatin1String("cputicks"); + return QTest::CPUTicks; } #endif diff --git a/src/testlib/qbenchmarkmeasurement_p.h b/src/testlib/qbenchmarkmeasurement_p.h index f237034..fc4b0fe 100644 --- a/src/testlib/qbenchmarkmeasurement_p.h +++ b/src/testlib/qbenchmarkmeasurement_p.h @@ -55,6 +55,7 @@ #include #include "3rdparty/cycle_p.h" +#include "qbenchmark.h" QT_BEGIN_NAMESPACE @@ -71,8 +72,7 @@ public: virtual int adjustMedianCount(int suggestion) = 0; virtual bool repeatCount() { return 1; } virtual bool needsWarmupIteration() { return false; } - virtual QString unitText() = 0; - virtual QString metricText() = 0; + virtual QTest::QBenchmarkMetric metricType() = 0; }; class QBenchmarkTimeMeasurer : public QBenchmarkMeasurerBase @@ -84,8 +84,7 @@ public: bool isMeasurementAccepted(qint64 measurement); int adjustIterationCount(int sugestion); int adjustMedianCount(int suggestion); - QString unitText(); - QString metricText(); + QTest::QBenchmarkMetric metricType(); private: QTime time; }; @@ -102,8 +101,7 @@ public: int adjustIterationCount(int); int adjustMedianCount(int suggestion); bool needsWarmupIteration(); - QString unitText(); - QString metricText(); + QTest::QBenchmarkMetric metricType(); private: CycleCounterTicks startTicks; }; diff --git a/src/testlib/qbenchmarkmetric.cpp b/src/testlib/qbenchmarkmetric.cpp new file mode 100644 index 0000000..614357c --- /dev/null +++ b/src/testlib/qbenchmarkmetric.cpp @@ -0,0 +1,87 @@ +/**************************************************************************** + ** + ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + ** All rights reserved. + ** Contact: Nokia Corporation (qt-info@nokia.com) + ** + ** This file is part of the QtTest module of the Qt Toolkit. + ** + ** $QT_BEGIN_LICENSE:LGPL$ + ** No Commercial Usage + ** This file contains pre-release code and may not be distributed. + ** You may use this file in accordance with the terms and conditions + ** contained in the Technology Preview License Agreement accompanying + ** this package. + ** + ** GNU Lesser General Public License Usage + ** Alternatively, this file may be used under the terms of the GNU Lesser + ** General Public License version 2.1 as published by the Free Software + ** Foundation and appearing in the file LICENSE.LGPL included in the + ** packaging of this file. Please review the following information to + ** ensure the GNU Lesser General Public License version 2.1 requirements + ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. + ** + ** In addition, as a special exception, Nokia gives you certain additional + ** rights. These rights are described in the Nokia Qt LGPL Exception + ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. + ** + ** If you have questions regarding the use of this file, please contact + ** Nokia at qt-info@nokia.com. + ** + ** + ** + ** + ** + ** + ** + ** + ** $QT_END_LICENSE$ + ** + ****************************************************************************/ + +#include + +const char * QTest::benchmarkMetricName(QBenchmarkMetric metric) +{ + switch (metric) { + case FramesPerSecond: + return "FramesPerSecond"; + case BitsPerSecond: + return "BitsPerSecond"; + case BytesPerSecond: + return "BytesPerSecond"; + case WalltimeMilliseconds: + return "WalltimeMilliseconds"; + case CPUTicks: + return "CPUTicks"; + case InstructionReads: + return "InstructionReads"; + case Events: + return "Events"; + default: + return ""; + } +}; + +const char * QTest::benchmarkMetricUnit(QBenchmarkMetric metric) +{ + switch (metric) { + case FramesPerSecond: + return "fps"; + case BitsPerSecond: + return "bits/s"; + case BytesPerSecond: + return "bytes/s"; + case WalltimeMilliseconds: + return "msecs"; + case CPUTicks: + return "CPU ticks"; + case InstructionReads: + return "instruction reads"; + case Events: + return "events"; + default: + return ""; + } +} + diff --git a/src/testlib/qbenchmarkmetric.h b/src/testlib/qbenchmarkmetric.h new file mode 100644 index 0000000..302c1aa --- /dev/null +++ b/src/testlib/qbenchmarkmetric.h @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtTest module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QBENCHMARKMETRIC_H +#define QBENCHMARKMETRIC_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Test) + +namespace QTest { + +enum QBenchmarkMetric { + FramesPerSecond, + BitsPerSecond, + BytesPerSecond, + WalltimeMilliseconds, + CPUTicks, + InstructionReads, + Events +}; + +} + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QBENCHMARK_H diff --git a/src/testlib/qbenchmarkmetric_p.h b/src/testlib/qbenchmarkmetric_p.h new file mode 100644 index 0000000..c919d2e --- /dev/null +++ b/src/testlib/qbenchmarkmetric_p.h @@ -0,0 +1,63 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtTest module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QBENCHMARKMETRIC_P_H +#define QBENCHMARKMETRIC_P_H + +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Test) + +namespace QTest { + const char * benchmarkMetricName(QBenchmarkMetric metric); + const char * benchmarkMetricUnit(QBenchmarkMetric metric); +} + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QBENCHMARK_H diff --git a/src/testlib/qbenchmarkvalgrind.cpp b/src/testlib/qbenchmarkvalgrind.cpp index 88cb37f..55cd901 100644 --- a/src/testlib/qbenchmarkvalgrind.cpp +++ b/src/testlib/qbenchmarkvalgrind.cpp @@ -263,14 +263,9 @@ bool QBenchmarkCallgrindMeasurer::needsWarmupIteration() return true; } -QString QBenchmarkCallgrindMeasurer::unitText() +QTest::QBenchmarkMetric QBenchmarkCallgrindMeasurer::metricType() { - return QLatin1String("instr. loads"); -} - -QString QBenchmarkCallgrindMeasurer::metricText() -{ - return QLatin1String("callgrind"); + return QTest::InstructionReads; } QT_END_NAMESPACE diff --git a/src/testlib/qbenchmarkvalgrind_p.h b/src/testlib/qbenchmarkvalgrind_p.h index 14bb5a0..bdb3a5c 100644 --- a/src/testlib/qbenchmarkvalgrind_p.h +++ b/src/testlib/qbenchmarkvalgrind_p.h @@ -54,6 +54,7 @@ // #include "QtTest/private/qbenchmarkmeasurement_p.h" +#include "QtTest/private/qbenchmarkmetric_p.h" #include #include @@ -84,8 +85,7 @@ public: int adjustIterationCount(int); int adjustMedianCount(int); bool needsWarmupIteration(); - QString unitText(); - QString metricText(); + QTest::QBenchmarkMetric metricType(); }; QT_END_NAMESPACE diff --git a/src/testlib/qplaintestlogger.cpp b/src/testlib/qplaintestlogger.cpp index 61c3728..2830556 100644 --- a/src/testlib/qplaintestlogger.cpp +++ b/src/testlib/qplaintestlogger.cpp @@ -44,6 +44,7 @@ #include "QtTest/private/qtestlog_p.h" #include "QtTest/private/qplaintestlogger_p.h" #include "QtTest/private/qbenchmark_p.h" +#include "QtTest/private/qbenchmarkmetric_p.h" #include #include @@ -324,7 +325,6 @@ namespace QTest { QTestResult::currentTestObjectName(), result.context.slotName.toAscii().data()); - char bufTag[1024]; bufTag[0] = 0; QByteArray tag = result.context.tag.toAscii(); @@ -340,32 +340,42 @@ namespace QTest { char fill[1024]; QTest::qt_snprintf(fill, sizeof(fill), fillFormat, ""); - - QByteArray unitText = QBenchmarkGlobalData::current->measurer->unitText().toAscii(); + const char * unitText = QTest::benchmarkMetricUnit(result.metric); qreal valuePerIteration = qreal(result.value) / qreal(result.iterations); char resultBuffer[100] = ""; formatResult(resultBuffer, 100, valuePerIteration, countSignificantDigits(result.value)); - QByteArray iterationText = "per iteration"; - char buf2[1024]; - Q_ASSERT(result.iterations > 0); QTest::qt_snprintf( - buf2, sizeof(buf2), "%s %s %s", + buf2, sizeof(buf2), "%s %s", resultBuffer, - unitText.data(), + unitText); + + char buf2_[1024]; + QByteArray iterationText = " per iteration"; + Q_ASSERT(result.iterations > 0); + QTest::qt_snprintf( + buf2_, + sizeof(buf2_), "%s", iterationText.data()); char buf3[1024]; Q_ASSERT(result.iterations > 0); QTest::qt_snprintf( - buf3, sizeof(buf3), " (total: %s, iterations: %d)\n", + buf3, sizeof(buf3), " (total: %s, iterations: %d)", QByteArray::number(result.value).constData(), // no 64-bit qt_snprintf support result.iterations); char buf[1024]; - QTest::qt_snprintf(buf, sizeof(buf), "%s%s%s%s%s", buf1, bufTag, fill, buf2, buf3); + + if (result.setByMacro) { + QTest::qt_snprintf( + buf, sizeof(buf), "%s%s%s%s%s%s\n", buf1, bufTag, fill, buf2, buf2_, buf3); + } else { + QTest::qt_snprintf(buf, sizeof(buf), "%s%s%s%s\n", buf1, bufTag, fill, buf2); + } + memcpy(buf, bmtag, strlen(bmtag)); outputMessage(buf); } diff --git a/src/testlib/qtestcoreelement.h b/src/testlib/qtestcoreelement.h index b5e5d0f..ceeba52 100644 --- a/src/testlib/qtestcoreelement.h +++ b/src/testlib/qtestcoreelement.h @@ -45,6 +45,8 @@ #include #include +#include + QT_BEGIN_HEADER QT_BEGIN_NAMESPACE @@ -93,6 +95,9 @@ void QTestCoreElement::addAttribute(const QTest::AttributeIndex att if (attribute(attributeIndex)) return; + // if (attributeIndex == QTest::AI_Metric) + // abort(); + QTestElementAttribute *testAttribute = new QTestElementAttribute; testAttribute->setPair(attributeIndex, value); testAttribute->addToList(&listOfAttributes); diff --git a/src/testlib/qtestlogger.cpp b/src/testlib/qtestlogger.cpp index 3e89ff7..c5b8e7f 100644 --- a/src/testlib/qtestlogger.cpp +++ b/src/testlib/qtestlogger.cpp @@ -267,7 +267,9 @@ void QTestLogger::addBenchmarkResult(const QBenchmarkResult &result) QTestElement *benchmarkElement = new QTestElement(QTest::LET_Benchmark); // printf("element %i", benchmarkElement->elementType()); - benchmarkElement->addAttribute(QTest::AI_Metric, QBenchmarkGlobalData::current->measurer->metricText().toAscii().data()); + benchmarkElement->addAttribute( + QTest::AI_Metric, + QTest::benchmarkMetricName(QBenchmarkTestMethodData::current->result.metric)); benchmarkElement->addAttribute(QTest::AI_Tag, result.context.tag.toAscii().data()); benchmarkElement->addAttribute(QTest::AI_Value, QByteArray::number(result.value).constData()); diff --git a/src/testlib/qxmltestlogger.cpp b/src/testlib/qxmltestlogger.cpp index fac3663..a4750ac 100644 --- a/src/testlib/qxmltestlogger.cpp +++ b/src/testlib/qxmltestlogger.cpp @@ -46,6 +46,7 @@ #include "QtTest/private/qxmltestlogger_p.h" #include "QtTest/private/qtestresult_p.h" #include "QtTest/private/qbenchmark_p.h" +#include "QtTest/private/qbenchmarkmetric_p.h" #include "QtTest/qtestcase.h" QT_BEGIN_NAMESPACE @@ -243,7 +244,7 @@ void QXmlTestLogger::addBenchmarkResult(const QBenchmarkResult &result) QTestCharBuffer quotedTag; xmlQuote("edMetric, - QBenchmarkGlobalData::current->measurer->metricText().toAscii().constData()); + benchmarkMetricUnit(result.metric)); xmlQuote("edTag, result.context.tag.toAscii().constData()); QTest::qt_asprintf( diff --git a/src/testlib/testlib.pro b/src/testlib/testlib.pro index f68ff35..a8186d8 100644 --- a/src/testlib/testlib.pro +++ b/src/testlib/testlib.pro @@ -47,6 +47,7 @@ SOURCES = qtestcase.cpp \ qbenchmarkmeasurement.cpp \ qbenchmarkvalgrind.cpp \ qbenchmarkevent.cpp \ + qbenchmarkmetric.cpp \ qtestelement.cpp \ qtestelementattribute.cpp \ qtestbasicstreamer.cpp \ -- cgit v0.12 From 8cb83f37cc2e95002b44b48e851ec7672fb95df2 Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Tue, 15 Dec 2009 15:35:12 +0100 Subject: Fixed memory leak in caching of concave paths in GL2 engine. Reviewed-by: Gunnar --- .../gl2paintengineex/qpaintengineex_opengl2.cpp | 39 ++++++++++++---------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index 8fa8171..f9c41b1 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -884,6 +884,8 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path) QVectorPath::CacheEntry *data = path.lookupCacheData(q); QGL2PEVectorPathCache *cache; + bool updateCache = false; + if (data) { cache = (QGL2PEVectorPathCache *) data->data; // Check if scale factor is exceeded for curved paths and generate curves if so... @@ -898,23 +900,23 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path) qFree(cache->vertices); Q_ASSERT(cache->indices == 0); #endif - cache->vertexCount = 0; + updateCache = true; } } } else { cache = new QGL2PEVectorPathCache; - cache->vertexCount = 0; - cache->indexCount = 0; data = const_cast(path).addCacheData(q, cache, qopengl2paintengine_cleanup_vectorpath); + updateCache = true; } // Flatten the path at the current scale factor and fill it into the cache struct. - if (!cache->vertexCount) { + if (updateCache) { vertexCoordinateArray.clear(); vertexCoordinateArray.addPath(path, inverseScale, false); int vertexCount = vertexCoordinateArray.vertexCount(); int floatSizeInBytes = vertexCount * 2 * sizeof(float); cache->vertexCount = vertexCount; + cache->indexCount = 0; cache->primitiveType = GL_TRIANGLE_FAN; cache->iscale = inverseScale; #ifdef QT_OPENGL_CACHE_AS_VBOS @@ -951,18 +953,22 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path) } } else { + bool useCache = path.isCacheable(); + if (useCache) { + QRectF bbox = path.controlPointRect(); + // If the path doesn't fit within these limits, it is possible that the triangulation will fail. + useCache &= (bbox.left() > -0x8000 * inverseScale) + && (bbox.right() < 0x8000 * inverseScale) + && (bbox.top() > -0x8000 * inverseScale) + && (bbox.bottom() < 0x8000 * inverseScale); + } - QRectF bbox = path.controlPointRect(); - // If the path doesn't fit within these limits, it is possible that the triangulation will fail. - bool pathIsWithinLimits = (bbox.left() > -0x8000 * inverseScale) - && (bbox.right() < 0x8000 * inverseScale) - && (bbox.top() > -0x8000 * inverseScale) - && (bbox.bottom() < 0x8000 * inverseScale); - - if (path.isCacheable() && pathIsWithinLimits) { + if (useCache) { QVectorPath::CacheEntry *data = path.lookupCacheData(q); QGL2PEVectorPathCache *cache; + bool updateCache = false; + if (data) { cache = (QGL2PEVectorPathCache *) data->data; // Check if scale factor is exceeded for curved paths and generate curves if so... @@ -972,24 +978,21 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path) #ifdef QT_OPENGL_CACHE_AS_VBOS glDeleteBuffers(1, &cache->vbo); glDeleteBuffers(1, &cache->ibo); - cache->vbo = cache->ibo = 0; #else qFree(cache->vertices); qFree(cache->indices); #endif - cache->vertexCount = 0; - cache->indexCount = 0; + updateCache = true; } } } else { cache = new QGL2PEVectorPathCache; - cache->vertexCount = 0; - cache->indexCount = 0; data = const_cast(path).addCacheData(q, cache, qopengl2paintengine_cleanup_vectorpath); + updateCache = true; } // Flatten the path at the current scale factor and fill it into the cache struct. - if (!cache->vertexCount) { + if (updateCache) { QTriangleSet polys = qTriangulate(path, QTransform().scale(1 / inverseScale, 1 / inverseScale)); cache->vertexCount = polys.vertices.size() / 2; cache->indexCount = polys.indices.size(); -- cgit v0.12 From d4005e273d4285d0b6a9c60f712cfd12c311c3a3 Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Fri, 11 Dec 2009 20:19:53 +0100 Subject: Focus frames in mac style gets clipped. The focus frame on mac is a separate widget. The parent of the focus frame is same as the parent of the widget who has the focus. So if there is not enough room for a focus frame between the parent and the widget, it gets clipped to the parent. This parent is now changed to the nearest (in hierarchy) top level, toolbar or scrollarea-viewport. A clip area is set on the focus frame widget based on the visible region of the widget. This reduces the chances of having clipped focus frames. It is always better to leave enough margin for widgets which shows focus frames. Task-number: 6567 Reviewed-by: Richard Moe Gustavsen Reviewed-by: Jan-Arve --- src/gui/widgets/qfocusframe.cpp | 91 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 80 insertions(+), 11 deletions(-) diff --git a/src/gui/widgets/qfocusframe.cpp b/src/gui/widgets/qfocusframe.cpp index e96f50d..02f76f1 100644 --- a/src/gui/widgets/qfocusframe.cpp +++ b/src/gui/widgets/qfocusframe.cpp @@ -53,11 +53,14 @@ class QFocusFramePrivate : public QWidgetPrivate { Q_DECLARE_PUBLIC(QFocusFrame) QWidget *widget; - + QWidget *frameParent; + bool showFrameAboveWidget; public: QFocusFramePrivate() { widget = 0; + frameParent = 0; sendChildEvents = false; + showFrameAboveWidget = false; } void updateSize(); void update(); @@ -66,10 +69,10 @@ public: void QFocusFramePrivate::update() { Q_Q(QFocusFrame); - q->setParent(widget->parentWidget()); + q->setParent(frameParent); updateSize(); if (q->parentWidget()->rect().intersects(q->geometry())) { - if (q->style()->styleHint(QStyle::SH_FocusFrame_AboveWidget, 0, q)) + if (showFrameAboveWidget) q->raise(); else q->stackUnder(widget); @@ -84,7 +87,10 @@ void QFocusFramePrivate::updateSize() Q_Q(QFocusFrame); int vmargin = q->style()->pixelMetric(QStyle::PM_FocusFrameVMargin), hmargin = q->style()->pixelMetric(QStyle::PM_FocusFrameHMargin); - QRect geom(widget->x()-hmargin, widget->y()-vmargin, + QPoint pos(widget->x(), widget->y()); + if (q->parentWidget() != widget->parentWidget()) + pos = widget->parentWidget()->mapTo(q->parentWidget(), pos); + QRect geom(pos.x()-hmargin, pos.y()-vmargin, widget->width()+(hmargin*2), widget->height()+(vmargin*2)); if(q->geometry() == geom) return; @@ -176,14 +182,52 @@ void QFocusFrame::setWidget(QWidget *widget) { Q_D(QFocusFrame); - if(widget == d->widget) - return; - if(d->widget) - d->widget->removeEventFilter(this); - if(widget && !widget->isWindow() && widget->parentWidget()->windowType() != Qt::SubWindow) { + if (style()->styleHint(QStyle::SH_FocusFrame_AboveWidget, 0, this)) + d->showFrameAboveWidget = true; + else + d->showFrameAboveWidget = false; + + if (widget == d->widget) + return; + if (d->widget) { + // Remove event filters from the widget hierarchy. + QWidget *p = d->widget; + do { + p->removeEventFilter(this); + if (!d->showFrameAboveWidget || p == d->frameParent) + break; + p = p->parentWidget(); + }while (p); + } + if (widget && !widget->isWindow() && widget->parentWidget()->windowType() != Qt::SubWindow) { d->widget = widget; - widget->installEventFilter(this); + d->widget->installEventFilter(this); + QWidget *p = widget->parentWidget(); + QWidget *prev = 0; + if (d->showFrameAboveWidget) { + // Find the right parent for the focus frame. + while (p) { + // Traverse the hirerarchy of the 'widget' for setting event filter. + // During this if come across toolbar or a top level, use that + // as the parent for the focus frame. If we find a scroll area + // use its viewport as the parent. + bool isScrollArea = false; + if (p->isWindow() || p->inherits("QToolBar") || (isScrollArea = p->inherits("QAbstractScrollArea"))) { + d->frameParent = p; + // The previous one in the hierarchy will be the viewport. + if (prev && isScrollArea) + d->frameParent = prev; + break; + } else { + p->installEventFilter(this); + prev = p; + p = p->parentWidget(); + } + } + } else { + d->frameParent = p; + } d->update(); } else { d->widget = 0; @@ -210,9 +254,15 @@ QFocusFrame::widget() const void QFocusFrame::paintEvent(QPaintEvent *) { + Q_D(QFocusFrame); QStylePainter p(this); QStyleOption option; initStyleOption(&option); + int vmargin = style()->pixelMetric(QStyle::PM_FocusFrameVMargin); + int hmargin = style()->pixelMetric(QStyle::PM_FocusFrameHMargin); + QWidgetPrivate *wd = qt_widget_private(d->widget); + QRect rect = wd->clipRect().adjusted(0, 0, hmargin*2, vmargin*2); + p.setClipRect(rect); p.drawControl(QStyle::CE_FocusFrame, option); } @@ -233,7 +283,13 @@ QFocusFrame::eventFilter(QObject *o, QEvent *e) hide(); break; case QEvent::ParentChange: - d->update(); + if (d->showFrameAboveWidget) { + QWidget *w = d->widget; + setWidget(0); + setWidget(w); + } else { + d->update(); + } break; case QEvent::Show: d->update(); @@ -254,6 +310,19 @@ QFocusFrame::eventFilter(QObject *o, QEvent *e) default: break; } + } else if (d->showFrameAboveWidget) { + // Handle changes in the parent widgets we are monitoring. + switch(e->type()) { + case QEvent::Move: + case QEvent::Resize: + d->updateSize(); + break; + case QEvent::ZOrderChange: + raise(); + break; + default: + break; + } } return false; } -- cgit v0.12 From f0c5c37ad8c2497511564d8c52dd53b2503c97c4 Mon Sep 17 00:00:00 2001 From: ck Date: Mon, 21 Dec 2009 09:50:59 +0100 Subject: Assistant: Refactor help engine wrapper. This class had a lot of implementation details in the header, which were moved to an internal private class. --- .../tools/assistant/helpenginewrapper.cpp | 292 +++++++++++++-------- .../assistant/tools/assistant/helpenginewrapper.h | 37 +-- tools/assistant/tools/assistant/main.cpp | 2 +- 3 files changed, 187 insertions(+), 144 deletions(-) diff --git a/tools/assistant/tools/assistant/helpenginewrapper.cpp b/tools/assistant/tools/assistant/helpenginewrapper.cpp index 79a25ec..72ba30d 100644 --- a/tools/assistant/tools/assistant/helpenginewrapper.cpp +++ b/tools/assistant/tools/assistant/helpenginewrapper.cpp @@ -43,8 +43,11 @@ #include "helpenginewrapper.h" #include "../shared/collectionconfiguration.h" +#include #include #include +#include +#include #include #include #include @@ -71,6 +74,49 @@ namespace { arg(QLatin1String(QT_VERSION_STR))); } // anonymous namespace +class TimeoutForwarder : public QObject +{ + Q_OBJECT +public: + TimeoutForwarder(const QString &fileName); +private slots: + void forward(); +private: + friend class HelpEngineWrapperPrivate; + + const QString m_fileName; +}; + +class HelpEngineWrapperPrivate : public QObject +{ + Q_OBJECT + friend class HelpEngineWrapper; + friend class TimeoutForwarder; +private slots: + void qchFileChanged(const QString &fileName); + +signals: + void documentationRemoved(const QString &namespaceName); + void documentationUpdated(const QString &namespaceName); + +private: + HelpEngineWrapperPrivate(const QString &collectionFile); + + friend class TimeoutForwarder; + + void initFileSystemWatchers(); + void assertDocFilesWatched(); + void qchFileChanged(const QString &fileName, bool fromTimeout); + + static const int UpdateGracePeriod = 2000; + + QHelpEngine * const m_helpEngine; + QFileSystemWatcher * const m_qchWatcher; + typedef QPair > RecentSignal; + QMap m_recentQchUpdates; + +}; + HelpEngineWrapper *HelpEngineWrapper::helpEngineWrapper = 0; HelpEngineWrapper &HelpEngineWrapper::instance(const QString &collectionFile) @@ -93,183 +139,179 @@ void HelpEngineWrapper::removeInstance() } HelpEngineWrapper::HelpEngineWrapper(const QString &collectionFile) - : m_helpEngine(new QHelpEngine(collectionFile, this)), - m_qchWatcher(new QFileSystemWatcher(this)) + : d(new HelpEngineWrapperPrivate(collectionFile)) { TRACE_OBJ - connect(m_helpEngine, SIGNAL(currentFilterChanged(QString)), + connect(d, SIGNAL(documentationRemoved(QString)), + this, SIGNAL(documentationRemoved(QString))); + connect(d, SIGNAL(documentationUpdated(QString)), + this, SIGNAL(documentationUpdated(QString))); + connect(d->m_helpEngine, SIGNAL(currentFilterChanged(QString)), this, SIGNAL(currentFilterChanged(QString))); - connect(m_helpEngine, SIGNAL(setupFinished()), + connect(d->m_helpEngine, SIGNAL(setupFinished()), this, SIGNAL(setupFinished())); - initFileSystemWatchers(); } -void HelpEngineWrapper::initFileSystemWatchers() +HelpEngineWrapper::~HelpEngineWrapper() { TRACE_OBJ - foreach(const QString &ns, m_helpEngine->registeredDocumentations()) { - const QString &docFile = m_helpEngine->documentationFileName(ns); - m_qchWatcher->addPath(docFile); - connect(m_qchWatcher, SIGNAL(fileChanged(QString)), - this, SLOT(qchFileChanged(QString))); - } - assertDocFilesWatched(); + delete d; } QHelpSearchEngine *HelpEngineWrapper::searchEngine() const { TRACE_OBJ - return m_helpEngine->searchEngine(); + return d->m_helpEngine->searchEngine(); } QHelpContentModel *HelpEngineWrapper::contentModel() const { TRACE_OBJ - return m_helpEngine->contentModel(); + return d->m_helpEngine->contentModel(); } QHelpIndexModel *HelpEngineWrapper::indexModel() const { TRACE_OBJ - return m_helpEngine->indexModel(); + return d->m_helpEngine->indexModel(); } QHelpContentWidget *HelpEngineWrapper::contentWidget() { TRACE_OBJ - return m_helpEngine->contentWidget(); + return d->m_helpEngine->contentWidget(); } QHelpIndexWidget *HelpEngineWrapper::indexWidget() { TRACE_OBJ - return m_helpEngine->indexWidget(); + return d->m_helpEngine->indexWidget(); } const QStringList HelpEngineWrapper::registeredDocumentations() const { TRACE_OBJ - return m_helpEngine->registeredDocumentations(); + return d->m_helpEngine->registeredDocumentations(); } const QString HelpEngineWrapper::collectionFile() const { TRACE_OBJ - return m_helpEngine->collectionFile(); + return d->m_helpEngine->collectionFile(); } bool HelpEngineWrapper::registerDocumentation(const QString &docFile) { TRACE_OBJ - assertDocFilesWatched(); - if (!m_helpEngine->registerDocumentation(docFile)) + d->assertDocFilesWatched(); + if (!d->m_helpEngine->registerDocumentation(docFile)) return false; - m_qchWatcher->addPath(docFile); - assertDocFilesWatched(); + d->m_qchWatcher->addPath(docFile); + d->assertDocFilesWatched(); return true; } bool HelpEngineWrapper::unregisterDocumentation(const QString &namespaceName) { TRACE_OBJ - assertDocFilesWatched(); - const QString &file = m_helpEngine->documentationFileName(namespaceName); - if (!m_helpEngine->unregisterDocumentation(namespaceName)) + d->assertDocFilesWatched(); + const QString &file = d->m_helpEngine->documentationFileName(namespaceName); + if (!d->m_helpEngine->unregisterDocumentation(namespaceName)) return false; - m_qchWatcher->removePath(file); - assertDocFilesWatched(); + d->m_qchWatcher->removePath(file); + d->assertDocFilesWatched(); return true; } bool HelpEngineWrapper::setupData() { TRACE_OBJ - return m_helpEngine->setupData(); + return d->m_helpEngine->setupData(); } bool HelpEngineWrapper::addCustomFilter(const QString &filterName, const QStringList &attributes) { TRACE_OBJ - return m_helpEngine->addCustomFilter(filterName, attributes); + return d->m_helpEngine->addCustomFilter(filterName, attributes); } bool HelpEngineWrapper::removeCustomFilter(const QString &filterName) { TRACE_OBJ - return m_helpEngine->removeCustomFilter(filterName); + return d->m_helpEngine->removeCustomFilter(filterName); } void HelpEngineWrapper::setCurrentFilter(const QString ¤tFilter) { TRACE_OBJ - m_helpEngine->setCurrentFilter(currentFilter); + d->m_helpEngine->setCurrentFilter(currentFilter); } const QString HelpEngineWrapper::currentFilter() const { TRACE_OBJ - return m_helpEngine->currentFilter(); + return d->m_helpEngine->currentFilter(); } const QStringList HelpEngineWrapper::customFilters() const { TRACE_OBJ - return m_helpEngine->customFilters(); + return d->m_helpEngine->customFilters(); } QUrl HelpEngineWrapper::findFile(const QUrl &url) const { TRACE_OBJ - return m_helpEngine->findFile(url); + return d->m_helpEngine->findFile(url); } QByteArray HelpEngineWrapper::fileData(const QUrl &url) const { TRACE_OBJ - return m_helpEngine->fileData(url); + return d->m_helpEngine->fileData(url); } QMap HelpEngineWrapper::linksForIdentifier(const QString &id) const { TRACE_OBJ - return m_helpEngine->linksForIdentifier(id); + return d->m_helpEngine->linksForIdentifier(id); } const QStringList HelpEngineWrapper::filterAttributes() const { TRACE_OBJ - return m_helpEngine->filterAttributes(); + return d->m_helpEngine->filterAttributes(); } const QStringList HelpEngineWrapper::filterAttributes(const QString &filterName) const { TRACE_OBJ - return m_helpEngine->filterAttributes(filterName); + return d->m_helpEngine->filterAttributes(filterName); } QString HelpEngineWrapper::error() const { TRACE_OBJ - return m_helpEngine->error(); + return d->m_helpEngine->error(); } bool HelpEngineWrapper::unfilteredInserted() const { TRACE_OBJ - return m_helpEngine->customValue(UnfilteredInsertedKey).toInt() == 1; + return d->m_helpEngine->customValue(UnfilteredInsertedKey).toInt() == 1; } void HelpEngineWrapper::setUnfilteredInserted() { TRACE_OBJ - m_helpEngine->setCustomValue(UnfilteredInsertedKey, 1); + d->m_helpEngine->setCustomValue(UnfilteredInsertedKey, 1); } const QStringList HelpEngineWrapper::qtDocInfo(const QString &component) const { TRACE_OBJ - return m_helpEngine->customValue(VersionKey.arg(component)).toString(). + return d->m_helpEngine->customValue(VersionKey.arg(component)).toString(). split(CollectionConfiguration::ListSeparator); } @@ -277,264 +319,265 @@ void HelpEngineWrapper::setQtDocInfo(const QString &component, const QStringList &doc) { TRACE_OBJ - m_helpEngine->setCustomValue(VersionKey.arg(component), + d->m_helpEngine->setCustomValue(VersionKey.arg(component), doc.join(CollectionConfiguration::ListSeparator)); } const QStringList HelpEngineWrapper::lastShownPages() const { TRACE_OBJ - return CollectionConfiguration::lastShownPages(*m_helpEngine); + return CollectionConfiguration::lastShownPages(*d->m_helpEngine); } void HelpEngineWrapper::setLastShownPages(const QStringList &lastShownPages) { TRACE_OBJ - CollectionConfiguration::setLastShownPages(*m_helpEngine, lastShownPages); + CollectionConfiguration::setLastShownPages(*d->m_helpEngine, lastShownPages); } const QStringList HelpEngineWrapper::lastZoomFactors() const { TRACE_OBJ - return CollectionConfiguration::lastZoomFactors(*m_helpEngine); + return CollectionConfiguration::lastZoomFactors(*d->m_helpEngine); } void HelpEngineWrapper::setLastZoomFactors(const QStringList &lastZoomFactors) { TRACE_OBJ - CollectionConfiguration::setLastZoomFactors(*m_helpEngine, lastZoomFactors); + CollectionConfiguration::setLastZoomFactors(*d->m_helpEngine, lastZoomFactors); } const QString HelpEngineWrapper::cacheDir() const { TRACE_OBJ - return CollectionConfiguration::cacheDir(*m_helpEngine); + return CollectionConfiguration::cacheDir(*d->m_helpEngine); } bool HelpEngineWrapper::cacheDirIsRelativeToCollection() const { TRACE_OBJ - return CollectionConfiguration::cacheDirIsRelativeToCollection(*m_helpEngine); + return CollectionConfiguration::cacheDirIsRelativeToCollection(*d->m_helpEngine); } void HelpEngineWrapper::setCacheDir(const QString &cacheDir, bool relativeToCollection) { TRACE_OBJ - CollectionConfiguration::setCacheDir(*m_helpEngine, cacheDir, + CollectionConfiguration::setCacheDir(*d->m_helpEngine, cacheDir, relativeToCollection); } bool HelpEngineWrapper::filterFunctionalityEnabled() const { TRACE_OBJ - return CollectionConfiguration::filterFunctionalityEnabled(*m_helpEngine); + return CollectionConfiguration::filterFunctionalityEnabled(*d->m_helpEngine); } void HelpEngineWrapper::setFilterFunctionalityEnabled(bool enabled) { TRACE_OBJ - CollectionConfiguration::setFilterFunctionalityEnabled(*m_helpEngine, + CollectionConfiguration::setFilterFunctionalityEnabled(*d->m_helpEngine, enabled); } bool HelpEngineWrapper::filterToolbarVisible() const { TRACE_OBJ - return CollectionConfiguration::filterToolbarVisible(*m_helpEngine); + return CollectionConfiguration::filterToolbarVisible(*d->m_helpEngine); } void HelpEngineWrapper::setFilterToolbarVisible(bool visible) { TRACE_OBJ - CollectionConfiguration::setFilterToolbarVisible(*m_helpEngine, visible); + CollectionConfiguration::setFilterToolbarVisible(*d->m_helpEngine, visible); } bool HelpEngineWrapper::addressBarEnabled() const { TRACE_OBJ - return CollectionConfiguration::addressBarEnabled(*m_helpEngine); + return CollectionConfiguration::addressBarEnabled(*d->m_helpEngine); } void HelpEngineWrapper::setAddressBarEnabled(bool enabled) { TRACE_OBJ - CollectionConfiguration::setAddressBarEnabled(*m_helpEngine, enabled); + CollectionConfiguration::setAddressBarEnabled(*d->m_helpEngine, enabled); } bool HelpEngineWrapper::addressBarVisible() const { TRACE_OBJ - return CollectionConfiguration::addressBarVisible(*m_helpEngine); + return CollectionConfiguration::addressBarVisible(*d->m_helpEngine); } void HelpEngineWrapper::setAddressBarVisible(bool visible) { TRACE_OBJ - CollectionConfiguration::setAddressBarVisible(*m_helpEngine, visible); + CollectionConfiguration::setAddressBarVisible(*d->m_helpEngine, visible); } bool HelpEngineWrapper::documentationManagerEnabled() const { TRACE_OBJ - return CollectionConfiguration::documentationManagerEnabled(*m_helpEngine); + return CollectionConfiguration::documentationManagerEnabled(*d->m_helpEngine); } void HelpEngineWrapper::setDocumentationManagerEnabled(bool enabled) { TRACE_OBJ - CollectionConfiguration::setDocumentationManagerEnabled(*m_helpEngine, + CollectionConfiguration::setDocumentationManagerEnabled(*d->m_helpEngine, enabled); } const QByteArray HelpEngineWrapper::aboutMenuTexts() const { TRACE_OBJ - return CollectionConfiguration::aboutMenuTexts(*m_helpEngine); + return CollectionConfiguration::aboutMenuTexts(*d->m_helpEngine); } void HelpEngineWrapper::setAboutMenuTexts(const QByteArray &texts) { TRACE_OBJ - CollectionConfiguration::setAboutMenuTexts(*m_helpEngine, texts); + CollectionConfiguration::setAboutMenuTexts(*d->m_helpEngine, texts); } const QByteArray HelpEngineWrapper::aboutIcon() const { TRACE_OBJ - return CollectionConfiguration::aboutIcon(*m_helpEngine); + return CollectionConfiguration::aboutIcon(*d->m_helpEngine); } void HelpEngineWrapper::setAboutIcon(const QByteArray &icon) { TRACE_OBJ - CollectionConfiguration::setAboutIcon(*m_helpEngine, icon); + CollectionConfiguration::setAboutIcon(*d->m_helpEngine, icon); } const QByteArray HelpEngineWrapper::aboutImages() const { TRACE_OBJ - return CollectionConfiguration::aboutImages(*m_helpEngine); + return CollectionConfiguration::aboutImages(*d->m_helpEngine); } void HelpEngineWrapper::setAboutImages(const QByteArray &images) { TRACE_OBJ - CollectionConfiguration::setAboutImages(*m_helpEngine, images); + CollectionConfiguration::setAboutImages(*d->m_helpEngine, images); } const QByteArray HelpEngineWrapper::aboutTexts() const { TRACE_OBJ - return CollectionConfiguration::aboutTexts(*m_helpEngine); + return CollectionConfiguration::aboutTexts(*d->m_helpEngine); } void HelpEngineWrapper::setAboutTexts(const QByteArray &texts) { TRACE_OBJ - CollectionConfiguration::setAboutTexts(*m_helpEngine, texts); + CollectionConfiguration::setAboutTexts(*d->m_helpEngine, texts); } const QString HelpEngineWrapper::windowTitle() const { TRACE_OBJ - return CollectionConfiguration::windowTitle(*m_helpEngine); + return CollectionConfiguration::windowTitle(*d->m_helpEngine); } void HelpEngineWrapper::setWindowTitle(const QString &windowTitle) { TRACE_OBJ - CollectionConfiguration::setWindowTitle(*m_helpEngine, windowTitle); + CollectionConfiguration::setWindowTitle(*d->m_helpEngine, windowTitle); } const QByteArray HelpEngineWrapper::applicationIcon() const { TRACE_OBJ - return CollectionConfiguration::applicationIcon(*m_helpEngine); + return CollectionConfiguration::applicationIcon(*d->m_helpEngine); } void HelpEngineWrapper::setApplicationIcon(const QByteArray &icon) { TRACE_OBJ - CollectionConfiguration::setApplicationIcon(*m_helpEngine, icon); + CollectionConfiguration::setApplicationIcon(*d->m_helpEngine, icon); } const QByteArray HelpEngineWrapper::mainWindow() const { TRACE_OBJ - return m_helpEngine->customValue(MainWindowKey).toByteArray(); + return d->m_helpEngine->customValue(MainWindowKey).toByteArray(); } void HelpEngineWrapper::setMainWindow(const QByteArray &mainWindow) { TRACE_OBJ - m_helpEngine->setCustomValue(MainWindowKey, mainWindow); + d->m_helpEngine->setCustomValue(MainWindowKey, mainWindow); } const QByteArray HelpEngineWrapper::mainWindowGeometry() const { TRACE_OBJ - return m_helpEngine->customValue(MainWindowGeometryKey).toByteArray(); + return d->m_helpEngine->customValue(MainWindowGeometryKey).toByteArray(); } void HelpEngineWrapper::setMainWindowGeometry(const QByteArray &geometry) { TRACE_OBJ - m_helpEngine->setCustomValue(MainWindowGeometryKey, geometry); + d->m_helpEngine->setCustomValue(MainWindowGeometryKey, geometry); } const QByteArray HelpEngineWrapper::bookmarks() const { TRACE_OBJ - return m_helpEngine->customValue(BookmarksKey).toByteArray(); + return d->m_helpEngine->customValue(BookmarksKey).toByteArray(); } void HelpEngineWrapper::setBookmarks(const QByteArray &bookmarks) { TRACE_OBJ - m_helpEngine->setCustomValue(BookmarksKey, bookmarks); + d->m_helpEngine->setCustomValue(BookmarksKey, bookmarks); } int HelpEngineWrapper::lastTabPage() const { TRACE_OBJ - return CollectionConfiguration::lastTabPage(*m_helpEngine); + return CollectionConfiguration::lastTabPage(*d->m_helpEngine); } void HelpEngineWrapper::setLastTabPage(int lastPage) { TRACE_OBJ - CollectionConfiguration::setLastTabPage(*m_helpEngine, lastPage); + CollectionConfiguration::setLastTabPage(*d->m_helpEngine, lastPage); } bool HelpEngineWrapper::searchWasAttached() const { TRACE_OBJ - return m_helpEngine->customValue(SearchWasAttachedKey).toBool(); + return d->m_helpEngine->customValue(SearchWasAttachedKey).toBool(); } void HelpEngineWrapper::setSearchWasAttached(bool attached) { TRACE_OBJ - m_helpEngine->setCustomValue(SearchWasAttachedKey, attached); + d->m_helpEngine->setCustomValue(SearchWasAttachedKey, attached); } int HelpEngineWrapper::startOption() const { TRACE_OBJ - return m_helpEngine->customValue(StartOptionKey, ShowLastPages).toInt(); + return d->m_helpEngine->customValue(StartOptionKey, ShowLastPages).toInt(); } void HelpEngineWrapper::setStartOption(int option) { TRACE_OBJ - m_helpEngine->setCustomValue(StartOptionKey, option); + d->m_helpEngine->setCustomValue(StartOptionKey, option); } const QString HelpEngineWrapper::homePage() const { TRACE_OBJ - const QString &homePage = m_helpEngine->customValue(HomePageKey).toString(); + const QString &homePage + = d->m_helpEngine->customValue(HomePageKey).toString(); if (!homePage.isEmpty()) return homePage; return defaultHomePage(); @@ -543,129 +586,151 @@ const QString HelpEngineWrapper::homePage() const void HelpEngineWrapper::setHomePage(const QString &page) { TRACE_OBJ - m_helpEngine->setCustomValue(HomePageKey, page); + d->m_helpEngine->setCustomValue(HomePageKey, page); } const QString HelpEngineWrapper::defaultHomePage() const { TRACE_OBJ - return CollectionConfiguration::defaultHomePage(*m_helpEngine); + return CollectionConfiguration::defaultHomePage(*d->m_helpEngine); } void HelpEngineWrapper::setDefaultHomePage(const QString &page) { TRACE_OBJ - CollectionConfiguration::setDefaultHomePage(*m_helpEngine, page); + CollectionConfiguration::setDefaultHomePage(*d->m_helpEngine, page); } bool HelpEngineWrapper::hasFontSettings() const { TRACE_OBJ - return m_helpEngine->customValue(UseAppFontKey).isValid(); + return d->m_helpEngine->customValue(UseAppFontKey).isValid(); } bool HelpEngineWrapper::usesAppFont() const { TRACE_OBJ - return m_helpEngine->customValue(UseAppFontKey).toBool(); + return d->m_helpEngine->customValue(UseAppFontKey).toBool(); } void HelpEngineWrapper::setUseAppFont(bool useAppFont) { TRACE_OBJ - m_helpEngine->setCustomValue(UseAppFontKey, useAppFont); + d->m_helpEngine->setCustomValue(UseAppFontKey, useAppFont); } bool HelpEngineWrapper::usesBrowserFont() const { TRACE_OBJ - return m_helpEngine->customValue(UseBrowserFontKey, false).toBool(); + return d->m_helpEngine->customValue(UseBrowserFontKey, false).toBool(); } void HelpEngineWrapper::setUseBrowserFont(bool useBrowserFont) { TRACE_OBJ - m_helpEngine->setCustomValue(UseBrowserFontKey, useBrowserFont); + d->m_helpEngine->setCustomValue(UseBrowserFontKey, useBrowserFont); } const QFont HelpEngineWrapper::appFont() const { TRACE_OBJ - return qVariantValue(m_helpEngine->customValue(AppFontKey)); + return qVariantValue(d->m_helpEngine->customValue(AppFontKey)); } void HelpEngineWrapper::setAppFont(const QFont &font) { TRACE_OBJ - m_helpEngine->setCustomValue(AppFontKey, font); + d->m_helpEngine->setCustomValue(AppFontKey, font); } QFontDatabase::WritingSystem HelpEngineWrapper::appWritingSystem() const { TRACE_OBJ return static_cast( - m_helpEngine->customValue(AppWritingSystemKey).toInt()); + d->m_helpEngine->customValue(AppWritingSystemKey).toInt()); } void HelpEngineWrapper::setAppWritingSystem(QFontDatabase::WritingSystem system) { TRACE_OBJ - m_helpEngine->setCustomValue(AppWritingSystemKey, system); + d->m_helpEngine->setCustomValue(AppWritingSystemKey, system); } const QFont HelpEngineWrapper::browserFont() const { TRACE_OBJ - return qVariantValue(m_helpEngine->customValue(BrowserFontKey)); + return qVariantValue(d->m_helpEngine->customValue(BrowserFontKey)); } void HelpEngineWrapper::setBrowserFont(const QFont &font) { TRACE_OBJ - m_helpEngine->setCustomValue(BrowserFontKey, font); + d->m_helpEngine->setCustomValue(BrowserFontKey, font); } QFontDatabase::WritingSystem HelpEngineWrapper::browserWritingSystem() const { TRACE_OBJ return static_cast( - m_helpEngine->customValue(BrowserWritingSystemKey).toInt()); + d->m_helpEngine->customValue(BrowserWritingSystemKey).toInt()); } void HelpEngineWrapper::setBrowserWritingSystem(QFontDatabase::WritingSystem system) { TRACE_OBJ - m_helpEngine->setCustomValue(BrowserWritingSystemKey, system); + d->m_helpEngine->setCustomValue(BrowserWritingSystemKey, system); } -void HelpEngineWrapper::assertDocFilesWatched() +TimeoutForwarder::TimeoutForwarder(const QString &fileName) + : m_fileName(fileName) { TRACE_OBJ - Q_ASSERT(m_qchWatcher->files().count() - == m_helpEngine->registeredDocumentations().count()); } -TimeoutForwarder::TimeoutForwarder(const QString &fileName) - : m_fileName(fileName) +void TimeoutForwarder::forward() { TRACE_OBJ + HelpEngineWrapper::instance().d->qchFileChanged(m_fileName, true); } -void TimeoutForwarder::forward() + +HelpEngineWrapperPrivate::HelpEngineWrapperPrivate(const QString &collectionFile) + : m_helpEngine(new QHelpEngine(collectionFile, this)), + m_qchWatcher(new QFileSystemWatcher(this)) { TRACE_OBJ - HelpEngineWrapper::instance().qchFileChanged(m_fileName, true); + initFileSystemWatchers(); +} + +void HelpEngineWrapperPrivate::initFileSystemWatchers() +{ + TRACE_OBJ + foreach(const QString &ns, m_helpEngine->registeredDocumentations()) { + const QString &docFile = m_helpEngine->documentationFileName(ns); + m_qchWatcher->addPath(docFile); + connect(m_qchWatcher, SIGNAL(fileChanged(QString)), + this, SLOT(qchFileChanged(QString))); + } + assertDocFilesWatched(); } -void HelpEngineWrapper::qchFileChanged(const QString &fileName) +void HelpEngineWrapperPrivate::qchFileChanged(const QString &fileName) { TRACE_OBJ qchFileChanged(fileName, false); } -void HelpEngineWrapper::qchFileChanged(const QString &fileName, bool fromTimeout) +void HelpEngineWrapperPrivate::assertDocFilesWatched() +{ + TRACE_OBJ + Q_ASSERT(m_qchWatcher->files().count() + == m_helpEngine->registeredDocumentations().count()); +} + +void HelpEngineWrapperPrivate::qchFileChanged(const QString &fileName, + bool fromTimeout) { TRACE_OBJ @@ -731,4 +796,7 @@ void HelpEngineWrapper::qchFileChanged(const QString &fileName, bool fromTimeout m_recentQchUpdates.erase(it); } + QT_END_NAMESPACE + +#include "helpenginewrapper.moc" diff --git a/tools/assistant/tools/assistant/helpenginewrapper.h b/tools/assistant/tools/assistant/helpenginewrapper.h index 348479e..ea7b762 100644 --- a/tools/assistant/tools/assistant/helpenginewrapper.h +++ b/tools/assistant/tools/assistant/helpenginewrapper.h @@ -42,11 +42,8 @@ #ifndef HELPENGINEWRAPPER_H #define HELPENGINEWRAPPER_H -#include #include #include -#include -#include #include #include #include @@ -58,8 +55,6 @@ QT_BEGIN_NAMESPACE class QFileSystemWatcher; class QHelpContentModel; class QHelpContentWidget; -class QHelpEngine; -class QHelpEngineCore; class QHelpIndexModel; class QHelpIndexWidget; class QHelpSearchEngine; @@ -70,24 +65,14 @@ enum { ShowLastPages = 2 }; - -class TimeoutForwarder : public QObject -{ - Q_OBJECT -public: - TimeoutForwarder(const QString &fileName); -private slots: - void forward(); -private: - friend class HelpEngineWrapper; - - const QString m_fileName; -}; +class HelpEngineWrapperPrivate; +class TimeoutForwarder; class HelpEngineWrapper : public QObject { Q_OBJECT Q_DISABLE_COPY(HelpEngineWrapper) + friend class TimeoutForwarder; public: static HelpEngineWrapper &instance(const QString &collectionFile = QString()); static void removeInstance(); @@ -210,23 +195,13 @@ signals: void currentFilterChanged(const QString ¤tFilter); void setupFinished(); -private slots: - void qchFileChanged(const QString &fileName); - private: - friend class TimeoutForwarder; - HelpEngineWrapper(const QString &collectionFile); - void initFileSystemWatchers(); - void assertDocFilesWatched(); - void qchFileChanged(const QString &fileName, bool fromTimeout); + ~HelpEngineWrapper(); - static const int UpdateGracePeriod = 2000; static HelpEngineWrapper *helpEngineWrapper; - QHelpEngine * const m_helpEngine; - QFileSystemWatcher * const m_qchWatcher; - typedef QPair > RecentSignal; - QMap m_recentQchUpdates; + + HelpEngineWrapperPrivate *d; }; QT_END_NAMESPACE diff --git a/tools/assistant/tools/assistant/main.cpp b/tools/assistant/tools/assistant/main.cpp index ce85854..dfee0fb 100644 --- a/tools/assistant/tools/assistant/main.cpp +++ b/tools/assistant/tools/assistant/main.cpp @@ -427,6 +427,6 @@ int main(int argc, char *argv[]) a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); const int retval = a.exec(); delete w; - delete &HelpEngineWrapper::instance(); + HelpEngineWrapper::removeInstance(); return retval; } -- cgit v0.12 From 22573ddffc28135fba2dbb9eb2d50a76cae0a09c Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Mon, 21 Dec 2009 14:23:21 +0100 Subject: Fixed gradients on text when coordinate mode != logical mode. Task-number: QTBUG-6395 Reviewed-by: Samuel --- src/gui/painting/qemulationpaintengine.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/gui/painting/qemulationpaintengine.cpp b/src/gui/painting/qemulationpaintengine.cpp index 662b163..5bd3c71 100644 --- a/src/gui/painting/qemulationpaintengine.cpp +++ b/src/gui/painting/qemulationpaintengine.cpp @@ -172,6 +172,36 @@ void QEmulationPaintEngine::drawTextItem(const QPointF &p, const QTextItem &text QRectF rect(p.x(), p.y() - ti.ascent.toReal(), ti.width.toReal(), (ti.ascent + ti.descent + 1).toReal()); fillBGRect(rect); } + + QPainterState *s = state(); + Qt::BrushStyle style = qbrush_style(s->pen.brush()); + if (style >= Qt::LinearGradientPattern && style <= Qt::ConicalGradientPattern) + { + QPen savedPen = s->pen; + QGradient g = *s->pen.brush().gradient(); + + if (g.coordinateMode() > QGradient::LogicalMode) { + QTransform mat = s->pen.brush().transform(); + if (g.coordinateMode() == QGradient::StretchToDeviceMode) { + mat.scale(real_engine->painter()->device()->width(), real_engine->painter()->device()->height()); + } else if (g.coordinateMode() == QGradient::ObjectBoundingMode) { + const QTextItemInt &ti = static_cast(textItem); + QRectF r(p.x(), p.y() - ti.ascent.toReal(), ti.width.toReal(), (ti.ascent + ti.descent + 1).toReal()); + mat.translate(r.x(), r.y()); + mat.scale(r.width(), r.height()); + } + g.setCoordinateMode(QGradient::LogicalMode); + QBrush brush(g); + brush.setTransform(mat); + s->pen.setBrush(brush); + penChanged(); + real_engine->drawTextItem(p, textItem); + s->pen = savedPen; + penChanged(); + return; + } + } + real_engine->drawTextItem(p, textItem); } -- cgit v0.12 From 875afab977005b03d307040fb3be15c7524a37ff Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Fri, 18 Dec 2009 11:14:29 +0100 Subject: Cocoa: added release pool Fix warning given by cocoa --- src/gui/kernel/qwidget_mac.mm | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index 34a9eed..7bdf745 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -3671,6 +3671,7 @@ void QWidgetPrivate::raise_sys() return; #if QT_MAC_USE_COCOA + QMacCocoaAutoReleasePool pool; if (isRealWindow()) { // Calling orderFront shows the window on Cocoa too. if (!q->testAttribute(Qt::WA_DontShowOnScreen) && q->isVisible()) { -- cgit v0.12 From 464306df827cbf3378f72f9aead0448a32ab5a21 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Wed, 9 Dec 2009 15:30:10 +0100 Subject: Cocoa: event dispatcher drops events on the floor Under some circumstances, the event dispatcher needs to stop NSApplication, let the control return back to the QEventLoop that called processEvents, which very often will just call processEvents again, which in turn will restart NSApplication. After stopping NSApplication, Cocoa seems to throw away at least some of the posted cocoa events that are still pending. This will offcourse have inpact on things like window updates etc. that never happends. This patch will be more careful about when to stop NSApplication, and delay this until the run loop has finished one more spin after interrupt has been called. The same goes for modal sessions. Introducing this delay also made it neccessary to sometimes block cocoa from updating the stacking order of the windows. Autotest: qcoreapplication, qapplication, qtimer --- src/gui/kernel/qcocoasharedwindowmethods_mac_p.h | 34 ++ src/gui/kernel/qeventdispatcher_mac.mm | 397 +++++++++++++---------- src/gui/kernel/qeventdispatcher_mac_p.h | 9 +- src/gui/kernel/qwidget_mac.mm | 47 ++- 4 files changed, 293 insertions(+), 194 deletions(-) diff --git a/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h b/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h index cc5839c..7661b89 100644 --- a/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h +++ b/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h @@ -55,6 +55,7 @@ QT_BEGIN_NAMESPACE extern Qt::MouseButton cocoaButton2QtButton(NSInteger buttonNum); // qcocoaview.mm extern QPointer qt_button_down; //qapplication_mac.cpp extern const QStringList& qEnabledDraggedTypes(); // qmime_mac.cpp +extern bool qt_blockCocoaSettingModalWindowLevel; // qeventdispatcher_mac_p.h Q_GLOBAL_STATIC(QPointer, currentDragTarget); @@ -88,6 +89,39 @@ QT_END_NAMESPACE return !(isPopup || isToolTip); } +- (BOOL)canBecomeMainWindow +{ + QWidget *widget = [self QT_MANGLE_NAMESPACE(qt_qwidget)]; + + bool isToolTip = (widget->windowType() == Qt::ToolTip); + bool isPopup = (widget->windowType() == Qt::Popup); + return !(isPopup || isToolTip); +} + +- (void)orderWindow:(NSWindowOrderingMode)orderingMode relativeTo:(NSInteger)otherWindowNumber +{ + if (qt_blockCocoaSettingModalWindowLevel) { + // To avoid windows popping in front while restoring modal sessions + // in the event dispatcher, we block cocoa from ordering this window + // to front. The result of not doing this can be seen if executing + // a native color dialog on top of another executing dialog. + return; + } + [super orderWindow:orderingMode relativeTo:otherWindowNumber]; +} + +- (void)setLevel:(NSInteger)windowLevel +{ + if (qt_blockCocoaSettingModalWindowLevel) { + // To avoid windows popping in front while restoring modal sessions + // in the event dispatcher, we block cocoa from ordering this window + // to front. The result of not doing this can be seen if executing + // a native color dialog on top of another executing dialog. + return; + } + [super setLevel:windowLevel]; +} + - (void)toggleToolbarShown:(id)sender { macSendToolbarChangeEvent([self QT_MANGLE_NAMESPACE(qt_qwidget)]); diff --git a/src/gui/kernel/qeventdispatcher_mac.mm b/src/gui/kernel/qeventdispatcher_mac.mm index e0eebfd..0b48dca 100644 --- a/src/gui/kernel/qeventdispatcher_mac.mm +++ b/src/gui/kernel/qeventdispatcher_mac.mm @@ -90,11 +90,16 @@ #ifndef QT_NO_THREAD # include "qmutex.h" +#endif QT_BEGIN_NAMESPACE QT_USE_NAMESPACE -#endif + +/***************************************************************************** + Internal variables and functions + *****************************************************************************/ +bool qt_blockCocoaSettingModalWindowLevel = false; /***************************************************************************** Externals @@ -540,6 +545,12 @@ bool QEventDispatcherMac::processEvents(QEventLoop::ProcessEventsFlags flags) { Q_D(QEventDispatcherMac); d->interrupt = false; + +#ifdef QT_MAC_USE_COCOA + bool interruptLater = false; + QtMacInterruptDispatcherHelp::cancelInterruptLater(); +#endif + // In case we end up recursing while we now process events, make sure // that we send remaining posted Qt events before this call returns: wakeUp(); @@ -554,25 +565,26 @@ bool QEventDispatcherMac::processEvents(QEventLoop::ProcessEventsFlags flags) QMacCocoaAutoReleasePool pool; NSEvent* event = 0; - // If Qt is used as a plugin, or just added into a native cocoa - // application, we should not run or stop NSApplication; - // This will be done from outside Qt. - // And if processEvents is called manually (rather than from QEventLoop), we - // cannot enter a tight loop and block the call, but instead return after one flush: + // If Qt is used as a plugin, or as an extension in a native cocoa + // application, we should not run or stop NSApplication; This will be + // done from the application itself. And if processEvents is called + // manually (rather than from a QEventLoop), we cannot enter a tight + // loop and block this call, but instead we need to return after one flush: bool canExec_3rdParty = d->nsAppRunCalledByQt || ![NSApp isRunning]; bool canExec_Qt = flags & QEventLoop::DialogExec || flags & QEventLoop::EventLoopExec; if (canExec_Qt && canExec_3rdParty) { // We can use exec-mode, meaning that we can stay in a tight loop until - // interrupted. This is mostly an optimization, but it also allow us - // to use [NSApp run], which is the recommended way of running applications - // in cocoa. [NSApp run] should be called at least once for any cocoa app. + // interrupted. This is mostly an optimization, but it allow us to use + // [NSApp run], which is the normal code path for cocoa applications. if (NSModalSession session = d->currentModalSession()) { QBoolBlocker execGuard(d->currentExecIsNSAppRun, false); - while (!d->interrupt && [NSApp runModalSession:session] == NSRunContinuesResponse) + + while ([NSApp runModalSession:session] == NSRunContinuesResponse && !d->interrupt) qt_mac_waitForMoreModalSessionEvents(); + if (!d->interrupt && session == d->currentModalSessionCached) { - // INVARIANT: Someone called e.g. [NSApp stopModal:] from outside the event + // Someone called [NSApp stopModal:] from outside the event // dispatcher (e.g to stop a native dialog). But that call wrongly stopped // 'session' as well. As a result, we need to restart all internal sessions: d->temporarilyStopAllModalSessions(); @@ -583,54 +595,62 @@ bool QEventDispatcherMac::processEvents(QEventLoop::ProcessEventsFlags flags) [NSApp run]; } retVal = true; - } else do { - // INVARIANT: We cannot block the thread (and run in a tight loop). - // Instead we will process all current pending events and return. - bool mustRelease = false; - - if (!(flags & QEventLoop::ExcludeUserInputEvents) && !d->queuedUserInputEvents.isEmpty()) { - // Process a pending user input event - mustRelease = true; - event = static_cast(d->queuedUserInputEvents.takeFirst()); - } else { - if (NSModalSession session = d->currentModalSession()) { - if (flags & QEventLoop::WaitForMoreEvents) - qt_mac_waitForMoreModalSessionEvents(); - NSInteger status = [NSApp runModalSession:session]; - if (status != NSRunContinuesResponse && session == d->currentModalSessionCached) { - // INVARIANT: Someone called e.g. [NSApp stopModal:] from outside the event - // dispatcher (e.g to stop a native dialog). But that call wrongly stopped - // 'session' as well. As a result, we need to restart all internal sessions: - d->temporarilyStopAllModalSessions(); - } - retVal = true; - break; + } else { + do { + // We cannot block the thread (and run in a tight loop). + // Instead we will process all current pending events and return. + bool releaseEvent = false; + + if (!(flags & QEventLoop::ExcludeUserInputEvents) + && !d->queuedUserInputEvents.isEmpty()) { + // Process a pending user input event + releaseEvent = true; + event = static_cast(d->queuedUserInputEvents.takeFirst()); } else { - event = [NSApp nextEventMatchingMask:NSAnyEventMask - untilDate:nil - inMode:NSDefaultRunLoopMode - dequeue: YES]; - - if (event != nil) { - if (flags & QEventLoop::ExcludeUserInputEvents) { - if (IsMouseOrKeyEvent(event)) { - // retain event here? - [event retain]; - d->queuedUserInputEvents.append(event); - continue; + if (NSModalSession session = d->currentModalSession()) { + if (flags & QEventLoop::WaitForMoreEvents) + qt_mac_waitForMoreModalSessionEvents(); + NSInteger status = [NSApp runModalSession:session]; + if (status != NSRunContinuesResponse && session == d->currentModalSessionCached) { + // INVARIANT: Someone called [NSApp stopModal:] from outside the event + // dispatcher (e.g to stop a native dialog). But that call wrongly stopped + // 'session' as well. As a result, we need to restart all internal sessions: + d->temporarilyStopAllModalSessions(); + } + retVal = true; + break; + } else { + event = [NSApp nextEventMatchingMask:NSAnyEventMask + untilDate:nil + inMode:NSDefaultRunLoopMode + dequeue: YES]; + + if (event != nil) { + if (flags & QEventLoop::ExcludeUserInputEvents) { + if (IsMouseOrKeyEvent(event)) { + [event retain]; + d->queuedUserInputEvents.append(event); + continue; + } } } } } - } - if (event) { - if (!filterEvent(event) && qt_mac_send_event(flags, event, 0)) - retVal = true; - if (mustRelease) - [event release]; - } - } while(!d->interrupt && event != nil); - + if (event) { + if (!filterEvent(event) && qt_mac_send_event(flags, event, 0)) + retVal = true; + if (releaseEvent) + [event release]; + } + } while (!d->interrupt && event != nil); + + // Since the window that holds modality might have changed while processing + // events, we we need to interrupt when we return back the previous process + // event recursion to ensure that we spin the correct modal session. + // We do the interruptLater at the end of the function to ensure that we don't + // disturb the 'wait for more events' below (as deleteLater will post an event): + interruptLater = true; + } #else do { EventRef event; @@ -682,25 +702,19 @@ bool QEventDispatcherMac::processEvents(QEventLoop::ProcessEventsFlags flags) } } + // If we're interrupted, we need to interrupt the _current_ + // recursion as well to check if it is still supposed to be + // executing. This way we wind down the stack until we land + // on a recursion that again calls processEvents (typically + // from QEventLoop), and set interrupt to false: + if (d->interrupt) + interrupt(); + #ifdef QT_MAC_USE_COCOA - // In case we _now_ process events using [NSApp run], we need to stop it to - // ensure that: - // 1. the QEventLoop that called us is still executing, or - // 2. we have a modal session that needs to be spun instead. - // In case this is a plain call to processEvents (perhaps from a loop) - // from the application (rather than from a QEventLoop), we delay the - // interrupting until we/ actually enter a lower loop level (hence the - // deffered delete of the object below): - QtMacInterruptDispatcherHelp::interruptLater(); + if (interruptLater) + QtMacInterruptDispatcherHelp::interruptLater(); #endif - if (d->interrupt) { - // We should continue to leave all recursion to processEvents until - // processEvents is called again (e.g. from a QEventLoop that - // was not yet told to quit: - interrupt(); - } - return retVal; } @@ -733,35 +747,45 @@ bool QEventDispatcherMacPrivate::blockSendPostedEvents = false; #ifdef QT_MAC_USE_COCOA QStack QEventDispatcherMacPrivate::cocoaModalSessionStack; bool QEventDispatcherMacPrivate::currentExecIsNSAppRun = false; +bool QEventDispatcherMacPrivate::modalSessionsTemporarilyStopped = false; bool QEventDispatcherMacPrivate::nsAppRunCalledByQt = false; +bool QEventDispatcherMacPrivate::cleanupModalSessionsNeeded = false; NSModalSession QEventDispatcherMacPrivate::currentModalSessionCached = 0; -int QEventDispatcherMacPrivate::activeModalSessionCount() +void QEventDispatcherMacPrivate::flushCocoaEvents() { - // Returns the number of modal sessions created - // (and not just pushed onto the stack, pending to be created) - int count = 0; - for (int i=cocoaModalSessionStack.size()-1; i>=0; --i) { - QCocoaModalSessionInfo &info = cocoaModalSessionStack[i]; - if (info.session) - ++count; + while (NSEvent *event = [NSApp nextEventMatchingMask:0 + untilDate:nil + inMode:NSDefaultRunLoopMode + dequeue: YES]) { + qt_mac_send_event(0, event, 0); } - return count; } void QEventDispatcherMacPrivate::temporarilyStopAllModalSessions() { - // Stop all created modal session, and as such, make then - // pending again. The next call to currentModalSession will - // recreate the session on top again: + // Flush, and Stop, all created modal session, and as + // such, make them pending again. The next call to + // currentModalSession will recreate them again. The + // reason to stop all session like this is that otherwise + // a call [NSApp stop] would not stop NSApp, but rather + // the current modal session. So if we need to stop NSApp + // we need to stop all the modal session first. To avoid changing + // the stacking order of the windows while doing so, we put + // up a block that is used in QCocoaWindow and QCocoaPanel: + QBoolBlocker block1(blockSendPostedEvents, true); + QBoolBlocker block2(qt_blockCocoaSettingModalWindowLevel, true); + int stackSize = cocoaModalSessionStack.size(); for (int i=stackSize-1; i>=0; --i) { QCocoaModalSessionInfo &info = cocoaModalSessionStack[i]; if (info.session) { + [NSApp runModalSession:info.session]; [NSApp endModalSession:info.session]; info.session = 0; } } + modalSessionsTemporarilyStopped = true; currentModalSessionCached = 0; } @@ -775,23 +799,6 @@ NSModalSession QEventDispatcherMacPrivate::currentModalSession() if (cocoaModalSessionStack.isEmpty()) return 0; - // Since this code will end up calling our Qt event handler - // (also from beginModalSessionForWindow), we need to block - // that to avoid side effects of events beeing delivered: - QBoolBlocker block(blockSendPostedEvents, true); - - if (![NSApp isRunning]) { - // Sadly, we need to introduce this little event flush - // to stop dialogs from blinking/poping in front if a - // modal session restart was needed: - while (NSEvent *event = [NSApp nextEventMatchingMask:0 - untilDate:nil - inMode:NSDefaultRunLoopMode - dequeue: YES]) { - qt_mac_send_event(0, event, 0); - } - } - int sessionCount = cocoaModalSessionStack.size(); for (int i=0; i=0; --i) { + QCocoaModalSessionInfo &info = cocoaModalSessionStack[i]; + if (info.widget) { + currentModalSessionCached = info.session; + break; + } + cocoaModalSessionStack.remove(i); + currentModalSessionCached = 0; + if (info.session) + [NSApp endModalSession:info.session]; + } + + updateChildrenWorksWhenModal(); + cleanupModalSessionsNeeded = false; +} + void QEventDispatcherMacPrivate::beginModalSession(QWidget *widget) { // Add a new, empty (null), NSModalSession to the stack. @@ -852,7 +903,7 @@ void QEventDispatcherMacPrivate::beginModalSession(QWidget *widget) // is non-zero, and the session pointer is zero (it will become active upon a call to // currentModalSession). A QCocoaModalSessionInfo is considered pending to be stopped if // the widget pointer is zero, and the session pointer is non-zero (it will be fully - // stopped in endModalSession(). + // stopped in cleanupModalSessions()). QCocoaModalSessionInfo info = {widget, 0}; cocoaModalSessionStack.push(info); updateChildrenWorksWhenModal(); @@ -869,32 +920,16 @@ void QEventDispatcherMacPrivate::endModalSession(QWidget *widget) int stackSize = cocoaModalSessionStack.size(); for (int i=stackSize-1; i>=0; --i) { QCocoaModalSessionInfo &info = cocoaModalSessionStack[i]; - if (info.widget == widget) + if (info.widget == widget) { info.widget = 0; - } - - // Now we stop, and remove, all sessions marked as pending - // to be stopped on _top_ of the stack, if any: - bool needToInterruptEventDispatcher = false; - bool needToUpdateChildrenWorksWhenModal = false; - - for (int i=stackSize-1; i>=0; --i) { - QCocoaModalSessionInfo &info = cocoaModalSessionStack[i]; - if (info.widget) - break; - cocoaModalSessionStack.remove(i); - needToUpdateChildrenWorksWhenModal = true; - currentModalSessionCached = 0; - if (info.session) { - [NSApp endModalSession:info.session]; - needToInterruptEventDispatcher = true; + if (i == stackSize-1) { + // The top sessions ended. Interrupt the event dispatcher + // to start spinning the correct session immidiatly: + cleanupModalSessionsNeeded = true; + QEventDispatcherMac::instance()->interrupt(); + } } } - - if (needToUpdateChildrenWorksWhenModal) - updateChildrenWorksWhenModal(); - if (needToInterruptEventDispatcher) - QEventDispatcherMac::instance()->interrupt(); } #endif @@ -959,13 +994,39 @@ Boolean QEventDispatcherMacPrivate::postedEventSourceEqualCallback(const void *i inline static void processPostedEvents(QEventDispatcherMacPrivate *const d, const bool blockSendPostedEvents) { - if (blockSendPostedEvents || d->interrupt) { + if (blockSendPostedEvents) { + // We're told to not send posted events (because the event dispatcher + // is currently working on setting up the correct session to run). But + // we still need to make sure that we don't fall asleep until pending events + // are sendt, so we just signal this need, and return: CFRunLoopSourceSignal(d->postedEventsSource); - } else { - if (!d->threadData->canWait || (d->serialNumber != d->lastSerial)) { - d->lastSerial = d->serialNumber; - QApplicationPrivate::sendPostedEvents(0, 0, d->threadData); + return; + } + +#ifdef QT_MAC_USE_COCOA + if (d->cleanupModalSessionsNeeded) + d->cleanupModalSessions(); +#endif + + if (d->interrupt) { +#ifdef QT_MAC_USE_COCOA + if (d->currentExecIsNSAppRun) { + // The event dispatcher has been interrupted. But since + // [NSApplication run] is running the event loop, we + // delayed stopping it until now (to let cocoa process + // pending cocoa events first). + if (d->currentModalSessionCached) + d->temporarilyStopAllModalSessions(); + [NSApp stop:NSApp]; + d->cancelWaitForMoreEvents(); } +#endif + return; + } + + if (!d->threadData->canWait || (d->serialNumber != d->lastSerial)) { + d->lastSerial = d->serialNumber; + QApplicationPrivate::sendPostedEvents(0, 0, d->threadData); } } @@ -983,6 +1044,19 @@ void QEventDispatcherMacPrivate::postedEventsSourcePerformCallback(void *info) processPostedEvents(static_cast(info), blockSendPostedEvents); } +#ifdef QT_MAC_USE_COCOA +void QEventDispatcherMacPrivate::cancelWaitForMoreEvents() +{ + // In case the event dispatcher is waiting for more + // events somewhere, we post a dummy event to wake it up: + QMacCocoaAutoReleasePool pool; + static const short NSAppShouldStopForQt = SHRT_MAX; + [NSApp postEvent:[NSEvent otherEventWithType:NSApplicationDefined location:NSZeroPoint + modifierFlags:0 timestamp:0. windowNumber:0 context:0 + subtype:NSAppShouldStopForQt data1:0 data2:0] atStart:NO]; +} +#endif + void QEventDispatcherMac::interrupt() { Q_D(QEventDispatcherMac); @@ -992,20 +1066,14 @@ void QEventDispatcherMac::interrupt() #ifndef QT_MAC_USE_COCOA CFRunLoopStop(mainRunLoop()); #else - QMacCocoaAutoReleasePool pool; - // In case we wait for more events inside - // processEvents (or NSApp run), post a dummy to wake it up: - static const short NSAppShouldStopForQt = SHRT_MAX; - [NSApp postEvent:[NSEvent otherEventWithType:NSApplicationDefined location:NSZeroPoint - modifierFlags:0 timestamp:0. windowNumber:0 context:0 - subtype:NSAppShouldStopForQt data1:0 data2:0] atStart:NO]; - - if (d->activeModalSessionCount() == 0) { - // We should only stop NSApp if we actually started it (and - // not some 3rd party application, e.g. if we are a plugin). - if (d->nsAppRunCalledByQt) - [NSApp stop:NSApp]; - } + // We do nothing more here than setting d->interrupt = true, and + // poke the event loop if it is sleeping. Actually stopping + // NSApp, or the current modal session, is done inside the send + // posted events callback. We do this to ensure that all current pending + // cocoa events gets delivered before we stop. Otherwise, if we now stop + // the last event loop recursion, cocoa will just drop pending posted + // events on the floor before we get a chance to reestablish a new session. + d->cancelWaitForMoreEvents(); #endif } @@ -1046,17 +1114,18 @@ QEventDispatcherMac::~QEventDispatcherMac() CFRelease(d->firstTimeObserver); } -///////////////////////////////////////////////////////////////////////////// - #ifdef QT_MAC_USE_COCOA QtMacInterruptDispatcherHelp* QtMacInterruptDispatcherHelp::instance = 0; QtMacInterruptDispatcherHelp::QtMacInterruptDispatcherHelp() : cancelled(false) { - // This is the whole point of encapsulation this code - // inside a class; we can make the code (inside destructor) - // execute on lower loop level: + // The whole point of this class is that we enable a way to interrupt + // the event dispatcher when returning back to a lower recursion level + // than where interruptLater was called. This is needed to detect if + // [NSApp run] should still be running at the recursion level it is at. + // Since the interrupt is canceled if processEvents is called before + // this object gets deleted, we also avoid interrupting unnecessary. deleteLater(); } @@ -1064,34 +1133,26 @@ QtMacInterruptDispatcherHelp::~QtMacInterruptDispatcherHelp() { if (cancelled) return; - instance = 0; - - if (QEventDispatcherMacPrivate::currentExecIsNSAppRun) { - int activeCount = QEventDispatcherMacPrivate::activeModalSessionCount(); - if (activeCount > 0) { - // The problem we now have hit: [NSApp stop] will not stop NSApp - // if a session is active; it will stop the session instead. - // So to stop NSApp, we need to temporarily stop all the - // sessions, then stop NSApp, then restart the session on top again. - // We need to do this to ensure that we're not stuck inside - // [NSApp run] when we really should be running a modal session: - QEventDispatcherMacPrivate::temporarilyStopAllModalSessions(); - } - } - // Always interrupt once more in case the modal session stack changed - // while processEvents was called manually from within the application: QEventDispatcherMac::instance()->interrupt(); } -void QtMacInterruptDispatcherHelp::interruptLater() { - if (instance) { - instance->cancelled = true; - delete instance; - } +void QtMacInterruptDispatcherHelp::cancelInterruptLater() +{ + if (!instance) + return; + instance->cancelled = true; + delete instance; + instance = 0; +} + +void QtMacInterruptDispatcherHelp::interruptLater() +{ + cancelInterruptLater(); instance = new QtMacInterruptDispatcherHelp; } #endif QT_END_NAMESPACE + diff --git a/src/gui/kernel/qeventdispatcher_mac_p.h b/src/gui/kernel/qeventdispatcher_mac_p.h index dfcb91f..37ee2b1 100644 --- a/src/gui/kernel/qeventdispatcher_mac_p.h +++ b/src/gui/kernel/qeventdispatcher_mac_p.h @@ -174,13 +174,17 @@ public: static QStack cocoaModalSessionStack; static bool currentExecIsNSAppRun; static bool nsAppRunCalledByQt; + static bool cleanupModalSessionsNeeded; + static bool modalSessionsTemporarilyStopped; static NSModalSession currentModalSessionCached; - static void updateChildrenWorksWhenModal(); static NSModalSession currentModalSession(); - static int activeModalSessionCount(); + static void updateChildrenWorksWhenModal(); static void temporarilyStopAllModalSessions(); static void beginModalSession(QWidget *widget); static void endModalSession(QWidget *widget); + static void cancelWaitForMoreEvents(); + static void cleanupModalSessions(); + static void flushCocoaEvents(); #endif MacSocketHash macSockets; @@ -211,6 +215,7 @@ class QtMacInterruptDispatcherHelp : public QObject public: static void interruptLater(); + static void cancelInterruptLater(); }; #endif diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index 7bdf745..63afb0d 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -3309,13 +3309,23 @@ void QWidgetPrivate::show_sys() #else // sync the opacity value back (in case of a fade). [window setAlphaValue:q->windowOpacity()]; - [window makeKeyAndOrderFront:window]; - // If this window is app modal, we need to start spinning - // a modal session for it. Interrupting - // the event dispatcher will make this happend: - if (data.window_modality == Qt::ApplicationModal) - QEventDispatcherMac::instance()->interrupt(); + QWidget *top = 0; + if (QApplicationPrivate::tryModalHelper(q, &top)) { + [window makeKeyAndOrderFront:window]; + // If this window is app modal, we need to start spinning + // a modal session for it. Interrupting + // the event dispatcher will make this happend: + if (data.window_modality == Qt::ApplicationModal) + QEventDispatcherMac::instance()->interrupt(); + } else { + // The window is modally shaddowed, so we need to make + // sure that we don't pop in front of the modal window: + [window orderFront:window]; + if (NSWindow *modalWin = qt_mac_window_for(top)) + [modalWin orderFront:window]; + } + #endif if (q->windowType() == Qt::Popup) { if (q->focusWidget()) @@ -3334,8 +3344,6 @@ void QWidgetPrivate::show_sys() } else if (!q->testAttribute(Qt::WA_ShowWithoutActivating)) { #ifndef QT_MAC_USE_COCOA qt_event_request_activate(q); -#else - [qt_mac_window_for(q) makeKeyWindow]; #endif } } else if(topData()->embedded || !q->parentWidget() || q->parentWidget()->isVisible()) { @@ -3411,12 +3419,15 @@ void QWidgetPrivate::hide_sys() } #endif } - if(q->isActiveWindow() && !(q->windowType() == Qt::Popup)) { +#ifndef QT_MAC_USE_COCOA + // If the window we now hide was the active window, we need + // to find, and activate another window on screen. NB: Cocoa takes care of this + // logic for us (and distinquishes between main windows and key windows) + if (q->isActiveWindow() && !(q->windowType() == Qt::Popup)) { QWidget *w = 0; if(q->parentWidget()) w = q->parentWidget()->window(); if(!w || (!w->isVisible() && !w->isMinimized())) { -#ifndef QT_MAC_USE_COCOA for (WindowPtr wp = GetFrontWindowOfClass(kMovableModalWindowClass, true); wp; wp = GetNextWindowOfClass(wp, kMovableModalWindowClass, true)) { if((w = qt_mac_find_window(wp))) @@ -3436,24 +3447,12 @@ void QWidgetPrivate::hide_sys() break; } } -#else - NSArray *windows = [NSApp windows]; - NSUInteger totalWindows = [windows count]; - for (NSUInteger i = 0; i < totalWindows; ++i) { - OSWindowRef wp = [windows objectAtIndex:i]; - if ((w = qt_mac_find_window(wp))) - break; - } -#endif } if(w && w->isVisible() && !w->isMinimized()) { -#ifndef QT_MAC_USE_COCOA - qt_event_request_activate(w); -#else - [qt_mac_window_for(w) makeKeyWindow]; -#endif + qt_event_request_activate(w); } } +#endif } else { invalidateBuffer(q->rect()); #ifndef QT_MAC_USE_COCOA -- cgit v0.12 From ef5291b0fd521b7f22169ebc2297f720120296d6 Mon Sep 17 00:00:00 2001 From: miniak Date: Tue, 22 Dec 2009 14:57:46 +0100 Subject: Doc: remove obsolete Win9x stuff from the documentation Merge-request: 1627 Reviewed-by: Joerg Bornemann --- doc/src/frameworks-technologies/activeqt-server.qdoc | 7 +------ doc/src/howtos/timers.qdoc | 2 +- doc/src/internationalization/i18n.qdoc | 3 --- doc/src/platforms/platform-notes.qdoc | 8 -------- doc/src/porting/porting4.qdoc | 9 ++++----- 5 files changed, 6 insertions(+), 23 deletions(-) diff --git a/doc/src/frameworks-technologies/activeqt-server.qdoc b/doc/src/frameworks-technologies/activeqt-server.qdoc index 89456bf..ccf8c83 100644 --- a/doc/src/frameworks-technologies/activeqt-server.qdoc +++ b/doc/src/frameworks-technologies/activeqt-server.qdoc @@ -99,10 +99,6 @@ \o Register the server \endlist - Note that the QAxServer build system is not supported on Windows 98/ME - (attaching of resources to a binary is not possible there), but a server - built on Windows NT/2000/XP will work on previous Windows versions as well. - To skip the post-processing step, also set the \c qaxserver_no_postlink configuration. @@ -413,8 +409,7 @@ \footnote OLE needs to marshal user defined types by reference (ByRef), and cannot marshal them by value (ByVal). This is why const-references and object - parameters are not supported for QRect, QSize and QPoint. Also note that - servers with this datatype require Windows 98 or DCOM 1.2 to be installed. + parameters are not supported for QRect, QSize and QPoint. \endfootnote \o [in, out] struct QRect (user defined) \row diff --git a/doc/src/howtos/timers.qdoc b/doc/src/howtos/timers.qdoc index 85902be..189f1c3 100644 --- a/doc/src/howtos/timers.qdoc +++ b/doc/src/howtos/timers.qdoc @@ -72,7 +72,7 @@ The upper limit for the interval value is determined by the number of milliseconds that can be specified in a signed integer (in practice, this is a period of just over 24 days). The accuracy - depends on the underlying operating system. Windows 98 has 55 + depends on the underlying operating system. Windows 2000 has 15 millisecond accuracy; other systems that we have tested can handle 1 millisecond intervals. diff --git a/doc/src/internationalization/i18n.qdoc b/doc/src/internationalization/i18n.qdoc index ecc25fe..94717db 100644 --- a/doc/src/internationalization/i18n.qdoc +++ b/doc/src/internationalization/i18n.qdoc @@ -512,9 +512,6 @@ Note that some Windows programs do not understand big-endian Unicode text files even though that is the order prescribed by the Unicode Standard in the absence of higher-level protocols. - \o Unlike programs written with MFC or plain winlib, Qt programs - are portable between Windows 98 and Windows NT. - \e {You do not need different binaries to support Unicode.} \endlist \section2 Mac OS X diff --git a/doc/src/platforms/platform-notes.qdoc b/doc/src/platforms/platform-notes.qdoc index 85b9ff8..a1d3e9a 100644 --- a/doc/src/platforms/platform-notes.qdoc +++ b/doc/src/platforms/platform-notes.qdoc @@ -263,14 +263,6 @@ Install Qt into a subdirectory without spaces to avoid this problem. - \section2 AccelGALAXY graphic card - - When you use a NT 4.0 machine with the driver number - 4,00,1381,1000,021,4.0.0 there is a problem with drag an drop and icons. - The computer freezes, and you have to reset. The problem disappears with - the newest version of the driver, available at - \l{http://www.es.com/}{www.es.com}. - \section2 Possible GL conflict There is a known issue with running Microsoft NetMeeting, Lotus SameTime diff --git a/doc/src/porting/porting4.qdoc b/doc/src/porting/porting4.qdoc index 20fd8a6..bc49b48 100644 --- a/doc/src/porting/porting4.qdoc +++ b/doc/src/porting/porting4.qdoc @@ -3793,11 +3793,10 @@ multimedia timer API, which gives us 1 millisecond resolution for QTimer. - Note that other versions of Windows have a lower timer resolution, - and that code relying on underlying system timer restrictions - encounters no such limitations using Qt 4 (e.g., setting an - interval of 0 millisecond results in Qt occupying all of the - processor time when no GUI events need processing). + Note that Windows 2000 has a lower timer resolution, and that code relying + on underlying system timer restrictions encounters no such limitations + using Qt 4 (e.g., setting an interval of 0 millisecond results in Qt + occupying all of the processor time when no GUI events need processing). \section1 QToolBar -- cgit v0.12 From e60dbc9ca47a0e9371d619b7c5d24a4b3ec4fcd9 Mon Sep 17 00:00:00 2001 From: miniak Date: Tue, 22 Dec 2009 14:57:59 +0100 Subject: fix small leftovers from the Win9x removal in the code LoadLibraryW -> LoadLibrary RegOpenKeyExW -> RegOpenKeyEx qdesktopservices_win.cpp: buffer size fixed in launchWebBrowser() Windows NT 4.0 version condition removed Merge-request: 1627 Reviewed-by: Joerg Bornemann --- bin/syncqt | 3 --- src/corelib/io/qfsfileengine_win.cpp | 15 +++++++-------- src/gui/dialogs/qfiledialog_win.cpp | 7 +------ src/gui/text/qfontdatabase_win.cpp | 1 - src/gui/util/qdesktopservices_win.cpp | 14 +++++++------- 5 files changed, 15 insertions(+), 25 deletions(-) diff --git a/bin/syncqt b/bin/syncqt index e19018c..13e792b 100755 --- a/bin/syncqt +++ b/bin/syncqt @@ -578,9 +578,6 @@ while ( @ARGV ) { } elsif("$arg" eq "-show") { $var = "showonly"; $val = "yes"; - } elsif("$arg" eq '*') { - # workaround for windows 9x where "%*" expands to "*" - $var = 1; } #do something diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp index 10a7c54..36cf67b 100644 --- a/src/corelib/io/qfsfileengine_win.cpp +++ b/src/corelib/io/qfsfileengine_win.cpp @@ -177,7 +177,7 @@ void QFSFileEnginePrivate::resolveLibs() triedResolve = true; #if !defined(Q_OS_WINCE) - HINSTANCE advapiHnd = LoadLibraryW(L"advapi32"); + HINSTANCE advapiHnd = LoadLibrary(L"advapi32"); if (advapiHnd) { ptrGetNamedSecurityInfoW = (PtrGetNamedSecurityInfoW)GetProcAddress(advapiHnd, "GetNamedSecurityInfoW"); ptrLookupAccountSidW = (PtrLookupAccountSidW)GetProcAddress(advapiHnd, "LookupAccountSidW"); @@ -209,7 +209,7 @@ void QFSFileEnginePrivate::resolveLibs() ptrFreeSid(pWorld); } } - HINSTANCE userenvHnd = LoadLibraryW(L"userenv"); + HINSTANCE userenvHnd = LoadLibrary(L"userenv"); if (userenvHnd) ptrGetUserProfileDirectoryW = (PtrGetUserProfileDirectoryW)GetProcAddress(userenvHnd, "GetUserProfileDirectoryW"); #endif @@ -217,7 +217,6 @@ void QFSFileEnginePrivate::resolveLibs() } #endif // QT_NO_LIBRARY -// UNC functions NT typedef DWORD (WINAPI *PtrNetShareEnum)(LPWSTR, DWORD, LPBYTE*, DWORD, LPDWORD, LPDWORD, LPDWORD); static PtrNetShareEnum ptrNetShareEnum = 0; typedef DWORD (WINAPI *PtrNetApiBufferFree)(LPVOID); @@ -241,7 +240,7 @@ bool QFSFileEnginePrivate::resolveUNCLibs() #endif triedResolve = true; #if !defined(Q_OS_WINCE) - HINSTANCE hLib = LoadLibraryW(L"Netapi32"); + HINSTANCE hLib = LoadLibrary(L"netapi32"); if (hLib) { ptrNetShareEnum = (PtrNetShareEnum)GetProcAddress(hLib, "NetShareEnum"); if (ptrNetShareEnum) @@ -1038,11 +1037,11 @@ QString QFSFileEngine::homePath() if (ok) { DWORD dwBufferSize = 0; // First call, to determine size of the strings (with '\0'). - ok = ::ptrGetUserProfileDirectoryW(token, NULL, &dwBufferSize); + ok = ptrGetUserProfileDirectoryW(token, NULL, &dwBufferSize); if (!ok && dwBufferSize != 0) { // We got the required buffer size wchar_t *userDirectory = new wchar_t[dwBufferSize]; // Second call, now we can fill the allocated buffer. - ok = ::ptrGetUserProfileDirectoryW(token, userDirectory, &dwBufferSize); + ok = ptrGetUserProfileDirectoryW(token, userDirectory, &dwBufferSize); if (ok) ret = QString::fromWCharArray(userDirectory); @@ -1414,7 +1413,7 @@ QAbstractFileEngine::FileFlags QFSFileEnginePrivate::getPermissions() const QAbstractFileEngine::FileFlags ret = 0; #if !defined(QT_NO_LIBRARY) - if((qt_ntfs_permission_lookup > 0) && ((QSysInfo::WindowsVersion&QSysInfo::WV_NT_based) > QSysInfo::WV_NT)) { + if((qt_ntfs_permission_lookup > 0) && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based)) { PSID pOwner = 0; PSID pGroup = 0; PACL pDacl; @@ -1721,7 +1720,7 @@ QString QFSFileEngine::owner(FileOwner own) const { #if !defined(QT_NO_LIBRARY) Q_D(const QFSFileEngine); - if((qt_ntfs_permission_lookup > 0) && ((QSysInfo::WindowsVersion&QSysInfo::WV_NT_based) > QSysInfo::WV_NT)) { + if((qt_ntfs_permission_lookup > 0) && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based)) { PSID pOwner = 0; PSECURITY_DESCRIPTOR pSD; QString name; diff --git a/src/gui/dialogs/qfiledialog_win.cpp b/src/gui/dialogs/qfiledialog_win.cpp index c74f622..6128a8a 100644 --- a/src/gui/dialogs/qfiledialog_win.cpp +++ b/src/gui/dialogs/qfiledialog_win.cpp @@ -85,11 +85,6 @@ static const CLSID QT_CLSID_FileOpenDialog = {0xdc1c5a9c, 0xe88a, 0x4dde, {0xa5, #endif -// Don't remove the lines below! -// -// resolving the W methods manually is needed, because Windows 95 doesn't include -// these methods in Shell32.lib (not even stubs!), so you'd get an unresolved symbol -// when Qt calls getExistingDirectory(), etc. typedef LPITEMIDLIST (WINAPI *PtrSHBrowseForFolder)(BROWSEINFO*); static PtrSHBrowseForFolder ptrSHBrowseForFolder = 0; typedef BOOL (WINAPI *PtrSHGetPathFromIDList)(LPITEMIDLIST,LPWSTR); @@ -125,7 +120,7 @@ static void qt_win_resolve_libs() ptrSHGetMalloc = (PtrSHGetMalloc) lib.resolve("SHGetMalloc"); #else // CE stores them in a different lib and does not use unicode version - HINSTANCE handle = LoadLibraryW(L"Ceshell"); + HINSTANCE handle = LoadLibrary(L"Ceshell"); ptrSHBrowseForFolder = (PtrSHBrowseForFolder)GetProcAddress(handle, L"SHBrowseForFolder"); ptrSHGetPathFromIDList = (PtrSHGetPathFromIDList)GetProcAddress(handle, L"SHGetPathFromIDList"); ptrSHGetMalloc = (PtrSHGetMalloc)GetProcAddress(handle, L"SHGetMalloc"); diff --git a/src/gui/text/qfontdatabase_win.cpp b/src/gui/text/qfontdatabase_win.cpp index 6cde9ed..2fe1196 100644 --- a/src/gui/text/qfontdatabase_win.cpp +++ b/src/gui/text/qfontdatabase_win.cpp @@ -1101,7 +1101,6 @@ static void registerFont(QFontDatabasePrivate::ApplicationFont *fnt) if (AddFontResource((LPCWSTR)fnt->fileName.utf16()) == 0) return; #else - // supported from 2000 on, so no need to deal with the *A variant PtrAddFontResourceExW ptrAddFontResourceExW = (PtrAddFontResourceExW)QLibrary::resolve(QLatin1String("gdi32"), "AddFontResourceExW"); if (!ptrAddFontResourceExW diff --git a/src/gui/util/qdesktopservices_win.cpp b/src/gui/util/qdesktopservices_win.cpp index 39443f2..e4c99a8 100644 --- a/src/gui/util/qdesktopservices_win.cpp +++ b/src/gui/util/qdesktopservices_win.cpp @@ -97,19 +97,19 @@ static bool launchWebBrowser(const QUrl &url) if (url.scheme() == QLatin1String("mailto")) { //Retrieve the commandline for the default mail client //the default key used below is the command line for the mailto: shell command - DWORD bufferSize = 2 * MAX_PATH; + DWORD bufferSize = sizeof(wchar_t) * MAX_PATH; long returnValue = -1; QString command; HKEY handle; LONG res; - wchar_t keyValue[2 * MAX_PATH] = {0}; + wchar_t keyValue[MAX_PATH] = {0}; QString keyName(QLatin1String("mailto")); //Check if user has set preference, otherwise use default. - res = RegOpenKeyExW(HKEY_CURRENT_USER, - L"Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\mailto\\UserChoice", - 0, KEY_READ, &handle); + res = RegOpenKeyEx(HKEY_CURRENT_USER, + L"Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\mailto\\UserChoice", + 0, KEY_READ, &handle); if (res == ERROR_SUCCESS) { returnValue = RegQueryValueEx(handle, L"Progid", 0, 0, reinterpret_cast(keyValue), &bufferSize); if (!returnValue) @@ -121,8 +121,8 @@ static bool launchWebBrowser(const QUrl &url) if (res != ERROR_SUCCESS) return false; - bufferSize = 2 * MAX_PATH; - returnValue = RegQueryValueExW(handle, L"", 0, 0, reinterpret_cast(keyValue), &bufferSize); + bufferSize = sizeof(wchar_t) * MAX_PATH; + returnValue = RegQueryValueEx(handle, L"", 0, 0, reinterpret_cast(keyValue), &bufferSize); if (!returnValue) command = QString::fromRawData((QChar*)keyValue, bufferSize); RegCloseKey(handle); -- cgit v0.12 From c5e5998bec4aafca555543d1ef3c335f7b280294 Mon Sep 17 00:00:00 2001 From: miniak Date: Tue, 22 Dec 2009 14:58:03 +0100 Subject: remove obsolete QT_WA/QT_WA_INLINE macros Merge-request: 1627 Reviewed-by: Joerg Bornemann --- src/corelib/global/qglobal.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 1f0b80c..5851d26 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -1540,9 +1540,6 @@ inline QT3_SUPPORT bool qt_winUnicode() { return true; } inline QT3_SUPPORT int qWinVersion() { return QSysInfo::WindowsVersion; } #endif -#define QT_WA(unicode, ansi) unicode -#define QT_WA_INLINE(unicode, ansi) (unicode) - #endif /* Q_WS_WIN */ #ifndef Q_OUTOFLINE_TEMPLATE -- cgit v0.12 From 4376f8871b4422830e9ffb7f3acbc29766d8d218 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 23 Dec 2009 14:41:58 +0100 Subject: Revert "remove obsolete QT_WA/QT_WA_INLINE macros" To be on the safe side wrt source compatibilty, we'll postpone the QT_WA / QT_WA_INLINE removal for Qt 5. This reverts commit c5e5998bec4aafca555543d1ef3c335f7b280294. --- src/corelib/global/qglobal.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 5851d26..1f0b80c 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -1540,6 +1540,9 @@ inline QT3_SUPPORT bool qt_winUnicode() { return true; } inline QT3_SUPPORT int qWinVersion() { return QSysInfo::WindowsVersion; } #endif +#define QT_WA(unicode, ansi) unicode +#define QT_WA_INLINE(unicode, ansi) (unicode) + #endif /* Q_WS_WIN */ #ifndef Q_OUTOFLINE_TEMPLATE -- cgit v0.12 From e5c52134bdd24a19f2aa5c29b654ab5e6b39ec89 Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Mon, 28 Dec 2009 12:21:50 +0100 Subject: Format qOpenGLVersionFlagsFromString() according to Qt coding style. --- src/opengl/qgl.cpp | 38 ++++++++++++++++---------------------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 466e851..eb14c6c 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -1117,25 +1117,21 @@ QGLFormat::OpenGLVersionFlags Q_AUTOTEST_EXPORT qOpenGLVersionFlagsFromString(co if (parts[2].startsWith(QLatin1String("1.1"))) versionFlags |= QGLFormat::OpenGL_ES_Common_Version_1_1 | QGLFormat::OpenGL_ES_CommonLite_Version_1_1; - } - else { + } else { // Not -CM, must be CL, CommonLite versionFlags |= QGLFormat::OpenGL_ES_CommonLite_Version_1_0; if (parts[2].startsWith(QLatin1String("1.1"))) versionFlags |= QGLFormat::OpenGL_ES_CommonLite_Version_1_1; } - } - else { + } else { // OpenGL ES version 2.0 or higher versionFlags |= QGLFormat::OpenGL_ES_Version_2_0; } - } - else { + } else { // if < 3 parts to the name, it is an unrecognised OpenGL ES qWarning("Unrecognised OpenGL ES version"); } - } - else { + } else { // not ES, regular OpenGL, the version numbers are first in the string if (versionString.startsWith(QLatin1String("1."))) { switch (versionString[2].toAscii()) { @@ -1152,8 +1148,7 @@ QGLFormat::OpenGLVersionFlags Q_AUTOTEST_EXPORT qOpenGLVersionFlagsFromString(co default: break; } - } - else if (versionString.startsWith(QLatin1String("2."))) { + } else if (versionString.startsWith(QLatin1String("2."))) { versionFlags |= QGLFormat::OpenGL_Version_1_1 | QGLFormat::OpenGL_Version_1_2 | QGLFormat::OpenGL_Version_1_3 | @@ -1163,19 +1158,18 @@ QGLFormat::OpenGLVersionFlags Q_AUTOTEST_EXPORT qOpenGLVersionFlagsFromString(co QString minorVersion = versionString.section(QLatin1Char(' '), 0, 0).section(QLatin1Char('.'), 1, 1); if (minorVersion == QChar(QLatin1Char('1'))) versionFlags |= QGLFormat::OpenGL_Version_2_1; - } - else if (versionString.startsWith(QLatin1String("3."))) { - versionFlags |= QGLFormat::OpenGL_Version_1_1 | - QGLFormat::OpenGL_Version_1_2 | - QGLFormat::OpenGL_Version_1_3 | - QGLFormat::OpenGL_Version_1_4 | - QGLFormat::OpenGL_Version_1_5 | - QGLFormat::OpenGL_Version_2_0 | - QGLFormat::OpenGL_Version_2_1 | - QGLFormat::OpenGL_Version_3_0; - } - else + } else if (versionString.startsWith(QLatin1String("3."))) { + versionFlags |= QGLFormat::OpenGL_Version_1_1 | + QGLFormat::OpenGL_Version_1_2 | + QGLFormat::OpenGL_Version_1_3 | + QGLFormat::OpenGL_Version_1_4 | + QGLFormat::OpenGL_Version_1_5 | + QGLFormat::OpenGL_Version_2_0 | + QGLFormat::OpenGL_Version_2_1 | + QGLFormat::OpenGL_Version_3_0; + } else { qWarning("Unrecognised OpenGL version"); + } } return versionFlags; } -- cgit v0.12 From 592dc5978e5109c6c7c378623817938779c869a0 Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Tue, 29 Dec 2009 14:06:18 +0100 Subject: Added support for OpenGL up to version 3.2 on Windows. Task-number: QTBUG-4438, QT-2662, QT-2663 Reviewed-by: Tom --- src/opengl/qgl.cpp | 101 ++++++++++++++++++++++++++++++- src/opengl/qgl.h | 23 ++++++- src/opengl/qgl_p.h | 18 +++++- src/opengl/qgl_win.cpp | 158 +++++++++++++++++++++++++++++++++++++++++++------ 4 files changed, 275 insertions(+), 25 deletions(-) diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index eb14c6c..ffce551 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -227,6 +227,9 @@ bool qt_gl_preferGL2Engine() \value DirectRendering Specifies that the context is used for direct rendering to a display. \value HasOverlay Enables the use of an overlay. \value SampleBuffers Enables the use of sample buffers. + \value DeprecatedFunctions Enables the use of deprecated functionality for OpenGL 3.x + contexts. A context with deprecated functionality enabled is + called a full context in the OpenGL specification. \value SingleBuffer Specifies the use of a single buffer, as opposed to double buffers. \value NoDepthBuffer Disables the use of a depth buffer. \value ColorIndex Specifies that the context should use a color index as its pixel format. @@ -237,6 +240,9 @@ bool qt_gl_preferGL2Engine() \value IndirectRendering Specifies that the context is used for indirect rendering to a buffer. \value NoOverlay Disables the use of an overlay. \value NoSampleBuffers Disables the use of sample buffers. + \value NoDeprecatedFunctions Disables the use of deprecated functionality for OpenGL 3.x + contexts. A context with deprecated functionality disabled is + called a forward compatible context in the OpenGL specification. \sa {Sample Buffers Example} */ @@ -1082,6 +1088,84 @@ int QGLFormat::stencilBufferSize() const } /*! + \since 4.7 + + Set the OpenGL version. If a context compatible with the requested OpenGL version + cannot be created, a context compatible with version 1.x is created instead. + + \sa majorVersion(), minorVersion() +*/ +void QGLFormat::setVersion(int major, int minor) +{ + detach(); + d->majorVersion = major; + d->minorVersion = minor; +} + +/*! + \since 4.7 + + Returns the OpenGL major version. + + \sa setVersion(), minorVersion() +*/ +int QGLFormat::majorVersion() const +{ + return d->majorVersion; +} + +/*! + \since 4.7 + + Returns the OpenGL minor version. + + \sa setVersion(), majorVersion() +*/ +int QGLFormat::minorVersion() const +{ + return d->minorVersion; +} + +/*! + \enum QGLFormat::OpenGLContextProfile + \since 4.7 + + This enum describes the OpenGL context profiles that can be specified for contexts implementing + OpenGL version 3.2 or higher. These profiles are different from OpenGL ES profiles. + + \value NoProfile OpenGL version is lower than 3.2. + \value CoreProfile Functionality deprecated in OpenGL version 3.0 is not available. + \value CompatibilityProfile Functionality from earlier OpenGL versions is available. +*/ + +/*! + \since 4.7 + + Set the OpenGL context profile. The profile is ignored if the requested OpenGL + version is less than 3.2. + + \sa profile() +*/ +void QGLFormat::setProfile(OpenGLContextProfile profile) +{ + detach(); + d->profile = profile; +} + +/*! + \since 4.7 + + Returns the OpenGL context profile. + + \sa setProfile() +*/ +QGLFormat::OpenGLContextProfile QGLFormat::profile() const +{ + return d->profile; +} + + +/*! \fn bool QGLFormat::hasOpenGL() Returns true if the window system has any OpenGL support; @@ -1155,8 +1239,7 @@ QGLFormat::OpenGLVersionFlags Q_AUTOTEST_EXPORT qOpenGLVersionFlagsFromString(co QGLFormat::OpenGL_Version_1_4 | QGLFormat::OpenGL_Version_1_5 | QGLFormat::OpenGL_Version_2_0; - QString minorVersion = versionString.section(QLatin1Char(' '), 0, 0).section(QLatin1Char('.'), 1, 1); - if (minorVersion == QChar(QLatin1Char('1'))) + if (versionString[2].toAscii() == '1') versionFlags |= QGLFormat::OpenGL_Version_2_1; } else if (versionString.startsWith(QLatin1String("3."))) { versionFlags |= QGLFormat::OpenGL_Version_1_1 | @@ -1167,6 +1250,14 @@ QGLFormat::OpenGLVersionFlags Q_AUTOTEST_EXPORT qOpenGLVersionFlagsFromString(co QGLFormat::OpenGL_Version_2_0 | QGLFormat::OpenGL_Version_2_1 | QGLFormat::OpenGL_Version_3_0; + switch (versionString[2].toAscii()) { + case '2': + versionFlags |= QGLFormat::OpenGL_Version_3_2; + case '1': + versionFlags |= QGLFormat::OpenGL_Version_3_1; + default: + break; + } } else { qWarning("Unrecognised OpenGL version"); } @@ -1201,6 +1292,12 @@ QGLFormat::OpenGLVersionFlags Q_AUTOTEST_EXPORT qOpenGLVersionFlagsFromString(co \value OpenGL_Version_3_0 OpenGL version 3.0 or higher is present. + \value OpenGL_Version_3_1 OpenGL version 3.1 or higher is present. + Note that OpenGL version 3.1 or higher does not necessarily support all the features of + version 3.0 and lower. + + \value OpenGL_Version_3_2 OpenGL version 3.2 or higher is present. + \value OpenGL_ES_CommonLite_Version_1_0 OpenGL ES version 1.0 Common Lite or higher is present. \value OpenGL_ES_Common_Version_1_0 OpenGL ES version 1.0 Common or higher is present. diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h index 2076c46..d2fe5fb 100644 --- a/src/opengl/qgl.h +++ b/src/opengl/qgl.h @@ -144,6 +144,7 @@ namespace QGL DirectRendering = 0x0080, HasOverlay = 0x0100, SampleBuffers = 0x0200, + DeprecatedFunctions = 0x0400, SingleBuffer = DoubleBuffer << 16, NoDepthBuffer = DepthBuffer << 16, ColorIndex = Rgba << 16, @@ -153,7 +154,8 @@ namespace QGL NoStereoBuffers = StereoBuffers << 16, IndirectRendering = DirectRendering << 16, NoOverlay = HasOverlay << 16, - NoSampleBuffers = SampleBuffers << 16 + NoSampleBuffers = SampleBuffers << 16, + NoDeprecatedFunctions = DeprecatedFunctions << 16 }; Q_DECLARE_FLAGS(FormatOptions, FormatOption) } @@ -235,7 +237,20 @@ public: static bool hasOpenGL(); static bool hasOpenGLOverlays(); - enum OpenGLVersionFlag { + void setVersion(int major, int minor); + int majorVersion() const; + int minorVersion() const; + + enum OpenGLContextProfile { + NoProfile, + CoreProfile, + CompatibilityProfile + }; + + void setProfile(OpenGLContextProfile profile); + OpenGLContextProfile profile() const; + + enum OpenGLVersionFlag { OpenGL_Version_None = 0x00000000, OpenGL_Version_1_1 = 0x00000001, OpenGL_Version_1_2 = 0x00000002, @@ -249,7 +264,9 @@ public: OpenGL_ES_Common_Version_1_1 = 0x00000200, OpenGL_ES_CommonLite_Version_1_1 = 0x00000400, OpenGL_ES_Version_2_0 = 0x00000800, - OpenGL_Version_3_0 = 0x00001000 + OpenGL_Version_3_0 = 0x00001000, + OpenGL_Version_3_1 = 0x00002000, + OpenGL_Version_3_2 = 0x00004000 }; Q_DECLARE_FLAGS(OpenGLVersionFlags, OpenGLVersionFlag) diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h index 99c0f33..a075a31 100644 --- a/src/opengl/qgl_p.h +++ b/src/opengl/qgl_p.h @@ -132,11 +132,15 @@ public: QGLFormatPrivate() : ref(1) { - opts = QGL::DoubleBuffer | QGL::DepthBuffer | QGL::Rgba | QGL::DirectRendering | QGL::StencilBuffer; + opts = QGL::DoubleBuffer | QGL::DepthBuffer | QGL::Rgba | QGL::DirectRendering + | QGL::StencilBuffer | QGL::DeprecatedFunctions; pln = 0; depthSize = accumSize = stencilSize = redSize = greenSize = blueSize = alphaSize = -1; numSamples = -1; swapInterval = -1; + majorVersion = 1; + minorVersion = 0; + profile = QGLFormat::NoProfile; } QGLFormatPrivate(const QGLFormatPrivate *other) : ref(1), @@ -150,7 +154,10 @@ public: blueSize(other->blueSize), alphaSize(other->alphaSize), numSamples(other->numSamples), - swapInterval(other->swapInterval) + swapInterval(other->swapInterval), + majorVersion(other->majorVersion), + minorVersion(other->minorVersion), + profile(other->profile) { } QAtomicInt ref; @@ -165,6 +172,9 @@ public: int alphaSize; int numSamples; int swapInterval; + int majorVersion; + int minorVersion; + QGLFormat::OpenGLContextProfile profile; }; class QGLWidgetPrivate : public QWidgetPrivate @@ -277,6 +287,10 @@ public: void cleanup(); #if defined(Q_WS_WIN) + void updateFormatVersion(); +#endif + +#if defined(Q_WS_WIN) HGLRC rc; HDC dc; WId win; diff --git a/src/opengl/qgl_win.cpp b/src/opengl/qgl_win.cpp index 5b5820a..c2170e0 100644 --- a/src/opengl/qgl_win.cpp +++ b/src/opengl/qgl_win.cpp @@ -122,6 +122,30 @@ typedef bool (APIENTRY *PFNWGLCHOOSEPIXELFORMATARB)(HDC hdc, #define WGL_TYPE_COLORINDEX_ARB 0x202C #endif +#ifndef WGL_ARB_create_context +#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091 +#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092 +#define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093 +#define WGL_CONTEXT_FLAGS_ARB 0x2094 +#define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126 +#define WGL_CONTEXT_DEBUG_BIT_ARB 0x0001 +#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002 +#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x0001 +#define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x0002 +// Error codes returned by GetLastError(). +#define ERROR_INVALID_VERSION_ARB 0x2095 +#define ERROR_INVALID_PROFILE_ARB 0x2096 +#endif + +#ifndef GL_VERSION_3_2 +#define GL_CONTEXT_PROFILE_MASK 0x9126 +#define GL_MAJOR_VERSION 0x821B +#define GL_MINOR_VERSION 0x821C +#define GL_NUM_EXTENSIONS 0x821D +#define GL_CONTEXT_FLAGS 0x821E +#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001 +#endif + QT_BEGIN_NAMESPACE class QGLCmapPrivate @@ -681,8 +705,118 @@ public: WId dmy_id; }; +static bool qgl_create_context(HDC hdc, QGLContextPrivate *d, QGLContextPrivate *shareContext) +{ + d->rc = 0; + + typedef HGLRC (APIENTRYP PFNWGLCREATECONTEXTATTRIBSARB)(HDC, HGLRC, const int *); + PFNWGLCREATECONTEXTATTRIBSARB wglCreateContextAttribsARB = + (PFNWGLCREATECONTEXTATTRIBSARB) wglGetProcAddress("wglCreateContextAttribsARB"); + if (wglCreateContextAttribsARB) { + int attributes[11]; + int attribIndex = 0; + const int major = d->reqFormat.majorVersion(); + const int minor = d->reqFormat.minorVersion(); + attributes[attribIndex++] = WGL_CONTEXT_MAJOR_VERSION_ARB; + attributes[attribIndex++] = major; + attributes[attribIndex++] = WGL_CONTEXT_MINOR_VERSION_ARB; + attributes[attribIndex++] = minor; + + if (major >= 3 && !d->reqFormat.testOption(QGL::DeprecatedFunctions)) { + attributes[attribIndex++] = WGL_CONTEXT_FLAGS_ARB; + attributes[attribIndex++] = WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB; + } + + if ((major == 3 && minor >= 2) || major > 3) { + switch (d->reqFormat.profile()) { + case QGLFormat::NoProfile: + break; + case QGLFormat::CoreProfile: + attributes[attribIndex++] = WGL_CONTEXT_PROFILE_MASK_ARB; + attributes[attribIndex++] = WGL_CONTEXT_CORE_PROFILE_BIT_ARB; + break; + case QGLFormat::CompatibilityProfile: + attributes[attribIndex++] = WGL_CONTEXT_PROFILE_MASK_ARB; + attributes[attribIndex++] = WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB; + break; + default: + qWarning("QGLContext::chooseContext(): Context profile not supported."); + return false; + } + } + + if (d->reqFormat.plane() != 0) { + attributes[attribIndex++] = WGL_CONTEXT_LAYER_PLANE_ARB; + attributes[attribIndex++] = d->reqFormat.plane(); + } + + attributes[attribIndex++] = 0; // Terminate list. + d->rc = wglCreateContextAttribsARB(hdc, shareContext && shareContext->valid + ? shareContext->rc : 0, attributes); + if (d->rc) { + if (shareContext) + shareContext->sharing = d->sharing = true; + return true; + } + } + + d->rc = wglCreateLayerContext(hdc, d->reqFormat.plane()); + if (d->rc && shareContext && shareContext->valid) + shareContext->sharing = d->sharing = wglShareLists(shareContext->rc, d->rc); + return d->rc != 0; +} + +void QGLContextPrivate::updateFormatVersion() +{ + const GLubyte *s = glGetString(GL_VERSION); + + if (!(s && s[0] >= '0' && s[0] <= '9' && s[1] == '.' && s[2] >= '0' && s[2] <= '9')) { + if (!s) + qWarning("QGLContext::chooseContext(): OpenGL version string is null."); + else + qWarning("QGLContext::chooseContext(): Unexpected OpenGL version string format."); + glFormat.setVersion(0, 0); + glFormat.setProfile(QGLFormat::NoProfile); + glFormat.setOption(QGL::DeprecatedFunctions); + return; + } + + int major = s[0] - '0'; + int minor = s[2] - '0'; + glFormat.setVersion(major, minor); + + if (major < 3) { + glFormat.setProfile(QGLFormat::NoProfile); + glFormat.setOption(QGL::DeprecatedFunctions); + } else { + GLint value = 0; + if (major > 3 || minor >= 2) + glGetIntegerv(GL_CONTEXT_PROFILE_MASK, &value); + + switch (value) { + case WGL_CONTEXT_CORE_PROFILE_BIT_ARB: + glFormat.setProfile(QGLFormat::CoreProfile); + break; + case WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB: + glFormat.setProfile(QGLFormat::CompatibilityProfile); + break; + default: + glFormat.setProfile(QGLFormat::NoProfile); + break; + } + + glGetIntegerv(GL_CONTEXT_FLAGS, &value); + if (value & GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT) + glFormat.setOption(QGL::NoDeprecatedFunctions); + else + glFormat.setOption(QGL::DeprecatedFunctions); + } +} + bool QGLContext::chooseContext(const QGLContext* shareContext) { + QGLContextPrivate *share = shareContext ? const_cast(shareContext)->d_func() : 0; + Q_D(QGLContext); // workaround for matrox driver: // make a cheap call to opengl to force loading of DLL @@ -740,8 +874,7 @@ bool QGLContext::chooseContext(const QGLContext* shareContext) goto end; } - d->rc = wglCreateLayerContext(myDc, d->glFormat.plane()); - if (!d->rc) { + if (!qgl_create_context(myDc, d, share)) { qwglError("QGLContext::chooseContext()", "CreateLayerContext"); result = false; goto end; @@ -791,16 +924,7 @@ bool QGLContext::chooseContext(const QGLContext* shareContext) d->cmap = new QGLCmap(1 << lpfd.cColorBits); d->cmap->setEntry(lpfd.crTransparent, qRgb(1, 2, 3));//, QGLCmap::Reserved); } - - if (shareContext && shareContext->isValid()) { - QGLContext *share = const_cast(shareContext); - d->sharing = (wglShareLists(shareContext->d_func()->rc, d->rc) != 0); - share->d_func()->sharing = d->sharing; - } - - goto end; - } - { + } else { PIXELFORMATDESCRIPTOR pfd; PIXELFORMATDESCRIPTOR realPfd; d->pixelFormatId = choosePixelFormat(&pfd, myDc); @@ -839,17 +963,12 @@ bool QGLContext::chooseContext(const QGLContext* shareContext) goto end; } - if (!(d->rc = wglCreateLayerContext(myDc, 0))) { + if (!qgl_create_context(myDc, d, share)) { qwglError("QGLContext::chooseContext()", "wglCreateContext"); result = false; goto end; } - if (shareContext && shareContext->isValid()) { - d->sharing = (wglShareLists(shareContext->d_func()->rc, d->rc) != 0); - const_cast(shareContext)->d_func()->sharing = d->sharing; - } - if(!deviceIsPixmap()) { QRgb* pal = qgl_create_rgb_palette(&realPfd); if (pal) { @@ -864,6 +983,9 @@ bool QGLContext::chooseContext(const QGLContext* shareContext) end: // vblanking wglMakeCurrent(myDc, d->rc); + if (d->rc) + d->updateFormatVersion(); + typedef BOOL (APIENTRYP PFNWGLSWAPINTERVALEXT) (int interval); typedef int (APIENTRYP PFNWGLGETSWAPINTERVALEXT) (void); PFNWGLSWAPINTERVALEXT wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXT) wglGetProcAddress("wglSwapIntervalEXT"); -- cgit v0.12 From ec452c7f31ffe53dc28763a80d517288ac3c118d Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Wed, 23 Dec 2009 14:18:31 +0100 Subject: Cocoa: app menu does now show before doing qApp::exec() The reason is that we need to start [NSApplication run] before the menus get properly initialized. This patch will make the event dispatcher run nsapp once before spinning a modal session, if needed Task-number: QTBUG-6627 --- src/gui/kernel/qeventdispatcher_mac.mm | 40 +++++++++++++++++++++------------ src/gui/kernel/qeventdispatcher_mac_p.h | 4 ++-- 2 files changed, 28 insertions(+), 16 deletions(-) diff --git a/src/gui/kernel/qeventdispatcher_mac.mm b/src/gui/kernel/qeventdispatcher_mac.mm index 0b48dca..8d2218b 100644 --- a/src/gui/kernel/qeventdispatcher_mac.mm +++ b/src/gui/kernel/qeventdispatcher_mac.mm @@ -570,8 +570,8 @@ bool QEventDispatcherMac::processEvents(QEventLoop::ProcessEventsFlags flags) // done from the application itself. And if processEvents is called // manually (rather than from a QEventLoop), we cannot enter a tight // loop and block this call, but instead we need to return after one flush: - bool canExec_3rdParty = d->nsAppRunCalledByQt || ![NSApp isRunning]; - bool canExec_Qt = flags & QEventLoop::DialogExec || flags & QEventLoop::EventLoopExec; + const bool canExec_3rdParty = d->nsAppRunCalledByQt || ![NSApp isRunning]; + const bool canExec_Qt = flags & QEventLoop::DialogExec || flags & QEventLoop::EventLoopExec; if (canExec_Qt && canExec_3rdParty) { // We can use exec-mode, meaning that we can stay in a tight loop until @@ -596,9 +596,10 @@ bool QEventDispatcherMac::processEvents(QEventLoop::ProcessEventsFlags flags) } retVal = true; } else { + // We cannot block the thread (and run in a tight loop). + // Instead we will process all current pending events and return. + d->ensureNSAppInitialized(); do { - // We cannot block the thread (and run in a tight loop). - // Instead we will process all current pending events and return. bool releaseEvent = false; if (!(flags & QEventLoop::ExcludeUserInputEvents) @@ -746,20 +747,31 @@ bool QEventDispatcherMacPrivate::blockSendPostedEvents = false; #ifdef QT_MAC_USE_COCOA QStack QEventDispatcherMacPrivate::cocoaModalSessionStack; +bool QEventDispatcherMacPrivate::interrupt = false; bool QEventDispatcherMacPrivate::currentExecIsNSAppRun = false; bool QEventDispatcherMacPrivate::modalSessionsTemporarilyStopped = false; bool QEventDispatcherMacPrivate::nsAppRunCalledByQt = false; bool QEventDispatcherMacPrivate::cleanupModalSessionsNeeded = false; NSModalSession QEventDispatcherMacPrivate::currentModalSessionCached = 0; -void QEventDispatcherMacPrivate::flushCocoaEvents() +void QEventDispatcherMacPrivate::ensureNSAppInitialized() { - while (NSEvent *event = [NSApp nextEventMatchingMask:0 - untilDate:nil - inMode:NSDefaultRunLoopMode - dequeue: YES]) { - qt_mac_send_event(0, event, 0); - } + // Some elements in Cocoa require NSApplication to be running before + // they get fully initialized, in particular the menu bar. This + // function is intended for cases where a dialog is told to execute before + // QApplication::exec is called, or the application spins the events loop + // manually rather than calling QApplication:exec. + // The function makes sure that NSApplication starts running, but stops + // it again as soon as the send posted events callback is called. That way + // we let Cocoa finish the initialization it seems to need. We'll only + // apply this trick at most once for any application, and we avoid doing it + // for the common case where main just starts QApplication::exec. + if (nsAppRunCalledByQt || [NSApp isRunning]) + return; + nsAppRunCalledByQt = true; + QBoolBlocker block1(interrupt, true); + QBoolBlocker block2(currentExecIsNSAppRun, true); + [NSApp run]; } void QEventDispatcherMacPrivate::temporarilyStopAllModalSessions() @@ -811,6 +823,8 @@ NSModalSession QEventDispatcherMacPrivate::currentModalSession() NSWindow *window = qt_mac_window_for(info.widget); if (!window) continue; + + ensureNSAppInitialized(); QBoolBlocker block1(blockSendPostedEvents, true); info.session = [NSApp beginModalSessionForWindow:window]; } @@ -826,12 +840,11 @@ NSModalSession QEventDispatcherMacPrivate::currentModalSession() // screen. To work around this, we block cocoa from changing the // stacking order of the windows, and flush out the pending events // (the block is used in QCocoaWindow and QCocoaPanel): - modalSessionsTemporarilyStopped = false; QBoolBlocker block1(blockSendPostedEvents, true); QBoolBlocker block2(qt_blockCocoaSettingModalWindowLevel, true); [NSApp runModalSession:currentModalSessionCached]; } - + modalSessionsTemporarilyStopped = false; return currentModalSessionCached; } @@ -935,7 +948,6 @@ void QEventDispatcherMacPrivate::endModalSession(QWidget *widget) #endif QEventDispatcherMacPrivate::QEventDispatcherMacPrivate() - : interrupt(false) { } diff --git a/src/gui/kernel/qeventdispatcher_mac_p.h b/src/gui/kernel/qeventdispatcher_mac_p.h index 37ee2b1..205f564 100644 --- a/src/gui/kernel/qeventdispatcher_mac_p.h +++ b/src/gui/kernel/qeventdispatcher_mac_p.h @@ -184,7 +184,7 @@ public: static void endModalSession(QWidget *widget); static void cancelWaitForMoreEvents(); static void cleanupModalSessions(); - static void flushCocoaEvents(); + static void ensureNSAppInitialized(); #endif MacSocketHash macSockets; @@ -194,7 +194,7 @@ public: CFRunLoopObserverRef firstTimeObserver; QAtomicInt serialNumber; int lastSerial; - bool interrupt; + static bool interrupt; private: static Boolean postedEventSourceEqualCallback(const void *info1, const void *info2); static void postedEventsSourcePerformCallback(void *info); -- cgit v0.12 From 5356d3717a9355830a13dfa0c8726f86a5f1c522 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Mon, 4 Jan 2010 10:01:27 +0100 Subject: Carbon: compile fix Oops. Broke build on carbon. --- src/gui/kernel/qeventdispatcher_mac.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/kernel/qeventdispatcher_mac.mm b/src/gui/kernel/qeventdispatcher_mac.mm index 8d2218b..ab1e2a1 100644 --- a/src/gui/kernel/qeventdispatcher_mac.mm +++ b/src/gui/kernel/qeventdispatcher_mac.mm @@ -744,10 +744,10 @@ void QEventDispatcherMac::flush() *****************************************************************************/ MacTimerHash QEventDispatcherMacPrivate::macTimerHash; bool QEventDispatcherMacPrivate::blockSendPostedEvents = false; +bool QEventDispatcherMacPrivate::interrupt = false; #ifdef QT_MAC_USE_COCOA QStack QEventDispatcherMacPrivate::cocoaModalSessionStack; -bool QEventDispatcherMacPrivate::interrupt = false; bool QEventDispatcherMacPrivate::currentExecIsNSAppRun = false; bool QEventDispatcherMacPrivate::modalSessionsTemporarilyStopped = false; bool QEventDispatcherMacPrivate::nsAppRunCalledByQt = false; -- cgit v0.12 From 81d06f72cb84485847f963ba1dfea662e51096e4 Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Mon, 4 Jan 2010 10:44:03 +0100 Subject: Fixed QGLFormat::operator== to handle new fields. When I added new fields to QGLFormat in commit 592dc597, I forgot to update operator==. It has now been fixed and the auto-test updated. Reviewed-by: Trond --- src/opengl/qgl.cpp | 16 +++++++++++++--- tests/auto/qgl/tst_qgl.cpp | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 3 deletions(-) diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index ffce551..9d4b488 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -1097,6 +1097,10 @@ int QGLFormat::stencilBufferSize() const */ void QGLFormat::setVersion(int major, int minor) { + if (major < 1 || minor < 0) { + qWarning("QGLFormat::setVersion: Cannot set zero or negative version number %d.%d", major, minor); + return; + } detach(); d->majorVersion = major; d->minorVersion = minor; @@ -1470,14 +1474,20 @@ void QGLFormat::setDefaultOverlayFormat(const QGLFormat &f) bool operator==(const QGLFormat& a, const QGLFormat& b) { - return (int) a.d->opts == (int) b.d->opts && a.d->pln == b.d->pln && a.d->alphaSize == b.d->alphaSize - && a.d->accumSize == b.d->accumSize && a.d->stencilSize == b.d->stencilSize + return (a.d == b.d) || ((int) a.d->opts == (int) b.d->opts + && a.d->pln == b.d->pln + && a.d->alphaSize == b.d->alphaSize + && a.d->accumSize == b.d->accumSize + && a.d->stencilSize == b.d->stencilSize && a.d->depthSize == b.d->depthSize && a.d->redSize == b.d->redSize && a.d->greenSize == b.d->greenSize && a.d->blueSize == b.d->blueSize && a.d->numSamples == b.d->numSamples - && a.d->swapInterval == b.d->swapInterval; + && a.d->swapInterval == b.d->swapInterval + && a.d->majorVersion == b.d->majorVersion + && a.d->minorVersion == b.d->minorVersion + && a.d->profile == b.d->profile); } diff --git a/tests/auto/qgl/tst_qgl.cpp b/tests/auto/qgl/tst_qgl.cpp index 532e550..7cda35d 100644 --- a/tests/auto/qgl/tst_qgl.cpp +++ b/tests/auto/qgl/tst_qgl.cpp @@ -425,6 +425,26 @@ void tst_QGL::getSetCheck() obj1.setPlane(TEST_INT_MAX); QCOMPARE(TEST_INT_MAX, obj1.plane()); + // int QGLFormat::major/minorVersion() + // void QGLFormat::setVersion(int, int) + QCOMPARE(obj1.majorVersion(), 1); + QCOMPARE(obj1.minorVersion(), 0); + obj1.setVersion(3, 2); + QCOMPARE(obj1.majorVersion(), 3); + QCOMPARE(obj1.minorVersion(), 2); + QTest::ignoreMessage(QtWarningMsg, "QGLFormat::setVersion: Cannot set zero or negative version number 0.1"); + obj1.setVersion(0, 1); + QCOMPARE(obj1.majorVersion(), 3); + QCOMPARE(obj1.minorVersion(), 2); + QTest::ignoreMessage(QtWarningMsg, "QGLFormat::setVersion: Cannot set zero or negative version number 3.-1"); + obj1.setVersion(3, -1); + QCOMPARE(obj1.majorVersion(), 3); + QCOMPARE(obj1.minorVersion(), 2); + obj1.setVersion(TEST_INT_MAX, TEST_INT_MAX - 1); + QCOMPARE(obj1.majorVersion(), TEST_INT_MAX); + QCOMPARE(obj1.minorVersion(), TEST_INT_MAX - 1); + + // operator== and operator!= for QGLFormat QGLFormat format1; QGLFormat format2; @@ -508,6 +528,27 @@ void tst_QGL::getSetCheck() QVERIFY(format1 == format2); QVERIFY(!(format1 != format2)); + format1.setVersion(3, 2); + QVERIFY(!(format1 == format2)); + QVERIFY(format1 != format2); + format2.setVersion(3, 2); + QVERIFY(format1 == format2); + QVERIFY(!(format1 != format2)); + + format1.setProfile(QGLFormat::CoreProfile); + QVERIFY(!(format1 == format2)); + QVERIFY(format1 != format2); + format2.setProfile(QGLFormat::CoreProfile); + QVERIFY(format1 == format2); + QVERIFY(!(format1 != format2)); + + format1.setOption(QGL::NoDeprecatedFunctions); + QVERIFY(!(format1 == format2)); + QVERIFY(format1 != format2); + format2.setOption(QGL::NoDeprecatedFunctions); + QVERIFY(format1 == format2); + QVERIFY(!(format1 != format2)); + // Copy constructor and assignment for QGLFormat. QGLFormat format3(format1); QGLFormat format4; -- cgit v0.12 From 2176a58c5312e2f994d5e345708a3b37e333d668 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Mon, 4 Jan 2010 15:45:49 +0100 Subject: Cocoa: exec() on a dialog with Qt::Tool windowflag is just a dialog. This is because a modal flag on the window wins over the type when determining window class. This fix will respect the type first, before looking at the window flag. Task-number: QTBUG-1455 Reviewed-by: Prasanth --- src/gui/kernel/qwidget_mac.mm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index 3925905..35e7505 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -1888,13 +1888,15 @@ void QWidgetPrivate::determineWindowClass() wclass = kDocumentWindowClass; else if(popup || (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5 && type == Qt::SplashScreen)) wclass = kModalWindowClass; - else if(q->testAttribute(Qt::WA_ShowModal) || type == Qt::Dialog) + else if(type == Qt::Dialog) wclass = kMovableModalWindowClass; else if(type == Qt::ToolTip) wclass = kHelpWindowClass; else if(type == Qt::Tool || (QSysInfo::MacintoshVersion < QSysInfo::MV_10_5 && type == Qt::SplashScreen)) wclass = kFloatingWindowClass; + else if(q->testAttribute(Qt::WA_ShowModal)) + wclass = kMovableModalWindowClass; else wclass = kDocumentWindowClass; @@ -1998,8 +2000,6 @@ void QWidgetPrivate::determineWindowClass() for(int i = 0; tmp_wattr && known_attribs[i].name; i++) { if((tmp_wattr & known_attribs[i].tag) == known_attribs[i].tag) { tmp_wattr ^= known_attribs[i].tag; - qDebug("Qt: internal: * %s %s", known_attribs[i].name, - (GetAvailableWindowAttributes(wclass) & known_attribs[i].tag) ? "" : "(*)"); } } if(tmp_wattr) -- cgit v0.12 From b1b8ff495f7a33769b2aea9091622e3fa1e3344c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Tue, 5 Jan 2010 08:15:03 +0100 Subject: Don't use QPointer in objectve-c interfaces. (Constructors and destructors are not called.) --- src/gui/widgets/qcocoamenu_mac_p.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/widgets/qcocoamenu_mac_p.h b/src/gui/widgets/qcocoamenu_mac_p.h index 3ad0ab8..57b4e17 100644 --- a/src/gui/widgets/qcocoamenu_mac_p.h +++ b/src/gui/widgets/qcocoamenu_mac_p.h @@ -52,10 +52,10 @@ #include "qmacdefines_mac.h" #ifdef QT_MAC_USE_COCOA -#include #import QT_FORWARD_DECLARE_CLASS(QMenu) +QT_FORWARD_DECLARE_CLASS(QAction) #if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_5 @@ -72,7 +72,7 @@ QT_FORWARD_DECLARE_CLASS(QMenu) @interface QT_MANGLE_NAMESPACE(QCocoaMenu) : NSMenu { QMenu *qmenu; - QPointer previousAction; + QAction *previousAction; } - (id)initWithQMenu:(QMenu*)menu; - (BOOL)menuHasKeyEquivalent:(NSMenu *)menu forEvent:(NSEvent *)event target:(id *)target action:(SEL *)action; -- cgit v0.12 From 3d16f0d69c083e78cda0f036ceaca6031ef85b12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Tue, 5 Jan 2010 14:01:02 +0100 Subject: Remove obsolete XShape configure warning. Task:QTBUG-2158 Designer no longer uses XShape for Drag and Drop. --- configure | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/configure b/configure index 22e6bd4..d921f70 100755 --- a/configure +++ b/configure @@ -7827,10 +7827,7 @@ if [ "$PLATFORM_X11" = "yes" ] && [ "$CFG_XSHAPE" = "no" ]; then cat < Date: Tue, 5 Jan 2010 14:04:31 +0100 Subject: Remove the entire warning, is seems it was only there for Designer. --- configure | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/configure b/configure index d921f70..7b4f832 100755 --- a/configure +++ b/configure @@ -7821,17 +7821,6 @@ done rm -f .projects .projects.3 #------------------------------------------------------------------------------- -# XShape is important, DnD in the Designer doens't work without it -#------------------------------------------------------------------------------- -if [ "$PLATFORM_X11" = "yes" ] && [ "$CFG_XSHAPE" = "no" ]; then - cat < Date: Tue, 5 Jan 2010 16:46:15 +0100 Subject: Fixed the host detection in qmake profiles. The previous tests were checking the target platform, but we need to check the host. RevBy: Trust me --- mkspecs/common/symbian/symbian.conf | 4 ++-- mkspecs/features/symbian/application_icon.prf | 2 +- projects.pro | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mkspecs/common/symbian/symbian.conf b/mkspecs/common/symbian/symbian.conf index 40f8424..95f7dc3 100644 --- a/mkspecs/common/symbian/symbian.conf +++ b/mkspecs/common/symbian/symbian.conf @@ -74,7 +74,7 @@ QMAKE_LIBS_COMPAT = QMAKE_LIBS_QT_ENTRY = -llibcrt0.lib QMAKE_LIBS_S60 = -lavkon -win32:!isEmpty(QMAKE_SH) | unix { +contains(QMAKE_HOST.os, "Windows"):!isEmpty(QMAKE_SH) | unix { QMAKE_COPY = cp QMAKE_COPY_DIR = cp -r QMAKE_MOVE = mv @@ -92,7 +92,7 @@ win32:!isEmpty(QMAKE_SH) | unix { QMAKE_CHK_DIR_EXISTS = if not exist } -win32 { +contains(QMAKE_HOST.os, "Windows") { QMAKE_MOC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}moc.exe QMAKE_UIC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}uic.exe QMAKE_IDC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}idc.exe diff --git a/mkspecs/features/symbian/application_icon.prf b/mkspecs/features/symbian/application_icon.prf index 8849ea0..b790463 100644 --- a/mkspecs/features/symbian/application_icon.prf +++ b/mkspecs/features/symbian/application_icon.prf @@ -30,7 +30,7 @@ contains( CONFIG, no_icon ) { # Note: symbian-sbsv2 builds can't utilize extra compiler for mifconv, so ICON handling is done in code symbian-abld { #Makefile: requires paths with backslash - win32:ICON = $$replace(ICON, /, \\) + contains(QMAKE_HOST.os, "Windows"):ICON = $$replace(ICON, /, \\) # Extra compiler rules for mifconv mifconv.output = ${ZDIR}$$APP_RESOURCE_DIR/$${baseTarget}.mif diff --git a/projects.pro b/projects.pro index 11cbd03..19a5ff8 100644 --- a/projects.pro +++ b/projects.pro @@ -112,7 +112,7 @@ win32 { } symbian { confclean.depends += distclean - win32 { + contains(QMAKE_HOST.os, "Windows") { confclean.commands += \ (cd src\tools\moc && $(MAKE) distclean) $$escape_expand(\n\t) \ (cd src\tools\rcc && $(MAKE) distclean) $$escape_expand(\n\t) \ -- cgit v0.12 From d149a3faca9b97ce806249bc7ef73fe2f59589d5 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 6 Jan 2010 10:48:25 +0100 Subject: Don't call invalidate when resetting the QSortFilterProxyModel. The invalidate connection is made before connecting the source model, which means it gets called first. If a second proxy model is used with it, the sourceLayoutAboutToBeChanged of the second proxy is therefore called before its sourceReset slot, but after the persistent indexes of the first model have been invalidated. The invalidate call is not needed because clear_mappings is called when the source model is reset anyway. Merge-request: 416 Reviewed-by: Olivier Goffart --- src/gui/itemviews/qsortfilterproxymodel.cpp | 1 - tests/auto/modeltest/dynamictreemodel.cpp | 3 ++- tests/auto/modeltest/tst_modeltest.cpp | 30 +++++++++++++++++++++++++++-- 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/src/gui/itemviews/qsortfilterproxymodel.cpp b/src/gui/itemviews/qsortfilterproxymodel.cpp index 646a3a1..0e4af53 100644 --- a/src/gui/itemviews/qsortfilterproxymodel.cpp +++ b/src/gui/itemviews/qsortfilterproxymodel.cpp @@ -1481,7 +1481,6 @@ QSortFilterProxyModel::QSortFilterProxyModel(QObject *parent) d->filter_column = 0; d->filter_role = Qt::DisplayRole; d->dynamic_sortfilter = false; - connect(this, SIGNAL(modelReset()), this, SLOT(invalidate())); } /*! diff --git a/tests/auto/modeltest/dynamictreemodel.cpp b/tests/auto/modeltest/dynamictreemodel.cpp index 24d3ab3..b572eb1 100644 --- a/tests/auto/modeltest/dynamictreemodel.cpp +++ b/tests/auto/modeltest/dynamictreemodel.cpp @@ -160,10 +160,11 @@ QVariant DynamicTreeModel::data(const QModelIndex &index, int role) const void DynamicTreeModel::clear() { + beginResetModel(); m_items.clear(); m_childItems.clear(); nextId = 1; - reset(); + endResetModel(); } diff --git a/tests/auto/modeltest/tst_modeltest.cpp b/tests/auto/modeltest/tst_modeltest.cpp index 262b966..8beeb38 100644 --- a/tests/auto/modeltest/tst_modeltest.cpp +++ b/tests/auto/modeltest/tst_modeltest.cpp @@ -67,6 +67,7 @@ private slots: void standardItemModel(); void testInsertThroughProxy(); void moveSourceItems(); + void testResetThroughProxy(); }; @@ -225,8 +226,9 @@ public slots: void storePersistent() { - m_persistentSourceIndexes.clear(); - m_persistentProxyIndexes.clear(); + foreach(const QModelIndex &idx, m_persistentProxyIndexes) + Q_ASSERT(idx.isValid()); // This is called from layoutAboutToBeChanged. Persistent indexes should be valid + Q_ASSERT(m_proxy->persistent().isEmpty()); storePersistent(QModelIndex()); Q_ASSERT(!m_proxy->persistent().isEmpty()); @@ -243,6 +245,8 @@ public slots: QModelIndex updatedSource = m_persistentSourceIndexes.at(row); QCOMPARE(m_proxy->mapToSource(updatedProxy), updatedSource); } + m_persistentSourceIndexes.clear(); + m_persistentProxyIndexes.clear(); } private: @@ -278,6 +282,28 @@ void tst_ModelTest::moveSourceItems() moveCommand->doCommand(); } +void tst_ModelTest::testResetThroughProxy() +{ + DynamicTreeModel *model = new DynamicTreeModel(this); + + ModelInsertCommand *insertCommand = new ModelInsertCommand(model, this); + insertCommand->setStartRow(0); + insertCommand->setEndRow(2); + insertCommand->doCommand(); + + QPersistentModelIndex persistent = model->index(0, 0); + + AccessibleProxyModel *proxy = new AccessibleProxyModel(this); + proxy->setSourceModel(model); + + ObservingObject observer(proxy); + observer.storePersistent(); + + ModelResetCommand *resetCommand = new ModelResetCommand(model, this); + resetCommand->setNumCols(0); + resetCommand->doCommand(); +} + QTEST_MAIN(tst_ModelTest) #include "tst_modeltest.moc" -- cgit v0.12 From 7e77574fbedf0227efd33b0fab1028b7129ef908 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 6 Jan 2010 11:40:42 +0100 Subject: GCC doesn't like comment lines ending in \ src/opengl/gl2paintengineex/qtriangulator.cpp:655:5: warning: multi-line comment So add some padding characters to the right (can't just add spaces though). Reviewed-by: TrustMe --- src/opengl/gl2paintengineex/qtriangulator.cpp | 56 +++++++++++++-------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/src/opengl/gl2paintengineex/qtriangulator.cpp b/src/opengl/gl2paintengineex/qtriangulator.cpp index 6a1112b..d8e72f3 100644 --- a/src/opengl/gl2paintengineex/qtriangulator.cpp +++ b/src/opengl/gl2paintengineex/qtriangulator.cpp @@ -650,53 +650,53 @@ inline void QRBTree::clear() template void QRBTree::rotateLeft(Node *node) { - // | | - // N B - // / \ / \ - // A B ---> N D - // / \ / \ - // C D A C + // | | // + // N B // + // / \ / \ // + // A B ---> N D // + // / \ / \ // + // C D A C // Node *&ref = (node->parent ? (node == node->parent->left ? node->parent->left : node->parent->right) : root); ref = node->right; node->right->parent = node->parent; - // : - // N - // / :| - // A B - // / \ - // C D + // : // + // N // + // / :| // + // A B // + // / \ // + // C D // node->right = ref->left; if (ref->left) ref->left->parent = node; - // : | - // N B - // / \ : \ - // A C D + // : | // + // N B // + // / \ : \ // + // A C D // ref->left = node; node->parent = ref; - // | - // B - // / \ - // N D - // / \ - // A C + // | // + // B // + // / \ // + // N D // + // / \ // + // A C // } template void QRBTree::rotateRight(Node *node) { - // | | - // N A - // / \ / \ - // A B ---> C N - // / \ / \ - // C D D B + // | | // + // N A // + // / \ / \ // + // A B ---> C N // + // / \ / \ // + // C D D B // Node *&ref = (node->parent ? (node == node->parent->left ? node->parent->left : node->parent->right) : root); ref = node->left; -- cgit v0.12 From 7fc53c195b3a830ff6db68bb9c4294f444e5519e Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 6 Jan 2010 11:42:07 +0100 Subject: Change from std::pair to QPair. My Qt is built with -no-stl, so the STL headers aren't included and, thus, std::pair isn't defined. Reviewed-by: Trust Me --- src/opengl/gl2paintengineex/qtriangulator.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/opengl/gl2paintengineex/qtriangulator.cpp b/src/opengl/gl2paintengineex/qtriangulator.cpp index d8e72f3..b60e10d 100644 --- a/src/opengl/gl2paintengineex/qtriangulator.cpp +++ b/src/opengl/gl2paintengineex/qtriangulator.cpp @@ -2707,7 +2707,7 @@ void QTriangulator::SimpleToMonotone::monotoneDecomposition() return; Q_ASSERT(!m_edgeList.root); - QDataBuffer > diagonals; + QDataBuffer > diagonals; int i = 0; for (int index = 1; index < m_edges.size(); ++index) { @@ -2743,7 +2743,7 @@ void QTriangulator::SimpleToMonotone::monotoneDecomposition() if (m_edges.at(i).node) { Q_ASSERT(!m_edges.at(j).node); if (m_edges.at(m_edges.at(i).helper).type == MergeVertex) - diagonals.add(std::pair(i, m_edges.at(i).helper)); + diagonals.add(QPair(i, m_edges.at(i).helper)); m_edges.at(j).node = m_edges.at(i).node; m_edges.at(i).node = 0; m_edges.at(j).node->data = j; @@ -2751,7 +2751,7 @@ void QTriangulator::SimpleToMonotone::monotoneDecomposition() } else if (m_edges.at(j).node) { Q_ASSERT(!m_edges.at(i).node); if (m_edges.at(m_edges.at(j).helper).type == MergeVertex) - diagonals.add(std::pair(i, m_edges.at(j).helper)); + diagonals.add(QPair(i, m_edges.at(j).helper)); m_edges.at(i).node = m_edges.at(j).node; m_edges.at(j).node = 0; m_edges.at(i).node->data = i; @@ -2763,7 +2763,7 @@ void QTriangulator::SimpleToMonotone::monotoneDecomposition() leftEdgeNode = searchEdgeLeftOfPoint(m_edges.at(i).from); if (leftEdgeNode) { if (m_edges.at(m_edges.at(leftEdgeNode->data).helper).type == MergeVertex) - diagonals.add(std::pair(i, m_edges.at(leftEdgeNode->data).helper)); + diagonals.add(QPair(i, m_edges.at(leftEdgeNode->data).helper)); m_edges.at(leftEdgeNode->data).helper = i; } else { qWarning("Inconsistent polygon. (#2)"); @@ -2773,7 +2773,7 @@ void QTriangulator::SimpleToMonotone::monotoneDecomposition() case SplitVertex: leftEdgeNode = searchEdgeLeftOfPoint(m_edges.at(i).from); if (leftEdgeNode) { - diagonals.add(std::pair(i, m_edges.at(leftEdgeNode->data).helper)); + diagonals.add(QPair(i, m_edges.at(leftEdgeNode->data).helper)); m_edges.at(leftEdgeNode->data).helper = i; } else { qWarning("Inconsistent polygon. (#3)"); @@ -2802,7 +2802,7 @@ void QTriangulator::SimpleToMonotone::monotoneDecomposition() leftEdgeNode = searchEdgeLeftOfPoint(m_edges.at(i).from); if (leftEdgeNode) { if (m_edges.at(m_edges.at(leftEdgeNode->data).helper).type == MergeVertex) - diagonals.add(std::pair(i, m_edges.at(leftEdgeNode->data).helper)); + diagonals.add(QPair(i, m_edges.at(leftEdgeNode->data).helper)); m_edges.at(leftEdgeNode->data).helper = i; } else { qWarning("Inconsistent polygon. (#4)"); @@ -2811,7 +2811,7 @@ void QTriangulator::SimpleToMonotone::monotoneDecomposition() case EndVertex: if (m_clockwiseOrder) { if (m_edges.at(m_edges.at(i).helper).type == MergeVertex) - diagonals.add(std::pair(i, m_edges.at(i).helper)); + diagonals.add(QPair(i, m_edges.at(i).helper)); if (m_edges.at(i).node) { m_edgeList.deleteNode(m_edges.at(i).node); Q_ASSERT(m_edgeList.verify()); @@ -2820,7 +2820,7 @@ void QTriangulator::SimpleToMonotone::monotoneDecomposition() } } else { if (m_edges.at(m_edges.at(j).helper).type == MergeVertex) - diagonals.add(std::pair(i, m_edges.at(j).helper)); + diagonals.add(QPair(i, m_edges.at(j).helper)); if (m_edges.at(j).node) { m_edgeList.deleteNode(m_edges.at(j).node); Q_ASSERT(m_edgeList.verify()); -- cgit v0.12 From e2baf96da8881ed7c585e59e84efe39bbbd3d0d4 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 6 Jan 2010 11:45:13 +0100 Subject: Fix compilation breakage caused by merge. This function was renamed in b06313579aad82f8dda64ad14384080754f2b222. Reviewed-by: TrustMe --- src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index e679db8..98be0cb 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -1014,7 +1014,7 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path) } } else { cache = new QGL2PEVectorPathCache; - data = const_cast(path).addCacheData(q, cache, qopengl2paintengine_cleanup_vectorpath); + data = const_cast(path).addCacheData(q, cache, cleanupVectorPath); updateCache = true; } -- cgit v0.12 From e7274672bfddc6896dc7edbf57b555189e06ed55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Wed, 6 Jan 2010 12:29:32 +0100 Subject: Make Qt use Cocoa by default on Mac OS X The "-cococa" option is now deprecated, "-carbon" is added. This is mostly a behind-the-scenes change, but has some implications: If you are developing on Snow Leopard Qt vill be built in x86_64 mode by default. This can be overridden by configuring with "-arch x86" Qt for Cocoa will not build on 10.4 Tiger, nor will Cocoa-based binaries deploy back to that platform. Configure with "-carbon" if you want to target 10.4. --- configure | 75 ++++++++++++++++++++++++++++++++------------------------------- 1 file changed, 38 insertions(+), 37 deletions(-) diff --git a/configure b/configure index 7b4f832..7744d51 100755 --- a/configure +++ b/configure @@ -759,9 +759,9 @@ CFG_MAC_ARCHS= MAC_CONFIG_TEST_COMMANDLINE= # used to make the configure tests run with the correct arch's and SDK settings CFG_MAC_DWARF2=auto CFG_MAC_XARCH=auto -CFG_MAC_CARBON=yes -CFG_MAC_COCOA=auto -COMMANDLINE_MAC_COCOA=no +CFG_MAC_CARBON=no +CFG_MAC_COCOA=yes +COMMANDLINE_MAC_CARBON=no CFG_SXE=no CFG_PREFIX_INSTALL=yes CFG_SDK= @@ -921,7 +921,7 @@ while [ "$#" -gt 0 ]; do VAL=no ;; #Qt style yes options - -incremental|-qvfb|-profile|-shared|-static|-sm|-xinerama|-xshape|-xsync|-xinput|-reduce-exports|-pch|-separate-debug-info|-stl|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-nis|-qdbus|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-qt3support|-debug-and-release|-exceptions|-cocoa|-universal|-prefix-install|-silent|-armfpa|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-ptmalloc|-xmlpatterns|-phonon|-phonon-backend|-multimedia|-audio-backend|-svg|-declarative|-webkit|-javascript-jit|-script|-scripttools|-rpath|-force-pkg-config) + -incremental|-qvfb|-profile|-shared|-static|-sm|-xinerama|-xshape|-xsync|-xinput|-reduce-exports|-pch|-separate-debug-info|-stl|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-nis|-qdbus|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-qt3support|-debug-and-release|-exceptions|-cocoa|-carbon|-universal|-prefix-install|-silent|-armfpa|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-ptmalloc|-xmlpatterns|-phonon|-phonon-backend|-multimedia|-audio-backend|-svg|-declarative|-webkit|-javascript-jit|-script|-scripttools|-rpath|-force-pkg-config) VAR=`echo $1 | sed "s,^-\(.*\),\1,"` VAL=yes ;; @@ -1321,13 +1321,17 @@ while [ "$#" -gt 0 ]; do fi ;; cocoa) +# do nothing - Cocoa is the default. + ;; + carbon) if [ "$PLATFORM_MAC" = "yes" ] && [ "$VAL" = "yes" ]; then - CFG_MAC_COCOA="$VAL" - COMMANDLINE_MAC_COCOA="$VAL" + CFG_MAC_CARBON="$VAL" + COMMANDLINE_MAC_CARBON="$VAL" else UNKNOWN_OPT=yes fi ;; + framework) if [ "$PLATFORM_MAC" = "yes" ]; then CFG_FRAMEWORK="$VAL" @@ -3784,10 +3788,11 @@ Qt/Mac only: -Fstring ........... Add an explicit framework path. -fw string ......... Add an explicit framework. - -cocoa ............. Build the Cocoa version of Qt. Note that -no-framework - and -static is not supported with -cocoa. Specifying - this option creates Qt binaries that requires Mac OS X - 10.5 or higher. + -cocoa ............. [Deprecated] Cocoa is now enabled by default. + + -carbon .............Build the Carbon version of Qt. 64-bit archs + are not supported by carbon and will be built + with cocoa * -framework ......... Build Qt as a series of frameworks and link tools against those frameworks. @@ -3800,8 +3805,7 @@ Qt/Mac only: -arch ....... Build Qt for Example values for : x86 ppc x86_64 ppc64 - Multiple -arch arguments can be specified, 64-bit archs - will be built with the Cocoa framework. + Multiple -arch arguments can be specified. -sdk ......... Build Qt using Apple provided SDK . This option requires gcc 4. To use a different SDK with gcc 3.3, set the SDKROOT environment variable. @@ -5942,14 +5946,14 @@ if [ "$CFG_MAC_DWARF2" = "yes" ]; then QT_CONFIG="$QT_CONFIG dwarf2" fi -# Set the default arch. -# Carbon builds: 32 bit x86/ppc. -# For "-cocoa" builds on snow leopard : compiler default (64-bit). -# For "-cocoa" builds on leopard : compiler default (32-bit). +# Set the default arch if there are no "-arch" arguments on the configure line +# For "-carbon" builds: 32 bit x86/ppc. +# For builds on snow leopard : compiler default (64-bit). +# For builds on leopard : compiler default (32-bit). if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_MAC_ARCHS" = "" ]; then source "$mactests/defaultarch.test" "$TEST_COMPILER" "$OPT_VERBOSE" "$mactests" - if [ "$CFG_MAC_COCOA" != "yes" ]; then + if [ "$CFG_MAC_CARBON" = "yes" ]; then if [ "$QT_MAC_DEFAULT_ARCH" = "x86_64" ]; then CFG_MAC_ARCHS=" x86" elif [ "$QT_MAC_DEFAULT_ARCH" = "ppc64" ]; then @@ -5965,25 +5969,23 @@ if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_MAC_ARCHS" = "" ]; then fi # enable cocoa and/or carbon on Mac -if [ "$CFG_MAC_COCOA" = "yes" ]; then -# -cocoa on the command line disables carbon completely (i.e. use cocoa for 32-bit as well) - CFG_MAC_CARBON="no" -else +if [ "$CFG_MAC_CARBON" = "yes" ]; then +# -carbon on the command line disables Cocoa, except for 64b-bit archs + CFG_MAC_CARBON="YES" + CFG_MAC_COCOA="NO" +fi # check which archs are in use, enable cocoa if we find a 64-bit one - if echo "$CFG_MAC_ARCHS" | grep 64 > /dev/null 2>&1; then - CFG_MAC_COCOA="yes"; - CFG_MAC_CARBON="no"; - if echo "$CFG_MAC_ARCHS" | grep -w ppc > /dev/null 2>&1; then - CFG_MAC_CARBON="yes"; - fi - if echo "$CFG_MAC_ARCHS" | grep -w x86 > /dev/null 2>&1; then - CFG_MAC_CARBON="yes"; - fi - else -# no 64-bit archs found. - CFG_MAC_COCOA="no" +if echo "$CFG_MAC_ARCHS" | grep 64 > /dev/null 2>&1; then + CFG_MAC_COCOA="yes"; + CFG_MAC_CARBON="no"; + if echo "$CFG_MAC_ARCHS" | grep -w ppc > /dev/null 2>&1; then + CFG_MAC_CARBON="yes"; + fi + if echo "$CFG_MAC_ARCHS" | grep -w x86 > /dev/null 2>&1; then + CFG_MAC_CARBON="yes"; fi -fi; +fi + # set the global Mac deployment target. This is overridden on an arch-by-arch basis # in some cases, see code further down @@ -6579,9 +6581,8 @@ fi # On Mac, set the minimum deployment target for the different architechtures # using the Xarch compiler option when supported (10.5 and up). On 10.4 the # deployment version is set to 10.4 globally using the QMAKE_MACOSX_DEPLOYMENT_TARGET -# env. variable. "-cocoa" on the command line means Cocoa is used in 32-bit mode also, -# in this case fall back on QMAKE_MACOSX_DEPLOYMENT_TARGET which will be set to 10.5. -if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_MAC_XARCH" != "no" ] && [ "$COMMANDLINE_MAC_COCOA" != "yes" ]; then +# env. variable. +if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_MAC_XARCH" != "no" ] ; then if echo "$CFG_MAC_ARCHS" | grep '\' > /dev/null 2>&1; then QMakeVar add QMAKE_CFLAGS "-Xarch_i386 -mmacosx-version-min=10.4" QMakeVar add QMAKE_CXXFLAGS "-Xarch_i386 -mmacosx-version-min=10.4" -- cgit v0.12 From 6f173f9686bb3be19b26215342699705765937d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Wed, 6 Jan 2010 13:18:44 +0100 Subject: Select Carbon when building on 10.4 Tiger. Only perform the architecture check when "-carbon" has been specified on the configure line, as this is the only case where cocoa might have to be enabled on an arch by arch basis. --- configure | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/configure b/configure index 7744d51..0030c6c 100755 --- a/configure +++ b/configure @@ -5968,25 +5968,34 @@ if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_MAC_ARCHS" = "" ]; then [ "$OPT_VERBOSE" = "yes" ] && echo "Setting Mac architechture to$CFG_MAC_ARCHS." fi -# enable cocoa and/or carbon on Mac +# enable Cocoa and/or Carbon on Mac +# -carbon on the command line disables Cocoa, except for 64-bit archs if [ "$CFG_MAC_CARBON" = "yes" ]; then -# -carbon on the command line disables Cocoa, except for 64b-bit archs CFG_MAC_CARBON="YES" CFG_MAC_COCOA="NO" -fi -# check which archs are in use, enable cocoa if we find a 64-bit one -if echo "$CFG_MAC_ARCHS" | grep 64 > /dev/null 2>&1; then - CFG_MAC_COCOA="yes"; - CFG_MAC_CARBON="no"; - if echo "$CFG_MAC_ARCHS" | grep -w ppc > /dev/null 2>&1; then - CFG_MAC_CARBON="yes"; + +# check which archs are in use, enable cocoa if we find a 64-bit one + if echo "$CFG_MAC_ARCHS" | grep 64 > /dev/null 2>&1; then + CFG_MAC_COCOA="yes"; + CFG_MAC_CARBON="no"; + if echo "$CFG_MAC_ARCHS" | grep -w ppc > /dev/null 2>&1; then + CFG_MAC_CARBON="yes"; + fi + if echo "$CFG_MAC_ARCHS" | grep -w x86 > /dev/null 2>&1; then + CFG_MAC_CARBON="yes"; + fi fi - if echo "$CFG_MAC_ARCHS" | grep -w x86 > /dev/null 2>&1; then +fi + +# select Carbon on 10.4 Tiger. +if [ "$PLATFORM_MAC" = "yes" ]; then + VERSION=`uname -r | tr '.' ' ' | awk '{print $1}'` + if [ "$VERSION" == 8 ]; then + CFG_MAC_COCOA="no"; CFG_MAC_CARBON="yes"; fi fi - # set the global Mac deployment target. This is overridden on an arch-by-arch basis # in some cases, see code further down case "$PLATFORM,$CFG_MAC_COCOA" in -- cgit v0.12 From 2399046fbc9dc2c9f7250a43a83ce6f800b59922 Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Wed, 6 Jan 2010 16:49:21 +0100 Subject: Fix build on other platforms than Mac $CFG_MAC_COCOA has a default value of yes now so be sure we the platform is Mac before doing anything with it. Reviewed-by:thiago --- configure | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 0030c6c..ec23103 100755 --- a/configure +++ b/configure @@ -6911,9 +6911,9 @@ if [ "$CFG_LARGEFILE" = "yes" ]; then fi # if both carbon and cocoa are specified, enable the autodetection code. -if [ "$CFG_MAC_COCOA" = "yes" -a "$CFG_MAC_CARBON" = "yes" ]; then +if [ "$PLATFORM_MAC" = "yes" -a "$CFG_MAC_COCOA" = "yes" -a "$CFG_MAC_CARBON" = "yes" ]; then echo "#define AUTODETECT_COCOA 1" >>"$outpath/src/corelib/global/qconfig.h.new" -elif [ "$CFG_MAC_COCOA" = "yes" ]; then +elif [ "$PLATFORM_MAC" = "yes" -a "$CFG_MAC_COCOA" = "yes" ]; then echo "#define QT_MAC_USE_COCOA 1" >>"$outpath/src/corelib/global/qconfig.h.new" fi -- cgit v0.12 From a8e3cca9032b471c1efd018a75456ee9beb70b13 Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Wed, 6 Jan 2010 16:53:29 +0100 Subject: Our variables are our variables so we prefix them. AUTODETECT_COCOA -> QT_AUTODETECT_COCOA Reviewed-by:thiago --- configure | 2 +- src/corelib/global/qglobal.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index ec23103..0644cc0 100755 --- a/configure +++ b/configure @@ -6912,7 +6912,7 @@ fi # if both carbon and cocoa are specified, enable the autodetection code. if [ "$PLATFORM_MAC" = "yes" -a "$CFG_MAC_COCOA" = "yes" -a "$CFG_MAC_CARBON" = "yes" ]; then - echo "#define AUTODETECT_COCOA 1" >>"$outpath/src/corelib/global/qconfig.h.new" + echo "#define QT_AUTODETECT_COCOA 1" >>"$outpath/src/corelib/global/qconfig.h.new" elif [ "$PLATFORM_MAC" = "yes" -a "$CFG_MAC_COCOA" = "yes" ]; then echo "#define QT_MAC_USE_COCOA 1" >>"$outpath/src/corelib/global/qconfig.h.new" fi diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 1f0b80c..e285517 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -275,7 +275,7 @@ namespace QT_NAMESPACE {} # endif #endif -#ifdef AUTODETECT_COCOA +#ifdef QT_AUTODETECT_COCOA # ifdef Q_OS_MAC64 # define QT_MAC_USE_COCOA 1 # define QT_BUILD_KEY QT_BUILD_KEY_COCOA -- cgit v0.12 From 0647ea310c3880a0b1457f750dd6d092666c14de Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 6 Jan 2010 18:42:56 +0100 Subject: Qt 5 comment added for QT_WA / QT_WA_INLINE removal --- src/corelib/global/qglobal.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index e285517..573626d 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -1540,6 +1540,7 @@ inline QT3_SUPPORT bool qt_winUnicode() { return true; } inline QT3_SUPPORT int qWinVersion() { return QSysInfo::WindowsVersion; } #endif +// ### Qt 5: remove Win9x support macros QT_WA and QT_WA_INLINE. #define QT_WA(unicode, ansi) unicode #define QT_WA_INLINE(unicode, ansi) (unicode) -- cgit v0.12 From 58112b1e251c03b0a72511508712f9a67ce84d25 Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Thu, 7 Jan 2010 08:57:54 +1000 Subject: Add QImage::constBits() and QImage::constScanLine() QImage::bits() and QImage::scanLine() can create deep copies if the QImage is not const. The constBits() and constScanLine() functions make things more explicit and less error-prone. Reviewed-by: Daniel Pope --- src/gui/image/qimage.cpp | 40 ++++++++++++++++++++++++++++++++++++++-- src/gui/image/qimage.h | 2 ++ 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index ec8dd88..fc1107d 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -1832,7 +1832,7 @@ void QImage::setColor(int i, QRgb c) qAlpha() to access the pixels. \sa bytesPerLine(), bits(), {QImage#Pixel Manipulation}{Pixel - Manipulation} + Manipulation}, constScanLine() */ uchar *QImage::scanLine(int i) { @@ -1862,6 +1862,28 @@ const uchar *QImage::scanLine(int i) const /*! + Returns a pointer to the pixel data at the scanline with index \a + i. The first scanline is at index 0. + + The scanline data is aligned on a 32-bit boundary. + + Note that QImage uses \l{Implicit Data Sharing} {implicit data + sharing}, but this function does \e not perform a deep copy of the + shared pixel data, because the returned data is const. + + \sa scanLine(), constBits() + \since 4.7 +*/ +const uchar *QImage::constScanLine(int i) const +{ + if (!d) + return 0; + + Q_ASSERT(i >= 0 && i < height()); + return d->data + i * d->bytes_per_line; +} + +/*! Returns a pointer to the first pixel data. This is equivalent to scanLine(0). @@ -1870,7 +1892,7 @@ const uchar *QImage::scanLine(int i) const data, thus ensuring that this QImage is the only one using the current return value. - \sa scanLine(), byteCount() + \sa scanLine(), byteCount(), constBits() */ uchar *QImage::bits() { @@ -1898,6 +1920,20 @@ const uchar *QImage::bits() const } +/*! + Returns a pointer to the first pixel data. + + Note that QImage uses \l{Implicit Data Sharing} {implicit data + sharing}, but this function does \e not perform a deep copy of the + shared pixel data, because the returned data is const. + + \sa bits(), constScanLine() + \since 4.7 +*/ +const uchar *QImage::constBits() const +{ + return d ? d->data : 0; +} /*! \fn void QImage::reset() diff --git a/src/gui/image/qimage.h b/src/gui/image/qimage.h index ce7f450..4e74c0e 100644 --- a/src/gui/image/qimage.h +++ b/src/gui/image/qimage.h @@ -182,6 +182,7 @@ public: uchar *bits(); const uchar *bits() const; + const uchar *constBits() const; #ifdef QT_DEPRECATED QT_DEPRECATED int numBytes() const; #endif @@ -189,6 +190,7 @@ public: uchar *scanLine(int); const uchar *scanLine(int) const; + const uchar *constScanLine(int) const; int bytesPerLine() const; bool valid(int x, int y) const; -- cgit v0.12 From 4d786b6961f23af6edccf75c6b41267285fefcda Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Thu, 7 Jan 2010 10:38:52 +0100 Subject: Cocoa: problems quitting application when not using qApp::exec This problem has been around before. At that time it had to do with what part of the application received the kEAQuit apple event. In Qt-4.7 we ensure that NSApplication gets run at least once before we do any other event processing in Qt. That way the menu bar gets fully initialized. The backside of the coin is that NSApplication will not let the quit menu send a terminate action to the menu nibs file owner (qmenuloader_mac.mm) when a modal window is showing on screen. This is normally expected behaviour, but in Qt we allow the user to quit when just a single window/dialog is showing on screen. This fix remaps the quit items target from files owner to first responder. That way we can catch the terminate at the window/responder beeing that, and terminate as needed. Task-number: QTBUG-7197 Reviewed-by: Prasanth --- src/gui/kernel/kernel.pri | 1 + src/gui/kernel/qcocoasharedwindowmethods_mac_p.h | 7 +++++++ src/gui/mac/qt_menu.nib/classes.nib | 16 ++++++++-------- src/gui/mac/qt_menu.nib/info.nib | 4 ++-- src/gui/mac/qt_menu.nib/keyedobjects.nib | Bin 5567 -> 5560 bytes 5 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/gui/kernel/kernel.pri b/src/gui/kernel/kernel.pri index f2bd288..30cb043 100644 --- a/src/gui/kernel/kernel.pri +++ b/src/gui/kernel/kernel.pri @@ -201,6 +201,7 @@ embedded { OBJECTIVE_HEADERS += \ qcocoawindow_mac_p.h \ + qcocoapanel_mac_p.h \ qcocoawindowdelegate_mac_p.h \ qcocoaview_mac_p.h \ qcocoaapplication_mac_p.h \ diff --git a/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h b/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h index 7661b89..31d81d9 100644 --- a/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h +++ b/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h @@ -160,6 +160,13 @@ QT_END_NAMESPACE qt_dispatchTabletProximityEvent(tabletEvent); } +- (void)terminate:(id)sender +{ + // This function is called from the quit item in the + // menubar, when this window is the first responder + [NSApp terminate:sender]; +} + - (void)sendEvent:(NSEvent *)event { QWidget *widget = [[QT_MANGLE_NAMESPACE(QCocoaWindowDelegate) sharedDelegate] qt_qwidgetForWindow:self]; diff --git a/src/gui/mac/qt_menu.nib/classes.nib b/src/gui/mac/qt_menu.nib/classes.nib index fed50a3..0031e0e 100644 --- a/src/gui/mac/qt_menu.nib/classes.nib +++ b/src/gui/mac/qt_menu.nib/classes.nib @@ -5,14 +5,6 @@ IBClasses - CLASS - FirstResponder - LANGUAGE - ObjC - SUPERCLASS - NSObject - - ACTIONS hide @@ -52,6 +44,14 @@ SUPERCLASS NSResponder + + CLASS + FirstResponder + LANGUAGE + ObjC + SUPERCLASS + NSObject + IBVersion 1 diff --git a/src/gui/mac/qt_menu.nib/info.nib b/src/gui/mac/qt_menu.nib/info.nib index 768cb8b..02e5cca 100644 --- a/src/gui/mac/qt_menu.nib/info.nib +++ b/src/gui/mac/qt_menu.nib/info.nib @@ -3,7 +3,7 @@ IBFramework Version - 670 + 672 IBOldestOS 5 IBOpenObjects @@ -11,7 +11,7 @@ 57 IBSystem Version - 9G55 + 9L31a targetFramework IBCocoaFramework diff --git a/src/gui/mac/qt_menu.nib/keyedobjects.nib b/src/gui/mac/qt_menu.nib/keyedobjects.nib index 18a6648..3edb0ed 100644 Binary files a/src/gui/mac/qt_menu.nib/keyedobjects.nib and b/src/gui/mac/qt_menu.nib/keyedobjects.nib differ -- cgit v0.12 From 5339d24dc09525a67295adf98e9042971f4a9b2e Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Thu, 7 Jan 2010 10:58:17 +0100 Subject: QMenuBar::triggered(QAction *) fires twice in Mac (carbon). The signal was being emitted both from the carbon event handler and the platform independent code of QMenu. The one in the event handler is now removed. Task-number: 6741 Reviewed-by: Richard Moe Gustavsen --- src/gui/widgets/qmenu_mac.mm | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/gui/widgets/qmenu_mac.mm b/src/gui/widgets/qmenu_mac.mm index 30bbd31..99301ee 100644 --- a/src/gui/widgets/qmenu_mac.mm +++ b/src/gui/widgets/qmenu_mac.mm @@ -231,7 +231,7 @@ bool qt_mac_activate_action(MenuRef menu, uint command, QAction::ActionEvent act //now walk up firing for each "caused" widget (like in the platform independent menu) QWidget *caused = 0; - if (GetMenuItemProperty(menu, 0, kMenuCreatorQt, kMenuPropertyCausedQWidget, sizeof(caused), 0, &caused) == noErr) { + if (action_e == QAction::Hover && GetMenuItemProperty(menu, 0, kMenuCreatorQt, kMenuPropertyCausedQWidget, sizeof(caused), 0, &caused) == noErr) { MenuRef caused_menu = 0; if (QMenu *qmenu2 = qobject_cast(caused)) caused_menu = qmenu2->macMenu(); @@ -244,25 +244,17 @@ bool qt_mac_activate_action(MenuRef menu, uint command, QAction::ActionEvent act QWidget *widget = 0; GetMenuItemProperty(caused_menu, 0, kMenuCreatorQt, kMenuPropertyQWidget, sizeof(widget), 0, &widget); if (QMenu *qmenu = qobject_cast(widget)) { - if (action_e == QAction::Trigger) { - emit qmenu->triggered(action->action); - } else if (action_e == QAction::Hover) { - action->action->showStatusText(widget); - emit qmenu->hovered(action->action); - } + action->action->showStatusText(widget); + emit qmenu->hovered(action->action); } else if (QMenuBar *qmenubar = qobject_cast(widget)) { - if (action_e == QAction::Trigger) { - emit qmenubar->triggered(action->action); - } else if (action_e == QAction::Hover) { - action->action->showStatusText(widget); - emit qmenubar->hovered(action->action); - } + action->action->showStatusText(widget); + emit qmenubar->hovered(action->action); break; //nothing more.. } //walk up if (GetMenuItemProperty(caused_menu, 0, kMenuCreatorQt, kMenuPropertyCausedQWidget, - sizeof(caused), 0, &caused) != noErr) + sizeof(caused), 0, &caused) != noErr) break; if (QMenu *qmenu2 = qobject_cast(caused)) caused_menu = qmenu2->macMenu(); -- cgit v0.12 From 63e248aae7aecce2299bfd7941bd37fdfc136dcf Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Thu, 7 Jan 2010 14:11:28 +0100 Subject: Mac style doesn't honour QStyle::State_HasFocus for non-widgets. This patch draws the focus frame for widgets other than QLineEdit (e.g. for line edits in Webkit). The frame is drawn outside the rectangle passed in the option-rect. Task-number: QTBUG-5530 Reviewed-by: MortenS --- src/gui/styles/qmacstyle_mac.mm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm index 4075cf7..53740fc 100644 --- a/src/gui/styles/qmacstyle_mac.mm +++ b/src/gui/styles/qmacstyle_mac.mm @@ -3109,6 +3109,18 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai break; case PE_PanelLineEdit: QWindowsStyle::drawPrimitive(pe, opt, p, w); + // Draw the focus frame for widgets other than QLineEdit (e.g. for line edits in Webkit). + // Focus frame is drawn outside the rectangle passed in the option-rect. + if (const QStyleOptionFrame *panel = qstyleoption_cast(opt)) { + if ((opt->state & State_HasFocus) && !qobject_cast(w)) { + int vmargin = pixelMetric(QStyle::PM_FocusFrameVMargin); + int hmargin = pixelMetric(QStyle::PM_FocusFrameHMargin); + QStyleOptionFrame focusFrame = *panel; + focusFrame.rect = panel->rect.adjusted(-hmargin, -vmargin, hmargin, vmargin); + drawControl(CE_FocusFrame, &focusFrame, p, w); + } + } + break; case PE_FrameTabWidget: if (const QStyleOptionTabWidgetFrame *twf -- cgit v0.12 From 9701f97b6f14e25b405adb7e82ef0ec93a6b8a0f Mon Sep 17 00:00:00 2001 From: ck Date: Thu, 7 Jan 2010 14:22:05 +0100 Subject: Assistant: Add doucmentation for -rebuild-search-index option. Reviewed-by: David Boddie --- doc/src/development/assistant-manual.qdoc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/src/development/assistant-manual.qdoc b/doc/src/development/assistant-manual.qdoc index fb9bbda..824169d 100644 --- a/doc/src/development/assistant-manual.qdoc +++ b/doc/src/development/assistant-manual.qdoc @@ -154,13 +154,17 @@ \row \o -unregister \o Unregisters the specified compressed help file from the given - collection file. + collection file. \row \o -remove-search-index \o Purges the help search engine's index. This option is useful in case the associated index files get corrupted. \QA will re-index the documentation at the next start-up. \row + \o -rebuild-search-index + \o Rebuilds the help search engine's index. + Note that this operation may take a while to finish. + \row \o -setCurrentFilter \o Sets the given filter as the active filter. \row -- cgit v0.12 From 59a8e0200b912481ff750401ef10c588ad9bd872 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Arve=20S=C3=A6ther?= Date: Thu, 7 Jan 2010 13:22:53 +0100 Subject: Don't use QTime::elapsed() on windows to query for the actual time. It seems that the time spent between the execution of QTime::start() and QTime::elapsed() can be higher than what QTime::elapsed() sometimes reports. (To put it differently, QTime::elapsed() was sometimes returning a time that was *less* than the actual time spent.) Note that this is *not* a bug on Windows, since GetLocalTime explicitly mentions that we should not use local system times to to relative comparisions (this is what elapsed() currently do). This is also partly reflected by the documentation of QTime::elapsed(), where it says that the result of elapsed() is undefined if the clock setting has been changed. Due to the fact mentioned in the above paragraph this is also a potential problem on other platforms (at least Linux and Mac). However, these platforms do not suffer from the immediate problem we observed on windows (that QTime::elapsed() could return a too small value), so this commit only fixes the problem on Windows (it now uses GetTickCount instead of QTime). For the other platforms the behaviour should be unchanged, since we still use QTime. This was found by running the QPauseAnimation autotest, where some tests were unstable (and failed). However, it did not fail on all windows systems. (Luckilly it failed on my Win 7 system) Reviewed-by: Leo --- src/corelib/animation/qabstractanimation.cpp | 2 +- src/corelib/animation/qabstractanimation_p.h | 62 +++++++++++++++++++++++++++- 2 files changed, 62 insertions(+), 2 deletions(-) diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp index 299585a..de972d4 100644 --- a/src/corelib/animation/qabstractanimation.cpp +++ b/src/corelib/animation/qabstractanimation.cpp @@ -242,7 +242,7 @@ void QUnifiedTimer::timerEvent(QTimerEvent *event) animationTimer.stop(); isPauseTimerActive = false; // invalidate the start reference time - time = QTime(); + time.invalidate(); } else { restartAnimationTimer(); if (!time.isValid()) { diff --git a/src/corelib/animation/qabstractanimation_p.h b/src/corelib/animation/qabstractanimation_p.h index 720e68d..04dd218 100644 --- a/src/corelib/animation/qabstractanimation_p.h +++ b/src/corelib/animation/qabstractanimation_p.h @@ -58,6 +58,10 @@ #include #include +#ifdef Q_OS_WIN +#include +#endif + #ifndef QT_NO_ANIMATION QT_BEGIN_NAMESPACE @@ -109,6 +113,61 @@ private: Q_DECLARE_PUBLIC(QAbstractAnimation) }; +class ElapsedTimer +{ +public: + ElapsedTimer() { + invalidate(); + } + + void invalidate() { + m_started = -1; + } + + bool isValid() const { + return m_started >= 0; + } + + void start() { + m_started = getTickCount_sys(); + } + + qint64 elapsed() const { + qint64 current = getTickCount_sys(); + qint64 delta = current - m_started; + if (delta < 0) + delta += getPeriod_sys(); //we wrapped around + return delta; + } + +private: + enum { + MSECS_PER_HOUR = 3600000, + MSECS_PER_MIN = 60000 + }; + + qint64 m_started; + + quint64 getPeriod_sys() const { +#ifdef Q_OS_WIN + return Q_UINT64_C(0x100000000); +#else + // fallback + return 86400 * 1000; +#endif + } + + qint64 getTickCount_sys() const { +#ifdef Q_OS_WIN + return ::GetTickCount(); +#else + // fallback + const QTime t = QTime::currentTime(); + return MSECS_PER_HOUR * t.hour() + MSECS_PER_MIN * t.minute() + 1000 * t.second() + t.msec(); +#endif + } +}; + class QUnifiedTimer : public QObject { @@ -162,7 +221,8 @@ private: // timer used to delay the check if we should start/stop the animation timer QBasicTimer startStopAnimationTimer; - QTime time; + ElapsedTimer time; + int lastTick; int timingInterval; int currentAnimationIdx; -- cgit v0.12 From 9b0502aa6abf6bb9c07f205bccdf2d9c65027bde Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Fri, 8 Jan 2010 10:18:52 +0100 Subject: Fixes: Checked QPushbutton ignores stylesheet backround: This is because the light() color of the palette is used and it was not modified. Task-number: QTBUG-7216 Reviewed-by: jbache --- src/gui/styles/qstylesheetstyle.cpp | 6 ++++ .../uiloader/baseline/css_buttons_background.ui | 39 ++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp index aff3ac0..56cc364 100644 --- a/src/gui/styles/qstylesheetstyle.cpp +++ b/src/gui/styles/qstylesheetstyle.cpp @@ -1350,6 +1350,12 @@ void QRenderRule::configurePalette(QPalette *p, QPalette::ColorRole fr, QPalette if (br != QPalette::NoRole) p->setBrush(br, bg->brush); p->setBrush(QPalette::Window, bg->brush); + if (bg->brush.style() == Qt::SolidPattern) { + p->setBrush(QPalette::Light, bg->brush.color().lighter(115)); + p->setBrush(QPalette::Midlight, bg->brush.color().lighter(107)); + p->setBrush(QPalette::Dark, bg->brush.color().darker(150)); + p->setBrush(QPalette::Shadow, bg->brush.color().darker(300)); + } } if (!hasPalette()) diff --git a/tests/auto/uiloader/baseline/css_buttons_background.ui b/tests/auto/uiloader/baseline/css_buttons_background.ui index f1fa0bc..3d80aeb 100644 --- a/tests/auto/uiloader/baseline/css_buttons_background.ui +++ b/tests/auto/uiloader/baseline/css_buttons_background.ui @@ -89,6 +89,19 @@ color: yellow;
+ + + + Checked + + + true + + + true + + + @@ -149,6 +162,19 @@ color: yellow; + + + + Checked + + + true + + + true + + + @@ -209,6 +235,19 @@ color: yellow; + + + + Checked + + + true + + + true + + + -- cgit v0.12 From 71f7c1d006d0942fb91e795855bd00a35f226385 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 28 Dec 2009 13:58:25 +0100 Subject: QStyleSheetStyle: Fixed some text croped when having padding with native border. The native border width need to be taken into account in QRenderRule::boxRect() Task-number: QTBUG-6855 Reviewed-by: Benjamin Poulain (cherry picked from commit 6e90192b599cee9b903177a0978198326f667613) --- src/gui/styles/qstylesheetstyle.cpp | 2 +- tests/auto/uiloader/baseline/css_qtbug6855.ui | 57 +++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 tests/auto/uiloader/baseline/css_qtbug6855.ui diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp index ca6968b..56cc364 100644 --- a/src/gui/styles/qstylesheetstyle.cpp +++ b/src/gui/styles/qstylesheetstyle.cpp @@ -1065,7 +1065,7 @@ QRect QRenderRule::boxRect(const QRect& cr, int flags) const r.adjust(-p[LeftEdge], -p[TopEdge], p[RightEdge], p[BottomEdge]); } } - if (!hasNativeBorder() && (flags & Border)) { + if (hasBorder() && (flags & Border)) { const int *b = border()->borders; r.adjust(-b[LeftEdge], -b[TopEdge], b[RightEdge], b[BottomEdge]); } diff --git a/tests/auto/uiloader/baseline/css_qtbug6855.ui b/tests/auto/uiloader/baseline/css_qtbug6855.ui new file mode 100644 index 0000000..0727f6b --- /dev/null +++ b/tests/auto/uiloader/baseline/css_qtbug6855.ui @@ -0,0 +1,57 @@ + + + Form + + + + 0 + 0 + 212 + 108 + + + + Form + + + QPushButton { padding: 20px; } + + + + + + Text not cropped + + + + + + + Qt::Horizontal + + + + 258 + 20 + + + + + + + + Qt::Vertical + + + + 20 + 218 + + + + + + + + + -- cgit v0.12 From 319b0262418d74cc416a7dd1f620b54ba45bad22 Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Fri, 8 Jan 2010 15:33:06 +0100 Subject: Obsolete QDirModel and remove it from the doc. QFileSystemModel provides the same features as QDirModel but in a efficient way so no need to keep QDirModel around. This commit mark as obsolete QDirModel. Examples has been ported to use QFileSystemModel instead. QCompleter also gain the support of QFileSystemModel to complete nicely a line edit. This commit also add a new signal in QFileSystemModel when the directory is loaded, i.e. the thread has finished to read the current dir. Task-number:QTBUG-3884 Reviewed-by:ogoffart Reviewed-by:gabi Reviewed-by:mbm --- examples/itemviews/dirview/main.cpp | 3 +- examples/tools/completer/dirmodel.cpp | 9 +++-- examples/tools/completer/dirmodel.h | 12 +++--- examples/tools/completer/mainwindow.cpp | 18 +++++---- src/gui/dialogs/qfileinfogatherer.cpp | 1 + src/gui/dialogs/qfileinfogatherer_p.h | 1 + src/gui/dialogs/qfilesystemmodel.cpp | 10 +++++ src/gui/dialogs/qfilesystemmodel.h | 1 + src/gui/itemviews/qdirmodel.cpp | 4 +- src/gui/itemviews/qfileiconprovider.cpp | 2 +- src/gui/util/qcompleter.cpp | 70 +++++++++++++++++++++++++++------ src/gui/util/qcompleter.h | 1 + src/gui/util/qcompleter_p.h | 1 + 13 files changed, 98 insertions(+), 35 deletions(-) diff --git a/examples/itemviews/dirview/main.cpp b/examples/itemviews/dirview/main.cpp index 768046a..e7e343e 100644 --- a/examples/itemviews/dirview/main.cpp +++ b/examples/itemviews/dirview/main.cpp @@ -45,7 +45,8 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); - QDirModel model; + QFileSystemModel model; + model.setRootPath(""); QTreeView tree; tree.setModel(&model); diff --git a/examples/tools/completer/dirmodel.cpp b/examples/tools/completer/dirmodel.cpp index 9fd7763..1173d88 100644 --- a/examples/tools/completer/dirmodel.cpp +++ b/examples/tools/completer/dirmodel.cpp @@ -42,14 +42,14 @@ #include "dirmodel.h" //! [0] -DirModel::DirModel(QObject *parent) - : QDirModel(parent) +FileSystemModel::FileSystemModel(QObject *parent) + : QFileSystemModel(parent) { } //! [0] //! [1] -QVariant DirModel::data(const QModelIndex &index, int role) const +QVariant FileSystemModel::data(const QModelIndex &index, int role) const { if (role == Qt::DisplayRole && index.column() == 0) { QString path = QDir::toNativeSeparators(filePath(index)); @@ -58,6 +58,7 @@ QVariant DirModel::data(const QModelIndex &index, int role) const return path; } - return QDirModel::data(index, role); + return QFileSystemModel::data(index, role); } + //! [1] diff --git a/examples/tools/completer/dirmodel.h b/examples/tools/completer/dirmodel.h index a690f6c..5f4d2a7 100644 --- a/examples/tools/completer/dirmodel.h +++ b/examples/tools/completer/dirmodel.h @@ -39,21 +39,21 @@ ** ****************************************************************************/ -#ifndef DIRMODEL_H -#define DIRMODEL_H +#ifndef FILESYSTEMMODEL_H +#define FILESYSTEMMODEL_H -#include +#include -// With a QDirModel, set on a view, you will see "Program Files" in the view +// With a QFileSystemModel, set on a view, you will see "Program Files" in the view // But with this model, you will see "C:\Program Files" in the view. // We acheive this, by having the data() return the entire file path for // the display role. Note that the Qt::EditRole over which the QCompleter // looks for matches is left unchanged //! [0] -class DirModel : public QDirModel +class FileSystemModel : public QFileSystemModel { public: - DirModel(QObject *parent = 0); + FileSystemModel(QObject *parent = 0); QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; }; //! [0] diff --git a/examples/tools/completer/mainwindow.cpp b/examples/tools/completer/mainwindow.cpp index 8fe8c37..e5ee68e 100644 --- a/examples/tools/completer/mainwindow.cpp +++ b/examples/tools/completer/mainwindow.cpp @@ -55,8 +55,8 @@ MainWindow::MainWindow(QWidget *parent) modelLabel->setText(tr("Model")); modelCombo = new QComboBox; - modelCombo->addItem(tr("QDirModel")); - modelCombo->addItem(tr("QDirModel that shows full path")); + modelCombo->addItem(tr("QFileSytemModel")); + modelCombo->addItem(tr("QFileSytemModel that shows full path")); modelCombo->addItem(tr("Country list")); modelCombo->addItem(tr("Word list")); modelCombo->setCurrentIndex(0); @@ -218,17 +218,19 @@ void MainWindow::changeModel() switch (modelCombo->currentIndex()) { default: case 0: - { // Unsorted QDirModel - QDirModel *dirModel = new QDirModel(completer); - completer->setModel(dirModel); + { // Unsorted QFileSystemModel + QFileSystemModel *fsModel = new QFileSystemModel(completer); + fsModel->setRootPath(""); + completer->setModel(fsModel); contentsLabel->setText(tr("Enter file path")); } break; //! [11] //! [12] case 1: - { // DirModel that shows full paths - DirModel *dirModel = new DirModel(completer); - completer->setModel(dirModel); + { // FileSystemModel that shows full paths + FileSystemModel *fsModel = new FileSystemModel(completer); + completer->setModel(fsModel); + fsModel->setRootPath(""); contentsLabel->setText(tr("Enter file path")); } break; diff --git a/src/gui/dialogs/qfileinfogatherer.cpp b/src/gui/dialogs/qfileinfogatherer.cpp index 2729530..bcabb20 100644 --- a/src/gui/dialogs/qfileinfogatherer.cpp +++ b/src/gui/dialogs/qfileinfogatherer.cpp @@ -354,6 +354,7 @@ void QFileInfoGatherer::getFileInfos(const QString &path, const QStringList &fil } if (!updatedFiles.isEmpty()) emit updates(path, updatedFiles); + emit directoryLoaded(path); } void QFileInfoGatherer::fetch(const QFileInfo &fileInfo, QTime &base, bool &firstTime, QList > &updatedFiles, const QString &path) { diff --git a/src/gui/dialogs/qfileinfogatherer_p.h b/src/gui/dialogs/qfileinfogatherer_p.h index b722410..db4e1d0 100644 --- a/src/gui/dialogs/qfileinfogatherer_p.h +++ b/src/gui/dialogs/qfileinfogatherer_p.h @@ -155,6 +155,7 @@ Q_SIGNALS: void updates(const QString &directory, const QList > &updates); void newListOfFiles(const QString &directory, const QStringList &listOfFiles) const; void nameResolved(const QString &fileName, const QString &resolvedName) const; + void directoryLoaded(const QString &path); public: QFileInfoGatherer(QObject *parent = 0); diff --git a/src/gui/dialogs/qfilesystemmodel.cpp b/src/gui/dialogs/qfilesystemmodel.cpp index 6ec80a9..063f979 100644 --- a/src/gui/dialogs/qfilesystemmodel.cpp +++ b/src/gui/dialogs/qfilesystemmodel.cpp @@ -150,6 +150,14 @@ QT_BEGIN_NAMESPACE */ /*! + \since 4.7 + \fn void QFileSystemModel::directoryLoaded(const QString &path) + + This signal is emitted when the gatherer thread has finished to load the \a path. + +*/ + +/*! \fn bool QFileSystemModel::remove(const QModelIndex &index) const Removes the model item \a index from the file system model and \bold{deletes the @@ -1869,6 +1877,8 @@ void QFileSystemModelPrivate::init() q, SLOT(_q_fileSystemChanged(QString,QList >))); q->connect(&fileInfoGatherer, SIGNAL(nameResolved(QString,QString)), q, SLOT(_q_resolvedName(QString,QString))); + q->connect(&fileInfoGatherer, SIGNAL(directoryLoaded(QString)), + q, SIGNAL(directoryLoaded(QString))); q->connect(&delayedSortTimer, SIGNAL(timeout()), q, SLOT(_q_performDelayedSort()), Qt::QueuedConnection); } diff --git a/src/gui/dialogs/qfilesystemmodel.h b/src/gui/dialogs/qfilesystemmodel.h index 4a3c892..a41bc3f 100644 --- a/src/gui/dialogs/qfilesystemmodel.h +++ b/src/gui/dialogs/qfilesystemmodel.h @@ -70,6 +70,7 @@ class Q_GUI_EXPORT QFileSystemModel : public QAbstractItemModel Q_SIGNALS: void rootPathChanged(const QString &newPath); void fileRenamed(const QString &path, const QString &oldName, const QString &newName); + void directoryLoaded(const QString &path); public: enum Roles { diff --git a/src/gui/itemviews/qdirmodel.cpp b/src/gui/itemviews/qdirmodel.cpp index 942cfd7..ddbe51c 100644 --- a/src/gui/itemviews/qdirmodel.cpp +++ b/src/gui/itemviews/qdirmodel.cpp @@ -185,12 +185,12 @@ void QDirModelPrivate::invalidate() /*! \class QDirModel - + \obsolete \brief The QDirModel class provides a data model for the local filesystem. \ingroup model-view - \note The usage of QDirModel is not recommended anymore. The + The usage of QDirModel is not recommended anymore. The QFileSystemModel class is a more performant alternative. This class provides access to the local filesystem, providing functions diff --git a/src/gui/itemviews/qfileiconprovider.cpp b/src/gui/itemviews/qfileiconprovider.cpp index 6316797..0241d4a 100644 --- a/src/gui/itemviews/qfileiconprovider.cpp +++ b/src/gui/itemviews/qfileiconprovider.cpp @@ -72,7 +72,7 @@ QT_BEGIN_NAMESPACE /*! \class QFileIconProvider - \brief The QFileIconProvider class provides file icons for the QDirModel class. + \brief The QFileIconProvider class provides file icons for the QDirModel and the QFileSystemModel classes. */ /*! diff --git a/src/gui/util/qcompleter.cpp b/src/gui/util/qcompleter.cpp index 30bccfb..eeabc22 100644 --- a/src/gui/util/qcompleter.cpp +++ b/src/gui/util/qcompleter.cpp @@ -62,7 +62,7 @@ \snippet doc/src/snippets/code/src_gui_util_qcompleter.cpp 0 - A QDirModel can be used to provide auto completion of file names. + A QFileSystemModel can be used to provide auto completion of file names. For example: \snippet doc/src/snippets/code/src_gui_util_qcompleter.cpp 1 @@ -120,7 +120,7 @@ completion is then performed one level at a time. Let's take the example of a user typing in a file system path. - The model is a (hierarchical) QDirModel. The completion + The model is a (hierarchical) QFileSystemModel. The completion occurs for every element in the path. For example, if the current text is \c C:\Wind, QCompleter might suggest \c Windows to complete the current path element. Similarly, if the current text @@ -130,12 +130,12 @@ split the path into a list of strings that are matched at each level. For \c C:\Windows\Sy, it needs to be split as "C:", "Windows" and "Sy". The default implementation of splitPath(), splits the completionPrefix - using QDir::separator() if the model is a QDirModel. + using QDir::separator() if the model is a QFileSystemModel. To provide completions, QCompleter needs to know the path from an index. This is provided by pathFromIndex(). The default implementation of pathFromIndex(), returns the data for the \l{Qt::EditRole}{edit role} - for list models and the absolute file path if the mode is a QDirModel. + for list models and the absolute file path if the mode is a QFileSystemModel. \sa QAbstractItemModel, QLineEdit, QComboBox, {Completer Example} */ @@ -147,6 +147,7 @@ #include "QtGui/qscrollbar.h" #include "QtGui/qstringlistmodel.h" #include "QtGui/qdirmodel.h" +#include "QtGui/qfilesystemmodel.h" #include "QtGui/qheaderview.h" #include "QtGui/qlistview.h" #include "QtGui/qapplication.h" @@ -470,9 +471,13 @@ QMatchData QCompletionEngine::filterHistory() QAbstractItemModel *source = c->proxy->sourceModel(); if (curParts.count() <= 1 || c->proxy->showAll || !source) return QMatchData(); - bool dirModel = false; + bool isDirModel = false; + bool isFsModel = false; #ifndef QT_NO_DIRMODEL - dirModel = (qobject_cast(source) != 0); + isDirModel = (qobject_cast(source) != 0); +#endif +#ifndef QT_NO_FILESYSTEMMODEL + isFsModel = (qobject_cast(source) != 0); #endif QVector v; QIndexMapper im(v); @@ -482,7 +487,7 @@ QMatchData QCompletionEngine::filterHistory() QString str = source->index(i, c->column).data().toString(); if (str.startsWith(c->prefix, c->cs) #if (!defined(Q_OS_WIN) || defined(Q_OS_WINCE)) && !defined(Q_OS_SYMBIAN) - && (!dirModel || QDir::toNativeSeparators(str) != QDir::separator()) + && ((!isFsModel && !isDirModel) || QDir::toNativeSeparators(str) != QDir::separator()) #endif ) m.indices.append(i); @@ -838,6 +843,13 @@ void QCompleterPrivate::_q_complete(QModelIndex index, bool highlighted) completion += QDir::separator(); } #endif +#ifndef QT_NO_FILESYSTEMMODEL + // add a trailing separator in inline + if (mode == QCompleter::InlineCompletion) { + if (qobject_cast(proxy->sourceModel()) && QFileInfo(completion).isDir()) + completion += QDir::separator(); + } +#endif } if (highlighted) { @@ -891,6 +903,14 @@ void QCompleterPrivate::showPopup(const QRect& rect) popup->show(); } + +void QCompleterPrivate::_q_fileSystemModelDirectoryLoaded(const QString &path) +{ + Q_Q(QCompleter); + Q_UNUSED(path); + q->complete(); +} + /*! Constructs a completer object with the given \a parent. */ @@ -971,7 +991,7 @@ QWidget *QCompleter::widget() const be list model or a tree model. If a model has been already previously set and it has the QCompleter as its parent, it is deleted. - For convenience, if \a model is a QDirModel, QCompleter switches its + For convenience, if \a model is a QFileSystemModel, QCompleter switches its caseSensitivity to Qt::CaseInsensitive on Windows and Qt::CaseSensitive on other platforms. @@ -995,6 +1015,17 @@ void QCompleter::setModel(QAbstractItemModel *model) #endif } #endif // QT_NO_DIRMODEL +#ifndef QT_NO_FILESYSTEMMODEL + QFileSystemModel *fsModel = qobject_cast(model); + if (fsModel) { +#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE)) || defined(Q_OS_SYMBIAN) + setCaseSensitivity(Qt::CaseInsensitive); +#else + setCaseSensitivity(Qt::CaseSensitive); +#endif + connect(fsModel, SIGNAL(directoryLoaded(QString)), this, SLOT(_q_fileSystemModelDirectoryLoaded(QString))); + } +#endif // QT_NO_FILESYSTEMMODEL } /*! @@ -1626,10 +1657,11 @@ QAbstractItemModel *QCompleter::completionModel() const The default implementation returns the \l{Qt::EditRole}{edit role} of the item for list models. It returns the absolute file path if the model is a - QDirModel. + QFileSystemModel. \sa splitPath() */ + QString QCompleter::pathFromIndex(const QModelIndex& index) const { Q_D(const QCompleter); @@ -1639,10 +1671,15 @@ QString QCompleter::pathFromIndex(const QModelIndex& index) const QAbstractItemModel *sourceModel = d->proxy->sourceModel(); if (!sourceModel) return QString(); + bool isDirModel = false; + bool isFsModel = false; #ifndef QT_NO_DIRMODEL - QDirModel *dirModel = qobject_cast(sourceModel); - if (!dirModel) + isDirModel = qobject_cast(d->proxy->sourceModel()) != 0; +#endif +#ifndef QT_NO_FILESYSTEMMODEL + isFsModel = qobject_cast(d->proxy->sourceModel()) != 0; #endif + if (!isDirModel && !isFsModel) return sourceModel->data(index, d->role).toString(); QModelIndex idx = index; @@ -1668,7 +1705,7 @@ QString QCompleter::pathFromIndex(const QModelIndex& index) const in the model(). The default implementation of splitPath() splits a file system path based on - QDir::separator() when the sourceModel() is a QDirModel. + QDir::separator() when the sourceModel() is a QFileSystemModel. When used with list models, the first item in the returned list is used for matching. @@ -1678,12 +1715,19 @@ QString QCompleter::pathFromIndex(const QModelIndex& index) const QStringList QCompleter::splitPath(const QString& path) const { bool isDirModel = false; + bool isFsModel = false; #ifndef QT_NO_DIRMODEL Q_D(const QCompleter); isDirModel = qobject_cast(d->proxy->sourceModel()) != 0; #endif +#ifndef QT_NO_FILESYSTEMMODEL +#ifdef QT_NO_DIRMODEL + Q_D(const QCompleter); +#endif + isFsModel = qobject_cast(d->proxy->sourceModel()) != 0; +#endif - if (!isDirModel || path.isEmpty()) + if ((!isDirModel && !isFsModel) || path.isEmpty()) return QStringList(completionPrefix()); QString pathCopy = QDir::toNativeSeparators(path); diff --git a/src/gui/util/qcompleter.h b/src/gui/util/qcompleter.h index c6ec75d..16cdac0 100644 --- a/src/gui/util/qcompleter.h +++ b/src/gui/util/qcompleter.h @@ -159,6 +159,7 @@ private: Q_PRIVATE_SLOT(d_func(), void _q_complete(QModelIndex)) Q_PRIVATE_SLOT(d_func(), void _q_completionSelected(const QItemSelection&)) Q_PRIVATE_SLOT(d_func(), void _q_autoResizePopup()) + Q_PRIVATE_SLOT(d_func(), void _q_fileSystemModelDirectoryLoaded(const QString&)) }; #endif // QT_NO_COMPLETER diff --git a/src/gui/util/qcompleter_p.h b/src/gui/util/qcompleter_p.h index 107d85f..84a1a74 100644 --- a/src/gui/util/qcompleter_p.h +++ b/src/gui/util/qcompleter_p.h @@ -98,6 +98,7 @@ public: void _q_complete(QModelIndex, bool = false); void _q_completionSelected(const QItemSelection&); void _q_autoResizePopup(); + void _q_fileSystemModelDirectoryLoaded(const QString &path); void setCurrentIndex(QModelIndex, bool = true); }; -- cgit v0.12 From 158d63b56da7433ca627ad82635541c3c17c74e1 Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Fri, 8 Jan 2010 16:16:00 +0100 Subject: Rename files in completer example since QDirModel is not used. Doc updated for the example. Reviewed-by:TrustMe --- doc/src/examples/completer.qdoc | 30 ++++++++-------- examples/tools/completer/completer.pro | 4 +-- examples/tools/completer/dirmodel.cpp | 64 ---------------------------------- examples/tools/completer/dirmodel.h | 61 -------------------------------- examples/tools/completer/fsmodel.cpp | 64 ++++++++++++++++++++++++++++++++++ examples/tools/completer/fsmodel.h | 61 ++++++++++++++++++++++++++++++++ 6 files changed, 142 insertions(+), 142 deletions(-) delete mode 100644 examples/tools/completer/dirmodel.cpp delete mode 100644 examples/tools/completer/dirmodel.h create mode 100644 examples/tools/completer/fsmodel.cpp create mode 100644 examples/tools/completer/fsmodel.h diff --git a/doc/src/examples/completer.qdoc b/doc/src/examples/completer.qdoc index d092027..8a743a7 100644 --- a/doc/src/examples/completer.qdoc +++ b/doc/src/examples/completer.qdoc @@ -48,7 +48,7 @@ \image completer-example.png - This example uses a custom item model, \c DirModel, and a QCompleter object. + This example uses a custom item model, \c FileSystemModel, and a QCompleter object. QCompleter is a class that provides completions based on an item model. The type of model, the completion mode, and the case sensitivity can be selected using combo boxes. @@ -61,32 +61,32 @@ \quotefile examples/tools/completer/completer.qrc - \section1 DirModel Class Definition + \section1 FileSystemModel Class Definition - The \c DirModel class is a subclass of QDirModel, which provides a data + The \c FileSystemModel class is a subclass of QFileSystemModel, which provides a data model for the local filesystem. - \snippet examples/tools/completer/dirmodel.h 0 + \snippet examples/tools/completer/fsmodel.h 0 This class only has a constructor and a \c data() function as it is only created to enable \c data() to return the entire file path for the - display role, unlike \l{QDirModel}'s \c data() function that only returns + display role, unlike \l{QFileSystemModel}'s \c data() function that only returns the folder and not the drive label. This is further explained in - \c DirModel's implementation. + \c FileSystemModel's implementation. - \section1 DirModel Class Implementation + \section1 FileSystemModel Class Implementation - The constructor for the \c DirModel class is used to pass \a parent to - QDirModel. + The constructor for the \c FileSystemModel class is used to pass \a parent to + QFileSystemModel. - \snippet examples/tools/completer/dirmodel.cpp 0 + \snippet examples/tools/completer/fsmodel.cpp 0 As mentioned earlier, the \c data() function is reimplemented in order to get it to return the entire file parth for the display role. For example, - with a QDirModel, you will see "Program Files" in the view. However, with - \c DirModel, you will see "C:\\Program Files". + with a QFileSystemModel, you will see "Program Files" in the view. However, with + \c FileSystemModel, you will see "C:\\Program Files". - \snippet examples/tools/completer/dirmodel.cpp 1 + \snippet examples/tools/completer/fsmodel.cpp 1 The screenshots below illustrate this difference: @@ -120,7 +120,7 @@ is then invoked. We set up three QComboBox objects, \c modelComb, \c modeCombo and - \c caseCombo. By default, the \c modelCombo is set to QDirModel, + \c caseCombo. By default, the \c modelCombo is set to QFileSystemModel, the \c modeCombo is set to "Filtered Popup" and the \c caseCombo is set to "Case Insensitive". @@ -202,7 +202,7 @@ model selected by the user. A \c switch statement is used to change the item model based on the index - of \c modelCombo. If \c case is 0, we use an unsorted QDirModel, providing + of \c modelCombo. If \c case is 0, we use an unsorted QFileSystemModel, providing us with a file path excluding the drive label. \snippet examples/tools/completer/mainwindow.cpp 11 diff --git a/examples/tools/completer/completer.pro b/examples/tools/completer/completer.pro index 96d3734..14521b2 100644 --- a/examples/tools/completer/completer.pro +++ b/examples/tools/completer/completer.pro @@ -1,6 +1,6 @@ -HEADERS = dirmodel.h \ +HEADERS = fsmodel.h \ mainwindow.h -SOURCES = dirmodel.cpp \ +SOURCES = fsmodel.cpp \ main.cpp \ mainwindow.cpp RESOURCES = completer.qrc diff --git a/examples/tools/completer/dirmodel.cpp b/examples/tools/completer/dirmodel.cpp deleted file mode 100644 index 1173d88..0000000 --- a/examples/tools/completer/dirmodel.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "dirmodel.h" - -//! [0] -FileSystemModel::FileSystemModel(QObject *parent) - : QFileSystemModel(parent) -{ -} -//! [0] - -//! [1] -QVariant FileSystemModel::data(const QModelIndex &index, int role) const -{ - if (role == Qt::DisplayRole && index.column() == 0) { - QString path = QDir::toNativeSeparators(filePath(index)); - if (path.endsWith(QDir::separator())) - path.chop(1); - return path; - } - - return QFileSystemModel::data(index, role); -} - -//! [1] diff --git a/examples/tools/completer/dirmodel.h b/examples/tools/completer/dirmodel.h deleted file mode 100644 index 5f4d2a7..0000000 --- a/examples/tools/completer/dirmodel.h +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef FILESYSTEMMODEL_H -#define FILESYSTEMMODEL_H - -#include - -// With a QFileSystemModel, set on a view, you will see "Program Files" in the view -// But with this model, you will see "C:\Program Files" in the view. -// We acheive this, by having the data() return the entire file path for -// the display role. Note that the Qt::EditRole over which the QCompleter -// looks for matches is left unchanged -//! [0] -class FileSystemModel : public QFileSystemModel -{ -public: - FileSystemModel(QObject *parent = 0); - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; -}; -//! [0] - -#endif diff --git a/examples/tools/completer/fsmodel.cpp b/examples/tools/completer/fsmodel.cpp new file mode 100644 index 0000000..8a50f2d --- /dev/null +++ b/examples/tools/completer/fsmodel.cpp @@ -0,0 +1,64 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "fsmodel.h" + +//! [0] +FileSystemModel::FileSystemModel(QObject *parent) + : QFileSystemModel(parent) +{ +} +//! [0] + +//! [1] +QVariant FileSystemModel::data(const QModelIndex &index, int role) const +{ + if (role == Qt::DisplayRole && index.column() == 0) { + QString path = QDir::toNativeSeparators(filePath(index)); + if (path.endsWith(QDir::separator())) + path.chop(1); + return path; + } + + return QFileSystemModel::data(index, role); +} + +//! [1] diff --git a/examples/tools/completer/fsmodel.h b/examples/tools/completer/fsmodel.h new file mode 100644 index 0000000..5f4d2a7 --- /dev/null +++ b/examples/tools/completer/fsmodel.h @@ -0,0 +1,61 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef FILESYSTEMMODEL_H +#define FILESYSTEMMODEL_H + +#include + +// With a QFileSystemModel, set on a view, you will see "Program Files" in the view +// But with this model, you will see "C:\Program Files" in the view. +// We acheive this, by having the data() return the entire file path for +// the display role. Note that the Qt::EditRole over which the QCompleter +// looks for matches is left unchanged +//! [0] +class FileSystemModel : public QFileSystemModel +{ +public: + FileSystemModel(QObject *parent = 0); + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; +}; +//! [0] + +#endif -- cgit v0.12 From d93b2ff9c976a2aea4fb1a7be68565ea0df81ba4 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Fri, 8 Jan 2010 15:10:31 +0100 Subject: Added new functions to QTextCodec that accept ConversionFlags. In some cases the user might want to pass initial conversion flags that should be used by the QTextEncoder and QTextDecoder, so added convenience QTextCodec::makeDecoder and makeEncoder functions that accept those flags as an argument. Task-number: QTBUG-7180 Reviewed-by: Thiago --- src/corelib/codecs/qtextcodec.cpp | 49 +++++++++++++++++++++++++++++++++++++++ src/corelib/codecs/qtextcodec.h | 11 ++++++--- 2 files changed, 57 insertions(+), 3 deletions(-) diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp index 5d62095..65152ca 100644 --- a/src/corelib/codecs/qtextcodec.cpp +++ b/src/corelib/codecs/qtextcodec.cpp @@ -1163,6 +1163,19 @@ QTextDecoder* QTextCodec::makeDecoder() const return new QTextDecoder(this); } +/*! + Creates a QTextDecoder with a specified \a flags to decode chunks + of \c{char *} data to create chunks of Unicode data. + + The caller is responsible for deleting the returned object. + + \since 4.7 +*/ +QTextDecoder* QTextCodec::makeDecoder(QTextCodec::ConversionFlags flags) const +{ + return new QTextDecoder(this, flags); +} + /*! Creates a QTextEncoder which stores enough state to encode chunks @@ -1176,6 +1189,19 @@ QTextEncoder* QTextCodec::makeEncoder() const } /*! + Creates a QTextEncoder with a specified \a flags to encode chunks + of Unicode data as \c{char *} data. + + The caller is responsible for deleting the returned object. + + \since 4.7 +*/ +QTextEncoder* QTextCodec::makeEncoder(QTextCodec::ConversionFlags flags) const +{ + return new QTextEncoder(this, flags); +} + +/*! \fn QByteArray QTextCodec::fromUnicode(const QChar *input, int number, ConverterState *state) const @@ -1316,6 +1342,17 @@ QString QTextCodec::toUnicode(const char *chars) const */ /*! + Constructs a text encoder for the given \a codec and conversion \a flags. + + \since 4.7 +*/ +QTextEncoder::QTextEncoder(const QTextCodec *codec, QTextCodec::ConversionFlags flags) + : c(codec), state() +{ + state.flags = flags; +} + +/*! Destroys the encoder. */ QTextEncoder::~QTextEncoder() @@ -1392,6 +1429,18 @@ QByteArray QTextEncoder::fromUnicode(const QString& uc, int& lenInOut) */ /*! + Constructs a text decoder for the given \a codec and conversion \a flags. + + \since 4.7 +*/ + +QTextDecoder::QTextDecoder(const QTextCodec *codec, QTextCodec::ConversionFlags flags) + : c(codec), state() +{ + state.flags = flags; +} + +/*! Destroys the decoder. */ QTextDecoder::~QTextDecoder() diff --git a/src/corelib/codecs/qtextcodec.h b/src/corelib/codecs/qtextcodec.h index 6170272..91bccda 100644 --- a/src/corelib/codecs/qtextcodec.h +++ b/src/corelib/codecs/qtextcodec.h @@ -85,9 +85,6 @@ public: static QTextCodec *codecForUtfText(const QByteArray &ba); static QTextCodec *codecForUtfText(const QByteArray &ba, QTextCodec *defaultCodec); - QTextDecoder* makeDecoder() const; - QTextEncoder* makeEncoder() const; - bool canEncode(QChar) const; bool canEncode(const QString&) const; @@ -120,6 +117,12 @@ public: QByteArray fromUnicode(const QChar *in, int length, ConverterState *state = 0) const { return convertFromUnicode(in, length, state); } + // ### Qt 5: merge these functions. + QTextDecoder* makeDecoder() const; + QTextDecoder* makeDecoder(ConversionFlags flags) const; + QTextEncoder* makeEncoder() const; + QTextEncoder* makeEncoder(ConversionFlags flags) const; + virtual QByteArray name() const = 0; virtual QList aliases() const; virtual int mibEnum() const = 0; @@ -157,6 +160,7 @@ class Q_CORE_EXPORT QTextEncoder { Q_DISABLE_COPY(QTextEncoder) public: explicit QTextEncoder(const QTextCodec *codec) : c(codec), state() {} + QTextEncoder(const QTextCodec *codec, QTextCodec::ConversionFlags flags); ~QTextEncoder(); QByteArray fromUnicode(const QString& str); QByteArray fromUnicode(const QChar *uc, int len); @@ -173,6 +177,7 @@ class Q_CORE_EXPORT QTextDecoder { Q_DISABLE_COPY(QTextDecoder) public: explicit QTextDecoder(const QTextCodec *codec) : c(codec), state() {} + QTextDecoder(const QTextCodec *codec, QTextCodec::ConversionFlags flags); ~QTextDecoder(); QString toUnicode(const char* chars, int len); QString toUnicode(const QByteArray &ba); -- cgit v0.12 From 2f500df286afba5e64f5288fbc3d02e6e2e41211 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Fri, 8 Jan 2010 16:28:48 +0100 Subject: Use the new QTextCodec api in the QXmlStreamWriter. Instead of accesing private data, use the QTextCodec::makeEncoder() to pass the initial conversion flags to the codec. Also improved the behavior - we shouldn't add BOM in the middle of the data when dumping xml in all encodings, not only for utf8. Task-number: QTBUG-7180 Reviewed-by: Thiago Conflicts: src/corelib/xml/qxmlstream.cpp --- src/corelib/xml/qxmlstream.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/corelib/xml/qxmlstream.cpp b/src/corelib/xml/qxmlstream.cpp index e31ed6d..f879315 100644 --- a/src/corelib/xml/qxmlstream.cpp +++ b/src/corelib/xml/qxmlstream.cpp @@ -3005,8 +3005,7 @@ QXmlStreamWriterPrivate::QXmlStreamWriterPrivate(QXmlStreamWriter *q) deleteDevice = false; #ifndef QT_NO_TEXTCODEC codec = QTextCodec::codecForMib(106); // utf8 - encoder = codec->makeEncoder(); - encoder->fromUnicode(QLatin1String("")); // no byte order mark for utf8 + encoder = codec->makeEncoder(QTextCodec::IgnoreHeader); // no byte order mark for utf8 #endif inStartElement = inEmptyElement = false; wroteSomething = false; @@ -3280,9 +3279,7 @@ void QXmlStreamWriter::setCodec(QTextCodec *codec) if (codec) { d->codec = codec; delete d->encoder; - d->encoder = codec->makeEncoder(); - if (codec->mibEnum() == 106) - d->encoder->fromUnicode(QLatin1String("")); // no byte order mark for utf8 + d->encoder = codec->makeEncoder(QTextCodec::IgnoreHeader); // no byte order mark for utf8 } } -- cgit v0.12 From cb0de81ad244aba16d6218085b39c2b15ab4aa96 Mon Sep 17 00:00:00 2001 From: ck Date: Mon, 11 Jan 2010 10:15:26 +0100 Subject: Add QT_{BEGIN,END}_NAMESPACE to qtextureglyphcache_gl.cpp. --- src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp index 047876f..8b4265d 100644 --- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp +++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp @@ -42,6 +42,8 @@ #include "qtextureglyphcache_gl_p.h" #include "qpaintengineex_opengl2_p.h" +QT_BEGIN_NAMESPACE + #ifdef Q_WS_WIN extern Q_GUI_EXPORT bool qt_cleartype_enabled; #endif @@ -214,3 +216,5 @@ int QGLTextureGlyphCache::glyphMargin() const return m_type == QFontEngineGlyphCache::Raster_RGBMask ? 2 : 0; #endif } + +QT_END_NAMESPACE -- cgit v0.12 From 56d0ea16af168167d840889f67948a79fac9a0d6 Mon Sep 17 00:00:00 2001 From: ck Date: Mon, 11 Jan 2010 10:35:48 +0100 Subject: Update reference to renamed file in completer example. --- examples/tools/completer/mainwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/tools/completer/mainwindow.cpp b/examples/tools/completer/mainwindow.cpp index e5ee68e..52e5c0c 100644 --- a/examples/tools/completer/mainwindow.cpp +++ b/examples/tools/completer/mainwindow.cpp @@ -40,7 +40,7 @@ ****************************************************************************/ #include -#include "dirmodel.h" +#include "fsmodel.h" #include "mainwindow.h" //! [0] -- cgit v0.12 From e8f45c5ba8371053817f13e70d78b06f229d8666 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 11 Jan 2010 17:09:41 +0100 Subject: Autotest: add a local version of the tst_QHttp::connectionClose test Now it doesn't have to be manual any more. Reviewed-by: Trust Me --- tests/auto/qhttp/tst_qhttp.cpp | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/tests/auto/qhttp/tst_qhttp.cpp b/tests/auto/qhttp/tst_qhttp.cpp index 92ab3d8..bfd8ae9 100644 --- a/tests/auto/qhttp/tst_qhttp.cpp +++ b/tests/auto/qhttp/tst_qhttp.cpp @@ -114,9 +114,6 @@ private slots: void abortInReadyRead(); void abortInResponseHeaderReceived(); void nestedEventLoop(); - - - // manual tests void connectionClose(); protected slots: @@ -175,6 +172,23 @@ private: bool proxyAuthCalled; }; +class ClosingServer: public QTcpServer +{ + Q_OBJECT +public: + ClosingServer() + { + connect(this, SIGNAL(newConnection()), SLOT(handleConnection())); + listen(); + } + +public slots: + void handleConnection() + { + delete nextPendingConnection(); + } +}; + //#define DUMP_SIGNALS const int bytesTotal_init = -10; @@ -1491,20 +1505,14 @@ void tst_QHttp::abortInResponseHeaderReceived() void tst_QHttp::connectionClose() { - // This test tries to connect to a client's server, so it is disabled. - // Every now and then, someone please run it to make sure it's not broken. - // Note: the servers might change too... - // // This was added in response to bug 176822 -#ifndef Q_OS_SYMBIAN - QSKIP("This test is manual - read comments in the source code", SkipAll); -#endif QFETCH_GLOBAL(bool, setProxy); if (setProxy) return; QHttp http; - http.setHost("www.fon.com", QHttp::ConnectionModeHttps); + ClosingServer server; + http.setHost("localhost", QHttp::ConnectionModeHttps, server.serverPort()); http.get("/login/gateway/processLogin"); // another possibility: -- cgit v0.12 From 705ebaea0d81c76c97e7230f0acbe85442981555 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Tue, 12 Jan 2010 09:05:13 +0100 Subject: Add an autorelease pool to QApplication instance. This will catch releases done between creating the QApplication object and calling QApplication::exec. (The Cocoa event loop creates release pools for us when it's running.) The memory used by the objects stored in this pool won't be released until the QApplication instance is deleted at application exit. Because of this it still makes sense to still add local release pools when doing potentially large allocations. --- src/gui/kernel/qapplication_p.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/gui/kernel/qapplication_p.h b/src/gui/kernel/qapplication_p.h index 14d7215..fc9e1ab 100644 --- a/src/gui/kernel/qapplication_p.h +++ b/src/gui/kernel/qapplication_p.h @@ -74,6 +74,9 @@ #ifdef Q_OS_SYMBIAN #include #endif +#ifdef Q_WS_MAC +#include +#endif QT_BEGIN_NAMESPACE @@ -481,6 +484,13 @@ public: static Qt::NavigationMode navigationMode; #endif +// We need to have an autorelease pool in place in order +// to catch releases done in between creating the QApplication +// instance and calling QApplicaiton::exec(); +#if defined(QT_MAC_USE_COCOA) + QMacCocoaAutoReleasePool pool; +#endif + #if defined(Q_WS_MAC) || defined(Q_WS_X11) void _q_alertTimeOut(); QHash alertTimerHash; -- cgit v0.12 From ab2f88e3cfbf43afd536b9946a40e936c3dcee35 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 12 Jan 2010 10:00:18 +0100 Subject: Fix compilation of builds without WebKit --- tools/assistant/tools/assistant/centralwidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/assistant/tools/assistant/centralwidget.cpp b/tools/assistant/tools/assistant/centralwidget.cpp index 638b8d2..0f57628 100644 --- a/tools/assistant/tools/assistant/centralwidget.cpp +++ b/tools/assistant/tools/assistant/centralwidget.cpp @@ -1190,7 +1190,7 @@ void CentralWidget::closeOrReloadTabs(const QList &indices, bool tryReload) if (tryReload) { HelpViewer *viewer = qobject_cast(tabWidget->widget(tab)); - if (HelpEngineWrapper::instance().findFile(viewer->url()).isValid()) { + if (HelpEngineWrapper::instance().findFile(viewer->source()).isValid()) { viewer->reload(); close = false; } -- cgit v0.12 From aca933dea3858c0b6db4a02063583da24e80b6c3 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Fri, 8 Jan 2010 15:32:01 +0100 Subject: Cocoa: application will not quit when using dialogs When creating a single dialog in the main function, and tell it to exec, we run a modal dialog. But there is really no other window on screen to be modal for. So in that case, since this is a rather common pattern for Qt applications, we allow users to quit the application from the dock. But this action is sendt as an apple event. And and that point in time, cocoa has the the apple event handler, and refuses to close down the application because it detects a modal window. Our solution is to install/overwrite the apple event handler for kAEQuit _after_ cocoa has finished its own installation. But in order to do this, we need to wait until [NSApplication run] has started, otherwise it will not take effect. And that is what this patch essentially does. --- src/corelib/kernel/qcoreevent.h | 1 - src/gui/kernel/qapplication_mac.mm | 21 +++++++++++++++++---- src/gui/kernel/qapplication_p.h | 3 +++ src/gui/kernel/qcocoaapplicationdelegate_mac.mm | 7 +++++++ src/gui/kernel/qcocoapanel_mac.mm | 1 + src/gui/kernel/qcocoasharedwindowmethods_mac_p.h | 14 ++++++++++++-- src/gui/kernel/qcocoawindow_mac.mm | 1 + src/gui/kernel/qeventdispatcher_mac.mm | 3 +++ src/gui/kernel/qt_cocoa_helpers_mac.mm | 15 +++++++++++++++ src/gui/kernel/qt_cocoa_helpers_mac_p.h | 4 ++++ src/gui/statemachine/qguistatemachine.cpp | 6 ------ src/gui/widgets/qmenu_mac.mm | 4 ++-- 12 files changed, 65 insertions(+), 15 deletions(-) diff --git a/src/corelib/kernel/qcoreevent.h b/src/corelib/kernel/qcoreevent.h index 6427d17..ecca4e2 100644 --- a/src/corelib/kernel/qcoreevent.h +++ b/src/corelib/kernel/qcoreevent.h @@ -266,7 +266,6 @@ public: UngrabMouse = 187, GrabKeyboard = 188, UngrabKeyboard = 189, - CocoaRequestModal = 190, // Internal for requesting an application modal Cocoa Window MacGLClearDrawable = 191, // Internal Cocoa, the window has changed, so we must clear StateMachineSignal = 192, diff --git a/src/gui/kernel/qapplication_mac.mm b/src/gui/kernel/qapplication_mac.mm index 688e51f..a815f94 100644 --- a/src/gui/kernel/qapplication_mac.mm +++ b/src/gui/kernel/qapplication_mac.mm @@ -1239,10 +1239,6 @@ void qt_init(QApplicationPrivate *priv, int) [cocoaApp setMenu:[qtMenuLoader menu]]; [newDelegate setMenuLoader:qtMenuLoader]; [qtMenuLoader release]; - - NSAppleEventManager *eventManager = [NSAppleEventManager sharedAppleEventManager]; - [eventManager setEventHandler:newDelegate andSelector:@selector(getUrl:withReplyEvent:) - forEventClass:kInternetEventClass andEventID:kAEGetURL]; } #endif // Register for Carbon tablet proximity events on the event monitor target. @@ -2435,6 +2431,23 @@ QApplicationPrivate::globalEventProcessor(EventHandlerCallRef er, EventRef event #endif } +#ifdef QT_MAC_USE_COCOA +void QApplicationPrivate::setupAppleEvents() +{ + // This function is called from the event dispatcher when NSApplication has + // finished initialization, which appears to be just after [NSApplication run] has + // started to execute. By setting up our apple events handlers this late, we override + // the ones set up by NSApplication. + QT_MANGLE_NAMESPACE(QCocoaApplicationDelegate) *newDelegate = [QT_MANGLE_NAMESPACE(QCocoaApplicationDelegate) sharedDelegate]; + NSAppleEventManager *eventManager = [NSAppleEventManager sharedAppleEventManager]; + [eventManager setEventHandler:newDelegate andSelector:@selector(appleEventQuit:withReplyEvent:) + forEventClass:kCoreEventClass andEventID:kAEQuitApplication]; + [eventManager setEventHandler:newDelegate andSelector:@selector(getUrl:withReplyEvent:) + forEventClass:kInternetEventClass andEventID:kAEGetURL]; + +} +#endif + // In Carbon this is your one stop for apple events. // In Cocoa, it ISN'T. This is the catch-all Apple Event handler that exists // for the time between instantiating the NSApplication, but before the diff --git a/src/gui/kernel/qapplication_p.h b/src/gui/kernel/qapplication_p.h index fc9e1ab..2927c45 100644 --- a/src/gui/kernel/qapplication_p.h +++ b/src/gui/kernel/qapplication_p.h @@ -459,6 +459,9 @@ public: static OSStatus globalEventProcessor(EventHandlerCallRef, EventRef, void *); static OSStatus globalAppleEventProcessor(const AppleEvent *, AppleEvent *, long); static OSStatus tabletProximityCallback(EventHandlerCallRef, EventRef, void *); +#ifdef QT_MAC_USE_COCOA + static void setupAppleEvents(); +#endif static bool qt_mac_apply_settings(); #endif diff --git a/src/gui/kernel/qcocoaapplicationdelegate_mac.mm b/src/gui/kernel/qcocoaapplicationdelegate_mac.mm index 304e5d3..fc2a5ab 100644 --- a/src/gui/kernel/qcocoaapplicationdelegate_mac.mm +++ b/src/gui/kernel/qcocoaapplicationdelegate_mac.mm @@ -317,5 +317,12 @@ static void cleanupCocoaApplicationDelegate() qt_sendSpontaneousEvent(qAppInstance(), &qtEvent); } +- (void)appleEventQuit:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent +{ + Q_UNUSED(event); + Q_UNUSED(replyEvent); + [NSApp terminate:self]; +} + @end #endif diff --git a/src/gui/kernel/qcocoapanel_mac.mm b/src/gui/kernel/qcocoapanel_mac.mm index 9154284..3d9c1b9 100644 --- a/src/gui/kernel/qcocoapanel_mac.mm +++ b/src/gui/kernel/qcocoapanel_mac.mm @@ -46,6 +46,7 @@ #import #import #import +#import #include diff --git a/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h b/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h index 31d81d9..240cfe7 100644 --- a/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h +++ b/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h @@ -160,10 +160,20 @@ QT_END_NAMESPACE qt_dispatchTabletProximityEvent(tabletEvent); } +- (void)qtDispatcherToQAction:(id)sender +{ + // If this window is modal, the menu bar will be modally shaddowed. + // In that case, since the window will be in the first responder chain, + // we can still catch the trigger here and forward it to the menu bar. + // This is needed as a single modal dialog on Qt should be able to access + // the application menu (e.g. quit). + [[NSApp QT_MANGLE_NAMESPACE(qt_qcocoamenuLoader)] qtDispatcherToQAction:sender]; +} + - (void)terminate:(id)sender { - // This function is called from the quit item in the - // menubar, when this window is the first responder + // This function is called from the quit item in the menubar when this window + // is in the first responder chain (see also qtDispatcherToQAction above) [NSApp terminate:sender]; } diff --git a/src/gui/kernel/qcocoawindow_mac.mm b/src/gui/kernel/qcocoawindow_mac.mm index a9aa373..9250f27 100644 --- a/src/gui/kernel/qcocoawindow_mac.mm +++ b/src/gui/kernel/qcocoawindow_mac.mm @@ -46,6 +46,7 @@ #import #import #import +#import #include diff --git a/src/gui/kernel/qeventdispatcher_mac.mm b/src/gui/kernel/qeventdispatcher_mac.mm index ab1e2a1..a84eca8 100644 --- a/src/gui/kernel/qeventdispatcher_mac.mm +++ b/src/gui/kernel/qeventdispatcher_mac.mm @@ -1048,6 +1048,9 @@ void QEventDispatcherMacPrivate::firstLoopEntry(CFRunLoopObserverRef ref, { Q_UNUSED(ref); Q_UNUSED(activity); +#ifdef QT_MAC_USE_COCOA + QApplicationPrivate::setupAppleEvents(); +#endif processPostedEvents(static_cast(info), blockSendPostedEvents); } diff --git a/src/gui/kernel/qt_cocoa_helpers_mac.mm b/src/gui/kernel/qt_cocoa_helpers_mac.mm index ef680a4..41c859a 100644 --- a/src/gui/kernel/qt_cocoa_helpers_mac.mm +++ b/src/gui/kernel/qt_cocoa_helpers_mac.mm @@ -1278,4 +1278,19 @@ void qt_cocoaChangeOverrideCursor(const QCursor &cursor) } #endif +@implementation DebugNSApplication { +} +- (void)sendEvent:(NSEvent *)event +{ + NSLog(@"NSAppDebug: sendEvent: %@", event); + return [super sendEvent:event]; +} + +- (BOOL)sendAction:(SEL)anAction to:(id)aTarget from:(id)sender +{ + NSLog(@"NSAppDebug: sendAction: %s to %@ from %@", anAction, aTarget, sender); + return [super sendAction:anAction to:aTarget from:sender]; +} +@end + QT_END_NAMESPACE diff --git a/src/gui/kernel/qt_cocoa_helpers_mac_p.h b/src/gui/kernel/qt_cocoa_helpers_mac_p.h index f11ccc5..211a407 100644 --- a/src/gui/kernel/qt_cocoa_helpers_mac_p.h +++ b/src/gui/kernel/qt_cocoa_helpers_mac_p.h @@ -181,6 +181,10 @@ inline QString qt_mac_NSStringToQString(const NSString *nsstr) inline NSString *qt_mac_QStringToNSString(const QString &qstr) { return [reinterpret_cast(QCFString::toCFStringRef(qstr)) autorelease]; } + +@interface DebugNSApplication : NSApplication {} +@end + #endif QT_END_NAMESPACE diff --git a/src/gui/statemachine/qguistatemachine.cpp b/src/gui/statemachine/qguistatemachine.cpp index c3a9228..aeb3dbe 100644 --- a/src/gui/statemachine/qguistatemachine.cpp +++ b/src/gui/statemachine/qguistatemachine.cpp @@ -469,12 +469,6 @@ static QEvent *cloneEvent(QEvent *e) case QEvent::UngrabKeyboard: return new QEvent(*e); -#ifdef QT_MAC_USE_COCOA - case QEvent::CocoaRequestModal: - Q_ASSERT_X(false, "cloneEvent()", "not implemented"); - break; -#endif - case QEvent::TouchBegin: case QEvent::TouchUpdate: case QEvent::TouchEnd: diff --git a/src/gui/widgets/qmenu_mac.mm b/src/gui/widgets/qmenu_mac.mm index 99301ee..62a482a 100644 --- a/src/gui/widgets/qmenu_mac.mm +++ b/src/gui/widgets/qmenu_mac.mm @@ -625,7 +625,7 @@ static NSMenuItem *createNSMenuItem(const QString &title) NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:qt_mac_QStringToNSString(title) action:@selector(qtDispatcherToQAction:) keyEquivalent:@""]; - [item setTarget:getMenuLoader()]; + [item setTarget:nil]; return item; } #endif @@ -1106,7 +1106,7 @@ QMenuPrivate::QMacMenuPrivate::addAction(QMacMenuAction *action, QMacMenuAction action->menu = merge; [cmd retain]; [cmd setAction:@selector(qtDispatcherToQAction:)]; - [cmd setTarget:getMenuLoader()]; + [cmd setTarget:nil]; [action->menuItem release]; action->menuItem = cmd; QMenuMergeList *list = QMenuPrivate::mergeMenuItemsHash.value(merge); -- cgit v0.12 From 0e6abffa2843bae594195b9ba56d5c5264837288 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Tue, 12 Jan 2010 13:46:27 +0100 Subject: Cocoa: the menu bar is sometimes faulty disabled In Qt, we allow the menu bar to be enabled if we only have one exec-ing dialog on screen. That way you can reach the quit menu item to close down the application. But in order for this to work, some overhaul of qmenu_mac.mm was need to teach it these rules. --- src/gui/widgets/qmenu_mac.mm | 155 +++++++++++++++++++++++++++++-------------- 1 file changed, 106 insertions(+), 49 deletions(-) diff --git a/src/gui/widgets/qmenu_mac.mm b/src/gui/widgets/qmenu_mac.mm index 62a482a..3ab6645 100644 --- a/src/gui/widgets/qmenu_mac.mm +++ b/src/gui/widgets/qmenu_mac.mm @@ -1906,57 +1906,53 @@ static bool qt_mac_is_ancestor(QWidget* possibleAncestor, QWidget *child) Returns true if the entries of menuBar should be disabled, based on the modality type of modalWidget. */ -static bool qt_mac_should_disable_menu(QMenuBar *menuBar, QWidget *modalWidget) +static bool qt_mac_should_disable_menu(QMenuBar *menuBar) { - if (modalWidget == 0 || menuBar == 0) + QWidget *modalWidget = qApp->activeModalWidget(); + if (!modalWidget) return false; - // If there is an application modal window on - // screen, the entries of the menubar should be disabled: + if (menuBar && menuBar == menubars()->value(modalWidget)) + // The menu bar is owned by the modal widget. + // In that case we should enable it: + return false; + + // When there is an application modal window on screen, the entries of + // the menubar should be disabled. The exception in Qt is that if the + // modal window is the only window on screen, then we enable the menu bar. QWidget *w = modalWidget; + QWidgetList topLevelWidgets = QApplication::topLevelWidgets(); while (w) { - if (w->isVisible() && w->windowModality() == Qt::ApplicationModal) - return true; + if (w->isVisible() && w->windowModality() == Qt::ApplicationModal) { + for (int i=0; iparentWidget(); } // INVARIANT: modalWidget is window modal. Disable menu entries - // if the menu bar belongs to an ancestor of modalWidget: - return qt_mac_is_ancestor(menuBar->parentWidget(), modalWidget); + // if the menu bar belongs to an ancestor of modalWidget. If menuBar + // is nil, we understand it as the default menu bar set by the nib: + return menuBar ? qt_mac_is_ancestor(menuBar->parentWidget(), modalWidget) : false; } -static void cancelAllMenuTracking() +static QWidget *findWindowThatShouldDisplayMenubar() { -#ifdef QT_MAC_USE_COCOA - QMacCocoaAutoReleasePool pool; - NSMenu *mainMenu = [NSApp mainMenu]; - [mainMenu cancelTracking]; - for (NSMenuItem *item in [mainMenu itemArray]) { - if ([item submenu]) { - [[item submenu] cancelTracking]; - } - } -#endif -} - -/*! - \internal - - This function will update the current menu bar and set it as the - active menu bar in the Menu Manager. - - \warning This function is not portable. - - \sa QMenu::macMenu(), QMenuBar::macMenu() -*/ -bool QMenuBar::macUpdateMenuBar() -{ - cancelAllMenuTracking(); - QMenuBar *mb = 0; - //find a menu bar QWidget *w = qApp->activeWindow(); - if (!w) { + // We have no active window on screen. Try to + // find a window from the list of top levels: QWidgetList tlws = QApplication::topLevelWidgets(); for(int i = 0; i < tlws.size(); ++i) { QWidget *tlw = tlws.at(i); @@ -1967,6 +1963,12 @@ bool QMenuBar::macUpdateMenuBar() } } } + return w; +} + +static QMenuBar *findMenubarForWindow(QWidget *w) +{ + QMenuBar *mb = 0; if (w) { mb = menubars()->value(w); #ifndef QT_NO_MAINWINDOW @@ -1980,11 +1982,49 @@ bool QMenuBar::macUpdateMenuBar() while(w && !mb) mb = menubars()->value((w = w->parentWidget())); } - if (!mb) + + if (!mb) { + // We could not find a menu bar for the window. Lets + // check if we have a global (parentless) menu bar instead: mb = fallback; - //now set it + } + + return mb; +} + +static void cancelAllMenuTracking() +{ +#ifdef QT_MAC_USE_COCOA + QMacCocoaAutoReleasePool pool; + NSMenu *mainMenu = [NSApp mainMenu]; + [mainMenu cancelTracking]; + for (NSMenuItem *item in [mainMenu itemArray]) { + if ([item submenu]) { + [[item submenu] cancelTracking]; + } + } +#endif +} + +/*! + \internal + + This function will update the current menu bar and set it as the + active menu bar in the Menu Manager. + + \warning This function is not portable. + + \sa QMenu::macMenu(), QMenuBar::macMenu() +*/ +bool QMenuBar::macUpdateMenuBar() +{ bool ret = false; + cancelAllMenuTracking(); + QWidget *w = findWindowThatShouldDisplayMenubar(); + QMenuBar *mb = findMenubarForWindow(w); + if (mb && mb->isNativeMenuBar()) { + bool modal = QApplicationPrivate::modalState(); #ifdef QT_MAC_USE_COCOA QMacCocoaAutoReleasePool pool; #endif @@ -2014,16 +2054,18 @@ bool QMenuBar::macUpdateMenuBar() } } #endif - QWidget *modalWidget = qApp->activeModalWidget(); - if (mb != menubars()->value(modalWidget)) { - qt_mac_set_modal_state(menu, qt_mac_should_disable_menu(mb, modalWidget)); - } + // Check if menu is modally shaddowed and should be disabled: + modal = qt_mac_should_disable_menu(mb); + if (mb != qt_mac_current_menubar.qmenubar || modal != qt_mac_current_menubar.modal) + qt_mac_set_modal_state(menu, modal); } qt_mac_current_menubar.qmenubar = mb; - qt_mac_current_menubar.modal = QApplicationPrivate::modalState(); + qt_mac_current_menubar.modal = modal; ret = true; } else if (qt_mac_current_menubar.qmenubar && qt_mac_current_menubar.qmenubar->isNativeMenuBar()) { - const bool modal = QApplicationPrivate::modalState(); + // INVARIANT: The currently active menu bar (if any) is not native. But we do have a + // native menu bar from before. So we need to decide whether or not is should be enabled: + const bool modal = qt_mac_should_disable_menu(qt_mac_current_menubar.qmenubar); if (modal != qt_mac_current_menubar.modal) { ret = true; if (OSMenuRef menu = qt_mac_current_menubar.qmenubar->macMenu()) { @@ -2035,14 +2077,29 @@ bool QMenuBar::macUpdateMenuBar() [NSApp setMainMenu:menu]; syncMenuBarItemsVisiblity(qt_mac_current_menubar.qmenubar->d_func()->mac_menubar); #endif - QWidget *modalWidget = qApp->activeModalWidget(); - if (qt_mac_current_menubar.qmenubar != menubars()->value(modalWidget)) { - qt_mac_set_modal_state(menu, qt_mac_should_disable_menu(mb, modalWidget)); - } + qt_mac_set_modal_state(menu, modal); } qt_mac_current_menubar.modal = modal; } + } else { + // INVARIANT: There is no menubar specified, so the default one with the application + // menu is shown. Check if we need to disable it because of modality. We set + // qt_mac_current_menubar.qmenubar to nil to mean the default nib loaded menu: +#ifdef QT_MAC_USE_COCOA + QMacCocoaAutoReleasePool pool; + QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *loader = getMenuLoader(); + OSMenuRef menu = [loader menu]; + [loader ensureAppMenuInMenu:menu]; + [NSApp setMainMenu:menu]; + const bool modal = qt_mac_should_disable_menu(0); + if (qt_mac_current_menubar.qmenubar || modal != qt_mac_current_menubar.modal) + qt_mac_set_modal_state(menu, modal); + qt_mac_current_menubar.qmenubar = 0; + qt_mac_current_menubar.modal = modal; + ret = true; +#endif } + if(!ret) qt_mac_clear_menubar(); return ret; -- cgit v0.12 From b958102dfa36a3554911adb8fdb21375f0ecb48c Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Thu, 3 Dec 2009 09:46:12 +0100 Subject: QNAM: Add priority to the API and use it for HTTP QHttpNetworkRequest and other classes already knew about the priority. Change QNetworkRequest to export this as API. It will be used in WebKit to tag high priority html, javascript and css files as such. Reviewed-By: Markus Goetz --- src/network/access/qnetworkaccesshttpbackend.cpp | 14 ++++++++++ src/network/access/qnetworkrequest.cpp | 34 +++++++++++++++++++++++- src/network/access/qnetworkrequest.h | 9 +++++++ 3 files changed, 56 insertions(+), 1 deletion(-) diff --git a/src/network/access/qnetworkaccesshttpbackend.cpp b/src/network/access/qnetworkaccesshttpbackend.cpp index 91f9189..a42044c 100644 --- a/src/network/access/qnetworkaccesshttpbackend.cpp +++ b/src/network/access/qnetworkaccesshttpbackend.cpp @@ -467,10 +467,24 @@ void QNetworkAccessHttpBackend::validateCache(QHttpNetworkRequest &httpRequest, loadedFromCache = false; } +static QHttpNetworkRequest::Priority convert(const QNetworkRequest::Priority& prio) +{ + switch (prio) { + case QNetworkRequest::LowPriority: + return QHttpNetworkRequest::LowPriority; + case QNetworkRequest::HighPriority: + return QHttpNetworkRequest::HighPriority; + case QNetworkRequest::NormalPriority: + default: + return QHttpNetworkRequest::NormalPriority; + } +} + void QNetworkAccessHttpBackend::postRequest() { bool loadedFromCache = false; QHttpNetworkRequest httpRequest; + httpRequest.setPriority(convert(request().priority())); switch (operation()) { case QNetworkAccessManager::GetOperation: httpRequest.setOperation(QHttpNetworkRequest::Get); diff --git a/src/network/access/qnetworkrequest.cpp b/src/network/access/qnetworkrequest.cpp index 923f2e3..55643e4 100644 --- a/src/network/access/qnetworkrequest.cpp +++ b/src/network/access/qnetworkrequest.cpp @@ -218,8 +218,9 @@ class QNetworkRequestPrivate: public QSharedData, public QNetworkHeadersPrivate { public: inline QNetworkRequestPrivate() + : priority(QNetworkRequest::NormalPriority) #ifndef QT_NO_OPENSSL - : sslConfiguration(0) + , sslConfiguration(0) #endif { qRegisterMetaType(); } ~QNetworkRequestPrivate() @@ -234,6 +235,7 @@ public: : QSharedData(other), QNetworkHeadersPrivate(other) { url = other.url; + priority = other.priority; #ifndef QT_NO_OPENSSL sslConfiguration = 0; @@ -245,12 +247,14 @@ public: inline bool operator==(const QNetworkRequestPrivate &other) const { return url == other.url && + priority == other.priority && rawHeaders == other.rawHeaders && attributes == other.attributes; // don't compare cookedHeaders } QUrl url; + QNetworkRequest::Priority priority; #ifndef QT_NO_OPENSSL mutable QSslConfiguration *sslConfiguration; #endif @@ -516,6 +520,34 @@ QObject *QNetworkRequest::originatingObject() const return d->originatingObject.data(); } +/*! + \since 4.7 + + Return the priority of this request. + + \sa setPriority() +*/ +QNetworkRequest::Priority QNetworkRequest::priority() const +{ + return d->priority; +} + +/*! + \since 4.7 + + Set the priority of this request. + + \note The priority is only a hint to the network access manager. + It can use it or not. Currently it is used for HTTP to + decide which request should be sent first to a server. + + \sa priority() +*/ +void QNetworkRequest::setPriority(Priority priority) +{ + d->priority = priority; +} + static QByteArray headerName(QNetworkRequest::KnownHeaders header) { switch (header) { diff --git a/src/network/access/qnetworkrequest.h b/src/network/access/qnetworkrequest.h index 62c6dda..6fd8dba 100644 --- a/src/network/access/qnetworkrequest.h +++ b/src/network/access/qnetworkrequest.h @@ -89,6 +89,12 @@ public: AlwaysCache }; + enum Priority { + HighPriority = 1, + NormalPriority = 3, + LowPriority = 5 + }; + explicit QNetworkRequest(const QUrl &url = QUrl()); QNetworkRequest(const QNetworkRequest &other); ~QNetworkRequest(); @@ -123,6 +129,9 @@ public: void setOriginatingObject(QObject *object); QObject *originatingObject() const; + Priority priority() const; + void setPriority(Priority priority); + private: QSharedDataPointer d; friend class QNetworkRequestPrivate; -- cgit v0.12 From b38da980696e69b61d2f5411ad2f2c36453ed089 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Tue, 12 Jan 2010 19:10:12 +0100 Subject: add a hash function to QUrl, and remove the xmlpatterns specific one we had a hash function defined in xmlpatterns; this commit adds a global hash function for QUrls. Beware that code that defines its own hash function for QUrls will need to #ifdef it out for 4.7. Patch-By: Warwick Allison Reviewed-by: Peter Hartmann Reviewed-by: Thiago Macieira --- src/corelib/io/qurl.h | 7 +++++++ src/xmlpatterns/type/qprimitives_p.h | 14 -------------- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/corelib/io/qurl.h b/src/corelib/io/qurl.h index f76d345..bb04ad1 100644 --- a/src/corelib/io/qurl.h +++ b/src/corelib/io/qurl.h @@ -46,6 +46,7 @@ #include #include #include +#include QT_BEGIN_HEADER @@ -75,6 +76,7 @@ public: RemovePath = 0x20, RemoveQuery = 0x40, RemoveFragment = 0x80, + // 0x100: private: normalized StripTrailingSlash = 0x10000 }; @@ -268,6 +270,11 @@ public: inline DataPtr &data_ptr() { return d; } }; +inline uint qHash(const QUrl &uri) +{ + return qHash(uri.toEncoded(QUrl::FormattingOption(0x100))); +} + Q_DECLARE_TYPEINFO(QUrl, Q_MOVABLE_TYPE); Q_DECLARE_SHARED(QUrl) Q_DECLARE_OPERATORS_FOR_FLAGS(QUrl::FormattingOptions) diff --git a/src/xmlpatterns/type/qprimitives_p.h b/src/xmlpatterns/type/qprimitives_p.h index 01c04a1..d86fa4f 100644 --- a/src/xmlpatterns/type/qprimitives_p.h +++ b/src/xmlpatterns/type/qprimitives_p.h @@ -79,18 +79,6 @@ class QString; */ namespace QPatternist { - - /** - * @internal - * - * A method to allow a QHash or QSet with QUrl - * as key type. - */ - inline uint qHash(const QUrl &uri) - { - return qHash(uri.toString()); - } - /** * @defgroup Patternist_cppWXSTypes C++ Primitives for W3C XML Schema Number Types * @@ -208,8 +196,6 @@ namespace QPatternist QString Q_AUTOTEST_EXPORT escape(const QString &input); } -using QPatternist::qHash; - QT_END_NAMESPACE QT_END_HEADER -- cgit v0.12 From 737161bbec97e738d0e91cc86bd4e4033be07b97 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 13 Jan 2010 12:31:12 +0100 Subject: Add an overload of qRegisterMetaTypeStreamOperators without the type name Reviewed-by: Bradley T. Hughes --- src/corelib/kernel/qmetatype.cpp | 7 +++++++ src/corelib/kernel/qmetatype.h | 20 ++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp index b1ce608..ac15e49 100644 --- a/src/corelib/kernel/qmetatype.cpp +++ b/src/corelib/kernel/qmetatype.cpp @@ -361,7 +361,14 @@ void QMetaType::registerStreamOperators(const char *typeName, SaveOperator saveO int idx = type(typeName); if (!idx) return; + registerStreamOperators(idx, saveOp, loadOp); +} +/*! \internal +*/ +void QMetaType::registerStreamOperators(int idx, SaveOperator saveOp, + LoadOperator loadOp) +{ QVector *ct = customTypes(); if (!ct) return; diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h index 0277200..115411c 100644 --- a/src/corelib/kernel/qmetatype.h +++ b/src/corelib/kernel/qmetatype.h @@ -108,6 +108,8 @@ public: typedef void (*LoadOperator)(QDataStream &, void *); static void registerStreamOperators(const char *typeName, SaveOperator saveOp, LoadOperator loadOp); + static void registerStreamOperators(int type, SaveOperator saveOp, + LoadOperator loadOp); #endif static int registerType(const char *typeName, Destructor destructor, Constructor constructor); @@ -224,6 +226,24 @@ inline int qRegisterMetaType( #endif } +#ifndef QT_NO_DATASTREAM +template +inline int qRegisterMetaTypeStreamOperators() +{ + typedef void(*SavePtr)(QDataStream &, const T *); + typedef void(*LoadPtr)(QDataStream &, T *); + SavePtr sptr = qMetaTypeSaveHelper; + LoadPtr lptr = qMetaTypeLoadHelper; + + register int id = qMetaTypeId(); + QMetaType::registerStreamOperators(id, + reinterpret_cast(sptr), + reinterpret_cast(lptr)); + + return id; +} +#endif + #define Q_DECLARE_METATYPE(TYPE) \ QT_BEGIN_NAMESPACE \ template <> \ -- cgit v0.12 From 52ecdf550a57906a01580c2f811a4035414f0c8b Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Wed, 13 Jan 2010 11:16:35 +0100 Subject: Cocoa: refactor code for clearing the native menu bar It turns out that some of the code executed when synching then menu bar was already implemented in the function that clears the menu bar. So this patch makes the code a bit more compact, avoiding implementing the same code twize. --- src/gui/widgets/qmenu_mac.mm | 73 ++++++++++++++++++-------------------------- 1 file changed, 30 insertions(+), 43 deletions(-) diff --git a/src/gui/widgets/qmenu_mac.mm b/src/gui/widgets/qmenu_mac.mm index 3ab6645..b5ed843 100644 --- a/src/gui/widgets/qmenu_mac.mm +++ b/src/gui/widgets/qmenu_mac.mm @@ -725,32 +725,6 @@ bool qt_mac_menubar_is_open() return qt_mac_menus_open_count > 0; } -void qt_mac_clear_menubar() -{ - if (QApplication::testAttribute(Qt::AA_MacPluginApplication)) - return; - -#ifndef QT_MAC_USE_COCOA - MenuRef clear_menu = 0; - if (CreateNewMenu(0, 0, &clear_menu) == noErr) { - SetRootMenu(clear_menu); - ReleaseMenu(clear_menu); - } else { - qWarning("QMenu: Internal error at %s:%d", __FILE__, __LINE__); - } - ClearMenuBar(); - qt_mac_command_set_enabled(0, kHICommandPreferences, false); - InvalMenuBar(); -#else - QMacCocoaAutoReleasePool pool; - QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *loader = getMenuLoader(); - NSMenu *menu = [loader menu]; - [loader ensureAppMenuInMenu:menu]; - [NSApp setMainMenu:menu]; -#endif -} - - QMacMenuAction::~QMacMenuAction() { #ifdef QT_MAC_USE_COCOA @@ -2006,6 +1980,36 @@ static void cancelAllMenuTracking() #endif } +void qt_mac_clear_menubar() +{ + if (QApplication::testAttribute(Qt::AA_MacPluginApplication)) + return; + +#ifndef QT_MAC_USE_COCOA + MenuRef clear_menu = 0; + if (CreateNewMenu(0, 0, &clear_menu) == noErr) { + SetRootMenu(clear_menu); + ReleaseMenu(clear_menu); + } else { + qWarning("QMenu: Internal error at %s:%d", __FILE__, __LINE__); + } + ClearMenuBar(); + qt_mac_command_set_enabled(0, kHICommandPreferences, false); + InvalMenuBar(); +#else + QMacCocoaAutoReleasePool pool; + QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *loader = getMenuLoader(); + NSMenu *menu = [loader menu]; + [loader ensureAppMenuInMenu:menu]; + [NSApp setMainMenu:menu]; + const bool modal = qt_mac_should_disable_menu(0); + if (qt_mac_current_menubar.qmenubar || modal != qt_mac_current_menubar.modal) + qt_mac_set_modal_state(menu, modal); + qt_mac_current_menubar.qmenubar = 0; + qt_mac_current_menubar.modal = modal; +#endif +} + /*! \internal @@ -2081,23 +2085,6 @@ bool QMenuBar::macUpdateMenuBar() } qt_mac_current_menubar.modal = modal; } - } else { - // INVARIANT: There is no menubar specified, so the default one with the application - // menu is shown. Check if we need to disable it because of modality. We set - // qt_mac_current_menubar.qmenubar to nil to mean the default nib loaded menu: -#ifdef QT_MAC_USE_COCOA - QMacCocoaAutoReleasePool pool; - QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *loader = getMenuLoader(); - OSMenuRef menu = [loader menu]; - [loader ensureAppMenuInMenu:menu]; - [NSApp setMainMenu:menu]; - const bool modal = qt_mac_should_disable_menu(0); - if (qt_mac_current_menubar.qmenubar || modal != qt_mac_current_menubar.modal) - qt_mac_set_modal_state(menu, modal); - qt_mac_current_menubar.qmenubar = 0; - qt_mac_current_menubar.modal = modal; - ret = true; -#endif } if(!ret) -- cgit v0.12 From 20e0e7a849d70139f9106f60c78fd0c736ec3c4b Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Wed, 13 Jan 2010 12:25:30 +0100 Subject: Revert "Add an autorelease pool to QApplication instance." This reverts commit 705ebaea0d81c76c97e7230f0acbe85442981555. For some strange reason, the change that we revert caused a lot of problems; the menu bar stopped working, duplicating menu items etc., and modality stopped working correctly. So there is only one thing to do: revert. Rev-By: msorvig --- src/gui/kernel/qapplication_p.h | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/gui/kernel/qapplication_p.h b/src/gui/kernel/qapplication_p.h index 2927c45..2404d91 100644 --- a/src/gui/kernel/qapplication_p.h +++ b/src/gui/kernel/qapplication_p.h @@ -74,9 +74,6 @@ #ifdef Q_OS_SYMBIAN #include #endif -#ifdef Q_WS_MAC -#include -#endif QT_BEGIN_NAMESPACE @@ -487,13 +484,6 @@ public: static Qt::NavigationMode navigationMode; #endif -// We need to have an autorelease pool in place in order -// to catch releases done in between creating the QApplication -// instance and calling QApplicaiton::exec(); -#if defined(QT_MAC_USE_COCOA) - QMacCocoaAutoReleasePool pool; -#endif - #if defined(Q_WS_MAC) || defined(Q_WS_X11) void _q_alertTimeOut(); QHash alertTimerHash; -- cgit v0.12 From fac30831e9235bb3373a0a96c40c9b653f87e34c Mon Sep 17 00:00:00 2001 From: ck Date: Thu, 14 Jan 2010 10:52:25 +0100 Subject: Use QTemporaryFile for opening documents in external applications. Reviewed-by: kh1 --- tools/assistant/tools/assistant/helpviewer.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tools/assistant/tools/assistant/helpviewer.cpp b/tools/assistant/tools/assistant/helpviewer.cpp index 4ba896c..f20cbc1 100644 --- a/tools/assistant/tools/assistant/helpviewer.cpp +++ b/tools/assistant/tools/assistant/helpviewer.cpp @@ -48,6 +48,8 @@ #include #include #include +#include +#include #include #include @@ -243,19 +245,17 @@ bool HelpPage::acceptNavigationRequest(QWebFrame *, if (isLocalUrl(url)) { const QString& path = url.path(); if (path.endsWith(QLatin1String(".pdf"))) { - const int lastDash = path.lastIndexOf(QChar('/')); - QString fileName = QDir::tempPath() + QDir::separator(); - if (lastDash < 0) - fileName += path; - else - fileName += path.mid(lastDash + 1, path.length()); - - QFile tmpFile(QDir::cleanPath(fileName)); - if (tmpFile.open(QIODevice::ReadWrite)) { - tmpFile.write(HelpEngineWrapper::instance().fileData(url)); - tmpFile.close(); + QTemporaryFile tmpTmpFile; + if (!tmpTmpFile.open()) + return false; + const QString extension = QFileInfo(path).completeSuffix(); + QFile actualTmpFile(tmpTmpFile.fileName() % QLatin1String(".") + % extension); + if (actualTmpFile.open(QIODevice::ReadWrite | QIODevice::Truncate)) { + actualTmpFile.write(HelpEngineWrapper::instance().fileData(url)); + actualTmpFile.close(); + QDesktopServices::openUrl(QUrl(actualTmpFile.fileName())); } - QDesktopServices::openUrl(QUrl(tmpFile.fileName())); if (closeNewTab) QMetaObject::invokeMethod(CentralWidget::instance(), "closeTab"); -- cgit v0.12 From 54d1ad11a4f35c0484418e5d18537daaccc2c6ab Mon Sep 17 00:00:00 2001 From: ck Date: Thu, 14 Jan 2010 11:15:08 +0100 Subject: Assistant: Open non-HTML content in external application. Task-number: QTBUG-5583 Reviewed-by: kh1 --- tools/assistant/tools/assistant/contentwindow.cpp | 12 +++--------- tools/assistant/tools/assistant/helpviewer.cpp | 16 ++++++++++++---- tools/assistant/tools/assistant/helpviewer.h | 3 +++ tools/assistant/tools/assistant/indexwindow.cpp | 3 ++- 4 files changed, 20 insertions(+), 14 deletions(-) diff --git a/tools/assistant/tools/assistant/contentwindow.cpp b/tools/assistant/tools/assistant/contentwindow.cpp index 23bcae4..976ed7a 100644 --- a/tools/assistant/tools/assistant/contentwindow.cpp +++ b/tools/assistant/tools/assistant/contentwindow.cpp @@ -43,6 +43,7 @@ #include "contentwindow.h" #include "centralwidget.h" #include "helpenginewrapper.h" +#include "helpviewer.h" #include #include @@ -143,7 +144,7 @@ bool ContentWindow::eventFilter(QObject *o, QEvent *e) qobject_cast(m_contentWidget->model()); if (contentModel) { QHelpContentItem *itm = contentModel->contentItemAt(index); - if (itm && !isPdfFile(itm)) + if (itm && HelpViewer::canOpenPage(itm->url().path())) CentralWidget::instance()->setSourceInNewTab(itm->url()); } } else if (button == Qt::LeftButton) { @@ -169,7 +170,7 @@ void ContentWindow::showContextMenu(const QPoint &pos) QMenu menu; QAction *curTab = menu.addAction(tr("Open Link")); QAction *newTab = menu.addAction(tr("Open Link in New Tab")); - if (isPdfFile(itm)) + if (!HelpViewer::canOpenPage(itm->url().path())) newTab->setEnabled(false); menu.move(m_contentWidget->mapToGlobal(pos)); @@ -194,11 +195,4 @@ void ContentWindow::itemClicked(const QModelIndex &index) } } -bool ContentWindow::isPdfFile(QHelpContentItem *item) const -{ - TRACE_OBJ - const QString &path = item->url().path(); - return path.endsWith(QLatin1String(".pdf"), Qt::CaseInsensitive); -} - QT_END_NAMESPACE diff --git a/tools/assistant/tools/assistant/helpviewer.cpp b/tools/assistant/tools/assistant/helpviewer.cpp index f20cbc1..d92ff13 100644 --- a/tools/assistant/tools/assistant/helpviewer.cpp +++ b/tools/assistant/tools/assistant/helpviewer.cpp @@ -244,7 +244,7 @@ bool HelpPage::acceptNavigationRequest(QWebFrame *, if (isLocalUrl(url)) { const QString& path = url.path(); - if (path.endsWith(QLatin1String(".pdf"))) { + if (!HelpViewer::canOpenPage(path)) { QTemporaryFile tmpTmpFile; if (!tmpTmpFile.open()) return false; @@ -476,12 +476,12 @@ void HelpViewer::zoomOut(int range) bool HelpViewer::launchedWithExternalApp(const QUrl &url) { TRACE_OBJ - bool isPdf = url.path().endsWith(QLatin1String(".pdf")); + const bool canOpen = canOpenPage(url.path()); if (url.scheme() == QLatin1String("http") || url.scheme() == QLatin1String("ftp") - || url.scheme() == QLatin1String("mailto") || isPdf) { + || url.scheme() == QLatin1String("mailto") || !canOpen) { bool launched = false; - if (isPdf && url.scheme() == QLatin1String("qthelp")) { + if (!canOpen && url.scheme() == QLatin1String("qthelp")) { const QString& path = url.path(); const int lastDash = path.lastIndexOf(QChar('/')); QString fileName = QDir::tempPath() + QDir::separator(); @@ -638,4 +638,12 @@ void HelpViewer::home() setSource(helpEngine.homePage()); } +bool HelpViewer::canOpenPage(const QString &url) +{ + TRACE_OBJ + return url.endsWith(QLatin1String(".html"), Qt::CaseInsensitive) + || url.endsWith(QLatin1String(".htm"), Qt::CaseInsensitive); +} + + QT_END_NAMESPACE diff --git a/tools/assistant/tools/assistant/helpviewer.h b/tools/assistant/tools/assistant/helpviewer.h index ab46208..cfe4c3e 100644 --- a/tools/assistant/tools/assistant/helpviewer.h +++ b/tools/assistant/tools/assistant/helpviewer.h @@ -97,6 +97,8 @@ public: inline qreal zoom() const { return textSizeMultiplier(); } + static bool canOpenPage(const QString &url); + public Q_SLOTS: void home(); void backward() { back(); } @@ -143,6 +145,7 @@ public: { return textCursor().hasSelection(); } bool launchedWithExternalApp(const QUrl &url); + static bool canOpenPage(const QString &url); public Q_SLOTS: void home(); diff --git a/tools/assistant/tools/assistant/indexwindow.cpp b/tools/assistant/tools/assistant/indexwindow.cpp index a61ab70..82242e5 100644 --- a/tools/assistant/tools/assistant/indexwindow.cpp +++ b/tools/assistant/tools/assistant/indexwindow.cpp @@ -43,6 +43,7 @@ #include "indexwindow.h" #include "centralwidget.h" #include "helpenginewrapper.h" +#include "helpviewer.h" #include "topicchooser.h" #include @@ -218,7 +219,7 @@ void IndexWindow::open(QHelpIndexWidget* indexWidget, const QModelIndex &index) return; } - if (url.path().endsWith(QLatin1String(".pdf"), Qt::CaseInsensitive)) + if (!HelpViewer::canOpenPage(url.path())) CentralWidget::instance()->setSource(url); else CentralWidget::instance()->setSourceInNewTab(url); -- cgit v0.12 From 90563926e2d68a468bb9accdbad9760da21d5ba3 Mon Sep 17 00:00:00 2001 From: ck Date: Thu, 14 Jan 2010 11:37:17 +0100 Subject: Assistant: Extend 54d1ad11a4f35c0484418e5d18537daaccc2c6ab. Forgot one place. --- tools/assistant/tools/assistant/aboutdialog.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/assistant/tools/assistant/aboutdialog.cpp b/tools/assistant/tools/assistant/aboutdialog.cpp index ba93351..5727528 100644 --- a/tools/assistant/tools/assistant/aboutdialog.cpp +++ b/tools/assistant/tools/assistant/aboutdialog.cpp @@ -38,6 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#include "helpviewer.h" #include "tracer.h" #include @@ -97,7 +98,7 @@ void AboutLabel::setSource(const QUrl &url) TRACE_OBJ if (url.isValid() && (url.scheme() == QLatin1String("http") || url.scheme() == QLatin1String("ftp") - || url.scheme() == QLatin1String("mailto") || url.path().endsWith(QLatin1String("pdf")))) { + || url.scheme() == QLatin1String("mailto") || !HelpViewer::canOpenPage(url.path()))) { if (!QDesktopServices::openUrl(url)) { QMessageBox::warning(this, tr("Warning"), tr("Unable to launch external application.\n"), -- cgit v0.12 From c5a226dc46110848eb874212cf4bb2257ada0c84 Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Thu, 14 Jan 2010 11:33:56 +0100 Subject: Implement showing the volume name for drives on Windows. Also fix a bug with QCompleter and QFileSystemModel when the popup was shown even if there was nothing to complete. Task-number:QTBUG-5376 Reviewed-by:janarve --- src/gui/dialogs/qfilesystemmodel.cpp | 28 ++++++++++++++++++++++++++-- src/gui/dialogs/qfilesystemmodel_p.h | 4 ++++ src/gui/util/qcompleter.cpp | 13 +++++++++---- 3 files changed, 39 insertions(+), 6 deletions(-) diff --git a/src/gui/dialogs/qfilesystemmodel.cpp b/src/gui/dialogs/qfilesystemmodel.cpp index 517c3ab..ae75126 100644 --- a/src/gui/dialogs/qfilesystemmodel.cpp +++ b/src/gui/dialogs/qfilesystemmodel.cpp @@ -681,7 +681,7 @@ QVariant QFileSystemModel::data(const QModelIndex &index, int role) const case Qt::EditRole: case Qt::DisplayRole: switch (index.column()) { - case 0: return d->name(index); + case 0: return d->displayName(index); case 1: return d->size(index); case 2: return d->type(index); case 3: return d->time(index); @@ -797,13 +797,25 @@ QString QFileSystemModelPrivate::name(const QModelIndex &index) const if (resolvedSymLinks.contains(fullPath)) return resolvedSymLinks[fullPath]; } - // ### TODO it would be nice to grab the volume name if dirNode->parent == root return dirNode->fileName; } /*! \internal */ +QString QFileSystemModelPrivate::displayName(const QModelIndex &index) const +{ +#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) + QFileSystemNode *dirNode = node(index); + if (!dirNode->volumeName.isNull()) + return dirNode->volumeName + QLatin1String(" (") + name(index) + QLatin1Char(')'); +#endif + return name(index); +} + +/*! + \internal +*/ QIcon QFileSystemModelPrivate::icon(const QModelIndex &index) const { if (!index.isValid()) @@ -1648,6 +1660,18 @@ QFileSystemModelPrivate::QFileSystemNode* QFileSystemModelPrivate::addNode(QFile #ifndef QT_NO_FILESYSTEMWATCHER node->populate(info); #endif +#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) + //The parentNode is "" so we are listing the drives + if (parentNode->fileName.isEmpty()) { + wchar_t name[MAX_PATH + 1]; + //GetVolumeInformation requires to add trailing backslash + const QString nodeName = fileName + QLatin1String("\\"); + BOOL success = ::GetVolumeInformation((wchar_t *)(nodeName.utf16()), + name, ARRAYSIZE(name), NULL, 0, NULL, NULL, 0); + if (success && name[0]) + node->volumeName = QString::fromWCharArray(name); + } +#endif parentNode->children.insert(fileName, node); return node; } diff --git a/src/gui/dialogs/qfilesystemmodel_p.h b/src/gui/dialogs/qfilesystemmodel_p.h index 6c85a7c..03e0bfb 100644 --- a/src/gui/dialogs/qfilesystemmodel_p.h +++ b/src/gui/dialogs/qfilesystemmodel_p.h @@ -97,6 +97,9 @@ public: } QString fileName; +#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) + QString volumeName; +#endif inline qint64 size() const { if (info && !info->isDir()) return info->size(); return 0; } inline QString type() const { if (info) return info->displayType; return QLatin1String(""); } @@ -278,6 +281,7 @@ public: QIcon icon(const QModelIndex &index) const; QString name(const QModelIndex &index) const; + QString displayName(const QModelIndex &index) const; QString filePath(const QModelIndex &index) const; QString size(const QModelIndex &index) const; static QString size(qint64 bytes); diff --git a/src/gui/util/qcompleter.cpp b/src/gui/util/qcompleter.cpp index 0a070b6..b7be967 100644 --- a/src/gui/util/qcompleter.cpp +++ b/src/gui/util/qcompleter.cpp @@ -903,12 +903,12 @@ void QCompleterPrivate::showPopup(const QRect& rect) popup->show(); } - void QCompleterPrivate::_q_fileSystemModelDirectoryLoaded(const QString &path) { Q_Q(QCompleter); - Q_UNUSED(path); - q->complete(); + //the path given by QFileSystemModel does not end with / + if (q->completionPrefix() != path + QLatin1Char('/')) + q->complete(); } /*! @@ -1023,6 +1023,7 @@ void QCompleter::setModel(QAbstractItemModel *model) #else setCaseSensitivity(Qt::CaseSensitive); #endif + setCompletionRole(QFileSystemModel::FileNameRole); connect(fsModel, SIGNAL(directoryLoaded(QString)), this, SLOT(_q_fileSystemModelDirectoryLoaded(QString))); } #endif // QT_NO_FILESYSTEMMODEL @@ -1685,7 +1686,11 @@ QString QCompleter::pathFromIndex(const QModelIndex& index) const QModelIndex idx = index; QStringList list; do { - QString t = sourceModel->data(idx, Qt::EditRole).toString(); + QString t; + if (isDirModel) + t = sourceModel->data(idx, Qt::EditRole).toString(); + else + t = sourceModel->data(idx, QFileSystemModel::FileNameRole).toString(); list.prepend(t); QModelIndex parent = idx.parent(); idx = parent.sibling(parent.row(), index.column()); -- cgit v0.12 From 035bb4a1363443df7bb3fd80f0b2e7d548f3d3a1 Mon Sep 17 00:00:00 2001 From: ck Date: Thu, 14 Jan 2010 15:41:02 +0100 Subject: Assistant: Fix bug that can lead to infinite loop in edge cases. --- tools/assistant/lib/qhelp_global.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/assistant/lib/qhelp_global.cpp b/tools/assistant/lib/qhelp_global.cpp index e6a26c4..8e96b55 100644 --- a/tools/assistant/lib/qhelp_global.cpp +++ b/tools/assistant/lib/qhelp_global.cpp @@ -89,10 +89,11 @@ QString QHelpGlobal::codecFromHtmlData(const QByteArray &data) QString head = QString::fromUtf8(data.constData(), qMin(1000, data.size())); int start = head.indexOf(QLatin1String(" 0) { - int end; QRegExp r(QLatin1String("charset=([^\"\\s]+)")); while (start != -1) { - end = head.indexOf(QLatin1Char('>'), start) + 1; + const int end = head.indexOf(QLatin1Char('>'), start) + 1; + if (end <= start) + break; const QString &meta = head.mid(start, end - start).toLower(); if (r.indexIn(meta) != -1) return r.cap(1); -- cgit v0.12 From 9fc2d9630169cd2466f113e259b5cae73baeb1c8 Mon Sep 17 00:00:00 2001 From: ck Date: Thu, 14 Jan 2010 15:42:19 +0100 Subject: Assistant: Use isLocalUrl() to decide whether a page is internal. Reviewed-by: kh1 --- tools/assistant/tools/assistant/aboutdialog.cpp | 5 ++-- tools/assistant/tools/assistant/helpviewer.cpp | 32 +++++++++++-------------- tools/assistant/tools/assistant/helpviewer.h | 2 ++ 3 files changed, 18 insertions(+), 21 deletions(-) diff --git a/tools/assistant/tools/assistant/aboutdialog.cpp b/tools/assistant/tools/assistant/aboutdialog.cpp index 5727528..26d488d 100644 --- a/tools/assistant/tools/assistant/aboutdialog.cpp +++ b/tools/assistant/tools/assistant/aboutdialog.cpp @@ -96,9 +96,8 @@ QVariant AboutLabel::loadResource(int type, const QUrl &name) void AboutLabel::setSource(const QUrl &url) { TRACE_OBJ - if (url.isValid() - && (url.scheme() == QLatin1String("http") || url.scheme() == QLatin1String("ftp") - || url.scheme() == QLatin1String("mailto") || !HelpViewer::canOpenPage(url.path()))) { + if (url.isValid() && (!HelpViewer::isLocalUrl(url) + || !HelpViewer::canOpenPage(url.path()))) { if (!QDesktopServices::openUrl(url)) { QMessageBox::warning(this, tr("Warning"), tr("Unable to launch external application.\n"), diff --git a/tools/assistant/tools/assistant/helpviewer.cpp b/tools/assistant/tools/assistant/helpviewer.cpp index d92ff13..4141d64 100644 --- a/tools/assistant/tools/assistant/helpviewer.cpp +++ b/tools/assistant/tools/assistant/helpviewer.cpp @@ -208,20 +208,6 @@ QWebPage *HelpPage::createWindow(QWebPage::WebWindowType) return newPage; } -static bool isLocalUrl(const QUrl &url) -{ - TRACE_OBJ - const QString scheme = url.scheme(); - if (scheme.isEmpty() - || scheme == QLatin1String("file") - || scheme == QLatin1String("qrc") - || scheme == QLatin1String("data") - || scheme == QLatin1String("qthelp") - || scheme == QLatin1String("about")) - return true; - return false; -} - void HelpPage::triggerAction(WebAction action, bool checked) { TRACE_OBJ @@ -242,7 +228,7 @@ bool HelpPage::acceptNavigationRequest(QWebFrame *, const bool closeNewTab = closeNewTabIfNeeded; closeNewTabIfNeeded = false; - if (isLocalUrl(url)) { + if (HelpViewer::isLocalUrl(url)) { const QString& path = url.path(); if (!HelpViewer::canOpenPage(path)) { QTemporaryFile tmpTmpFile; @@ -477,9 +463,7 @@ bool HelpViewer::launchedWithExternalApp(const QUrl &url) { TRACE_OBJ const bool canOpen = canOpenPage(url.path()); - if (url.scheme() == QLatin1String("http") - || url.scheme() == QLatin1String("ftp") - || url.scheme() == QLatin1String("mailto") || !canOpen) { + if (!isLocalUrl(url) || !canOpen) { bool launched = false; if (!canOpen && url.scheme() == QLatin1String("qthelp")) { const QString& path = url.path(); @@ -645,5 +629,17 @@ bool HelpViewer::canOpenPage(const QString &url) || url.endsWith(QLatin1String(".htm"), Qt::CaseInsensitive); } +bool HelpViewer::isLocalUrl(const QUrl &url) +{ + TRACE_OBJ + const QString scheme = url.scheme(); + return scheme.isEmpty() + || scheme == QLatin1String("file") + || scheme == QLatin1String("qrc") + || scheme == QLatin1String("data") + || scheme == QLatin1String("qthelp") + || scheme == QLatin1String("about"); +} + QT_END_NAMESPACE diff --git a/tools/assistant/tools/assistant/helpviewer.h b/tools/assistant/tools/assistant/helpviewer.h index cfe4c3e..4dd8064 100644 --- a/tools/assistant/tools/assistant/helpviewer.h +++ b/tools/assistant/tools/assistant/helpviewer.h @@ -98,6 +98,7 @@ public: { return textSizeMultiplier(); } static bool canOpenPage(const QString &url); + static bool isLocalUrl(const QUrl &url); public Q_SLOTS: void home(); @@ -146,6 +147,7 @@ public: bool launchedWithExternalApp(const QUrl &url); static bool canOpenPage(const QString &url); + static bool isLocalUrl(const QUrl &url); public Q_SLOTS: void home(); -- cgit v0.12 From 6c5c2312ca5477a1ec33f43c1673ab65a0dce8bb Mon Sep 17 00:00:00 2001 From: ck Date: Thu, 14 Jan 2010 16:17:21 +0100 Subject: Assistant: Extend list of file types to open internally. --- tools/assistant/tools/assistant/helpviewer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/assistant/tools/assistant/helpviewer.cpp b/tools/assistant/tools/assistant/helpviewer.cpp index 4141d64..bd75f3a 100644 --- a/tools/assistant/tools/assistant/helpviewer.cpp +++ b/tools/assistant/tools/assistant/helpviewer.cpp @@ -626,7 +626,8 @@ bool HelpViewer::canOpenPage(const QString &url) { TRACE_OBJ return url.endsWith(QLatin1String(".html"), Qt::CaseInsensitive) - || url.endsWith(QLatin1String(".htm"), Qt::CaseInsensitive); + || url.endsWith(QLatin1String(".htm"), Qt::CaseInsensitive) + || url == QLatin1String("blank"); } bool HelpViewer::isLocalUrl(const QUrl &url) -- cgit v0.12 From f0d24ba1eaa1079abef3a1da641b43437dc7df66 Mon Sep 17 00:00:00 2001 From: Kurt Korbatits Date: Fri, 15 Jan 2010 13:38:12 +1000 Subject: Added new funcs to QAudioFormat and QAudioDeviceInfo class's. QAudioFormat::setChannelCount(), channelCount() QAudioFormat::setSampleRate(), sampleRate() QAudioDeviceInfo::supportedChannelCounts(), supportedSampleRates() Changed all instances to use these new functions instead of channels(),frequency(),setFrequency(),setChannels() supportedChannels(),supportedFrequencies() Old functions still exist but are marked obsolete. Reviewed-by:Justin McPherson --- doc/src/snippets/audio/main.cpp | 4 +- examples/multimedia/audiodevices/audiodevices.cpp | 16 +++--- examples/multimedia/audioinput/audioinput.cpp | 4 +- examples/multimedia/audiooutput/audiooutput.cpp | 4 +- src/multimedia/audio/qaudio_mac.cpp | 12 ++-- src/multimedia/audio/qaudiodeviceinfo.cpp | 32 ++++++++++- src/multimedia/audio/qaudiodeviceinfo.h | 2 + src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp | 26 ++++----- src/multimedia/audio/qaudiodeviceinfo_mac_p.cpp | 8 +-- src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp | 10 ++-- src/multimedia/audio/qaudioformat.cpp | 66 +++++++++++++++++++--- src/multimedia/audio/qaudioformat.h | 6 ++ src/multimedia/audio/qaudioinput.cpp | 4 +- src/multimedia/audio/qaudioinput_alsa_p.cpp | 8 +-- src/multimedia/audio/qaudioinput_mac_p.cpp | 2 +- src/multimedia/audio/qaudioinput_win32_p.cpp | 16 +++--- src/multimedia/audio/qaudiooutput.cpp | 4 +- src/multimedia/audio/qaudiooutput_alsa_p.cpp | 6 +- src/multimedia/audio/qaudiooutput_mac_p.cpp | 6 +- src/multimedia/audio/qaudiooutput_win32_p.cpp | 14 ++--- .../auto/qaudiodeviceinfo/tst_qaudiodeviceinfo.cpp | 16 +++--- tests/auto/qaudioformat/tst_qaudioformat.cpp | 10 ++-- tests/auto/qaudioinput/tst_qaudioinput.cpp | 8 +-- tests/auto/qaudiooutput/tst_qaudiooutput.cpp | 8 +-- 24 files changed, 189 insertions(+), 103 deletions(-) diff --git a/doc/src/snippets/audio/main.cpp b/doc/src/snippets/audio/main.cpp index 0910865..bf4b145 100644 --- a/doc/src/snippets/audio/main.cpp +++ b/doc/src/snippets/audio/main.cpp @@ -89,9 +89,9 @@ private: { //![1] QAudioFormat format; - format.setFrequency(44100); + format.setSampleRate(44100); //![1] - format.setChannels(2); + format.setChannelCount(2); format.setSampleSize(16); format.setCodec("audio/pcm"); format.setByteOrder(QAudioFormat::LittleEndian); diff --git a/examples/multimedia/audiodevices/audiodevices.cpp b/examples/multimedia/audiodevices/audiodevices.cpp index 4198605..bf6d2d0 100644 --- a/examples/multimedia/audiodevices/audiodevices.cpp +++ b/examples/multimedia/audiodevices/audiodevices.cpp @@ -108,8 +108,8 @@ void AudioTest::test() } else { QAudioFormat nearest = deviceInfo.nearestFormat(settings); logOutput->append(tr("Failed")); - nearestFreq->setText(QString("%1").arg(nearest.frequency())); - nearestChannel->setText(QString("%1").arg(nearest.channels())); + nearestFreq->setText(QString("%1").arg(nearest.sampleRate())); + nearestChannel->setText(QString("%1").arg(nearest.channelCount())); nearestCodec->setText(nearest.codec()); nearestSampleSize->setText(QString("%1").arg(nearest.sampleSize())); @@ -161,18 +161,18 @@ void AudioTest::deviceChanged(int idx) deviceInfo = deviceBox->itemData(idx).value(); frequencyBox->clear(); - QList freqz = deviceInfo.supportedFrequencies(); + QList freqz = deviceInfo.supportedSampleRates(); for(int i = 0; i < freqz.size(); ++i) frequencyBox->addItem(QString("%1").arg(freqz.at(i))); if(freqz.size()) - settings.setFrequency(freqz.at(0)); + settings.setSampleRate(freqz.at(0)); channelsBox->clear(); - QList chz = deviceInfo.supportedChannels(); + QList chz = deviceInfo.supportedChannelCounts(); for(int i = 0; i < chz.size(); ++i) channelsBox->addItem(QString("%1").arg(chz.at(i))); if(chz.size()) - settings.setChannels(chz.at(0)); + settings.setChannelCount(chz.at(0)); codecsBox->clear(); QStringList codecz = deviceInfo.supportedCodecs(); @@ -229,12 +229,12 @@ void AudioTest::deviceChanged(int idx) void AudioTest::freqChanged(int idx) { // freq has changed - settings.setFrequency(frequencyBox->itemText(idx).toInt()); + settings.setSampleRate(frequencyBox->itemText(idx).toInt()); } void AudioTest::channelChanged(int idx) { - settings.setChannels(channelsBox->itemText(idx).toInt()); + settings.setChannelCount(channelsBox->itemText(idx).toInt()); } void AudioTest::codecChanged(int idx) diff --git a/examples/multimedia/audioinput/audioinput.cpp b/examples/multimedia/audioinput/audioinput.cpp index 3d537a2..3349d54 100644 --- a/examples/multimedia/audioinput/audioinput.cpp +++ b/examples/multimedia/audioinput/audioinput.cpp @@ -196,8 +196,8 @@ InputTest::InputTest() pullMode = true; // AudioInfo class only supports mono S16LE samples! - format.setFrequency(8000); - format.setChannels(1); + format.setSampleRate(8000); + format.setChannelCount(1); format.setSampleSize(16); format.setSampleType(QAudioFormat::SignedInt); format.setByteOrder(QAudioFormat::LittleEndian); diff --git a/examples/multimedia/audiooutput/audiooutput.cpp b/examples/multimedia/audiooutput/audiooutput.cpp index c92bbaf..7a76c82 100644 --- a/examples/multimedia/audiooutput/audiooutput.cpp +++ b/examples/multimedia/audiooutput/audiooutput.cpp @@ -164,8 +164,8 @@ AudioTest::AudioTest() gen->start(); - settings.setFrequency(SYSTEM_FREQ); - settings.setChannels(1); + settings.setSampleRate(SYSTEM_FREQ); + settings.setChannelCount(1); settings.setSampleSize(16); settings.setCodec("audio/pcm"); settings.setByteOrder(QAudioFormat::LittleEndian); diff --git a/src/multimedia/audio/qaudio_mac.cpp b/src/multimedia/audio/qaudio_mac.cpp index 1cd9225..d876745 100644 --- a/src/multimedia/audio/qaudio_mac.cpp +++ b/src/multimedia/audio/qaudio_mac.cpp @@ -48,8 +48,8 @@ QT_BEGIN_NAMESPACE QDebug operator<<(QDebug dbg, const QAudioFormat& audioFormat) { dbg.nospace() << "QAudioFormat(" << - audioFormat.frequency() << "," << - audioFormat.channels() << "," << + audioFormat.sampleRate() << "," << + audioFormat.channelCount() << "," << audioFormat.sampleSize()<< "," << audioFormat.codec() << "," << audioFormat.byteOrder() << "," << @@ -64,8 +64,8 @@ QAudioFormat toQAudioFormat(AudioStreamBasicDescription const& sf) { QAudioFormat audioFormat; - audioFormat.setFrequency(sf.mSampleRate); - audioFormat.setChannels(sf.mChannelsPerFrame); + audioFormat.setSampleRate(sf.mSampleRate); + audioFormat.setChannelCount(sf.mChannelsPerFrame); audioFormat.setSampleSize(sf.mBitsPerChannel); audioFormat.setCodec(QString::fromLatin1("audio/pcm")); audioFormat.setByteOrder(sf.mFormatFlags & kLinearPCMFormatFlagIsBigEndian != 0 ? QAudioFormat::BigEndian : QAudioFormat::LittleEndian); @@ -84,9 +84,9 @@ AudioStreamBasicDescription toAudioStreamBasicDescription(QAudioFormat const& au AudioStreamBasicDescription sf; sf.mFormatFlags = kAudioFormatFlagIsPacked; - sf.mSampleRate = audioFormat.frequency(); + sf.mSampleRate = audioFormat.sampleRate(); sf.mFramesPerPacket = 1; - sf.mChannelsPerFrame = audioFormat.channels(); + sf.mChannelsPerFrame = audioFormat.channelCount(); sf.mBitsPerChannel = audioFormat.sampleSize(); sf.mBytesPerFrame = sf.mChannelsPerFrame * (sf.mBitsPerChannel / 8); sf.mBytesPerPacket = sf.mFramesPerPacket * sf.mBytesPerFrame; diff --git a/src/multimedia/audio/qaudiodeviceinfo.cpp b/src/multimedia/audio/qaudiodeviceinfo.cpp index dce2884..45e177e 100644 --- a/src/multimedia/audio/qaudiodeviceinfo.cpp +++ b/src/multimedia/audio/qaudiodeviceinfo.cpp @@ -100,13 +100,13 @@ public: You can also query each device for the formats it supports. A format in this context is a set consisting of a specific byte - order, channel, codec, frequency, sample rate, and sample type. A + order, channel, codec, sample rate, sample size and sample type. A format is represented by the QAudioFormat class. The values supported by the the device for each of these parameters can be fetched with - supportedByteOrders(), supportedChannels(), supportedCodecs(), - supportedFrequencies(), supportedSampleSizes(), and + supportedByteOrders(), supportedChannelCounts(), supportedCodecs(), + supportedSampleRates(), supportedSampleSizes(), and supportedSampleTypes(). The combinations supported are dependent on the platform, audio plugins installed and the audio device capabilities. If you need a specific format, you can check if the device supports it with isFormatSupported(), or fetch a @@ -259,6 +259,19 @@ QStringList QAudioDeviceInfo::supportedCodecs() const } /*! + Returns a list of supported sample rates. +*/ + +QList QAudioDeviceInfo::supportedSampleRates() const +{ + return supportedFrequencies(); +} + +/*! + \obsolete + + Use supportedSampleRates() instead. + Returns a list of supported frequencies. */ @@ -268,6 +281,19 @@ QList QAudioDeviceInfo::supportedFrequencies() const } /*! + Returns a list of supported channel counts. +*/ + +QList QAudioDeviceInfo::supportedChannelCounts() const +{ + return supportedChannels(); +} + +/*! + \obsolete + + Use supportedChannelCount() instead. + Returns a list of supported channels. */ diff --git a/src/multimedia/audio/qaudiodeviceinfo.h b/src/multimedia/audio/qaudiodeviceinfo.h index 53b9904..134b688 100644 --- a/src/multimedia/audio/qaudiodeviceinfo.h +++ b/src/multimedia/audio/qaudiodeviceinfo.h @@ -84,7 +84,9 @@ public: QStringList supportedCodecs() const; QList supportedFrequencies() const; + QList supportedSampleRates() const; QList supportedChannels() const; + QList supportedChannelCounts() const; QList supportedSampleSizes() const; QList supportedByteOrders() const; QList supportedSampleTypes() const; diff --git a/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp b/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp index e828238..08c617b 100644 --- a/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp +++ b/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp @@ -78,20 +78,20 @@ QAudioFormat QAudioDeviceInfoInternal::preferredFormat() const { QAudioFormat nearest; if(mode == QAudio::AudioOutput) { - nearest.setFrequency(44100); - nearest.setChannels(2); + nearest.setSampleRate(44100); + nearest.setChannelCount(2); nearest.setByteOrder(QAudioFormat::LittleEndian); nearest.setSampleType(QAudioFormat::SignedInt); nearest.setSampleSize(16); nearest.setCodec(QLatin1String("audio/pcm")); } else { - nearest.setFrequency(8000); - nearest.setChannels(1); + nearest.setSampleRate(8000); + nearest.setChannelCount(1); nearest.setSampleType(QAudioFormat::UnSignedInt); nearest.setSampleSize(8); nearest.setCodec(QLatin1String("audio/pcm")); if(!testSettings(nearest)) { - nearest.setChannels(2); + nearest.setChannelCount(2); nearest.setSampleSize(16); nearest.setSampleType(QAudioFormat::SignedInt); } @@ -234,8 +234,8 @@ bool QAudioDeviceInfoInternal::testSettings(const QAudioFormat& format) const snd_pcm_hw_params_any( handle, params ); // set the values! - snd_pcm_hw_params_set_channels(handle,params,format.channels()); - snd_pcm_hw_params_set_rate(handle,params,format.frequency(),dir); + snd_pcm_hw_params_set_channels(handle,params,format.channelCount()); + snd_pcm_hw_params_set_rate(handle,params,format.sampleRate(),dir); switch(format.sampleSize()) { case 8: if(format.sampleType() == QAudioFormat::SignedInt) @@ -276,18 +276,18 @@ bool QAudioDeviceInfoInternal::testSettings(const QAudioFormat& format) const } else testCodec = true; - if(err>=0 && format.channels() != -1) { - err = snd_pcm_hw_params_test_channels(handle,params,format.channels()); + if(err>=0 && format.channelCount() != -1) { + err = snd_pcm_hw_params_test_channels(handle,params,format.channelCount()); if(err>=0) - err = snd_pcm_hw_params_set_channels(handle,params,format.channels()); + err = snd_pcm_hw_params_set_channels(handle,params,format.channelCount()); if(err>=0) testChannel = true; } - if(err>=0 && format.frequency() != -1) { - err = snd_pcm_hw_params_test_rate(handle,params,format.frequency(),0); + if(err>=0 && format.sampleRate() != -1) { + err = snd_pcm_hw_params_test_rate(handle,params,format.sampleRate(),0); if(err>=0) - err = snd_pcm_hw_params_set_rate(handle,params,format.frequency(),dir); + err = snd_pcm_hw_params_set_rate(handle,params,format.sampleRate(),dir); if(err>=0) testFreq = true; } diff --git a/src/multimedia/audio/qaudiodeviceinfo_mac_p.cpp b/src/multimedia/audio/qaudiodeviceinfo_mac_p.cpp index ec07748..258132a 100644 --- a/src/multimedia/audio/qaudiodeviceinfo_mac_p.cpp +++ b/src/multimedia/audio/qaudiodeviceinfo_mac_p.cpp @@ -144,10 +144,10 @@ QAudioFormat QAudioDeviceInfoInternal::nearestFormat(const QAudioFormat& format) rc.setCodec(QString::fromLatin1("audio/pcm")); - if (rc.frequency() != target.frequency()) - rc.setFrequency(target.frequency()); - if (rc.channels() != target.channels()) - rc.setChannels(target.channels()); + if (rc.sampleRate() != target.sampleRate()) + rc.setSampleRate(target.sampleRate()); + if (rc.channelCount() != target.channelCount()) + rc.setChannelCount(target.channelCount()); if (rc.sampleSize() != target.sampleSize()) rc.setSampleSize(target.sampleSize()); if (rc.byteOrder() != target.byteOrder()) diff --git a/src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp b/src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp index 69d5c94..f77efd0 100644 --- a/src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp +++ b/src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp @@ -95,14 +95,14 @@ QAudioFormat QAudioDeviceInfoInternal::preferredFormat() const QAudioFormat nearest; if(mode == QAudio::AudioOutput) { nearest.setFrequency(44100); - nearest.setChannels(2); + nearest.setChannelCount(2); nearest.setByteOrder(QAudioFormat::LittleEndian); nearest.setSampleType(QAudioFormat::SignedInt); nearest.setSampleSize(16); nearest.setCodec(QLatin1String("audio/pcm")); } else { nearest.setFrequency(11025); - nearest.setChannels(1); + nearest.setChannelCount(1); nearest.setSampleType(QAudioFormat::SignedInt); nearest.setSampleSize(8); nearest.setCodec(QLatin1String("audio/pcm")); @@ -180,12 +180,12 @@ bool QAudioDeviceInfoInternal::testSettings(const QAudioFormat& format) const if(!format.codec().startsWith(QLatin1String("audio/pcm"))) failed = true; - if(!failed && !(format.channels() == 1 || format.channels() == 2)) + if(!failed && !(format.channelCount() == 1 || format.channelCount() == 2)) failed = true; if(!failed) { - if(!(format.frequency() == 8000 || format.frequency() == 11025 || format.frequency() == 22050 || - format.frequency() == 44100 || format.frequency() == 48000 || format.frequency() == 96000)) + if(!(format.sampleRate() == 8000 || format.sampleRate() == 11025 || format.sampleRate() == 22050 || + format.sampleRate() == 44100 || format.sampleRate() == 48000 || format.sampleRate() == 96000)) failed = true; } diff --git a/src/multimedia/audio/qaudioformat.cpp b/src/multimedia/audio/qaudioformat.cpp index 86fe85b..e31d2ec 100644 --- a/src/multimedia/audio/qaudioformat.cpp +++ b/src/multimedia/audio/qaudioformat.cpp @@ -111,7 +111,7 @@ public: \o Parameter \o Description \row - \o Frequency + \o Sample Rate \o Samples per second of audio data in Hertz. \row \o Number of channels @@ -143,8 +143,8 @@ public: Values are initialized as follows: \list - \o frequency() = -1 - \o channels() = -1 + \o sampleRate() = -1 + \o channelCount() = -1 \o sampleSize() = -1 \o byteOrder() = QAudioFormat::Endian(QSysInfo::ByteOrder) \o sampleType() = QAudioFormat::Unknown @@ -227,7 +227,20 @@ bool QAudioFormat::isNull() const } /*! - Sets the frequency to \a frequency. + Sets the sample rate to \a samplerate Hertz. +*/ + +void QAudioFormat::setSampleRate(int samplerate) +{ + d->frequency = samplerate; +} + +/*! + \obsolete + + Use setSampleRate() instead. + + Sets the frequency to \a frequency Hertz. */ void QAudioFormat::setFrequency(int frequency) @@ -236,7 +249,20 @@ void QAudioFormat::setFrequency(int frequency) } /*! - Returns the current frequency value. + Returns the current sample rate in Hertz. +*/ + +int QAudioFormat::sampleRate() const +{ + return d->frequency; +} + +/*! + \obsolete + + Use sampleRate() instead. + + Returns the current frequency in Hertz. */ int QAudioFormat::frequency() const @@ -245,7 +271,20 @@ int QAudioFormat::frequency() const } /*! - Sets the channels to \a channels. + Sets the channel count to \a channels. +*/ + +void QAudioFormat::setChannelCount(int channels) +{ + d->channels = channels; +} + +/*! + \obsolete + + Use setChannelCount() instead. + + Sets the no. of channels to \a channels. */ void QAudioFormat::setChannels(int channels) @@ -254,7 +293,20 @@ void QAudioFormat::setChannels(int channels) } /*! - Returns the current channel value. + Returns the current channel count value. +*/ + +int QAudioFormat::channelCount() const +{ + return d->channels; +} + +/*! + \obsolete + + Use channelCount() instead. + + Returns the no. of channels. */ int QAudioFormat::channels() const diff --git a/src/multimedia/audio/qaudioformat.h b/src/multimedia/audio/qaudioformat.h index d5841ce..f64dd7e 100644 --- a/src/multimedia/audio/qaudioformat.h +++ b/src/multimedia/audio/qaudioformat.h @@ -76,6 +76,12 @@ public: void setFrequency(int frequency); int frequency() const; + void setSampleRate(int samplerate); + int sampleRate() const; + + void setChannelCount(int channels); + int channelCount() const; + void setChannels(int channels); int channels() const; diff --git a/src/multimedia/audio/qaudioinput.cpp b/src/multimedia/audio/qaudioinput.cpp index 7a3be23..8f2d75b 100644 --- a/src/multimedia/audio/qaudioinput.cpp +++ b/src/multimedia/audio/qaudioinput.cpp @@ -85,8 +85,8 @@ QT_BEGIN_NAMESPACE QAudioFormat format; // set up the format you want, eg. - format.setFrequency(8000); - format.setChannels(1); + format.setSampleRate(8000); + format.setChannelCount(1); format.setSampleSize(8); format.setCodec("audio/pcm"); format.setByteOrder(QAudioFormat::LittleEndian); diff --git a/src/multimedia/audio/qaudioinput_alsa_p.cpp b/src/multimedia/audio/qaudioinput_alsa_p.cpp index 9eb8cfb..b6fff64 100644 --- a/src/multimedia/audio/qaudioinput_alsa_p.cpp +++ b/src/multimedia/audio/qaudioinput_alsa_p.cpp @@ -256,7 +256,7 @@ bool QAudioInputPrivate::open() int dir; int err=-1; int count=0; - unsigned int freakuency=settings.frequency(); + unsigned int freakuency=settings.sampleRate(); QString dev = QString(QLatin1String(m_device.constData())); if(!dev.contains(QLatin1String("default"))) { @@ -323,7 +323,7 @@ bool QAudioInputPrivate::open() } } if ( !fatal ) { - err = snd_pcm_hw_params_set_channels( handle, hwparams, (unsigned int)settings.channels() ); + err = snd_pcm_hw_params_set_channels( handle, hwparams, (unsigned int)settings.channelCount() ); if ( err < 0 ) { fatal = true; errMessage = QString::fromLatin1("QAudioInput: snd_pcm_hw_params_set_channels: err = %1").arg(err); @@ -496,7 +496,7 @@ qint64 QAudioInputPrivate::read(char* data, qint64 len) errorState = QAudio::NoError; deviceState = QAudio::IdleState; } else { - totalTimeValue += snd_pcm_bytes_to_frames(handle, err)*1000000/settings.frequency(); + totalTimeValue += snd_pcm_bytes_to_frames(handle, err)*1000000/settings.sampleRate(); resuming = false; errorState = QAudio::NoError; deviceState = QAudio::ActiveState; @@ -693,7 +693,7 @@ qint64 InputPrivate::readData( char* data, qint64 len) count++; } if(err > 0 && readFrames > 0) { - audioDevice->totalTimeValue += readFrames*1000/audioDevice->settings.frequency()*1000; + audioDevice->totalTimeValue += readFrames*1000/audioDevice->settings.sampleRate()*1000; audioDevice->deviceState = QAudio::ActiveState; return err; } diff --git a/src/multimedia/audio/qaudioinput_mac_p.cpp b/src/multimedia/audio/qaudioinput_mac_p.cpp index cb05920..c88c558 100644 --- a/src/multimedia/audio/qaudioinput_mac_p.cpp +++ b/src/multimedia/audio/qaudioinput_mac_p.cpp @@ -814,7 +814,7 @@ int QAudioInputPrivate::notifyInterval() const qint64 QAudioInputPrivate::totalTime() const { - return totalFrames * 1000000 / audioFormat.frequency(); + return totalFrames * 1000000 / audioFormat.sampleRate(); } qint64 QAudioInputPrivate::clock() const diff --git a/src/multimedia/audio/qaudioinput_win32_p.cpp b/src/multimedia/audio/qaudioinput_win32_p.cpp index a059e76..ca0bc24 100644 --- a/src/multimedia/audio/qaudioinput_win32_p.cpp +++ b/src/multimedia/audio/qaudioinput_win32_p.cpp @@ -217,21 +217,21 @@ bool QAudioInputPrivate::open() header = 0; if(buffer_size == 0) { // Default buffer size, 100ms, default period size is 20ms - buffer_size = settings.frequency()*settings.channels()*(settings.sampleSize()/8)*0.1; + buffer_size = settings.sampleRate()*settings.channelCount()*(settings.sampleSize()/8)*0.1; period_size = buffer_size/5; } else { period_size = buffer_size/5; } #ifdef Q_OS_WINCE // For wince reduce size to 40ms for buffer size and 20ms period - buffer_size = settings.frequency()*settings.channels()*(settings.sampleSize()/8)*0.04; + buffer_size = settings.sampleRate()*settings.channelCount()*(settings.sampleSize()/8)*0.04; period_size = buffer_size/2; #endif timeStamp.restart(); elapsedTimeOffset = 0; - wfx.nSamplesPerSec = settings.frequency(); + wfx.nSamplesPerSec = settings.sampleRate(); wfx.wBitsPerSample = settings.sampleSize(); - wfx.nChannels = settings.channels(); + wfx.nChannels = settings.channelCount(); wfx.cbSize = 0; wfx.wFormatTag = WAVE_FORMAT_PCM; @@ -367,8 +367,8 @@ qint64 QAudioInputPrivate::read(char* data, qint64 len) } else { totalTimeValue += waveBlocks[header].dwBytesRecorded - /((settings.channels()*settings.sampleSize()/8)) - *10000/settings.frequency()*100; + /((settings.channelCount()*settings.sampleSize()/8)) + *10000/settings.sampleRate()*100; errorState = QAudio::NoError; deviceState = QAudio::ActiveState; resuming = false; @@ -381,8 +381,8 @@ qint64 QAudioInputPrivate::read(char* data, qint64 len) qDebug()<<"IN: "< 0) { - totalTimeValue += err*1000000/settings.frequency(); + totalTimeValue += err*1000000/settings.sampleRate(); resuming = false; errorState = QAudio::NoError; deviceState = QAudio::ActiveState; diff --git a/src/multimedia/audio/qaudiooutput_mac_p.cpp b/src/multimedia/audio/qaudiooutput_mac_p.cpp index f23db80..5bb872f 100644 --- a/src/multimedia/audio/qaudiooutput_mac_p.cpp +++ b/src/multimedia/audio/qaudiooutput_mac_p.cpp @@ -87,8 +87,8 @@ public: m_device(0) { m_buffer = new QAudioRingBuffer(bufferSize + (bufferSize % maxPeriodSize == 0 ? 0 : maxPeriodSize - (bufferSize % maxPeriodSize))); - m_bytesPerFrame = (audioFormat.sampleSize() / 8) * audioFormat.channels(); - m_periodTime = m_maxPeriodSize / m_bytesPerFrame * 1000 / audioFormat.frequency(); + m_bytesPerFrame = (audioFormat.sampleSize() / 8) * audioFormat.channelCount(); + m_periodTime = m_maxPeriodSize / m_bytesPerFrame * 1000 / audioFormat.sampleRate(); m_fillTimer = new QTimer(this); connect(m_fillTimer, SIGNAL(timeout()), SLOT(fillBuffer())); @@ -546,7 +546,7 @@ int QAudioOutputPrivate::notifyInterval() const qint64 QAudioOutputPrivate::totalTime() const { - return totalFrames * 1000000 / audioFormat.frequency(); + return totalFrames * 1000000 / audioFormat.sampleRate(); } qint64 QAudioOutputPrivate::clock() const diff --git a/src/multimedia/audio/qaudiooutput_win32_p.cpp b/src/multimedia/audio/qaudiooutput_win32_p.cpp index 1810ed2..4a77386 100644 --- a/src/multimedia/audio/qaudiooutput_win32_p.cpp +++ b/src/multimedia/audio/qaudiooutput_win32_p.cpp @@ -205,7 +205,7 @@ bool QAudioOutputPrivate::open() #endif if(buffer_size == 0) { // Default buffer size, 200ms, default period size is 40ms - buffer_size = settings.frequency()*settings.channels()*(settings.sampleSize()/8)*0.2; + buffer_size = settings.sampleRate()*settings.channelCount()*(settings.sampleSize()/8)*0.2; period_size = buffer_size/5; } else { period_size = buffer_size/5; @@ -224,9 +224,9 @@ bool QAudioOutputPrivate::open() timeStamp.restart(); elapsedTimeOffset = 0; - wfx.nSamplesPerSec = settings.frequency(); + wfx.nSamplesPerSec = settings.sampleRate(); wfx.wBitsPerSample = settings.sampleSize(); - wfx.nChannels = settings.channels(); + wfx.nChannels = settings.channelCount(); wfx.cbSize = 0; wfx.wFormatTag = WAVE_FORMAT_PCM; @@ -281,8 +281,8 @@ void QAudioOutputPrivate::close() return; deviceState = QAudio::StopState; - int delay = (buffer_size-bytesFree())*1000/(settings.frequency() - *settings.channels()*(settings.sampleSize()/8)); + int delay = (buffer_size-bytesFree())*1000/(settings.sampleRate() + *settings.channelCount()*(settings.sampleSize()/8)); waveOutReset(hWaveOut); Sleep(delay+10); @@ -378,8 +378,8 @@ qint64 QAudioOutputPrivate::write( const char *data, qint64 len ) LeaveCriticalSection(&waveOutCriticalSection); #endif totalTimeValue += current->dwBufferLength - /(settings.channels()*(settings.sampleSize()/8)) - *1000000/settings.frequency();; + /(settings.channelCount()*(settings.sampleSize()/8)) + *1000000/settings.sampleRate();; waveCurrentBlock++; waveCurrentBlock %= buffer_size/period_size; current = &waveBlocks[waveCurrentBlock]; diff --git a/tests/auto/qaudiodeviceinfo/tst_qaudiodeviceinfo.cpp b/tests/auto/qaudiodeviceinfo/tst_qaudiodeviceinfo.cpp index 7b9a422..45ebc5f 100644 --- a/tests/auto/qaudiodeviceinfo/tst_qaudiodeviceinfo.cpp +++ b/tests/auto/qaudiodeviceinfo/tst_qaudiodeviceinfo.cpp @@ -128,7 +128,7 @@ void tst_QAudioDeviceInfo::codecs() void tst_QAudioDeviceInfo::channels() { if(available) { - QList avail = device->supportedChannels(); + QList avail = device->supportedChannelCounts(); QVERIFY(avail.size() > 0); } } @@ -160,7 +160,7 @@ void tst_QAudioDeviceInfo::sampleTypes() void tst_QAudioDeviceInfo::frequencies() { if(available) { - QList avail = device->supportedFrequencies(); + QList avail = device->supportedSampleRates(); QVERIFY(avail.size() > 0); } } @@ -169,8 +169,8 @@ void tst_QAudioDeviceInfo::isformat() { if(available) { QAudioFormat format; - format.setFrequency(44100); - format.setChannels(2); + format.setSampleRate(44100); + format.setChannelCount(2); format.setSampleType(QAudioFormat::SignedInt); format.setByteOrder(QAudioFormat::LittleEndian); format.setSampleSize(16); @@ -185,8 +185,8 @@ void tst_QAudioDeviceInfo::preferred() { if(available) { QAudioFormat format = device->preferredFormat(); - QVERIFY(format.frequency() == 44100); - QVERIFY(format.channels() == 2); + QVERIFY(format.sampleRate() == 44100); + QVERIFY(format.channelCount() == 2); } } @@ -194,9 +194,9 @@ void tst_QAudioDeviceInfo::nearest() { if(available) { QAudioFormat format1, format2; - format1.setFrequency(8000); + format1.setSampleRate(8000); format2 = device->nearestFormat(format1); - QVERIFY(format2.frequency() == 44100); + QVERIFY(format2.sampleRate() == 44100); } } diff --git a/tests/auto/qaudioformat/tst_qaudioformat.cpp b/tests/auto/qaudioformat/tst_qaudioformat.cpp index 286e63f..5d70fed 100644 --- a/tests/auto/qaudioformat/tst_qaudioformat.cpp +++ b/tests/auto/qaudioformat/tst_qaudioformat.cpp @@ -92,7 +92,7 @@ void tst_QAudioFormat::checkFrequency() void tst_QAudioFormat::checkChannels() { QAudioFormat audioFormat; - audioFormat.setChannels(2); + audioFormat.setChannelCount(2); QVERIFY(audioFormat.channels() == 2); } @@ -135,14 +135,14 @@ void tst_QAudioFormat::checkEquality() // on filled formats audioFormat0.setFrequency(8000); - audioFormat0.setChannels(1); + audioFormat0.setChannelCount(1); audioFormat0.setSampleSize(8); audioFormat0.setCodec("audio/pcm"); audioFormat0.setByteOrder(QAudioFormat::LittleEndian); audioFormat0.setSampleType(QAudioFormat::UnSignedInt); audioFormat1.setFrequency(8000); - audioFormat1.setChannels(1); + audioFormat1.setChannelCount(1); audioFormat1.setSampleSize(8); audioFormat1.setCodec("audio/pcm"); audioFormat1.setByteOrder(QAudioFormat::LittleEndian); @@ -151,7 +151,7 @@ void tst_QAudioFormat::checkEquality() QVERIFY(audioFormat0 == audioFormat1); QVERIFY(!(audioFormat0 != audioFormat1)); - audioFormat0.setFrequency(44100); + audioFormat0.setSampleRate(44100); QVERIFY(audioFormat0 != audioFormat1); QVERIFY(!(audioFormat0 == audioFormat1)); } @@ -162,7 +162,7 @@ void tst_QAudioFormat::checkAssignment() QAudioFormat audioFormat1; audioFormat0.setFrequency(8000); - audioFormat0.setChannels(1); + audioFormat0.setChannelCount(1); audioFormat0.setSampleSize(8); audioFormat0.setCodec("audio/pcm"); audioFormat0.setByteOrder(QAudioFormat::LittleEndian); diff --git a/tests/auto/qaudioinput/tst_qaudioinput.cpp b/tests/auto/qaudioinput/tst_qaudioinput.cpp index 3efc346..bb1ac70 100644 --- a/tests/auto/qaudioinput/tst_qaudioinput.cpp +++ b/tests/auto/qaudioinput/tst_qaudioinput.cpp @@ -68,8 +68,8 @@ private: void tst_QAudioInput::initTestCase() { - format.setFrequency(8000); - format.setChannels(1); + format.setSampleRate(8000); + format.setChannelCount(1); format.setSampleSize(8); format.setCodec("audio/pcm"); format.setByteOrder(QAudioFormat::LittleEndian); @@ -94,8 +94,8 @@ void tst_QAudioInput::settings() // Confirm the setting we added in the init function. QAudioFormat f = audio->format(); - QVERIFY(format.channels() == f.channels()); - QVERIFY(format.frequency() == f.frequency()); + QVERIFY(format.channelCount() == f.channelCount()); + QVERIFY(format.sampleRate() == f.sampleRate()); QVERIFY(format.sampleSize() == f.sampleSize()); QVERIFY(format.codec() == f.codec()); QVERIFY(format.byteOrder() == f.byteOrder()); diff --git a/tests/auto/qaudiooutput/tst_qaudiooutput.cpp b/tests/auto/qaudiooutput/tst_qaudiooutput.cpp index b001af1..c3c25d3 100644 --- a/tests/auto/qaudiooutput/tst_qaudiooutput.cpp +++ b/tests/auto/qaudiooutput/tst_qaudiooutput.cpp @@ -71,8 +71,8 @@ private: void tst_QAudioOutput::initTestCase() { - format.setFrequency(8000); - format.setChannels(1); + format.setSampleRate(8000); + format.setChannelCount(1); format.setSampleSize(8); format.setCodec("audio/pcm"); format.setByteOrder(QAudioFormat::LittleEndian); @@ -95,8 +95,8 @@ void tst_QAudioOutput::settings() // Confirm the setting we added in the init function. QAudioFormat f = audio->format(); - QVERIFY(format.channels() == f.channels()); - QVERIFY(format.frequency() == f.frequency()); + QVERIFY(format.channelCount() == f.channelCount()); + QVERIFY(format.sampleRate() == f.sampleRate()); QVERIFY(format.sampleSize() == f.sampleSize()); QVERIFY(format.codec() == f.codec()); QVERIFY(format.byteOrder() == f.byteOrder()); -- cgit v0.12 From 2d1f2bbfa6def2afdf8cc53e4521c4c74c9b1769 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Fri, 15 Jan 2010 07:40:30 +0100 Subject: Doc: Cocoa is now the default Mac port. --- doc/src/development/developing-on-mac.qdoc | 40 ++++++++++++++---------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/doc/src/development/developing-on-mac.qdoc b/doc/src/development/developing-on-mac.qdoc index b0862cf..20eefb7 100644 --- a/doc/src/development/developing-on-mac.qdoc +++ b/doc/src/development/developing-on-mac.qdoc @@ -60,26 +60,26 @@ \section1 What Versions of Mac OS X are Supported? - As of Qt 4.6, Qt supports Mac OS X versions 10.4 and up. It is usually in + As of Qt 4.7, Qt supports Mac OS X versions 10.4 and up. It is usually in the best interest of the developer and user to be running the latest updates to any version. We test internally against Mac OS X 10.4.11 as well as the updated release of Mac OS X 10.5 and Mac OS X 10.6. \section2 Carbon or Cocoa? - Historically, Qt has used the Carbon toolkit, which supports 32-bit - applications on Mac OS X 10.4 and up. Qt 4.5 and up has support for the Cocoa - toolkit, which requires 10.5 and provides 64-bit support. - - This detail is typically not important to Qt application developers. Qt is - cross-platform across Carbon and Cocoa, and Qt applications behave - the same way when configured for either one. Eventually, the Carbon - version will be discontinued. This is something to keep in mind when you - consider writing code directly against native APIs. - - The current binary for Qt is built in two flavors, 32-bit Carbon and full - universal Cocoa (32-bit and 64-bit). If you want a different setup for - Qt will use, you must build from scratch. Carbon or Cocoa is chosen when + Qt supports building in two flavors, using either the Carbon or Cocoa APIs. + Using the Cocoa toolkit, Qt requires 10.5 and provides 64-bit support. With + Carbon Qt can be developed on and deployed to 10.4, but there is no 64-bit + support. + + With Qt 4.7 we now reccommend using the Cocoa version of Qt for developement, + unless you want to target the 10.4 platform. Qt now uses Cocoa by default, + both for the binary package and when configuring from source. Download the + Carbon binarypackages or configure with "-carbon" to use that version. + + There are two versions of the Qt binary, one with x86 and x86_64 + Cocoa and another with x86 and ppc Carbon. If you want a different setup + you must build from source. Carbon or Cocoa is chosen when configuring the package for building. The configure process selects Carbon by default, to specify Cocoa use the \c{-cocoa} flag. configure for a 64-bit architecture using one of the \c{-arch} flags (see \l{universal @@ -147,13 +147,11 @@ Carbon and Cocoa both have their advantages and disadvantages. Probably the easiest way to determine is to look at the version of Mac OS X you are - targetting. If you are starting a new application and can target 10.5 and - up, then please consider Cocoa only. If you have an existing application or - need to target earlier versions of the operating system and do not need - access to 64-bit or newer Apple technologies, then Carbon is a good fit. If - your needs fall in between, you can go with a 64-bit Cocoa and 32-bit - Carbon universal application with the appropriate checks in your code to - choose the right path based on where you are running the application. + targetting. If your application can target 10.5 and up, then we reccomend + using Cocoa. If you need to target earlier versions of the operating system + and do not need access to 64-bit or newer Apple technologies, then Carbon + is a good fit. If your needs fall in between, you can go with a 64-bit Cocoa and 32-bit + Carbon universal application. For Mac OS X 10.6, Apple has started recommending developers to build their applications 64-bit. The main reason is that there is a small speed -- cgit v0.12 From 27ed53bbdcbb8ee9c9916bf90e5c9fe8157091ec Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Thu, 14 Jan 2010 13:21:21 +0100 Subject: Cococa: QDialogs stays on top when application is not active At one point in history, we decided that QDialogs should stack just above normal windows. This patch reverts this behaviour, as cocoa gets confused if we stack a dialog at this level without telling it to be modal. So instead, we let cocoa set the modal window level when we create a modal session, and also let cocoa restore the level to what it were when the sessions ends. That way, we avoid doing the work that cocoa is allready designed to do. Task-number: QTBUG-5057 Reviewed-by: msorvig --- src/gui/kernel/qwidget_mac.mm | 73 ++++++++++++++++++++++++------------------- src/gui/kernel/qwidget_p.h | 1 + 2 files changed, 42 insertions(+), 32 deletions(-) diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index a8cc427..2d3c862 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -2194,6 +2194,41 @@ void QWidgetPrivate::finishCreateWindow_sys_Carbon(OSWindowRef windowRef) applyMaxAndMinSizeOnWindow(); } #else // QT_MAC_USE_COCOA + +void QWidgetPrivate::setWindowLevel() +{ + Q_Q(QWidget); + const QWidget * const windowParent = q->window()->parentWidget(); + const QWidget * const primaryWindow = windowParent ? windowParent->window() : 0; + NSInteger winLevel = -1; + + if (q->windowType() == Qt::Popup) { + winLevel = NSPopUpMenuWindowLevel; + // Popup should be in at least the same level as its parent. + if (primaryWindow) { + OSWindowRef parentRef = qt_mac_window_for(primaryWindow); + winLevel = qMax([parentRef level], winLevel); + } + } else if (q->windowType() == Qt::Tool) { + winLevel = NSFloatingWindowLevel; + } else if (q->windowType() == Qt::Dialog) { + // Correct modality level (NSModalPanelWindowLevel) will be + // set by cocoa when creating a modal session later. + winLevel = NSNormalWindowLevel; + } + + // StayOnTop window should appear above Tool windows. + if (data.window_flags & Qt::WindowStaysOnTopHint) + winLevel = NSPopUpMenuWindowLevel; + // Tooltips should appear above StayOnTop windows. + if (q->windowType() == Qt::ToolTip) + winLevel = NSScreenSaverWindowLevel; + // All other types are Normal level. + if (winLevel == -1) + winLevel = NSNormalWindowLevel; + [qt_mac_window_for(q) setLevel:winLevel]; +} + void QWidgetPrivate::finishCreateWindow_sys_Cocoa(void * /*NSWindow * */ voidWindowRef) { Q_Q(QWidget); @@ -2266,6 +2301,7 @@ void QWidgetPrivate::finishCreateWindow_sys_Cocoa(void * /*NSWindow * */ voidWin q->setAttribute(Qt::WA_WState_WindowOpacitySet, false); } + setWindowLevel(); macUpdateHideOnSuspend(); macUpdateOpaqueSizeGrip(); macUpdateIgnoreMouseEvents(); @@ -4697,7 +4733,7 @@ void QWidgetPrivate::setModal_sys() bool alreadySheet = [windowRef styleMask] & NSDocModalWindowMask; if (windowParent && q->windowModality() == Qt::WindowModal){ - // Window should be window-modal, which implies a sheet. + // INVARIANT: Window should be window-modal (which implies a sheet). if (!alreadySheet) { // NB: the following call will call setModal_sys recursivly: recreateMacWindow(); @@ -4714,47 +4750,20 @@ void QWidgetPrivate::setModal_sys() [static_cast(windowRef) setWorksWhenModal:YES]; } } else { - // Window shold not be window-modal, and as such, not a sheet. + // INVARIANT: Window shold _not_ be window-modal (and as such, not a sheet). + // If the window is application modal, there in no need to do much at this point. if (alreadySheet){ // NB: the following call will call setModal_sys recursivly: recreateMacWindow(); windowRef = qt_mac_window_for(q); } - if (q->windowModality() == Qt::ApplicationModal) { - [windowRef setLevel:NSModalPanelWindowLevel]; - } else if (primaryWindow && primaryWindow->windowModality() == Qt::ApplicationModal) { + if (q->windowModality() == Qt::NonModal + && primaryWindow && primaryWindow->windowModality() == Qt::ApplicationModal) { // INVARIANT: Our window is a dialog that has a dialog parent that is // application modal, or . This means that q is supposed to be on top of this // dialog and not be modally shaddowed: - [windowRef setLevel:NSModalPanelWindowLevel]; if ([windowRef isKindOfClass:[NSPanel class]]) [static_cast(windowRef) setWorksWhenModal:YES]; - } else { - // INVARIANT: q should not be modal. - NSInteger winLevel = -1; - if (q->windowType() == Qt::Popup) { - winLevel = NSPopUpMenuWindowLevel; - // Popup should be in at least the same level as its parent. - if (primaryWindow) { - OSWindowRef parentRef = qt_mac_window_for(primaryWindow); - winLevel = qMax([parentRef level], winLevel); - } - } else if (q->windowType() == Qt::Tool) { - winLevel = NSFloatingWindowLevel; - } else if (q->windowType() == Qt::Dialog) { - winLevel = NSModalPanelWindowLevel; - } - - // StayOnTop window should appear above Tool windows. - if (data.window_flags & Qt::WindowStaysOnTopHint) - winLevel = NSPopUpMenuWindowLevel; - // Tooltips should appear above StayOnTop windows. - if (q->windowType() == Qt::ToolTip) - winLevel = NSScreenSaverWindowLevel; - // All other types are Normal level. - if (winLevel == -1) - winLevel = NSNormalWindowLevel; - [windowRef setLevel:winLevel]; } } diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h index f3edf21..318a87a 100644 --- a/src/gui/kernel/qwidget_p.h +++ b/src/gui/kernel/qwidget_p.h @@ -761,6 +761,7 @@ public: void initWindowPtr(); void finishCreateWindow_sys_Carbon(OSWindowRef windowRef); #else + void setWindowLevel(); void finishCreateWindow_sys_Cocoa(void * /*NSWindow * */ windowRef); void syncCocoaMask(); void finishCocoaMaskSetup(); -- cgit v0.12 From 7dee69caea20b189d5f4f8e27179c5abfd73a815 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Fri, 15 Jan 2010 13:19:11 +0100 Subject: Cocoa: sub-windows do not stack in front of parents Seems like this were never implemented. This patch does. Task-number: QTBUG-7375 --- src/gui/kernel/qwidget_mac.mm | 42 +++++++++++++++++++++++++++++++++++------- src/gui/kernel/qwidget_p.h | 1 + 2 files changed, 36 insertions(+), 7 deletions(-) diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index 2d3c862..e30bf95 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -2732,6 +2732,35 @@ void QWidgetPrivate::transferChildren() } } +#ifdef QT_MAC_USE_COCOA +void QWidgetPrivate::setSubWindowStacking(bool set) +{ + Q_Q(QWidget); + if (!q->isWindow() || !q->testAttribute(Qt::WA_WState_Created)) + return; + + if (QWidget *parent = q->parentWidget()) { + if (parent->testAttribute(Qt::WA_WState_Created)) { + if (set) + [qt_mac_window_for(parent) addChildWindow:qt_mac_window_for(q) ordered:NSWindowAbove]; + else + [qt_mac_window_for(parent) removeChildWindow:qt_mac_window_for(q)]; + } + } + + QList widgets = q->findChildren(); + for (int i=0; iisWindow() && child->testAttribute(Qt::WA_WState_Created)) { + if (set) + [qt_mac_window_for(q) addChildWindow:qt_mac_window_for(child) ordered:NSWindowAbove]; + else + [qt_mac_window_for(q) removeChildWindow:qt_mac_window_for(child)]; + } + } +} +#endif + void QWidgetPrivate::setParent_sys(QWidget *parent, Qt::WindowFlags f) { Q_Q(QWidget); @@ -2883,7 +2912,6 @@ void QWidgetPrivate::setParent_sys(QWidget *parent, Qt::WindowFlags f) current = current->parentWidget(); } } - invalidateBuffer(q->rect()); qt_event_request_window_change(q); } @@ -3345,6 +3373,7 @@ void QWidgetPrivate::show_sys() #else // sync the opacity value back (in case of a fade). [window setAlphaValue:q->windowOpacity()]; + setSubWindowStacking(true); QWidget *top = 0; if (QApplicationPrivate::tryModalHelper(q, &top)) { @@ -3361,7 +3390,6 @@ void QWidgetPrivate::show_sys() if (NSWindow *modalWin = qt_mac_window_for(top)) [modalWin orderFront:window]; } - #endif if (q->windowType() == Qt::Popup) { if (q->focusWidget()) @@ -3422,6 +3450,7 @@ void QWidgetPrivate::hide_sys() QMacCocoaAutoReleasePool pool; if(q->isWindow()) { + setSubWindowStacking(false); OSWindowRef window = qt_mac_window_for(q); if(qt_mac_is_macsheet(q)) { #ifndef QT_MAC_USE_COCOA @@ -4751,17 +4780,16 @@ void QWidgetPrivate::setModal_sys() } } else { // INVARIANT: Window shold _not_ be window-modal (and as such, not a sheet). - // If the window is application modal, there in no need to do much at this point. if (alreadySheet){ // NB: the following call will call setModal_sys recursivly: recreateMacWindow(); windowRef = qt_mac_window_for(q); } if (q->windowModality() == Qt::NonModal - && primaryWindow && primaryWindow->windowModality() == Qt::ApplicationModal) { - // INVARIANT: Our window is a dialog that has a dialog parent that is - // application modal, or . This means that q is supposed to be on top of this - // dialog and not be modally shaddowed: + && primaryWindow && primaryWindow->windowModality() == Qt::ApplicationModal) { + // INVARIANT: Our window has a parent that is application modal. + // This means that q is supposed to be on top of this window and + // not be modally shaddowed: if ([windowRef isKindOfClass:[NSPanel class]]) [static_cast(windowRef) setWorksWhenModal:YES]; } diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h index 318a87a..4b98478 100644 --- a/src/gui/kernel/qwidget_p.h +++ b/src/gui/kernel/qwidget_p.h @@ -761,6 +761,7 @@ public: void initWindowPtr(); void finishCreateWindow_sys_Carbon(OSWindowRef windowRef); #else + void setSubWindowStacking(bool set); void setWindowLevel(); void finishCreateWindow_sys_Cocoa(void * /*NSWindow * */ windowRef); void syncCocoaMask(); -- cgit v0.12 From b4dd6ff29bc921ec81b4fd67ed44830e4d697d1d Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Mon, 18 Jan 2010 17:27:54 +0100 Subject: Build fix for MSVC2005 and older SDK --- src/gui/dialogs/qfiledialog_win.cpp | 28 ++------------------- src/gui/dialogs/qfiledialog_win_p.h | 49 +++++++++++++++++++++++++++++++++--- src/gui/util/qsystemtrayicon_win.cpp | 1 - 3 files changed, 47 insertions(+), 31 deletions(-) diff --git a/src/gui/dialogs/qfiledialog_win.cpp b/src/gui/dialogs/qfiledialog_win.cpp index 6128a8a..c2b6950 100644 --- a/src/gui/dialogs/qfiledialog_win.cpp +++ b/src/gui/dialogs/qfiledialog_win.cpp @@ -60,21 +60,6 @@ #ifdef Q_WS_WINCE #include -# ifndef BFFM_SETSELECTION -# define BFFM_SETSELECTION (WM_USER + 102) -# endif -// Windows Mobile has a broken definition for BROWSEINFO -// Only compile fix -typedef struct qt_priv_browseinfo { - HWND hwndOwner; - LPCITEMIDLIST pidlRoot; - LPWSTR pszDisplayName; - LPCWSTR lpszTitle; - UINT ulFlags; - BFFCALLBACK lpfn; - LPARAM lParam; - int iImage; -} qt_BROWSEINFO; bool qt_priv_ptr_valid = false; #else #include "qfiledialog_win_p.h" @@ -457,7 +442,7 @@ static bool qt_win_set_IFileDialogOptions(IFileDialog *pfd, // Add the filters to the file dialog. if (numFilters) { wchar_t *szData = (wchar_t*)winfilters.utf16(); - COMDLG_FILTERSPEC *filterSpec = new COMDLG_FILTERSPEC[numFilters]; + qt_COMDLG_FILTERSPEC *filterSpec = new qt_COMDLG_FILTERSPEC[numFilters]; for(int i = 0; itestAttribute(Qt::WA_WState_Created)); bi.hwndOwner = (parent ? parent->winId() : 0); @@ -760,7 +736,7 @@ QString qt_win_get_existing_directory(const QFileDialogArgs &args) qt_win_resolve_libs(); if (ptrSHBrowseForFolder) { - LPITEMIDLIST pItemIDList = ptrSHBrowseForFolder((BROWSEINFO*)&bi); + LPITEMIDLIST pItemIDList = ptrSHBrowseForFolder(&bi); if (pItemIDList) { ptrSHGetPathFromIDList(pItemIDList, path); IMalloc *pMalloc; diff --git a/src/gui/dialogs/qfiledialog_win_p.h b/src/gui/dialogs/qfiledialog_win_p.h index 6d8c7c9..b55d1ff 100644 --- a/src/gui/dialogs/qfiledialog_win_p.h +++ b/src/gui/dialogs/qfiledialog_win_p.h @@ -39,9 +39,9 @@ ** ****************************************************************************/ -#include +#include #include -#if !defined(QFILEDIAG_WIN_P_H) && !defined(__shobjidl_h__) +#ifndef QFILEDIAG_WIN_P_H //these are the interface declarations needed for the file dialog on Vista and up @@ -50,6 +50,8 @@ //declarations typedef DWORD SICHINTF; +typedef ULONG SFGAOF; +typedef DWORD SHCONTF; #define FOS_OVERWRITEPROMPT 0x2 #define FOS_STRICTFILETYPES 0x4 #define FOS_NOCHANGEDIR 0x8 @@ -83,6 +85,31 @@ typedef int GETPROPERTYSTOREFLAGS; #define GPS_BESTEFFORT 0x00000040 #define GPS_MASK_VALID 0x0000007F +typedef int (CALLBACK* BFFCALLBACK)(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData); +// message from browser +#define BFFM_INITIALIZED 1 +#define BFFM_SELCHANGED 2 +#define BFFM_ENABLEOK (WM_USER + 101) +#define BFFM_SETSELECTION (WM_USER + 103) +#define BFFM_SETSTATUSTEXT (WM_USER + 104) + +// Browsing for directory. +#define BIF_RETURNONLYFSDIRS 0x0001 +#define BIF_DONTGOBELOWDOMAIN 0x0002 +#define BIF_STATUSTEXT 0x0004 +#define BIF_RETURNFSANCESTORS 0x0008 +#define BIF_EDITBOX 0x0010 +#define BIF_VALIDATE 0x0020 +#define BIF_NEWDIALOGSTYLE 0x0040 +#define BIF_BROWSEINCLUDEURLS 0x0080 +#define BIF_UAHINT 0x0100 +#define BIF_NONEWFOLDERBUTTON 0x0200 +#define BIF_NOTRANSLATETARGETS 0x0400 +#define BIF_BROWSEFORCOMPUTER 0x1000 +#define BIF_BROWSEFORPRINTER 0x2000 +#define BIF_BROWSEINCLUDEFILES 0x4000 +#define BIF_SHAREABLE 0x8000 + //the enums typedef enum { SIATTRIBFLAGS_AND = 0x1, @@ -115,11 +142,25 @@ typedef FDE_SHAREVIOLATION_RESPONSE FDE_OVERWRITE_RESPONSE; typedef struct { LPCWSTR pszName; LPCWSTR pszSpec; -} COMDLG_FILTERSPEC; +} qt_COMDLG_FILTERSPEC; +#ifndef PROPERTYKEY_DEFINED +#define PROPERTYKEY_DEFINED typedef struct { GUID fmtid; DWORD pid; } PROPERTYKEY; +#endif +typedef struct { + HWND hwndOwner; + LPCITEMIDLIST pidlRoot; + LPWSTR pszDisplayName; + LPCWSTR lpszTitle; + UINT ulFlags; + BFFCALLBACK lpfn; + LPARAM lParam; + int iImage; +} BROWSEINFO; + DECLARE_INTERFACE(IFileDialogEvents); DECLARE_INTERFACE_(IShellItem, IUnknown) { @@ -157,7 +198,7 @@ DECLARE_INTERFACE_(IModalWindow, IUnknown) }; DECLARE_INTERFACE_(IFileDialog, IModalWindow) { - STDMETHOD(SetFileTypes)(THIS_ UINT cFileTypes, const COMDLG_FILTERSPEC *rgFilterSpec) PURE; + STDMETHOD(SetFileTypes)(THIS_ UINT cFileTypes, const qt_COMDLG_FILTERSPEC *rgFilterSpec) PURE; STDMETHOD(SetFileTypeIndex)(THIS_ UINT iFileType) PURE; STDMETHOD(GetFileTypeIndex)(THIS_ UINT *piFileType) PURE; STDMETHOD(Advise)(THIS_ IFileDialogEvents *pfde, DWORD *pdwCookie) PURE; diff --git a/src/gui/util/qsystemtrayicon_win.cpp b/src/gui/util/qsystemtrayicon_win.cpp index 474555b..51de62b 100644 --- a/src/gui/util/qsystemtrayicon_win.cpp +++ b/src/gui/util/qsystemtrayicon_win.cpp @@ -53,7 +53,6 @@ #include #include -#include #include #include #include -- cgit v0.12 From 5c8c51284b1119f90520b6dbad0ac23fe0487bcf Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Mon, 18 Jan 2010 18:22:38 +0100 Subject: build fix for mingw --- src/gui/dialogs/qfiledialog_win_p.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/gui/dialogs/qfiledialog_win_p.h b/src/gui/dialogs/qfiledialog_win_p.h index b55d1ff..ad3bc14 100644 --- a/src/gui/dialogs/qfiledialog_win_p.h +++ b/src/gui/dialogs/qfiledialog_win_p.h @@ -39,7 +39,6 @@ ** ****************************************************************************/ -#include #include #ifndef QFILEDIAG_WIN_P_H @@ -150,6 +149,15 @@ typedef struct { DWORD pid; } PROPERTYKEY; #endif + +typedef struct { + USHORT cb; + BYTE abID[1]; +} SHITEMID, *LPSHITEMID; +typedef struct { + SHITEMID mkid; +} ITEMIDLIST, *LPITEMIDLIST; +typedef const ITEMIDLIST *LPCITEMIDLIST; typedef struct { HWND hwndOwner; LPCITEMIDLIST pidlRoot; -- cgit v0.12 From 61ce98e3af8f0acdb011e87e281a1440fa7817a7 Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Tue, 19 Jan 2010 11:40:32 +0100 Subject: Updated painter path caching in the GL2 engine after merge. The painter path caching needed to be updated after an optimisation (45fedfeb) in the 4.6 branch was merged into the master branch. --- src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index 2a49d8a..5e41cc1 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -809,16 +809,15 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path) } prepareForDraw(currentBrush.isOpaque()); - glEnableVertexAttribArray(QT_VERTEX_COORDS_ATTR); #ifdef QT_OPENGL_CACHE_AS_VBOS glBindBuffer(GL_ARRAY_BUFFER, cache->vbo); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, cache->ibo); - glVertexAttribPointer(QT_VERTEX_COORDS_ATTR, 2, GL_FLOAT, false, 0, 0); + setVertexAttributePointer(QT_VERTEX_COORDS_ATTR, 0); glDrawElements(cache->primitiveType, cache->indexCount, GL_UNSIGNED_INT, 0); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); glBindBuffer(GL_ARRAY_BUFFER, 0); #else - glVertexAttribPointer(QT_VERTEX_COORDS_ATTR, 2, GL_FLOAT, false, 0, cache->vertices); + setVertexAttributePointer(QT_VERTEX_COORDS_ATTR, cache->vertices); glDrawElements(cache->primitiveType, cache->indexCount, GL_UNSIGNED_INT, cache->indices); #endif -- cgit v0.12 From b80ac6d798577286829154388ac86f4cf0845e19 Mon Sep 17 00:00:00 2001 From: kh1 Date: Tue, 19 Jan 2010 12:55:45 +0100 Subject: Force the creation of the default collection file directory. Fixes error message after starting on a clean working system. --- tools/assistant/tools/assistant/mainwindow.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/assistant/tools/assistant/mainwindow.cpp b/tools/assistant/tools/assistant/mainwindow.cpp index 4e10cba..ac33fc5 100644 --- a/tools/assistant/tools/assistant/mainwindow.cpp +++ b/tools/assistant/tools/assistant/mainwindow.cpp @@ -1132,7 +1132,8 @@ QString MainWindow::collectionFileDirectory(bool createDir, const QString &cache QString MainWindow::defaultHelpCollectionFileName() { TRACE_OBJ - return collectionFileDirectory() + QDir::separator() + + // forces creation of the default collection file path + return collectionFileDirectory(true) + QDir::separator() + QString(QLatin1String("qthelpcollection_%1.qhc")). arg(QLatin1String(QT_VERSION_STR)); } -- cgit v0.12 From 1969f1f291807210f0a1b2fd3dbabb8110b9bb52 Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Tue, 19 Jan 2010 13:29:10 +0100 Subject: Changed QBrush::operator== to also compare the brush transforms. Updated documentation and autotest as well. Reviewed-by: Trond --- src/gui/painting/qbrush.cpp | 36 ++++++++++++++++++------------------ tests/auto/qbrush/tst_qbrush.cpp | 9 +++++++++ 2 files changed, 27 insertions(+), 18 deletions(-) diff --git a/src/gui/painting/qbrush.cpp b/src/gui/painting/qbrush.cpp index 1a83b1d..a82d0f9 100644 --- a/src/gui/painting/qbrush.cpp +++ b/src/gui/painting/qbrush.cpp @@ -912,7 +912,7 @@ void QBrush::setTransform(const QTransform &matrix) otherwise returns false. Two brushes are different if they have different styles, colors or - pixmaps. + transforms or different pixmaps or gradients depending on the style. \sa operator==() */ @@ -924,7 +924,7 @@ void QBrush::setTransform(const QTransform &matrix) otherwise returns false. Two brushes are equal if they have equal styles, colors and - pixmaps. + transforms and equal pixmaps or gradients depending on the style. \sa operator!=() */ @@ -933,26 +933,26 @@ bool QBrush::operator==(const QBrush &b) const { if (b.d == d) return true; - if (b.d->style == d->style && b.d->color == d->color) { - switch (d->style) { - case Qt::TexturePattern: { - QPixmap &us = (static_cast(d.data()))->pixmap(); - QPixmap &them = (static_cast(b.d.data()))->pixmap(); + if (b.d->style != d->style || b.d->color != d->color || b.d->transform != d->transform) + return false; + switch (d->style) { + case Qt::TexturePattern: + { + const QPixmap &us = (static_cast(d.data()))->pixmap(); + const QPixmap &them = (static_cast(b.d.data()))->pixmap(); return ((us.isNull() && them.isNull()) || us.cacheKey() == them.cacheKey()); } - case Qt::LinearGradientPattern: - case Qt::RadialGradientPattern: - case Qt::ConicalGradientPattern: - { - QGradientBrushData *d1 = static_cast(d.data()); - QGradientBrushData *d2 = static_cast(b.d.data()); - return d1->gradient == d2->gradient; - } - default: - return true; + case Qt::LinearGradientPattern: + case Qt::RadialGradientPattern: + case Qt::ConicalGradientPattern: + { + const QGradientBrushData *d1 = static_cast(d.data()); + const QGradientBrushData *d2 = static_cast(b.d.data()); + return d1->gradient == d2->gradient; } + default: + return true; } - return false; } /*! diff --git a/tests/auto/qbrush/tst_qbrush.cpp b/tests/auto/qbrush/tst_qbrush.cpp index bc2bc60..628e859 100644 --- a/tests/auto/qbrush/tst_qbrush.cpp +++ b/tests/auto/qbrush/tst_qbrush.cpp @@ -108,6 +108,15 @@ void tst_QBrush::operator_eq_eq_data() << false; QTest::newRow("rad vs con") << QBrush(QRadialGradient(0, 0, 0, 0, 0)) << QBrush(QConicalGradient(0, 0, 0)) << false; + + QBrush b1(lg); + QBrush b2(lg); + b1.setTransform(QTransform().scale(2, 2)); + QTest::newRow("lg with transform vs same lg") << b1 << b2 << false; + + b2.setTransform(QTransform().scale(2, 2)); + QTest::newRow("lg w/transform vs same lg w/same transform") << b1 << b2 << true; + } void tst_QBrush::operator_eq_eq() -- cgit v0.12 From 3d6cfbbc51f82a03cfa69d027defb0d0a3a9af50 Mon Sep 17 00:00:00 2001 From: Leonardo Sobral Cunha Date: Wed, 20 Jan 2010 16:01:31 +0100 Subject: Removing unused image from git in qgraphicsitem autotest Reviewed-by: trustme --- tests/auto/qgraphicsitem/nestedClipping_reference.png | Bin 638 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 tests/auto/qgraphicsitem/nestedClipping_reference.png diff --git a/tests/auto/qgraphicsitem/nestedClipping_reference.png b/tests/auto/qgraphicsitem/nestedClipping_reference.png deleted file mode 100644 index 3bd4fe7..0000000 Binary files a/tests/auto/qgraphicsitem/nestedClipping_reference.png and /dev/null differ -- cgit v0.12 From 01a54a8d903abddd8b1fbddb1410e56878f41b7c Mon Sep 17 00:00:00 2001 From: ck Date: Thu, 21 Jan 2010 10:30:40 +0100 Subject: Assistant: Fix translations. --- tools/assistant/tools/assistant/main.cpp | 33 +++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/tools/assistant/tools/assistant/main.cpp b/tools/assistant/tools/assistant/main.cpp index d4f4afd..a13bf2e 100644 --- a/tools/assistant/tools/assistant/main.cpp +++ b/tools/assistant/tools/assistant/main.cpp @@ -292,23 +292,26 @@ bool unregisterDocumentation(QHelpEngineCore &collection, return true; } -void setupTranslations(QApplication &app) +void setupTranslation(const QString &fileName, const QString &dir) +{ + QTranslator *translator = new QTranslator(QCoreApplication::instance()); + if (translator->load(fileName, dir)) { + QCoreApplication::installTranslator(translator); + } else { + qWarning("Could not load translation file %s in directory %s.", + qPrintable(fileName), qPrintable(dir)); + } +} + +void setupTranslations() { TRACE_OBJ const QString& locale = QLocale::system().name(); - QString resourceDir = QLibraryInfo::location(QLibraryInfo::TranslationsPath); - - QTranslator translator(0); - translator.load(QLatin1String("assistant_") + locale, resourceDir); - app.installTranslator(&translator); - - QTranslator qtTranslator(0); - qtTranslator.load(QLatin1String("qt_") + locale, resourceDir); - app.installTranslator(&qtTranslator); - - QTranslator qtHelpTranslator(0); - qtHelpTranslator.load(QLatin1String("qt_help_") + locale, resourceDir); - app.installTranslator(&qtHelpTranslator); + const QString &resourceDir + = QLibraryInfo::location(QLibraryInfo::TranslationsPath); + setupTranslation(QLatin1String("assistant_") + locale, resourceDir); + setupTranslation(QLatin1String("qt_") + locale, resourceDir); + setupTranslation(QLatin1String("qt_help_") + locale, resourceDir); } } // Anonymous namespace. @@ -413,7 +416,7 @@ int main(int argc, char *argv[]) cachedCollection.setCurrentFilter(cmd.currentFilter()); } - setupTranslations(a); + setupTranslations(); /* * We need to be careful here: The main window has to be deleted before -- cgit v0.12 From 5bda4e27bbe3fde98bd5c628fada76dfccadad0e Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Thu, 21 Jan 2010 11:31:50 +0100 Subject: Remove statusbaritem on Mac OSX The statusbar item should not draw a frame on Mac OSX. The current frame is essentially redundant and results in non-native appearance on Mac. Task-number: QTBUG-3574 Reviewed-by: morten --- src/gui/styles/qmacstyle_mac.mm | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm index 51c2a96..0e0a9ca 100644 --- a/src/gui/styles/qmacstyle_mac.mm +++ b/src/gui/styles/qmacstyle_mac.mm @@ -3132,7 +3132,6 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai p->drawLine(opt->rect.topLeft(), opt->rect.bottomLeft()); } break; case PE_FrameStatusBarItem: - QCommonStyle::drawPrimitive(pe, opt, p, w); break; case PE_IndicatorTabClose: { bool hover = (opt->state & State_MouseOver); -- cgit v0.12 From 6b92cb8ec199159d629c013fbd4b4b7ab8ad60db Mon Sep 17 00:00:00 2001 From: Leonardo Sobral Cunha Date: Thu, 21 Jan 2010 13:34:52 +0100 Subject: Make the animation api compile when QT_NO_THREAD is defined Task-number: QTBUG-6890 Reviewed-by: Thierry --- src/corelib/animation/qabstractanimation.cpp | 7 +++++++ src/corelib/animation/qpropertyanimation.cpp | 2 ++ src/corelib/animation/qvariantanimation.cpp | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp index b7afd9f..f5a9d16 100644 --- a/src/corelib/animation/qabstractanimation.cpp +++ b/src/corelib/animation/qabstractanimation.cpp @@ -161,7 +161,9 @@ QT_BEGIN_NAMESPACE +#ifndef QT_NO_THREAD Q_GLOBAL_STATIC(QThreadStorage, unifiedTimer) +#endif QUnifiedTimer::QUnifiedTimer() : QObject(), lastTick(0), timingInterval(DEFAULT_TIMER_INTERVAL), @@ -173,12 +175,17 @@ QUnifiedTimer::QUnifiedTimer() : QUnifiedTimer *QUnifiedTimer::instance() { QUnifiedTimer *inst; +#ifndef QT_NO_THREAD if (!unifiedTimer()->hasLocalData()) { inst = new QUnifiedTimer; unifiedTimer()->setLocalData(inst); } else { inst = unifiedTimer()->localData(); } +#else + static QUnifiedTimer unifiedTimer; + inst = &unifiedTimer; +#endif return inst; } diff --git a/src/corelib/animation/qpropertyanimation.cpp b/src/corelib/animation/qpropertyanimation.cpp index eec5b30..ea807db 100644 --- a/src/corelib/animation/qpropertyanimation.cpp +++ b/src/corelib/animation/qpropertyanimation.cpp @@ -264,7 +264,9 @@ void QPropertyAnimation::updateState(QAbstractAnimation::State newState, QPropertyAnimation *animToStop = 0; { +#ifndef QT_NO_THREAD QMutexLocker locker(QMutexPool::globalInstanceGet(&staticMetaObject)); +#endif typedef QPair QPropertyAnimationPair; typedef QHash QPropertyAnimationHash; static QPropertyAnimationHash hash; diff --git a/src/corelib/animation/qvariantanimation.cpp b/src/corelib/animation/qvariantanimation.cpp index 115edbe..173802d 100644 --- a/src/corelib/animation/qvariantanimation.cpp +++ b/src/corelib/animation/qvariantanimation.cpp @@ -431,7 +431,9 @@ void QVariantAnimation::registerInterpolator(QVariantAnimation::Interpolator fun { // will override any existing interpolators QInterpolatorVector *interpolators = registeredInterpolators(); +#ifndef QT_NO_THREAD QMutexLocker locker(QMutexPool::globalInstanceGet(interpolators)); +#endif if (int(interpolationType) >= interpolators->count()) interpolators->resize(int(interpolationType) + 1); interpolators->replace(interpolationType, func); @@ -446,7 +448,9 @@ template static inline QVariantAnimation::Interpolator castToInterpo QVariantAnimation::Interpolator QVariantAnimationPrivate::getInterpolator(int interpolationType) { QInterpolatorVector *interpolators = registeredInterpolators(); +#ifndef QT_NO_THREAD QMutexLocker locker(QMutexPool::globalInstanceGet(interpolators)); +#endif QVariantAnimation::Interpolator ret = 0; if (interpolationType < interpolators->count()) { ret = interpolators->at(interpolationType); -- cgit v0.12 From b739ad7a9f8a81d9f68be53045e3ab9e2ff48ff6 Mon Sep 17 00:00:00 2001 From: ck Date: Thu, 21 Jan 2010 14:56:14 +0100 Subject: Assistant: Simplify check for SQLITE plugin. Reviewed-by: kh1 --- tools/assistant/tools/assistant/main.cpp | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/tools/assistant/tools/assistant/main.cpp b/tools/assistant/tools/assistant/main.cpp index a13bf2e..434a211 100644 --- a/tools/assistant/tools/assistant/main.cpp +++ b/tools/assistant/tools/assistant/main.cpp @@ -223,19 +223,6 @@ bool rebuildSearchIndex(QCoreApplication &app, const QString &collectionFile, return app.exec() == 0; } -bool checkForSqlite(CmdLineParser &cmd) -{ - TRACE_OBJ - QSqlDatabase db; - QStringList sqlDrivers(db.drivers()); - if (!sqlDrivers.contains(QLatin1String("QSQLITE"))) { - cmd.showMessage(QObject::tr("Cannot load sqlite database driver!"), - true); - return false; - } - return true; -} - bool useGui(int argc, char *argv[]) { TRACE_OBJ @@ -407,8 +394,11 @@ int main(int argc, char *argv[]) ? EXIT_SUCCESS : EXIT_FAILURE; } - if (!checkForSqlite(cmd)) + if (!QSqlDatabase::isDriverAvailable(QLatin1String("QSQLITE"))) { + cmd.showMessage(QObject::tr("Cannot load sqlite database driver!"), + true); return EXIT_FAILURE; + } if (!cmd.currentFilter().isEmpty()) { if (collectionFileGiven) -- cgit v0.12 From c74deadf4b7eeb2800b318e0952dac8f700d9236 Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Thu, 21 Jan 2010 14:58:48 +0100 Subject: add QModelIndex::rowCount() and QModelIndex::ColumnCount convenience methods Merge-request: 438 Reviewed-by: Leonardo Sobral Cunha --- src/corelib/kernel/qabstractitemmodel.cpp | 22 +++++++++++++++++++++- src/corelib/kernel/qabstractitemmodel.h | 8 ++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/corelib/kernel/qabstractitemmodel.cpp b/src/corelib/kernel/qabstractitemmodel.cpp index dbf422e..fdbc5ba 100644 --- a/src/corelib/kernel/qabstractitemmodel.cpp +++ b/src/corelib/kernel/qabstractitemmodel.cpp @@ -1043,12 +1043,32 @@ void QAbstractItemModelPrivate::columnsRemoved(const QModelIndex &parent, /*! + \since 4.7 + + \fn int QModelIndex::rowCount() const + + Returns the number of children of this model index. + + \sa columnCount(), parent(), child(), sibling(), model() +*/ + +/*! + \since 4.7 + + \fn int QModelIndex::columnCount() const + + Returns the number of columns for the children of this model index. + + \sa rowCount(), parent(), child(), sibling(), model() +*/ + +/*! \fn QModelIndex QModelIndex::parent() const Returns the parent of the model index, or QModelIndex() if it has no parent. - \sa child(), sibling(), model() + \sa child(), sibling(), rowCount(), columnCount(), model() */ /*! diff --git a/src/corelib/kernel/qabstractitemmodel.h b/src/corelib/kernel/qabstractitemmodel.h index 63d9e6f..d91c383 100644 --- a/src/corelib/kernel/qabstractitemmodel.h +++ b/src/corelib/kernel/qabstractitemmodel.h @@ -68,6 +68,8 @@ public: inline int column() const { return c; } inline void *internalPointer() const { return p; } inline qint64 internalId() const { return reinterpret_cast(p); } + inline int rowCount() const; + inline int columnCount() const; inline QModelIndex parent() const; inline QModelIndex sibling(int row, int column) const; inline QModelIndex child(int row, int column) const; @@ -385,6 +387,12 @@ inline QModelIndex::QModelIndex(int arow, int acolumn, void *adata, const QAbstractItemModel *amodel) : r(arow), c(acolumn), p(adata), m(amodel) {} +inline int QModelIndex::rowCount() const +{ return m ? m->rowCount(*this) : 0; } + +inline int QModelIndex::columnCount() const +{ return m ? m->columnCount(*this) : 0; } + inline QModelIndex QModelIndex::parent() const { return m ? m->parent(*this) : QModelIndex(); } -- cgit v0.12 From 613be7cd75663ab8227de80d75d8f01e92c5c7d2 Mon Sep 17 00:00:00 2001 From: kh1 Date: Thu, 21 Jan 2010 18:17:13 +0100 Subject: Use HighlightAllOccurrences to have highlighting after full text search. Also use HighlightAllOccurrences to have highlighting during type and search. Some more refactoring. Task-number: QTBUG-3335 Reviewed-by: ck --- tools/assistant/tools/assistant/centralwidget.cpp | 96 +++++++++++++++-------- tools/assistant/tools/assistant/centralwidget.h | 8 +- 2 files changed, 68 insertions(+), 36 deletions(-) diff --git a/tools/assistant/tools/assistant/centralwidget.cpp b/tools/assistant/tools/assistant/centralwidget.cpp index b3660da..dab1ade 100644 --- a/tools/assistant/tools/assistant/centralwidget.cpp +++ b/tools/assistant/tools/assistant/centralwidget.cpp @@ -363,7 +363,7 @@ void CentralWidget::zoomOut() void CentralWidget::findNext() { TRACE_OBJ - find(findWidget->editFind->text(), true, false); + find(findWidget->editFind->text(), true); } void CentralWidget::nextPage() @@ -398,7 +398,7 @@ void CentralWidget::previousPage() void CentralWidget::findPrevious() { TRACE_OBJ - find(findWidget->editFind->text(), false, true); + find(findWidget->editFind->text(), false); } void CentralWidget::closeTab() @@ -711,7 +711,7 @@ HelpViewer *CentralWidget::newEmptyTab() void CentralWidget::findCurrentText(const QString &text) { TRACE_OBJ - find(text, false, false); + find(text, true); } void CentralWidget::connectSignals() @@ -918,20 +918,37 @@ void CentralWidget::keyPressEvent(QKeyEvent *e) QWidget::keyPressEvent(e); } -void CentralWidget::find(const QString &ttf, bool forward, bool backward) +void CentralWidget::find(const QString &ttf, bool forward) { TRACE_OBJ QPalette p = findWidget->editFind->palette(); p.setColor(QPalette::Active, QPalette::Base, Qt::white); - if (!ttf.isEmpty()) { - HelpViewer *viewer = currentHelpViewer(); + bool found = false; - bool found = false; +#if defined(QT_NO_WEBKIT) + found = findInTextBrowser(ttf, forward); +#else + found = findInWebPage(ttf, forward); +#endif + + if (!found && !ttf.isEmpty()) + p.setColor(QPalette::Active, QPalette::Base, QColor(255, 102, 102)); + + if (!findWidget->isVisible()) + findWidget->show(); + findWidget->editFind->setPalette(p); +} + +bool CentralWidget::findInWebPage(const QString &ttf, bool forward) +{ + TRACE_OBJ #if !defined(QT_NO_WEBKIT) - if (viewer) { - QWebPage::FindFlags options; - if (backward) + if (HelpViewer *viewer = currentHelpViewer()) { + bool found = false; + QWebPage::FindFlags options; + if (!ttf.isEmpty()) { + if (!forward) options |= QWebPage::FindBackward; if (findWidget->checkCase->isChecked()) @@ -946,31 +963,28 @@ void CentralWidget::find(const QString &ttf, bool forward, bool backward) if (found) findWidget->labelWrapped->show(); } - } else if (tabWidget->currentWidget() == m_searchWidget) { - QTextBrowser *browser = qFindChild(m_searchWidget); - found = findInTextBrowser(browser, ttf, forward, backward); } -#else - QTextBrowser *browser = qobject_cast(viewer); - if (tabWidget->currentWidget() == m_searchWidget) - browser = qFindChild(m_searchWidget); - found = findInTextBrowser(browser, ttf, forward, backward); -#endif - - if (!found) - p.setColor(QPalette::Active, QPalette::Base, QColor(255, 102, 102)); + // force highlighting of all other matches, also when empty (clear) + options = QWebPage::HighlightAllOccurrences; + viewer->findText(QLatin1String(""), options); + viewer->findText(ttf, options); + return found; } - if (!findWidget->isVisible()) - findWidget->show(); - findWidget->editFind->setPalette(p); + // this needs to stay, case for active search results page + return findInTextBrowser(ttf, forward); +#endif + return false; } -bool CentralWidget::findInTextBrowser(QTextBrowser* browser, const QString &ttf, - bool forward, bool backward) +bool CentralWidget::findInTextBrowser(const QString &ttf, bool forward) { TRACE_OBJ - if (!browser) + QTextBrowser *browser = qobject_cast(currentHelpViewer()); + if (tabWidget->currentWidget() == m_searchWidget) + browser = qFindChild(m_searchWidget); + + if (!browser || ttf.isEmpty()) return false; QTextDocument *doc = browser->document(); @@ -986,7 +1000,7 @@ bool CentralWidget::findInTextBrowser(QTextBrowser* browser, const QString &ttf, QTextCursor::MoveAnchor); } - if (backward) + if (!forward) options |= QTextDocument::FindBackward; if (findWidget->checkCase->isChecked()) @@ -1106,7 +1120,12 @@ CentralWidget::setSourceFromSearch(const QUrl &url) { TRACE_OBJ setSource(url); - highlightSearchTerms(); +#if defined(QT_NO_WEBKIT) + highlightSearchTerms() +#else + connect(currentHelpViewer(), SIGNAL(loadFinished(bool)), this, + SLOT(highlightSearchTerms())); +#endif } void @@ -1114,14 +1133,18 @@ CentralWidget::setSourceFromSearchInNewTab(const QUrl &url) { TRACE_OBJ setSourceInNewTab(url); - highlightSearchTerms(); +#if defined(QT_NO_WEBKIT) + highlightSearchTerms() +#else + connect(currentHelpViewer(), SIGNAL(loadFinished(bool)), this, + SLOT(highlightSearchTerms())); +#endif } void CentralWidget::highlightSearchTerms() { TRACE_OBJ -#if defined(QT_NO_WEBKIT) HelpViewer *viewer = currentHelpViewer(); if (!viewer) return; @@ -1144,6 +1167,7 @@ CentralWidget::highlightSearchTerms() } } +#if defined(QT_NO_WEBKIT) viewer->viewport()->setUpdatesEnabled(false); QTextCharFormat marker; @@ -1175,6 +1199,14 @@ CentralWidget::highlightSearchTerms() viewer->setTextCursor(firstHit); viewer->viewport()->setUpdatesEnabled(true); +#else + viewer->findText("", QWebPage::HighlightAllOccurrences); + // clears existing selections + foreach (const QString& term, terms) + viewer->findText(term, QWebPage::HighlightAllOccurrences); + + disconnect(viewer, SIGNAL(loadFinished(bool)), this, + SLOT(highlightSearchTerms())); #endif } diff --git a/tools/assistant/tools/assistant/centralwidget.h b/tools/assistant/tools/assistant/centralwidget.h index 60caae3..c0bee81 100644 --- a/tools/assistant/tools/assistant/centralwidget.h +++ b/tools/assistant/tools/assistant/centralwidget.h @@ -184,16 +184,16 @@ private slots: void printPreview(QPrinter *printer); void setSourceFromSearch(const QUrl &url); void setSourceFromSearchInNewTab(const QUrl &url); + void highlightSearchTerms(); private: void connectSignals(); bool eventFilter(QObject *object, QEvent *e); - void find(const QString &ttf, bool forward, bool backward); - bool findInTextBrowser(QTextBrowser* browser, const QString &ttf, - bool forward, bool backward); + void find(const QString &ttf, bool forward); + bool findInWebPage(const QString &ttf, bool forward); + bool findInTextBrowser(const QString &ttf, bool forward); void initPrinter(); QString quoteTabTitle(const QString &title) const; - void highlightSearchTerms(); void setLastShownPages(); void getBrowserFontFor(QWidget* viewer, QFont *font); -- cgit v0.12 From c4dc54a048202955d68262a20e0100f9856be303 Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Fri, 22 Jan 2010 11:41:32 +1000 Subject: Fixed compile when Qt is configured with -no-webkit --- tools/assistant/tools/assistant/centralwidget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/assistant/tools/assistant/centralwidget.cpp b/tools/assistant/tools/assistant/centralwidget.cpp index dab1ade..b772030 100644 --- a/tools/assistant/tools/assistant/centralwidget.cpp +++ b/tools/assistant/tools/assistant/centralwidget.cpp @@ -1121,7 +1121,7 @@ CentralWidget::setSourceFromSearch(const QUrl &url) TRACE_OBJ setSource(url); #if defined(QT_NO_WEBKIT) - highlightSearchTerms() + highlightSearchTerms(); #else connect(currentHelpViewer(), SIGNAL(loadFinished(bool)), this, SLOT(highlightSearchTerms())); @@ -1134,7 +1134,7 @@ CentralWidget::setSourceFromSearchInNewTab(const QUrl &url) TRACE_OBJ setSourceInNewTab(url); #if defined(QT_NO_WEBKIT) - highlightSearchTerms() + highlightSearchTerms(); #else connect(currentHelpViewer(), SIGNAL(loadFinished(bool)), this, SLOT(highlightSearchTerms())); -- cgit v0.12 From a5f0627f0d6123286ae852bbb1dc942214f3ee53 Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Fri, 22 Jan 2010 12:58:47 +1000 Subject: Fixed compile for wincewm60standard-msvc2008. Includes partial revert of b4dd6ff29bc921ec81b4fd67ed44830e4d697d1d --- src/gui/dialogs/qfiledialog_win.cpp | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/gui/dialogs/qfiledialog_win.cpp b/src/gui/dialogs/qfiledialog_win.cpp index f8c3b84..7938040 100644 --- a/src/gui/dialogs/qfiledialog_win.cpp +++ b/src/gui/dialogs/qfiledialog_win.cpp @@ -59,7 +59,23 @@ #endif #ifdef Q_WS_WINCE +#include #include +# ifndef BFFM_SETSELECTION +# define BFFM_SETSELECTION (WM_USER + 102) +# endif +// Windows Mobile has a broken definition for BROWSEINFO +// Only compile fix +typedef struct qt_priv_browseinfo { + HWND hwndOwner; + LPCITEMIDLIST pidlRoot; + LPWSTR pszDisplayName; + LPCWSTR lpszTitle; + UINT ulFlags; + BFFCALLBACK lpfn; + LPARAM lParam; + int iImage; +} qt_BROWSEINFO; bool qt_priv_ptr_valid = false; #else #include "qfiledialog_win_p.h" @@ -698,6 +714,11 @@ static int __stdcall winGetExistDirCallbackProc(HWND hwnd, return 0; } +#ifndef BIF_NEWDIALOGSTYLE +#define BIF_NEWDIALOGSTYLE 0x0040 // Use the new dialog layout with the ability to resize +#endif + + QString qt_win_get_existing_directory(const QFileDialogArgs &args) { QString currentDir = QDir::currentPath(); @@ -722,7 +743,11 @@ QString qt_win_get_existing_directory(const QFileDialogArgs &args) path[0] = 0; tTitle = args.caption; +#if !defined(Q_WS_WINCE) BROWSEINFO bi; +#else + qt_BROWSEINFO bi; +#endif Q_ASSERT(!parent ||parent->testAttribute(Qt::WA_WState_Created)); bi.hwndOwner = (parent ? parent->winId() : 0); @@ -736,7 +761,7 @@ QString qt_win_get_existing_directory(const QFileDialogArgs &args) qt_win_resolve_libs(); if (ptrSHBrowseForFolder) { - LPITEMIDLIST pItemIDList = ptrSHBrowseForFolder(&bi); + LPITEMIDLIST pItemIDList = ptrSHBrowseForFolder((BROWSEINFO*)&bi); if (pItemIDList) { ptrSHGetPathFromIDList(pItemIDList, path); IMalloc *pMalloc; -- cgit v0.12 From 381aa09688d0a333b3d44d5f77e098d4439d34f0 Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Fri, 22 Jan 2010 13:31:35 +1000 Subject: Fixed compile. --- src/3rdparty/phonon/ds9/videorenderer_default.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/3rdparty/phonon/ds9/videorenderer_default.cpp b/src/3rdparty/phonon/ds9/videorenderer_default.cpp index 9d82255..0045a49 100644 --- a/src/3rdparty/phonon/ds9/videorenderer_default.cpp +++ b/src/3rdparty/phonon/ds9/videorenderer_default.cpp @@ -32,7 +32,7 @@ namespace Phonon { namespace DS9 { - VideoRendererDefault::~VideoRendererVMR9() + VideoRendererDefault::~VideoRendererDefault() { } -- cgit v0.12 From b8a2d4f224a4e7c330cd40d66d08eba006ec32d9 Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Fri, 22 Jan 2010 14:06:20 +1000 Subject: Fixed compile for wincewm60standard-msvc2008. --- src/3rdparty/phonon/ds9/videowidget.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/3rdparty/phonon/ds9/videowidget.cpp b/src/3rdparty/phonon/ds9/videowidget.cpp index 59abb04..7b56ca4 100644 --- a/src/3rdparty/phonon/ds9/videowidget.cpp +++ b/src/3rdparty/phonon/ds9/videowidget.cpp @@ -24,9 +24,10 @@ along with this library. If not, see . #include "mediaobject.h" +#include "videorenderer_vmr9.h" + #ifndef Q_OS_WINCE #include "videorenderer_evr.h" -#include "videorenderer_vmr9.h" #else #include "videorenderer_default.h" #endif -- cgit v0.12 From 1a13a3c48ddbe3998edda778df53f4b1e838536f Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Fri, 22 Jan 2010 14:49:06 +1000 Subject: Fixed compile for wincewm60standard-msvc2008 (attempt 2) --- src/3rdparty/phonon/ds9/videowidget.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/3rdparty/phonon/ds9/videowidget.cpp b/src/3rdparty/phonon/ds9/videowidget.cpp index 7b56ca4..1eddaee 100644 --- a/src/3rdparty/phonon/ds9/videowidget.cpp +++ b/src/3rdparty/phonon/ds9/videowidget.cpp @@ -24,10 +24,9 @@ along with this library. If not, see . #include "mediaobject.h" -#include "videorenderer_vmr9.h" - #ifndef Q_OS_WINCE #include "videorenderer_evr.h" +#include "videorenderer_vmr9.h" #else #include "videorenderer_default.h" #endif @@ -370,7 +369,7 @@ namespace Phonon } } #else - renderer = new VideoRendererVMR9(m_widget); + renderer = new VideoRendererDefault(m_widget); if (renderer->getFilter() == 0) { //instanciating the renderer might fail m_noNativeRendererSupported = true; -- cgit v0.12 From dc8fb82e982127d3cc9086342db10866ca03ea7e Mon Sep 17 00:00:00 2001 From: ck Date: Fri, 22 Jan 2010 09:59:53 +0100 Subject: Assistant: Fix compliation for -no-webkit. --- tools/assistant/tools/assistant/centralwidget.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/assistant/tools/assistant/centralwidget.cpp b/tools/assistant/tools/assistant/centralwidget.cpp index dab1ade..076498e 100644 --- a/tools/assistant/tools/assistant/centralwidget.cpp +++ b/tools/assistant/tools/assistant/centralwidget.cpp @@ -973,6 +973,9 @@ bool CentralWidget::findInWebPage(const QString &ttf, bool forward) // this needs to stay, case for active search results page return findInTextBrowser(ttf, forward); +#else + Q_UNUSED(ttf); + Q_UNUSED(forward); #endif return false; } @@ -1121,7 +1124,7 @@ CentralWidget::setSourceFromSearch(const QUrl &url) TRACE_OBJ setSource(url); #if defined(QT_NO_WEBKIT) - highlightSearchTerms() + highlightSearchTerms(); #else connect(currentHelpViewer(), SIGNAL(loadFinished(bool)), this, SLOT(highlightSearchTerms())); @@ -1134,7 +1137,7 @@ CentralWidget::setSourceFromSearchInNewTab(const QUrl &url) TRACE_OBJ setSourceInNewTab(url); #if defined(QT_NO_WEBKIT) - highlightSearchTerms() + highlightSearchTerms(); #else connect(currentHelpViewer(), SIGNAL(loadFinished(bool)), this, SLOT(highlightSearchTerms())); -- cgit v0.12 From bc842d020c9e4f992ebda385bbd695292997fed9 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Mon, 18 Jan 2010 17:27:54 +0100 Subject: Build fix for MSVC2005 and older SDK --- src/gui/dialogs/qfiledialog_win.cpp | 28 ++------------------- src/gui/dialogs/qfiledialog_win_p.h | 49 +++++++++++++++++++++++++++++++++--- src/gui/util/qsystemtrayicon_win.cpp | 1 - 3 files changed, 47 insertions(+), 31 deletions(-) diff --git a/src/gui/dialogs/qfiledialog_win.cpp b/src/gui/dialogs/qfiledialog_win.cpp index 4e333f2..f8c3b84 100644 --- a/src/gui/dialogs/qfiledialog_win.cpp +++ b/src/gui/dialogs/qfiledialog_win.cpp @@ -60,21 +60,6 @@ #ifdef Q_WS_WINCE #include -# ifndef BFFM_SETSELECTION -# define BFFM_SETSELECTION (WM_USER + 102) -# endif -// Windows Mobile has a broken definition for BROWSEINFO -// Only compile fix -typedef struct qt_priv_browseinfo { - HWND hwndOwner; - LPCITEMIDLIST pidlRoot; - LPWSTR pszDisplayName; - LPCWSTR lpszTitle; - UINT ulFlags; - BFFCALLBACK lpfn; - LPARAM lParam; - int iImage; -} qt_BROWSEINFO; bool qt_priv_ptr_valid = false; #else #include "qfiledialog_win_p.h" @@ -457,7 +442,7 @@ static bool qt_win_set_IFileDialogOptions(IFileDialog *pfd, // Add the filters to the file dialog. if (numFilters) { wchar_t *szData = (wchar_t*)winfilters.utf16(); - COMDLG_FILTERSPEC *filterSpec = new COMDLG_FILTERSPEC[numFilters]; + qt_COMDLG_FILTERSPEC *filterSpec = new qt_COMDLG_FILTERSPEC[numFilters]; for(int i = 0; itestAttribute(Qt::WA_WState_Created)); bi.hwndOwner = (parent ? parent->winId() : 0); @@ -760,7 +736,7 @@ QString qt_win_get_existing_directory(const QFileDialogArgs &args) qt_win_resolve_libs(); if (ptrSHBrowseForFolder) { - LPITEMIDLIST pItemIDList = ptrSHBrowseForFolder((BROWSEINFO*)&bi); + LPITEMIDLIST pItemIDList = ptrSHBrowseForFolder(&bi); if (pItemIDList) { ptrSHGetPathFromIDList(pItemIDList, path); IMalloc *pMalloc; diff --git a/src/gui/dialogs/qfiledialog_win_p.h b/src/gui/dialogs/qfiledialog_win_p.h index 6d8c7c9..b55d1ff 100644 --- a/src/gui/dialogs/qfiledialog_win_p.h +++ b/src/gui/dialogs/qfiledialog_win_p.h @@ -39,9 +39,9 @@ ** ****************************************************************************/ -#include +#include #include -#if !defined(QFILEDIAG_WIN_P_H) && !defined(__shobjidl_h__) +#ifndef QFILEDIAG_WIN_P_H //these are the interface declarations needed for the file dialog on Vista and up @@ -50,6 +50,8 @@ //declarations typedef DWORD SICHINTF; +typedef ULONG SFGAOF; +typedef DWORD SHCONTF; #define FOS_OVERWRITEPROMPT 0x2 #define FOS_STRICTFILETYPES 0x4 #define FOS_NOCHANGEDIR 0x8 @@ -83,6 +85,31 @@ typedef int GETPROPERTYSTOREFLAGS; #define GPS_BESTEFFORT 0x00000040 #define GPS_MASK_VALID 0x0000007F +typedef int (CALLBACK* BFFCALLBACK)(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData); +// message from browser +#define BFFM_INITIALIZED 1 +#define BFFM_SELCHANGED 2 +#define BFFM_ENABLEOK (WM_USER + 101) +#define BFFM_SETSELECTION (WM_USER + 103) +#define BFFM_SETSTATUSTEXT (WM_USER + 104) + +// Browsing for directory. +#define BIF_RETURNONLYFSDIRS 0x0001 +#define BIF_DONTGOBELOWDOMAIN 0x0002 +#define BIF_STATUSTEXT 0x0004 +#define BIF_RETURNFSANCESTORS 0x0008 +#define BIF_EDITBOX 0x0010 +#define BIF_VALIDATE 0x0020 +#define BIF_NEWDIALOGSTYLE 0x0040 +#define BIF_BROWSEINCLUDEURLS 0x0080 +#define BIF_UAHINT 0x0100 +#define BIF_NONEWFOLDERBUTTON 0x0200 +#define BIF_NOTRANSLATETARGETS 0x0400 +#define BIF_BROWSEFORCOMPUTER 0x1000 +#define BIF_BROWSEFORPRINTER 0x2000 +#define BIF_BROWSEINCLUDEFILES 0x4000 +#define BIF_SHAREABLE 0x8000 + //the enums typedef enum { SIATTRIBFLAGS_AND = 0x1, @@ -115,11 +142,25 @@ typedef FDE_SHAREVIOLATION_RESPONSE FDE_OVERWRITE_RESPONSE; typedef struct { LPCWSTR pszName; LPCWSTR pszSpec; -} COMDLG_FILTERSPEC; +} qt_COMDLG_FILTERSPEC; +#ifndef PROPERTYKEY_DEFINED +#define PROPERTYKEY_DEFINED typedef struct { GUID fmtid; DWORD pid; } PROPERTYKEY; +#endif +typedef struct { + HWND hwndOwner; + LPCITEMIDLIST pidlRoot; + LPWSTR pszDisplayName; + LPCWSTR lpszTitle; + UINT ulFlags; + BFFCALLBACK lpfn; + LPARAM lParam; + int iImage; +} BROWSEINFO; + DECLARE_INTERFACE(IFileDialogEvents); DECLARE_INTERFACE_(IShellItem, IUnknown) { @@ -157,7 +198,7 @@ DECLARE_INTERFACE_(IModalWindow, IUnknown) }; DECLARE_INTERFACE_(IFileDialog, IModalWindow) { - STDMETHOD(SetFileTypes)(THIS_ UINT cFileTypes, const COMDLG_FILTERSPEC *rgFilterSpec) PURE; + STDMETHOD(SetFileTypes)(THIS_ UINT cFileTypes, const qt_COMDLG_FILTERSPEC *rgFilterSpec) PURE; STDMETHOD(SetFileTypeIndex)(THIS_ UINT iFileType) PURE; STDMETHOD(GetFileTypeIndex)(THIS_ UINT *piFileType) PURE; STDMETHOD(Advise)(THIS_ IFileDialogEvents *pfde, DWORD *pdwCookie) PURE; diff --git a/src/gui/util/qsystemtrayicon_win.cpp b/src/gui/util/qsystemtrayicon_win.cpp index 6db158e..092909f 100644 --- a/src/gui/util/qsystemtrayicon_win.cpp +++ b/src/gui/util/qsystemtrayicon_win.cpp @@ -53,7 +53,6 @@ #include #include -#include #include #include #include -- cgit v0.12 From e29453ab71c3bf795dbc0cdeb1c88e28e2de1470 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Mon, 18 Jan 2010 18:22:38 +0100 Subject: build fix for mingw --- src/gui/dialogs/qfiledialog_win_p.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/gui/dialogs/qfiledialog_win_p.h b/src/gui/dialogs/qfiledialog_win_p.h index b55d1ff..ad3bc14 100644 --- a/src/gui/dialogs/qfiledialog_win_p.h +++ b/src/gui/dialogs/qfiledialog_win_p.h @@ -39,7 +39,6 @@ ** ****************************************************************************/ -#include #include #ifndef QFILEDIAG_WIN_P_H @@ -150,6 +149,15 @@ typedef struct { DWORD pid; } PROPERTYKEY; #endif + +typedef struct { + USHORT cb; + BYTE abID[1]; +} SHITEMID, *LPSHITEMID; +typedef struct { + SHITEMID mkid; +} ITEMIDLIST, *LPITEMIDLIST; +typedef const ITEMIDLIST *LPCITEMIDLIST; typedef struct { HWND hwndOwner; LPCITEMIDLIST pidlRoot; -- cgit v0.12 From 2f48ff8cbefc70b2eb4de1e08a9e48c917486018 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Fri, 22 Jan 2010 11:34:39 +0100 Subject: Adding a warning if the property of an animation is not writable --- src/corelib/animation/qpropertyanimation.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/corelib/animation/qpropertyanimation.cpp b/src/corelib/animation/qpropertyanimation.cpp index 19b493d..37b79ba 100644 --- a/src/corelib/animation/qpropertyanimation.cpp +++ b/src/corelib/animation/qpropertyanimation.cpp @@ -118,7 +118,9 @@ void QPropertyAnimationPrivate::updateMetaProperty() propertyType = QVariant::Invalid; if (!targetValue->dynamicPropertyNames().contains(propertyName)) qWarning("QPropertyAnimation: you're trying to animate a non-existing property %s of your QObject", propertyName.constData()); - } + } else if (!targetValue->metaObject()->property(propertyIndex).isWritable()) { + qWarning("QPropertyAnimation: you're trying to animate the non-writable property %s of your QObject", propertyName.constData()); + } } void QPropertyAnimationPrivate::updateProperty(const QVariant &newValue) -- cgit v0.12 From 178f722835ec0995fe211046579c50893659cc8e Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Mon, 18 Jan 2010 10:47:13 +0100 Subject: Standard dialogs example does not respect non-native flag When showing a colordialog from the example, it does not check if the 'use native dialogs' checkbox is checked. This patch makes sure it does --- examples/dialogs/standarddialogs/dialog.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/dialogs/standarddialogs/dialog.cpp b/examples/dialogs/standarddialogs/dialog.cpp index 9001619..92ed334 100644 --- a/examples/dialogs/standarddialogs/dialog.cpp +++ b/examples/dialogs/standarddialogs/dialog.cpp @@ -239,7 +239,12 @@ void Dialog::setText() void Dialog::setColor() { - QColor color = QColorDialog::getColor(Qt::green, this); + QColor color; + if (native->isChecked()) + color = QColorDialog::getColor(Qt::green, this); + else + color = QColorDialog::getColor(Qt::green, this, "Select Color", QColorDialog::DontUseNativeDialog); + if (color.isValid()) { colorLabel->setText(color.name()); colorLabel->setPalette(QPalette(color)); -- cgit v0.12 From 2c3f2a0c41a9a2b8f1961197369b278d335f9cf1 Mon Sep 17 00:00:00 2001 From: ck Date: Fri, 22 Jan 2010 13:03:18 +0100 Subject: QtHelp: Minor clean-ups. --- tools/assistant/tools/assistant/helpenginewrapper.cpp | 3 --- tools/assistant/tools/qcollectiongenerator/main.cpp | 8 ++++---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/tools/assistant/tools/assistant/helpenginewrapper.cpp b/tools/assistant/tools/assistant/helpenginewrapper.cpp index 72ba30d..9785710 100644 --- a/tools/assistant/tools/assistant/helpenginewrapper.cpp +++ b/tools/assistant/tools/assistant/helpenginewrapper.cpp @@ -102,8 +102,6 @@ signals: private: HelpEngineWrapperPrivate(const QString &collectionFile); - friend class TimeoutForwarder; - void initFileSystemWatchers(); void assertDocFilesWatched(); void qchFileChanged(const QString &fileName, bool fromTimeout); @@ -114,7 +112,6 @@ private: QFileSystemWatcher * const m_qchWatcher; typedef QPair > RecentSignal; QMap m_recentQchUpdates; - }; HelpEngineWrapper *HelpEngineWrapper::helpEngineWrapper = 0; diff --git a/tools/assistant/tools/qcollectiongenerator/main.cpp b/tools/assistant/tools/qcollectiongenerator/main.cpp index d8150ff..f75d891 100644 --- a/tools/assistant/tools/qcollectiongenerator/main.cpp +++ b/tools/assistant/tools/qcollectiongenerator/main.cpp @@ -42,19 +42,19 @@ #include "../shared/collectionconfiguration.h" #include "../shared/helpgenerator.h" +#include +#include + #include #include #include #include #include #include - -#include -#include #include - #include + QT_USE_NAMESPACE class CollectionConfigReader : public QXmlStreamReader -- cgit v0.12 From a259511a2b76ddee2e1199802c66295b964c394e Mon Sep 17 00:00:00 2001 From: Darin Broady Date: Fri, 22 Jan 2010 15:12:01 +0100 Subject: The declaration of qt_x11Data needs to be consistent across the header and the implementation file, and this includes it's visibility. This error and patch was found while attempting to get symbol visibility to work with the SunStudio compilers (coming later). I went with the visibility setting from the implementation file (qapplication_x11.cpp) because I don't know if this variables is used outside of libQtGui.so, especially in 3rd-party code. If it's not supposed to be used outside of libQtGui.so, then the proper change would be to remove the Q_GUI_EXPORT from the definition in qapplication_x11.cpp. Merge-request: 433 Reviewed-by: Thiago Macieira --- src/gui/kernel/qt_x11_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/kernel/qt_x11_p.h b/src/gui/kernel/qt_x11_p.h index d110084..b2ce754 100644 --- a/src/gui/kernel/qt_x11_p.h +++ b/src/gui/kernel/qt_x11_p.h @@ -331,7 +331,7 @@ struct QXdndDropTransaction class QMimeData; struct QX11Data; -extern QX11Data *qt_x11Data; +extern Q_GUI_EXPORT QX11Data *qt_x11Data; enum DesktopEnvironment { DE_UNKNOWN, -- cgit v0.12 From 1ad847de17cb0e5f53bd5c62933ca887d9cdf7ef Mon Sep 17 00:00:00 2001 From: Darin Broady Date: Fri, 22 Jan 2010 15:12:02 +0100 Subject: Add the ability for the SunStudio 8+ compilers to do ELF symbol visibility. Merge-request: 433 Reviewed-by: Thiago Macieira --- config.tests/unix/fvisibility.test | 39 ++++++++++++++++++++++++++++---------- mkspecs/solaris-cc-64/qmake.conf | 2 ++ mkspecs/solaris-cc/qmake.conf | 2 ++ src/corelib/global/qglobal.h | 5 +++-- 4 files changed, 36 insertions(+), 12 deletions(-) diff --git a/config.tests/unix/fvisibility.test b/config.tests/unix/fvisibility.test index b2bcc07..d716695 100755 --- a/config.tests/unix/fvisibility.test +++ b/config.tests/unix/fvisibility.test @@ -4,25 +4,41 @@ FVISIBILITY_SUPPORT=no COMPILER=$1 VERBOSE=$2 +CMDLINE= + + RunCompileTest() { cat >>fvisibility.c << EOF -__attribute__((visibility("default"))) void blah(); -#if !defined(__GNUC__) -# error "Visiblility support requires GCC" -#elif __GNUC__ < 4 -# error "GCC3 with backported visibility patch is known to miscompile Qt" +#if defined(__GNUC__) +# if (__GNUC__ < 4) +# error "GCC3 with backported visibility patch is known to miscompile Qt" +# endif +__attribute((visibility("default"))) void blah(); +#elif defined(__SUNPRO_CC) +# if (__SUNPRO_CC < 0x0550) +# error "SunStudio 8 or later is required for ELF visibility" +# endif +__global void blah(); +#else +# error "GCC4+ or SunStudio 8+ are required to support ELF visibility" #endif EOF if [ "$VERBOSE" = "yes" ] ; then - "$COMPILER" -c -fvisibility=hidden fvisibility.c && FVISIBILITY_SUPPORT=yes + "$COMPILER" -c $CMDLINE fvisibility.c && FVISIBILITY_SUPPORT=yes else - "$COMPILER" -c -fvisibility=hidden fvisibility.c >/dev/null 2>&1 && FVISIBILITY_SUPPORT=yes + "$COMPILER" -c $CMDLINE fvisibility.c >/dev/null 2>&1 && FVISIBILITY_SUPPORT=yes fi rm -f fvisibility.c fvisibility.o } + case "$COMPILER" in +g++) + CMDLINE="-fvisibility=hidden" + RunCompileTest + ;; + aCC*) ;; @@ -34,14 +50,17 @@ icpc) ;; *) # the compile test works for the intel compiler because it mimics gcc's behavior + CMDLINE="-fvisibility=hidden" RunCompileTest ;; esac ;; - *) - RunCompileTest - ;; +CC) + # This should be SunStudio. If not, it'll get caught. + CMDLINE="-xldscope=hidden" + RunCompileTest + ;; esac # done diff --git a/mkspecs/solaris-cc-64/qmake.conf b/mkspecs/solaris-cc-64/qmake.conf index eb594d9..d51d77a 100644 --- a/mkspecs/solaris-cc-64/qmake.conf +++ b/mkspecs/solaris-cc-64/qmake.conf @@ -41,6 +41,7 @@ QMAKE_CFLAGS_SHLIB = -KPIC QMAKE_CFLAGS_STATIC_LIB = $$QMAKE_CFLAGS_SHLIB QMAKE_CFLAGS_YACC = QMAKE_CFLAGS_THREAD = -mt +QMAKE_CFLAGS_HIDESYMS = -xldscope=hidden QMAKE_CXX = CC QMAKE_CXXFLAGS = $$QMAKE_CFLAGS @@ -53,6 +54,7 @@ QMAKE_CXXFLAGS_SHLIB = $$QMAKE_CFLAGS_SHLIB QMAKE_CXXFLAGS_STATIC_LIB = $$QMAKE_CFLAGS_STATIC_LIB QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD +QMAKE_CXXFLAGS_HIDESYMS = $$QMAKE_CFLAGS_HIDESYMS QMAKE_INCDIR = /usr/sfw/include QMAKE_LIBDIR = /usr/sfw/lib/64 diff --git a/mkspecs/solaris-cc/qmake.conf b/mkspecs/solaris-cc/qmake.conf index ad430d1..354b83c 100644 --- a/mkspecs/solaris-cc/qmake.conf +++ b/mkspecs/solaris-cc/qmake.conf @@ -24,6 +24,7 @@ QMAKE_CFLAGS_SHLIB = -KPIC QMAKE_CFLAGS_STATIC_LIB = $$QMAKE_CFLAGS_SHLIB QMAKE_CFLAGS_YACC = QMAKE_CFLAGS_THREAD = -mt +QMAKE_CFLAGS_HIDESYMS = -xldscope=hidden QMAKE_CXX = CC QMAKE_CXXFLAGS = $$QMAKE_CFLAGS @@ -36,6 +37,7 @@ QMAKE_CXXFLAGS_SHLIB = $$QMAKE_CFLAGS_SHLIB QMAKE_CXXFLAGS_STATIC_LIB = $$QMAKE_CFLAGS_STATIC_LIB QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD +QMAKE_CXXFLAGS_HIDESYMS = $$QMAKE_CFLAGS_HIDESYMS QMAKE_INCDIR = /usr/sfw/include QMAKE_LIBDIR = /usr/sfw/lib diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index c4cf3f0..b237659 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -672,8 +672,9 @@ namespace QT_NAMESPACE {} # define Q_ALIGNOF(type) __alignof__(type) # define Q_TYPEOF(expr) __typeof__(expr) # define Q_DECL_ALIGN(n) __attribute__((__aligned__(n))) -// using CC 5.9: Warning: attribute visibility is unsupported and will be skipped.. -//# define Q_DECL_EXPORT __attribute__((__visibility__("default"))) +# endif +# if __SUNPRO_CC >= 0x550 +# define Q_DECL_EXPORT __global # endif # if __SUNPRO_CC < 0x5a0 # define Q_NO_TEMPLATE_FRIENDS -- cgit v0.12 From 91eec1a5c15d53b9f66349430187785dd03d5ddd Mon Sep 17 00:00:00 2001 From: Darin Broady Date: Fri, 22 Jan 2010 15:12:03 +0100 Subject: Support both gcc & g++ as a valid GCC compiler. Merge-request: 433 Reviewed-by: Thiago Macieira --- config.tests/unix/fvisibility.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.tests/unix/fvisibility.test b/config.tests/unix/fvisibility.test index d716695..99e6fbe 100755 --- a/config.tests/unix/fvisibility.test +++ b/config.tests/unix/fvisibility.test @@ -34,7 +34,7 @@ EOF case "$COMPILER" in -g++) +gcc|g++) CMDLINE="-fvisibility=hidden" RunCompileTest ;; -- cgit v0.12 From 08ff927d675532e4b8b9fef616194dfd0200b7c7 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Fri, 22 Jan 2010 16:38:57 +0100 Subject: Build fix for wince --- src/gui/dialogs/qfiledialog_win.cpp | 2 +- src/gui/dialogs/qfiledialog_win_p.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/dialogs/qfiledialog_win.cpp b/src/gui/dialogs/qfiledialog_win.cpp index f8c3b84..3bfeb03 100644 --- a/src/gui/dialogs/qfiledialog_win.cpp +++ b/src/gui/dialogs/qfiledialog_win.cpp @@ -53,6 +53,7 @@ #include #include #include +#include "qfiledialog_win_p.h" #ifndef QT_NO_THREAD # include @@ -62,7 +63,6 @@ #include bool qt_priv_ptr_valid = false; #else -#include "qfiledialog_win_p.h" //we have to declare them here because they're not present for all SDK/compilers static const IID QT_IID_IFileOpenDialog = {0xd57c7288, 0xd4ad, 0x4768, {0xbe, 0x02, 0x9d, 0x96, 0x95, 0x32, 0xd9, 0x60} }; static const IID QT_IID_IShellItem = {0x43826d1e, 0xe718, 0x42ee, {0xbc, 0x55, 0xa1, 0xe2, 0x61, 0xc3, 0x7b, 0xfe} }; diff --git a/src/gui/dialogs/qfiledialog_win_p.h b/src/gui/dialogs/qfiledialog_win_p.h index ad3bc14..39e6f5d 100644 --- a/src/gui/dialogs/qfiledialog_win_p.h +++ b/src/gui/dialogs/qfiledialog_win_p.h @@ -41,6 +41,7 @@ #include #ifndef QFILEDIAG_WIN_P_H +#define QFILEDIAG_WIN_P_H //these are the interface declarations needed for the file dialog on Vista and up -- cgit v0.12 From 44232675a87c766b48d8f3d70d04dee6538a6caf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Thu, 14 Jan 2010 18:52:38 +0100 Subject: Refactor common X/Open LFS support out of individual qplatformdefs.h Reviewed-by: Thiago Macieira --- mkspecs/aix-g++-64/qplatformdefs.h | 43 +--------- mkspecs/aix-g++/qplatformdefs.h | 43 +--------- mkspecs/aix-xlc-64/qplatformdefs.h | 43 +--------- mkspecs/aix-xlc/qplatformdefs.h | 43 +--------- mkspecs/common/symbian/qplatformdefs.h | 44 +--------- mkspecs/common/xopen-lfs/qplatformdefs.h | 97 ++++++++++++++++++++++ mkspecs/hpux-acc-64/qplatformdefs.h | 44 +--------- mkspecs/hpux-acc-o64/qplatformdefs.h | 43 +--------- mkspecs/hpux-acc/qplatformdefs.h | 44 +--------- mkspecs/hpux-g++-64/qplatformdefs.h | 43 +--------- mkspecs/hpux-g++/qplatformdefs.h | 43 +--------- mkspecs/hpuxi-acc-32/qplatformdefs.h | 44 +--------- mkspecs/hpuxi-acc-64/qplatformdefs.h | 44 +--------- mkspecs/hpuxi-g++-64/qplatformdefs.h | 44 +--------- mkspecs/irix-cc-64/qplatformdefs.h | 43 +--------- mkspecs/irix-cc/qplatformdefs.h | 43 +--------- mkspecs/irix-g++/qplatformdefs.h | 43 +--------- mkspecs/linux-cxx/qplatformdefs.h | 43 +--------- mkspecs/linux-ecc-64/qplatformdefs.h | 43 +--------- mkspecs/linux-g++/qplatformdefs.h | 43 +--------- mkspecs/linux-kcc/qplatformdefs.h | 43 +--------- mkspecs/linux-llvm/qplatformdefs.h | 43 +--------- mkspecs/linux-lsb-g++/qplatformdefs.h | 44 +--------- mkspecs/linux-pgcc/qplatformdefs.h | 43 +--------- mkspecs/solaris-cc-64/qplatformdefs.h | 43 +--------- mkspecs/solaris-cc/qplatformdefs.h | 43 +--------- mkspecs/solaris-g++-64/qplatformdefs.h | 43 +--------- mkspecs/solaris-g++/qplatformdefs.h | 43 +--------- mkspecs/unsupported/qnx-g++/qplatformdefs.h | 43 +--------- .../vxworks-simpentium-g++/qplatformdefs.h | 45 +--------- 30 files changed, 142 insertions(+), 1211 deletions(-) create mode 100644 mkspecs/common/xopen-lfs/qplatformdefs.h diff --git a/mkspecs/aix-g++-64/qplatformdefs.h b/mkspecs/aix-g++-64/qplatformdefs.h index ecc2cf0..0a2ef22 100644 --- a/mkspecs/aix-g++-64/qplatformdefs.h +++ b/mkspecs/aix-g++-64/qplatformdefs.h @@ -81,47 +81,7 @@ #include #endif -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif - -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif +#include "../common/xopen-lfs/qplatformdefs.h" #define QT_STAT_REG S_IFREG #define QT_STAT_DIR S_IFDIR @@ -138,7 +98,6 @@ #define QT_CHDIR ::chdir #define QT_MKDIR ::mkdir #define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE #define QT_OPEN_RDONLY O_RDONLY #define QT_OPEN_WRONLY O_WRONLY #define QT_OPEN_RDWR O_RDWR diff --git a/mkspecs/aix-g++/qplatformdefs.h b/mkspecs/aix-g++/qplatformdefs.h index ecc2cf0..0a2ef22 100644 --- a/mkspecs/aix-g++/qplatformdefs.h +++ b/mkspecs/aix-g++/qplatformdefs.h @@ -81,47 +81,7 @@ #include #endif -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif - -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif +#include "../common/xopen-lfs/qplatformdefs.h" #define QT_STAT_REG S_IFREG #define QT_STAT_DIR S_IFDIR @@ -138,7 +98,6 @@ #define QT_CHDIR ::chdir #define QT_MKDIR ::mkdir #define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE #define QT_OPEN_RDONLY O_RDONLY #define QT_OPEN_WRONLY O_WRONLY #define QT_OPEN_RDWR O_RDWR diff --git a/mkspecs/aix-xlc-64/qplatformdefs.h b/mkspecs/aix-xlc-64/qplatformdefs.h index 2ed0879..c28f04a 100644 --- a/mkspecs/aix-xlc-64/qplatformdefs.h +++ b/mkspecs/aix-xlc-64/qplatformdefs.h @@ -77,47 +77,7 @@ #include #endif -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif - -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif +#include "../common/xopen-lfs/qplatformdefs.h" #define QT_STAT_REG S_IFREG #define QT_STAT_DIR S_IFDIR @@ -134,7 +94,6 @@ #define QT_CHDIR ::chdir #define QT_MKDIR ::mkdir #define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE #define QT_OPEN_RDONLY O_RDONLY #define QT_OPEN_WRONLY O_WRONLY #define QT_OPEN_RDWR O_RDWR diff --git a/mkspecs/aix-xlc/qplatformdefs.h b/mkspecs/aix-xlc/qplatformdefs.h index 435fc40..f789fda 100644 --- a/mkspecs/aix-xlc/qplatformdefs.h +++ b/mkspecs/aix-xlc/qplatformdefs.h @@ -77,47 +77,7 @@ #include #endif -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif - -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif +#include "../common/xopen-lfs/qplatformdefs.h" #define QT_STAT_REG S_IFREG #define QT_STAT_DIR S_IFDIR @@ -134,7 +94,6 @@ #define QT_CHDIR ::chdir #define QT_MKDIR ::mkdir #define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE #define QT_OPEN_RDONLY O_RDONLY #define QT_OPEN_WRONLY O_WRONLY #define QT_OPEN_RDWR O_RDWR diff --git a/mkspecs/common/symbian/qplatformdefs.h b/mkspecs/common/symbian/qplatformdefs.h index c8a336b..4d95fae 100644 --- a/mkspecs/common/symbian/qplatformdefs.h +++ b/mkspecs/common/symbian/qplatformdefs.h @@ -84,47 +84,10 @@ #endif #include -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif +#include "../xopen-lfs/qplatformdefs.h" -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif +#undef QT_OPEN_LARGEFILE +#define QT_OPEN_LARGEFILE 0 #define QT_STAT_REG S_IFREG #define QT_STAT_DIR S_IFDIR @@ -141,7 +104,6 @@ #define QT_CHDIR ::chdir #define QT_MKDIR ::mkdir #define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE 0 #define QT_OPEN_RDONLY O_RDONLY #define QT_OPEN_WRONLY O_WRONLY #define QT_OPEN_RDWR O_RDWR diff --git a/mkspecs/common/xopen-lfs/qplatformdefs.h b/mkspecs/common/xopen-lfs/qplatformdefs.h new file mode 100644 index 0000000..2599d62 --- /dev/null +++ b/mkspecs/common/xopen-lfs/qplatformdefs.h @@ -0,0 +1,97 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the qmake spec of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q_XOPEN_LFS_QPLATFORMDEFS_H +#define Q_XOPEN_LFS_QPLATFORMDEFS_H + +#ifdef QT_LARGEFILE_SUPPORT + +#define QT_STATBUF struct stat64 +#define QT_STATBUF4TSTAT struct stat64 +#define QT_FPOS_T fpos64_t +#define QT_OFF_T off64_t + +#define QT_STAT ::stat64 +#define QT_LSTAT ::lstat64 +#define QT_TRUNCATE ::truncate64 + +#define QT_OPEN ::open64 +#define QT_LSEEK ::lseek64 +#define QT_FSTAT ::fstat64 +#define QT_FTRUNCATE ::ftruncate64 + +#define QT_FOPEN ::fopen64 +#define QT_FSEEK ::fseeko64 +#define QT_FTELL ::ftello64 +#define QT_FGETPOS ::fgetpos64 +#define QT_FSETPOS ::fsetpos64 + +#define QT_MMAP ::mmap64 + +#else // !QT_LARGEFILE_SUPPORT + +#define QT_STATBUF struct stat +#define QT_STATBUF4TSTAT struct stat +#define QT_FPOS_T fpos_t +#define QT_OFF_T long + +#define QT_STAT ::stat +#define QT_LSTAT ::lstat +#define QT_TRUNCATE ::truncate + +#define QT_OPEN ::open +#define QT_LSEEK ::lseek +#define QT_FSTAT ::fstat +#define QT_FTRUNCATE ::ftruncate + +#define QT_FOPEN ::fopen +#define QT_FSEEK ::fseek +#define QT_FTELL ::ftell +#define QT_FGETPOS ::fgetpos +#define QT_FSETPOS ::fsetpos + +#define QT_MMAP ::mmap + +#endif // QT_LARGEFILE_SUPPORT + +#define QT_OPEN_LARGEFILE O_LARGEFILE + +#endif // include guard diff --git a/mkspecs/hpux-acc-64/qplatformdefs.h b/mkspecs/hpux-acc-64/qplatformdefs.h index 50da616..933ffb7 100644 --- a/mkspecs/hpux-acc-64/qplatformdefs.h +++ b/mkspecs/hpux-acc-64/qplatformdefs.h @@ -76,47 +76,10 @@ #include #endif -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif +#include "../common/xopen-lfs/qplatformdefs.h" -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif +#undef QT_OPEN_LARGEFILE +#define QT_OPEN_LARGEFILE 0 #define QT_STAT_REG S_IFREG #define QT_STAT_DIR S_IFDIR @@ -133,7 +96,6 @@ #define QT_CHDIR ::chdir #define QT_MKDIR ::mkdir #define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE 0 #define QT_OPEN_RDONLY O_RDONLY #define QT_OPEN_WRONLY O_WRONLY #define QT_OPEN_RDWR O_RDWR diff --git a/mkspecs/hpux-acc-o64/qplatformdefs.h b/mkspecs/hpux-acc-o64/qplatformdefs.h index 1aee3f9..397d9aa 100644 --- a/mkspecs/hpux-acc-o64/qplatformdefs.h +++ b/mkspecs/hpux-acc-o64/qplatformdefs.h @@ -77,47 +77,7 @@ #include #endif -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif - -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif +#include "../common/xopen-lfs/qplatformdefs.h" #define QT_STAT_REG S_IFREG #define QT_STAT_DIR S_IFDIR @@ -134,7 +94,6 @@ #define QT_CHDIR ::chdir #define QT_MKDIR ::mkdir #define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE #define QT_OPEN_RDONLY O_RDONLY #define QT_OPEN_WRONLY O_WRONLY #define QT_OPEN_RDWR O_RDWR diff --git a/mkspecs/hpux-acc/qplatformdefs.h b/mkspecs/hpux-acc/qplatformdefs.h index 475c85a..bec30bd 100644 --- a/mkspecs/hpux-acc/qplatformdefs.h +++ b/mkspecs/hpux-acc/qplatformdefs.h @@ -79,47 +79,10 @@ #include #endif -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif +#include "../common/xopen-lfs/qplatformdefs.h" -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif +#undef QT_OPEN_LARGEFILE +#define QT_OPEN_LARGEFILE 0 #define QT_STAT_REG S_IFREG #define QT_STAT_DIR S_IFDIR @@ -136,7 +99,6 @@ #define QT_CHDIR ::chdir #define QT_MKDIR ::mkdir #define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE 0 #define QT_OPEN_RDONLY O_RDONLY #define QT_OPEN_WRONLY O_WRONLY #define QT_OPEN_RDWR O_RDWR diff --git a/mkspecs/hpux-g++-64/qplatformdefs.h b/mkspecs/hpux-g++-64/qplatformdefs.h index 6082632..54e3058 100644 --- a/mkspecs/hpux-g++-64/qplatformdefs.h +++ b/mkspecs/hpux-g++-64/qplatformdefs.h @@ -76,47 +76,7 @@ #include #endif -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif - -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif +#include "../common/xopen-lfs/qplatformdefs.h" #define QT_STAT_REG S_IFREG #define QT_STAT_DIR S_IFDIR @@ -133,7 +93,6 @@ #define QT_CHDIR ::chdir #define QT_MKDIR ::mkdir #define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE #define QT_OPEN_RDONLY O_RDONLY #define QT_OPEN_WRONLY O_WRONLY #define QT_OPEN_RDWR O_RDWR diff --git a/mkspecs/hpux-g++/qplatformdefs.h b/mkspecs/hpux-g++/qplatformdefs.h index 161474e..bb165f9 100644 --- a/mkspecs/hpux-g++/qplatformdefs.h +++ b/mkspecs/hpux-g++/qplatformdefs.h @@ -78,47 +78,7 @@ #include #endif -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif - -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif +#include "../common/xopen-lfs/qplatformdefs.h" #define QT_STAT_REG S_IFREG #define QT_STAT_DIR S_IFDIR @@ -135,7 +95,6 @@ #define QT_CHDIR ::chdir #define QT_MKDIR ::mkdir #define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE #define QT_OPEN_RDONLY O_RDONLY #define QT_OPEN_WRONLY O_WRONLY #define QT_OPEN_RDWR O_RDWR diff --git a/mkspecs/hpuxi-acc-32/qplatformdefs.h b/mkspecs/hpuxi-acc-32/qplatformdefs.h index 04ce3cd..7afb0fe 100644 --- a/mkspecs/hpuxi-acc-32/qplatformdefs.h +++ b/mkspecs/hpuxi-acc-32/qplatformdefs.h @@ -77,47 +77,10 @@ #include #endif -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif +#include "../common/xopen-lfs/qplatformdefs.h" -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif +#undef QT_OPEN_LARGEFILE +#define QT_OPEN_LARGEFILE 0 #define QT_STAT_REG S_IFREG #define QT_STAT_DIR S_IFDIR @@ -134,7 +97,6 @@ #define QT_CHDIR ::chdir #define QT_MKDIR ::mkdir #define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE 0 #define QT_OPEN_RDONLY O_RDONLY #define QT_OPEN_WRONLY O_WRONLY #define QT_OPEN_RDWR O_RDWR diff --git a/mkspecs/hpuxi-acc-64/qplatformdefs.h b/mkspecs/hpuxi-acc-64/qplatformdefs.h index 04ce3cd..7afb0fe 100644 --- a/mkspecs/hpuxi-acc-64/qplatformdefs.h +++ b/mkspecs/hpuxi-acc-64/qplatformdefs.h @@ -77,47 +77,10 @@ #include #endif -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif +#include "../common/xopen-lfs/qplatformdefs.h" -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif +#undef QT_OPEN_LARGEFILE +#define QT_OPEN_LARGEFILE 0 #define QT_STAT_REG S_IFREG #define QT_STAT_DIR S_IFDIR @@ -134,7 +97,6 @@ #define QT_CHDIR ::chdir #define QT_MKDIR ::mkdir #define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE 0 #define QT_OPEN_RDONLY O_RDONLY #define QT_OPEN_WRONLY O_WRONLY #define QT_OPEN_RDWR O_RDWR diff --git a/mkspecs/hpuxi-g++-64/qplatformdefs.h b/mkspecs/hpuxi-g++-64/qplatformdefs.h index ba62e24..62c977f 100644 --- a/mkspecs/hpuxi-g++-64/qplatformdefs.h +++ b/mkspecs/hpuxi-g++-64/qplatformdefs.h @@ -76,47 +76,10 @@ #include #endif -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif +#include "../common/xopen-lfs/qplatformdefs.h" -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif +#undef QT_OPEN_LARGEFILE +#define QT_OPEN_LARGEFILE 0 #define QT_STAT_REG S_IFREG #define QT_STAT_DIR S_IFDIR @@ -133,7 +96,6 @@ #define QT_CHDIR ::chdir #define QT_MKDIR ::mkdir #define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE 0 #define QT_OPEN_RDONLY O_RDONLY #define QT_OPEN_WRONLY O_WRONLY #define QT_OPEN_RDWR O_RDWR diff --git a/mkspecs/irix-cc-64/qplatformdefs.h b/mkspecs/irix-cc-64/qplatformdefs.h index f1078df..bcd8742 100644 --- a/mkspecs/irix-cc-64/qplatformdefs.h +++ b/mkspecs/irix-cc-64/qplatformdefs.h @@ -75,47 +75,7 @@ #include #endif -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif - -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif +#include "../common/xopen-lfs/qplatformdefs.h" #define QT_STAT_REG S_IFREG #define QT_STAT_DIR S_IFDIR @@ -132,7 +92,6 @@ #define QT_CHDIR ::chdir #define QT_MKDIR ::mkdir #define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE #define QT_OPEN_RDONLY O_RDONLY #define QT_OPEN_WRONLY O_WRONLY #define QT_OPEN_RDWR O_RDWR diff --git a/mkspecs/irix-cc/qplatformdefs.h b/mkspecs/irix-cc/qplatformdefs.h index f1078df..bcd8742 100644 --- a/mkspecs/irix-cc/qplatformdefs.h +++ b/mkspecs/irix-cc/qplatformdefs.h @@ -75,47 +75,7 @@ #include #endif -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif - -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif +#include "../common/xopen-lfs/qplatformdefs.h" #define QT_STAT_REG S_IFREG #define QT_STAT_DIR S_IFDIR @@ -132,7 +92,6 @@ #define QT_CHDIR ::chdir #define QT_MKDIR ::mkdir #define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE #define QT_OPEN_RDONLY O_RDONLY #define QT_OPEN_WRONLY O_WRONLY #define QT_OPEN_RDWR O_RDWR diff --git a/mkspecs/irix-g++/qplatformdefs.h b/mkspecs/irix-g++/qplatformdefs.h index 49d0bfb..2d85b4f 100644 --- a/mkspecs/irix-g++/qplatformdefs.h +++ b/mkspecs/irix-g++/qplatformdefs.h @@ -75,47 +75,7 @@ #include #endif -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif - -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif +#include "../common/xopen-lfs/qplatformdefs.h" #define QT_STAT_REG S_IFREG #define QT_STAT_DIR S_IFDIR @@ -132,7 +92,6 @@ #define QT_CHDIR ::chdir #define QT_MKDIR ::mkdir #define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE #define QT_OPEN_RDONLY O_RDONLY #define QT_OPEN_WRONLY O_WRONLY #define QT_OPEN_RDWR O_RDWR diff --git a/mkspecs/linux-cxx/qplatformdefs.h b/mkspecs/linux-cxx/qplatformdefs.h index 11b5ac0..a708a81 100644 --- a/mkspecs/linux-cxx/qplatformdefs.h +++ b/mkspecs/linux-cxx/qplatformdefs.h @@ -82,47 +82,7 @@ #include #endif -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif - -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif +#include "../common/xopen-lfs/qplatformdefs.h" #define QT_STAT_REG S_IFREG #define QT_STAT_DIR S_IFDIR @@ -139,7 +99,6 @@ #define QT_CHDIR ::chdir #define QT_MKDIR ::mkdir #define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE #define QT_OPEN_RDONLY O_RDONLY #define QT_OPEN_WRONLY O_WRONLY #define QT_OPEN_RDWR O_RDWR diff --git a/mkspecs/linux-ecc-64/qplatformdefs.h b/mkspecs/linux-ecc-64/qplatformdefs.h index 11b5ac0..a708a81 100644 --- a/mkspecs/linux-ecc-64/qplatformdefs.h +++ b/mkspecs/linux-ecc-64/qplatformdefs.h @@ -82,47 +82,7 @@ #include #endif -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif - -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif +#include "../common/xopen-lfs/qplatformdefs.h" #define QT_STAT_REG S_IFREG #define QT_STAT_DIR S_IFDIR @@ -139,7 +99,6 @@ #define QT_CHDIR ::chdir #define QT_MKDIR ::mkdir #define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE #define QT_OPEN_RDONLY O_RDONLY #define QT_OPEN_WRONLY O_WRONLY #define QT_OPEN_RDWR O_RDWR diff --git a/mkspecs/linux-g++/qplatformdefs.h b/mkspecs/linux-g++/qplatformdefs.h index a879279..09697e2 100644 --- a/mkspecs/linux-g++/qplatformdefs.h +++ b/mkspecs/linux-g++/qplatformdefs.h @@ -81,47 +81,7 @@ #include #endif -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif - -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif +#include "../common/xopen-lfs/qplatformdefs.h" #define QT_STAT_REG S_IFREG #define QT_STAT_DIR S_IFDIR @@ -138,7 +98,6 @@ #define QT_CHDIR ::chdir #define QT_MKDIR ::mkdir #define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE #define QT_OPEN_RDONLY O_RDONLY #define QT_OPEN_WRONLY O_WRONLY #define QT_OPEN_RDWR O_RDWR diff --git a/mkspecs/linux-kcc/qplatformdefs.h b/mkspecs/linux-kcc/qplatformdefs.h index 30b3c25..9150292 100644 --- a/mkspecs/linux-kcc/qplatformdefs.h +++ b/mkspecs/linux-kcc/qplatformdefs.h @@ -85,47 +85,7 @@ #include #endif -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif - -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif +#include "../common/xopen-lfs/qplatformdefs.h" #define QT_STAT_REG S_IFREG #define QT_STAT_DIR S_IFDIR @@ -142,7 +102,6 @@ #define QT_CHDIR ::chdir #define QT_MKDIR ::mkdir #define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE #define QT_OPEN_RDONLY O_RDONLY #define QT_OPEN_WRONLY O_WRONLY #define QT_OPEN_RDWR O_RDWR diff --git a/mkspecs/linux-llvm/qplatformdefs.h b/mkspecs/linux-llvm/qplatformdefs.h index 8e59249..ea1a0da 100644 --- a/mkspecs/linux-llvm/qplatformdefs.h +++ b/mkspecs/linux-llvm/qplatformdefs.h @@ -82,47 +82,7 @@ #include #endif -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif - -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif +#include "../common/xopen-lfs/qplatformdefs.h" #define QT_STAT_REG S_IFREG #define QT_STAT_DIR S_IFDIR @@ -139,7 +99,6 @@ #define QT_CHDIR ::chdir #define QT_MKDIR ::mkdir #define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE #define QT_OPEN_RDONLY O_RDONLY #define QT_OPEN_WRONLY O_WRONLY #define QT_OPEN_RDWR O_RDWR diff --git a/mkspecs/linux-lsb-g++/qplatformdefs.h b/mkspecs/linux-lsb-g++/qplatformdefs.h index ce0b461..7731c38 100644 --- a/mkspecs/linux-lsb-g++/qplatformdefs.h +++ b/mkspecs/linux-lsb-g++/qplatformdefs.h @@ -86,47 +86,10 @@ // LSB 3.1 defines htonl and friends here #include -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif +#include "../common/xopen-lfs/qplatformdefs.h" -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif +#undef QT_OPEN_LARGEFILE +#define QT_OPEN_LARGEFILE 0 #define QT_STAT_REG S_IFREG #define QT_STAT_DIR S_IFDIR @@ -144,7 +107,6 @@ #define QT_CHDIR ::chdir #define QT_MKDIR ::mkdir #define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE 0 #define QT_OPEN_RDONLY O_RDONLY #define QT_OPEN_WRONLY O_WRONLY #define QT_OPEN_RDWR O_RDWR diff --git a/mkspecs/linux-pgcc/qplatformdefs.h b/mkspecs/linux-pgcc/qplatformdefs.h index 11b5ac0..a708a81 100644 --- a/mkspecs/linux-pgcc/qplatformdefs.h +++ b/mkspecs/linux-pgcc/qplatformdefs.h @@ -82,47 +82,7 @@ #include #endif -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif - -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif +#include "../common/xopen-lfs/qplatformdefs.h" #define QT_STAT_REG S_IFREG #define QT_STAT_DIR S_IFDIR @@ -139,7 +99,6 @@ #define QT_CHDIR ::chdir #define QT_MKDIR ::mkdir #define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE #define QT_OPEN_RDONLY O_RDONLY #define QT_OPEN_WRONLY O_WRONLY #define QT_OPEN_RDWR O_RDWR diff --git a/mkspecs/solaris-cc-64/qplatformdefs.h b/mkspecs/solaris-cc-64/qplatformdefs.h index 8de7c20..d791e97 100644 --- a/mkspecs/solaris-cc-64/qplatformdefs.h +++ b/mkspecs/solaris-cc-64/qplatformdefs.h @@ -83,47 +83,7 @@ static inline int qt_socket_connect(int s, struct sockaddr *addr, QT_SOCKLEN_T addrlen) { return ::connect(s, addr, addrlen); } -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif - -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif +#include "../common/xopen-lfs/qplatformdefs.h" #define QT_STAT_REG S_IFREG #define QT_STAT_DIR S_IFDIR @@ -140,7 +100,6 @@ static inline int qt_socket_connect(int s, struct sockaddr *addr, QT_SOCKLEN_T a #define QT_CHDIR ::chdir #define QT_MKDIR ::mkdir #define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE #define QT_OPEN_RDONLY O_RDONLY #define QT_OPEN_WRONLY O_WRONLY #define QT_OPEN_RDWR O_RDWR diff --git a/mkspecs/solaris-cc/qplatformdefs.h b/mkspecs/solaris-cc/qplatformdefs.h index 128cd8f..04be413 100644 --- a/mkspecs/solaris-cc/qplatformdefs.h +++ b/mkspecs/solaris-cc/qplatformdefs.h @@ -91,47 +91,7 @@ static inline int qt_socket_connect(int s, struct sockaddr *addr, QT_SOCKLEN_T addrlen) { return ::connect(s, addr, addrlen); } -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif - -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif +#include "../common/xopen-lfs/qplatformdefs.h" #define QT_STAT_REG S_IFREG #define QT_STAT_DIR S_IFDIR @@ -148,7 +108,6 @@ static inline int qt_socket_connect(int s, struct sockaddr *addr, QT_SOCKLEN_T a #define QT_CHDIR ::chdir #define QT_MKDIR ::mkdir #define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE #define QT_OPEN_RDONLY O_RDONLY #define QT_OPEN_WRONLY O_WRONLY #define QT_OPEN_RDWR O_RDWR diff --git a/mkspecs/solaris-g++-64/qplatformdefs.h b/mkspecs/solaris-g++-64/qplatformdefs.h index d7aebaf..f9c21d7 100644 --- a/mkspecs/solaris-g++-64/qplatformdefs.h +++ b/mkspecs/solaris-g++-64/qplatformdefs.h @@ -100,47 +100,7 @@ static inline int qt_socket_bind(int s, struct sockaddr *addr, QT_SOCKLEN_T addr # undef bind #endif -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif - -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif +#include "../common/xopen-lfs/qplatformdefs.h" #define QT_STAT_REG S_IFREG #define QT_STAT_DIR S_IFDIR @@ -157,7 +117,6 @@ static inline int qt_socket_bind(int s, struct sockaddr *addr, QT_SOCKLEN_T addr #define QT_CHDIR ::chdir #define QT_MKDIR ::mkdir #define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE #define QT_OPEN_RDONLY O_RDONLY #define QT_OPEN_WRONLY O_WRONLY #define QT_OPEN_RDWR O_RDWR diff --git a/mkspecs/solaris-g++/qplatformdefs.h b/mkspecs/solaris-g++/qplatformdefs.h index 9984a38..6438e7c 100644 --- a/mkspecs/solaris-g++/qplatformdefs.h +++ b/mkspecs/solaris-g++/qplatformdefs.h @@ -104,47 +104,7 @@ static inline int qt_socket_bind(int s, struct sockaddr *addr, QT_SOCKLEN_T addr # undef bind #endif -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif - -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif +#include "../common/xopen-lfs/qplatformdefs.h" #define QT_STAT_REG S_IFREG #define QT_STAT_DIR S_IFDIR @@ -161,7 +121,6 @@ static inline int qt_socket_bind(int s, struct sockaddr *addr, QT_SOCKLEN_T addr #define QT_CHDIR ::chdir #define QT_MKDIR ::mkdir #define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE #define QT_OPEN_RDONLY O_RDONLY #define QT_OPEN_WRONLY O_WRONLY #define QT_OPEN_RDWR O_RDWR diff --git a/mkspecs/unsupported/qnx-g++/qplatformdefs.h b/mkspecs/unsupported/qnx-g++/qplatformdefs.h index 9fe67dd..d86ce26 100644 --- a/mkspecs/unsupported/qnx-g++/qplatformdefs.h +++ b/mkspecs/unsupported/qnx-g++/qplatformdefs.h @@ -81,47 +81,7 @@ // for htonl #include -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseeko -#define QT_FTELL ::ftello -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T off_t -#endif - -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif +#include "../../common/xopen-lfs/qplatformdefs.h" #define QT_STAT_REG S_IFREG #define QT_STAT_DIR S_IFDIR @@ -138,7 +98,6 @@ #define QT_CHDIR ::chdir #define QT_MKDIR ::mkdir #define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE #define QT_OPEN_RDONLY O_RDONLY #define QT_OPEN_WRONLY O_WRONLY #define QT_OPEN_RDWR O_RDWR diff --git a/mkspecs/unsupported/vxworks-simpentium-g++/qplatformdefs.h b/mkspecs/unsupported/vxworks-simpentium-g++/qplatformdefs.h index 33ffd96..47a24a4 100644 --- a/mkspecs/unsupported/vxworks-simpentium-g++/qplatformdefs.h +++ b/mkspecs/unsupported/vxworks-simpentium-g++/qplatformdefs.h @@ -47,48 +47,10 @@ #include "qglobal.h" #include "qfunctions_vxworks.h" +#include "../../common/xopen-lfs/qplatformdefs.h" -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::stat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::stat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif - -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif +#undef QT_LSTAT +#define QT_LSTAT QT_STAT #define QT_STAT_REG S_IFREG #define QT_STAT_DIR S_IFDIR @@ -106,7 +68,6 @@ #define QT_CHDIR ::chdir #define QT_MKDIR(dir, perm) ::mkdir(dir) #define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE #define QT_OPEN_RDONLY O_RDONLY #define QT_OPEN_WRONLY O_WRONLY #define QT_OPEN_RDWR O_RDWR -- cgit v0.12 From 784946b8ea8b932924a831504387661d66170ca0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Fri, 15 Jan 2010 12:26:17 +0100 Subject: Refactor common C89 support out of individual qplatformdefs.h Reviewed-by: Thiago Macieira --- mkspecs/common/c89/qplatformdefs.h | 56 ++++++++++++++++++++++++++++++++++ mkspecs/cygwin-g++/qplatformdefs.h | 9 +----- mkspecs/darwin-g++/qplatformdefs.h | 13 +++++--- mkspecs/freebsd-g++/qplatformdefs.h | 13 +++++--- mkspecs/hurd-g++/qplatformdefs.h | 13 +++++--- mkspecs/lynxos-g++/qplatformdefs.h | 13 +++++--- mkspecs/macx-g++/qplatformdefs.h | 13 +++++--- mkspecs/macx-g++40/qplatformdefs.h | 13 +++++--- mkspecs/macx-g++42/qplatformdefs.h | 13 +++++--- mkspecs/macx-llvm/qplatformdefs.h | 13 +++++--- mkspecs/macx-pbuilder/qplatformdefs.h | 13 +++++--- mkspecs/macx-xcode/qplatformdefs.h | 13 +++++--- mkspecs/macx-xlc/qplatformdefs.h | 13 +++++--- mkspecs/netbsd-g++/qplatformdefs.h | 13 +++++--- mkspecs/openbsd-g++/qplatformdefs.h | 13 +++++--- mkspecs/sco-cc/qplatformdefs.h | 13 +++++--- mkspecs/sco-g++/qplatformdefs.h | 13 +++++--- mkspecs/tru64-cxx/qplatformdefs.h | 12 +++----- mkspecs/tru64-g++/qplatformdefs.h | 12 +++----- mkspecs/unixware-cc/qplatformdefs.h | 12 +++----- mkspecs/unixware-g++/qplatformdefs.h | 12 +++----- mkspecs/win32-borland/qplatformdefs.h | 17 ++++------- mkspecs/win32-g++/qplatformdefs.h | 17 ++++------- mkspecs/win32-icc/qplatformdefs.h | 18 +++++------ mkspecs/win32-msvc.net/qplatformdefs.h | 17 +++-------- mkspecs/win32-msvc/qplatformdefs.h | 16 ++-------- mkspecs/win32-msvc2005/qplatformdefs.h | 17 ++++------- 27 files changed, 231 insertions(+), 179 deletions(-) create mode 100644 mkspecs/common/c89/qplatformdefs.h diff --git a/mkspecs/common/c89/qplatformdefs.h b/mkspecs/common/c89/qplatformdefs.h new file mode 100644 index 0000000..c6a8e14 --- /dev/null +++ b/mkspecs/common/c89/qplatformdefs.h @@ -0,0 +1,56 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the qmake spec of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q_C89_QPLATFORMDEFS_H +#define Q_C89_QPLATFORMDEFS_H + +// #include + +#define QT_FPOS_T fpos_t +#define QT_OFF_T long + +#define QT_FOPEN ::fopen +#define QT_FSEEK ::fseek +#define QT_FTELL ::ftell +#define QT_FGETPOS ::fgetpos +#define QT_FSETPOS ::fsetpos + +#endif // include guard diff --git a/mkspecs/cygwin-g++/qplatformdefs.h b/mkspecs/cygwin-g++/qplatformdefs.h index 9b3be62..2927945 100644 --- a/mkspecs/cygwin-g++/qplatformdefs.h +++ b/mkspecs/cygwin-g++/qplatformdefs.h @@ -81,6 +81,7 @@ //#include #include +#include "../common/c89/qplatformdefs.h" #define QT_STATBUF struct stat #define QT_STATBUF4TSTAT struct stat @@ -113,15 +114,7 @@ #define QT_OPEN_CREAT O_CREAT #define QT_OPEN_TRUNC O_TRUNC #define QT_OPEN_APPEND O_APPEND -#define QT_FOPEN ::fopen -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos #define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long #define QT_SIGNAL_RETTYPE void #define QT_SIGNAL_ARGS int diff --git a/mkspecs/darwin-g++/qplatformdefs.h b/mkspecs/darwin-g++/qplatformdefs.h index 5aea69f..4a378ba 100644 --- a/mkspecs/darwin-g++/qplatformdefs.h +++ b/mkspecs/darwin-g++/qplatformdefs.h @@ -74,15 +74,18 @@ #include #endif -#define QT_FOPEN ::fopen +#include "../common/c89/qplatformdefs.h" + +#undef QT_FSEEK +#undef QT_FTELL +#undef QT_OFF_T + #define QT_FSEEK ::fseeko #define QT_FTELL ::ftello -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t #define QT_OFF_T off_t +#define QT_MMAP ::mmap + #define QT_STATBUF struct stat #define QT_STATBUF4TSTAT struct stat #define QT_STAT ::stat diff --git a/mkspecs/freebsd-g++/qplatformdefs.h b/mkspecs/freebsd-g++/qplatformdefs.h index b5d1b2f..d9c6903 100644 --- a/mkspecs/freebsd-g++/qplatformdefs.h +++ b/mkspecs/freebsd-g++/qplatformdefs.h @@ -76,15 +76,18 @@ #include #endif -#define QT_FOPEN ::fopen +#include "../common/c89/qplatformdefs.h" + +#undef QT_FSEEK +#undef QT_FTELL +#undef QT_OFF_T + #define QT_FSEEK ::fseeko #define QT_FTELL ::ftello -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t #define QT_OFF_T off_t +#define QT_MMAP ::mmap + #define QT_STATBUF struct stat #define QT_STATBUF4TSTAT struct stat #define QT_STAT ::stat diff --git a/mkspecs/hurd-g++/qplatformdefs.h b/mkspecs/hurd-g++/qplatformdefs.h index 68ee2d8..41ced99 100644 --- a/mkspecs/hurd-g++/qplatformdefs.h +++ b/mkspecs/hurd-g++/qplatformdefs.h @@ -82,15 +82,18 @@ #include #endif -#define QT_FOPEN ::fopen +#include "../common/c89/qplatformdefs.h" + +#undef QT_FSEEK +#undef QT_FTELL +#undef QT_OFF_T + #define QT_FSEEK ::fseeko #define QT_FTELL ::ftello -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t #define QT_OFF_T off_t +#define QT_MMAP ::mmap + #define QT_STATBUF struct stat #define QT_STATBUF4TSTAT struct stat #define QT_STAT ::stat diff --git a/mkspecs/lynxos-g++/qplatformdefs.h b/mkspecs/lynxos-g++/qplatformdefs.h index bdb492e..93ed4d5 100644 --- a/mkspecs/lynxos-g++/qplatformdefs.h +++ b/mkspecs/lynxos-g++/qplatformdefs.h @@ -75,15 +75,18 @@ #include #endif -#define QT_FOPEN ::fopen +#include "../common/c89/qplatformdefs.h" + +#undef QT_FSEEK +#undef QT_FTELL +#undef QT_OFF_T + #define QT_FSEEK ::fseeko #define QT_FTELL ::ftello -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t #define QT_OFF_T off_t +#define QT_MMAP ::mmap + #define QT_STATBUF struct stat #define QT_STATBUF4TSTAT struct stat #define QT_STAT ::stat diff --git a/mkspecs/macx-g++/qplatformdefs.h b/mkspecs/macx-g++/qplatformdefs.h index 03bdce9..890e4bb 100644 --- a/mkspecs/macx-g++/qplatformdefs.h +++ b/mkspecs/macx-g++/qplatformdefs.h @@ -75,15 +75,18 @@ #include #endif -#define QT_FOPEN ::fopen +#include "../common/c89/qplatformdefs.h" + +#undef QT_FSEEK +#undef QT_FTELL +#undef QT_OFF_T + #define QT_FSEEK ::fseeko #define QT_FTELL ::ftello -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t #define QT_OFF_T off_t +#define QT_MMAP ::mmap + #define QT_STATBUF struct stat #define QT_STATBUF4TSTAT struct stat #define QT_STAT ::stat diff --git a/mkspecs/macx-g++40/qplatformdefs.h b/mkspecs/macx-g++40/qplatformdefs.h index 03bdce9..890e4bb 100644 --- a/mkspecs/macx-g++40/qplatformdefs.h +++ b/mkspecs/macx-g++40/qplatformdefs.h @@ -75,15 +75,18 @@ #include #endif -#define QT_FOPEN ::fopen +#include "../common/c89/qplatformdefs.h" + +#undef QT_FSEEK +#undef QT_FTELL +#undef QT_OFF_T + #define QT_FSEEK ::fseeko #define QT_FTELL ::ftello -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t #define QT_OFF_T off_t +#define QT_MMAP ::mmap + #define QT_STATBUF struct stat #define QT_STATBUF4TSTAT struct stat #define QT_STAT ::stat diff --git a/mkspecs/macx-g++42/qplatformdefs.h b/mkspecs/macx-g++42/qplatformdefs.h index 03bdce9..890e4bb 100644 --- a/mkspecs/macx-g++42/qplatformdefs.h +++ b/mkspecs/macx-g++42/qplatformdefs.h @@ -75,15 +75,18 @@ #include #endif -#define QT_FOPEN ::fopen +#include "../common/c89/qplatformdefs.h" + +#undef QT_FSEEK +#undef QT_FTELL +#undef QT_OFF_T + #define QT_FSEEK ::fseeko #define QT_FTELL ::ftello -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t #define QT_OFF_T off_t +#define QT_MMAP ::mmap + #define QT_STATBUF struct stat #define QT_STATBUF4TSTAT struct stat #define QT_STAT ::stat diff --git a/mkspecs/macx-llvm/qplatformdefs.h b/mkspecs/macx-llvm/qplatformdefs.h index 03bdce9..890e4bb 100644 --- a/mkspecs/macx-llvm/qplatformdefs.h +++ b/mkspecs/macx-llvm/qplatformdefs.h @@ -75,15 +75,18 @@ #include #endif -#define QT_FOPEN ::fopen +#include "../common/c89/qplatformdefs.h" + +#undef QT_FSEEK +#undef QT_FTELL +#undef QT_OFF_T + #define QT_FSEEK ::fseeko #define QT_FTELL ::ftello -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t #define QT_OFF_T off_t +#define QT_MMAP ::mmap + #define QT_STATBUF struct stat #define QT_STATBUF4TSTAT struct stat #define QT_STAT ::stat diff --git a/mkspecs/macx-pbuilder/qplatformdefs.h b/mkspecs/macx-pbuilder/qplatformdefs.h index c8e49af..7a04926 100644 --- a/mkspecs/macx-pbuilder/qplatformdefs.h +++ b/mkspecs/macx-pbuilder/qplatformdefs.h @@ -75,15 +75,18 @@ #include #endif -#define QT_FOPEN ::fopen +#include "../common/c89/qplatformdefs.h" + +#undef QT_FSEEK +#undef QT_FTELL +#undef QT_OFF_T + #define QT_FSEEK ::fseeko #define QT_FTELL ::ftello -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t #define QT_OFF_T off_t +#define QT_MMAP ::mmap + #define QT_STATBUF struct stat #define QT_STATBUF4TSTAT struct stat #define QT_STAT ::stat diff --git a/mkspecs/macx-xcode/qplatformdefs.h b/mkspecs/macx-xcode/qplatformdefs.h index 03bdce9..890e4bb 100644 --- a/mkspecs/macx-xcode/qplatformdefs.h +++ b/mkspecs/macx-xcode/qplatformdefs.h @@ -75,15 +75,18 @@ #include #endif -#define QT_FOPEN ::fopen +#include "../common/c89/qplatformdefs.h" + +#undef QT_FSEEK +#undef QT_FTELL +#undef QT_OFF_T + #define QT_FSEEK ::fseeko #define QT_FTELL ::ftello -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t #define QT_OFF_T off_t +#define QT_MMAP ::mmap + #define QT_STATBUF struct stat #define QT_STATBUF4TSTAT struct stat #define QT_STAT ::stat diff --git a/mkspecs/macx-xlc/qplatformdefs.h b/mkspecs/macx-xlc/qplatformdefs.h index 43c3158..b78d523 100644 --- a/mkspecs/macx-xlc/qplatformdefs.h +++ b/mkspecs/macx-xlc/qplatformdefs.h @@ -75,15 +75,18 @@ #include #endif -#define QT_FOPEN ::fopen +#include "../common/c89/qplatformdefs.h" + +#undef QT_FSEEK +#undef QT_FTELL +#undef QT_OFF_T + #define QT_FSEEK ::fseeko #define QT_FTELL ::ftello -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t #define QT_OFF_T off_t +#define QT_MMAP ::mmap + #define QT_STATBUF struct stat #define QT_STATBUF4TSTAT struct stat #define QT_STAT ::stat diff --git a/mkspecs/netbsd-g++/qplatformdefs.h b/mkspecs/netbsd-g++/qplatformdefs.h index f455a86..7816703 100644 --- a/mkspecs/netbsd-g++/qplatformdefs.h +++ b/mkspecs/netbsd-g++/qplatformdefs.h @@ -75,15 +75,18 @@ #include #endif -#define QT_FOPEN ::fopen +#include "../common/c89/qplatformdefs.h" + +#undef QT_FSEEK +#undef QT_FTELL +#undef QT_OFF_T + #define QT_FSEEK ::fseeko #define QT_FTELL ::ftello -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t #define QT_OFF_T off_t +#define QT_MMAP ::mmap + #define QT_STATBUF struct stat #define QT_STATBUF4TSTAT struct stat #define QT_STAT ::stat diff --git a/mkspecs/openbsd-g++/qplatformdefs.h b/mkspecs/openbsd-g++/qplatformdefs.h index 0a9ea21..db957c2 100644 --- a/mkspecs/openbsd-g++/qplatformdefs.h +++ b/mkspecs/openbsd-g++/qplatformdefs.h @@ -76,15 +76,18 @@ #include #endif -#define QT_FOPEN ::fopen +#include "../common/c89/qplatformdefs.h" + +#undef QT_FSEEK +#undef QT_FTELL +#undef QT_OFF_T + #define QT_FSEEK ::fseeko #define QT_FTELL ::ftello -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t #define QT_OFF_T off_t +#define QT_MMAP ::mmap + #define QT_STATBUF struct stat #define QT_STATBUF4TSTAT struct stat #define QT_STAT ::stat diff --git a/mkspecs/sco-cc/qplatformdefs.h b/mkspecs/sco-cc/qplatformdefs.h index b5427c9..df12900 100644 --- a/mkspecs/sco-cc/qplatformdefs.h +++ b/mkspecs/sco-cc/qplatformdefs.h @@ -76,15 +76,18 @@ #include #endif -#define QT_FOPEN ::fopen +#include "../common/c89/qplatformdefs.h" + +#undef QT_FSEEK +#undef QT_FTELL +#undef QT_OFF_T + #define QT_FSEEK ::fseeko #define QT_FTELL ::ftello -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t #define QT_OFF_T off_t +#define QT_MMAP ::mmap + #define QT_STATBUF struct stat #define QT_STATBUF4TSTAT struct stat #define QT_STAT ::stat diff --git a/mkspecs/sco-g++/qplatformdefs.h b/mkspecs/sco-g++/qplatformdefs.h index 058ab78..fe3c1ee 100644 --- a/mkspecs/sco-g++/qplatformdefs.h +++ b/mkspecs/sco-g++/qplatformdefs.h @@ -80,15 +80,18 @@ #include #endif -#define QT_FOPEN ::fopen +#include "../common/c89/qplatformdefs.h" + +#undef QT_FSEEK +#undef QT_FTELL +#undef QT_OFF_T + #define QT_FSEEK ::fseeko #define QT_FTELL ::ftello -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t #define QT_OFF_T off_t +#define QT_MMAP ::mmap + #define QT_STATBUF struct stat #define QT_STATBUF4TSTAT struct stat #define QT_STAT ::stat diff --git a/mkspecs/tru64-cxx/qplatformdefs.h b/mkspecs/tru64-cxx/qplatformdefs.h index 54fb139..dc18e1d 100644 --- a/mkspecs/tru64-cxx/qplatformdefs.h +++ b/mkspecs/tru64-cxx/qplatformdefs.h @@ -78,15 +78,13 @@ #include #endif -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t +#include "../common/c89/qplatformdefs.h" + +#undef QT_OFF_T #define QT_OFF_T off_t +#define QT_MMAP ::mmap + #define QT_STATBUF struct stat #define QT_STATBUF4TSTAT struct stat #define QT_STAT ::stat diff --git a/mkspecs/tru64-g++/qplatformdefs.h b/mkspecs/tru64-g++/qplatformdefs.h index 44c23f1..485879e 100644 --- a/mkspecs/tru64-g++/qplatformdefs.h +++ b/mkspecs/tru64-g++/qplatformdefs.h @@ -78,15 +78,13 @@ #include #endif -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t +#include "../common/c89/qplatformdefs.h" + +#undef QT_OFF_T #define QT_OFF_T off_t +#define QT_MMAP ::mmap + #define QT_STATBUF struct stat #define QT_STATBUF4TSTAT struct stat #define QT_STAT ::stat diff --git a/mkspecs/unixware-cc/qplatformdefs.h b/mkspecs/unixware-cc/qplatformdefs.h index e314713..cdcd3a3 100644 --- a/mkspecs/unixware-cc/qplatformdefs.h +++ b/mkspecs/unixware-cc/qplatformdefs.h @@ -76,15 +76,13 @@ #include #endif -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t +#include "../common/c89/qplatformdefs.h" + +#undef QT_OFF_T #define QT_OFF_T off_t +#define QT_MMAP ::mmap + #define QT_STATBUF struct stat #define QT_STATBUF4TSTAT struct stat #define QT_STAT ::stat diff --git a/mkspecs/unixware-g++/qplatformdefs.h b/mkspecs/unixware-g++/qplatformdefs.h index e314713..cdcd3a3 100644 --- a/mkspecs/unixware-g++/qplatformdefs.h +++ b/mkspecs/unixware-g++/qplatformdefs.h @@ -76,15 +76,13 @@ #include #endif -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t +#include "../common/c89/qplatformdefs.h" + +#undef QT_OFF_T #define QT_OFF_T off_t +#define QT_MMAP ::mmap + #define QT_STATBUF struct stat #define QT_STATBUF4TSTAT struct stat #define QT_STAT ::stat diff --git a/mkspecs/win32-borland/qplatformdefs.h b/mkspecs/win32-borland/qplatformdefs.h index 4efae9a..d8fa4c2 100644 --- a/mkspecs/win32-borland/qplatformdefs.h +++ b/mkspecs/win32-borland/qplatformdefs.h @@ -96,21 +96,16 @@ # define QT_STAT_LNK _S_IFLNK #endif -#define QT_FOPEN ::fopen +#include "../common/c89/qplatformdefs.h" + #ifdef QT_LARGEFILE_SUPPORT +#undef QT_FSEEK +#undef QT_FTELL +#undef QT_OFF_T + #define QT_FSEEK ::_fseeki64 #define QT_FTELL ::_ftelli64 -#else -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#endif -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_FPOS_T fpos_t -#ifdef QT_LARGEFILE_SUPPORT #define QT_OFF_T __int64 -#else -#define QT_OFF_T long #endif #define QT_FILENO _fileno diff --git a/mkspecs/win32-g++/qplatformdefs.h b/mkspecs/win32-g++/qplatformdefs.h index 12828d1..36333b6 100644 --- a/mkspecs/win32-g++/qplatformdefs.h +++ b/mkspecs/win32-g++/qplatformdefs.h @@ -133,21 +133,16 @@ typedef enum { # define QT_OPEN_BINARY _O_BINARY #endif -#define QT_FOPEN ::fopen +#include "../common/c89/qplatformdefs.h" + #ifdef QT_LARGEFILE_SUPPORT +#undef QT_FSEEK +#undef QT_FTELL +#undef QT_OFF_T + #define QT_FSEEK ::fseeko64 #define QT_FTELL ::ftello64 -#else -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#endif -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_FPOS_T fpos_t -#ifdef QT_LARGEFILE_SUPPORT #define QT_OFF_T off64_t -#else -#define QT_OFF_T long #endif #define QT_SIGNAL_ARGS int diff --git a/mkspecs/win32-icc/qplatformdefs.h b/mkspecs/win32-icc/qplatformdefs.h index 6abfef2..833846f 100644 --- a/mkspecs/win32-icc/qplatformdefs.h +++ b/mkspecs/win32-icc/qplatformdefs.h @@ -113,21 +113,19 @@ # define QT_OPEN_BINARY _O_BINARY #endif -#define QT_FOPEN ::fopen +#include "../common/c89/qplatformdefs.h" + #if defined(QT_LARGEFILE_SUPPORT) && _MSC_VER > 1310 +#undef QT_FSEEK +#undef QT_FTELL + #define QT_FSEEK ::_fseeki64 #define QT_FTELL ::_ftelli64 -#else -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell #endif -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_FPOS_T fpos_t -#ifdef QT_LARGEFILE_SUPPORT + +#if defined(QT_LARGEFILE_SUPPORT) +#undef QT_OFF_T #define QT_OFF_T __int64 -#else -#define QT_OFF_T long #endif #define QT_SIGNAL_ARGS int diff --git a/mkspecs/win32-msvc.net/qplatformdefs.h b/mkspecs/win32-msvc.net/qplatformdefs.h index dcfaec5..05584c9 100644 --- a/mkspecs/win32-msvc.net/qplatformdefs.h +++ b/mkspecs/win32-msvc.net/qplatformdefs.h @@ -113,23 +113,16 @@ # define QT_OPEN_BINARY _O_BINARY #endif -#define QT_FOPEN ::fopen +#include "../common/c89/qplatformdefs.h" + #ifdef QT_LARGEFILE_SUPPORT +#undef QT_FTELL +#undef QT_OFF_T + // 64-bit versions of fseek/ftell not always available. E.g., when linking // dynamically to CRT (/MT) -#define QT_FSEEK ::fseek #define QT_FTELL (QT_OFF_T)::ftell -#else -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#endif -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_FPOS_T fpos_t -#ifdef QT_LARGEFILE_SUPPORT #define QT_OFF_T __int64 -#else -#define QT_OFF_T long #endif #define QT_SIGNAL_ARGS int diff --git a/mkspecs/win32-msvc/qplatformdefs.h b/mkspecs/win32-msvc/qplatformdefs.h index 5dee28c..abb5894 100644 --- a/mkspecs/win32-msvc/qplatformdefs.h +++ b/mkspecs/win32-msvc/qplatformdefs.h @@ -113,21 +113,11 @@ # define QT_OPEN_BINARY _O_BINARY #endif -#define QT_FOPEN ::fopen -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#else -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#endif -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_FPOS_T fpos_t +#include "../common/c89/qplatformdefs.h" + #ifdef QT_LARGEFILE_SUPPORT +#undef QT_OFF_T #define QT_OFF_T __int64 -#else -#define QT_OFF_T long #endif #define QT_SIGNAL_ARGS int diff --git a/mkspecs/win32-msvc2005/qplatformdefs.h b/mkspecs/win32-msvc2005/qplatformdefs.h index b87ea48..33360b7 100644 --- a/mkspecs/win32-msvc2005/qplatformdefs.h +++ b/mkspecs/win32-msvc2005/qplatformdefs.h @@ -113,21 +113,16 @@ # define QT_OPEN_BINARY _O_BINARY #endif -#define QT_FOPEN ::fopen +#include "../common/c89/qplatformdefs.h" + #ifdef QT_LARGEFILE_SUPPORT +#undef QT_FSEEK +#undef QT_FTELL +#undef QT_OFF_T + #define QT_FSEEK ::_fseeki64 #define QT_FTELL ::_ftelli64 -#else -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#endif -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_FPOS_T fpos_t -#ifdef QT_LARGEFILE_SUPPORT #define QT_OFF_T __int64 -#else -#define QT_OFF_T long #endif #define QT_SIGNAL_ARGS int -- cgit v0.12 From 0f8519368e2cfdaddb49cea60096fd03df69fd62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Fri, 15 Jan 2010 18:05:06 +0100 Subject: Refactor common POSIX support out of individual qplatformdefs.h POSIX header incorporates previously refactored X/Open LFS extensions. Reviewed-by: Thiago Macieira --- mkspecs/aix-g++-64/qplatformdefs.h | 37 +----- mkspecs/aix-g++/qplatformdefs.h | 37 +----- mkspecs/aix-xlc-64/qplatformdefs.h | 31 +---- mkspecs/aix-xlc/qplatformdefs.h | 37 +----- mkspecs/common/posix/qplatformdefs.h | 144 +++++++++++++++++++++ mkspecs/common/symbian/qplatformdefs.h | 39 +----- mkspecs/common/xopen-lfs/qplatformdefs.h | 97 -------------- mkspecs/cygwin-g++/qplatformdefs.h | 43 +----- mkspecs/darwin-g++/qplatformdefs.h | 49 +------ mkspecs/freebsd-g++/qplatformdefs.h | 54 +------- mkspecs/hpux-acc-64/qplatformdefs.h | 35 +---- mkspecs/hpux-acc-o64/qplatformdefs.h | 33 +---- mkspecs/hpux-acc/qplatformdefs.h | 35 +---- mkspecs/hpux-g++-64/qplatformdefs.h | 32 +---- mkspecs/hpux-g++/qplatformdefs.h | 33 +---- mkspecs/hpuxi-acc-32/qplatformdefs.h | 34 +---- mkspecs/hpuxi-acc-64/qplatformdefs.h | 34 +---- mkspecs/hpuxi-g++-64/qplatformdefs.h | 34 +---- mkspecs/hurd-g++/qplatformdefs.h | 49 +------ mkspecs/irix-cc-64/qplatformdefs.h | 34 +---- mkspecs/irix-cc/qplatformdefs.h | 34 +---- mkspecs/irix-g++/qplatformdefs.h | 46 ++----- mkspecs/linux-cxx/qplatformdefs.h | 36 +----- mkspecs/linux-ecc-64/qplatformdefs.h | 36 +----- mkspecs/linux-g++/qplatformdefs.h | 34 +---- mkspecs/linux-kcc/qplatformdefs.h | 36 +----- mkspecs/linux-llvm/qplatformdefs.h | 34 +---- mkspecs/linux-lsb-g++/qplatformdefs.h | 43 ++---- mkspecs/linux-pgcc/qplatformdefs.h | 36 +----- mkspecs/lynxos-g++/qplatformdefs.h | 55 +------- mkspecs/macx-g++/qplatformdefs.h | 57 ++------ mkspecs/macx-g++40/qplatformdefs.h | 57 ++------ mkspecs/macx-g++42/qplatformdefs.h | 57 ++------ mkspecs/macx-llvm/qplatformdefs.h | 57 ++------ mkspecs/macx-pbuilder/qplatformdefs.h | 58 ++------- mkspecs/macx-xcode/qplatformdefs.h | 57 ++------ mkspecs/macx-xlc/qplatformdefs.h | 51 +------- mkspecs/netbsd-g++/qplatformdefs.h | 54 +------- mkspecs/openbsd-g++/qplatformdefs.h | 54 +------- mkspecs/sco-cc/qplatformdefs.h | 50 +------ mkspecs/sco-g++/qplatformdefs.h | 50 +------ mkspecs/solaris-cc-64/qplatformdefs.h | 35 +---- mkspecs/solaris-cc/qplatformdefs.h | 42 ++---- mkspecs/solaris-g++-64/qplatformdefs.h | 39 +----- mkspecs/solaris-g++/qplatformdefs.h | 38 ++---- mkspecs/tru64-cxx/qplatformdefs.h | 56 ++------ mkspecs/tru64-g++/qplatformdefs.h | 56 ++------ mkspecs/unixware-cc/qplatformdefs.h | 45 +------ mkspecs/unixware-g++/qplatformdefs.h | 45 +------ mkspecs/unsupported/qnx-g++/qplatformdefs.h | 31 +---- .../vxworks-simpentium-g++/qplatformdefs.h | 38 ++---- 51 files changed, 456 insertions(+), 1882 deletions(-) create mode 100644 mkspecs/common/posix/qplatformdefs.h delete mode 100644 mkspecs/common/xopen-lfs/qplatformdefs.h diff --git a/mkspecs/aix-g++-64/qplatformdefs.h b/mkspecs/aix-g++-64/qplatformdefs.h index 0a2ef22..4421ba4 100644 --- a/mkspecs/aix-g++-64/qplatformdefs.h +++ b/mkspecs/aix-g++-64/qplatformdefs.h @@ -81,45 +81,22 @@ #include #endif -#include "../common/xopen-lfs/qplatformdefs.h" +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../common/posix/qplatformdefs.h" -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN +#undef QT_SOCKLEN_T #ifdef _AIX43 // AIX 4.3 and better -#define QT_SOCKLEN_T socklen_t +#define QT_SOCKLEN_T socklen_t #elif _AIX42 // AIX 4.2 -#define QT_SOCKLEN_T size_t +#define QT_SOCKLEN_T size_t #else // AIX 4.1 -#define QT_SOCKLEN_T size_t +#define QT_SOCKLEN_T size_t // override -#define QT_SOCKOPTLEN_T int +#define QT_SOCKOPTLEN_T int #endif #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) diff --git a/mkspecs/aix-g++/qplatformdefs.h b/mkspecs/aix-g++/qplatformdefs.h index 0a2ef22..4421ba4 100644 --- a/mkspecs/aix-g++/qplatformdefs.h +++ b/mkspecs/aix-g++/qplatformdefs.h @@ -81,45 +81,22 @@ #include #endif -#include "../common/xopen-lfs/qplatformdefs.h" +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../common/posix/qplatformdefs.h" -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN +#undef QT_SOCKLEN_T #ifdef _AIX43 // AIX 4.3 and better -#define QT_SOCKLEN_T socklen_t +#define QT_SOCKLEN_T socklen_t #elif _AIX42 // AIX 4.2 -#define QT_SOCKLEN_T size_t +#define QT_SOCKLEN_T size_t #else // AIX 4.1 -#define QT_SOCKLEN_T size_t +#define QT_SOCKLEN_T size_t // override -#define QT_SOCKOPTLEN_T int +#define QT_SOCKOPTLEN_T int #endif #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) diff --git a/mkspecs/aix-xlc-64/qplatformdefs.h b/mkspecs/aix-xlc-64/qplatformdefs.h index c28f04a..a52b3d3 100644 --- a/mkspecs/aix-xlc-64/qplatformdefs.h +++ b/mkspecs/aix-xlc-64/qplatformdefs.h @@ -77,36 +77,11 @@ #include #endif -#include "../common/xopen-lfs/qplatformdefs.h" - -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../common/posix/qplatformdefs.h" +// QT_SOCKLEN_T // Only AIX 4.3 and better support 64-bit -#define QT_SOCKLEN_T socklen_t #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) // Only AIX 4.3 and better support 64-bit diff --git a/mkspecs/aix-xlc/qplatformdefs.h b/mkspecs/aix-xlc/qplatformdefs.h index f789fda..97cd0a1 100644 --- a/mkspecs/aix-xlc/qplatformdefs.h +++ b/mkspecs/aix-xlc/qplatformdefs.h @@ -77,45 +77,22 @@ #include #endif -#include "../common/xopen-lfs/qplatformdefs.h" +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../common/posix/qplatformdefs.h" -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN +#undef QT_SOCKLEN_T #ifdef _AIX43 // AIX 4.3 and better -#define QT_SOCKLEN_T socklen_t +#define QT_SOCKLEN_T socklen_t #elif _AIX42 // AIX 4.2 -#define QT_SOCKLEN_T size_t +#define QT_SOCKLEN_T size_t #else // AIX 4.1 -#define QT_SOCKLEN_T size_t +#define QT_SOCKLEN_T size_t // override -#define QT_SOCKOPTLEN_T int +#define QT_SOCKOPTLEN_T int #endif #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE-0 >= 500) diff --git a/mkspecs/common/posix/qplatformdefs.h b/mkspecs/common/posix/qplatformdefs.h new file mode 100644 index 0000000..fe50de2 --- /dev/null +++ b/mkspecs/common/posix/qplatformdefs.h @@ -0,0 +1,144 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the qmake spec of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q_POSIX_QPLATFORMDEFS_H +#define Q_POSIX_QPLATFORMDEFS_H + +#include + +#include +#include +#include + +#if defined(QT_USE_XOPEN_LFS_EXTENSIONS) && defined(QT_LARGEFILE_SUPPORT) + +#define QT_STATBUF struct stat64 +#define QT_FPOS_T fpos64_t +#define QT_OFF_T off64_t + +#define QT_STAT ::stat64 +#define QT_LSTAT ::lstat64 +#define QT_TRUNCATE ::truncate64 + +// File I/O +#define QT_OPEN ::open64 +#define QT_LSEEK ::lseek64 +#define QT_FSTAT ::fstat64 +#define QT_FTRUNCATE ::ftruncate64 + +// Standard C89 +#define QT_FOPEN ::fopen64 +#define QT_FSEEK ::fseeko64 +#define QT_FTELL ::ftello64 +#define QT_FGETPOS ::fgetpos64 +#define QT_FSETPOS ::fsetpos64 + +#define QT_MMAP ::mmap64 + +#else // !defined(QT_USE_XOPEN_LFS_EXTENSIONS) || !defined(QT_LARGEFILE_SUPPORT) + +#include "../c89/qplatformdefs.h" + +#define QT_STATBUF struct stat + +#define QT_STAT ::stat +#define QT_LSTAT ::lstat +#define QT_TRUNCATE ::truncate + +// File I/O +#define QT_OPEN ::open +#define QT_LSEEK ::lseek +#define QT_FSTAT ::fstat +#define QT_FTRUNCATE ::ftruncate + +// Posix extensions to C89 +#if !defined(QT_USE_XOPEN_LFS_EXTENSIONS) && !defined(QT_NO_USE_FSEEKO) +#undef QT_OFF_T +#undef QT_FSEEK +#undef QT_FTELL + +#define QT_OFF_T off_t + +#define QT_FSEEK ::fseeko +#define QT_FTELL ::ftello +#endif + +#define QT_MMAP ::mmap + +#endif // !defined (QT_USE_XOPEN_LFS_EXTENSIONS) || !defined(QT_LARGEFILE_SUPPORT) + +#define QT_STAT_MASK S_IFMT +#define QT_STAT_REG S_IFREG +#define QT_STAT_DIR S_IFDIR +#define QT_STAT_LNK S_IFLNK + +#define QT_ACCESS ::access +#define QT_GETCWD ::getcwd +#define QT_CHDIR ::chdir +#define QT_MKDIR ::mkdir +#define QT_RMDIR ::rmdir + +// File I/O +#define QT_CLOSE ::close +#define QT_READ ::read +#define QT_WRITE ::write + +#define QT_OPEN_LARGEFILE O_LARGEFILE +#define QT_OPEN_RDONLY O_RDONLY +#define QT_OPEN_WRONLY O_WRONLY +#define QT_OPEN_RDWR O_RDWR +#define QT_OPEN_CREAT O_CREAT +#define QT_OPEN_TRUNC O_TRUNC +#define QT_OPEN_APPEND O_APPEND + +// Posix extensions to C89 +#define QT_FILENO fileno + +#define QT_SOCKLEN_T socklen_t + +#define QT_SOCKET_CONNECT ::connect +#define QT_SOCKET_BIND ::bind + +#define QT_SIGNAL_RETTYPE void +#define QT_SIGNAL_ARGS int +#define QT_SIGNAL_IGNORE SIG_IGN + +#endif // include guard diff --git a/mkspecs/common/symbian/qplatformdefs.h b/mkspecs/common/symbian/qplatformdefs.h index 4d95fae..38a1314 100644 --- a/mkspecs/common/symbian/qplatformdefs.h +++ b/mkspecs/common/symbian/qplatformdefs.h @@ -84,48 +84,23 @@ #endif #include -#include "../xopen-lfs/qplatformdefs.h" +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../posix/qplatformdefs.h" #undef QT_OPEN_LARGEFILE -#define QT_OPEN_LARGEFILE 0 - -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN +#undef QT_SOCKLEN_T + +#define QT_OPEN_LARGEFILE 0 #if (defined(__GLIBC__) && (__GLIBC__ >= 2)) || defined(Q_OS_SYMBIAN) -#define QT_SOCKLEN_T socklen_t +#define QT_SOCKLEN_T socklen_t #else -#define QT_SOCKLEN_T int +#define QT_SOCKLEN_T int #endif - #if defined(__ISO_C_VISIBLE) && (__ISO_C_VISIBLE >= 1999) #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf #endif - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/common/xopen-lfs/qplatformdefs.h b/mkspecs/common/xopen-lfs/qplatformdefs.h deleted file mode 100644 index 2599d62..0000000 --- a/mkspecs/common/xopen-lfs/qplatformdefs.h +++ /dev/null @@ -1,97 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the qmake spec of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef Q_XOPEN_LFS_QPLATFORMDEFS_H -#define Q_XOPEN_LFS_QPLATFORMDEFS_H - -#ifdef QT_LARGEFILE_SUPPORT - -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t - -#define QT_STAT ::stat64 -#define QT_LSTAT ::lstat64 -#define QT_TRUNCATE ::truncate64 - -#define QT_OPEN ::open64 -#define QT_LSEEK ::lseek64 -#define QT_FSTAT ::fstat64 -#define QT_FTRUNCATE ::ftruncate64 - -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 - -#define QT_MMAP ::mmap64 - -#else // !QT_LARGEFILE_SUPPORT - -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_FPOS_T fpos_t -#define QT_OFF_T long - -#define QT_STAT ::stat -#define QT_LSTAT ::lstat -#define QT_TRUNCATE ::truncate - -#define QT_OPEN ::open -#define QT_LSEEK ::lseek -#define QT_FSTAT ::fstat -#define QT_FTRUNCATE ::ftruncate - -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos - -#define QT_MMAP ::mmap - -#endif // QT_LARGEFILE_SUPPORT - -#define QT_OPEN_LARGEFILE O_LARGEFILE - -#endif // include guard diff --git a/mkspecs/cygwin-g++/qplatformdefs.h b/mkspecs/cygwin-g++/qplatformdefs.h index 2927945..b64e126 100644 --- a/mkspecs/cygwin-g++/qplatformdefs.h +++ b/mkspecs/cygwin-g++/qplatformdefs.h @@ -81,51 +81,16 @@ //#include #include -#include "../common/c89/qplatformdefs.h" +#define QT_NO_USE_FSEEKO +#include "../common/posix/qplatformdefs.h" + +#undef QT_OPEN_LARGEFILE -#define QT_STATBUF struct stat #define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_OPEN ::open -#define QT_CLOSE ::close -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND -#define QT_MMAP ::mmap - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN - -#define QT_SOCKLEN_T socklen_t #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf #endif - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/darwin-g++/qplatformdefs.h b/mkspecs/darwin-g++/qplatformdefs.h index 4a378ba..2ee0698 100644 --- a/mkspecs/darwin-g++/qplatformdefs.h +++ b/mkspecs/darwin-g++/qplatformdefs.h @@ -74,55 +74,12 @@ #include #endif -#include "../common/c89/qplatformdefs.h" +#include "../common/posix/qplatformdefs.h" -#undef QT_FSEEK -#undef QT_FTELL -#undef QT_OFF_T - -#define QT_FSEEK ::fseeko -#define QT_FTELL ::ftello -#define QT_OFF_T off_t - -#define QT_MMAP ::mmap - -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_OPEN ::open -#define QT_CLOSE ::close -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir +#undef QT_OPEN_LARGEFILE #define QT_OPEN_LARGEFILE 0 -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN -#define QT_SOCKLEN_T socklen_t +#define QT_STATBUF4TSTAT struct stat #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf diff --git a/mkspecs/freebsd-g++/qplatformdefs.h b/mkspecs/freebsd-g++/qplatformdefs.h index d9c6903..c0b7da6 100644 --- a/mkspecs/freebsd-g++/qplatformdefs.h +++ b/mkspecs/freebsd-g++/qplatformdefs.h @@ -76,62 +76,23 @@ #include #endif -#include "../common/c89/qplatformdefs.h" +#include "../common/posix/qplatformdefs.h" -#undef QT_FSEEK -#undef QT_FTELL -#undef QT_OFF_T +#undef QT_OPEN_LARGEFILE +#undef QT_SOCKLEN_T -#define QT_FSEEK ::fseeko -#define QT_FTELL ::ftello -#define QT_OFF_T off_t - -#define QT_MMAP ::mmap - -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_OPEN ::open -#define QT_CLOSE ::close -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir #define QT_OPEN_LARGEFILE 0 -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN #if !defined(__DragonFly__) && (__FreeBSD_version < 400000) // FreeBSD 1.0 - 3.5.1 -# define QT_SOCKLEN_T int +#define QT_SOCKLEN_T int #else // FreeBSD 4.0 and better -# define QT_SOCKLEN_T socklen_t +#define QT_SOCKLEN_T socklen_t #endif +#define QT_STATBUF4TSTAT struct stat + #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf @@ -146,5 +107,4 @@ #define QT_AOUT_UNDERSCORE #endif - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/hpux-acc-64/qplatformdefs.h b/mkspecs/hpux-acc-64/qplatformdefs.h index 933ffb7..f9789a8 100644 --- a/mkspecs/hpux-acc-64/qplatformdefs.h +++ b/mkspecs/hpux-acc-64/qplatformdefs.h @@ -76,38 +76,13 @@ #include #endif -#include "../common/xopen-lfs/qplatformdefs.h" +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../common/posix/qplatformdefs.h" #undef QT_OPEN_LARGEFILE -#define QT_OPEN_LARGEFILE 0 - -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN - -#define QT_SOCKLEN_T int +#undef QT_SOCKLEN_T +#define QT_OPEN_LARGEFILE 0 +#define QT_SOCKLEN_T int #endif // QPLATFORMDEFS_H diff --git a/mkspecs/hpux-acc-o64/qplatformdefs.h b/mkspecs/hpux-acc-o64/qplatformdefs.h index 397d9aa..5237806 100644 --- a/mkspecs/hpux-acc-o64/qplatformdefs.h +++ b/mkspecs/hpux-acc-o64/qplatformdefs.h @@ -77,35 +77,10 @@ #include #endif -#include "../common/xopen-lfs/qplatformdefs.h" - -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN - -#define QT_SOCKLEN_T int +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../common/posix/qplatformdefs.h" +#undef QT_SOCKLEN_T +#define QT_SOCKLEN_T int #endif // QPLATFORMDEFS_H diff --git a/mkspecs/hpux-acc/qplatformdefs.h b/mkspecs/hpux-acc/qplatformdefs.h index bec30bd..9ce08c6 100644 --- a/mkspecs/hpux-acc/qplatformdefs.h +++ b/mkspecs/hpux-acc/qplatformdefs.h @@ -79,38 +79,14 @@ #include #endif -#include "../common/xopen-lfs/qplatformdefs.h" +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../common/posix/qplatformdefs.h" #undef QT_OPEN_LARGEFILE -#define QT_OPEN_LARGEFILE 0 - -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN +#undef QT_SOCKLEN_T -#define QT_SOCKLEN_T int +#define QT_OPEN_LARGEFILE 0 +#define QT_SOCKLEN_T int // presence of _XOPEN_UNIX can be used to detect HP-UX 10 or higher #if !defined(_XOPEN_UNIX) @@ -118,5 +94,4 @@ #define select(a,b,c,d,e) select((a), (int *)(b), (int *)(c), (int *)(d), (e)) #endif - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/hpux-g++-64/qplatformdefs.h b/mkspecs/hpux-g++-64/qplatformdefs.h index 54e3058..f3fbda5 100644 --- a/mkspecs/hpux-g++-64/qplatformdefs.h +++ b/mkspecs/hpux-g++-64/qplatformdefs.h @@ -76,35 +76,7 @@ #include #endif -#include "../common/xopen-lfs/qplatformdefs.h" - -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN - -#define QT_SOCKLEN_T socklen_t - +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../common/posix/qplatformdefs.h" #endif // QPLATFORMDEFS_H diff --git a/mkspecs/hpux-g++/qplatformdefs.h b/mkspecs/hpux-g++/qplatformdefs.h index bb165f9..38e9408 100644 --- a/mkspecs/hpux-g++/qplatformdefs.h +++ b/mkspecs/hpux-g++/qplatformdefs.h @@ -78,35 +78,11 @@ #include #endif -#include "../common/xopen-lfs/qplatformdefs.h" +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../common/posix/qplatformdefs.h" -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN - -#define QT_SOCKLEN_T int +#undef QT_SOCKLEN_T +#define QT_SOCKLEN_T int // presence of _XOPEN_UNIX can be used to detect HP-UX 10 or higher #if !defined(_XOPEN_UNIX) @@ -114,5 +90,4 @@ #define select(a,b,c,d,e) select((a), (int *)(b), (int *)(c), (int *)(d), (e)) #endif - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/hpuxi-acc-32/qplatformdefs.h b/mkspecs/hpuxi-acc-32/qplatformdefs.h index 7afb0fe..a0d2464 100644 --- a/mkspecs/hpuxi-acc-32/qplatformdefs.h +++ b/mkspecs/hpuxi-acc-32/qplatformdefs.h @@ -77,37 +77,13 @@ #include #endif -#include "../common/xopen-lfs/qplatformdefs.h" +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../common/posix/qplatformdefs.h" #undef QT_OPEN_LARGEFILE -#define QT_OPEN_LARGEFILE 0 +#undef QT_SOCKLEN_T -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN - -#define QT_SOCKLEN_T int +#define QT_OPEN_LARGEFILE 0 +#define QT_SOCKLEN_T int #endif // QPLATFORMDEFS_H diff --git a/mkspecs/hpuxi-acc-64/qplatformdefs.h b/mkspecs/hpuxi-acc-64/qplatformdefs.h index 7afb0fe..a0d2464 100644 --- a/mkspecs/hpuxi-acc-64/qplatformdefs.h +++ b/mkspecs/hpuxi-acc-64/qplatformdefs.h @@ -77,37 +77,13 @@ #include #endif -#include "../common/xopen-lfs/qplatformdefs.h" +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../common/posix/qplatformdefs.h" #undef QT_OPEN_LARGEFILE -#define QT_OPEN_LARGEFILE 0 +#undef QT_SOCKLEN_T -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN - -#define QT_SOCKLEN_T int +#define QT_OPEN_LARGEFILE 0 +#define QT_SOCKLEN_T int #endif // QPLATFORMDEFS_H diff --git a/mkspecs/hpuxi-g++-64/qplatformdefs.h b/mkspecs/hpuxi-g++-64/qplatformdefs.h index 62c977f..288a331 100644 --- a/mkspecs/hpuxi-g++-64/qplatformdefs.h +++ b/mkspecs/hpuxi-g++-64/qplatformdefs.h @@ -76,37 +76,13 @@ #include #endif -#include "../common/xopen-lfs/qplatformdefs.h" +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../common/posix/qplatformdefs.h" #undef QT_OPEN_LARGEFILE -#define QT_OPEN_LARGEFILE 0 +#undef QT_SOCKLEN_T -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN - -#define QT_SOCKLEN_T int +#define QT_OPEN_LARGEFILE 0 +#define QT_SOCKLEN_T int #endif // QPLATFORMDEFS_H diff --git a/mkspecs/hurd-g++/qplatformdefs.h b/mkspecs/hurd-g++/qplatformdefs.h index 41ced99..b439e6b 100644 --- a/mkspecs/hurd-g++/qplatformdefs.h +++ b/mkspecs/hurd-g++/qplatformdefs.h @@ -82,60 +82,13 @@ #include #endif -#include "../common/c89/qplatformdefs.h" +#include "../common/posix/qplatformdefs.h" -#undef QT_FSEEK -#undef QT_FTELL -#undef QT_OFF_T - -#define QT_FSEEK ::fseeko -#define QT_FTELL ::ftello -#define QT_OFF_T off_t - -#define QT_MMAP ::mmap - -#define QT_STATBUF struct stat #define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_OPEN ::open -#define QT_CLOSE ::close -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN - -#define QT_SOCKLEN_T socklen_t #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf #endif - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/irix-cc-64/qplatformdefs.h b/mkspecs/irix-cc-64/qplatformdefs.h index bcd8742..c95c2e5 100644 --- a/mkspecs/irix-cc-64/qplatformdefs.h +++ b/mkspecs/irix-cc-64/qplatformdefs.h @@ -75,38 +75,15 @@ #include #endif -#include "../common/xopen-lfs/qplatformdefs.h" +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../common/posix/qplatformdefs.h" -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN +#undef QT_SOCKLEN_T #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE-0 >= 500) -#define QT_SOCKLEN_T size_t +#define QT_SOCKLEN_T size_t #else -#define QT_SOCKLEN_T int +#define QT_SOCKLEN_T int #endif // Irix 6.5 and better @@ -115,5 +92,4 @@ #define QT_VSNPRINTF ::vsnprintf #endif - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/irix-cc/qplatformdefs.h b/mkspecs/irix-cc/qplatformdefs.h index bcd8742..c95c2e5 100644 --- a/mkspecs/irix-cc/qplatformdefs.h +++ b/mkspecs/irix-cc/qplatformdefs.h @@ -75,38 +75,15 @@ #include #endif -#include "../common/xopen-lfs/qplatformdefs.h" +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../common/posix/qplatformdefs.h" -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN +#undef QT_SOCKLEN_T #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE-0 >= 500) -#define QT_SOCKLEN_T size_t +#define QT_SOCKLEN_T size_t #else -#define QT_SOCKLEN_T int +#define QT_SOCKLEN_T int #endif // Irix 6.5 and better @@ -115,5 +92,4 @@ #define QT_VSNPRINTF ::vsnprintf #endif - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/irix-g++/qplatformdefs.h b/mkspecs/irix-g++/qplatformdefs.h index 2d85b4f..be7fb69 100644 --- a/mkspecs/irix-g++/qplatformdefs.h +++ b/mkspecs/irix-g++/qplatformdefs.h @@ -75,42 +75,22 @@ #include #endif -#include "../common/xopen-lfs/qplatformdefs.h" - -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#if defined(_LANGUAGE_C_PLUS_PLUS) || !defined(_SGIAPI) -#define QT_SIGNAL_ARGS int +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../common/posix/qplatformdefs.h" + +#undef QT_SOCKLEN_T +#undef QT_SIGNAL_ARGS + +#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE-0 >= 500) +#define QT_SOCKLEN_T size_t #else -#define QT_SIGNAL_ARGS void +#define QT_SOCKLEN_T int #endif -#define QT_SIGNAL_IGNORE SIG_IGN -#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE-0 >= 500) -#define QT_SOCKLEN_T size_t +#if defined(_LANGUAGE_C_PLUS_PLUS) || !defined(_SGIAPI) +#define QT_SIGNAL_ARGS int #else -#define QT_SOCKLEN_T int +#define QT_SIGNAL_ARGS void #endif // Irix 6.5 and better @@ -119,6 +99,4 @@ #define QT_VSNPRINTF ::vsnprintf #endif - #endif // QPLATFORMDEFS_H - diff --git a/mkspecs/linux-cxx/qplatformdefs.h b/mkspecs/linux-cxx/qplatformdefs.h index a708a81..578e63a 100644 --- a/mkspecs/linux-cxx/qplatformdefs.h +++ b/mkspecs/linux-cxx/qplatformdefs.h @@ -82,38 +82,15 @@ #include #endif -#include "../common/xopen-lfs/qplatformdefs.h" - -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../common/posix/qplatformdefs.h" + +#undef QT_SOCKLEN_T #if defined(__GLIBC__) && (__GLIBC__ >= 2) -#define QT_SOCKLEN_T socklen_t +#define QT_SOCKLEN_T socklen_t #else -#define QT_SOCKLEN_T int +#define QT_SOCKLEN_T int #endif #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) @@ -121,5 +98,4 @@ #define QT_VSNPRINTF ::vsnprintf #endif - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/linux-ecc-64/qplatformdefs.h b/mkspecs/linux-ecc-64/qplatformdefs.h index a708a81..578e63a 100644 --- a/mkspecs/linux-ecc-64/qplatformdefs.h +++ b/mkspecs/linux-ecc-64/qplatformdefs.h @@ -82,38 +82,15 @@ #include #endif -#include "../common/xopen-lfs/qplatformdefs.h" - -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../common/posix/qplatformdefs.h" + +#undef QT_SOCKLEN_T #if defined(__GLIBC__) && (__GLIBC__ >= 2) -#define QT_SOCKLEN_T socklen_t +#define QT_SOCKLEN_T socklen_t #else -#define QT_SOCKLEN_T int +#define QT_SOCKLEN_T int #endif #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) @@ -121,5 +98,4 @@ #define QT_VSNPRINTF ::vsnprintf #endif - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/linux-g++/qplatformdefs.h b/mkspecs/linux-g++/qplatformdefs.h index 09697e2..23816b1 100644 --- a/mkspecs/linux-g++/qplatformdefs.h +++ b/mkspecs/linux-g++/qplatformdefs.h @@ -81,38 +81,15 @@ #include #endif -#include "../common/xopen-lfs/qplatformdefs.h" +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../common/posix/qplatformdefs.h" -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN +#undef QT_SOCKLEN_T #if defined(__GLIBC__) && (__GLIBC__ >= 2) -#define QT_SOCKLEN_T socklen_t +#define QT_SOCKLEN_T socklen_t #else -#define QT_SOCKLEN_T int +#define QT_SOCKLEN_T int #endif #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) @@ -120,5 +97,4 @@ #define QT_VSNPRINTF ::vsnprintf #endif - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/linux-kcc/qplatformdefs.h b/mkspecs/linux-kcc/qplatformdefs.h index 9150292..3a37ab9 100644 --- a/mkspecs/linux-kcc/qplatformdefs.h +++ b/mkspecs/linux-kcc/qplatformdefs.h @@ -85,38 +85,15 @@ #include #endif -#include "../common/xopen-lfs/qplatformdefs.h" - -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../common/posix/qplatformdefs.h" + +#undef QT_SOCKLEN_T #if defined(__GLIBC__) && (__GLIBC__ >= 2) -#define QT_SOCKLEN_T socklen_t +#define QT_SOCKLEN_T socklen_t #else -#define QT_SOCKLEN_T int +#define QT_SOCKLEN_T int #endif #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) @@ -124,5 +101,4 @@ #define QT_VSNPRINTF ::vsnprintf #endif - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/linux-llvm/qplatformdefs.h b/mkspecs/linux-llvm/qplatformdefs.h index ea1a0da..a38c86c 100644 --- a/mkspecs/linux-llvm/qplatformdefs.h +++ b/mkspecs/linux-llvm/qplatformdefs.h @@ -82,38 +82,15 @@ #include #endif -#include "../common/xopen-lfs/qplatformdefs.h" +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../common/posix/qplatformdefs.h" -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN +#undef QT_SOCKLEN_T #if defined(__GLIBC__) && (__GLIBC__ >= 2) -#define QT_SOCKLEN_T socklen_t +#define QT_SOCKLEN_T socklen_t #else -#define QT_SOCKLEN_T int +#define QT_SOCKLEN_T int #endif #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) @@ -121,5 +98,4 @@ #define QT_VSNPRINTF ::vsnprintf #endif - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/linux-lsb-g++/qplatformdefs.h b/mkspecs/linux-lsb-g++/qplatformdefs.h index 7731c38..e2a138a 100644 --- a/mkspecs/linux-lsb-g++/qplatformdefs.h +++ b/mkspecs/linux-lsb-g++/qplatformdefs.h @@ -86,52 +86,27 @@ // LSB 3.1 defines htonl and friends here #include -#include "../common/xopen-lfs/qplatformdefs.h" +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../common/posix/qplatformdefs.h" #undef QT_OPEN_LARGEFILE +#undef QT_SOCKLEN_T + #define QT_OPEN_LARGEFILE 0 -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN +#if defined(__GLIBC__) && (__GLIBC__ >= 2) +#define QT_SOCKLEN_T socklen_t +#else +#define QT_SOCKLEN_T int +#endif #ifndef SIOCGIFBRDADDR # define SIOCGIFBRDADDR 0x8919 #endif -#if defined(__GLIBC__) && (__GLIBC__ >= 2) -#define QT_SOCKLEN_T socklen_t -#else -#define QT_SOCKLEN_T int -#endif - #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf #endif - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/linux-pgcc/qplatformdefs.h b/mkspecs/linux-pgcc/qplatformdefs.h index a708a81..578e63a 100644 --- a/mkspecs/linux-pgcc/qplatformdefs.h +++ b/mkspecs/linux-pgcc/qplatformdefs.h @@ -82,38 +82,15 @@ #include #endif -#include "../common/xopen-lfs/qplatformdefs.h" - -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../common/posix/qplatformdefs.h" + +#undef QT_SOCKLEN_T #if defined(__GLIBC__) && (__GLIBC__ >= 2) -#define QT_SOCKLEN_T socklen_t +#define QT_SOCKLEN_T socklen_t #else -#define QT_SOCKLEN_T int +#define QT_SOCKLEN_T int #endif #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) @@ -121,5 +98,4 @@ #define QT_VSNPRINTF ::vsnprintf #endif - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/lynxos-g++/qplatformdefs.h b/mkspecs/lynxos-g++/qplatformdefs.h index 93ed4d5..4d3965d 100644 --- a/mkspecs/lynxos-g++/qplatformdefs.h +++ b/mkspecs/lynxos-g++/qplatformdefs.h @@ -75,64 +75,21 @@ #include #endif -#include "../common/c89/qplatformdefs.h" +#include "../common/posix/qplatformdefs.h" -#undef QT_FSEEK -#undef QT_FTELL -#undef QT_OFF_T - -#define QT_FSEEK ::fseeko -#define QT_FTELL ::ftello -#define QT_OFF_T off_t - -#define QT_MMAP ::mmap - -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_OPEN ::open -#define QT_CLOSE ::close -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS void -#define QT_SIGNAL_IGNORE SIG_IGN +#undef QT_SOCKLEN_T #if defined(__GLIBC__) && (__GLIBC__ >= 2) -#define QT_SOCKLEN_T socklen_t +#define QT_SOCKLEN_T socklen_t #else -#define QT_SOCKLEN_T int +#define QT_SOCKLEN_T int #endif +#define QT_STATBUF4TSTAT struct stat + #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf #endif - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/macx-g++/qplatformdefs.h b/mkspecs/macx-g++/qplatformdefs.h index 890e4bb..5aef821 100644 --- a/mkspecs/macx-g++/qplatformdefs.h +++ b/mkspecs/macx-g++/qplatformdefs.h @@ -75,62 +75,25 @@ #include #endif -#include "../common/c89/qplatformdefs.h" +#include "../common/posix/qplatformdefs.h" -#undef QT_FSEEK -#undef QT_FTELL -#undef QT_OFF_T +#undef QT_OPEN_LARGEFILE +#undef QT_SOCKLEN_T +#undef QT_SIGNAL_IGNORE -#define QT_FSEEK ::fseeko -#define QT_FTELL ::ftello -#define QT_OFF_T off_t - -#define QT_MMAP ::mmap - -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_OPEN ::open -#define QT_CLOSE ::close -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir #define QT_OPEN_LARGEFILE 0 -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE (void (*)(int))1 #if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4) -#define QT_SOCKLEN_T socklen_t +#define QT_SOCKLEN_T socklen_t #else -#define QT_SOCKLEN_T int +#define QT_SOCKLEN_T int #endif +#define QT_SIGNAL_IGNORE (void (*)(int))1 + +#define QT_STATBUF4TSTAT struct stat + #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/macx-g++40/qplatformdefs.h b/mkspecs/macx-g++40/qplatformdefs.h index 890e4bb..5aef821 100644 --- a/mkspecs/macx-g++40/qplatformdefs.h +++ b/mkspecs/macx-g++40/qplatformdefs.h @@ -75,62 +75,25 @@ #include #endif -#include "../common/c89/qplatformdefs.h" +#include "../common/posix/qplatformdefs.h" -#undef QT_FSEEK -#undef QT_FTELL -#undef QT_OFF_T +#undef QT_OPEN_LARGEFILE +#undef QT_SOCKLEN_T +#undef QT_SIGNAL_IGNORE -#define QT_FSEEK ::fseeko -#define QT_FTELL ::ftello -#define QT_OFF_T off_t - -#define QT_MMAP ::mmap - -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_OPEN ::open -#define QT_CLOSE ::close -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir #define QT_OPEN_LARGEFILE 0 -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE (void (*)(int))1 #if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4) -#define QT_SOCKLEN_T socklen_t +#define QT_SOCKLEN_T socklen_t #else -#define QT_SOCKLEN_T int +#define QT_SOCKLEN_T int #endif +#define QT_SIGNAL_IGNORE (void (*)(int))1 + +#define QT_STATBUF4TSTAT struct stat + #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/macx-g++42/qplatformdefs.h b/mkspecs/macx-g++42/qplatformdefs.h index 890e4bb..5aef821 100644 --- a/mkspecs/macx-g++42/qplatformdefs.h +++ b/mkspecs/macx-g++42/qplatformdefs.h @@ -75,62 +75,25 @@ #include #endif -#include "../common/c89/qplatformdefs.h" +#include "../common/posix/qplatformdefs.h" -#undef QT_FSEEK -#undef QT_FTELL -#undef QT_OFF_T +#undef QT_OPEN_LARGEFILE +#undef QT_SOCKLEN_T +#undef QT_SIGNAL_IGNORE -#define QT_FSEEK ::fseeko -#define QT_FTELL ::ftello -#define QT_OFF_T off_t - -#define QT_MMAP ::mmap - -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_OPEN ::open -#define QT_CLOSE ::close -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir #define QT_OPEN_LARGEFILE 0 -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE (void (*)(int))1 #if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4) -#define QT_SOCKLEN_T socklen_t +#define QT_SOCKLEN_T socklen_t #else -#define QT_SOCKLEN_T int +#define QT_SOCKLEN_T int #endif +#define QT_SIGNAL_IGNORE (void (*)(int))1 + +#define QT_STATBUF4TSTAT struct stat + #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/macx-llvm/qplatformdefs.h b/mkspecs/macx-llvm/qplatformdefs.h index 890e4bb..5aef821 100644 --- a/mkspecs/macx-llvm/qplatformdefs.h +++ b/mkspecs/macx-llvm/qplatformdefs.h @@ -75,62 +75,25 @@ #include #endif -#include "../common/c89/qplatformdefs.h" +#include "../common/posix/qplatformdefs.h" -#undef QT_FSEEK -#undef QT_FTELL -#undef QT_OFF_T +#undef QT_OPEN_LARGEFILE +#undef QT_SOCKLEN_T +#undef QT_SIGNAL_IGNORE -#define QT_FSEEK ::fseeko -#define QT_FTELL ::ftello -#define QT_OFF_T off_t - -#define QT_MMAP ::mmap - -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_OPEN ::open -#define QT_CLOSE ::close -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir #define QT_OPEN_LARGEFILE 0 -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE (void (*)(int))1 #if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4) -#define QT_SOCKLEN_T socklen_t +#define QT_SOCKLEN_T socklen_t #else -#define QT_SOCKLEN_T int +#define QT_SOCKLEN_T int #endif +#define QT_SIGNAL_IGNORE (void (*)(int))1 + +#define QT_STATBUF4TSTAT struct stat + #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/macx-pbuilder/qplatformdefs.h b/mkspecs/macx-pbuilder/qplatformdefs.h index 7a04926..256dba6 100644 --- a/mkspecs/macx-pbuilder/qplatformdefs.h +++ b/mkspecs/macx-pbuilder/qplatformdefs.h @@ -75,62 +75,22 @@ #include #endif -#include "../common/c89/qplatformdefs.h" +#include "../common/posix/qplatformdefs.h" -#undef QT_FSEEK -#undef QT_FTELL -#undef QT_OFF_T - -#define QT_FSEEK ::fseeko -#define QT_FTELL ::ftello -#define QT_OFF_T off_t - -#define QT_MMAP ::mmap - -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_OPEN ::open -#define QT_CLOSE ::close -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE (void (*)(int))1 +#undef QT_SOCKLEN_T +#undef QT_SIGNAL_IGNORE #if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4) -#define QT_SOCKLEN_T socklen_t +#define QT_SOCKLEN_T socklen_t #else -#define QT_SOCKLEN_T int +#define QT_SOCKLEN_T int #endif +#define QT_SIGNAL_IGNORE (void (*)(int))1 + +#define QT_STATBUF4TSTAT struct stat + #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/macx-xcode/qplatformdefs.h b/mkspecs/macx-xcode/qplatformdefs.h index 890e4bb..5aef821 100644 --- a/mkspecs/macx-xcode/qplatformdefs.h +++ b/mkspecs/macx-xcode/qplatformdefs.h @@ -75,62 +75,25 @@ #include #endif -#include "../common/c89/qplatformdefs.h" +#include "../common/posix/qplatformdefs.h" -#undef QT_FSEEK -#undef QT_FTELL -#undef QT_OFF_T +#undef QT_OPEN_LARGEFILE +#undef QT_SOCKLEN_T +#undef QT_SIGNAL_IGNORE -#define QT_FSEEK ::fseeko -#define QT_FTELL ::ftello -#define QT_OFF_T off_t - -#define QT_MMAP ::mmap - -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_OPEN ::open -#define QT_CLOSE ::close -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir #define QT_OPEN_LARGEFILE 0 -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE (void (*)(int))1 #if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4) -#define QT_SOCKLEN_T socklen_t +#define QT_SOCKLEN_T socklen_t #else -#define QT_SOCKLEN_T int +#define QT_SOCKLEN_T int #endif +#define QT_SIGNAL_IGNORE (void (*)(int))1 + +#define QT_STATBUF4TSTAT struct stat + #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/macx-xlc/qplatformdefs.h b/mkspecs/macx-xlc/qplatformdefs.h index b78d523..380c217 100644 --- a/mkspecs/macx-xlc/qplatformdefs.h +++ b/mkspecs/macx-xlc/qplatformdefs.h @@ -75,58 +75,17 @@ #include #endif -#include "../common/c89/qplatformdefs.h" +#include "../common/posix/qplatformdefs.h" -#undef QT_FSEEK -#undef QT_FTELL -#undef QT_OFF_T +#undef QT_SOCKLEN_T +#undef QT_SIGNAL_IGNORE -#define QT_FSEEK ::fseeko -#define QT_FTELL ::ftello -#define QT_OFF_T off_t +#define QT_SOCKLEN_T int +#define QT_SIGNAL_IGNORE (void (*)(int))1 -#define QT_MMAP ::mmap - -#define QT_STATBUF struct stat #define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_OPEN ::open -#define QT_CLOSE ::close -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE (void (*)(int))1 - -#define QT_SOCKLEN_T int #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/netbsd-g++/qplatformdefs.h b/mkspecs/netbsd-g++/qplatformdefs.h index 7816703..53be833 100644 --- a/mkspecs/netbsd-g++/qplatformdefs.h +++ b/mkspecs/netbsd-g++/qplatformdefs.h @@ -75,57 +75,16 @@ #include #endif -#include "../common/c89/qplatformdefs.h" +#include "../common/posix/qplatformdefs.h" -#undef QT_FSEEK -#undef QT_FTELL -#undef QT_OFF_T - -#define QT_FSEEK ::fseeko -#define QT_FTELL ::ftello -#define QT_OFF_T off_t - -#define QT_MMAP ::mmap - -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_OPEN ::open -#define QT_CLOSE ::close -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir +#undef QT_OPEN_LARGEFILE #define QT_OPEN_LARGEFILE 0 -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN +// QT_SOCKLEN_T +// NetBSD 1.0 - 1.3.3 int +// NetBSD 1.4 - 1.5 socklen_t -// NetBSD 1.0 - 1.3.3 int -// NetBSD 1.4 - 1.5 socklen_t -#define QT_SOCKLEN_T socklen_t +#define QT_STATBUF4TSTAT struct stat #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf @@ -135,5 +94,4 @@ #define QT_AOUT_UNDERSCORE #endif - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/openbsd-g++/qplatformdefs.h b/mkspecs/openbsd-g++/qplatformdefs.h index db957c2..f5adf6f 100644 --- a/mkspecs/openbsd-g++/qplatformdefs.h +++ b/mkspecs/openbsd-g++/qplatformdefs.h @@ -76,57 +76,16 @@ #include #endif -#include "../common/c89/qplatformdefs.h" +#include "../common/posix/qplatformdefs.h" -#undef QT_FSEEK -#undef QT_FTELL -#undef QT_OFF_T - -#define QT_FSEEK ::fseeko -#define QT_FTELL ::ftello -#define QT_OFF_T off_t - -#define QT_MMAP ::mmap - -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_OPEN ::open -#define QT_CLOSE ::close -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir +#undef QT_OPEN_LARGEFILE #define QT_OPEN_LARGEFILE 0 -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN +// QT_SOCKLEN_T +// OpenBSD 2.2 - 2.4 int +// OpenBSD 2.5 - 2.8 socklen_t -// OpenBSD 2.2 - 2.4 int -// OpenBSD 2.5 - 2.8 socklen_t -#define QT_SOCKLEN_T socklen_t +#define QT_STATBUF4TSTAT struct stat #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf @@ -151,5 +110,4 @@ #define QT_AOUT_UNDERSCORE #endif - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/sco-cc/qplatformdefs.h b/mkspecs/sco-cc/qplatformdefs.h index df12900..2ae4b48 100644 --- a/mkspecs/sco-cc/qplatformdefs.h +++ b/mkspecs/sco-cc/qplatformdefs.h @@ -76,58 +76,14 @@ #include #endif -#include "../common/c89/qplatformdefs.h" +#include "../common/posix/qplatformdefs.h" -#undef QT_FSEEK -#undef QT_FTELL -#undef QT_OFF_T +#undef QT_SOCKLEN_T +#define QT_SOCKLEN_T size_t -#define QT_FSEEK ::fseeko -#define QT_FTELL ::ftello -#define QT_OFF_T off_t - -#define QT_MMAP ::mmap - -#define QT_STATBUF struct stat #define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_OPEN ::open -#define QT_CLOSE ::close -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN - -#define QT_SOCKLEN_T size_t #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/sco-g++/qplatformdefs.h b/mkspecs/sco-g++/qplatformdefs.h index fe3c1ee..c62fe93 100644 --- a/mkspecs/sco-g++/qplatformdefs.h +++ b/mkspecs/sco-g++/qplatformdefs.h @@ -80,58 +80,14 @@ #include #endif -#include "../common/c89/qplatformdefs.h" +#include "../common/posix/qplatformdefs.h" -#undef QT_FSEEK -#undef QT_FTELL -#undef QT_OFF_T +#undef QT_SOCKLEN_T +#define QT_SOCKLEN_T int -#define QT_FSEEK ::fseeko -#define QT_FTELL ::ftello -#define QT_OFF_T off_t - -#define QT_MMAP ::mmap - -#define QT_STATBUF struct stat #define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_OPEN ::open -#define QT_CLOSE ::close -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN - -#define QT_SOCKLEN_T int #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/solaris-cc-64/qplatformdefs.h b/mkspecs/solaris-cc-64/qplatformdefs.h index d791e97..d01c48c 100644 --- a/mkspecs/solaris-cc-64/qplatformdefs.h +++ b/mkspecs/solaris-cc-64/qplatformdefs.h @@ -76,41 +76,16 @@ #include #endif -// On 64-bit platforms sockets use socklen_t -#define QT_SOCKLEN_T socklen_t +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../common/posix/qplatformdefs.h" + +#undef QT_SOCKET_CONNECT +#define QT_SOCKET_CONNECT qt_socket_connect // Solaris redefines connect -> __xnet_connect with _XOPEN_SOURCE_EXTENDED static inline int qt_socket_connect(int s, struct sockaddr *addr, QT_SOCKLEN_T addrlen) { return ::connect(s, addr, addrlen); } -#include "../common/xopen-lfs/qplatformdefs.h" - -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT qt_socket_connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN - // Only Solaris 7 and better support 64-bit #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf diff --git a/mkspecs/solaris-cc/qplatformdefs.h b/mkspecs/solaris-cc/qplatformdefs.h index 04be413..678d076 100644 --- a/mkspecs/solaris-cc/qplatformdefs.h +++ b/mkspecs/solaris-cc/qplatformdefs.h @@ -76,49 +76,29 @@ #include #endif +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../common/posix/qplatformdefs.h" + +#undef QT_SOCKLEN_T +#undef QT_SOCKET_CONNECT + +#define QT_SOCKET_CONNECT qt_socket_connect + #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE-0 >= 500) && (_XOPEN_VERSION-0 >= 500) // Solaris 7 and better with specific feature test macros -#define QT_SOCKLEN_T socklen_t +#define QT_SOCKLEN_T socklen_t #elif defined(_XOPEN_SOURCE_EXTENDED) && (_XOPEN_VERSION-0 >= 4) // Solaris 2.6 and better with specific feature test macros -#define QT_SOCKLEN_T size_t +#define QT_SOCKLEN_T size_t #else // always this case in practice -#define QT_SOCKLEN_T int +#define QT_SOCKLEN_T int #endif // Solaris redefines connect -> __xnet_connect with _XOPEN_SOURCE_EXTENDED static inline int qt_socket_connect(int s, struct sockaddr *addr, QT_SOCKLEN_T addrlen) { return ::connect(s, addr, addrlen); } -#include "../common/xopen-lfs/qplatformdefs.h" - -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT qt_socket_connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN - #if !defined(_XOPEN_UNIX) // Solaris 2.5.1 // Function usleep() is defined in C library but not declared in header files diff --git a/mkspecs/solaris-g++-64/qplatformdefs.h b/mkspecs/solaris-g++-64/qplatformdefs.h index f9c21d7..bce0d5b 100644 --- a/mkspecs/solaris-g++-64/qplatformdefs.h +++ b/mkspecs/solaris-g++-64/qplatformdefs.h @@ -79,12 +79,11 @@ #include #endif -// On 64-bit platforms sockets use socklen_t -#define QT_SOCKLEN_T socklen_t +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../common/posix/qplatformdefs.h" -// Only Solaris 7 and better support 64-bit -#define QT_SNPRINTF ::snprintf -#define QT_VSNPRINTF ::vsnprintf +#undef QT_SOCKET_CONNECT +#define QT_SOCKET_CONNECT qt_socket_connect // Solaris redefines connect -> __xnet_connect with _XOPEN_SOURCE_EXTENDED static inline int qt_socket_connect(int s, struct sockaddr *addr, QT_SOCKLEN_T addrlen) @@ -100,32 +99,8 @@ static inline int qt_socket_bind(int s, struct sockaddr *addr, QT_SOCKLEN_T addr # undef bind #endif -#include "../common/xopen-lfs/qplatformdefs.h" - -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT qt_socket_connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN +// Only Solaris 7 and better support 64-bit +#define QT_SNPRINTF ::snprintf +#define QT_VSNPRINTF ::vsnprintf #endif // QPLATFORMDEFS_H diff --git a/mkspecs/solaris-g++/qplatformdefs.h b/mkspecs/solaris-g++/qplatformdefs.h index 6438e7c..5732388 100644 --- a/mkspecs/solaris-g++/qplatformdefs.h +++ b/mkspecs/solaris-g++/qplatformdefs.h @@ -79,6 +79,16 @@ #include #endif +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../common/posix/qplatformdefs.h" + +#undef QT_SOCKLEN_T +#undef QT_SOCKET_CONNECT +#undef QT_SOCKET_BIND + +#define QT_SOCKET_CONNECT qt_socket_connect +#define QT_SOCKET_BIND qt_socket_bind + #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE-0 >= 500) && (_XOPEN_VERSION-0 >= 500) // Solaris 7 and better with specific feature test macros #define QT_SOCKLEN_T socklen_t @@ -104,34 +114,6 @@ static inline int qt_socket_bind(int s, struct sockaddr *addr, QT_SOCKLEN_T addr # undef bind #endif -#include "../common/xopen-lfs/qplatformdefs.h" - -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT qt_socket_connect -#define QT_SOCKET_BIND qt_socket_bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN - #if !defined(_XOPEN_UNIX) // Solaris 2.5.1 // Function usleep() is defined in C library but not declared in header files diff --git a/mkspecs/tru64-cxx/qplatformdefs.h b/mkspecs/tru64-cxx/qplatformdefs.h index dc18e1d..15b83aa 100644 --- a/mkspecs/tru64-cxx/qplatformdefs.h +++ b/mkspecs/tru64-cxx/qplatformdefs.h @@ -78,48 +78,23 @@ #include #endif -#include "../common/c89/qplatformdefs.h" +#define QT_NO_USE_FSEEKO +#include "../common/posix/qplatformdefs.h" #undef QT_OFF_T +#undef QT_SOCKLEN_T + #define QT_OFF_T off_t -#define QT_MMAP ::mmap +#if defined(_POSIX_PII_SOCKET) +#define QT_SOCKLEN_T socklen_t +#elif defined(_XOPEN_SOURCE_EXTENDED) +#define QT_SOCKLEN_T size_t +#else +#define QT_SOCKLEN_T int +#endif -#define QT_STATBUF struct stat #define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_OPEN ::open -#define QT_CLOSE ::close -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN #if defined(_XOPEN_SOURCE) && defined(_OSF_SOURCE) // Not available in the header file of Tru64 4.0F. @@ -127,19 +102,10 @@ extern "C" int usleep(useconds_t); #endif -#if defined(_POSIX_PII_SOCKET) -#define QT_SOCKLEN_T socklen_t -#elif defined(_XOPEN_SOURCE_EXTENDED) -#define QT_SOCKLEN_T size_t -#else -#define QT_SOCKLEN_T int -#endif - #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE-0 >= 400) // Tru64 5.0 and better #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf #endif - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/tru64-g++/qplatformdefs.h b/mkspecs/tru64-g++/qplatformdefs.h index 485879e..15b83aa 100644 --- a/mkspecs/tru64-g++/qplatformdefs.h +++ b/mkspecs/tru64-g++/qplatformdefs.h @@ -78,48 +78,23 @@ #include #endif -#include "../common/c89/qplatformdefs.h" +#define QT_NO_USE_FSEEKO +#include "../common/posix/qplatformdefs.h" #undef QT_OFF_T +#undef QT_SOCKLEN_T + #define QT_OFF_T off_t -#define QT_MMAP ::mmap +#if defined(_POSIX_PII_SOCKET) +#define QT_SOCKLEN_T socklen_t +#elif defined(_XOPEN_SOURCE_EXTENDED) +#define QT_SOCKLEN_T size_t +#else +#define QT_SOCKLEN_T int +#endif -#define QT_STATBUF struct stat #define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_OPEN ::open -#define QT_CLOSE ::close -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN #if defined(_XOPEN_SOURCE) && defined(_OSF_SOURCE) // Not available in the header file of Tru64 4.0F. @@ -127,19 +102,10 @@ extern "C" int usleep(useconds_t); #endif -#if defined(_POSIX_PII_SOCKET) -# define QT_SOCKLEN_T socklen_t -#elif defined(_XOPEN_SOURCE_EXTENDED) -# define QT_SOCKLEN_T size_t -#else -# define QT_SOCKLEN_T int -#endif - #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE-0 >= 400) // Tru64 5.0 and better #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf #endif - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/unixware-cc/qplatformdefs.h b/mkspecs/unixware-cc/qplatformdefs.h index cdcd3a3..4ad4d6c 100644 --- a/mkspecs/unixware-cc/qplatformdefs.h +++ b/mkspecs/unixware-cc/qplatformdefs.h @@ -76,53 +76,18 @@ #include #endif -#include "../common/c89/qplatformdefs.h" +#define QT_NO_USE_FSEEKO +#include "../common/posix/qplatformdefs.h" #undef QT_OFF_T -#define QT_OFF_T off_t +#undef QT_SOCKLEN_T -#define QT_MMAP ::mmap +#define QT_OFF_T off_t +#define QT_SOCKLEN_T size_t -#define QT_STATBUF struct stat #define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_OPEN ::open -#define QT_CLOSE ::close -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN - -#define QT_SOCKLEN_T size_t #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/unixware-g++/qplatformdefs.h b/mkspecs/unixware-g++/qplatformdefs.h index cdcd3a3..4ad4d6c 100644 --- a/mkspecs/unixware-g++/qplatformdefs.h +++ b/mkspecs/unixware-g++/qplatformdefs.h @@ -76,53 +76,18 @@ #include #endif -#include "../common/c89/qplatformdefs.h" +#define QT_NO_USE_FSEEKO +#include "../common/posix/qplatformdefs.h" #undef QT_OFF_T -#define QT_OFF_T off_t +#undef QT_SOCKLEN_T -#define QT_MMAP ::mmap +#define QT_OFF_T off_t +#define QT_SOCKLEN_T size_t -#define QT_STATBUF struct stat #define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_OPEN ::open -#define QT_CLOSE ::close -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN - -#define QT_SOCKLEN_T size_t #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/unsupported/qnx-g++/qplatformdefs.h b/mkspecs/unsupported/qnx-g++/qplatformdefs.h index d86ce26..b5bcee8 100644 --- a/mkspecs/unsupported/qnx-g++/qplatformdefs.h +++ b/mkspecs/unsupported/qnx-g++/qplatformdefs.h @@ -81,35 +81,8 @@ // for htonl #include -#include "../../common/xopen-lfs/qplatformdefs.h" - -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN - -#define QT_SOCKLEN_T socklen_t +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../../common/posix/qplatformdefs.h" #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf diff --git a/mkspecs/unsupported/vxworks-simpentium-g++/qplatformdefs.h b/mkspecs/unsupported/vxworks-simpentium-g++/qplatformdefs.h index 47a24a4..b183684 100644 --- a/mkspecs/unsupported/vxworks-simpentium-g++/qplatformdefs.h +++ b/mkspecs/unsupported/vxworks-simpentium-g++/qplatformdefs.h @@ -47,45 +47,29 @@ #include "qglobal.h" #include "qfunctions_vxworks.h" -#include "../../common/xopen-lfs/qplatformdefs.h" +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../../common/posix/qplatformdefs.h" #undef QT_LSTAT +#undef QT_MKDIR +#undef QT_READ +#undef QT_WRITE +#undef QT_SOCKLEN_T +#undef QT_SOCKET_CONNECT + #define QT_LSTAT QT_STAT +#define QT_MKDIR(dir, perm) ::mkdir(dir) -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT(sd, to, tolen) \ - ::connect(sd, (struct sockaddr *) to, tolen) -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close #define QT_READ(fd, buf, len) ::read(fd, (char*) buf, len) #define QT_WRITE(fd, buf, len) ::write(fd, (char*) buf, len) -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR(dir, perm) ::mkdir(dir) -#define QT_RMDIR ::rmdir -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN // there IS a socklen_t in sys/socket.h (unsigned int), // but sockLib.h uses int in all function declaration... -//#define QT_SOCKLEN_T socklen_t #define QT_SOCKLEN_T int +#define QT_SOCKET_CONNECT(sd, to, tolen) \ + ::connect(sd, (struct sockaddr *) to, tolen) #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf - #endif // QPLATFORMDEFS_H -- cgit v0.12 From 31d18e089691c7ffb9c9c48579f1004eded9fc6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Fri, 15 Jan 2010 18:10:46 +0100 Subject: Dropping windows #define from qplatformheaders for *nix platforms. QT_STATBUF4TSTAT was meant for the windows-specific _tstat function, taking a _TCHAR* path argument. Reviewed-by: Thiago Macieira --- mkspecs/cygwin-g++/qplatformdefs.h | 2 -- mkspecs/darwin-g++/qplatformdefs.h | 2 -- mkspecs/freebsd-g++/qplatformdefs.h | 2 -- mkspecs/hurd-g++/qplatformdefs.h | 2 -- mkspecs/lynxos-g++/qplatformdefs.h | 2 -- mkspecs/macx-g++/qplatformdefs.h | 2 -- mkspecs/macx-g++40/qplatformdefs.h | 2 -- mkspecs/macx-g++42/qplatformdefs.h | 2 -- mkspecs/macx-llvm/qplatformdefs.h | 2 -- mkspecs/macx-pbuilder/qplatformdefs.h | 2 -- mkspecs/macx-xcode/qplatformdefs.h | 2 -- mkspecs/macx-xlc/qplatformdefs.h | 2 -- mkspecs/netbsd-g++/qplatformdefs.h | 2 -- mkspecs/openbsd-g++/qplatformdefs.h | 2 -- mkspecs/sco-cc/qplatformdefs.h | 2 -- mkspecs/sco-g++/qplatformdefs.h | 2 -- mkspecs/tru64-cxx/qplatformdefs.h | 2 -- mkspecs/tru64-g++/qplatformdefs.h | 2 -- mkspecs/unixware-cc/qplatformdefs.h | 2 -- mkspecs/unixware-g++/qplatformdefs.h | 2 -- 20 files changed, 40 deletions(-) diff --git a/mkspecs/cygwin-g++/qplatformdefs.h b/mkspecs/cygwin-g++/qplatformdefs.h index b64e126..a6f57d2 100644 --- a/mkspecs/cygwin-g++/qplatformdefs.h +++ b/mkspecs/cygwin-g++/qplatformdefs.h @@ -86,8 +86,6 @@ #undef QT_OPEN_LARGEFILE -#define QT_STATBUF4TSTAT struct stat - #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf diff --git a/mkspecs/darwin-g++/qplatformdefs.h b/mkspecs/darwin-g++/qplatformdefs.h index 2ee0698..7a67339 100644 --- a/mkspecs/darwin-g++/qplatformdefs.h +++ b/mkspecs/darwin-g++/qplatformdefs.h @@ -79,8 +79,6 @@ #undef QT_OPEN_LARGEFILE #define QT_OPEN_LARGEFILE 0 -#define QT_STATBUF4TSTAT struct stat - #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf diff --git a/mkspecs/freebsd-g++/qplatformdefs.h b/mkspecs/freebsd-g++/qplatformdefs.h index c0b7da6..5afb965 100644 --- a/mkspecs/freebsd-g++/qplatformdefs.h +++ b/mkspecs/freebsd-g++/qplatformdefs.h @@ -91,8 +91,6 @@ #define QT_SOCKLEN_T socklen_t #endif -#define QT_STATBUF4TSTAT struct stat - #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf diff --git a/mkspecs/hurd-g++/qplatformdefs.h b/mkspecs/hurd-g++/qplatformdefs.h index b439e6b..b734a68 100644 --- a/mkspecs/hurd-g++/qplatformdefs.h +++ b/mkspecs/hurd-g++/qplatformdefs.h @@ -84,8 +84,6 @@ #include "../common/posix/qplatformdefs.h" -#define QT_STATBUF4TSTAT struct stat - #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf diff --git a/mkspecs/lynxos-g++/qplatformdefs.h b/mkspecs/lynxos-g++/qplatformdefs.h index 4d3965d..cac71d1 100644 --- a/mkspecs/lynxos-g++/qplatformdefs.h +++ b/mkspecs/lynxos-g++/qplatformdefs.h @@ -85,8 +85,6 @@ #define QT_SOCKLEN_T int #endif -#define QT_STATBUF4TSTAT struct stat - #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf diff --git a/mkspecs/macx-g++/qplatformdefs.h b/mkspecs/macx-g++/qplatformdefs.h index 5aef821..99d64ef 100644 --- a/mkspecs/macx-g++/qplatformdefs.h +++ b/mkspecs/macx-g++/qplatformdefs.h @@ -91,8 +91,6 @@ #define QT_SIGNAL_IGNORE (void (*)(int))1 -#define QT_STATBUF4TSTAT struct stat - #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf diff --git a/mkspecs/macx-g++40/qplatformdefs.h b/mkspecs/macx-g++40/qplatformdefs.h index 5aef821..99d64ef 100644 --- a/mkspecs/macx-g++40/qplatformdefs.h +++ b/mkspecs/macx-g++40/qplatformdefs.h @@ -91,8 +91,6 @@ #define QT_SIGNAL_IGNORE (void (*)(int))1 -#define QT_STATBUF4TSTAT struct stat - #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf diff --git a/mkspecs/macx-g++42/qplatformdefs.h b/mkspecs/macx-g++42/qplatformdefs.h index 5aef821..99d64ef 100644 --- a/mkspecs/macx-g++42/qplatformdefs.h +++ b/mkspecs/macx-g++42/qplatformdefs.h @@ -91,8 +91,6 @@ #define QT_SIGNAL_IGNORE (void (*)(int))1 -#define QT_STATBUF4TSTAT struct stat - #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf diff --git a/mkspecs/macx-llvm/qplatformdefs.h b/mkspecs/macx-llvm/qplatformdefs.h index 5aef821..99d64ef 100644 --- a/mkspecs/macx-llvm/qplatformdefs.h +++ b/mkspecs/macx-llvm/qplatformdefs.h @@ -91,8 +91,6 @@ #define QT_SIGNAL_IGNORE (void (*)(int))1 -#define QT_STATBUF4TSTAT struct stat - #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf diff --git a/mkspecs/macx-pbuilder/qplatformdefs.h b/mkspecs/macx-pbuilder/qplatformdefs.h index 256dba6..66afad2 100644 --- a/mkspecs/macx-pbuilder/qplatformdefs.h +++ b/mkspecs/macx-pbuilder/qplatformdefs.h @@ -88,8 +88,6 @@ #define QT_SIGNAL_IGNORE (void (*)(int))1 -#define QT_STATBUF4TSTAT struct stat - #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf diff --git a/mkspecs/macx-xcode/qplatformdefs.h b/mkspecs/macx-xcode/qplatformdefs.h index 5aef821..99d64ef 100644 --- a/mkspecs/macx-xcode/qplatformdefs.h +++ b/mkspecs/macx-xcode/qplatformdefs.h @@ -91,8 +91,6 @@ #define QT_SIGNAL_IGNORE (void (*)(int))1 -#define QT_STATBUF4TSTAT struct stat - #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf diff --git a/mkspecs/macx-xlc/qplatformdefs.h b/mkspecs/macx-xlc/qplatformdefs.h index 380c217..b830041 100644 --- a/mkspecs/macx-xlc/qplatformdefs.h +++ b/mkspecs/macx-xlc/qplatformdefs.h @@ -83,8 +83,6 @@ #define QT_SOCKLEN_T int #define QT_SIGNAL_IGNORE (void (*)(int))1 -#define QT_STATBUF4TSTAT struct stat - #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf diff --git a/mkspecs/netbsd-g++/qplatformdefs.h b/mkspecs/netbsd-g++/qplatformdefs.h index 53be833..2ce5b4a 100644 --- a/mkspecs/netbsd-g++/qplatformdefs.h +++ b/mkspecs/netbsd-g++/qplatformdefs.h @@ -84,8 +84,6 @@ // NetBSD 1.0 - 1.3.3 int // NetBSD 1.4 - 1.5 socklen_t -#define QT_STATBUF4TSTAT struct stat - #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf diff --git a/mkspecs/openbsd-g++/qplatformdefs.h b/mkspecs/openbsd-g++/qplatformdefs.h index f5adf6f..b3a9ad5 100644 --- a/mkspecs/openbsd-g++/qplatformdefs.h +++ b/mkspecs/openbsd-g++/qplatformdefs.h @@ -85,8 +85,6 @@ // OpenBSD 2.2 - 2.4 int // OpenBSD 2.5 - 2.8 socklen_t -#define QT_STATBUF4TSTAT struct stat - #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf diff --git a/mkspecs/sco-cc/qplatformdefs.h b/mkspecs/sco-cc/qplatformdefs.h index 2ae4b48..078cb45 100644 --- a/mkspecs/sco-cc/qplatformdefs.h +++ b/mkspecs/sco-cc/qplatformdefs.h @@ -81,8 +81,6 @@ #undef QT_SOCKLEN_T #define QT_SOCKLEN_T size_t -#define QT_STATBUF4TSTAT struct stat - #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf diff --git a/mkspecs/sco-g++/qplatformdefs.h b/mkspecs/sco-g++/qplatformdefs.h index c62fe93..a09f77d 100644 --- a/mkspecs/sco-g++/qplatformdefs.h +++ b/mkspecs/sco-g++/qplatformdefs.h @@ -85,8 +85,6 @@ #undef QT_SOCKLEN_T #define QT_SOCKLEN_T int -#define QT_STATBUF4TSTAT struct stat - #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf diff --git a/mkspecs/tru64-cxx/qplatformdefs.h b/mkspecs/tru64-cxx/qplatformdefs.h index 15b83aa..ed07d5b 100644 --- a/mkspecs/tru64-cxx/qplatformdefs.h +++ b/mkspecs/tru64-cxx/qplatformdefs.h @@ -94,8 +94,6 @@ #define QT_SOCKLEN_T int #endif -#define QT_STATBUF4TSTAT struct stat - #if defined(_XOPEN_SOURCE) && defined(_OSF_SOURCE) // Not available in the header file of Tru64 4.0F. // Fixed in the header of Tru64 5.0A so we copy/paste from there... diff --git a/mkspecs/tru64-g++/qplatformdefs.h b/mkspecs/tru64-g++/qplatformdefs.h index 15b83aa..ed07d5b 100644 --- a/mkspecs/tru64-g++/qplatformdefs.h +++ b/mkspecs/tru64-g++/qplatformdefs.h @@ -94,8 +94,6 @@ #define QT_SOCKLEN_T int #endif -#define QT_STATBUF4TSTAT struct stat - #if defined(_XOPEN_SOURCE) && defined(_OSF_SOURCE) // Not available in the header file of Tru64 4.0F. // Fixed in the header of Tru64 5.0A so we copy/paste from there... diff --git a/mkspecs/unixware-cc/qplatformdefs.h b/mkspecs/unixware-cc/qplatformdefs.h index 4ad4d6c..3a26042 100644 --- a/mkspecs/unixware-cc/qplatformdefs.h +++ b/mkspecs/unixware-cc/qplatformdefs.h @@ -85,8 +85,6 @@ #define QT_OFF_T off_t #define QT_SOCKLEN_T size_t -#define QT_STATBUF4TSTAT struct stat - #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf diff --git a/mkspecs/unixware-g++/qplatformdefs.h b/mkspecs/unixware-g++/qplatformdefs.h index 4ad4d6c..3a26042 100644 --- a/mkspecs/unixware-g++/qplatformdefs.h +++ b/mkspecs/unixware-g++/qplatformdefs.h @@ -85,8 +85,6 @@ #define QT_OFF_T off_t #define QT_SOCKLEN_T size_t -#define QT_STATBUF4TSTAT struct stat - #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf -- cgit v0.12 From 2547e8d27fc7d651d21ba3805918ee3681f03f05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Fri, 22 Jan 2010 11:31:31 +0100 Subject: Merged qplatformdefs.h for AIX I don't think the differences warranted having to maintain 3 slightly differing copies. "Old" locations changed to a forwarding header to the merged one. Differences and how they were resolved in the merged file: - comment on a workaround for a potential issue when using g++ => comment kept - #ifdef's for xlc-64 had been simplified, because it is only supported on AIX 4.3 and above => versioned #ifdefs should still work on 64-bit platforms, so that was preferred; comment left for future reference - use of different condition in #if clause: (_XOPEN_SOURCE-0 >= 500) => verbosity preferred, since it is probably a workaround for a preprocessor or #define bug. Reviewed-by: Thiago Macieira --- mkspecs/aix-g++-64/qplatformdefs.h | 63 +-------------------- mkspecs/aix-g++/qplatformdefs.h | 63 +-------------------- mkspecs/aix-xlc-64/qplatformdefs.h | 47 +--------------- mkspecs/aix-xlc/qplatformdefs.h | 59 +------------------- mkspecs/common/aix/qplatformdefs.h | 110 +++++++++++++++++++++++++++++++++++++ 5 files changed, 114 insertions(+), 228 deletions(-) create mode 100644 mkspecs/common/aix/qplatformdefs.h diff --git a/mkspecs/aix-g++-64/qplatformdefs.h b/mkspecs/aix-g++-64/qplatformdefs.h index 4421ba4..d32f994 100644 --- a/mkspecs/aix-g++-64/qplatformdefs.h +++ b/mkspecs/aix-g++-64/qplatformdefs.h @@ -42,67 +42,6 @@ #ifndef QPLATFORMDEFS_H #define QPLATFORMDEFS_H -// Get Qt defines/settings - -#include "qglobal.h" - -// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs - -#include - - -// We are hot - unistd.h should have turned on the specific APIs we requested - - -// uncomment if you have problems with because your gcc -// hasn't been built on exactly the same OS version your are using now. -// typedef int crid_t; -// typedef unsigned int class_id_t; -#include -#include -#include -#include -#include -#include -#include -#include // AIX X11 headers define FD_ZERO using bzero() - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifndef QT_NO_IPV6IFNAME -#include -#endif - -#define QT_USE_XOPEN_LFS_EXTENSIONS -#include "../common/posix/qplatformdefs.h" - -#undef QT_SOCKLEN_T - -#ifdef _AIX43 -// AIX 4.3 and better -#define QT_SOCKLEN_T socklen_t -#elif _AIX42 -// AIX 4.2 -#define QT_SOCKLEN_T size_t -#else -// AIX 4.1 -#define QT_SOCKLEN_T size_t -// override -#define QT_SOCKOPTLEN_T int -#endif - -#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) -// AIX 4.3 and better -#define QT_SNPRINTF ::snprintf -#define QT_VSNPRINTF ::vsnprintf -#endif +#include "../common/aix/qplatformdefs.h" #endif // QPLATFORMDEFS_H diff --git a/mkspecs/aix-g++/qplatformdefs.h b/mkspecs/aix-g++/qplatformdefs.h index 4421ba4..d32f994 100644 --- a/mkspecs/aix-g++/qplatformdefs.h +++ b/mkspecs/aix-g++/qplatformdefs.h @@ -42,67 +42,6 @@ #ifndef QPLATFORMDEFS_H #define QPLATFORMDEFS_H -// Get Qt defines/settings - -#include "qglobal.h" - -// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs - -#include - - -// We are hot - unistd.h should have turned on the specific APIs we requested - - -// uncomment if you have problems with because your gcc -// hasn't been built on exactly the same OS version your are using now. -// typedef int crid_t; -// typedef unsigned int class_id_t; -#include -#include -#include -#include -#include -#include -#include -#include // AIX X11 headers define FD_ZERO using bzero() - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifndef QT_NO_IPV6IFNAME -#include -#endif - -#define QT_USE_XOPEN_LFS_EXTENSIONS -#include "../common/posix/qplatformdefs.h" - -#undef QT_SOCKLEN_T - -#ifdef _AIX43 -// AIX 4.3 and better -#define QT_SOCKLEN_T socklen_t -#elif _AIX42 -// AIX 4.2 -#define QT_SOCKLEN_T size_t -#else -// AIX 4.1 -#define QT_SOCKLEN_T size_t -// override -#define QT_SOCKOPTLEN_T int -#endif - -#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) -// AIX 4.3 and better -#define QT_SNPRINTF ::snprintf -#define QT_VSNPRINTF ::vsnprintf -#endif +#include "../common/aix/qplatformdefs.h" #endif // QPLATFORMDEFS_H diff --git a/mkspecs/aix-xlc-64/qplatformdefs.h b/mkspecs/aix-xlc-64/qplatformdefs.h index a52b3d3..d32f994 100644 --- a/mkspecs/aix-xlc-64/qplatformdefs.h +++ b/mkspecs/aix-xlc-64/qplatformdefs.h @@ -42,51 +42,6 @@ #ifndef QPLATFORMDEFS_H #define QPLATFORMDEFS_H -// Get Qt defines/settings - -#include "qglobal.h" - -// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs - -#include - - -// We are hot - unistd.h should have turned on the specific APIs we requested - - -#include -#include -#include -#include -#include -#include -#include -#include // AIX X11 headers define FD_ZERO using bzero() - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifndef QT_NO_IPV6IFNAME -#include -#endif - -#define QT_USE_XOPEN_LFS_EXTENSIONS -#include "../common/posix/qplatformdefs.h" - -// QT_SOCKLEN_T -// Only AIX 4.3 and better support 64-bit - -#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) -// Only AIX 4.3 and better support 64-bit -#define QT_SNPRINTF ::snprintf -#define QT_VSNPRINTF ::vsnprintf -#endif +#include "../common/aix/qplatformdefs.h" #endif // QPLATFORMDEFS_H diff --git a/mkspecs/aix-xlc/qplatformdefs.h b/mkspecs/aix-xlc/qplatformdefs.h index 97cd0a1..d32f994 100644 --- a/mkspecs/aix-xlc/qplatformdefs.h +++ b/mkspecs/aix-xlc/qplatformdefs.h @@ -42,63 +42,6 @@ #ifndef QPLATFORMDEFS_H #define QPLATFORMDEFS_H -// Get Qt defines/settings - -#include "qglobal.h" - -// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs - -#include - - -// We are hot - unistd.h should have turned on the specific APIs we requested - - -#include -#include -#include -#include -#include -#include -#include -#include // AIX X11 headers define FD_ZERO using bzero() - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifndef QT_NO_IPV6IFNAME -#include -#endif - -#define QT_USE_XOPEN_LFS_EXTENSIONS -#include "../common/posix/qplatformdefs.h" - -#undef QT_SOCKLEN_T - -#ifdef _AIX43 -// AIX 4.3 and better -#define QT_SOCKLEN_T socklen_t -#elif _AIX42 -// AIX 4.2 -#define QT_SOCKLEN_T size_t -#else -// AIX 4.1 -#define QT_SOCKLEN_T size_t -// override -#define QT_SOCKOPTLEN_T int -#endif - -#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE-0 >= 500) -// AIX 4.3 and better -#define QT_SNPRINTF ::snprintf -#define QT_VSNPRINTF ::vsnprintf -#endif +#include "../common/aix/qplatformdefs.h" #endif // QPLATFORMDEFS_H diff --git a/mkspecs/common/aix/qplatformdefs.h b/mkspecs/common/aix/qplatformdefs.h new file mode 100644 index 0000000..57c5a76 --- /dev/null +++ b/mkspecs/common/aix/qplatformdefs.h @@ -0,0 +1,110 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the qmake spec of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q_AIX_QPLATFORMDEFS_H +#define Q_AIX_QPLATFORMDEFS_H + +// Get Qt defines/settings + +#include "qglobal.h" + +// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs + +#include + + +// We are hot - unistd.h should have turned on the specific APIs we requested + + +// uncomment if you have problems with because your gcc +// hasn't been built on exactly the same OS version your are using now. +// typedef int crid_t; +// typedef unsigned int class_id_t; +#include +#include +#include +#include +#include +#include +#include +#include // AIX X11 headers define FD_ZERO using bzero() + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifndef QT_NO_IPV6IFNAME +#include +#endif + +// Only AIX 4.3 and better support 64-bit + +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../posix/qplatformdefs.h" + +#undef QT_SOCKLEN_T + +#ifdef _AIX43 +// AIX 4.3 and better +#define QT_SOCKLEN_T socklen_t +#elif _AIX42 +// AIX 4.2 +#define QT_SOCKLEN_T size_t +#else +// AIX 4.1 +#define QT_SOCKLEN_T size_t +// override +#define QT_SOCKOPTLEN_T int +#endif + +#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE-0 >= 500) +// AIX 4.3 and better +#define QT_SNPRINTF ::snprintf +#define QT_VSNPRINTF ::vsnprintf +#endif + +#endif // include guard -- cgit v0.12 From 5a850d6acbbd7cdd813c4babfedf39a9df44b9aa Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Mon, 25 Jan 2010 10:03:56 +0100 Subject: build fix for phonon on wince --- src/3rdparty/phonon/ds9/videorenderer_default.cpp | 2 +- src/3rdparty/phonon/ds9/videowidget.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/3rdparty/phonon/ds9/videorenderer_default.cpp b/src/3rdparty/phonon/ds9/videorenderer_default.cpp index 9d82255..0045a49 100644 --- a/src/3rdparty/phonon/ds9/videorenderer_default.cpp +++ b/src/3rdparty/phonon/ds9/videorenderer_default.cpp @@ -32,7 +32,7 @@ namespace Phonon { namespace DS9 { - VideoRendererDefault::~VideoRendererVMR9() + VideoRendererDefault::~VideoRendererDefault() { } diff --git a/src/3rdparty/phonon/ds9/videowidget.cpp b/src/3rdparty/phonon/ds9/videowidget.cpp index 59abb04..1eddaee 100644 --- a/src/3rdparty/phonon/ds9/videowidget.cpp +++ b/src/3rdparty/phonon/ds9/videowidget.cpp @@ -369,7 +369,7 @@ namespace Phonon } } #else - renderer = new VideoRendererVMR9(m_widget); + renderer = new VideoRendererDefault(m_widget); if (renderer->getFilter() == 0) { //instanciating the renderer might fail m_noNativeRendererSupported = true; -- cgit v0.12 From b6a2ce7b02951aab761ddc8ffa022bbd8f19fa83 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Tue, 26 Jan 2010 09:29:49 +0100 Subject: Carbon: fix build breakage on carbon Just forgot an ifdef... --- src/gui/kernel/qwidget_mac.mm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index d52ac77..20c0cde 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -3463,7 +3463,9 @@ void QWidgetPrivate::hide_sys() QMacCocoaAutoReleasePool pool; if(q->isWindow()) { +#ifdef QT_MAC_USE_COCOA setSubWindowStacking(false); +#endif OSWindowRef window = qt_mac_window_for(q); if(qt_mac_is_macsheet(q)) { #ifndef QT_MAC_USE_COCOA -- cgit v0.12 From 7ad08868de4b3e481a51a3431504fcf42a4bbf6d Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Tue, 26 Jan 2010 13:42:48 +0100 Subject: Cocoa: qfiledialog test spits out memory warnings We need an auto release pool! --- src/gui/kernel/qt_cocoa_helpers_mac.mm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/kernel/qt_cocoa_helpers_mac.mm b/src/gui/kernel/qt_cocoa_helpers_mac.mm index e0dcaef..13c25fd 100644 --- a/src/gui/kernel/qt_cocoa_helpers_mac.mm +++ b/src/gui/kernel/qt_cocoa_helpers_mac.mm @@ -143,6 +143,9 @@ extern QPointer qt_button_down; //qapplication_mac.cpp void macWindowFade(void * /*OSWindowRef*/ window, float durationSeconds) { +#ifdef QT_MAC_USE_COCOA + QMacCocoaAutoReleasePool pool; +#endif OSWindowRef wnd = static_cast(window); if (wnd) { QWidget *widget; -- cgit v0.12 From d5a512b40190d4986be23bbebd2cbb53919e48ae Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 26 Jan 2010 14:14:30 +0100 Subject: Add proper license headers to these files. This makes the headers:licenseCheck test pass. --- src/testlib/qbenchmarkmetric.cpp | 78 ++++++++++++++++----------------- tests/auto/qobject/oldnormalizeobject.h | 41 +++++++++++++++++ tests/benchmarks/qvector/outofline.cpp | 40 +++++++++++++++++ 3 files changed, 120 insertions(+), 39 deletions(-) diff --git a/src/testlib/qbenchmarkmetric.cpp b/src/testlib/qbenchmarkmetric.cpp index 614357c..75297c4 100644 --- a/src/testlib/qbenchmarkmetric.cpp +++ b/src/testlib/qbenchmarkmetric.cpp @@ -1,43 +1,43 @@ /**************************************************************************** - ** - ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). - ** All rights reserved. - ** Contact: Nokia Corporation (qt-info@nokia.com) - ** - ** This file is part of the QtTest module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** No Commercial Usage - ** This file contains pre-release code and may not be distributed. - ** You may use this file in accordance with the terms and conditions - ** contained in the Technology Preview License Agreement accompanying - ** this package. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 2.1 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 2.1 requirements - ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. - ** - ** In addition, as a special exception, Nokia gives you certain additional - ** rights. These rights are described in the Nokia Qt LGPL Exception - ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. - ** - ** If you have questions regarding the use of this file, please contact - ** Nokia at qt-info@nokia.com. - ** - ** - ** - ** - ** - ** - ** - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtTest module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ #include diff --git a/tests/auto/qobject/oldnormalizeobject.h b/tests/auto/qobject/oldnormalizeobject.h index 8420a3a..3adf04d 100644 --- a/tests/auto/qobject/oldnormalizeobject.h +++ b/tests/auto/qobject/oldnormalizeobject.h @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtTest module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + #ifndef OLDNORMALIZEOBJECT_H #define OLDNORMALIZEOBJECT_H diff --git a/tests/benchmarks/qvector/outofline.cpp b/tests/benchmarks/qvector/outofline.cpp index d1d72b0..e8d036e 100644 --- a/tests/benchmarks/qvector/outofline.cpp +++ b/tests/benchmarks/qvector/outofline.cpp @@ -1,3 +1,43 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtTest module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ #include #include -- cgit v0.12 From 7b306a0534e4c1db40fbcf77612fd88ac672b6f7 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 26 Jan 2010 14:17:01 +0100 Subject: Remove the tests/auto/networkdata dir, since this causes the maketestselftest test fail --- tests/auto/networkdata/README | 1 - 1 file changed, 1 deletion(-) delete mode 100644 tests/auto/networkdata/README diff --git a/tests/auto/networkdata/README b/tests/auto/networkdata/README deleted file mode 100644 index e8748cc..0000000 --- a/tests/auto/networkdata/README +++ /dev/null @@ -1 +0,0 @@ -This directory contains network test data -- cgit v0.12 From 2b13dc93d406040d5f62ca57b44969b484370f87 Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Tue, 26 Jan 2010 15:05:25 +0100 Subject: Fix compile on MSVC 2003. ARRAYSIZE macro doesn't exit. Reviewed-by:Jan-Arve --- src/gui/dialogs/qfilesystemmodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/dialogs/qfilesystemmodel.cpp b/src/gui/dialogs/qfilesystemmodel.cpp index ae75126..0e1837b 100644 --- a/src/gui/dialogs/qfilesystemmodel.cpp +++ b/src/gui/dialogs/qfilesystemmodel.cpp @@ -1667,7 +1667,7 @@ QFileSystemModelPrivate::QFileSystemNode* QFileSystemModelPrivate::addNode(QFile //GetVolumeInformation requires to add trailing backslash const QString nodeName = fileName + QLatin1String("\\"); BOOL success = ::GetVolumeInformation((wchar_t *)(nodeName.utf16()), - name, ARRAYSIZE(name), NULL, 0, NULL, NULL, 0); + name, MAX_PATH + 1, NULL, 0, NULL, NULL, 0); if (success && name[0]) node->volumeName = QString::fromWCharArray(name); } -- cgit v0.12 From c06c254cf208840f14c9e562cae976f1a61f0879 Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Tue, 26 Jan 2010 16:00:02 +0100 Subject: Fixed compile of QTriangulator on Solaris. Reviewed-by: Trond --- src/opengl/gl2paintengineex/qtriangulator.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/opengl/gl2paintengineex/qtriangulator.cpp b/src/opengl/gl2paintengineex/qtriangulator.cpp index b60e10d..115f31b 100644 --- a/src/opengl/gl2paintengineex/qtriangulator.cpp +++ b/src/opengl/gl2paintengineex/qtriangulator.cpp @@ -361,14 +361,14 @@ struct QIntersectionPoint static inline QIntersectionPoint qIntersectionPoint(const QPodPoint &point) { - // m_upperLeft = point, m_xOffset = 0/1, m_yOffset = 0/1. - QIntersectionPoint p = {point, {0, 1}, {0, 1}}; + // upperLeft = point, xOffset = 0/1, yOffset = 0/1. + QIntersectionPoint p = {{point.x, point.y}, {0, 1}, {0, 1}}; return p; } static inline QIntersectionPoint qIntersectionPoint(int x, int y) { - // m_upperLeft = (x, y), m_xOffset = 0/1, m_yOffset = 0/1. + // upperLeft = (x, y), xOffset = 0/1, yOffset = 0/1. QIntersectionPoint p = {{x, y}, {0, 1}, {0, 1}}; return p; } @@ -1988,8 +1988,10 @@ void QTriangulator::ComplexToSimple::fillPriorityQueue() Q_ASSERT(m_edges.at(i).pointingUp == (m_parent->m_vertices.at(m_edges.at(i).to) < m_parent->m_vertices.at(m_edges.at(i).from))); // Ignore zero-length edges. if (m_parent->m_vertices.at(m_edges.at(i).to) != m_parent->m_vertices.at(m_edges.at(i).from)) { - Event upperEvent = {m_parent->m_vertices.at(m_edges.at(i).upper()), Event::Upper, i}; - Event lowerEvent = {m_parent->m_vertices.at(m_edges.at(i).lower()), Event::Lower, i}; + QPodPoint upper = m_parent->m_vertices.at(m_edges.at(i).upper()); + QPodPoint lower = m_parent->m_vertices.at(m_edges.at(i).lower()); + Event upperEvent = {{upper.x, upper.y}, Event::Upper, i}; + Event lowerEvent = {{lower.x, lower.y}, Event::Lower, i}; m_events.add(upperEvent); m_events.add(lowerEvent); } -- cgit v0.12 From c3619bce443e73430b1b8aa7ab4c0e712375b53b Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Tue, 26 Jan 2010 17:26:46 +0100 Subject: fix regression introduced in 44766d2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit null fileNames returned by fileEngine must be cached too Merge-request: 446 Reviewed-by: João Abecasis --- src/corelib/io/qfileinfo.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp index e90529e..6eb864e 100644 --- a/src/corelib/io/qfileinfo.cpp +++ b/src/corelib/io/qfileinfo.cpp @@ -132,6 +132,8 @@ QString QFileInfoPrivate::getFileName(QAbstractFileEngine::FileName name) const if(data->cache_enabled && !data->fileNames[(int)name].isNull()) return data->fileNames[(int)name]; QString ret = data->fileEngine->fileName(name); + if (ret.isNull()) + ret = QLatin1String(""); if(data->cache_enabled) data->fileNames[(int)name] = ret; return ret; -- cgit v0.12 From 95f0dbd76f419ebc80e27f184d5e1199e91de4b7 Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Tue, 26 Jan 2010 17:26:47 +0100 Subject: QFileInfoPrivate::Data: don't call clear() from constructors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit causes Refresh of file engine's internal cache, since `fileEngine' member is set before clear() is called. Initialize members with default values instead. Merge-request: 446 Reviewed-by: João Abecasis --- src/corelib/io/qfileinfo_p.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/corelib/io/qfileinfo_p.h b/src/corelib/io/qfileinfo_p.h index 065f860..7f8ab4e 100644 --- a/src/corelib/io/qfileinfo_p.h +++ b/src/corelib/io/qfileinfo_p.h @@ -81,12 +81,14 @@ public: CachedSize =0x08 }; struct Data { inline Data() - : ref(1), fileEngine(0), cache_enabled(1), fileSize(0) - { clear(); } + : ref(1), fileEngine(0), + cachedFlags(0), cache_enabled(1), fileFlags(0), fileSize(0) + {} inline Data(const Data ©) : ref(1), fileEngine(QAbstractFileEngine::create(copy.fileName)), - fileName(copy.fileName), cache_enabled(copy.cache_enabled), fileSize(copy.fileSize) - { clear(); } + fileName(copy.fileName), + cachedFlags(0), cache_enabled(copy.cache_enabled), fileFlags(0), fileSize(0) + {} inline ~Data() { delete fileEngine; } inline void clearFlags() { fileFlags = 0; -- cgit v0.12 From 3a5eb87965b60a3e249a16dc48cb06f4759dfb1b Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Tue, 26 Jan 2010 17:26:48 +0100 Subject: QFileInfo: Don't re-stat files, when in caching mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Separated testing for permissions flags, in order to speedup QFileInfo on Windows with qt_ntfs_permission_lookup flag turned on (especially on network shares). In QFileInfoPrivate::getFileFlags, avoid multiple calls to the engine, by concatenating all requests. Merge-request: 446 Reviewed-by: João Abecasis --- src/corelib/io/qfileinfo.cpp | 74 +++++++++++++++++++++++++------------------- src/corelib/io/qfileinfo_p.h | 2 +- 2 files changed, 44 insertions(+), 32 deletions(-) diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp index 6eb864e..2260036 100644 --- a/src/corelib/io/qfileinfo.cpp +++ b/src/corelib/io/qfileinfo.cpp @@ -81,7 +81,8 @@ void QFileInfoPrivate::initFileEngine(const QString &file) bool QFileInfoPrivate::hasAccess(Access access) const { - if (!(getFileFlags(QAbstractFileEngine::FileInfoAll) & QAbstractFileEngine::LocalDiskFlag)) { + if (!(getFileFlags(QAbstractFileEngine::PermsMask + | QAbstractFileEngine::LocalDiskFlag) & QAbstractFileEngine::LocalDiskFlag)) { switch (access) { case ReadAccess: return getFileFlags(QAbstractFileEngine::ReadUserPerm); @@ -141,51 +142,62 @@ QString QFileInfoPrivate::getFileName(QAbstractFileEngine::FileName name) const uint QFileInfoPrivate::getFileFlags(QAbstractFileEngine::FileFlags request) const { - // We split the testing into tests for for LinkType, BundleType and the rest. + // We split the testing into tests for for LinkType, BundleType, PermsMask + // and the rest. + // Tests for file permissions on Windows can be slow, expecially on network + // paths and NTFS drives. // In order to determine if a file is a symlink or not, we have to lstat(). // If we're not interested in that information, we might as well avoid one // extra syscall. Bundle detecton on Mac can be slow, expecially on network // paths, so we separate out that as well. - QAbstractFileEngine::FileFlags flags; - if (!data->getCachedFlag(CachedFileFlags)) { - QAbstractFileEngine::FileFlags req = QAbstractFileEngine::FileInfoAll; - req &= (~QAbstractFileEngine::LinkType); - req &= (~QAbstractFileEngine::BundleType); + QAbstractFileEngine::FileFlags req = 0; + uint cachedFlags = 0; - flags = data->fileEngine->fileFlags(req); - data->setCachedFlag(CachedFileFlags); - data->fileFlags |= uint(flags); - } else { - flags = QAbstractFileEngine::FileFlags(data->fileFlags & request); - } + if (request & (QAbstractFileEngine::FlagsMask | QAbstractFileEngine::TypesMask)) { + if (!data->getCachedFlag(CachedFileFlags)) { + req |= QAbstractFileEngine::FlagsMask; + req |= QAbstractFileEngine::TypesMask; + req &= (~QAbstractFileEngine::LinkType); + req &= (~QAbstractFileEngine::BundleType); - if (request & QAbstractFileEngine::LinkType) { - if (!data->getCachedFlag(CachedLinkTypeFlag)) { - QAbstractFileEngine::FileFlags linkflag; - linkflag = data->fileEngine->fileFlags(QAbstractFileEngine::LinkType); + cachedFlags |= CachedFileFlags; + + if (request & QAbstractFileEngine::LinkType) { + if (!data->getCachedFlag(CachedLinkTypeFlag)) { + req |= QAbstractFileEngine::LinkType; + cachedFlags |= CachedLinkTypeFlag; + } + } - data->setCachedFlag(CachedLinkTypeFlag); - data->fileFlags |= uint(linkflag); - flags |= linkflag; + if (request & QAbstractFileEngine::BundleType) { + if (!data->getCachedFlag(CachedBundleTypeFlag)) { + req |= QAbstractFileEngine::BundleType; + cachedFlags |= CachedBundleTypeFlag; + } + } } } - if (request & QAbstractFileEngine::BundleType) { - if (!data->getCachedFlag(CachedBundleTypeFlag)) { - QAbstractFileEngine::FileFlags bundleflag; - bundleflag = data->fileEngine->fileFlags(QAbstractFileEngine::BundleType); - - data->setCachedFlag(CachedBundleTypeFlag); - data->fileFlags |= uint(bundleflag); - flags |= bundleflag; + if (request & QAbstractFileEngine::PermsMask) { + if (!data->getCachedFlag(CachedPerms)) { + req |= QAbstractFileEngine::PermsMask; + cachedFlags |= CachedPerms; } } - // no else branch - // if we had it cached, it was caught in the previous else branch + if (req) { + if (data->cache_enabled) + req &= (~QAbstractFileEngine::Refresh); + else + req |= QAbstractFileEngine::Refresh; + + QAbstractFileEngine::FileFlags flags = data->fileEngine->fileFlags(req); + data->fileFlags |= uint(flags); + data->setCachedFlag(cachedFlags); + } - return flags & request; + return data->fileFlags & request; } QDateTime &QFileInfoPrivate::getFileTime(QAbstractFileEngine::FileTime request) const diff --git a/src/corelib/io/qfileinfo_p.h b/src/corelib/io/qfileinfo_p.h index 7f8ab4e..8e00909 100644 --- a/src/corelib/io/qfileinfo_p.h +++ b/src/corelib/io/qfileinfo_p.h @@ -78,7 +78,7 @@ public: enum { CachedFileFlags=0x01, CachedLinkTypeFlag=0x02, CachedBundleTypeFlag=0x04, CachedMTime=0x10, CachedCTime=0x20, CachedATime=0x40, - CachedSize =0x08 }; + CachedSize =0x08, CachedPerms=0x80 }; struct Data { inline Data() : ref(1), fileEngine(0), -- cgit v0.12 From d48fdf76f721b97e427073c665102e1b42398883 Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Tue, 26 Jan 2010 17:26:48 +0100 Subject: Simplify QFileInfoPrivate::getFileTime MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit remove repeated code; improve readability Merge-request: 446 Reviewed-by: João Abecasis --- src/corelib/io/qfileinfo.cpp | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp index 2260036..6616066 100644 --- a/src/corelib/io/qfileinfo.cpp +++ b/src/corelib/io/qfileinfo.cpp @@ -204,25 +204,18 @@ QDateTime &QFileInfoPrivate::getFileTime(QAbstractFileEngine::FileTime request) { if (!data->cache_enabled) data->clearFlags(); - if(request == QAbstractFileEngine::CreationTime) { - if(data->getCachedFlag(CachedCTime)) - return data->fileTimes[request]; - data->setCachedFlag(CachedCTime); - return (data->fileTimes[request] = data->fileEngine->fileTime(request)); + uint cf; + if (request == QAbstractFileEngine::CreationTime) + cf = CachedCTime; + else if (request == QAbstractFileEngine::ModificationTime) + cf = CachedMTime; + else + cf = CachedATime; + if (!data->getCachedFlag(cf)) { + data->fileTimes[request] = data->fileEngine->fileTime(request); + data->setCachedFlag(cf); } - if(request == QAbstractFileEngine::ModificationTime) { - if(data->getCachedFlag(CachedMTime)) - return data->fileTimes[request]; - data->setCachedFlag(CachedMTime); - return (data->fileTimes[request] = data->fileEngine->fileTime(request)); - } - if(request == QAbstractFileEngine::AccessTime) { - if(data->getCachedFlag(CachedATime)) - return data->fileTimes[request]; - data->setCachedFlag(CachedATime); - return (data->fileTimes[request] = data->fileEngine->fileTime(request)); - } - return data->fileTimes[0]; //cannot really happen + return data->fileTimes[request]; } //************* QFileInfo -- cgit v0.12 From fbd0b8c0f6dce834b241f6beb755d2c2cb013305 Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Tue, 26 Jan 2010 17:26:49 +0100 Subject: qfileinfo_p.h: removed unnecessary dependency on QFSFileEngine MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Moved includes into proper place. Merge-request: 446 Reviewed-by: João Abecasis --- src/corelib/io/qfileinfo.cpp | 3 --- src/corelib/io/qfileinfo_p.h | 5 ++++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp index 6616066..f4e92a5 100644 --- a/src/corelib/io/qfileinfo.cpp +++ b/src/corelib/io/qfileinfo.cpp @@ -41,11 +41,8 @@ #include "qplatformdefs.h" #include "qfileinfo.h" -#include "qdatetime.h" -#include "qabstractfileengine.h" #include "qfsfileengine_p.h" #include "qglobal.h" -#include "qatomic.h" #include "qhash.h" #include "qdir.h" #include "qfileinfo_p.h" diff --git a/src/corelib/io/qfileinfo_p.h b/src/corelib/io/qfileinfo_p.h index 8e00909..bf02aaa 100644 --- a/src/corelib/io/qfileinfo_p.h +++ b/src/corelib/io/qfileinfo_p.h @@ -54,6 +54,9 @@ // #include "qfileinfo.h" +#include "qabstractfileengine.h" +#include "qdatetime.h" +#include "qatomic.h" QT_BEGIN_NAMESPACE @@ -94,7 +97,7 @@ public: fileFlags = 0; cachedFlags = 0; if (fileEngine) - (void)fileEngine->fileFlags(QFSFileEngine::Refresh); + (void)fileEngine->fileFlags(QAbstractFileEngine::Refresh); } inline void clear() { clearFlags(); -- cgit v0.12 From 3c8ac0ee7f09bbef4dc56a05de538df1aa16a596 Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Tue, 26 Jan 2010 17:26:50 +0100 Subject: QFileInfo: Implement additional caching of FileOwner strings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reduce overhead of the uid/gid to user/group name conversion by caching results from QAbstractFileEngine::owner(). Merge-request: 446 Reviewed-by: João Abecasis --- src/corelib/io/qfileinfo.cpp | 16 ++++++++++++++-- src/corelib/io/qfileinfo_p.h | 4 ++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp index f4e92a5..d827f57 100644 --- a/src/corelib/io/qfileinfo.cpp +++ b/src/corelib/io/qfileinfo.cpp @@ -137,6 +137,18 @@ QString QFileInfoPrivate::getFileName(QAbstractFileEngine::FileName name) const return ret; } +QString QFileInfoPrivate::getFileOwner(QAbstractFileEngine::FileOwner own) const +{ + if (data->cache_enabled && !data->fileOwners[(int)own].isNull()) + return data->fileOwners[(int)own]; + QString ret = data->fileEngine->owner(own); + if (ret.isNull()) + ret = QLatin1String(""); + if (data->cache_enabled) + data->fileOwners[(int)own] = ret; + return ret; +} + uint QFileInfoPrivate::getFileFlags(QAbstractFileEngine::FileFlags request) const { // We split the testing into tests for for LinkType, BundleType, PermsMask @@ -1089,7 +1101,7 @@ QString QFileInfo::owner() const Q_D(const QFileInfo); if(!d->data->fileEngine) return QLatin1String(""); - return d->data->fileEngine->owner(QAbstractFileEngine::OwnerUser); + return d->getFileOwner(QAbstractFileEngine::OwnerUser); } /*! @@ -1125,7 +1137,7 @@ QString QFileInfo::group() const Q_D(const QFileInfo); if(!d->data->fileEngine) return QLatin1String(""); - return d->data->fileEngine->owner(QAbstractFileEngine::OwnerGroup); + return d->getFileOwner(QAbstractFileEngine::OwnerGroup); } /*! diff --git a/src/corelib/io/qfileinfo_p.h b/src/corelib/io/qfileinfo_p.h index bf02aaa..d97a0cf 100644 --- a/src/corelib/io/qfileinfo_p.h +++ b/src/corelib/io/qfileinfo_p.h @@ -78,6 +78,7 @@ public: uint getFileFlags(QAbstractFileEngine::FileFlags) const; QDateTime &getFileTime(QAbstractFileEngine::FileTime) const; QString getFileName(QAbstractFileEngine::FileName) const; + QString getFileOwner(QAbstractFileEngine::FileOwner own) const; enum { CachedFileFlags=0x01, CachedLinkTypeFlag=0x02, CachedBundleTypeFlag=0x04, CachedMTime=0x10, CachedCTime=0x20, CachedATime=0x40, @@ -103,12 +104,15 @@ public: clearFlags(); for (int i = QAbstractFileEngine::NFileNames - 1 ; i >= 0 ; --i) fileNames[i].clear(); + fileOwners[1].clear(); + fileOwners[0].clear(); } mutable QAtomicInt ref; QAbstractFileEngine *fileEngine; mutable QString fileName; mutable QString fileNames[QAbstractFileEngine::NFileNames]; + mutable QString fileOwners[2]; mutable uint cachedFlags : 31; mutable uint cache_enabled : 1; -- cgit v0.12 From bde7b69f2f69bbb2cf9eecb5e3ad3501c1f2c62e Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Tue, 26 Jan 2010 17:26:50 +0100 Subject: cleanups & styling fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `if(' -> `if (' `for(' -> `for (' remove needless qhash.h include Merge-request: 446 Reviewed-by: João Abecasis --- src/corelib/io/qfileinfo.cpp | 93 ++++++++++++++++++++++---------------------- 1 file changed, 46 insertions(+), 47 deletions(-) diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp index d827f57..616f6f9 100644 --- a/src/corelib/io/qfileinfo.cpp +++ b/src/corelib/io/qfileinfo.cpp @@ -43,7 +43,6 @@ #include "qfileinfo.h" #include "qfsfileengine_p.h" #include "qglobal.h" -#include "qhash.h" #include "qdir.h" #include "qfileinfo_p.h" @@ -51,7 +50,7 @@ QT_BEGIN_NAMESPACE QFileInfoPrivate::QFileInfoPrivate(const QFileInfo *copy) { - if(copy) { + if (copy) { copy->d_func()->data->ref.ref(); data = copy->d_func()->data; } else { @@ -127,12 +126,12 @@ void QFileInfoPrivate::detach() QString QFileInfoPrivate::getFileName(QAbstractFileEngine::FileName name) const { - if(data->cache_enabled && !data->fileNames[(int)name].isNull()) + if (data->cache_enabled && !data->fileNames[(int)name].isNull()) return data->fileNames[(int)name]; QString ret = data->fileEngine->fileName(name); if (ret.isNull()) ret = QLatin1String(""); - if(data->cache_enabled) + if (data->cache_enabled) data->fileNames[(int)name] = ret; return ret; } @@ -411,19 +410,19 @@ bool QFileInfo::operator==(const QFileInfo &fileinfo) const Q_D(const QFileInfo); // ### Qt 5: understand long and short file names on Windows // ### (GetFullPathName()). - if(fileinfo.d_func()->data == d->data) + if (fileinfo.d_func()->data == d->data) return true; - if(!d->data->fileEngine || !fileinfo.d_func()->data->fileEngine) + if (!d->data->fileEngine || !fileinfo.d_func()->data->fileEngine) return false; - if(d->data->fileEngine->caseSensitive() != fileinfo.d_func()->data->fileEngine->caseSensitive()) + if (d->data->fileEngine->caseSensitive() != fileinfo.d_func()->data->fileEngine->caseSensitive()) return false; - if(fileinfo.size() == size()) { //if the size isn't the same... + if (fileinfo.size() == size()) { //if the size isn't the same... QString file1 = canonicalFilePath(), file2 = fileinfo.canonicalFilePath(); - if(file1.length() == file2.length()) { - if(!fileinfo.d_func()->data->fileEngine->caseSensitive()) { - for(int i = 0; i < file1.length(); i++) { - if(file1.at(i).toLower() != file2.at(i).toLower()) + if (file1.length() == file2.length()) { + if (!fileinfo.d_func()->data->fileEngine->caseSensitive()) { + for (int i = 0; i < file1.length(); i++) { + if (file1.at(i).toLower() != file2.at(i).toLower()) return false; } return true; @@ -544,7 +543,7 @@ void QFileInfo::setFile(const QDir &dir, const QString &file) QString QFileInfo::absoluteFilePath() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return QLatin1String(""); return d->getFileName(QAbstractFileEngine::AbsoluteName); } @@ -562,7 +561,7 @@ QString QFileInfo::absoluteFilePath() const QString QFileInfo::canonicalFilePath() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return QLatin1String(""); return d->getFileName(QAbstractFileEngine::CanonicalName); } @@ -611,7 +610,7 @@ QString QFileInfo::absolutePath() const QString QFileInfo::canonicalPath() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return QLatin1String(""); return d->getFileName(QAbstractFileEngine::CanonicalPathName); } @@ -630,7 +629,7 @@ QString QFileInfo::canonicalPath() const QString QFileInfo::path() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return QLatin1String(""); return d->getFileName(QAbstractFileEngine::PathName); } @@ -655,7 +654,7 @@ QString QFileInfo::path() const bool QFileInfo::isRelative() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return true; return d->data->fileEngine->isRelativePath(); } @@ -672,7 +671,7 @@ bool QFileInfo::isRelative() const bool QFileInfo::makeAbsolute() { Q_D(QFileInfo); - if(!d->data->fileEngine || !d->data->fileEngine->isRelativePath()) + if (!d->data->fileEngine || !d->data->fileEngine->isRelativePath()) return false; QString absFileName = d->getFileName(QAbstractFileEngine::AbsoluteName); d->initFileEngine(absFileName); @@ -689,7 +688,7 @@ bool QFileInfo::makeAbsolute() bool QFileInfo::exists() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return false; return d->getFileFlags(QAbstractFileEngine::ExistsFlag); } @@ -718,7 +717,7 @@ void QFileInfo::refresh() QString QFileInfo::filePath() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return QLatin1String(""); return d->getFileName(QAbstractFileEngine::DefaultName); } @@ -738,7 +737,7 @@ QString QFileInfo::filePath() const QString QFileInfo::fileName() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return QLatin1String(""); return d->getFileName(QAbstractFileEngine::BaseName); } @@ -759,7 +758,7 @@ QString QFileInfo::fileName() const QString QFileInfo::bundleName() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return QLatin1String(""); return d->getFileName(QAbstractFileEngine::BundleName); } @@ -784,7 +783,7 @@ QString QFileInfo::bundleName() const QString QFileInfo::baseName() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return QLatin1String(""); return d->getFileName(QAbstractFileEngine::BaseName).section(QLatin1Char('.'), 0, 0); } @@ -804,7 +803,7 @@ QString QFileInfo::baseName() const QString QFileInfo::completeBaseName() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return QLatin1String(""); QString name = d->getFileName(QAbstractFileEngine::BaseName); int index = name.lastIndexOf(QLatin1Char('.')); @@ -826,7 +825,7 @@ QString QFileInfo::completeBaseName() const QString QFileInfo::completeSuffix() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return QLatin1String(""); QString fileName = d->getFileName(QAbstractFileEngine::BaseName); int firstDot = fileName.indexOf(QLatin1Char('.')); @@ -854,7 +853,7 @@ QString QFileInfo::completeSuffix() const QString QFileInfo::suffix() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return QLatin1String(""); QString fileName = d->getFileName(QAbstractFileEngine::BaseName); int lastDot = fileName.lastIndexOf(QLatin1Char('.')); @@ -907,7 +906,7 @@ QDir QFileInfo::absoluteDir() const */ QDir QFileInfo::dir(bool absPath) const { - if(absPath) + if (absPath) return absoluteDir(); return dir(); } @@ -922,7 +921,7 @@ QDir QFileInfo::dir(bool absPath) const bool QFileInfo::isReadable() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return false; return d->hasAccess(QFileInfoPrivate::ReadAccess); } @@ -936,7 +935,7 @@ bool QFileInfo::isReadable() const bool QFileInfo::isWritable() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return false; return d->hasAccess(QFileInfoPrivate::WriteAccess); } @@ -950,7 +949,7 @@ bool QFileInfo::isWritable() const bool QFileInfo::isExecutable() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return false; return d->hasAccess(QFileInfoPrivate::ExecuteAccess); } @@ -964,7 +963,7 @@ bool QFileInfo::isExecutable() const bool QFileInfo::isHidden() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return false; return d->getFileFlags(QAbstractFileEngine::HiddenFlag); } @@ -980,7 +979,7 @@ bool QFileInfo::isHidden() const bool QFileInfo::isFile() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return false; return d->getFileFlags(QAbstractFileEngine::FileType); } @@ -995,7 +994,7 @@ bool QFileInfo::isFile() const bool QFileInfo::isDir() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return false; return d->getFileFlags(QAbstractFileEngine::DirectoryType); } @@ -1012,7 +1011,7 @@ bool QFileInfo::isDir() const bool QFileInfo::isBundle() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return false; return d->getFileFlags(QAbstractFileEngine::BundleType); } @@ -1038,7 +1037,7 @@ bool QFileInfo::isBundle() const bool QFileInfo::isSymLink() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return false; return d->getFileFlags(QAbstractFileEngine::LinkType); } @@ -1080,7 +1079,7 @@ bool QFileInfo::isRoot() const QString QFileInfo::readLink() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return QLatin1String(""); return d->getFileName(QAbstractFileEngine::LinkName); } @@ -1099,7 +1098,7 @@ QString QFileInfo::readLink() const QString QFileInfo::owner() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return QLatin1String(""); return d->getFileOwner(QAbstractFileEngine::OwnerUser); } @@ -1116,7 +1115,7 @@ QString QFileInfo::owner() const uint QFileInfo::ownerId() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return 0; return d->data->fileEngine->ownerId(QAbstractFileEngine::OwnerUser); } @@ -1135,7 +1134,7 @@ uint QFileInfo::ownerId() const QString QFileInfo::group() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return QLatin1String(""); return d->getFileOwner(QAbstractFileEngine::OwnerGroup); } @@ -1152,7 +1151,7 @@ QString QFileInfo::group() const uint QFileInfo::groupId() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return 0; return d->data->fileEngine->ownerId(QAbstractFileEngine::OwnerGroup); } @@ -1174,7 +1173,7 @@ uint QFileInfo::groupId() const bool QFileInfo::permission(QFile::Permissions permissions) const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return false; return d->getFileFlags(QAbstractFileEngine::FileFlags((int)permissions)) == (uint)permissions; } @@ -1187,7 +1186,7 @@ bool QFileInfo::permission(QFile::Permissions permissions) const QFile::Permissions QFileInfo::permissions() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return 0; return QFile::Permissions(d->getFileFlags(QAbstractFileEngine::PermsMask) & QAbstractFileEngine::PermsMask); } @@ -1203,9 +1202,9 @@ QFile::Permissions QFileInfo::permissions() const qint64 QFileInfo::size() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return 0; - if(!d->data->getCachedFlag(QFileInfoPrivate::CachedSize)) { + if (!d->data->getCachedFlag(QFileInfoPrivate::CachedSize)) { d->data->setCachedFlag(QFileInfoPrivate::CachedSize); d->data->fileSize = d->data->fileEngine->size(); } @@ -1229,7 +1228,7 @@ qint64 QFileInfo::size() const QDateTime QFileInfo::created() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return QDateTime(); return d->getFileTime(QAbstractFileEngine::CreationTime); } @@ -1243,7 +1242,7 @@ QDateTime QFileInfo::created() const QDateTime QFileInfo::lastModified() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return QDateTime(); return d->getFileTime(QAbstractFileEngine::ModificationTime); } @@ -1260,7 +1259,7 @@ QDateTime QFileInfo::lastModified() const QDateTime QFileInfo::lastRead() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return QDateTime(); return d->getFileTime(QAbstractFileEngine::AccessTime); } -- cgit v0.12 From a9d351f72582c06a979874619003da36214b010f Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Tue, 26 Jan 2010 17:26:51 +0100 Subject: Whitespace cleanup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Merge-request: 446 Reviewed-by: João Abecasis --- src/corelib/io/qfileinfo.cpp | 86 ++++++++++---------------------------------- 1 file changed, 18 insertions(+), 68 deletions(-) diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp index 616f6f9..21ff708 100644 --- a/src/corelib/io/qfileinfo.cpp +++ b/src/corelib/io/qfileinfo.cpp @@ -320,7 +320,6 @@ QDateTime &QFileInfoPrivate::getFileTime(QAbstractFileEngine::FileTime request) \sa setFile() */ - QFileInfo::QFileInfo() : d_ptr(new QFileInfoPrivate()) { } @@ -331,7 +330,6 @@ QFileInfo::QFileInfo() : d_ptr(new QFileInfoPrivate()) \sa setFile(), isRelative(), QDir::setCurrent(), QDir::isRelativePath() */ - QFileInfo::QFileInfo(const QString &file) : d_ptr(new QFileInfoPrivate()) { d_ptr->initFileEngine(file); @@ -346,7 +344,6 @@ QFileInfo::QFileInfo(const QString &file) : d_ptr(new QFileInfoPrivate()) \sa isRelative() */ - QFileInfo::QFileInfo(const QFile &file) : d_ptr(new QFileInfoPrivate()) { d_ptr->initFileEngine(file.fileName()); @@ -364,7 +361,6 @@ QFileInfo::QFileInfo(const QFile &file) : d_ptr(new QFileInfoPrivate()) \sa isRelative() */ - QFileInfo::QFileInfo(const QDir &dir, const QString &file) : d_ptr(new QFileInfoPrivate()) { d_ptr->initFileEngine(dir.filePath(file)); @@ -373,7 +369,6 @@ QFileInfo::QFileInfo(const QDir &dir, const QString &file) : d_ptr(new QFileInfo /*! Constructs a new QFileInfo that is a copy of the given \a fileinfo. */ - QFileInfo::QFileInfo(const QFileInfo &fileinfo) : d_ptr(new QFileInfoPrivate(&fileinfo)) { @@ -383,7 +378,6 @@ QFileInfo::QFileInfo(const QFileInfo &fileinfo) : d_ptr(new QFileInfoPrivate(&fi Destroys the QFileInfo and frees its resources. */ - QFileInfo::~QFileInfo() { } @@ -456,7 +450,6 @@ bool QFileInfo::operator==(const QFileInfo &fileinfo) /*! Makes a copy of the given \a fileinfo and assigns it to this QFileInfo. */ - QFileInfo &QFileInfo::operator=(const QFileInfo &fileinfo) { Q_D(QFileInfo); @@ -479,7 +472,6 @@ QFileInfo &QFileInfo::operator=(const QFileInfo &fileinfo) \sa isRelative(), QDir::setCurrent(), QDir::isRelativePath() */ - void QFileInfo::setFile(const QString &file) { *this = QFileInfo(file); @@ -496,7 +488,6 @@ void QFileInfo::setFile(const QString &file) \sa isRelative() */ - void QFileInfo::setFile(const QFile &file) { *this = QFileInfo(file.fileName()); @@ -513,7 +504,6 @@ void QFileInfo::setFile(const QFile &file) \sa isRelative() */ - void QFileInfo::setFile(const QDir &dir, const QString &file) { *this = QFileInfo(dir.filePath(file)); @@ -549,15 +539,14 @@ QString QFileInfo::absoluteFilePath() const } /*! - Returns the canonical path including the file name, i.e. an absolute - path without symbolic links or redundant "." or ".." elements. + Returns the canonical path including the file name, i.e. an absolute + path without symbolic links or redundant "." or ".." elements. - If the file does not exist, canonicalFilePath() returns an empty - string. + If the file does not exist, canonicalFilePath() returns an empty + string. - \sa filePath(), absoluteFilePath(), dir() + \sa filePath(), absoluteFilePath(), dir() */ - QString QFileInfo::canonicalFilePath() const { Q_D(const QFileInfo); @@ -584,7 +573,6 @@ QString QFileInfo::canonicalFilePath() const \sa absoluteFilePath(), path(), canonicalPath(), fileName(), isRelative() */ - QString QFileInfo::absolutePath() const { Q_D(const QFileInfo); @@ -606,7 +594,6 @@ QString QFileInfo::absolutePath() const \sa path(), absolutePath() */ - QString QFileInfo::canonicalPath() const { Q_D(const QFileInfo); @@ -615,7 +602,6 @@ QString QFileInfo::canonicalPath() const return d->getFileName(QAbstractFileEngine::CanonicalPathName); } - /*! Returns the file's path. This doesn't include the file name. @@ -625,7 +611,6 @@ QString QFileInfo::canonicalPath() const \sa filePath(), absolutePath(), canonicalPath(), dir(), fileName(), isRelative() */ - QString QFileInfo::path() const { Q_D(const QFileInfo); @@ -650,7 +635,6 @@ QString QFileInfo::path() const \sa isAbsolute() */ - bool QFileInfo::isRelative() const { Q_D(const QFileInfo); @@ -659,7 +643,6 @@ bool QFileInfo::isRelative() const return d->data->fileEngine->isRelativePath(); } - /*! Converts the file's path to an absolute path if it is not already in that form. Returns true to indicate that the path was converted; otherwise returns false @@ -667,7 +650,6 @@ bool QFileInfo::isRelative() const \sa filePath(), isRelative() */ - bool QFileInfo::makeAbsolute() { Q_D(QFileInfo); @@ -684,7 +666,6 @@ bool QFileInfo::makeAbsolute() \note If the file is a symlink that points to a non existing file, false is returned. */ - bool QFileInfo::exists() const { Q_D(const QFileInfo); @@ -700,7 +681,6 @@ bool QFileInfo::exists() const \note On Windows CE, there might be a delay for the file system driver to detect changes on the file. */ - void QFileInfo::refresh() { Q_D(QFileInfo); @@ -713,7 +693,6 @@ void QFileInfo::refresh() \sa absoluteFilePath(), canonicalFilePath(), isRelative() */ - QString QFileInfo::filePath() const { Q_D(const QFileInfo); @@ -733,7 +712,6 @@ QString QFileInfo::filePath() const \sa isRelative(), filePath(), baseName(), extension() */ - QString QFileInfo::fileName() const { Q_D(const QFileInfo); @@ -754,7 +732,6 @@ QString QFileInfo::fileName() const \sa isBundle(), filePath(), baseName(), extension() */ - QString QFileInfo::bundleName() const { Q_D(const QFileInfo); @@ -779,7 +756,6 @@ QString QFileInfo::bundleName() const \sa fileName(), suffix(), completeSuffix(), completeBaseName() */ - QString QFileInfo::baseName() const { Q_D(const QFileInfo); @@ -799,7 +775,6 @@ QString QFileInfo::baseName() const \sa fileName(), suffix(), completeSuffix(), baseName() */ - QString QFileInfo::completeBaseName() const { Q_D(const QFileInfo); @@ -821,7 +796,6 @@ QString QFileInfo::completeBaseName() const \sa fileName(), suffix(), baseName(), completeBaseName() */ - QString QFileInfo::completeSuffix() const { Q_D(const QFileInfo); @@ -849,7 +823,6 @@ QString QFileInfo::completeSuffix() const \sa fileName(), completeSuffix(), baseName(), completeBaseName() */ - QString QFileInfo::suffix() const { Q_D(const QFileInfo); @@ -864,24 +837,23 @@ QString QFileInfo::suffix() const /*! - Returns the path of the object's parent directory as a QDir object. + Returns the path of the object's parent directory as a QDir object. - \bold{Note:} The QDir returned always corresponds to the object's - parent directory, even if the QFileInfo represents a directory. + \bold{Note:} The QDir returned always corresponds to the object's + parent directory, even if the QFileInfo represents a directory. - For each of the follwing, dir() returns a QDir for - \c{"~/examples/191697"}. + For each of the follwing, dir() returns a QDir for + \c{"~/examples/191697"}. - \snippet doc/src/snippets/fileinfo/main.cpp 0 + \snippet doc/src/snippets/fileinfo/main.cpp 0 - For each of the follwing, dir() returns a QDir for - \c{"."}. + For each of the follwing, dir() returns a QDir for + \c{"."}. - \snippet doc/src/snippets/fileinfo/main.cpp 1 + \snippet doc/src/snippets/fileinfo/main.cpp 1 - \sa absolutePath(), filePath(), fileName(), isRelative(), absoluteDir() + \sa absolutePath(), filePath(), fileName(), isRelative(), absoluteDir() */ - QDir QFileInfo::dir() const { // ### Qt5: Maybe rename this to parentDirectory(), considering what it actually do? @@ -893,7 +865,6 @@ QDir QFileInfo::dir() const \sa dir(), filePath(), fileName(), isRelative() */ - QDir QFileInfo::absoluteDir() const { return QDir(absolutePath()); @@ -917,7 +888,6 @@ QDir QFileInfo::dir(bool absPath) const \sa isWritable(), isExecutable(), permission() */ - bool QFileInfo::isReadable() const { Q_D(const QFileInfo); @@ -931,7 +901,6 @@ bool QFileInfo::isReadable() const \sa isReadable(), isExecutable(), permission() */ - bool QFileInfo::isWritable() const { Q_D(const QFileInfo); @@ -945,7 +914,6 @@ bool QFileInfo::isWritable() const \sa isReadable(), isWritable(), permission() */ - bool QFileInfo::isExecutable() const { Q_D(const QFileInfo); @@ -975,7 +943,6 @@ bool QFileInfo::isHidden() const \sa isDir(), isSymLink(), isBundle() */ - bool QFileInfo::isFile() const { Q_D(const QFileInfo); @@ -990,7 +957,6 @@ bool QFileInfo::isFile() const \sa isFile(), isSymLink(), isBundle() */ - bool QFileInfo::isDir() const { Q_D(const QFileInfo); @@ -1007,7 +973,6 @@ bool QFileInfo::isDir() const \sa isDir(), isSymLink(), isFile() */ - bool QFileInfo::isBundle() const { Q_D(const QFileInfo); @@ -1033,7 +998,6 @@ bool QFileInfo::isBundle() const \sa isFile(), isDir(), symLinkTarget() */ - bool QFileInfo::isSymLink() const { Q_D(const QFileInfo); @@ -1043,11 +1007,10 @@ bool QFileInfo::isSymLink() const } /*! - Returns true if the object points to a directory or to a symbolic - link to a directory, and that directory is the root directory; otherwise - returns false. + Returns true if the object points to a directory or to a symbolic + link to a directory, and that directory is the root directory; otherwise + returns false. */ - bool QFileInfo::isRoot() const { Q_D(const QFileInfo); @@ -1094,7 +1057,6 @@ QString QFileInfo::readLink() const \sa ownerId(), group(), groupId() */ - QString QFileInfo::owner() const { Q_D(const QFileInfo); @@ -1111,7 +1073,6 @@ QString QFileInfo::owner() const \sa owner(), group(), groupId() */ - uint QFileInfo::ownerId() const { Q_D(const QFileInfo); @@ -1130,7 +1091,6 @@ uint QFileInfo::ownerId() const \sa groupId(), owner(), ownerId() */ - QString QFileInfo::group() const { Q_D(const QFileInfo); @@ -1147,7 +1107,6 @@ QString QFileInfo::group() const \sa group(), owner(), ownerId() */ - uint QFileInfo::groupId() const { Q_D(const QFileInfo); @@ -1169,7 +1128,6 @@ uint QFileInfo::groupId() const \sa isReadable(), isWritable(), isExecutable() */ - bool QFileInfo::permission(QFile::Permissions permissions) const { Q_D(const QFileInfo); @@ -1182,7 +1140,6 @@ bool QFileInfo::permission(QFile::Permissions permissions) const Returns the complete OR-ed together combination of QFile::Permissions for the file. */ - QFile::Permissions QFileInfo::permissions() const { Q_D(const QFileInfo); @@ -1198,7 +1155,6 @@ QFile::Permissions QFileInfo::permissions() const \sa exists() */ - qint64 QFileInfo::size() const { Q_D(const QFileInfo); @@ -1224,7 +1180,6 @@ qint64 QFileInfo::size() const \sa lastModified() lastRead() */ - QDateTime QFileInfo::created() const { Q_D(const QFileInfo); @@ -1238,7 +1193,6 @@ QDateTime QFileInfo::created() const \sa created() lastRead() */ - QDateTime QFileInfo::lastModified() const { Q_D(const QFileInfo); @@ -1255,7 +1209,6 @@ QDateTime QFileInfo::lastModified() const \sa created() lastModified() */ - QDateTime QFileInfo::lastRead() const { Q_D(const QFileInfo); @@ -1267,7 +1220,6 @@ QDateTime QFileInfo::lastRead() const /*! \internal Detaches all internal data. */ - void QFileInfo::detach() { Q_D(QFileInfo); @@ -1279,7 +1231,6 @@ void QFileInfo::detach() \sa setCaching(), refresh() */ - bool QFileInfo::caching() const { Q_D(const QFileInfo); @@ -1298,7 +1249,6 @@ bool QFileInfo::caching() const \sa refresh(), caching() */ - void QFileInfo::setCaching(bool enable) { Q_D(QFileInfo); -- cgit v0.12 From 8de4f6f16ec2b5b3e92e25aafd2649f076c0b31b Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 26 Jan 2010 14:50:18 +0100 Subject: Remove test binary left behind --- tests/auto/selftests/xunit/tst_xunit | Bin 11624 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100755 tests/auto/selftests/xunit/tst_xunit diff --git a/tests/auto/selftests/xunit/tst_xunit b/tests/auto/selftests/xunit/tst_xunit deleted file mode 100755 index 31d03a8..0000000 Binary files a/tests/auto/selftests/xunit/tst_xunit and /dev/null differ -- cgit v0.12 From 7461ed5227e3002c4a6f74d458aa0255b7c1217d Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 26 Jan 2010 17:32:25 +0100 Subject: Optimise QStringList::join by pre-allocating the final size. This avoids a number of reallocations due to appending. This patch was contributed to us. Task-number: QTBUG-3242 Reviewed-by: Thiago Macieira --- src/corelib/tools/qstringlist.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/corelib/tools/qstringlist.cpp b/src/corelib/tools/qstringlist.cpp index 4b0f488..e9bdf57 100644 --- a/src/corelib/tools/qstringlist.cpp +++ b/src/corelib/tools/qstringlist.cpp @@ -404,7 +404,17 @@ void QtPrivate::QStringList_replaceInStrings(QStringList *that, const QRegExp &r */ QString QtPrivate::QStringList_join(const QStringList *that, const QString &sep) { + int totalLength = 0; + const int size = that->size(); + + for (int i = 0; i < size; ++i) + totalLength += that->at(i).size(); + + if(size > 0) + totalLength += sep.size() * (size - 1); + QString res; + res.reserve(totalLength); for (int i = 0; i < that->size(); ++i) { if (i) res += sep; -- cgit v0.12 From abeeac820a1da1e1d32768904fa70e048a836c3f Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 26 Jan 2010 14:42:05 +0100 Subject: Make indexOfMethod not crash when going through a metaobject with methodCount == 0. Reviewed-by: Bradley T. Hughes --- src/corelib/kernel/qmetaobject.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp index d391893..be1b2ae 100644 --- a/src/corelib/kernel/qmetaobject.cpp +++ b/src/corelib/kernel/qmetaobject.cpp @@ -492,10 +492,14 @@ static inline int indexOfMethodRelative(const QMetaObject **baseObject, const char *method, bool normalizeStringData) { - while (*baseObject) { + const QMetaObject *m; + for (m = *baseObject; m; m = *baseObject = m->d.superdata) { const QMetaObject *const m = *baseObject; int i = (MethodType == MethodSignal && priv(m->d.data)->revision >= 4) ? (priv(m->d.data)->signalCount - 1) : (priv(m->d.data)->methodCount - 1); + if (i < 0) + continue; + const int end = (MethodType == MethodSlot && priv(m->d.data)->revision >= 4) ? (priv(m->d.data)->signalCount) : 0; if (!normalizeStringData) { @@ -513,7 +517,6 @@ static inline int indexOfMethodRelative(const QMetaObject **baseObject, return i; } } - *baseObject = m->d.superdata; } return -1; } -- cgit v0.12 From 97f7c9afb295140a7d979203f41d91082ee73cd9 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 26 Jan 2010 15:40:55 +0100 Subject: Fix crash handler regression introduced by c7739f7dd. The crash handler is removed when the FatalSignalHandler object goes out of scope, which it did right inside that if. Reviewed-By: Harald Fernengel --- src/testlib/qtestcase.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index 98e9787..40daecb 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -1671,8 +1671,9 @@ int QTest::qExec(QObject *testObject, int argc, char **argv) #endif { #if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) + QScopedPointer handler; if (!noCrashHandler) - FatalSignalHandler handler; + handler.reset(new FatalSignalHandler); #endif qInvokeTestMethods(testObject); } -- cgit v0.12 From b88141c7505e10ffaa25cc20b444da8e2cc6d9c7 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 26 Jan 2010 15:30:06 +0100 Subject: BenchLib: update the result format and self-test. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since BenchLib now uses floating point for its calculations, we should format both the value per-iteration and the total the same way. Otherwise, it would output something like "2e+08" for the total. Reviewed-by: Morten Sørvig --- src/testlib/qplaintestlogger.cpp | 3 ++- tests/auto/selftests/expected_benchlibcallgrind.txt | 2 +- tests/auto/selftests/tst_selftests.cpp | 13 ++++++++----- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/testlib/qplaintestlogger.cpp b/src/testlib/qplaintestlogger.cpp index e244690..46431a8 100644 --- a/src/testlib/qplaintestlogger.cpp +++ b/src/testlib/qplaintestlogger.cpp @@ -362,9 +362,10 @@ namespace QTest { char buf3[1024]; Q_ASSERT(result.iterations > 0); + formatResult(resultBuffer, 100, result.value, countSignificantDigits(result.value)); QTest::qt_snprintf( buf3, sizeof(buf3), " (total: %s, iterations: %d)", - QByteArray::number(result.value).constData(), // no 64-bit qt_snprintf support + resultBuffer, result.iterations); char buf[1024]; diff --git a/tests/auto/selftests/expected_benchlibcallgrind.txt b/tests/auto/selftests/expected_benchlibcallgrind.txt index caf2424..f172711 100644 --- a/tests/auto/selftests/expected_benchlibcallgrind.txt +++ b/tests/auto/selftests/expected_benchlibcallgrind.txt @@ -2,7 +2,7 @@ Config: Using QTest library 4.5.0, Qt 4.5.0 PASS : tst_BenchlibCallgrind::initTestCase() RESULT : tst_BenchlibCallgrind::twoHundredMillionInstructions(): - 200,000,000 instr. loads per iteration (total: 200000000, iterations: 1) + 200,000,000 instruction reads per iteration (total: 200000000, iterations: 1) PASS : tst_BenchlibCallgrind::twoHundredMillionInstructions() PASS : tst_BenchlibCallgrind::cleanupTestCase() Totals: 3 passed, 0 failed, 0 skipped diff --git a/tests/auto/selftests/tst_selftests.cpp b/tests/auto/selftests/tst_selftests.cpp index 89ece0f..6608439 100644 --- a/tests/auto/selftests/tst_selftests.cpp +++ b/tests/auto/selftests/tst_selftests.cpp @@ -97,7 +97,7 @@ inline bool qCompare if (r1.unit == "msec") { variance = 0.1; } - else if (r1.unit == "instr. loads") { + else if (r1.unit == "instruction reads") { variance = 0.001; } else if (r1.unit == "ticks") { @@ -434,7 +434,7 @@ BenchmarkResult BenchmarkResult::parse(QString const& line, QString* error) /* This code avoids using a QRegExp because QRegExp might be broken. */ - /* Sample format: 4,000 msec per iteration (total: 4000, iterations: 1) */ + /* Sample format: 4,000 msec per iteration (total: 4,000, iterations: 1) */ QString sFirstNumber; while (!remaining.isEmpty() && !remaining.at(0).isSpace()) { @@ -468,7 +468,7 @@ BenchmarkResult BenchmarkResult::parse(QString const& line, QString* error) remaining = remaining.mid(sizeof(periterbit)-1); - /* Remaining: 4000, iterations: 1) */ + /* Remaining: 4,000, iterations: 1) */ static const char itersbit[] = ", iterations: "; QString sTotal; while (!remaining.startsWith(itersbit) && !remaining.isEmpty()) { @@ -482,9 +482,12 @@ BenchmarkResult BenchmarkResult::parse(QString const& line, QString* error) remaining = remaining.mid(sizeof(itersbit)-1); - qint64 total = sTotal.toLongLong(&ok); + /* 4,000 -> 4000 */ + sTotal.remove(','); + + double total = sTotal.toDouble(&ok); if (!ok) { - if (error) *error = sTotal + " (total) is not a valid integer"; + if (error) *error = sTotal + " (total) is not a valid number"; return out; } -- cgit v0.12 From 2877e3510db0cceeb4483b032fcc8f3bd61d28d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Wed, 27 Jan 2010 18:15:06 +0100 Subject: Fix regressions introduced in 3a5eb87965b60a3e249a16dc48cb06f4759dfb1b Caching of LinkType and BundleType is independent of other file flags. --- src/corelib/io/qfileinfo.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp index 21ff708..625098e 100644 --- a/src/corelib/io/qfileinfo.cpp +++ b/src/corelib/io/qfileinfo.cpp @@ -170,19 +170,19 @@ uint QFileInfoPrivate::getFileFlags(QAbstractFileEngine::FileFlags request) cons req &= (~QAbstractFileEngine::BundleType); cachedFlags |= CachedFileFlags; + } - if (request & QAbstractFileEngine::LinkType) { - if (!data->getCachedFlag(CachedLinkTypeFlag)) { - req |= QAbstractFileEngine::LinkType; - cachedFlags |= CachedLinkTypeFlag; - } + if (request & QAbstractFileEngine::LinkType) { + if (!data->getCachedFlag(CachedLinkTypeFlag)) { + req |= QAbstractFileEngine::LinkType; + cachedFlags |= CachedLinkTypeFlag; } + } - if (request & QAbstractFileEngine::BundleType) { - if (!data->getCachedFlag(CachedBundleTypeFlag)) { - req |= QAbstractFileEngine::BundleType; - cachedFlags |= CachedBundleTypeFlag; - } + if (request & QAbstractFileEngine::BundleType) { + if (!data->getCachedFlag(CachedBundleTypeFlag)) { + req |= QAbstractFileEngine::BundleType; + cachedFlags |= CachedBundleTypeFlag; } } } -- cgit v0.12 From 21e0423a5c9ecd9da8e141dcfba25e60b55f7fe5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Wed, 27 Jan 2010 20:26:26 +0100 Subject: Fix QDirIterator auto test The test depended on being run inside the source directory, because of a dummy file hierarchy present there. With these changes the needed hierarchy is generated on the fly and cleaned up at the end of the test. Also removed garbage at the end of tst_QDirIterator::stopLinkLoop. Cleanup is done in test destructor. --- tests/auto/qdiriterator/entrylist/directory/dummy | 0 tests/auto/qdiriterator/entrylist/file | 0 tests/auto/qdiriterator/foo/bar/readme.txt | 0 .../qdiriterator/recursiveDirs/dir1/aPage.html | 8 -- .../qdiriterator/recursiveDirs/dir1/textFileB.txt | 1 - .../auto/qdiriterator/recursiveDirs/textFileA.txt | 1 - tests/auto/qdiriterator/tst_qdiriterator.cpp | 129 ++++++++++++--------- 7 files changed, 76 insertions(+), 63 deletions(-) delete mode 100644 tests/auto/qdiriterator/entrylist/directory/dummy delete mode 100644 tests/auto/qdiriterator/entrylist/file delete mode 100644 tests/auto/qdiriterator/foo/bar/readme.txt delete mode 100644 tests/auto/qdiriterator/recursiveDirs/dir1/aPage.html delete mode 100644 tests/auto/qdiriterator/recursiveDirs/dir1/textFileB.txt delete mode 100644 tests/auto/qdiriterator/recursiveDirs/textFileA.txt diff --git a/tests/auto/qdiriterator/entrylist/directory/dummy b/tests/auto/qdiriterator/entrylist/directory/dummy deleted file mode 100644 index e69de29..0000000 diff --git a/tests/auto/qdiriterator/entrylist/file b/tests/auto/qdiriterator/entrylist/file deleted file mode 100644 index e69de29..0000000 diff --git a/tests/auto/qdiriterator/foo/bar/readme.txt b/tests/auto/qdiriterator/foo/bar/readme.txt deleted file mode 100644 index e69de29..0000000 diff --git a/tests/auto/qdiriterator/recursiveDirs/dir1/aPage.html b/tests/auto/qdiriterator/recursiveDirs/dir1/aPage.html deleted file mode 100644 index 51a2261..0000000 --- a/tests/auto/qdiriterator/recursiveDirs/dir1/aPage.html +++ /dev/null @@ -1,8 +0,0 @@ - - - A title - - -

Some text

- - diff --git a/tests/auto/qdiriterator/recursiveDirs/dir1/textFileB.txt b/tests/auto/qdiriterator/recursiveDirs/dir1/textFileB.txt deleted file mode 100644 index 5b1dd02..0000000 --- a/tests/auto/qdiriterator/recursiveDirs/dir1/textFileB.txt +++ /dev/null @@ -1 +0,0 @@ -Some Text diff --git a/tests/auto/qdiriterator/recursiveDirs/textFileA.txt b/tests/auto/qdiriterator/recursiveDirs/textFileA.txt deleted file mode 100644 index 5b1dd02..0000000 --- a/tests/auto/qdiriterator/recursiveDirs/textFileA.txt +++ /dev/null @@ -1 +0,0 @@ -Some Text diff --git a/tests/auto/qdiriterator/tst_qdiriterator.cpp b/tests/auto/qdiriterator/tst_qdiriterator.cpp index 6cdd1f7..f6fce32 100644 --- a/tests/auto/qdiriterator/tst_qdiriterator.cpp +++ b/tests/auto/qdiriterator/tst_qdiriterator.cpp @@ -71,6 +71,39 @@ public: tst_QDirIterator(); virtual ~tst_QDirIterator(); +private: // convenience functions + QStringList createdDirectories; + QStringList createdFiles; + + QDir currentDir; + bool createDirectory(const QString &dirName) + { + if (currentDir.mkdir(dirName)) { + createdDirectories.prepend(dirName); + return true; + } + return false; + } + + bool createFile(const QString &fileName) + { + QFile file(fileName); + if (file.open(QIODevice::WriteOnly)) { + createdFiles << fileName; + return true; + } + return false; + } + + bool createLink(const QString &destination, const QString &linkName) + { + if (QFile::link(destination, linkName)) { + createdFiles << linkName; + return true; + } + return false; + } + private slots: void iterateRelativeDirectory_data(); void iterateRelativeDirectory(); @@ -96,41 +129,47 @@ tst_QDirIterator::tst_QDirIterator() QFile::remove("entrylist/directory/entrylist3.lnk"); QFile::remove("entrylist/directory/entrylist4.lnk"); + createDirectory("entrylist"); + createDirectory("entrylist/directory"); + createFile("entrylist/file"); + createFile("entrylist/writable"); + createFile("entrylist/directory/dummy"); + + createDirectory("recursiveDirs"); + createDirectory("recursiveDirs/dir1"); + createFile("recursiveDirs/textFileA.txt"); + createFile("recursiveDirs/dir1/aPage.html"); + createFile("recursiveDirs/dir1/textFileB.txt"); + + createDirectory("foo"); + createDirectory("foo/bar"); + createFile("foo/bar/readme.txt"); + #ifndef Q_NO_SYMLINKS # if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) // ### Sadly, this is a platform difference right now. - QFile::link("entrylist/file", "entrylist/linktofile.lnk"); + createLink("entrylist/file", "entrylist/linktofile.lnk"); # ifndef Q_NO_SYMLINKS_TO_DIRS - QFile::link("entrylist/directory", "entrylist/linktodirectory.lnk"); + createLink("entrylist/directory", "entrylist/linktodirectory.lnk"); # endif - QFile::link("entrylist/nothing", "entrylist/brokenlink.lnk"); + createLink("entrylist/nothing", "entrylist/brokenlink.lnk"); # else - QFile::link("file", "entrylist/linktofile.lnk"); + createLink("file", "entrylist/linktofile.lnk"); # ifndef Q_NO_SYMLINKS_TO_DIRS - QFile::link("directory", "entrylist/linktodirectory.lnk"); + createLink("directory", "entrylist/linktodirectory.lnk"); # endif - QFile::link("nothing", "entrylist/brokenlink.lnk"); + createLink("nothing", "entrylist/brokenlink.lnk"); # endif #endif - QFile("entrylist/writable").open(QIODevice::ReadWrite); } tst_QDirIterator::~tst_QDirIterator() { - QFile::remove("entrylist/directory"); - QFile::remove("entrylist/linktofile.lnk"); - QFile::remove("entrylist/linktodirectory.lnk"); - QFile::remove("entrylist/brokenlink.lnk"); - QFile::remove("entrylist/brokenlink"); - QFile::remove("entrylist/writable"); - QFile::remove("entrylist/entrylist1.lnk"); - QFile::remove("entrylist/entrylist2.lnk"); - QFile::remove("entrylist/entrylist3.lnk"); - QFile::remove("entrylist/entrylist4.lnk"); - QFile::remove("entrylist/directory/entrylist1.lnk"); - QFile::remove("entrylist/directory/entrylist2.lnk"); - QFile::remove("entrylist/directory/entrylist3.lnk"); - QFile::remove("entrylist/directory/entrylist4.lnk"); + Q_FOREACH(QString fileName, createdFiles) + QFile::remove(fileName); + + Q_FOREACH(QString dirName, createdDirectories) + currentDir.rmdir(dirName); } void tst_QDirIterator::iterateRelativeDirectory_data() @@ -298,23 +337,23 @@ void tst_QDirIterator::stopLinkLoop() { #ifdef Q_OS_WIN // ### Sadly, this is a platform difference right now. - QFile::link(QDir::currentPath() + QLatin1String("/entrylist"), "entrylist/entrylist1.lnk"); - QFile::link("entrylist/.", "entrylist/entrylist2.lnk"); - QFile::link("entrylist/../entrylist/.", "entrylist/entrylist3.lnk"); - QFile::link("entrylist/..", "entrylist/entrylist4.lnk"); - QFile::link(QDir::currentPath() + QLatin1String("/entrylist"), "entrylist/directory/entrylist1.lnk"); - QFile::link("entrylist/.", "entrylist/directory/entrylist2.lnk"); - QFile::link("entrylist/../directory/.", "entrylist/directory/entrylist3.lnk"); - QFile::link("entrylist/..", "entrylist/directory/entrylist4.lnk"); + createLink(QDir::currentPath() + QLatin1String("/entrylist"), "entrylist/entrylist1.lnk"); + createLink("entrylist/.", "entrylist/entrylist2.lnk"); + createLink("entrylist/../entrylist/.", "entrylist/entrylist3.lnk"); + createLink("entrylist/..", "entrylist/entrylist4.lnk"); + createLink(QDir::currentPath() + QLatin1String("/entrylist"), "entrylist/directory/entrylist1.lnk"); + createLink("entrylist/.", "entrylist/directory/entrylist2.lnk"); + createLink("entrylist/../directory/.", "entrylist/directory/entrylist3.lnk"); + createLink("entrylist/..", "entrylist/directory/entrylist4.lnk"); #else - QFile::link(QDir::currentPath() + QLatin1String("/entrylist"), "entrylist/entrylist1.lnk"); - QFile::link(".", "entrylist/entrylist2.lnk"); - QFile::link("../entrylist/.", "entrylist/entrylist3.lnk"); - QFile::link("..", "entrylist/entrylist4.lnk"); - QFile::link(QDir::currentPath() + QLatin1String("/entrylist"), "entrylist/directory/entrylist1.lnk"); - QFile::link(".", "entrylist/directory/entrylist2.lnk"); - QFile::link("../directory/.", "entrylist/directory/entrylist3.lnk"); - QFile::link("..", "entrylist/directory/entrylist4.lnk"); + createLink(QDir::currentPath() + QLatin1String("/entrylist"), "entrylist/entrylist1.lnk"); + createLink(".", "entrylist/entrylist2.lnk"); + createLink("../entrylist/.", "entrylist/entrylist3.lnk"); + createLink("..", "entrylist/entrylist4.lnk"); + createLink(QDir::currentPath() + QLatin1String("/entrylist"), "entrylist/directory/entrylist1.lnk"); + createLink(".", "entrylist/directory/entrylist2.lnk"); + createLink("../directory/.", "entrylist/directory/entrylist3.lnk"); + createLink("..", "entrylist/directory/entrylist4.lnk"); #endif QDirIterator it(QLatin1String("entrylist"), QDirIterator::Subdirectories | QDirIterator::FollowSymlinks); @@ -325,22 +364,6 @@ void tst_QDirIterator::stopLinkLoop() QVERIFY(max); // The goal of this test is only to ensure that the test above don't malfunction - -#ifdef Q_OS_WIN - // ### Sadly, this is a platform difference right now. - QFile::link(QDir::currentPath() + QLatin1String("/entrylist"), "entrylist/entrylist1.lnk"); - QFile::link("../../entrylist/.", "entrylist/entrylist2.lnk"); - QFile::link("entrylist/..", "entrylist/entrylist3.lnk"); -#else - QFile::remove("entrylist/entrylist1.lnk"); - QFile::remove("entrylist/entrylist2.lnk"); - QFile::remove("entrylist/entrylist3.lnk"); - QFile::remove("entrylist/entrylist4.lnk"); - QFile::remove("entrylist/directory/entrylist1.lnk"); - QFile::remove("entrylist/directory/entrylist2.lnk"); - QFile::remove("entrylist/directory/entrylist3.lnk"); - QFile::remove("entrylist/directory/entrylist4.lnk"); -#endif } class EngineWithNoIterator : public QFSFileEngine -- cgit v0.12 From e60ea3cef1dec60b0f00ddc8fa48ed639ea06ddc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Thu, 28 Jan 2010 11:01:57 +0100 Subject: Fix breakage introduced in 21e0423a5c9ecd9da8e141dcfba25e60b55f7fe5 Turns out two of the files removed were still required by the resource compiler. --- tests/auto/qdiriterator/entrylist/directory/dummy | 0 tests/auto/qdiriterator/entrylist/file | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 tests/auto/qdiriterator/entrylist/directory/dummy create mode 100644 tests/auto/qdiriterator/entrylist/file diff --git a/tests/auto/qdiriterator/entrylist/directory/dummy b/tests/auto/qdiriterator/entrylist/directory/dummy new file mode 100644 index 0000000..e69de29 diff --git a/tests/auto/qdiriterator/entrylist/file b/tests/auto/qdiriterator/entrylist/file new file mode 100644 index 0000000..e69de29 -- cgit v0.12 From 5ed327e29906717d3b95b910e147de6314512a61 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Thu, 28 Jan 2010 10:40:41 +0100 Subject: Cocoa: implement usage of override cursors This have never worked in the Cocoa port, it seems. This patch gives it a try. Reviewed-by: msorvig --- src/gui/kernel/qapplication_mac.mm | 38 ++++++++++++++++++++++++++++++++-- src/gui/kernel/qapplication_p.h | 3 +++ src/gui/kernel/qeventdispatcher_mac.mm | 2 +- src/gui/kernel/qwidget_mac.mm | 3 +++ 4 files changed, 43 insertions(+), 3 deletions(-) diff --git a/src/gui/kernel/qapplication_mac.mm b/src/gui/kernel/qapplication_mac.mm index e72194e..961a3f6 100644 --- a/src/gui/kernel/qapplication_mac.mm +++ b/src/gui/kernel/qapplication_mac.mm @@ -1337,12 +1337,39 @@ void QApplication::setMainWidget(QWidget *mainWidget) /***************************************************************************** QApplication cursor stack *****************************************************************************/ +#ifdef QT_MAC_USE_COCOA +void QApplicationPrivate::disableUsageOfCursorRects(bool disable) +{ + // In Cocoa there are two competing ways of setting the cursor; either + // by using cursor rects (see qcocoaview_mac.mm), or by pushing/popping + // the cursor manually. When we use override cursors, it makes most sense + // to use the latter. But then we need to tell cocoa to stop using the + // first approach so it doesn't change the cursor back when hovering over + // a cursor rect: + QWidgetList topLevels = qApp->topLevelWidgets(); + for (int i=0; ioverrideCursor()) + [static_cast(qt_mac_nsCursorForQCursor(*override)) set]; +} +#endif + void QApplication::setOverrideCursor(const QCursor &cursor) { qApp->d_func()->cursor_list.prepend(cursor); #ifdef QT_MAC_USE_COCOA QMacCocoaAutoReleasePool pool; + if (qApp->d_func()->cursor_list.size() == 1) + qApp->d_func()->disableUsageOfCursorRects(true); [static_cast(qt_mac_nsCursorForQCursor(cursor)) push]; #else if (qApp && qApp->activeWindow()) @@ -1359,6 +1386,8 @@ void QApplication::restoreOverrideCursor() #ifdef QT_MAC_USE_COCOA QMacCocoaAutoReleasePool pool; [NSCursor pop]; + if (qApp->d_func()->cursor_list.isEmpty()) + qApp->d_func()->disableUsageOfCursorRects(false); #else if (qApp && qApp->activeWindow()) { const QCursor def(Qt::ArrowCursor); @@ -2432,6 +2461,12 @@ QApplicationPrivate::globalEventProcessor(EventHandlerCallRef er, EventRef event } #ifdef QT_MAC_USE_COCOA +void QApplicationPrivate::qt_initAfterNSAppStarted() +{ + setupAppleEvents(); + updateOverrideCursor(); +} + void QApplicationPrivate::setupAppleEvents() { // This function is called from the event dispatcher when NSApplication has @@ -2444,7 +2479,6 @@ void QApplicationPrivate::setupAppleEvents() forEventClass:kCoreEventClass andEventID:kAEQuitApplication]; [eventManager setEventHandler:newDelegate andSelector:@selector(getUrl:withReplyEvent:) forEventClass:kInternetEventClass andEventID:kAEGetURL]; - } #endif @@ -2995,7 +3029,7 @@ void onApplicationWindowChangedActivation(QWidget *widget, bool activated) } QMenuBar::macUpdateMenuBar(); - + QApplicationPrivate::updateOverrideCursor(); #else Q_UNUSED(widget); Q_UNUSED(activated); diff --git a/src/gui/kernel/qapplication_p.h b/src/gui/kernel/qapplication_p.h index a796048..59565d4 100644 --- a/src/gui/kernel/qapplication_p.h +++ b/src/gui/kernel/qapplication_p.h @@ -458,7 +458,10 @@ public: static OSStatus globalAppleEventProcessor(const AppleEvent *, AppleEvent *, long); static OSStatus tabletProximityCallback(EventHandlerCallRef, EventRef, void *); #ifdef QT_MAC_USE_COCOA + static void qt_initAfterNSAppStarted(); static void setupAppleEvents(); + static void updateOverrideCursor(); + static void disableUsageOfCursorRects(bool disable); #endif static bool qt_mac_apply_settings(); #endif diff --git a/src/gui/kernel/qeventdispatcher_mac.mm b/src/gui/kernel/qeventdispatcher_mac.mm index 84d37ae..2a1da41 100644 --- a/src/gui/kernel/qeventdispatcher_mac.mm +++ b/src/gui/kernel/qeventdispatcher_mac.mm @@ -1049,7 +1049,7 @@ void QEventDispatcherMacPrivate::firstLoopEntry(CFRunLoopObserverRef ref, Q_UNUSED(ref); Q_UNUSED(activity); #ifdef QT_MAC_USE_COCOA - QApplicationPrivate::setupAppleEvents(); + QApplicationPrivate::qt_initAfterNSAppStarted(); #endif processPostedEvents(static_cast(info), blockSendPostedEvents); } diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index 20c0cde..5b5ab40 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -2311,6 +2311,9 @@ void QWidgetPrivate::finishCreateWindow_sys_Cocoa(void * /*NSWindow * */ voidWin q->setAttribute(Qt::WA_WState_WindowOpacitySet, false); } + if (qApp->overrideCursor()) + [windowRef disableCursorRects]; + setWindowLevel(); macUpdateHideOnSuspend(); macUpdateOpaqueSizeGrip(); -- cgit v0.12 From 6f260fe99f742949bbfcfcf3eebc19486bd09a1e Mon Sep 17 00:00:00 2001 From: Fabien Freling Date: Thu, 28 Jan 2010 11:18:03 +0100 Subject: Add new QMetaObject test for signal lookup. --- tests/benchmarks/qmetaobject/main.cpp | 105 ++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) diff --git a/tests/benchmarks/qmetaobject/main.cpp b/tests/benchmarks/qmetaobject/main.cpp index c375a16..eef6020 100644 --- a/tests/benchmarks/qmetaobject/main.cpp +++ b/tests/benchmarks/qmetaobject/main.cpp @@ -42,6 +42,84 @@ #include #include +class LotsOfSignals : public QObject +{ + Q_OBJECT +public: + LotsOfSignals() {} + +signals: + void extraSignal1(); + void extraSignal2(); + void extraSignal3(); + void extraSignal4(); + void extraSignal5(); + void extraSignal6(); + void extraSignal7(); + void extraSignal8(); + void extraSignal9(); + void extraSignal10(); + void extraSignal12(); + void extraSignal13(); + void extraSignal14(); + void extraSignal15(); + void extraSignal16(); + void extraSignal17(); + void extraSignal18(); + void extraSignal19(); + void extraSignal20(); + void extraSignal21(); + void extraSignal22(); + void extraSignal23(); + void extraSignal24(); + void extraSignal25(); + void extraSignal26(); + void extraSignal27(); + void extraSignal28(); + void extraSignal29(); + void extraSignal30(); + void extraSignal31(); + void extraSignal32(); + void extraSignal33(); + void extraSignal34(); + void extraSignal35(); + void extraSignal36(); + void extraSignal37(); + void extraSignal38(); + void extraSignal39(); + void extraSignal40(); + void extraSignal41(); + void extraSignal42(); + void extraSignal43(); + void extraSignal44(); + void extraSignal45(); + void extraSignal46(); + void extraSignal47(); + void extraSignal48(); + void extraSignal49(); + void extraSignal50(); + void extraSignal51(); + void extraSignal52(); + void extraSignal53(); + void extraSignal54(); + void extraSignal55(); + void extraSignal56(); + void extraSignal57(); + void extraSignal58(); + void extraSignal59(); + void extraSignal60(); + void extraSignal61(); + void extraSignal62(); + void extraSignal63(); + void extraSignal64(); + void extraSignal65(); + void extraSignal66(); + void extraSignal67(); + void extraSignal68(); + void extraSignal69(); + void extraSignal70(); +}; + class tst_qmetaobject: public QObject { Q_OBJECT @@ -57,6 +135,9 @@ private slots: void indexOfSignal(); void indexOfSlot_data(); void indexOfSlot(); + + void unconnected_data(); + void unconnected(); }; void tst_qmetaobject::initTestCase() @@ -154,6 +235,30 @@ void tst_qmetaobject::indexOfSlot() } } +void tst_qmetaobject::unconnected_data() +{ + QTest::addColumn("signal_index"); + QTest::newRow("signal--9") << 9; + QTest::newRow("signal--32") << 32; + QTest::newRow("signal--33") << 33; + QTest::newRow("signal--64") << 64; + QTest::newRow("signal--65") << 65; + QTest::newRow("signal--70") << 70; +} + +void tst_qmetaobject::unconnected() +{ + LotsOfSignals *obj = new LotsOfSignals; + QFETCH(int, signal_index); + QVERIFY(obj->metaObject()->methodCount() == 73); + void *v; + QBENCHMARK { + //+1 because QObject has one slot + QMetaObject::metacall(obj, QMetaObject::InvokeMetaMethod, signal_index+1, &v); + } + delete obj; +} + QTEST_MAIN(tst_qmetaobject) #include "main.moc" -- cgit v0.12 From c58ac55bbe65866db85ba1338642c00fe5cc2a70 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Thu, 28 Jan 2010 15:38:55 +0100 Subject: Fix header labels on mac with rtl The removed code simply reduces the size of the rect when running with RightToLeft without compensating anywhere else. It seems to be a leftover from a previously removed piece of code. Reviewed-by: richard Task-number: QTBUG-6882 --- src/gui/styles/qmacstyle_mac.mm | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm index 083f730..2313ac5 100644 --- a/src/gui/styles/qmacstyle_mac.mm +++ b/src/gui/styles/qmacstyle_mac.mm @@ -4320,8 +4320,6 @@ QRect QMacStyle::subElementRect(SubElement sr, const QStyleOption *opt, rect.setY(0); rect.setHeight(widget->height()); } - if (opt->direction == Qt::RightToLeft) - rect.adjust(15, 0, -20, 0); } break; case SE_ProgressBarGroove: -- cgit v0.12 From f842ec12706b70f94ab5f634dc2aa025ba2cf3f2 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Fri, 29 Jan 2010 10:49:14 +0100 Subject: Carbon: crash problem in QWidgetPrivate::hide_sys The crash occurs because we at one point try to assign a widget that is marked as 'about to be deleted' to a QPointer, after clearguards has been called. The correct fix is to avoid such an assignment in the first place. Task-number: QTBUG-4227 Reviewed-by: Prasanth --- src/gui/kernel/qwidget_mac.mm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index 5b5ab40..b942bdd 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -3579,6 +3579,8 @@ void QWidgetPrivate::hide_sys() if (!QWidget::mouseGrabber()){ QWidget *enterWidget = QApplication::widgetAt(QCursor::pos()); + if (enterWidget->data->in_destructor) + enterWidget = 0; QApplicationPrivate::dispatchEnterLeave(enterWidget, qt_mouseover); qt_mouseover = enterWidget; } -- cgit v0.12 From ebf9c943b789bb4ce1e1222ed17cc37bd0b1f1fe Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Fri, 29 Jan 2010 11:47:02 +0100 Subject: Carbon: crash problem in QWidgetPrivate::hide_sys, v2 See change: f842ec12706. Needed some ekstra checks for the cocoa port as well. Task-number: QTBUG-4227 Reviewed-by: Prasanth --- src/gui/kernel/qcocoaview_mac.mm | 2 ++ src/gui/kernel/qwidget_mac.mm | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm index b4bb8bf..8c5d166 100644 --- a/src/gui/kernel/qcocoaview_mac.mm +++ b/src/gui/kernel/qcocoaview_mac.mm @@ -602,6 +602,8 @@ extern "C" { - (void)mouseEntered:(NSEvent *)event { + if (qwidgetprivate->data.in_destructor) + return; QEvent enterEvent(QEvent::Enter); NSPoint windowPoint = [event locationInWindow]; NSPoint globalPoint = [[event window] convertBaseToScreen:windowPoint]; diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index b942bdd..3ff46f5 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -3579,7 +3579,7 @@ void QWidgetPrivate::hide_sys() if (!QWidget::mouseGrabber()){ QWidget *enterWidget = QApplication::widgetAt(QCursor::pos()); - if (enterWidget->data->in_destructor) + if (enterWidget && enterWidget->data->in_destructor) enterWidget = 0; QApplicationPrivate::dispatchEnterLeave(enterWidget, qt_mouseover); qt_mouseover = enterWidget; -- cgit v0.12 From 0b7474c8ef9167bef92f8a09e8a818334822aa36 Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Fri, 29 Jan 2010 13:12:37 +0100 Subject: Fix QDir::operator[] documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Merge-request: 445 Reviewed-by: João Abecasis --- src/corelib/io/qdir.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp index dc7f17e..eb5f3de 100644 --- a/src/corelib/io/qdir.cpp +++ b/src/corelib/io/qdir.cpp @@ -1260,13 +1260,10 @@ uint QDir::count() const /*! Returns the file name at position \a pos in the list of file names. Equivalent to entryList().at(index). - - Returns an empty string if \a pos is out of range or if the - entryList() function failed. + \a pos must be a valid index position in the list (i.e., 0 <= pos < count()). \sa count(), entryList() */ - QString QDir::operator[](int pos) const { Q_D(const QDir); -- cgit v0.12 From 2964718224c0ed356511335742368d4fc421c6bd Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Fri, 29 Jan 2010 13:12:38 +0100 Subject: QDir::entry(Info)List(): really use cached data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test conditions for using cached file lists were wrong and preventing list reuse unless no filters or sorting flags were previously set. Merge-request: 445 Reviewed-by: João Abecasis --- src/corelib/io/qdir.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp index eb5f3de..6b79cae 100644 --- a/src/corelib/io/qdir.cpp +++ b/src/corelib/io/qdir.cpp @@ -1353,10 +1353,12 @@ QStringList QDir::entryList(const QStringList &nameFilters, Filters filters, #endif if (sort == NoSort) sort = d->data->sort; - if (filters == NoFilter && sort == NoSort && nameFilters == d->data->nameFilters) { + + if (filters == d->data->filters && sort == d->data->sort && nameFilters == d->data->nameFilters) { d->updateFileLists(); return d->data->files; } + QFileInfoList l; QDirIterator it(d->data->path, nameFilters, filters); while (it.hasNext()) { @@ -1398,10 +1400,12 @@ QFileInfoList QDir::entryInfoList(const QStringList &nameFilters, Filters filter #endif if (sort == NoSort) sort = d->data->sort; - if (filters == NoFilter && sort == NoSort && nameFilters == d->data->nameFilters) { + + if (filters == d->data->filters && sort == d->data->sort && nameFilters == d->data->nameFilters) { d->updateFileLists(); return d->data->fileInfos; } + QFileInfoList l; QDirIterator it(d->data->path, nameFilters, filters); while (it.hasNext()) { -- cgit v0.12 From c43400792b637c744ca840a4ecb339ffdb27c604 Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Fri, 29 Jan 2010 13:12:39 +0100 Subject: QDir::cleanPath: strip trailing slash for "/:/" on non-win platforms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Merge-request: 445 Reviewed-by: João Abecasis --- src/corelib/io/qdir.cpp | 9 ++++++--- tests/auto/qdir/tst_qdir.cpp | 7 +++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp index 6b79cae..f465e73 100644 --- a/src/corelib/io/qdir.cpp +++ b/src/corelib/io/qdir.cpp @@ -2193,9 +2193,12 @@ QString QDir::cleanPath(const QString &path) ret = QString(out, used); // Strip away last slash except for root directories - if (ret.endsWith(QLatin1Char('/')) - && !(ret.size() == 1 || (ret.size() == 3 && ret.at(1) == QLatin1Char(':')))) - ret = ret.left(ret.length() - 1); + if (ret.length() > 1 && ret.endsWith(QLatin1Char('/'))) { +#ifdef Q_OS_WIN + if (!(ret.length() == 3 && ret.at(1) == QLatin1Char(':'))) +#endif + ret.chop(1); + } return ret; } diff --git a/tests/auto/qdir/tst_qdir.cpp b/tests/auto/qdir/tst_qdir.cpp index c7f9b6b..1d909c9 100644 --- a/tests/auto/qdir/tst_qdir.cpp +++ b/tests/auto/qdir/tst_qdir.cpp @@ -982,6 +982,13 @@ tst_QDir::cleanPath_data() QTest::newRow("data7") << ".//file1.txt" << "file1.txt"; QTest::newRow("data8") << "/foo/bar/..//file1.txt" << "/foo/file1.txt"; QTest::newRow("data9") << "//" << "/"; +#if !defined(Q_OS_WINCE) +#if defined Q_OS_WIN + QTest::newRow("data10") << "c:\\" << "c:/"; +#else + QTest::newRow("data10") << "/:/" << "/:"; +#endif +#endif } -- cgit v0.12 From 57f72b0c2c2f717b267518da7f03dd08576c4df4 Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Fri, 29 Jan 2010 13:12:39 +0100 Subject: QDirPrivate::Data: remove needless clear()-s in constructors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Initialize members with default values in constructor, instead. Merge-request: 445 Reviewed-by: João Abecasis --- src/corelib/io/qdir.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp index f465e73..3a04920 100644 --- a/src/corelib/io/qdir.cpp +++ b/src/corelib/io/qdir.cpp @@ -120,12 +120,12 @@ private: struct Data { inline Data() - : ref(1), fileEngine(0) - { clear(); } + : ref(1), fileEngine(0), listsDirty(1) + {} inline Data(const Data ©) : ref(1), path(copy.path), nameFilters(copy.nameFilters), sort(copy.sort), - filters(copy.filters), fileEngine(0) - { clear(); } + filters(copy.filters), fileEngine(0), listsDirty(1) + {} inline ~Data() { delete fileEngine; } @@ -181,7 +181,6 @@ QDirPrivate::QDirPrivate(QDir *qq, const QDir *copy) : q_ptr(qq) data = copy->d_func()->data; } else { data = new QDirPrivate::Data; - data->clear(); } } -- cgit v0.12 From b915461519f1a4b7da8920203529e315eee39323 Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Fri, 29 Jan 2010 13:12:40 +0100 Subject: optimize QDir::cd() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We already create a file engine for testing if dir exists. We can also use it as source for current QDir. Merge-request: 445 Reviewed-by: João Abecasis --- src/corelib/io/qdir.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp index 3a04920..eb02e6c 100644 --- a/src/corelib/io/qdir.cpp +++ b/src/corelib/io/qdir.cpp @@ -929,14 +929,13 @@ bool QDir::cd(const QString &dirName) } } } - { - QFileInfo fi(newPath); - if (!(fi.exists() && fi.isDir())) - return false; - } - d->setPath(newPath); - refresh(); + QDir dir(*this); + dir.setPath(newPath); + if (!dir.exists()) + return false; + + *this = dir; return true; } -- cgit v0.12 From 9d713d7e73a88fe8328b55d2ab9af8c215dcb89d Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Fri, 29 Jan 2010 13:12:41 +0100 Subject: QDirPrivate::setPath: always initialize the file engine MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QDir::isRelativePath() would construct a temporary file engine just to check if we could reuse the existing one. This was also making assumptions about the inner workings of the engine, that might not be valid outside QFSFileEngine. Merge-request: 445 Reviewed-by: João Abecasis --- src/corelib/io/qdir.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp index eb02e6c..06ea95a 100644 --- a/src/corelib/io/qdir.cpp +++ b/src/corelib/io/qdir.cpp @@ -147,7 +147,6 @@ private: } *data; inline void setPath(const QString &p) { - detach(false); QString path = p; if ((path.endsWith(QLatin1Char('/')) || path.endsWith(QLatin1Char('\\'))) && path.length() > 1) { @@ -156,12 +155,9 @@ private: #endif path.truncate(path.length() - 1); } - if(!data->fileEngine || !QDir::isRelativePath(path)) - path = initFileEngine(path); - data->fileEngine->setFileName(path); + // set the path to be the qt friendly version so then we can operate on it using just / - data->path = data->fileEngine->fileName(QAbstractFileEngine::DefaultName); - data->clear(); + data->path = initFileEngine(path); } inline void reset() { detach(); @@ -318,12 +314,11 @@ inline void QDirPrivate::updateFileLists() const } } -QString QDirPrivate::initFileEngine(const QString &path) +inline QString QDirPrivate::initFileEngine(const QString &path) { detach(false); - delete data->fileEngine; - data->fileEngine = 0; data->clear(); + delete data->fileEngine; data->fileEngine = QAbstractFileEngine::create(path); return data->fileEngine->fileName(QAbstractFileEngine::DefaultName); } -- cgit v0.12 From 585ac6cf9da5896753d33090320ebcc9c97cdda5 Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Fri, 29 Jan 2010 13:12:42 +0100 Subject: QDir: clear internal file lists cache early MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the cache was invalidated (setPath, refresh, detach, etc.) then there is no sense to keep it any longer. Merge-request: 445 Reviewed-by: João Abecasis --- src/corelib/io/qdir.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp index 06ea95a..61f048a 100644 --- a/src/corelib/io/qdir.cpp +++ b/src/corelib/io/qdir.cpp @@ -131,6 +131,8 @@ private: inline void clear() { listsDirty = 1; + files.clear(); + fileInfos.clear(); } mutable QAtomicInt ref; @@ -269,10 +271,7 @@ bool QDirSortItemComparator::operator()(const QDirSortItem &n1, const QDirSortIt inline void QDirPrivate::sortFileList(QDir::SortFlags sort, QFileInfoList &l, QStringList *names, QFileInfoList *infos) const { - if(names) - names->clear(); - if(infos) - infos->clear(); + // names and infos are always empty lists or 0 here int n = l.size(); if(n > 0) { if (n == 1 || (sort & QDir::SortByMask) == QDir::Unsorted) { -- cgit v0.12 From 5d8e2a668d497e81c812328f045d73c7f24efc70 Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Fri, 29 Jan 2010 13:12:43 +0100 Subject: QDirPrivate: remove unused q_ptr and Q_DECLARE_PUBLIC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit update constructor signatures; both private and protected members became public. Merge-request: 445 Reviewed-by: João Abecasis --- src/corelib/io/qdir.cpp | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp index 61f048a..d7fb03b 100644 --- a/src/corelib/io/qdir.cpp +++ b/src/corelib/io/qdir.cpp @@ -83,12 +83,10 @@ static QString driveSpec(const QString &path) //************* QDirPrivate class QDirPrivate { - QDir *q_ptr; - Q_DECLARE_PUBLIC(QDir) - friend struct QScopedPointerDeleter; -protected: - QDirPrivate(QDir*, const QDir *copy=0); + +public: + QDirPrivate(const QDir *copy = 0); ~QDirPrivate(); QString initFileEngine(const QString &file); @@ -96,7 +94,6 @@ protected: void updateFileLists() const; void sortFileList(QDir::SortFlags, QFileInfoList &, QStringList *, QFileInfoList *) const; -private: #ifdef QT3_SUPPORT QChar filterSepChar; bool matchAllDirs; @@ -168,10 +165,9 @@ private: void detach(bool createFileEngine = true); }; -QDirPrivate::QDirPrivate(QDir *qq, const QDir *copy) : q_ptr(qq) +QDirPrivate::QDirPrivate(const QDir *copy) #ifdef QT3_SUPPORT - , filterSepChar(0) - , matchAllDirs(false) + : filterSepChar(0), matchAllDirs(false) #endif { if(copy) { @@ -187,7 +183,6 @@ QDirPrivate::~QDirPrivate() if (!data->ref.deref()) delete data; data = 0; - q_ptr = 0; } /* For sorting */ @@ -514,7 +509,7 @@ void QDirPrivate::detach(bool createFileEngine) \sa currentPath() */ -QDir::QDir(const QString &path) : d_ptr(new QDirPrivate(this)) +QDir::QDir(const QString &path) : d_ptr(new QDirPrivate) { Q_D(QDir); d->setPath(path.isEmpty() ? QString::fromLatin1(".") : path); @@ -543,7 +538,7 @@ QDir::QDir(const QString &path) : d_ptr(new QDirPrivate(this)) */ QDir::QDir(const QString &path, const QString &nameFilter, - SortFlags sort, Filters filters) : d_ptr(new QDirPrivate(this)) + SortFlags sort, Filters filters) : d_ptr(new QDirPrivate) { Q_D(QDir); d->setPath(path.isEmpty() ? QString::fromLatin1(".") : path); @@ -571,7 +566,7 @@ QDir::QDir(const QString &path, const QString &nameFilter, \sa operator=() */ -QDir::QDir(const QDir &dir) : d_ptr(new QDirPrivate(this, &dir)) +QDir::QDir(const QDir &dir) : d_ptr(new QDirPrivate(&dir)) { } -- cgit v0.12 From 6d2288d4b8d6ffe7eb7cef9a0677be2ad3f45341 Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Fri, 29 Jan 2010 13:12:43 +0100 Subject: code cleanup and styling fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * remove trailing whitespaces * tabs -> whitespaces * "if(" -> "if (" * "while(" -> "while (" * "for(" -> "for (" * "for (int i.*; i++)" -> "for (int i.*; ++i)" /* looks better ;) */ * minor doc fixes Merge-request: 445 Reviewed-by: João Abecasis --- src/corelib/io/qdir.cpp | 262 +++++++++++++++++++----------------------------- src/corelib/io/qdir.h | 5 +- 2 files changed, 108 insertions(+), 159 deletions(-) diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp index d7fb03b..0b6ad08 100644 --- a/src/corelib/io/qdir.cpp +++ b/src/corelib/io/qdir.cpp @@ -52,13 +52,13 @@ #include "qregexp.h" #include "qvector.h" #include "qalgorithms.h" +#include "qvarlengtharray.h" + #ifdef QT_BUILD_CORE_LIB -# include "qresource.h" +# include "qresource.h" +# include "private/qcoreglobaldata_p.h" #endif -#include "qvarlengtharray.h" - -#include "private/qcoreglobaldata_p.h" #include QT_BEGIN_NAMESPACE @@ -106,11 +106,11 @@ public: sep = QChar(QLatin1Char(' ')); return sep; } - static inline QStringList splitFilters(const QString &nameFilter, QChar sep=0) { - if(sep == 0) + static inline QStringList splitFilters(const QString &nameFilter, QChar sep = 0) { + if (sep == 0) sep = getFilterSepChar(nameFilter); QStringList ret = nameFilter.split(sep); - for(int i = 0; i < ret.count(); i++) + for (int i = 0; i < ret.count(); ++i) ret[i] = ret[i].trimmed(); return ret; } @@ -170,7 +170,7 @@ QDirPrivate::QDirPrivate(const QDir *copy) : filterSepChar(0), matchAllDirs(false) #endif { - if(copy) { + if (copy) { copy->d_func()->data->ref.ref(); data = copy->d_func()->data; } else { @@ -186,14 +186,16 @@ QDirPrivate::~QDirPrivate() } /* For sorting */ -struct QDirSortItem { +struct QDirSortItem +{ mutable QString filename_cache; mutable QString suffix_cache; QFileInfo item; }; -class QDirSortItemComparator { +class QDirSortItemComparator +{ int qt_cmp_si_sort_flags; public: QDirSortItemComparator(int flags) : qt_cmp_si_sort_flags(flags) {} @@ -232,7 +234,7 @@ bool QDirSortItemComparator::operator()(const QDirSortItem &n1, const QDirSortIt f2->suffix_cache = ic ? f2->item.suffix().toLower() : f2->item.suffix(); - r = qt_cmp_si_sort_flags & QDir::LocaleAware + r = qt_cmp_si_sort_flags & QDir::LocaleAware ? f1->suffix_cache.localeAwareCompare(f2->suffix_cache) : f1->suffix_cache.compare(f2->suffix_cache); } @@ -252,7 +254,7 @@ bool QDirSortItemComparator::operator()(const QDirSortItem &n1, const QDirSortIt f2->filename_cache = ic ? f2->item.fileName().toLower() : f2->item.fileName(); - r = qt_cmp_si_sort_flags & QDir::LocaleAware + r = qt_cmp_si_sort_flags & QDir::LocaleAware ? f1->filename_cache.localeAwareCompare(f2->filename_cache) : f1->filename_cache.compare(f2->filename_cache); } @@ -268,11 +270,11 @@ inline void QDirPrivate::sortFileList(QDir::SortFlags sort, QFileInfoList &l, { // names and infos are always empty lists or 0 here int n = l.size(); - if(n > 0) { + if (n > 0) { if (n == 1 || (sort & QDir::SortByMask) == QDir::Unsorted) { - if(infos) + if (infos) *infos = l; - if(names) { + if (names) { for (int i = 0; i < n; ++i) names->append(l.at(i).fileName()); } @@ -280,13 +282,13 @@ inline void QDirPrivate::sortFileList(QDir::SortFlags sort, QFileInfoList &l, QScopedArrayPointer si(new QDirSortItem[n]); for (int i = 0; i < n; ++i) si[i].item = l.at(i); - qSort(si.data(), si.data()+n, QDirSortItemComparator(sort)); + qSort(si.data(), si.data() + n, QDirSortItemComparator(sort)); // put them back in the list(s) - if(infos) { + if (infos) { for (int i = 0; i < n; ++i) infos->append(si[i].item); } - if(names) { + if (names) { for (int i = 0; i < n; ++i) names->append(si[i].item.fileName()); } @@ -296,7 +298,7 @@ inline void QDirPrivate::sortFileList(QDir::SortFlags sort, QFileInfoList &l, inline void QDirPrivate::updateFileLists() const { - if(data->listsDirty) { + if (data->listsDirty) { QFileInfoList l; QDirIterator it(data->path, data->nameFilters, data->filters); while (it.hasNext()) { @@ -508,7 +510,6 @@ void QDirPrivate::detach(bool createFileEngine) \sa currentPath() */ - QDir::QDir(const QString &path) : d_ptr(new QDirPrivate) { Q_D(QDir); @@ -536,7 +537,6 @@ QDir::QDir(const QString &path) : d_ptr(new QDirPrivate) \sa exists(), setPath(), setNameFilter(), setFilter(), setSorting() */ - QDir::QDir(const QString &path, const QString &nameFilter, SortFlags sort, Filters filters) : d_ptr(new QDirPrivate) { @@ -544,10 +544,10 @@ QDir::QDir(const QString &path, const QString &nameFilter, d->setPath(path.isEmpty() ? QString::fromLatin1(".") : path); d->data->nameFilters = QDir::nameFiltersFromString(nameFilter); bool empty = d->data->nameFilters.isEmpty(); - if(!empty) { + if (!empty) { empty = true; - for(int i = 0; i < d->data->nameFilters.size(); ++i) { - if(!d->data->nameFilters.at(i).isEmpty()) { + for (int i = 0; i < d->data->nameFilters.size(); ++i) { + if (!d->data->nameFilters.at(i).isEmpty()) { empty = false; break; } @@ -565,7 +565,6 @@ QDir::QDir(const QString &path, const QString &nameFilter, \sa operator=() */ - QDir::QDir(const QDir &dir) : d_ptr(new QDirPrivate(&dir)) { } @@ -574,7 +573,6 @@ QDir::QDir(const QDir &dir) : d_ptr(new QDirPrivate(&dir)) Destroys the QDir object frees up its resources. This has no effect on the underlying directory in the file system. */ - QDir::~QDir() { } @@ -595,7 +593,6 @@ QDir::~QDir() \sa path(), absolutePath(), exists(), cleanPath(), dirName(), absoluteFilePath(), isRelative(), makeAbsolute() */ - void QDir::setPath(const QString &path) { Q_D(QDir); @@ -612,7 +609,6 @@ void QDir::setPath(const QString &path) \sa setPath(), absolutePath(), exists(), cleanPath(), dirName(), absoluteFilePath(), toNativeSeparators(), makeAbsolute() */ - QString QDir::path() const { Q_D(const QDir); @@ -627,7 +623,6 @@ QString QDir::path() const \sa setPath(), canonicalPath(), exists(), cleanPath(), dirName(), absoluteFilePath() */ - QString QDir::absolutePath() const { Q_D(const QDir); @@ -637,7 +632,6 @@ QString QDir::absolutePath() const return cleanPath(ret); } - /*! Returns the canonical path, i.e. a path without symbolic links or redundant "." or ".." elements. @@ -654,12 +648,11 @@ QString QDir::absolutePath() const \sa path(), absolutePath(), exists(), cleanPath(), dirName(), absoluteFilePath() */ - QString QDir::canonicalPath() const { Q_D(const QDir); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return QLatin1String(""); return cleanPath(d->data->fileEngine->fileName(QAbstractFileEngine::CanonicalName)); } @@ -675,7 +668,6 @@ QString QDir::canonicalPath() const \sa path(), filePath(), absolutePath(), absoluteFilePath() */ - QString QDir::dirName() const { Q_D(const QDir); @@ -694,7 +686,6 @@ QString QDir::dirName() const \sa dirName() absoluteFilePath(), isRelative(), canonicalPath() */ - QString QDir::filePath(const QString &fileName) const { Q_D(const QDir); @@ -702,7 +693,7 @@ QString QDir::filePath(const QString &fileName) const return QString(fileName); QString ret = d->data->path; - if(!fileName.isEmpty()) { + if (!fileName.isEmpty()) { if (!ret.isEmpty() && ret[(int)ret.length()-1] != QLatin1Char('/') && fileName[0] != QLatin1Char('/')) ret += QLatin1Char('/'); ret += fileName; @@ -718,13 +709,12 @@ QString QDir::filePath(const QString &fileName) const \sa relativeFilePath() filePath() canonicalPath() */ - QString QDir::absoluteFilePath(const QString &fileName) const { Q_D(const QDir); if (isAbsolutePath(fileName)) return fileName; - if(!d->data->fileEngine) + if (!d->data->fileEngine) return fileName; QString ret; @@ -732,7 +722,7 @@ QString QDir::absoluteFilePath(const QString &fileName) const if (isRelativePath(d->data->path)) //get pwd ret = QFSFileEngine::currentPath(fileName); #endif - if(!d->data->path.isEmpty() && d->data->path != QLatin1String(".")) { + if (!d->data->path.isEmpty() && d->data->path != QLatin1String(".")) { if (!ret.isEmpty() && !ret.endsWith(QLatin1Char('/'))) ret += QLatin1Char('/'); ret += d->data->path; @@ -752,7 +742,6 @@ QString QDir::absoluteFilePath(const QString &fileName) const \sa absoluteFilePath() filePath() canonicalPath() */ - QString QDir::relativeFilePath(const QString &fileName) const { QString dir = absolutePath(); @@ -839,7 +828,7 @@ QString QDir::toNativeSeparators(const QString &pathName) { QString n(pathName); #if defined(Q_FS_FAT) || defined(Q_OS_OS2EMX) || defined(Q_OS_SYMBIAN) - for (int i=0; i<(int)n.length(); i++) { + for (int i = 0; i < (int)n.length(); ++i) { if (n[i] == QLatin1Char('/')) n[i] = QLatin1Char('\\'); } @@ -863,7 +852,7 @@ QString QDir::fromNativeSeparators(const QString &pathName) { QString n(pathName); #if defined(Q_FS_FAT) || defined(Q_OS_OS2EMX) || defined(Q_OS_SYMBIAN) - for (int i=0; i<(int)n.length(); i++) { + for (int i = 0; i < (int)n.length(); ++i) { if (n[i] == QLatin1Char('\\')) n[i] = QLatin1Char('/'); } @@ -882,7 +871,6 @@ QString QDir::fromNativeSeparators(const QString &pathName) \sa cdUp(), isReadable(), exists(), path() */ - bool QDir::cd(const QString &dirName) { Q_D(QDir); @@ -938,7 +926,6 @@ bool QDir::cd(const QString &dirName) \sa cd(), isReadable(), exists(), path() */ - bool QDir::cdUp() { return cd(QString::fromLatin1("..")); @@ -947,7 +934,6 @@ bool QDir::cdUp() /*! Returns the string list set by setNameFilters() */ - QStringList QDir::nameFilters() const { Q_D(const QDir); @@ -970,10 +956,10 @@ QStringList QDir::nameFilters() const \sa nameFilters(), setFilter() */ - void QDir::setNameFilters(const QStringList &nameFilters) { Q_D(QDir); + d->detach(); d->data->nameFilters = nameFilters; } @@ -988,7 +974,6 @@ void QDir::setNameFilters(const QStringList &nameFilters) \sa {The Qt Resource System}, QResource::addSearchPath() */ - void QDir::addResourceSearchPath(const QString &path) { #ifdef QT_BUILD_CORE_LIB @@ -1026,7 +1011,7 @@ void QDir::setSearchPaths(const QString &prefix, const QStringList &searchPaths) return; } - for (int i = 0; i < prefix.count(); i++) { + for (int i = 0; i < prefix.count(); ++i) { if (!prefix.at(i).isLetterOrNumber()) { qWarning("QDir::setSearchPaths: Prefix can only contain letters or numbers"); return; @@ -1076,7 +1061,6 @@ QStringList QDir::searchPaths(const QString &prefix) /*! Returns the value set by setFilter() */ - QDir::Filters QDir::filter() const { Q_D(const QDir); @@ -1158,7 +1142,6 @@ QDir::Filters QDir::filter() const \sa filter(), setNameFilters() */ - void QDir::setFilter(Filters filters) { Q_D(QDir); @@ -1172,7 +1155,6 @@ void QDir::setFilter(Filters filters) \sa setSorting() SortFlag */ - QDir::SortFlags QDir::sorting() const { Q_D(const QDir); @@ -1218,7 +1200,6 @@ QDir::SortFlags QDir::sorting() const \sa sorting() SortFlag */ - void QDir::setSorting(SortFlags sort) { Q_D(QDir); @@ -1227,7 +1208,6 @@ void QDir::setSorting(SortFlags sort) d->data->sort = sort; } - /*! Returns the total number of directories and files in the directory. @@ -1235,7 +1215,6 @@ void QDir::setSorting(SortFlags sort) \sa operator[](), entryList() */ - uint QDir::count() const { Q_D(const QDir); @@ -1278,7 +1257,6 @@ QString QDir::operator[](int pos) const \sa entryInfoList(), setNameFilters(), setSorting(), setFilter() */ - QStringList QDir::entryList(Filters filters, SortFlags sort) const { Q_D(const QDir); @@ -1326,7 +1304,6 @@ QFileInfoList QDir::entryInfoList(Filters filters, SortFlags sort) const \sa entryInfoList(), setNameFilters(), setSorting(), setFilter() */ - QStringList QDir::entryList(const QStringList &nameFilters, Filters filters, SortFlags sort) const { @@ -1373,7 +1350,6 @@ QStringList QDir::entryList(const QStringList &nameFilters, Filters filters, \sa entryList(), setNameFilters(), setSorting(), setFilter(), isReadable(), exists() */ - QFileInfoList QDir::entryInfoList(const QStringList &nameFilters, Filters filters, SortFlags sort) const { @@ -1411,7 +1387,6 @@ QFileInfoList QDir::entryInfoList(const QStringList &nameFilters, Filters filter \sa rmdir() */ - bool QDir::mkdir(const QString &dirName) const { Q_D(const QDir); @@ -1420,7 +1395,7 @@ bool QDir::mkdir(const QString &dirName) const qWarning("QDir::mkdir: Empty or null file name(s)"); return false; } - if(!d->data->fileEngine) + if (!d->data->fileEngine) return false; QString fn = filePath(dirName); @@ -1436,7 +1411,6 @@ bool QDir::mkdir(const QString &dirName) const \sa mkdir() */ - bool QDir::rmdir(const QString &dirName) const { Q_D(const QDir); @@ -1445,7 +1419,7 @@ bool QDir::rmdir(const QString &dirName) const qWarning("QDir::rmdir: Empty or null file name(s)"); return false; } - if(!d->data->fileEngine) + if (!d->data->fileEngine) return false; QString fn = filePath(dirName); @@ -1462,7 +1436,6 @@ bool QDir::rmdir(const QString &dirName) const \sa rmpath() */ - bool QDir::mkpath(const QString &dirPath) const { Q_D(const QDir); @@ -1471,7 +1444,7 @@ bool QDir::mkpath(const QString &dirPath) const qWarning("QDir::mkpath: Empty or null file name(s)"); return false; } - if(!d->data->fileEngine) + if (!d->data->fileEngine) return false; QString fn = filePath(dirPath); @@ -1497,7 +1470,7 @@ bool QDir::rmpath(const QString &dirPath) const qWarning("QDir::rmpath: Empty or null file name(s)"); return false; } - if(!d->data->fileEngine) + if (!d->data->fileEngine) return false; QString fn = filePath(dirPath); @@ -1513,17 +1486,16 @@ bool QDir::rmpath(const QString &dirPath) const \sa QFileInfo::isReadable() */ - - bool QDir::isReadable() const { Q_D(const QDir); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return false; - const QAbstractFileEngine::FileFlags info = d->data->fileEngine->fileFlags(QAbstractFileEngine::DirectoryType - |QAbstractFileEngine::PermsMask); - if(!(info & QAbstractFileEngine::DirectoryType)) + const QAbstractFileEngine::FileFlags info = + d->data->fileEngine->fileFlags(QAbstractFileEngine::DirectoryType + | QAbstractFileEngine::PermsMask); + if (!(info & QAbstractFileEngine::DirectoryType)) return false; return info & QAbstractFileEngine::ReadUserPerm; } @@ -1539,19 +1511,17 @@ bool QDir::isReadable() const \sa QFileInfo::exists(), QFile::exists() */ - bool QDir::exists() const { Q_D(const QDir); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return false; const QAbstractFileEngine::FileFlags info = - d->data->fileEngine->fileFlags( - QAbstractFileEngine::DirectoryType - | QAbstractFileEngine::ExistsFlag - | QAbstractFileEngine::Refresh); - if(!(info & QAbstractFileEngine::DirectoryType)) + d->data->fileEngine->fileFlags(QAbstractFileEngine::DirectoryType + | QAbstractFileEngine::ExistsFlag + | QAbstractFileEngine::Refresh); + if (!(info & QAbstractFileEngine::DirectoryType)) return false; return info & QAbstractFileEngine::ExistsFlag; } @@ -1568,12 +1538,11 @@ bool QDir::exists() const \sa root(), rootPath() */ - bool QDir::isRoot() const { Q_D(const QDir); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return true; return d->data->fileEngine->fileFlags(QAbstractFileEngine::FlagsMask) & QAbstractFileEngine::RootFlag; } @@ -1603,12 +1572,11 @@ bool QDir::isRoot() const \sa makeAbsolute() isAbsolute() isAbsolutePath() cleanPath() */ - bool QDir::isRelative() const { Q_D(const QDir); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return false; return d->data->fileEngine->isRelativePath(); } @@ -1621,20 +1589,19 @@ bool QDir::isRelative() const \sa isAbsolute() isAbsolutePath() isRelative() cleanPath() */ - bool QDir::makeAbsolute() // ### What do the return values signify? { Q_D(QDir); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return false; QString absolutePath = d->data->fileEngine->fileName(QAbstractFileEngine::AbsoluteName); - if(QDir::isRelativePath(absolutePath)) + if (QDir::isRelativePath(absolutePath)) return false; d->detach(); d->data->path = absolutePath; d->data->fileEngine->setFileName(absolutePath); - if(!(d->data->fileEngine->fileFlags(QAbstractFileEngine::TypesMask) & QAbstractFileEngine::DirectoryType)) + if (!(d->data->fileEngine->fileFlags(QAbstractFileEngine::TypesMask) & QAbstractFileEngine::DirectoryType)) return false; return true; } @@ -1648,22 +1615,21 @@ bool QDir::makeAbsolute() // ### What do the return values signify? \snippet doc/src/snippets/code/src_corelib_io_qdir.cpp 10 */ - bool QDir::operator==(const QDir &dir) const { const QDirPrivate *d = d_func(); const QDirPrivate *other = dir.d_func(); - if(d->data == other->data) + if (d->data == other->data) return true; Q_ASSERT(d->data->fileEngine && other->data->fileEngine); - if(d->data->fileEngine->caseSensitive() != other->data->fileEngine->caseSensitive()) + if (d->data->fileEngine->caseSensitive() != other->data->fileEngine->caseSensitive()) return false; - if(d->data->filters == other->data->filters + if (d->data->filters == other->data->filters && d->data->sort == other->data->sort && d->data->nameFilters == other->data->nameFilters) { QString dir1 = absolutePath(), dir2 = dir.absolutePath(); - if(!other->data->fileEngine->caseSensitive()) + if (!other->data->fileEngine->caseSensitive()) return (dir1.toLower() == dir2.toLower()); return (dir1 == dir2); @@ -1676,7 +1642,6 @@ bool QDir::operator==(const QDir &dir) const Makes a copy of the \a dir object and assigns it to this QDir object. */ - QDir &QDir::operator=(const QDir &dir) { if (this == &dir) @@ -1695,7 +1660,6 @@ QDir &QDir::operator=(const QDir &dir) Use setPath() instead. */ - QDir &QDir::operator=(const QString &path) { Q_D(QDir); @@ -1716,14 +1680,12 @@ QDir &QDir::operator=(const QString &path) \snippet doc/src/snippets/code/src_corelib_io_qdir.cpp 11 */ - /*! Removes the file, \a fileName. Returns true if the file is removed successfully; otherwise returns false. */ - bool QDir::remove(const QString &fileName) { if (fileName.isEmpty()) { @@ -1745,7 +1707,6 @@ bool QDir::remove(const QString &fileName) fail. For example, on at least one file system rename() fails if \a newName points to an open file. */ - bool QDir::rename(const QString &oldName, const QString &newName) { Q_D(QDir); @@ -1754,11 +1715,11 @@ bool QDir::rename(const QString &oldName, const QString &newName) qWarning("QDir::rename: Empty or null file name(s)"); return false; } - if(!d->data->fileEngine) + if (!d->data->fileEngine) return false; QFile file(filePath(oldName)); - if(!file.exists()) + if (!file.exists()) return false; return file.rename(filePath(newName)); } @@ -1773,7 +1734,6 @@ bool QDir::rename(const QString &oldName, const QString &newName) \sa QFileInfo::exists(), QFile::exists() */ - bool QDir::exists(const QString &name) const { if (name.isEmpty()) { @@ -1793,7 +1753,6 @@ bool QDir::exists(const QString &name) const \sa root(), rootPath() */ - QFileInfoList QDir::drives() { #ifdef QT_NO_FSFILEENGINE @@ -1813,7 +1772,6 @@ QFileInfoList QDir::drives() user using their operating system's separator use toNativeSeparators(). */ - QChar QDir::separator() { #if defined (Q_FS_FAT) || defined(Q_WS_WIN) || defined(Q_OS_SYMBIAN) @@ -1832,9 +1790,8 @@ QChar QDir::separator() Returns true if the directory was successfully changed; otherwise returns false. - \sa current() currentPath() home() root() temp() + \sa current(), currentPath(), home(), root(), temp() */ - bool QDir::setCurrent(const QString &path) { #ifdef QT_NO_FSFILEENGINE @@ -1853,13 +1810,13 @@ bool QDir::setCurrent(const QString &path) The directory is constructed using the absolute path of the current directory, ensuring that its path() will be the same as its absolutePath(). - \sa currentPath(), home(), root(), temp() + \sa currentPath(), setCurrent(), home(), root(), temp() */ /*! Returns the absolute path of the application's current directory. - \sa current(), homePath(), rootPath(), tempPath() + \sa current(), setCurrent(), homePath(), rootPath(), tempPath() */ QString QDir::currentPath() { @@ -1876,7 +1833,7 @@ QString QDir::currentPath() Use currentPath() instead. - \sa currentPath() + \sa currentPath(), setCurrent() */ /*! @@ -1933,14 +1890,14 @@ QString QDir::homePath() } /*! - \fn QString QDir::homeDirPath() + \fn QString QDir::homeDirPath() - Returns the absolute path of the user's home directory. + Returns the absolute path of the user's home directory. - Use homePath() instead. + Use homePath() instead. - \sa homePath() - */ + \sa homePath() +*/ /*! \fn QDir QDir::temp() @@ -2006,13 +1963,13 @@ QString QDir::rootPath() } /*! - \fn QString QDir::rootDirPath() + \fn QString QDir::rootDirPath() - Returns the absolute path of the root directory. + Returns the absolute path of the root directory. - Use rootPath() instead. + Use rootPath() instead. - \sa rootPath() + \sa rootPath() */ #ifndef QT_NO_REGEXP @@ -2025,11 +1982,9 @@ QString QDir::rootPath() \sa {QRegExp wildcard matching}, QRegExp::exactMatch() entryList() entryInfoList() */ - - bool QDir::match(const QStringList &filters, const QString &fileName) { - for(QStringList::ConstIterator sit = filters.begin(); sit != filters.end(); ++sit) { + for (QStringList::ConstIterator sit = filters.begin(); sit != filters.end(); ++sit) { QRegExp rx(*sit, Qt::CaseInsensitive, QRegExp::Wildcard); if (rx.exactMatch(fileName)) return true; @@ -2045,12 +2000,11 @@ bool QDir::match(const QStringList &filters, const QString &fileName) \sa {QRegExp wildcard matching}, QRegExp::exactMatch() entryList() entryInfoList() */ - bool QDir::match(const QString &filter, const QString &fileName) { return match(nameFiltersFromString(filter), fileName); } -#endif +#endif // QT_NO_REGEXP /*! Removes all multiple directory separators "/" and resolves any @@ -2063,15 +2017,14 @@ bool QDir::match(const QString &filter, const QString &fileName) \sa absolutePath() canonicalPath() */ - QString QDir::cleanPath(const QString &path) { if (path.isEmpty()) return path; QString name = path; QChar dir_separator = separator(); - if(dir_separator != QLatin1Char('/')) - name.replace(dir_separator, QLatin1Char('/')); + if (dir_separator != QLatin1Char('/')) + name.replace(dir_separator, QLatin1Char('/')); int used = 0, levels = 0; const int len = name.length(); @@ -2079,27 +2032,27 @@ QString QDir::cleanPath(const QString &path) QChar *out = outVector.data(); const QChar *p = name.unicode(); - for(int i = 0, last = -1, iwrite = 0; i < len; i++) { - if(p[i] == QLatin1Char('/')) { - while(i < len-1 && p[i+1] == QLatin1Char('/')) { + for (int i = 0, last = -1, iwrite = 0; i < len; ++i) { + if (p[i] == QLatin1Char('/')) { + while (i < len-1 && p[i+1] == QLatin1Char('/')) { #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) //allow unc paths - if(!i) + if (!i) break; #endif i++; } bool eaten = false; - if(i < len - 1 && p[i+1] == QLatin1Char('.')) { + if (i < len - 1 && p[i+1] == QLatin1Char('.')) { int dotcount = 1; - if(i < len - 2 && p[i+2] == QLatin1Char('.')) + if (i < len - 2 && p[i+2] == QLatin1Char('.')) dotcount++; - if(i == len - dotcount - 1) { - if(dotcount == 1) { + if (i == len - dotcount - 1) { + if (dotcount == 1) { break; - } else if(levels) { - if(last == -1) { - for(int i2 = iwrite-1; i2 >= 0; i2--) { - if(out[i2] == QLatin1Char('/')) { + } else if (levels) { + if (last == -1) { + for (int i2 = iwrite-1; i2 >= 0; i2--) { + if (out[i2] == QLatin1Char('/')) { last = i2; break; } @@ -2108,11 +2061,11 @@ QString QDir::cleanPath(const QString &path) used -= iwrite - last - 1; break; } - } else if(p[i+dotcount+1] == QLatin1Char('/')) { - if(dotcount == 2 && levels) { - if(last == -1 || iwrite - last == 1) { - for(int i2 = (last == -1) ? (iwrite-1) : (last-1); i2 >= 0; i2--) { - if(out[i2] == QLatin1Char('/')) { + } else if (p[i+dotcount+1] == QLatin1Char('/')) { + if (dotcount == 2 && levels) { + if (last == -1 || iwrite - last == 1) { + for (int i2 = (last == -1) ? (iwrite-1) : (last-1); i2 >= 0; i2--) { + if (out[i2] == QLatin1Char('/')) { eaten = true; last = i2; break; @@ -2121,7 +2074,7 @@ QString QDir::cleanPath(const QString &path) } else { eaten = true; } - if(eaten) { + if (eaten) { levels--; used -= iwrite - last; iwrite = last; @@ -2133,38 +2086,38 @@ QString QDir::cleanPath(const QString &path) iwrite = qMax(0, last); last = -1; ++i; - } else if(dotcount == 1) { + } else if (dotcount == 1) { eaten = true; } - if(eaten) + if (eaten) i += dotcount; } else { levels++; } - } else if(last != -1 && iwrite - last == 1) { + } else if (last != -1 && iwrite - last == 1) { #if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) eaten = (iwrite > 2); #else eaten = true; #endif last = -1; - } else if(last != -1 && i == len-1) { + } else if (last != -1 && i == len-1) { eaten = true; } else { levels++; } - if(!eaten) + if (!eaten) last = i - (i - iwrite); else continue; - } else if(!i && p[i] == QLatin1Char('.')) { + } else if (!i && p[i] == QLatin1Char('.')) { int dotcount = 1; - if(len >= 1 && p[1] == QLatin1Char('.')) + if (len >= 1 && p[1] == QLatin1Char('.')) dotcount++; - if(len >= dotcount && p[dotcount] == QLatin1Char('/')) { - if(dotcount == 1) { + if (len >= dotcount && p[dotcount] == QLatin1Char('/')) { + if (dotcount == 1) { i++; - while(i+1 < len-1 && p[i+1] == QLatin1Char('/')) + while (i+1 < len-1 && p[i+1] == QLatin1Char('/')) i++; continue; } @@ -2196,7 +2149,6 @@ QString QDir::cleanPath(const QString &path) \sa isRelative() isAbsolutePath() makeAbsolute() */ - bool QDir::isRelativePath(const QString &path) { return QFileInfo(path).isRelative(); @@ -2205,7 +2157,6 @@ bool QDir::isRelativePath(const QString &path) /*! Refreshes the directory information. */ - void QDir::refresh() const { Q_D(const QDir); @@ -2220,7 +2171,6 @@ void QDir::refresh() const there is more than one filter, each pair of filters is separated by a space or by a semicolon.) */ - QStringList QDir::nameFiltersFromString(const QString &nameFilter) { return QDirPrivate::splitFilters(nameFilter); @@ -2412,7 +2362,8 @@ void QDir::setNameFilter(const QString &nameFilter) Use QDir::SortFlags instead. */ -#endif +#endif // QT3_SUPPORT + #ifndef QT_NO_DEBUG_STREAM QDebug operator<<(QDebug debug, QDir::Filters filters) { @@ -2475,9 +2426,6 @@ QDebug operator<<(QDebug debug, const QDir &dir) << ')'; return debug.space(); } - - - -#endif +#endif // QT_NO_DEBUG_STREAM QT_END_NAMESPACE diff --git a/src/corelib/io/qdir.h b/src/corelib/io/qdir.h index 6be4922..186dd2f 100644 --- a/src/corelib/io/qdir.h +++ b/src/corelib/io/qdir.h @@ -83,7 +83,7 @@ public: Modified = 0x080, Hidden = 0x100, System = 0x200, - + AccessMask = 0x3F0, AllDirs = 0x400, @@ -215,6 +215,7 @@ public: static bool match(const QStringList &filters, const QString &fileName); static bool match(const QString &filter, const QString &fileName); #endif + static QString cleanPath(const QString &path); void refresh() const; @@ -246,7 +247,7 @@ public: inline QT3_SUPPORT static QString homeDirPath() { return homePath(); } inline QT3_SUPPORT static QString rootDirPath() { return rootPath(); } inline QT3_SUPPORT static QString cleanDirPath(const QString &name) { return cleanPath(name); } -#endif +#endif // QT3_SUPPORT }; Q_DECLARE_OPERATORS_FOR_FLAGS(QDir::Filters) -- cgit v0.12 From 6d8ea540bd123270f0010eb5fa5e68a510ca89e7 Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Fri, 29 Jan 2010 13:12:44 +0100 Subject: nano-optimizations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Merge-request: 445 Reviewed-by: João Abecasis --- src/corelib/io/qdir.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp index 0b6ad08..250e5e5 100644 --- a/src/corelib/io/qdir.cpp +++ b/src/corelib/io/qdir.cpp @@ -1692,8 +1692,7 @@ bool QDir::remove(const QString &fileName) qWarning("QDir::remove: Empty or null file name"); return false; } - QString p = filePath(fileName); - return QFile::remove(p); + return QFile::remove(filePath(fileName)); } /*! @@ -1740,8 +1739,7 @@ bool QDir::exists(const QString &name) const qWarning("QDir::exists: Empty or null file name"); return false; } - QString tmp = filePath(name); - return QFile::exists(tmp); + return QFile::exists(filePath(name)); } /*! @@ -1984,7 +1982,7 @@ QString QDir::rootPath() */ bool QDir::match(const QStringList &filters, const QString &fileName) { - for (QStringList::ConstIterator sit = filters.begin(); sit != filters.end(); ++sit) { + for (QStringList::ConstIterator sit = filters.constBegin(); sit != filters.constEnd(); ++sit) { QRegExp rx(*sit, Qt::CaseInsensitive, QRegExp::Wildcard); if (rx.exactMatch(fileName)) return true; @@ -2126,12 +2124,8 @@ QString QDir::cleanPath(const QString &path) out[iwrite++] = p[i]; used++; } - QString ret; - if(used == len) - ret = name; - else - ret = QString(out, used); + QString ret = (used == len ? name : QString(out, used)); // Strip away last slash except for root directories if (ret.length() > 1 && ret.endsWith(QLatin1Char('/'))) { #ifdef Q_OS_WIN -- cgit v0.12 From 1492a2edf269b368abd2af9f8ffb474489609b5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Thu, 21 Jan 2010 19:48:33 +0100 Subject: Use X/Open LFS extensions for 64-bit support on directory iteration This boils down to using readdir64(_r) and struct dirent64 where available. I assumed these are available in the same platforms other such extensions are already being used. AIX uses the additional type DIR64 and opendir64/closedir64 to manipulate it. Task-number: QTBUG-2781 Reviewed-by: Thiago Macieira --- mkspecs/common/aix/qplatformdefs.h | 10 ++++++++++ mkspecs/common/posix/qplatformdefs.h | 16 ++++++++++++++++ src/corelib/io/qfilesystemwatcher_dnotify.cpp | 13 +++++++------ src/corelib/io/qfsfileengine_iterator_unix.cpp | 20 ++++++++++---------- src/gui/embedded/qscreen_qws.cpp | 21 +++++++++++---------- 5 files changed, 54 insertions(+), 26 deletions(-) diff --git a/mkspecs/common/aix/qplatformdefs.h b/mkspecs/common/aix/qplatformdefs.h index 57c5a76..b3abf68 100644 --- a/mkspecs/common/aix/qplatformdefs.h +++ b/mkspecs/common/aix/qplatformdefs.h @@ -101,6 +101,16 @@ #define QT_SOCKOPTLEN_T int #endif +#ifdef QT_LARGEFILE_SUPPORT +#undef QT_DIR +#undef QT_OPENDIR +#undef QT_CLOSEDIR + +#define QT_DIR DIR64 +#define QT_OPENDIR ::opendir64 +#define QT_CLOSEDIR ::closedir64 +#endif + #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE-0 >= 500) // AIX 4.3 and better #define QT_SNPRINTF ::snprintf diff --git a/mkspecs/common/posix/qplatformdefs.h b/mkspecs/common/posix/qplatformdefs.h index fe50de2..e29bc6f 100644 --- a/mkspecs/common/posix/qplatformdefs.h +++ b/mkspecs/common/posix/qplatformdefs.h @@ -132,6 +132,22 @@ // Posix extensions to C89 #define QT_FILENO fileno +// Directory iteration +#define QT_DIR DIR + +#define QT_OPENDIR ::opendir +#define QT_CLOSEDIR ::closedir + +#if defined(QT_USE_XOPEN_LFS_EXTENSIONS) && defined(QT_LARGEFILE_SUPPORT) +#define QT_DIRENT struct dirent64 +#define QT_READDIR ::readdir64 +#define QT_READDIR_R ::readdir64_r +#else +#define QT_DIRENT struct dirent +#define QT_READDIR ::readdir +#define QT_READDIR_R ::readdir_r +#endif + #define QT_SOCKLEN_T socklen_t #define QT_SOCKET_CONNECT ::connect diff --git a/src/corelib/io/qfilesystemwatcher_dnotify.cpp b/src/corelib/io/qfilesystemwatcher_dnotify.cpp index 1a218c7..82470c8 100644 --- a/src/corelib/io/qfilesystemwatcher_dnotify.cpp +++ b/src/corelib/io/qfilesystemwatcher_dnotify.cpp @@ -39,6 +39,7 @@ ** ****************************************************************************/ +#include "qplatformdefs.h" #include "qfilesystemwatcher.h" #include "qfilesystemwatcher_dnotify_p.h" @@ -255,16 +256,16 @@ QStringList QDnotifyFileSystemWatcherEngine::addPaths(const QStringList &paths, if(fd == 0) { - DIR *d = ::opendir(path.toUtf8().constData()); + QT_DIR *d = QT_OPENDIR(path.toUtf8().constData()); if(!d) continue; // Could not open directory - DIR *parent = 0; + QT_DIR *parent = 0; QDir parentDir(path); if(!parentDir.isRoot()) { parentDir.cdUp(); - parent = ::opendir(parentDir.path().toUtf8().constData()); + parent = QT_OPENDIR(parentDir.path().toUtf8().constData()); if(!parent) { - ::closedir(d); + QT_CLOSEDIR(d); continue; } } @@ -272,8 +273,8 @@ QStringList QDnotifyFileSystemWatcherEngine::addPaths(const QStringList &paths, fd = qt_safe_dup(::dirfd(d)); int parentFd = parent ? qt_safe_dup(::dirfd(parent)) : 0; - ::closedir(d); - if(parent) ::closedir(parent); + QT_CLOSEDIR(d); + if(parent) QT_CLOSEDIR(parent); Q_ASSERT(fd); if(::fcntl(fd, F_SETSIG, SIGIO) || diff --git a/src/corelib/io/qfsfileengine_iterator_unix.cpp b/src/corelib/io/qfsfileengine_iterator_unix.cpp index b68b1a1..bfdb03e 100644 --- a/src/corelib/io/qfsfileengine_iterator_unix.cpp +++ b/src/corelib/io/qfsfileengine_iterator_unix.cpp @@ -58,13 +58,13 @@ public: #endif {} - DIR *dir; - dirent *dirEntry; + QT_DIR *dir; + QT_DIRENT *dirEntry; bool done; #if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN) && !defined(Q_OS_SYMBIAN) // for readdir_r - dirent *mt_file; + QT_DIRENT *mt_file; #endif }; @@ -76,14 +76,14 @@ void QFSFileEngineIterator::advance() return; #if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN) && !defined(Q_OS_SYMBIAN) - if (::readdir_r(platform->dir, platform->mt_file, &platform->dirEntry) != 0) + if (QT_READDIR_R(platform->dir, platform->mt_file, &platform->dirEntry) != 0) platform->done = true; #else // ### add local lock to prevent breaking reentrancy - platform->dirEntry = ::readdir(platform->dir); + platform->dirEntry = QT_READDIR(platform->dir); #endif // _POSIX_THREAD_SAFE_FUNCTIONS if (!platform->dirEntry) { - ::closedir(platform->dir); + QT_CLOSEDIR(platform->dir); platform->dir = 0; platform->done = true; #if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN) && !defined(Q_OS_SYMBIAN) @@ -101,7 +101,7 @@ void QFSFileEngineIterator::newPlatformSpecifics() void QFSFileEngineIterator::deletePlatformSpecifics() { if (platform->dir) { - ::closedir(platform->dir); + QT_CLOSEDIR(platform->dir); #if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN) && !defined(Q_OS_SYMBIAN) delete [] platform->mt_file; platform->mt_file = 0; @@ -115,18 +115,18 @@ bool QFSFileEngineIterator::hasNext() const { if (!platform->done && !platform->dir) { QFSFileEngineIterator *that = const_cast(this); - if ((that->platform->dir = ::opendir(QFile::encodeName(path()).data())) == 0) { + if ((that->platform->dir = QT_OPENDIR(QFile::encodeName(path()).data())) == 0) { that->platform->done = true; } else { // ### Race condition; we should use fpathconf and dirfd(). long maxPathName = ::pathconf(QFile::encodeName(path()).data(), _PC_NAME_MAX); if ((int) maxPathName == -1) maxPathName = FILENAME_MAX; - maxPathName += sizeof(dirent) + 1; + maxPathName += sizeof(QT_DIRENT) + 1; #if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN) && !defined(Q_OS_SYMBIAN) if (that->platform->mt_file) delete [] that->platform->mt_file; - that->platform->mt_file = (dirent *)new char[maxPathName]; + that->platform->mt_file = (QT_DIRENT *)new char[maxPathName]; #endif that->advance(); diff --git a/src/gui/embedded/qscreen_qws.cpp b/src/gui/embedded/qscreen_qws.cpp index 8eb8123..65a3fb5 100644 --- a/src/gui/embedded/qscreen_qws.cpp +++ b/src/gui/embedded/qscreen_qws.cpp @@ -39,6 +39,7 @@ ** ****************************************************************************/ +#include "qplatformdefs.h" #include "qscreen_qws.h" #include "qcolormap.h" @@ -3223,13 +3224,13 @@ QScreen * qt_probe_bus() return qt_dodriver("unaccel.so",0,0); } - DIR * dirptr=opendir("/proc/bus/pci"); + QT_DIR *dirptr = QT_OPENDIR("/proc/bus/pci"); if(!dirptr) return qt_dodriver("unaccel.so",0,0); - DIR * dirptr2; - dirent * cards; + QT_DIR * dirptr2; + QT_DIRENT *cards; - dirent * busses=readdir(dirptr); + QT_DIRENT *busses = QT_READDIR(dirptr); while(busses) { if(busses->d_name[0]!='.') { @@ -3237,9 +3238,9 @@ QScreen * qt_probe_bus() strcpy(buf,"/proc/bus/pci/"); qstrcpy(buf+14,busses->d_name); int p=strlen(buf); - dirptr2=opendir(buf); + dirptr2 = QT_OPENDIR(buf); if(dirptr2) { - cards=readdir(dirptr2); + cards = QT_READDIR(dirptr2); while(cards) { if(cards->d_name[0]!='.') { buf[p]='/'; @@ -3248,14 +3249,14 @@ QScreen * qt_probe_bus() if(ret) return ret; } - cards=readdir(dirptr2); + cards = QT_READDIR(dirptr2); } - closedir(dirptr2); + QT_CLOSEDIR(dirptr2); } } - busses=readdir(dirptr); + busses = QT_READDIR(dirptr); } - closedir(dirptr); + QT_CLOSEDIR(dirptr); return qt_dodriver("unaccel.so",0,0); } -- cgit v0.12 From c035b7edbdf053a5e230c30d2605a416cd4d86df Mon Sep 17 00:00:00 2001 From: Ademar de Souza Reis Jr Date: Tue, 8 Sep 2009 09:54:41 -0300 Subject: doc: Fix qmake-manual warn_on/warn_off references Signed-off-by: Ademar de Souza Reis Jr --- doc/src/development/qmake-manual.qdoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/src/development/qmake-manual.qdoc b/doc/src/development/qmake-manual.qdoc index d7aa0db..3d5c792 100644 --- a/doc/src/development/qmake-manual.qdoc +++ b/doc/src/development/qmake-manual.qdoc @@ -1977,7 +1977,7 @@ distinction between shared and \section1 QMAKE_CFLAGS_WARN_OFF This variable is not empty if the warn_off - \l{#TEMPLATE}{TEMPLATE} option is specified. The value of this + \l{#CONFIG}{CONFIG} option is specified. The value of this variable is typically handled by \c qmake or \l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified. @@ -1985,7 +1985,7 @@ distinction between shared and \section1 QMAKE_CFLAGS_WARN_ON This variable is not empty if the warn_on - \l{#TEMPLATE}{TEMPLATE} option is specified. + \l{#CONFIG}{CONFIG} option is specified. The value of this variable is typically handled by \c qmake or \l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified. -- cgit v0.12 From d64ff88040586c42d73bd58204e517b2a11fd648 Mon Sep 17 00:00:00 2001 From: Ademar de Souza Reis Jr Date: Tue, 15 Sep 2009 11:18:23 -0300 Subject: doc: Fix typo in QEvent::ignore() documentation Signed-off-by: Ademar de Souza Reis Jr --- src/corelib/kernel/qcoreevent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/kernel/qcoreevent.cpp b/src/corelib/kernel/qcoreevent.cpp index 3f69b4f..d177b26 100644 --- a/src/corelib/kernel/qcoreevent.cpp +++ b/src/corelib/kernel/qcoreevent.cpp @@ -331,7 +331,7 @@ QEvent::~QEvent() equivalent of calling setAccepted(false). Clearing the accept parameter indicates that the event receiver - does not want the event. Unwanted events might be propgated to the + does not want the event. Unwanted events might be propagated to the parent widget. \sa accept() -- cgit v0.12 From a1973962379345988f0a3686153f70397ce3eb99 Mon Sep 17 00:00:00 2001 From: Ademar de Souza Reis Jr Date: Fri, 6 Nov 2009 16:19:15 -0300 Subject: examples/dbus: update dbus-chat adaptor/interface files The example was outdated, thus causing some confusion for someone who tries to follow it. --- examples/dbus/dbus-chat/chat_adaptor.cpp | 6 +++--- examples/dbus/dbus-chat/chat_adaptor.h | 27 ++++++++++++--------------- examples/dbus/dbus-chat/chat_interface.cpp | 6 +++--- examples/dbus/dbus-chat/chat_interface.h | 10 +++++----- 4 files changed, 23 insertions(+), 26 deletions(-) diff --git a/examples/dbus/dbus-chat/chat_adaptor.cpp b/examples/dbus/dbus-chat/chat_adaptor.cpp index dc07e1c..c093c70 100644 --- a/examples/dbus/dbus-chat/chat_adaptor.cpp +++ b/examples/dbus/dbus-chat/chat_adaptor.cpp @@ -38,10 +38,10 @@ ** $QT_END_LICENSE$ ** ** -** This file was generated by dbusxml2cpp version 0.6 -** Command line was: dbusxml2cpp -i chat_adaptor.h -a :chat_adaptor.cpp com.trolltech.chat.xml +** This file was generated by qdbusxml2cpp version 0.7 +** Command line was: qdbusxml2cpp -i chat_adaptor.h -a :chat_adaptor.cpp com.trolltech.chat.xml ** -** dbusxml2cpp is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** qdbusxml2cpp is Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** ** This is an auto-generated file. ** Do not edit! All changes made to it will be lost. diff --git a/examples/dbus/dbus-chat/chat_adaptor.h b/examples/dbus/dbus-chat/chat_adaptor.h index b1e66ad..de5c4a2 100644 --- a/examples/dbus/dbus-chat/chat_adaptor.h +++ b/examples/dbus/dbus-chat/chat_adaptor.h @@ -38,10 +38,10 @@ ** $QT_END_LICENSE$ ** ** -** This file was generated by dbusxml2cpp version 0.6 -** Command line was: dbusxml2cpp -a chat_adaptor.h: com.trolltech.chat.xml +** This file was generated by qdbusxml2cpp version 0.7 +** Command line was: qdbusxml2cpp -a chat_adaptor.h: com.trolltech.chat.xml ** -** dbusxml2cpp is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** qdbusxml2cpp is Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** ** This is an auto-generated file. ** This file may have been hand-edited. Look for HAND-EDIT comments @@ -49,20 +49,17 @@ ** ****************************************************************************/ -#ifndef CHAT_ADAPTOR_H_142741156243605 -#define CHAT_ADAPTOR_H_142741156243605 +#ifndef CHAT_ADAPTOR_H_1257535021 +#define CHAT_ADAPTOR_H_1257535021 #include #include - -QT_BEGIN_NAMESPACE class QByteArray; template class QList; template class QMap; class QString; class QStringList; class QVariant; -QT_END_NAMESPACE /* * Adaptor class for interface com.trolltech.chat @@ -72,14 +69,14 @@ class ChatAdaptor: public QDBusAbstractAdaptor Q_OBJECT Q_CLASSINFO("D-Bus Interface", "com.trolltech.chat") Q_CLASSINFO("D-Bus Introspection", "" -" \n" -" \n" -" \n" -" \n" +" \n" +" \n" +" \n" +" \n" " \n" -" \n" -" \n" -" \n" +" \n" +" \n" +" \n" " \n" " \n" "") diff --git a/examples/dbus/dbus-chat/chat_interface.cpp b/examples/dbus/dbus-chat/chat_interface.cpp index f187ee0..d591053 100644 --- a/examples/dbus/dbus-chat/chat_interface.cpp +++ b/examples/dbus/dbus-chat/chat_interface.cpp @@ -38,10 +38,10 @@ ** $QT_END_LICENSE$ ** ** -** This file was generated by dbusxml2cpp version 0.6 -** Command line was: dbusxml2cpp -i chat_interface.h -p :chat_interface.cpp chat/com.trolltech.chat.xml +** This file was generated by qdbusxml2cpp version 0.7 +** Command line was: qdbusxml2cpp -i chat_interface.h -p :chat_interface.cpp com.trolltech.chat.xml ** -** dbusxml2cpp is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** qdbusxml2cpp is Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** ** This is an auto-generated file. ** This file may have been hand-edited. Look for HAND-EDIT comments diff --git a/examples/dbus/dbus-chat/chat_interface.h b/examples/dbus/dbus-chat/chat_interface.h index 3bf427b..2f695b5 100644 --- a/examples/dbus/dbus-chat/chat_interface.h +++ b/examples/dbus/dbus-chat/chat_interface.h @@ -38,18 +38,18 @@ ** $QT_END_LICENSE$ ** ** -** This file was generated by dbusxml2cpp version 0.6 -** Command line was: dbusxml2cpp -p chat_interface.h: com.trolltech.chat.xml +** This file was generated by qdbusxml2cpp version 0.7 +** Command line was: qdbusxml2cpp -p chat_interface.h: com.trolltech.chat.xml ** -** dbusxml2cpp is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** qdbusxml2cpp is Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** ** This is an auto-generated file. ** Do not edit! All changes made to it will be lost. ** ****************************************************************************/ -#ifndef CHAT_INTERFACE_H_143021156243606 -#define CHAT_INTERFACE_H_143021156243606 +#ifndef CHAT_INTERFACE_H_1257535021 +#define CHAT_INTERFACE_H_1257535021 #include #include -- cgit v0.12 From 8993ed377456b57a516c5e1407b716a7e330fe18 Mon Sep 17 00:00:00 2001 From: Ademar de Souza Reis Jr Date: Fri, 6 Nov 2009 16:49:12 -0300 Subject: examples/dbus: update remotecontrolledcar example The example was outdated, thus causing some confusion for someone who tries to follow it. --- examples/dbus/remotecontrolledcar/car/car.pro | 2 +- .../dbus/remotecontrolledcar/car/car_adaptor.cpp | 22 ++-- .../dbus/remotecontrolledcar/car/car_adaptor_p.h | 97 ------------------ examples/dbus/remotecontrolledcar/car/main.cpp | 4 +- .../controller/car_interface.cpp | 15 ++- .../controller/car_interface_p.h | 114 --------------------- .../remotecontrolledcar/controller/controller.cpp | 4 +- .../remotecontrolledcar/controller/controller.h | 5 +- .../remotecontrolledcar/controller/controller.pro | 2 +- 9 files changed, 26 insertions(+), 239 deletions(-) delete mode 100644 examples/dbus/remotecontrolledcar/car/car_adaptor_p.h delete mode 100644 examples/dbus/remotecontrolledcar/controller/car_interface_p.h diff --git a/examples/dbus/remotecontrolledcar/car/car.pro b/examples/dbus/remotecontrolledcar/car/car.pro index 9b426d3..d362dc9 100644 --- a/examples/dbus/remotecontrolledcar/car/car.pro +++ b/examples/dbus/remotecontrolledcar/car/car.pro @@ -10,7 +10,7 @@ CONFIG += qdbus # Input # DBUS_ADAPTORS += car.xml -HEADERS += car.h car_adaptor_p.h +HEADERS += car.h car_adaptor.h SOURCES += car.cpp main.cpp car_adaptor.cpp # install diff --git a/examples/dbus/remotecontrolledcar/car/car_adaptor.cpp b/examples/dbus/remotecontrolledcar/car/car_adaptor.cpp index bd4832e..80249a4 100644 --- a/examples/dbus/remotecontrolledcar/car/car_adaptor.cpp +++ b/examples/dbus/remotecontrolledcar/car/car_adaptor.cpp @@ -38,17 +38,17 @@ ** $QT_END_LICENSE$ ** ** -** This file was generated by dbusxml2cpp version 0.6 -** Command line was: dbusxml2cpp -c CarAdaptor -a car_adaptor_p.h:car_adaptor.cpp car.xml +** This file was generated by qdbusxml2cpp version 0.7 +** Command line was: qdbusxml2cpp -i car_adaptor.h -a :car_adaptor.cpp car.xml ** -** dbusxml2cpp is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** qdbusxml2cpp is Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** ** This is an auto-generated file. ** Do not edit! All changes made to it will be lost. ** ****************************************************************************/ -#include "car_adaptor_p.h" +#include "car_adaptor.h" #include #include #include @@ -58,40 +58,40 @@ #include /* - * Implementation of adaptor class CarAdaptor + * Implementation of adaptor class CarInterfaceAdaptor */ -CarAdaptor::CarAdaptor(QObject *parent) +CarInterfaceAdaptor::CarInterfaceAdaptor(QObject *parent) : QDBusAbstractAdaptor(parent) { // constructor setAutoRelaySignals(true); } -CarAdaptor::~CarAdaptor() +CarInterfaceAdaptor::~CarInterfaceAdaptor() { // destructor } -void CarAdaptor::accelerate() +void CarInterfaceAdaptor::accelerate() { // handle method call com.trolltech.Examples.CarInterface.accelerate QMetaObject::invokeMethod(parent(), "accelerate"); } -void CarAdaptor::decelerate() +void CarInterfaceAdaptor::decelerate() { // handle method call com.trolltech.Examples.CarInterface.decelerate QMetaObject::invokeMethod(parent(), "decelerate"); } -void CarAdaptor::turnLeft() +void CarInterfaceAdaptor::turnLeft() { // handle method call com.trolltech.Examples.CarInterface.turnLeft QMetaObject::invokeMethod(parent(), "turnLeft"); } -void CarAdaptor::turnRight() +void CarInterfaceAdaptor::turnRight() { // handle method call com.trolltech.Examples.CarInterface.turnRight QMetaObject::invokeMethod(parent(), "turnRight"); diff --git a/examples/dbus/remotecontrolledcar/car/car_adaptor_p.h b/examples/dbus/remotecontrolledcar/car/car_adaptor_p.h deleted file mode 100644 index 5f769cd..0000000 --- a/examples/dbus/remotecontrolledcar/car/car_adaptor_p.h +++ /dev/null @@ -1,97 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -** -** This file was generated by dbusxml2cpp version 0.6 -** Command line was: dbusxml2cpp -c CarAdaptor -a car_adaptor_p.h:car_adaptor.cpp car.xml -** -** dbusxml2cpp is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** -** This is an auto-generated file. -** This file may have been hand-edited. Look for HAND-EDIT comments -** before re-generating it. -** -****************************************************************************/ - -#ifndef CAR_ADAPTOR_P_H_1157030132 -#define CAR_ADAPTOR_P_H_1157030132 - -#include -#include - -QT_BEGIN_NAMESPACE -class QByteArray; -template class QList; -template class QMap; -class QString; -class QStringList; -class QVariant; -QT_END_NAMESPACE - -/* - * Adaptor class for interface com.trolltech.Examples.CarInterface - */ -class CarAdaptor: public QDBusAbstractAdaptor -{ - Q_OBJECT - Q_CLASSINFO("D-Bus Interface", "com.trolltech.Examples.CarInterface") - Q_CLASSINFO("D-Bus Introspection", "" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" - "") -public: - CarAdaptor(QObject *parent); - virtual ~CarAdaptor(); - -public: // PROPERTIES -public Q_SLOTS: // METHODS - void accelerate(); - void decelerate(); - void turnLeft(); - void turnRight(); -Q_SIGNALS: // SIGNALS - void crashed(); -}; - -#endif diff --git a/examples/dbus/remotecontrolledcar/car/main.cpp b/examples/dbus/remotecontrolledcar/car/main.cpp index 85b206c..eab82a7 100644 --- a/examples/dbus/remotecontrolledcar/car/main.cpp +++ b/examples/dbus/remotecontrolledcar/car/main.cpp @@ -40,7 +40,7 @@ ****************************************************************************/ #include "car.h" -#include "car_adaptor_p.h" +#include "car_adaptor.h" #include #include #include @@ -64,7 +64,7 @@ int main(int argc, char *argv[]) view.resize(400, 300); view.show(); - new CarAdaptor(car); + new CarInterfaceAdaptor(car); QDBusConnection connection = QDBusConnection::sessionBus(); connection.registerObject("/Car", car); connection.registerService("com.trolltech.CarExample"); diff --git a/examples/dbus/remotecontrolledcar/controller/car_interface.cpp b/examples/dbus/remotecontrolledcar/controller/car_interface.cpp index 01be1bf..4fc29b2 100644 --- a/examples/dbus/remotecontrolledcar/controller/car_interface.cpp +++ b/examples/dbus/remotecontrolledcar/controller/car_interface.cpp @@ -38,10 +38,10 @@ ** $QT_END_LICENSE$ ** ** -** This file was generated by dbusxml2cpp version 0.6 -** Command line was: dbusxml2cpp -c CarInterface -p car_interface_p.h:car_interface.cpp car.xml +** This file was generated by qdbusxml2cpp version 0.7 +** Command line was: qdbusxml2cpp -i car_interface.h -p :car_interface.cpp car.xml ** -** dbusxml2cpp is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** qdbusxml2cpp is Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** ** This is an auto-generated file. ** This file may have been hand-edited. Look for HAND-EDIT comments @@ -49,18 +49,17 @@ ** ****************************************************************************/ -#include "car_interface_p.h" - +#include "car_interface.h" /* - * Implementation of interface class CarInterface + * Implementation of interface class ComTrolltechExamplesCarInterfaceInterface */ -CarInterface::CarInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent) +ComTrolltechExamplesCarInterfaceInterface::ComTrolltechExamplesCarInterfaceInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent) : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent) { } -CarInterface::~CarInterface() +ComTrolltechExamplesCarInterfaceInterface::~ComTrolltechExamplesCarInterfaceInterface() { } diff --git a/examples/dbus/remotecontrolledcar/controller/car_interface_p.h b/examples/dbus/remotecontrolledcar/controller/car_interface_p.h deleted file mode 100644 index 8a5a907..0000000 --- a/examples/dbus/remotecontrolledcar/controller/car_interface_p.h +++ /dev/null @@ -1,114 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -** -** This file was generated by dbusxml2cpp version 0.6 -** Command line was: dbusxml2cpp -c CarInterface -p car_interface_p.h:car_interface.cpp car.xml -** -** dbusxml2cpp is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** -** This is an auto-generated file. -** Do not edit! All changes made to it will be lost. -** -****************************************************************************/ - -#ifndef CAR_INTERFACE_P_H_1156853585 -#define CAR_INTERFACE_P_H_1156853585 - -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Proxy class for interface com.trolltech.Examples.CarInterface - */ -class CarInterface: public QDBusAbstractInterface -{ - Q_OBJECT -public: - static inline const char *staticInterfaceName() - { return "com.trolltech.Examples.CarInterface"; } - -public: - CarInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0); - - ~CarInterface(); - -public Q_SLOTS: // METHODS - inline QDBusReply accelerate() - { - QList argumentList; - return callWithArgumentList(QDBus::Block, QLatin1String("accelerate"), argumentList); - } - - inline QDBusReply decelerate() - { - QList argumentList; - return callWithArgumentList(QDBus::Block, QLatin1String("decelerate"), argumentList); - } - - inline QDBusReply turnLeft() - { - QList argumentList; - return callWithArgumentList(QDBus::Block, QLatin1String("turnLeft"), argumentList); - } - - inline QDBusReply turnRight() - { - QList argumentList; - return callWithArgumentList(QDBus::Block, QLatin1String("turnRight"), argumentList); - } - -Q_SIGNALS: // SIGNALS - void crashed(); -}; - -namespace com { - namespace trolltech { - namespace Examples { - typedef ::CarInterface CarInterface; - } - } -} -#endif diff --git a/examples/dbus/remotecontrolledcar/controller/controller.cpp b/examples/dbus/remotecontrolledcar/controller/controller.cpp index 00a8875..5fca9e3 100644 --- a/examples/dbus/remotecontrolledcar/controller/controller.cpp +++ b/examples/dbus/remotecontrolledcar/controller/controller.cpp @@ -42,13 +42,13 @@ #include #include "controller.h" -#include "car_interface_p.h" +#include "car_interface.h" Controller::Controller(QWidget *parent) : QWidget(parent) { ui.setupUi(this); - car = new CarInterface("com.trolltech.CarExample", "/Car", + car = new com::trolltech::Examples::CarInterface("com.trolltech.CarExample", "/Car", QDBusConnection::sessionBus(), this); startTimer(1000); } diff --git a/examples/dbus/remotecontrolledcar/controller/controller.h b/examples/dbus/remotecontrolledcar/controller/controller.h index 07a1355..caadff9 100644 --- a/examples/dbus/remotecontrolledcar/controller/controller.h +++ b/examples/dbus/remotecontrolledcar/controller/controller.h @@ -43,8 +43,7 @@ #define CONTROLLER_H #include "ui_controller.h" - -class CarInterface; +#include "car_interface.h" class Controller : public QWidget { @@ -64,7 +63,7 @@ private slots: private: Ui::Controller ui; - CarInterface *car; + com::trolltech::Examples::CarInterface *car; }; #endif diff --git a/examples/dbus/remotecontrolledcar/controller/controller.pro b/examples/dbus/remotecontrolledcar/controller/controller.pro index 159e3b1..375b9d7 100644 --- a/examples/dbus/remotecontrolledcar/controller/controller.pro +++ b/examples/dbus/remotecontrolledcar/controller/controller.pro @@ -11,7 +11,7 @@ CONFIG += qdbus # Input # DBUS_INTERFACES += car.xml FORMS += controller.ui -HEADERS += car_interface_p.h controller.h +HEADERS += car_interface.h controller.h SOURCES += main.cpp car_interface.cpp controller.cpp # install -- cgit v0.12 From 9a6f11ab7651b6c66771033245906f43a0e651b3 Mon Sep 17 00:00:00 2001 From: Ademar de Souza Reis Jr Date: Fri, 29 Jan 2010 10:53:48 -0300 Subject: Fix build due to missing auto-generated files on dbus example Breakage introduced by my previous commit: a1c6fdf0fe5a51b5955ea3fc5f6c3eceee24e0f8 Signed-off-by: Ademar de Souza Reis Jr --- .../dbus/remotecontrolledcar/car/car_adaptor.h | 94 +++++++++++++++++ .../remotecontrolledcar/controller/car_interface.h | 114 +++++++++++++++++++++ 2 files changed, 208 insertions(+) create mode 100644 examples/dbus/remotecontrolledcar/car/car_adaptor.h create mode 100644 examples/dbus/remotecontrolledcar/controller/car_interface.h diff --git a/examples/dbus/remotecontrolledcar/car/car_adaptor.h b/examples/dbus/remotecontrolledcar/car/car_adaptor.h new file mode 100644 index 0000000..d109883 --- /dev/null +++ b/examples/dbus/remotecontrolledcar/car/car_adaptor.h @@ -0,0 +1,94 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +** +** This file was generated by qdbusxml2cpp version 0.7 +** Command line was: qdbusxml2cpp -a car_adaptor.h: car.xml +** +** qdbusxml2cpp is Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** +** This is an auto-generated file. +** This file may have been hand-edited. Look for HAND-EDIT comments +** before re-generating it. +** +****************************************************************************/ + +#ifndef CAR_ADAPTOR_H_1264773009 +#define CAR_ADAPTOR_H_1264773009 + +#include +#include +class QByteArray; +template class QList; +template class QMap; +class QString; +class QStringList; +class QVariant; + +/* + * Adaptor class for interface com.trolltech.Examples.CarInterface + */ +class CarInterfaceAdaptor: public QDBusAbstractAdaptor +{ + Q_OBJECT + Q_CLASSINFO("D-Bus Interface", "com.trolltech.Examples.CarInterface") + Q_CLASSINFO("D-Bus Introspection", "" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" + "") +public: + CarInterfaceAdaptor(QObject *parent); + virtual ~CarInterfaceAdaptor(); + +public: // PROPERTIES +public Q_SLOTS: // METHODS + void accelerate(); + void decelerate(); + void turnLeft(); + void turnRight(); +Q_SIGNALS: // SIGNALS + void crashed(); +}; + +#endif diff --git a/examples/dbus/remotecontrolledcar/controller/car_interface.h b/examples/dbus/remotecontrolledcar/controller/car_interface.h new file mode 100644 index 0000000..c2d281a --- /dev/null +++ b/examples/dbus/remotecontrolledcar/controller/car_interface.h @@ -0,0 +1,114 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +** +** This file was generated by qdbusxml2cpp version 0.7 +** Command line was: qdbusxml2cpp -p car_interface.h: car.xml +** +** qdbusxml2cpp is Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** +** This is an auto-generated file. +** Do not edit! All changes made to it will be lost. +** +****************************************************************************/ + +#ifndef CAR_INTERFACE_H_1264772826 +#define CAR_INTERFACE_H_1264772826 + +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * Proxy class for interface com.trolltech.Examples.CarInterface + */ +class ComTrolltechExamplesCarInterfaceInterface: public QDBusAbstractInterface +{ + Q_OBJECT +public: + static inline const char *staticInterfaceName() + { return "com.trolltech.Examples.CarInterface"; } + +public: + ComTrolltechExamplesCarInterfaceInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0); + + ~ComTrolltechExamplesCarInterfaceInterface(); + +public Q_SLOTS: // METHODS + inline QDBusPendingReply<> accelerate() + { + QList argumentList; + return asyncCallWithArgumentList(QLatin1String("accelerate"), argumentList); + } + + inline QDBusPendingReply<> decelerate() + { + QList argumentList; + return asyncCallWithArgumentList(QLatin1String("decelerate"), argumentList); + } + + inline QDBusPendingReply<> turnLeft() + { + QList argumentList; + return asyncCallWithArgumentList(QLatin1String("turnLeft"), argumentList); + } + + inline QDBusPendingReply<> turnRight() + { + QList argumentList; + return asyncCallWithArgumentList(QLatin1String("turnRight"), argumentList); + } + +Q_SIGNALS: // SIGNALS + void crashed(); +}; + +namespace com { + namespace trolltech { + namespace Examples { + typedef ::ComTrolltechExamplesCarInterfaceInterface CarInterface; + } + } +} +#endif -- cgit v0.12 From db4415d06ab58c5c37afc4cb032b4eb89f68594f Mon Sep 17 00:00:00 2001 From: ck Date: Fri, 29 Jan 2010 15:32:32 +0100 Subject: Assistant: Eliminate private tr contexts. Merging private tr contexts into the surrounding class keeps related strings together. Contributed-by: Ritt Konstantin Reviewed-by: kh1 --- tools/assistant/lib/qhelpenginecore.cpp | 2 +- tools/assistant/lib/qhelpsearchresultwidget.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/assistant/lib/qhelpenginecore.cpp b/tools/assistant/lib/qhelpenginecore.cpp index 0fceaaa..4809de6 100644 --- a/tools/assistant/lib/qhelpenginecore.cpp +++ b/tools/assistant/lib/qhelpenginecore.cpp @@ -119,7 +119,7 @@ bool QHelpEngineCorePrivate::setup() QHelpDBReader *reader = new QHelpDBReader(absFileName, QHelpGlobal::uniquifyConnectionName(info.fileName, this), this); if (!reader->init()) { - emit q->warning(tr("Cannot open documentation file %1: %2!") + emit q->warning(QHelpEngineCore::tr("Cannot open documentation file %1: %2!") .arg(absFileName, reader->errorMessage())); continue; } diff --git a/tools/assistant/lib/qhelpsearchresultwidget.cpp b/tools/assistant/lib/qhelpsearchresultwidget.cpp index a3f5aed..e1987d4 100644 --- a/tools/assistant/lib/qhelpsearchresultwidget.cpp +++ b/tools/assistant/lib/qhelpsearchresultwidget.cpp @@ -304,7 +304,7 @@ private: last = resultLastToShow > count ? count : resultLastToShow; } } - hitsLabel->setText(tr("%1 - %2 of %3 Hits").arg(first).arg(last).arg(count)); + hitsLabel->setText(QHelpSearchResultWidget::tr("%1 - %2 of %3 Hits").arg(first).arg(last).arg(count)); } private: -- cgit v0.12 From 2f3bf7b546186b9415f2d0b97ae431fea1a2cc48 Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Fri, 29 Jan 2010 14:00:38 +1000 Subject: Add the QGLBuffer class to Qt 4.7 for VBO's Reviewed-by: Sarah Smith --- src/opengl/opengl.pro | 2 + src/opengl/qglbuffer.cpp | 454 +++++++++++++++++++++++++++++++++ src/opengl/qglbuffer.h | 124 +++++++++ src/opengl/qglextensions.cpp | 26 +- src/opengl/qglextensions_p.h | 30 ++- tests/auto/auto.pro | 2 +- tests/auto/qglbuffer/qglbuffer.pro | 9 + tests/auto/qglbuffer/tst_qglbuffer.cpp | 261 +++++++++++++++++++ 8 files changed, 892 insertions(+), 16 deletions(-) create mode 100644 src/opengl/qglbuffer.cpp create mode 100644 src/opengl/qglbuffer.h create mode 100644 tests/auto/qglbuffer/qglbuffer.pro create mode 100644 tests/auto/qglbuffer/tst_qglbuffer.cpp diff --git a/src/opengl/opengl.pro b/src/opengl/opengl.pro index 69cfd30..7338534 100644 --- a/src/opengl/opengl.pro +++ b/src/opengl/opengl.pro @@ -26,6 +26,7 @@ HEADERS += qgl.h \ qglframebufferobject_p.h \ qglextensions_p.h \ qglpaintdevice_p.h \ + qglbuffer.h \ SOURCES += qgl.cpp \ @@ -34,6 +35,7 @@ SOURCES += qgl.cpp \ qglframebufferobject.cpp \ qglextensions.cpp \ qglpaintdevice.cpp \ + qglbuffer.cpp \ !contains(QT_CONFIG, opengles2) { diff --git a/src/opengl/qglbuffer.cpp b/src/opengl/qglbuffer.cpp new file mode 100644 index 0000000..2018086 --- /dev/null +++ b/src/opengl/qglbuffer.cpp @@ -0,0 +1,454 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtOpenGL module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include +#include "qglbuffer.h" + +QT_BEGIN_NAMESPACE + +/*! + \class QGLBuffer + \brief The QGLBuffer class provides functions for creating and managing GL buffer objects. + \since 4.7 + \ingroup painting-3D + + Buffer objects are created in the GL server so that the + client application can avoid uploading vertices, indices, + texture image data, etc every time they are needed. +*/ + +/*! + \enum QGLBuffer::Type + This enum defines the type of GL buffer object to create with QGLBuffer. + + \value VertexBuffer Vertex buffer object for use when specifying + vertex arrays. + \value IndexBuffer Index buffer object for use with \c{glDrawElements()}. + \value PixelPackBuffer Pixel pack buffer object for reading pixel + data from the GL server (for example, with \c{glReadPixels()}). + Not supported under OpenGL/ES. + \value PixelUnpackBuffer Pixel unpack buffer object for writing pixel + data to the GL server (for example, with \c{glTexImage2D()}). + Not supported under OpenGL/ES. +*/ + +/*! + \enum QGLBuffer::UsagePattern + This enum defines the usage pattern of a QGLBuffer object. + + \value StreamDraw The data will be set once and used a few times + for drawing operations. Under OpenGL/ES 1.1 this is identical + to StaticDraw. + \value StreamRead The data will be set once and used a few times + for reading data back from the GL server. Not supported + under OpenGL/ES. + \value StreamCopy The data will be set once and used a few times + for reading data back from the GL server for use in further + drawing operations. Not supported under OpenGL/ES. + \value StaticDraw The data will be set once and used many times + for drawing operations. + \value StaticRead The data will be set once and used many times + for reading data back from the GL server. Not supported + under OpenGL/ES. + \value StaticCopy The data will be set once and used many times + for reading data back from the GL server for use in further + drawing operations. Not supported under OpenGL/ES. + \value DynamicDraw The data will be modified repeatedly and used + many times for drawing operations. + \value DynamicRead The data will be modified repeatedly and used + many times for reading data back from the GL server. + Not supported under OpenGL/ES. + \value DynamicCopy The data will be modified repeatedly and used + many times for reading data back from the GL server for + use in further drawing operations. Not supported under OpenGL/ES. +*/ + +/*! + \enum QGLBuffer::Access + This enum defines the access mode for QGLBuffer::map(). + + \value ReadOnly The buffer will be mapped for reading only. + \value WriteOnly The buffer will be mapped for writing only. + \value ReadWrite The buffer will be mapped for reading and writing. +*/ + +class QGLBufferPrivate +{ +public: + QGLBufferPrivate(QGLBuffer::Type t) + : type(t), + guard(0), + usagePattern(QGLBuffer::StaticDraw), + actualUsagePattern(QGLBuffer::StaticDraw) + { + } + + QGLBuffer::Type type; + QGLSharedResourceGuard guard; + QGLBuffer::UsagePattern usagePattern; + QGLBuffer::UsagePattern actualUsagePattern; +}; + +/*! + Constructs a new buffer object of \a type. + + Note: this constructor just creates the QGLBuffer instance. The actual + buffer object in the GL server is not created until create() is called. + + \sa create() +*/ +QGLBuffer::QGLBuffer(QGLBuffer::Type type) + : d_ptr(new QGLBufferPrivate(type)) +{ +} + +#define ctx d->guard.context() + +/*! + Destroys this buffer object, including the storage being + used in the GL server. +*/ +QGLBuffer::~QGLBuffer() +{ + Q_D(QGLBuffer); + GLuint bufferId = d->guard.id(); + if (bufferId) { + // Switch to the original creating context to destroy it. + QGLShareContextScope scope(d->guard.context()); + glDeleteBuffers(1, &bufferId); + } +} + +/*! + Returns the type of buffer represented by this object. +*/ +QGLBuffer::Type QGLBuffer::type() const +{ + Q_D(const QGLBuffer); + return d->type; +} + +/*! + Returns the usage pattern for this buffer object. + The default value is StaticDraw. + + \sa setUsagePattern() +*/ +QGLBuffer::UsagePattern QGLBuffer::usagePattern() const +{ + Q_D(const QGLBuffer); + return d->usagePattern; +} + +/*! + Sets the usage pattern for this buffer object to \a value. + This function must be called before allocate() or write(). + + \sa usagePattern(), allocate(), write() +*/ +void QGLBuffer::setUsagePattern(QGLBuffer::UsagePattern value) +{ + Q_D(QGLBuffer); +#if defined(QT_OPENGL_ES_1) + // OpenGL/ES 1.1 does not support GL_STREAM_DRAW, so use GL_STATIC_DRAW. + // OpenGL/ES 2.0 does support GL_STREAM_DRAW. + d->usagePattern = value; + if (value == StreamDraw) + d->actualUsagePattern = StaticDraw; + else + d->actualUsagePattern = value; +#else + d->usagePattern = d->actualUsagePattern = value; +#endif +} + +#undef ctx + +/*! + Creates the buffer object in the GL server. Returns true if + the object was created; false otherwise. + + This function must be called with a current QGLContext. + The buffer will be bound to and can only be used in + that context (or any other context that is shared with it). + + This function will return false if the GL implementation + does not support buffers, or there is no current QGLContext. + + \sa isCreated(), allocate(), write() +*/ +bool QGLBuffer::create() +{ + Q_D(QGLBuffer); + if (d->guard.id()) + return true; + const QGLContext *ctx = QGLContext::currentContext(); + if (ctx) { + if (!qt_resolve_buffer_extensions(const_cast(ctx))) + return false; + GLuint bufferId = 0; + glGenBuffers(1, &bufferId); + if (bufferId) { + d->guard.setContext(ctx); + d->guard.setId(bufferId); + return true; + } + } + return false; +} + +#define ctx d->guard.context() + +/*! + Returns true if this buffer has been created; false otherwise. + + \sa create() +*/ +bool QGLBuffer::isCreated() const +{ + Q_D(const QGLBuffer); + return d->guard.id() != 0; +} + +/*! + Reads the \a size bytes in this buffer starting at \a offset + into \a data. Returns true on success; false if reading from + the buffer is not supported. Buffer reading is not supported + under OpenGL/ES. + + It is assumed that this buffer has been bound to the current context. + + \sa write(), bind() +*/ +bool QGLBuffer::read(int offset, void *data, int size) +{ +#if !defined(QT_OPENGL_ES) + Q_D(QGLBuffer); + if (!glGetBufferSubData || !d->guard.id()) + return false; + while (glGetError() != GL_NO_ERROR) ; // Clear error state. + glGetBufferSubData(d->type, offset, size, data); + return glGetError() == GL_NO_ERROR; +#else + Q_UNUSED(offset); + Q_UNUSED(data); + Q_UNUSED(size); + return false; +#endif +} + +/*! + Replaces the \a size bytes of this buffer starting at \a offset + with the contents of \a data. Any other bytes in the buffer + will be left unmodified. + + It is assumed that create() has been called on this buffer and that + it has been bound to the current context. + + \sa create(), read(), allocate() +*/ +void QGLBuffer::write(int offset, const void *data, int size) +{ + Q_D(QGLBuffer); + if (d->guard.id()) + glBufferSubData(d->type, offset, size, data); +} + +/*! + Allocates \a size bytes of space to the buffer, initialized to + the contents of \a data. Any previous contents will be removed. + + It is assumed that create() has been called on this buffer and that + it has been bound to the current context. + + \sa create(), read(), write() +*/ +void QGLBuffer::allocate(const void *data, int size) +{ + Q_D(QGLBuffer); + if (d->guard.id()) + glBufferData(d->type, size, data, d->actualUsagePattern); +} + +/*! + \fn void QGLBuffer::allocate(int size) + \overload + + Allocates \a size bytes of space to the buffer. Any previous + contents will be removed. + + It is assumed that create() has been called on this buffer and that + it has been bound to the current context. + + \sa create(), write() +*/ + +/*! + Binds the buffer associated with this object to the current + GL context. Returns false if binding was not possible, usually because + type() is not supported on this GL implementation. + + The buffer must be bound to the same QGLContext current when create() + was called, or to another QGLContext that is sharing with it. + Otherwise, false will be returned from this function. + + \sa release(), create() +*/ +bool QGLBuffer::bind() const +{ + Q_D(const QGLBuffer); + GLuint bufferId = d->guard.id(); + if (bufferId) { + if (!QGLContext::areSharing(QGLContext::currentContext(), + d->guard.context())) { +#ifndef QT_NO_DEBUG + qWarning("QGLBuffer::bind: buffer is not valid in the current context"); +#endif + return false; + } + glBindBuffer(d->type, bufferId); + return true; + } else { + return false; + } +} + +/*! + Releases the buffer associated with this object from the + current GL context. + + This function must be called with the same QGLContext current + as when bind() was called on the buffer. + + \sa bind() +*/ +void QGLBuffer::release() const +{ + Q_D(const QGLBuffer); + if (d->guard.id()) + glBindBuffer(d->type, 0); +} + +/*! + Returns the GL identifier associated with this buffer; zero if + the buffer has not been created. + + \sa isCreated() +*/ +uint QGLBuffer::bufferId() const +{ + Q_D(const QGLBuffer); + return d->guard.id(); +} + +#ifndef GL_BUFFER_SIZE +#define GL_BUFFER_SIZE 0x8764 +#endif + +/*! + Returns the size of the data in this buffer, for reading operations. + Returns -1 if fetching the buffer size is not supported, or the + buffer has not been created. + + It is assumed that this buffer has been bound to the current context. + + \sa isCreated(), bind() +*/ +int QGLBuffer::size() const +{ + Q_D(const QGLBuffer); + if (!d->guard.id()) + return -1; + GLint value = -1; + glGetBufferParameteriv(d->type, GL_BUFFER_SIZE, &value); + return value; +} + +/*! + Maps the contents of this buffer into the application's memory + space and returns a pointer to it. Returns null if memory + mapping is not possible. The \a access parameter indicates the + type of access to be performed. + + It is assumed that create() has been called on this buffer and that + it has been bound to the current context. + + This function is only supported under OpenGL/ES if the + \c{GL_OES_mapbuffer} extension is present. + + \sa unmap(), create(), bind() +*/ +void *QGLBuffer::map(QGLBuffer::Access access) +{ + Q_D(QGLBuffer); + if (!d->guard.id()) + return 0; + if (!glMapBufferARB) + return 0; + return glMapBufferARB(d->type, access); +} + +/*! + Unmaps the buffer after it was mapped into the application's + memory space with a previous call to map(). Returns true if + the unmap succeeded; false otherwise. + + It is assumed that this buffer has been bound to the current context, + and that it was previously mapped with map(). + + This function is only supported under OpenGL/ES if the + \c{GL_OES_mapbuffer} extension is present. + + \sa map() +*/ +bool QGLBuffer::unmap() +{ + Q_D(QGLBuffer); + if (!d->guard.id()) + return false; + if (!glUnmapBufferARB) + return false; + return glUnmapBufferARB(d->type) == GL_TRUE; +} + +QT_END_NAMESPACE diff --git a/src/opengl/qglbuffer.h b/src/opengl/qglbuffer.h new file mode 100644 index 0000000..68ee56c --- /dev/null +++ b/src/opengl/qglbuffer.h @@ -0,0 +1,124 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtOpenGL module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QGLBUFFER_H +#define QGLBUFFER_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(OpenGL) + +class QGLBufferPrivate; + +class Q_OPENGL_EXPORT QGLBuffer +{ +public: + enum Type + { + VertexBuffer = 0x8892, // GL_ARRAY_BUFFER + IndexBuffer = 0x8893, // GL_ELEMENT_ARRAY_BUFFER + PixelPackBuffer = 0x88EB, // GL_PIXEL_PACK_BUFFER + PixelUnpackBuffer = 0x88EC // GL_PIXEL_UNPACK_BUFFER + }; + + explicit QGLBuffer(QGLBuffer::Type type); + ~QGLBuffer(); + + enum UsagePattern + { + StreamDraw = 0x88E0, // GL_STREAM_DRAW + StreamRead = 0x88E1, // GL_STREAM_READ + StreamCopy = 0x88E2, // GL_STREAM_COPY + StaticDraw = 0x88E4, // GL_STATIC_DRAW + StaticRead = 0x88E5, // GL_STATIC_READ + StaticCopy = 0x88E6, // GL_STATIC_COPY + DynamicDraw = 0x88E8, // GL_DYNAMIC_DRAW + DynamicRead = 0x88E9, // GL_DYNAMIC_READ + DynamicCopy = 0x88EA // GL_DYNAMIC_COPY + }; + + enum Access + { + ReadOnly = 0x88B8, // GL_READ_ONLY + WriteOnly = 0x88B9, // GL_WRITE_ONLY + ReadWrite = 0x88BA // GL_READ_WRITE + }; + + QGLBuffer::Type type() const; + + QGLBuffer::UsagePattern usagePattern() const; + void setUsagePattern(QGLBuffer::UsagePattern value); + + bool create(); + bool isCreated() const; + + bool bind() const; + void release() const; + + uint bufferId() const; + + int size() const; + + bool read(int offset, void *data, int size); + void write(int offset, const void *data, int size); + + void allocate(const void *data, int size); + inline void allocate(int size) { allocate(0, size); } + + void *map(QGLBuffer::Access access); + bool unmap(); + +private: + QScopedPointer d_ptr; + + Q_DISABLE_COPY(QGLBuffer) + Q_DECLARE_PRIVATE(QGLBuffer) +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif diff --git a/src/opengl/qglextensions.cpp b/src/opengl/qglextensions.cpp index c091191..03fca39 100644 --- a/src/opengl/qglextensions.cpp +++ b/src/opengl/qglextensions.cpp @@ -191,31 +191,35 @@ bool qt_resolve_frag_program_extensions(QGLContext *ctx) bool qt_resolve_buffer_extensions(QGLContext *ctx) { - if (glMapBufferARB && glUnmapBufferARB -#if !defined(QT_OPENGL_ES_2) - && glBindBuffer && glDeleteBuffers && glGenBuffers && glBufferData -#endif - ) +#if defined(QGL_RESOLVE_BUFFER_FUNCS) + if (glBindBuffer && glDeleteBuffers && glGenBuffers && glBufferData + && glBufferSubData && glGetBufferParameteriv) return true; +#endif -#if !defined(QT_OPENGL_ES_2) +#if defined(QGL_RESOLVE_BUFFER_FUNCS) glBindBuffer = (_glBindBuffer) qt_gl_getProcAddressARB(ctx, "glBindBuffer"); glDeleteBuffers = (_glDeleteBuffers) qt_gl_getProcAddressARB(ctx, "glDeleteBuffers"); glGenBuffers = (_glGenBuffers) qt_gl_getProcAddressARB(ctx, "glGenBuffers"); glBufferData = (_glBufferData) qt_gl_getProcAddressARB(ctx, "glBufferData"); + glBufferSubData = (_glBufferSubData) qt_gl_getProcAddressARB(ctx, "glBufferSubData"); + glGetBufferSubData = (_glGetBufferSubData) qt_gl_getProcAddressARB(ctx, "glGetBufferSubData"); + glGetBufferParameteriv = (_glGetBufferParameteriv) qt_gl_getProcAddressARB(ctx, "glGetBufferParameteriv"); #endif glMapBufferARB = (_glMapBufferARB) qt_gl_getProcAddressARB(ctx, "glMapBuffer"); glUnmapBufferARB = (_glUnmapBufferARB) qt_gl_getProcAddressARB(ctx, "glUnmapBuffer"); - return glMapBufferARB - && glUnmapBufferARB -#if !defined(QT_OPENGL_ES_2) - && glBindBuffer +#if defined(QGL_RESOLVE_BUFFER_FUNCS) + return glBindBuffer && glDeleteBuffers && glGenBuffers && glBufferData + && glBufferSubData + && glGetBufferParameteriv; + // glGetBufferSubData() is optional +#else + return true; #endif - ; } bool qt_resolve_glsl_extensions(QGLContext *ctx) diff --git a/src/opengl/qglextensions_p.h b/src/opengl/qglextensions_p.h index 86096d2..116dfa6 100644 --- a/src/opengl/qglextensions_p.h +++ b/src/opengl/qglextensions_p.h @@ -71,6 +71,7 @@ #include #ifndef GL_ARB_vertex_buffer_object +typedef ptrdiff_t GLintptrARB; typedef ptrdiff_t GLsizeiptrARB; #endif @@ -78,13 +79,25 @@ typedef ptrdiff_t GLsizeiptrARB; typedef char GLchar; #endif -// ARB_pixel_buffer_object +// ARB_vertex_buffer_object typedef void (APIENTRY *_glBindBuffer) (GLenum, GLuint); typedef void (APIENTRY *_glDeleteBuffers) (GLsizei, const GLuint *); typedef void (APIENTRY *_glGenBuffers) (GLsizei, GLuint *); typedef void (APIENTRY *_glBufferData) (GLenum, GLsizeiptrARB, const GLvoid *, GLenum); +typedef void (APIENTRY *_glBufferSubData) (GLenum, GLintptrARB, GLsizeiptrARB, const GLvoid *); +typedef void (APIENTRY *_glGetBufferSubData) (GLenum, GLintptrARB, GLsizeiptrARB, GLvoid *); +typedef void (APIENTRY *_glGetBufferParameteriv) (GLenum, GLenum, GLint *); typedef GLvoid* (APIENTRY *_glMapBufferARB) (GLenum, GLenum); typedef GLboolean (APIENTRY *_glUnmapBufferARB) (GLenum); +// We can call the buffer functions directly in OpenGL/ES 1.1 or higher, +// but all other platforms need to resolve the extensions. +#if defined(QT_OPENGL_ES) +#if defined(GL_OES_VERSION_1_0) && !defined(GL_OES_VERSION_1_1) +#define QGL_RESOLVE_BUFFER_FUNCS 1 +#endif +#else +#define QGL_RESOLVE_BUFFER_FUNCS 1 +#endif // ARB_fragment_program typedef void (APIENTRY *_glProgramStringARB) (GLenum, GLenum, GLsizei, const GLvoid *); @@ -285,11 +298,14 @@ struct QGLExtensionFuncs qt_glRenderbufferStorageMultisampleEXT = 0; // Buffer objects: -#if !defined(QT_OPENGL_ES_2) +#if defined(QGL_RESOLVE_BUFFER_FUNCS) qt_glBindBuffer = 0; qt_glDeleteBuffers = 0; qt_glGenBuffers = 0; qt_glBufferData = 0; + qt_glBufferSubData = 0; + qt_glGetBufferSubData = 0; + qt_glGetBufferParameteriv = 0; #endif qt_glMapBufferARB = 0; qt_glUnmapBufferARB = 0; @@ -397,11 +413,14 @@ struct QGLExtensionFuncs _glRenderbufferStorageMultisampleEXT qt_glRenderbufferStorageMultisampleEXT; // Buffer objects -#if !defined(QT_OPENGL_ES_2) +#if defined(QGL_RESOLVE_BUFFER_FUNCS) _glBindBuffer qt_glBindBuffer; _glDeleteBuffers qt_glDeleteBuffers; _glGenBuffers qt_glGenBuffers; _glBufferData qt_glBufferData; + _glBufferSubData qt_glBufferSubData; + _glGetBufferSubData qt_glGetBufferSubData; + _glGetBufferParameteriv qt_glGetBufferParameteriv; #endif _glMapBufferARB qt_glMapBufferARB; _glUnmapBufferARB qt_glUnmapBufferARB; @@ -681,11 +700,14 @@ struct QGLExtensionFuncs // Buffer objects -#if !defined(QT_OPENGL_ES_2) +#if defined(QGL_RESOLVE_BUFFER_FUNCS) #define glBindBuffer QGLContextPrivate::extensionFuncs(ctx).qt_glBindBuffer #define glDeleteBuffers QGLContextPrivate::extensionFuncs(ctx).qt_glDeleteBuffers #define glGenBuffers QGLContextPrivate::extensionFuncs(ctx).qt_glGenBuffers #define glBufferData QGLContextPrivate::extensionFuncs(ctx).qt_glBufferData +#define glBufferSubData QGLContextPrivate::extensionFuncs(ctx).qt_glBufferSubData +#define glGetBufferSubData QGLContextPrivate::extensionFuncs(ctx).qt_glGetBufferSubData +#define glGetBufferParameteriv QGLContextPrivate::extensionFuncs(ctx).qt_glGetBufferParameteriv #endif #define glMapBufferARB QGLContextPrivate::extensionFuncs(ctx).qt_glMapBufferARB #define glUnmapBufferARB QGLContextPrivate::extensionFuncs(ctx).qt_glUnmapBufferARB diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index 3198a65..1abf9b7 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -462,7 +462,7 @@ SUBDIRS += \ rcc \ windowsmobile -contains(QT_CONFIG,opengl):SUBDIRS += qgl +contains(QT_CONFIG,opengl):SUBDIRS += qgl qglbuffer contains(QT_CONFIG,qt3support):!wince*:SUBDIRS += $$Q3SUBDIRS diff --git a/tests/auto/qglbuffer/qglbuffer.pro b/tests/auto/qglbuffer/qglbuffer.pro new file mode 100644 index 0000000..07d05bb --- /dev/null +++ b/tests/auto/qglbuffer/qglbuffer.pro @@ -0,0 +1,9 @@ +############################################################ +# Project file for autotest for file qglbuffer.h +############################################################ + +load(qttest_p4) +requires(contains(QT_CONFIG,opengl)) +QT += opengl + +SOURCES += tst_qglbuffer.cpp diff --git a/tests/auto/qglbuffer/tst_qglbuffer.cpp b/tests/auto/qglbuffer/tst_qglbuffer.cpp new file mode 100644 index 0000000..b7d5821 --- /dev/null +++ b/tests/auto/qglbuffer/tst_qglbuffer.cpp @@ -0,0 +1,261 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtOpenGL module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include + +class tst_QGLBuffer : public QObject +{ + Q_OBJECT +public: + tst_QGLBuffer() {} + ~tst_QGLBuffer() {} + +private slots: + void vertexBuffer_data(); + void vertexBuffer(); + void indexBuffer_data(); + void indexBuffer(); + void bufferSharing(); + +private: + void testBuffer(QGLBuffer::Type type); +}; + +void tst_QGLBuffer::vertexBuffer_data() +{ + QTest::addColumn("usagePattern"); + + QTest::newRow("StreamDraw") << int(QGLBuffer::StreamDraw); + QTest::newRow("StaticDraw") << int(QGLBuffer::StaticDraw); + QTest::newRow("DynamicDraw") << int(QGLBuffer::DynamicDraw); +} + +void tst_QGLBuffer::vertexBuffer() +{ + testBuffer(QGLBuffer::VertexBuffer); +} + +void tst_QGLBuffer::indexBuffer_data() +{ + vertexBuffer_data(); +} + +void tst_QGLBuffer::indexBuffer() +{ + testBuffer(QGLBuffer::IndexBuffer); +} + +void tst_QGLBuffer::testBuffer(QGLBuffer::Type type) +{ + QFETCH(int, usagePattern); + + QGLWidget w; + w.makeCurrent(); + + // Create the local object, but not the buffer in the server. + QGLBuffer buffer(type); + QVERIFY(buffer.usagePattern() == QGLBuffer::StaticDraw); + buffer.setUsagePattern(QGLBuffer::UsagePattern(usagePattern)); + + // Check the initial state. + QVERIFY(buffer.type() == type); + QVERIFY(!buffer.isCreated()); + QVERIFY(buffer.bufferId() == 0); + QVERIFY(buffer.usagePattern() == QGLBuffer::UsagePattern(usagePattern)); + QCOMPARE(buffer.size(), -1); + + // Should not be able to bind it yet because it isn't created. + QVERIFY(!buffer.bind()); + + // Create the buffer - if this fails, then assume that the + // GL implementation does not support buffers at all. + if (!buffer.create()) + QSKIP("Buffers are not supported on this platform", SkipAll); + + // Should now have a buffer id. + QVERIFY(buffer.bufferId() != 0); + + // Bind the buffer and upload some data. + QVERIFY(buffer.bind()); + static GLfloat const data[] = {1, 2, 3, 4, 5, 6, 7, 8, 9}; + buffer.allocate(data, sizeof(data)); + + // Check the buffer size. + QCOMPARE(buffer.size(), int(sizeof(data))); + + // Map the buffer and read back its contents. + bool haveMap = false; + GLfloat *mapped = reinterpret_cast + (buffer.map(QGLBuffer::ReadOnly)); + if (mapped) { + for (int index = 0; index < 9; ++index) + QCOMPARE(mapped[index], data[index]); + buffer.unmap(); + haveMap = true; + } else { + qWarning("QGLBuffer::map() is not supported on this platform"); + } + + // Read back the buffer contents using read(). + bool haveRead = false; + GLfloat readdata[9]; + if (buffer.read(0, readdata, sizeof(readdata))) { + for (int index = 0; index < 9; ++index) + QCOMPARE(readdata[index], data[index]); + haveRead = true; + } else { + qWarning("QGLBuffer::read() is not supported on this platform"); + } + + // Write some different data to a specific location and check it. + static GLfloat const diffdata[] = {11, 12, 13}; + buffer.write(sizeof(GLfloat) * 3, diffdata, sizeof(diffdata)); + if (haveMap) { + mapped = reinterpret_cast(buffer.map(QGLBuffer::ReadOnly)); + QVERIFY(mapped != 0); + for (int index = 0; index < 9; ++index) { + if (index >= 3 && index <= 5) + QCOMPARE(mapped[index], diffdata[index - 3]); + else + QCOMPARE(mapped[index], data[index]); + } + buffer.unmap(); + } + if (haveRead) { + QVERIFY(buffer.read(0, readdata, sizeof(readdata))); + for (int index = 0; index < 9; ++index) { + if (index >= 3 && index <= 5) + QCOMPARE(readdata[index], diffdata[index - 3]); + else + QCOMPARE(readdata[index], data[index]); + } + } + + // Write to the buffer using the return value from map. + if (haveMap) { + mapped = reinterpret_cast(buffer.map(QGLBuffer::WriteOnly)); + QVERIFY(mapped != 0); + mapped[6] = 14; + buffer.unmap(); + + mapped = reinterpret_cast(buffer.map(QGLBuffer::ReadOnly)); + QVERIFY(mapped != 0); + static GLfloat const diff2data[] = {11, 12, 13, 14}; + for (int index = 0; index < 9; ++index) { + if (index >= 3 && index <= 6) + QCOMPARE(mapped[index], diff2data[index - 3]); + else + QCOMPARE(mapped[index], data[index]); + } + buffer.unmap(); + } + + // Resize the buffer. + buffer.allocate(sizeof(GLfloat) * 20); + QCOMPARE(buffer.size(), int(sizeof(GLfloat) * 20)); + buffer.allocate(0, sizeof(GLfloat) * 32); + QCOMPARE(buffer.size(), int(sizeof(GLfloat) * 32)); + + // Release the buffer. + buffer.release(); +} + +void tst_QGLBuffer::bufferSharing() +{ + QGLWidget *w1 = new QGLWidget(); + w1->makeCurrent(); + + QGLWidget *w2 = new QGLWidget(0, w1); + if (!w2->isSharing()) { + delete w2; + delete w1; + QSKIP("Context sharing is not supported on this platform", SkipSingle); + } + + // Bind the buffer in the first context and write some data to it. + QGLBuffer buffer(QGLBuffer::VertexBuffer); + if (!buffer.create()) + QSKIP("Buffers are not supported on this platform", SkipSingle); + QVERIFY(buffer.isCreated()); + QVERIFY(buffer.bind()); + static GLfloat const data[] = {1, 2, 3, 4, 5, 6, 7, 8, 9}; + buffer.allocate(data, sizeof(data)); + QCOMPARE(buffer.size(), int(sizeof(data))); + buffer.release(); + + // Bind the buffer in the second context and read back the data. + w2->makeCurrent(); + QVERIFY(buffer.bind()); + QCOMPARE(buffer.size(), int(sizeof(data))); + GLfloat readdata[9]; + if (buffer.read(0, readdata, sizeof(readdata))) { + for (int index = 0; index < 9; ++index) + QCOMPARE(readdata[index], data[index]); + } + buffer.release(); + + // Delete the first context. + delete w1; + + // Make the second context current again because deleting the first + // one will call doneCurrent() even though it wasn't current! + w2->makeCurrent(); + + // The buffer should still be valid in the second context. + QVERIFY(buffer.bufferId() != 0); + QVERIFY(buffer.isCreated()); + QVERIFY(buffer.bind()); + QCOMPARE(buffer.size(), int(sizeof(data))); + buffer.release(); + + // Delete the second context. + delete w2; + + // The buffer should now be invalid. + QVERIFY(buffer.bufferId() == 0); + QVERIFY(!buffer.isCreated()); +} + +QTEST_MAIN(tst_QGLBuffer) + +#include "tst_qglbuffer.moc" -- cgit v0.12 From a16a6e6fb3cf9d9c70515d2361bc06c598c27f3f Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Mon, 1 Feb 2010 11:03:16 +1000 Subject: Promote QPixmap::convertFromImage() to public API from Qt3Support QPixmap::fromImage() creates a new pixmap from a QImage. There was no way to replace a pixmap with a new QImage in-place without using the private QPixmapData API. This change promotes the Qt3Support function convertFromImage() back to official status for updating a pixmap in-place. Task-number: QTBUG-7361 Reviewed-by: Tom Cooksey --- src/gui/image/qpixmap.cpp | 20 ++++++++++++++++++-- src/gui/image/qpixmap.h | 4 ++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index 5626485..fe03c93 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -1379,10 +1379,26 @@ void QPixmap::deref() */ /*! - \fn bool QPixmap::convertFromImage(const QImage &image, Qt::ImageConversionFlags flags) + Replaces this pixmap's data with the given \a image using the specified + \a flags to control the conversion. The \a flags argument is a + bitwise-OR of the \l{Qt::ImageConversionFlags}. Passing 0 for \a + flags sets all the default options. - Use the static fromImage() function instead. + Note: this function was part of Qt 3 support in Qt 4.6 and earlier. + It has been promoted to official API status in 4.7 to support updating + the pixmap's image without creating a new QPixmap as fromImage() would. + + \sa fromImage() + \since 4.7 */ +bool QPixmap::convertFromImage(const QImage &image, Qt::ImageConversionFlags flags) +{ + if (image.isNull() || !data) + *this = QPixmap::fromImage(image, flags); + else + data->fromImage(image, flags); + return !isNull(); +} /*! \fn QPixmap QPixmap::xForm(const QMatrix &matrix) const diff --git a/src/gui/image/qpixmap.h b/src/gui/image/qpixmap.h index 46363f0..180af3b 100644 --- a/src/gui/image/qpixmap.h +++ b/src/gui/image/qpixmap.h @@ -141,6 +141,8 @@ public: bool save(const QString& fileName, const char* format = 0, int quality = -1) const; bool save(QIODevice* device, const char* format = 0, int quality = -1) const; + bool convertFromImage(const QImage &img, Qt::ImageConversionFlags flags = Qt::AutoColor); + #if defined(Q_WS_WIN) enum HBitmapFormat { NoAlpha, @@ -224,8 +226,6 @@ public: QT3_SUPPORT QPixmap &operator=(const QImage &); inline QT3_SUPPORT QImage convertToImage() const { return toImage(); } QT3_SUPPORT bool convertFromImage(const QImage &, ColorMode mode); - QT3_SUPPORT bool convertFromImage(const QImage &img, Qt::ImageConversionFlags flags = Qt::AutoColor) - { (*this) = fromImage(img, flags); return !isNull(); } inline QT3_SUPPORT operator QImage() const { return toImage(); } inline QT3_SUPPORT QPixmap xForm(const QMatrix &matrix) const { return transformed(QTransform(matrix)); } inline QT3_SUPPORT bool selfMask() const { return false; } -- cgit v0.12 From 533e40ca32eefe271e385bb2740e001ffc82b9e6 Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Mon, 1 Feb 2010 14:45:10 +1000 Subject: Placate pedantic compiler warning modes on QGLBuffer Reviewed-by: Sarah Smith --- src/opengl/qglbuffer.cpp | 22 +++++++++++----------- src/opengl/qglbuffer.h | 8 ++++---- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/opengl/qglbuffer.cpp b/src/opengl/qglbuffer.cpp index 2018086..62f6078 100644 --- a/src/opengl/qglbuffer.cpp +++ b/src/opengl/qglbuffer.cpp @@ -251,7 +251,7 @@ bool QGLBuffer::isCreated() const } /*! - Reads the \a size bytes in this buffer starting at \a offset + Reads the \a count bytes in this buffer starting at \a offset into \a data. Returns true on success; false if reading from the buffer is not supported. Buffer reading is not supported under OpenGL/ES. @@ -260,14 +260,14 @@ bool QGLBuffer::isCreated() const \sa write(), bind() */ -bool QGLBuffer::read(int offset, void *data, int size) +bool QGLBuffer::read(int offset, void *data, int count) { #if !defined(QT_OPENGL_ES) Q_D(QGLBuffer); if (!glGetBufferSubData || !d->guard.id()) return false; while (glGetError() != GL_NO_ERROR) ; // Clear error state. - glGetBufferSubData(d->type, offset, size, data); + glGetBufferSubData(d->type, offset, count, data); return glGetError() == GL_NO_ERROR; #else Q_UNUSED(offset); @@ -278,7 +278,7 @@ bool QGLBuffer::read(int offset, void *data, int size) } /*! - Replaces the \a size bytes of this buffer starting at \a offset + Replaces the \a count bytes of this buffer starting at \a offset with the contents of \a data. Any other bytes in the buffer will be left unmodified. @@ -287,15 +287,15 @@ bool QGLBuffer::read(int offset, void *data, int size) \sa create(), read(), allocate() */ -void QGLBuffer::write(int offset, const void *data, int size) +void QGLBuffer::write(int offset, const void *data, int count) { Q_D(QGLBuffer); if (d->guard.id()) - glBufferSubData(d->type, offset, size, data); + glBufferSubData(d->type, offset, count, data); } /*! - Allocates \a size bytes of space to the buffer, initialized to + Allocates \a count bytes of space to the buffer, initialized to the contents of \a data. Any previous contents will be removed. It is assumed that create() has been called on this buffer and that @@ -303,18 +303,18 @@ void QGLBuffer::write(int offset, const void *data, int size) \sa create(), read(), write() */ -void QGLBuffer::allocate(const void *data, int size) +void QGLBuffer::allocate(const void *data, int count) { Q_D(QGLBuffer); if (d->guard.id()) - glBufferData(d->type, size, data, d->actualUsagePattern); + glBufferData(d->type, count, data, d->actualUsagePattern); } /*! - \fn void QGLBuffer::allocate(int size) + \fn void QGLBuffer::allocate(int count) \overload - Allocates \a size bytes of space to the buffer. Any previous + Allocates \a count bytes of space to the buffer. Any previous contents will be removed. It is assumed that create() has been called on this buffer and that diff --git a/src/opengl/qglbuffer.h b/src/opengl/qglbuffer.h index 68ee56c..ecb86e2 100644 --- a/src/opengl/qglbuffer.h +++ b/src/opengl/qglbuffer.h @@ -101,11 +101,11 @@ public: int size() const; - bool read(int offset, void *data, int size); - void write(int offset, const void *data, int size); + bool read(int offset, void *data, int count); + void write(int offset, const void *data, int count); - void allocate(const void *data, int size); - inline void allocate(int size) { allocate(0, size); } + void allocate(const void *data, int count); + inline void allocate(int count) { allocate(0, count); } void *map(QGLBuffer::Access access); bool unmap(); -- cgit v0.12 From fe849f50ca83f50f6068b7d494cb228fae1d6309 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Mon, 1 Feb 2010 14:30:01 +0100 Subject: Geometry Shader support in QGLShaderProgram --- src/opengl/qglextensions.cpp | 6 ++ src/opengl/qglextensions_p.h | 46 ++++++++++++ src/opengl/qglshaderprogram.cpp | 153 ++++++++++++++++++++++++++++++++++++++++ src/opengl/qglshaderprogram.h | 24 ++++++- 4 files changed, 228 insertions(+), 1 deletion(-) diff --git a/src/opengl/qglextensions.cpp b/src/opengl/qglextensions.cpp index c091191..a4b2dc1 100644 --- a/src/opengl/qglextensions.cpp +++ b/src/opengl/qglextensions.cpp @@ -220,6 +220,12 @@ bool qt_resolve_buffer_extensions(QGLContext *ctx) bool qt_resolve_glsl_extensions(QGLContext *ctx) { + // Geometry shaders are optional... + glProgramParameteriEXT = (_glProgramParameteriEXT) ctx->getProcAddress(QLatin1String("glProgramParameteriEXT")); + glFramebufferTextureEXT = (_glFramebufferTextureEXT) ctx->getProcAddress(QLatin1String("glFramebufferTextureEXT")); + glFramebufferTextureLayerEXT = (_glFramebufferTextureLayerEXT) ctx->getProcAddress(QLatin1String("glFramebufferTextureLayerEXT")); + glFramebufferTextureFaceEXT = (_glFramebufferTextureFaceEXT) ctx->getProcAddress(QLatin1String("glFramebufferTextureFaceEXT")); + #if defined(QT_OPENGL_ES_2) // The GLSL shader functions are always present in OpenGL/ES 2.0. // The only exceptions are glGetProgramBinaryOES and glProgramBinaryOES. diff --git a/src/opengl/qglextensions_p.h b/src/opengl/qglextensions_p.h index 86096d2..e65e3a1 100644 --- a/src/opengl/qglextensions_p.h +++ b/src/opengl/qglextensions_p.h @@ -184,6 +184,15 @@ typedef void (APIENTRY *_glBlitFramebufferEXT) (int srcX0, int srcY0, int srcX1, typedef void (APIENTRY *_glRenderbufferStorageMultisampleEXT) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +// GL_EXT_geometry_shader4 +typedef void (APIENTRY *_glProgramParameteriEXT)(GLuint program, GLenum pname, GLint value); +typedef void (APIENTRY *_glFramebufferTextureEXT)(GLenum target, GLenum attachment, + GLuint texture, GLint level); +typedef void (APIENTRY *_glFramebufferTextureLayerEXT)(GLenum target, GLenum attachment, + GLuint texture, GLint level, GLint layer); +typedef void (APIENTRY *_glFramebufferTextureFaceEXT)(GLenum target, GLenum attachment, + GLuint texture, GLint level, GLenum face); + // ARB_texture_compression typedef void (APIENTRY *_glCompressedTexImage2DARB) (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); @@ -294,6 +303,10 @@ struct QGLExtensionFuncs qt_glMapBufferARB = 0; qt_glUnmapBufferARB = 0; + qt_glProgramParameteriEXT = 0; + qt_glFramebufferTextureEXT = 0; + qt_glFramebufferTextureLayerEXT = 0; + qt_glFramebufferTextureFaceEXT = 0; #if !defined(QT_OPENGL_ES) // Texture compression qt_glCompressedTexImage2DARB = 0; @@ -406,6 +419,11 @@ struct QGLExtensionFuncs _glMapBufferARB qt_glMapBufferARB; _glUnmapBufferARB qt_glUnmapBufferARB; + // Geometry shaders... + _glProgramParameteriEXT qt_glProgramParameteriEXT; + _glFramebufferTextureEXT qt_glFramebufferTextureEXT; + _glFramebufferTextureLayerEXT qt_glFramebufferTextureLayerEXT; + _glFramebufferTextureFaceEXT qt_glFramebufferTextureFaceEXT; #if !defined(QT_OPENGL_ES) // Texture compression _glCompressedTexImage2DARB qt_glCompressedTexImage2DARB; @@ -642,6 +660,29 @@ struct QGLExtensionFuncs #define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A #endif +// Geometry shader defines +#ifndef GL_GEOMETRY_SHADER_EXT +# define GL_GEOMETRY_SHADER_EXT 0x8DD9 +# define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA +# define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB +# define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC +# define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 +# define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD +# define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE +# define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B +# define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF +# define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 +# define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 +# define GL_LINES_ADJACENCY_EXT 0xA +# define GL_LINE_STRIP_ADJACENCY_EXT 0xB +# define GL_TRIANGLES_ADJACENCY_EXT 0xC +# define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0xD +# define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 +# define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9 +# define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 +# define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 +# define GL_PROGRAM_POINT_SIZE_EXT 0x8642 +#endif #if !defined(QT_OPENGL_ES_2) #define glProgramStringARB QGLContextPrivate::extensionFuncs(ctx).qt_glProgramStringARB @@ -759,6 +800,11 @@ struct QGLExtensionFuncs #define glClearDepth glClearDepthf #endif +#define glProgramParameteriEXT QGLContextPrivate::extensionFuncs(ctx).qt_glProgramParameteriEXT +#define glFramebufferTextureEXT QGLContextPrivate::extensionFuncs(ctx).qt_glFramebufferTextureEXT +#define glFramebufferTextureLayerEXT QGLContextPrivate::extensionFuncs(ctx).qt_glFramebufferTextureLayerEXT +#define glFramebufferTextureFaceEXT QGLContextPrivate::extensionFuncs(ctx).qt_glFramebufferTextureFaceEXT + #if !defined(QT_OPENGL_ES) #define glCompressedTexImage2D QGLContextPrivate::extensionFuncs(ctx).qt_glCompressedTexImage2DARB #endif diff --git a/src/opengl/qglshaderprogram.cpp b/src/opengl/qglshaderprogram.cpp index 5e2f1f5..43d1df8 100644 --- a/src/opengl/qglshaderprogram.cpp +++ b/src/opengl/qglshaderprogram.cpp @@ -213,6 +213,8 @@ bool QGLShaderPrivate::create() GLuint shader; if (shaderType == QGLShader::Vertex) shader = glCreateShader(GL_VERTEX_SHADER); + else if (shaderType == QGLShader::Geometry) + shader = glCreateShader(GL_GEOMETRY_SHADER_EXT); else shader = glCreateShader(GL_FRAGMENT_SHADER); if (!shader) { @@ -496,6 +498,10 @@ GLuint QGLShader::shaderId() const return d->shaderGuard.id(); } + + + + #undef ctx #define ctx programGuard.context() @@ -508,8 +514,12 @@ public: , linked(false) , inited(false) , removingShaders(false) + , geometryVertexCount(64) + , geometryInputType(0) + , geometryOutputType(0) , vertexShader(0) , fragmentShader(0) + , geometryShader(0) { } ~QGLShaderProgramPrivate(); @@ -518,11 +528,17 @@ public: bool linked; bool inited; bool removingShaders; + + int geometryVertexCount; + GLenum geometryInputType; + GLenum geometryOutputType; + QString log; QList shaders; QList anonShaders; QGLShader *vertexShader; QGLShader *fragmentShader; + QGLShader *geometryShader; bool hasShader(QGLShader::ShaderType type) const; }; @@ -820,6 +836,22 @@ bool QGLShaderProgram::link() GLuint program = d->programGuard.id(); if (!program) return false; + + // Set up the geometry shader parameters + if (glProgramParameteriEXT) { + foreach (QGLShader *shader, d->shaders) { + if (shader->shaderType() & QGLShader::Geometry) { + glProgramParameteriEXT(program, GL_GEOMETRY_INPUT_TYPE_EXT, + d->geometryInputType); + glProgramParameteriEXT(program, GL_GEOMETRY_OUTPUT_TYPE_EXT, + d->geometryOutputType); + glProgramParameteriEXT(program, GL_GEOMETRY_VERTICES_OUT_EXT, + d->geometryVertexCount); + break; + } + } + } + glLinkProgram(program); GLint value = 0; glGetProgramiv(program, GL_LINK_STATUS, &value); @@ -2830,6 +2862,97 @@ void QGLShaderProgram::setUniformValueArray(const char *name, const QMatrix4x4 * #undef ctx /*! + Returns the hardware limit for how many vertices a geometry shader + can output. + + \sa setGeometryShaderOutputVertexCount +*/ +int QGLShaderProgram::maxGeometryOutputVertices() const +{ + int n; + glGetIntegerv(GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT, &n); + return n; +} + + + +/*! + Sets the maximum number of vertices the current geometry shader + program will produce, if active. + + This parameter takes effect the next time the program is linked. +*/ +void QGLShaderProgram::setGeometryOutputVertexCount(int count) +{ +#ifndef QT_NO_DEBUG + int max = maxGeometryOutputVertices(); + if (count > max) { + qWarning("QGLShaderProgram::setGeometryOutputVertexCount: count: %d higher than maximum: %d", + count, max); + } +#endif + d_func()->geometryVertexCount = count; +} + + +/*! + Returns the maximum number of vertices the current geometry shader + program will produce, if active. + + This parameter takes effect the ntext time the program is linked. +*/ +int QGLShaderProgram::geometryOutputVertexCount() const +{ + return d_func()->geometryVertexCount; +} + + +/*! + Sets the output type from the geometry shader, if active. + + This parameter takes effect the next time the program is linked. +*/ +void QGLShaderProgram::setGeometryInputType(GLenum inputType) +{ + d_func()->geometryInputType = inputType; +} + + +/*! + Returns the geometry shader input type, if active. + + This parameter takes effect the next time the program is linked. + */ + +GLenum QGLShaderProgram::geometryInputType() const +{ + return d_func()->geometryInputType; +} + + +/*! + Sets the output type from the geometry shader, if active. + + This parameter takes effect the next time the program is linked. +*/ +void QGLShaderProgram::setGeometryOutputType(GLenum outputType) +{ + d_func()->geometryOutputType = outputType; +} + + +/*! + Returns the geometry shader output type, if active. + + This parameter takes effect the next time the program is linked. + */ +GLenum QGLShaderProgram::geometryOutputType() const +{ + return d_func()->geometryOutputType; +} + + +/*! Returns true if shader programs written in the OpenGL Shading Language (GLSL) are supported on this system; false otherwise. @@ -2861,6 +2984,36 @@ void QGLShaderProgram::shaderDestroyed() removeShader(shader); } + +#undef ctx +#undef context + +/*! + Returns true if shader programs of type \a type are supported on + this system; false otherwise. + + The \a context is used to resolve the GLSL extensions. + If \a context is null, then QGLContext::currentContext() is used. +*/ +bool QGLShader::hasShaders(ShaderType type, const QGLContext *context) +{ +#if !defined(QT_OPENGL_ES_2) + if (!context) + context = QGLContext::currentContext(); + if (!context) + return false; +#endif + bool resolved = qt_resolve_glsl_extensions(const_cast(context)); + if (!resolved) + return false; + const QGLContext *ctx = context; + if ((type & Geometry) && !glProgramParameteriEXT) + return false; + return true; +} + + + #ifdef Q_MAC_COMPAT_GL_FUNCTIONS /*! \internal */ void QGLShaderProgram::setUniformValue(int location, QMacCompatGLint value) diff --git a/src/opengl/qglshaderprogram.h b/src/opengl/qglshaderprogram.h index 24ab986..face66e 100644 --- a/src/opengl/qglshaderprogram.h +++ b/src/opengl/qglshaderprogram.h @@ -66,7 +66,8 @@ public: enum ShaderTypeBit { Vertex = 0x0001, - Fragment = 0x0002 + Fragment = 0x0002, + Geometry = 0x0004 }; Q_DECLARE_FLAGS(ShaderType, ShaderTypeBit) @@ -88,6 +89,8 @@ public: GLuint shaderId() const; + static bool hasShaders(ShaderType type, const QGLContext *context = 0); + private: friend class QGLShaderProgram; @@ -104,6 +107,14 @@ class Q_OPENGL_EXPORT QGLShaderProgram : public QObject { Q_OBJECT public: + enum GeometryTypes + { + LinesWithAdjacencyGeometryType = 0xa, + LineStripWithAdjacencyGeometryType = 0xb, + TrianglesWithAdjacencyGeometryType = 0xc, + TriangleStripWithAdjacencyGeometryType = 0xd + }; + explicit QGLShaderProgram(QObject *parent = 0); explicit QGLShaderProgram(const QGLContext *context, QObject *parent = 0); virtual ~QGLShaderProgram(); @@ -128,6 +139,17 @@ public: GLuint programId() const; + int maxGeometryOutputVertices() const; + + void setGeometryOutputVertexCount(int count); + int geometryOutputVertexCount() const; + + void setGeometryInputType(GLenum inputType); + GLenum geometryInputType() const; + + void setGeometryOutputType(GLenum outputType); + GLenum geometryOutputType() const; + void bindAttributeLocation(const char *name, int location); void bindAttributeLocation(const QByteArray& name, int location); void bindAttributeLocation(const QString& name, int location); -- cgit v0.12 From ec4eeb8f52b4a5841a3345db415b496adae2dee2 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Mon, 1 Feb 2010 14:37:44 +0100 Subject: Use RefPtr to store QScriptProgram's EvalExecutable Otherwise we crash with latest WebKit trunk because the SourceProvider is prematurely destructed. --- src/script/api/qscriptprogram.cpp | 9 ++++----- src/script/api/qscriptprogram_p.h | 4 +++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/script/api/qscriptprogram.cpp b/src/script/api/qscriptprogram.cpp index c452052..d4a32f4 100644 --- a/src/script/api/qscriptprogram.cpp +++ b/src/script/api/qscriptprogram.cpp @@ -63,7 +63,6 @@ QScriptProgramPrivate::QScriptProgramPrivate(const QString &src, QScriptProgramPrivate::~QScriptProgramPrivate() { - delete _executable; } QScriptProgramPrivate *QScriptProgramPrivate::get(const QScriptProgram &q) @@ -76,17 +75,17 @@ JSC::EvalExecutable *QScriptProgramPrivate::executable(JSC::ExecState *exec, { if (_executable) { if (eng == engine) - return _executable; - delete _executable; + return _executable.get(); + _executable = 0; } WTF::PassRefPtr provider = QScript::UStringSourceProviderWithFeedback::create(sourceCode, fileName, firstLineNumber, eng); sourceId = provider->asID(); JSC::SourceCode source(provider, firstLineNumber); //after construction of SourceCode provider variable will be null. - _executable = new JSC::EvalExecutable(exec, source); + _executable = JSC::EvalExecutable::create(exec, source); engine = eng; isCompiled = false; - return _executable; + return _executable.get(); } /*! diff --git a/src/script/api/qscriptprogram_p.h b/src/script/api/qscriptprogram_p.h index 427ab34..95e75fd 100644 --- a/src/script/api/qscriptprogram_p.h +++ b/src/script/api/qscriptprogram_p.h @@ -37,6 +37,8 @@ #include +#include "RefPtr.h" + namespace JSC { class EvalExecutable; @@ -67,7 +69,7 @@ public: int firstLineNumber; QScriptEnginePrivate *engine; - JSC::EvalExecutable *_executable; + WTF::RefPtr _executable; intptr_t sourceId; bool isCompiled; }; -- cgit v0.12 From 849257a1cf993275d6d1e7f39f8374cc4d879d13 Mon Sep 17 00:00:00 2001 From: ck Date: Mon, 1 Feb 2010 16:27:30 +0100 Subject: QAbstractItemModel docs: Fix typo. --- src/corelib/kernel/qabstractitemmodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/kernel/qabstractitemmodel.cpp b/src/corelib/kernel/qabstractitemmodel.cpp index fdbc5ba..bf69b4c 100644 --- a/src/corelib/kernel/qabstractitemmodel.cpp +++ b/src/corelib/kernel/qabstractitemmodel.cpp @@ -1265,7 +1265,7 @@ void QAbstractItemModelPrivate::columnsRemoved(const QModelIndex &parent, /*! \fn QModelIndex QAbstractItemModel::parent(const QModelIndex &index) const = 0 - Returns the parent of the model item with the given \a index. If the model + Returns the parent of the model item with the given \a index. If the item has no parent, an invalid QModelIndex is returned. A common convention used in models that expose tree data structures is that -- cgit v0.12 From cf3eddb9c917aa5180a961c2bc9700e47a5f8434 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Mon, 1 Feb 2010 19:24:25 +0100 Subject: Fixed handling of paths containing ".." in QFileSystemModel on Windows. Reviewed-by: Jan-Arve --- src/gui/dialogs/qfilesystemmodel.cpp | 84 ++++++++++++++++-------------------- 1 file changed, 38 insertions(+), 46 deletions(-) diff --git a/src/gui/dialogs/qfilesystemmodel.cpp b/src/gui/dialogs/qfilesystemmodel.cpp index ae75126..1016980 100644 --- a/src/gui/dialogs/qfilesystemmodel.cpp +++ b/src/gui/dialogs/qfilesystemmodel.cpp @@ -51,6 +51,9 @@ #ifdef Q_OS_WIN #include #endif +#ifdef Q_OS_WIN32 +#include +#endif QT_BEGIN_NAMESPACE @@ -278,53 +281,38 @@ QFileSystemModelPrivate::QFileSystemNode *QFileSystemModelPrivate::node(const QM return indexNode; } -#ifdef Q_OS_WIN +#ifdef Q_OS_WIN32 static QString qt_GetLongPathName(const QString &strShortPath) { - QString longPath; - int i = 0; - if (strShortPath == QLatin1String(".") - || (strShortPath.startsWith(QLatin1String("//"))) - || (strShortPath.startsWith(QLatin1String("\\\\")))) // unc + if (strShortPath.isEmpty() + || strShortPath == QLatin1String(".") || strShortPath == QLatin1String("..")) return strShortPath; - QString::const_iterator it = strShortPath.constBegin(); - QString::const_iterator constEnd = strShortPath.constEnd(); - do { - bool isSep = (*it == QLatin1Char('\\') || *it == QLatin1Char('/')); - if (isSep || it == constEnd) { - QString section = (it == constEnd ? strShortPath : strShortPath.left(i)); - // FindFirstFile does not handle volumes ("C:"), so we have to catch that ourselves. - if (section.endsWith(QLatin1Char(':'))) { - longPath.append(section.toUpper()); - } else { - HANDLE h; -#ifndef Q_OS_WINCE - //We add the extend length prefix to handle long path - QString longSection = QLatin1String("\\\\?\\")+QDir::toNativeSeparators(section); -#else - QString longSection = QDir::toNativeSeparators(section); -#endif - WIN32_FIND_DATA findData; - h = ::FindFirstFile((wchar_t*)longSection.utf16(), &findData); - if (h != INVALID_HANDLE_VALUE) { - longPath.append(QString::fromWCharArray(findData.cFileName)); - ::FindClose(h); - } else { - longPath.append(section); - break; - } - } - if (it != constEnd) - longPath.append(*it); - else - break; - } - ++it; - if (isSep && it == constEnd) // break out if the last character is a separator - break; - ++i; - } while (true); - return longPath; + if (strShortPath.length() == 2 && strShortPath.endsWith(QLatin1Char(':'))) + return strShortPath.toUpper(); + const QString absPath = QDir(strShortPath).absolutePath(); + if (absPath.startsWith(QLatin1String("//")) + || absPath.startsWith(QLatin1String("\\\\"))) // unc + return QDir::fromNativeSeparators(absPath); + if (absPath.startsWith(QLatin1Char('/'))) + return QString(); + const QString inputString = QLatin1String("\\\\?\\") + QDir::toNativeSeparators(absPath); + QVarLengthArray buffer(MAX_PATH); + DWORD result = ::GetLongPathName((wchar_t*)inputString.utf16(), + buffer.data(), + buffer.size()); + if (result > DWORD(buffer.size())) { + buffer.resize(result); + result = ::GetLongPathName((wchar_t*)inputString.utf16(), + buffer.data(), + buffer.size()); + } + if (result > 4) { + QString longPath = QString::fromWCharArray(buffer.data() + 4); // ignoring prefix + longPath[0] = longPath.at(0).toUpper(); // capital drive letters + return QDir::fromNativeSeparators(longPath); + } else { + return QDir::fromNativeSeparators(strShortPath); + } } #endif @@ -342,7 +330,7 @@ QFileSystemModelPrivate::QFileSystemNode *QFileSystemModelPrivate::node(const QS // Construct the nodes up to the new root path if they need to be built QString absolutePath; -#ifdef Q_OS_WIN +#ifdef Q_OS_WIN32 QString longPath = qt_GetLongPathName(path); #else QString longPath = path; @@ -1357,7 +1345,11 @@ QModelIndex QFileSystemModel::setRootPath(const QString &newPath) { Q_D(QFileSystemModel); #ifdef Q_OS_WIN - QString longNewPath = QDir::fromNativeSeparators(qt_GetLongPathName(newPath)); +#ifdef Q_OS_WIN32 + QString longNewPath = qt_GetLongPathName(newPath); +#else + QString longNewPath = QDir::fromNativeSeparators(newPath); +#endif #else QString longNewPath = newPath; #endif -- cgit v0.12 From 07e565096c5d209a16102f1d41c7ada8544a77d3 Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Tue, 2 Feb 2010 15:24:02 +1000 Subject: Add Q_MOVABLE_TYPE decls to QVector?D, QMatrix4x4, QQuaternion Marking these types are movable allows container classes to optimize for their unique properties. Reviewed-by: Sarah Smith Reviewed-by: Daniel Pope --- src/gui/math3d/qmatrix4x4.h | 2 ++ src/gui/math3d/qquaternion.h | 2 ++ src/gui/math3d/qvector2d.h | 2 ++ src/gui/math3d/qvector3d.h | 2 ++ src/gui/math3d/qvector4d.h | 2 ++ 5 files changed, 10 insertions(+) diff --git a/src/gui/math3d/qmatrix4x4.h b/src/gui/math3d/qmatrix4x4.h index f9902d7..0671fa8 100644 --- a/src/gui/math3d/qmatrix4x4.h +++ b/src/gui/math3d/qmatrix4x4.h @@ -208,6 +208,8 @@ private: friend class QGraphicsRotation; }; +Q_DECLARE_TYPEINFO(QMatrix4x4, Q_MOVABLE_TYPE); + inline QMatrix4x4::QMatrix4x4 (qreal m11, qreal m12, qreal m13, qreal m14, qreal m21, qreal m22, qreal m23, qreal m24, diff --git a/src/gui/math3d/qquaternion.h b/src/gui/math3d/qquaternion.h index a446f28..16aa5d0 100644 --- a/src/gui/math3d/qquaternion.h +++ b/src/gui/math3d/qquaternion.h @@ -136,6 +136,8 @@ private: qreal wp, xp, yp, zp; }; +Q_DECLARE_TYPEINFO(QQuaternion, Q_MOVABLE_TYPE); + inline QQuaternion::QQuaternion() : wp(1.0f), xp(0.0f), yp(0.0f), zp(0.0f) {} inline QQuaternion::QQuaternion(qreal aScalar, qreal xpos, qreal ypos, qreal zpos) : wp(aScalar), xp(xpos), yp(ypos), zp(zpos) {} diff --git a/src/gui/math3d/qvector2d.h b/src/gui/math3d/qvector2d.h index d76f35a..c92c5e0 100644 --- a/src/gui/math3d/qvector2d.h +++ b/src/gui/math3d/qvector2d.h @@ -126,6 +126,8 @@ private: friend class QVector4D; }; +Q_DECLARE_TYPEINFO(QVector2D, Q_MOVABLE_TYPE); + inline QVector2D::QVector2D() : xp(0.0f), yp(0.0f) {} inline QVector2D::QVector2D(float xpos, float ypos, int) : xp(xpos), yp(ypos) {} diff --git a/src/gui/math3d/qvector3d.h b/src/gui/math3d/qvector3d.h index 80c7152..2fdd1d3 100644 --- a/src/gui/math3d/qvector3d.h +++ b/src/gui/math3d/qvector3d.h @@ -141,6 +141,8 @@ private: #endif }; +Q_DECLARE_TYPEINFO(QVector3D, Q_MOVABLE_TYPE); + inline QVector3D::QVector3D() : xp(0.0f), yp(0.0f), zp(0.0f) {} inline QVector3D::QVector3D(qreal xpos, qreal ypos, qreal zpos) : xp(xpos), yp(ypos), zp(zpos) {} diff --git a/src/gui/math3d/qvector4d.h b/src/gui/math3d/qvector4d.h index 4af2961..a383fbb 100644 --- a/src/gui/math3d/qvector4d.h +++ b/src/gui/math3d/qvector4d.h @@ -138,6 +138,8 @@ private: #endif }; +Q_DECLARE_TYPEINFO(QVector4D, Q_MOVABLE_TYPE); + inline QVector4D::QVector4D() : xp(0.0f), yp(0.0f), zp(0.0f), wp(0.0f) {} inline QVector4D::QVector4D(qreal xpos, qreal ypos, qreal zpos, qreal wpos) : xp(xpos), yp(ypos), zp(zpos), wp(wpos) {} -- cgit v0.12 From e9b0c9a1d25a2260bd7c0e7ead840cacb31ce424 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 2 Feb 2010 10:50:49 +0100 Subject: Revert "add QModelIndex::rowCount() and QModelIndex::ColumnCount convenience methods" This reverts commit c74deadf4b7eeb2800b318e0952dac8f700d9236. The convinience method are missleading because it does not work for the root model index. Also, the test is missing, and the function should have been added in the mirror class QPersistentModelIndex Reviewed-by: Thierry Reviewed-by: Leo --- src/corelib/kernel/qabstractitemmodel.cpp | 22 +--------------------- src/corelib/kernel/qabstractitemmodel.h | 8 -------- 2 files changed, 1 insertion(+), 29 deletions(-) diff --git a/src/corelib/kernel/qabstractitemmodel.cpp b/src/corelib/kernel/qabstractitemmodel.cpp index fdbc5ba..dbf422e 100644 --- a/src/corelib/kernel/qabstractitemmodel.cpp +++ b/src/corelib/kernel/qabstractitemmodel.cpp @@ -1043,32 +1043,12 @@ void QAbstractItemModelPrivate::columnsRemoved(const QModelIndex &parent, /*! - \since 4.7 - - \fn int QModelIndex::rowCount() const - - Returns the number of children of this model index. - - \sa columnCount(), parent(), child(), sibling(), model() -*/ - -/*! - \since 4.7 - - \fn int QModelIndex::columnCount() const - - Returns the number of columns for the children of this model index. - - \sa rowCount(), parent(), child(), sibling(), model() -*/ - -/*! \fn QModelIndex QModelIndex::parent() const Returns the parent of the model index, or QModelIndex() if it has no parent. - \sa child(), sibling(), rowCount(), columnCount(), model() + \sa child(), sibling(), model() */ /*! diff --git a/src/corelib/kernel/qabstractitemmodel.h b/src/corelib/kernel/qabstractitemmodel.h index d91c383..63d9e6f 100644 --- a/src/corelib/kernel/qabstractitemmodel.h +++ b/src/corelib/kernel/qabstractitemmodel.h @@ -68,8 +68,6 @@ public: inline int column() const { return c; } inline void *internalPointer() const { return p; } inline qint64 internalId() const { return reinterpret_cast(p); } - inline int rowCount() const; - inline int columnCount() const; inline QModelIndex parent() const; inline QModelIndex sibling(int row, int column) const; inline QModelIndex child(int row, int column) const; @@ -387,12 +385,6 @@ inline QModelIndex::QModelIndex(int arow, int acolumn, void *adata, const QAbstractItemModel *amodel) : r(arow), c(acolumn), p(adata), m(amodel) {} -inline int QModelIndex::rowCount() const -{ return m ? m->rowCount(*this) : 0; } - -inline int QModelIndex::columnCount() const -{ return m ? m->columnCount(*this) : 0; } - inline QModelIndex QModelIndex::parent() const { return m ? m->parent(*this) : QModelIndex(); } -- cgit v0.12 From f063786144477336c462b06642fc3725c060311d Mon Sep 17 00:00:00 2001 From: ck Date: Tue, 2 Feb 2010 11:45:04 +0100 Subject: Assistant: Give meaningful context to translations. Reviewed-by: kh1 Instigated-by: Friedemann Kleint --- tools/assistant/lib/qhelp_global.cpp | 3 +- tools/assistant/lib/qhelpprojectdata.cpp | 47 ++++++++++++++-------- tools/assistant/tools/assistant/cmdlineparser.cpp | 6 ++- tools/assistant/tools/assistant/helpviewer.cpp | 5 ++- tools/assistant/tools/assistant/main.cpp | 40 +++++++++++------- .../assistant/tools/qcollectiongenerator/main.cpp | 21 ++++++---- tools/assistant/tools/qhelpgenerator/main.cpp | 11 +++-- 7 files changed, 85 insertions(+), 48 deletions(-) diff --git a/tools/assistant/lib/qhelp_global.cpp b/tools/assistant/lib/qhelp_global.cpp index 8e96b55..d8a94d3 100644 --- a/tools/assistant/lib/qhelp_global.cpp +++ b/tools/assistant/lib/qhelp_global.cpp @@ -39,6 +39,7 @@ ** ****************************************************************************/ +#include #include #include #include @@ -60,7 +61,7 @@ QString QHelpGlobal::uniquifyConnectionName(const QString &name, void *pointer) QString QHelpGlobal::documentTitle(const QString &content) { - QString title = QObject::tr("Untitled"); + QString title = QCoreApplication::translate("QHelp", "Untitled"); if (!content.isEmpty()) { int start = content.indexOf(QLatin1String(""), 0, Qt::CaseInsensitive) + 7; int end = content.indexOf(QLatin1String(""), 0, Qt::CaseInsensitive); diff --git a/tools/assistant/lib/qhelpprojectdata.cpp b/tools/assistant/lib/qhelpprojectdata.cpp index 869a446..83491a0 100644 --- a/tools/assistant/lib/qhelpprojectdata.cpp +++ b/tools/assistant/lib/qhelpprojectdata.cpp @@ -41,6 +41,7 @@ #include "qhelpprojectdata_p.h" +#include #include #include #include @@ -82,7 +83,7 @@ private: void QHelpProjectDataPrivate::raiseUnknownTokenError() { - raiseError(QObject::tr("Unknown token.")); + raiseError(QCoreApplication::translate("QHelpProject", "Unknown token.")); } void QHelpProjectDataPrivate::readData(const QByteArray &contents) @@ -95,12 +96,14 @@ void QHelpProjectDataPrivate::readData(const QByteArray &contents) && attributes().value(QLatin1String("version")) == QLatin1String("1.0")) readProject(); else - raiseError(QObject::tr("Unknown token. Expected \"QtHelpProject\"!")); + raiseError(QCoreApplication::translate("QHelpProject", + "Unknown token. Expected \"QtHelpProject\"!")); } } if (hasError()) { - raiseError(QObject::tr("Error in line %1: %2").arg(lineNumber()) + raiseError(QCoreApplication::translate("QHelpProject", + "Error in line %1: %2").arg(lineNumber()) .arg(errorString())); } } @@ -113,11 +116,15 @@ void QHelpProjectDataPrivate::readProject() if (name() == QLatin1String("virtualFolder")) { virtualFolder = readElementText(); if (virtualFolder.contains(QLatin1String("/"))) - raiseError(QObject::tr("A virtual folder must not contain a \'/\' character!")); + raiseError(QCoreApplication::translate("QHelpProject", + "A virtual folder must not contain " + "a \'/\' character!")); } else if (name() == QLatin1String("namespace")) { namespaceName = readElementText(); if (namespaceName.contains(QLatin1String("/"))) - raiseError(QObject::tr("A namespace must not contain a \'/\' character!")); + raiseError(QCoreApplication::translate("QHelpProject", + "A namespace must not contain a " + "\'/\' character!")); } else if (name() == QLatin1String("customFilter")) { readCustomFilter(); } else if (name() == QLatin1String("filterSection")) { @@ -125,17 +132,21 @@ void QHelpProjectDataPrivate::readProject() } else if (name() == QLatin1String("metaData")) { QString n = attributes().value(QLatin1String("name")).toString(); if (!metaData.contains(n)) - metaData[n] = attributes().value(QLatin1String("value")).toString(); + metaData[n] + = attributes().value(QLatin1String("value")).toString(); else - metaData.insert(n, attributes().value(QLatin1String("value")).toString()); + metaData.insert(n, attributes(). + value(QLatin1String("value")).toString()); } else { raiseUnknownTokenError(); } } else if (isEndElement() && name() == QLatin1String("QtHelpProject")) { if (namespaceName.isEmpty()) - raiseError(QObject::tr("Missing namespace in QtHelpProject.")); + raiseError(QCoreApplication::translate("QHelpProject", + "Missing namespace in QtHelpProject.")); else if (virtualFolder.isEmpty()) - raiseError(QObject::tr("Missing virtual folder in QtHelpProject")); + raiseError(QCoreApplication::translate("QHelpProject", + "Missing virtual folder in QtHelpProject")); break; } } @@ -223,12 +234,14 @@ void QHelpProjectDataPrivate::readKeywords() if (attributes().value(QLatin1String("ref")).toString().isEmpty() || (attributes().value(QLatin1String("name")).toString().isEmpty() && attributes().value(QLatin1String("id")).toString().isEmpty())) - raiseError(QObject::tr("Missing attribute in keyword at line %1.") - .arg(lineNumber())); - filterSectionList.last().addIndex( - QHelpDataIndexItem(attributes().value(QLatin1String("name")).toString(), - attributes().value(QLatin1String("id")).toString(), - attributes().value(QLatin1String("ref")).toString())); + raiseError(QCoreApplication::translate("QHelpProject", + "Missing attribute in keyword at line %1.") + .arg(lineNumber())); + filterSectionList.last() + .addIndex(QHelpDataIndexItem(attributes(). + value(QLatin1String("name")).toString(), + attributes().value(QLatin1String("id")).toString(), + attributes().value(QLatin1String("ref")).toString())); } else { raiseUnknownTokenError(); } @@ -346,8 +359,8 @@ bool QHelpProjectData::readData(const QString &fileName) d->rootPath = QFileInfo(fileName).absolutePath(); QFile file(fileName); if (!file.open(QIODevice::ReadOnly)) { - d->errorMsg = QObject::tr("The input file %1 could not be opened!") - .arg(fileName); + d->errorMsg = QCoreApplication::translate("QHelpProject", + "The input file %1 could not be opened!").arg(fileName); return false; } diff --git a/tools/assistant/tools/assistant/cmdlineparser.cpp b/tools/assistant/tools/assistant/cmdlineparser.cpp index b3ba93c..b063830 100644 --- a/tools/assistant/tools/assistant/cmdlineparser.cpp +++ b/tools/assistant/tools/assistant/cmdlineparser.cpp @@ -278,10 +278,12 @@ void CmdLineParser::showMessage(const QString &msg, bool error) return; #ifdef Q_OS_WIN QString s = QLatin1String("
") + msg + QLatin1String("
"); + const QString &message + = QCoreApplication::translate("Assistant", "Qt Assistant"), s); if (error) - QMessageBox::critical(0, QObject::tr("Qt Assistant"), s); + QMessageBox::critical(0, message); else - QMessageBox::information(0, QObject::tr("Qt Assistant"), s); + QMessageBox::information(0, message); #else fprintf(error ? stderr : stdout, "%s\n", qPrintable(msg)); #endif diff --git a/tools/assistant/tools/assistant/helpviewer.cpp b/tools/assistant/tools/assistant/helpviewer.cpp index bd75f3a..00504e7 100644 --- a/tools/assistant/tools/assistant/helpviewer.cpp +++ b/tools/assistant/tools/assistant/helpviewer.cpp @@ -67,8 +67,9 @@ QT_BEGIN_NAMESPACE namespace { const QString PageNotFoundMessage = - QObject::tr("Error 404...


" - "

The page could not be found


'%1'

"); + QCoreApplication::translate("HelpViewer", + "Error 404...


" + "

The page could not be found


'%1'

"); } #if !defined(QT_NO_WEBKIT) diff --git a/tools/assistant/tools/assistant/main.cpp b/tools/assistant/tools/assistant/main.cpp index 434a211..cc76f81 100644 --- a/tools/assistant/tools/assistant/main.cpp +++ b/tools/assistant/tools/assistant/main.cpp @@ -174,8 +174,9 @@ bool synchronizeDocs(QHelpEngineCore &collection, if (!cachedDocs.contains(doc)) { const QString &docFile = collection.documentationFileName(doc); if (!cachedCollection.registerDocumentation(docFile)) { - cmd.showMessage(QObject::tr("Error registering documentation file '%1': %2"). - arg(docFile).arg(cachedCollection.error()), true); + cmd.showMessage(QCoreApplication::translate("Assistant", + "Error registering documentation file '%1': %2"). + arg(docFile).arg(cachedCollection.error()), true); return false; } } @@ -212,7 +213,8 @@ bool rebuildSearchIndex(QCoreApplication &app, const QString &collectionFile, TRACE_OBJ QHelpEngine engine(collectionFile); if (!engine.setupData()) { - cmd.showMessage(QObject::tr("Error: %1").arg(engine.error()), true); + cmd.showMessage(QCoreApplication::translate("Assistant", "Error: %1") + .arg(engine.error()), true); return false; } @@ -250,13 +252,14 @@ bool registerDocumentation(QHelpEngineCore &collection, CmdLineParser &cmd, { TRACE_OBJ if (!collection.registerDocumentation(cmd.helpFile())) { - cmd.showMessage( - QObject::tr("Could not register documentation file\n%1\n\nReason:\n%2") - .arg(cmd.helpFile()).arg(collection.error()), true); + cmd.showMessage(QCoreApplication::translate("Assistant", + "Could not register documentation file\n%1\n\nReason:\n%2") + .arg(cmd.helpFile()).arg(collection.error()), true); return false; } if (printSuccess) - cmd.showMessage(QObject::tr("Documentation successfully registered."), + cmd.showMessage(QCoreApplication::translate("Assistant", + "Documentation successfully registered."), false); CollectionConfiguration::updateLastRegisterTime(collection); return true; @@ -267,14 +270,16 @@ bool unregisterDocumentation(QHelpEngineCore &collection, { TRACE_OBJ if (!collection.unregisterDocumentation(namespaceName)) { - cmd.showMessage(QObject::tr("Could not unregister documentation" - " file\n%1\n\nReason:\n%2"). + cmd.showMessage(QCoreApplication::translate("Assistant", + "Could not unregister documentation" + " file\n%1\n\nReason:\n%2"). arg(cmd.helpFile()).arg(collection.error()), true); return false; } updateLastPagesOnUnregister(collection, namespaceName); if (printSuccess) - cmd.showMessage(QObject::tr("Documentation successfully unregistered."), + cmd.showMessage(QCoreApplication::translate("Assistant", + "Documentation successfully unregistered."), false); return true; } @@ -328,7 +333,8 @@ int main(int argc, char *argv[]) if (collectionFileGiven) { collection.reset(new QHelpEngineCore(collectionFile)); if (!collection->setupData()) { - cmd.showMessage(QObject::tr("Error reading collection file '%1': %2."). + cmd.showMessage(QCoreApplication::translate("Assistant", + "Error reading collection file '%1': %2."). arg(collectionFile).arg(collection->error()), true); return EXIT_FAILURE; } @@ -338,13 +344,15 @@ int main(int argc, char *argv[]) : MainWindow::defaultHelpCollectionFileName(); if (collectionFileGiven && !QFileInfo(cachedCollectionFile).exists() && !collection->copyCollectionFile(cachedCollectionFile)) { - cmd.showMessage(QObject::tr("Error creating collection file '%1': %2."). + cmd.showMessage(QCoreApplication::translate("Assistant", + "Error creating collection file '%1': %2."). arg(cachedCollectionFile).arg(collection->error()), true); return EXIT_FAILURE; } QHelpEngineCore cachedCollection(cachedCollectionFile); if (!cachedCollection.setupData()) { - cmd.showMessage(QObject::tr("Error reading collection file '%1': %2"). + cmd.showMessage(QCoreApplication::translate("Assistant", + "Error reading collection file '%1': %2"). arg(cachedCollectionFile). arg(cachedCollection.error()), true); return EXIT_FAILURE; @@ -365,7 +373,8 @@ int main(int argc, char *argv[]) const QString &namespaceName = QHelpEngineCore::namespaceName(cmd.helpFile()); if (cmd.registerRequest() == CmdLineParser::Register) { - if (collectionFileGiven && !registerDocumentation(*collection, cmd, true)) + if (collectionFileGiven + && !registerDocumentation(*collection, cmd, true)) return EXIT_FAILURE; if (!cachedDocs.contains(namespaceName) && !registerDocumentation(cachedCollection, cmd, !collectionFileGiven)) @@ -395,7 +404,8 @@ int main(int argc, char *argv[]) } if (!QSqlDatabase::isDriverAvailable(QLatin1String("QSQLITE"))) { - cmd.showMessage(QObject::tr("Cannot load sqlite database driver!"), + cmd.showMessage(QCoreApplication::translate("Assistant", + "Cannot load sqlite database driver!"), true); return EXIT_FAILURE; } diff --git a/tools/assistant/tools/qcollectiongenerator/main.cpp b/tools/assistant/tools/qcollectiongenerator/main.cpp index f75d891..7fcb4e1 100644 --- a/tools/assistant/tools/qcollectiongenerator/main.cpp +++ b/tools/assistant/tools/qcollectiongenerator/main.cpp @@ -45,6 +45,7 @@ #include #include +#include #include #include #include @@ -122,7 +123,8 @@ private: void CollectionConfigReader::raiseErrorWithLine() { - raiseError(QObject::tr("Unknown token at line %1.") + raiseError(QCoreApplication::translate("QCollectionGenerator", + "Unknown token at line %1.") .arg(lineNumber())); } @@ -142,8 +144,10 @@ void CollectionConfigReader::readData(const QByteArray &contents) && attributes().value(QLatin1String("version")) == QLatin1String("1.0")) readConfig(); else - raiseError(QObject::tr("Unknown token at line %1. Expected \"QtHelpCollectionProject\"!") - .arg(lineNumber())); + raiseError(QCoreApplication::translate("QCollectionGenerator", + "Unknown token at line %1. " + "Expected \"QtHelpCollectionProject\"!") + .arg(lineNumber())); } } } @@ -353,7 +357,8 @@ int main(int argc, char *argv[]) QFileInfo fi(QString::fromLocal8Bit(argv[i])); collectionFile = fi.absoluteFilePath(); } else { - error = QObject::tr("Missing output file name!"); + error = QCoreApplication::translate("QCollectionGenerator", + "Missing output file name!"); } } else if (arg == QLatin1String("-h")) { showHelp = true; @@ -367,14 +372,16 @@ int main(int argc, char *argv[]) } if (showVersion) { - fprintf(stdout, "Qt Collection Generator version 1.0 (Qt %s)\n", QT_VERSION_STR); + fprintf(stdout, "Qt Collection Generator version 1.0 (Qt %s)\n", + QT_VERSION_STR); return 0; } if (configFile.isEmpty() && !showHelp) - error = QObject::tr("Missing collection config file!"); + error = QCoreApplication::translate("QCollectionGenerator", + "Missing collection config file!"); - QString help = QObject::tr("\nUsage:\n\n" + QString help = QCoreApplication::translate("QCollectionGenerator", "\nUsage:\n\n" "qcollectiongenerator [options]\n\n" " -o Generates a collection file\n" " called . If\n" diff --git a/tools/assistant/tools/qhelpgenerator/main.cpp b/tools/assistant/tools/qhelpgenerator/main.cpp index 00a0a3d..a309f42 100644 --- a/tools/assistant/tools/qhelpgenerator/main.cpp +++ b/tools/assistant/tools/qhelpgenerator/main.cpp @@ -67,7 +67,8 @@ int main(int argc, char *argv[]) QFileInfo fi(QString::fromLocal8Bit(argv[i])); compressedFile = fi.absoluteFilePath(); } else { - error = QObject::tr("Missing output file name!"); + error = QCoreApplication::translate("QHelpGenerator", + "Missing output file name!"); } } else if (arg == QLatin1String("-v")) { showVersion = true; @@ -83,14 +84,16 @@ int main(int argc, char *argv[]) } if (showVersion) { - fprintf(stdout, "Qt Help Generator version 1.0 (Qt %s)\n", QT_VERSION_STR); + fprintf(stdout, "Qt Help Generator version 1.0 (Qt %s)\n", + QT_VERSION_STR); return 0; } if (projectFile.isEmpty() && !showHelp) - error = QObject::tr("Missing Qt help project file!"); + error = QCoreApplication::translate("QHelpGenerator", + "Missing Qt help project file!"); - QString help = QObject::tr("\nUsage:\n\n" + QString help = QCoreApplication::translate("QHelpGenerator", "\nUsage:\n\n" "qhelpgenerator [options]\n\n" " -o Generates a Qt compressed help\n" " file called .\n" -- cgit v0.12 From 0a2daeed026eca14bafe8463c7d0e629fd196c59 Mon Sep 17 00:00:00 2001 From: ck Date: Tue, 2 Feb 2010 14:07:38 +0100 Subject: Assistant: Treat "unfiltered" filter in a apecial way. - Don't put the translated string into the help engine. - Don't let it be edited by users. Reviewed-by: kh1 --- .../tools/assistant/helpenginewrapper.cpp | 39 ++++++++++++---------- .../assistant/tools/assistant/helpenginewrapper.h | 9 ++--- tools/assistant/tools/assistant/mainwindow.cpp | 7 ---- .../tools/assistant/preferencesdialog.cpp | 4 ++- 4 files changed, 30 insertions(+), 29 deletions(-) diff --git a/tools/assistant/tools/assistant/helpenginewrapper.cpp b/tools/assistant/tools/assistant/helpenginewrapper.cpp index 9785710..ddc056a 100644 --- a/tools/assistant/tools/assistant/helpenginewrapper.cpp +++ b/tools/assistant/tools/assistant/helpenginewrapper.cpp @@ -57,6 +57,7 @@ QT_BEGIN_NAMESPACE namespace { + const QString Unfiltered; const QString AppFontKey(QLatin1String("appFont")); const QString AppWritingSystemKey(QLatin1String("appWritingSystem")); const QString BookmarksKey(QLatin1String("Bookmarks")); @@ -67,7 +68,6 @@ namespace { const QString MainWindowGeometryKey(QLatin1String("MainWindowGeometry")); const QString SearchWasAttachedKey(QLatin1String("SearchWasAttached")); const QString StartOptionKey(QLatin1String("StartOption")); - const QString UnfilteredInsertedKey(QLatin1String("UnfilteredFilterInserted")); const QString UseAppFontKey(QLatin1String("useAppFont")); const QString UseBrowserFontKey(QLatin1String("useBrowserFont")); const QString VersionKey(QString(QLatin1String("qtVersion%1$$$%2")). @@ -114,6 +114,8 @@ private: QMap m_recentQchUpdates; }; +const QString HelpEngineWrapper::TrUnfiltered = tr("Unfiltered"); + HelpEngineWrapper *HelpEngineWrapper::helpEngineWrapper = 0; HelpEngineWrapper &HelpEngineWrapper::instance(const QString &collectionFile) @@ -144,7 +146,7 @@ HelpEngineWrapper::HelpEngineWrapper(const QString &collectionFile) connect(d, SIGNAL(documentationUpdated(QString)), this, SIGNAL(documentationUpdated(QString))); connect(d->m_helpEngine, SIGNAL(currentFilterChanged(QString)), - this, SIGNAL(currentFilterChanged(QString))); + this, SLOT(handleCurrentFilterChanged(QString))); connect(d->m_helpEngine, SIGNAL(setupFinished()), this, SIGNAL(setupFinished())); } @@ -242,19 +244,25 @@ bool HelpEngineWrapper::removeCustomFilter(const QString &filterName) void HelpEngineWrapper::setCurrentFilter(const QString ¤tFilter) { TRACE_OBJ - d->m_helpEngine->setCurrentFilter(currentFilter); + const QString &filter + = currentFilter == TrUnfiltered ? Unfiltered : currentFilter; + d->m_helpEngine->setCurrentFilter(filter); } const QString HelpEngineWrapper::currentFilter() const { TRACE_OBJ - return d->m_helpEngine->currentFilter(); + const QString &filter = d->m_helpEngine->currentFilter(); + return filter == Unfiltered ? TrUnfiltered : filter; } const QStringList HelpEngineWrapper::customFilters() const { TRACE_OBJ - return d->m_helpEngine->customFilters(); + QStringList filters = d->m_helpEngine->customFilters(); + filters.removeOne(Unfiltered); + filters.prepend(TrUnfiltered); + return filters; } QUrl HelpEngineWrapper::findFile(const QUrl &url) const @@ -293,18 +301,6 @@ QString HelpEngineWrapper::error() const return d->m_helpEngine->error(); } -bool HelpEngineWrapper::unfilteredInserted() const -{ - TRACE_OBJ - return d->m_helpEngine->customValue(UnfilteredInsertedKey).toInt() == 1; -} - -void HelpEngineWrapper::setUnfilteredInserted() -{ - TRACE_OBJ - d->m_helpEngine->setCustomValue(UnfilteredInsertedKey, 1); -} - const QStringList HelpEngineWrapper::qtDocInfo(const QString &component) const { TRACE_OBJ @@ -679,6 +675,13 @@ void HelpEngineWrapper::setBrowserWritingSystem(QFontDatabase::WritingSystem sys d->m_helpEngine->setCustomValue(BrowserWritingSystemKey, system); } +void HelpEngineWrapper::handleCurrentFilterChanged(const QString &filter) +{ + const QString &filterToReport + = filter == Unfiltered ? TrUnfiltered : filter; + emit currentFilterChanged(filterToReport); +} + TimeoutForwarder::TimeoutForwarder(const QString &fileName) : m_fileName(fileName) @@ -698,6 +701,8 @@ HelpEngineWrapperPrivate::HelpEngineWrapperPrivate(const QString &collectionFile m_qchWatcher(new QFileSystemWatcher(this)) { TRACE_OBJ + if (!m_helpEngine->customFilters().contains(Unfiltered)) + m_helpEngine->addCustomFilter(Unfiltered, QStringList()); initFileSystemWatchers(); } diff --git a/tools/assistant/tools/assistant/helpenginewrapper.h b/tools/assistant/tools/assistant/helpenginewrapper.h index ea7b762..a30fab8 100644 --- a/tools/assistant/tools/assistant/helpenginewrapper.h +++ b/tools/assistant/tools/assistant/helpenginewrapper.h @@ -101,10 +101,6 @@ public: const QStringList filterAttributes(const QString &filterName) const; QString error() const; - // Access to a collection's custom values. - bool unfilteredInserted() const; - void setUnfilteredInserted(); - const QStringList qtDocInfo(const QString &component) const; void setQtDocInfo(const QString &component, const QStringList &doc); @@ -185,6 +181,8 @@ public: QFontDatabase::WritingSystem browserWritingSystem() const; void setBrowserWritingSystem(QFontDatabase::WritingSystem system); + static const QString TrUnfiltered; + signals: // For asynchronous doc updates triggered by external actions. @@ -195,6 +193,9 @@ signals: void currentFilterChanged(const QString ¤tFilter); void setupFinished(); +private slots: + void handleCurrentFilterChanged(const QString &filter); + private: HelpEngineWrapper(const QString &collectionFile); ~HelpEngineWrapper(); diff --git a/tools/assistant/tools/assistant/mainwindow.cpp b/tools/assistant/tools/assistant/mainwindow.cpp index ac33fc5..cfd0fee 100644 --- a/tools/assistant/tools/assistant/mainwindow.cpp +++ b/tools/assistant/tools/assistant/mainwindow.cpp @@ -315,13 +315,6 @@ bool MainWindow::initHelpDB() needsSetup = true; } - if (!helpEngineWrapper.unfilteredInserted()) { - helpEngineWrapper.addCustomFilter(tr("Unfiltered"), QStringList()); - helpEngineWrapper.setUnfilteredInserted(); - helpEngineWrapper.setCurrentFilter(tr("Unfiltered")); - needsSetup = true; - } - if (needsSetup) helpEngineWrapper.setupData(); return true; diff --git a/tools/assistant/tools/assistant/preferencesdialog.cpp b/tools/assistant/tools/assistant/preferencesdialog.cpp index fb41590..f0ef054 100644 --- a/tools/assistant/tools/assistant/preferencesdialog.cpp +++ b/tools/assistant/tools/assistant/preferencesdialog.cpp @@ -160,8 +160,10 @@ void PreferencesDialog::updateFilterPage() m_ui.attributeWidget->clear(); m_filterMapBackup.clear(); - const QStringList filters = helpEngine.customFilters(); + const QStringList &filters = helpEngine.customFilters(); foreach (const QString &filter, filters) { + if (filter == HelpEngineWrapper::TrUnfiltered) + continue; QStringList atts = helpEngine.filterAttributes(filter); m_filterMapBackup.insert(filter, atts); if (!m_filterMap.contains(filter)) -- cgit v0.12 From 42e181a6feba241997b041a2a58903f308264559 Mon Sep 17 00:00:00 2001 From: David Faure Date: Tue, 2 Feb 2010 14:29:11 +0100 Subject: QLabel: add setSelection, hasSelectedText, selectedText, selectionStart. When using TextSelectableByMouse or TextSelectableByKeyboard, this allows to programmatically control the selection. Needed in KDE's KSqueezedTextLabel, so that mouseReleaseEvent can get the selection and copy the un-squeezed text instead of the squeezed one. Merge-request: 454 Reviewed-by: Leonardo Sobral Cunha --- src/gui/widgets/qlabel.cpp | 89 ++++++++++++++++++++++++++++++++++++++++ src/gui/widgets/qlabel.h | 7 ++++ tests/auto/qlabel/tst_qlabel.cpp | 22 ++++++++++ 3 files changed, 118 insertions(+) diff --git a/src/gui/widgets/qlabel.cpp b/src/gui/widgets/qlabel.cpp index 8428ad7..c779312 100644 --- a/src/gui/widgets/qlabel.cpp +++ b/src/gui/widgets/qlabel.cpp @@ -781,6 +781,95 @@ Qt::TextInteractionFlags QLabel::textInteractionFlags() const return d->textInteractionFlags; } +/*! + Selects text from position \a start and for \a length characters. + + \sa selectedText() + + \bold{Note:} The textInteractionFlags set on the label need to include + either TextSelectableByMouse or TextSelectableByKeyboard. + + \since 4.7 +*/ +void QLabel::setSelection(int start, int length) +{ + Q_D(QLabel); + if (d->control) { + d->ensureTextPopulated(); + QTextCursor cursor = d->control->textCursor(); + cursor.setPosition(start); + cursor.setPosition(start + length, QTextCursor::KeepAnchor); + d->control->setTextCursor(cursor); + } +} + +/*! + \property QLabel::hasSelectedText + \brief whether there is any text selected + + hasSelectedText() returns true if some or all of the text has been + selected by the user; otherwise returns false. + + By default, this property is false. + + \sa selectedText() + + \bold{Note:} The textInteractionFlags set on the label need to include + either TextSelectableByMouse or TextSelectableByKeyboard. + + \since 4.7 +*/ +bool QLabel::hasSelectedText() const +{ + Q_D(const QLabel); + if (d->control) + return d->control->textCursor().hasSelection(); + return false; +} + +/*! + \property QLabel::selectedText + \brief the selected text + + If there is no selected text this property's value is + an empty string. + + By default, this property contains an empty string. + + \sa hasSelectedText() + + \bold{Note:} The textInteractionFlags set on the label need to include + either TextSelectableByMouse or TextSelectableByKeyboard. + + \since 4.7 +*/ +QString QLabel::selectedText() const +{ + Q_D(const QLabel); + if (d->control) + return d->control->textCursor().selectedText(); + return QString(); +} + +/*! + selectionStart() returns the index of the first selected character in the + label or -1 if no text is selected. + + \sa selectedText() + + \bold{Note:} The textInteractionFlags set on the label need to include + either TextSelectableByMouse or TextSelectableByKeyboard. + + \since 4.7 +*/ +int QLabel::selectionStart() const +{ + Q_D(const QLabel); + if (d->control && d->control->textCursor().hasSelection()) + return d->control->textCursor().selectionStart(); + return -1; +} + /*!\reimp */ QSize QLabel::sizeHint() const diff --git a/src/gui/widgets/qlabel.h b/src/gui/widgets/qlabel.h index d916078..54babb1 100644 --- a/src/gui/widgets/qlabel.h +++ b/src/gui/widgets/qlabel.h @@ -65,6 +65,8 @@ class Q_GUI_EXPORT QLabel : public QFrame Q_PROPERTY(int indent READ indent WRITE setIndent) Q_PROPERTY(bool openExternalLinks READ openExternalLinks WRITE setOpenExternalLinks) Q_PROPERTY(Qt::TextInteractionFlags textInteractionFlags READ textInteractionFlags WRITE setTextInteractionFlags) + Q_PROPERTY(bool hasSelectedText READ hasSelectedText) + Q_PROPERTY(QString selectedText READ selectedText) public: explicit QLabel(QWidget *parent=0, Qt::WindowFlags f=0); @@ -111,6 +113,11 @@ public: void setTextInteractionFlags(Qt::TextInteractionFlags flags); Qt::TextInteractionFlags textInteractionFlags() const; + void setSelection(int, int); + bool hasSelectedText() const; + QString selectedText() const; + int selectionStart() const; + public Q_SLOTS: void setText(const QString &); void setPixmap(const QPixmap &); diff --git a/tests/auto/qlabel/tst_qlabel.cpp b/tests/auto/qlabel/tst_qlabel.cpp index c3af495..7099917 100644 --- a/tests/auto/qlabel/tst_qlabel.cpp +++ b/tests/auto/qlabel/tst_qlabel.cpp @@ -119,6 +119,7 @@ private slots: void mnemonic_data(); void mnemonic(); + void selection(); private: QLabel *testWidget; @@ -559,6 +560,27 @@ void tst_QLabel::mnemonic() QCOMPARE(d->shortcutCursor.selectedText(), expectedShortcutCursor); } +void tst_QLabel::selection() +{ + QLabel label; + label.setText("Hello world"); + + label.setTextInteractionFlags(Qt::TextSelectableByMouse); + + QVERIFY(!label.hasSelectedText()); + QCOMPARE(label.selectedText(), QString()); + QCOMPARE(label.selectionStart(), -1); + + label.setSelection(0, 4); + QVERIFY(label.hasSelectedText()); + QCOMPARE(label.selectedText(), QString::fromLatin1("Hell")); + QCOMPARE(label.selectionStart(), 0); + + label.setSelection(6, 5); + QVERIFY(label.hasSelectedText()); + QCOMPARE(label.selectedText(), QString::fromLatin1("world")); + QCOMPARE(label.selectionStart(), 6); +} QTEST_MAIN(tst_QLabel) #include "tst_qlabel.moc" -- cgit v0.12 From fc92419c2058b8c3af8fc1c723e9d957118bcb8f Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Tue, 2 Feb 2010 15:44:28 +0100 Subject: Expanded tst_QFileSystemModel::rootPath() to check directories ending in "." or ".." Reviewed-by: Jan-Arve --- tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp b/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp index 287f472..9f67a5e 100644 --- a/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp +++ b/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp @@ -236,6 +236,26 @@ void tst_QFileSystemModel::rootPath() QCOMPARE(model->rootPath(), QString(QDir::homePath())); QCOMPARE(rootChanged.count(), oldRootPath == model->rootPath() ? 0 : 1); QCOMPARE(model->rootDirectory().absolutePath(), QDir::homePath()); + + model->setRootPath(QDir::rootPath()); + int oldCount = rootChanged.count(); + oldRootPath = model->rootPath(); + root = model->setRootPath(QDir::homePath() + QLatin1String("/.")); + QTRY_VERIFY(model->rowCount(root) >= 0); + QCOMPARE(model->rootPath(), QDir::homePath()); + QCOMPARE(rootChanged.count(), oldRootPath == model->rootPath() ? oldCount : oldCount + 1); + QCOMPARE(model->rootDirectory().absolutePath(), QDir::homePath()); + + QDir newdir = QDir::home(); + if (newdir.cdUp()) { + oldCount = rootChanged.count(); + oldRootPath = model->rootPath(); + root = model->setRootPath(QDir::homePath() + QLatin1String("/..")); + QTRY_VERIFY(model->rowCount(root) >= 0); + QCOMPARE(model->rootPath(), newdir.path()); + QCOMPARE(rootChanged.count(), oldCount + 1); + QCOMPARE(model->rootDirectory().absolutePath(), newdir.path()); + } } void tst_QFileSystemModel::naturalCompare_data() -- cgit v0.12 From 7b96944a02991e404cdab61e24182b90f5849120 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 2 Feb 2010 13:46:09 +0100 Subject: QSortFilterProxyModel: Fix dynamic sorting when severals rows are added. We need to update the sorting column in clear_mapping. But the problem is that updating the source column create a mapping (because it uses mapToSource). So we need to clear that wrong mapping again In _q_sourceLayoutChanged there was an uneeded special case. The case where the source_sort_column might change was never triggered because of that. So now that the special case has been removed, we need to do as in clear_mapping. The test cover the change in clear_mapping and in _q_sourceLayoutChanged The problem was shown in the Kopete: https://bugs.kde.org/show_bug.cgi?id=199850 Reviewed-by: Thierry Task-number: QTBUG-7537 --- src/gui/itemviews/qsortfilterproxymodel.cpp | 16 +++-- .../tst_qsortfilterproxymodel.cpp | 69 ++++++++++++++++++++++ 2 files changed, 79 insertions(+), 6 deletions(-) diff --git a/src/gui/itemviews/qsortfilterproxymodel.cpp b/src/gui/itemviews/qsortfilterproxymodel.cpp index 472af7d..e73013c 100644 --- a/src/gui/itemviews/qsortfilterproxymodel.cpp +++ b/src/gui/itemviews/qsortfilterproxymodel.cpp @@ -270,6 +270,11 @@ void QSortFilterProxyModelPrivate::clear_mapping() qDeleteAll(source_index_mapping); source_index_mapping.clear(); + if (dynamic_sortfilter && update_source_sort_column()) { + //update_source_sort_column might have created wrong mapping so we have to clear it again + qDeleteAll(source_index_mapping); + source_index_mapping.clear(); + } // update the persistent indexes update_persistent_indexes(source_indexes); @@ -1208,11 +1213,6 @@ void QSortFilterProxyModelPrivate::_q_sourceLayoutAboutToBeChanged() void QSortFilterProxyModelPrivate::_q_sourceLayoutChanged() { Q_Q(QSortFilterProxyModel); - if (saved_persistent_indexes.isEmpty()) { - clear_mapping(); - emit q->layoutChanged(); - return; - } qDeleteAll(source_index_mapping); source_index_mapping.clear(); @@ -1220,7 +1220,11 @@ void QSortFilterProxyModelPrivate::_q_sourceLayoutChanged() update_persistent_indexes(saved_persistent_indexes); saved_persistent_indexes.clear(); - update_source_sort_column(); + if (dynamic_sortfilter && update_source_sort_column()) { + //update_source_sort_column might have created wrong mapping so we have to clear it again + qDeleteAll(source_index_mapping); + source_index_mapping.clear(); + } emit q->layoutChanged(); } diff --git a/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp b/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp index 8abf3c0..5b2b0cf 100644 --- a/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp +++ b/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp @@ -136,6 +136,7 @@ private slots: void task252507_mapFromToSource(); void task255652_removeRowsRecursive(); void taskQTBUG_6205_doubleProxySelectionSetSourceModel(); + void taskQTBUG_7537_appearsAndSort(); protected: void buildHierarchy(const QStringList &data, QAbstractItemModel *model); @@ -2852,5 +2853,73 @@ void tst_QSortFilterProxyModel::taskQTBUG_6205_doubleProxySelectionSetSourceMode QVERIFY(ism.selection().isEmpty()); } +void tst_QSortFilterProxyModel::taskQTBUG_7537_appearsAndSort() +{ + class PModel : public QSortFilterProxyModel + { + public: + PModel() : mVisible(false) {}; + protected: + bool filterAcceptsRow(int, const QModelIndex &) const + { + return mVisible; + } + + public: + void updateXX() + { + mVisible = true; + invalidate(); + } + private: + bool mVisible; + } proxyModel; + + + QStringListModel sourceModel; + QStringList list; + list << "b" << "a" << "c"; + sourceModel.setStringList(list); + + proxyModel.setSourceModel(&sourceModel); + proxyModel.setDynamicSortFilter(true); + proxyModel.sort(0, Qt::AscendingOrder); + + QApplication::processEvents(); + QCOMPARE(sourceModel.rowCount(), 3); + QCOMPARE(proxyModel.rowCount(), 0); //all rows are hidden at first; + + QSignalSpy spyAbout1(&proxyModel, SIGNAL(layoutAboutToBeChanged())); + QSignalSpy spyChanged1(&proxyModel, SIGNAL(layoutChanged())); + + //introducing secondProxyModel to test the layoutChange when many items appears at once + QSortFilterProxyModel secondProxyModel; + secondProxyModel.setSourceModel(&proxyModel); + secondProxyModel.setDynamicSortFilter(true); + secondProxyModel.sort(0, Qt::DescendingOrder); + QCOMPARE(secondProxyModel.rowCount(), 0); //all rows are hidden at first; + QSignalSpy spyAbout2(&secondProxyModel, SIGNAL(layoutAboutToBeChanged())); + QSignalSpy spyChanged2(&secondProxyModel, SIGNAL(layoutChanged())); + + proxyModel.updateXX(); + QApplication::processEvents(); + //now rows should be visible, and sorted + QCOMPARE(proxyModel.rowCount(), 3); + QCOMPARE(proxyModel.data(proxyModel.index(0,0), Qt::DisplayRole).toString(), QString::fromLatin1("a")); + QCOMPARE(proxyModel.data(proxyModel.index(1,0), Qt::DisplayRole).toString(), QString::fromLatin1("b")); + QCOMPARE(proxyModel.data(proxyModel.index(2,0), Qt::DisplayRole).toString(), QString::fromLatin1("c")); + + //now rows should be visible, and sorted + QCOMPARE(secondProxyModel.rowCount(), 3); + QCOMPARE(secondProxyModel.data(secondProxyModel.index(0,0), Qt::DisplayRole).toString(), QString::fromLatin1("c")); + QCOMPARE(secondProxyModel.data(secondProxyModel.index(1,0), Qt::DisplayRole).toString(), QString::fromLatin1("b")); + QCOMPARE(secondProxyModel.data(secondProxyModel.index(2,0), Qt::DisplayRole).toString(), QString::fromLatin1("a")); + + QCOMPARE(spyAbout1.count(), 1); + QCOMPARE(spyChanged1.count(), 1); + QCOMPARE(spyAbout2.count(), 1); + QCOMPARE(spyChanged2.count(), 1); +} + QTEST_MAIN(tst_QSortFilterProxyModel) #include "tst_qsortfilterproxymodel.moc" -- cgit v0.12 From 7702b57286b0d02857f5312dbc36c87784ac1b11 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 3 Feb 2010 10:42:26 +0100 Subject: Designer: Support the 'windowOpacity'-property for forms. Analogous to windowTitle, etc. Task-number: QTBUG-7822 --- tools/designer/src/components/formeditor/formwindow.cpp | 1 + tools/designer/src/lib/shared/qdesigner_propertysheet.cpp | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/tools/designer/src/components/formeditor/formwindow.cpp b/tools/designer/src/components/formeditor/formwindow.cpp index 2d013c9..4cfec95 100644 --- a/tools/designer/src/components/formeditor/formwindow.cpp +++ b/tools/designer/src/components/formeditor/formwindow.cpp @@ -484,6 +484,7 @@ void FormWindow::setMainContainer(QWidget *w) sheet->setVisible(sheet->indexOf(QLatin1String("windowTitle")), true); sheet->setVisible(sheet->indexOf(QLatin1String("windowIcon")), true); sheet->setVisible(sheet->indexOf(QLatin1String("windowModality")), true); + sheet->setVisible(sheet->indexOf(QLatin1String("windowOpacity")), true); sheet->setVisible(sheet->indexOf(QLatin1String("windowFilePath")), true); // ### generalize } diff --git a/tools/designer/src/lib/shared/qdesigner_propertysheet.cpp b/tools/designer/src/lib/shared/qdesigner_propertysheet.cpp index b4b962c..13bb1d7 100644 --- a/tools/designer/src/lib/shared/qdesigner_propertysheet.cpp +++ b/tools/designer/src/lib/shared/qdesigner_propertysheet.cpp @@ -610,8 +610,9 @@ QDesignerPropertySheet::QDesignerPropertySheet(QObject *object, QObject *parent) createFakeProperty(QLatin1String("whatsThis")); createFakeProperty(QLatin1String("acceptDrops")); createFakeProperty(QLatin1String("dragEnabled")); - // windowModality is visible only for the main container, in which case the form windows enables it on loading + // windowModality/Opacity is visible only for the main container, in which case the form windows enables it on loading setVisible(createFakeProperty(QLatin1String("windowModality")), false); + setVisible(createFakeProperty(QLatin1String("windowOpacity"), double(1.0)), false); if (qobject_cast(d->m_object)) { // prevent toolbars from being dragged off createFakeProperty(QLatin1String("floatable"), QVariant(true)); } else { @@ -1451,8 +1452,13 @@ bool QDesignerPropertySheet::isVisible(int index) const } if (isFakeProperty(index)) { - if (type == PropertyWindowModality) // Hidden for child widgets + switch (type) { + case PropertyWindowModality: // Hidden for child widgets + case PropertyWindowOpacity: return d->m_info.value(index).visible; + default: + break; + } return true; } -- cgit v0.12 From 7ed1f0c899bde0cac84bbef8d8be3b16ca42cd98 Mon Sep 17 00:00:00 2001 From: Laszlo Papp Date: Wed, 3 Feb 2010 11:10:39 +0100 Subject: Add Qt base hungarian translation Signed-off-by: Laszlo Papp Reviewed-by: Benjamin Poulain --- qt_hu.ts | 10537 ++++++++++++++++++++++++++++++++++++++++ translations/translations.pri | 2 +- 2 files changed, 10538 insertions(+), 1 deletion(-) create mode 100644 qt_hu.ts diff --git a/qt_hu.ts b/qt_hu.ts new file mode 100644 index 0000000..ecc9826 --- /dev/null +++ b/qt_hu.ts @@ -0,0 +1,10537 @@ + + + + + CloseButton + + + Close Tab + Lap bezárása + + + + FakeReply + + + Fake error ! + Hamisítási hiba ! + + + + Invalid URL + Érvénytelen URL + + + + Phonon:: + + + Notifications + Értesítések + + + + Music + Zene + + + + Video + Videó + + + + Communication + Kommunikáció + + + + Games + Játékok + + + + Accessibility + Hozzáférhetőség + + + + Phonon::AudioOutput + + + <html>The audio playback device <b>%1</b> does not work.<br/>Falling back to <b>%2</b>.</html> + <html>Az audió visszajátszó eszköz <b>%1</b> nem működik.<br/>Visszavonul ide: <b>%2</b>.</html> + + + + <html>Switching to the audio playback device <b>%1</b><br/>which just became available and has higher preference.</html> + <html>Az audió visszajátszó eszközre kapcsolás <b>%1</b><br/>amely éppen elérhetővé vált és magasabb prioritása van.</html> + + + + Revert back to device '%1' + Visszatérés a(z) '%1' eszközre + + + + Phonon::Gstreamer::Backend + + + Warning: You do not seem to have the package gstreamer0.10-plugins-good installed. + Some video features have been disabled. + Figyelmeztetés: Úgy tűnik nem telepítette megfelelően a gstreamer0.10-plugins csomagot. + Néhány videó tulajdonság tiltva van. + + + + Warning: You do not seem to have the base GStreamer plugins installed. + All audio and video support has been disabled + Figyelmeztetés: Úgy tűnik nem telepítette az alap GStreamer beépülő modulokat. + Az összes audió és videó támogatás tiltva van + + + + Phonon::Gstreamer::MediaObject + + + Cannot start playback. + +Check your GStreamer installation and make sure you +have libgstreamer-plugins-base installed. + Nem lehet elindítani a visszajátszást. + +Ellenőrizze le a GStreamer telepítését és győzödjön meg róla, hogy installálta a libgstreamer-plugins-base csomagot. + + + + A required codec is missing. You need to install the following codec(s) to play this content: %0 + Egy szükséges kódek hiányzik. A következő kódek(ek) telepítése szükséges ennek a tartalomnak a lejátszásához: %0 + + + + + + + + + + + Could not open media source. + Nem sikerült megnyitni a média forrást. + + + + Invalid source type. + Érvénytelen forrás típus. + + + + Could not locate media source. + Nem sikerült telepíteni a média forrást. + + + + Could not open audio device. The device is already in use. + Nem sikerült megnyitni az audió eszközt. Az eszköz már használatban van. + + + + Could not decode media source. + Nem sikerült dekódolni a forrást. + + + + Phonon::MMF + + + Audio Output + Audio kimenet + + + + The audio output device + A kimeneti audió eszköz + + + + Phonon::MMF::AudioEqualizer + + + Frequency band, %1 Hz + Frekvencia sáv, '%1' Hz + + + + Phonon::MMF::EffectFactory + + + Audio Equalizer + Audió hangszínszabályozó + + + + Bass Boost + Basszus erősítés + + + + Distance Attenuation + Távcsillapítás + + + + + Environmental Reverb + Környezeti visszhang + + + + Loudness + Hangosság + + + + Source Orientation + Forrás orientáció + + + + Stereo Widening + Sztereó szélesség + + + + Phonon::MMF::MediaObject + + + Media type could not be determined + Nem lehetet meghatározni a média típust + + + + Phonon::VolumeSlider + + + + + + Volume: %1% + Hangerő: %1% + + + + + + Use this slider to adjust the volume. The leftmost position is 0%, the rightmost is %1% + Használja ezt a csúszkát a hangerő szabályozásához. A legbaloldalib pozíció: 0%, a legjobboldalibb %1% + + + + Muted + Elnémított + + + + Q3Accel + + + %1, %2 not defined + %1, %2 nincs definiálva + + + + Ambiguous %1 not handled + Félreérthető %1 nincs lekezelve + + + + Q3DataTable + + + True + Igaz + + + + False + Hamis + + + + Insert + Beszúrás + + + + Update + Frissítés + + + + Delete + Törlés + + + + Q3FileDialog + + + Copy or Move a File + Egy fájl másolása vagy mozgatása + + + + Read: %1 + Olvasás: %1 + + + + + Write: %1 + Írás: %1 + + + + + Cancel + Mégse + + + + + + + All Files (*) + Az összes fájl (*) + + + + Name + Név + + + + Size + Méret + + + + Type + Típus + + + + Date + Dátum + + + + Attributes + Attribútumok + + + + + &OK + &OK + + + + Look &in: + &Benéz: + + + + + + File &name: + Fájl &név: + + + + File &type: + Fájl &típus: + + + + Back + Vissza + + + + One directory up + Egy könyvtárral kintebb + + + + Create New Folder + Új mappa létrehozása + + + + List View + Lista nézet + + + + Detail View + Részletes nézet + + + + Preview File Info + Fájl információ előnézet + + + + Preview File Contents + Fájl tartalom előnézet + + + + Read-write + Írás olvasás + + + + Read-only + Csak olvasható + + + + Write-only + Csak írható + + + + Inaccessible + Hozzáférhetetlen + + + + Symlink to File + Szimlink a fájlra + + + + Symlink to Directory + Szimlink a könyvtárra + + + + Symlink to Special + Szimlink egy speciálisra + + + + File + Fájl + + + + Dir + Könyvtár + + + + Special + Speciális + + + + + + Open + Megnyitás + + + + + Save As + Mentés másként + + + + + + &Open + &Megnyitás + + + + + &Save + &Mentés + + + + &Rename + &Átnevezés + + + + &Delete + &Törlés + + + + R&eload + &Újratöltés + + + + Sort by &Name + Rendezés &Név alapján + + + + Sort by &Size + Rendezés &Méret alapján + + + + Sort by &Date + Rendezés &Dátum alapján + + + + &Unsorted + &Rendezetlen + + + + Sort + Rendezés + + + + Show &hidden files + &Rejtett fájlok megjelenítése + + + + the file + a fájl + + + + the directory + a könyvtár + + + + the symlink + a szimlink + + + + Delete %1 + %1 törlése + + + + <qt>Are you sure you wish to delete %1 "%2"?</qt> + <qt>Biztos benne, hogy törölni kívánja a(z) %1 "%2"?</qt> + + + + &Yes + &Igen + + + + &No + &Nem + + + + New Folder 1 + Új mappa 1 + + + + New Folder + Új mappa + + + + New Folder %1 + Új mappa %1 + + + + Find Directory + Könyvtár keresése + + + + + Directories + Könyvtárak + + + + Directory: + Könyvtár: + + + + + Error + Hiba + + + + %1 +File not found. +Check path and filename. + %1 +Fájl nem található +Útvonal és fájlnév ellenőrzése. + + + + All Files (*.*) + Az összes fájl (*.*) + + + + Open + Megnyitás + + + + Select a Directory + Egy könyvtár kiválasztása + + + + Q3LocalFs + + + + Could not read directory +%1 + Nem sikerült a könytárat olvasni +%1 + + + + Could not create directory +%1 + Nem sikerült létrehozni a könyvtárat +%1 + + + + Could not remove file or directory +%1 + Nem sikerült eltávolítani egy fájlt vag könyvtárat +%1 + + + + Could not rename +%1 +to +%2 + Nem sikerült átnevezni ezt +%1 +erre +%2 + + + + Could not open +%1 + Nem sikerült megnyitni +%1 + + + + Could not write +%1 + Nem sikerült írni +%1 + + + + Q3MainWindow + + + Line up + Egy sorral feljebb + + + + Customize... + Egyéni... + + + + Q3NetworkProtocol + + + Operation stopped by the user + A felhasználó leállította a műveletet + + + + Q3ProgressDialog + + + + Cancel + Mégse + + + + Q3TabDialog + + + + OK + OK + + + + Apply + Alkalmazza + + + + Help + Súgó + + + + Defaults + Alapértelemett + + + + Cancel + Mégse + + + + Q3TextEdit + + + &Undo + &Visszavonás + + + + &Redo + &Helyreállítás + + + + Cu&t + &Kivágás + + + + &Copy + &Másolás + + + + &Paste + &Beillesztés + + + + Clear + Kiürítés + + + + + Select All + Az összes kiválasztása + + + + Q3TitleBar + + + System + Rendszer + + + + Restore up + Felállítás + + + + Minimize + Minimalizálás + + + + Restore down + Leállítás + + + + Maximize + Maximalizálás + + + + Close + Bezárás + + + + Contains commands to manipulate the window + Tartalmazza az ablak manipulációs parancsokat + + + + Puts a minimized window back to normal + Egy minimalizált ablak normálra visszatétele + + + + Moves the window out of the way + Az ablak félreeső helyre mozgatása + + + + Puts a maximized window back to normal + Maximalizált ablak normálra visszatétele + + + + Makes the window full screen + Az ablak maximális méretűvé tétele + + + + Closes the window + Az ablak bezárása + + + + Displays the name of the window and contains controls to manipulate it + Az ablak nevének megjelenítése és manipuláláshoz szükséges vezérlő elemek tartalmazása + + + + Q3ToolBar + + + More... + További... + + + + Q3UrlOperator + + + + + The protocol `%1' is not supported + A(z) '%1' protokoll nem támogatott + + + + The protocol `%1' does not support listing directories + A(z) '%1' protokoll nem támogatja a könyvtár listázást + + + + The protocol `%1' does not support creating new directories + A(z) '%1' protokoll nem támogatja az új könyvtárak létrehozását + + + + The protocol `%1' does not support removing files or directories + A(z) '%1' protokoll nem támogatja fájlok vagy könyvtárat áthelyezését + + + + The protocol `%1' does not support renaming files or directories + A(z) '%1' protokoll nem támogatja fájlok vagy könyvtárat átnevezését + + + + The protocol `%1' does not support getting files + A(z) '%1' protokoll nem támogatja fájlok szerzését + + + + The protocol `%1' does not support putting files + A(z) '%1' protokoll nem támogatja fájlok betevését + + + + + The protocol `%1' does not support copying or moving files or directories + A(z) '%1' protokoll nem támogatja fájlok vagy könyvtárak mozgatását vagy másolását + + + + + (unknown) + (ismeretlen) + + + + Q3Wizard + + + &Cancel + &Mégse + + + + < &Back + < &Vissza + + + + &Next > + &Következő > + + + + &Finish + &Befejezés + + + + &Help + &Súgó + + + + QAbstractSocket + + + + + + Host not found + A hoszt nem található + + + + + + Connection refused + A kapcsolódás elutasítva + + + + Connection timed out + Kapcsolódási időtúllépés + + + + + + Operation on socket is not supported + A socket művelet nem támogatott + + + + Socket operation timed out + Socket művelet időtúllépés + + + + Socket is not connected + Socket nincs csatlakoztatva + + + + Network unreachable + A hálózat nem elérhető + + + + QAbstractSpinBox + + + &Step up + &Növelés + + + + Step &down + &Csökkentés + + + + &Select All + Az összes &kiválasztása + + + + QAccessibleButton + + + Press + Megnyomás + + + + QApplication + + + QT_LAYOUT_DIRECTION + Translate this string to the string 'LTR' in left-to-right languages or to 'RTL' in right-to-left languages (such as Hebrew and Arabic) to get proper widget layout. + QT_LAYOUT_DIRECTION + + + + Executable '%1' requires Qt %2, found Qt %3. + A(z) '%1' futtatható fájl igényli a Qt %2, de Qt %3.-t talált. + + + + Incompatible Qt Library Error + Inkompatibilis Qt könyvtár hiba + + + + Activate + Aktiválás + + + + Activates the program's main window + A program fő ablakának aktiválása + + + + QAxSelect + + + Select ActiveX Control + ActiveX vezérlő kiválasztása + + + + OK + OK + + + + &Cancel + &Mégse + + + + COM &Object: + COM &Objektum: + + + + QCheckBox + + + Uncheck + Nincs bejelölve + + + + Check + Bejelölve + + + + Toggle + Kapcsolgatás + + + + QColorDialog + + + Hu&e: + &Színárnyalat: + + + + &Sat: + &Sat: + + + + &Val: + &Érték: + + + + &Red: + &Piros: + + + + &Green: + &Zöld: + + + + Bl&ue: + &Kék: + + + + A&lpha channel: + A&lfa csatorna: + + + + Select Color + Szín kiválasztása + + + + &Basic colors + &Alap színek + + + + &Custom colors + &Egyéni színek + + + + &Add to Custom Colors + &Egyéni színek hozzáadása + + + + QComboBox + + + + Open + Megnyitás + + + + False + Hamis + + + + True + Igaz + + + + Close + Bezárás + + + + QCoreApplication + + + %1: key is empty + QSystemSemaphore + %1:kulcs üres + + + + %1: unable to make key + QSystemSemaphore + %1: nem lehet kulcsot csinálni + + + + %1: ftok failed + QSystemSemaphore + %1: ftok hiba + + + + %1: already exists + QSystemSemaphore + %1: már létezik + + + + %1: does not exist + QSystemSemaphore + %1: nem létezik + + + + %1: out of resources + QSystemSemaphore + %1: elfogytak az erőforrások + + + + %1: unknown error %2 + QSystemSemaphore + %1: ismeretlen hiba %2 + + + + QDB2Driver + + + Unable to connect + Nem lehet csatlakozni + + + + Unable to commit transaction + Nem lehet kommitolni a tranzakciót + + + + Unable to rollback transaction + Nem lehet visszagörgetni a tranzakciót + + + + Unable to set autocommit + Nem lehet beállítani az automatikus kommitolást + + + + QDB2Result + + + + Unable to execute statement + Nem lehet végrehajtani a műveletet + + + + Unable to prepare statement + Nem lehet felkészülni a műveletre + + + + Unable to bind variable + Nem lehet összekötni a változót + + + + Unable to fetch record %1 + Nem lehet letölteni a(z) %1 felvételt + + + + Unable to fetch next + Nem lehet letölteni a következőt + + + + Unable to fetch first + Nem lehet letölteni az elsőt + + + + QDateTimeEdit + + + AM + AM + + + + am + am + + + + PM + PM + + + + pm + pm + + + + QDial + + + QDial + QDial + + + + SpeedoMeter + Sebességmérő + + + + SliderHandle + CsúszkaKezelő + + + + QDialog + + + What's This? + Mi ez? + + + + Done + Kész + + + + QDialogButtonBox + + + + + OK + OK + + + + Save + Mentés + + + + &Save + &Mentés + + + + Open + Megnyitás + + + + Cancel + Mégse + + + + &Cancel + &Mégse + + + + Close + Bezárás + + + + &Close + &Bezárás + + + + Apply + Alkalmazza + + + + Reset + Visszaállítás + + + + Help + Súgó + + + + Don't Save + Ne mentse + + + + Discard + Eldob + + + + &Yes + &Igen + + + + Yes to &All + Igen az &összesre + + + + &No + &Nem + + + + N&o to All + &Nem az összesre + + + + Save All + Az összes mentése + + + + Abort + Megszakítás + + + + Retry + Újra próbálkozás + + + + Ignore + Mellőzés + + + + Restore Defaults + Alapértelemezett beállítások visszaállítása + + + + Close without Saving + Bezárás mentés nélkül + + + + &OK + &OK + + + + QDirModel + + + Name + Név + + + + Size + Méret + + + + Kind + Match OS X Finder + Fajta + + + + Type + All other platforms + Típus + + + + Date Modified + Dátum módosítva + + + + QDockWidget + + + Close + Bezárás + + + + Dock + Dokkolás + + + + Float + Lebegtetés + + + + QDoubleSpinBox + + + More + Több + + + + Less + Kevesebb + + + + QErrorMessage + + + &Show this message again + Az üzenet újbóli &megjelenítése + + + + &OK + &OK + + + + Debug Message: + Debug üzenet: + + + + Warning: + Figyelmeztetés: + + + + Fatal Error: + Végzetes hiba: + + + + QFile + + + + Destination file exists + A cél fájl létezik + + + + Will not rename sequential file using block copy + Blokkos másolásnál nem lesznek átnevezve az egymást követő fájlok + + + + Cannot remove source file + Nem lehet a forrás fájlt eltávolítani + + + + Cannot open %1 for input + Nem lehet megnyitni %1-t bementre + + + + Cannot open for output + Nem lehet megnyitni a kimenetre + + + + Failure to write block + Hiba történt a blokk írás közben + + + + Cannot create %1 for output + Nem lehet létrehozni a(z) %1-t kimenetre + + + + QFileDialog + + + + All Files (*) + Az összes fájl (*) + + + + + Back + Vissza + + + + + List View + Lista nézet + + + + + Detail View + Részletes nézet + + + + + File + Fájl + + + + Open + Megnyitás + + + + Save As + Mentés másként + + + + + + &Open + &Megnyitás + + + + + &Save + &Mentés + + + + Recent Places + Utolsó helyek + + + + &Rename + &Átnevezés + + + + &Delete + &Törlés + + + + Show &hidden files + &Rejtett fájlok megjelenítése + + + + New Folder + Új mappa + + + + Find Directory + Könyvtár keresése + + + + Directories + Könyvtárak + + + + All Files (*.*) + Az összes fájl (*.*) + + + + + Directory: + Könyvtár: + + + + %1 already exists. +Do you want to replace it? + A(z) %1 már létezik. +Szeretné lecserélni? + + + + %1 +File not found. +Please verify the correct file name was given. + %1 +Fájl nem található. +Kérem ellenőrizze, hogy helyes fájlnevet adott meg. + + + + My Computer + Sajátgép + + + + + Parent Directory + Szülő könyvtár + + + + + Files of type: + Típusfájlok: + + + + + %1 +Directory not found. +Please verify the correct directory name was given. + %1 +A könyvtár nem található. +Kérem ellenőrizze le, hogy helyes könyvtár nevet adott meg. + + + + '%1' is write protected. +Do you want to delete it anyway? + A(z) '%1' írásvédett. +Mégis törölni szeretné? + + + + Are sure you want to delete '%1'? + Törölni szeretné '%1'? + + + + Could not delete directory. + Nem sikerült törölni a könyvtárat. + + + + Drive + Vezérlő + + + + File Folder + Match Windows Explorer + Fájl mappa + + + + Folder + All other platforms + Mappa + + + + Alias + Mac OS X Finder + Álnév + + + + Shortcut + All other platforms + Gyorsbillentyű + + + + Unknown + Ismeretlen + + + + Show + Megjelenítés + + + + + Forward + Előre + + + + &New Folder + &Új mappa + + + + + &Choose + &Kiválasztás + + + + Remove + Eltávolítás + + + + + File &name: + Fájl &név: + + + + + Look in: + Benéz: + + + + + Create New Folder + Új mappa létrehozása + + + + QFileSystemModel + + + + %1 TB + %1 TB + + + + + %1 GB + %1 GB + + + + + %1 MB + %1 MB + + + + + %1 KB + %1 KB + + + + %1 bytes + %1 bájt + + + + Invalid filename + Érvénytelen fájlnév + + + + <b>The name "%1" can not be used.</b><p>Try using another name, with fewer characters or no punctuations marks. + <b>A(z) "%1" név nem használható.</b><p>Próbáljon meg más nevet használni, kevesebb karakterrel vagy írásjelekek nélkül. + + + + Name + Név + + + + Size + Méret + + + + Kind + Match OS X Finder + Fajta + + + + Type + All other platforms + Típus + + + + Date Modified + Dátum módosítva + + + + My Computer + Sajátgép + + + + Computer + Számítógép + + + + %1 byte(s) + %1 bájt + + + + QFontDatabase + + + + Normal + Normál + + + + + + Bold + Kövér + + + + + Demi Bold + Félkövér + + + + + + Black + Fekete + + + + Demi + Fél + + + + + Light + Világos + + + + + Italic + Dőlt + + + + + Oblique + Homályos + + + + Any + Bármilyen + + + + Latin + Latin + + + + Greek + Görög + + + + Cyrillic + Ciril + + + + Armenian + Örmény + + + + Hebrew + Héber + + + + Arabic + Arab + + + + Syriac + Szíriai + + + + Thaana + Thana + + + + Devanagari + Dévanágari + + + + Bengali + Bengáli + + + + Gurmukhi + Gurmukhi + + + + Gujarati + Gujarati + + + + Oriya + Oriya + + + + Tamil + Tamil + + + + Telugu + Telugu + + + + Kannada + Kanadai + + + + Malayalam + Maláj + + + + Sinhala + Sinhala + + + + Thai + Tájföldi + + + + Lao + Lao + + + + Tibetan + Tibeti + + + + Myanmar + Mianmari + + + + Georgian + Grúz + + + + Khmer + Khmer + + + + Simplified Chinese + Egyszerűsített kínai + + + + Traditional Chinese + Hagyományos kínai + + + + Japanese + Japán + + + + Korean + Koreai + + + + Vietnamese + Vietnámi + + + + Symbol + Szimbólum + + + + Ogham + Ogham + + + + Runic + Székely + + + + N'Ko + N'Ko + + + + QFontDialog + + + &Font + &Betű + + + + Font st&yle + Betű st&ílus + + + + &Size + &Méret + + + + Effects + Hatások + + + + Stri&keout + Ki&talál + + + + &Underline + &Aláhúzás + + + + Sample + Minta + + + + + Select Font + Betű kiválasztása + + + + Wr&iting System + Rendszer &írása + + + + QFtp + + + Host %1 found + %1 host megtalálva + + + + Host found + Hoszt megtalálva + + + + + + Connected to host %1 + %1 hosztra csatlkoztatva + + + + Connected to host + Hosztra csatlakoztatva + + + + Connection to %1 closed + %1-re csatlakoztatása bezárva + + + + + + Connection closed + Kapcsolat bezárva + + + + + Host %1 not found + %1 host nem található + + + + + Connection refused to host %1 + Kapcsolat elutasítva a(z) %1 hoszttal + + + + Connection timed out to host %1 + Kapcsolati időtúllépés a %1 hoszttal + + + + + + + Unknown error + Ismeretlen hiba + + + + + Connecting to host failed: +%1 + A hoszthoz kapcsolódás nem sikerült: +%1 + + + + + Login failed: +%1 + Bejelentkezési hiba: +%1 + + + + + Listing directory failed: +%1 + Könyvtár listázási hiba: +%1 + + + + + Changing directory failed: +%1 + Könyvtár változtatási hiba: +%1 + + + + + Downloading file failed: +%1 + Fájl letöltési hiba: +%1 + + + + + Uploading file failed: +%1 + Fájl feltöltési hiba: +%1 + + + + + Removing file failed: +%1 + Fájl eltávolítási hiba: +%1 + + + + + Creating directory failed: +%1 + Könyvtár létrehozási hiba: +%1 + + + + + Removing directory failed: +%1 + Könyvtár eltávolítása hiba: +%1 + + + + + Not connected + Nincs csatlakoztatva + + + + + Connection refused for data connection + Adat kapcsolat érdekében történő csatlakozás megtagadva + + + + QHostInfo + + + Unknown error + Ismeretlen hiba + + + + QHostInfoAgent + + + + + + Host not found + A hoszt nem található + + + + + + + Unknown address type + Ismeretlen cím típus + + + + + + Unknown error + Ismeretlen hiba + + + + No host name given + Nincs hoszt név megadva + + + + Invalid hostname + Érvénytelen hoszt név + + + + QHttp + + + + Connection refused + Kapcsolat megtagadva + + + + + + Host %1 not found + A(z) %1 hoszt nem található + + + + + Wrong content length + Hibás tartalom hossz + + + + + + + HTTP request failed + HTTP kérési hiba + + + + Host %1 found + A(z) %1 hoszt nem található + + + + Host found + Hoszt megtalálható + + + + Connected to host %1 + %1 hoszthoz csatlakozva van + + + + Connected to host + Hosztra csatlakoztatva + + + + Connection to %1 closed + %1-re csatlkozás bezárva + + + + + Connection closed + Kapcsolat bezárva + + + + + + + Unknown error + Ismeretlen hiba + + + + + Request aborted + Kérés megszakítva + + + + + No server set to connect to + Nincsen szerver beállítva, amire csatlakozni lehetne + + + + + Server closed connection unexpectedly + A szerver váratlanul bezárta a kapcsolatot + + + + + Invalid HTTP response header + Érvénytelen HTTP válasz fejléc + + + + Unknown authentication method + Ismeretlen hitelesítési eljárás + + + + + + + Invalid HTTP chunked body + Érvénytelen nagy HTTP törzs + + + + Error writing response to device + Hiba történt a válasz eszközre írása közben + + + + Proxy authentication required + Proxy hitelesítés szükséges + + + + Authentication required + Hitelesítés szükséges + + + + Proxy requires authentication + A proxy a hitelesítést kéri + + + + Host requires authentication + A hoszt hitelesítést kér + + + + Data corrupted + Sérült adat + + + + SSL handshake failed + SSL kézfogási hiba + + + + Unknown protocol specified + Ismeretlen protokoll van megadva + + + + Connection refused (or timed out) + Kapcsolat megtagadva (vagy időtúllépés) + + + + HTTPS connection requested but SSL support not compiled in + HTTP kapcsolat lett kérve, de az SSL támogatás nincs beleforgatva + + + + QHttpSocketEngine + + + Did not receive HTTP response from proxy + Nem kapott HTTP választ a proxy-tól + + + + Error parsing authentication request from proxy + Hiba történt a proxy hitelesítés kérésének elemzése közben + + + + Authentication required + Hitelesítés szükséges + + + + Proxy denied connection + A proxy megtagadta a kapcsolatot + + + + Error communicating with HTTP proxy + Hiba történt a HTTP proxy-val történő kommunikáció közben + + + + Proxy server not found + A proxy szerver nem található + + + + Proxy connection refused + A proxy kapcsolat elutasítva + + + + Proxy server connection timed out + Proxy szerver kapcsolódási időtúllépés + + + + Proxy connection closed prematurely + Proxy kapcsolódás túl korán be lett zárva + + + + QIBaseDriver + + + Error opening database + Hiba történt az adatbázis megnyitása közben + + + + Could not start transaction + Nem sikerült elindítani a tranzakciót + + + + Unable to commit transaction + Nem lehet kommitolni a tranzakciót + + + + Unable to rollback transaction + Nem lehet visszagörgetni a tranzakciót + + + + QIBaseResult + + + Unable to create BLOB + Nem lehet BLOB-t létrehozni + + + + Unable to write BLOB + Nem lehet írni a BLOB-t + + + + Unable to open BLOB + Nem lehet megnyitni a BLOB-t + + + + Unable to read BLOB + Nem lehet olvasni a BLOB-t + + + + + Could not find array + Nem sikerült megtalálni a tömböt + + + + Could not get array data + Nem sikerüét megszerezni a tömb adatokat + + + + Could not get query info + Nem sikerült megszerezni a lekérdezi információt + + + + Could not start transaction + Nem sikerült elindítani a tranzakciót + + + + Unable to commit transaction + Nem lehet kommitolni a tranzakciót + + + + Could not allocate statement + Nem sikerült lefoglalni a műveletet + + + + Could not prepare statement + Nem sikerült felkészülni a műveletre + + + + + Could not describe input statement + Nem sikerült leírni a bemeneti állítást + + + + Could not describe statement + Nem sikerült leírni az állítást + + + + Unable to close statement + Nem lehet megnyitni az állítást + + + + Unable to execute query + Nem lehet végrehajtani a lekérdezést + + + + Could not fetch next item + Nem lehet letölteni a következő elemet + + + + Could not get statement info + Nem lehet az művelet információkat megszerezni + + + + QIODevice + + + Permission denied + Beleegyezés megtagadva + + + + Too many open files + Túl sok fájl megnyitása + + + + No such file or directory + Nincs ilyen fájl vagy könyvtár + + + + No space left on device + Nincs több hely a lemezen + + + + Unknown error + Ismeretlen hiba + + + + QInputContext + + + XIM + XIM + + + + FEP + FEP + + + + XIM input method + XIM beviteli eljárás + + + + Windows input method + Windows beviteli eljárás + + + + Mac OS X input method + Mac OS X beviteli eljárás + + + + S60 FEP input method + S60 FEP beviteli eljárás + + + + QInputDialog + + + Enter a value: + Egy értél bevitele: + + + + QLibrary + + + Could not mmap '%1': %2 + Nem sikerült az mmap '%1': %2 + + + + Plugin verification data mismatch in '%1' + Beépülő modul igazoló adata nem megfelelő a(z) '%1'-ben + + + + Could not unmap '%1': %2 + Nem lehet eltávolítani a letérképezést '%1': %2 + + + + The plugin '%1' uses incompatible Qt library. (%2.%3.%4) [%5] + A(z) '%1' beépülő modul inkompatibilis Qt könyvtárat használ. (%2.%3.%4) [%5] + + + + The plugin '%1' uses incompatible Qt library. Expected build key "%2", got "%3" + A(z) '%1' beépülő modul inkompatibilis Qt könyvtárat használ. A várt építési kulcs '%2', kapott '%3' + + + + Unknown error + Ismeretlen hiba + + + + + The shared library was not found. + A megosztott könyvtár nem található. + + + + The file '%1' is not a valid Qt plugin. + A(z) '%1' fájl nem egy érvényes Qt beépülő modul. + + + + The plugin '%1' uses incompatible Qt library. (Cannot mix debug and release libraries.) + A(z) '%1' beépülő modul inkompatibilis Qt könyvtárat használ. (Nem lehet a debug és kiadási könyvtárakat keverni.) + + + + + Cannot load library %1: %2 + Nem lehet betölteni a(z) %1 könyvtárat: %2 + + + + + Cannot unload library %1: %2 + Nem lehet kirakni a(z) %1 könyvtárat: %2 + + + + + Cannot resolve symbol "%1" in %2: %3 + Nem lehet megfejteni a(z) '%1' szimbólumot a(z) %2-ben: %3 + + + + QLineEdit + + + Select All + Az összes kiválasztása + + + + &Undo + &Visszavonás + + + + &Redo + &Helyreállítás + + + + Cu&t + &Kivágás + + + + &Copy + &Másolás + + + + &Paste + &Beillesztés + + + + Delete + Törlés + + + + QLocalServer + + + + %1: Name error + %1: Név hiba + + + + %1: Permission denied + %1: Engedély megtagadva + + + + %1: Address in use + %1: Cím használatban + + + + %1: Unknown error %2 + %1: Ismeretlen hiba %2 + + + + QLocalSocket + + + + %1: Connection refused + %1: Kapcsolat elutasítva + + + + + %1: Remote closed + %1: Távol bezárva + + + + + + + %1: Invalid name + %1: Érvénytelen név + + + + + %1: Socket access error + %1: Socket hozzáférési hiba + + + + + %1: Socket resource error + %1: Socket erőforrás hiba + + + + + %1: Socket operation timed out + %1: Socker művelet időtúllépés + + + + + %1: Datagram too large + %1: Túl nagy datagram + + + + + + %1: Connection error + %1: Kapcsolat hiba + + + + + %1: The socket operation is not supported + %1: A socket művelet nem támogatott + + + + %1: Unknown error + %1: Ismeretlen hiba + + + + + %1: Unknown error %2 + %1: Ismeretlen hiba %2 + + + + QMYSQLDriver + + + Unable to open database ' + Nem lehet megnyitni az adatbázist + + + + Unable to connect + Nem lehet kapcsolódni + + + + Unable to begin transaction + Nem lehet megkezdeni a tranzakciót + + + + Unable to commit transaction + Nem lehet kommitolni a tranzakciót + + + + Unable to rollback transaction + Nem lehet visszagörgetni a tranzakciót + + + + QMYSQLResult + + + Unable to fetch data + Nem lehet letölteni az adatot + + + + Unable to execute query + Nem lehet végrehajtani a lekérdezést + + + + Unable to store result + Nem lehet tárolni az eredményt + + + + + Unable to prepare statement + Nem lehet felkészülni a műveletre + + + + Unable to reset statement + Nem lehet visszaállítani a műveleteket + + + + Unable to bind value + Nem lehet összekötni az értéket + + + + Unable to execute statement + Nem lehet végrehajtani az állítást + + + + + Unable to bind outvalues + Nem lehet összekötni a kiértékeléseket + + + + Unable to store statement results + Nem lehet letárolni a művelet eredményeket + + + + Unable to execute next query + Nem lehet végrehajtani a következő lekérdezést + + + + Unable to store next result + Nem lehet letárolni a következő eredményt + + + + QMdiArea + + + (Untitled) + (Címtelen) + + + + QMdiSubWindow + + + %1 - [%2] + %1 - [%2] + + + + Close + Bezárás + + + + Minimize + Minimalizálás + + + + Restore Down + Leállítás + + + + &Restore + &Letárolás + + + + &Move + &Mozgatás + + + + &Size + &Méret + + + + Mi&nimize + &Minimalizálás + + + + Ma&ximize + Ma&ximalizálás + + + + Stay on &Top + &Tetején maradni + + + + &Close + &Bezárás + + + + Maximize + Maximalizálás + + + + Unshade + Árnyékolás megszüntetése + + + + Shade + Árnyákolás + + + + Restore + Visszaállítás + + + + Help + Súgó + + + + Menu + Menü + + + + - [%1] + - [%1] + + + + QMenu + + + + Close + Bezárás + + + + + Open + Megnyitás + + + + + + Execute + Végrehajtás + + + + QMenuBar + + + Actions + Tevékenységek + + + + QMessageBox + + + + + + OK + OK + + + + <h3>About Qt</h3><p>This program uses Qt version %1.</p> + <h3>Qt-ról</h3><p>Ez a program a(z) %1 Qt verziót használja.</p> + + + + <p>Qt is a C++ toolkit for cross-platform application development.</p><p>Qt provides single-source portability across MS&nbsp;Windows, Mac&nbsp;OS&nbsp;X, Linux, and all major commercial Unix variants. Qt is also available for embedded devices as Qt for Embedded Linux and Qt for Windows CE.</p><p>Qt is available under three different licensing options designed to accommodate the needs of our various users.</p><p>Qt licensed under our commercial license agreement is appropriate for development of proprietary/commercial software where you do not want to share any source code with third parties or otherwise cannot comply with the terms of the GNU LGPL version 2.1 or GNU GPL version 3.0.</p><p>Qt licensed under the GNU LGPL version 2.1 is appropriate for the development of Qt applications (proprietary or open source) provided you can comply with the terms and conditions of the GNU LGPL version 2.1.</p><p>Qt licensed under the GNU General Public License version 3.0 is appropriate for the development of Qt applications where you wish to use such applications in combination with software subject to the terms of the GNU GPL version 3.0 or where you are otherwise willing to comply with the terms of the GNU GPL version 3.0.</p><p>Please see <a href="http://qt.nokia.com/products/licensing">qt.nokia.com/products/licensing</a> for an overview of Qt licensing.</p><p>Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).</p><p>Qt is a Nokia product. See <a href="http://qt.nokia.com/">qt.nokia.com</a> for more information.</p> + + + + + About Qt + Qt-ról + + + + Help + Súgó + + + + Show Details... + Részletek megjelenítése... + + + + Hide Details... + Részletek elrejtése... + + + + QMultiInputContext + + + Select IM + IM kiválasztása + + + + QMultiInputContextPlugin + + + Multiple input method switcher + Összetett beviteli eljárás kapcsoló + + + + Multiple input method switcher that uses the context menu of the text widgets + Összetett beviteli eljárás kapcsoló, ami a szöveg widgetek menü összefüggéseit használja + + + + QNativeSocketEngine + + + The remote host closed the connection + A távoli hoszt bezárta a kapcsolatot + + + + Network operation timed out + Hálózati művelet időtúllépése + + + + Out of resources + Kifogytak az erőforrások + + + + Unsupported socket operation + Nem támogatott socket művelet + + + + Protocol type not supported + Nem támogatott protokoll típus + + + + Invalid socket descriptor + Érvénytelen socket leíró + + + + Network unreachable + A hálózat nem elérhető + + + + Permission denied + Engedély megtagadva + + + + Connection timed out + Kapcsolat időtúllépés + + + + Connection refused + Kapcsolat elutasítva + + + + The bound address is already in use + A cím összeköttetés már használatban van + + + + The address is not available + A cím nem elérhető + + + + The address is protected + A cím védett + + + + Unable to send a message + Nem lehet üzenetet küldeni + + + + Unable to receive a message + Nem lehet megkapni az üzeneteket + + + + Unable to write + Nem lehet írni + + + + Network error + Hálózati hiba + + + + Another socket is already listening on the same port + Egy másik socker már ugyanazon a porton figyel + + + + Unable to initialize non-blocking socket + Nem lehet inicializálni egy nem blokkoló socketet + + + + Unable to initialize broadcast socket + Nem lehet inicializálni a socket közvetítőt + + + + Attempt to use IPv6 socket on a platform with no IPv6 support + IPv6 socket használatának kipróbálása olyan platformon, amelyik nem támogatja az IPv6-t + + + + Host unreachable + A hoszt nem elérhető + + + + Datagram was too large to send + A datagram túl nagy volt elküldésre + + + + Operation on non-socket + Nem socketen végzett művelet + + + + Unknown error + Ismeretlen hiba + + + + The proxy type is invalid for this operation + A proxy típusa ismeretlen erre a műveletre + + + + QNetworkAccessCacheBackend + + + Error opening %1 + Hiba történt a(z) %1 megnyitása közben + + + + QNetworkAccessDebugPipeBackend + + + Write error writing to %1: %2 + Írása hiba történt a(z) %1-be történő írás közben: %2 + + + + QNetworkAccessFileBackend + + + + Request for opening non-local file %1 + Kérés a(z) %1 nem helyi fál megnyitására + + + + + Error opening %1: %2 + Hiba történt a(z) %1 megnyitása közben: %2 + + + + Write error writing to %1: %2 + Írási hiba történt a(z) %1-be írás közben: %2 + + + + + Cannot open %1: Path is a directory + Nem lehet megnyitni a(z) %1-t: az útvonal egy könyvtár + + + + Read error reading from %1: %2 + Olvasási hiba történt a(z) %1-ból való olvasás közben: %2 + + + + QNetworkAccessFtpBackend + + + No suitable proxy found + Nem található megfelelő proxy + + + + Cannot open %1: is a directory + Nem lehet megnyitni a(z) %1 t, mert az egy könyvtár + + + + Logging in to %1 failed: authentication required + A(z) %1-be történő loggolás nem sikerült: hitelesítés szükséges + + + + Error while downloading %1: %2 + Hiba történt a(z) %1 letöltése közben: %2 + + + + Error while uploading %1: %2 + Hiba történt a(z) %1 feltöltése közben: %2 + + + + QNetworkAccessHttpBackend + + + No suitable proxy found + Nem található megfelelő proxy + + + + QNetworkReply + + + Error downloading %1 - server replied: %2 + Hiba történt a(z) %1 letöltése közben - a szerver válasza: %2 + + + + Protocol "%1" is unknown + A(z) '%1' protokoll ismeretlen + + + + QNetworkReplyImpl + + + + Operation canceled + Művelet visszavonása + + + + QOCIDriver + + + Unable to logon + Nem lehet bejelentkezni + + + + Unable to initialize + QOCIDriver + Nem lehet inicializálni + + + + Unable to begin transaction + Nem lehet megkezdeni a tranzakciót + + + + Unable to commit transaction + Nem lehet kommitolni a tranzakciót + + + + Unable to rollback transaction + Nem lehet visszagörgetni a tranzakciót + + + + QOCIResult + + + + + Unable to bind column for batch execute + Nem lehet összekötni az oszlopot köteg végrehajtásra + + + + Unable to execute batch statement + Nem lehet végrehajtani a köteg állítást + + + + Unable to goto next + Nem lehet a következőre ugrani + + + + Unable to alloc statement + Nem lehet helyet lefoglalni az állításnak + + + + Unable to prepare statement + Nem lehet felkészülni a műveletre + + + + Unable to get statement type + Nem lehet megszerezni az állítás típusát + + + + Unable to bind value + Nem lehet összekötni az értéket + + + + Unable to execute statement + Nem lehet végrehajtani az állítást + + + + QODBCDriver + + + Unable to connect + Nem lehet kapcsolódni + + + + Unable to disable autocommit + Nem lehet letiltani az automatikus kommitolást + + + + Unable to commit transaction + Nem lehet kommitolni a tranzakciót + + + + Unable to rollback transaction + Nem lehet visszagörgetni a tranzakciót + + + + Unable to enable autocommit + Nem lehet engedélyezni az automatikus kommitolást + + + + Unable to connect - Driver doesn't support all functionality required + Nem lehet csatlakozni- A vezérlő nem támogatja az összes szükséges funkciót + + + + QODBCResult + + + + QODBCResult::reset: Unable to set 'SQL_CURSOR_STATIC' as statement attribute. Please check your ODBC driver configuration + QODBCEredmény::Visszaállítás: Nen lehet beállítani az 'SQL_CURSOR_STATIC' állítás attribútumra. Kérem ellenőrizze le az ODBC vezérlő konfigurációt + + + + + Unable to execute statement + Nem lehet végrehajtani az állítást + + + + Unable to fetch next + Nem lehet letölteni a következőt + + + + Unable to prepare statement + Nem lehet felkészülni az állításra + + + + Unable to bind variable + Nem lehet összekötni a változót + + + + + + Unable to fetch last + Nem lehet letölteni az utolsót + + + + Unable to fetch + Nem lehet letölteni + + + + Unable to fetch first + Nem letölteni az elsőt + + + + Unable to fetch previous + Nem lehet letölteni az előzőt + + + + QObject + + + Invalid hostname + Érvénytelen hoszt név + + + + Operation not supported on %1 + A művelet nem támogatott a(z) %1-n + + + + Invalid URI: %1 + Érvénytelen URI: %1 + + + + Socket error on %1: %2 + Socket hiba a(z) %1-n: %2 + + + + Remote host closed the connection prematurely on %1 + A távoli hoszt túl korán bezárta a kapcsolatot a(z) %1-n + + + + + No host name given + Nincs hoszt név megadva + + + + QPPDOptionsModel + + + Name + Név + + + + Value + Érték + + + + QPSQLDriver + + + Unable to connect + Nem lehet csatlakozni + + + + Could not begin transaction + Nem sikerült megkezdeni a tranzakciót + + + + Could not commit transaction + Nem lehet kommitolni a tranzakciót + + + + Could not rollback transaction + Nem lehet visszagörgetni a tranzakciót + + + + Unable to subscribe + Nem lehet feliratkozni + + + + Unable to unsubscribe + Nem lehet leiratkozni + + + + QPSQLResult + + + Unable to create query + Nem lehet létrehozni a lekérdezést + + + + Unable to prepare statement + Nem lehet felkészülni az állításra + + + + QPageSetupWidget + + + Centimeters (cm) + Centiméter (cm) + + + + Millimeters (mm) + Milliméter (mm) + + + + Inches (in) + Incs (in) + + + + Points (pt) + Pont (pt) + + + + Form + + + + + Paper + Papír + + + + Page size: + Lap méret: + + + + Width: + Szélesség: + + + + Height: + Magasság: + + + + Paper source: + Papír forrás: + + + + Orientation + Elhelyezkedés + + + + Portrait + Portré + + + + Landscape + Tájkép + + + + Reverse landscape + Fordított tájkép + + + + Reverse portrait + Fordított portré + + + + Margins + Margó + + + + top margin + Felső margó + + + + left margin + Bal margó + + + + right margin + Jobb margó + + + + bottom margin + Alsó margó + + + + QPluginLoader + + + Unknown error + Ismeretlen hiba + + + + The plugin was not loaded. + A beépülő modult nem sikerült betölteni. + + + + QPrintDialog + + + locally connected + Helyileg csatlakoztatva + + + + + Aliases: %1 + Álnevek: %1 + + + + + unknown + ismeretlen + + + + OK + OK + + + + Print all + Az összes kinyomtatása + + + + Print range + Egy tartomány kinyomtatása + + + + A0 (841 x 1189 mm) + A0 (841 x 1189 mm) + + + + A1 (594 x 841 mm) + A1 (594 x 841 mm) + + + + A2 (420 x 594 mm) + A2 (420 x 594 mm) + + + + A3 (297 x 420 mm) + A3 (297 x 420 mm) + + + + A5 (148 x 210 mm) + A5 (148 x 210 mm) + + + + A6 (105 x 148 mm) + A6 (105 x 148 mm) + + + + A7 (74 x 105 mm) + A7 (74 x 105 mm) + + + + A8 (52 x 74 mm) + A8 (52 x 74 mm) + + + + A9 (37 x 52 mm) + A9 (37 x 52 mm) + + + + B0 (1000 x 1414 mm) + B0 (1000 x 1414 mm) + + + + B1 (707 x 1000 mm) + B1 (707 x 1000 mm) + + + + B2 (500 x 707 mm) + B2 (500 x 707 mm) + + + + B3 (353 x 500 mm) + B3 (353 x 500 mm) + + + + B4 (250 x 353 mm) + B4 (250 x 353 mm) + + + + B6 (125 x 176 mm) + B6 (125 x 176 mm) + + + + B7 (88 x 125 mm) + B7 (88 x 125 mm) + + + + B8 (62 x 88 mm) + B8 (62 x 88 mm) + + + + B9 (44 x 62 mm) + B9 (44 x 62 mm) + + + + B10 (31 x 44 mm) + B10 (31 x 44 mm) + + + + C5E (163 x 229 mm) + C5E (163 x 229 mm) + + + + DLE (110 x 220 mm) + DLE (110 x 220 mm) + + + + Folio (210 x 330 mm) + Fólió (210 x 330 mm) + + + + Ledger (432 x 279 mm) + Főkönyv (432 x 279 mm) + + + + Tabloid (279 x 432 mm) + Tabletta (279 x 432 mm) + + + + US Common #10 Envelope (105 x 241 mm) + US közös #10 bélyeg (105 x 241 mm) + + + + A4 (210 x 297 mm, 8.26 x 11.7 inches) + A4 (210 x 297 mm, 8.26 x 11.7 inches) + + + + B5 (176 x 250 mm, 6.93 x 9.84 inches) + B5 (176 x 250 mm, 6.93 x 9.84 inches) + + + + Executive (7.5 x 10 inches, 191 x 254 mm) + Vezető (7.5 x 10 inches, 191 x 254 mm) + + + + Legal (8.5 x 14 inches, 216 x 356 mm) + Legális (8.5 x 14 inches, 216 x 356 mm) + + + + Letter (8.5 x 11 inches, 216 x 279 mm) + Levél (8.5 x 11 inches, 216 x 279 mm) + + + + Print selection + Nyomtatási kiválasztás + + + + + + Print + Nyomtatás + + + + Print To File ... + Fájlba nyomtatás ... + + + + File %1 is not writable. +Please choose a different file name. + A(z) %1 fájl nem írható. +Kérem válasszon különböző fájl nevet. + + + + %1 already exists. +Do you want to overwrite it? + A(z) %1 már létezik. +Felül szeretné írni? + + + + File exists + Fájl létezik + + + + <qt>Do you want to overwrite it?</qt> + <qt>Felül szeretné írni?</qt> + + + + %1 is a directory. +Please choose a different file name. + A(z) %1 egy könyvtár. +Kérem válasszon egy különböző fájl nevet. + + + + The 'From' value cannot be greater than the 'To' value. + A '-Tól' érték nem lehet nagyobb az '-Ig' értéknél. + + + + A0 + A0 + + + + A1 + A1 + + + + A2 + A2 + + + + A3 + A3 + + + + A4 + A4 + + + + A5 + A5 + + + + A6 + A6 + + + + A7 + A7 + + + + A8 + A8 + + + + A9 + A9 + + + + B0 + B0 + + + + B1 + B1 + + + + B2 + B2 + + + + B3 + B3 + + + + B4 + B4 + + + + B5 + B5 + + + + B6 + B6 + + + + B7 + B7 + + + + B8 + B8 + + + + B9 + B9 + + + + B10 + B10 + + + + C5E + C5E + + + + DLE + DLE + + + + Executive + Vezető + + + + Folio + Fólió + + + + Ledger + Főkönyv + + + + Legal + Legális + + + + Letter + Levél + + + + Tabloid + Tabletta + + + + US Common #10 Envelope + US közös #10 bélyeg + + + + Custom + Egyéni + + + + + &Options >> + &Opciók >> + + + + &Options << + &Opciók << + + + + Print to File (PDF) + Fájlba nyomtatás (PDF) + + + + Print to File (Postscript) + Fájlba nyomtatás (Postscript) + + + + Local file + Helyi fájl + + + + Write %1 file + %1 fájlba írás + + + + &Print + &Nyomtatás + + + + QPrintPreviewDialog + + + %1% + %1% + + + + Print Preview + Nyomtatási előnézet + + + + Next page + Következő lap + + + + Previous page + Előző lap + + + + First page + Első lap + + + + Last page + Utolsó lap + + + + Fit width + Megfelelő szélesség + + + + Fit page + Megfelelő lap + + + + Zoom in + Nagyítás + + + + Zoom out + Kicsinyítés + + + + Portrait + Portré + + + + Landscape + Tájkép + + + + Show single page + Egyetlen lap megjelenítése + + + + Show facing pages + Lapok megjelenítése szemből + + + + Show overview of all pages + Az összes lap áttekintésének megjelenítése + + + + Print + Nyomtatás + + + + Page setup + Lap beállítás + + + + Export to PDF + PDF-be exportálás + + + + Export to PostScript + PostScript-be exportálás + + + + + Page Setup + Lap beállítás + + + + QPrintPropertiesWidget + + + Form + Forma + + + + Page + Lap + + + + Advanced + Speciális + + + + QPrintSettingsOutput + + + Form + Forma + + + + Copies + Másolás + + + + Print range + Tartomány nyomtatása + + + + Print all + Az összes nyomtatása + + + + Pages from + Lapok ettől + + + + to + eddig + + + + Selection + Kiválasztás + + + + Output Settings + Kimeneti beállítások + + + + Copies: + Másolatok: + + + + Collate + Egyeztet + + + + Reverse + Fordítva + + + + Options + Opciók + + + + Color Mode + Színes mód + + + + Color + Szín + + + + Grayscale + Szürkeárnyalat + + + + Duplex Printing + Dupla nyomtatás + + + + None + Semmi + + + + Long side + Hosszú oldal + + + + Short side + Rövid oldal + + + + QPrintWidget + + + Form + Űrlap + + + + Printer + Nyomtató + + + + &Name: + &Név: + + + + P&roperties + Tu&lajdonságok + + + + Location: + Elhelyezkedés: + + + + Preview + Előnézet + + + + Type: + Típus: + + + + Output &file: + Kimeneti &fájl: + + + + ... + ... + + + + QProcess + + + + Could not open input redirection for reading + Nem sikerült megnyitni a bevitel olvasásra irányítását + + + + + Could not open output redirection for writing + Nem sikerült megnyitni a kimenet írásra irányítását + + + + Resource error (fork failure): %1 + Erőforrás hiba (Szétágazás hiba): %1 + + + + + + + + + + + + Process operation timed out + Folyamat művelet időtúllépés + + + + + + + Error reading from process + Hiba történt a folyamat olvasása közben + + + + + + Error writing to process + Hiba történt a folyamat írása közben + + + + Process crashed + A folyamat összeomlott + + + + No program defined + Nincs program definiálva + + + + Process failed to start: %1 + Nem sikerült elindítani a folyamatot: %1 + + + + QProgressDialog + + + Cancel + Mégse + + + + QPushButton + + + Open + Megnyitás + + + + QRadioButton + + + Check + Ellenőrzés + + + + QRegExp + + + no error occurred + nem történt hiba + + + + disabled feature used + tiltás tulajdonság használva + + + + bad char class syntax + rossz karakter osztály szintakszis + + + + bad lookahead syntax + rossz előreolvasási szintakszis + + + + bad repetition syntax + rossz ismétlési szintakszis + + + + invalid octal value + érvénytelen oktális érték + + + + missing left delim + hiányzó bal határolójel + + + + unexpected end + váratlan vég + + + + met internal limit + találkozott belső korlát + + + + invalid interval + érvénytelen intervallum + + + + invalid category + érvénytelen kategória + + + + QSQLite2Driver + + + Error opening database + Hiba történt az adatbázis megnyitása közben + + + + Unable to begin transaction + Nem lehet elkezdeni a tranzakciót + + + + Unable to commit transaction + Nem lehet kommitolni a tranzakciót + + + + Unable to rollback transaction + Nem lehet visszagörgetni a tranzakciót + + + + QSQLite2Result + + + Unable to fetch results + Nem lehet letölteni az eredményeket + + + + Unable to execute statement + Nem lehet végrehajtani az állítást + + + + QSQLiteDriver + + + Error opening database + Hiba történt az adatbázis megnyitása közben + + + + Error closing database + Hiba történt az adatbázis bezárása közben + + + + Unable to begin transaction + Nem lehet elkezdeni a tranzakciót + + + + Unable to commit transaction + Nem lehet kommitolni a tranzakciót + + + + Unable to rollback transaction + Nem lehet visszagörgetni a tranzakciót + + + + QSQLiteResult + + + + + Unable to fetch row + Nem lehet leszedni a sort + + + + Unable to execute statement + Nem lehet végrehajtani az állítást + + + + Unable to reset statement + Nem lehet visszaállítani az állítást + + + + Unable to bind parameters + Nem lehet összekötni a paramétereket + + + + Parameter count mismatch + A paraméter számláló nem megfelelő + + + + No query + Nincs lekérdezés + + + + QScriptBreakpointsModel + + + ID + Azonosító + + + + Location + Elhelyezkedés + + + + Condition + Feltétel + + + + Ignore-count + Számítás mellőzése + + + + Single-shot + Egylövetű + + + + Hit-count + Leütés számítás + + + + QScriptBreakpointsWidget + + + New + Új + + + + Delete + Törlés + + + + QScriptDebugger + + + + Go to Line + Ugrás erre a sorra + + + + Line: + Sor: + + + + Interrupt + Megszakítás + + + + Shift+F5 + Shift+F5 + + + + Continue + Folytatás + + + + F5 + F5 + + + + Step Into + Belelépés + + + + F11 + F11 + + + + Step Over + Átlépés + + + + F10 + F10 + + + + Step Out + Kilép + + + + Shift+F11 + Shift+F11 + + + + Run to Cursor + Kurzorra futás + + + + Ctrl+F10 + Ctrl+F10 + + + + Run to New Script + Az új Szkriptre futás + + + + Toggle Breakpoint + Töréspont kapcsolgatása + + + + F9 + F9 + + + + Clear Debug Output + Debug kimenet kiürítése + + + + Clear Error Log + Error Log kiürítése + + + + Clear Console + Konzol kiürítése + + + + &Find in Script... + Szkriptben &keresés... + + + + Ctrl+F + Ctrl+F + + + + Find &Next + &Következő keresése + + + + F3 + F3 + + + + Find &Previous + &Előző keresése + + + + Shift+F3 + Shift+F3 + + + + Ctrl+G + Ctrl+G + + + + Debug + Debug + + + + QScriptDebuggerCodeFinderWidget + + + Close + Bezárás + + + + Previous + Előző + + + + Next + Következő + + + + Case Sensitive + Kis és nagybetű érzékeny + + + + Whole words + Egész szavakat + + + + <img src=":/qt/scripttools/debugging/images/wrap.png">&nbsp;Search wrapped + <img src=":/qt/scripttools/debugging/images/wrap.png">&nbsp;Keresés tördelve + + + + QScriptDebuggerLocalsModel + + + Name + Név + + + + Value + Érték + + + + QScriptDebuggerStackModel + + + Level + Szint + + + + Name + Név + + + + Location + Elhelyezkedés + + + + QScriptEdit + + + Toggle Breakpoint + Töréspont kapcsolgatása + + + + Disable Breakpoint + Töréspont tiltása + + + + Enable Breakpoint + Töréspont engedélyezése + + + + Breakpoint Condition: + Töréspont feltétel: + + + + QScriptEngineDebugger + + + Loaded Scripts + Betöltött szkriptek + + + + Breakpoints + Töréspontok + + + + Stack + Verem + + + + Locals + Helyi változók + + + + Console + Konzol + + + + Debug Output + Debug kimenet + + + + Error Log + Hiba Log + + + + Search + Keresés + + + + View + Nézet + + + + Qt Script Debugger + Qt szkript debugger + + + + QScriptNewBreakpointWidget + + + Close + Bezárás + + + + QScrollBar + + + Scroll here + Görgetés itt + + + + Left edge + Bal szegély + + + + Top + Tető + + + + Right edge + Jobb szegély + + + + Bottom + Alja + + + + Page left + Lapzoás balra + + + + + Page up + Lapozás felfele + + + + Page right + Lapozás jobbra + + + + + Page down + Lapozás lefele + + + + Scroll left + Görgetés balra + + + + Scroll up + Görgetés felfele + + + + Scroll right + Görgetés jobbra + + + + Scroll down + Görgetés lefele + + + + Line up + Egy sorral feljebb + + + + Position + Pozíció + + + + Line down + Egy sorral lejjebb + + + + QSharedMemory + + + %1: create size is less then 0 + %1: 0-nál kisebb méret létrehozása + + + + + %1: unable to lock + %1: Nem lehet zárolni + + + + %1: unable to unlock + %1: Nem lehet kinyitni + + + + + + %1: permission denied + %1: engedély megtagadva + + + + + + %1: already exists + %1: már létezik + + + + %1: doesn't exists + %1: nem létezik + + + + + + %1: out of resources + %1: Kifogyott az erőforrásból + + + + + + %1: unknown error %2 + %1: ismeretlen hiba %2 + + + + %1: key is empty + %1: Üres kulcs + + + + %1: ftok failed + %1: ftok hiba + + + + + + %1: unable to make key + %1: Nem lehet kulcsot csinálni + + + + + %1: doesn't exist + %1: nem létezik + + + + %1: UNIX key file doesn't exist + %1: UNIX kulcs fájl nem létezik + + + + %1: system-imposed size restrictions + %1: a rendszer rárakott méretének korlátozásai + + + + %1: not attached + %1: nincs hozzácsatolva + + + + + %1: invalid size + %1: érvénytelen méret + + + + + %1: key error + %1: kulcs hiba + + + + %1: size query failed + %1: méret lekérdezési hiba + + + + %1: unable to set key on lock + %1: nem lehet beállítani a kulcsot a záron + + + + QShortcut + + + Space + Space + + + + Esc + Esc + + + + Tab + Tab + + + + Backtab + Backtab + + + + Backspace + Backspace + + + + Return + Return + + + + Enter + Enter + + + + Ins + Ins + + + + Del + Del + + + + Pause + Pause + + + + Print + Print + + + + SysReq + SysReq + + + + Home + Home + + + + End + End + + + + Left + Left + + + + Up + Up + + + + Right + Right + + + + Down + Down + + + + PgUp + PgUp + + + + PgDown + PgDown + + + + CapsLock + CapsLock + + + + NumLock + NumLock + + + + ScrollLock + ScrollLock + + + + Menu + Menü + + + + Help + Súgó + + + + Back + Vissza + + + + Forward + Előre + + + + Stop + Leállítás + + + + Refresh + Felfrissítés + + + + Volume Down + Hangerő lehalkítása + + + + Volume Mute + Hangerő Elnémítás + + + + Volume Up + Hangerő hangosítása + + + + Bass Boost + Basszus erősítés + + + + Bass Up + Basszus növelése + + + + Bass Down + Basszus csökkentése + + + + Treble Up + Felháromszorozás + + + + Treble Down + Leharmadolás + + + + Media Play + Média elindítása + + + + Media Stop + Média leállítása + + + + Media Previous + Előző média + + + + Media Next + Következő média + + + + Media Record + Média felvétel + + + + Favorites + Kedvcencek + + + + Search + Keresés + + + + Standby + Készenlét + + + + Open URL + URL megnyitása + + + + Launch Mail + Mail indítása + + + + Launch Media + Média indítása + + + + Launch (0) + Elindítás (0) + + + + Launch (1) + Elindítás (1) + + + + Launch (2) + Elindítás (2) + + + + Launch (3) + Elindítás (3) + + + + Launch (4) + Elindítás (4) + + + + Launch (5) + Elindítás (5) + + + + Launch (6) + Elindítás (6) + + + + Launch (7) + Elindítás (7) + + + + Launch (8) + Elindítás (8) + + + + Launch (9) + Elindítás (9) + + + + Launch (A) + Elindítás (A) + + + + Launch (B) + Elindítás (B) + + + + Launch (C) + Elindítás (C) + + + + Launch (D) + Elindítás (D) + + + + Launch (E) + Elindítás (E) + + + + Launch (F) + Elindítás (F) + + + + Monitor Brightness Up + Monitorfény növelése + + + + Monitor Brightness Down + Monitorfény csökkentése + + + + Keyboard Light On/Off + Billentyű világítás be/ki + + + + Keyboard Brightness Up + Billentyűfény növelése + + + + Keyboard Brightness Down + Billentyűfény csökkentése + + + + Power Off + Kikapcsolás + + + + Wake Up + Felébresztés + + + + Eject + Kidobás + + + + Screensaver + Képernyővédő + + + + WWW + WWW + + + + Sleep + Alvás + + + + LightBulb + Villanykörte + + + + Shop + Bolt + + + + History + Történelem + + + + Add Favorite + Hozzáadás a kedvencekhez + + + + Hot Links + Hot linkek + + + + Adjust Brightness + Fényszabályozás + + + + Finance + Pénzügy + + + + Community + Közösség + + + + Audio Rewind + Audió áttekercselés + + + + Back Forward + Előre hátra + + + + Application Left + Alkalmazás balra + + + + Application Right + Alkalmazás jobbra + + + + Book + Könyv + + + + CD + CD + + + + Calculator + Számológép + + + + Clear + Tiszta + + + + Clear Grab + Tiszta megmarkolás + + + + Close + Bezárás + + + + Copy + Másolás + + + + Cut + Kivágás + + + + Display + Megjelenítés + + + + DOS + DOS + + + + Documents + Dokumentumok + + + + Spreadsheet + Táblázatkezelő + + + + Browser + Böngésző + + + + Game + Játék + + + + Go + Gyerünk + + + + iTouch + iTouch + + + + Logoff + Kijelentkezés + + + + Market + Piac + + + + Meeting + Találkozó + + + + Keyboard Menu + Billlentyű menü + + + + Menu PB + PB menü + + + + My Sites + Oldalam + + + + News + Hírek + + + + Home Office + Otthoni iroda + + + + Option + Opció + + + + Paste + Beillesztés + + + + Phone + Telefon + + + + Reply + Válasz + + + + Reload + Újratöltés + + + + Rotate Windows + Ablakok forgatása + + + + Rotation PB + PB forgatás + + + + Rotation KB + KB forgatás + + + + Save + Mentés + + + + Send + Küldés + + + + Spellchecker + Helyesírás ellenőrző + + + + Split Screen + Képernyő felosztása + + + + Support + Támogatás + + + + Task Panel + Feladat panel + + + + Terminal + Terminál + + + + Tools + Eszközök + + + + Travel + Utazás + + + + Video + Videó + + + + Word Processor + Szó feldolgozó + + + + XFer + XFer + + + + Zoom In + Nagyítás + + + + Zoom Out + Kicsinyítés + + + + Away + Távol + + + + Messenger + Hírnök + + + + WebCam + WebCam + + + + Mail Forward + Mail továbbítása + + + + Pictures + Képek + + + + Music + Zene + + + + Battery + Elem + + + + Bluetooth + Bluetooth + + + + Wireless + Vezeték nélküli + + + + Ultra Wide Band + Ultra széles sáv + + + + Audio Forward + Audio továbbítás + + + + Audio Repeat + Audió ismétlés + + + + Audio Random Play + Audió véletlenszerű lejátszása + + + + Subtitle + Alcím + + + + Audio Cycle Track + Audió ciklikus követése + + + + Time + Idő + + + + View + Nézet + + + + Top Menu + Felső menü + + + + Suspend + Felfüggesztés + + + + Hibernate + Hibernálás + + + + Print Screen + Képernyő másolás + + + + Page Up + Feljebb lapozás + + + + Page Down + Lejjebb lapozás + + + + Caps Lock + Caps Lock + + + + Num Lock + Num Lock + + + + Number Lock + Number Lock + + + + Scroll Lock + Scroll Lock + + + + Insert + Insert + + + + Delete + Delete + + + + Escape + Escape + + + + System Request + System Request + + + + + Select + Kiválsztás + + + + Yes + Igen + + + + No + Nem + + + + Context1 + Tartalom1 + + + + Context2 + Tartalom2 + + + + Context3 + Tartalom3 + + + + Context4 + Tartalom4 + + + + Call + Hívás + + + + Hangup + Felfüggeszt + + + + Flip + Feldobás + + + + + Ctrl + Ctrl + + + + + Shift + Shift + + + + + Alt + Alt + + + + + Meta + Meta + + + + + + + + + + + F%1 + F%1 + + + + Home Page + Honlap + + + + QSlider + + + Page left + Lapozás balra + + + + Page up + Lapozás felfele + + + + Position + Pozíció + + + + Page right + Lapozás jobbra + + + + Page down + Lapozás lefele + + + + QSocks5SocketEngine + + + Connection to proxy refused + Proxyhoz kapcsolódás elutasítva + + + + Connection to proxy closed prematurely + A proxyhoz való csatlakozás túl korán be lett zárva + + + + Proxy host not found + Proxy hoszt nem található + + + + Connection to proxy timed out + Proxyhoz való csatlakozásnál időtúllépés történt + + + + Proxy authentication failed + Proxy hitelesítési hiba + + + + Proxy authentication failed: %1 + Proxy hitelesítési hiba: %1 + + + + SOCKS version 5 protocol error + SOCKS verzió 5-s protokoll hiba + + + + General SOCKSv5 server failure + Általános SOCKSv5 szerver hiba + + + + Connection not allowed by SOCKSv5 server + A csatlakozást nem engedi a SOCKSv5 szerver + + + + TTL expired + Lejárt a TTL + + + + SOCKSv5 command not supported + SOCKSv5 parancs nincs támogatva + + + + Address type not supported + Cím típus nincs támogatva + + + + Unknown SOCKSv5 proxy error code 0x%1 + Ismeretlen SOCKSv5 proxy hiba kód 0x%1 + + + + Network operation timed out + Hálózat műveleti időtúllépés + + + + QSoftKeyManager + + + Ok + Ok + + + + Select + Kiválasztás + + + + Done + Kész + + + + Options + Opciók + + + + Cancel + Mégse + + + + Exit + Kilépés + + + + QSpinBox + + + More + Több + + + + Less + Kevés + + + + QSql + + + Delete + Törlés + + + + Delete this record? + Törölni szeretné ezt a felvételt? + + + + + + Yes + Igen + + + + + + No + Nem + + + + Insert + Beszúrás + + + + Update + Frissítés + + + + Save edits? + Szerkesztések mentése? + + + + Cancel + Mégse + + + + Confirm + Megerősítés + + + + Cancel your edits? + Szerkesztések visszavonása? + + + + QSslSocket + + + Unable to write data: %1 + Nem lehet adatot írni: %1 + + + + Error while reading: %1 + Hiba történt olvasás közben: %1 + + + + Error during SSL handshake: %1 + Hiba történt az SSL kézfogás közben: %1 + + + + Error creating SSL context (%1) + Hiba történt az SSL összefüggés (%1) létrehozása közben + + + + Invalid or empty cipher list (%1) + Érvénytelen vagy üres számjegy lista (%1) + + + + Private key does not certify public key, %1 + A privát kulcs nem igazolja a publikus kulcsot, %1 + + + + Error creating SSL session, %1 + Hiba történt az SSL szakasz létrehozása közben, %1 + + + + Error creating SSL session: %1 + Hiba történt az SSL szakasz létrehozása közben: %1 + + + + Cannot provide a certificate with no key, %1 + Nem lehet biztosítani egy igazolást kulcs nélkül, %1 + + + + Error loading local certificate, %1 + Hiba történt a helyi igazolás betöltése közben, %1 + + + + Error loading private key, %1 + Hiba történt a privát kulcs betöltése közben, %1 + + + + No error + Nincs hiba + + + + The issuer certificate could not be found + A problémás igazolás nem található + + + + The certificate signature could not be decrypted + Az igazolás aláírás titkosítását nem sikerült feloldani + + + + The public key in the certificate could not be read + Az igazolásban található publikus kulcsot nem sikerült olvasni + + + + The signature of the certificate is invalid + Az igazolás aláírása érvénytelen + + + + The certificate is not yet valid + Az igazolás még nem érvényes + + + + The certificate has expired + Az igazolás lejárt + + + + The certificate's notBefore field contains an invalid time + A mező érvénytelen idő tartalmazása előtt nincsen igazolás + + + + The certificate's notAfter field contains an invalid time + A mező érvénytelen idő tartalmazása után nincsen igazolás + + + + The certificate is self-signed, and untrusted + Az igazolás ön jelölt, és megbízhatatlan + + + + The root certificate of the certificate chain is self-signed, and untrusted + Az igazolás lánc rendszergazda igazolása ön jelölt és megbízhatatlan + + + + The issuer certificate of a locally looked up certificate could not be found + Egy helyileg utánanézett igazolás problémás igazolása nem található + + + + No certificates could be verified + Nem sikerült igazolást leellenőrizni + + + + One of the CA certificates is invalid + A CA igazolások egyike érvénytelen + + + + The basicConstraints path length parameter has been exceeded + Az alap megszorítási útvonal hossz paramétereket meghaladták + + + + The supplied certificate is unsuitable for this purpose + A szolgáltatott igazolás nem alkalmas erre a célra + + + + The root CA certificate is not trusted for this purpose + A rendszergazda CA igazolás nem megbízható erre a célra + + + + The root CA certificate is marked to reject the specified purpose + A rendszergazda CA igazolás a specializást cél megtagadására lett megjelölve + + + + The current candidate issuer certificate was rejected because its subject name did not match the issuer name of the current certificate + Az aktuális jelölt problémás igazolása meg lett tagadva, mert a téma neve nem egyezett az aktuális igazolás problémás nevével + + + + The current candidate issuer certificate was rejected because its issuer name and serial number was present and did not match the authority key identifier of the current certificate + Az aktuális jelölt problémás igazolása el lett utasítva, mert a problémás név és sorszám benyűjtva és nem egyezett az aktuális igazolás hitelesítési kulcs azonosítójával + + + + The peer did not present any certificate + A kortárs nem nyújtott be egyetlen igazolást sem + + + + The host name did not match any of the valid hosts for this certificate + A hoszt név nem egyezik egyetlen érvényes hoszttal sem erre az igazolásra + + + + Unknown error + Ismeretlen hiba + + + + QStateMachine + + + Missing initial state in compound state '%1' + Hiányzó kezdeti állapot összetett helyzetben '%1' + + + + Missing default state in history state '%1' + Hiányzó alapértelmezett állapot a történelmi állapotokban '%1' + + + + No common ancestor for targets and source of transition from state '%1' + Nincs közös őse az átmeneti céloknak és forrásnak a(z) '%1' helyzetből + + + + Unknown error + Ismeretlen hiba + + + + QSystemSemaphore + + + %1: does not exist + %1 : nem létezik + + + + + %1: out of resources + %1: kifogyott az erőforrásból + + + + + %1: permission denied + %1: Engedély megtagadva + + + + %1: already exists + %1: már létezik + + + + + %1: unknown error %2 + %1: ismeretlen hiba %2 + + + + QTDSDriver + + + Unable to open connection + Nem lehet megnyitni a kapcsolatot + + + + Unable to use database + Nem lehet az adatbázist használni + + + + QTabBar + + + Scroll Left + Görgetés balra + + + + Scroll Right + Görgetésre jobbra + + + + QTcpServer + + + Operation on socket is not supported + A socketen végzett művelet nem támogatott + + + + QTextControl + + + &Undo + &Visszavonás + + + + &Redo + &Megismétlés + + + + Cu&t + &Kivágás + + + + &Copy + &Másolás + + + + Copy &Link Location + &Link címének másolása + + + + &Paste + &Beillesztés + + + + Delete + Törlés + + + + Select All + Az összes kiválasztása + + + + QToolButton + + + + Press + Megnyomás + + + + + Open + Megnyitás + + + + QUdpSocket + + + This platform does not support IPv6 + Ez a platform nem támogatja az IPv6-t + + + + QUndoGroup + + + Undo + Visszavonás + + + + Redo + Megismétlés + + + + QUndoModel + + + <empty> + <üres> + + + + QUndoStack + + + Undo + Visszavonás + + + + Redo + Megismétlés + + + + QUnicodeControlCharacterMenu + + + LRM Left-to-right mark + LRM balról jobbra jelölés + + + + RLM Right-to-left mark + RLM jobbról balra jelölés + + + + ZWJ Zero width joiner + ZWJ Nulla szélességű asztalos + + + + ZWNJ Zero width non-joiner + ZWNJ Nulla szélességű nem asztalos + + + + ZWSP Zero width space + ZWSP Nulla szélességű hely + + + + LRE Start of left-to-right embedding + LRE Balról jobbra beágyazás kezdete + + + + RLE Start of right-to-left embedding + RLE Jobbról balra beágyazás kezdete + + + + LRO Start of left-to-right override + LRO Balról jobbra megsemmisítés kezdete + + + + RLO Start of right-to-left override + RLO Jobbról balra megsemmisítés kezdete + + + + PDF Pop directional formatting + PDF Kérirányú formázás benézése + + + + Insert Unicode control character + Unicode vezérlő karakter beszúrása + + + + QWebFrame + + + Request cancelled + Kérés visszavonva + + + + Request blocked + Kérés blokkolva + + + + Cannot show URL + Nem lehet megjeleníteni az URL-t + + + + Frame load interrupted by policy change + Irányvonal megváltozása miatt a szerkezet töltése megszakítva + + + + Cannot show mimetype + Nem lehet megjeleníteni mime típust + + + + File does not exist + A fájl nem létezik + + + + QWebPage + + + Submit + default label for Submit buttons in forms on web pages + Feltöltés + + + + Submit + Submit (input element) alt text for <input> elements with no alt, title, or value + Feltöltés + + + + Reset + default label for Reset buttons in forms on web pages + Helyreállítás + + + + Choose File + title for file button used in HTML forms + Fájl kiválasztása + + + + No file selected + text to display in file button used in HTML forms when no file is selected + Nincsen egyetlen fájl sem kiválasztva + + + + Open in New Window + Open in New Window context menu item + Megnyitás új ablakban + + + + Save Link... + Download Linked File context menu item + Link mentése... + + + + Copy Link + Copy Link context menu item + Link másolása + + + + Open Image + Open Image in New Window context menu item + Kép megnyitása + + + + Save Image + Download Image context menu item + Kép elmentése + + + + Copy Image + Copy Link context menu item + Kép másolása + + + + Open Frame + Open Frame in New Window context menu item + Szerkezet megnyitása + + + + Copy + Copy context menu item + Másolás + + + + Go Back + Back context menu item + Menj vissza + + + + Go Forward + Forward context menu item + Menj előre + + + + Stop + Stop context menu item + Leállítás + + + + Reload + Reload context menu item + Újratöltés + + + + Cut + Cut context menu item + Kivágás + + + + Paste + Paste context menu item + Beillesztés + + + + No Guesses Found + No Guesses Found context menu item + Nincs feltételezések találata + + + + Ignore + Ignore Spelling context menu item + Mellőzés + + + + Add To Dictionary + Learn Spelling context menu item + Hozzáadás a szótárhoz + + + + Search The Web + Search The Web context menu item + Keresés a weben + + + + Look Up In Dictionary + Look Up in Dictionary context menu item + Utánanézés szótárban + + + + Open Link + Open Link context menu item + Link megnyitása + + + + Ignore + Ignore Grammar context menu item + Mellőzés + + + + Spelling + Spelling and Grammar context sub-menu item + Helyesírás + + + + Show Spelling and Grammar + menu item title + Helyesírás és nyelvtan megjelenítése + + + + Hide Spelling and Grammar + menu item title + Helyesírás és nyelvtan elrejtése + + + + Check Spelling + Check spelling context menu item + Helyesírás ellenőrzés + + + + Check Spelling While Typing + Check spelling while typing context menu item + Helyesírás ellenőrzés gépelés közben + + + + Check Grammar With Spelling + Check grammar with spelling context menu item + Nyelvtani ellenőrzés helyesírás ellenőrzéssel + + + + Fonts + Font context sub-menu item + Betű + + + + Bold + Bold context menu item + Félkövér + + + + Italic + Italic context menu item + Dőlt + + + + Underline + Underline context menu item + Aláhúzás + + + + Outline + Outline context menu item + Kontúrozás + + + + Direction + Writing direction context sub-menu item + Irány összefüggések írás, menü elem + + + + Text Direction + Text direction context sub-menu item + Szöveg irány + + + + Default + Default writing direction context menu item + Alapértelmezett + + + + Left to Right + Left to Right context menu item + Balról jobbra + + + + Right to Left + Right to Left context menu item + Jobbról balra + + + + Loading... + Media controller status message when the media is loading + Betöltés... + + + + Live Broadcast + Media controller status message when watching a live broadcast + Élő bejelentés + + + + Audio Element + Media controller element + Audió elem + + + + Video Element + Media controller element + Videó elem + + + + Mute Button + Media controller element + Elnémítás gomb + + + + Unmute Button + Media controller element + Elnémítás megszűntetése gomb + + + + Play Button + Media controller element + Lejátszás gomb + + + + Pause Button + Media controller element + Szünet gomb + + + + Slider + Media controller element + Csúszka + + + + Slider Thumb + Media controller element + Csuszka ujj + + + + Rewind Button + Media controller element + Áttekercselés gomb + + + + Return to Real-time Button + Media controller element + A valós idejűre visszatérés gomb + + + + Elapsed Time + Media controller element + Eltelt idő + + + + Remaining Time + Media controller element + Fennmaradó idő + + + + Status Display + Media controller element + Státusz kijelzés + + + + Fullscreen Button + Media controller element + Teljes képernyő gomb + + + + Seek Forward Button + Media controller element + Keresés továbbítása gomb + + + + Seek Back Button + Media controller element + Keresés visszafele gomb + + + + Audio element playback controls and status display + Media controller element + Audió elem visszajátszás vezérlők és státusz kijelzés + + + + Video element playback controls and status display + Media controller element + Videó elem visszajátszás vezérlők és státusz kijelzés + + + + Mute audio tracks + Media controller element + Audió számok elnémítása + + + + Unmute audio tracks + Media controller element + Audió számok elnémításának megszűntetése + + + + Begin playback + Media controller element + Visszajátszás megkezdése + + + + Pause playback + Media controller element + Visszajátszás szüneteltetése + + + + Movie time scrubber + Media controller element + Film idő súroló + + + + Movie time scrubber thumb + Media controller element + Film idő súrolókörte + + + + Rewind movie + Media controller element + Film visszatekerése + + + + Return streaming movie to real-time + Media controller element + Özönlő filmek visszaadása a valós idő számára + + + + Current movie time + Media controller element + Az aktuális filmidő + + + + Remaining movie time + Media controller element + Fennmaradó filmidő + + + + Current movie status + Media controller element + Az aktuális film státusz + + + + Play movie in full-screen mode + Media controller element + Film lejátszása teljes képernyős módban + + + + Seek quickly back + Media controller element + Gyorsan visszafele keresés + + + + Seek quickly forward + Media controller element + Gyorsan előre keresés + + + + Indefinite time + Media time description + Bizonytalan idő + + + + %1 days %2 hours %3 minutes %4 seconds + Media time description + %1 nap %2 óra %3 perc %4 másodperc + + + + %1 hours %2 minutes %3 seconds + Media time description + %1 óra %2 perc %3 másodperc + + + + %1 minutes %2 seconds + Media time description + %1 perc %2 másodperc + + + + %1 seconds + Media time description + %1 másodperc + + + + Inspect + Inspect Element context menu item + Megtekintés + + + + No recent searches + Label for only item in menu that appears when clicking on the search field image, when no searches have been performed + Nincsenek utóbbi keresések + + + + Recent searches + label for first item in the menu that appears when clicking on the search field image, used as embedded menu title + Utóbbi keresések + + + + Clear recent searches + menu item in Recent Searches menu that empties menu's contents + Utóbbi keresések kiürítése + + + + Unknown + Unknown filesize FTP directory listing item + Ismeretlen + + + + Web Inspector - %2 + Web felügyelő - %2 + + + + %1 (%2x%3 pixels) + Title string for images + %1 (%2x%3 pixelek) + + + + Bad HTTP request + Érvénytelen HTTP kérés + + + + This is a searchable index. Enter search keywords: + text that appears at the start of nearly-obsolete web pages in the form of a 'searchable index' + Ez egy kereshető index. Gépelje be a kívánt kulcsszavakat: + + + + Scroll here + Görgetés ide + + + + Left edge + Bal szegély + + + + Top + Felül + + + + Right edge + Jobb szegély + + + + Bottom + Alul + + + + Page left + Lapozás balra + + + + Page up + Lapozás fel + + + + Page right + Lapozás jobbra + + + + Page down + Lapozás balra + + + + Scroll left + Görgetés balra + + + + Scroll up + Görgetés fel + + + + Scroll right + Görgetés jobbra + + + + Scroll down + Görgetés lefele + + + + %n file(s) + number of chosen file + + %n fájl + + + + + JavaScript Alert - %1 + JavaSzkript figyelmeztetés - %1 + + + + JavaScript Confirm - %1 + JavaSzkript megerősítés - %1 + + + + JavaScript Prompt - %1 + JavaSzkript prompt - %1 + + + + JavaScript Problem - %1 + JavaSzkript probléma - %1 + + + + The script on this page appears to have a problem. Do you want to stop the script? + Az ezen a lapon található szkriptnek úgy tűnik, hogy van egy problémája. Le szeretné állítani a szkriptet? + + + + Move the cursor to the next character + Az egér mozgatása a következő karakterre + + + + Move the cursor to the previous character + Az egér mozgatása az előző karakterre + + + + Move the cursor to the next word + Az egér mozgatása a következő szóra + + + + Move the cursor to the previous word + Az egér mozgatása az előző szóra + + + + Move the cursor to the next line + Az egér mozgatása a következő sorra + + + + Move the cursor to the previous line + Az egér mozgatása az előző sorra + + + + Move the cursor to the start of the line + Az egér mozgatása a sor elejére + + + + Move the cursor to the end of the line + Az egér mozgatása a sor végére + + + + Move the cursor to the start of the block + Az egér mozgatása a blokk elejére + + + + Move the cursor to the end of the block + Az egér mozgatása a blokk végére + + + + Move the cursor to the start of the document + Az egér mozgatása a dokumentum elejére + + + + Move the cursor to the end of the document + Az egér mozgatása a dokumentum végére + + + + Select all + Az összes kiválasztása + + + + Select to the next character + A következő karakter kiválasztása + + + + Select to the previous character + Az előző karakter kiválasztása + + + + Select to the next word + A következő szó kiválasztása + + + + Select to the previous word + Az előző szó kiválasztása + + + + Select to the next line + A következő sor kiválasztása + + + + Select to the previous line + Az előző sor kiválasztása + + + + Select to the start of the line + A sor elejének kiválasztása + + + + Select to the end of the line + A sor végének kiválasztása + + + + Select to the start of the block + A blokk elejének kiválsztása + + + + Select to the end of the block + A blokk végének kiválasztása + + + + Select to the start of the document + A dokumentum elejének kiválasztása + + + + Select to the end of the document + A dokumentum végének kiválasztása + + + + Delete to the start of the word + A szó elejének törlése + + + + Delete to the end of the word + A szó végének törlése + + + + Insert a new paragraph + Egy új bekezdés beszúrása + + + + Insert a new line + Egy új sor beszúrása + + + + Paste and Match Style + Stílus beillesztése és összepasszintása + + + + Remove formatting + Formázás eltávolítása + + + + Strikethrough + Áthúzás + + + + Subscript + Alsó index + + + + Superscript + Felső index + + + + Insert Bulleted List + Hivatalos közlemény lista beszúrása + + + + Insert Numbered List + Számozott lista beszúrása + + + + Indent + Behúzás + + + + Outdent + Behúzás kifelé + + + + Center + Közép + + + + Justify + Igazolás + + + + Align Left + Balra állít + + + + Align Right + Jobbra állít + + + + QWhatsThisAction + + + What's This? + Mi ez? + + + + QWidget + + + * + * + + + + QWizard + + + Cancel + Mégse + + + + Help + Súgó + + + + < &Back + < &Vissza + + + + &Finish + &Befejezés + + + + &Help + &Súgó + + + + Go Back + Vissza ugrás + + + + Continue + Folytatás + + + + Commit + Kommit + + + + Done + Kész + + + + &Next + &Következő + + + + &Next > + &Következő > + + + + QWorkspace + + + &Restore + &Visszaállítás + + + + &Move + &Mozgatás + + + + &Size + &Méret + + + + Mi&nimize + &Minimalizálás + + + + Ma&ximize + Ma&ximalizálás + + + + &Close + &Bezárás + + + + Stay on &Top + &Tetején maradni + + + + Minimize + Minimalizálás + + + + Restore Down + Letárolás + + + + Close + Bezárás + + + + + Sh&ade + Árnya&lat + + + + + %1 - [%2] + %1 - [%2] + + + + &Unshade + &Leeresztés + + + + QXml + + + no error occurred + nem történt hiba + + + + error triggered by consumer + Ügyfél által előidézett hiba + + + + unexpected end of file + Váratlan fájlvég + + + + more than one document type definition + Több mint egy dokumentum típus definíció + + + + error occurred while parsing element + Hiba történt az elem elemzése közben + + + + tag mismatch + Nem egyező címke + + + + error occurred while parsing content + Hiba történt a tartalom elemzése közben + + + + unexpected character + váratlan karakter + + + + invalid name for processing instruction + érvénytelen név az utasítás feldolgozására + + + + version expected while reading the XML declaration + várt verzió az XML deklaráció olvasása közben + + + + wrong value for standalone declaration + Hibás egyedülálló deklaráció érték + + + + error occurred while parsing document type definition + Hiba történt a dokumentum típus definíció elemzése közben + + + + letter is expected + betű várt + + + + error occurred while parsing comment + hiba történt az elemző megjegyzés előfordulása közben + + + + error occurred while parsing reference + Hiba történt az elemző hivatkozás előfordulása közben + + + + internal general entity reference not allowed in DTD + A DTD-ben nem engedélyezett a belső általános valós hivatkozás + + + + external parsed general entity reference not allowed in attribute value + Az attribútum értékben nem engedélyezett a külsőleg elemzett általános valós hivatkozás + + + + external parsed general entity reference not allowed in DTD + A DTD-ben nem engedélyezett a külsőleg elemzett általános valós hivatkozás + + + + unparsed entity reference in wrong context + Hivatkozás egy nem értelmezett entitásra hibás összefüggésben + + + + recursive entities + Rekurzív entitások + + + + error in the text declaration of an external entity + Hiba egy külső entitás szöveg deklarációjában + + + + encoding declaration or standalone declaration expected while reading the XML declaration + Kódolása deklaráció vagy egyedülálló deklaráció várt az XML deklaráció olvasása közben + + + + standalone declaration expected while reading the XML declaration + Egyedülálló deklaráció várt az XML deklaráció olvasása közben + + + + QXmlPatternistCLI + + + Warning in %1, at line %2, column %3: %4 + Figyelmeztetés %1-ben, %2 sorban, %3 oszlopban: %4 + + + + Warning in %1: %2 + Figyelmeztetés %1-ben: %2 + + + + Unknown location + Ismeretlen elhelyezkedés + + + + Error %1 in %2, at line %3, column %4: %5 + %1 hiba %2-ben, %3 sorban, %4 oszlopban: %5 + + + + Error %1 in %2: %3 + %1 hiba %2-ben: %3 + + + + QXmlStream + + + + Extra content at end of document. + Extra tartalom a dokumentum végén. + + + + Invalid entity value. + Érvénytelen entitás érték. + + + + Invalid XML character. + Érvénytelen XML karakter. + + + + Sequence ']]>' not allowed in content. + ']]>' sor nem engedélyezett a tartalomban. + + + + Namespace prefix '%1' not declared + '%1' névtér előtag nincsen deklarálva + + + + Attribute redefined. + Attribútum újradefiniálva. + + + + Unexpected character '%1' in public id literal. + Váratlan karakter '%1' a publikus azonosító literál. + + + + Invalid XML version string. + Érvénytelen XML verzió sztring. + + + + Unsupported XML version. + Nem támogatott XML verzió. + + + + %1 is an invalid encoding name. + %1 egy érvénytelen kódolási név. + + + + Encoding %1 is unsupported + %1 kódolás nem támogatva + + + + Standalone accepts only yes or no. + Egyedülálló elfogadás kizárólas igen vagy nem. + + + + Invalid attribute in XML declaration. + Érvénytelen attribútum az XML deklarációban. + + + + Premature end of document. + Túl korai dokumentum vég. + + + + Invalid document. + Érvénytelen dokumentum. + + + + Expected + Várt + + + + , but got ' + , pedig megkapta ' + + + + Unexpected ' + Váratlan ' + + + + Expected character data. + Várt karakter adat. + + + + Recursive entity detected. + Rekurzív entitás észlelve. + + + + Start tag expected. + Kezdő címke várva. + + + + XML declaration not at start of document. + XML deklaráció nem a dokumentum elején található. + + + + NDATA in parameter entity declaration. + NDATA a paraméter entitás deklarációban. + + + + %1 is an invalid processing instruction name. + %1 egy érvénytelen feldolgozó utasítás neve. + + + + Invalid processing instruction name. + Érvénytelen feldolgozó utasítás név. + + + + + + + Illegal namespace declaration. + Illegális névtér deklarációk. + + + + Invalid XML name. + Érvénytelen XML név. + + + + Opening and ending tag mismatch. + Nyitó és záró címkék nem egyeznek. + + + + Reference to unparsed entity '%1'. + Hivatkozás egy nem értelmezett entitásra '%1'. + + + + + + Entity '%1' not declared. + '%1' entitás nincsen deklarálva. + + + + Reference to external entity '%1' in attribute value. + Hivatkozás egy külső entitásra '%1' az attribútum értékben. + + + + Invalid character reference. + Érvénytelen karakter hivatkozás. + + + + + Encountered incorrectly encoded content. + Helytelen kódolási tartalommal találta szembe magát. + + + + The standalone pseudo attribute must appear after the encoding. + Az egyedülálló ál attribútumnak a kódolás után kell feltűnnie. + + + + %1 is an invalid PUBLIC identifier. + %1 egy érvénytelen PUBLIC-us azonosító. + + + + QtXmlPatterns + + + + At least one component must be present. + Legalább egy komponenset be kell nyújtani. + + + + %1 is not a valid value of type %2. + %1 nem egy érvény értéke a(z) %2 típusnak. + + + + When casting to %1 from %2, the source value cannot be %3. + A(z) %1-ről %2-re történő kasztoláskor, a forrás érték nem lehet %3. + + + + Effective Boolean Value cannot be calculated for a sequence containing two or more atomic values. + Hatékony logikai értéket nem lehet egy sor számára kiszámítani, amely kettő vagy több atomikus értéket tartalmaz. + + + + The data of a processing instruction cannot contain the string %1 + Egy feldolgozó utasítás adata nem tartalmazhat %1 sztringet + + + + + %1 is an invalid %2 + %1 egy érvénytelen %2 + + + + %1 is not a valid XML 1.0 character. + %1 egy érvénytelen 1.0 XML karakter. + + + + %1 was called. + %1 lett meghívva. + + + + In the replacement string, %1 must be followed by at least one digit when not escaped. + A kicserélési sztrinben, %1 -t legalább egy számnak kell követnie nem meneküléskor. + + + + In the replacement string, %1 can only be used to escape itself or %2, not %3 + A kicserelési sztringben, %1-t csak magának a(z) %2 vagy %3 menekülésére lehet használni + + + + %1 matches newline characters + %1 megegyező újsor karakterek + + + + Matches are case insensitive + Az egyezés kis és nagybetűre nem érzékeny + + + + %1 is an invalid regular expression pattern: %2 + %1 egy érvénytelen reguláris kifejezés minta: %2 + + + + It will not be possible to retrieve %1. + Nem lesz lehetséges kinyerni %1. + + + + The default collection is undefined + Az alapértelmezett gyűjtemény nincs definiálva + + + + %1 cannot be retrieved + %1 nem lehet megszerezni + + + + The item %1 did not match the required type %2. + A(z) %1 elem nem egyezik a szükséges típussal %2. + + + + + %1 is an unknown schema type. + %1 egy ismeretlen terv típus. + + + + A template with name %1 has already been declared. + Egy %1 nevű sablon már deklarálva van. + + + + Only one %1 declaration can occur in the query prolog. + Kizárólag egy %1 deklaráció fordulhat elő a kérdéses előszóban. + + + + The initialization of variable %1 depends on itself + A(z) %1 változó inicializálása önmagától függ + + + + The variable %1 is unused + A(z) %1 változó nincsen használva + + + + Version %1 is not supported. The supported XQuery version is 1.0. + %1-es verzió nem támogatott. A támogatott XQuery verzió az 1.0. + + + + No function with signature %1 is available + Nincs %1 aláírással rendelkező függvény + + + + It is not possible to redeclare prefix %1. + Nem lehetséges a(z) %1 előtag újradeklarálása. + + + + Prefix %1 is already declared in the prolog. + %1 előtag már deklarálva van az előszóban. + + + + The name of an option must have a prefix. There is no default namespace for options. + Az opció nevének tartalmaznia kell egy előtagot. Nincs alapértelmezett névtér ezekre az opciókra. + + + + The Schema Import feature is not supported, and therefore %1 declarations cannot occur. + A terv importálása tulajdonság nem támogatott, és ennek következtében a(z) %1 deklarációk nem fordulhatnak elő. + + + + The target namespace of a %1 cannot be empty. + Egy %1 cél névtere nem lehet üres. + + + + The module import feature is not supported + A modul importáló tulajdonság nem támogatott + + + + The namespace of a user defined function in a library module must be equivalent to the module namespace. In other words, it should be %1 instead of %2 + Egy felhasználó által definiált függvény névterének egy könyvtár modulban megfelelőnek kell lenni a modul névtérrel. Más szóval, %1-nek kellene lennie %2 helyett + + + + A function already exists with the signature %1. + Egy függvény már létezik ezzel az aláírással %1. + + + + No external functions are supported. All supported functions can be used directly, without first declaring them as external + Kulső függvények nincsenek támogatva. Az összes támogatott függvényt lehet közvetlenül haszálni, az első külső deklarálásuk nélkül + + + + The %1-axis is unsupported in XQuery + A(z) %1 tengely nem támogatott az XQuery-ben + + + + The namespace URI cannot be the empty string when binding to a prefix, %1. + Az URI névtér nem lehet üres sztring egy előtaghoz való összeköttetéskor, %1. + + + + %1 is an invalid namespace URI. + %1 egy érvénytelen URI névtér. + + + + It is not possible to bind to the prefix %1 + Nem lehetséges a(z) %1 előtaggal összekötni + + + + Two namespace declaration attributes have the same name: %1. + Két névtér deklaráció attribútumnak ugyanaz a neve: %1. + + + + The namespace URI must be a constant and cannot use enclosed expressions. + Az URI névtérnek állandónak kell lennie és nem használhat elhatárolt kifejezéseket. + + + + + %1 is not in the in-scope attribute declarations. Note that the schema import feature is not supported. + %1 nem a hatókör attribútum deklarációin belül található. Vegye figyelembe, hogy a terv importáló tulajdonság nem támogatott. + + + + empty + üres + + + + zero or one + nulla vagy egy + + + + exactly one + pontosan egy + + + + one or more + egy vagy több + + + + zero or more + nulla vagy több + + + + The focus is undefined. + A fókusz nincs definiálva. + + + + An attribute by name %1 has already been created. + Egy %1 nevű attribútum már létre lett hozva. + + + + Network timeout. + Hálózati időtúllépés. + + + + Element %1 can't be serialized because it appears outside the document element. + %1 elemet nem lehet besorolni, mert úgy tűnik a dokumentum elem külső oldalán található. + + + + Year %1 is invalid because it begins with %2. + %1 év érvénytelen, mert %2-vel kezdődik. + + + + Day %1 is outside the range %2..%3. + %1 nap a tartomány külsp oldalán van %2..%3. + + + + Month %1 is outside the range %2..%3. + %1 hónap a tartomány külső felületén van %2..%3. + + + + Overflow: Can't represent date %1. + Túlcsordulás: Nem lehet feltünteti a(z) %1 dátumot. + + + + Day %1 is invalid for month %2. + %1 nap érvénytelen a(z) %2 hónapra vonatkozólag. + + + + Time 24:%1:%2.%3 is invalid. Hour is 24, but minutes, seconds, and milliseconds are not all 0; + Idő 24:%1:%2:%3 érvénytelen. Az óra 24, de a perc, másodperc, és milliszekundum egyáltalán nem 0; + + + + Time %1:%2:%3.%4 is invalid. + Idő %1:%2:%3.%4 érvénytelen. + + + + Overflow: Date can't be represented. + Túlcsordulás: A dátumot nem lehet feltüntetni. + + + + At least one time component must appear after the %1-delimiter. + Legalább egy idő komponensnek lennie kell a(z) %1 határolójel után. + + + + + Dividing a value of type %1 by %2 (not-a-number) is not allowed. + %1 típus értékének osztása egy %2(nem szám)-mal nem engedélyezett. + + + + Dividing a value of type %1 by %2 or %3 (plus or minus zero) is not allowed. + %1 típus értékének osztása egy %2 vagy %3(plusz vagy minusz nulla)-mal nem engedélyezett. + + + + Multiplication of a value of type %1 by %2 or %3 (plus or minus infinity) is not allowed. + %1 típusú érték %2 vagy %3-mal való szorzása(plusz vagy minusz végtelen) nem engedélyezett. + + + + A value of type %1 cannot have an Effective Boolean Value. + %1 típusú értéknek nincsen hatékony logikai értéke. + + + + Value %1 of type %2 exceeds maximum (%3). + %2 típus %1 értéke elérte a maxiumot (%3). + + + + Value %1 of type %2 is below minimum (%3). + %1 típus %2 értéke a minimum alatt van (%3). + + + + A value of type %1 must contain an even number of digits. The value %2 does not. + %1 típus értékének tartalmaznia kell egy páratlan számú számot. A(z) %2 érték nem. + + + + %1 is not valid as a value of type %2. + %1 érvénytelen %2 típusú értékként. + + + + Operator %1 cannot be used on type %2. + %1 műveletet nem lehet a(z) %2 típuson használni. + + + + Operator %1 cannot be used on atomic values of type %2 and %3. + %1 műveletet nem lehet a %2 és %3-as típusú atomikus értéken használni. + + + + The namespace URI in the name for a computed attribute cannot be %1. + Az URI névtér a névben számított attribútumra nem lehet %1. + + + + The name for a computed attribute cannot have the namespace URI %1 with the local name %2. + Egy kiszámított attribútumnak nem lehet %1 URI névtere %2 helyi névvel. + + + + Type error in cast, expected %1, received %2. + Típus hiba a kasztolásban, %1 várt, %2 kapott. + + + + When casting to %1 or types derived from it, the source value must be of the same type, or it must be a string literal. Type %2 is not allowed. + %1-re kasztoláskor vagy típus származtatáskor, a forrás értéknek ugyanolyan típusúnak kell lennie, vagy sztring literálnak kell lennie. %2 típus nem engedélyezett. + + + + A comment cannot contain %1 + A megjegyzés nem tartalmazhat %1-t + + + + A comment cannot end with a %1. + A megjegyzés nem végződget %1-gyel. + + + + An attribute node cannot be a child of a document node. Therefore, the attribute %1 is out of place. + Az attribútum csomópont egy dokumentum csomópont gyermeke. Ennek következtében a(z) %1 attribútum nem helyénvaló. + + + + A library module cannot be evaluated directly. It must be imported from a main module. + A köbyvtár modult nem lehet közvetlenül kiértékelni. A fő modulból kell importálni. + + + + No template by name %1 exists. + %1 nevű sablon nem létezik. + + + + A value of type %1 cannot be a predicate. A predicate must have either a numeric type or an Effective Boolean Value type. + A(z) %1 típus értéke egy állítmány. Egy állítmánynak tartalmaznia kell vagy egy szám típust vagy egy effektív logikai érték típust. + + + + A positional predicate must evaluate to a single numeric value. + A helyzet állítmányt egy egyetlen szám értékként kell kiértékelni. + + + + The target name in a processing instruction cannot be %1 in any combination of upper and lower case. Therefore, %2 is invalid. + A cél neve egy utasítás feldolgozásban nem lehet %1 kis és nagybetűk bármely kombinációjában. Ennek következtében a(z) %2 érvénytelen. + + + + %1 is not a valid target name in a processing instruction. It must be a %2 value, e.g. %3. + %1 nem egy érvényes cél név az utasítás feldolgozásban. %2 vagy %3 értéknek kell lennie. + + + + The last step in a path must contain either nodes or atomic values. It cannot be a mixture between the two. + Az utolsó lépésnek vagy csomópontokat vagy atomikus értékeket kell tartalmaznia. Ez nem lehet a kettő közötti keverék. + + + + No namespace binding exists for the prefix %1 + Nem létezik névtér összeköttetés a(z) %1 előtagra + + + + No namespace binding exists for the prefix %1 in %2 + Nem létezik névtér összeköttetés a(z) %1 előtagra %2-ben + + + + The first argument to %1 cannot be of type %2. It must be a numeric type, xs:yearMonthDuration or xs:dayTimeDuration. + Az első argumentum %1 nem lehet %2 típusú. Egy számos típusnak kelle lennie, xs:évHónapIdőtartam vagy xs:napIdőTartam. + + + + The first argument to %1 cannot be of type %2. It must be of type %3, %4, or %5. + Az első argumentum %1 nem lehet %2 típusú. %3, %4 vagy %5 típusúnak kell lennie. + + + + The second argument to %1 cannot be of type %2. It must be of type %3, %4, or %5. + Az második argumentum %1 nem lehet %2 típusú. %3, %4 vagy %5 típusúnak kell lennie. + + + + If both values have zone offsets, they must have the same zone offset. %1 and %2 are not the same. + Ha mindkét értéknek zóna eltolása van, ugyanazt a zóna eltolást kell tartalmazniuk. %1 és %2 nem ugyanaz. + + + + %1 must be followed by %2 or %3, not at the end of the replacement string. + %1-t %2 vagy %3-nak kell követnie, nem a kicserélési sztring végén. + + + + %1 and %2 match the start and end of a line. + %1 és %2 egyezik a sor elején és végén. + + + + Whitespace characters are removed, except when they appear in character classes + Nem látható karakterek eltávolítva, kivéve mikor karakter osztályokban tűnnek fel + + + + %1 is an invalid flag for regular expressions. Valid flags are: + %1 egy érvénytelen jelző reguláris kifejezésekre. Érvényes flagek: + + + + If the first argument is the empty sequence or a zero-length string (no namespace), a prefix cannot be specified. Prefix %1 was specified. + Ha az első argumentum üres sorozat vagy nulla hosszúságú sztring (nincsen névtér), egy előtagot nem lehet meghatározni. %1 előtag volt meghatározva. + + + + The normalization form %1 is unsupported. The supported forms are %2, %3, %4, and %5, and none, i.e. the empty string (no normalization). + A(z) %1 szabványosítási forma nem támogatott. A támogatott formák %2, %3, %4 és %5 és semmi más, lásd az üres sztringet (nincs szabványosítás). + + + + A zone offset must be in the range %1..%2 inclusive. %3 is out of range. + A zóna eltolásnak a(z) %1..%2 tartományban kell benne lennie. %3 az tartományon kívüli. + + + + Required cardinality is %1; got cardinality %2. + Szükséges számosság %1, szerzett számosság %2. + + + + The encoding %1 is invalid. It must contain Latin characters only, must not contain whitespace, and must match the regular expression %2. + A(z) %1 kódolás érvénytelen. Kizárólag latin karaktereket kell tartalmaznia, nem szabad látható karaktereket tartalmaznia, és a(z) %2 reguláris kifejezéssel kell megegyeznie. + + + + The keyword %1 cannot occur with any other mode name. + A(z) %1 kulcscszó nem fordulhat elő semmilyen más mód névvel. + + + + No variable with name %1 exists + %1 nevű változó nem létezik + + + + The value of attribute %1 must be of type %2, which %3 isn't. + A(z) %1 attribútumnak %2 típusúnak kell lennie, amelyik nem %3-as. + + + + The prefix %1 cannot be bound. By default, it is already bound to the namespace %2. + A(z) %1 előtagot nem lehet összekötni. Alapértelmezetten, már hozzá van kötve a %2 névtérhez. + + + + A variable with name %1 has already been declared. + %1 nevű változó már deklarálva van. + + + + No value is available for the external variable with name %1. + %1 nevű külső változóhoz nem érhető el érték. + + + + A stylesheet function must have a prefixed name. + A stíluslap függvénynek tartalmaznia kell egy előtag nevet. + + + + The namespace %1 is reserved; therefore user defined functions may not use it. Try the predefined prefix %2, which exists for these cases. + A(z) %1 névtér foglalt, ennek következtében a felhasználó által definiált függvényt nem lehet használni. Próbálja ki az előredefiniált %2 előtagot, amely erre az esetekre van kitalálva. + + + + An argument with name %1 has already been declared. Every argument name must be unique. + Egy %1 nevű argumentum már deklarálva van. Minden argumentum névnek egyedülállónak kell lennie. + + + + When function %1 is used for matching inside a pattern, the argument must be a variable reference or a string literal. + Mikor %1 függvény van használva egyeztetése egy mintán belül, az argumentumnak egy változó hivatkozásnak vagy egy sztring literálnak kell lennie. + + + + In an XSL-T pattern, the first argument to function %1 must be a string literal, when used for matching. + Egy XSLT mintában, az első argumentumnak a(z) %1 függvényre egy sztring literálnak kell lennie, amikor egyeztetésre használják. + + + + In an XSL-T pattern, the first argument to function %1 must be a literal or a variable reference, when used for matching. + Egy XSLT mintában, az első argumentumnak a(z) %1 függvény esetén egy literálnak vagy egy változó hibatkozásnak kell lennie, mikor egyeztetésre használják. + + + + In an XSL-T pattern, function %1 cannot have a third argument. + Egy XSLT mintában, %1 függvénynek nem lehet egy harmadik argumentuma. + + + + In an XSL-T pattern, only function %1 and %2, not %3, can be used for matching. + Egy XSLT mintában, kizárólag a(z) %1 és %2 függvényeket, és %3-at nem lehet egyeztetésre használni. + + + + In an XSL-T pattern, axis %1 cannot be used, only axis %2 or %3 can. + Egy XSLT mintában, %1 tengelyt nem lehet használni, kizárólag a(z) %2 vagy %3 tengelyeket. + + + + %1 is an invalid template mode name. + %1 egy érvénytelen sablon mód név. + + + + The name of a variable bound in a for-expression must be different from the positional variable. Hence, the two variables named %1 collide. + Egy változó összeköttetés nevének egy for kifejezésben különböznie kell a pozícionális változótol. Ezért, a két %1 nevű változó ütközik. + + + + The Schema Validation Feature is not supported. Hence, %1-expressions may not be used. + A terv jóváhagyási tulajdonság nem támogatott. Ezért, %1 kifejezést nem lehet használni. + + + + None of the pragma expressions are supported. Therefore, a fallback expression must be present + A pragma kifejezések egyike sem támogatott. Ezért egy visszavonuló kifejezést kell nyújtani + + + + Each name of a template parameter must be unique; %1 is duplicated. + Sablon paraméter mindegyik nevének egyedülállónak kell lennie, %1 az duplikáns. + + + + No function with name %1 is available. + %1 nevű függvény nem elérhető. + + + + %1 is not a valid numeric literal. + %1 nem egy érvényes számos literál. + + + + W3C XML Schema identity constraint selector + W3C XML terv azonosító megszorító kiválasztó + + + + W3C XML Schema identity constraint field + W3C XML Terv azonosító megszorító mező + + + + A construct was encountered which is disallowed in the current language(%1). + Egy olyan konstruktort talált amelyik nincsen engedélyezve az aktuális nyelvben(%1). + + + + Namespace %1 can only be bound to %2 (and it is, in either case, pre-declared). + %1 névteret kizárólag a %2-vel lehet összekötni (és ennyi, vagy mindkét esetben, előre deklarált). + + + + Prefix %1 can only be bound to %2 (and it is, in either case, pre-declared). + %1 előtagot kizárólag a %2-vel lehet összekötni (és ennyi, vagy mindkét esetben, előre deklarált). + + + + An attribute with name %1 has already appeared on this element. + %1 attribútum név már van ebben az elemben. + + + + A direct element constructor is not well-formed. %1 is ended with %2. + Egy közvetlen elem konstruktor, mely nincsen jól megformázva. %1 a(z) %2-ben végzőik. + + + + The name %1 does not refer to any schema type. + A(z) %1 név nem vonatkozik egyetlen terv típusra sem. + + + + %1 is an complex type. Casting to complex types is not possible. However, casting to atomic types such as %2 works. + %1 egy összetett típus. Összetett típusra kasztolás nem lehetséges. De egy atomikus típusra mint egy %2 működik. + + + + %1 is not an atomic type. Casting is only possible to atomic types. + %1 nem egy atomikus típus. Kaszolás kizárólag csak atomikus típusra lehetséges. + + + + %1 is not a valid name for a processing-instruction. + %1 nem egy érvényes név egy utasítás feldolgozásra. + + + + The name of an extension expression must be in a namespace. + Egy kifejezés kiterjesztés nevének egy névtérben kell lennie. + + + + Required type is %1, but %2 was found. + %1 a szükséges típus, de %2 található. + + + + Promoting %1 to %2 may cause loss of precision. + %1 elősegítése %2-re precíziós vesztést okozhat. + + + + It's not possible to add attributes after any other kind of node. + Nem lehetséges attribútumokat hozzáadni, bármely másik csomópont után. + + + + Only the Unicode Codepoint Collation is supported(%1). %2 is unsupported. + Kizárólag a Unicode Kódpontos összevetés támogatott(%1). %2 nem támogatott. + + + + Integer division (%1) by zero (%2) is undefined. + Egész számos (%1) osztás nullával (%2) nem definiált. + + + + Division (%1) by zero (%2) is undefined. + Osztás (%1) nullával (%2) nem definiált. + + + + Modulus division (%1) by zero (%2) is undefined. + Tényezős osztás (%1) nullával (%2) nem definiált. + + + + %1 takes at most %n argument(s). %2 is therefore invalid. + + %1 legalább %n argumentumot vár. A(z) %2 ennel következtében érvénytelen. + + + + + %1 requires at least %n argument(s). %2 is therefore invalid. + + %1 legalább %n argumentumot igényel. Ennek következtében a(z) %2 érvénytelen. + + + + + The root node of the second argument to function %1 must be a document node. %2 is not a document node. + A második argumentum rendszergazda csomópontja %1 függvényre dokumentum csomópontnak kell lenni. %2 nem egy dokumentum csomópont. + + + + The namespace for a user defined function cannot be empty (try the predefined prefix %1 which exists for cases like this) + A névtér a felhasználó által definiált függvényre nem lehet üres (próbálja ki az előredefiniált %1 előtagot, mely innen esetekre lett kitalálva) + + + + + A default namespace declaration must occur before function, variable, and option declarations. + Egy alapértelmezett névtér deklarációnak a függvény, változó, és opció deklarációk előtt kell elhelyezkednie. + + + + Namespace declarations must occur before function, variable, and option declarations. + A névtér deklarációnak a függvény, változó, és opció deklarációk előtt kell elhelyezkednie. + + + + Module imports must occur before function, variable, and option declarations. + Modul importálásnak a függvény, változó, és opció deklarációk előtt kell elhelyezkednie. + + + + %1 is not a whole number of minutes. + %1 nem egy egész számú perc érték. + + + + Attribute %1 can't be serialized because it appears at the top level. + %1 attribtútumot nem lehet sorozatosítani, mert legfelső szinten tűnik fel. + + + + %1 is an unsupported encoding. + %1 egy nem támogatott kódolás. + + + + %1 contains octets which are disallowed in the requested encoding %2. + %1 oktálisokat tartalmat, melyek tiltva vannak a lekérdezett %2 kódolásban. + + + + The codepoint %1, occurring in %2 using encoding %3, is an invalid XML character. + A kódpont %1, mely a %2-ben fordul elő %3 kódolást használva, egy érvénytelen XML karakter. + + + + Ambiguous rule match. + Bizonytalan szabály egyezés. + + + + In a namespace constructor, the value for a namespace cannot be an empty string. + Egy névtér konstruktorban, egy névtér értéke nem lehet egy üres sztring. + + + + The prefix must be a valid %1, which %2 is not. + Az előtagnak egy érvényes %1-nek kell lennie, %2 nem lehet. + + + + The prefix %1 cannot be bound. + A(z) %1 előtagot nem lehet összekötni. + + + + Only the prefix %1 can be bound to %2 and vice versa. + Kizárólag a(z) %1 előtagot lehet összekötni a %2-vel és fordítva. + + + + The parameter %1 is required, but no corresponding %2 is supplied. + A(z) %1 paraméter követelik, de nincs megelelő %2 támogatás hozzá. + + + + The parameter %1 is passed, but no corresponding %2 exists. + A(z) %1 paraméter teljesítve, de a megfelelő %2 nem létezik. + + + + The URI cannot have a fragment + Az URI nem tartalmaz tördezettséget + + + + Element %1 is not allowed at this location. + %1 elem nincs engedélyezve ezen a ponton. + + + + Text nodes are not allowed at this location. + Szöveg csomópontok nincsenek engedélyezve ezen a ponton. + + + + Parse error: %1 + Elemzési hiba: %1 + + + + The value of the XSL-T version attribute must be a value of type %1, which %2 isn't. + XSLT verzió attribútum értékének %1 típusú értéknek kell lennie, %2 nem lehet. + + + + Running an XSL-T 1.0 stylesheet with a 2.0 processor. + Egy XSLT 1.0 stíluslap egy 2.0 feldolgozóval való futtatása. + + + + Unknown XSL-T attribute %1. + Ismeretlen XSLT attribútum %1. + + + + Attribute %1 and %2 are mutually exclusive. + A(z) %1 és %2 attribútum kölcsönösen kizárják egymást. + + + + In a simplified stylesheet module, attribute %1 must be present. + Egy leegyszerűsített stíluslap modulban, %1 attribútumot kell nyújtani. + + + + If element %1 has no attribute %2, it cannot have attribute %3 or %4. + Ha a(z) %1 elem nem tartalmaz %2 attribútumot, akkor nem tartalmazhat %3 vagy %4 attribútumot. + + + + Element %1 must have at least one of the attributes %2 or %3. + %1 elemnek legalább egy %2 vagy %3 attribútumot kell tartalmaznia. + + + + At least one mode must be specified in the %1-attribute on element %2. + Legalább egy csomópontot meg kell határozni a(z) %1 attribútumban a(z) %2 elemen. + + + + Element %1 must come last. + %1 elemnek kell utoljára következnie. + + + + At least one %1-element must occur before %2. + Legalább egy %1 elemnek kell előfordulnia %2 előtt. + + + + Only one %1-element can appear. + Csak egy %1 elem jelenhet meg. + + + + At least one %1-element must occur inside %2. + Legalább egy %1 elem fordulhat elő %2-n belül. + + + + When attribute %1 is present on %2, a sequence constructor cannot be used. + Mikor %1 attribútuk van benyújtva %2-n, egy sorozat konstruktort nem lehet használni. + + + + Element %1 must have either a %2-attribute or a sequence constructor. + %1 elemnek vagy egy %2 attribútumot vagy egy sorozat konstruktort kell tartalmaznia. + + + + When a parameter is required, a default value cannot be supplied through a %1-attribute or a sequence constructor. + Amikor egy paramétert igényel, egy alapértelmezett érték ellátni egy %1 attribútum vagy egy sorozat konstruktoron keresztül. + + + + Element %1 cannot have children. + %1 elem nem tartalmazhat gyereket. + + + + Element %1 cannot have a sequence constructor. + %1 elem nem tartalmazhat egy sorozat konstruktort. + + + + + The attribute %1 cannot appear on %2, when it is a child of %3. + A(z) %1 attribútum nem jelenhet meg %2-n, mikor egy %3 gyereke. + + + + A parameter in a function cannot be declared to be a tunnel. + Egy paramétert nem lehet behangoltnak deklarálni egy függvényben. + + + + This processor is not Schema-aware and therefore %1 cannot be used. + Ez a feldolgozó nem terv biztos és ennek következtében a(z) %1-t nem lehet használni. + + + + Top level stylesheet elements must be in a non-null namespace, which %1 isn't. + Felső szintű stíluslap elemeknek nem szabad egy nem nulla névtérnek lenniük, %1 nem jó. + + + + The value for attribute %1 on element %2 must either be %3 or %4, not %5. + %1 attribútum értékének a(z) %2-s elemen vagy %3 vagy %4, vagy %5-nek kell lennie. + + + + Attribute %1 cannot have the value %2. + %1 attribútum nem tartalmazhat %2 értéket. + + + + The attribute %1 can only appear on the first %2 element. + A(z) %1 attribútum kizárólag az első %2 elemen tűnhet fel. + + + + At least one %1 element must appear as child of %2. + Legalább egy %1 elemnek mutatkoznia %2 gyerekeként. + + + + %1 has inheritance loop in its base type %2. + %1 tartalmaz egy öröklődési hurkot annak %2 alaptípusában. + + + + + Circular inheritance of base type %1. + A(z) %1 alaptípus cirkuláris öröklődése. + + + + Circular inheritance of union %1. + A(z) %1 union cirkuláris öröklődése. + + + + %1 is not allowed to derive from %2 by restriction as the latter defines it as final. + A(z) %1 %2-ből való származtatása nem megengedett, azzal a korlátozassal, hogy az utóbbi utolsónak definiálja. + + + + %1 is not allowed to derive from %2 by extension as the latter defines it as final. + %1-nek nem engedélyezett a %2-ből való származtatása, azzal a kiegészítéssel, hogy a utóbbi végsőnek definiálja. + + + + Base type of simple type %1 cannot be complex type %2. + A(z) %1 egyszerű típus alaptípusa nem lehet egy %2 összetett típus. + + + + Simple type %1 cannot have direct base type %2. + A(z) %1 egyszerű típus nem tartalmazhat közvetlen %2 alap típust. + + + + + Simple type %1 is not allowed to have base type %2. + %1 egyszerű típusnak nincs engedélyezve, hogy %2 alap típusokat tartalmazzon. + + + + Simple type %1 can only have simple atomic type as base type. + A(z) %1 egyszerű típus kizárólag egyszerű atomikus típusokat tartalmazhat alaptípusként. + + + + Simple type %1 cannot derive from %2 as the latter defines restriction as final. + %1 egyszerű típus nem származtatható %2-ből, mint ahogy az utóbbi végső korlátozásokat definiál. + + + + + Variety of item type of %1 must be either atomic or union. + %1 elemtípus különbözőségeinek vagy vagy atomikus vagy unionnak kell lenni. + + + + + Variety of member types of %1 must be atomic. + %1 tagtípusok különbözőségének atomikusnak kell lennie. + + + + + %1 is not allowed to derive from %2 by list as the latter defines it as final. + %1 származtatása a(z) %2-ből nem engedélyezett, listázva azt, hogy az utóbbi végsőként definiálja. + + + + Simple type %1 is only allowed to have %2 facet. + %1 egyszerű típus kizárólag %2 oldalt tartalmazhat. + + + + Base type of simple type %1 must have variety of type list. + %1 egyszerű típus alap típusának különböző típus listákat kell tartalmaznia. + + + + Base type of simple type %1 has defined derivation by restriction as final. + %1 egyszerű típus alaptípusa definiálja a számaztatást végső korlátozással. + + + + Item type of base type does not match item type of %1. + Az alap típus elem típusa nem egyezik a(z) %1 elemtípusával. + + + + + Simple type %1 contains not allowed facet type %2. + %1 egyszerű típus nem engedélyezett oldal %2 típusokat tartalmaz. + + + + + %1 is not allowed to derive from %2 by union as the latter defines it as final. + %1 %2-ből történő származtatása nem engedélyezett az unió által, az utóbbi végsőként definiálja. + + + + %1 is not allowed to have any facets. + %1 nem tartalmazhat semmilyen oldalt. + + + + Base type %1 of simple type %2 must have variety of union. + %2 egyszerű típus %1 alap típusának különböző egységeket kell tartalmaznia. + + + + Base type %1 of simple type %2 is not allowed to have restriction in %3 attribute. + %2 egyszerű típus %1 alap típusa nem tartalmazhat korlátozásokat a %3 attribútumban. + + + + Member type %1 cannot be derived from member type %2 of %3's base type %4. + %1 tag típus nem származtatható a(z) %3 %4 alap típusának %2 tagtípusából. + + + + Derivation method of %1 must be extension because the base type %2 is a simple type. + %1 származtatása eljárásának kiterjesztésnek kell lennie, mert %2 alap típus egy egyszerű típus. + + + + Complex type %1 has duplicated element %2 in its content model. + A(z) %1 összetett típusnak duplikáns %2 eleme van a tartalmi modellében. + + + + Complex type %1 has non-deterministic content. + %1 összetett típusnak nincsen meghatározott tartalma. + + + + Attributes of complex type %1 are not a valid extension of the attributes of base type %2: %3. + %1 összetett típus attribútumai a(z) %2 alap típus attribútumainak nem érvényes kiterjesztései: %3. + + + + Content model of complex type %1 is not a valid extension of content model of %2. + %1 komplex típus tartalmi modelle a(z) %2 tartalmi modellének nem egy érvényes kiterjesztése. + + + + Complex type %1 must have simple content. + %1 komplex típusnak tartalmaznia kell egy egyszerű tartalmat. + + + + Complex type %1 must have the same simple type as its base class %2. + %1 komplex típusnak ugyanazt az egyszerű típust kell tartalmaznia a(z) %2 alap osztálya számára. + + + + Complex type %1 cannot be derived from base type %2%3. + %1 komplex típus nem származtatható a(z) %2%3 alap típusból. + + + + Attributes of complex type %1 are not a valid restriction from the attributes of base type %2: %3. + %1 komplex típus attribútumai nem egy érvényes korlátozások a(z) %2 alap típus attribútumaitól: %3. + + + + Complex type %1 with simple content cannot be derived from complex base type %2. + %1 komplex típus egyszerű tartalommal nem származtatható %2 komplex alap típusból. + + + + Item type of simple type %1 cannot be a complex type. + A(z) %1 egyszerű típus elemi típusa nem lehet egy komplex típus. + + + + Member type of simple type %1 cannot be a complex type. + %1 egyszerű típus tag típusa nem lehet egy komplex típus. + + + + %1 is not allowed to have a member type with the same name as itself. + %1 nem engedélyzett, hogy tartalmazzon egy tag típust ugyanazzal a névvel, mint a saját neve. + + + + + + %1 facet collides with %2 facet. + %1 oldal ütközik a(z) %2 oldallal. + + + + %1 facet must have the same value as %2 facet of base type. + %1 oldalnak ugyanazt az értéket kell tartalmaznia, mint az alap típus %2 oldalának. + + + + %1 facet must be equal or greater than %2 facet of base type. + %1 oldalnak nagyobbnak vagy egyenlőnek kell lennie, mint az alap típus %2 oldalának. + + + + + + + + + + + %1 facet must be less than or equal to %2 facet of base type. + %1 oldalnal kisebb vagy egyenlőnek kell lennie az alap típus %2 oldalánál. + + + + %1 facet contains invalid regular expression + %1 oldal érvénytelen reguláris kifejezéseket tartalmaz + + + + Unknown notation %1 used in %2 facet. + %1 ismeretlen jelölési mód van használva a(z) %2 oldalon. + + + + %1 facet contains invalid value %2: %3. + %1 oldal érvénytelen %2 értéket tartalmaz: %3. + + + + %1 facet cannot be %2 or %3 if %4 facet of base type is %5. + %1 oldal nem lehet %2 vagy %3, ha az alap típus %4 oldala %5. + + + + %1 facet cannot be %2 if %3 facet of base type is %4. + %1 oldal nem lehet %2, ha az alap típus %3 oldala %4. + + + + + + %1 facet must be less than or equal to %2 facet. + %1 oldalnak kisebb egyenlőnek kell lennie a(z) %2 oldalnál. + + + + + + %1 facet must be less than %2 facet of base type. + %1 oldalnak kisebbnek kell lennie az alap típus %2 oldalánál. + + + + + %1 facet and %2 facet cannot appear together. + %1 oldal és %2 oldal nem fordulhat elő együtt. + + + + + + %1 facet must be greater than %2 facet of base type. + %1 oldalnak nagyobbnak kell lennie, mint az alaptípus %2 oldalának. + + + + + %1 facet must be less than %2 facet. + %1 oldalnak kisebbnek kell lenni a(z) %2 oldalnál. + + + + + %1 facet must be greater than or equal to %2 facet of base type. + %1 oldalnak nagyobb vagy egyenlőnek kell lennie az alap típus %2 oldalánál. + + + + Simple type contains not allowed facet %1. + Egyszerű típus nem tartalmazhat %1 oldalt. + + + + %1, %2, %3, %4, %5 and %6 facets are not allowed when derived by list. + %1, %2, %3, %4, %5 és %6 oldalak nem engedélyezettek listáról származtatáskor. + + + + Only %1 and %2 facets are allowed when derived by union. + Csak a(z) %1 és %2 oldalak engedélyezettek union származtatásakor. + + + + + %1 contains %2 facet with invalid data: %3. + %1 %2 oldalt tartalmaz érvénytelen adattal: %3. + + + + Attribute group %1 contains attribute %2 twice. + A(z) %1 attribútum csoport a(z) %2 attribútumot kétszer tartalmazza. + + + + Attribute group %1 contains two different attributes that both have types derived from %2. + A(z) %1 attribútum csoport két különböző attribútumot tartalmaz, melyek közül mindkettő %2-ból számaztatott típusokat tartalmaz. + + + + Attribute group %1 contains attribute %2 that has value constraint but type that inherits from %3. + A(z) %1 attribútum csoport %2 attribútumot tartalmaz, amely olyan megszorított értéket tartalmaz, kivéve a típust, amit %3-ból örököl. + + + + Complex type %1 contains attribute %2 twice. + A(z) %1 összetett típus %2 attribútumot tartalmazza kétszer. + + + + Complex type %1 contains two different attributes that both have types derived from %2. + %1 komplex típus két különböző attribútumot tartalmaz, amelyek közül mindkettő %2-ból származtatott típusokat tartalmaz. + + + + Complex type %1 contains attribute %2 that has value constraint but type that inherits from %3. + %1 kompex típus %2 attribútumot tartalmaz, aminek megszorító értéke van, kivéve a típust, amit a(z) %3-ból örököl. + + + + Element %1 is not allowed to have a value constraint if its base type is complex. + %1 elem nem tartalmazhat egy korlátozott értéket, ha az alaptípusa komplex. + + + + Element %1 is not allowed to have a value constraint if its type is derived from %2. + %1 elem nem tartalmazhat egy korlátozott értéket, ha a típusa a(z) %2-ből származik. + + + + + Value constraint of element %1 is not of elements type: %2. + %1 elem korlátozó értéke nem elemi típus: %2. + + + + Element %1 is not allowed to have substitution group affiliation as it is no global element. + %1 elem nem tartalmazhat helyettesítési csoport egyesítést, mert nem egy globális elem. + + + + Type of element %1 cannot be derived from type of substitution group affiliation. + %1 elem típus nem származtatható helyettesítési csoport egyesítési típusból. + + + + Value constraint of attribute %1 is not of attributes type: %2. + %1 attribútum korlátozó értéke nem attribútum típus: %2. + + + + Attribute %1 has value constraint but has type derived from %2. + %1 attribútumnak korlátozó értéke van, de %2-ből származtatott típust tartalmaz. + + + + %1 attribute in derived complex type must be %2 like in base type. + %1 attribútum egy származtatott komplex típusban %2-nek kell lennie, mint az alap típusban. + + + + Attribute %1 in derived complex type must have %2 value constraint like in base type. + A származtatott komplex típusban levő %1 attribútumnak %2 érték korlátozót kell tartalmaznia, mint az alap típusban. + + + + Attribute %1 in derived complex type must have the same %2 value constraint like in base type. + Származtatott komplex típusban levő %1 attribútumnak ugyanazt a(z) %2 korlátozott értéket kell tartalmaznia, mint az alap típusban. + + + + Attribute %1 in derived complex type must have %2 value constraint. + Származtatott komplex típusban levő %1 attribútumnak %2 érték korlátozót kell tartalmaznia. + + + + processContent of base wildcard must be weaker than derived wildcard. + Az alap helyettesítő jel folyamat tartalma gyengébb kell legyen, mint a származtatott helyettesítő jel. + + + + + Element %1 exists twice with different types. + %1 elem kétszer létezik különböző típusokkal. + + + + Particle contains non-deterministic wildcards. + A részecske nem meghatározott helyettesítő jeleket tartalmaz. + + + + + Base attribute %1 is required but derived attribute is not. + A(z) %1 alap attribútum szükséges, de a származtatott attribútum nem. + + + + Type of derived attribute %1 cannot be validly derived from type of base attribute. + A(z) %1 származtatott attribútum típusa nem lehet érvényesen származtatni az alap attribútum típusból. + + + + Value constraint of derived attribute %1 does not match value constraint of base attribute. + '%1 származtatott attribútum érték korlátozója nem egyezik az alap attribútum érték korlátozójával. + + + + Derived attribute %1 does not exist in the base definition. + %1 származtatott attribútum nem létezik az alap definícióban. + + + + Derived attribute %1 does not match the wildcard in the base definition. + %1 származtatott attribútum nem egyezik a helyettesítő jellel az alap definícióban. + + + + Base attribute %1 is required but missing in derived definition. + %1 alap attribútum szükséges, de hiáynzik a származtatott definícióban. + + + + Derived definition contains an %1 element that does not exists in the base definition + A származtatot definíció egy %1 elemet tartalmaz, ami nem létezik az alap definícióban + + + + Derived wildcard is not a subset of the base wildcard. + Származtatott helyettesítőjel nem az alap helyettesítőjel egy részhalmaza. + + + + %1 of derived wildcard is not a valid restriction of %2 of base wildcard + Származtaott helyettesítő jel %1-e nem az alap helyettesítőjel %2-nek egy érvényes korlátozója + + + + Attribute %1 from base type is missing in derived type. + Az alap típus %1 attribútuma hiányzik a származtatott típusban. + + + + Type of derived attribute %1 differs from type of base attribute. + A(z) %1 származtatott típus az alap attribútum típusától különbözik. + + + + Base definition contains an %1 element that is missing in the derived definition + Az alap definíció egy %1 elemet tartalmaz, ami hiányzik a származtatott definícióból + + + + %1 references unknown %2 or %3 element %4. + %1 ismeretlen %2 vagy %3 elemre hivatkozik %4. + + + + %1 references identity constraint %2 that is no %3 or %4 element. + %1 %2 indentitás korlátozóra hivatkozik, ami nem %3 vagy %4 elem. + + + + %1 has a different number of fields from the identity constraint %2 that it references. + %1 mezők egy különböző számát tartalmazza a(z) %2 indetitás korlátozóbol, amelyik erre hivatkozik. + + + + Base type %1 of %2 element cannot be resolved. + %1 elem %2 alap típusát nem lehet megfejteni. + + + + Item type %1 of %2 element cannot be resolved. + %2 elem %1 elem típusát nem lehet megfejteni. + + + + Member type %1 of %2 element cannot be resolved. + %2 elem %1 tag típusát nem lehet megoldani. + + + + + + Type %1 of %2 element cannot be resolved. + %2 elem %1 típusát nem lehet megoldani. + + + + Base type %1 of complex type cannot be resolved. + Komplex típus %1 alap típusát nem lehet megfejteni. + + + + %1 cannot have complex base type that has a %2. + %1 nem tartalmazhat komplex alap típusokat, egy %2-t tartalmaz. + + + + Content model of complex type %1 contains %2 element so it cannot be derived by extension from a non-empty type. + %1 komplex típus tartalmi modelle %2 elemet tartalmaz, tehát nem származtatható kiterjesztésben egy nem üres típusból. + + + + Complex type %1 cannot be derived by extension from %2 as the latter contains %3 element in its content model. + %1 komplex nem típus nem származtatható kiterjesztésben %2-ből, mert az utóbbi %3 elemet tartalmaz a tartalmi modellében. + + + + Type of %1 element must be a simple type, %2 is not. + %1 elem típusnak egy egyszerű típusnak kell, de %2 nem az. + + + + Substitution group %1 of %2 element cannot be resolved. + %2 elem %1 helyettesítési csoportját nem lehet megoldani. + + + + Substitution group %1 has circular definition. + %1 helyettesítési csoport cirkuláris definíciót tartalmaz. + + + + + Duplicated element names %1 in %2 element. + Duplikát %1 elemnév %2 elemben. + + + + + + + Reference %1 of %2 element cannot be resolved. + %2 elem %1 hivatkozását nem lehet megoldani. + + + + Circular group reference for %1. + Cirkuláris csoport hivatkozás %1-re. + + + + %1 element is not allowed in this scope + %1 elem nem engedélyezett ebben a hatókörben + + + + %1 element cannot have %2 attribute with value other than %3. + %1 elem nem tartalmazhat %2 attribútumot %3-tól eltérő értékkel. + + + + %1 element cannot have %2 attribute with value other than %3 or %4. + %1 element nem tartalmazhat %2 attribútumot %3 vagy %4-től eltérő értékkel. + + + + %1 or %2 attribute of reference %3 does not match with the attribute declaration %4. + %3 hivatkozás %1 vagy %2 attribútuma nem egyezik meg a(z) %4 attribútum deklarációval. + + + + Attribute group %1 has circular reference. + %1 attribútum csoport cirkuláris hivatkozást tartalmaz. + + + + %1 attribute in %2 must have %3 use like in base type %4. + %2-ben található %1 attribútumnak %3 használatát kell tartalmaznia, mint a(z) %4 alap típusban. + + + + Attribute wildcard of %1 is not a valid restriction of attribute wildcard of base type %2. + %1 attribútum helyettesítő jele nem a(z) %2 alap típus attribútum helyettesítő jelének egy érvényes korlátozása. + + + + %1 has attribute wildcard but its base type %2 has not. + %1 attribútum helyettesítő jelet tartalmaz, de a(z) %2 alap típusa nem. + + + + Union of attribute wildcard of type %1 and attribute wildcard of its base type %2 is not expressible. + %2 alaptípusának attribútum helyettesítő jele és a(z) %1 típus attribútum helyettesítő jelének union-ja nem kifejezhető. + + + + Enumeration facet contains invalid content: {%1} is not a value of type %2. + Felsorolás oldal érvénytelen tartalmat tartalmaz. {%1} nem egy érvényes %2 típus érték. + + + + Namespace prefix of qualified name %1 is not defined. + %1 minősített név névtér előtagja nincs definiálva. + + + + + %1 element %2 is not a valid restriction of the %3 element it redefines: %4. + %2 elem %1 nem a(z) %3 elem egy érvényes korlátozása, újradefininálja: %4. + + + + Empty particle cannot be derived from non-empty particle. + Üres részecskét nem lehet egy üres részecskéből származtatni. + + + + Derived particle is missing element %1. + Származtatott részecskének van egy %1 hiányzó eleme. + + + + Derived element %1 is missing value constraint as defined in base particle. + %1 származtatott elem hiányol egy érték korlátozót, ami az alap részecskében van definiálva. + + + + Derived element %1 has weaker value constraint than base particle. + %1 származtatott elem gyengébb érték korlátozót tartalmaz, mint az alap részecske. + + + + Fixed value constraint of element %1 differs from value constraint in base particle. + %1 elem fix érték korlátozója különbözik az alap részecskében található érték korlátozótól. + + + + Derived element %1 cannot be nillable as base element is not nillable. + %1 származtatott elem nem lehet nullázható, mint ahogy az alap elem sem nullázható. + + + + Block constraints of derived element %1 must not be more weaker than in the base element. + %1 származtatott elem blokk korlátozója nem lehet gyengébb, mint az alap elemben. + + + + Simple type of derived element %1 cannot be validly derived from base element. + %1 származtatott elem egyszerű típusa nem származtatható érvényesen az alap elemből. + + + + Complex type of derived element %1 cannot be validly derived from base element. + %1 származtatott elem komplex típusa nem származtatható érvényesen az alap elemből. + + + + Element %1 is missing in derived particle. + %1 elem hiányzik a származtott récseszkében. + + + + Element %1 does not match namespace constraint of wildcard in base particle. + %1 elem nem egyezik meg az alap részecskében található helyettesítő jel névtér korlátozójával. + + + + Wildcard in derived particle is not a valid subset of wildcard in base particle. + Helyettesítő jel a származtatott részecskénen nem az alap részecskében található helyettesítő jel egy érvényes részhalmaza. + + + + processContent of wildcard in derived particle is weaker than wildcard in base particle. + A származtatott részecskében található helyettesítő jel folyamatTartalma gyengébb, mint az alap részecskében található helyettesítő jel. + + + + Derived particle allows content that is not allowed in the base particle. + Származtatott részecske engedélyezi a tartalmat, ami nem engedélyezett az alap részecskében. + + + + Can not process unknown element %1, expected elements are: %2. + Nem lehet feldolgozni ismeretlen %1 elemet, várt elemek: %2. + + + + Element %1 is not allowed in this scope, possible elements are: %2. + %1 elem nem engedélyezett ebben a hatórközben, lehetséges elemek: %2. + + + + Child element is missing in that scope, possible child elements are: %1. + Gyermek elem hiányzik abban a hatókörben, lehetséges gyermek elemek: %1. + + + + Document is not a XML schema. + Dokumentum nem egy XML terv. + + + + %1 attribute of %2 element contains invalid content: {%3} is not a value of type %4. + %2 elem %1 attribútuma érvénytelen tartalmat tartalmaz: {%3} nem egy %4 típus érték. + + + + %1 attribute of %2 element contains invalid content: {%3}. + %2 elem %1 attribútuma érvénytelen tartalmat tartalmaz: {%3}. + + + + Target namespace %1 of included schema is different from the target namespace %2 as defined by the including schema. + A beleértett terv %1 cél névtere különbözik a %2 cél névtértől, amit a beleértett terv által lett definiálva. + + + + + Target namespace %1 of imported schema is different from the target namespace %2 as defined by the importing schema. + Az importált terv %1 cél névtere különbözik a(z) %2 cél névtértől, ami az importált terv által van definiálva. + + + + %1 element is not allowed to have the same %2 attribute value as the target namespace %3. + %1 elem nem tartalmazhatja ugyanazt a(z) %2 attribútum értéket, mint a(z) %3 cél névtér. + + + + %1 element without %2 attribute is not allowed inside schema without target namespace. + %1 elem %2 attribútum nélkül nem engedélyezett a vázlaton belül cél névtér nélkül. + + + + + %1 element is not allowed inside %2 element if %3 attribute is present. + %1 elem nem engedélyezett a(z) %2 elemen belül, ha %3 attribútum van nyújtva. + + + + + + %1 element has neither %2 attribute nor %3 child element. + %1 elem nem tartalmaz %2 attribútumot és %3 gyermek elemet sem. + + + + + + + + + + + + + + + + + %1 element with %2 child element must not have a %3 attribute. + %1 elem %2 gyermek elemmel nem tartalmazhat egy %3 attribútumot. + + + + %1 attribute of %2 element must be %3 or %4. + %2 elem %1 attribútumának %3 vagy %4-nek kell lennie. + + + + %1 attribute of %2 element must have a value of %3. + %2 elem %1 attribútumának %3 egy értékét tartalmaznia kell. + + + + + %1 attribute of %2 element must have a value of %3 or %4. + %2 elem %1 attribútumának tartalmaznia kell %3 vagy %4 egy értékét. + + + + + + + + + + + + + + + + + %1 element must not have %2 and %3 attribute together. + %1 elemnek tartalmaznia kell %2 és %3 attribútumokat együttesen. + + + + + Content of %1 attribute of %2 element must not be from namespace %3. + %2 elem %1 attribútumának tartalmának nem szabad a(z) %3 névtérből lennie. + + + + + %1 attribute of %2 element must not be %3. + %2 elem %1 attribútumának nem szabad %3-nak lennie. + + + + %1 attribute of %2 element must have the value %3 because the %4 attribute is set. + %2 elem %1 attribútumának tartalmaznia kell %3 értéket, mert %4 attribútum be van állítva. + + + + Specifying use='prohibited' inside an attribute group has no effect. + Használat meghatározásának = 'tiltott' egy attribútum csoportját belül nincsen hatása. + + + + %1 element must have either %2 or %3 attribute. + %1 elemnek vagy %2 vagy %3 attribútumot tartalmaznia kell. + + + + %1 element must have either %2 attribute or %3 or %4 as child element. + %1 elemnek tartalmaznia kell vagy %2 vagy %3 vagy %4 attribútumot, mint ahogy a gyermek elem. + + + + %1 element requires either %2 or %3 attribute. + %1 elem vagy %2 vagy %3 attribútumot igényli. + + + + Text or entity references not allowed inside %1 element + Szöveg avgy entitás hivatkozás nem engedélyezett a(z) %1 elemen belül + + + + + %1 attribute of %2 element must contain %3, %4 or a list of URIs. + %2 elem %1 attribútumának tartalmaznia kell %3, %4 vagy URI-k egy listáját. + + + + %1 element is not allowed in this context. + %1 elem nem engedélyezett ebben a szöveg környezetben. + + + + %1 attribute of %2 element has larger value than %3 attribute. + %2 elem %1 attribútuma nagyobb értéket tartalmaz, mint a %3 attribútum. + + + + Prefix of qualified name %1 is not defined. + A(z) %1 minősített név előtagja nem definiált. + + + + + %1 attribute of %2 element must either contain %3 or the other values. + %2 elem %1 attribútumának vagy %3 vagy más értékeket kell tartalmaznia. + + + + Component with ID %1 has been defined previously. + %1 azonosítóval rendelkezővel komponens előzőleg definiálva lett. + + + + Element %1 already defined. + %1 elem már definiálva van. + + + + Attribute %1 already defined. + %1 attribútum már definiálva van. + + + + Type %1 already defined. + %1 típus már definiálva van. + + + + Attribute group %1 already defined. + %1 csoport attribútum már definiálva van. + + + + Element group %1 already defined. + %1 csoport elem már definiálva van. + + + + Notation %1 already defined. + %1 értesítés már definiálva van. + + + + Identity constraint %1 already defined. + %1 azonosító korlátozó már definiálva van. + + + + Duplicated facets in simple type %1. + Duplikált oldalak %1 egyszerű típusban. + + + + + + %1 is not valid according to %2. + %1 nem érvényes %2 szerint. + + + + String content does not match the length facet. + Sztring tartalom nem egyezik a hossz oldallal. + + + + String content does not match the minLength facet. + Sztring tartalom nem egyezik a minimális hosszúságú felülettel. + + + + String content does not match the maxLength facet. + Sztring tartalom nem egyezik a maximális hosszúságú felülettel. + + + + String content does not match pattern facet. + Sztrng tartalom nem egyezik a minta felülettel. + + + + String content is not listed in the enumeration facet. + Sztring tartalom nincs listázva a felsorol felületben. + + + + Signed integer content does not match the maxInclusive facet. + Előjeles egész szám tartalom nem egyezik a maximális beleszámított felülettel. + + + + Signed integer content does not match the maxExclusive facet. + Előjeles egész szám tartalom nem egyzik a maximális kizárólagos felülettel. + + + + Signed integer content does not match the minInclusive facet. + Előjeles egész szám tartalom nem egyezik a minimális beleértet felülettel. + + + + Signed integer content does not match the minExclusive facet. + Előjeles egész szám tartalom nem egyezik a minimális kizárólagos felülettel. + + + + Signed integer content is not listed in the enumeration facet. + Előjeles egész szám tartalom nincsen kilistázva a felsorolási felületben. + + + + Signed integer content does not match pattern facet. + Előjeles egész szám tartalom nem egyezik a minta felületben. + + + + Signed integer content does not match in the totalDigits facet. + Előjeles egész szám tartalom nem egyezik a teljesSzámos felület. + + + + Unsigned integer content does not match the maxInclusive facet. + Nem előjeles egész szám tartalom nem egyezik a maximális beleértett felülettel. + + + + Unsigned integer content does not match the maxExclusive facet. + Nem előjeles egész szám tartalom nem egyezik a maximális kizárólagos felülettel. + + + + Unsigned integer content does not match the minInclusive facet. + Nem előjeles tartalom nem egyezik a minimális beleértett felülettel. + + + + Unsigned integer content does not match the minExclusive facet. + Nem előjeleg egész szám tartalom nem egyezik a beleértett minimális felülettel. + + + + Unsigned integer content is not listed in the enumeration facet. + Nem előjeles egész szám tartalom nincsen kilistázva a felsorolási felületben. + + + + Unsigned integer content does not match pattern facet. + Nem előjeles egész szám tartalom nem egyezik a minta felületben. + + + + Unsigned integer content does not match in the totalDigits facet. + Nem előjeles egész szám tartalom nem egyezik a teljesSzámos felületben. + + + + Double content does not match the maxInclusive facet. + Dupla tartalom nem egyezik a maximális beleértett felületben. + + + + Double content does not match the maxExclusive facet. + Dupla tartalom nem egyezik a maximális kizárólagos felülettel. + + + + Double content does not match the minInclusive facet. + Dupla tartalom nem egyezik a minimális beleértett felülettel. + + + + Double content does not match the minExclusive facet. + Dupla tartalom nem egyezik a minimális kizárólag felülettel. + + + + Double content is not listed in the enumeration facet. + Dupla tartalom nincs listázva a felsorolási felületben. + + + + Double content does not match pattern facet. + Dupla tartalom nem egyezik a minta felületben. + + + + Decimal content does not match in the fractionDigits facet. + Tizedes tartalom nem egyezik a szám tényezős felületben. + + + + Decimal content does not match in the totalDigits facet. + Tizedes tartalom nem egyezik a teljesenSzámos felületben. + + + + Date time content does not match the maxInclusive facet. + Dátum idő tartalom nem egyezik a maximális beleértett felülettel. + + + + Date time content does not match the maxExclusive facet. + Dátum idő tartalom nem egyezik a maximális kizárólagos felülettel. + + + + Date time content does not match the minInclusive facet. + Dátum idő tartalom nem egyezik a minimális beleértett felülettel. + + + + Date time content does not match the minExclusive facet. + Dátum idő tartalom nem egyezik a minimális kizárólagos felülettel. + + + + Date time content is not listed in the enumeration facet. + Dátum idő tartalom nincsen kilistázva a felsorolási felületben. + + + + Date time content does not match pattern facet. + Dátum idő tartalom nem egyezik a minta felületben. + + + + Duration content does not match the maxInclusive facet. + Tartalom időtartam nem egyezik a maximális beleértett felülettel. + + + + Duration content does not match the maxExclusive facet. + Tartalom időtartam nem egyezik a maximális kizárólagos felülettel. + + + + Duration content does not match the minInclusive facet. + Tartalom időtartam nem egyezik a minimális benne foglalt felülettel. + + + + Duration content does not match the minExclusive facet. + Tartalom időtartam nem egyezik a minimális kizárólagos felülettel. + + + + Duration content is not listed in the enumeration facet. + Tartalom időtartam nincs listázva a felsorolási felületben. + + + + Duration content does not match pattern facet. + Tartalom időtartam nem egyezik a felület mintában. + + + + Boolean content does not match pattern facet. + Logikai tartalom nem egyezik a minta felületben. + + + + Binary content does not match the length facet. + Bináris tartalom nem egyezik a hossz felületben. + + + + Binary content does not match the minLength facet. + Bináris tartalom nem egyezik a minimális hossz felületben. + + + + Binary content does not match the maxLength facet. + Bináris tartalom nem egyezik a maximális hossz felületben. + + + + Binary content is not listed in the enumeration facet. + Bináris tartalom nincsen kilistázva a felsorolási felületben. + + + + Invalid QName content: %1. + Érvénytelen QName tartalom: %1. + + + + QName content is not listed in the enumeration facet. + QName tartalom nincsen kilistázva a felsorolási felületben. + + + + QName content does not match pattern facet. + QName tartalom nem egyezik a mintha felületben. + + + + Notation content is not listed in the enumeration facet. + Tartalom jelölés nincsen kilistázva a felsorolási felületben. + + + + List content does not match length facet. + Tartalom lista nem egyezik a hossz felületben. + + + + List content does not match minLength facet. + Tartalmi lista nem egyezik a minimális hossz felületben. + + + + List content does not match maxLength facet. + Tartalmi list nem egyezik a maximális hossz felületen. + + + + List content is not listed in the enumeration facet. + Tartalmi lista nincsen kilistázva a felsorolási felületen. + + + + List content does not match pattern facet. + Tartalmi lista nem egyezik a minta felületen. + + + + Union content is not listed in the enumeration facet. + Egység tartalom nincsen kilistázva a felsorolási felületen. + + + + Union content does not match pattern facet. + Egység tartalom nem egyezik a minta felületen. + + + + Data of type %1 are not allowed to be empty. + %1 típus adata nem engedélyezett, hogy üres legyen. + + + + Element %1 is missing child element. + %1 elem hiányzik a gyermek elemből. + + + + There is one IDREF value with no corresponding ID: %1. + Van egy IDREF érték nem megfelelő azonosítóval: %1. + + + + Loaded schema file is invalid. + Betöltött terv fájl nem létezik. + + + + %1 contains invalid data. + %1 érvénytelen adatot tartalmaz. + + + + xsi:schemaLocation namespace %1 has already appeared earlier in the instance document. + xsi:tervElhelyezkedés %1 névtér már előfordult korábban a példa dokumentumban. + + + + xsi:noNamespaceSchemaLocation cannot appear after the first no-namespace element or attribute. + xsi:tervElhelyezkedés névtér nem fordulhat elő az első nem névtér elem vagy attribútum után. + + + + No schema defined for validation. + Nincsen terv definiálva jóváhagyásra. + + + + No definition for element %1 available. + Nincsen elérhető definíció a(z) %1 elemre. + + + + + + Specified type %1 is not known to the schema. + %1 meghatározott típus ismeretlen a terv számára. + + + + Element %1 is not defined in this scope. + %1 elem nincs definiálva ebben a hatókörben. + + + + Declaration for element %1 does not exist. + %1 elem deklaráció nem létezik. + + + + Element %1 contains invalid content. + %1 elem érvénytelen tartalmat tartalmaz. + + + + Element %1 is declared as abstract. + %1 elem elvontkét lett deklarálva. + + + + Element %1 is not nillable. + %1 elem nem nullázható. + + + + Attribute %1 contains invalid data: %2 + %1 attribútum érvénytelen adatokat tartalmaz: %2 + + + + Element contains content although it is nillable. + Elem nem nullázható elemeket tartalmaz. + + + + Fixed value constraint not allowed if element is nillable. + Fix érték korlátozó nem engedélyezett, ha az elem nullázható. + + + + Element %1 cannot contain other elements, as it has a fixed content. + %1 nem tartalmazhat másik elemeket, mint ennek is egy fix mérete van. + + + + Specified type %1 is not validly substitutable with element type %2. + %1 meghatározott típus nem helyettesíthető érvényesen %2 elem típussal. + + + + Complex type %1 is not allowed to be abstract. + %1 komplex típus nem engedélyezett, hogy elvont legyen. + + + + Element %1 contains not allowed attributes. + %1 nem engedélyezett attribútumokat tartalmaz. + + + + + Element %1 contains not allowed child element. + %1 nem engedélyezett gyermek attribútumokat tartalmaz. + + + + + Content of element %1 does not match its type definition: %2. + %1 elem tartalma nem egyezik meg a típus definíciójával: %2. + + + + + + Content of element %1 does not match defined value constraint. + %1 elem tartalma nem egyezik meg a definiált érték korlátozóval. + + + + Element %1 contains not allowed child content. + %1 nem engedélyezett gyermek tartalmat tartalmaz. + + + + Element %1 contains not allowed text content. + %1 nem engedélyezett szöveg tartalmat tartalmaz. + + + + Element %1 is missing required attribute %2. + %1 hiányzik, %2 attribútum igényli. + + + + Attribute %1 does not match the attribute wildcard. + %1 attribűtum nem egyezik meg az attribútum helyettesítő jellel. + + + + Declaration for attribute %1 does not exist. + %1 attribútum deklarációja nem létezik. + + + + Element %1 contains two attributes of type %2. + %1 elem %2 típus két attribútumát tartalmazza. + + + + Attribute %1 contains invalid content. + %1 attribútum érvénytelen tartalmaz tartalmaz. + + + + Element %1 contains unknown attribute %2. + %1 elem ismeretlen %2 attribútumokat tartalmaz. + + + + + Content of attribute %1 does not match its type definition: %2. + %1 attribútum tartalma nem egyezik a típus definíciójával: %2. + + + + + Content of attribute %1 does not match defined value constraint. + %1 attribútum tartalma nem egyezik meg a definiált érték korlátozóval. + + + + Non-unique value found for constraint %1. + Nem található egyedülálló érték a(z) %1 módosítóra. + + + + Key constraint %1 contains absent fields. + %1 kulcs korlátozó hiányzó mezőket tartalmaz. + + + + Key constraint %1 contains references nillable element %2. + %1 kulcs korlátozó hivatkozásokat nem tartalmaz nullázható %2 elemekre. + + + + No referenced value found for key reference %1. + Nem található referencia érték a(z) %1 kulcs referenciára. + + + + More than one value found for field %1. + Több mint egy érték található a(z) %1-es mezőre. + + + + Field %1 has no simple type. + %1 mezőnek nincsen egyszerű típusa. + + + + ID value '%1' is not unique. + %1 azonosító érték nem egyedülálló. + + + + '%1' attribute contains invalid QName content: %2. + %1 attribútum érvénytelen QName tartalmaz tartalmaz: %2. + + + diff --git a/translations/translations.pri b/translations/translations.pri index 2b97a14..3bb79b6 100644 --- a/translations/translations.pri +++ b/translations/translations.pri @@ -17,7 +17,7 @@ LUPDATE += -locations relative -no-ui-lines ###### Qt Libraries -QT_TS = ar da de es fr iw ja_JP pl pt ru sk sl sv uk zh_CN zh_TW +QT_TS = ar da de es fr hu iw ja_JP pl pt ru sk sl sv uk zh_CN zh_TW ts-qt.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \ -I../include -I../include/Qt \ -- cgit v0.12 From 228b7ff2f31788338a2dbc96219672768ecb250b Mon Sep 17 00:00:00 2001 From: Laszlo Papp Date: Wed, 3 Feb 2010 11:10:40 +0100 Subject: Add Assistant hungarian translation Signed-off-by: Laszlo Papp Reviewed-by: Benjamin Poulain --- assistant_hu.ts | 1083 +++++++++++++++++++++++++ tools/assistant/translations/translations.pro | 1 + 2 files changed, 1084 insertions(+) create mode 100644 assistant_hu.ts diff --git a/assistant_hu.ts b/assistant_hu.ts new file mode 100644 index 0000000..e43070c --- /dev/null +++ b/assistant_hu.ts @@ -0,0 +1,1083 @@ + + + + + AboutDialog + + + &Close + &Bezárás + + + + AboutLabel + + + Warning + Figyelmeztetés + + + + Unable to launch external application. + + Nem lehet külső alkalmazást elindítani. + + + + OK + OK + + + + BookmarkDialog + + + Add Bookmark + Könyvjelző hozzáadása + + + + Bookmark: + Könyvjelző: + + + + Add in Folder: + Hozzáadás dossziéban: + + + + New Folder + Új dosszié + + + + + + + + Bookmarks + Könyvjelzők + + + + + + + + + + + Delete Folder + Dosszié törlése + + + + Rename Folder + Dosszié átnevezése + + + + BookmarkManager + + + Bookmarks + Könyvjelzők + + + + Remove + Áthelyezés + + + + You are going to delete a Folder, this will also<br>remove it's content. Are you sure to continue? + Egy olyan dossziét fog törölni, ami <br> törli annak tartalmát is. Biztos benne, hogy folytatja? + + + + + New Folder + Új Dosszié + + + + BookmarkWidget + + + Filter: + Szűrő: + + + + Remove + Eltávolítás + + + + Delete Folder + Dosszié törlése + + + + Rename Folder + Dosszié átnevezése + + + + Show Bookmark + Könyvjelző megjelenítése + + + + Show Bookmark in New Tab + Könyvjelző megjelenítése új lapon + + + + Delete Bookmark + Könyvjelző törlése + + + + Rename Bookmark + Könyvjelző átnevezése + + + + Add + Hozzáadás + + + + CentralWidget + + + Add new page + Új lap hozzáadása + + + + Close current page + Aktuális lap bezárása + + + + Print Document + Dokumentum nyomtatása + + + + + unknown + ismeretlen + + + + Add New Page + Új lap hozzáadása + + + + Close This Page + Lap bezárása + + + + Close Other Pages + Többi lap bezárása + + + + Add Bookmark for this Page... + Könyvjelző hozzáadása ehhez a laphoz... + + + + Search + Keresés + + + + ContentWindow + + + Open Link + Link megnyitása + + + + Open Link in New Tab + Link megnyitása új lapon + + + + FilterNameDialogClass + + + Add Filter Name + Szűrő név hozzáadása + + + + Filter Name: + Szűrő név: + + + + FindWidget + + + Previous + Előző + + + + Next + Következő + + + + Case Sensitive + Kis és nagybetű érzékeny + + + + Whole words + Egész szavakat + + + + <img src=":/trolltech/assistant/images/wrap.png">&nbsp;Search wrapped + <img src=":/trolltech/assistant/images/wrap.png">&nbsp;Keresés tördelése + + + + FontPanel + + + Font + Betű + + + + &Writing system + Rendszer &írása + + + + &Family + &Család + + + + &Style + &Stílus + + + + &Point size + &Pont méret + + + + HelpViewer + + + Help + Segítség + + + + OK + OK + + + + <title>Error 404...</title><div align="center"><br><br><h1>The page could not be found</h1><br><h3>'%1'</h3></div> + <title>404-es hiba...</title><div align="center"><br><br><h1>A lap nem található </h1><br><h3>'%1'</h3></div> + + + + Copy &Link Location + &Link címének másolása + + + + Open Link in New Tab Ctrl+LMB + Link megnyitása új lapon Ctrl+LMB + + + + Open Link in New Tab + Link megnyitása új lapon + + + + Unable to launch external application. + + Nem lehet külső alkalmazást indítani. + + + + IndexWindow + + + &Look for: + &Keresés: + + + + Open Link + Link megnyitása + + + + Open Link in New Tab + Link megnyitása új lapon + + + + InstallDialog + + + + Install Documentation + + + + + Downloading documentation info... + Dokumentum információ letöltése... + + + + Download canceled. + Letöltés vmegszakítva. + + + + + + Done. + Kész. + + + + The file %1 already exists. Do you want to overwrite it? + A(z) %1 fájl már létezik. Felül szeretné írni? + + + + Unable to save the file %1: %2. + Nem lehet elmenteni a(z) %1 fájlt: %2. + + + + Downloading %1... + %1 letöltése... + + + + + + Download failed: %1. + Nem sikerült a letöltés: %1. + + + + Documentation info file is corrupt! + Dokumentum információ sérült! + + + + Download failed: Downloaded file is corrupted. + Nem sikerült letölteni: A letöltött fájl sérült. + + + + Installing documentation %1... + %1 dokumentáció telepítése... + + + + Error while installing documentation: +%1 + Hiba történt a dokumentáció telepítése közben: %1 + + + + Available Documentation: + Elérhető dokumentáció: + + + + Install + Telepítés + + + + Cancel + Mégse + + + + Close + Bezárás + + + + Installation Path: + Telepítési útvonal: + + + + ... + ... + + + + MainWindow + + + + Index + Index + + + + + Contents + Tartalom + + + + + Bookmarks + Könyvjelzők + + + + Search + Keresés + + + + + + Qt Assistant + Qt Assistant + + + + + Unfiltered + Szűrés nélküli + + + + Page Set&up... + Lap Beállí&tás... + + + + Print Preview... + Nyomtatási előnézet... + + + + &Print... + &Nyomtatás... + + + + New &Tab + Új &Lap + + + + &Close Tab + Lap &bezárása + + + + &Quit + &Kilépés + + + + &Copy selected Text + Kiválasztott szöveg &másolása + + + + &Find in Text... + &Keresés szövegben... + + + + &Find + &Keresés + + + + Find &Next + &Következő keresés + + + + Find &Previous + &Előző keresés + + + + Preferences... + Beállítások... + + + + Zoom &in + &Nagyítás + + + + Zoom &out + &Kicsinyítés + + + + Normal &Size + Normál &méret + + + + Ctrl+0 + Ctrl + 0 + + + + ALT+C + ALT + C + + + + ALT+I + ALT + l + + + + ALT+S + ALT + S + + + + &Home + &Otthon + + + + &Back + &Vissza + + + + &Forward + &Előre + + + + Sync with Table of Contents + Tartalomjegyzékkel való szinkronizálás + + + + Sync + Szinkronizálás + + + + Next Page + Következő lap + + + + Ctrl+Alt+Right + Ctrl+Alt+Right + + + + Previous Page + Előző lap + + + + Ctrl+Alt+Left + Ctrl+Alt+Left + + + + Add Bookmark... + Könyvjelző hozzáadása... + + + + About... + Névjegy... + + + + Navigation Toolbar + Navigációs eszköztár + + + + Toolbars + Eszköztár + + + + Filter Toolbar + Eszköztár szűrő + + + + Filtered by: + Szűrési feltétel: + + + + Address Toolbar + Eszköztár cím + + + + Address: + Cím: + + + + Could not find the associated content item. + Nem sikerült az összekapcsolt tartalom elemet megtalálni. + + + + About %1 + %1-ről + + + + Updating search index + Keresési index frissítése + + + + Looking for Qt Documentation... + Qt dokumentáció keresése... + + + + &Window + &Ablak + + + + Minimize + Minimalizálás + + + + Ctrl+M + Ctrl + M + + + + Zoom + Zoomolás + + + + &File + &Fájl + + + + &Edit + &Szerkesztés + + + + &View + &Nézet + + + + &Go + &Gyerünk + + + + ALT+Home + ALT+Home + + + + &Bookmarks + &Könyvjelzők + + + + &Help + &Segítség + + + + ALT+O + ALT + 0 + + + + CTRL+D + CTRL+D + + + + PreferencesDialog + + + + Add Documentation + Dokumentáció hozzáadása + + + + Qt Compressed Help Files (*.qch) + Qt tömörített súgó fájlok (*.qch) + + + + The specified file is not a valid Qt Help File! + A meghatározott fájl egy érvénytelen Qt Súgó fájl! + + + + The namespace %1 is already registered! + A(z) %1 névtér már regisztrálva van! + + + + Remove Documentation + Dokumentáció eltávolítása + + + + Some documents currently opened in Assistant reference the documentation you are attempting to remove. Removing the documentation will close those documents. + Néhány dokumentum jelenleg az Assistant hivatkozásban lett megnyitva, amely az a dokumentum, amit megpróbál eltávolítani. A dokumentum eltávolítása be fogja zárni azokat a dokumentumokat. + + + + Cancel + Mégse + + + + OK + OK + + + + Use custom settings + Szokásos beállítások használata + + + + PreferencesDialogClass + + + Preferences + Beállítások + + + + Fonts + Betűk + + + + Font settings: + Betű beállítások: + + + + Browser + Böngésző + + + + Application + Alkalmazás + + + + Filters + Szűrők + + + + Filter: + Szűrők: + + + + Attributes: + Attrubútumok: + + + + 1 + 1 + + + + Add + Hozzáadás + + + + Remove + Eltávolítás + + + + Documentation + Dokumentáció + + + + Registered Documentation: + Regisztrált dokumentáció: + + + + Add... + Hozzáadás... + + + + Options + Opciók + + + + Current Page + Aktuális lap + + + + Restore to default + Alapértelmezett beállítások visszaállítása + + + + Homepage + Honlap + + + + On help start: + Súgó indításra: + + + + Show my home page + Honlapom megjelenítése + + + + Show a blank page + Egy üres lap megjelenítése + + + + Show my tabs from last session + A lapjaim megjelenításe a legutolsó szakaszból + + + + Blank Page + Üres lap + + + + QObject + + + The specified collection file does not exist! + A meghatározott gyűjtemény fájl nem létezik! + + + + Missing collection file! + Hiányzó gyűjtemény fájl! + + + + Invalid URL! + Érvénytelen URL! + + + + Missing URL! + Hiányzó URL! + + + + + + Unknown widget: %1 + Ismeretlen widget: %1 + + + + + + Missing widget! + Hiányzó widget! + + + + + The specified Qt help file does not exist! + A meghatározott Qt súgó fájl nem létezik! + + + + + Missing help file! + Hiányzó súgó fájl! + + + + Missing filter argument! + Hiányzó szűrő argumentum! + + + + Unknown option: %1 + Ismeretlen opció: %1 + + + + + Qt Assistant + Qt Assistant + + + + Could not register documentation file +%1 + +Reason: +%2 + Nem sikerült a dokumentációs fájl regisztrálása +%1 + +Ok: +%2 + + + + Documentation successfully registered. + A dokumentáció regisztrálása sikeresen megtörtént. + + + + Could not unregister documentation file +%1 + +Reason: +%2 + Nem sikerült regisztrálni a dokumentációs fájlt +%1 + +Ok: +%2 + + + + Documentation successfully unregistered. + Dokumentáció regisztrációjának megszűntetése sikeresen megtörtént. + + + + Cannot load sqlite database driver! + Nem lehet betölteni az sqlite adatbázis vezérlőt! + + + + The specified collection file could not be read! + A meghatározott gyűjtemény fájlt nem lehet olvasni! + + + + RemoteControl + + + Debugging Remote Control + Debuggolás Távoli Vezérlő + + + + Received Command: %1 %2 + Elfogadott parancs: %1 %2 + + + + SearchWidget + + + &Copy + &Másolás + + + + Copy &Link Location + &Link címének másolása + + + + Open Link in New Tab + Link megnyitása új lapon + + + + Select All + Az összes kiválasztása + + + + TopicChooser + + + Choose a topic for <b>%1</b>: + Topik választása a következőhöz: <b>%1</b>: + + + + Choose Topic + Topik választása + + + + &Topics + &Topikok + + + + &Display + &Kijelzés + + + + &Close + &Bezárás + + + diff --git a/tools/assistant/translations/translations.pro b/tools/assistant/translations/translations.pro index 95501ab..16d2010 100644 --- a/tools/assistant/translations/translations.pro +++ b/tools/assistant/translations/translations.pro @@ -45,6 +45,7 @@ TRANSLATIONS = \ $$TR_DIR/assistant_da.ts \ $$TR_DIR/assistant_de.ts \ $$TR_DIR/assistant_fr.ts \ + $$TR_DIR/assistant_hu.ts \ $$TR_DIR/assistant_ja.ts \ $$TR_DIR/assistant_pl.ts \ $$TR_DIR/assistant_ru.ts \ -- cgit v0.12 From 921f1b05f512fdec8f0303c53a741a1912f4410a Mon Sep 17 00:00:00 2001 From: Laszlo Papp Date: Wed, 3 Feb 2010 11:10:40 +0100 Subject: Add Qt help hungarian translation Signed-off-by: Laszlo Papp Reviewed-by: Benjamin Poulain --- qt_help_hu.ts | 298 +++++++++++++++++++++++++++++++ tools/assistant/translations/qt_help.pro | 1 + 2 files changed, 299 insertions(+) create mode 100644 qt_help_hu.ts diff --git a/qt_help_hu.ts b/qt_help_hu.ts new file mode 100644 index 0000000..3fbe0e9 --- /dev/null +++ b/qt_help_hu.ts @@ -0,0 +1,298 @@ + + + + + QCLuceneResultWidget + + Search Results + Keresési eredmény + + + Note: + Megjegyzés: + + + The search results may not be complete since the documentation is still being indexed! + A keresési eredmény lehet, hogy nem teljes, mivel a dokumentáció még mindig indexelvan van! + + + Your search did not match any documents. + A keresési feltételeknek megfelően nincs találat. + + + (The reason for this might be that the documentation is still being indexed.) + (Ennek az oka az lehet, hogy a dokumentáció még mindig indexelve van.) + + + + QHelpCollectionHandler + + The collection file '%1' is not set up yet! + A(z) '%1'gyűjtemény fájl még nincs beállítva! + + + Cannot load sqlite database driver! + Nem lehet betölteni az sqlite adatbázis vezérlőt! + + + Cannot open collection file: %1 + Nem lehet megnyitni a gyűjtemény fájlt: %1 + + + Cannot create tables in file %1! + Nem lehet lehet a(z) %1 fájlban táblákat létrehozni! + + + The collection file '%1' already exists! + A(z) '%1' gyűjtemény fájl már létezik! + + + Unknown filter '%1'! + Ismeretlen szűrő '%1'! + + + Invalid documentation file '%1'! + Érvénytelen dokumentációs fájl '%1'! + + + Cannot register namespace '%1'! + Nem lehet regisztrálni a(z) '%1' névteret! + + + Cannot open database '%1' to optimize! + Nem lehet optimalizálásra megnyitni a(z) '%1' adatbázist! + + + Cannot create directory: %1 + Nem lehet a könyvtárat létrehozni: %1 + + + Cannot copy collection file: %1 + Nem lehet a gyűjtemény fájlt másolni: %1 + + + Cannot register filter %1! + Nem lehet regisztrálni a(z) %1 szűrőt! + + + Cannot open documentation file %1! + Nem lehet megnyitni a(z) %1 dokumentációs fájlt! + + + The namespace %1 was not registered! + A(z) %1 névteret nem regisztrálták! + + + Namespace %1 already exists! + A(z) %1 névtér már létezik! + + + + QHelpDBReader + + Cannot open database '%1' '%2': %3 + Nem lehet megnyitni az adatbázist '%1' '%2': %3 + + + + QHelpEngineCore + + The specified namespace does not exist! + A meghatározott névtér nem létezik! + + + + QHelpEngineCorePrivate + + Cannot open documentation file %1: %2! + Nem lehet megnyitni a(z) %1 fájlt: %2! + + + + QHelpGenerator + + Invalid help data! + Érvénytelen segítség adat! + + + No output file name specified! + Nincsen kimeneti fájl meghatározva! + + + Building up file structure... + Fájl struktúra felépítése... + + + The file %1 cannot be overwritten! + Nem lehet felülírni a(z) %1 fájlt! + + + Cannot open data base file %1! + Nem lehet megnyitni a(z) %1 adatbázis fájlt! + + + Cannot register namespace %1! + Nem lehet regisztrálni a(z) %1 névteret! + + + Insert custom filters... + Szokásos szűrő beszúrása... + + + Insert help data for filter section (%1 of %2)... + Segítség adatok beszúrása a szűrő szegmens számára (%1 %2-től)... + + + Documentation successfully generated. + A dokumentáció legenerálása sikeresen lezajlott. + + + Some tables already exist! + Néhány tábla már létezik! + + + Cannot create tables! + Nem lehet a táblákat létrehozni! + + + Cannot register virtual folder! + Nem lehet registrálni a virtuális dossziét! + + + Insert files... + Fájlok beszúrása... + + + The referenced file %1 must be inside or within a subdirectory of (%2). Skipping it. + A(z) %1 hivatkozott fájlnak a(z) (%2) alkönyvtárán belül kell elhelyezkednie. Ennek kihagyása. + + + The file %1 does not exist! Skipping it. + A(z) %1 fájl nem létezik! Ennek kihagyása. + + + Cannot open file %1! Skipping it. + Nem lehet megnyitni a(z) %1 fájlt! Ennek kihagyása. + + + The filter %1 is already registered! + A(z) %1 szűrő már regisztrálva van! + + + Cannot register filter %1! + Nem lehet regisztrálni a(z) %1 szűrőt! + + + Insert indices... + Indexek beszúrása... + + + Insert contents... + Tartalom beszúrása... + + + Cannot insert contents! + Nem lehet beszúrni a tartalmat! + + + Cannot register contents! + Nem lehet regisztrálni a tartalmat! + + + + QHelpSearchQueryWidget + + Search for: + Keresés erre: + + + Previous search + Előző keresése + + + Next search + Következő keresése + + + Search + Keresés + + + Advanced search + Összetett keresés + + + words <B>similar</B> to: + szavak <B>hasonlóak</B> ehhez: + + + <B>without</B> the words: + Ezen szavak <B>nélkül</B>: + + + with <B>exact phrase</B>: + <B>Pontos kifejezés</B>: + + + with <B>all</B> of the words: + Ezen szavak<B>mindegyikével</B>: + + + with <B>at least one</B> of the words: + <B>Legalább egy</B> a következő szavak közül: + + + + QHelpSearchResultWidget + + 0 - 0 of 0 Hits + 0 találat 0 - 0 + + + + QHelpSearchResultWidgetPrivate + + %1 - %2 of %3 Hits + %3 Találat %1 - %2 + + + + QObject + + Unknown token. + Ismeretlen jel. + + + Unknown token. Expected "QtHelpProject"! + Ismeretlen hel. "QtSegítségProjekt" várt! + + + Error in line %1: %2 + Hiba a(z) %1 sorban: %2 + + + A virtual folder must not contain a '/' character! + A virtuális dosszié nem tartalmazhat '/' karaktert! + + + A namespace must not contain a '/' character! + A névtér nem tartalmazhat '/' karaktert! + + + Missing namespace in QtHelpProject. + Hiányzó névtér a QtSegítségProjektben. + + + Missing virtual folder in QtHelpProject + Hiányzó virtuális dosszié a QtSegítségProjektben + + + Missing attribute in keyword at line %1. + Hiányzó attirbútum a kulcsszóban a(z) %1 sorban. + + + The input file %1 could not be opened! + Nem sikerült megnyitni a(z) %1 bemeneti fájlt! + + + diff --git a/tools/assistant/translations/qt_help.pro b/tools/assistant/translations/qt_help.pro index db54ae6..a641069 100644 --- a/tools/assistant/translations/qt_help.pro +++ b/tools/assistant/translations/qt_help.pro @@ -43,6 +43,7 @@ TR_DIR = $$PWD/../../../translations TRANSLATIONS = \ $$TR_DIR/qt_help_da.ts \ $$TR_DIR/qt_help_de.ts \ + $$TR_DIR/qt_help_hu.ts \ $$TR_DIR/qt_help_ja.ts \ $$TR_DIR/qt_help_pl.ts \ $$TR_DIR/qt_help_ru.ts \ -- cgit v0.12 From e11d4006e735d821e5738bf7fdd9e7d8b8371fac Mon Sep 17 00:00:00 2001 From: Laszlo Papp Date: Wed, 3 Feb 2010 11:10:41 +0100 Subject: Add Designer hungarian translation Signed-off-by: Laszlo Papp Reviewed-by: Benjamin Poulain --- designer_hu.ts | 7023 ++++++++++++++++++++++++++ tools/designer/translations/translations.pro | 1 + 2 files changed, 7024 insertions(+) create mode 100644 designer_hu.ts diff --git a/designer_hu.ts b/designer_hu.ts new file mode 100644 index 0000000..c2960bc --- /dev/null +++ b/designer_hu.ts @@ -0,0 +1,7023 @@ + + + + + AbstractFindWidget + + + &Previous + &Előző + + + + &Next + &Következő + + + + &Case sensitive + &Kis ér nagybetű érzékeny + + + + Whole &words + Egész &szavakat + + + + <img src=":/trolltech/shared/images/wrap.png">&nbsp;Search wrapped + <img src=":/trolltech/shared/images/wrap.png">&nbsp;Keresés tördelve + + + + AddLinkDialog + + + Insert Link + Link beszúrása + + + + Title: + Cím: + + + + URL: + URL: + + + + AppFontDialog + + + Additional Fonts + További betűl + + + + AppFontManager + + + '%1' is not a file. + %1 nem egy fájl. + + + + The font file '%1' does not have read permissions. + '%1' betű fájlnak nincsen olvasási engedélye. + + + + The font file '%1' is already loaded. + '%1' font fájl már be van töltve. + + + + The font file '%1' could not be loaded. + '%1' font fájlt nem sikerült betölteni. + + + + '%1' is not a valid font id. + '%1' nem egy érvényes betű azonosító. + + + + There is no loaded font matching the id '%1'. + Nincsen '%1' azonosítóval megegyező betöltött betű. + + + + The font '%1' (%2) could not be unloaded. + '%1' betűt (%2) nem lehetett kirakni. + + + + AppFontWidget + + + Fonts + Betűk + + + + Add font files + Betű fájlok hozzáadása + + + + Remove current font file + Aktuális betű fájl eltávolítása + + + + Remove all font files + Az összes betű fájl eltávolítása + + + + Add Font Files + Betű fájlok hozzáadása + + + + Font files (*.ttf) + Betű fájlok (*.ttf) + + + + Error Adding Fonts + Hiba történt a betűk hozzáadásakor + + + + Error Removing Fonts + Hiba történt a betűk eltávolításakor + + + + Remove Fonts + Betűk eltávolítása + + + + Would you like to remove all fonts? + El szeretné távolítani az összes betűt? + + + + AppearanceOptionsWidget + + + Form + + + + + User Interface Mode + Felhasználói interfész mód + + + + AssistantClient + + + Unable to send request: Assistant is not responding. + Nem lehet elküldeni a kérést, az Assistant nem válaszol. + + + + The binary '%1' does not exist. + '%1' bináris nem létezik. + + + + Unable to launch assistant (%1). + Nem lehet elindítani a(z) %1 assistant. + + + + BrushPropertyManager + + + No brush + Nincs kefe + + + + Solid + Szolid + + + + Dense 1 + Sűrű 1 + + + + Dense 2 + Sűrű 2 + + + + Dense 3 + Sűrű 3 + + + + Dense 4 + Sűrű 4 + + + + Dense 5 + Sűrű 5 + + + + Dense 6 + Sűrű 6 + + + + Dense 7 + Sűrű 7 + + + + Horizontal + Horizontális + + + + Vertical + Vertikális + + + + Cross + Kereszt + + + + Backward diagonal + Visszafele átlós + + + + Forward diagonal + Előre átlós + + + + Crossing diagonal + Kereszt átlós + + + + Style + Stílus + + + + Color + Szín + + + + [%1, %2] + [%1, %2] + + + + Command + + + + Change signal + Jel változtatás + + + + + Change slot + Szlot változtatás + + + + Change signal-slot connection + Jel szlot kapcsolat változtatása + + + + Change sender + Küldő változtatás + + + + Change receiver + Fogadó változtatás + + + + Create button group + Gomb csoport létrehozása + + + + Break button group + Gomb csoport törése + + + + Break button group '%1' + '%1' gomb csoport törése + + + + Add buttons to group + Gomb hozzáadása a csoporthoz + + + + + Add '%1' to '%2' + Command description for adding buttons to a QButtonGroup + '%1' hozzáadása '%2'-höz + + + + Remove buttons from group + Gomb eltávolítása a csoportból + + + + Remove '%1' from '%2' + Command description for removing buttons from a QButtonGroup + '%1' eltávolítása '%2'-ból + + + + Add connection + Kapcsolat hozzáadása + + + + Adjust connection + Kapcsolat beállítása + + + + Delete connections + Kapcsolatok törlése + + + + Change source + Forrás változtatása + + + + Change target + Cél változtatása + + + + Morph %1/'%2' into %3 + MorphWidgetCommand description + %1/'%2' alakváltoztatása %3-re + + + + Insert '%1' + '%1' beszúrása + + + + Change Z-order of '%1' + '%1' Z sorrendjének megváltoztatása + + + + Raise '%1' + '%1' növelése + + + + Lower '%1' + Alsó '%1' + + + + Delete '%1' + '%1' törlése + + + + Reparent '%1' + '%1' újra szülősítése + + + + Promote to custom widget + Egyéni widget elősegítése + + + + Demote from custom widget + Egyéni widget lefokozása + + + + Lay out using grid + Tervraj rácsok használatával + + + + Lay out vertically + Tervrajz vertikálisan + + + + Lay out horizontally + Tervrajz horizontálisan + + + + Break layout + Tervrajz törése + + + + Simplify Grid Layout + Egyszerűsített rács tervrajz + + + + + + Move Page + Lap mozgatása + + + + + + + Delete Page + Lap törlése + + + + + Page + Lap + + + + page + lap + + + + + + + Insert Page + Lap beszúrása + + + + Change Tab order + Tab sorrend változtatása + + + + Create Menu Bar + Menü sáv + + + + Delete Menu Bar + Menü sáv törlése + + + + Create Status Bar + Státusz sáv létrehozása + + + + Delete Status Bar + Státusz sáv törlése + + + + Add Tool Bar + Eszköz sáv hozzáadása + + + + Add Dock Window + Dokk ablak hozzáadása + + + + Adjust Size of '%1' + '%1' méretének igazítása + + + + Change Form Layout Item Geometry + Űrlap tervrajz elem geometriájának megváltoztatása + + + + Change Layout Item Geometry + Tervrajz elem geometriájának megváltoztatása + + + + Delete Subwindow + Alablak törlése + + + + Insert Subwindow + Alablak beszúrása + + + + subwindow + alablak + + + + Subwindow + Alablak + + + + Change Table Contents + Táblázat tartalom megváltoztatása + + + + Change Tree Contents + Fa tartalom megváltoztatása + + + + + Add action + Tevékenység hozzáadása + + + + + Remove action + Tevékenység eltávolítása + + + + Add menu + Menü hozzáadása + + + + Remove menu + Menü eltávolítása + + + + Create submenu + Almenü létrehozása + + + + Delete Tool Bar + Eszköz sáv törlése + + + + Change layout of '%1' from %2 to %3 + '%1' tervrajz megváltoztatása %2-ről %3-ra + + + + Set action text + Tevékenység szöveg beállítása + + + + Insert action + Tevékenység beszúrása + + + + + Move action + Tevékenység mozgatása + + + + Change Title + Cím megváltoztatása + + + + Insert Menu + Menü beszúrása + + + + Changed '%1' of '%2' + '%2' '%1'-ének megváltoztatása + + + + Changed '%1' of %n objects + + %n objektum %1-ének megváltoztatása + + + + + Reset '%1' of '%2' + '%2' '%1'-ének megváltoztatása + + + + Reset '%1' of %n objects + + %n objektum '%1'-ének újraindítása + + + + + Add dynamic property '%1' to '%2' + '%2' '%1' dinamikus tulajdonságának hozzáadása + + + + Add dynamic property '%1' to %n objects + + %n objektum' '%1' dinamikus tulajdonságának hozzáadása + + + + + Remove dynamic property '%1' from '%2' + '%1' dinamikus tulajdonság eltávolítáas '%2'-ből + + + + Remove dynamic property '%1' from %n objects + + '%1' dinamikus tulajdonság eltávolítása %n objektumból + + + + + Change script + Szkript megváltoztatása + + + + Change signals/slots + Jelek/Szlotok megváltoztatása + + + + ConnectDialog + + + Configure Connection + Kapcsolat konfigurálása + + + + + GroupBox + CsoportDoboz + + + + + Edit... + Szerkesztés... + + + + Show signals and slots inherited from QWidget + QWidget-ből örökölt jelek és szlotok megjelenítése + + + + ConnectionDelegate + + + <object> + <objekttum> + + + + <signal> + <jel> + + + + <slot> + <szlot> + + + + DPI_Chooser + + + Standard (96 x 96) + Embedded device standard screen resolution + Szabványos (96 x 96) + + + + Greenphone (179 x 185) + Embedded device screen resolution + Greenphone (179 x 185) + + + + High (192 x 192) + Embedded device high definition screen resolution + Magasság (192 x 192) + + + + Designer + + + Qt Designer + Qt Designer + + + + This file contains top level spacers.<br>They have <b>NOT</b> been saved into the form. + Ez a fájl felső szintű távtartókat tartalmaz.<br> Nem tartalmaznak <b>SEMMIT</b>, ami el lenne mentve az űrlapba. + + + + Perhaps you forgot to create a layout? + Talán elfelejtette létrehozni a tervrajzot? + + + + Invalid UI file: The root element <ui> is missing. + Érvénytelen UI fájl. A rendszergazda elem <ui> hiányzik. + + + + An error has occurred while reading the UI file at line %1, column %2: %3 + Hiba történt az UI fájl olvasás közben %1 sorban, %2 oszlopban: %3 + + + + This file cannot be read because it was created using %1. + A fájl nem olvasható, mert %1 használatával hozták létre. + + + + This file was created using Designer from Qt-%1 and cannot be read. + A fájlt a(z) %1 Qt Designer-rel hozták létre és nem olvasható. + + + + The converted file could not be read. + A konvertált fájlt nem sikerült olvasni. + + + + This file was created using Designer from Qt-%1 and will be converted to a new form by Qt Designer. + A fájlt a(z) %1 Qt Designer-rel hozták létre és a Qt Designer egy új űrlapra fogja konvertálni. + + + + The old form has not been touched, but you will have to save the form under a new name. + A régi űrlap nem lett érintve, de az űrlapot új néven kell majd elmentenie. + + + + This file was created using Designer from Qt-%1 and could not be read: +%2 + A fájl a(z) %1 Qt Designer-rel lett létrehozva és nem olvasható: +%2 + + + + Please run it through <b>uic3&nbsp;-convert</b> to convert it to Qt-4's ui format. + Kérem futtassa a <br>uic3&nbsp;-convert</b> Qt 4-s ui formára konvertáláshoz. + + + + This file cannot be read because the extra info extension failed to load. + Ez a fájl nem olvasható, mert az extra információ kiterjesztést nem sikerült betölteni. + + + + Custom Widgets + Egyéni Widgetek + + + + Promoted Widgets + Támogatott Widgetek + + + + Unable to launch %1. + Nem lehet elindítani %1-t. + + + + %1 timed out. + %1 időtúllépés. + + + + DesignerMetaEnum + + + %1 is not a valid enumeration value of '%2'. + %1 nem egy érvényes '%2' felsorolási érték. + + + + '%1' could not be converted to an enumeration value of type '%2'. + '%1' nem konvertálható egy '%2' típusú felsorolási értékre. + + + + DesignerMetaFlags + + + '%1' could not be converted to a flag value of type '%2'. + '%1' nem konvertálható egy '%2' típusú jelző értékre. + + + + DeviceProfile + + + '%1' is not a number. + Reading a number for an embedded device profile + '%1' nem egy szám. + + + + An invalid tag <%1> was encountered. + Egy érvénytelen címkét <%1> talált. + + + + DeviceProfileDialog + + + &Family + &Család + + + + &Point Size + &Pont méret + + + + Style + Stílus + + + + Device DPI + Eszköz DPI + + + + Name + Név + + + + DeviceSkin + + + The image file '%1' could not be loaded. + Nem sikerült betölteni a(z) '%1' kép fájlt. + + + + The skin directory '%1' does not contain a configuration file. + A(z) '%1' szkin könyvtár nem tartalmaz egy konfigurációs fájlt sem. + + + + The skin configuration file '%1' could not be opened. + A(z) '%1' szkin konfigurációs fájlt nem sikerült megnyitni. + + + + The skin configuration file '%1' could not be read: %2 + A(z) '%1' szkin konfigurációs fájlt nem sikerült olvasni: %2 + + + + Syntax error: %1 + Szintakszis hiba: %1 + + + + The skin "up" image file '%1' does not exist. + A(z) '%1' szkin 'fel' kép fájl nem létezik. + + + + The skin "down" image file '%1' does not exist. + A(z) '%1' szkin 'le' kép fájl nem létezik. + + + + The skin "closed" image file '%1' does not exist. + A(z) '%1' szkin 'zárt' kép fájl nem létezik. + + + + The skin cursor image file '%1' does not exist. + A(z) '%1' szkin kurzor kép fájl nem létezik. + + + + Syntax error in area definition: %1 + Szintakszis hiba a terület definícióban: %1 + + + + Mismatch in number of areas, expected %1, got %2. + Rossz párosítás a területek számában, várt %1, kapot %2. + + + + EmbeddedOptionsControl + + + <html><table><tr><td><b>Font</b></td><td>%1, %2</td></tr><tr><td><b>Style</b></td><td>%3</td></tr><tr><td><b>Resolution</b></td><td>%4 x %5</td></tr></table></html> + Format embedded device profile description + <html><table><tr><td><b>Betű</b></td><td>%1, %2</td></tr><tr><td><b>Stílus</b></td><td>%3</td></tr><tr><td><b>Felbontás</b></td><td>%4 x %5</td></tr></table></html> + + + + EmbeddedOptionsPage + + + Embedded Design + Tab in preferences dialog + Tab a beállítások párbeszéd ablakban + + + + Device Profiles + EmbeddedOptionsControl group box" + BeágyazottOpciókVezérlő csoport doboz" + + + + FontPanel + + + Font + Betű + + + + &Writing system + Rendszer &írása + + + + &Family + &Család + + + + &Style + &Stílus + + + + &Point size + &Pont méret + + + + FontPropertyManager + + + PreferDefault + AlapértelmezettPreferálása + + + + NoAntialias + NincsÁtlapolás + + + + PreferAntialias + ÁtlapolásPreferálása + + + + Antialiasing + Átlapolás + + + + FormBuilder + + + Invalid stretch value for '%1': '%2' + Parsing layout stretch values + Érvénytelen érték kiterjesztés '%1'-re: '%2' + + + + Invalid minimum size for '%1': '%2' + Parsing grid layout minimum size values + Érvénytelen minimum méret '%1'-re: '%2' + + + + FormEditorOptionsPage + + + %1 % + %1 % + + + + Preview Zoom + Zoom előnézet + + + + Default Zoom + Alapértelmezett zoom + + + + Forms + Tab in preferences dialog + Űrlapok + + + + Default Grid + Alapértelmezett rács + + + + FormLayoutRowDialog + + + Add Form Layout Row + нелепица какая-то + Űrlap szerkezet sor hozzaadása + + + + &Label text: + &Címke szöveg: + + + + Field &type: + Mező &típus: + + + + &Field name: + &Mező név: + + + + &Buddy: + &Haver: + + + + &Row: + &Sor: + + + + Label &name: + Címke &név: + + + + FormWindow + + + Unexpected element <%1> + Váratlan elem <%1> + + + + Error while pasting clipboard contents at line %1, column %2: %3 + Hiba történt a vágólap tartalom beillesztése közben a(z) %1 sorban, %2 oszlopban: %3 + + + + FormWindowSettings + + + Form Settings + Űrlap beállítások + + + + Layout &Default + &Alapértelmezett elrendezés + + + + &Spacing: + &Ritkítás: + + + + &Margin: + &Margó: + + + + &Layout Function + &Elrendezés függvény + + + + + Ma&rgin: + Ma&rgó: + + + + Spa&cing: + Rit&kítás: + + + + &Author + &Szerző + + + + &Include Hints + Célzások &beleértése + + + + &Pixmap Function + &Pixmap függvény + + + + Grid + Rács + + + + Embedded Design + Beágyazott terv + + + + IconSelector + + + All Pixmaps ( + Az összes Pixmap ( + + + + ItemPropertyBrowser + + + XX Icon Selected off + Sample string to determinate the width for the first column of the list item property browser + XX ikon kiválasztásának kikapcsolása + + + + MainWindowBase + + + Main + Not currently used (main tool bar) + + + + + File + Fájl + + + + Edit + Szerkesztés + + + + Tools + Eszközök + + + + Form + Űrlap + + + + Qt Designer + Qt Designer + + + + NewForm + + + C&reate + &Létrehozás + + + + Recent + Utóbbi + + + + &Close + &Bezárás + + + + &Open... + &Megnyitás... + + + + &Recent Forms + &Utóbbi űrlapok + + + + Read error + Olvasási hiba + + + + New Form + Űj űrlap + + + + Show this Dialog on Startup + Párbeszédablak megjelenítése betöltéskor + + + + A temporary form file could not be created in %1. + Egy átmeneti űrlap fájlt nem sikerült létrehozni %1-ben. + + + + The temporary form file %1 could not be written. + A(z) %1 átmeneti űrlap fájlt nem sikerült írni. + + + + ObjectInspectorModel + + + Object + Objektum + + + + Class + Osztály + + + + separator + Elválasztó + + + + <noname> + <noname> + + + + ObjectNameDialog + + + Change Object Name + Objektum nevének megváltoztatása + + + + Object Name + Objektum név + + + + PluginDialog + + + Plugin Information + Beépülő modul információ + + + + 1 + 1 + + + + PreferencesDialog + + + Preferences + Beállítások + + + + PreviewConfigurationWidget + + + Form + Űrlap + + + + Print/Preview Configuration + Nyomtatás/Előnézet konfiguráció + + + + Style + Stílus + + + + Style sheet + Stíluslap + + + + + + ... + ... + + + + Device skin + Eszköz szkin + + + + PromotionModel + + + Not used + Usage of promoted widgets + Nincs használva + + + + Q3WizardContainer + + + + Page + Lap + + + + QAbstractFormBuilder + + + Unexpected element <%1> + Váratlan elem <%1> + + + + An error has occurred while reading the UI file at line %1, column %2: %3 + Hiba történt az UI fájl olvasása közben a(z) %1 sorban, %2 oszlopban: %3 + + + + Invalid UI file: The root element <ui> is missing. + Érvénytelen UI fájl. A rendszergazda elem <ui> hiányzik. + + + + The creation of a widget of the class '%1' failed. + A(z) '%1' osztály egy widget-ének létrehozása nem sikerült. + + + + Attempt to add child that is not of class QWizardPage to QWizard. + Gyermek hozzáadásának megkísérelése QWizard-hoz, amely nem egy QWizardPage osztály. + + + + Attempt to add a layout to a widget '%1' (%2) which already has a layout of non-box type %3. +This indicates an inconsistency in the ui-file. + Egy elrendezés hozzáadásának megprónálás egy "%1' widgethez (%2), melynek már egy %3 típusú nem doboz elrendezése van. +Ez ellentmondást mutat az ui fájlban. + + + + Empty widget item in %1 '%2'. + Üres widget elem %1-ben '%2'. + + + + Flags property are not supported yet. + Jelző tulajdonság még nem támogatott. + + + + While applying tab stops: The widget '%1' could not be found. + Tab stops alkalmazásakor: A(z) '%1' widget nem található. + + + + Invalid QButtonGroup reference '%1' referenced by '%2'. + Érvénytelen '%1' QButtonGroup hivatkozásra hivatkozik a(z) '%2'. + + + + This version of the uitools library is linked without script support. + Az uitools könyvtár ezen verziója szkript támogatás nélkül linkelt. + + + + QAxWidgetPlugin + + + ActiveX control + ActiveX vezérlő + + + + ActiveX control widget + ActiveX vezérlő widget + + + + QAxWidgetTaskMenu + + + Set Control + Vezérlő beállítása + + + + Reset Control + Vezérlő újraindítása + + + + Licensed Control + Felhatalmazott vezérlő + + + + The control requires a design-time license + A vezérlő egy tervezés idejű felhatalmazást igényel + + + + QCoreApplication + + + %1 is not a promoted class. + %1 nem egy támogatott osztály. + + + + The base class %1 is invalid. + A(z) %1 alap osztály érvénytelen. + + + + The class %1 already exists. + A(z) %1 osztály már létezik. + + + + Promoted Widgets + Támogatott Widget-ek + + + + The class %1 cannot be removed + A(z) %1 osztályt nem lehet eltávolítani + + + + The class %1 cannot be removed because it is still referenced. + A(z) %1 osztályt nem lehet eltávolítani, mert még mindig hivatkozott. + + + + The class %1 cannot be renamed + A(z) %1 osztályt nem lehet átnevezni + + + + The class %1 cannot be renamed to an empty name. + A(z) %1 osztályt nem lehet átnevezni egy üres névűre. + + + + There is already a class named %1. + Már van egy %1 nevű osztály. + + + + Cannot set an empty include file. + перевод близко к тексту - буквальный совсем глаз режет + Nem lehet beállítani egy üres bennefoglalt fájlt. + + + + Exception at line %1: %2 + Kivétel a(z) %1 sorban: %2 + + + + Unknown error + Ismeretlen hiba + + + + An error occurred while running the script for %1: %2 +Script: %3 + Hiba történt a szkript futtása közben %1-re: %2 +Szkript: %3 + + + + QDesigner + + + %1 - warning + %1 -figyelmeztetés + + + + Qt Designer + Qt Designer + + + + This application cannot be used for the Console edition of Qt + Ezt alkalmazást nem lehet a Qt konzol szerkesztésére használni + + + + QDesignerActions + + + Saved %1. + Mentve: %1. + + + + Edit Widgets + Widget-ek szerkesztése + + + + &Quit + &Bezárás + + + + &Minimize + &Minimalizálás + + + + Bring All to Front + Az összes előre hozása + + + + Preferences... + Beállítások... + + + + Clear &Menu + &Menü tisztítása + + + + CTRL+SHIFT+S + CTRL+SHIFT+S + + + + CTRL+R + CTRL+R + + + + CTRL+M + CTRL+M + + + + Qt Designer &Help + Qt Designer &Súgó + + + + Current Widget Help + Aktuális Widget Súgó + + + + What's New in Qt Designer? + Mi az újdonság a Qt Designer-ben? + + + + About Plugins + Beépülő modulokról + + + + + About Qt Designer + Qt Designer-ről + + + + About Qt + Qt-ról + + + + + Open Form + Űrlap megnyitása + + + + + + Designer UI files (*.%1);;All Files (*) + Designer UI fájlok (*.%1);;Az összes fájl (*) + + + + %1 already exists. +Do you want to replace it? + %1 már létezik. +Le szeretné cserélni? + + + + Additional Fonts... + További betűk... + + + + &Recent Forms + &Utóbbi űrlapok + + + + Designer + Designer + + + + Feature not implemented yet! + A tulajdonság még nincs implementálva! + + + + Read error + Olvasási hiba + + + + %1 +Do you want to update the file location or generate a new form? + %1 +Szeretné frissíteni a fájl helyét vagy generálni egy új űrlapot? + + + + &Update + &Frissítés + + + + &New Form + &Új űrlap + + + + + Save Form? + Menti az űrlapot? + + + + Could not open file + Nem sikerült megnyitni a fájlt + + + + Select New File + Új fájl kiválasztása + + + + Could not write file + Nem sikerült írni a fájlt + + + + &Close Preview + Előnézet &bezárása + + + + &New... + &Új... + + + + &Open... + &Megnyitás... + + + + &Save + &Mentés + + + + Save &As... + Mentés &másként... + + + + Save A&ll + Az ö&sszes mentése + + + + Save As &Template... + Mentés &sablonként... + + + + + &Close + &Bezárás + + + + Save &Image... + &Kép mentése... + + + + &Print... + &Nyomtatás... + + + + View &Code... + &Kód nézet... + + + + ALT+CTRL+S + ALT+CTRL+S + + + + + Save Form As + Mentés űrlapként + + + + Preview failed + Előnézet hiba + + + + Code generation failed + Kód generálási hiba + + + + The file %1 could not be opened. +Reason: %2 +Would you like to retry or select a different file? + Nem sikerült megnyitni a(z) %1 fájlt. +Ok: %2 +Meg szeretné újra próbálni vagy kiválasztani egy különböző fájlt? + + + + It was not possible to write the entire file %1 to disk. +Reason:%2 +Would you like to retry? + Nem lehetett az egész %1 fájlt a lemezre írni. +Ok: %2 +Meg szeretné próbálni újra? + + + + + Assistant + Assistant + + + + + The backup file %1 could not be written. + Nem sikerült írni az archivált %1 fájlt. + + + + The backup directory %1 could not be created. + Nem sikerült létrehozni a(z) %1 archivált könyvtárat. + + + + The temporary backup directory %1 could not be created. + Nem sikerült létrehozni az átmeneti archivált %1 könyvtárat. + + + + Image files (*.%1) + Kép fájlok (*.%1) + + + + + Save Image + Kép mentése + + + + Saved image %1. + Mentett kép: %1. + + + + The file %1 could not be written. + Nem sikerült írni a(z) %1 fájlt. + + + + Please close all forms to enable the loading of additional fonts. + Kérem zárja be az összes űrlapot további betűk betöltéséhez. + + + + Printed %1. + Kinyomtatva: %1. + + + + QDesignerAppearanceOptionsPage + + + Appearance + Tab in preferences dialog + Megjelenés + + + + QDesignerAppearanceOptionsWidget + + + Docked Window + Dokkolt ablak + + + + Multiple Top-Level Windows + Összes felső szintű ablakok + + + + Toolwindow Font + Eszköz ablak betű + + + + QDesignerAxWidget + + + Reset control + Vezérlés újraindítása + + + + Set control + Vezérlés beállítása + + + + Control loaded + Vezérlés betöltve + + + + A COM exception occurred when executing a meta call of type %1, index %2 of "%3". + Egy COM kivétel történt a(z) %1 típusú meta hívás végrehajtása közben, '%3' %2 indexe. + + + + QDesignerFormBuilder + + + Script errors occurred: + Szkript hiba történt: + + + + The preview failed to build. + Nem sikerült az előnézetet felépíteni. + + + + Designer + Designer + + + + QDesignerFormWindow + + + %1 - %2[*] + %1 - %2[*] + + + + Save Form? + Űrlap mentése? + + + + Do you want to save the changes to this document before closing? + El szeretné menteni a változtatásokat ebbe a dokumentumba a bezárás előtt? + + + + If you don't save, your changes will be lost. + Ha nem menti el, a változtatásai el fognak veszni. + + + + QDesignerMenu + + + Type Here + Gépelje be ide + + + + Add Separator + Elválasztó hozzáadása + + + + Insert separator + Elválasztó beszúrása + + + + Remove separator + Elválasztó eltávolítása + + + + Remove action '%1' + '%1' tevékenység eltávolítása + + + + + Add separator + Elválasztó hozzáadása + + + + Insert action + Tevékenység beszúrása + + + + QDesignerMenuBar + + + Type Here + Gépelje be ide + + + + Remove Menu '%1' + '%1' menü eltávolítása + + + + Remove Menu Bar + Menü sáv eltávolítása + + + + Menu + Menü + + + + QDesignerPluginManager + + + An XML error was encountered when parsing the XML of the custom widget %1: %2 + Egy XML hiba történt az egyéni %1 widget XML-ének elemzése közben: %2 + + + + A required attribute ('%1') is missing. + Egy szükséges attribútum ('%1') hiányzik. + + + + An invalid property specification ('%1') was encountered. Supported types: %2 + Egy érvénytelen tulajdonság specifikációt ('%1') talált. Támogatott típusok: %2 + + + + '%1' is not a valid string property specification. + '%1' nem egy érvényes sztring tulajdonság specifikáció. + + + + The XML of the custom widget %1 does not contain any of the elements <widget> or <ui>. + Az egyéni %1 widget XML-je nem tartalmaz semmilyen elemet <widget> vagy <ui>. + + + + The class attribute for the class %1 is missing. + Az osztály attribútum %1 osztályra hiányzik. + + + + The class attribute for the class %1 does not match the class name %2. + Az osztály attribútum %1 osztályra nem egyezik meg a(z) %2 osztály nevével. + + + + QDesignerPropertySheet + + + Dynamic Properties + Dinamikus tulajdonságok + + + + QDesignerResource + + + The layout type '%1' is not supported, defaulting to grid. + A(z) '%1' elrendezés típus nem támogatott, alapértelmezett rács. + + + + The container extension of the widget '%1' (%2) returned a widget not managed by Designer '%3' (%4) when queried for page #%5. +Container pages should only be added by specifying them in XML returned by the domXml() method of the custom widget. + A(z) '%1' (%2) widget konténer kiterjesztése egy olyan widget-et adott vissza, amelyet a(z) '%3' (%4) Designer nem kezel, %5 lap lekéréskor. +Konténer lapokat XML-ben való specifikációjuk által kellene hozzáadni, az egyéni widget domXML() eljárása által. + + + + Unexpected element <%1> + Parsing clipboard contents + Váratlan elem <%1> + + + + Error while pasting clipboard contents at line %1, column %2: %3 + Parsing clipboard contents + Hiba történt a vágólap tartalmának beillesztése közben a(z) %1 sorban, %2 oszlopban: %3 + + + + Error while pasting clipboard contents: The root element <ui> is missing. + Parsing clipboard contents + Hiba történt a vágólap tartalmának beillesztése közben. A rendszergazda elem <ui> hiányzik. + + + + QDesignerSharedSettings + + + The template path %1 could not be created. + Nem sikerült létrehozni a(z) %1 sablon útvonalat. + + + + An error has been encountered while parsing device profile XML: %1 + Hiba történt az eszköz profil %1 XML elemzése közben + + + + QDesignerToolWindow + + + Property Editor + Tulajdonság szerkesztő + + + + Action Editor + Tevékenység szerkesztő + + + + Object Inspector + Objektum felügyelő + + + + Resource Browser + Erőforrás böngésző + + + + Signal/Slot Editor + Jel/Szlot szerkesztő + + + + Widget Box + Widget doboz + + + + QDesignerWorkbench + + + &File + &Fájl + + + + F&orm + &Űrlap + + + + Preview in + Előnézetben + + + + &Window + &Ablak + + + + &Help + &Súgó + + + + Edit + Szerkesztés + + + + Toolbars + Eszközsávok + + + + Save Forms? + Űrlap mentése? + + + + There are %n forms with unsaved changes. Do you want to review these changes before quitting? + + %n űrlapban vannak el nem mentett változtatások. Át szeretné tekintei ezeket a változtatásokat a kilépés előtt? + + + + + &View + &Nézet + + + + &Settings + &Beállítások + + + + Widget Box + Widget doboz + + + + If you do not review your documents, all your changes will be lost. + Ha nem tekinti át újra a dokumentumokat, az összes változtatása el fog veszni. + + + + Discard Changes + Változtatások eldobása + + + + Review Changes + Változtatások áttekintése + + + + Backup Information + Archiválási információ + + + + The last session of Designer was not terminated correctly. Backup files were left behind. Do you want to load them? + A Designer utolsó szakasza nem megfelelően állt le. Archivált fájlok hagyott maga után. Be szeretné tölteni őket? + + + + The file <b>%1</b> could not be opened. + A(z) <b>%1</b> fájlt nem sikerült megnyitni. + + + + The file <b>%1</b> is not a valid Designer UI file. + A(z) <b>%1</b> fájl nem egy érvényes Designer UI fájl. + + + + QFormBuilder + + + An empty class name was passed on to %1 (object name: '%2'). + Empty class name passed to widget factory method + Egy üres osztály név volt %1-ra (objektum név: '%2'). + + + + QFormBuilder was unable to create a custom widget of the class '%1'; defaulting to base class '%2'. + QFormBuilder-nek nem sikerült létrehozni egy '%1' osztály egyéni widget-et, alapértelmezés a(z) '%2' alap osztályra. + + + + QFormBuilder was unable to create a widget of the class '%1'. + QFormBuilder-nak nem sikerült létrehoznia egy '%1' osztály widget-et. + + + + The layout type `%1' is not supported. + A(z) '%1' elrendezés terv nem támogatott. + + + + The set-type property %1 could not be read. + Nem sikerült olvasni a(z) %1 beállított típusú tulajdonságot. + + + + The enumeration-type property %1 could not be read. + A(z) %1 felsorolási típus tulajdonságot nem sikerült olvasni. + + + + Reading properties of the type %1 is not supported yet. + '%1' típus tulajdonságok olvasása még nem támogatott. + + + + The property %1 could not be written. The type %2 is not supported yet. + A(z) %1 tulajdonságot nem sikerült írni. A(z) %2 típus nem támogatott még. + + + + QStackedWidgetEventFilter + + + Previous Page + Előző lap + + + + Next Page + Következő lap + + + + Delete + Törlés + + + + Before Current Page + Aktuális lap előtt + + + + After Current Page + Aktuális lap után + + + + Change Page Order... + Lap sorrend megváltoztatása... + + + + Change Page Order + Lap sorrend megváltoztatása + + + + Page %1 of %2 + %2 %1 lapja + + + + + Insert Page + Lap beszúrása + + + + QStackedWidgetPreviewEventFilter + + + Go to previous page of %1 '%2' (%3/%4). + Ugrás a(z) %1 '%2' (%3/%4) előző lapjára. + + + + Go to next page of %1 '%2' (%3/%4). + Ugrás a(z) %1 '%2' (%3/%4) következő lapjára. + + + + QTabWidgetEventFilter + + + Delete + Törlés + + + + Before Current Page + Aktuális lap előtt + + + + After Current Page + Aktuális lap után + + + + Page %1 of %2 + %2 %1 lapja + + + + + Insert Page + Lap beszúrása + + + + QToolBoxHelper + + + Delete Page + Lap törlése + + + + Before Current Page + Aktuális lap előtt + + + + After Current Page + Aktuális lap után + + + + Change Page Order... + Lap sorrend megváltoztatása... + + + + Change Page Order + Lap sorrend megváltoztatása + + + + Page %1 of %2 + %2 %1 lapja + + + + Insert Page + Lap beszúrása + + + + QtBoolEdit + + + + + True + Igaz + + + + + False + Hamis + + + + QtBoolPropertyManager + + + True + Igaz + + + + False + Hamis + + + + QtCharEdit + + + Clear Char + Karakter ürítése + + + + QtColorEditWidget + + + ... + ... + + + + QtColorPropertyManager + + + Red + Piros + + + + Green + Zöld + + + + Blue + Kék + + + + Alpha + Alfa + + + + QtCursorDatabase + + + Arrow + Nyíl + + + + Up Arrow + Felfele nyíl + + + + Cross + Kereszt + + + + Wait + Várakozás + + + + IBeam + IBeam + + + + Size Vertical + Vertikális méret + + + + Size Horizontal + Horizontális méret + + + + Size Backslash + Visszaper méret + + + + Size Slash + Per méret + + + + Size All + Az összes méret + + + + Blank + Üres + + + + Split Vertical + Vertikális feldarabolás + + + + Split Horizontal + Horizontális feldarabolás + + + + Pointing Hand + Mutató kéz + + + + Forbidden + Tiltott + + + + Open Hand + Nyitott kéz + + + + Closed Hand + Zárt kéz + + + + What's This + Mi ez + + + + Busy + Elfoglalt + + + + QtFontEditWidget + + + ... + ... + + + + Select Font + Betű kiválasztása + + + + QtFontPropertyManager + + + Family + Család + + + + Point Size + Pont méret + + + + Bold + Félkövér + + + + Italic + Dőlt + + + + Underline + Aláhúzás + + + + Strikeout + Kitalálás + + + + Kerning + Szóközökkel feltöltés + + + + QtGradientDialog + + + Edit Gradient + Meredekség szerkesztése + + + + QtGradientEditor + + + Start X + X indítása + + + + Start Y + Y indítása + + + + Final X + Végső X + + + + Final Y + Végső Y + + + + + Central X + X középpont + + + + + Central Y + Y középpont + + + + Focal X + X gyújtópont + + + + Focal Y + Y gyújtópont + + + + Radius + Sugár + + + + Angle + Szög + + + + Linear + Lineáris + + + + Radial + Sugárirányú + + + + Conical + Kúp alakú + + + + Pad + Lyuk + + + + Repeat + Megismétlés + + + + Reflect + Prizma + + + + Form + Űrlap + + + + Gradient Editor + Meredekség szerkesztő + + + + This area shows a preview of the gradient being edited. It also allows you to edit parameters specific to the gradient's type such as start and final point, radius, etc. by drag & drop. + Ez a mező jeleníti meg a meredekség egy előzetének szerkesztését. Ez engedélyezi a meredekség típusához tartozó paraméter specifikus dolgok szerkesztését, mint a kezdő és végpont, sugár, stb. a fogd & vidd módszerrel. + + + + 1 + 1 + + + + 2 + 2 + + + + 3 + 3 + + + + 4 + 4 + + + + 5 + 5 + + + + Gradient Stops Editor + Meredekség leállítás szerkesztő + + + + This area allows you to edit gradient stops. Double click on the existing stop handle to duplicate it. Double click outside of the existing stop handles to create a new stop. Drag & drop the handle to reposition it. Use right mouse button to popup context menu with extra actions. + Ez a mező engedélyezi a meredekség leállításának szerkesztését.Dupla kattintás a létező leállítás kezelőn duplikálja ezt. Dupla kattintás a létező leállítás kezelőn kívül létrehoz egy új leállítást. Fogd & vidd az újrapozíciónálo kezelőt. Használja a jobb egér gombot a felugró menü összefüggéshez extra tevékenységekkel. + + + + Zoom + Zoom + + + + + Reset Zoom + Újraindítás zoom + + + + Position + Pozíció + + + + + + Hue + Színárnyalat + + + + H + H + + + + + Saturation + Telítettség + + + + S + S + + + + Sat + Sat + + + + + Value + Érték + + + + V + V + + + + Val + Val + + + + + + Alpha + Alfa + + + + A + A + + + + Type + Típus + + + + Spread + Kiterjedés + + + + Color + Szín + + + + Current stop's color + Aktuális leállítás színe + + + + Show HSV specification + HSV specifikáció megjelenítése + + + + HSV + HSV + + + + Show RGB specification + RGB specifikáció megjelenítése + + + + RGB + RGB + + + + Current stop's position + Aktuális leállítás pozíciója + + + + % + % + + + + Zoom In + Nagyítás + + + + Zoom Out + Kicsinyítés + + + + Toggle details extension + Részlet kiterjesztések kapcsolgatása + + + + > + > + + + + Linear Type + Lineáris típus + + + + + + + + + ... + ... + + + + Radial Type + Sugárirányú típus + + + + Conical Type + Kúp alakú típus + + + + Pad Spread + Lyuk kiterjedés + + + + Repeat Spread + Ismétlési kiterjedés + + + + Reflect Spread + Prizma kiterjedés + + + + QtGradientStopsWidget + + + New Stop + Új leállítás + + + + Delete + Törlés + + + + Flip All + Az összes feldobása + + + + Select All + Az összes kiválasztása + + + + Zoom In + Nagyítás + + + + Zoom Out + Kicsinyítés + + + + Reset Zoom + Zoom újraindítása + + + + QtGradientView + + + Grad + Diplomás + + + + Remove Gradient + Meredekség eltávolítása + + + + Are you sure you want to remove the selected gradient? + El szeretné távolítani a kiválasztott meredekséget? + + + + + New... + Új... + + + + + Edit... + Szerkesztés... + + + + + Rename + Átnevezés + + + + + Remove + Eltávolítás + + + + Gradient View + Meredekség nézet + + + + QtGradientViewDialog + + + Select Gradient + Meredekség kiválasztása + + + + QtKeySequenceEdit + + + Clear Shortcut + Gyorsbillentyű kitisztítása + + + + QtLocalePropertyManager + + + %1, %2 + %1, %2 + + + + Language + Nyelv + + + + Country + Ország + + + + QtPointFPropertyManager + + + (%1, %2) + (%1, %2) + + + + X + X + + + + Y + Y + + + + QtPointPropertyManager + + + (%1, %2) + (%1, %2) + + + + X + X + + + + Y + Y + + + + QtPropertyBrowserUtils + + + [%1, %2, %3] (%4) + [%1, %2, %3] (%4) + + + + [%1, %2] + [%1, %2] + + + + QtRectFPropertyManager + + + [(%1, %2), %3 x %4] + [(%1, %2), %3 x %4] + + + + X + X + + + + Y + Y + + + + Width + Szélesség + + + + Height + Magasság + + + + QtRectPropertyManager + + + [(%1, %2), %3 x %4] + [(%1, %2), %3 x %4] + + + + X + X + + + + Y + Y + + + + Width + Szélesség + + + + Height + Magasság + + + + QtResourceEditorDialog + + + %1 already exists. +Do you want to replace it? + %1 már létezik. +Le szeretné cserélni? + + + + The file does not appear to be a resource file; element '%1' was found where '%2' was expected. + A fájl nem egy erőforrás fájl, '%1' elem található, ahol '%2' a várt. + + + + %1 [read-only] + %1 [csak olvasható] + + + + + %1 [missing] + %1 [hiányzik] + + + + <no prefix> + <nincs előtag> + + + + + New Resource File + Új erőforrás fájl + + + + + Resource files (*.qrc) + Erőforrás fájlok (*.qrc) + + + + Import Resource File + Erőforrás fájl importálása + + + + newPrefix + újElőtag + + + + <p><b>Warning:</b> The file</p><p>%1</p><p>is outside of the current resource file's parent directory.</p> + <p><b>Figyelmeztetés:</b> A(z)</p><p>%1</p><p>fájl az aktuális erőforrás fájl szülő könyvtárán kívül helyezkedik el.</p> + + + + <p>To resolve the issue, press:</p><table><tr><th align="left">Copy</th><td>to copy the file to the resource file's parent directory.</td></tr><tr><th align="left">Copy As...</th><td>to copy the file into a subdirectory of the resource file's parent directory.</td></tr><tr><th align="left">Keep</th><td>to use its current location.</td></tr></table> + <p>A hiba megoldásához, nyomja le a következőt:</p><table><tr><th align="left">Másolás</th><td>a fájl erőforrás fájljának szülőkönyvtárába másoláshoz.</td></tr><tr><th align="left">Másolás másként...</th><td>a fájl erőforrás fájljának szülőkönyvtárának egy alkönyvtárába másoláshoz.</td></tr><tr><th align="left">Megtartás</th><td>az aktuális helyének használatához. </td></tr></table> + + + + Add Files + Fájlok hozzáadása + + + + Incorrect Path + Helytelen útvonal + + + + + + + Copy + Másolás + + + + Copy As... + Másolás, mint... + + + + Keep + Megtartás + + + + Skip + Kihagyás + + + + Clone Prefix + Előtag klónozása + + + + Enter the suffix which you want to add to the names of the cloned files. +This could for example be a language extension like "_de". + Gépelje be az utótagot, melyet hozzá akar adni a klónozott fájl nevekhez. +Ez például egy nyelv kiterjesztés lenne, úgy mint "_de". + + + + + Copy As + Másolás, mint + + + + <p>The selected file:</p><p>%1</p><p>is outside of the current resource file's directory:</p><p>%2</p><p>Please select another path within this directory.<p> + <p>A kiválaszott fájl:</p><p>%1</p><p>az aktuális erőforrás fájl könytárán kívül helyezkedik el:</p><p>%2</p><p>Kérem válasszon másik útvonalat ezen a könyvtáron belül.<p> + + + + Could not overwrite %1. + Nem sikerült felülírni %1. + + + + Could not copy +%1 +to +%2 + Nem sikerült másolni +%1 +ide +%2 + + + + A parse error occurred at line %1, column %2 of %3: +%4 + Egy elemzési hiba történt %3 %1 sorában, %2 oszlopában: +%4 + + + + Save Resource File + Erőforrás fájl mentése + + + + Could not write %1: %2 + Nem sikerült írni %1: %2 + + + + Edit Resources + Erőforrások szerkesztése + + + + New... + Új... + + + + Open... + Megnyitás... + + + + Open Resource File + Erőforrás fájl megnyitása + + + + + Remove + Eltávolítás + + + + + Move Up + Mozgatás felfelé + + + + + Move Down + Mozgatás lefelé + + + + + Add Prefix + Előtag hozzáadása + + + + Add Files... + Fájlok hozzáadása... + + + + Change Prefix + Előtag megváltoztatása + + + + Change Language + Nyelv megváltoztatása + + + + Change Alias + Álnév megváltoztatása + + + + Clone Prefix... + Előtag klónozása... + + + + Prefix / Path + Előtag / Útvonal + + + + Language / Alias + Nyelv / Álnév + + + + <html><p><b>Warning:</b> There have been problems while reloading the resources:</p><pre>%1</pre></html> + <html><p><b>Figyelmeztetés:</b> Hibák történtek az erőforrások újra töltése közben:</p><pre>%1</pre></html> + + + + Resource Warning + Erőforrás figyelmeztetés + + + + Dialog + Párbeszéd ablak + + + + New File + Új fájl + + + + + N + N + + + + Remove File + Fájl eltávolítása + + + + + R + R + + + + I + I + + + + New Resource + Új erőforrás + + + + A + A + + + + Remove Resource or File + Erőforrás vagy fájl eltávolítása + + + + QtResourceView + + + Size: %1 x %2 +%3 + Méret: %1 x %2 +%3 + + + + Edit Resources... + Erőforrások szerkesztése... + + + + Reload + Újratöltés + + + + Copy Path + Útvonal másolása + + + + QtResourceViewDialog + + + Select Resource + Erőforrás kiválasztása + + + + QtSizeFPropertyManager + + + %1 x %2 + %1 x %2 + + + + Width + Szélesség + + + + Height + Magasság + + + + QtSizePolicyPropertyManager + + + + <Invalid> + <Érvénytelen> + + + + [%1, %2, %3, %4] + [%1, %2, %3, %4] + + + + Horizontal Policy + Horizontális irányvonal + + + + Vertical Policy + Vertikális irányelv + + + + Horizontal Stretch + Horizontális terjedelem + + + + Vertical Stretch + Vertikális terjedelem + + + + QtSizePropertyManager + + + %1 x %2 + %1 x %2 + + + + Width + Szélesség + + + + Height + Magasság + + + + QtToolBarDialog + + + Custom Toolbar + Egyéni eszköz sáv + + + + < S E P A R A T O R > + < E L V Á L A S Z T Ó > + + + + Customize Toolbars + Eszköz sávok testreszabása + + + + 1 + 1 + + + + Actions + Tevékenységek + + + + Toolbars + Eszköz sávok + + + + Add new toolbar + Új eszköz sáv hozzáadása + + + + New + Új + + + + Remove selected toolbar + Kiválaszott eszköz sáv eltávolítás + + + + Remove + Eltávolítás + + + + Rename toolbar + Eszköz sáv átnevezése + + + + Rename + Átnevezés + + + + Move action up + Tevékenység mozgatása felfelé + + + + Up + Fel + + + + Remove action from toolbar + Tevékenység eltávolítása az eszköz sávról + + + + <- + <- + + + + Add action to toolbar + Tevékenység hozzáadása az eszközsávhoz + + + + -> + -> + + + + Move action down + Tevékenység mozgatása felfele + + + + Down + Le + + + + Current Toolbar Actions + Aktuális eszköz sáv tevékenységek + + + + QtTreePropertyBrowser + + + Property + Tulajdonság + + + + Value + Érték + + + + SaveFormAsTemplate + + + Add path... + Útvonal hozzáadása... + + + + Template Exists + A sablon létezik + + + + A template with the name %1 already exists. +Do you want overwrite the template? + Egy %1 nevű sablon már létezik. +Felül szeretné írni a sablont? + + + + Overwrite Template + Sablom felülírása + + + + Open Error + Megnyitási hiba + + + + There was an error opening template %1 for writing. Reason: %2 + Hiba történt a(z) %1 sablon írásra megnyitása közben. Ok: %2 + + + + Write Error + Írása hiba + + + + There was an error writing the template %1 to disk. Reason: %2 + Hiba történt a(z) %1 sablon lemezre írása közben. Ok: %2 + + + + Pick a directory to save templates in + Egy könyvtár gondos kiválasztása, melybe a könytárak lesznek elmentve + + + + Save Form As Template + Az űrlap sablonként mentése + + + + &Category: + &Kategória: + + + + &Name: + &Név: + + + + ScriptErrorDialog + + + An error occurred while running the scripts for "%1": + + Hiba történt a szkriptek futtatása közben '%1'-re: + + + + SelectSignalDialog + + + Go to slot + Szlotra ugrás + + + + Select signal + Jel kiválasztása + + + + signal + jel + + + + class + osztály + + + + SignalSlotConnection + + + SENDER(%1), SIGNAL(%2), RECEIVER(%3), SLOT(%4) + KÜLDŐ(%1), JEL(%2), FOGADÓ(%3), SZLOT(%4) + + + + SignalSlotDialogClass + + + Signals and slots + Jelek és szlotok + + + + Slots + Szlotok + + + + + Add + Hozzáadás + + + + + + + ... + ... + + + + + Delete + Törlés + + + + Signals + Jelek + + + + Spacer + + + Horizontal Spacer '%1', %2 x %3 + Horizontális távtartók '%1', %2 x %3 + + + + Vertical Spacer '%1', %2 x %3 + Vertikális távtartók '%1', %2 x %3 + + + + TemplateOptionsPage + + + Template Paths + Tab in preferences dialog + Слово "пути" опустил, т.к. с другими вкладками не перепутать, а длинная вкладка не смотрится. + Sablon útvonalak + + + + ToolBarManager + + + Configure Toolbars... + Eszköz sávok konfigurálása... + + + + Window + Ablak + + + + Help + Súgó + + + + Style + Stílus + + + + Dock views + Dokk nézetek + + + + Toolbars + Eszköz sávok + + + + VersionDialog + + + <h3>%1</h3><br/><br/>Version %2 + <h3>%1</h3><br/><br/>Verzió %2 + + + + Qt Designer + Qt Designer + + + + <br/>Qt Designer is a graphical user interface designer for Qt applications.<br/> + <br/>Qt Designer egy grafikus felhasználói felület tervező Qt alkalmazásokhoz.<br/> + + + + %1<br/>Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). + %1<br/>Szerzői jog (C) 2010 Nokia vállalat és/vagy leányvállalata(i). + + + + WidgetDataBase + + + The file contains a custom widget '%1' whose base class (%2) differs from the current entry in the widget database (%3). The widget database is left unchanged. + A fájl egy egyéni '%1' widget-t tartalmaz, aminek az alap osztálya (%2) különbözik az aktuális beviteltől a widget adatbázisban (%3). A widget adatbázis változatlanul lett hagyva. + + + + qdesigner_internal::ActionEditor + + + New... + Új... + + + + Edit... + Szerkesztés... + + + + Go to slot... + Ugrás a szlotra... + + + + Copy + Másolás + + + + Cut + Kivágás + + + + Paste + Beillesztés + + + + Select all + Az összes kiválasztása + + + + Delete + Törlés + + + + Actions + Tevékenységek + + + + Configure Action Editor + Tevékenység szerkesztő konfigurálása + + + + Icon View + Ikon nézet + + + + Detailed View + Részletezett nézet + + + + New action + Új tevékenység + + + + Edit action + Tevékenység szerkesztése + + + + Remove action '%1' + '%1' tevékenység eltávolítása + + + + Remove actions + Tevékenységek eltávolítása + + + + Used In + Használva ebben + + + + qdesigner_internal::ActionModel + + + Name + Név + + + + Used + Használt + + + + Text + Szöveg + + + + Shortcut + Rövidebb út + + + + Checkable + Leellenőrizhető + + + + ToolTip + Eszköz tipp + + + + qdesigner_internal::BrushManagerProxy + + + The element '%1' is missing the required attribute '%2'. + A(z) '%1' elem hiányzik, a szükséges attribútum '%2'. + + + + Empty brush name encountered. + Üres kefe nevet talált. + + + + An unexpected element '%1' was encountered. + Egy '%1' váratlan elemet talált. + + + + An error occurred when reading the brush definition file '%1' at line line %2, column %3: %4 + Hiba történt a(z) '%1' ecset definíciós fájl olvasása közben %2 sorban, %3 oszlopban: %4 + + + + An error occurred when reading the resource file '%1' at line %2, column %3: %4 + Hiba történt a(z) '%1' erőforrás fájl olvasása közben, %2 sorban, %3 oszlopban: %4 + + + + qdesigner_internal::BuddyEditor + + + Add buddy + Haver hozzáadása + + + + Remove buddies + Haverok eltávolítása + + + + Remove %n buddies + + %n haverok eltávolítása + + + + + Add %n buddies + + %n haver hozzáadása + + + + + Set automatically + Automatikus beállítás + + + + qdesigner_internal::BuddyEditorPlugin + + + Edit Buddies + Haverok szerkesztése + + + + qdesigner_internal::BuddyEditorTool + + + Edit Buddies + Haverok szerkesztése + + + + qdesigner_internal::ButtonGroupMenu + + + Select members + Tagok kiválasztása + + + + Break + Törés + + + + qdesigner_internal::ButtonTaskMenu + + + Assign to button group + Gomb csoporthoz rendelés + + + + Button group + Gomb csoport + + + + New button group + Új gomb csoport + + + + Change text... + Szöveg megváltoztatása... + + + + None + Semmi + + + + Button group '%1' + '%1' gomb csoport + + + + qdesigner_internal::CodeDialog + + + Save... + Mentés... + + + + Copy All + Az összes másolása + + + + &Find in Text... + &Keresés szövegben... + + + + A temporary form file could not be created in %1. + Egy átmeneti űrlap fájlt nem sikerült létrehozni %1-ben. + + + + The temporary form file %1 could not be written. + A(z) %1 átmeneti űrlap fájlt nem sikerült írni. + + + + %1 - [Code] + %1 - [Kód] + + + + Save Code + Kód mentése + + + + Header Files (*.%1) + Fejállományok (*.%1) + + + + The file %1 could not be opened: %2 + A(z) %1 fájlt nem sikerült megnyitni: %2 + + + + The file %1 could not be written: %2 + A(z) %1 fájlt nem sikerült írni: %2 + + + + %1 - Error + %1 - Hiba + + + + qdesigner_internal::ColorAction + + + Text Color + Szöveg szín + + + + qdesigner_internal::ComboBoxTaskMenu + + + Edit Items... + Elemek szerkesztése... + + + + Change Combobox Contents + Combobox tartalmának megváltoztatása + + + + qdesigner_internal::CommandLinkButtonTaskMenu + + + Change description... + Leírás megváltoztatása... + + + + qdesigner_internal::ConnectionEdit + + + Select All + Az összes kiválasztása + + + + Deselect All + Az összes kijelölés eltűntetése + + + + Delete + Törlés + + + + qdesigner_internal::ConnectionModel + + + Sender + Küldő + + + + Signal + Jel + + + + Receiver + Fogadó + + + + Slot + Szlot + + + + <sender> + <küldő> + + + + <signal> + <jel> + + + + <receiver> + <fogadó> + + + + <slot> + <szlot> + + + + The connection already exists!<br>%1 + A kapcsolat már létezik!<br>%1 + + + + Signal and Slot Editor + Jel és Szlot szerkesztő + + + + qdesigner_internal::ContainerWidgetTaskMenu + + + Delete + Törlés + + + + Insert + Beszúrás + + + + Insert Page Before Current Page + Lap beszúrása az aktuális lap elé + + + + Insert Page After Current Page + Lap beszúrása az aktuális lap után + + + + Add Subwindow + Alablak hozzáadása + + + + Subwindow + Al ablak + + + + Page + Lap + + + + Page %1 of %2 + %2 %1 lapja + + + + qdesigner_internal::DPI_Chooser + + + System (%1 x %2) + System resolution + Rendszer (%1 x %2) + + + + User defined + Felhasználó által definiált + + + + x + DPI X/Y separator + x + + + + qdesigner_internal::DesignerPropertyManager + + + + AlignLeft + IgazításBalra + + + + AlignHCenter + IgazításHKözépre + + + + AlignRight + IgazításJobbra + + + + AlignJustify + IgazításFeloldása + + + + AlignTop + IgazításTetejére + + + + + AlignVCenter + IgazításVKözépre + + + + AlignBottom + IgazításAlulra + + + + %1, %2 + %1, %2 + + + + Customized (%n roles) + + Testreszabva (%n szabály) + + + + + Inherited + Örökölt + + + + Horizontal + Horizontális + + + + Vertical + Vertikális + + + + Normal Off + Normál ki + + + + Normal On + Normál be + + + + Disabled Off + Tiltás ki + + + + Disabled On + Tiltás be + + + + Active Off + Aktív ki + + + + Active On + Aktív be + + + + Selected Off + Kiválasztás ki + + + + Selected On + Kiválasztás be + + + + + translatable + fordítható + + + + + disambiguation + Nem félreérthető + + + + + comment + megjegyzés + + + + qdesigner_internal::DeviceProfileDialog + + + Device Profiles (*.%1) + Eszköz profilok (*.%1) + + + + Default + Alapértelmezett + + + + Save Profile + Profil mentése + + + + Save Profile - Error + Profil mentése - Hiba + + + + Unable to open the file '%1' for writing: %2 + Nem lehet megnyitni a(z) '%1' fájlt írásra: %2 + + + + Open profile + Profil megnyitása + + + + + Open Profile - Error + Profil megnyitása - Hiba + + + + Unable to open the file '%1' for reading: %2 + Nem lehet megnyitni a(z) '%1' fájlt olvasásra: %2 + + + + '%1' is not a valid profile: %2 + '%1' nem egy érvényes profil: %2 + + + + qdesigner_internal::Dialog + + + Dialog + Párbeszéd ablak + + + + StringList + Sztring lista + + + + New String + Új Sztring + + + + &New + &Új + + + + Delete String + Sztring törlése + + + + &Delete + &Törlés + + + + &Value: + &Érték: + + + + Move String Up + Sztring felfelé mozgatása + + + + Up + Fel + + + + Move String Down + Sztring lefelé mozgatása + + + + Down + Le + + + + qdesigner_internal::EmbeddedOptionsControl + + + None + Semmi + + + + Add a profile + Egy profil hozzáadása + + + + Edit the selected profile + A kiválasztott profil szerkesztése + + + + Delete the selected profile + A kiválasztott profil törlése + + + + Add Profile + Profil hozzáadása + + + + New profile + Új profil + + + + Edit Profile + Profil szerkesztése + + + + Delete Profile + Profil törlése + + + + Would you like to delete the profile '%1'? + Törölni szeretné a(z) '%1' profilet? + + + + Default + Alapértelmezett + + + + qdesigner_internal::FilterWidget + + + <Filter> + <Szűrő> + + + + qdesigner_internal::FormEditor + + + Resource File Changed + Erőforrás fájl megváltoztatva + + + + The file "%1" has changed outside Designer. Do you want to reload it? + A(z) '%1' fájl megváltoztatták a Designer-en kívül. Újra szeretné tölteni? + + + + qdesigner_internal::FormLayoutMenu + + + Add form layout row... + Űrlap elrendezési sor hozzáadása... + + + + qdesigner_internal::FormWindow + + + Edit contents + Tartalom szerkesztése + + + + F2 + F2 + + + + Insert widget '%1' + '%1' widget beszúrása + + + + Resize + Átméretezés + + + + + Key Move + Kulcs mozgatás + + + + Paste %n action(s) + + %n tevékenység beillesztése + + + + + Paste %n widget(s) + + %n widget beillesztése + + + + + Paste (%1 widgets, %2 actions) + Beillesztés (%1 widget-ek, %2 tevékenységek) + + + + Cannot paste widgets. Designer could not find a container without a layout to paste into. + Nem lehet beilleszteni a widget-eket. A Designer nem talált egy tárolót sem elrendezés nélküli beillesztéshez. + + + + Break the layout of the container you want to paste into, select this container and then paste again. + A tároló elrendezésének megtörése, ahová be akarja illeszteni, válassza ki ezt a tárolót és aztán illessze e újra. + + + + Paste error + Beillesztési hiba + + + + Raise widgets + Widget-ek növelése + + + + Lower widgets + Alsó widget-ek + + + + Select Ancestor + Ős kiválasztása + + + + Lay out + Elrendezés + + + + + Drop widget + Widget ejtése + + + + A QMainWindow-based form does not contain a central widget. + Egy QMainWindow alapú űrlap nem tartalmaz egy központi widget-et. + + + + qdesigner_internal::FormWindowBase + + + Delete '%1' + '%1' törlése + + + + Delete + Törlés + + + + qdesigner_internal::FormWindowManager + + + Cu&t + &Kivágás + + + + Cuts the selected widgets and puts them on the clipboard + A kiválaszott widget-ek kivágása és vágólapra helyezése + + + + &Copy + &Másolás + + + + Copies the selected widgets to the clipboard + A kiválasztott widget-ek vágólapra másolása + + + + &Paste + &Beillesztés + + + + Pastes the clipboard's contents + A vágólap tartalmának beillesztése + + + + &Delete + &Törlés + + + + Deletes the selected widgets + A kiválasztott widget-ek törlése + + + + Select &All + Az &összes kiválasztása + + + + Selects all widgets + Az összes widget kiválasztása + + + + Bring to &Front + &Előre hozás + + + + + Raises the selected widgets + A kiválaszott widget-ek növelése + + + + Send to &Back + &Visszaküldés + + + + + Lowers the selected widgets + Alsó kiválasztott widget-ek + + + + Adjust &Size + &Méret igazítása + + + + Adjusts the size of the selected widget + A kiválasztott widget méretének igazítása + + + + Lay Out &Horizontally + Elrendezés &Horizontálisan + + + + Lays out the selected widgets horizontally + A kiválaszott widget-ek horizontális elrendezése + + + + Lay Out &Vertically + Elrendezés &vertikálisan + + + + Lays out the selected widgets vertically + A kiválaszott widget-ek vertikális elrendezése + + + + Lay Out in a &Form Layout + Elrendezés egy &Űrlap elrendezésben + + + + Lays out the selected widgets in a form layout + A kiválaszott widget-ek elrendezése egy űrlap elrendezésben + + + + Lay Out in a &Grid + Elrendezés egy &rácsban + + + + Lays out the selected widgets in a grid + A kiválasztott widget-ek elrendezése egy rácsban + + + + Lay Out Horizontally in S&plitter + Elrendezés Horizontálisan a &csúszkában + + + + Lays out the selected widgets horizontally in a splitter + A kiválasztott widget-ek horizontális elrendezése egy csúszkában + + + + Lay Out Vertically in Sp&litter + Elrendezés vertikálisan egy &csúszkában + + + + Lays out the selected widgets vertically in a splitter + A kiválaszott widget-ek vertikális elrendezése egy csúszkában + + + + &Break Layout + Elrendezés &törése + + + + Breaks the selected layout + A kiválaszott elrendezés törése + + + + Si&mplify Grid Layout + Egy&szerűsített rács elrendezés + + + + Removes empty columns and rows + Üres oszlopok és sorok eltávolítása + + + + &Preview... + &Előnézet... + + + + Preview current form + Aktuális űrlap előnézet + + + + Form &Settings... + Űrlap &beállítások... + + + + Break Layout + Elrendezés törése + + + + Adjust Size + Méret igazítása + + + + Could not create form preview + Title of warning message box + Nem sikerült létrehozni az űrlap előnézetet + + + + Form Settings - %1 + Űrlap beállítások - %1 + + + + qdesigner_internal::FormWindowSettings + + + None + Semmi + + + + Device Profile: %1 + Eszköz profil: %1 + + + + qdesigner_internal::GridPanel + + + Form + Űrlap + + + + Grid + Rács + + + + Visible + Látható + + + + Grid &X + Rács &X + + + + + Snap + Bepattintás + + + + Reset + Újraindítás + + + + Grid &Y + Rács &Y + + + + qdesigner_internal::GroupBoxTaskMenu + + + Change title... + Cím változtatása... + + + + qdesigner_internal::HtmlTextEdit + + + Insert HTML entity + HTML entitás beszúrása + + + + qdesigner_internal::IconSelector + + + The pixmap file '%1' cannot be read. + A(z) '%1' pixmap fájlt nem lehet olvasni. + + + + The file '%1' does not appear to be a valid pixmap file: %2 + A(z) '%1' fájlt nem egy érvényes pixmap fájl: %2 + + + + The file '%1' could not be read: %2 + A(z) '%1' fájlt nem sikerült olvasni: %2 + + + + Choose a Pixmap + Egy pixmap kiválasztása + + + + Pixmap Read Error + Pixmap olvasási hiba + + + + ... + ... + + + + Normal Off + Normál ki + + + + Normal On + Normál be + + + + Disabled Off + Tiltás ki + + + + Disabled On + Tiltás be + + + + Active Off + Aktív ki + + + + Active On + Aktív be + + + + Selected Off + Kiválaszott ki + + + + Selected On + Kiválaszott be + + + + Choose Resource... + Erőforrás kiválasztása... + + + + Choose File... + Fájl kiválasztása... + + + + Reset + Újraindítás + + + + Reset All + Az összes újraindítása + + + + qdesigner_internal::ItemListEditor + + + Properties &<< + Tulajdonságok &<< + + + + + Properties &>> + Tulajdonságok &>> + + + + Items List + Elem lista + + + + New Item + Új elem + + + + &New + &Új + + + + Delete Item + Elem törlése + + + + &Delete + &Törlés + + + + Move Item Up + Elem mozgatása felfelé + + + + U + U + + + + Move Item Down + Elem mozgatása lefelé + + + + D + D + + + + qdesigner_internal::LabelTaskMenu + + + Change rich text... + Gazdag szöveg választása... + + + + Change plain text... + Egyszerű szöveg választása... + + + + qdesigner_internal::LanguageResourceDialog + + + Choose Resource + Erőforrás kiválasztása + + + + qdesigner_internal::LineEditTaskMenu + + + Change text... + Szöveg kiválasztása... + + + + qdesigner_internal::ListWidgetEditor + + + New Item + Új elem + + + + Edit List Widget + Widget szerkesztési lista + + + + Edit Combobox + Combobox szerkesztése + + + + qdesigner_internal::ListWidgetTaskMenu + + + Edit Items... + Elemek szerkesztése... + + + + Change List Contents + Tartalom változtatási lista + + + + qdesigner_internal::MdiContainerWidgetTaskMenu + + + Next Subwindow + Új alablak + + + + Previous Subwindow + Előző alablak + + + + Tile + Cserép + + + + Cascade + Kaszkád + + + + qdesigner_internal::MenuTaskMenu + + + Remove + Eltávolítás + + + + qdesigner_internal::MorphMenu + + + Morph into + Morph into + + + + qdesigner_internal::NewActionDialog + + + New Action... + Új tevékenység... + + + + &Text: + &Szöveg: + + + + Object &name: + Objektum &név: + + + + &Icon: + &Ikon: + + + + Shortcut: + Rövidebb út: + + + + Checkable: + Ellenőrizhető: + + + + ToolTip: + Eszköz tipp: + + + + + ... + ... + + + + qdesigner_internal::NewDynamicPropertyDialog + + + Set Property Name + Tulajdonság nevének beállítása + + + + The current object already has a property named '%1'. +Please select another, unique one. + Az aktuális objektumnak már van egy '%1' nevű tulajdonsága. +Kérem válasszon másikat, egy egyedülállót. + + + + The '_q_' prefix is reserved for the Qt library. +Please select another name. + Az '_q_' előtag foglalt a Qt könyvtárhoz. +Kérem válasszon másikat. + + + + Create Dynamic Property + Dinamikus tulajdonság létrehozása + + + + Property Name + Tulajdonság Neve + + + + horizontalSpacer + horizontálisTávtartó + + + + Property Type + Tulajdonság Típusa + + + + qdesigner_internal::NewFormWidget + + + Default size + Alapértelmezett méret + + + + QVGA portrait (240x320) + QVGA portré (240x320) + + + + QVGA landscape (320x240) + QVGA tájkép (320x240) + + + + VGA portrait (480x640) + VGA portré (480x640) + + + + VGA landscape (640x480) + VGA tájkép: (640x480) + + + + Widgets + New Form Dialog Categories + Widget-ek + + + + Custom Widgets + Egyéni Widget-ek + + + + None + Semmi + + + + Error loading form + Hiba történt az űrlap betöltése közben + + + + Unable to open the form template file '%1': %2 + Nem lehet megnyitni a(z) '%1' űrlap sablon fájlt: %2 + + + + Internal error: No template selected. + Belső hiba: Nincsen sablon kiválasztva. + + + + 0 + 0 + + + + Choose a template for a preview + Válasszon egy sablont egy előnézetre + + + + Embedded Design + Beágyazott tervezés + + + + Device: + Eszköz: + + + + Screen Size: + Képernyő méret: + + + + qdesigner_internal::NewPromotedClassPanel + + + Add + Hozzáadás + + + + New Promoted Class + Új támogatott osztály + + + + Base class name: + Alap osztály név: + + + + Promoted class name: + Támogatott osztály neve: + + + + Header file: + Fejállomány: + + + + Global include + Globális include + + + + Reset + Újraindítás + + + + qdesigner_internal::ObjectInspector + + + &Find in Text... + &Keresés a szövegben... + + + + qdesigner_internal::ObjectInspector::ObjectInspectorPrivate + + + Change Current Page + Aktuális lap megváltoztatása + + + + qdesigner_internal::OrderDialog + + + Index %1 (%2) + Index %1 (%2) + + + + %1 %2 + %1 %2 + + + + Change Page Order + Lap sorrend megváltoztatása + + + + Page Order + Lap sorrend + + + + Move page up + Lap mozgatása felfelé + + + + Move page down + Lap mozgatása lefelé + + + + qdesigner_internal::PaletteEditor + + + Edit Palette + Paletta szerkesztése + + + + Tune Palette + Paletta finomhangolása + + + + Show Details + Részletek megjelenítése + + + + Compute Details + Számítási részletek + + + + Quick + Gyors + + + + Preview + Előnézet + + + + Disabled + Tiltott + + + + Inactive + Inaktív + + + + Active + Aktív + + + + qdesigner_internal::PaletteEditorButton + + + Change Palette + Paletta megváltoztatása + + + + qdesigner_internal::PaletteModel + + + Color Role + Szín szabály + + + + Active + Aktív + + + + Inactive + Inaktív + + + + Disabled + Tiltott + + + + qdesigner_internal::PixmapEditor + + + Choose Resource... + Erőforrás kiválasztása... + + + + Choose File... + Fájl kiválasztása... + + + + Copy Path + Útvonal kiválasztása + + + + Paste Path + Útvonal beillesztése + + + + + ... + ... + + + + qdesigner_internal::PlainTextEditorDialog + + + Edit text + Szöveg szerkesztése + + + + qdesigner_internal::PluginDialog + + + Components + Komponensek + + + + Plugin Information + Beépülő modul információ + + + + Refresh + Felfrissítés + + + + Scan for newly installed custom widget plugins. + Újonnan telepített egyéni widget beépülő modulok letapogatása. + + + + Qt Designer couldn't find any plugins + Qt Designer nem talált egyetlen beépülő modult sem + + + + Qt Designer found the following plugins + Qt Designer a következő beépülő modulokat találta + + + + New custom widget plugins have been found. + Új egyéni widget betöltő modul talált. + + + + qdesigner_internal::PreviewActionGroup + + + %1 Style + %1 Stílus + + + + qdesigner_internal::PreviewConfigurationWidget + + + Default + Alapértelmezett + + + + None + Semmi + + + + Browse... + Böngészés... + + + + qdesigner_internal::PreviewConfigurationWidget::PreviewConfigurationWidgetPrivate + + + Load Custom Device Skin + Egyéni eszköz szkin betöltése + + + + All QVFB Skins (*.%1) + Az összes QVFB szkin (*.%1) + + + + %1 - Duplicate Skin + %1 - Duplikált szkin + + + + The skin '%1' already exists. + A(z) '%1' szkin már létezik. + + + + %1 - Error + %1 - Hiba + + + + %1 is not a valid skin directory: +%2 + %1 nem egy érvényes szkin könyvtár: +%2 + + + + qdesigner_internal::PreviewDeviceSkin + + + &Portrait + + + + + Landscape (&CCW) + Rotate form preview counter-clockwise + + + + + &Landscape (CW) + Rotate form preview clockwise + + + + + &Close + &Bezárás + + + + qdesigner_internal::PreviewManager + + + %1 - [Preview] + + + + + qdesigner_internal::PreviewMdiArea + + + The moose in the noose +ate the goose who was loose. + Palette editor background + + + + + qdesigner_internal::PreviewWidget + + + Preview Window + + + + + LineEdit + + + + + ComboBox + + + + + PushButton + + + + + ButtonGroup2 + + + + + CheckBox1 + + + + + CheckBox2 + + + + + ButtonGroup + + + + + RadioButton1 + + + + + RadioButton2 + + + + + RadioButton3 + + + + + qdesigner_internal::PromotionModel + + + Name + + + + + Header file + + + + + Global include + + + + + Usage + + + + + qdesigner_internal::PromotionTaskMenu + + + Promoted widgets... + + + + + Promote to ... + + + + + Change signals/slots... + + + + + Promote to + + + + + Demote to %1 + + + + + qdesigner_internal::PropertyEditor + + + Add Dynamic Property... + + + + + Remove Dynamic Property + + + + + Sorting + + + + + Color Groups + + + + + Tree View + + + + + Drop Down Button View + + + + + String... + + + + + Bool... + + + + + Other... + + + + + Configure Property Editor + + + + + Object: %1 +Class: %2 + + + + + qdesigner_internal::PropertyLineEdit + + + Insert line break + + + + + qdesigner_internal::QDesignerPromotionDialog + + + Promoted Widgets + + + + + Promoted Classes + + + + + Promote + + + + + Change signals/slots... + + + + + %1 - Error + + + + + qdesigner_internal::QDesignerResource + + + Loading qrc file + + + + + The specified qrc file <p><b>%1</b></p><p>could not be found. Do you want to update the file location?</p> + + + + + New location for %1 + + + + + Resource files (*.qrc) + + + + + qdesigner_internal::QDesignerTaskMenu + + + Change objectName... + + + + + Change toolTip... + + + + + Change whatsThis... + + + + + Change styleSheet... + + + + + Create Menu Bar + + + + + Add Tool Bar + + + + + Create Status Bar + + + + + Remove Status Bar + + + + + Change script... + + + + + Change signals/slots... + + + + + Go to slot... + + + + + Size Constraints + + + + + Set Minimum Width + + + + + Set Minimum Height + + + + + Set Minimum Size + + + + + Set Maximum Width + + + + + Set Maximum Height + + + + + Set Maximum Size + + + + + Edit ToolTip + + + + + Edit WhatsThis + + + + + no signals available + + + + + Set size constraint on %n widget(s) + + + + + + + qdesigner_internal::QDesignerWidgetBox + + + + Unexpected element <%1> + + + + + A parse error occurred at line %1, column %2 of the XML code specified for the widget %3: %4 +%5 + + + + + The XML code specified for the widget %1 does not contain any widget elements. +%2 + + + + + An error has been encountered at line %1 of %2: %3 + + + + + Unexpected element <%1> encountered when parsing for <widget> or <ui> + + + + + Unexpected end of file encountered when parsing widgets. + + + + + A widget element could not be found. + + + + + qdesigner_internal::QtGradientStopsController + + + H + + + + + S + + + + + V + + + + + + Hue + + + + + Sat + + + + + Val + + + + + Saturation + + + + + Value + + + + + R + + + + + G + + + + + B + + + + + Red + + + + + Green + + + + + Blue + + + + + qdesigner_internal::RichTextEditorDialog + + + Edit text + + + + + Rich Text + + + + + Source + + + + + &OK + + + + + &Cancel + + + + + qdesigner_internal::RichTextEditorToolBar + + + Bold + + + + + CTRL+B + + + + + Italic + + + + + CTRL+I + + + + + Underline + + + + + CTRL+U + + + + + Left Align + + + + + Center + + + + + Right Align + + + + + Justify + + + + + Superscript + + + + + Subscript + + + + + Insert &Link + + + + + Insert &Image + + + + + qdesigner_internal::ScriptDialog + + + Edit script + + + + + <html>Enter a Qt Script snippet to be executed while loading the form.<br>The widget and its children are accessible via the variables <i>widget</i> and <i>childWidgets</i>, respectively. + + + + + Syntax error + + + + + qdesigner_internal::ScriptErrorDialog + + + Script errors + + + + + qdesigner_internal::SignalSlotDialog + + + There is already a slot with the signature '%1'. + + + + + There is already a signal with the signature '%1'. + + + + + %1 - Duplicate Signature + + + + + + Signals/Slots of %1 + + + + + qdesigner_internal::SignalSlotEditorPlugin + + + Edit Signals/Slots + + + + + F4 + + + + + qdesigner_internal::SignalSlotEditorTool + + + Edit Signals/Slots + + + + + qdesigner_internal::StatusBarTaskMenu + + + Remove + + + + + qdesigner_internal::StringListEditorButton + + + Change String List + + + + + qdesigner_internal::StyleSheetEditorDialog + + + + Valid Style Sheet + + + + + Add Resource... + + + + + Add Gradient... + + + + + Add Color... + + + + + Add Font... + + + + + Edit Style Sheet + + + + + Invalid Style Sheet + + + + + qdesigner_internal::TabOrderEditor + + + Start from Here + + + + + Restart + + + + + Tab Order List... + + + + + Tab Order List + + + + + Tab Order + + + + + qdesigner_internal::TabOrderEditorPlugin + + + Edit Tab Order + + + + + qdesigner_internal::TabOrderEditorTool + + + Edit Tab Order + + + + + qdesigner_internal::TableWidgetEditor + + + + Properties &>> + + + + + Edit Table Widget + + + + + &Items + + + + + Table Items + + + + + New Column + + + + + New Row + + + + + &Columns + + + + + &Rows + + + + + Properties &<< + + + + + qdesigner_internal::TableWidgetTaskMenu + + + Edit Items... + + + + + qdesigner_internal::TemplateOptionsWidget + + + Pick a directory to save templates in + + + + + Form + + + + + Additional Template Paths + + + + + + ... + + + + + qdesigner_internal::TextEditTaskMenu + + + Edit HTML + + + + + Change HTML... + + + + + Edit Text + + + + + Change Plain Text... + + + + + qdesigner_internal::TextEditor + + + Choose Resource... + + + + + Choose File... + + + + + ... + + + + + Choose a File + + + + + qdesigner_internal::ToolBarEventFilter + + + Insert Separator before '%1' + + + + + Append Separator + + + + + Remove action '%1' + + + + + Remove Toolbar '%1' + + + + + Insert Separator + + + + + qdesigner_internal::TreeWidgetEditor + + + New Column + + + + + &Columns + + + + + Per column properties + + + + + Common properties + + + + + + New Item + + + + + + New Subitem + + + + + Properties &<< + + + + + + Properties &>> + + + + + Edit Tree Widget + + + + + &Items + + + + + Tree Items + + + + + 1 + + + + + &New + + + + + New &Subitem + + + + + Delete Item + + + + + &Delete + + + + + Move Item Left (before Parent Item) + + + + + L + + + + + Move Item Right (as a First Subitem of the Next Sibling Item) + + + + + R + + + + + Move Item Up + + + + + U + + + + + Move Item Down + + + + + D + + + + + qdesigner_internal::TreeWidgetTaskMenu + + + Edit Items... + + + + + qdesigner_internal::WidgetBox + + + Warning: Widget creation failed in the widget box. This could be caused by invalid custom widget XML. + + + + + qdesigner_internal::WidgetBoxTreeWidget + + + Scratchpad + + + + + Custom Widgets + + + + + Expand all + + + + + Collapse all + + + + + List View + + + + + Icon View + + + + + Remove + + + + + Edit name + + + + + qdesigner_internal::WidgetDataBase + + + A custom widget plugin whose class name (%1) matches that of an existing class has been found. + + + + + qdesigner_internal::WidgetEditorTool + + + Edit Widgets + + + + + qdesigner_internal::WidgetFactory + + + The custom widget factory registered for widgets of class %1 returned 0. + + + + + A class name mismatch occurred when creating a widget using the custom widget factory registered for widgets of class %1. It returned a widget of class %2. + + + + + %1 Widget + + + + + The current page of the container '%1' (%2) could not be determined while creating a layout.This indicates an inconsistency in the ui-file, probably a layout being constructed on a container widget. + + + + + Attempt to add a layout to a widget '%1' (%2) which already has an unmanaged layout of type %3. +This indicates an inconsistency in the ui-file. + + + + + Cannot create style '%1'. + + + + + qdesigner_internal::WizardContainerWidgetTaskMenu + + + Next + + + + + Back + + + + + qdesigner_internal::ZoomMenu + + + %1 % + Zoom factor + + + + + qdesigner_internal::ZoomablePreviewDeviceSkin + + + &Zoom + + + + diff --git a/tools/designer/translations/translations.pro b/tools/designer/translations/translations.pro index 03c1415..279b322 100644 --- a/tools/designer/translations/translations.pro +++ b/tools/designer/translations/translations.pro @@ -131,6 +131,7 @@ TR_DIR = $$PWD/../../../translations TRANSLATIONS = \ $$TR_DIR/designer_de.ts \ $$TR_DIR/designer_fr.ts \ + $$TR_DIR/designer_hu.ts \ $$TR_DIR/designer_ja.ts \ $$TR_DIR/designer_pl.ts \ $$TR_DIR/designer_ru.ts \ -- cgit v0.12 From b7d8493e73fd76f079400a592b621fb6acf35116 Mon Sep 17 00:00:00 2001 From: Laszlo Papp Date: Wed, 3 Feb 2010 11:10:42 +0100 Subject: Add Linguist hungarian translation Signed-off-by: Laszlo Papp Reviewed-by: Benjamin Poulain --- linguist_hu.ts | 2014 ++++++++++++++++++++++++++++++++++ tools/linguist/linguist/linguist.pro | 7 +- 2 files changed, 2018 insertions(+), 3 deletions(-) create mode 100644 linguist_hu.ts diff --git a/linguist_hu.ts b/linguist_hu.ts new file mode 100644 index 0000000..aaff893 --- /dev/null +++ b/linguist_hu.ts @@ -0,0 +1,2014 @@ + + + + + AboutDialog + + + Qt Linguist + Qt Linguist + + + + BatchTranslationDialog + + + Batch Translation of '%1' - Qt Linguist + '%1' Qt Linguist egy adat fordítása + + + + Searching, please wait... + Keresés, kérem várjon... + + + + &Cancel + &Mégse + + + + Linguist batch translator + Linguist köteg fordító + + + + Batch translated %n entries + + %n adat belépés lefordítva + + + + + Qt Linguist - Batch Translation + Qt Linguist adat fordítás + + + + Options + Opciók + + + + Set translated entries to finished + Lefordított bevitelek befejezettre állítása + + + + Retranslate entries with existing translation + Bevitelek újrafordítása létező fordításokkal + + + + Translate also finished entries + Befejezett belépéseknek is a lefordítása + + + + Phrase book preference + Fázis könyv beállítások + + + + Move up + Felfelé mozgatás + + + + Move down + Lefelé mozgatás + + + + &Run + &Futtatás + + + + Cancel + Mégse + + + + Note that the modified entries will be reset to unfinished if 'Set translated entries to finished' above is unchecked + Ne felejtse el, hogy a módosított belépések újra lesznek indítva befejezetlenre, ha a 'lefordított bevitelek befejezettre állítása' felül meg van jelölve + + + + The batch translator will search through the selected phrase books in the order given above + A köteg fordító a kiválasztott fázis könyvek között fog keresni, a fent megadott sorrendben + + + + DataModel + + + <qt>Duplicate messages found in '%1': + <qt>Dupliált üzenetek találhatóak a(z) '%1'-ben: + + + + + <p>[more duplicates omitted] + <p>[többi duplikáció kihagyása] + + + + <p>* ID: %1 + <p>* Azonosító: %1 + + + + <p>* Context: %1<br>* Source: %2 + <p>* Szövegösszefüggés: %1<br>* Forrás: %2 + + + + <br>* Comment: %3 + <br>* Megjegyzés: %3 + + + + Linguist does not know the plural rules for '%1'. +Will assume a single universal form. + A Linguist nem ismeri a többes számú szabályokat a '%1'-re. Egy egyszerű univerzális formát fog feltételezni. + + + + Cannot create '%2': %1 + Nem lehet létrehozni '%2': %1 + + + + Universal Form + Univerzális forma + + + + ErrorsView + + + Accelerator possibly superfluous in translation. + A gyorsítás valószínűleg nélkülözhető a fordításban. + + + + Accelerator possibly missing in translation. + A gyorsítás valószínűleg hiányzik a fordításban. + + + + Translation does not end with the same punctuation as the source text. + A fordítás nem ugyanazzal az írásjellel végződik, mint a forrás szöveg. + + + + A phrase book suggestion for '%1' was ignored. + A(z) '%1'-re tett fáziskönyv ajánlat mellőzve lett. + + + + Translation does not refer to the same place markers as in the source text. + Nem ugyanazok a hely megjelölők találhatóak a fordításban, mint a forrás szövegben. + + + + Translation does not contain the necessary %n place marker. + A fordítás nem tartalmazza a szükséges %n hely megjelölőket. + + + + Unknown error + Ismeretlen hiba + + + + FindDialog + + + This window allows you to search for some text in the translation source file. + Ez az ablak engedélyezi, hogy szöveget keresses a fordítás forrás fájlban. + + + + Type in the text to search for. + Gépelje be szövegbe, amit keres.. + + + + Options + Opciók + + + + Source texts are searched when checked. + Forrás szövegek keresési ellenőrzéskor. + + + + Translations are searched when checked. + Fordítások keresése ellenőrzéskor. + + + + Texts such as 'TeX' and 'tex' are considered as different when checked. + 'TeX' és 'tex' szövegek különbözőként kezelése bejelöléskor. + + + + Comments and contexts are searched when checked. + Megjegyzések és tartalmak keresése bejelöléskor. + + + + Find + Keresés + + + + + &Find what: + Ennek &keresése: + + + + &Source texts + &Forrás szövegek + + + + &Translations + &Fordítások + + + + &Match case + &Egyezés + + + + &Comments + &Kommentek + + + + Ignore &accelerators + &Gyorsítások mellőzése + + + + Click here to find the next occurrence of the text you typed in. + Kattintson ide a begépelt szöveg következő előfordulásának megkereséséhez. + + + + Find Next + Következő keresése + + + + Click here to close this window. + Kattintson ide az ablak bezárásához. + + + + Cancel + Mégse + + + + + Choose Edit|Find from the menu bar or press Ctrl+F to pop up the Find dialog + Válassza ki a Szerkesztés/Keresés opciót a menüből vagy nyomja le a Ctrl+F billentyűket a keresési párbeszédablak felugrásához + + + + + FormMultiWidget + + + Alt+Delete + translate, but don't change + fordítsd, de ne változtasd + ALT+Delete + + + + Shift+Alt+Insert + translate, but don't change + Fordítsd, de ne változtasd. + Shift+Alt+Insert + + + + Alt+Insert + translate, but don't change + Alt+Insert + + + + Confirmation - Qt Linguist + Megerősítés - Qt Linguist + + + + Delete non-empty length variant? + Törölje az 0 hosszúságú változatok? + + + + LRelease + + + Dropped %n message(s) which had no ID. + + %n üzenez eldobva, melyek nem rendelkeztek azonosítóval. + + + + + Excess context/disambiguation dropped from %n message(s). + + Fölösleges szövegösszefüggés/egyértelműsítés törlése %n üzenetből. + + + + + Generated %n translation(s) (%1 finished and %2 unfinished) + + + %n fordítás legenerálása (%1 befejezett és %2 befejezetlen) + + + + + Ignored %n untranslated source text(s) + + + %n lefordítatlan forrás szöveg mellőzése + + + + + MainWindow + + + MainWindow + FőAblak + + + + &Phrases + &Fázisok + + + + &Close Phrase Book + &Fázis könyvek bezárása + + + + &Edit Phrase Book + Fázis könyvek &szerkesztése + + + + &Print Phrase Book + &Fázis könyvek nyomtatása + + + + V&alidation + &Érvényesítés + + + + &View + &Nézet + + + + Vie&ws + &Nézetek + + + + &Toolbars + &Eszköztár + + + + &Help + &Súgó + + + + &Translation + &Fordítások + + + + &File + &Fájl + + + + &Edit + &Szerkesztés + + + + &Open... + &Megnyitás... + + + + Open a Qt translation source file (TS file) for editing + Egy Qt fordítási forrás fájl (TS fájl) megnyitása szerkesztésre + + + + Ctrl+O + Ctrl+O + + + + E&xit + &Kilépés + + + + Close this window and exit. + Ablak bezárása és kilépés. + + + + Ctrl+Q + Ctrl+Q + + + + + &Save + &Mentés + + + + Save changes made to this Qt translation source file + Változtatások elmentése a Qt fordítási forrás fájlban + + + + Move to the previous unfinished item. + Az előző befejezetlen elemre mozgatás. + + + + Move to the next unfinished item. + A következő befejezetlen elemre mozgatás. + + + + Move to the previous item. + Az előző elemre mozgatás. + + + + Move to the next item. + A következő elemre mozgatás. + + + + Mark this item as done and move to the next unfinished item. + Az elem készre jelölése és a következő befejezetlen elemre mozgás. + + + + Copy from source text + Másolás forrás szövegből + + + + Toggle the validity check of accelerators, i.e. whether the number of ampersands in the source and translation text is the same. If the check fails, a message is shown in the warnings window. + Gyorsítások érvényesség ellenőrzésének kapcsolgatása, lásd vajon az et jelek száma megegyezik-e a a forrás és lefordított szövegben. Ha ez az ellenőrzés hibásan zárul le, a figyelmeztető ablakban egy üzenet tűnik fel. + + + + Toggle the validity check of ending punctuation. If the check fails, a message is shown in the warnings window. + A végződő írásjelek érvényesség ellenőrzésének kapcsolgatása. Ha ez az ellenőrzés nem sikerült, akkor egy üzenet bukkan fel a figyelmeztető ablakban. + + + + Toggle checking that phrase suggestions are used. If the check fails, a message is shown in the warnings window. + Fázis ajánlások ellenőrzésének kapcsolgatása. Ha az ellenőrzés sikertelen, akkor egy üzenet bukkan fel a figyelmeztető ablakban. + + + + Toggle the validity check of place markers, i.e. whether %1, %2, ... are used consistently in the source text and translation text. If the check fails, a message is shown in the warnings window. + A hely megjelelölők érvényesség ellenőrzésének kapcsolgatása, lásd vajon a(z) %1, %2.. következetesen vannak-e használva a forrás és lefordított szövegben. Ha az ellenőrzés sikertelen, egy üzenet bukkan fel a figyelmeztető ablakban. + + + + Open Read-O&nly... + &Csak olvasható megnyitása... + + + + &Save All + Az összes &mentése + + + + Ctrl+S + Ctrl+S + + + + + + Save &As... + &Másként mentés... + + + + Save As... + Másként mentés... + + + + Save changes made to this Qt translation source file into a new file. + A változtatások egy új fájlba mentése, amik ebben a Qt fordítási forrás fájlban keletkeztek. + + + + &Release + &Kiadás + + + + Create a Qt message file suitable for released applications from the current message file. + Qt üzenez fájl létrehozása az aktuális üzenet fájlból, ami alkalmas a kiadásra. + + + + &Print... + &Nyomtatás... + + + + Ctrl+P + Ctrl+P + + + + &Undo + &Visszacsinálás + + + + Recently Opened &Files + &Utoljára megnyitott &fájlok + + + + Save + Mentés + + + + Print a list of all the translation units in the current translation source file. + Az összes fordítási egység kinyomtatása az aktuális fordítási forrás fájlban. + + + + Undo the last editing operation performed on the current translation. + Az utoljára szerkesztett művelet visszavonása az aktuális fordításon. + + + + Ctrl+Z + Ctrl+Z + + + + &Redo + &Helyreállítás + + + + Redo an undone editing operation performed on the translation. + Szerkesztő művelet helyreállítása és visszavonása, ami az aktuális fordításon lett végrehajtva. + + + + Ctrl+Y + Ctrl+Y + + + + Cu&t + &Kivágás + + + + Copy the selected translation text to the clipboard and deletes it. + A kiválasztott fordítási szöveg vágólapra másolása és törlése. + + + + Ctrl+X + Ctrl+X + + + + &Copy + &Másolás + + + + Copy the selected translation text to the clipboard. + A kiválaszott fordítási szöveg vágólapra másolása. + + + + Ctrl+C + Ctrl+C + + + + &Paste + &Beillesztés + + + + Paste the clipboard text into the translation. + A vágólapon levő szöveg fordításba illesztése. + + + + Ctrl+V + Ctrl+V + + + + Select &All + Az &összes kiválasztása + + + + Select the whole translation text. + Az egész fordítási szöveg kiválasztása. + + + + Ctrl+A + Ctrl+A + + + + &Find... + &Keresés... + + + + Search for some text in the translation source file. + Néhány szövegre keresés a fordítási forrás fájlban. + + + + Ctrl+F + Ctrl+F + + + + Find &Next + &Következő keresése + + + + Continue the search where it was left. + A keresés folytatása ott, ahol abba lett hagyva. + + + + F3 + F3 + + + + &Prev Unfinished + Az &előző befejezetlen + + + + Close + Bezárás + + + + &Close All + Az összes &bezárása + + + + Ctrl+W + Ctrl+W + + + + Ctrl+K + Ctrl+K + + + + &Next Unfinished + &Következő befejezetlen + + + + P&rev + &Előző + + + + Ctrl+Shift+K + Ctrl+Shift+K + + + + Ne&xt + &Következő + + + + &Done and Next + &Kész és Következő + + + + Copies the source text into the translation field. + Forrás szövegek fordítási mezőbe másolása. + + + + Ctrl+B + Ctrl+B + + + + &Accelerators + &Gyorsítások + + + + &Ending Punctuation + &Vég írásjelek + + + + &Phrase matches + &Fázis egyezés + + + + Place &Marker Matches + Hely &megjelölők egyezései + + + + &New Phrase Book... + &Új fázis könyv... + + + + Create a new phrase book. + Egy új fázis könyv létrehozása. + + + + Ctrl+N + Ctrl+N + + + + &Open Phrase Book... + Fázis könyv &megnyitása... + + + + Open a phrase book to assist translation. + Fáris könyv megnyitása a fordítás támogatásával. + + + + Ctrl+H + Ctrl+H + + + + &Reset Sorting + &Rendezés helyreállítása + + + + Sort the items back in the same order as in the message file. + Az elemek visszarendezése ugyanabba a sorrendben, ahogy az üzenet fájlban található. + + + + &Display guesses + Feltételezések &kijelzése + + + + Set whether or not to display translation guesses. + Annak beállítása, hogy vajon kijelezze a fordítási feltételezéseket vagy sem. + + + + &Statistics + &Statisztikák + + + + Display translation statistics. + Fordítási statisztikák kijelzése. + + + + &Manual + &Kézi + + + + F1 + F1 + + + + About Qt Linguist + Qt Linguist-ról + + + + About Qt + Qt-ról + + + + Display information about the Qt toolkit by Trolltech. + Információ megjelenítése a Trolltech Qt eszközrendszeréről. + + + + &What's This? + &Mi ez? + + + + What's This? + Mi ez? + + + + Enter What's This? mode. + Mi ez? beviteli mód. + + + + Shift+F1 + Shift+F1 + + + + &Search And Translate... + &Keresés és fordítás... + + + + Replace the translation on all entries that matches the search source text. + A fordítások kicserélése az összes olyan helyen, ahol az megegyezik a keresett forrás szöveggel. + + + + + &Batch Translation... + &Köteg fordítás... + + + + Batch translate all entries using the information in the phrase books. + Köteg fordítás mindenhol, ahol az információ a fázis könyvekben van haszálva. + + + + + + Release As... + Kiadás, mint... + + + + + This is the application's main window. + Ez az alkalmazás fő ablaka. + + + + + Source text + Forrás szöveg + + + + + Index + Index + + + + + Context + Összefüggés + + + + Items + Elemek + + + + This panel lists the source contexts. + Ez a panel kilistázza a forrás összefüggéseket. + + + + Strings + Sztringek + + + + Phrases and guesses + Kommunikációk és feltételezések + + + + Sources and Forms + Források és formák + + + + Warnings + Figyelmeztetések + + + + MOD + status bar: file(s) modified + MOD + + + + Loading... + Betöltés... + + + + + Loading File - Qt Linguist + Fájl betöltése - Qt Linguist + + + + The file '%1' does not seem to be related to the currently open file(s) '%2'. + +Close the open file(s) first? + A(z) '%1' fájl nem tartozik hozzá egyetlen aktuálisan megnyitott '%2' fájlhoz sem. + +Bezárja először a megnyitott fájl(oka)t? + + + + The file '%1' does not seem to be related to the file '%2' which is being loaded as well. + +Skip loading the first named file? + A(z) '%1' fájl nem tartozik egyetlen '%2' fájlhoz sem, amelyik ugyanúgy be lett töltve. + +Azt első megnevezett fájl betöltésének kihagyása? + + + + %n translation unit(s) loaded. + + %n fordítási egység betöltése. + + + + + Related files (%1);; + Hozzákapcsolodó fájlok (%1);; + + + + Open Translation Files + Fordítási fájlok megnyitása + + + + + File saved. + Fájl elmentve. + + + + + + Release + Kiadás + + + + Qt message files for released applications (*.qm) +All files (*) + Qt üzenet fájlok a kiadott alkalmazásra (*.qm) +Az összes fájl(*) + + + + + File created. + Fál létrehozva. + + + + + Printing... + Nyomtatás... + + + + Context: %1 + Összefüggés: %1 + + + + finished + Befejezve + + + + unresolved + Nincs megoldva + + + + obsolete + Elavulás + + + + + Printing... (page %1) + Nyomtatás... (%1 lap) + + + + + Printing completed + Nyomtatás teljesítve + + + + + Printing aborted + Nyomtatás megszakítva + + + + Search wrapped. + Keresés elrejtése. + + + + + + + + + + + + + Qt Linguist + Qt Linguist + + + + + Cannot find the string '%1'. + A(z) '%1' sztring nem található. + + + + Search And Translate in '%1' - Qt Linguist + Keresés és fordítás a(z) '%1'-ben - Qt Linguist + + + + + + Translate - Qt Linguist + Qt Linguist fordítása + + + + Translated %n entry(s) + + %n bevitel lefordítva + + + + + No more occurrences of '%1'. Start over? + Nem található '%1' több előfordulása. Előlről kezdi? + + + + Create New Phrase Book + Új kommunikációs könyv létrehozása + + + + Qt phrase books (*.qph) +All files (*) + Qt kommunikációs könyv (*.qph) +Az összes fájl (*) + + + + Phrase book created. + Kommunikációs könyv létrehozva. + + + + Open Phrase Book + Kommunikációs könyv megnyitása + + + + Qt phrase books (*.qph);;All files (*) + Qt kommunikációs könyvek (*.qpm);;Az összes fájl (*) + + + + %n phrase(s) loaded. + + %n kommunikáció betöltése. + + + + + + + Add to phrase book + Kommunikációs könyv hozzáadása + + + + No appropriate phrasebook found. + Nem található megfelelő kommunikációs könyv. + + + + Adding entry to phrasebook %1 + Új elem hozzáadása a(z) %1 fázis fáziskönyvhöz + + + + Select phrase book to add to + Kommunikációs könyv kiválasztása hozzáadásra + + + + Unable to launch Qt Assistant (%1) + Nem lehet elindítani a Qt Assistant (%1) + + + + Version %1 + %1 Verzió + + + + <center><img src=":/images/splash.png"/></img><p>%1</p></center><p>Qt Linguist is a tool for adding translations to Qt applications.</p><p>Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). + <center><img src=":/images/splash.png"/></img><p>%1</p></center><p>Qt Linguist egy olyan eszköz, amelyekkel fordítások adhat hozzá a Qt alkalmazásokhoz.</p><p>Szerzői jog(C) 2010 Nokia Vállalat és/vagy leányvállalatai. + + + + Do you want to save the modified files? + El szeretné menteni a módosított fájlokat? + + + + Do you want to save '%1'? + El szeretné menteni a(z) %1-t ? + + + + Qt Linguist[*] + Qt Linguist[*] + + + + %1[*] - Qt Linguist + %1[*] - Qt Linguist + + + + + No untranslated translation units left. + Nem maradtak lefordítatlan fordítások. + + + + &Window + &Ablak + + + + Minimize + Minimalizálás + + + + Ctrl+M + Ctrl+M + + + + Display the manual for %1. + A manuál megjelenítése %1-re vonatkozóan. + + + + Display information about %1. + Információ megjelenítése a(z) %1-ről. + + + + &Save '%1' + '%1' &mentése + + + + Save '%1' &As... + '%1' &másként mentése... + + + + Release '%1' + '%1' kiadása + + + + Release '%1' As... + '%1' másként kiadása... + + + + &Close '%1' + '%1' &bezárása + + + + + &Close + &Bezárás + + + + Save All + Az összes mentése + + + + + &Release All + Az összes &kiadása + + + + Close All + Az összes bezárása + + + + Translation File &Settings for '%1'... + Fordítási fájlok &beállítása erre '%1'... + + + + &Batch Translation of '%1'... + A(z) '%1' &köteg fordítása... + + + + Search And &Translate in '%1'... + Keresés és &fordítás '%1'-ben... + + + + Search And &Translate... + Keresés és &fordítás... + + + + + File + Fájl + + + + + Edit + Szerkesztés + + + + + Translation + Fordítás + + + + + Validation + Érvényesítés + + + + + Help + Súgó + + + + Cannot read from phrase book '%1'. + Nem lehet a(z) '%1' kommunikációs könyvből olvasni. + + + + Close this phrase book. + A kommunikációs könyv bezárása. + + + + Enables you to add, modify, or delete entries in this phrase book. + Hozzáadás, módosítás, vagy törlés engedélyezése ebben a kommunikációs könyvben. + + + + Print the entries in this phrase book. + Az összes bevitel kinyomtatása ebben a társalgási szótárban. + + + + Cannot create phrase book '%1'. + Nem lehet a '%1' társalgási szótárat létrehozni. + + + + Do you want to save phrase book '%1'? + El szeretné menteni a '%1' társalgási szótárat? + + + + All + Mind + + + + Open/Refresh Form &Preview + Forma megnyitása/felfrissítése &nézet + + + + Form Preview Tool + Forma előnézeti eszköz + + + + F5 + F5 + + + + + Translation File &Settings... + Fordítási fájl &beállítások... + + + + &Add to Phrase Book + Társalgási szótárhoz &hozzáadás + + + + Ctrl+T + Ctrl+T + + + + Ctrl+J + Ctrl+J + + + + Ctrl+Shift+J + Ctrl+Shift+J + + + + Previous unfinished item + Előző befejezetlen elem + + + + Next unfinished item + Következő befejezetlen elem + + + + Move to previous item + Az előző befejezetlen elemre mozgás + + + + Next item + Következő elem + + + + Mark item as done and move to the next unfinished item + Az elem készként jelölése és a következő befejezetlen elemre mozgatás + + + + Copies the source text into the translation field + A forrás szöveg fordítási szövegbe másolása + + + + Toggle the validity check of accelerators + Gyorsítások érvényesség ellenőrzésének kapcsolgatása + + + + Toggle the validity check of ending punctuation + Vég írásjelek érvényesség ellenőrzésének kapcsolgatása + + + + Toggle checking that phrase suggestions are used + A használt társalgási ajánlások ellenőrzésének kapcsolgatása + + + + Toggle the validity check of place markers + Hely megjelölők érvényesség vizsgálatának kapcsolgatása + + + + Create a Qt message file suitable for released applications from the current message file. The filename will automatically be determined from the name of the TS file. + Egy Qt üzenet fájl létrehozása az aktuális üzenet fájlból, amely megfelelő az alkalmazás kiadásaira. A fájlnév TS fájl nevéből lesz automatikusan meghatározva. + + + + Length Variants + Hossz változatok + + + + MessageEditor + + + + This is the right panel of the main window. + Ez a fő ablak jobb panelja. + + + + + Russian + Orosz + + + + German + Német + + + + Japanese + Japán + + + + French + Francia + + + + Polish + Lengyel + + + + Chinese + Kínai + + + + This whole panel allows you to view and edit the translation of some source text. + Ez az egész pabel engedélyezi néhány forrás szöveg fordításának megtekintését és szerkesztését. + + + + Source text + Forrás szöveg + + + + This area shows the source text. + Ez a terület mutatja a forrás szöveget. + + + + Source text (Plural) + Forrás szöveg (Többesszám) + + + + This area shows the plural form of the source text. + Ez a terület mutatja a forrás szöveg többesszámú formáját. + + + + Developer comments + Fejlesztői megjegyzések + + + + This area shows a comment that may guide you, and the context in which the text occurs. + Ez a terület mutatja a megjegyzéseket, ami segítheti Önt, és az összefüggéseket, hogy melyik szövegben fordul elő. + + + + Here you can enter comments for your own use. They have no effect on the translated applications. + Itt hozzáadhatja a saját megjegyzését saját használatra. Nincsen hatásuk a lefordított alkalmazásokon. + + + + %1 translation (%2) + %1 fordítás (%2) + + + + This is where you can enter or modify the translation of the above source text. + Ez az a hely, ahol beviheti és módosíthatja a fentebb található forrás szöveg fordítását. + + + + %1 translation + %1 fordítás + + + + %1 translator comments + %1 fordító megjegyzések + + + + '%1' +Line: %2 + '%1' +Sor: %2 + + + + MessageModel + + + Completion status for %1 + %1 elkészítési státusza + + + + <file header> + <file header> + + + + <context comment> + <context comment> + + + + <unnamed context> + <unnamed context> + + + + MsgEdit + + + + This is the right panel of the main window. + Ez a fő ablak jobb panelja. + + + + + PhraseBookBox + + + + Go to Phrase > Edit Phrase Book... The dialog that pops up is a PhraseBookBox. + Társalgás -> Társalgási szótár szerkesztése... A felbukkanó ablak egy TársalgásiSzótárDoboz. + + + + + (New Entry) + (Új bevitel) + + + + %1[*] - Qt Linguist + %1[*] - Qt Linguist + + + + Qt Linguist + Qt Linguist + + + + Cannot save phrase book '%1'. + Nem lehet elmenteni a(z) '%1' társalgási szótárat. + + + + Edit Phrase Book + Társalgási szótár szerkesztése + + + + This window allows you to add, modify, or delete entries in a phrase book. + Ez az ablak engedélyezi új bevitelek hozzáadását, módosítását, vagy törlését egy társalgási szótárban. + + + + &Translation: + &Fordítás: + + + + This is the phrase in the target language corresponding to the source phrase. + Ez a forrás társalgás megfelelője a cél nyelvben. + + + + S&ource phrase: + &Forrás társalgás: + + + + This is a definition for the source phrase. + Ez egy forrás fordítás definíció. + + + + This is the phrase in the source language. + Ez egy társalgás a forrás nyelvben. + + + + &Definition: + &Definíció: + + + + Click here to add the phrase to the phrase book. + Kattintson ide a társalgás hozzáadásához a társalgási könyvben. + + + + &New Entry + &Új bevitel + + + + Click here to remove the entry from the phrase book. + Kattintson ide a bevitel társalgási könyvből való eltávolításához. + + + + &Remove Entry + Bevitel &eltávolítása + + + + Settin&gs... + &Beállítások... + + + + Click here to save the changes made. + Kattintson ide a változtatások elmentéséhez. + + + + &Save + &Mentés + + + + Click here to close this window. + Kattintson ide az ablak bezárásához. + + + + Close + Bezárás + + + + PhraseModel + + + Source phrase + Forrás társalgás + + + + Translation + Fordítás + + + + Definition + Definíció + + + + PhraseView + + + Insert + Beszúrás + + + + Edit + Szerkesztés + + + + Guess (%1) + Feltételezés (%1) + + + + Guess + Feltételezés + + + + QObject + + + Compiled Qt translations + Lefordított Qt fordítások + + + + Translation files (%1);; + Fordítási fájlok (%1);; + + + + All files (*) + Fájlok hozzáadása ( *) + + + + + + + + + + Qt Linguist + Qt Linguist + + + + GNU Gettext localization files + GNU Gettext lokalizációs fájlok + + + + Qt translation sources (format 1.1) + Qt fordítási forrása (1.1 formátum) + + + + Qt translation sources (format 2.0) + Qt fordítás források (2.0 formátum) + + + + Qt translation sources (latest format) + Qt fordítási források (legutolsó formátum) + + + + XLIFF localization files + XLIFF lokalizációs fájlok + + + + Qt Linguist 'Phrase Book' + Qt Linguist 'Társalgási Könyv' + + + + SourceCodeView + + + <i>Source code not available</i> + <i>A forrás kód nem elérhető</i> + + + + <i>File %1 not available</i> + <i>A(z) %1 fájl nem elérhető</i> + + + + <i>File %1 not readable</i> + <i>A(z) %1 fájl nem olvasható</i> + + + + Statistics + + + Statistics + Statisztikák + + + + Translation + Fordítás + + + + Source + Forrás + + + + 0 + 0 + + + + Words: + Szavak: + + + + Characters: + Karakterek: + + + + Characters (with spaces): + Karakterek (szóközökkel): + + + + Close + Bezárás + + + + TranslateDialog + + + This window allows you to search for some text in the translation source file. + Ez az ablak engedélyezi, hogy rákeressen néhány szövegre a fordítási forrás fájlban. + + + + Type in the text to search for. + Gépelje be a keresni kívánt szöveget. + + + + Find &source text: + &Forrás szöveg keresése: + + + + &Translate to: + &Fordítás erre: + + + + Search options + Keresés opciók + + + + Texts such as 'TeX' and 'tex' are considered as different when checked. + 'TeX' és 'text' szövegek különbözően kezelése bejelöléskor. + + + + Match &case + Megegyező &eset + + + + Mark new translation as &finished + Új fordítások &befejezettként jelölése + + + + Click here to find the next occurrence of the text you typed in. + Kattintson ide a begépelt szöveg következő előfordulásának megkereséséhez. + + + + Find Next + Következő keresése + + + + Translate + Fordítás + + + + Translate All + Az összes fordítása + + + + Click here to close this window. + Kattintson ide az ablak bezárásához. + + + + Cancel + Mégse + + + + TranslationSettingsDialog + + + Any Country + Bármeny ország + + + + + Settings for '%1' - Qt Linguist + '%1'-re állítás - Qt Linguist + + + + Source language + Forrás nyelv + + + + Language + Nyelv + + + + Country/Region + OrszágRégió + + + + Target language + Cél nyelv + + + diff --git a/tools/linguist/linguist/linguist.pro b/tools/linguist/linguist/linguist.pro index c902aeb..67bcda8 100644 --- a/tools/linguist/linguist/linguist.pro +++ b/tools/linguist/linguist/linguist.pro @@ -9,7 +9,7 @@ CONFIG += qt \ uitools DEFINES += QT_NO_CAST_FROM_ASCII QT_NO_CAST_TO_ASCII -build_all:!build_pass { +build_all:!build_pass { CONFIG -= build_all CONFIG += release } @@ -42,7 +42,7 @@ SOURCES += \ statistics.cpp \ translatedialog.cpp \ translationsettingsdialog.cpp \ - ../shared/simtexth.cpp + ../shared/simtexth.cpp HEADERS += \ batchtranslationdialog.h \ @@ -71,7 +71,7 @@ contains(QT_PRODUCT, OpenSource.*):DEFINES *= QT_OPENSOURCE DEFINES += QT_KEYWORDS TARGET = linguist win32:RC_FILE = linguist.rc -mac { +mac { static:CONFIG -= global_init_link_order ICON = linguist.icns TARGET = Linguist @@ -99,6 +99,7 @@ TR_DIR = $$PWD/../../../translations TRANSLATIONS = \ $$TR_DIR/linguist_de.ts \ $$TR_DIR/linguist_fr.ts \ + $$TR_DIR/linguist_hu.ts \ $$TR_DIR/linguist_ja.ts \ $$TR_DIR/linguist_pl.ts \ $$TR_DIR/linguist_ru.ts \ -- cgit v0.12 From 0782ffa51f582c7f1d8f8ef7b0ad7627cc54f9ed Mon Sep 17 00:00:00 2001 From: Laszlo Papp Date: Wed, 3 Feb 2010 11:10:42 +0100 Subject: Add Qtconfig hungarian translation Signed-off-by: Laszlo Papp Reviewed-by: Benjamin Poulain --- qtconfig_hu.ts | 920 +++++++++++++++++++++++++++ tools/qtconfig/translations/translations.pro | 1 + 2 files changed, 921 insertions(+) create mode 100644 qtconfig_hu.ts diff --git a/qtconfig_hu.ts b/qtconfig_hu.ts new file mode 100644 index 0000000..0eaead0 --- /dev/null +++ b/qtconfig_hu.ts @@ -0,0 +1,920 @@ + + + + + MainWindow + + + Desktop Settings (Default) + Asztali beállítások (Alapértelmezett) + + + + Choose style and palette based on your desktop settings. + Stílus és paletta alapú kiválasztása az asztali beállításokban. + + + + On The Spot + Azon nyomban + + + + + + + Auto (default) + Automatikus (alapértelmezett) + + + + Choose audio output automatically. + Audió kimenet automatikus kiválasztása. + + + + + aRts + aRts + + + + Experimental aRts support for GStreamer. + Kísérleti aRts támogatás a GStreamerhez. + + + + Phonon GStreamer backend not available. + Phonon GStreamer backend nem elérhető. + + + + Choose render method automatically + Render eljárás automatikus kiválasztása + + + + + X11 + X11 + + + + Use X11 Overlays + X11 borítás használata + + + + + OpenGL + OpenGL + + + + Use OpenGL if avaiable + OpenGL használata, ha rendelkezésre áll + + + + + Software + Szoftver + + + + Use simple software rendering + Egyszerű szoftver adás használata + + + + No changes to be saved. + A változtatások nincsenek elmentve. + + + + Saving changes... + Változtatások elmentése... + + + + Over The Spot + Célon túlmenően + + + + Off The Spot + Elkalandozás + + + + Root + Rendszergazda + + + + Select a Directory + Egy könyvtár kiválasztása + + + + <h3>%1</h3><br/>Version %2<br/><br/>Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). + <h3>%1</h3><br/>Verzió %2<br/><br/>Szerzői jog (C) 2010 Nokia vállalat és/vagy leányvállalata(i). + + + + + + Qt Configuration + Qt Konfiguráció + + + + Save Changes + Változtatások elmentése + + + + Save changes to settings? + Változtatások elmentése a beállításokba ? + + + + &Yes + &Igen + + + + &No + &Nem + + + + &Cancel + &Mégse + + + + MainWindowBase + + + Qt Configuration + Qt Konfiguráció + + + + + Appearance + Feltűnés + + + + GUI Style + GUI Stílus + + + + Select GUI &Style: + GUI &Stílus kiválasztása: + + + + Build Palette + Építési paletta + + + + &3-D Effects: + &3 D Hatások: + + + + Window Back&ground: + Ablak Hát&tér: + + + + &Tune Palette... + &Hangolási paletta... + + + + Please use the KDE Control Center to set the palette. + Kérem használja a KDE Vezérlő Központot a paletta beállításához. + + + + Preview + Előnézet + + + + Select &Palette: + &Paletta kiválasztása: + + + + Active Palette + Aktív paletta + + + + Inactive Palette + Inaktív paletta + + + + Disabled Palette + Tiltott paletta + + + + Fonts + Betűk + + + + Default Font + Alapértelmezett betű + + + + &Style: + &Stílus: + + + + &Point Size: + &Pont méret: + + + + F&amily: + Csa&lád: + + + + Sample Text + Minta szöveg + + + + Font Substitution + Betű helyettesítés + + + + S&elect or Enter a Family: + Egy család ki&választása vgy bevitele: + + + + Current Substitutions: + Aktuális helyettesítés: + + + + + Up + Fel + + + + + Down + Le + + + + + Remove + Eltávolítás + + + + Select s&ubstitute Family: + Család &helyettesítésének kiválasztása: + + + + + Add + Hozzáad + + + + Interface + Interfész + + + + Feel Settings + Érzet beállítások + + + + + ms + ms + + + + &Double Click Interval: + &Dupla kattintási intervallum: + + + + No blinking + Nincs villogás + + + + &Cursor Flash Time: + &Kurzor flash idő: + + + + lines + sorok + + + + Wheel &Scroll Lines: + Kerék sor &görgetés: + + + + Resolve symlinks in URLs + URL-ben található szimlinkek megoldása + + + + GUI Effects + GUI hatások + + + + &Enable + &Engedélyezés + + + + Alt+E + Alt+E + + + + &Menu Effect: + &Menü hatás: + + + + C&omboBox Effect: + C&omboBox hatás: + + + + &ToolTip Effect: + &Eszköz tipp hatás: + + + + Tool&Box Effect: + Eszköz&doboz hatás: + + + + + + + Disable + Tiltás + + + + + + + Animate + Animálás + + + + + Fade + Elhalkulás + + + + Global Strut + Globális struktúra + + + + Minimum &Width: + Minimum &szélesség: + + + + Minimum Hei&ght: + Minimum ma&gasség: + + + + + pixels + pixelek + + + + Enhanced support for languages written right-to-left + Kiterjesztett támogatás a jobbról balra írt nyelvek számára + + + + XIM Input Style: + XIM beviteli stílus: + + + + On The Spot + Azon nyomban + + + + Over The Spot + Célon túlmenően + + + + Off The Spot + Elkalandozás + + + + Root + Rendszergazda + + + + Default Input Method: + Alapértelmezett beviteli eljárás: + + + + Printer + Nyomtató + + + + Enable Font embedding + Betű beágyazás engedélyezése + + + + Font Paths + Betű útvonalak + + + + Browse... + Böngészés... + + + + Press the <b>Browse</b> button or enter a directory and press Enter to add them to the list. + Nyomja meg a <b>Böngészés</b> gombot vagy lépjen be egy könyvtárba és nyomja meg az Enter gombot hogy hozzáadja őket a listához. + + + + Phonon + Phonon + + + + About Phonon + Phonon-ról + + + + + Current Version: + Aktuális verzió: + + + + + Not available + Nem elérhető + + + + + Website: + Weblap: + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://phonon.kde.org"><span style=" text-decoration: underline; color:#0000ff;">http://phonon.kde.org</span></a></p></body></html> + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://phonon.kde.org"><span style=" text-decoration: underline; color:#0000ff;">http://phonon.kde.org</span></a></p></body></html> + + + + About GStreamer + GStreamer-ről + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://gstreamer.freedesktop.org/"><span style=" text-decoration: underline; color:#0000ff;">http://gstreamer.freedesktop.org/</span></a></p></body></html> + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://gstreamer.freedesktop.org/"><span style=" text-decoration: underline; color:#0000ff;">http://gstreamer.freedesktop.org/</span></a></p></body></html> + + + + GStreamer backend settings + GStreamer backend beállítások + + + + Preferred audio sink: + Preferrált audió tartály: + + + + Preferred render method: + Preferrált render eljárás: + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-style:italic;">Note: changes to these settings may prevent applications from starting up correctly.</span></p></body></html> + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-style:italic;">Megjegyzés: Ezekben a beállításokban történő változtatások megakadályozhatják az alkalmazásokat a megfelelő betöltéstől.</span></p></body></html> + + + + &File + &Fájl + + + + &Help + &Súgó + + + + &Save + &Mentés + + + + Save + Mentés + + + + Ctrl+S + Ctrl+S + + + + E&xit + &Kilépés + + + + Exit + Kilépés + + + + &About + &Névjegy + + + + About + Névjegy + + + + About &Qt + &Qt-ról + + + + About Qt + Qt-ról + + + + PaletteEditorAdvancedBase + + + Tune Palette + Hangoló paletta + + + + <b>Edit Palette</b><p>Change the palette of the current widget or form.</p><p>Use a generated palette or select colors for each color group and each color role.</p><p>The palette can be tested with different widget layouts in the preview section.</p> + <b>Paletta szerkesztése</b><p>Az aktuális widget vagy űrlap palettájának megváltoztatása</p><p>Egy generált paletta használata vagy szín kiválasztás mindegyik színcsoport és szín szabályra.</p><p>A paletta tesztelhető különböző widget szerkezetekkel az előnézeti szegmensben.</p> + + + + Select &Palette: + &Paletta kiválasztása: + + + + Active Palette + Aktív paletta + + + + Inactive Palette + Inaktív paletta + + + + Disabled Palette + Paletta tiltása + + + + Auto + Auto + + + + Build inactive palette from active + Inaktív paletta építése aktívból + + + + Build disabled palette from active + Tiltott paletta építése aktívból + + + + Central color &roles + Központi szín &szabályok + + + + Choose central color role + Központi szín szabályok kiválasztása + + + + <b>Select a color role.</b><p>Available central roles are: <ul> <li>Window - general background color.</li> <li>WindowText - general foreground color. </li> <li>Base - used as background color for e.g. text entry widgets, usually white or another light color. </li> <li>Text - the foreground color used with Base. Usually this is the same as WindowText, in what case it must provide good contrast both with Window and Base. </li> <li>Button - general button background color, where buttons need a background different from Window, as in the Macintosh style. </li> <li>ButtonText - a foreground color used with the Button color. </li> <li>Highlight - a color to indicate a selected or highlighted item. </li> <li>HighlightedText - a text color that contrasts to Highlight. </li> <li>BrightText - a text color that is very different from WindowText and contrasts well with e.g. black. </li> </ul> </p> + <b>Egy szín szabály kiválasztása.</b><p>Az elérhetp központi szabályok: <ul> <li>Ablak - általános háttér szín.</li> <li>AblakSzöveg - általános előtér szín. </li> <li>Alap - háttérszínként használva példul szöveg beviteli widgetekre, rendszerint fehér vagy más világos színekre. </li> <li>Szöveg - az előtér szín van haszálva a bázissal. Rendszerint ez ugyanaz, mint az AblakSzöveg, amilyen esetekben egy jó ellentétet kell biztosítania mindkettőre Ablakkal és Bázissal. </li> <li>Gomb - általános gomb háttér szín, ahol a gomboknak szüksége van egy háttére ami különbözik az ablakétól, mint a Macintosh stílusban. </li> <li>GombSzöveg - egy előtér szín van használva gomb színnel. </li> <li>Kihangsúlyozás - egy szín a kiválasztott vagy kihangsúlyozott elem jelölésére. </li> <li>KihangsúlyozottSzöveg - egy szöveg szín, ami ellentétes a kihangsúlyozással. </li> <li>VilágosSzöveg - egy szöveg szín, ami nagyon különböző az AblakSzövegtől és a kontrasztoktól jól van példul feketével. </li> </ul> </p> + + + + Window + Ablak + + + + WindowText + AblakSzöveg + + + + Button + Gomb + + + + Base + Bázis + + + + Text + Szöveg + + + + BrightText + VilágosSzöveg + + + + ButtonText + GombSzöveg + + + + Highlight + Kihangsúlyozás + + + + HighlightedText + KihangsúlyozottSzöveg + + + + &Select Color: + Szín &kiválasztása: + + + + + Choose a color + Egy szín kiválasztása + + + + Choose a color for the selected central color role. + Egy szín kiválasztása a kiválasztott központi szín szabályokra. + + + + 3-D shadow &effects + 3 D árnyék &hatások + + + + Build &from button color + Építés gomb szín&ből + + + + Generate shadings + Árnyékolások generálása + + + + Check to let 3D-effect colors be calculated from button-color. + + + + + Choose 3D-effect color role + 3D hatás szín szabályok kiválasztása + + + + <b>Select a color role.</b><p>Available effect roles are: <ul> <li>Light - lighter than Button color. </li> <li>Midlight - between Button and Light. </li> <li>Mid - between Button and Dark. </li> <li>Dark - darker than Button. </li> <li>Shadow - a very dark color. </li> </ul> + + + + + Light + Világos + + + + Midlight + Központi fény + + + + Mid + Középső + + + + Dark + Sötét + + + + Shadow + Árnyék + + + + Select Co&lor: + &Szín kiválasztása: + + + + Choose a color for the selected effect color role. + Egy szín kiválasztása a kiválaszott hatás szín szabályra. + + + + OK + OK + + + + Close dialog and apply all changes. + Párbeszéd ablak bezárása és az összes változtatás alkalmazása. + + + + Cancel + Mégse + + + + Close dialog and discard all changes. + Párbeszédablak bezárása és az összes változtatás eldobása. + + + + PreviewFrame + + + Desktop settings will only take effect after an application restart. + Az asztal beállítások kizárólag az alkalmazás újraindítása utan lépnek érvénybe. + + + + PreviewWidgetBase + + + Preview Window + Előnézet ablak + + + + ButtonGroup + GombCsoport + + + + RadioButton1 + RádioGomb1 + + + + RadioButton2 + RádioGomb2 + + + + RadioButton3 + RádioGomb3 + + + + ButtonGroup2 + GombCsoport2 + + + + CheckBox1 + Jelölőnégyzet1 + + + + CheckBox2 + Jelölőnégyzet2 + + + + LineEdit + SorSzerkesztés + + + + ComboBox + ComboBox + + + + PushButton + NyomóGomb + + + + <p> +<a href="http://qt.nokia.com">http://qt.nokia.com</a> +</p> +<p> +<a href="http://www.kde.org">http://www.kde.org</a> +</p> + <p> +<a href="http://qt.nokia.com">http://qt.nokia.com</a> +</p> +<p> +<a href="http://www.kde.org">http://www.kde.org</a> +</p> + + + diff --git a/tools/qtconfig/translations/translations.pro b/tools/qtconfig/translations/translations.pro index bf8a1da..5d35b6a 100644 --- a/tools/qtconfig/translations/translations.pro +++ b/tools/qtconfig/translations/translations.pro @@ -9,6 +9,7 @@ FORMS = ../mainwindowbase.ui ../paletteeditoradvancedbase.ui ../previewwi TR_DIR = $$PWD/../../../translations TRANSLATIONS = \ + $$TR_DIR/qtconfig_hu.ts \ $$TR_DIR/qtconfig_pl.ts \ $$TR_DIR/qtconfig_ru.ts \ $$TR_DIR/qtconfig_zh_CN.ts \ -- cgit v0.12 From 40361096213895db05750b32dc05331ef56c7783 Mon Sep 17 00:00:00 2001 From: Laszlo Papp Date: Wed, 3 Feb 2010 11:10:43 +0100 Subject: Add Qvfb hungarian translation Signed-off-by: Laszlo Papp Reviewed-by: Benjamin Poulain --- qvfb_hu.ts | 344 +++++++++++++++++++++++++++++++ tools/qvfb/translations/translations.pro | 1 + 2 files changed, 345 insertions(+) create mode 100644 qvfb_hu.ts diff --git a/qvfb_hu.ts b/qvfb_hu.ts new file mode 100644 index 0000000..bb8c931 --- /dev/null +++ b/qvfb_hu.ts @@ -0,0 +1,344 @@ + + + + + AnimationSaveWidget + + + + Record + Rekord + + + + Reset + Visszaállítás + + + + Save + Mentés + + + + Save in MPEG format (requires netpbm package installed) + MPEG formátumba mentés (netpbm csomag telepítése szükséges) + + + + + Click record to begin recording. + Kattintson az írásra az írás megkezdéséhez. + + + + + Finished saving. + Befejezett mentés. + + + + Paused. Click record to resume, or save if done. + Szüneteltetve. Kattintson az írásra a folytatáshoz, vagy mentse el, ha kész. + + + + Pause + Szünet + + + + Recording... + Felvétel... + + + + Saving... + Mentés... + + + + + Save animation... + Animáció mentése... + + + + Save canceled. + Megnés visszavonva. + + + + Save failed! + Mentési hiba! + + + + Config + + + Configure + Konfigurálás + + + + Size + Méret + + + + 176x220 "SmartPhone" + 176x220 "ÜgyesTelefon" + + + + 240x320 "PDA" + 240x320 "PDA" + + + + 320x240 "TV" / "QVGA" + 320x240 "TV" / "QVGA" + + + + 640x480 "VGA" + 640x480 "VGA" + + + + 800x600 + 800x600 + + + + 1024x768 + 1024x768 + + + + Custom + Szokásos + + + + Depth + Mélység + + + + 1 bit monochrome + 1 bites egyszínű + + + + 2 bit grayscale + 2 bites szürke skálázás + + + + 4 bit grayscale + 4 bites szürke slálázás + + + + 8 bit + 8 bites + + + + 12 (16) bit + 12 (16) bites + + + + 15 bit + 15 bites + + + + 16 bit + 16 bites + + + + 18 bit + 18 bites + + + + 24 bit + 24 bites + + + + 32 bit + 32 bites + + + + 32 bit ARGB + 32 bites ARGB + + + + Swap red and blue channels + Piros és kék csatornák felcserélése + + + + BGR format + BGR formátum + + + + Skin + Szkin + + + + None + Semmi + + + + Emulate touch screen (no mouse move) + указателя? + Érintő képernyő emulálása (nincs egér mozgatás) + + + + Emulate LCD screen (Only with fixed zoom of 3.0 times magnification) + LCD kijelző emulálása (Kizárólag egy fix 3-szoros nagyítással) + + + + <p>Note that any applications using the virtual framebuffer will be terminated if you change the Size or Depth <i>above</i>. You may freely modify the Gamma <i>below</i>. + <p>Vegye figyelembe azt, hogy bármely alkalmazás, amely virtuális framebuffer-t használ, be lesz fejezve, ha megváltoztatja a méretet vagy a mélységet <i>felül</i>. Szabadon módosíthatja a Gamma-t <i>alul</i>. + + + + Gamma + Gamma + + + + Blue + Kék + + + + + + + 1.0 + 1.0 + + + + Green + Zöld + + + + All + Mind + + + + Red + Piros + + + + Set all to 1.0 + Az összes 1.0-ra állítása + + + + &OK + &OK + + + + &Cancel + &Mégse + + + + DeviceSkin + + + The image file '%1' could not be loaded. + Nem sikerült betölteni a(z) '%1' kép fájlt. + + + + The skin directory '%1' does not contain a configuration file. + A(z) '%1' skin könyvtár nem tartalmaz egyetlen konfigurációs fájlt sem. + + + + The skin configuration file '%1' could not be opened. + Nem lehetett megnyitni a(z) '%1' skin konfigurációs fájlt. + + + + The skin configuration file '%1' could not be read: %2 + Nem lehetett olvasni a(z) '%1' skin konfigurációs fájlt: %2 + + + + Syntax error: %1 + Szintakszis hiba: %1 + + + + The skin "up" image file '%1' does not exist. + A(z) '%1 'fel' skinezett kép fájl nem létezik. + + + + The skin "down" image file '%1' does not exist. + A(z) '%1 'le' skinezett kép fájl nem létezik. + + + + The skin "closed" image file '%1' does not exist. + A(z) '%1' skin "bezárt" kép fájl nem létezik. + + + + The skin cursor image file '%1' does not exist. + A(z) '%1' skin kurzor kép fájl nem létezik. + + + + Syntax error in area definition: %1 + Szintaszis hiba a terület definícióban: %1 + + + + Mismatch in number of areas, expected %1, got %2. + Nem megfelelő terület szám, %1 várt, %2 kapott. + + + + QVFb + + + Browse... + Böngészés... + + + + Load Custom Skin... + Szokásos skin betöltése... + + + + All QVFB Skins (*.skin) + Minden QVFB skin (*.skin) + + + diff --git a/tools/qvfb/translations/translations.pro b/tools/qvfb/translations/translations.pro index ef42063..b0b1af4 100644 --- a/tools/qvfb/translations/translations.pro +++ b/tools/qvfb/translations/translations.pro @@ -28,6 +28,7 @@ SOURCES = ../qvfb.cpp \ TR_DIR = $$PWD/../../../translations TRANSLATIONS = \ + $$TR_DIR/qvfb_hu.ts \ $$TR_DIR/qvfb_pl.ts \ $$TR_DIR/qvfb_ru.ts \ $$TR_DIR/qvfb_zh_CN.ts \ -- cgit v0.12 From d50c672b037005dfd838bf7658ab7f2888697e85 Mon Sep 17 00:00:00 2001 From: Benjamin Poulain Date: Wed, 3 Feb 2010 11:35:16 +0100 Subject: Move the Hungarian translation to the translations folder --- assistant_hu.ts | 1083 ----- designer_hu.ts | 7023 --------------------------- linguist_hu.ts | 2014 -------- qt_help_hu.ts | 298 -- qt_hu.ts | 10537 ----------------------------------------- qtconfig_hu.ts | 920 ---- qvfb_hu.ts | 344 -- translations/assistant_hu.ts | 1083 +++++ translations/designer_hu.ts | 7023 +++++++++++++++++++++++++++ translations/linguist_hu.ts | 2014 ++++++++ translations/qt_help_hu.ts | 298 ++ translations/qt_hu.ts | 10537 +++++++++++++++++++++++++++++++++++++++++ translations/qtconfig_hu.ts | 920 ++++ translations/qvfb_hu.ts | 344 ++ 14 files changed, 22219 insertions(+), 22219 deletions(-) delete mode 100644 assistant_hu.ts delete mode 100644 designer_hu.ts delete mode 100644 linguist_hu.ts delete mode 100644 qt_help_hu.ts delete mode 100644 qt_hu.ts delete mode 100644 qtconfig_hu.ts delete mode 100644 qvfb_hu.ts create mode 100644 translations/assistant_hu.ts create mode 100644 translations/designer_hu.ts create mode 100644 translations/linguist_hu.ts create mode 100644 translations/qt_help_hu.ts create mode 100644 translations/qt_hu.ts create mode 100644 translations/qtconfig_hu.ts create mode 100644 translations/qvfb_hu.ts diff --git a/assistant_hu.ts b/assistant_hu.ts deleted file mode 100644 index e43070c..0000000 --- a/assistant_hu.ts +++ /dev/null @@ -1,1083 +0,0 @@ - - - - - AboutDialog - - - &Close - &Bezárás - - - - AboutLabel - - - Warning - Figyelmeztetés - - - - Unable to launch external application. - - Nem lehet külső alkalmazást elindítani. - - - - OK - OK - - - - BookmarkDialog - - - Add Bookmark - Könyvjelző hozzáadása - - - - Bookmark: - Könyvjelző: - - - - Add in Folder: - Hozzáadás dossziéban: - - - - New Folder - Új dosszié - - - - - - - - Bookmarks - Könyvjelzők - - - - + - + - - - - Delete Folder - Dosszié törlése - - - - Rename Folder - Dosszié átnevezése - - - - BookmarkManager - - - Bookmarks - Könyvjelzők - - - - Remove - Áthelyezés - - - - You are going to delete a Folder, this will also<br>remove it's content. Are you sure to continue? - Egy olyan dossziét fog törölni, ami <br> törli annak tartalmát is. Biztos benne, hogy folytatja? - - - - - New Folder - Új Dosszié - - - - BookmarkWidget - - - Filter: - Szűrő: - - - - Remove - Eltávolítás - - - - Delete Folder - Dosszié törlése - - - - Rename Folder - Dosszié átnevezése - - - - Show Bookmark - Könyvjelző megjelenítése - - - - Show Bookmark in New Tab - Könyvjelző megjelenítése új lapon - - - - Delete Bookmark - Könyvjelző törlése - - - - Rename Bookmark - Könyvjelző átnevezése - - - - Add - Hozzáadás - - - - CentralWidget - - - Add new page - Új lap hozzáadása - - - - Close current page - Aktuális lap bezárása - - - - Print Document - Dokumentum nyomtatása - - - - - unknown - ismeretlen - - - - Add New Page - Új lap hozzáadása - - - - Close This Page - Lap bezárása - - - - Close Other Pages - Többi lap bezárása - - - - Add Bookmark for this Page... - Könyvjelző hozzáadása ehhez a laphoz... - - - - Search - Keresés - - - - ContentWindow - - - Open Link - Link megnyitása - - - - Open Link in New Tab - Link megnyitása új lapon - - - - FilterNameDialogClass - - - Add Filter Name - Szűrő név hozzáadása - - - - Filter Name: - Szűrő név: - - - - FindWidget - - - Previous - Előző - - - - Next - Következő - - - - Case Sensitive - Kis és nagybetű érzékeny - - - - Whole words - Egész szavakat - - - - <img src=":/trolltech/assistant/images/wrap.png">&nbsp;Search wrapped - <img src=":/trolltech/assistant/images/wrap.png">&nbsp;Keresés tördelése - - - - FontPanel - - - Font - Betű - - - - &Writing system - Rendszer &írása - - - - &Family - &Család - - - - &Style - &Stílus - - - - &Point size - &Pont méret - - - - HelpViewer - - - Help - Segítség - - - - OK - OK - - - - <title>Error 404...</title><div align="center"><br><br><h1>The page could not be found</h1><br><h3>'%1'</h3></div> - <title>404-es hiba...</title><div align="center"><br><br><h1>A lap nem található </h1><br><h3>'%1'</h3></div> - - - - Copy &Link Location - &Link címének másolása - - - - Open Link in New Tab Ctrl+LMB - Link megnyitása új lapon Ctrl+LMB - - - - Open Link in New Tab - Link megnyitása új lapon - - - - Unable to launch external application. - - Nem lehet külső alkalmazást indítani. - - - - IndexWindow - - - &Look for: - &Keresés: - - - - Open Link - Link megnyitása - - - - Open Link in New Tab - Link megnyitása új lapon - - - - InstallDialog - - - - Install Documentation - - - - - Downloading documentation info... - Dokumentum információ letöltése... - - - - Download canceled. - Letöltés vmegszakítva. - - - - - - Done. - Kész. - - - - The file %1 already exists. Do you want to overwrite it? - A(z) %1 fájl már létezik. Felül szeretné írni? - - - - Unable to save the file %1: %2. - Nem lehet elmenteni a(z) %1 fájlt: %2. - - - - Downloading %1... - %1 letöltése... - - - - - - Download failed: %1. - Nem sikerült a letöltés: %1. - - - - Documentation info file is corrupt! - Dokumentum információ sérült! - - - - Download failed: Downloaded file is corrupted. - Nem sikerült letölteni: A letöltött fájl sérült. - - - - Installing documentation %1... - %1 dokumentáció telepítése... - - - - Error while installing documentation: -%1 - Hiba történt a dokumentáció telepítése közben: %1 - - - - Available Documentation: - Elérhető dokumentáció: - - - - Install - Telepítés - - - - Cancel - Mégse - - - - Close - Bezárás - - - - Installation Path: - Telepítési útvonal: - - - - ... - ... - - - - MainWindow - - - - Index - Index - - - - - Contents - Tartalom - - - - - Bookmarks - Könyvjelzők - - - - Search - Keresés - - - - - - Qt Assistant - Qt Assistant - - - - - Unfiltered - Szűrés nélküli - - - - Page Set&up... - Lap Beállí&tás... - - - - Print Preview... - Nyomtatási előnézet... - - - - &Print... - &Nyomtatás... - - - - New &Tab - Új &Lap - - - - &Close Tab - Lap &bezárása - - - - &Quit - &Kilépés - - - - &Copy selected Text - Kiválasztott szöveg &másolása - - - - &Find in Text... - &Keresés szövegben... - - - - &Find - &Keresés - - - - Find &Next - &Következő keresés - - - - Find &Previous - &Előző keresés - - - - Preferences... - Beállítások... - - - - Zoom &in - &Nagyítás - - - - Zoom &out - &Kicsinyítés - - - - Normal &Size - Normál &méret - - - - Ctrl+0 - Ctrl + 0 - - - - ALT+C - ALT + C - - - - ALT+I - ALT + l - - - - ALT+S - ALT + S - - - - &Home - &Otthon - - - - &Back - &Vissza - - - - &Forward - &Előre - - - - Sync with Table of Contents - Tartalomjegyzékkel való szinkronizálás - - - - Sync - Szinkronizálás - - - - Next Page - Következő lap - - - - Ctrl+Alt+Right - Ctrl+Alt+Right - - - - Previous Page - Előző lap - - - - Ctrl+Alt+Left - Ctrl+Alt+Left - - - - Add Bookmark... - Könyvjelző hozzáadása... - - - - About... - Névjegy... - - - - Navigation Toolbar - Navigációs eszköztár - - - - Toolbars - Eszköztár - - - - Filter Toolbar - Eszköztár szűrő - - - - Filtered by: - Szűrési feltétel: - - - - Address Toolbar - Eszköztár cím - - - - Address: - Cím: - - - - Could not find the associated content item. - Nem sikerült az összekapcsolt tartalom elemet megtalálni. - - - - About %1 - %1-ről - - - - Updating search index - Keresési index frissítése - - - - Looking for Qt Documentation... - Qt dokumentáció keresése... - - - - &Window - &Ablak - - - - Minimize - Minimalizálás - - - - Ctrl+M - Ctrl + M - - - - Zoom - Zoomolás - - - - &File - &Fájl - - - - &Edit - &Szerkesztés - - - - &View - &Nézet - - - - &Go - &Gyerünk - - - - ALT+Home - ALT+Home - - - - &Bookmarks - &Könyvjelzők - - - - &Help - &Segítség - - - - ALT+O - ALT + 0 - - - - CTRL+D - CTRL+D - - - - PreferencesDialog - - - - Add Documentation - Dokumentáció hozzáadása - - - - Qt Compressed Help Files (*.qch) - Qt tömörített súgó fájlok (*.qch) - - - - The specified file is not a valid Qt Help File! - A meghatározott fájl egy érvénytelen Qt Súgó fájl! - - - - The namespace %1 is already registered! - A(z) %1 névtér már regisztrálva van! - - - - Remove Documentation - Dokumentáció eltávolítása - - - - Some documents currently opened in Assistant reference the documentation you are attempting to remove. Removing the documentation will close those documents. - Néhány dokumentum jelenleg az Assistant hivatkozásban lett megnyitva, amely az a dokumentum, amit megpróbál eltávolítani. A dokumentum eltávolítása be fogja zárni azokat a dokumentumokat. - - - - Cancel - Mégse - - - - OK - OK - - - - Use custom settings - Szokásos beállítások használata - - - - PreferencesDialogClass - - - Preferences - Beállítások - - - - Fonts - Betűk - - - - Font settings: - Betű beállítások: - - - - Browser - Böngésző - - - - Application - Alkalmazás - - - - Filters - Szűrők - - - - Filter: - Szűrők: - - - - Attributes: - Attrubútumok: - - - - 1 - 1 - - - - Add - Hozzáadás - - - - Remove - Eltávolítás - - - - Documentation - Dokumentáció - - - - Registered Documentation: - Regisztrált dokumentáció: - - - - Add... - Hozzáadás... - - - - Options - Opciók - - - - Current Page - Aktuális lap - - - - Restore to default - Alapértelmezett beállítások visszaállítása - - - - Homepage - Honlap - - - - On help start: - Súgó indításra: - - - - Show my home page - Honlapom megjelenítése - - - - Show a blank page - Egy üres lap megjelenítése - - - - Show my tabs from last session - A lapjaim megjelenításe a legutolsó szakaszból - - - - Blank Page - Üres lap - - - - QObject - - - The specified collection file does not exist! - A meghatározott gyűjtemény fájl nem létezik! - - - - Missing collection file! - Hiányzó gyűjtemény fájl! - - - - Invalid URL! - Érvénytelen URL! - - - - Missing URL! - Hiányzó URL! - - - - - - Unknown widget: %1 - Ismeretlen widget: %1 - - - - - - Missing widget! - Hiányzó widget! - - - - - The specified Qt help file does not exist! - A meghatározott Qt súgó fájl nem létezik! - - - - - Missing help file! - Hiányzó súgó fájl! - - - - Missing filter argument! - Hiányzó szűrő argumentum! - - - - Unknown option: %1 - Ismeretlen opció: %1 - - - - - Qt Assistant - Qt Assistant - - - - Could not register documentation file -%1 - -Reason: -%2 - Nem sikerült a dokumentációs fájl regisztrálása -%1 - -Ok: -%2 - - - - Documentation successfully registered. - A dokumentáció regisztrálása sikeresen megtörtént. - - - - Could not unregister documentation file -%1 - -Reason: -%2 - Nem sikerült regisztrálni a dokumentációs fájlt -%1 - -Ok: -%2 - - - - Documentation successfully unregistered. - Dokumentáció regisztrációjának megszűntetése sikeresen megtörtént. - - - - Cannot load sqlite database driver! - Nem lehet betölteni az sqlite adatbázis vezérlőt! - - - - The specified collection file could not be read! - A meghatározott gyűjtemény fájlt nem lehet olvasni! - - - - RemoteControl - - - Debugging Remote Control - Debuggolás Távoli Vezérlő - - - - Received Command: %1 %2 - Elfogadott parancs: %1 %2 - - - - SearchWidget - - - &Copy - &Másolás - - - - Copy &Link Location - &Link címének másolása - - - - Open Link in New Tab - Link megnyitása új lapon - - - - Select All - Az összes kiválasztása - - - - TopicChooser - - - Choose a topic for <b>%1</b>: - Topik választása a következőhöz: <b>%1</b>: - - - - Choose Topic - Topik választása - - - - &Topics - &Topikok - - - - &Display - &Kijelzés - - - - &Close - &Bezárás - - - diff --git a/designer_hu.ts b/designer_hu.ts deleted file mode 100644 index c2960bc..0000000 --- a/designer_hu.ts +++ /dev/null @@ -1,7023 +0,0 @@ - - - - - AbstractFindWidget - - - &Previous - &Előző - - - - &Next - &Következő - - - - &Case sensitive - &Kis ér nagybetű érzékeny - - - - Whole &words - Egész &szavakat - - - - <img src=":/trolltech/shared/images/wrap.png">&nbsp;Search wrapped - <img src=":/trolltech/shared/images/wrap.png">&nbsp;Keresés tördelve - - - - AddLinkDialog - - - Insert Link - Link beszúrása - - - - Title: - Cím: - - - - URL: - URL: - - - - AppFontDialog - - - Additional Fonts - További betűl - - - - AppFontManager - - - '%1' is not a file. - %1 nem egy fájl. - - - - The font file '%1' does not have read permissions. - '%1' betű fájlnak nincsen olvasási engedélye. - - - - The font file '%1' is already loaded. - '%1' font fájl már be van töltve. - - - - The font file '%1' could not be loaded. - '%1' font fájlt nem sikerült betölteni. - - - - '%1' is not a valid font id. - '%1' nem egy érvényes betű azonosító. - - - - There is no loaded font matching the id '%1'. - Nincsen '%1' azonosítóval megegyező betöltött betű. - - - - The font '%1' (%2) could not be unloaded. - '%1' betűt (%2) nem lehetett kirakni. - - - - AppFontWidget - - - Fonts - Betűk - - - - Add font files - Betű fájlok hozzáadása - - - - Remove current font file - Aktuális betű fájl eltávolítása - - - - Remove all font files - Az összes betű fájl eltávolítása - - - - Add Font Files - Betű fájlok hozzáadása - - - - Font files (*.ttf) - Betű fájlok (*.ttf) - - - - Error Adding Fonts - Hiba történt a betűk hozzáadásakor - - - - Error Removing Fonts - Hiba történt a betűk eltávolításakor - - - - Remove Fonts - Betűk eltávolítása - - - - Would you like to remove all fonts? - El szeretné távolítani az összes betűt? - - - - AppearanceOptionsWidget - - - Form - - - - - User Interface Mode - Felhasználói interfész mód - - - - AssistantClient - - - Unable to send request: Assistant is not responding. - Nem lehet elküldeni a kérést, az Assistant nem válaszol. - - - - The binary '%1' does not exist. - '%1' bináris nem létezik. - - - - Unable to launch assistant (%1). - Nem lehet elindítani a(z) %1 assistant. - - - - BrushPropertyManager - - - No brush - Nincs kefe - - - - Solid - Szolid - - - - Dense 1 - Sűrű 1 - - - - Dense 2 - Sűrű 2 - - - - Dense 3 - Sűrű 3 - - - - Dense 4 - Sűrű 4 - - - - Dense 5 - Sűrű 5 - - - - Dense 6 - Sűrű 6 - - - - Dense 7 - Sűrű 7 - - - - Horizontal - Horizontális - - - - Vertical - Vertikális - - - - Cross - Kereszt - - - - Backward diagonal - Visszafele átlós - - - - Forward diagonal - Előre átlós - - - - Crossing diagonal - Kereszt átlós - - - - Style - Stílus - - - - Color - Szín - - - - [%1, %2] - [%1, %2] - - - - Command - - - - Change signal - Jel változtatás - - - - - Change slot - Szlot változtatás - - - - Change signal-slot connection - Jel szlot kapcsolat változtatása - - - - Change sender - Küldő változtatás - - - - Change receiver - Fogadó változtatás - - - - Create button group - Gomb csoport létrehozása - - - - Break button group - Gomb csoport törése - - - - Break button group '%1' - '%1' gomb csoport törése - - - - Add buttons to group - Gomb hozzáadása a csoporthoz - - - - - Add '%1' to '%2' - Command description for adding buttons to a QButtonGroup - '%1' hozzáadása '%2'-höz - - - - Remove buttons from group - Gomb eltávolítása a csoportból - - - - Remove '%1' from '%2' - Command description for removing buttons from a QButtonGroup - '%1' eltávolítása '%2'-ból - - - - Add connection - Kapcsolat hozzáadása - - - - Adjust connection - Kapcsolat beállítása - - - - Delete connections - Kapcsolatok törlése - - - - Change source - Forrás változtatása - - - - Change target - Cél változtatása - - - - Morph %1/'%2' into %3 - MorphWidgetCommand description - %1/'%2' alakváltoztatása %3-re - - - - Insert '%1' - '%1' beszúrása - - - - Change Z-order of '%1' - '%1' Z sorrendjének megváltoztatása - - - - Raise '%1' - '%1' növelése - - - - Lower '%1' - Alsó '%1' - - - - Delete '%1' - '%1' törlése - - - - Reparent '%1' - '%1' újra szülősítése - - - - Promote to custom widget - Egyéni widget elősegítése - - - - Demote from custom widget - Egyéni widget lefokozása - - - - Lay out using grid - Tervraj rácsok használatával - - - - Lay out vertically - Tervrajz vertikálisan - - - - Lay out horizontally - Tervrajz horizontálisan - - - - Break layout - Tervrajz törése - - - - Simplify Grid Layout - Egyszerűsített rács tervrajz - - - - - - Move Page - Lap mozgatása - - - - - - - Delete Page - Lap törlése - - - - - Page - Lap - - - - page - lap - - - - - - - Insert Page - Lap beszúrása - - - - Change Tab order - Tab sorrend változtatása - - - - Create Menu Bar - Menü sáv - - - - Delete Menu Bar - Menü sáv törlése - - - - Create Status Bar - Státusz sáv létrehozása - - - - Delete Status Bar - Státusz sáv törlése - - - - Add Tool Bar - Eszköz sáv hozzáadása - - - - Add Dock Window - Dokk ablak hozzáadása - - - - Adjust Size of '%1' - '%1' méretének igazítása - - - - Change Form Layout Item Geometry - Űrlap tervrajz elem geometriájának megváltoztatása - - - - Change Layout Item Geometry - Tervrajz elem geometriájának megváltoztatása - - - - Delete Subwindow - Alablak törlése - - - - Insert Subwindow - Alablak beszúrása - - - - subwindow - alablak - - - - Subwindow - Alablak - - - - Change Table Contents - Táblázat tartalom megváltoztatása - - - - Change Tree Contents - Fa tartalom megváltoztatása - - - - - Add action - Tevékenység hozzáadása - - - - - Remove action - Tevékenység eltávolítása - - - - Add menu - Menü hozzáadása - - - - Remove menu - Menü eltávolítása - - - - Create submenu - Almenü létrehozása - - - - Delete Tool Bar - Eszköz sáv törlése - - - - Change layout of '%1' from %2 to %3 - '%1' tervrajz megváltoztatása %2-ről %3-ra - - - - Set action text - Tevékenység szöveg beállítása - - - - Insert action - Tevékenység beszúrása - - - - - Move action - Tevékenység mozgatása - - - - Change Title - Cím megváltoztatása - - - - Insert Menu - Menü beszúrása - - - - Changed '%1' of '%2' - '%2' '%1'-ének megváltoztatása - - - - Changed '%1' of %n objects - - %n objektum %1-ének megváltoztatása - - - - - Reset '%1' of '%2' - '%2' '%1'-ének megváltoztatása - - - - Reset '%1' of %n objects - - %n objektum '%1'-ének újraindítása - - - - - Add dynamic property '%1' to '%2' - '%2' '%1' dinamikus tulajdonságának hozzáadása - - - - Add dynamic property '%1' to %n objects - - %n objektum' '%1' dinamikus tulajdonságának hozzáadása - - - - - Remove dynamic property '%1' from '%2' - '%1' dinamikus tulajdonság eltávolítáas '%2'-ből - - - - Remove dynamic property '%1' from %n objects - - '%1' dinamikus tulajdonság eltávolítása %n objektumból - - - - - Change script - Szkript megváltoztatása - - - - Change signals/slots - Jelek/Szlotok megváltoztatása - - - - ConnectDialog - - - Configure Connection - Kapcsolat konfigurálása - - - - - GroupBox - CsoportDoboz - - - - - Edit... - Szerkesztés... - - - - Show signals and slots inherited from QWidget - QWidget-ből örökölt jelek és szlotok megjelenítése - - - - ConnectionDelegate - - - <object> - <objekttum> - - - - <signal> - <jel> - - - - <slot> - <szlot> - - - - DPI_Chooser - - - Standard (96 x 96) - Embedded device standard screen resolution - Szabványos (96 x 96) - - - - Greenphone (179 x 185) - Embedded device screen resolution - Greenphone (179 x 185) - - - - High (192 x 192) - Embedded device high definition screen resolution - Magasság (192 x 192) - - - - Designer - - - Qt Designer - Qt Designer - - - - This file contains top level spacers.<br>They have <b>NOT</b> been saved into the form. - Ez a fájl felső szintű távtartókat tartalmaz.<br> Nem tartalmaznak <b>SEMMIT</b>, ami el lenne mentve az űrlapba. - - - - Perhaps you forgot to create a layout? - Talán elfelejtette létrehozni a tervrajzot? - - - - Invalid UI file: The root element <ui> is missing. - Érvénytelen UI fájl. A rendszergazda elem <ui> hiányzik. - - - - An error has occurred while reading the UI file at line %1, column %2: %3 - Hiba történt az UI fájl olvasás közben %1 sorban, %2 oszlopban: %3 - - - - This file cannot be read because it was created using %1. - A fájl nem olvasható, mert %1 használatával hozták létre. - - - - This file was created using Designer from Qt-%1 and cannot be read. - A fájlt a(z) %1 Qt Designer-rel hozták létre és nem olvasható. - - - - The converted file could not be read. - A konvertált fájlt nem sikerült olvasni. - - - - This file was created using Designer from Qt-%1 and will be converted to a new form by Qt Designer. - A fájlt a(z) %1 Qt Designer-rel hozták létre és a Qt Designer egy új űrlapra fogja konvertálni. - - - - The old form has not been touched, but you will have to save the form under a new name. - A régi űrlap nem lett érintve, de az űrlapot új néven kell majd elmentenie. - - - - This file was created using Designer from Qt-%1 and could not be read: -%2 - A fájl a(z) %1 Qt Designer-rel lett létrehozva és nem olvasható: -%2 - - - - Please run it through <b>uic3&nbsp;-convert</b> to convert it to Qt-4's ui format. - Kérem futtassa a <br>uic3&nbsp;-convert</b> Qt 4-s ui formára konvertáláshoz. - - - - This file cannot be read because the extra info extension failed to load. - Ez a fájl nem olvasható, mert az extra információ kiterjesztést nem sikerült betölteni. - - - - Custom Widgets - Egyéni Widgetek - - - - Promoted Widgets - Támogatott Widgetek - - - - Unable to launch %1. - Nem lehet elindítani %1-t. - - - - %1 timed out. - %1 időtúllépés. - - - - DesignerMetaEnum - - - %1 is not a valid enumeration value of '%2'. - %1 nem egy érvényes '%2' felsorolási érték. - - - - '%1' could not be converted to an enumeration value of type '%2'. - '%1' nem konvertálható egy '%2' típusú felsorolási értékre. - - - - DesignerMetaFlags - - - '%1' could not be converted to a flag value of type '%2'. - '%1' nem konvertálható egy '%2' típusú jelző értékre. - - - - DeviceProfile - - - '%1' is not a number. - Reading a number for an embedded device profile - '%1' nem egy szám. - - - - An invalid tag <%1> was encountered. - Egy érvénytelen címkét <%1> talált. - - - - DeviceProfileDialog - - - &Family - &Család - - - - &Point Size - &Pont méret - - - - Style - Stílus - - - - Device DPI - Eszköz DPI - - - - Name - Név - - - - DeviceSkin - - - The image file '%1' could not be loaded. - Nem sikerült betölteni a(z) '%1' kép fájlt. - - - - The skin directory '%1' does not contain a configuration file. - A(z) '%1' szkin könyvtár nem tartalmaz egy konfigurációs fájlt sem. - - - - The skin configuration file '%1' could not be opened. - A(z) '%1' szkin konfigurációs fájlt nem sikerült megnyitni. - - - - The skin configuration file '%1' could not be read: %2 - A(z) '%1' szkin konfigurációs fájlt nem sikerült olvasni: %2 - - - - Syntax error: %1 - Szintakszis hiba: %1 - - - - The skin "up" image file '%1' does not exist. - A(z) '%1' szkin 'fel' kép fájl nem létezik. - - - - The skin "down" image file '%1' does not exist. - A(z) '%1' szkin 'le' kép fájl nem létezik. - - - - The skin "closed" image file '%1' does not exist. - A(z) '%1' szkin 'zárt' kép fájl nem létezik. - - - - The skin cursor image file '%1' does not exist. - A(z) '%1' szkin kurzor kép fájl nem létezik. - - - - Syntax error in area definition: %1 - Szintakszis hiba a terület definícióban: %1 - - - - Mismatch in number of areas, expected %1, got %2. - Rossz párosítás a területek számában, várt %1, kapot %2. - - - - EmbeddedOptionsControl - - - <html><table><tr><td><b>Font</b></td><td>%1, %2</td></tr><tr><td><b>Style</b></td><td>%3</td></tr><tr><td><b>Resolution</b></td><td>%4 x %5</td></tr></table></html> - Format embedded device profile description - <html><table><tr><td><b>Betű</b></td><td>%1, %2</td></tr><tr><td><b>Stílus</b></td><td>%3</td></tr><tr><td><b>Felbontás</b></td><td>%4 x %5</td></tr></table></html> - - - - EmbeddedOptionsPage - - - Embedded Design - Tab in preferences dialog - Tab a beállítások párbeszéd ablakban - - - - Device Profiles - EmbeddedOptionsControl group box" - BeágyazottOpciókVezérlő csoport doboz" - - - - FontPanel - - - Font - Betű - - - - &Writing system - Rendszer &írása - - - - &Family - &Család - - - - &Style - &Stílus - - - - &Point size - &Pont méret - - - - FontPropertyManager - - - PreferDefault - AlapértelmezettPreferálása - - - - NoAntialias - NincsÁtlapolás - - - - PreferAntialias - ÁtlapolásPreferálása - - - - Antialiasing - Átlapolás - - - - FormBuilder - - - Invalid stretch value for '%1': '%2' - Parsing layout stretch values - Érvénytelen érték kiterjesztés '%1'-re: '%2' - - - - Invalid minimum size for '%1': '%2' - Parsing grid layout minimum size values - Érvénytelen minimum méret '%1'-re: '%2' - - - - FormEditorOptionsPage - - - %1 % - %1 % - - - - Preview Zoom - Zoom előnézet - - - - Default Zoom - Alapértelmezett zoom - - - - Forms - Tab in preferences dialog - Űrlapok - - - - Default Grid - Alapértelmezett rács - - - - FormLayoutRowDialog - - - Add Form Layout Row - нелепица какая-то - Űrlap szerkezet sor hozzaadása - - - - &Label text: - &Címke szöveg: - - - - Field &type: - Mező &típus: - - - - &Field name: - &Mező név: - - - - &Buddy: - &Haver: - - - - &Row: - &Sor: - - - - Label &name: - Címke &név: - - - - FormWindow - - - Unexpected element <%1> - Váratlan elem <%1> - - - - Error while pasting clipboard contents at line %1, column %2: %3 - Hiba történt a vágólap tartalom beillesztése közben a(z) %1 sorban, %2 oszlopban: %3 - - - - FormWindowSettings - - - Form Settings - Űrlap beállítások - - - - Layout &Default - &Alapértelmezett elrendezés - - - - &Spacing: - &Ritkítás: - - - - &Margin: - &Margó: - - - - &Layout Function - &Elrendezés függvény - - - - - Ma&rgin: - Ma&rgó: - - - - Spa&cing: - Rit&kítás: - - - - &Author - &Szerző - - - - &Include Hints - Célzások &beleértése - - - - &Pixmap Function - &Pixmap függvény - - - - Grid - Rács - - - - Embedded Design - Beágyazott terv - - - - IconSelector - - - All Pixmaps ( - Az összes Pixmap ( - - - - ItemPropertyBrowser - - - XX Icon Selected off - Sample string to determinate the width for the first column of the list item property browser - XX ikon kiválasztásának kikapcsolása - - - - MainWindowBase - - - Main - Not currently used (main tool bar) - - - - - File - Fájl - - - - Edit - Szerkesztés - - - - Tools - Eszközök - - - - Form - Űrlap - - - - Qt Designer - Qt Designer - - - - NewForm - - - C&reate - &Létrehozás - - - - Recent - Utóbbi - - - - &Close - &Bezárás - - - - &Open... - &Megnyitás... - - - - &Recent Forms - &Utóbbi űrlapok - - - - Read error - Olvasási hiba - - - - New Form - Űj űrlap - - - - Show this Dialog on Startup - Párbeszédablak megjelenítése betöltéskor - - - - A temporary form file could not be created in %1. - Egy átmeneti űrlap fájlt nem sikerült létrehozni %1-ben. - - - - The temporary form file %1 could not be written. - A(z) %1 átmeneti űrlap fájlt nem sikerült írni. - - - - ObjectInspectorModel - - - Object - Objektum - - - - Class - Osztály - - - - separator - Elválasztó - - - - <noname> - <noname> - - - - ObjectNameDialog - - - Change Object Name - Objektum nevének megváltoztatása - - - - Object Name - Objektum név - - - - PluginDialog - - - Plugin Information - Beépülő modul információ - - - - 1 - 1 - - - - PreferencesDialog - - - Preferences - Beállítások - - - - PreviewConfigurationWidget - - - Form - Űrlap - - - - Print/Preview Configuration - Nyomtatás/Előnézet konfiguráció - - - - Style - Stílus - - - - Style sheet - Stíluslap - - - - - - ... - ... - - - - Device skin - Eszköz szkin - - - - PromotionModel - - - Not used - Usage of promoted widgets - Nincs használva - - - - Q3WizardContainer - - - - Page - Lap - - - - QAbstractFormBuilder - - - Unexpected element <%1> - Váratlan elem <%1> - - - - An error has occurred while reading the UI file at line %1, column %2: %3 - Hiba történt az UI fájl olvasása közben a(z) %1 sorban, %2 oszlopban: %3 - - - - Invalid UI file: The root element <ui> is missing. - Érvénytelen UI fájl. A rendszergazda elem <ui> hiányzik. - - - - The creation of a widget of the class '%1' failed. - A(z) '%1' osztály egy widget-ének létrehozása nem sikerült. - - - - Attempt to add child that is not of class QWizardPage to QWizard. - Gyermek hozzáadásának megkísérelése QWizard-hoz, amely nem egy QWizardPage osztály. - - - - Attempt to add a layout to a widget '%1' (%2) which already has a layout of non-box type %3. -This indicates an inconsistency in the ui-file. - Egy elrendezés hozzáadásának megprónálás egy "%1' widgethez (%2), melynek már egy %3 típusú nem doboz elrendezése van. -Ez ellentmondást mutat az ui fájlban. - - - - Empty widget item in %1 '%2'. - Üres widget elem %1-ben '%2'. - - - - Flags property are not supported yet. - Jelző tulajdonság még nem támogatott. - - - - While applying tab stops: The widget '%1' could not be found. - Tab stops alkalmazásakor: A(z) '%1' widget nem található. - - - - Invalid QButtonGroup reference '%1' referenced by '%2'. - Érvénytelen '%1' QButtonGroup hivatkozásra hivatkozik a(z) '%2'. - - - - This version of the uitools library is linked without script support. - Az uitools könyvtár ezen verziója szkript támogatás nélkül linkelt. - - - - QAxWidgetPlugin - - - ActiveX control - ActiveX vezérlő - - - - ActiveX control widget - ActiveX vezérlő widget - - - - QAxWidgetTaskMenu - - - Set Control - Vezérlő beállítása - - - - Reset Control - Vezérlő újraindítása - - - - Licensed Control - Felhatalmazott vezérlő - - - - The control requires a design-time license - A vezérlő egy tervezés idejű felhatalmazást igényel - - - - QCoreApplication - - - %1 is not a promoted class. - %1 nem egy támogatott osztály. - - - - The base class %1 is invalid. - A(z) %1 alap osztály érvénytelen. - - - - The class %1 already exists. - A(z) %1 osztály már létezik. - - - - Promoted Widgets - Támogatott Widget-ek - - - - The class %1 cannot be removed - A(z) %1 osztályt nem lehet eltávolítani - - - - The class %1 cannot be removed because it is still referenced. - A(z) %1 osztályt nem lehet eltávolítani, mert még mindig hivatkozott. - - - - The class %1 cannot be renamed - A(z) %1 osztályt nem lehet átnevezni - - - - The class %1 cannot be renamed to an empty name. - A(z) %1 osztályt nem lehet átnevezni egy üres névűre. - - - - There is already a class named %1. - Már van egy %1 nevű osztály. - - - - Cannot set an empty include file. - перевод близко к тексту - буквальный совсем глаз режет - Nem lehet beállítani egy üres bennefoglalt fájlt. - - - - Exception at line %1: %2 - Kivétel a(z) %1 sorban: %2 - - - - Unknown error - Ismeretlen hiba - - - - An error occurred while running the script for %1: %2 -Script: %3 - Hiba történt a szkript futtása közben %1-re: %2 -Szkript: %3 - - - - QDesigner - - - %1 - warning - %1 -figyelmeztetés - - - - Qt Designer - Qt Designer - - - - This application cannot be used for the Console edition of Qt - Ezt alkalmazást nem lehet a Qt konzol szerkesztésére használni - - - - QDesignerActions - - - Saved %1. - Mentve: %1. - - - - Edit Widgets - Widget-ek szerkesztése - - - - &Quit - &Bezárás - - - - &Minimize - &Minimalizálás - - - - Bring All to Front - Az összes előre hozása - - - - Preferences... - Beállítások... - - - - Clear &Menu - &Menü tisztítása - - - - CTRL+SHIFT+S - CTRL+SHIFT+S - - - - CTRL+R - CTRL+R - - - - CTRL+M - CTRL+M - - - - Qt Designer &Help - Qt Designer &Súgó - - - - Current Widget Help - Aktuális Widget Súgó - - - - What's New in Qt Designer? - Mi az újdonság a Qt Designer-ben? - - - - About Plugins - Beépülő modulokról - - - - - About Qt Designer - Qt Designer-ről - - - - About Qt - Qt-ról - - - - - Open Form - Űrlap megnyitása - - - - - - Designer UI files (*.%1);;All Files (*) - Designer UI fájlok (*.%1);;Az összes fájl (*) - - - - %1 already exists. -Do you want to replace it? - %1 már létezik. -Le szeretné cserélni? - - - - Additional Fonts... - További betűk... - - - - &Recent Forms - &Utóbbi űrlapok - - - - Designer - Designer - - - - Feature not implemented yet! - A tulajdonság még nincs implementálva! - - - - Read error - Olvasási hiba - - - - %1 -Do you want to update the file location or generate a new form? - %1 -Szeretné frissíteni a fájl helyét vagy generálni egy új űrlapot? - - - - &Update - &Frissítés - - - - &New Form - &Új űrlap - - - - - Save Form? - Menti az űrlapot? - - - - Could not open file - Nem sikerült megnyitni a fájlt - - - - Select New File - Új fájl kiválasztása - - - - Could not write file - Nem sikerült írni a fájlt - - - - &Close Preview - Előnézet &bezárása - - - - &New... - &Új... - - - - &Open... - &Megnyitás... - - - - &Save - &Mentés - - - - Save &As... - Mentés &másként... - - - - Save A&ll - Az ö&sszes mentése - - - - Save As &Template... - Mentés &sablonként... - - - - - &Close - &Bezárás - - - - Save &Image... - &Kép mentése... - - - - &Print... - &Nyomtatás... - - - - View &Code... - &Kód nézet... - - - - ALT+CTRL+S - ALT+CTRL+S - - - - - Save Form As - Mentés űrlapként - - - - Preview failed - Előnézet hiba - - - - Code generation failed - Kód generálási hiba - - - - The file %1 could not be opened. -Reason: %2 -Would you like to retry or select a different file? - Nem sikerült megnyitni a(z) %1 fájlt. -Ok: %2 -Meg szeretné újra próbálni vagy kiválasztani egy különböző fájlt? - - - - It was not possible to write the entire file %1 to disk. -Reason:%2 -Would you like to retry? - Nem lehetett az egész %1 fájlt a lemezre írni. -Ok: %2 -Meg szeretné próbálni újra? - - - - - Assistant - Assistant - - - - - The backup file %1 could not be written. - Nem sikerült írni az archivált %1 fájlt. - - - - The backup directory %1 could not be created. - Nem sikerült létrehozni a(z) %1 archivált könyvtárat. - - - - The temporary backup directory %1 could not be created. - Nem sikerült létrehozni az átmeneti archivált %1 könyvtárat. - - - - Image files (*.%1) - Kép fájlok (*.%1) - - - - - Save Image - Kép mentése - - - - Saved image %1. - Mentett kép: %1. - - - - The file %1 could not be written. - Nem sikerült írni a(z) %1 fájlt. - - - - Please close all forms to enable the loading of additional fonts. - Kérem zárja be az összes űrlapot további betűk betöltéséhez. - - - - Printed %1. - Kinyomtatva: %1. - - - - QDesignerAppearanceOptionsPage - - - Appearance - Tab in preferences dialog - Megjelenés - - - - QDesignerAppearanceOptionsWidget - - - Docked Window - Dokkolt ablak - - - - Multiple Top-Level Windows - Összes felső szintű ablakok - - - - Toolwindow Font - Eszköz ablak betű - - - - QDesignerAxWidget - - - Reset control - Vezérlés újraindítása - - - - Set control - Vezérlés beállítása - - - - Control loaded - Vezérlés betöltve - - - - A COM exception occurred when executing a meta call of type %1, index %2 of "%3". - Egy COM kivétel történt a(z) %1 típusú meta hívás végrehajtása közben, '%3' %2 indexe. - - - - QDesignerFormBuilder - - - Script errors occurred: - Szkript hiba történt: - - - - The preview failed to build. - Nem sikerült az előnézetet felépíteni. - - - - Designer - Designer - - - - QDesignerFormWindow - - - %1 - %2[*] - %1 - %2[*] - - - - Save Form? - Űrlap mentése? - - - - Do you want to save the changes to this document before closing? - El szeretné menteni a változtatásokat ebbe a dokumentumba a bezárás előtt? - - - - If you don't save, your changes will be lost. - Ha nem menti el, a változtatásai el fognak veszni. - - - - QDesignerMenu - - - Type Here - Gépelje be ide - - - - Add Separator - Elválasztó hozzáadása - - - - Insert separator - Elválasztó beszúrása - - - - Remove separator - Elválasztó eltávolítása - - - - Remove action '%1' - '%1' tevékenység eltávolítása - - - - - Add separator - Elválasztó hozzáadása - - - - Insert action - Tevékenység beszúrása - - - - QDesignerMenuBar - - - Type Here - Gépelje be ide - - - - Remove Menu '%1' - '%1' menü eltávolítása - - - - Remove Menu Bar - Menü sáv eltávolítása - - - - Menu - Menü - - - - QDesignerPluginManager - - - An XML error was encountered when parsing the XML of the custom widget %1: %2 - Egy XML hiba történt az egyéni %1 widget XML-ének elemzése közben: %2 - - - - A required attribute ('%1') is missing. - Egy szükséges attribútum ('%1') hiányzik. - - - - An invalid property specification ('%1') was encountered. Supported types: %2 - Egy érvénytelen tulajdonság specifikációt ('%1') talált. Támogatott típusok: %2 - - - - '%1' is not a valid string property specification. - '%1' nem egy érvényes sztring tulajdonság specifikáció. - - - - The XML of the custom widget %1 does not contain any of the elements <widget> or <ui>. - Az egyéni %1 widget XML-je nem tartalmaz semmilyen elemet <widget> vagy <ui>. - - - - The class attribute for the class %1 is missing. - Az osztály attribútum %1 osztályra hiányzik. - - - - The class attribute for the class %1 does not match the class name %2. - Az osztály attribútum %1 osztályra nem egyezik meg a(z) %2 osztály nevével. - - - - QDesignerPropertySheet - - - Dynamic Properties - Dinamikus tulajdonságok - - - - QDesignerResource - - - The layout type '%1' is not supported, defaulting to grid. - A(z) '%1' elrendezés típus nem támogatott, alapértelmezett rács. - - - - The container extension of the widget '%1' (%2) returned a widget not managed by Designer '%3' (%4) when queried for page #%5. -Container pages should only be added by specifying them in XML returned by the domXml() method of the custom widget. - A(z) '%1' (%2) widget konténer kiterjesztése egy olyan widget-et adott vissza, amelyet a(z) '%3' (%4) Designer nem kezel, %5 lap lekéréskor. -Konténer lapokat XML-ben való specifikációjuk által kellene hozzáadni, az egyéni widget domXML() eljárása által. - - - - Unexpected element <%1> - Parsing clipboard contents - Váratlan elem <%1> - - - - Error while pasting clipboard contents at line %1, column %2: %3 - Parsing clipboard contents - Hiba történt a vágólap tartalmának beillesztése közben a(z) %1 sorban, %2 oszlopban: %3 - - - - Error while pasting clipboard contents: The root element <ui> is missing. - Parsing clipboard contents - Hiba történt a vágólap tartalmának beillesztése közben. A rendszergazda elem <ui> hiányzik. - - - - QDesignerSharedSettings - - - The template path %1 could not be created. - Nem sikerült létrehozni a(z) %1 sablon útvonalat. - - - - An error has been encountered while parsing device profile XML: %1 - Hiba történt az eszköz profil %1 XML elemzése közben - - - - QDesignerToolWindow - - - Property Editor - Tulajdonság szerkesztő - - - - Action Editor - Tevékenység szerkesztő - - - - Object Inspector - Objektum felügyelő - - - - Resource Browser - Erőforrás böngésző - - - - Signal/Slot Editor - Jel/Szlot szerkesztő - - - - Widget Box - Widget doboz - - - - QDesignerWorkbench - - - &File - &Fájl - - - - F&orm - &Űrlap - - - - Preview in - Előnézetben - - - - &Window - &Ablak - - - - &Help - &Súgó - - - - Edit - Szerkesztés - - - - Toolbars - Eszközsávok - - - - Save Forms? - Űrlap mentése? - - - - There are %n forms with unsaved changes. Do you want to review these changes before quitting? - - %n űrlapban vannak el nem mentett változtatások. Át szeretné tekintei ezeket a változtatásokat a kilépés előtt? - - - - - &View - &Nézet - - - - &Settings - &Beállítások - - - - Widget Box - Widget doboz - - - - If you do not review your documents, all your changes will be lost. - Ha nem tekinti át újra a dokumentumokat, az összes változtatása el fog veszni. - - - - Discard Changes - Változtatások eldobása - - - - Review Changes - Változtatások áttekintése - - - - Backup Information - Archiválási információ - - - - The last session of Designer was not terminated correctly. Backup files were left behind. Do you want to load them? - A Designer utolsó szakasza nem megfelelően állt le. Archivált fájlok hagyott maga után. Be szeretné tölteni őket? - - - - The file <b>%1</b> could not be opened. - A(z) <b>%1</b> fájlt nem sikerült megnyitni. - - - - The file <b>%1</b> is not a valid Designer UI file. - A(z) <b>%1</b> fájl nem egy érvényes Designer UI fájl. - - - - QFormBuilder - - - An empty class name was passed on to %1 (object name: '%2'). - Empty class name passed to widget factory method - Egy üres osztály név volt %1-ra (objektum név: '%2'). - - - - QFormBuilder was unable to create a custom widget of the class '%1'; defaulting to base class '%2'. - QFormBuilder-nek nem sikerült létrehozni egy '%1' osztály egyéni widget-et, alapértelmezés a(z) '%2' alap osztályra. - - - - QFormBuilder was unable to create a widget of the class '%1'. - QFormBuilder-nak nem sikerült létrehoznia egy '%1' osztály widget-et. - - - - The layout type `%1' is not supported. - A(z) '%1' elrendezés terv nem támogatott. - - - - The set-type property %1 could not be read. - Nem sikerült olvasni a(z) %1 beállított típusú tulajdonságot. - - - - The enumeration-type property %1 could not be read. - A(z) %1 felsorolási típus tulajdonságot nem sikerült olvasni. - - - - Reading properties of the type %1 is not supported yet. - '%1' típus tulajdonságok olvasása még nem támogatott. - - - - The property %1 could not be written. The type %2 is not supported yet. - A(z) %1 tulajdonságot nem sikerült írni. A(z) %2 típus nem támogatott még. - - - - QStackedWidgetEventFilter - - - Previous Page - Előző lap - - - - Next Page - Következő lap - - - - Delete - Törlés - - - - Before Current Page - Aktuális lap előtt - - - - After Current Page - Aktuális lap után - - - - Change Page Order... - Lap sorrend megváltoztatása... - - - - Change Page Order - Lap sorrend megváltoztatása - - - - Page %1 of %2 - %2 %1 lapja - - - - - Insert Page - Lap beszúrása - - - - QStackedWidgetPreviewEventFilter - - - Go to previous page of %1 '%2' (%3/%4). - Ugrás a(z) %1 '%2' (%3/%4) előző lapjára. - - - - Go to next page of %1 '%2' (%3/%4). - Ugrás a(z) %1 '%2' (%3/%4) következő lapjára. - - - - QTabWidgetEventFilter - - - Delete - Törlés - - - - Before Current Page - Aktuális lap előtt - - - - After Current Page - Aktuális lap után - - - - Page %1 of %2 - %2 %1 lapja - - - - - Insert Page - Lap beszúrása - - - - QToolBoxHelper - - - Delete Page - Lap törlése - - - - Before Current Page - Aktuális lap előtt - - - - After Current Page - Aktuális lap után - - - - Change Page Order... - Lap sorrend megváltoztatása... - - - - Change Page Order - Lap sorrend megváltoztatása - - - - Page %1 of %2 - %2 %1 lapja - - - - Insert Page - Lap beszúrása - - - - QtBoolEdit - - - - - True - Igaz - - - - - False - Hamis - - - - QtBoolPropertyManager - - - True - Igaz - - - - False - Hamis - - - - QtCharEdit - - - Clear Char - Karakter ürítése - - - - QtColorEditWidget - - - ... - ... - - - - QtColorPropertyManager - - - Red - Piros - - - - Green - Zöld - - - - Blue - Kék - - - - Alpha - Alfa - - - - QtCursorDatabase - - - Arrow - Nyíl - - - - Up Arrow - Felfele nyíl - - - - Cross - Kereszt - - - - Wait - Várakozás - - - - IBeam - IBeam - - - - Size Vertical - Vertikális méret - - - - Size Horizontal - Horizontális méret - - - - Size Backslash - Visszaper méret - - - - Size Slash - Per méret - - - - Size All - Az összes méret - - - - Blank - Üres - - - - Split Vertical - Vertikális feldarabolás - - - - Split Horizontal - Horizontális feldarabolás - - - - Pointing Hand - Mutató kéz - - - - Forbidden - Tiltott - - - - Open Hand - Nyitott kéz - - - - Closed Hand - Zárt kéz - - - - What's This - Mi ez - - - - Busy - Elfoglalt - - - - QtFontEditWidget - - - ... - ... - - - - Select Font - Betű kiválasztása - - - - QtFontPropertyManager - - - Family - Család - - - - Point Size - Pont méret - - - - Bold - Félkövér - - - - Italic - Dőlt - - - - Underline - Aláhúzás - - - - Strikeout - Kitalálás - - - - Kerning - Szóközökkel feltöltés - - - - QtGradientDialog - - - Edit Gradient - Meredekség szerkesztése - - - - QtGradientEditor - - - Start X - X indítása - - - - Start Y - Y indítása - - - - Final X - Végső X - - - - Final Y - Végső Y - - - - - Central X - X középpont - - - - - Central Y - Y középpont - - - - Focal X - X gyújtópont - - - - Focal Y - Y gyújtópont - - - - Radius - Sugár - - - - Angle - Szög - - - - Linear - Lineáris - - - - Radial - Sugárirányú - - - - Conical - Kúp alakú - - - - Pad - Lyuk - - - - Repeat - Megismétlés - - - - Reflect - Prizma - - - - Form - Űrlap - - - - Gradient Editor - Meredekség szerkesztő - - - - This area shows a preview of the gradient being edited. It also allows you to edit parameters specific to the gradient's type such as start and final point, radius, etc. by drag & drop. - Ez a mező jeleníti meg a meredekség egy előzetének szerkesztését. Ez engedélyezi a meredekség típusához tartozó paraméter specifikus dolgok szerkesztését, mint a kezdő és végpont, sugár, stb. a fogd & vidd módszerrel. - - - - 1 - 1 - - - - 2 - 2 - - - - 3 - 3 - - - - 4 - 4 - - - - 5 - 5 - - - - Gradient Stops Editor - Meredekség leállítás szerkesztő - - - - This area allows you to edit gradient stops. Double click on the existing stop handle to duplicate it. Double click outside of the existing stop handles to create a new stop. Drag & drop the handle to reposition it. Use right mouse button to popup context menu with extra actions. - Ez a mező engedélyezi a meredekség leállításának szerkesztését.Dupla kattintás a létező leállítás kezelőn duplikálja ezt. Dupla kattintás a létező leállítás kezelőn kívül létrehoz egy új leállítást. Fogd & vidd az újrapozíciónálo kezelőt. Használja a jobb egér gombot a felugró menü összefüggéshez extra tevékenységekkel. - - - - Zoom - Zoom - - - - - Reset Zoom - Újraindítás zoom - - - - Position - Pozíció - - - - - - Hue - Színárnyalat - - - - H - H - - - - - Saturation - Telítettség - - - - S - S - - - - Sat - Sat - - - - - Value - Érték - - - - V - V - - - - Val - Val - - - - - - Alpha - Alfa - - - - A - A - - - - Type - Típus - - - - Spread - Kiterjedés - - - - Color - Szín - - - - Current stop's color - Aktuális leállítás színe - - - - Show HSV specification - HSV specifikáció megjelenítése - - - - HSV - HSV - - - - Show RGB specification - RGB specifikáció megjelenítése - - - - RGB - RGB - - - - Current stop's position - Aktuális leállítás pozíciója - - - - % - % - - - - Zoom In - Nagyítás - - - - Zoom Out - Kicsinyítés - - - - Toggle details extension - Részlet kiterjesztések kapcsolgatása - - - - > - > - - - - Linear Type - Lineáris típus - - - - - - - - - ... - ... - - - - Radial Type - Sugárirányú típus - - - - Conical Type - Kúp alakú típus - - - - Pad Spread - Lyuk kiterjedés - - - - Repeat Spread - Ismétlési kiterjedés - - - - Reflect Spread - Prizma kiterjedés - - - - QtGradientStopsWidget - - - New Stop - Új leállítás - - - - Delete - Törlés - - - - Flip All - Az összes feldobása - - - - Select All - Az összes kiválasztása - - - - Zoom In - Nagyítás - - - - Zoom Out - Kicsinyítés - - - - Reset Zoom - Zoom újraindítása - - - - QtGradientView - - - Grad - Diplomás - - - - Remove Gradient - Meredekség eltávolítása - - - - Are you sure you want to remove the selected gradient? - El szeretné távolítani a kiválasztott meredekséget? - - - - - New... - Új... - - - - - Edit... - Szerkesztés... - - - - - Rename - Átnevezés - - - - - Remove - Eltávolítás - - - - Gradient View - Meredekség nézet - - - - QtGradientViewDialog - - - Select Gradient - Meredekség kiválasztása - - - - QtKeySequenceEdit - - - Clear Shortcut - Gyorsbillentyű kitisztítása - - - - QtLocalePropertyManager - - - %1, %2 - %1, %2 - - - - Language - Nyelv - - - - Country - Ország - - - - QtPointFPropertyManager - - - (%1, %2) - (%1, %2) - - - - X - X - - - - Y - Y - - - - QtPointPropertyManager - - - (%1, %2) - (%1, %2) - - - - X - X - - - - Y - Y - - - - QtPropertyBrowserUtils - - - [%1, %2, %3] (%4) - [%1, %2, %3] (%4) - - - - [%1, %2] - [%1, %2] - - - - QtRectFPropertyManager - - - [(%1, %2), %3 x %4] - [(%1, %2), %3 x %4] - - - - X - X - - - - Y - Y - - - - Width - Szélesség - - - - Height - Magasság - - - - QtRectPropertyManager - - - [(%1, %2), %3 x %4] - [(%1, %2), %3 x %4] - - - - X - X - - - - Y - Y - - - - Width - Szélesség - - - - Height - Magasság - - - - QtResourceEditorDialog - - - %1 already exists. -Do you want to replace it? - %1 már létezik. -Le szeretné cserélni? - - - - The file does not appear to be a resource file; element '%1' was found where '%2' was expected. - A fájl nem egy erőforrás fájl, '%1' elem található, ahol '%2' a várt. - - - - %1 [read-only] - %1 [csak olvasható] - - - - - %1 [missing] - %1 [hiányzik] - - - - <no prefix> - <nincs előtag> - - - - - New Resource File - Új erőforrás fájl - - - - - Resource files (*.qrc) - Erőforrás fájlok (*.qrc) - - - - Import Resource File - Erőforrás fájl importálása - - - - newPrefix - újElőtag - - - - <p><b>Warning:</b> The file</p><p>%1</p><p>is outside of the current resource file's parent directory.</p> - <p><b>Figyelmeztetés:</b> A(z)</p><p>%1</p><p>fájl az aktuális erőforrás fájl szülő könyvtárán kívül helyezkedik el.</p> - - - - <p>To resolve the issue, press:</p><table><tr><th align="left">Copy</th><td>to copy the file to the resource file's parent directory.</td></tr><tr><th align="left">Copy As...</th><td>to copy the file into a subdirectory of the resource file's parent directory.</td></tr><tr><th align="left">Keep</th><td>to use its current location.</td></tr></table> - <p>A hiba megoldásához, nyomja le a következőt:</p><table><tr><th align="left">Másolás</th><td>a fájl erőforrás fájljának szülőkönyvtárába másoláshoz.</td></tr><tr><th align="left">Másolás másként...</th><td>a fájl erőforrás fájljának szülőkönyvtárának egy alkönyvtárába másoláshoz.</td></tr><tr><th align="left">Megtartás</th><td>az aktuális helyének használatához. </td></tr></table> - - - - Add Files - Fájlok hozzáadása - - - - Incorrect Path - Helytelen útvonal - - - - - - - Copy - Másolás - - - - Copy As... - Másolás, mint... - - - - Keep - Megtartás - - - - Skip - Kihagyás - - - - Clone Prefix - Előtag klónozása - - - - Enter the suffix which you want to add to the names of the cloned files. -This could for example be a language extension like "_de". - Gépelje be az utótagot, melyet hozzá akar adni a klónozott fájl nevekhez. -Ez például egy nyelv kiterjesztés lenne, úgy mint "_de". - - - - - Copy As - Másolás, mint - - - - <p>The selected file:</p><p>%1</p><p>is outside of the current resource file's directory:</p><p>%2</p><p>Please select another path within this directory.<p> - <p>A kiválaszott fájl:</p><p>%1</p><p>az aktuális erőforrás fájl könytárán kívül helyezkedik el:</p><p>%2</p><p>Kérem válasszon másik útvonalat ezen a könyvtáron belül.<p> - - - - Could not overwrite %1. - Nem sikerült felülírni %1. - - - - Could not copy -%1 -to -%2 - Nem sikerült másolni -%1 -ide -%2 - - - - A parse error occurred at line %1, column %2 of %3: -%4 - Egy elemzési hiba történt %3 %1 sorában, %2 oszlopában: -%4 - - - - Save Resource File - Erőforrás fájl mentése - - - - Could not write %1: %2 - Nem sikerült írni %1: %2 - - - - Edit Resources - Erőforrások szerkesztése - - - - New... - Új... - - - - Open... - Megnyitás... - - - - Open Resource File - Erőforrás fájl megnyitása - - - - - Remove - Eltávolítás - - - - - Move Up - Mozgatás felfelé - - - - - Move Down - Mozgatás lefelé - - - - - Add Prefix - Előtag hozzáadása - - - - Add Files... - Fájlok hozzáadása... - - - - Change Prefix - Előtag megváltoztatása - - - - Change Language - Nyelv megváltoztatása - - - - Change Alias - Álnév megváltoztatása - - - - Clone Prefix... - Előtag klónozása... - - - - Prefix / Path - Előtag / Útvonal - - - - Language / Alias - Nyelv / Álnév - - - - <html><p><b>Warning:</b> There have been problems while reloading the resources:</p><pre>%1</pre></html> - <html><p><b>Figyelmeztetés:</b> Hibák történtek az erőforrások újra töltése közben:</p><pre>%1</pre></html> - - - - Resource Warning - Erőforrás figyelmeztetés - - - - Dialog - Párbeszéd ablak - - - - New File - Új fájl - - - - - N - N - - - - Remove File - Fájl eltávolítása - - - - - R - R - - - - I - I - - - - New Resource - Új erőforrás - - - - A - A - - - - Remove Resource or File - Erőforrás vagy fájl eltávolítása - - - - QtResourceView - - - Size: %1 x %2 -%3 - Méret: %1 x %2 -%3 - - - - Edit Resources... - Erőforrások szerkesztése... - - - - Reload - Újratöltés - - - - Copy Path - Útvonal másolása - - - - QtResourceViewDialog - - - Select Resource - Erőforrás kiválasztása - - - - QtSizeFPropertyManager - - - %1 x %2 - %1 x %2 - - - - Width - Szélesség - - - - Height - Magasság - - - - QtSizePolicyPropertyManager - - - - <Invalid> - <Érvénytelen> - - - - [%1, %2, %3, %4] - [%1, %2, %3, %4] - - - - Horizontal Policy - Horizontális irányvonal - - - - Vertical Policy - Vertikális irányelv - - - - Horizontal Stretch - Horizontális terjedelem - - - - Vertical Stretch - Vertikális terjedelem - - - - QtSizePropertyManager - - - %1 x %2 - %1 x %2 - - - - Width - Szélesség - - - - Height - Magasság - - - - QtToolBarDialog - - - Custom Toolbar - Egyéni eszköz sáv - - - - < S E P A R A T O R > - < E L V Á L A S Z T Ó > - - - - Customize Toolbars - Eszköz sávok testreszabása - - - - 1 - 1 - - - - Actions - Tevékenységek - - - - Toolbars - Eszköz sávok - - - - Add new toolbar - Új eszköz sáv hozzáadása - - - - New - Új - - - - Remove selected toolbar - Kiválaszott eszköz sáv eltávolítás - - - - Remove - Eltávolítás - - - - Rename toolbar - Eszköz sáv átnevezése - - - - Rename - Átnevezés - - - - Move action up - Tevékenység mozgatása felfelé - - - - Up - Fel - - - - Remove action from toolbar - Tevékenység eltávolítása az eszköz sávról - - - - <- - <- - - - - Add action to toolbar - Tevékenység hozzáadása az eszközsávhoz - - - - -> - -> - - - - Move action down - Tevékenység mozgatása felfele - - - - Down - Le - - - - Current Toolbar Actions - Aktuális eszköz sáv tevékenységek - - - - QtTreePropertyBrowser - - - Property - Tulajdonság - - - - Value - Érték - - - - SaveFormAsTemplate - - - Add path... - Útvonal hozzáadása... - - - - Template Exists - A sablon létezik - - - - A template with the name %1 already exists. -Do you want overwrite the template? - Egy %1 nevű sablon már létezik. -Felül szeretné írni a sablont? - - - - Overwrite Template - Sablom felülírása - - - - Open Error - Megnyitási hiba - - - - There was an error opening template %1 for writing. Reason: %2 - Hiba történt a(z) %1 sablon írásra megnyitása közben. Ok: %2 - - - - Write Error - Írása hiba - - - - There was an error writing the template %1 to disk. Reason: %2 - Hiba történt a(z) %1 sablon lemezre írása közben. Ok: %2 - - - - Pick a directory to save templates in - Egy könyvtár gondos kiválasztása, melybe a könytárak lesznek elmentve - - - - Save Form As Template - Az űrlap sablonként mentése - - - - &Category: - &Kategória: - - - - &Name: - &Név: - - - - ScriptErrorDialog - - - An error occurred while running the scripts for "%1": - - Hiba történt a szkriptek futtatása közben '%1'-re: - - - - SelectSignalDialog - - - Go to slot - Szlotra ugrás - - - - Select signal - Jel kiválasztása - - - - signal - jel - - - - class - osztály - - - - SignalSlotConnection - - - SENDER(%1), SIGNAL(%2), RECEIVER(%3), SLOT(%4) - KÜLDŐ(%1), JEL(%2), FOGADÓ(%3), SZLOT(%4) - - - - SignalSlotDialogClass - - - Signals and slots - Jelek és szlotok - - - - Slots - Szlotok - - - - - Add - Hozzáadás - - - - - - - ... - ... - - - - - Delete - Törlés - - - - Signals - Jelek - - - - Spacer - - - Horizontal Spacer '%1', %2 x %3 - Horizontális távtartók '%1', %2 x %3 - - - - Vertical Spacer '%1', %2 x %3 - Vertikális távtartók '%1', %2 x %3 - - - - TemplateOptionsPage - - - Template Paths - Tab in preferences dialog - Слово "пути" опустил, т.к. с другими вкладками не перепутать, а длинная вкладка не смотрится. - Sablon útvonalak - - - - ToolBarManager - - - Configure Toolbars... - Eszköz sávok konfigurálása... - - - - Window - Ablak - - - - Help - Súgó - - - - Style - Stílus - - - - Dock views - Dokk nézetek - - - - Toolbars - Eszköz sávok - - - - VersionDialog - - - <h3>%1</h3><br/><br/>Version %2 - <h3>%1</h3><br/><br/>Verzió %2 - - - - Qt Designer - Qt Designer - - - - <br/>Qt Designer is a graphical user interface designer for Qt applications.<br/> - <br/>Qt Designer egy grafikus felhasználói felület tervező Qt alkalmazásokhoz.<br/> - - - - %1<br/>Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). - %1<br/>Szerzői jog (C) 2010 Nokia vállalat és/vagy leányvállalata(i). - - - - WidgetDataBase - - - The file contains a custom widget '%1' whose base class (%2) differs from the current entry in the widget database (%3). The widget database is left unchanged. - A fájl egy egyéni '%1' widget-t tartalmaz, aminek az alap osztálya (%2) különbözik az aktuális beviteltől a widget adatbázisban (%3). A widget adatbázis változatlanul lett hagyva. - - - - qdesigner_internal::ActionEditor - - - New... - Új... - - - - Edit... - Szerkesztés... - - - - Go to slot... - Ugrás a szlotra... - - - - Copy - Másolás - - - - Cut - Kivágás - - - - Paste - Beillesztés - - - - Select all - Az összes kiválasztása - - - - Delete - Törlés - - - - Actions - Tevékenységek - - - - Configure Action Editor - Tevékenység szerkesztő konfigurálása - - - - Icon View - Ikon nézet - - - - Detailed View - Részletezett nézet - - - - New action - Új tevékenység - - - - Edit action - Tevékenység szerkesztése - - - - Remove action '%1' - '%1' tevékenység eltávolítása - - - - Remove actions - Tevékenységek eltávolítása - - - - Used In - Használva ebben - - - - qdesigner_internal::ActionModel - - - Name - Név - - - - Used - Használt - - - - Text - Szöveg - - - - Shortcut - Rövidebb út - - - - Checkable - Leellenőrizhető - - - - ToolTip - Eszköz tipp - - - - qdesigner_internal::BrushManagerProxy - - - The element '%1' is missing the required attribute '%2'. - A(z) '%1' elem hiányzik, a szükséges attribútum '%2'. - - - - Empty brush name encountered. - Üres kefe nevet talált. - - - - An unexpected element '%1' was encountered. - Egy '%1' váratlan elemet talált. - - - - An error occurred when reading the brush definition file '%1' at line line %2, column %3: %4 - Hiba történt a(z) '%1' ecset definíciós fájl olvasása közben %2 sorban, %3 oszlopban: %4 - - - - An error occurred when reading the resource file '%1' at line %2, column %3: %4 - Hiba történt a(z) '%1' erőforrás fájl olvasása közben, %2 sorban, %3 oszlopban: %4 - - - - qdesigner_internal::BuddyEditor - - - Add buddy - Haver hozzáadása - - - - Remove buddies - Haverok eltávolítása - - - - Remove %n buddies - - %n haverok eltávolítása - - - - - Add %n buddies - - %n haver hozzáadása - - - - - Set automatically - Automatikus beállítás - - - - qdesigner_internal::BuddyEditorPlugin - - - Edit Buddies - Haverok szerkesztése - - - - qdesigner_internal::BuddyEditorTool - - - Edit Buddies - Haverok szerkesztése - - - - qdesigner_internal::ButtonGroupMenu - - - Select members - Tagok kiválasztása - - - - Break - Törés - - - - qdesigner_internal::ButtonTaskMenu - - - Assign to button group - Gomb csoporthoz rendelés - - - - Button group - Gomb csoport - - - - New button group - Új gomb csoport - - - - Change text... - Szöveg megváltoztatása... - - - - None - Semmi - - - - Button group '%1' - '%1' gomb csoport - - - - qdesigner_internal::CodeDialog - - - Save... - Mentés... - - - - Copy All - Az összes másolása - - - - &Find in Text... - &Keresés szövegben... - - - - A temporary form file could not be created in %1. - Egy átmeneti űrlap fájlt nem sikerült létrehozni %1-ben. - - - - The temporary form file %1 could not be written. - A(z) %1 átmeneti űrlap fájlt nem sikerült írni. - - - - %1 - [Code] - %1 - [Kód] - - - - Save Code - Kód mentése - - - - Header Files (*.%1) - Fejállományok (*.%1) - - - - The file %1 could not be opened: %2 - A(z) %1 fájlt nem sikerült megnyitni: %2 - - - - The file %1 could not be written: %2 - A(z) %1 fájlt nem sikerült írni: %2 - - - - %1 - Error - %1 - Hiba - - - - qdesigner_internal::ColorAction - - - Text Color - Szöveg szín - - - - qdesigner_internal::ComboBoxTaskMenu - - - Edit Items... - Elemek szerkesztése... - - - - Change Combobox Contents - Combobox tartalmának megváltoztatása - - - - qdesigner_internal::CommandLinkButtonTaskMenu - - - Change description... - Leírás megváltoztatása... - - - - qdesigner_internal::ConnectionEdit - - - Select All - Az összes kiválasztása - - - - Deselect All - Az összes kijelölés eltűntetése - - - - Delete - Törlés - - - - qdesigner_internal::ConnectionModel - - - Sender - Küldő - - - - Signal - Jel - - - - Receiver - Fogadó - - - - Slot - Szlot - - - - <sender> - <küldő> - - - - <signal> - <jel> - - - - <receiver> - <fogadó> - - - - <slot> - <szlot> - - - - The connection already exists!<br>%1 - A kapcsolat már létezik!<br>%1 - - - - Signal and Slot Editor - Jel és Szlot szerkesztő - - - - qdesigner_internal::ContainerWidgetTaskMenu - - - Delete - Törlés - - - - Insert - Beszúrás - - - - Insert Page Before Current Page - Lap beszúrása az aktuális lap elé - - - - Insert Page After Current Page - Lap beszúrása az aktuális lap után - - - - Add Subwindow - Alablak hozzáadása - - - - Subwindow - Al ablak - - - - Page - Lap - - - - Page %1 of %2 - %2 %1 lapja - - - - qdesigner_internal::DPI_Chooser - - - System (%1 x %2) - System resolution - Rendszer (%1 x %2) - - - - User defined - Felhasználó által definiált - - - - x - DPI X/Y separator - x - - - - qdesigner_internal::DesignerPropertyManager - - - - AlignLeft - IgazításBalra - - - - AlignHCenter - IgazításHKözépre - - - - AlignRight - IgazításJobbra - - - - AlignJustify - IgazításFeloldása - - - - AlignTop - IgazításTetejére - - - - - AlignVCenter - IgazításVKözépre - - - - AlignBottom - IgazításAlulra - - - - %1, %2 - %1, %2 - - - - Customized (%n roles) - - Testreszabva (%n szabály) - - - - - Inherited - Örökölt - - - - Horizontal - Horizontális - - - - Vertical - Vertikális - - - - Normal Off - Normál ki - - - - Normal On - Normál be - - - - Disabled Off - Tiltás ki - - - - Disabled On - Tiltás be - - - - Active Off - Aktív ki - - - - Active On - Aktív be - - - - Selected Off - Kiválasztás ki - - - - Selected On - Kiválasztás be - - - - - translatable - fordítható - - - - - disambiguation - Nem félreérthető - - - - - comment - megjegyzés - - - - qdesigner_internal::DeviceProfileDialog - - - Device Profiles (*.%1) - Eszköz profilok (*.%1) - - - - Default - Alapértelmezett - - - - Save Profile - Profil mentése - - - - Save Profile - Error - Profil mentése - Hiba - - - - Unable to open the file '%1' for writing: %2 - Nem lehet megnyitni a(z) '%1' fájlt írásra: %2 - - - - Open profile - Profil megnyitása - - - - - Open Profile - Error - Profil megnyitása - Hiba - - - - Unable to open the file '%1' for reading: %2 - Nem lehet megnyitni a(z) '%1' fájlt olvasásra: %2 - - - - '%1' is not a valid profile: %2 - '%1' nem egy érvényes profil: %2 - - - - qdesigner_internal::Dialog - - - Dialog - Párbeszéd ablak - - - - StringList - Sztring lista - - - - New String - Új Sztring - - - - &New - &Új - - - - Delete String - Sztring törlése - - - - &Delete - &Törlés - - - - &Value: - &Érték: - - - - Move String Up - Sztring felfelé mozgatása - - - - Up - Fel - - - - Move String Down - Sztring lefelé mozgatása - - - - Down - Le - - - - qdesigner_internal::EmbeddedOptionsControl - - - None - Semmi - - - - Add a profile - Egy profil hozzáadása - - - - Edit the selected profile - A kiválasztott profil szerkesztése - - - - Delete the selected profile - A kiválasztott profil törlése - - - - Add Profile - Profil hozzáadása - - - - New profile - Új profil - - - - Edit Profile - Profil szerkesztése - - - - Delete Profile - Profil törlése - - - - Would you like to delete the profile '%1'? - Törölni szeretné a(z) '%1' profilet? - - - - Default - Alapértelmezett - - - - qdesigner_internal::FilterWidget - - - <Filter> - <Szűrő> - - - - qdesigner_internal::FormEditor - - - Resource File Changed - Erőforrás fájl megváltoztatva - - - - The file "%1" has changed outside Designer. Do you want to reload it? - A(z) '%1' fájl megváltoztatták a Designer-en kívül. Újra szeretné tölteni? - - - - qdesigner_internal::FormLayoutMenu - - - Add form layout row... - Űrlap elrendezési sor hozzáadása... - - - - qdesigner_internal::FormWindow - - - Edit contents - Tartalom szerkesztése - - - - F2 - F2 - - - - Insert widget '%1' - '%1' widget beszúrása - - - - Resize - Átméretezés - - - - - Key Move - Kulcs mozgatás - - - - Paste %n action(s) - - %n tevékenység beillesztése - - - - - Paste %n widget(s) - - %n widget beillesztése - - - - - Paste (%1 widgets, %2 actions) - Beillesztés (%1 widget-ek, %2 tevékenységek) - - - - Cannot paste widgets. Designer could not find a container without a layout to paste into. - Nem lehet beilleszteni a widget-eket. A Designer nem talált egy tárolót sem elrendezés nélküli beillesztéshez. - - - - Break the layout of the container you want to paste into, select this container and then paste again. - A tároló elrendezésének megtörése, ahová be akarja illeszteni, válassza ki ezt a tárolót és aztán illessze e újra. - - - - Paste error - Beillesztési hiba - - - - Raise widgets - Widget-ek növelése - - - - Lower widgets - Alsó widget-ek - - - - Select Ancestor - Ős kiválasztása - - - - Lay out - Elrendezés - - - - - Drop widget - Widget ejtése - - - - A QMainWindow-based form does not contain a central widget. - Egy QMainWindow alapú űrlap nem tartalmaz egy központi widget-et. - - - - qdesigner_internal::FormWindowBase - - - Delete '%1' - '%1' törlése - - - - Delete - Törlés - - - - qdesigner_internal::FormWindowManager - - - Cu&t - &Kivágás - - - - Cuts the selected widgets and puts them on the clipboard - A kiválaszott widget-ek kivágása és vágólapra helyezése - - - - &Copy - &Másolás - - - - Copies the selected widgets to the clipboard - A kiválasztott widget-ek vágólapra másolása - - - - &Paste - &Beillesztés - - - - Pastes the clipboard's contents - A vágólap tartalmának beillesztése - - - - &Delete - &Törlés - - - - Deletes the selected widgets - A kiválasztott widget-ek törlése - - - - Select &All - Az &összes kiválasztása - - - - Selects all widgets - Az összes widget kiválasztása - - - - Bring to &Front - &Előre hozás - - - - - Raises the selected widgets - A kiválaszott widget-ek növelése - - - - Send to &Back - &Visszaküldés - - - - - Lowers the selected widgets - Alsó kiválasztott widget-ek - - - - Adjust &Size - &Méret igazítása - - - - Adjusts the size of the selected widget - A kiválasztott widget méretének igazítása - - - - Lay Out &Horizontally - Elrendezés &Horizontálisan - - - - Lays out the selected widgets horizontally - A kiválaszott widget-ek horizontális elrendezése - - - - Lay Out &Vertically - Elrendezés &vertikálisan - - - - Lays out the selected widgets vertically - A kiválaszott widget-ek vertikális elrendezése - - - - Lay Out in a &Form Layout - Elrendezés egy &Űrlap elrendezésben - - - - Lays out the selected widgets in a form layout - A kiválaszott widget-ek elrendezése egy űrlap elrendezésben - - - - Lay Out in a &Grid - Elrendezés egy &rácsban - - - - Lays out the selected widgets in a grid - A kiválasztott widget-ek elrendezése egy rácsban - - - - Lay Out Horizontally in S&plitter - Elrendezés Horizontálisan a &csúszkában - - - - Lays out the selected widgets horizontally in a splitter - A kiválasztott widget-ek horizontális elrendezése egy csúszkában - - - - Lay Out Vertically in Sp&litter - Elrendezés vertikálisan egy &csúszkában - - - - Lays out the selected widgets vertically in a splitter - A kiválaszott widget-ek vertikális elrendezése egy csúszkában - - - - &Break Layout - Elrendezés &törése - - - - Breaks the selected layout - A kiválaszott elrendezés törése - - - - Si&mplify Grid Layout - Egy&szerűsített rács elrendezés - - - - Removes empty columns and rows - Üres oszlopok és sorok eltávolítása - - - - &Preview... - &Előnézet... - - - - Preview current form - Aktuális űrlap előnézet - - - - Form &Settings... - Űrlap &beállítások... - - - - Break Layout - Elrendezés törése - - - - Adjust Size - Méret igazítása - - - - Could not create form preview - Title of warning message box - Nem sikerült létrehozni az űrlap előnézetet - - - - Form Settings - %1 - Űrlap beállítások - %1 - - - - qdesigner_internal::FormWindowSettings - - - None - Semmi - - - - Device Profile: %1 - Eszköz profil: %1 - - - - qdesigner_internal::GridPanel - - - Form - Űrlap - - - - Grid - Rács - - - - Visible - Látható - - - - Grid &X - Rács &X - - - - - Snap - Bepattintás - - - - Reset - Újraindítás - - - - Grid &Y - Rács &Y - - - - qdesigner_internal::GroupBoxTaskMenu - - - Change title... - Cím változtatása... - - - - qdesigner_internal::HtmlTextEdit - - - Insert HTML entity - HTML entitás beszúrása - - - - qdesigner_internal::IconSelector - - - The pixmap file '%1' cannot be read. - A(z) '%1' pixmap fájlt nem lehet olvasni. - - - - The file '%1' does not appear to be a valid pixmap file: %2 - A(z) '%1' fájlt nem egy érvényes pixmap fájl: %2 - - - - The file '%1' could not be read: %2 - A(z) '%1' fájlt nem sikerült olvasni: %2 - - - - Choose a Pixmap - Egy pixmap kiválasztása - - - - Pixmap Read Error - Pixmap olvasási hiba - - - - ... - ... - - - - Normal Off - Normál ki - - - - Normal On - Normál be - - - - Disabled Off - Tiltás ki - - - - Disabled On - Tiltás be - - - - Active Off - Aktív ki - - - - Active On - Aktív be - - - - Selected Off - Kiválaszott ki - - - - Selected On - Kiválaszott be - - - - Choose Resource... - Erőforrás kiválasztása... - - - - Choose File... - Fájl kiválasztása... - - - - Reset - Újraindítás - - - - Reset All - Az összes újraindítása - - - - qdesigner_internal::ItemListEditor - - - Properties &<< - Tulajdonságok &<< - - - - - Properties &>> - Tulajdonságok &>> - - - - Items List - Elem lista - - - - New Item - Új elem - - - - &New - &Új - - - - Delete Item - Elem törlése - - - - &Delete - &Törlés - - - - Move Item Up - Elem mozgatása felfelé - - - - U - U - - - - Move Item Down - Elem mozgatása lefelé - - - - D - D - - - - qdesigner_internal::LabelTaskMenu - - - Change rich text... - Gazdag szöveg választása... - - - - Change plain text... - Egyszerű szöveg választása... - - - - qdesigner_internal::LanguageResourceDialog - - - Choose Resource - Erőforrás kiválasztása - - - - qdesigner_internal::LineEditTaskMenu - - - Change text... - Szöveg kiválasztása... - - - - qdesigner_internal::ListWidgetEditor - - - New Item - Új elem - - - - Edit List Widget - Widget szerkesztési lista - - - - Edit Combobox - Combobox szerkesztése - - - - qdesigner_internal::ListWidgetTaskMenu - - - Edit Items... - Elemek szerkesztése... - - - - Change List Contents - Tartalom változtatási lista - - - - qdesigner_internal::MdiContainerWidgetTaskMenu - - - Next Subwindow - Új alablak - - - - Previous Subwindow - Előző alablak - - - - Tile - Cserép - - - - Cascade - Kaszkád - - - - qdesigner_internal::MenuTaskMenu - - - Remove - Eltávolítás - - - - qdesigner_internal::MorphMenu - - - Morph into - Morph into - - - - qdesigner_internal::NewActionDialog - - - New Action... - Új tevékenység... - - - - &Text: - &Szöveg: - - - - Object &name: - Objektum &név: - - - - &Icon: - &Ikon: - - - - Shortcut: - Rövidebb út: - - - - Checkable: - Ellenőrizhető: - - - - ToolTip: - Eszköz tipp: - - - - - ... - ... - - - - qdesigner_internal::NewDynamicPropertyDialog - - - Set Property Name - Tulajdonság nevének beállítása - - - - The current object already has a property named '%1'. -Please select another, unique one. - Az aktuális objektumnak már van egy '%1' nevű tulajdonsága. -Kérem válasszon másikat, egy egyedülállót. - - - - The '_q_' prefix is reserved for the Qt library. -Please select another name. - Az '_q_' előtag foglalt a Qt könyvtárhoz. -Kérem válasszon másikat. - - - - Create Dynamic Property - Dinamikus tulajdonság létrehozása - - - - Property Name - Tulajdonság Neve - - - - horizontalSpacer - horizontálisTávtartó - - - - Property Type - Tulajdonság Típusa - - - - qdesigner_internal::NewFormWidget - - - Default size - Alapértelmezett méret - - - - QVGA portrait (240x320) - QVGA portré (240x320) - - - - QVGA landscape (320x240) - QVGA tájkép (320x240) - - - - VGA portrait (480x640) - VGA portré (480x640) - - - - VGA landscape (640x480) - VGA tájkép: (640x480) - - - - Widgets - New Form Dialog Categories - Widget-ek - - - - Custom Widgets - Egyéni Widget-ek - - - - None - Semmi - - - - Error loading form - Hiba történt az űrlap betöltése közben - - - - Unable to open the form template file '%1': %2 - Nem lehet megnyitni a(z) '%1' űrlap sablon fájlt: %2 - - - - Internal error: No template selected. - Belső hiba: Nincsen sablon kiválasztva. - - - - 0 - 0 - - - - Choose a template for a preview - Válasszon egy sablont egy előnézetre - - - - Embedded Design - Beágyazott tervezés - - - - Device: - Eszköz: - - - - Screen Size: - Képernyő méret: - - - - qdesigner_internal::NewPromotedClassPanel - - - Add - Hozzáadás - - - - New Promoted Class - Új támogatott osztály - - - - Base class name: - Alap osztály név: - - - - Promoted class name: - Támogatott osztály neve: - - - - Header file: - Fejállomány: - - - - Global include - Globális include - - - - Reset - Újraindítás - - - - qdesigner_internal::ObjectInspector - - - &Find in Text... - &Keresés a szövegben... - - - - qdesigner_internal::ObjectInspector::ObjectInspectorPrivate - - - Change Current Page - Aktuális lap megváltoztatása - - - - qdesigner_internal::OrderDialog - - - Index %1 (%2) - Index %1 (%2) - - - - %1 %2 - %1 %2 - - - - Change Page Order - Lap sorrend megváltoztatása - - - - Page Order - Lap sorrend - - - - Move page up - Lap mozgatása felfelé - - - - Move page down - Lap mozgatása lefelé - - - - qdesigner_internal::PaletteEditor - - - Edit Palette - Paletta szerkesztése - - - - Tune Palette - Paletta finomhangolása - - - - Show Details - Részletek megjelenítése - - - - Compute Details - Számítási részletek - - - - Quick - Gyors - - - - Preview - Előnézet - - - - Disabled - Tiltott - - - - Inactive - Inaktív - - - - Active - Aktív - - - - qdesigner_internal::PaletteEditorButton - - - Change Palette - Paletta megváltoztatása - - - - qdesigner_internal::PaletteModel - - - Color Role - Szín szabály - - - - Active - Aktív - - - - Inactive - Inaktív - - - - Disabled - Tiltott - - - - qdesigner_internal::PixmapEditor - - - Choose Resource... - Erőforrás kiválasztása... - - - - Choose File... - Fájl kiválasztása... - - - - Copy Path - Útvonal kiválasztása - - - - Paste Path - Útvonal beillesztése - - - - - ... - ... - - - - qdesigner_internal::PlainTextEditorDialog - - - Edit text - Szöveg szerkesztése - - - - qdesigner_internal::PluginDialog - - - Components - Komponensek - - - - Plugin Information - Beépülő modul információ - - - - Refresh - Felfrissítés - - - - Scan for newly installed custom widget plugins. - Újonnan telepített egyéni widget beépülő modulok letapogatása. - - - - Qt Designer couldn't find any plugins - Qt Designer nem talált egyetlen beépülő modult sem - - - - Qt Designer found the following plugins - Qt Designer a következő beépülő modulokat találta - - - - New custom widget plugins have been found. - Új egyéni widget betöltő modul talált. - - - - qdesigner_internal::PreviewActionGroup - - - %1 Style - %1 Stílus - - - - qdesigner_internal::PreviewConfigurationWidget - - - Default - Alapértelmezett - - - - None - Semmi - - - - Browse... - Böngészés... - - - - qdesigner_internal::PreviewConfigurationWidget::PreviewConfigurationWidgetPrivate - - - Load Custom Device Skin - Egyéni eszköz szkin betöltése - - - - All QVFB Skins (*.%1) - Az összes QVFB szkin (*.%1) - - - - %1 - Duplicate Skin - %1 - Duplikált szkin - - - - The skin '%1' already exists. - A(z) '%1' szkin már létezik. - - - - %1 - Error - %1 - Hiba - - - - %1 is not a valid skin directory: -%2 - %1 nem egy érvényes szkin könyvtár: -%2 - - - - qdesigner_internal::PreviewDeviceSkin - - - &Portrait - - - - - Landscape (&CCW) - Rotate form preview counter-clockwise - - - - - &Landscape (CW) - Rotate form preview clockwise - - - - - &Close - &Bezárás - - - - qdesigner_internal::PreviewManager - - - %1 - [Preview] - - - - - qdesigner_internal::PreviewMdiArea - - - The moose in the noose -ate the goose who was loose. - Palette editor background - - - - - qdesigner_internal::PreviewWidget - - - Preview Window - - - - - LineEdit - - - - - ComboBox - - - - - PushButton - - - - - ButtonGroup2 - - - - - CheckBox1 - - - - - CheckBox2 - - - - - ButtonGroup - - - - - RadioButton1 - - - - - RadioButton2 - - - - - RadioButton3 - - - - - qdesigner_internal::PromotionModel - - - Name - - - - - Header file - - - - - Global include - - - - - Usage - - - - - qdesigner_internal::PromotionTaskMenu - - - Promoted widgets... - - - - - Promote to ... - - - - - Change signals/slots... - - - - - Promote to - - - - - Demote to %1 - - - - - qdesigner_internal::PropertyEditor - - - Add Dynamic Property... - - - - - Remove Dynamic Property - - - - - Sorting - - - - - Color Groups - - - - - Tree View - - - - - Drop Down Button View - - - - - String... - - - - - Bool... - - - - - Other... - - - - - Configure Property Editor - - - - - Object: %1 -Class: %2 - - - - - qdesigner_internal::PropertyLineEdit - - - Insert line break - - - - - qdesigner_internal::QDesignerPromotionDialog - - - Promoted Widgets - - - - - Promoted Classes - - - - - Promote - - - - - Change signals/slots... - - - - - %1 - Error - - - - - qdesigner_internal::QDesignerResource - - - Loading qrc file - - - - - The specified qrc file <p><b>%1</b></p><p>could not be found. Do you want to update the file location?</p> - - - - - New location for %1 - - - - - Resource files (*.qrc) - - - - - qdesigner_internal::QDesignerTaskMenu - - - Change objectName... - - - - - Change toolTip... - - - - - Change whatsThis... - - - - - Change styleSheet... - - - - - Create Menu Bar - - - - - Add Tool Bar - - - - - Create Status Bar - - - - - Remove Status Bar - - - - - Change script... - - - - - Change signals/slots... - - - - - Go to slot... - - - - - Size Constraints - - - - - Set Minimum Width - - - - - Set Minimum Height - - - - - Set Minimum Size - - - - - Set Maximum Width - - - - - Set Maximum Height - - - - - Set Maximum Size - - - - - Edit ToolTip - - - - - Edit WhatsThis - - - - - no signals available - - - - - Set size constraint on %n widget(s) - - - - - - - qdesigner_internal::QDesignerWidgetBox - - - - Unexpected element <%1> - - - - - A parse error occurred at line %1, column %2 of the XML code specified for the widget %3: %4 -%5 - - - - - The XML code specified for the widget %1 does not contain any widget elements. -%2 - - - - - An error has been encountered at line %1 of %2: %3 - - - - - Unexpected element <%1> encountered when parsing for <widget> or <ui> - - - - - Unexpected end of file encountered when parsing widgets. - - - - - A widget element could not be found. - - - - - qdesigner_internal::QtGradientStopsController - - - H - - - - - S - - - - - V - - - - - - Hue - - - - - Sat - - - - - Val - - - - - Saturation - - - - - Value - - - - - R - - - - - G - - - - - B - - - - - Red - - - - - Green - - - - - Blue - - - - - qdesigner_internal::RichTextEditorDialog - - - Edit text - - - - - Rich Text - - - - - Source - - - - - &OK - - - - - &Cancel - - - - - qdesigner_internal::RichTextEditorToolBar - - - Bold - - - - - CTRL+B - - - - - Italic - - - - - CTRL+I - - - - - Underline - - - - - CTRL+U - - - - - Left Align - - - - - Center - - - - - Right Align - - - - - Justify - - - - - Superscript - - - - - Subscript - - - - - Insert &Link - - - - - Insert &Image - - - - - qdesigner_internal::ScriptDialog - - - Edit script - - - - - <html>Enter a Qt Script snippet to be executed while loading the form.<br>The widget and its children are accessible via the variables <i>widget</i> and <i>childWidgets</i>, respectively. - - - - - Syntax error - - - - - qdesigner_internal::ScriptErrorDialog - - - Script errors - - - - - qdesigner_internal::SignalSlotDialog - - - There is already a slot with the signature '%1'. - - - - - There is already a signal with the signature '%1'. - - - - - %1 - Duplicate Signature - - - - - - Signals/Slots of %1 - - - - - qdesigner_internal::SignalSlotEditorPlugin - - - Edit Signals/Slots - - - - - F4 - - - - - qdesigner_internal::SignalSlotEditorTool - - - Edit Signals/Slots - - - - - qdesigner_internal::StatusBarTaskMenu - - - Remove - - - - - qdesigner_internal::StringListEditorButton - - - Change String List - - - - - qdesigner_internal::StyleSheetEditorDialog - - - - Valid Style Sheet - - - - - Add Resource... - - - - - Add Gradient... - - - - - Add Color... - - - - - Add Font... - - - - - Edit Style Sheet - - - - - Invalid Style Sheet - - - - - qdesigner_internal::TabOrderEditor - - - Start from Here - - - - - Restart - - - - - Tab Order List... - - - - - Tab Order List - - - - - Tab Order - - - - - qdesigner_internal::TabOrderEditorPlugin - - - Edit Tab Order - - - - - qdesigner_internal::TabOrderEditorTool - - - Edit Tab Order - - - - - qdesigner_internal::TableWidgetEditor - - - - Properties &>> - - - - - Edit Table Widget - - - - - &Items - - - - - Table Items - - - - - New Column - - - - - New Row - - - - - &Columns - - - - - &Rows - - - - - Properties &<< - - - - - qdesigner_internal::TableWidgetTaskMenu - - - Edit Items... - - - - - qdesigner_internal::TemplateOptionsWidget - - - Pick a directory to save templates in - - - - - Form - - - - - Additional Template Paths - - - - - - ... - - - - - qdesigner_internal::TextEditTaskMenu - - - Edit HTML - - - - - Change HTML... - - - - - Edit Text - - - - - Change Plain Text... - - - - - qdesigner_internal::TextEditor - - - Choose Resource... - - - - - Choose File... - - - - - ... - - - - - Choose a File - - - - - qdesigner_internal::ToolBarEventFilter - - - Insert Separator before '%1' - - - - - Append Separator - - - - - Remove action '%1' - - - - - Remove Toolbar '%1' - - - - - Insert Separator - - - - - qdesigner_internal::TreeWidgetEditor - - - New Column - - - - - &Columns - - - - - Per column properties - - - - - Common properties - - - - - - New Item - - - - - - New Subitem - - - - - Properties &<< - - - - - - Properties &>> - - - - - Edit Tree Widget - - - - - &Items - - - - - Tree Items - - - - - 1 - - - - - &New - - - - - New &Subitem - - - - - Delete Item - - - - - &Delete - - - - - Move Item Left (before Parent Item) - - - - - L - - - - - Move Item Right (as a First Subitem of the Next Sibling Item) - - - - - R - - - - - Move Item Up - - - - - U - - - - - Move Item Down - - - - - D - - - - - qdesigner_internal::TreeWidgetTaskMenu - - - Edit Items... - - - - - qdesigner_internal::WidgetBox - - - Warning: Widget creation failed in the widget box. This could be caused by invalid custom widget XML. - - - - - qdesigner_internal::WidgetBoxTreeWidget - - - Scratchpad - - - - - Custom Widgets - - - - - Expand all - - - - - Collapse all - - - - - List View - - - - - Icon View - - - - - Remove - - - - - Edit name - - - - - qdesigner_internal::WidgetDataBase - - - A custom widget plugin whose class name (%1) matches that of an existing class has been found. - - - - - qdesigner_internal::WidgetEditorTool - - - Edit Widgets - - - - - qdesigner_internal::WidgetFactory - - - The custom widget factory registered for widgets of class %1 returned 0. - - - - - A class name mismatch occurred when creating a widget using the custom widget factory registered for widgets of class %1. It returned a widget of class %2. - - - - - %1 Widget - - - - - The current page of the container '%1' (%2) could not be determined while creating a layout.This indicates an inconsistency in the ui-file, probably a layout being constructed on a container widget. - - - - - Attempt to add a layout to a widget '%1' (%2) which already has an unmanaged layout of type %3. -This indicates an inconsistency in the ui-file. - - - - - Cannot create style '%1'. - - - - - qdesigner_internal::WizardContainerWidgetTaskMenu - - - Next - - - - - Back - - - - - qdesigner_internal::ZoomMenu - - - %1 % - Zoom factor - - - - - qdesigner_internal::ZoomablePreviewDeviceSkin - - - &Zoom - - - - diff --git a/linguist_hu.ts b/linguist_hu.ts deleted file mode 100644 index aaff893..0000000 --- a/linguist_hu.ts +++ /dev/null @@ -1,2014 +0,0 @@ - - - - - AboutDialog - - - Qt Linguist - Qt Linguist - - - - BatchTranslationDialog - - - Batch Translation of '%1' - Qt Linguist - '%1' Qt Linguist egy adat fordítása - - - - Searching, please wait... - Keresés, kérem várjon... - - - - &Cancel - &Mégse - - - - Linguist batch translator - Linguist köteg fordító - - - - Batch translated %n entries - - %n adat belépés lefordítva - - - - - Qt Linguist - Batch Translation - Qt Linguist adat fordítás - - - - Options - Opciók - - - - Set translated entries to finished - Lefordított bevitelek befejezettre állítása - - - - Retranslate entries with existing translation - Bevitelek újrafordítása létező fordításokkal - - - - Translate also finished entries - Befejezett belépéseknek is a lefordítása - - - - Phrase book preference - Fázis könyv beállítások - - - - Move up - Felfelé mozgatás - - - - Move down - Lefelé mozgatás - - - - &Run - &Futtatás - - - - Cancel - Mégse - - - - Note that the modified entries will be reset to unfinished if 'Set translated entries to finished' above is unchecked - Ne felejtse el, hogy a módosított belépések újra lesznek indítva befejezetlenre, ha a 'lefordított bevitelek befejezettre állítása' felül meg van jelölve - - - - The batch translator will search through the selected phrase books in the order given above - A köteg fordító a kiválasztott fázis könyvek között fog keresni, a fent megadott sorrendben - - - - DataModel - - - <qt>Duplicate messages found in '%1': - <qt>Dupliált üzenetek találhatóak a(z) '%1'-ben: - - - - - <p>[more duplicates omitted] - <p>[többi duplikáció kihagyása] - - - - <p>* ID: %1 - <p>* Azonosító: %1 - - - - <p>* Context: %1<br>* Source: %2 - <p>* Szövegösszefüggés: %1<br>* Forrás: %2 - - - - <br>* Comment: %3 - <br>* Megjegyzés: %3 - - - - Linguist does not know the plural rules for '%1'. -Will assume a single universal form. - A Linguist nem ismeri a többes számú szabályokat a '%1'-re. Egy egyszerű univerzális formát fog feltételezni. - - - - Cannot create '%2': %1 - Nem lehet létrehozni '%2': %1 - - - - Universal Form - Univerzális forma - - - - ErrorsView - - - Accelerator possibly superfluous in translation. - A gyorsítás valószínűleg nélkülözhető a fordításban. - - - - Accelerator possibly missing in translation. - A gyorsítás valószínűleg hiányzik a fordításban. - - - - Translation does not end with the same punctuation as the source text. - A fordítás nem ugyanazzal az írásjellel végződik, mint a forrás szöveg. - - - - A phrase book suggestion for '%1' was ignored. - A(z) '%1'-re tett fáziskönyv ajánlat mellőzve lett. - - - - Translation does not refer to the same place markers as in the source text. - Nem ugyanazok a hely megjelölők találhatóak a fordításban, mint a forrás szövegben. - - - - Translation does not contain the necessary %n place marker. - A fordítás nem tartalmazza a szükséges %n hely megjelölőket. - - - - Unknown error - Ismeretlen hiba - - - - FindDialog - - - This window allows you to search for some text in the translation source file. - Ez az ablak engedélyezi, hogy szöveget keresses a fordítás forrás fájlban. - - - - Type in the text to search for. - Gépelje be szövegbe, amit keres.. - - - - Options - Opciók - - - - Source texts are searched when checked. - Forrás szövegek keresési ellenőrzéskor. - - - - Translations are searched when checked. - Fordítások keresése ellenőrzéskor. - - - - Texts such as 'TeX' and 'tex' are considered as different when checked. - 'TeX' és 'tex' szövegek különbözőként kezelése bejelöléskor. - - - - Comments and contexts are searched when checked. - Megjegyzések és tartalmak keresése bejelöléskor. - - - - Find - Keresés - - - - - &Find what: - Ennek &keresése: - - - - &Source texts - &Forrás szövegek - - - - &Translations - &Fordítások - - - - &Match case - &Egyezés - - - - &Comments - &Kommentek - - - - Ignore &accelerators - &Gyorsítások mellőzése - - - - Click here to find the next occurrence of the text you typed in. - Kattintson ide a begépelt szöveg következő előfordulásának megkereséséhez. - - - - Find Next - Következő keresése - - - - Click here to close this window. - Kattintson ide az ablak bezárásához. - - - - Cancel - Mégse - - - - - Choose Edit|Find from the menu bar or press Ctrl+F to pop up the Find dialog - Válassza ki a Szerkesztés/Keresés opciót a menüből vagy nyomja le a Ctrl+F billentyűket a keresési párbeszédablak felugrásához - - - - - FormMultiWidget - - - Alt+Delete - translate, but don't change - fordítsd, de ne változtasd - ALT+Delete - - - - Shift+Alt+Insert - translate, but don't change - Fordítsd, de ne változtasd. - Shift+Alt+Insert - - - - Alt+Insert - translate, but don't change - Alt+Insert - - - - Confirmation - Qt Linguist - Megerősítés - Qt Linguist - - - - Delete non-empty length variant? - Törölje az 0 hosszúságú változatok? - - - - LRelease - - - Dropped %n message(s) which had no ID. - - %n üzenez eldobva, melyek nem rendelkeztek azonosítóval. - - - - - Excess context/disambiguation dropped from %n message(s). - - Fölösleges szövegösszefüggés/egyértelműsítés törlése %n üzenetből. - - - - - Generated %n translation(s) (%1 finished and %2 unfinished) - - - %n fordítás legenerálása (%1 befejezett és %2 befejezetlen) - - - - - Ignored %n untranslated source text(s) - - - %n lefordítatlan forrás szöveg mellőzése - - - - - MainWindow - - - MainWindow - FőAblak - - - - &Phrases - &Fázisok - - - - &Close Phrase Book - &Fázis könyvek bezárása - - - - &Edit Phrase Book - Fázis könyvek &szerkesztése - - - - &Print Phrase Book - &Fázis könyvek nyomtatása - - - - V&alidation - &Érvényesítés - - - - &View - &Nézet - - - - Vie&ws - &Nézetek - - - - &Toolbars - &Eszköztár - - - - &Help - &Súgó - - - - &Translation - &Fordítások - - - - &File - &Fájl - - - - &Edit - &Szerkesztés - - - - &Open... - &Megnyitás... - - - - Open a Qt translation source file (TS file) for editing - Egy Qt fordítási forrás fájl (TS fájl) megnyitása szerkesztésre - - - - Ctrl+O - Ctrl+O - - - - E&xit - &Kilépés - - - - Close this window and exit. - Ablak bezárása és kilépés. - - - - Ctrl+Q - Ctrl+Q - - - - - &Save - &Mentés - - - - Save changes made to this Qt translation source file - Változtatások elmentése a Qt fordítási forrás fájlban - - - - Move to the previous unfinished item. - Az előző befejezetlen elemre mozgatás. - - - - Move to the next unfinished item. - A következő befejezetlen elemre mozgatás. - - - - Move to the previous item. - Az előző elemre mozgatás. - - - - Move to the next item. - A következő elemre mozgatás. - - - - Mark this item as done and move to the next unfinished item. - Az elem készre jelölése és a következő befejezetlen elemre mozgás. - - - - Copy from source text - Másolás forrás szövegből - - - - Toggle the validity check of accelerators, i.e. whether the number of ampersands in the source and translation text is the same. If the check fails, a message is shown in the warnings window. - Gyorsítások érvényesség ellenőrzésének kapcsolgatása, lásd vajon az et jelek száma megegyezik-e a a forrás és lefordított szövegben. Ha ez az ellenőrzés hibásan zárul le, a figyelmeztető ablakban egy üzenet tűnik fel. - - - - Toggle the validity check of ending punctuation. If the check fails, a message is shown in the warnings window. - A végződő írásjelek érvényesség ellenőrzésének kapcsolgatása. Ha ez az ellenőrzés nem sikerült, akkor egy üzenet bukkan fel a figyelmeztető ablakban. - - - - Toggle checking that phrase suggestions are used. If the check fails, a message is shown in the warnings window. - Fázis ajánlások ellenőrzésének kapcsolgatása. Ha az ellenőrzés sikertelen, akkor egy üzenet bukkan fel a figyelmeztető ablakban. - - - - Toggle the validity check of place markers, i.e. whether %1, %2, ... are used consistently in the source text and translation text. If the check fails, a message is shown in the warnings window. - A hely megjelelölők érvényesség ellenőrzésének kapcsolgatása, lásd vajon a(z) %1, %2.. következetesen vannak-e használva a forrás és lefordított szövegben. Ha az ellenőrzés sikertelen, egy üzenet bukkan fel a figyelmeztető ablakban. - - - - Open Read-O&nly... - &Csak olvasható megnyitása... - - - - &Save All - Az összes &mentése - - - - Ctrl+S - Ctrl+S - - - - - - Save &As... - &Másként mentés... - - - - Save As... - Másként mentés... - - - - Save changes made to this Qt translation source file into a new file. - A változtatások egy új fájlba mentése, amik ebben a Qt fordítási forrás fájlban keletkeztek. - - - - &Release - &Kiadás - - - - Create a Qt message file suitable for released applications from the current message file. - Qt üzenez fájl létrehozása az aktuális üzenet fájlból, ami alkalmas a kiadásra. - - - - &Print... - &Nyomtatás... - - - - Ctrl+P - Ctrl+P - - - - &Undo - &Visszacsinálás - - - - Recently Opened &Files - &Utoljára megnyitott &fájlok - - - - Save - Mentés - - - - Print a list of all the translation units in the current translation source file. - Az összes fordítási egység kinyomtatása az aktuális fordítási forrás fájlban. - - - - Undo the last editing operation performed on the current translation. - Az utoljára szerkesztett művelet visszavonása az aktuális fordításon. - - - - Ctrl+Z - Ctrl+Z - - - - &Redo - &Helyreállítás - - - - Redo an undone editing operation performed on the translation. - Szerkesztő művelet helyreállítása és visszavonása, ami az aktuális fordításon lett végrehajtva. - - - - Ctrl+Y - Ctrl+Y - - - - Cu&t - &Kivágás - - - - Copy the selected translation text to the clipboard and deletes it. - A kiválasztott fordítási szöveg vágólapra másolása és törlése. - - - - Ctrl+X - Ctrl+X - - - - &Copy - &Másolás - - - - Copy the selected translation text to the clipboard. - A kiválaszott fordítási szöveg vágólapra másolása. - - - - Ctrl+C - Ctrl+C - - - - &Paste - &Beillesztés - - - - Paste the clipboard text into the translation. - A vágólapon levő szöveg fordításba illesztése. - - - - Ctrl+V - Ctrl+V - - - - Select &All - Az &összes kiválasztása - - - - Select the whole translation text. - Az egész fordítási szöveg kiválasztása. - - - - Ctrl+A - Ctrl+A - - - - &Find... - &Keresés... - - - - Search for some text in the translation source file. - Néhány szövegre keresés a fordítási forrás fájlban. - - - - Ctrl+F - Ctrl+F - - - - Find &Next - &Következő keresése - - - - Continue the search where it was left. - A keresés folytatása ott, ahol abba lett hagyva. - - - - F3 - F3 - - - - &Prev Unfinished - Az &előző befejezetlen - - - - Close - Bezárás - - - - &Close All - Az összes &bezárása - - - - Ctrl+W - Ctrl+W - - - - Ctrl+K - Ctrl+K - - - - &Next Unfinished - &Következő befejezetlen - - - - P&rev - &Előző - - - - Ctrl+Shift+K - Ctrl+Shift+K - - - - Ne&xt - &Következő - - - - &Done and Next - &Kész és Következő - - - - Copies the source text into the translation field. - Forrás szövegek fordítási mezőbe másolása. - - - - Ctrl+B - Ctrl+B - - - - &Accelerators - &Gyorsítások - - - - &Ending Punctuation - &Vég írásjelek - - - - &Phrase matches - &Fázis egyezés - - - - Place &Marker Matches - Hely &megjelölők egyezései - - - - &New Phrase Book... - &Új fázis könyv... - - - - Create a new phrase book. - Egy új fázis könyv létrehozása. - - - - Ctrl+N - Ctrl+N - - - - &Open Phrase Book... - Fázis könyv &megnyitása... - - - - Open a phrase book to assist translation. - Fáris könyv megnyitása a fordítás támogatásával. - - - - Ctrl+H - Ctrl+H - - - - &Reset Sorting - &Rendezés helyreállítása - - - - Sort the items back in the same order as in the message file. - Az elemek visszarendezése ugyanabba a sorrendben, ahogy az üzenet fájlban található. - - - - &Display guesses - Feltételezések &kijelzése - - - - Set whether or not to display translation guesses. - Annak beállítása, hogy vajon kijelezze a fordítási feltételezéseket vagy sem. - - - - &Statistics - &Statisztikák - - - - Display translation statistics. - Fordítási statisztikák kijelzése. - - - - &Manual - &Kézi - - - - F1 - F1 - - - - About Qt Linguist - Qt Linguist-ról - - - - About Qt - Qt-ról - - - - Display information about the Qt toolkit by Trolltech. - Információ megjelenítése a Trolltech Qt eszközrendszeréről. - - - - &What's This? - &Mi ez? - - - - What's This? - Mi ez? - - - - Enter What's This? mode. - Mi ez? beviteli mód. - - - - Shift+F1 - Shift+F1 - - - - &Search And Translate... - &Keresés és fordítás... - - - - Replace the translation on all entries that matches the search source text. - A fordítások kicserélése az összes olyan helyen, ahol az megegyezik a keresett forrás szöveggel. - - - - - &Batch Translation... - &Köteg fordítás... - - - - Batch translate all entries using the information in the phrase books. - Köteg fordítás mindenhol, ahol az információ a fázis könyvekben van haszálva. - - - - - - Release As... - Kiadás, mint... - - - - - This is the application's main window. - Ez az alkalmazás fő ablaka. - - - - - Source text - Forrás szöveg - - - - - Index - Index - - - - - Context - Összefüggés - - - - Items - Elemek - - - - This panel lists the source contexts. - Ez a panel kilistázza a forrás összefüggéseket. - - - - Strings - Sztringek - - - - Phrases and guesses - Kommunikációk és feltételezések - - - - Sources and Forms - Források és formák - - - - Warnings - Figyelmeztetések - - - - MOD - status bar: file(s) modified - MOD - - - - Loading... - Betöltés... - - - - - Loading File - Qt Linguist - Fájl betöltése - Qt Linguist - - - - The file '%1' does not seem to be related to the currently open file(s) '%2'. - -Close the open file(s) first? - A(z) '%1' fájl nem tartozik hozzá egyetlen aktuálisan megnyitott '%2' fájlhoz sem. - -Bezárja először a megnyitott fájl(oka)t? - - - - The file '%1' does not seem to be related to the file '%2' which is being loaded as well. - -Skip loading the first named file? - A(z) '%1' fájl nem tartozik egyetlen '%2' fájlhoz sem, amelyik ugyanúgy be lett töltve. - -Azt első megnevezett fájl betöltésének kihagyása? - - - - %n translation unit(s) loaded. - - %n fordítási egység betöltése. - - - - - Related files (%1);; - Hozzákapcsolodó fájlok (%1);; - - - - Open Translation Files - Fordítási fájlok megnyitása - - - - - File saved. - Fájl elmentve. - - - - - - Release - Kiadás - - - - Qt message files for released applications (*.qm) -All files (*) - Qt üzenet fájlok a kiadott alkalmazásra (*.qm) -Az összes fájl(*) - - - - - File created. - Fál létrehozva. - - - - - Printing... - Nyomtatás... - - - - Context: %1 - Összefüggés: %1 - - - - finished - Befejezve - - - - unresolved - Nincs megoldva - - - - obsolete - Elavulás - - - - - Printing... (page %1) - Nyomtatás... (%1 lap) - - - - - Printing completed - Nyomtatás teljesítve - - - - - Printing aborted - Nyomtatás megszakítva - - - - Search wrapped. - Keresés elrejtése. - - - - - - - - - - - - - Qt Linguist - Qt Linguist - - - - - Cannot find the string '%1'. - A(z) '%1' sztring nem található. - - - - Search And Translate in '%1' - Qt Linguist - Keresés és fordítás a(z) '%1'-ben - Qt Linguist - - - - - - Translate - Qt Linguist - Qt Linguist fordítása - - - - Translated %n entry(s) - - %n bevitel lefordítva - - - - - No more occurrences of '%1'. Start over? - Nem található '%1' több előfordulása. Előlről kezdi? - - - - Create New Phrase Book - Új kommunikációs könyv létrehozása - - - - Qt phrase books (*.qph) -All files (*) - Qt kommunikációs könyv (*.qph) -Az összes fájl (*) - - - - Phrase book created. - Kommunikációs könyv létrehozva. - - - - Open Phrase Book - Kommunikációs könyv megnyitása - - - - Qt phrase books (*.qph);;All files (*) - Qt kommunikációs könyvek (*.qpm);;Az összes fájl (*) - - - - %n phrase(s) loaded. - - %n kommunikáció betöltése. - - - - - - - Add to phrase book - Kommunikációs könyv hozzáadása - - - - No appropriate phrasebook found. - Nem található megfelelő kommunikációs könyv. - - - - Adding entry to phrasebook %1 - Új elem hozzáadása a(z) %1 fázis fáziskönyvhöz - - - - Select phrase book to add to - Kommunikációs könyv kiválasztása hozzáadásra - - - - Unable to launch Qt Assistant (%1) - Nem lehet elindítani a Qt Assistant (%1) - - - - Version %1 - %1 Verzió - - - - <center><img src=":/images/splash.png"/></img><p>%1</p></center><p>Qt Linguist is a tool for adding translations to Qt applications.</p><p>Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). - <center><img src=":/images/splash.png"/></img><p>%1</p></center><p>Qt Linguist egy olyan eszköz, amelyekkel fordítások adhat hozzá a Qt alkalmazásokhoz.</p><p>Szerzői jog(C) 2010 Nokia Vállalat és/vagy leányvállalatai. - - - - Do you want to save the modified files? - El szeretné menteni a módosított fájlokat? - - - - Do you want to save '%1'? - El szeretné menteni a(z) %1-t ? - - - - Qt Linguist[*] - Qt Linguist[*] - - - - %1[*] - Qt Linguist - %1[*] - Qt Linguist - - - - - No untranslated translation units left. - Nem maradtak lefordítatlan fordítások. - - - - &Window - &Ablak - - - - Minimize - Minimalizálás - - - - Ctrl+M - Ctrl+M - - - - Display the manual for %1. - A manuál megjelenítése %1-re vonatkozóan. - - - - Display information about %1. - Információ megjelenítése a(z) %1-ről. - - - - &Save '%1' - '%1' &mentése - - - - Save '%1' &As... - '%1' &másként mentése... - - - - Release '%1' - '%1' kiadása - - - - Release '%1' As... - '%1' másként kiadása... - - - - &Close '%1' - '%1' &bezárása - - - - - &Close - &Bezárás - - - - Save All - Az összes mentése - - - - - &Release All - Az összes &kiadása - - - - Close All - Az összes bezárása - - - - Translation File &Settings for '%1'... - Fordítási fájlok &beállítása erre '%1'... - - - - &Batch Translation of '%1'... - A(z) '%1' &köteg fordítása... - - - - Search And &Translate in '%1'... - Keresés és &fordítás '%1'-ben... - - - - Search And &Translate... - Keresés és &fordítás... - - - - - File - Fájl - - - - - Edit - Szerkesztés - - - - - Translation - Fordítás - - - - - Validation - Érvényesítés - - - - - Help - Súgó - - - - Cannot read from phrase book '%1'. - Nem lehet a(z) '%1' kommunikációs könyvből olvasni. - - - - Close this phrase book. - A kommunikációs könyv bezárása. - - - - Enables you to add, modify, or delete entries in this phrase book. - Hozzáadás, módosítás, vagy törlés engedélyezése ebben a kommunikációs könyvben. - - - - Print the entries in this phrase book. - Az összes bevitel kinyomtatása ebben a társalgási szótárban. - - - - Cannot create phrase book '%1'. - Nem lehet a '%1' társalgási szótárat létrehozni. - - - - Do you want to save phrase book '%1'? - El szeretné menteni a '%1' társalgási szótárat? - - - - All - Mind - - - - Open/Refresh Form &Preview - Forma megnyitása/felfrissítése &nézet - - - - Form Preview Tool - Forma előnézeti eszköz - - - - F5 - F5 - - - - - Translation File &Settings... - Fordítási fájl &beállítások... - - - - &Add to Phrase Book - Társalgási szótárhoz &hozzáadás - - - - Ctrl+T - Ctrl+T - - - - Ctrl+J - Ctrl+J - - - - Ctrl+Shift+J - Ctrl+Shift+J - - - - Previous unfinished item - Előző befejezetlen elem - - - - Next unfinished item - Következő befejezetlen elem - - - - Move to previous item - Az előző befejezetlen elemre mozgás - - - - Next item - Következő elem - - - - Mark item as done and move to the next unfinished item - Az elem készként jelölése és a következő befejezetlen elemre mozgatás - - - - Copies the source text into the translation field - A forrás szöveg fordítási szövegbe másolása - - - - Toggle the validity check of accelerators - Gyorsítások érvényesség ellenőrzésének kapcsolgatása - - - - Toggle the validity check of ending punctuation - Vég írásjelek érvényesség ellenőrzésének kapcsolgatása - - - - Toggle checking that phrase suggestions are used - A használt társalgási ajánlások ellenőrzésének kapcsolgatása - - - - Toggle the validity check of place markers - Hely megjelölők érvényesség vizsgálatának kapcsolgatása - - - - Create a Qt message file suitable for released applications from the current message file. The filename will automatically be determined from the name of the TS file. - Egy Qt üzenet fájl létrehozása az aktuális üzenet fájlból, amely megfelelő az alkalmazás kiadásaira. A fájlnév TS fájl nevéből lesz automatikusan meghatározva. - - - - Length Variants - Hossz változatok - - - - MessageEditor - - - - This is the right panel of the main window. - Ez a fő ablak jobb panelja. - - - - - Russian - Orosz - - - - German - Német - - - - Japanese - Japán - - - - French - Francia - - - - Polish - Lengyel - - - - Chinese - Kínai - - - - This whole panel allows you to view and edit the translation of some source text. - Ez az egész pabel engedélyezi néhány forrás szöveg fordításának megtekintését és szerkesztését. - - - - Source text - Forrás szöveg - - - - This area shows the source text. - Ez a terület mutatja a forrás szöveget. - - - - Source text (Plural) - Forrás szöveg (Többesszám) - - - - This area shows the plural form of the source text. - Ez a terület mutatja a forrás szöveg többesszámú formáját. - - - - Developer comments - Fejlesztői megjegyzések - - - - This area shows a comment that may guide you, and the context in which the text occurs. - Ez a terület mutatja a megjegyzéseket, ami segítheti Önt, és az összefüggéseket, hogy melyik szövegben fordul elő. - - - - Here you can enter comments for your own use. They have no effect on the translated applications. - Itt hozzáadhatja a saját megjegyzését saját használatra. Nincsen hatásuk a lefordított alkalmazásokon. - - - - %1 translation (%2) - %1 fordítás (%2) - - - - This is where you can enter or modify the translation of the above source text. - Ez az a hely, ahol beviheti és módosíthatja a fentebb található forrás szöveg fordítását. - - - - %1 translation - %1 fordítás - - - - %1 translator comments - %1 fordító megjegyzések - - - - '%1' -Line: %2 - '%1' -Sor: %2 - - - - MessageModel - - - Completion status for %1 - %1 elkészítési státusza - - - - <file header> - <file header> - - - - <context comment> - <context comment> - - - - <unnamed context> - <unnamed context> - - - - MsgEdit - - - - This is the right panel of the main window. - Ez a fő ablak jobb panelja. - - - - - PhraseBookBox - - - - Go to Phrase > Edit Phrase Book... The dialog that pops up is a PhraseBookBox. - Társalgás -> Társalgási szótár szerkesztése... A felbukkanó ablak egy TársalgásiSzótárDoboz. - - - - - (New Entry) - (Új bevitel) - - - - %1[*] - Qt Linguist - %1[*] - Qt Linguist - - - - Qt Linguist - Qt Linguist - - - - Cannot save phrase book '%1'. - Nem lehet elmenteni a(z) '%1' társalgási szótárat. - - - - Edit Phrase Book - Társalgási szótár szerkesztése - - - - This window allows you to add, modify, or delete entries in a phrase book. - Ez az ablak engedélyezi új bevitelek hozzáadását, módosítását, vagy törlését egy társalgási szótárban. - - - - &Translation: - &Fordítás: - - - - This is the phrase in the target language corresponding to the source phrase. - Ez a forrás társalgás megfelelője a cél nyelvben. - - - - S&ource phrase: - &Forrás társalgás: - - - - This is a definition for the source phrase. - Ez egy forrás fordítás definíció. - - - - This is the phrase in the source language. - Ez egy társalgás a forrás nyelvben. - - - - &Definition: - &Definíció: - - - - Click here to add the phrase to the phrase book. - Kattintson ide a társalgás hozzáadásához a társalgási könyvben. - - - - &New Entry - &Új bevitel - - - - Click here to remove the entry from the phrase book. - Kattintson ide a bevitel társalgási könyvből való eltávolításához. - - - - &Remove Entry - Bevitel &eltávolítása - - - - Settin&gs... - &Beállítások... - - - - Click here to save the changes made. - Kattintson ide a változtatások elmentéséhez. - - - - &Save - &Mentés - - - - Click here to close this window. - Kattintson ide az ablak bezárásához. - - - - Close - Bezárás - - - - PhraseModel - - - Source phrase - Forrás társalgás - - - - Translation - Fordítás - - - - Definition - Definíció - - - - PhraseView - - - Insert - Beszúrás - - - - Edit - Szerkesztés - - - - Guess (%1) - Feltételezés (%1) - - - - Guess - Feltételezés - - - - QObject - - - Compiled Qt translations - Lefordított Qt fordítások - - - - Translation files (%1);; - Fordítási fájlok (%1);; - - - - All files (*) - Fájlok hozzáadása ( *) - - - - - - - - - - Qt Linguist - Qt Linguist - - - - GNU Gettext localization files - GNU Gettext lokalizációs fájlok - - - - Qt translation sources (format 1.1) - Qt fordítási forrása (1.1 formátum) - - - - Qt translation sources (format 2.0) - Qt fordítás források (2.0 formátum) - - - - Qt translation sources (latest format) - Qt fordítási források (legutolsó formátum) - - - - XLIFF localization files - XLIFF lokalizációs fájlok - - - - Qt Linguist 'Phrase Book' - Qt Linguist 'Társalgási Könyv' - - - - SourceCodeView - - - <i>Source code not available</i> - <i>A forrás kód nem elérhető</i> - - - - <i>File %1 not available</i> - <i>A(z) %1 fájl nem elérhető</i> - - - - <i>File %1 not readable</i> - <i>A(z) %1 fájl nem olvasható</i> - - - - Statistics - - - Statistics - Statisztikák - - - - Translation - Fordítás - - - - Source - Forrás - - - - 0 - 0 - - - - Words: - Szavak: - - - - Characters: - Karakterek: - - - - Characters (with spaces): - Karakterek (szóközökkel): - - - - Close - Bezárás - - - - TranslateDialog - - - This window allows you to search for some text in the translation source file. - Ez az ablak engedélyezi, hogy rákeressen néhány szövegre a fordítási forrás fájlban. - - - - Type in the text to search for. - Gépelje be a keresni kívánt szöveget. - - - - Find &source text: - &Forrás szöveg keresése: - - - - &Translate to: - &Fordítás erre: - - - - Search options - Keresés opciók - - - - Texts such as 'TeX' and 'tex' are considered as different when checked. - 'TeX' és 'text' szövegek különbözően kezelése bejelöléskor. - - - - Match &case - Megegyező &eset - - - - Mark new translation as &finished - Új fordítások &befejezettként jelölése - - - - Click here to find the next occurrence of the text you typed in. - Kattintson ide a begépelt szöveg következő előfordulásának megkereséséhez. - - - - Find Next - Következő keresése - - - - Translate - Fordítás - - - - Translate All - Az összes fordítása - - - - Click here to close this window. - Kattintson ide az ablak bezárásához. - - - - Cancel - Mégse - - - - TranslationSettingsDialog - - - Any Country - Bármeny ország - - - - - Settings for '%1' - Qt Linguist - '%1'-re állítás - Qt Linguist - - - - Source language - Forrás nyelv - - - - Language - Nyelv - - - - Country/Region - OrszágRégió - - - - Target language - Cél nyelv - - - diff --git a/qt_help_hu.ts b/qt_help_hu.ts deleted file mode 100644 index 3fbe0e9..0000000 --- a/qt_help_hu.ts +++ /dev/null @@ -1,298 +0,0 @@ - - - - - QCLuceneResultWidget - - Search Results - Keresési eredmény - - - Note: - Megjegyzés: - - - The search results may not be complete since the documentation is still being indexed! - A keresési eredmény lehet, hogy nem teljes, mivel a dokumentáció még mindig indexelvan van! - - - Your search did not match any documents. - A keresési feltételeknek megfelően nincs találat. - - - (The reason for this might be that the documentation is still being indexed.) - (Ennek az oka az lehet, hogy a dokumentáció még mindig indexelve van.) - - - - QHelpCollectionHandler - - The collection file '%1' is not set up yet! - A(z) '%1'gyűjtemény fájl még nincs beállítva! - - - Cannot load sqlite database driver! - Nem lehet betölteni az sqlite adatbázis vezérlőt! - - - Cannot open collection file: %1 - Nem lehet megnyitni a gyűjtemény fájlt: %1 - - - Cannot create tables in file %1! - Nem lehet lehet a(z) %1 fájlban táblákat létrehozni! - - - The collection file '%1' already exists! - A(z) '%1' gyűjtemény fájl már létezik! - - - Unknown filter '%1'! - Ismeretlen szűrő '%1'! - - - Invalid documentation file '%1'! - Érvénytelen dokumentációs fájl '%1'! - - - Cannot register namespace '%1'! - Nem lehet regisztrálni a(z) '%1' névteret! - - - Cannot open database '%1' to optimize! - Nem lehet optimalizálásra megnyitni a(z) '%1' adatbázist! - - - Cannot create directory: %1 - Nem lehet a könyvtárat létrehozni: %1 - - - Cannot copy collection file: %1 - Nem lehet a gyűjtemény fájlt másolni: %1 - - - Cannot register filter %1! - Nem lehet regisztrálni a(z) %1 szűrőt! - - - Cannot open documentation file %1! - Nem lehet megnyitni a(z) %1 dokumentációs fájlt! - - - The namespace %1 was not registered! - A(z) %1 névteret nem regisztrálták! - - - Namespace %1 already exists! - A(z) %1 névtér már létezik! - - - - QHelpDBReader - - Cannot open database '%1' '%2': %3 - Nem lehet megnyitni az adatbázist '%1' '%2': %3 - - - - QHelpEngineCore - - The specified namespace does not exist! - A meghatározott névtér nem létezik! - - - - QHelpEngineCorePrivate - - Cannot open documentation file %1: %2! - Nem lehet megnyitni a(z) %1 fájlt: %2! - - - - QHelpGenerator - - Invalid help data! - Érvénytelen segítség adat! - - - No output file name specified! - Nincsen kimeneti fájl meghatározva! - - - Building up file structure... - Fájl struktúra felépítése... - - - The file %1 cannot be overwritten! - Nem lehet felülírni a(z) %1 fájlt! - - - Cannot open data base file %1! - Nem lehet megnyitni a(z) %1 adatbázis fájlt! - - - Cannot register namespace %1! - Nem lehet regisztrálni a(z) %1 névteret! - - - Insert custom filters... - Szokásos szűrő beszúrása... - - - Insert help data for filter section (%1 of %2)... - Segítség adatok beszúrása a szűrő szegmens számára (%1 %2-től)... - - - Documentation successfully generated. - A dokumentáció legenerálása sikeresen lezajlott. - - - Some tables already exist! - Néhány tábla már létezik! - - - Cannot create tables! - Nem lehet a táblákat létrehozni! - - - Cannot register virtual folder! - Nem lehet registrálni a virtuális dossziét! - - - Insert files... - Fájlok beszúrása... - - - The referenced file %1 must be inside or within a subdirectory of (%2). Skipping it. - A(z) %1 hivatkozott fájlnak a(z) (%2) alkönyvtárán belül kell elhelyezkednie. Ennek kihagyása. - - - The file %1 does not exist! Skipping it. - A(z) %1 fájl nem létezik! Ennek kihagyása. - - - Cannot open file %1! Skipping it. - Nem lehet megnyitni a(z) %1 fájlt! Ennek kihagyása. - - - The filter %1 is already registered! - A(z) %1 szűrő már regisztrálva van! - - - Cannot register filter %1! - Nem lehet regisztrálni a(z) %1 szűrőt! - - - Insert indices... - Indexek beszúrása... - - - Insert contents... - Tartalom beszúrása... - - - Cannot insert contents! - Nem lehet beszúrni a tartalmat! - - - Cannot register contents! - Nem lehet regisztrálni a tartalmat! - - - - QHelpSearchQueryWidget - - Search for: - Keresés erre: - - - Previous search - Előző keresése - - - Next search - Következő keresése - - - Search - Keresés - - - Advanced search - Összetett keresés - - - words <B>similar</B> to: - szavak <B>hasonlóak</B> ehhez: - - - <B>without</B> the words: - Ezen szavak <B>nélkül</B>: - - - with <B>exact phrase</B>: - <B>Pontos kifejezés</B>: - - - with <B>all</B> of the words: - Ezen szavak<B>mindegyikével</B>: - - - with <B>at least one</B> of the words: - <B>Legalább egy</B> a következő szavak közül: - - - - QHelpSearchResultWidget - - 0 - 0 of 0 Hits - 0 találat 0 - 0 - - - - QHelpSearchResultWidgetPrivate - - %1 - %2 of %3 Hits - %3 Találat %1 - %2 - - - - QObject - - Unknown token. - Ismeretlen jel. - - - Unknown token. Expected "QtHelpProject"! - Ismeretlen hel. "QtSegítségProjekt" várt! - - - Error in line %1: %2 - Hiba a(z) %1 sorban: %2 - - - A virtual folder must not contain a '/' character! - A virtuális dosszié nem tartalmazhat '/' karaktert! - - - A namespace must not contain a '/' character! - A névtér nem tartalmazhat '/' karaktert! - - - Missing namespace in QtHelpProject. - Hiányzó névtér a QtSegítségProjektben. - - - Missing virtual folder in QtHelpProject - Hiányzó virtuális dosszié a QtSegítségProjektben - - - Missing attribute in keyword at line %1. - Hiányzó attirbútum a kulcsszóban a(z) %1 sorban. - - - The input file %1 could not be opened! - Nem sikerült megnyitni a(z) %1 bemeneti fájlt! - - - diff --git a/qt_hu.ts b/qt_hu.ts deleted file mode 100644 index ecc9826..0000000 --- a/qt_hu.ts +++ /dev/null @@ -1,10537 +0,0 @@ - - - - - CloseButton - - - Close Tab - Lap bezárása - - - - FakeReply - - - Fake error ! - Hamisítási hiba ! - - - - Invalid URL - Érvénytelen URL - - - - Phonon:: - - - Notifications - Értesítések - - - - Music - Zene - - - - Video - Videó - - - - Communication - Kommunikáció - - - - Games - Játékok - - - - Accessibility - Hozzáférhetőség - - - - Phonon::AudioOutput - - - <html>The audio playback device <b>%1</b> does not work.<br/>Falling back to <b>%2</b>.</html> - <html>Az audió visszajátszó eszköz <b>%1</b> nem működik.<br/>Visszavonul ide: <b>%2</b>.</html> - - - - <html>Switching to the audio playback device <b>%1</b><br/>which just became available and has higher preference.</html> - <html>Az audió visszajátszó eszközre kapcsolás <b>%1</b><br/>amely éppen elérhetővé vált és magasabb prioritása van.</html> - - - - Revert back to device '%1' - Visszatérés a(z) '%1' eszközre - - - - Phonon::Gstreamer::Backend - - - Warning: You do not seem to have the package gstreamer0.10-plugins-good installed. - Some video features have been disabled. - Figyelmeztetés: Úgy tűnik nem telepítette megfelelően a gstreamer0.10-plugins csomagot. - Néhány videó tulajdonság tiltva van. - - - - Warning: You do not seem to have the base GStreamer plugins installed. - All audio and video support has been disabled - Figyelmeztetés: Úgy tűnik nem telepítette az alap GStreamer beépülő modulokat. - Az összes audió és videó támogatás tiltva van - - - - Phonon::Gstreamer::MediaObject - - - Cannot start playback. - -Check your GStreamer installation and make sure you -have libgstreamer-plugins-base installed. - Nem lehet elindítani a visszajátszást. - -Ellenőrizze le a GStreamer telepítését és győzödjön meg róla, hogy installálta a libgstreamer-plugins-base csomagot. - - - - A required codec is missing. You need to install the following codec(s) to play this content: %0 - Egy szükséges kódek hiányzik. A következő kódek(ek) telepítése szükséges ennek a tartalomnak a lejátszásához: %0 - - - - - - - - - - - Could not open media source. - Nem sikerült megnyitni a média forrást. - - - - Invalid source type. - Érvénytelen forrás típus. - - - - Could not locate media source. - Nem sikerült telepíteni a média forrást. - - - - Could not open audio device. The device is already in use. - Nem sikerült megnyitni az audió eszközt. Az eszköz már használatban van. - - - - Could not decode media source. - Nem sikerült dekódolni a forrást. - - - - Phonon::MMF - - - Audio Output - Audio kimenet - - - - The audio output device - A kimeneti audió eszköz - - - - Phonon::MMF::AudioEqualizer - - - Frequency band, %1 Hz - Frekvencia sáv, '%1' Hz - - - - Phonon::MMF::EffectFactory - - - Audio Equalizer - Audió hangszínszabályozó - - - - Bass Boost - Basszus erősítés - - - - Distance Attenuation - Távcsillapítás - - - - - Environmental Reverb - Környezeti visszhang - - - - Loudness - Hangosság - - - - Source Orientation - Forrás orientáció - - - - Stereo Widening - Sztereó szélesség - - - - Phonon::MMF::MediaObject - - - Media type could not be determined - Nem lehetet meghatározni a média típust - - - - Phonon::VolumeSlider - - - - - - Volume: %1% - Hangerő: %1% - - - - - - Use this slider to adjust the volume. The leftmost position is 0%, the rightmost is %1% - Használja ezt a csúszkát a hangerő szabályozásához. A legbaloldalib pozíció: 0%, a legjobboldalibb %1% - - - - Muted - Elnémított - - - - Q3Accel - - - %1, %2 not defined - %1, %2 nincs definiálva - - - - Ambiguous %1 not handled - Félreérthető %1 nincs lekezelve - - - - Q3DataTable - - - True - Igaz - - - - False - Hamis - - - - Insert - Beszúrás - - - - Update - Frissítés - - - - Delete - Törlés - - - - Q3FileDialog - - - Copy or Move a File - Egy fájl másolása vagy mozgatása - - - - Read: %1 - Olvasás: %1 - - - - - Write: %1 - Írás: %1 - - - - - Cancel - Mégse - - - - - - - All Files (*) - Az összes fájl (*) - - - - Name - Név - - - - Size - Méret - - - - Type - Típus - - - - Date - Dátum - - - - Attributes - Attribútumok - - - - - &OK - &OK - - - - Look &in: - &Benéz: - - - - - - File &name: - Fájl &név: - - - - File &type: - Fájl &típus: - - - - Back - Vissza - - - - One directory up - Egy könyvtárral kintebb - - - - Create New Folder - Új mappa létrehozása - - - - List View - Lista nézet - - - - Detail View - Részletes nézet - - - - Preview File Info - Fájl információ előnézet - - - - Preview File Contents - Fájl tartalom előnézet - - - - Read-write - Írás olvasás - - - - Read-only - Csak olvasható - - - - Write-only - Csak írható - - - - Inaccessible - Hozzáférhetetlen - - - - Symlink to File - Szimlink a fájlra - - - - Symlink to Directory - Szimlink a könyvtárra - - - - Symlink to Special - Szimlink egy speciálisra - - - - File - Fájl - - - - Dir - Könyvtár - - - - Special - Speciális - - - - - - Open - Megnyitás - - - - - Save As - Mentés másként - - - - - - &Open - &Megnyitás - - - - - &Save - &Mentés - - - - &Rename - &Átnevezés - - - - &Delete - &Törlés - - - - R&eload - &Újratöltés - - - - Sort by &Name - Rendezés &Név alapján - - - - Sort by &Size - Rendezés &Méret alapján - - - - Sort by &Date - Rendezés &Dátum alapján - - - - &Unsorted - &Rendezetlen - - - - Sort - Rendezés - - - - Show &hidden files - &Rejtett fájlok megjelenítése - - - - the file - a fájl - - - - the directory - a könyvtár - - - - the symlink - a szimlink - - - - Delete %1 - %1 törlése - - - - <qt>Are you sure you wish to delete %1 "%2"?</qt> - <qt>Biztos benne, hogy törölni kívánja a(z) %1 "%2"?</qt> - - - - &Yes - &Igen - - - - &No - &Nem - - - - New Folder 1 - Új mappa 1 - - - - New Folder - Új mappa - - - - New Folder %1 - Új mappa %1 - - - - Find Directory - Könyvtár keresése - - - - - Directories - Könyvtárak - - - - Directory: - Könyvtár: - - - - - Error - Hiba - - - - %1 -File not found. -Check path and filename. - %1 -Fájl nem található -Útvonal és fájlnév ellenőrzése. - - - - All Files (*.*) - Az összes fájl (*.*) - - - - Open - Megnyitás - - - - Select a Directory - Egy könyvtár kiválasztása - - - - Q3LocalFs - - - - Could not read directory -%1 - Nem sikerült a könytárat olvasni -%1 - - - - Could not create directory -%1 - Nem sikerült létrehozni a könyvtárat -%1 - - - - Could not remove file or directory -%1 - Nem sikerült eltávolítani egy fájlt vag könyvtárat -%1 - - - - Could not rename -%1 -to -%2 - Nem sikerült átnevezni ezt -%1 -erre -%2 - - - - Could not open -%1 - Nem sikerült megnyitni -%1 - - - - Could not write -%1 - Nem sikerült írni -%1 - - - - Q3MainWindow - - - Line up - Egy sorral feljebb - - - - Customize... - Egyéni... - - - - Q3NetworkProtocol - - - Operation stopped by the user - A felhasználó leállította a műveletet - - - - Q3ProgressDialog - - - - Cancel - Mégse - - - - Q3TabDialog - - - - OK - OK - - - - Apply - Alkalmazza - - - - Help - Súgó - - - - Defaults - Alapértelemett - - - - Cancel - Mégse - - - - Q3TextEdit - - - &Undo - &Visszavonás - - - - &Redo - &Helyreállítás - - - - Cu&t - &Kivágás - - - - &Copy - &Másolás - - - - &Paste - &Beillesztés - - - - Clear - Kiürítés - - - - - Select All - Az összes kiválasztása - - - - Q3TitleBar - - - System - Rendszer - - - - Restore up - Felállítás - - - - Minimize - Minimalizálás - - - - Restore down - Leállítás - - - - Maximize - Maximalizálás - - - - Close - Bezárás - - - - Contains commands to manipulate the window - Tartalmazza az ablak manipulációs parancsokat - - - - Puts a minimized window back to normal - Egy minimalizált ablak normálra visszatétele - - - - Moves the window out of the way - Az ablak félreeső helyre mozgatása - - - - Puts a maximized window back to normal - Maximalizált ablak normálra visszatétele - - - - Makes the window full screen - Az ablak maximális méretűvé tétele - - - - Closes the window - Az ablak bezárása - - - - Displays the name of the window and contains controls to manipulate it - Az ablak nevének megjelenítése és manipuláláshoz szükséges vezérlő elemek tartalmazása - - - - Q3ToolBar - - - More... - További... - - - - Q3UrlOperator - - - - - The protocol `%1' is not supported - A(z) '%1' protokoll nem támogatott - - - - The protocol `%1' does not support listing directories - A(z) '%1' protokoll nem támogatja a könyvtár listázást - - - - The protocol `%1' does not support creating new directories - A(z) '%1' protokoll nem támogatja az új könyvtárak létrehozását - - - - The protocol `%1' does not support removing files or directories - A(z) '%1' protokoll nem támogatja fájlok vagy könyvtárat áthelyezését - - - - The protocol `%1' does not support renaming files or directories - A(z) '%1' protokoll nem támogatja fájlok vagy könyvtárat átnevezését - - - - The protocol `%1' does not support getting files - A(z) '%1' protokoll nem támogatja fájlok szerzését - - - - The protocol `%1' does not support putting files - A(z) '%1' protokoll nem támogatja fájlok betevését - - - - - The protocol `%1' does not support copying or moving files or directories - A(z) '%1' protokoll nem támogatja fájlok vagy könyvtárak mozgatását vagy másolását - - - - - (unknown) - (ismeretlen) - - - - Q3Wizard - - - &Cancel - &Mégse - - - - < &Back - < &Vissza - - - - &Next > - &Következő > - - - - &Finish - &Befejezés - - - - &Help - &Súgó - - - - QAbstractSocket - - - - - - Host not found - A hoszt nem található - - - - - - Connection refused - A kapcsolódás elutasítva - - - - Connection timed out - Kapcsolódási időtúllépés - - - - - - Operation on socket is not supported - A socket művelet nem támogatott - - - - Socket operation timed out - Socket művelet időtúllépés - - - - Socket is not connected - Socket nincs csatlakoztatva - - - - Network unreachable - A hálózat nem elérhető - - - - QAbstractSpinBox - - - &Step up - &Növelés - - - - Step &down - &Csökkentés - - - - &Select All - Az összes &kiválasztása - - - - QAccessibleButton - - - Press - Megnyomás - - - - QApplication - - - QT_LAYOUT_DIRECTION - Translate this string to the string 'LTR' in left-to-right languages or to 'RTL' in right-to-left languages (such as Hebrew and Arabic) to get proper widget layout. - QT_LAYOUT_DIRECTION - - - - Executable '%1' requires Qt %2, found Qt %3. - A(z) '%1' futtatható fájl igényli a Qt %2, de Qt %3.-t talált. - - - - Incompatible Qt Library Error - Inkompatibilis Qt könyvtár hiba - - - - Activate - Aktiválás - - - - Activates the program's main window - A program fő ablakának aktiválása - - - - QAxSelect - - - Select ActiveX Control - ActiveX vezérlő kiválasztása - - - - OK - OK - - - - &Cancel - &Mégse - - - - COM &Object: - COM &Objektum: - - - - QCheckBox - - - Uncheck - Nincs bejelölve - - - - Check - Bejelölve - - - - Toggle - Kapcsolgatás - - - - QColorDialog - - - Hu&e: - &Színárnyalat: - - - - &Sat: - &Sat: - - - - &Val: - &Érték: - - - - &Red: - &Piros: - - - - &Green: - &Zöld: - - - - Bl&ue: - &Kék: - - - - A&lpha channel: - A&lfa csatorna: - - - - Select Color - Szín kiválasztása - - - - &Basic colors - &Alap színek - - - - &Custom colors - &Egyéni színek - - - - &Add to Custom Colors - &Egyéni színek hozzáadása - - - - QComboBox - - - - Open - Megnyitás - - - - False - Hamis - - - - True - Igaz - - - - Close - Bezárás - - - - QCoreApplication - - - %1: key is empty - QSystemSemaphore - %1:kulcs üres - - - - %1: unable to make key - QSystemSemaphore - %1: nem lehet kulcsot csinálni - - - - %1: ftok failed - QSystemSemaphore - %1: ftok hiba - - - - %1: already exists - QSystemSemaphore - %1: már létezik - - - - %1: does not exist - QSystemSemaphore - %1: nem létezik - - - - %1: out of resources - QSystemSemaphore - %1: elfogytak az erőforrások - - - - %1: unknown error %2 - QSystemSemaphore - %1: ismeretlen hiba %2 - - - - QDB2Driver - - - Unable to connect - Nem lehet csatlakozni - - - - Unable to commit transaction - Nem lehet kommitolni a tranzakciót - - - - Unable to rollback transaction - Nem lehet visszagörgetni a tranzakciót - - - - Unable to set autocommit - Nem lehet beállítani az automatikus kommitolást - - - - QDB2Result - - - - Unable to execute statement - Nem lehet végrehajtani a műveletet - - - - Unable to prepare statement - Nem lehet felkészülni a műveletre - - - - Unable to bind variable - Nem lehet összekötni a változót - - - - Unable to fetch record %1 - Nem lehet letölteni a(z) %1 felvételt - - - - Unable to fetch next - Nem lehet letölteni a következőt - - - - Unable to fetch first - Nem lehet letölteni az elsőt - - - - QDateTimeEdit - - - AM - AM - - - - am - am - - - - PM - PM - - - - pm - pm - - - - QDial - - - QDial - QDial - - - - SpeedoMeter - Sebességmérő - - - - SliderHandle - CsúszkaKezelő - - - - QDialog - - - What's This? - Mi ez? - - - - Done - Kész - - - - QDialogButtonBox - - - - - OK - OK - - - - Save - Mentés - - - - &Save - &Mentés - - - - Open - Megnyitás - - - - Cancel - Mégse - - - - &Cancel - &Mégse - - - - Close - Bezárás - - - - &Close - &Bezárás - - - - Apply - Alkalmazza - - - - Reset - Visszaállítás - - - - Help - Súgó - - - - Don't Save - Ne mentse - - - - Discard - Eldob - - - - &Yes - &Igen - - - - Yes to &All - Igen az &összesre - - - - &No - &Nem - - - - N&o to All - &Nem az összesre - - - - Save All - Az összes mentése - - - - Abort - Megszakítás - - - - Retry - Újra próbálkozás - - - - Ignore - Mellőzés - - - - Restore Defaults - Alapértelemezett beállítások visszaállítása - - - - Close without Saving - Bezárás mentés nélkül - - - - &OK - &OK - - - - QDirModel - - - Name - Név - - - - Size - Méret - - - - Kind - Match OS X Finder - Fajta - - - - Type - All other platforms - Típus - - - - Date Modified - Dátum módosítva - - - - QDockWidget - - - Close - Bezárás - - - - Dock - Dokkolás - - - - Float - Lebegtetés - - - - QDoubleSpinBox - - - More - Több - - - - Less - Kevesebb - - - - QErrorMessage - - - &Show this message again - Az üzenet újbóli &megjelenítése - - - - &OK - &OK - - - - Debug Message: - Debug üzenet: - - - - Warning: - Figyelmeztetés: - - - - Fatal Error: - Végzetes hiba: - - - - QFile - - - - Destination file exists - A cél fájl létezik - - - - Will not rename sequential file using block copy - Blokkos másolásnál nem lesznek átnevezve az egymást követő fájlok - - - - Cannot remove source file - Nem lehet a forrás fájlt eltávolítani - - - - Cannot open %1 for input - Nem lehet megnyitni %1-t bementre - - - - Cannot open for output - Nem lehet megnyitni a kimenetre - - - - Failure to write block - Hiba történt a blokk írás közben - - - - Cannot create %1 for output - Nem lehet létrehozni a(z) %1-t kimenetre - - - - QFileDialog - - - - All Files (*) - Az összes fájl (*) - - - - - Back - Vissza - - - - - List View - Lista nézet - - - - - Detail View - Részletes nézet - - - - - File - Fájl - - - - Open - Megnyitás - - - - Save As - Mentés másként - - - - - - &Open - &Megnyitás - - - - - &Save - &Mentés - - - - Recent Places - Utolsó helyek - - - - &Rename - &Átnevezés - - - - &Delete - &Törlés - - - - Show &hidden files - &Rejtett fájlok megjelenítése - - - - New Folder - Új mappa - - - - Find Directory - Könyvtár keresése - - - - Directories - Könyvtárak - - - - All Files (*.*) - Az összes fájl (*.*) - - - - - Directory: - Könyvtár: - - - - %1 already exists. -Do you want to replace it? - A(z) %1 már létezik. -Szeretné lecserélni? - - - - %1 -File not found. -Please verify the correct file name was given. - %1 -Fájl nem található. -Kérem ellenőrizze, hogy helyes fájlnevet adott meg. - - - - My Computer - Sajátgép - - - - - Parent Directory - Szülő könyvtár - - - - - Files of type: - Típusfájlok: - - - - - %1 -Directory not found. -Please verify the correct directory name was given. - %1 -A könyvtár nem található. -Kérem ellenőrizze le, hogy helyes könyvtár nevet adott meg. - - - - '%1' is write protected. -Do you want to delete it anyway? - A(z) '%1' írásvédett. -Mégis törölni szeretné? - - - - Are sure you want to delete '%1'? - Törölni szeretné '%1'? - - - - Could not delete directory. - Nem sikerült törölni a könyvtárat. - - - - Drive - Vezérlő - - - - File Folder - Match Windows Explorer - Fájl mappa - - - - Folder - All other platforms - Mappa - - - - Alias - Mac OS X Finder - Álnév - - - - Shortcut - All other platforms - Gyorsbillentyű - - - - Unknown - Ismeretlen - - - - Show - Megjelenítés - - - - - Forward - Előre - - - - &New Folder - &Új mappa - - - - - &Choose - &Kiválasztás - - - - Remove - Eltávolítás - - - - - File &name: - Fájl &név: - - - - - Look in: - Benéz: - - - - - Create New Folder - Új mappa létrehozása - - - - QFileSystemModel - - - - %1 TB - %1 TB - - - - - %1 GB - %1 GB - - - - - %1 MB - %1 MB - - - - - %1 KB - %1 KB - - - - %1 bytes - %1 bájt - - - - Invalid filename - Érvénytelen fájlnév - - - - <b>The name "%1" can not be used.</b><p>Try using another name, with fewer characters or no punctuations marks. - <b>A(z) "%1" név nem használható.</b><p>Próbáljon meg más nevet használni, kevesebb karakterrel vagy írásjelekek nélkül. - - - - Name - Név - - - - Size - Méret - - - - Kind - Match OS X Finder - Fajta - - - - Type - All other platforms - Típus - - - - Date Modified - Dátum módosítva - - - - My Computer - Sajátgép - - - - Computer - Számítógép - - - - %1 byte(s) - %1 bájt - - - - QFontDatabase - - - - Normal - Normál - - - - - - Bold - Kövér - - - - - Demi Bold - Félkövér - - - - - - Black - Fekete - - - - Demi - Fél - - - - - Light - Világos - - - - - Italic - Dőlt - - - - - Oblique - Homályos - - - - Any - Bármilyen - - - - Latin - Latin - - - - Greek - Görög - - - - Cyrillic - Ciril - - - - Armenian - Örmény - - - - Hebrew - Héber - - - - Arabic - Arab - - - - Syriac - Szíriai - - - - Thaana - Thana - - - - Devanagari - Dévanágari - - - - Bengali - Bengáli - - - - Gurmukhi - Gurmukhi - - - - Gujarati - Gujarati - - - - Oriya - Oriya - - - - Tamil - Tamil - - - - Telugu - Telugu - - - - Kannada - Kanadai - - - - Malayalam - Maláj - - - - Sinhala - Sinhala - - - - Thai - Tájföldi - - - - Lao - Lao - - - - Tibetan - Tibeti - - - - Myanmar - Mianmari - - - - Georgian - Grúz - - - - Khmer - Khmer - - - - Simplified Chinese - Egyszerűsített kínai - - - - Traditional Chinese - Hagyományos kínai - - - - Japanese - Japán - - - - Korean - Koreai - - - - Vietnamese - Vietnámi - - - - Symbol - Szimbólum - - - - Ogham - Ogham - - - - Runic - Székely - - - - N'Ko - N'Ko - - - - QFontDialog - - - &Font - &Betű - - - - Font st&yle - Betű st&ílus - - - - &Size - &Méret - - - - Effects - Hatások - - - - Stri&keout - Ki&talál - - - - &Underline - &Aláhúzás - - - - Sample - Minta - - - - - Select Font - Betű kiválasztása - - - - Wr&iting System - Rendszer &írása - - - - QFtp - - - Host %1 found - %1 host megtalálva - - - - Host found - Hoszt megtalálva - - - - - - Connected to host %1 - %1 hosztra csatlkoztatva - - - - Connected to host - Hosztra csatlakoztatva - - - - Connection to %1 closed - %1-re csatlakoztatása bezárva - - - - - - Connection closed - Kapcsolat bezárva - - - - - Host %1 not found - %1 host nem található - - - - - Connection refused to host %1 - Kapcsolat elutasítva a(z) %1 hoszttal - - - - Connection timed out to host %1 - Kapcsolati időtúllépés a %1 hoszttal - - - - - - - Unknown error - Ismeretlen hiba - - - - - Connecting to host failed: -%1 - A hoszthoz kapcsolódás nem sikerült: -%1 - - - - - Login failed: -%1 - Bejelentkezési hiba: -%1 - - - - - Listing directory failed: -%1 - Könyvtár listázási hiba: -%1 - - - - - Changing directory failed: -%1 - Könyvtár változtatási hiba: -%1 - - - - - Downloading file failed: -%1 - Fájl letöltési hiba: -%1 - - - - - Uploading file failed: -%1 - Fájl feltöltési hiba: -%1 - - - - - Removing file failed: -%1 - Fájl eltávolítási hiba: -%1 - - - - - Creating directory failed: -%1 - Könyvtár létrehozási hiba: -%1 - - - - - Removing directory failed: -%1 - Könyvtár eltávolítása hiba: -%1 - - - - - Not connected - Nincs csatlakoztatva - - - - - Connection refused for data connection - Adat kapcsolat érdekében történő csatlakozás megtagadva - - - - QHostInfo - - - Unknown error - Ismeretlen hiba - - - - QHostInfoAgent - - - - - - Host not found - A hoszt nem található - - - - - - - Unknown address type - Ismeretlen cím típus - - - - - - Unknown error - Ismeretlen hiba - - - - No host name given - Nincs hoszt név megadva - - - - Invalid hostname - Érvénytelen hoszt név - - - - QHttp - - - - Connection refused - Kapcsolat megtagadva - - - - - - Host %1 not found - A(z) %1 hoszt nem található - - - - - Wrong content length - Hibás tartalom hossz - - - - - - - HTTP request failed - HTTP kérési hiba - - - - Host %1 found - A(z) %1 hoszt nem található - - - - Host found - Hoszt megtalálható - - - - Connected to host %1 - %1 hoszthoz csatlakozva van - - - - Connected to host - Hosztra csatlakoztatva - - - - Connection to %1 closed - %1-re csatlkozás bezárva - - - - - Connection closed - Kapcsolat bezárva - - - - - - - Unknown error - Ismeretlen hiba - - - - - Request aborted - Kérés megszakítva - - - - - No server set to connect to - Nincsen szerver beállítva, amire csatlakozni lehetne - - - - - Server closed connection unexpectedly - A szerver váratlanul bezárta a kapcsolatot - - - - - Invalid HTTP response header - Érvénytelen HTTP válasz fejléc - - - - Unknown authentication method - Ismeretlen hitelesítési eljárás - - - - - - - Invalid HTTP chunked body - Érvénytelen nagy HTTP törzs - - - - Error writing response to device - Hiba történt a válasz eszközre írása közben - - - - Proxy authentication required - Proxy hitelesítés szükséges - - - - Authentication required - Hitelesítés szükséges - - - - Proxy requires authentication - A proxy a hitelesítést kéri - - - - Host requires authentication - A hoszt hitelesítést kér - - - - Data corrupted - Sérült adat - - - - SSL handshake failed - SSL kézfogási hiba - - - - Unknown protocol specified - Ismeretlen protokoll van megadva - - - - Connection refused (or timed out) - Kapcsolat megtagadva (vagy időtúllépés) - - - - HTTPS connection requested but SSL support not compiled in - HTTP kapcsolat lett kérve, de az SSL támogatás nincs beleforgatva - - - - QHttpSocketEngine - - - Did not receive HTTP response from proxy - Nem kapott HTTP választ a proxy-tól - - - - Error parsing authentication request from proxy - Hiba történt a proxy hitelesítés kérésének elemzése közben - - - - Authentication required - Hitelesítés szükséges - - - - Proxy denied connection - A proxy megtagadta a kapcsolatot - - - - Error communicating with HTTP proxy - Hiba történt a HTTP proxy-val történő kommunikáció közben - - - - Proxy server not found - A proxy szerver nem található - - - - Proxy connection refused - A proxy kapcsolat elutasítva - - - - Proxy server connection timed out - Proxy szerver kapcsolódási időtúllépés - - - - Proxy connection closed prematurely - Proxy kapcsolódás túl korán be lett zárva - - - - QIBaseDriver - - - Error opening database - Hiba történt az adatbázis megnyitása közben - - - - Could not start transaction - Nem sikerült elindítani a tranzakciót - - - - Unable to commit transaction - Nem lehet kommitolni a tranzakciót - - - - Unable to rollback transaction - Nem lehet visszagörgetni a tranzakciót - - - - QIBaseResult - - - Unable to create BLOB - Nem lehet BLOB-t létrehozni - - - - Unable to write BLOB - Nem lehet írni a BLOB-t - - - - Unable to open BLOB - Nem lehet megnyitni a BLOB-t - - - - Unable to read BLOB - Nem lehet olvasni a BLOB-t - - - - - Could not find array - Nem sikerült megtalálni a tömböt - - - - Could not get array data - Nem sikerüét megszerezni a tömb adatokat - - - - Could not get query info - Nem sikerült megszerezni a lekérdezi információt - - - - Could not start transaction - Nem sikerült elindítani a tranzakciót - - - - Unable to commit transaction - Nem lehet kommitolni a tranzakciót - - - - Could not allocate statement - Nem sikerült lefoglalni a műveletet - - - - Could not prepare statement - Nem sikerült felkészülni a műveletre - - - - - Could not describe input statement - Nem sikerült leírni a bemeneti állítást - - - - Could not describe statement - Nem sikerült leírni az állítást - - - - Unable to close statement - Nem lehet megnyitni az állítást - - - - Unable to execute query - Nem lehet végrehajtani a lekérdezést - - - - Could not fetch next item - Nem lehet letölteni a következő elemet - - - - Could not get statement info - Nem lehet az művelet információkat megszerezni - - - - QIODevice - - - Permission denied - Beleegyezés megtagadva - - - - Too many open files - Túl sok fájl megnyitása - - - - No such file or directory - Nincs ilyen fájl vagy könyvtár - - - - No space left on device - Nincs több hely a lemezen - - - - Unknown error - Ismeretlen hiba - - - - QInputContext - - - XIM - XIM - - - - FEP - FEP - - - - XIM input method - XIM beviteli eljárás - - - - Windows input method - Windows beviteli eljárás - - - - Mac OS X input method - Mac OS X beviteli eljárás - - - - S60 FEP input method - S60 FEP beviteli eljárás - - - - QInputDialog - - - Enter a value: - Egy értél bevitele: - - - - QLibrary - - - Could not mmap '%1': %2 - Nem sikerült az mmap '%1': %2 - - - - Plugin verification data mismatch in '%1' - Beépülő modul igazoló adata nem megfelelő a(z) '%1'-ben - - - - Could not unmap '%1': %2 - Nem lehet eltávolítani a letérképezést '%1': %2 - - - - The plugin '%1' uses incompatible Qt library. (%2.%3.%4) [%5] - A(z) '%1' beépülő modul inkompatibilis Qt könyvtárat használ. (%2.%3.%4) [%5] - - - - The plugin '%1' uses incompatible Qt library. Expected build key "%2", got "%3" - A(z) '%1' beépülő modul inkompatibilis Qt könyvtárat használ. A várt építési kulcs '%2', kapott '%3' - - - - Unknown error - Ismeretlen hiba - - - - - The shared library was not found. - A megosztott könyvtár nem található. - - - - The file '%1' is not a valid Qt plugin. - A(z) '%1' fájl nem egy érvényes Qt beépülő modul. - - - - The plugin '%1' uses incompatible Qt library. (Cannot mix debug and release libraries.) - A(z) '%1' beépülő modul inkompatibilis Qt könyvtárat használ. (Nem lehet a debug és kiadási könyvtárakat keverni.) - - - - - Cannot load library %1: %2 - Nem lehet betölteni a(z) %1 könyvtárat: %2 - - - - - Cannot unload library %1: %2 - Nem lehet kirakni a(z) %1 könyvtárat: %2 - - - - - Cannot resolve symbol "%1" in %2: %3 - Nem lehet megfejteni a(z) '%1' szimbólumot a(z) %2-ben: %3 - - - - QLineEdit - - - Select All - Az összes kiválasztása - - - - &Undo - &Visszavonás - - - - &Redo - &Helyreállítás - - - - Cu&t - &Kivágás - - - - &Copy - &Másolás - - - - &Paste - &Beillesztés - - - - Delete - Törlés - - - - QLocalServer - - - - %1: Name error - %1: Név hiba - - - - %1: Permission denied - %1: Engedély megtagadva - - - - %1: Address in use - %1: Cím használatban - - - - %1: Unknown error %2 - %1: Ismeretlen hiba %2 - - - - QLocalSocket - - - - %1: Connection refused - %1: Kapcsolat elutasítva - - - - - %1: Remote closed - %1: Távol bezárva - - - - - - - %1: Invalid name - %1: Érvénytelen név - - - - - %1: Socket access error - %1: Socket hozzáférési hiba - - - - - %1: Socket resource error - %1: Socket erőforrás hiba - - - - - %1: Socket operation timed out - %1: Socker művelet időtúllépés - - - - - %1: Datagram too large - %1: Túl nagy datagram - - - - - - %1: Connection error - %1: Kapcsolat hiba - - - - - %1: The socket operation is not supported - %1: A socket művelet nem támogatott - - - - %1: Unknown error - %1: Ismeretlen hiba - - - - - %1: Unknown error %2 - %1: Ismeretlen hiba %2 - - - - QMYSQLDriver - - - Unable to open database ' - Nem lehet megnyitni az adatbázist - - - - Unable to connect - Nem lehet kapcsolódni - - - - Unable to begin transaction - Nem lehet megkezdeni a tranzakciót - - - - Unable to commit transaction - Nem lehet kommitolni a tranzakciót - - - - Unable to rollback transaction - Nem lehet visszagörgetni a tranzakciót - - - - QMYSQLResult - - - Unable to fetch data - Nem lehet letölteni az adatot - - - - Unable to execute query - Nem lehet végrehajtani a lekérdezést - - - - Unable to store result - Nem lehet tárolni az eredményt - - - - - Unable to prepare statement - Nem lehet felkészülni a műveletre - - - - Unable to reset statement - Nem lehet visszaállítani a műveleteket - - - - Unable to bind value - Nem lehet összekötni az értéket - - - - Unable to execute statement - Nem lehet végrehajtani az állítást - - - - - Unable to bind outvalues - Nem lehet összekötni a kiértékeléseket - - - - Unable to store statement results - Nem lehet letárolni a művelet eredményeket - - - - Unable to execute next query - Nem lehet végrehajtani a következő lekérdezést - - - - Unable to store next result - Nem lehet letárolni a következő eredményt - - - - QMdiArea - - - (Untitled) - (Címtelen) - - - - QMdiSubWindow - - - %1 - [%2] - %1 - [%2] - - - - Close - Bezárás - - - - Minimize - Minimalizálás - - - - Restore Down - Leállítás - - - - &Restore - &Letárolás - - - - &Move - &Mozgatás - - - - &Size - &Méret - - - - Mi&nimize - &Minimalizálás - - - - Ma&ximize - Ma&ximalizálás - - - - Stay on &Top - &Tetején maradni - - - - &Close - &Bezárás - - - - Maximize - Maximalizálás - - - - Unshade - Árnyékolás megszüntetése - - - - Shade - Árnyákolás - - - - Restore - Visszaállítás - - - - Help - Súgó - - - - Menu - Menü - - - - - [%1] - - [%1] - - - - QMenu - - - - Close - Bezárás - - - - - Open - Megnyitás - - - - - - Execute - Végrehajtás - - - - QMenuBar - - - Actions - Tevékenységek - - - - QMessageBox - - - - - - OK - OK - - - - <h3>About Qt</h3><p>This program uses Qt version %1.</p> - <h3>Qt-ról</h3><p>Ez a program a(z) %1 Qt verziót használja.</p> - - - - <p>Qt is a C++ toolkit for cross-platform application development.</p><p>Qt provides single-source portability across MS&nbsp;Windows, Mac&nbsp;OS&nbsp;X, Linux, and all major commercial Unix variants. Qt is also available for embedded devices as Qt for Embedded Linux and Qt for Windows CE.</p><p>Qt is available under three different licensing options designed to accommodate the needs of our various users.</p><p>Qt licensed under our commercial license agreement is appropriate for development of proprietary/commercial software where you do not want to share any source code with third parties or otherwise cannot comply with the terms of the GNU LGPL version 2.1 or GNU GPL version 3.0.</p><p>Qt licensed under the GNU LGPL version 2.1 is appropriate for the development of Qt applications (proprietary or open source) provided you can comply with the terms and conditions of the GNU LGPL version 2.1.</p><p>Qt licensed under the GNU General Public License version 3.0 is appropriate for the development of Qt applications where you wish to use such applications in combination with software subject to the terms of the GNU GPL version 3.0 or where you are otherwise willing to comply with the terms of the GNU GPL version 3.0.</p><p>Please see <a href="http://qt.nokia.com/products/licensing">qt.nokia.com/products/licensing</a> for an overview of Qt licensing.</p><p>Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).</p><p>Qt is a Nokia product. See <a href="http://qt.nokia.com/">qt.nokia.com</a> for more information.</p> - - - - - About Qt - Qt-ról - - - - Help - Súgó - - - - Show Details... - Részletek megjelenítése... - - - - Hide Details... - Részletek elrejtése... - - - - QMultiInputContext - - - Select IM - IM kiválasztása - - - - QMultiInputContextPlugin - - - Multiple input method switcher - Összetett beviteli eljárás kapcsoló - - - - Multiple input method switcher that uses the context menu of the text widgets - Összetett beviteli eljárás kapcsoló, ami a szöveg widgetek menü összefüggéseit használja - - - - QNativeSocketEngine - - - The remote host closed the connection - A távoli hoszt bezárta a kapcsolatot - - - - Network operation timed out - Hálózati művelet időtúllépése - - - - Out of resources - Kifogytak az erőforrások - - - - Unsupported socket operation - Nem támogatott socket művelet - - - - Protocol type not supported - Nem támogatott protokoll típus - - - - Invalid socket descriptor - Érvénytelen socket leíró - - - - Network unreachable - A hálózat nem elérhető - - - - Permission denied - Engedély megtagadva - - - - Connection timed out - Kapcsolat időtúllépés - - - - Connection refused - Kapcsolat elutasítva - - - - The bound address is already in use - A cím összeköttetés már használatban van - - - - The address is not available - A cím nem elérhető - - - - The address is protected - A cím védett - - - - Unable to send a message - Nem lehet üzenetet küldeni - - - - Unable to receive a message - Nem lehet megkapni az üzeneteket - - - - Unable to write - Nem lehet írni - - - - Network error - Hálózati hiba - - - - Another socket is already listening on the same port - Egy másik socker már ugyanazon a porton figyel - - - - Unable to initialize non-blocking socket - Nem lehet inicializálni egy nem blokkoló socketet - - - - Unable to initialize broadcast socket - Nem lehet inicializálni a socket közvetítőt - - - - Attempt to use IPv6 socket on a platform with no IPv6 support - IPv6 socket használatának kipróbálása olyan platformon, amelyik nem támogatja az IPv6-t - - - - Host unreachable - A hoszt nem elérhető - - - - Datagram was too large to send - A datagram túl nagy volt elküldésre - - - - Operation on non-socket - Nem socketen végzett művelet - - - - Unknown error - Ismeretlen hiba - - - - The proxy type is invalid for this operation - A proxy típusa ismeretlen erre a műveletre - - - - QNetworkAccessCacheBackend - - - Error opening %1 - Hiba történt a(z) %1 megnyitása közben - - - - QNetworkAccessDebugPipeBackend - - - Write error writing to %1: %2 - Írása hiba történt a(z) %1-be történő írás közben: %2 - - - - QNetworkAccessFileBackend - - - - Request for opening non-local file %1 - Kérés a(z) %1 nem helyi fál megnyitására - - - - - Error opening %1: %2 - Hiba történt a(z) %1 megnyitása közben: %2 - - - - Write error writing to %1: %2 - Írási hiba történt a(z) %1-be írás közben: %2 - - - - - Cannot open %1: Path is a directory - Nem lehet megnyitni a(z) %1-t: az útvonal egy könyvtár - - - - Read error reading from %1: %2 - Olvasási hiba történt a(z) %1-ból való olvasás közben: %2 - - - - QNetworkAccessFtpBackend - - - No suitable proxy found - Nem található megfelelő proxy - - - - Cannot open %1: is a directory - Nem lehet megnyitni a(z) %1 t, mert az egy könyvtár - - - - Logging in to %1 failed: authentication required - A(z) %1-be történő loggolás nem sikerült: hitelesítés szükséges - - - - Error while downloading %1: %2 - Hiba történt a(z) %1 letöltése közben: %2 - - - - Error while uploading %1: %2 - Hiba történt a(z) %1 feltöltése közben: %2 - - - - QNetworkAccessHttpBackend - - - No suitable proxy found - Nem található megfelelő proxy - - - - QNetworkReply - - - Error downloading %1 - server replied: %2 - Hiba történt a(z) %1 letöltése közben - a szerver válasza: %2 - - - - Protocol "%1" is unknown - A(z) '%1' protokoll ismeretlen - - - - QNetworkReplyImpl - - - - Operation canceled - Művelet visszavonása - - - - QOCIDriver - - - Unable to logon - Nem lehet bejelentkezni - - - - Unable to initialize - QOCIDriver - Nem lehet inicializálni - - - - Unable to begin transaction - Nem lehet megkezdeni a tranzakciót - - - - Unable to commit transaction - Nem lehet kommitolni a tranzakciót - - - - Unable to rollback transaction - Nem lehet visszagörgetni a tranzakciót - - - - QOCIResult - - - - - Unable to bind column for batch execute - Nem lehet összekötni az oszlopot köteg végrehajtásra - - - - Unable to execute batch statement - Nem lehet végrehajtani a köteg állítást - - - - Unable to goto next - Nem lehet a következőre ugrani - - - - Unable to alloc statement - Nem lehet helyet lefoglalni az állításnak - - - - Unable to prepare statement - Nem lehet felkészülni a műveletre - - - - Unable to get statement type - Nem lehet megszerezni az állítás típusát - - - - Unable to bind value - Nem lehet összekötni az értéket - - - - Unable to execute statement - Nem lehet végrehajtani az állítást - - - - QODBCDriver - - - Unable to connect - Nem lehet kapcsolódni - - - - Unable to disable autocommit - Nem lehet letiltani az automatikus kommitolást - - - - Unable to commit transaction - Nem lehet kommitolni a tranzakciót - - - - Unable to rollback transaction - Nem lehet visszagörgetni a tranzakciót - - - - Unable to enable autocommit - Nem lehet engedélyezni az automatikus kommitolást - - - - Unable to connect - Driver doesn't support all functionality required - Nem lehet csatlakozni- A vezérlő nem támogatja az összes szükséges funkciót - - - - QODBCResult - - - - QODBCResult::reset: Unable to set 'SQL_CURSOR_STATIC' as statement attribute. Please check your ODBC driver configuration - QODBCEredmény::Visszaállítás: Nen lehet beállítani az 'SQL_CURSOR_STATIC' állítás attribútumra. Kérem ellenőrizze le az ODBC vezérlő konfigurációt - - - - - Unable to execute statement - Nem lehet végrehajtani az állítást - - - - Unable to fetch next - Nem lehet letölteni a következőt - - - - Unable to prepare statement - Nem lehet felkészülni az állításra - - - - Unable to bind variable - Nem lehet összekötni a változót - - - - - - Unable to fetch last - Nem lehet letölteni az utolsót - - - - Unable to fetch - Nem lehet letölteni - - - - Unable to fetch first - Nem letölteni az elsőt - - - - Unable to fetch previous - Nem lehet letölteni az előzőt - - - - QObject - - - Invalid hostname - Érvénytelen hoszt név - - - - Operation not supported on %1 - A művelet nem támogatott a(z) %1-n - - - - Invalid URI: %1 - Érvénytelen URI: %1 - - - - Socket error on %1: %2 - Socket hiba a(z) %1-n: %2 - - - - Remote host closed the connection prematurely on %1 - A távoli hoszt túl korán bezárta a kapcsolatot a(z) %1-n - - - - - No host name given - Nincs hoszt név megadva - - - - QPPDOptionsModel - - - Name - Név - - - - Value - Érték - - - - QPSQLDriver - - - Unable to connect - Nem lehet csatlakozni - - - - Could not begin transaction - Nem sikerült megkezdeni a tranzakciót - - - - Could not commit transaction - Nem lehet kommitolni a tranzakciót - - - - Could not rollback transaction - Nem lehet visszagörgetni a tranzakciót - - - - Unable to subscribe - Nem lehet feliratkozni - - - - Unable to unsubscribe - Nem lehet leiratkozni - - - - QPSQLResult - - - Unable to create query - Nem lehet létrehozni a lekérdezést - - - - Unable to prepare statement - Nem lehet felkészülni az állításra - - - - QPageSetupWidget - - - Centimeters (cm) - Centiméter (cm) - - - - Millimeters (mm) - Milliméter (mm) - - - - Inches (in) - Incs (in) - - - - Points (pt) - Pont (pt) - - - - Form - - - - - Paper - Papír - - - - Page size: - Lap méret: - - - - Width: - Szélesség: - - - - Height: - Magasság: - - - - Paper source: - Papír forrás: - - - - Orientation - Elhelyezkedés - - - - Portrait - Portré - - - - Landscape - Tájkép - - - - Reverse landscape - Fordított tájkép - - - - Reverse portrait - Fordított portré - - - - Margins - Margó - - - - top margin - Felső margó - - - - left margin - Bal margó - - - - right margin - Jobb margó - - - - bottom margin - Alsó margó - - - - QPluginLoader - - - Unknown error - Ismeretlen hiba - - - - The plugin was not loaded. - A beépülő modult nem sikerült betölteni. - - - - QPrintDialog - - - locally connected - Helyileg csatlakoztatva - - - - - Aliases: %1 - Álnevek: %1 - - - - - unknown - ismeretlen - - - - OK - OK - - - - Print all - Az összes kinyomtatása - - - - Print range - Egy tartomány kinyomtatása - - - - A0 (841 x 1189 mm) - A0 (841 x 1189 mm) - - - - A1 (594 x 841 mm) - A1 (594 x 841 mm) - - - - A2 (420 x 594 mm) - A2 (420 x 594 mm) - - - - A3 (297 x 420 mm) - A3 (297 x 420 mm) - - - - A5 (148 x 210 mm) - A5 (148 x 210 mm) - - - - A6 (105 x 148 mm) - A6 (105 x 148 mm) - - - - A7 (74 x 105 mm) - A7 (74 x 105 mm) - - - - A8 (52 x 74 mm) - A8 (52 x 74 mm) - - - - A9 (37 x 52 mm) - A9 (37 x 52 mm) - - - - B0 (1000 x 1414 mm) - B0 (1000 x 1414 mm) - - - - B1 (707 x 1000 mm) - B1 (707 x 1000 mm) - - - - B2 (500 x 707 mm) - B2 (500 x 707 mm) - - - - B3 (353 x 500 mm) - B3 (353 x 500 mm) - - - - B4 (250 x 353 mm) - B4 (250 x 353 mm) - - - - B6 (125 x 176 mm) - B6 (125 x 176 mm) - - - - B7 (88 x 125 mm) - B7 (88 x 125 mm) - - - - B8 (62 x 88 mm) - B8 (62 x 88 mm) - - - - B9 (44 x 62 mm) - B9 (44 x 62 mm) - - - - B10 (31 x 44 mm) - B10 (31 x 44 mm) - - - - C5E (163 x 229 mm) - C5E (163 x 229 mm) - - - - DLE (110 x 220 mm) - DLE (110 x 220 mm) - - - - Folio (210 x 330 mm) - Fólió (210 x 330 mm) - - - - Ledger (432 x 279 mm) - Főkönyv (432 x 279 mm) - - - - Tabloid (279 x 432 mm) - Tabletta (279 x 432 mm) - - - - US Common #10 Envelope (105 x 241 mm) - US közös #10 bélyeg (105 x 241 mm) - - - - A4 (210 x 297 mm, 8.26 x 11.7 inches) - A4 (210 x 297 mm, 8.26 x 11.7 inches) - - - - B5 (176 x 250 mm, 6.93 x 9.84 inches) - B5 (176 x 250 mm, 6.93 x 9.84 inches) - - - - Executive (7.5 x 10 inches, 191 x 254 mm) - Vezető (7.5 x 10 inches, 191 x 254 mm) - - - - Legal (8.5 x 14 inches, 216 x 356 mm) - Legális (8.5 x 14 inches, 216 x 356 mm) - - - - Letter (8.5 x 11 inches, 216 x 279 mm) - Levél (8.5 x 11 inches, 216 x 279 mm) - - - - Print selection - Nyomtatási kiválasztás - - - - - - Print - Nyomtatás - - - - Print To File ... - Fájlba nyomtatás ... - - - - File %1 is not writable. -Please choose a different file name. - A(z) %1 fájl nem írható. -Kérem válasszon különböző fájl nevet. - - - - %1 already exists. -Do you want to overwrite it? - A(z) %1 már létezik. -Felül szeretné írni? - - - - File exists - Fájl létezik - - - - <qt>Do you want to overwrite it?</qt> - <qt>Felül szeretné írni?</qt> - - - - %1 is a directory. -Please choose a different file name. - A(z) %1 egy könyvtár. -Kérem válasszon egy különböző fájl nevet. - - - - The 'From' value cannot be greater than the 'To' value. - A '-Tól' érték nem lehet nagyobb az '-Ig' értéknél. - - - - A0 - A0 - - - - A1 - A1 - - - - A2 - A2 - - - - A3 - A3 - - - - A4 - A4 - - - - A5 - A5 - - - - A6 - A6 - - - - A7 - A7 - - - - A8 - A8 - - - - A9 - A9 - - - - B0 - B0 - - - - B1 - B1 - - - - B2 - B2 - - - - B3 - B3 - - - - B4 - B4 - - - - B5 - B5 - - - - B6 - B6 - - - - B7 - B7 - - - - B8 - B8 - - - - B9 - B9 - - - - B10 - B10 - - - - C5E - C5E - - - - DLE - DLE - - - - Executive - Vezető - - - - Folio - Fólió - - - - Ledger - Főkönyv - - - - Legal - Legális - - - - Letter - Levél - - - - Tabloid - Tabletta - - - - US Common #10 Envelope - US közös #10 bélyeg - - - - Custom - Egyéni - - - - - &Options >> - &Opciók >> - - - - &Options << - &Opciók << - - - - Print to File (PDF) - Fájlba nyomtatás (PDF) - - - - Print to File (Postscript) - Fájlba nyomtatás (Postscript) - - - - Local file - Helyi fájl - - - - Write %1 file - %1 fájlba írás - - - - &Print - &Nyomtatás - - - - QPrintPreviewDialog - - - %1% - %1% - - - - Print Preview - Nyomtatási előnézet - - - - Next page - Következő lap - - - - Previous page - Előző lap - - - - First page - Első lap - - - - Last page - Utolsó lap - - - - Fit width - Megfelelő szélesség - - - - Fit page - Megfelelő lap - - - - Zoom in - Nagyítás - - - - Zoom out - Kicsinyítés - - - - Portrait - Portré - - - - Landscape - Tájkép - - - - Show single page - Egyetlen lap megjelenítése - - - - Show facing pages - Lapok megjelenítése szemből - - - - Show overview of all pages - Az összes lap áttekintésének megjelenítése - - - - Print - Nyomtatás - - - - Page setup - Lap beállítás - - - - Export to PDF - PDF-be exportálás - - - - Export to PostScript - PostScript-be exportálás - - - - - Page Setup - Lap beállítás - - - - QPrintPropertiesWidget - - - Form - Forma - - - - Page - Lap - - - - Advanced - Speciális - - - - QPrintSettingsOutput - - - Form - Forma - - - - Copies - Másolás - - - - Print range - Tartomány nyomtatása - - - - Print all - Az összes nyomtatása - - - - Pages from - Lapok ettől - - - - to - eddig - - - - Selection - Kiválasztás - - - - Output Settings - Kimeneti beállítások - - - - Copies: - Másolatok: - - - - Collate - Egyeztet - - - - Reverse - Fordítva - - - - Options - Opciók - - - - Color Mode - Színes mód - - - - Color - Szín - - - - Grayscale - Szürkeárnyalat - - - - Duplex Printing - Dupla nyomtatás - - - - None - Semmi - - - - Long side - Hosszú oldal - - - - Short side - Rövid oldal - - - - QPrintWidget - - - Form - Űrlap - - - - Printer - Nyomtató - - - - &Name: - &Név: - - - - P&roperties - Tu&lajdonságok - - - - Location: - Elhelyezkedés: - - - - Preview - Előnézet - - - - Type: - Típus: - - - - Output &file: - Kimeneti &fájl: - - - - ... - ... - - - - QProcess - - - - Could not open input redirection for reading - Nem sikerült megnyitni a bevitel olvasásra irányítását - - - - - Could not open output redirection for writing - Nem sikerült megnyitni a kimenet írásra irányítását - - - - Resource error (fork failure): %1 - Erőforrás hiba (Szétágazás hiba): %1 - - - - - - - - - - - - Process operation timed out - Folyamat művelet időtúllépés - - - - - - - Error reading from process - Hiba történt a folyamat olvasása közben - - - - - - Error writing to process - Hiba történt a folyamat írása közben - - - - Process crashed - A folyamat összeomlott - - - - No program defined - Nincs program definiálva - - - - Process failed to start: %1 - Nem sikerült elindítani a folyamatot: %1 - - - - QProgressDialog - - - Cancel - Mégse - - - - QPushButton - - - Open - Megnyitás - - - - QRadioButton - - - Check - Ellenőrzés - - - - QRegExp - - - no error occurred - nem történt hiba - - - - disabled feature used - tiltás tulajdonság használva - - - - bad char class syntax - rossz karakter osztály szintakszis - - - - bad lookahead syntax - rossz előreolvasási szintakszis - - - - bad repetition syntax - rossz ismétlési szintakszis - - - - invalid octal value - érvénytelen oktális érték - - - - missing left delim - hiányzó bal határolójel - - - - unexpected end - váratlan vég - - - - met internal limit - találkozott belső korlát - - - - invalid interval - érvénytelen intervallum - - - - invalid category - érvénytelen kategória - - - - QSQLite2Driver - - - Error opening database - Hiba történt az adatbázis megnyitása közben - - - - Unable to begin transaction - Nem lehet elkezdeni a tranzakciót - - - - Unable to commit transaction - Nem lehet kommitolni a tranzakciót - - - - Unable to rollback transaction - Nem lehet visszagörgetni a tranzakciót - - - - QSQLite2Result - - - Unable to fetch results - Nem lehet letölteni az eredményeket - - - - Unable to execute statement - Nem lehet végrehajtani az állítást - - - - QSQLiteDriver - - - Error opening database - Hiba történt az adatbázis megnyitása közben - - - - Error closing database - Hiba történt az adatbázis bezárása közben - - - - Unable to begin transaction - Nem lehet elkezdeni a tranzakciót - - - - Unable to commit transaction - Nem lehet kommitolni a tranzakciót - - - - Unable to rollback transaction - Nem lehet visszagörgetni a tranzakciót - - - - QSQLiteResult - - - - - Unable to fetch row - Nem lehet leszedni a sort - - - - Unable to execute statement - Nem lehet végrehajtani az állítást - - - - Unable to reset statement - Nem lehet visszaállítani az állítást - - - - Unable to bind parameters - Nem lehet összekötni a paramétereket - - - - Parameter count mismatch - A paraméter számláló nem megfelelő - - - - No query - Nincs lekérdezés - - - - QScriptBreakpointsModel - - - ID - Azonosító - - - - Location - Elhelyezkedés - - - - Condition - Feltétel - - - - Ignore-count - Számítás mellőzése - - - - Single-shot - Egylövetű - - - - Hit-count - Leütés számítás - - - - QScriptBreakpointsWidget - - - New - Új - - - - Delete - Törlés - - - - QScriptDebugger - - - - Go to Line - Ugrás erre a sorra - - - - Line: - Sor: - - - - Interrupt - Megszakítás - - - - Shift+F5 - Shift+F5 - - - - Continue - Folytatás - - - - F5 - F5 - - - - Step Into - Belelépés - - - - F11 - F11 - - - - Step Over - Átlépés - - - - F10 - F10 - - - - Step Out - Kilép - - - - Shift+F11 - Shift+F11 - - - - Run to Cursor - Kurzorra futás - - - - Ctrl+F10 - Ctrl+F10 - - - - Run to New Script - Az új Szkriptre futás - - - - Toggle Breakpoint - Töréspont kapcsolgatása - - - - F9 - F9 - - - - Clear Debug Output - Debug kimenet kiürítése - - - - Clear Error Log - Error Log kiürítése - - - - Clear Console - Konzol kiürítése - - - - &Find in Script... - Szkriptben &keresés... - - - - Ctrl+F - Ctrl+F - - - - Find &Next - &Következő keresése - - - - F3 - F3 - - - - Find &Previous - &Előző keresése - - - - Shift+F3 - Shift+F3 - - - - Ctrl+G - Ctrl+G - - - - Debug - Debug - - - - QScriptDebuggerCodeFinderWidget - - - Close - Bezárás - - - - Previous - Előző - - - - Next - Következő - - - - Case Sensitive - Kis és nagybetű érzékeny - - - - Whole words - Egész szavakat - - - - <img src=":/qt/scripttools/debugging/images/wrap.png">&nbsp;Search wrapped - <img src=":/qt/scripttools/debugging/images/wrap.png">&nbsp;Keresés tördelve - - - - QScriptDebuggerLocalsModel - - - Name - Név - - - - Value - Érték - - - - QScriptDebuggerStackModel - - - Level - Szint - - - - Name - Név - - - - Location - Elhelyezkedés - - - - QScriptEdit - - - Toggle Breakpoint - Töréspont kapcsolgatása - - - - Disable Breakpoint - Töréspont tiltása - - - - Enable Breakpoint - Töréspont engedélyezése - - - - Breakpoint Condition: - Töréspont feltétel: - - - - QScriptEngineDebugger - - - Loaded Scripts - Betöltött szkriptek - - - - Breakpoints - Töréspontok - - - - Stack - Verem - - - - Locals - Helyi változók - - - - Console - Konzol - - - - Debug Output - Debug kimenet - - - - Error Log - Hiba Log - - - - Search - Keresés - - - - View - Nézet - - - - Qt Script Debugger - Qt szkript debugger - - - - QScriptNewBreakpointWidget - - - Close - Bezárás - - - - QScrollBar - - - Scroll here - Görgetés itt - - - - Left edge - Bal szegély - - - - Top - Tető - - - - Right edge - Jobb szegély - - - - Bottom - Alja - - - - Page left - Lapzoás balra - - - - - Page up - Lapozás felfele - - - - Page right - Lapozás jobbra - - - - - Page down - Lapozás lefele - - - - Scroll left - Görgetés balra - - - - Scroll up - Görgetés felfele - - - - Scroll right - Görgetés jobbra - - - - Scroll down - Görgetés lefele - - - - Line up - Egy sorral feljebb - - - - Position - Pozíció - - - - Line down - Egy sorral lejjebb - - - - QSharedMemory - - - %1: create size is less then 0 - %1: 0-nál kisebb méret létrehozása - - - - - %1: unable to lock - %1: Nem lehet zárolni - - - - %1: unable to unlock - %1: Nem lehet kinyitni - - - - - - %1: permission denied - %1: engedély megtagadva - - - - - - %1: already exists - %1: már létezik - - - - %1: doesn't exists - %1: nem létezik - - - - - - %1: out of resources - %1: Kifogyott az erőforrásból - - - - - - %1: unknown error %2 - %1: ismeretlen hiba %2 - - - - %1: key is empty - %1: Üres kulcs - - - - %1: ftok failed - %1: ftok hiba - - - - - - %1: unable to make key - %1: Nem lehet kulcsot csinálni - - - - - %1: doesn't exist - %1: nem létezik - - - - %1: UNIX key file doesn't exist - %1: UNIX kulcs fájl nem létezik - - - - %1: system-imposed size restrictions - %1: a rendszer rárakott méretének korlátozásai - - - - %1: not attached - %1: nincs hozzácsatolva - - - - - %1: invalid size - %1: érvénytelen méret - - - - - %1: key error - %1: kulcs hiba - - - - %1: size query failed - %1: méret lekérdezési hiba - - - - %1: unable to set key on lock - %1: nem lehet beállítani a kulcsot a záron - - - - QShortcut - - - Space - Space - - - - Esc - Esc - - - - Tab - Tab - - - - Backtab - Backtab - - - - Backspace - Backspace - - - - Return - Return - - - - Enter - Enter - - - - Ins - Ins - - - - Del - Del - - - - Pause - Pause - - - - Print - Print - - - - SysReq - SysReq - - - - Home - Home - - - - End - End - - - - Left - Left - - - - Up - Up - - - - Right - Right - - - - Down - Down - - - - PgUp - PgUp - - - - PgDown - PgDown - - - - CapsLock - CapsLock - - - - NumLock - NumLock - - - - ScrollLock - ScrollLock - - - - Menu - Menü - - - - Help - Súgó - - - - Back - Vissza - - - - Forward - Előre - - - - Stop - Leállítás - - - - Refresh - Felfrissítés - - - - Volume Down - Hangerő lehalkítása - - - - Volume Mute - Hangerő Elnémítás - - - - Volume Up - Hangerő hangosítása - - - - Bass Boost - Basszus erősítés - - - - Bass Up - Basszus növelése - - - - Bass Down - Basszus csökkentése - - - - Treble Up - Felháromszorozás - - - - Treble Down - Leharmadolás - - - - Media Play - Média elindítása - - - - Media Stop - Média leállítása - - - - Media Previous - Előző média - - - - Media Next - Következő média - - - - Media Record - Média felvétel - - - - Favorites - Kedvcencek - - - - Search - Keresés - - - - Standby - Készenlét - - - - Open URL - URL megnyitása - - - - Launch Mail - Mail indítása - - - - Launch Media - Média indítása - - - - Launch (0) - Elindítás (0) - - - - Launch (1) - Elindítás (1) - - - - Launch (2) - Elindítás (2) - - - - Launch (3) - Elindítás (3) - - - - Launch (4) - Elindítás (4) - - - - Launch (5) - Elindítás (5) - - - - Launch (6) - Elindítás (6) - - - - Launch (7) - Elindítás (7) - - - - Launch (8) - Elindítás (8) - - - - Launch (9) - Elindítás (9) - - - - Launch (A) - Elindítás (A) - - - - Launch (B) - Elindítás (B) - - - - Launch (C) - Elindítás (C) - - - - Launch (D) - Elindítás (D) - - - - Launch (E) - Elindítás (E) - - - - Launch (F) - Elindítás (F) - - - - Monitor Brightness Up - Monitorfény növelése - - - - Monitor Brightness Down - Monitorfény csökkentése - - - - Keyboard Light On/Off - Billentyű világítás be/ki - - - - Keyboard Brightness Up - Billentyűfény növelése - - - - Keyboard Brightness Down - Billentyűfény csökkentése - - - - Power Off - Kikapcsolás - - - - Wake Up - Felébresztés - - - - Eject - Kidobás - - - - Screensaver - Képernyővédő - - - - WWW - WWW - - - - Sleep - Alvás - - - - LightBulb - Villanykörte - - - - Shop - Bolt - - - - History - Történelem - - - - Add Favorite - Hozzáadás a kedvencekhez - - - - Hot Links - Hot linkek - - - - Adjust Brightness - Fényszabályozás - - - - Finance - Pénzügy - - - - Community - Közösség - - - - Audio Rewind - Audió áttekercselés - - - - Back Forward - Előre hátra - - - - Application Left - Alkalmazás balra - - - - Application Right - Alkalmazás jobbra - - - - Book - Könyv - - - - CD - CD - - - - Calculator - Számológép - - - - Clear - Tiszta - - - - Clear Grab - Tiszta megmarkolás - - - - Close - Bezárás - - - - Copy - Másolás - - - - Cut - Kivágás - - - - Display - Megjelenítés - - - - DOS - DOS - - - - Documents - Dokumentumok - - - - Spreadsheet - Táblázatkezelő - - - - Browser - Böngésző - - - - Game - Játék - - - - Go - Gyerünk - - - - iTouch - iTouch - - - - Logoff - Kijelentkezés - - - - Market - Piac - - - - Meeting - Találkozó - - - - Keyboard Menu - Billlentyű menü - - - - Menu PB - PB menü - - - - My Sites - Oldalam - - - - News - Hírek - - - - Home Office - Otthoni iroda - - - - Option - Opció - - - - Paste - Beillesztés - - - - Phone - Telefon - - - - Reply - Válasz - - - - Reload - Újratöltés - - - - Rotate Windows - Ablakok forgatása - - - - Rotation PB - PB forgatás - - - - Rotation KB - KB forgatás - - - - Save - Mentés - - - - Send - Küldés - - - - Spellchecker - Helyesírás ellenőrző - - - - Split Screen - Képernyő felosztása - - - - Support - Támogatás - - - - Task Panel - Feladat panel - - - - Terminal - Terminál - - - - Tools - Eszközök - - - - Travel - Utazás - - - - Video - Videó - - - - Word Processor - Szó feldolgozó - - - - XFer - XFer - - - - Zoom In - Nagyítás - - - - Zoom Out - Kicsinyítés - - - - Away - Távol - - - - Messenger - Hírnök - - - - WebCam - WebCam - - - - Mail Forward - Mail továbbítása - - - - Pictures - Képek - - - - Music - Zene - - - - Battery - Elem - - - - Bluetooth - Bluetooth - - - - Wireless - Vezeték nélküli - - - - Ultra Wide Band - Ultra széles sáv - - - - Audio Forward - Audio továbbítás - - - - Audio Repeat - Audió ismétlés - - - - Audio Random Play - Audió véletlenszerű lejátszása - - - - Subtitle - Alcím - - - - Audio Cycle Track - Audió ciklikus követése - - - - Time - Idő - - - - View - Nézet - - - - Top Menu - Felső menü - - - - Suspend - Felfüggesztés - - - - Hibernate - Hibernálás - - - - Print Screen - Képernyő másolás - - - - Page Up - Feljebb lapozás - - - - Page Down - Lejjebb lapozás - - - - Caps Lock - Caps Lock - - - - Num Lock - Num Lock - - - - Number Lock - Number Lock - - - - Scroll Lock - Scroll Lock - - - - Insert - Insert - - - - Delete - Delete - - - - Escape - Escape - - - - System Request - System Request - - - - - Select - Kiválsztás - - - - Yes - Igen - - - - No - Nem - - - - Context1 - Tartalom1 - - - - Context2 - Tartalom2 - - - - Context3 - Tartalom3 - - - - Context4 - Tartalom4 - - - - Call - Hívás - - - - Hangup - Felfüggeszt - - - - Flip - Feldobás - - - - - Ctrl - Ctrl - - - - - Shift - Shift - - - - - Alt - Alt - - - - - Meta - Meta - - - - + - + - - - - F%1 - F%1 - - - - Home Page - Honlap - - - - QSlider - - - Page left - Lapozás balra - - - - Page up - Lapozás felfele - - - - Position - Pozíció - - - - Page right - Lapozás jobbra - - - - Page down - Lapozás lefele - - - - QSocks5SocketEngine - - - Connection to proxy refused - Proxyhoz kapcsolódás elutasítva - - - - Connection to proxy closed prematurely - A proxyhoz való csatlakozás túl korán be lett zárva - - - - Proxy host not found - Proxy hoszt nem található - - - - Connection to proxy timed out - Proxyhoz való csatlakozásnál időtúllépés történt - - - - Proxy authentication failed - Proxy hitelesítési hiba - - - - Proxy authentication failed: %1 - Proxy hitelesítési hiba: %1 - - - - SOCKS version 5 protocol error - SOCKS verzió 5-s protokoll hiba - - - - General SOCKSv5 server failure - Általános SOCKSv5 szerver hiba - - - - Connection not allowed by SOCKSv5 server - A csatlakozást nem engedi a SOCKSv5 szerver - - - - TTL expired - Lejárt a TTL - - - - SOCKSv5 command not supported - SOCKSv5 parancs nincs támogatva - - - - Address type not supported - Cím típus nincs támogatva - - - - Unknown SOCKSv5 proxy error code 0x%1 - Ismeretlen SOCKSv5 proxy hiba kód 0x%1 - - - - Network operation timed out - Hálózat műveleti időtúllépés - - - - QSoftKeyManager - - - Ok - Ok - - - - Select - Kiválasztás - - - - Done - Kész - - - - Options - Opciók - - - - Cancel - Mégse - - - - Exit - Kilépés - - - - QSpinBox - - - More - Több - - - - Less - Kevés - - - - QSql - - - Delete - Törlés - - - - Delete this record? - Törölni szeretné ezt a felvételt? - - - - - - Yes - Igen - - - - - - No - Nem - - - - Insert - Beszúrás - - - - Update - Frissítés - - - - Save edits? - Szerkesztések mentése? - - - - Cancel - Mégse - - - - Confirm - Megerősítés - - - - Cancel your edits? - Szerkesztések visszavonása? - - - - QSslSocket - - - Unable to write data: %1 - Nem lehet adatot írni: %1 - - - - Error while reading: %1 - Hiba történt olvasás közben: %1 - - - - Error during SSL handshake: %1 - Hiba történt az SSL kézfogás közben: %1 - - - - Error creating SSL context (%1) - Hiba történt az SSL összefüggés (%1) létrehozása közben - - - - Invalid or empty cipher list (%1) - Érvénytelen vagy üres számjegy lista (%1) - - - - Private key does not certify public key, %1 - A privát kulcs nem igazolja a publikus kulcsot, %1 - - - - Error creating SSL session, %1 - Hiba történt az SSL szakasz létrehozása közben, %1 - - - - Error creating SSL session: %1 - Hiba történt az SSL szakasz létrehozása közben: %1 - - - - Cannot provide a certificate with no key, %1 - Nem lehet biztosítani egy igazolást kulcs nélkül, %1 - - - - Error loading local certificate, %1 - Hiba történt a helyi igazolás betöltése közben, %1 - - - - Error loading private key, %1 - Hiba történt a privát kulcs betöltése közben, %1 - - - - No error - Nincs hiba - - - - The issuer certificate could not be found - A problémás igazolás nem található - - - - The certificate signature could not be decrypted - Az igazolás aláírás titkosítását nem sikerült feloldani - - - - The public key in the certificate could not be read - Az igazolásban található publikus kulcsot nem sikerült olvasni - - - - The signature of the certificate is invalid - Az igazolás aláírása érvénytelen - - - - The certificate is not yet valid - Az igazolás még nem érvényes - - - - The certificate has expired - Az igazolás lejárt - - - - The certificate's notBefore field contains an invalid time - A mező érvénytelen idő tartalmazása előtt nincsen igazolás - - - - The certificate's notAfter field contains an invalid time - A mező érvénytelen idő tartalmazása után nincsen igazolás - - - - The certificate is self-signed, and untrusted - Az igazolás ön jelölt, és megbízhatatlan - - - - The root certificate of the certificate chain is self-signed, and untrusted - Az igazolás lánc rendszergazda igazolása ön jelölt és megbízhatatlan - - - - The issuer certificate of a locally looked up certificate could not be found - Egy helyileg utánanézett igazolás problémás igazolása nem található - - - - No certificates could be verified - Nem sikerült igazolást leellenőrizni - - - - One of the CA certificates is invalid - A CA igazolások egyike érvénytelen - - - - The basicConstraints path length parameter has been exceeded - Az alap megszorítási útvonal hossz paramétereket meghaladták - - - - The supplied certificate is unsuitable for this purpose - A szolgáltatott igazolás nem alkalmas erre a célra - - - - The root CA certificate is not trusted for this purpose - A rendszergazda CA igazolás nem megbízható erre a célra - - - - The root CA certificate is marked to reject the specified purpose - A rendszergazda CA igazolás a specializást cél megtagadására lett megjelölve - - - - The current candidate issuer certificate was rejected because its subject name did not match the issuer name of the current certificate - Az aktuális jelölt problémás igazolása meg lett tagadva, mert a téma neve nem egyezett az aktuális igazolás problémás nevével - - - - The current candidate issuer certificate was rejected because its issuer name and serial number was present and did not match the authority key identifier of the current certificate - Az aktuális jelölt problémás igazolása el lett utasítva, mert a problémás név és sorszám benyűjtva és nem egyezett az aktuális igazolás hitelesítési kulcs azonosítójával - - - - The peer did not present any certificate - A kortárs nem nyújtott be egyetlen igazolást sem - - - - The host name did not match any of the valid hosts for this certificate - A hoszt név nem egyezik egyetlen érvényes hoszttal sem erre az igazolásra - - - - Unknown error - Ismeretlen hiba - - - - QStateMachine - - - Missing initial state in compound state '%1' - Hiányzó kezdeti állapot összetett helyzetben '%1' - - - - Missing default state in history state '%1' - Hiányzó alapértelmezett állapot a történelmi állapotokban '%1' - - - - No common ancestor for targets and source of transition from state '%1' - Nincs közös őse az átmeneti céloknak és forrásnak a(z) '%1' helyzetből - - - - Unknown error - Ismeretlen hiba - - - - QSystemSemaphore - - - %1: does not exist - %1 : nem létezik - - - - - %1: out of resources - %1: kifogyott az erőforrásból - - - - - %1: permission denied - %1: Engedély megtagadva - - - - %1: already exists - %1: már létezik - - - - - %1: unknown error %2 - %1: ismeretlen hiba %2 - - - - QTDSDriver - - - Unable to open connection - Nem lehet megnyitni a kapcsolatot - - - - Unable to use database - Nem lehet az adatbázist használni - - - - QTabBar - - - Scroll Left - Görgetés balra - - - - Scroll Right - Görgetésre jobbra - - - - QTcpServer - - - Operation on socket is not supported - A socketen végzett művelet nem támogatott - - - - QTextControl - - - &Undo - &Visszavonás - - - - &Redo - &Megismétlés - - - - Cu&t - &Kivágás - - - - &Copy - &Másolás - - - - Copy &Link Location - &Link címének másolása - - - - &Paste - &Beillesztés - - - - Delete - Törlés - - - - Select All - Az összes kiválasztása - - - - QToolButton - - - - Press - Megnyomás - - - - - Open - Megnyitás - - - - QUdpSocket - - - This platform does not support IPv6 - Ez a platform nem támogatja az IPv6-t - - - - QUndoGroup - - - Undo - Visszavonás - - - - Redo - Megismétlés - - - - QUndoModel - - - <empty> - <üres> - - - - QUndoStack - - - Undo - Visszavonás - - - - Redo - Megismétlés - - - - QUnicodeControlCharacterMenu - - - LRM Left-to-right mark - LRM balról jobbra jelölés - - - - RLM Right-to-left mark - RLM jobbról balra jelölés - - - - ZWJ Zero width joiner - ZWJ Nulla szélességű asztalos - - - - ZWNJ Zero width non-joiner - ZWNJ Nulla szélességű nem asztalos - - - - ZWSP Zero width space - ZWSP Nulla szélességű hely - - - - LRE Start of left-to-right embedding - LRE Balról jobbra beágyazás kezdete - - - - RLE Start of right-to-left embedding - RLE Jobbról balra beágyazás kezdete - - - - LRO Start of left-to-right override - LRO Balról jobbra megsemmisítés kezdete - - - - RLO Start of right-to-left override - RLO Jobbról balra megsemmisítés kezdete - - - - PDF Pop directional formatting - PDF Kérirányú formázás benézése - - - - Insert Unicode control character - Unicode vezérlő karakter beszúrása - - - - QWebFrame - - - Request cancelled - Kérés visszavonva - - - - Request blocked - Kérés blokkolva - - - - Cannot show URL - Nem lehet megjeleníteni az URL-t - - - - Frame load interrupted by policy change - Irányvonal megváltozása miatt a szerkezet töltése megszakítva - - - - Cannot show mimetype - Nem lehet megjeleníteni mime típust - - - - File does not exist - A fájl nem létezik - - - - QWebPage - - - Submit - default label for Submit buttons in forms on web pages - Feltöltés - - - - Submit - Submit (input element) alt text for <input> elements with no alt, title, or value - Feltöltés - - - - Reset - default label for Reset buttons in forms on web pages - Helyreállítás - - - - Choose File - title for file button used in HTML forms - Fájl kiválasztása - - - - No file selected - text to display in file button used in HTML forms when no file is selected - Nincsen egyetlen fájl sem kiválasztva - - - - Open in New Window - Open in New Window context menu item - Megnyitás új ablakban - - - - Save Link... - Download Linked File context menu item - Link mentése... - - - - Copy Link - Copy Link context menu item - Link másolása - - - - Open Image - Open Image in New Window context menu item - Kép megnyitása - - - - Save Image - Download Image context menu item - Kép elmentése - - - - Copy Image - Copy Link context menu item - Kép másolása - - - - Open Frame - Open Frame in New Window context menu item - Szerkezet megnyitása - - - - Copy - Copy context menu item - Másolás - - - - Go Back - Back context menu item - Menj vissza - - - - Go Forward - Forward context menu item - Menj előre - - - - Stop - Stop context menu item - Leállítás - - - - Reload - Reload context menu item - Újratöltés - - - - Cut - Cut context menu item - Kivágás - - - - Paste - Paste context menu item - Beillesztés - - - - No Guesses Found - No Guesses Found context menu item - Nincs feltételezések találata - - - - Ignore - Ignore Spelling context menu item - Mellőzés - - - - Add To Dictionary - Learn Spelling context menu item - Hozzáadás a szótárhoz - - - - Search The Web - Search The Web context menu item - Keresés a weben - - - - Look Up In Dictionary - Look Up in Dictionary context menu item - Utánanézés szótárban - - - - Open Link - Open Link context menu item - Link megnyitása - - - - Ignore - Ignore Grammar context menu item - Mellőzés - - - - Spelling - Spelling and Grammar context sub-menu item - Helyesírás - - - - Show Spelling and Grammar - menu item title - Helyesírás és nyelvtan megjelenítése - - - - Hide Spelling and Grammar - menu item title - Helyesírás és nyelvtan elrejtése - - - - Check Spelling - Check spelling context menu item - Helyesírás ellenőrzés - - - - Check Spelling While Typing - Check spelling while typing context menu item - Helyesírás ellenőrzés gépelés közben - - - - Check Grammar With Spelling - Check grammar with spelling context menu item - Nyelvtani ellenőrzés helyesírás ellenőrzéssel - - - - Fonts - Font context sub-menu item - Betű - - - - Bold - Bold context menu item - Félkövér - - - - Italic - Italic context menu item - Dőlt - - - - Underline - Underline context menu item - Aláhúzás - - - - Outline - Outline context menu item - Kontúrozás - - - - Direction - Writing direction context sub-menu item - Irány összefüggések írás, menü elem - - - - Text Direction - Text direction context sub-menu item - Szöveg irány - - - - Default - Default writing direction context menu item - Alapértelmezett - - - - Left to Right - Left to Right context menu item - Balról jobbra - - - - Right to Left - Right to Left context menu item - Jobbról balra - - - - Loading... - Media controller status message when the media is loading - Betöltés... - - - - Live Broadcast - Media controller status message when watching a live broadcast - Élő bejelentés - - - - Audio Element - Media controller element - Audió elem - - - - Video Element - Media controller element - Videó elem - - - - Mute Button - Media controller element - Elnémítás gomb - - - - Unmute Button - Media controller element - Elnémítás megszűntetése gomb - - - - Play Button - Media controller element - Lejátszás gomb - - - - Pause Button - Media controller element - Szünet gomb - - - - Slider - Media controller element - Csúszka - - - - Slider Thumb - Media controller element - Csuszka ujj - - - - Rewind Button - Media controller element - Áttekercselés gomb - - - - Return to Real-time Button - Media controller element - A valós idejűre visszatérés gomb - - - - Elapsed Time - Media controller element - Eltelt idő - - - - Remaining Time - Media controller element - Fennmaradó idő - - - - Status Display - Media controller element - Státusz kijelzés - - - - Fullscreen Button - Media controller element - Teljes képernyő gomb - - - - Seek Forward Button - Media controller element - Keresés továbbítása gomb - - - - Seek Back Button - Media controller element - Keresés visszafele gomb - - - - Audio element playback controls and status display - Media controller element - Audió elem visszajátszás vezérlők és státusz kijelzés - - - - Video element playback controls and status display - Media controller element - Videó elem visszajátszás vezérlők és státusz kijelzés - - - - Mute audio tracks - Media controller element - Audió számok elnémítása - - - - Unmute audio tracks - Media controller element - Audió számok elnémításának megszűntetése - - - - Begin playback - Media controller element - Visszajátszás megkezdése - - - - Pause playback - Media controller element - Visszajátszás szüneteltetése - - - - Movie time scrubber - Media controller element - Film idő súroló - - - - Movie time scrubber thumb - Media controller element - Film idő súrolókörte - - - - Rewind movie - Media controller element - Film visszatekerése - - - - Return streaming movie to real-time - Media controller element - Özönlő filmek visszaadása a valós idő számára - - - - Current movie time - Media controller element - Az aktuális filmidő - - - - Remaining movie time - Media controller element - Fennmaradó filmidő - - - - Current movie status - Media controller element - Az aktuális film státusz - - - - Play movie in full-screen mode - Media controller element - Film lejátszása teljes képernyős módban - - - - Seek quickly back - Media controller element - Gyorsan visszafele keresés - - - - Seek quickly forward - Media controller element - Gyorsan előre keresés - - - - Indefinite time - Media time description - Bizonytalan idő - - - - %1 days %2 hours %3 minutes %4 seconds - Media time description - %1 nap %2 óra %3 perc %4 másodperc - - - - %1 hours %2 minutes %3 seconds - Media time description - %1 óra %2 perc %3 másodperc - - - - %1 minutes %2 seconds - Media time description - %1 perc %2 másodperc - - - - %1 seconds - Media time description - %1 másodperc - - - - Inspect - Inspect Element context menu item - Megtekintés - - - - No recent searches - Label for only item in menu that appears when clicking on the search field image, when no searches have been performed - Nincsenek utóbbi keresések - - - - Recent searches - label for first item in the menu that appears when clicking on the search field image, used as embedded menu title - Utóbbi keresések - - - - Clear recent searches - menu item in Recent Searches menu that empties menu's contents - Utóbbi keresések kiürítése - - - - Unknown - Unknown filesize FTP directory listing item - Ismeretlen - - - - Web Inspector - %2 - Web felügyelő - %2 - - - - %1 (%2x%3 pixels) - Title string for images - %1 (%2x%3 pixelek) - - - - Bad HTTP request - Érvénytelen HTTP kérés - - - - This is a searchable index. Enter search keywords: - text that appears at the start of nearly-obsolete web pages in the form of a 'searchable index' - Ez egy kereshető index. Gépelje be a kívánt kulcsszavakat: - - - - Scroll here - Görgetés ide - - - - Left edge - Bal szegély - - - - Top - Felül - - - - Right edge - Jobb szegély - - - - Bottom - Alul - - - - Page left - Lapozás balra - - - - Page up - Lapozás fel - - - - Page right - Lapozás jobbra - - - - Page down - Lapozás balra - - - - Scroll left - Görgetés balra - - - - Scroll up - Görgetés fel - - - - Scroll right - Görgetés jobbra - - - - Scroll down - Görgetés lefele - - - - %n file(s) - number of chosen file - - %n fájl - - - - - JavaScript Alert - %1 - JavaSzkript figyelmeztetés - %1 - - - - JavaScript Confirm - %1 - JavaSzkript megerősítés - %1 - - - - JavaScript Prompt - %1 - JavaSzkript prompt - %1 - - - - JavaScript Problem - %1 - JavaSzkript probléma - %1 - - - - The script on this page appears to have a problem. Do you want to stop the script? - Az ezen a lapon található szkriptnek úgy tűnik, hogy van egy problémája. Le szeretné állítani a szkriptet? - - - - Move the cursor to the next character - Az egér mozgatása a következő karakterre - - - - Move the cursor to the previous character - Az egér mozgatása az előző karakterre - - - - Move the cursor to the next word - Az egér mozgatása a következő szóra - - - - Move the cursor to the previous word - Az egér mozgatása az előző szóra - - - - Move the cursor to the next line - Az egér mozgatása a következő sorra - - - - Move the cursor to the previous line - Az egér mozgatása az előző sorra - - - - Move the cursor to the start of the line - Az egér mozgatása a sor elejére - - - - Move the cursor to the end of the line - Az egér mozgatása a sor végére - - - - Move the cursor to the start of the block - Az egér mozgatása a blokk elejére - - - - Move the cursor to the end of the block - Az egér mozgatása a blokk végére - - - - Move the cursor to the start of the document - Az egér mozgatása a dokumentum elejére - - - - Move the cursor to the end of the document - Az egér mozgatása a dokumentum végére - - - - Select all - Az összes kiválasztása - - - - Select to the next character - A következő karakter kiválasztása - - - - Select to the previous character - Az előző karakter kiválasztása - - - - Select to the next word - A következő szó kiválasztása - - - - Select to the previous word - Az előző szó kiválasztása - - - - Select to the next line - A következő sor kiválasztása - - - - Select to the previous line - Az előző sor kiválasztása - - - - Select to the start of the line - A sor elejének kiválasztása - - - - Select to the end of the line - A sor végének kiválasztása - - - - Select to the start of the block - A blokk elejének kiválsztása - - - - Select to the end of the block - A blokk végének kiválasztása - - - - Select to the start of the document - A dokumentum elejének kiválasztása - - - - Select to the end of the document - A dokumentum végének kiválasztása - - - - Delete to the start of the word - A szó elejének törlése - - - - Delete to the end of the word - A szó végének törlése - - - - Insert a new paragraph - Egy új bekezdés beszúrása - - - - Insert a new line - Egy új sor beszúrása - - - - Paste and Match Style - Stílus beillesztése és összepasszintása - - - - Remove formatting - Formázás eltávolítása - - - - Strikethrough - Áthúzás - - - - Subscript - Alsó index - - - - Superscript - Felső index - - - - Insert Bulleted List - Hivatalos közlemény lista beszúrása - - - - Insert Numbered List - Számozott lista beszúrása - - - - Indent - Behúzás - - - - Outdent - Behúzás kifelé - - - - Center - Közép - - - - Justify - Igazolás - - - - Align Left - Balra állít - - - - Align Right - Jobbra állít - - - - QWhatsThisAction - - - What's This? - Mi ez? - - - - QWidget - - - * - * - - - - QWizard - - - Cancel - Mégse - - - - Help - Súgó - - - - < &Back - < &Vissza - - - - &Finish - &Befejezés - - - - &Help - &Súgó - - - - Go Back - Vissza ugrás - - - - Continue - Folytatás - - - - Commit - Kommit - - - - Done - Kész - - - - &Next - &Következő - - - - &Next > - &Következő > - - - - QWorkspace - - - &Restore - &Visszaállítás - - - - &Move - &Mozgatás - - - - &Size - &Méret - - - - Mi&nimize - &Minimalizálás - - - - Ma&ximize - Ma&ximalizálás - - - - &Close - &Bezárás - - - - Stay on &Top - &Tetején maradni - - - - Minimize - Minimalizálás - - - - Restore Down - Letárolás - - - - Close - Bezárás - - - - - Sh&ade - Árnya&lat - - - - - %1 - [%2] - %1 - [%2] - - - - &Unshade - &Leeresztés - - - - QXml - - - no error occurred - nem történt hiba - - - - error triggered by consumer - Ügyfél által előidézett hiba - - - - unexpected end of file - Váratlan fájlvég - - - - more than one document type definition - Több mint egy dokumentum típus definíció - - - - error occurred while parsing element - Hiba történt az elem elemzése közben - - - - tag mismatch - Nem egyező címke - - - - error occurred while parsing content - Hiba történt a tartalom elemzése közben - - - - unexpected character - váratlan karakter - - - - invalid name for processing instruction - érvénytelen név az utasítás feldolgozására - - - - version expected while reading the XML declaration - várt verzió az XML deklaráció olvasása közben - - - - wrong value for standalone declaration - Hibás egyedülálló deklaráció érték - - - - error occurred while parsing document type definition - Hiba történt a dokumentum típus definíció elemzése közben - - - - letter is expected - betű várt - - - - error occurred while parsing comment - hiba történt az elemző megjegyzés előfordulása közben - - - - error occurred while parsing reference - Hiba történt az elemző hivatkozás előfordulása közben - - - - internal general entity reference not allowed in DTD - A DTD-ben nem engedélyezett a belső általános valós hivatkozás - - - - external parsed general entity reference not allowed in attribute value - Az attribútum értékben nem engedélyezett a külsőleg elemzett általános valós hivatkozás - - - - external parsed general entity reference not allowed in DTD - A DTD-ben nem engedélyezett a külsőleg elemzett általános valós hivatkozás - - - - unparsed entity reference in wrong context - Hivatkozás egy nem értelmezett entitásra hibás összefüggésben - - - - recursive entities - Rekurzív entitások - - - - error in the text declaration of an external entity - Hiba egy külső entitás szöveg deklarációjában - - - - encoding declaration or standalone declaration expected while reading the XML declaration - Kódolása deklaráció vagy egyedülálló deklaráció várt az XML deklaráció olvasása közben - - - - standalone declaration expected while reading the XML declaration - Egyedülálló deklaráció várt az XML deklaráció olvasása közben - - - - QXmlPatternistCLI - - - Warning in %1, at line %2, column %3: %4 - Figyelmeztetés %1-ben, %2 sorban, %3 oszlopban: %4 - - - - Warning in %1: %2 - Figyelmeztetés %1-ben: %2 - - - - Unknown location - Ismeretlen elhelyezkedés - - - - Error %1 in %2, at line %3, column %4: %5 - %1 hiba %2-ben, %3 sorban, %4 oszlopban: %5 - - - - Error %1 in %2: %3 - %1 hiba %2-ben: %3 - - - - QXmlStream - - - - Extra content at end of document. - Extra tartalom a dokumentum végén. - - - - Invalid entity value. - Érvénytelen entitás érték. - - - - Invalid XML character. - Érvénytelen XML karakter. - - - - Sequence ']]>' not allowed in content. - ']]>' sor nem engedélyezett a tartalomban. - - - - Namespace prefix '%1' not declared - '%1' névtér előtag nincsen deklarálva - - - - Attribute redefined. - Attribútum újradefiniálva. - - - - Unexpected character '%1' in public id literal. - Váratlan karakter '%1' a publikus azonosító literál. - - - - Invalid XML version string. - Érvénytelen XML verzió sztring. - - - - Unsupported XML version. - Nem támogatott XML verzió. - - - - %1 is an invalid encoding name. - %1 egy érvénytelen kódolási név. - - - - Encoding %1 is unsupported - %1 kódolás nem támogatva - - - - Standalone accepts only yes or no. - Egyedülálló elfogadás kizárólas igen vagy nem. - - - - Invalid attribute in XML declaration. - Érvénytelen attribútum az XML deklarációban. - - - - Premature end of document. - Túl korai dokumentum vég. - - - - Invalid document. - Érvénytelen dokumentum. - - - - Expected - Várt - - - - , but got ' - , pedig megkapta ' - - - - Unexpected ' - Váratlan ' - - - - Expected character data. - Várt karakter adat. - - - - Recursive entity detected. - Rekurzív entitás észlelve. - - - - Start tag expected. - Kezdő címke várva. - - - - XML declaration not at start of document. - XML deklaráció nem a dokumentum elején található. - - - - NDATA in parameter entity declaration. - NDATA a paraméter entitás deklarációban. - - - - %1 is an invalid processing instruction name. - %1 egy érvénytelen feldolgozó utasítás neve. - - - - Invalid processing instruction name. - Érvénytelen feldolgozó utasítás név. - - - - - - - Illegal namespace declaration. - Illegális névtér deklarációk. - - - - Invalid XML name. - Érvénytelen XML név. - - - - Opening and ending tag mismatch. - Nyitó és záró címkék nem egyeznek. - - - - Reference to unparsed entity '%1'. - Hivatkozás egy nem értelmezett entitásra '%1'. - - - - - - Entity '%1' not declared. - '%1' entitás nincsen deklarálva. - - - - Reference to external entity '%1' in attribute value. - Hivatkozás egy külső entitásra '%1' az attribútum értékben. - - - - Invalid character reference. - Érvénytelen karakter hivatkozás. - - - - - Encountered incorrectly encoded content. - Helytelen kódolási tartalommal találta szembe magát. - - - - The standalone pseudo attribute must appear after the encoding. - Az egyedülálló ál attribútumnak a kódolás után kell feltűnnie. - - - - %1 is an invalid PUBLIC identifier. - %1 egy érvénytelen PUBLIC-us azonosító. - - - - QtXmlPatterns - - - - At least one component must be present. - Legalább egy komponenset be kell nyújtani. - - - - %1 is not a valid value of type %2. - %1 nem egy érvény értéke a(z) %2 típusnak. - - - - When casting to %1 from %2, the source value cannot be %3. - A(z) %1-ről %2-re történő kasztoláskor, a forrás érték nem lehet %3. - - - - Effective Boolean Value cannot be calculated for a sequence containing two or more atomic values. - Hatékony logikai értéket nem lehet egy sor számára kiszámítani, amely kettő vagy több atomikus értéket tartalmaz. - - - - The data of a processing instruction cannot contain the string %1 - Egy feldolgozó utasítás adata nem tartalmazhat %1 sztringet - - - - - %1 is an invalid %2 - %1 egy érvénytelen %2 - - - - %1 is not a valid XML 1.0 character. - %1 egy érvénytelen 1.0 XML karakter. - - - - %1 was called. - %1 lett meghívva. - - - - In the replacement string, %1 must be followed by at least one digit when not escaped. - A kicserélési sztrinben, %1 -t legalább egy számnak kell követnie nem meneküléskor. - - - - In the replacement string, %1 can only be used to escape itself or %2, not %3 - A kicserelési sztringben, %1-t csak magának a(z) %2 vagy %3 menekülésére lehet használni - - - - %1 matches newline characters - %1 megegyező újsor karakterek - - - - Matches are case insensitive - Az egyezés kis és nagybetűre nem érzékeny - - - - %1 is an invalid regular expression pattern: %2 - %1 egy érvénytelen reguláris kifejezés minta: %2 - - - - It will not be possible to retrieve %1. - Nem lesz lehetséges kinyerni %1. - - - - The default collection is undefined - Az alapértelmezett gyűjtemény nincs definiálva - - - - %1 cannot be retrieved - %1 nem lehet megszerezni - - - - The item %1 did not match the required type %2. - A(z) %1 elem nem egyezik a szükséges típussal %2. - - - - - %1 is an unknown schema type. - %1 egy ismeretlen terv típus. - - - - A template with name %1 has already been declared. - Egy %1 nevű sablon már deklarálva van. - - - - Only one %1 declaration can occur in the query prolog. - Kizárólag egy %1 deklaráció fordulhat elő a kérdéses előszóban. - - - - The initialization of variable %1 depends on itself - A(z) %1 változó inicializálása önmagától függ - - - - The variable %1 is unused - A(z) %1 változó nincsen használva - - - - Version %1 is not supported. The supported XQuery version is 1.0. - %1-es verzió nem támogatott. A támogatott XQuery verzió az 1.0. - - - - No function with signature %1 is available - Nincs %1 aláírással rendelkező függvény - - - - It is not possible to redeclare prefix %1. - Nem lehetséges a(z) %1 előtag újradeklarálása. - - - - Prefix %1 is already declared in the prolog. - %1 előtag már deklarálva van az előszóban. - - - - The name of an option must have a prefix. There is no default namespace for options. - Az opció nevének tartalmaznia kell egy előtagot. Nincs alapértelmezett névtér ezekre az opciókra. - - - - The Schema Import feature is not supported, and therefore %1 declarations cannot occur. - A terv importálása tulajdonság nem támogatott, és ennek következtében a(z) %1 deklarációk nem fordulhatnak elő. - - - - The target namespace of a %1 cannot be empty. - Egy %1 cél névtere nem lehet üres. - - - - The module import feature is not supported - A modul importáló tulajdonság nem támogatott - - - - The namespace of a user defined function in a library module must be equivalent to the module namespace. In other words, it should be %1 instead of %2 - Egy felhasználó által definiált függvény névterének egy könyvtár modulban megfelelőnek kell lenni a modul névtérrel. Más szóval, %1-nek kellene lennie %2 helyett - - - - A function already exists with the signature %1. - Egy függvény már létezik ezzel az aláírással %1. - - - - No external functions are supported. All supported functions can be used directly, without first declaring them as external - Kulső függvények nincsenek támogatva. Az összes támogatott függvényt lehet közvetlenül haszálni, az első külső deklarálásuk nélkül - - - - The %1-axis is unsupported in XQuery - A(z) %1 tengely nem támogatott az XQuery-ben - - - - The namespace URI cannot be the empty string when binding to a prefix, %1. - Az URI névtér nem lehet üres sztring egy előtaghoz való összeköttetéskor, %1. - - - - %1 is an invalid namespace URI. - %1 egy érvénytelen URI névtér. - - - - It is not possible to bind to the prefix %1 - Nem lehetséges a(z) %1 előtaggal összekötni - - - - Two namespace declaration attributes have the same name: %1. - Két névtér deklaráció attribútumnak ugyanaz a neve: %1. - - - - The namespace URI must be a constant and cannot use enclosed expressions. - Az URI névtérnek állandónak kell lennie és nem használhat elhatárolt kifejezéseket. - - - - - %1 is not in the in-scope attribute declarations. Note that the schema import feature is not supported. - %1 nem a hatókör attribútum deklarációin belül található. Vegye figyelembe, hogy a terv importáló tulajdonság nem támogatott. - - - - empty - üres - - - - zero or one - nulla vagy egy - - - - exactly one - pontosan egy - - - - one or more - egy vagy több - - - - zero or more - nulla vagy több - - - - The focus is undefined. - A fókusz nincs definiálva. - - - - An attribute by name %1 has already been created. - Egy %1 nevű attribútum már létre lett hozva. - - - - Network timeout. - Hálózati időtúllépés. - - - - Element %1 can't be serialized because it appears outside the document element. - %1 elemet nem lehet besorolni, mert úgy tűnik a dokumentum elem külső oldalán található. - - - - Year %1 is invalid because it begins with %2. - %1 év érvénytelen, mert %2-vel kezdődik. - - - - Day %1 is outside the range %2..%3. - %1 nap a tartomány külsp oldalán van %2..%3. - - - - Month %1 is outside the range %2..%3. - %1 hónap a tartomány külső felületén van %2..%3. - - - - Overflow: Can't represent date %1. - Túlcsordulás: Nem lehet feltünteti a(z) %1 dátumot. - - - - Day %1 is invalid for month %2. - %1 nap érvénytelen a(z) %2 hónapra vonatkozólag. - - - - Time 24:%1:%2.%3 is invalid. Hour is 24, but minutes, seconds, and milliseconds are not all 0; - Idő 24:%1:%2:%3 érvénytelen. Az óra 24, de a perc, másodperc, és milliszekundum egyáltalán nem 0; - - - - Time %1:%2:%3.%4 is invalid. - Idő %1:%2:%3.%4 érvénytelen. - - - - Overflow: Date can't be represented. - Túlcsordulás: A dátumot nem lehet feltüntetni. - - - - At least one time component must appear after the %1-delimiter. - Legalább egy idő komponensnek lennie kell a(z) %1 határolójel után. - - - - - Dividing a value of type %1 by %2 (not-a-number) is not allowed. - %1 típus értékének osztása egy %2(nem szám)-mal nem engedélyezett. - - - - Dividing a value of type %1 by %2 or %3 (plus or minus zero) is not allowed. - %1 típus értékének osztása egy %2 vagy %3(plusz vagy minusz nulla)-mal nem engedélyezett. - - - - Multiplication of a value of type %1 by %2 or %3 (plus or minus infinity) is not allowed. - %1 típusú érték %2 vagy %3-mal való szorzása(plusz vagy minusz végtelen) nem engedélyezett. - - - - A value of type %1 cannot have an Effective Boolean Value. - %1 típusú értéknek nincsen hatékony logikai értéke. - - - - Value %1 of type %2 exceeds maximum (%3). - %2 típus %1 értéke elérte a maxiumot (%3). - - - - Value %1 of type %2 is below minimum (%3). - %1 típus %2 értéke a minimum alatt van (%3). - - - - A value of type %1 must contain an even number of digits. The value %2 does not. - %1 típus értékének tartalmaznia kell egy páratlan számú számot. A(z) %2 érték nem. - - - - %1 is not valid as a value of type %2. - %1 érvénytelen %2 típusú értékként. - - - - Operator %1 cannot be used on type %2. - %1 műveletet nem lehet a(z) %2 típuson használni. - - - - Operator %1 cannot be used on atomic values of type %2 and %3. - %1 műveletet nem lehet a %2 és %3-as típusú atomikus értéken használni. - - - - The namespace URI in the name for a computed attribute cannot be %1. - Az URI névtér a névben számított attribútumra nem lehet %1. - - - - The name for a computed attribute cannot have the namespace URI %1 with the local name %2. - Egy kiszámított attribútumnak nem lehet %1 URI névtere %2 helyi névvel. - - - - Type error in cast, expected %1, received %2. - Típus hiba a kasztolásban, %1 várt, %2 kapott. - - - - When casting to %1 or types derived from it, the source value must be of the same type, or it must be a string literal. Type %2 is not allowed. - %1-re kasztoláskor vagy típus származtatáskor, a forrás értéknek ugyanolyan típusúnak kell lennie, vagy sztring literálnak kell lennie. %2 típus nem engedélyezett. - - - - A comment cannot contain %1 - A megjegyzés nem tartalmazhat %1-t - - - - A comment cannot end with a %1. - A megjegyzés nem végződget %1-gyel. - - - - An attribute node cannot be a child of a document node. Therefore, the attribute %1 is out of place. - Az attribútum csomópont egy dokumentum csomópont gyermeke. Ennek következtében a(z) %1 attribútum nem helyénvaló. - - - - A library module cannot be evaluated directly. It must be imported from a main module. - A köbyvtár modult nem lehet közvetlenül kiértékelni. A fő modulból kell importálni. - - - - No template by name %1 exists. - %1 nevű sablon nem létezik. - - - - A value of type %1 cannot be a predicate. A predicate must have either a numeric type or an Effective Boolean Value type. - A(z) %1 típus értéke egy állítmány. Egy állítmánynak tartalmaznia kell vagy egy szám típust vagy egy effektív logikai érték típust. - - - - A positional predicate must evaluate to a single numeric value. - A helyzet állítmányt egy egyetlen szám értékként kell kiértékelni. - - - - The target name in a processing instruction cannot be %1 in any combination of upper and lower case. Therefore, %2 is invalid. - A cél neve egy utasítás feldolgozásban nem lehet %1 kis és nagybetűk bármely kombinációjában. Ennek következtében a(z) %2 érvénytelen. - - - - %1 is not a valid target name in a processing instruction. It must be a %2 value, e.g. %3. - %1 nem egy érvényes cél név az utasítás feldolgozásban. %2 vagy %3 értéknek kell lennie. - - - - The last step in a path must contain either nodes or atomic values. It cannot be a mixture between the two. - Az utolsó lépésnek vagy csomópontokat vagy atomikus értékeket kell tartalmaznia. Ez nem lehet a kettő közötti keverék. - - - - No namespace binding exists for the prefix %1 - Nem létezik névtér összeköttetés a(z) %1 előtagra - - - - No namespace binding exists for the prefix %1 in %2 - Nem létezik névtér összeköttetés a(z) %1 előtagra %2-ben - - - - The first argument to %1 cannot be of type %2. It must be a numeric type, xs:yearMonthDuration or xs:dayTimeDuration. - Az első argumentum %1 nem lehet %2 típusú. Egy számos típusnak kelle lennie, xs:évHónapIdőtartam vagy xs:napIdőTartam. - - - - The first argument to %1 cannot be of type %2. It must be of type %3, %4, or %5. - Az első argumentum %1 nem lehet %2 típusú. %3, %4 vagy %5 típusúnak kell lennie. - - - - The second argument to %1 cannot be of type %2. It must be of type %3, %4, or %5. - Az második argumentum %1 nem lehet %2 típusú. %3, %4 vagy %5 típusúnak kell lennie. - - - - If both values have zone offsets, they must have the same zone offset. %1 and %2 are not the same. - Ha mindkét értéknek zóna eltolása van, ugyanazt a zóna eltolást kell tartalmazniuk. %1 és %2 nem ugyanaz. - - - - %1 must be followed by %2 or %3, not at the end of the replacement string. - %1-t %2 vagy %3-nak kell követnie, nem a kicserélési sztring végén. - - - - %1 and %2 match the start and end of a line. - %1 és %2 egyezik a sor elején és végén. - - - - Whitespace characters are removed, except when they appear in character classes - Nem látható karakterek eltávolítva, kivéve mikor karakter osztályokban tűnnek fel - - - - %1 is an invalid flag for regular expressions. Valid flags are: - %1 egy érvénytelen jelző reguláris kifejezésekre. Érvényes flagek: - - - - If the first argument is the empty sequence or a zero-length string (no namespace), a prefix cannot be specified. Prefix %1 was specified. - Ha az első argumentum üres sorozat vagy nulla hosszúságú sztring (nincsen névtér), egy előtagot nem lehet meghatározni. %1 előtag volt meghatározva. - - - - The normalization form %1 is unsupported. The supported forms are %2, %3, %4, and %5, and none, i.e. the empty string (no normalization). - A(z) %1 szabványosítási forma nem támogatott. A támogatott formák %2, %3, %4 és %5 és semmi más, lásd az üres sztringet (nincs szabványosítás). - - - - A zone offset must be in the range %1..%2 inclusive. %3 is out of range. - A zóna eltolásnak a(z) %1..%2 tartományban kell benne lennie. %3 az tartományon kívüli. - - - - Required cardinality is %1; got cardinality %2. - Szükséges számosság %1, szerzett számosság %2. - - - - The encoding %1 is invalid. It must contain Latin characters only, must not contain whitespace, and must match the regular expression %2. - A(z) %1 kódolás érvénytelen. Kizárólag latin karaktereket kell tartalmaznia, nem szabad látható karaktereket tartalmaznia, és a(z) %2 reguláris kifejezéssel kell megegyeznie. - - - - The keyword %1 cannot occur with any other mode name. - A(z) %1 kulcscszó nem fordulhat elő semmilyen más mód névvel. - - - - No variable with name %1 exists - %1 nevű változó nem létezik - - - - The value of attribute %1 must be of type %2, which %3 isn't. - A(z) %1 attribútumnak %2 típusúnak kell lennie, amelyik nem %3-as. - - - - The prefix %1 cannot be bound. By default, it is already bound to the namespace %2. - A(z) %1 előtagot nem lehet összekötni. Alapértelmezetten, már hozzá van kötve a %2 névtérhez. - - - - A variable with name %1 has already been declared. - %1 nevű változó már deklarálva van. - - - - No value is available for the external variable with name %1. - %1 nevű külső változóhoz nem érhető el érték. - - - - A stylesheet function must have a prefixed name. - A stíluslap függvénynek tartalmaznia kell egy előtag nevet. - - - - The namespace %1 is reserved; therefore user defined functions may not use it. Try the predefined prefix %2, which exists for these cases. - A(z) %1 névtér foglalt, ennek következtében a felhasználó által definiált függvényt nem lehet használni. Próbálja ki az előredefiniált %2 előtagot, amely erre az esetekre van kitalálva. - - - - An argument with name %1 has already been declared. Every argument name must be unique. - Egy %1 nevű argumentum már deklarálva van. Minden argumentum névnek egyedülállónak kell lennie. - - - - When function %1 is used for matching inside a pattern, the argument must be a variable reference or a string literal. - Mikor %1 függvény van használva egyeztetése egy mintán belül, az argumentumnak egy változó hivatkozásnak vagy egy sztring literálnak kell lennie. - - - - In an XSL-T pattern, the first argument to function %1 must be a string literal, when used for matching. - Egy XSLT mintában, az első argumentumnak a(z) %1 függvényre egy sztring literálnak kell lennie, amikor egyeztetésre használják. - - - - In an XSL-T pattern, the first argument to function %1 must be a literal or a variable reference, when used for matching. - Egy XSLT mintában, az első argumentumnak a(z) %1 függvény esetén egy literálnak vagy egy változó hibatkozásnak kell lennie, mikor egyeztetésre használják. - - - - In an XSL-T pattern, function %1 cannot have a third argument. - Egy XSLT mintában, %1 függvénynek nem lehet egy harmadik argumentuma. - - - - In an XSL-T pattern, only function %1 and %2, not %3, can be used for matching. - Egy XSLT mintában, kizárólag a(z) %1 és %2 függvényeket, és %3-at nem lehet egyeztetésre használni. - - - - In an XSL-T pattern, axis %1 cannot be used, only axis %2 or %3 can. - Egy XSLT mintában, %1 tengelyt nem lehet használni, kizárólag a(z) %2 vagy %3 tengelyeket. - - - - %1 is an invalid template mode name. - %1 egy érvénytelen sablon mód név. - - - - The name of a variable bound in a for-expression must be different from the positional variable. Hence, the two variables named %1 collide. - Egy változó összeköttetés nevének egy for kifejezésben különböznie kell a pozícionális változótol. Ezért, a két %1 nevű változó ütközik. - - - - The Schema Validation Feature is not supported. Hence, %1-expressions may not be used. - A terv jóváhagyási tulajdonság nem támogatott. Ezért, %1 kifejezést nem lehet használni. - - - - None of the pragma expressions are supported. Therefore, a fallback expression must be present - A pragma kifejezések egyike sem támogatott. Ezért egy visszavonuló kifejezést kell nyújtani - - - - Each name of a template parameter must be unique; %1 is duplicated. - Sablon paraméter mindegyik nevének egyedülállónak kell lennie, %1 az duplikáns. - - - - No function with name %1 is available. - %1 nevű függvény nem elérhető. - - - - %1 is not a valid numeric literal. - %1 nem egy érvényes számos literál. - - - - W3C XML Schema identity constraint selector - W3C XML terv azonosító megszorító kiválasztó - - - - W3C XML Schema identity constraint field - W3C XML Terv azonosító megszorító mező - - - - A construct was encountered which is disallowed in the current language(%1). - Egy olyan konstruktort talált amelyik nincsen engedélyezve az aktuális nyelvben(%1). - - - - Namespace %1 can only be bound to %2 (and it is, in either case, pre-declared). - %1 névteret kizárólag a %2-vel lehet összekötni (és ennyi, vagy mindkét esetben, előre deklarált). - - - - Prefix %1 can only be bound to %2 (and it is, in either case, pre-declared). - %1 előtagot kizárólag a %2-vel lehet összekötni (és ennyi, vagy mindkét esetben, előre deklarált). - - - - An attribute with name %1 has already appeared on this element. - %1 attribútum név már van ebben az elemben. - - - - A direct element constructor is not well-formed. %1 is ended with %2. - Egy közvetlen elem konstruktor, mely nincsen jól megformázva. %1 a(z) %2-ben végzőik. - - - - The name %1 does not refer to any schema type. - A(z) %1 név nem vonatkozik egyetlen terv típusra sem. - - - - %1 is an complex type. Casting to complex types is not possible. However, casting to atomic types such as %2 works. - %1 egy összetett típus. Összetett típusra kasztolás nem lehetséges. De egy atomikus típusra mint egy %2 működik. - - - - %1 is not an atomic type. Casting is only possible to atomic types. - %1 nem egy atomikus típus. Kaszolás kizárólag csak atomikus típusra lehetséges. - - - - %1 is not a valid name for a processing-instruction. - %1 nem egy érvényes név egy utasítás feldolgozásra. - - - - The name of an extension expression must be in a namespace. - Egy kifejezés kiterjesztés nevének egy névtérben kell lennie. - - - - Required type is %1, but %2 was found. - %1 a szükséges típus, de %2 található. - - - - Promoting %1 to %2 may cause loss of precision. - %1 elősegítése %2-re precíziós vesztést okozhat. - - - - It's not possible to add attributes after any other kind of node. - Nem lehetséges attribútumokat hozzáadni, bármely másik csomópont után. - - - - Only the Unicode Codepoint Collation is supported(%1). %2 is unsupported. - Kizárólag a Unicode Kódpontos összevetés támogatott(%1). %2 nem támogatott. - - - - Integer division (%1) by zero (%2) is undefined. - Egész számos (%1) osztás nullával (%2) nem definiált. - - - - Division (%1) by zero (%2) is undefined. - Osztás (%1) nullával (%2) nem definiált. - - - - Modulus division (%1) by zero (%2) is undefined. - Tényezős osztás (%1) nullával (%2) nem definiált. - - - - %1 takes at most %n argument(s). %2 is therefore invalid. - - %1 legalább %n argumentumot vár. A(z) %2 ennel következtében érvénytelen. - - - - - %1 requires at least %n argument(s). %2 is therefore invalid. - - %1 legalább %n argumentumot igényel. Ennek következtében a(z) %2 érvénytelen. - - - - - The root node of the second argument to function %1 must be a document node. %2 is not a document node. - A második argumentum rendszergazda csomópontja %1 függvényre dokumentum csomópontnak kell lenni. %2 nem egy dokumentum csomópont. - - - - The namespace for a user defined function cannot be empty (try the predefined prefix %1 which exists for cases like this) - A névtér a felhasználó által definiált függvényre nem lehet üres (próbálja ki az előredefiniált %1 előtagot, mely innen esetekre lett kitalálva) - - - - - A default namespace declaration must occur before function, variable, and option declarations. - Egy alapértelmezett névtér deklarációnak a függvény, változó, és opció deklarációk előtt kell elhelyezkednie. - - - - Namespace declarations must occur before function, variable, and option declarations. - A névtér deklarációnak a függvény, változó, és opció deklarációk előtt kell elhelyezkednie. - - - - Module imports must occur before function, variable, and option declarations. - Modul importálásnak a függvény, változó, és opció deklarációk előtt kell elhelyezkednie. - - - - %1 is not a whole number of minutes. - %1 nem egy egész számú perc érték. - - - - Attribute %1 can't be serialized because it appears at the top level. - %1 attribtútumot nem lehet sorozatosítani, mert legfelső szinten tűnik fel. - - - - %1 is an unsupported encoding. - %1 egy nem támogatott kódolás. - - - - %1 contains octets which are disallowed in the requested encoding %2. - %1 oktálisokat tartalmat, melyek tiltva vannak a lekérdezett %2 kódolásban. - - - - The codepoint %1, occurring in %2 using encoding %3, is an invalid XML character. - A kódpont %1, mely a %2-ben fordul elő %3 kódolást használva, egy érvénytelen XML karakter. - - - - Ambiguous rule match. - Bizonytalan szabály egyezés. - - - - In a namespace constructor, the value for a namespace cannot be an empty string. - Egy névtér konstruktorban, egy névtér értéke nem lehet egy üres sztring. - - - - The prefix must be a valid %1, which %2 is not. - Az előtagnak egy érvényes %1-nek kell lennie, %2 nem lehet. - - - - The prefix %1 cannot be bound. - A(z) %1 előtagot nem lehet összekötni. - - - - Only the prefix %1 can be bound to %2 and vice versa. - Kizárólag a(z) %1 előtagot lehet összekötni a %2-vel és fordítva. - - - - The parameter %1 is required, but no corresponding %2 is supplied. - A(z) %1 paraméter követelik, de nincs megelelő %2 támogatás hozzá. - - - - The parameter %1 is passed, but no corresponding %2 exists. - A(z) %1 paraméter teljesítve, de a megfelelő %2 nem létezik. - - - - The URI cannot have a fragment - Az URI nem tartalmaz tördezettséget - - - - Element %1 is not allowed at this location. - %1 elem nincs engedélyezve ezen a ponton. - - - - Text nodes are not allowed at this location. - Szöveg csomópontok nincsenek engedélyezve ezen a ponton. - - - - Parse error: %1 - Elemzési hiba: %1 - - - - The value of the XSL-T version attribute must be a value of type %1, which %2 isn't. - XSLT verzió attribútum értékének %1 típusú értéknek kell lennie, %2 nem lehet. - - - - Running an XSL-T 1.0 stylesheet with a 2.0 processor. - Egy XSLT 1.0 stíluslap egy 2.0 feldolgozóval való futtatása. - - - - Unknown XSL-T attribute %1. - Ismeretlen XSLT attribútum %1. - - - - Attribute %1 and %2 are mutually exclusive. - A(z) %1 és %2 attribútum kölcsönösen kizárják egymást. - - - - In a simplified stylesheet module, attribute %1 must be present. - Egy leegyszerűsített stíluslap modulban, %1 attribútumot kell nyújtani. - - - - If element %1 has no attribute %2, it cannot have attribute %3 or %4. - Ha a(z) %1 elem nem tartalmaz %2 attribútumot, akkor nem tartalmazhat %3 vagy %4 attribútumot. - - - - Element %1 must have at least one of the attributes %2 or %3. - %1 elemnek legalább egy %2 vagy %3 attribútumot kell tartalmaznia. - - - - At least one mode must be specified in the %1-attribute on element %2. - Legalább egy csomópontot meg kell határozni a(z) %1 attribútumban a(z) %2 elemen. - - - - Element %1 must come last. - %1 elemnek kell utoljára következnie. - - - - At least one %1-element must occur before %2. - Legalább egy %1 elemnek kell előfordulnia %2 előtt. - - - - Only one %1-element can appear. - Csak egy %1 elem jelenhet meg. - - - - At least one %1-element must occur inside %2. - Legalább egy %1 elem fordulhat elő %2-n belül. - - - - When attribute %1 is present on %2, a sequence constructor cannot be used. - Mikor %1 attribútuk van benyújtva %2-n, egy sorozat konstruktort nem lehet használni. - - - - Element %1 must have either a %2-attribute or a sequence constructor. - %1 elemnek vagy egy %2 attribútumot vagy egy sorozat konstruktort kell tartalmaznia. - - - - When a parameter is required, a default value cannot be supplied through a %1-attribute or a sequence constructor. - Amikor egy paramétert igényel, egy alapértelmezett érték ellátni egy %1 attribútum vagy egy sorozat konstruktoron keresztül. - - - - Element %1 cannot have children. - %1 elem nem tartalmazhat gyereket. - - - - Element %1 cannot have a sequence constructor. - %1 elem nem tartalmazhat egy sorozat konstruktort. - - - - - The attribute %1 cannot appear on %2, when it is a child of %3. - A(z) %1 attribútum nem jelenhet meg %2-n, mikor egy %3 gyereke. - - - - A parameter in a function cannot be declared to be a tunnel. - Egy paramétert nem lehet behangoltnak deklarálni egy függvényben. - - - - This processor is not Schema-aware and therefore %1 cannot be used. - Ez a feldolgozó nem terv biztos és ennek következtében a(z) %1-t nem lehet használni. - - - - Top level stylesheet elements must be in a non-null namespace, which %1 isn't. - Felső szintű stíluslap elemeknek nem szabad egy nem nulla névtérnek lenniük, %1 nem jó. - - - - The value for attribute %1 on element %2 must either be %3 or %4, not %5. - %1 attribútum értékének a(z) %2-s elemen vagy %3 vagy %4, vagy %5-nek kell lennie. - - - - Attribute %1 cannot have the value %2. - %1 attribútum nem tartalmazhat %2 értéket. - - - - The attribute %1 can only appear on the first %2 element. - A(z) %1 attribútum kizárólag az első %2 elemen tűnhet fel. - - - - At least one %1 element must appear as child of %2. - Legalább egy %1 elemnek mutatkoznia %2 gyerekeként. - - - - %1 has inheritance loop in its base type %2. - %1 tartalmaz egy öröklődési hurkot annak %2 alaptípusában. - - - - - Circular inheritance of base type %1. - A(z) %1 alaptípus cirkuláris öröklődése. - - - - Circular inheritance of union %1. - A(z) %1 union cirkuláris öröklődése. - - - - %1 is not allowed to derive from %2 by restriction as the latter defines it as final. - A(z) %1 %2-ből való származtatása nem megengedett, azzal a korlátozassal, hogy az utóbbi utolsónak definiálja. - - - - %1 is not allowed to derive from %2 by extension as the latter defines it as final. - %1-nek nem engedélyezett a %2-ből való származtatása, azzal a kiegészítéssel, hogy a utóbbi végsőnek definiálja. - - - - Base type of simple type %1 cannot be complex type %2. - A(z) %1 egyszerű típus alaptípusa nem lehet egy %2 összetett típus. - - - - Simple type %1 cannot have direct base type %2. - A(z) %1 egyszerű típus nem tartalmazhat közvetlen %2 alap típust. - - - - - Simple type %1 is not allowed to have base type %2. - %1 egyszerű típusnak nincs engedélyezve, hogy %2 alap típusokat tartalmazzon. - - - - Simple type %1 can only have simple atomic type as base type. - A(z) %1 egyszerű típus kizárólag egyszerű atomikus típusokat tartalmazhat alaptípusként. - - - - Simple type %1 cannot derive from %2 as the latter defines restriction as final. - %1 egyszerű típus nem származtatható %2-ből, mint ahogy az utóbbi végső korlátozásokat definiál. - - - - - Variety of item type of %1 must be either atomic or union. - %1 elemtípus különbözőségeinek vagy vagy atomikus vagy unionnak kell lenni. - - - - - Variety of member types of %1 must be atomic. - %1 tagtípusok különbözőségének atomikusnak kell lennie. - - - - - %1 is not allowed to derive from %2 by list as the latter defines it as final. - %1 származtatása a(z) %2-ből nem engedélyezett, listázva azt, hogy az utóbbi végsőként definiálja. - - - - Simple type %1 is only allowed to have %2 facet. - %1 egyszerű típus kizárólag %2 oldalt tartalmazhat. - - - - Base type of simple type %1 must have variety of type list. - %1 egyszerű típus alap típusának különböző típus listákat kell tartalmaznia. - - - - Base type of simple type %1 has defined derivation by restriction as final. - %1 egyszerű típus alaptípusa definiálja a számaztatást végső korlátozással. - - - - Item type of base type does not match item type of %1. - Az alap típus elem típusa nem egyezik a(z) %1 elemtípusával. - - - - - Simple type %1 contains not allowed facet type %2. - %1 egyszerű típus nem engedélyezett oldal %2 típusokat tartalmaz. - - - - - %1 is not allowed to derive from %2 by union as the latter defines it as final. - %1 %2-ből történő származtatása nem engedélyezett az unió által, az utóbbi végsőként definiálja. - - - - %1 is not allowed to have any facets. - %1 nem tartalmazhat semmilyen oldalt. - - - - Base type %1 of simple type %2 must have variety of union. - %2 egyszerű típus %1 alap típusának különböző egységeket kell tartalmaznia. - - - - Base type %1 of simple type %2 is not allowed to have restriction in %3 attribute. - %2 egyszerű típus %1 alap típusa nem tartalmazhat korlátozásokat a %3 attribútumban. - - - - Member type %1 cannot be derived from member type %2 of %3's base type %4. - %1 tag típus nem származtatható a(z) %3 %4 alap típusának %2 tagtípusából. - - - - Derivation method of %1 must be extension because the base type %2 is a simple type. - %1 származtatása eljárásának kiterjesztésnek kell lennie, mert %2 alap típus egy egyszerű típus. - - - - Complex type %1 has duplicated element %2 in its content model. - A(z) %1 összetett típusnak duplikáns %2 eleme van a tartalmi modellében. - - - - Complex type %1 has non-deterministic content. - %1 összetett típusnak nincsen meghatározott tartalma. - - - - Attributes of complex type %1 are not a valid extension of the attributes of base type %2: %3. - %1 összetett típus attribútumai a(z) %2 alap típus attribútumainak nem érvényes kiterjesztései: %3. - - - - Content model of complex type %1 is not a valid extension of content model of %2. - %1 komplex típus tartalmi modelle a(z) %2 tartalmi modellének nem egy érvényes kiterjesztése. - - - - Complex type %1 must have simple content. - %1 komplex típusnak tartalmaznia kell egy egyszerű tartalmat. - - - - Complex type %1 must have the same simple type as its base class %2. - %1 komplex típusnak ugyanazt az egyszerű típust kell tartalmaznia a(z) %2 alap osztálya számára. - - - - Complex type %1 cannot be derived from base type %2%3. - %1 komplex típus nem származtatható a(z) %2%3 alap típusból. - - - - Attributes of complex type %1 are not a valid restriction from the attributes of base type %2: %3. - %1 komplex típus attribútumai nem egy érvényes korlátozások a(z) %2 alap típus attribútumaitól: %3. - - - - Complex type %1 with simple content cannot be derived from complex base type %2. - %1 komplex típus egyszerű tartalommal nem származtatható %2 komplex alap típusból. - - - - Item type of simple type %1 cannot be a complex type. - A(z) %1 egyszerű típus elemi típusa nem lehet egy komplex típus. - - - - Member type of simple type %1 cannot be a complex type. - %1 egyszerű típus tag típusa nem lehet egy komplex típus. - - - - %1 is not allowed to have a member type with the same name as itself. - %1 nem engedélyzett, hogy tartalmazzon egy tag típust ugyanazzal a névvel, mint a saját neve. - - - - - - %1 facet collides with %2 facet. - %1 oldal ütközik a(z) %2 oldallal. - - - - %1 facet must have the same value as %2 facet of base type. - %1 oldalnak ugyanazt az értéket kell tartalmaznia, mint az alap típus %2 oldalának. - - - - %1 facet must be equal or greater than %2 facet of base type. - %1 oldalnak nagyobbnak vagy egyenlőnek kell lennie, mint az alap típus %2 oldalának. - - - - - - - - - - - %1 facet must be less than or equal to %2 facet of base type. - %1 oldalnal kisebb vagy egyenlőnek kell lennie az alap típus %2 oldalánál. - - - - %1 facet contains invalid regular expression - %1 oldal érvénytelen reguláris kifejezéseket tartalmaz - - - - Unknown notation %1 used in %2 facet. - %1 ismeretlen jelölési mód van használva a(z) %2 oldalon. - - - - %1 facet contains invalid value %2: %3. - %1 oldal érvénytelen %2 értéket tartalmaz: %3. - - - - %1 facet cannot be %2 or %3 if %4 facet of base type is %5. - %1 oldal nem lehet %2 vagy %3, ha az alap típus %4 oldala %5. - - - - %1 facet cannot be %2 if %3 facet of base type is %4. - %1 oldal nem lehet %2, ha az alap típus %3 oldala %4. - - - - - - %1 facet must be less than or equal to %2 facet. - %1 oldalnak kisebb egyenlőnek kell lennie a(z) %2 oldalnál. - - - - - - %1 facet must be less than %2 facet of base type. - %1 oldalnak kisebbnek kell lennie az alap típus %2 oldalánál. - - - - - %1 facet and %2 facet cannot appear together. - %1 oldal és %2 oldal nem fordulhat elő együtt. - - - - - - %1 facet must be greater than %2 facet of base type. - %1 oldalnak nagyobbnak kell lennie, mint az alaptípus %2 oldalának. - - - - - %1 facet must be less than %2 facet. - %1 oldalnak kisebbnek kell lenni a(z) %2 oldalnál. - - - - - %1 facet must be greater than or equal to %2 facet of base type. - %1 oldalnak nagyobb vagy egyenlőnek kell lennie az alap típus %2 oldalánál. - - - - Simple type contains not allowed facet %1. - Egyszerű típus nem tartalmazhat %1 oldalt. - - - - %1, %2, %3, %4, %5 and %6 facets are not allowed when derived by list. - %1, %2, %3, %4, %5 és %6 oldalak nem engedélyezettek listáról származtatáskor. - - - - Only %1 and %2 facets are allowed when derived by union. - Csak a(z) %1 és %2 oldalak engedélyezettek union származtatásakor. - - - - - %1 contains %2 facet with invalid data: %3. - %1 %2 oldalt tartalmaz érvénytelen adattal: %3. - - - - Attribute group %1 contains attribute %2 twice. - A(z) %1 attribútum csoport a(z) %2 attribútumot kétszer tartalmazza. - - - - Attribute group %1 contains two different attributes that both have types derived from %2. - A(z) %1 attribútum csoport két különböző attribútumot tartalmaz, melyek közül mindkettő %2-ból számaztatott típusokat tartalmaz. - - - - Attribute group %1 contains attribute %2 that has value constraint but type that inherits from %3. - A(z) %1 attribútum csoport %2 attribútumot tartalmaz, amely olyan megszorított értéket tartalmaz, kivéve a típust, amit %3-ból örököl. - - - - Complex type %1 contains attribute %2 twice. - A(z) %1 összetett típus %2 attribútumot tartalmazza kétszer. - - - - Complex type %1 contains two different attributes that both have types derived from %2. - %1 komplex típus két különböző attribútumot tartalmaz, amelyek közül mindkettő %2-ból származtatott típusokat tartalmaz. - - - - Complex type %1 contains attribute %2 that has value constraint but type that inherits from %3. - %1 kompex típus %2 attribútumot tartalmaz, aminek megszorító értéke van, kivéve a típust, amit a(z) %3-ból örököl. - - - - Element %1 is not allowed to have a value constraint if its base type is complex. - %1 elem nem tartalmazhat egy korlátozott értéket, ha az alaptípusa komplex. - - - - Element %1 is not allowed to have a value constraint if its type is derived from %2. - %1 elem nem tartalmazhat egy korlátozott értéket, ha a típusa a(z) %2-ből származik. - - - - - Value constraint of element %1 is not of elements type: %2. - %1 elem korlátozó értéke nem elemi típus: %2. - - - - Element %1 is not allowed to have substitution group affiliation as it is no global element. - %1 elem nem tartalmazhat helyettesítési csoport egyesítést, mert nem egy globális elem. - - - - Type of element %1 cannot be derived from type of substitution group affiliation. - %1 elem típus nem származtatható helyettesítési csoport egyesítési típusból. - - - - Value constraint of attribute %1 is not of attributes type: %2. - %1 attribútum korlátozó értéke nem attribútum típus: %2. - - - - Attribute %1 has value constraint but has type derived from %2. - %1 attribútumnak korlátozó értéke van, de %2-ből származtatott típust tartalmaz. - - - - %1 attribute in derived complex type must be %2 like in base type. - %1 attribútum egy származtatott komplex típusban %2-nek kell lennie, mint az alap típusban. - - - - Attribute %1 in derived complex type must have %2 value constraint like in base type. - A származtatott komplex típusban levő %1 attribútumnak %2 érték korlátozót kell tartalmaznia, mint az alap típusban. - - - - Attribute %1 in derived complex type must have the same %2 value constraint like in base type. - Származtatott komplex típusban levő %1 attribútumnak ugyanazt a(z) %2 korlátozott értéket kell tartalmaznia, mint az alap típusban. - - - - Attribute %1 in derived complex type must have %2 value constraint. - Származtatott komplex típusban levő %1 attribútumnak %2 érték korlátozót kell tartalmaznia. - - - - processContent of base wildcard must be weaker than derived wildcard. - Az alap helyettesítő jel folyamat tartalma gyengébb kell legyen, mint a származtatott helyettesítő jel. - - - - - Element %1 exists twice with different types. - %1 elem kétszer létezik különböző típusokkal. - - - - Particle contains non-deterministic wildcards. - A részecske nem meghatározott helyettesítő jeleket tartalmaz. - - - - - Base attribute %1 is required but derived attribute is not. - A(z) %1 alap attribútum szükséges, de a származtatott attribútum nem. - - - - Type of derived attribute %1 cannot be validly derived from type of base attribute. - A(z) %1 származtatott attribútum típusa nem lehet érvényesen származtatni az alap attribútum típusból. - - - - Value constraint of derived attribute %1 does not match value constraint of base attribute. - '%1 származtatott attribútum érték korlátozója nem egyezik az alap attribútum érték korlátozójával. - - - - Derived attribute %1 does not exist in the base definition. - %1 származtatott attribútum nem létezik az alap definícióban. - - - - Derived attribute %1 does not match the wildcard in the base definition. - %1 származtatott attribútum nem egyezik a helyettesítő jellel az alap definícióban. - - - - Base attribute %1 is required but missing in derived definition. - %1 alap attribútum szükséges, de hiáynzik a származtatott definícióban. - - - - Derived definition contains an %1 element that does not exists in the base definition - A származtatot definíció egy %1 elemet tartalmaz, ami nem létezik az alap definícióban - - - - Derived wildcard is not a subset of the base wildcard. - Származtatott helyettesítőjel nem az alap helyettesítőjel egy részhalmaza. - - - - %1 of derived wildcard is not a valid restriction of %2 of base wildcard - Származtaott helyettesítő jel %1-e nem az alap helyettesítőjel %2-nek egy érvényes korlátozója - - - - Attribute %1 from base type is missing in derived type. - Az alap típus %1 attribútuma hiányzik a származtatott típusban. - - - - Type of derived attribute %1 differs from type of base attribute. - A(z) %1 származtatott típus az alap attribútum típusától különbözik. - - - - Base definition contains an %1 element that is missing in the derived definition - Az alap definíció egy %1 elemet tartalmaz, ami hiányzik a származtatott definícióból - - - - %1 references unknown %2 or %3 element %4. - %1 ismeretlen %2 vagy %3 elemre hivatkozik %4. - - - - %1 references identity constraint %2 that is no %3 or %4 element. - %1 %2 indentitás korlátozóra hivatkozik, ami nem %3 vagy %4 elem. - - - - %1 has a different number of fields from the identity constraint %2 that it references. - %1 mezők egy különböző számát tartalmazza a(z) %2 indetitás korlátozóbol, amelyik erre hivatkozik. - - - - Base type %1 of %2 element cannot be resolved. - %1 elem %2 alap típusát nem lehet megfejteni. - - - - Item type %1 of %2 element cannot be resolved. - %2 elem %1 elem típusát nem lehet megfejteni. - - - - Member type %1 of %2 element cannot be resolved. - %2 elem %1 tag típusát nem lehet megoldani. - - - - - - Type %1 of %2 element cannot be resolved. - %2 elem %1 típusát nem lehet megoldani. - - - - Base type %1 of complex type cannot be resolved. - Komplex típus %1 alap típusát nem lehet megfejteni. - - - - %1 cannot have complex base type that has a %2. - %1 nem tartalmazhat komplex alap típusokat, egy %2-t tartalmaz. - - - - Content model of complex type %1 contains %2 element so it cannot be derived by extension from a non-empty type. - %1 komplex típus tartalmi modelle %2 elemet tartalmaz, tehát nem származtatható kiterjesztésben egy nem üres típusból. - - - - Complex type %1 cannot be derived by extension from %2 as the latter contains %3 element in its content model. - %1 komplex nem típus nem származtatható kiterjesztésben %2-ből, mert az utóbbi %3 elemet tartalmaz a tartalmi modellében. - - - - Type of %1 element must be a simple type, %2 is not. - %1 elem típusnak egy egyszerű típusnak kell, de %2 nem az. - - - - Substitution group %1 of %2 element cannot be resolved. - %2 elem %1 helyettesítési csoportját nem lehet megoldani. - - - - Substitution group %1 has circular definition. - %1 helyettesítési csoport cirkuláris definíciót tartalmaz. - - - - - Duplicated element names %1 in %2 element. - Duplikát %1 elemnév %2 elemben. - - - - - - - Reference %1 of %2 element cannot be resolved. - %2 elem %1 hivatkozását nem lehet megoldani. - - - - Circular group reference for %1. - Cirkuláris csoport hivatkozás %1-re. - - - - %1 element is not allowed in this scope - %1 elem nem engedélyezett ebben a hatókörben - - - - %1 element cannot have %2 attribute with value other than %3. - %1 elem nem tartalmazhat %2 attribútumot %3-tól eltérő értékkel. - - - - %1 element cannot have %2 attribute with value other than %3 or %4. - %1 element nem tartalmazhat %2 attribútumot %3 vagy %4-től eltérő értékkel. - - - - %1 or %2 attribute of reference %3 does not match with the attribute declaration %4. - %3 hivatkozás %1 vagy %2 attribútuma nem egyezik meg a(z) %4 attribútum deklarációval. - - - - Attribute group %1 has circular reference. - %1 attribútum csoport cirkuláris hivatkozást tartalmaz. - - - - %1 attribute in %2 must have %3 use like in base type %4. - %2-ben található %1 attribútumnak %3 használatát kell tartalmaznia, mint a(z) %4 alap típusban. - - - - Attribute wildcard of %1 is not a valid restriction of attribute wildcard of base type %2. - %1 attribútum helyettesítő jele nem a(z) %2 alap típus attribútum helyettesítő jelének egy érvényes korlátozása. - - - - %1 has attribute wildcard but its base type %2 has not. - %1 attribútum helyettesítő jelet tartalmaz, de a(z) %2 alap típusa nem. - - - - Union of attribute wildcard of type %1 and attribute wildcard of its base type %2 is not expressible. - %2 alaptípusának attribútum helyettesítő jele és a(z) %1 típus attribútum helyettesítő jelének union-ja nem kifejezhető. - - - - Enumeration facet contains invalid content: {%1} is not a value of type %2. - Felsorolás oldal érvénytelen tartalmat tartalmaz. {%1} nem egy érvényes %2 típus érték. - - - - Namespace prefix of qualified name %1 is not defined. - %1 minősített név névtér előtagja nincs definiálva. - - - - - %1 element %2 is not a valid restriction of the %3 element it redefines: %4. - %2 elem %1 nem a(z) %3 elem egy érvényes korlátozása, újradefininálja: %4. - - - - Empty particle cannot be derived from non-empty particle. - Üres részecskét nem lehet egy üres részecskéből származtatni. - - - - Derived particle is missing element %1. - Származtatott részecskének van egy %1 hiányzó eleme. - - - - Derived element %1 is missing value constraint as defined in base particle. - %1 származtatott elem hiányol egy érték korlátozót, ami az alap részecskében van definiálva. - - - - Derived element %1 has weaker value constraint than base particle. - %1 származtatott elem gyengébb érték korlátozót tartalmaz, mint az alap részecske. - - - - Fixed value constraint of element %1 differs from value constraint in base particle. - %1 elem fix érték korlátozója különbözik az alap részecskében található érték korlátozótól. - - - - Derived element %1 cannot be nillable as base element is not nillable. - %1 származtatott elem nem lehet nullázható, mint ahogy az alap elem sem nullázható. - - - - Block constraints of derived element %1 must not be more weaker than in the base element. - %1 származtatott elem blokk korlátozója nem lehet gyengébb, mint az alap elemben. - - - - Simple type of derived element %1 cannot be validly derived from base element. - %1 származtatott elem egyszerű típusa nem származtatható érvényesen az alap elemből. - - - - Complex type of derived element %1 cannot be validly derived from base element. - %1 származtatott elem komplex típusa nem származtatható érvényesen az alap elemből. - - - - Element %1 is missing in derived particle. - %1 elem hiányzik a származtott récseszkében. - - - - Element %1 does not match namespace constraint of wildcard in base particle. - %1 elem nem egyezik meg az alap részecskében található helyettesítő jel névtér korlátozójával. - - - - Wildcard in derived particle is not a valid subset of wildcard in base particle. - Helyettesítő jel a származtatott részecskénen nem az alap részecskében található helyettesítő jel egy érvényes részhalmaza. - - - - processContent of wildcard in derived particle is weaker than wildcard in base particle. - A származtatott részecskében található helyettesítő jel folyamatTartalma gyengébb, mint az alap részecskében található helyettesítő jel. - - - - Derived particle allows content that is not allowed in the base particle. - Származtatott részecske engedélyezi a tartalmat, ami nem engedélyezett az alap részecskében. - - - - Can not process unknown element %1, expected elements are: %2. - Nem lehet feldolgozni ismeretlen %1 elemet, várt elemek: %2. - - - - Element %1 is not allowed in this scope, possible elements are: %2. - %1 elem nem engedélyezett ebben a hatórközben, lehetséges elemek: %2. - - - - Child element is missing in that scope, possible child elements are: %1. - Gyermek elem hiányzik abban a hatókörben, lehetséges gyermek elemek: %1. - - - - Document is not a XML schema. - Dokumentum nem egy XML terv. - - - - %1 attribute of %2 element contains invalid content: {%3} is not a value of type %4. - %2 elem %1 attribútuma érvénytelen tartalmat tartalmaz: {%3} nem egy %4 típus érték. - - - - %1 attribute of %2 element contains invalid content: {%3}. - %2 elem %1 attribútuma érvénytelen tartalmat tartalmaz: {%3}. - - - - Target namespace %1 of included schema is different from the target namespace %2 as defined by the including schema. - A beleértett terv %1 cél névtere különbözik a %2 cél névtértől, amit a beleértett terv által lett definiálva. - - - - - Target namespace %1 of imported schema is different from the target namespace %2 as defined by the importing schema. - Az importált terv %1 cél névtere különbözik a(z) %2 cél névtértől, ami az importált terv által van definiálva. - - - - %1 element is not allowed to have the same %2 attribute value as the target namespace %3. - %1 elem nem tartalmazhatja ugyanazt a(z) %2 attribútum értéket, mint a(z) %3 cél névtér. - - - - %1 element without %2 attribute is not allowed inside schema without target namespace. - %1 elem %2 attribútum nélkül nem engedélyezett a vázlaton belül cél névtér nélkül. - - - - - %1 element is not allowed inside %2 element if %3 attribute is present. - %1 elem nem engedélyezett a(z) %2 elemen belül, ha %3 attribútum van nyújtva. - - - - - - %1 element has neither %2 attribute nor %3 child element. - %1 elem nem tartalmaz %2 attribútumot és %3 gyermek elemet sem. - - - - - - - - - - - - - - - - - %1 element with %2 child element must not have a %3 attribute. - %1 elem %2 gyermek elemmel nem tartalmazhat egy %3 attribútumot. - - - - %1 attribute of %2 element must be %3 or %4. - %2 elem %1 attribútumának %3 vagy %4-nek kell lennie. - - - - %1 attribute of %2 element must have a value of %3. - %2 elem %1 attribútumának %3 egy értékét tartalmaznia kell. - - - - - %1 attribute of %2 element must have a value of %3 or %4. - %2 elem %1 attribútumának tartalmaznia kell %3 vagy %4 egy értékét. - - - - - - - - - - - - - - - - - %1 element must not have %2 and %3 attribute together. - %1 elemnek tartalmaznia kell %2 és %3 attribútumokat együttesen. - - - - - Content of %1 attribute of %2 element must not be from namespace %3. - %2 elem %1 attribútumának tartalmának nem szabad a(z) %3 névtérből lennie. - - - - - %1 attribute of %2 element must not be %3. - %2 elem %1 attribútumának nem szabad %3-nak lennie. - - - - %1 attribute of %2 element must have the value %3 because the %4 attribute is set. - %2 elem %1 attribútumának tartalmaznia kell %3 értéket, mert %4 attribútum be van állítva. - - - - Specifying use='prohibited' inside an attribute group has no effect. - Használat meghatározásának = 'tiltott' egy attribútum csoportját belül nincsen hatása. - - - - %1 element must have either %2 or %3 attribute. - %1 elemnek vagy %2 vagy %3 attribútumot tartalmaznia kell. - - - - %1 element must have either %2 attribute or %3 or %4 as child element. - %1 elemnek tartalmaznia kell vagy %2 vagy %3 vagy %4 attribútumot, mint ahogy a gyermek elem. - - - - %1 element requires either %2 or %3 attribute. - %1 elem vagy %2 vagy %3 attribútumot igényli. - - - - Text or entity references not allowed inside %1 element - Szöveg avgy entitás hivatkozás nem engedélyezett a(z) %1 elemen belül - - - - - %1 attribute of %2 element must contain %3, %4 or a list of URIs. - %2 elem %1 attribútumának tartalmaznia kell %3, %4 vagy URI-k egy listáját. - - - - %1 element is not allowed in this context. - %1 elem nem engedélyezett ebben a szöveg környezetben. - - - - %1 attribute of %2 element has larger value than %3 attribute. - %2 elem %1 attribútuma nagyobb értéket tartalmaz, mint a %3 attribútum. - - - - Prefix of qualified name %1 is not defined. - A(z) %1 minősített név előtagja nem definiált. - - - - - %1 attribute of %2 element must either contain %3 or the other values. - %2 elem %1 attribútumának vagy %3 vagy más értékeket kell tartalmaznia. - - - - Component with ID %1 has been defined previously. - %1 azonosítóval rendelkezővel komponens előzőleg definiálva lett. - - - - Element %1 already defined. - %1 elem már definiálva van. - - - - Attribute %1 already defined. - %1 attribútum már definiálva van. - - - - Type %1 already defined. - %1 típus már definiálva van. - - - - Attribute group %1 already defined. - %1 csoport attribútum már definiálva van. - - - - Element group %1 already defined. - %1 csoport elem már definiálva van. - - - - Notation %1 already defined. - %1 értesítés már definiálva van. - - - - Identity constraint %1 already defined. - %1 azonosító korlátozó már definiálva van. - - - - Duplicated facets in simple type %1. - Duplikált oldalak %1 egyszerű típusban. - - - - - - %1 is not valid according to %2. - %1 nem érvényes %2 szerint. - - - - String content does not match the length facet. - Sztring tartalom nem egyezik a hossz oldallal. - - - - String content does not match the minLength facet. - Sztring tartalom nem egyezik a minimális hosszúságú felülettel. - - - - String content does not match the maxLength facet. - Sztring tartalom nem egyezik a maximális hosszúságú felülettel. - - - - String content does not match pattern facet. - Sztrng tartalom nem egyezik a minta felülettel. - - - - String content is not listed in the enumeration facet. - Sztring tartalom nincs listázva a felsorol felületben. - - - - Signed integer content does not match the maxInclusive facet. - Előjeles egész szám tartalom nem egyezik a maximális beleszámított felülettel. - - - - Signed integer content does not match the maxExclusive facet. - Előjeles egész szám tartalom nem egyzik a maximális kizárólagos felülettel. - - - - Signed integer content does not match the minInclusive facet. - Előjeles egész szám tartalom nem egyezik a minimális beleértet felülettel. - - - - Signed integer content does not match the minExclusive facet. - Előjeles egész szám tartalom nem egyezik a minimális kizárólagos felülettel. - - - - Signed integer content is not listed in the enumeration facet. - Előjeles egész szám tartalom nincsen kilistázva a felsorolási felületben. - - - - Signed integer content does not match pattern facet. - Előjeles egész szám tartalom nem egyezik a minta felületben. - - - - Signed integer content does not match in the totalDigits facet. - Előjeles egész szám tartalom nem egyezik a teljesSzámos felület. - - - - Unsigned integer content does not match the maxInclusive facet. - Nem előjeles egész szám tartalom nem egyezik a maximális beleértett felülettel. - - - - Unsigned integer content does not match the maxExclusive facet. - Nem előjeles egész szám tartalom nem egyezik a maximális kizárólagos felülettel. - - - - Unsigned integer content does not match the minInclusive facet. - Nem előjeles tartalom nem egyezik a minimális beleértett felülettel. - - - - Unsigned integer content does not match the minExclusive facet. - Nem előjeleg egész szám tartalom nem egyezik a beleértett minimális felülettel. - - - - Unsigned integer content is not listed in the enumeration facet. - Nem előjeles egész szám tartalom nincsen kilistázva a felsorolási felületben. - - - - Unsigned integer content does not match pattern facet. - Nem előjeles egész szám tartalom nem egyezik a minta felületben. - - - - Unsigned integer content does not match in the totalDigits facet. - Nem előjeles egész szám tartalom nem egyezik a teljesSzámos felületben. - - - - Double content does not match the maxInclusive facet. - Dupla tartalom nem egyezik a maximális beleértett felületben. - - - - Double content does not match the maxExclusive facet. - Dupla tartalom nem egyezik a maximális kizárólagos felülettel. - - - - Double content does not match the minInclusive facet. - Dupla tartalom nem egyezik a minimális beleértett felülettel. - - - - Double content does not match the minExclusive facet. - Dupla tartalom nem egyezik a minimális kizárólag felülettel. - - - - Double content is not listed in the enumeration facet. - Dupla tartalom nincs listázva a felsorolási felületben. - - - - Double content does not match pattern facet. - Dupla tartalom nem egyezik a minta felületben. - - - - Decimal content does not match in the fractionDigits facet. - Tizedes tartalom nem egyezik a szám tényezős felületben. - - - - Decimal content does not match in the totalDigits facet. - Tizedes tartalom nem egyezik a teljesenSzámos felületben. - - - - Date time content does not match the maxInclusive facet. - Dátum idő tartalom nem egyezik a maximális beleértett felülettel. - - - - Date time content does not match the maxExclusive facet. - Dátum idő tartalom nem egyezik a maximális kizárólagos felülettel. - - - - Date time content does not match the minInclusive facet. - Dátum idő tartalom nem egyezik a minimális beleértett felülettel. - - - - Date time content does not match the minExclusive facet. - Dátum idő tartalom nem egyezik a minimális kizárólagos felülettel. - - - - Date time content is not listed in the enumeration facet. - Dátum idő tartalom nincsen kilistázva a felsorolási felületben. - - - - Date time content does not match pattern facet. - Dátum idő tartalom nem egyezik a minta felületben. - - - - Duration content does not match the maxInclusive facet. - Tartalom időtartam nem egyezik a maximális beleértett felülettel. - - - - Duration content does not match the maxExclusive facet. - Tartalom időtartam nem egyezik a maximális kizárólagos felülettel. - - - - Duration content does not match the minInclusive facet. - Tartalom időtartam nem egyezik a minimális benne foglalt felülettel. - - - - Duration content does not match the minExclusive facet. - Tartalom időtartam nem egyezik a minimális kizárólagos felülettel. - - - - Duration content is not listed in the enumeration facet. - Tartalom időtartam nincs listázva a felsorolási felületben. - - - - Duration content does not match pattern facet. - Tartalom időtartam nem egyezik a felület mintában. - - - - Boolean content does not match pattern facet. - Logikai tartalom nem egyezik a minta felületben. - - - - Binary content does not match the length facet. - Bináris tartalom nem egyezik a hossz felületben. - - - - Binary content does not match the minLength facet. - Bináris tartalom nem egyezik a minimális hossz felületben. - - - - Binary content does not match the maxLength facet. - Bináris tartalom nem egyezik a maximális hossz felületben. - - - - Binary content is not listed in the enumeration facet. - Bináris tartalom nincsen kilistázva a felsorolási felületben. - - - - Invalid QName content: %1. - Érvénytelen QName tartalom: %1. - - - - QName content is not listed in the enumeration facet. - QName tartalom nincsen kilistázva a felsorolási felületben. - - - - QName content does not match pattern facet. - QName tartalom nem egyezik a mintha felületben. - - - - Notation content is not listed in the enumeration facet. - Tartalom jelölés nincsen kilistázva a felsorolási felületben. - - - - List content does not match length facet. - Tartalom lista nem egyezik a hossz felületben. - - - - List content does not match minLength facet. - Tartalmi lista nem egyezik a minimális hossz felületben. - - - - List content does not match maxLength facet. - Tartalmi list nem egyezik a maximális hossz felületen. - - - - List content is not listed in the enumeration facet. - Tartalmi lista nincsen kilistázva a felsorolási felületen. - - - - List content does not match pattern facet. - Tartalmi lista nem egyezik a minta felületen. - - - - Union content is not listed in the enumeration facet. - Egység tartalom nincsen kilistázva a felsorolási felületen. - - - - Union content does not match pattern facet. - Egység tartalom nem egyezik a minta felületen. - - - - Data of type %1 are not allowed to be empty. - %1 típus adata nem engedélyezett, hogy üres legyen. - - - - Element %1 is missing child element. - %1 elem hiányzik a gyermek elemből. - - - - There is one IDREF value with no corresponding ID: %1. - Van egy IDREF érték nem megfelelő azonosítóval: %1. - - - - Loaded schema file is invalid. - Betöltött terv fájl nem létezik. - - - - %1 contains invalid data. - %1 érvénytelen adatot tartalmaz. - - - - xsi:schemaLocation namespace %1 has already appeared earlier in the instance document. - xsi:tervElhelyezkedés %1 névtér már előfordult korábban a példa dokumentumban. - - - - xsi:noNamespaceSchemaLocation cannot appear after the first no-namespace element or attribute. - xsi:tervElhelyezkedés névtér nem fordulhat elő az első nem névtér elem vagy attribútum után. - - - - No schema defined for validation. - Nincsen terv definiálva jóváhagyásra. - - - - No definition for element %1 available. - Nincsen elérhető definíció a(z) %1 elemre. - - - - - - Specified type %1 is not known to the schema. - %1 meghatározott típus ismeretlen a terv számára. - - - - Element %1 is not defined in this scope. - %1 elem nincs definiálva ebben a hatókörben. - - - - Declaration for element %1 does not exist. - %1 elem deklaráció nem létezik. - - - - Element %1 contains invalid content. - %1 elem érvénytelen tartalmat tartalmaz. - - - - Element %1 is declared as abstract. - %1 elem elvontkét lett deklarálva. - - - - Element %1 is not nillable. - %1 elem nem nullázható. - - - - Attribute %1 contains invalid data: %2 - %1 attribútum érvénytelen adatokat tartalmaz: %2 - - - - Element contains content although it is nillable. - Elem nem nullázható elemeket tartalmaz. - - - - Fixed value constraint not allowed if element is nillable. - Fix érték korlátozó nem engedélyezett, ha az elem nullázható. - - - - Element %1 cannot contain other elements, as it has a fixed content. - %1 nem tartalmazhat másik elemeket, mint ennek is egy fix mérete van. - - - - Specified type %1 is not validly substitutable with element type %2. - %1 meghatározott típus nem helyettesíthető érvényesen %2 elem típussal. - - - - Complex type %1 is not allowed to be abstract. - %1 komplex típus nem engedélyezett, hogy elvont legyen. - - - - Element %1 contains not allowed attributes. - %1 nem engedélyezett attribútumokat tartalmaz. - - - - - Element %1 contains not allowed child element. - %1 nem engedélyezett gyermek attribútumokat tartalmaz. - - - - - Content of element %1 does not match its type definition: %2. - %1 elem tartalma nem egyezik meg a típus definíciójával: %2. - - - - - - Content of element %1 does not match defined value constraint. - %1 elem tartalma nem egyezik meg a definiált érték korlátozóval. - - - - Element %1 contains not allowed child content. - %1 nem engedélyezett gyermek tartalmat tartalmaz. - - - - Element %1 contains not allowed text content. - %1 nem engedélyezett szöveg tartalmat tartalmaz. - - - - Element %1 is missing required attribute %2. - %1 hiányzik, %2 attribútum igényli. - - - - Attribute %1 does not match the attribute wildcard. - %1 attribűtum nem egyezik meg az attribútum helyettesítő jellel. - - - - Declaration for attribute %1 does not exist. - %1 attribútum deklarációja nem létezik. - - - - Element %1 contains two attributes of type %2. - %1 elem %2 típus két attribútumát tartalmazza. - - - - Attribute %1 contains invalid content. - %1 attribútum érvénytelen tartalmaz tartalmaz. - - - - Element %1 contains unknown attribute %2. - %1 elem ismeretlen %2 attribútumokat tartalmaz. - - - - - Content of attribute %1 does not match its type definition: %2. - %1 attribútum tartalma nem egyezik a típus definíciójával: %2. - - - - - Content of attribute %1 does not match defined value constraint. - %1 attribútum tartalma nem egyezik meg a definiált érték korlátozóval. - - - - Non-unique value found for constraint %1. - Nem található egyedülálló érték a(z) %1 módosítóra. - - - - Key constraint %1 contains absent fields. - %1 kulcs korlátozó hiányzó mezőket tartalmaz. - - - - Key constraint %1 contains references nillable element %2. - %1 kulcs korlátozó hivatkozásokat nem tartalmaz nullázható %2 elemekre. - - - - No referenced value found for key reference %1. - Nem található referencia érték a(z) %1 kulcs referenciára. - - - - More than one value found for field %1. - Több mint egy érték található a(z) %1-es mezőre. - - - - Field %1 has no simple type. - %1 mezőnek nincsen egyszerű típusa. - - - - ID value '%1' is not unique. - %1 azonosító érték nem egyedülálló. - - - - '%1' attribute contains invalid QName content: %2. - %1 attribútum érvénytelen QName tartalmaz tartalmaz: %2. - - - diff --git a/qtconfig_hu.ts b/qtconfig_hu.ts deleted file mode 100644 index 0eaead0..0000000 --- a/qtconfig_hu.ts +++ /dev/null @@ -1,920 +0,0 @@ - - - - - MainWindow - - - Desktop Settings (Default) - Asztali beállítások (Alapértelmezett) - - - - Choose style and palette based on your desktop settings. - Stílus és paletta alapú kiválasztása az asztali beállításokban. - - - - On The Spot - Azon nyomban - - - - - - - Auto (default) - Automatikus (alapértelmezett) - - - - Choose audio output automatically. - Audió kimenet automatikus kiválasztása. - - - - - aRts - aRts - - - - Experimental aRts support for GStreamer. - Kísérleti aRts támogatás a GStreamerhez. - - - - Phonon GStreamer backend not available. - Phonon GStreamer backend nem elérhető. - - - - Choose render method automatically - Render eljárás automatikus kiválasztása - - - - - X11 - X11 - - - - Use X11 Overlays - X11 borítás használata - - - - - OpenGL - OpenGL - - - - Use OpenGL if avaiable - OpenGL használata, ha rendelkezésre áll - - - - - Software - Szoftver - - - - Use simple software rendering - Egyszerű szoftver adás használata - - - - No changes to be saved. - A változtatások nincsenek elmentve. - - - - Saving changes... - Változtatások elmentése... - - - - Over The Spot - Célon túlmenően - - - - Off The Spot - Elkalandozás - - - - Root - Rendszergazda - - - - Select a Directory - Egy könyvtár kiválasztása - - - - <h3>%1</h3><br/>Version %2<br/><br/>Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). - <h3>%1</h3><br/>Verzió %2<br/><br/>Szerzői jog (C) 2010 Nokia vállalat és/vagy leányvállalata(i). - - - - - - Qt Configuration - Qt Konfiguráció - - - - Save Changes - Változtatások elmentése - - - - Save changes to settings? - Változtatások elmentése a beállításokba ? - - - - &Yes - &Igen - - - - &No - &Nem - - - - &Cancel - &Mégse - - - - MainWindowBase - - - Qt Configuration - Qt Konfiguráció - - - - - Appearance - Feltűnés - - - - GUI Style - GUI Stílus - - - - Select GUI &Style: - GUI &Stílus kiválasztása: - - - - Build Palette - Építési paletta - - - - &3-D Effects: - &3 D Hatások: - - - - Window Back&ground: - Ablak Hát&tér: - - - - &Tune Palette... - &Hangolási paletta... - - - - Please use the KDE Control Center to set the palette. - Kérem használja a KDE Vezérlő Központot a paletta beállításához. - - - - Preview - Előnézet - - - - Select &Palette: - &Paletta kiválasztása: - - - - Active Palette - Aktív paletta - - - - Inactive Palette - Inaktív paletta - - - - Disabled Palette - Tiltott paletta - - - - Fonts - Betűk - - - - Default Font - Alapértelmezett betű - - - - &Style: - &Stílus: - - - - &Point Size: - &Pont méret: - - - - F&amily: - Csa&lád: - - - - Sample Text - Minta szöveg - - - - Font Substitution - Betű helyettesítés - - - - S&elect or Enter a Family: - Egy család ki&választása vgy bevitele: - - - - Current Substitutions: - Aktuális helyettesítés: - - - - - Up - Fel - - - - - Down - Le - - - - - Remove - Eltávolítás - - - - Select s&ubstitute Family: - Család &helyettesítésének kiválasztása: - - - - - Add - Hozzáad - - - - Interface - Interfész - - - - Feel Settings - Érzet beállítások - - - - - ms - ms - - - - &Double Click Interval: - &Dupla kattintási intervallum: - - - - No blinking - Nincs villogás - - - - &Cursor Flash Time: - &Kurzor flash idő: - - - - lines - sorok - - - - Wheel &Scroll Lines: - Kerék sor &görgetés: - - - - Resolve symlinks in URLs - URL-ben található szimlinkek megoldása - - - - GUI Effects - GUI hatások - - - - &Enable - &Engedélyezés - - - - Alt+E - Alt+E - - - - &Menu Effect: - &Menü hatás: - - - - C&omboBox Effect: - C&omboBox hatás: - - - - &ToolTip Effect: - &Eszköz tipp hatás: - - - - Tool&Box Effect: - Eszköz&doboz hatás: - - - - - - - Disable - Tiltás - - - - - - - Animate - Animálás - - - - - Fade - Elhalkulás - - - - Global Strut - Globális struktúra - - - - Minimum &Width: - Minimum &szélesség: - - - - Minimum Hei&ght: - Minimum ma&gasség: - - - - - pixels - pixelek - - - - Enhanced support for languages written right-to-left - Kiterjesztett támogatás a jobbról balra írt nyelvek számára - - - - XIM Input Style: - XIM beviteli stílus: - - - - On The Spot - Azon nyomban - - - - Over The Spot - Célon túlmenően - - - - Off The Spot - Elkalandozás - - - - Root - Rendszergazda - - - - Default Input Method: - Alapértelmezett beviteli eljárás: - - - - Printer - Nyomtató - - - - Enable Font embedding - Betű beágyazás engedélyezése - - - - Font Paths - Betű útvonalak - - - - Browse... - Böngészés... - - - - Press the <b>Browse</b> button or enter a directory and press Enter to add them to the list. - Nyomja meg a <b>Böngészés</b> gombot vagy lépjen be egy könyvtárba és nyomja meg az Enter gombot hogy hozzáadja őket a listához. - - - - Phonon - Phonon - - - - About Phonon - Phonon-ról - - - - - Current Version: - Aktuális verzió: - - - - - Not available - Nem elérhető - - - - - Website: - Weblap: - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://phonon.kde.org"><span style=" text-decoration: underline; color:#0000ff;">http://phonon.kde.org</span></a></p></body></html> - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://phonon.kde.org"><span style=" text-decoration: underline; color:#0000ff;">http://phonon.kde.org</span></a></p></body></html> - - - - About GStreamer - GStreamer-ről - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://gstreamer.freedesktop.org/"><span style=" text-decoration: underline; color:#0000ff;">http://gstreamer.freedesktop.org/</span></a></p></body></html> - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://gstreamer.freedesktop.org/"><span style=" text-decoration: underline; color:#0000ff;">http://gstreamer.freedesktop.org/</span></a></p></body></html> - - - - GStreamer backend settings - GStreamer backend beállítások - - - - Preferred audio sink: - Preferrált audió tartály: - - - - Preferred render method: - Preferrált render eljárás: - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-style:italic;">Note: changes to these settings may prevent applications from starting up correctly.</span></p></body></html> - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-style:italic;">Megjegyzés: Ezekben a beállításokban történő változtatások megakadályozhatják az alkalmazásokat a megfelelő betöltéstől.</span></p></body></html> - - - - &File - &Fájl - - - - &Help - &Súgó - - - - &Save - &Mentés - - - - Save - Mentés - - - - Ctrl+S - Ctrl+S - - - - E&xit - &Kilépés - - - - Exit - Kilépés - - - - &About - &Névjegy - - - - About - Névjegy - - - - About &Qt - &Qt-ról - - - - About Qt - Qt-ról - - - - PaletteEditorAdvancedBase - - - Tune Palette - Hangoló paletta - - - - <b>Edit Palette</b><p>Change the palette of the current widget or form.</p><p>Use a generated palette or select colors for each color group and each color role.</p><p>The palette can be tested with different widget layouts in the preview section.</p> - <b>Paletta szerkesztése</b><p>Az aktuális widget vagy űrlap palettájának megváltoztatása</p><p>Egy generált paletta használata vagy szín kiválasztás mindegyik színcsoport és szín szabályra.</p><p>A paletta tesztelhető különböző widget szerkezetekkel az előnézeti szegmensben.</p> - - - - Select &Palette: - &Paletta kiválasztása: - - - - Active Palette - Aktív paletta - - - - Inactive Palette - Inaktív paletta - - - - Disabled Palette - Paletta tiltása - - - - Auto - Auto - - - - Build inactive palette from active - Inaktív paletta építése aktívból - - - - Build disabled palette from active - Tiltott paletta építése aktívból - - - - Central color &roles - Központi szín &szabályok - - - - Choose central color role - Központi szín szabályok kiválasztása - - - - <b>Select a color role.</b><p>Available central roles are: <ul> <li>Window - general background color.</li> <li>WindowText - general foreground color. </li> <li>Base - used as background color for e.g. text entry widgets, usually white or another light color. </li> <li>Text - the foreground color used with Base. Usually this is the same as WindowText, in what case it must provide good contrast both with Window and Base. </li> <li>Button - general button background color, where buttons need a background different from Window, as in the Macintosh style. </li> <li>ButtonText - a foreground color used with the Button color. </li> <li>Highlight - a color to indicate a selected or highlighted item. </li> <li>HighlightedText - a text color that contrasts to Highlight. </li> <li>BrightText - a text color that is very different from WindowText and contrasts well with e.g. black. </li> </ul> </p> - <b>Egy szín szabály kiválasztása.</b><p>Az elérhetp központi szabályok: <ul> <li>Ablak - általános háttér szín.</li> <li>AblakSzöveg - általános előtér szín. </li> <li>Alap - háttérszínként használva példul szöveg beviteli widgetekre, rendszerint fehér vagy más világos színekre. </li> <li>Szöveg - az előtér szín van haszálva a bázissal. Rendszerint ez ugyanaz, mint az AblakSzöveg, amilyen esetekben egy jó ellentétet kell biztosítania mindkettőre Ablakkal és Bázissal. </li> <li>Gomb - általános gomb háttér szín, ahol a gomboknak szüksége van egy háttére ami különbözik az ablakétól, mint a Macintosh stílusban. </li> <li>GombSzöveg - egy előtér szín van használva gomb színnel. </li> <li>Kihangsúlyozás - egy szín a kiválasztott vagy kihangsúlyozott elem jelölésére. </li> <li>KihangsúlyozottSzöveg - egy szöveg szín, ami ellentétes a kihangsúlyozással. </li> <li>VilágosSzöveg - egy szöveg szín, ami nagyon különböző az AblakSzövegtől és a kontrasztoktól jól van példul feketével. </li> </ul> </p> - - - - Window - Ablak - - - - WindowText - AblakSzöveg - - - - Button - Gomb - - - - Base - Bázis - - - - Text - Szöveg - - - - BrightText - VilágosSzöveg - - - - ButtonText - GombSzöveg - - - - Highlight - Kihangsúlyozás - - - - HighlightedText - KihangsúlyozottSzöveg - - - - &Select Color: - Szín &kiválasztása: - - - - - Choose a color - Egy szín kiválasztása - - - - Choose a color for the selected central color role. - Egy szín kiválasztása a kiválasztott központi szín szabályokra. - - - - 3-D shadow &effects - 3 D árnyék &hatások - - - - Build &from button color - Építés gomb szín&ből - - - - Generate shadings - Árnyékolások generálása - - - - Check to let 3D-effect colors be calculated from button-color. - - - - - Choose 3D-effect color role - 3D hatás szín szabályok kiválasztása - - - - <b>Select a color role.</b><p>Available effect roles are: <ul> <li>Light - lighter than Button color. </li> <li>Midlight - between Button and Light. </li> <li>Mid - between Button and Dark. </li> <li>Dark - darker than Button. </li> <li>Shadow - a very dark color. </li> </ul> - - - - - Light - Világos - - - - Midlight - Központi fény - - - - Mid - Középső - - - - Dark - Sötét - - - - Shadow - Árnyék - - - - Select Co&lor: - &Szín kiválasztása: - - - - Choose a color for the selected effect color role. - Egy szín kiválasztása a kiválaszott hatás szín szabályra. - - - - OK - OK - - - - Close dialog and apply all changes. - Párbeszéd ablak bezárása és az összes változtatás alkalmazása. - - - - Cancel - Mégse - - - - Close dialog and discard all changes. - Párbeszédablak bezárása és az összes változtatás eldobása. - - - - PreviewFrame - - - Desktop settings will only take effect after an application restart. - Az asztal beállítások kizárólag az alkalmazás újraindítása utan lépnek érvénybe. - - - - PreviewWidgetBase - - - Preview Window - Előnézet ablak - - - - ButtonGroup - GombCsoport - - - - RadioButton1 - RádioGomb1 - - - - RadioButton2 - RádioGomb2 - - - - RadioButton3 - RádioGomb3 - - - - ButtonGroup2 - GombCsoport2 - - - - CheckBox1 - Jelölőnégyzet1 - - - - CheckBox2 - Jelölőnégyzet2 - - - - LineEdit - SorSzerkesztés - - - - ComboBox - ComboBox - - - - PushButton - NyomóGomb - - - - <p> -<a href="http://qt.nokia.com">http://qt.nokia.com</a> -</p> -<p> -<a href="http://www.kde.org">http://www.kde.org</a> -</p> - <p> -<a href="http://qt.nokia.com">http://qt.nokia.com</a> -</p> -<p> -<a href="http://www.kde.org">http://www.kde.org</a> -</p> - - - diff --git a/qvfb_hu.ts b/qvfb_hu.ts deleted file mode 100644 index bb8c931..0000000 --- a/qvfb_hu.ts +++ /dev/null @@ -1,344 +0,0 @@ - - - - - AnimationSaveWidget - - - - Record - Rekord - - - - Reset - Visszaállítás - - - - Save - Mentés - - - - Save in MPEG format (requires netpbm package installed) - MPEG formátumba mentés (netpbm csomag telepítése szükséges) - - - - - Click record to begin recording. - Kattintson az írásra az írás megkezdéséhez. - - - - - Finished saving. - Befejezett mentés. - - - - Paused. Click record to resume, or save if done. - Szüneteltetve. Kattintson az írásra a folytatáshoz, vagy mentse el, ha kész. - - - - Pause - Szünet - - - - Recording... - Felvétel... - - - - Saving... - Mentés... - - - - - Save animation... - Animáció mentése... - - - - Save canceled. - Megnés visszavonva. - - - - Save failed! - Mentési hiba! - - - - Config - - - Configure - Konfigurálás - - - - Size - Méret - - - - 176x220 "SmartPhone" - 176x220 "ÜgyesTelefon" - - - - 240x320 "PDA" - 240x320 "PDA" - - - - 320x240 "TV" / "QVGA" - 320x240 "TV" / "QVGA" - - - - 640x480 "VGA" - 640x480 "VGA" - - - - 800x600 - 800x600 - - - - 1024x768 - 1024x768 - - - - Custom - Szokásos - - - - Depth - Mélység - - - - 1 bit monochrome - 1 bites egyszínű - - - - 2 bit grayscale - 2 bites szürke skálázás - - - - 4 bit grayscale - 4 bites szürke slálázás - - - - 8 bit - 8 bites - - - - 12 (16) bit - 12 (16) bites - - - - 15 bit - 15 bites - - - - 16 bit - 16 bites - - - - 18 bit - 18 bites - - - - 24 bit - 24 bites - - - - 32 bit - 32 bites - - - - 32 bit ARGB - 32 bites ARGB - - - - Swap red and blue channels - Piros és kék csatornák felcserélése - - - - BGR format - BGR formátum - - - - Skin - Szkin - - - - None - Semmi - - - - Emulate touch screen (no mouse move) - указателя? - Érintő képernyő emulálása (nincs egér mozgatás) - - - - Emulate LCD screen (Only with fixed zoom of 3.0 times magnification) - LCD kijelző emulálása (Kizárólag egy fix 3-szoros nagyítással) - - - - <p>Note that any applications using the virtual framebuffer will be terminated if you change the Size or Depth <i>above</i>. You may freely modify the Gamma <i>below</i>. - <p>Vegye figyelembe azt, hogy bármely alkalmazás, amely virtuális framebuffer-t használ, be lesz fejezve, ha megváltoztatja a méretet vagy a mélységet <i>felül</i>. Szabadon módosíthatja a Gamma-t <i>alul</i>. - - - - Gamma - Gamma - - - - Blue - Kék - - - - - - - 1.0 - 1.0 - - - - Green - Zöld - - - - All - Mind - - - - Red - Piros - - - - Set all to 1.0 - Az összes 1.0-ra állítása - - - - &OK - &OK - - - - &Cancel - &Mégse - - - - DeviceSkin - - - The image file '%1' could not be loaded. - Nem sikerült betölteni a(z) '%1' kép fájlt. - - - - The skin directory '%1' does not contain a configuration file. - A(z) '%1' skin könyvtár nem tartalmaz egyetlen konfigurációs fájlt sem. - - - - The skin configuration file '%1' could not be opened. - Nem lehetett megnyitni a(z) '%1' skin konfigurációs fájlt. - - - - The skin configuration file '%1' could not be read: %2 - Nem lehetett olvasni a(z) '%1' skin konfigurációs fájlt: %2 - - - - Syntax error: %1 - Szintakszis hiba: %1 - - - - The skin "up" image file '%1' does not exist. - A(z) '%1 'fel' skinezett kép fájl nem létezik. - - - - The skin "down" image file '%1' does not exist. - A(z) '%1 'le' skinezett kép fájl nem létezik. - - - - The skin "closed" image file '%1' does not exist. - A(z) '%1' skin "bezárt" kép fájl nem létezik. - - - - The skin cursor image file '%1' does not exist. - A(z) '%1' skin kurzor kép fájl nem létezik. - - - - Syntax error in area definition: %1 - Szintaszis hiba a terület definícióban: %1 - - - - Mismatch in number of areas, expected %1, got %2. - Nem megfelelő terület szám, %1 várt, %2 kapott. - - - - QVFb - - - Browse... - Böngészés... - - - - Load Custom Skin... - Szokásos skin betöltése... - - - - All QVFB Skins (*.skin) - Minden QVFB skin (*.skin) - - - diff --git a/translations/assistant_hu.ts b/translations/assistant_hu.ts new file mode 100644 index 0000000..e43070c --- /dev/null +++ b/translations/assistant_hu.ts @@ -0,0 +1,1083 @@ + + + + + AboutDialog + + + &Close + &Bezárás + + + + AboutLabel + + + Warning + Figyelmeztetés + + + + Unable to launch external application. + + Nem lehet külső alkalmazást elindítani. + + + + OK + OK + + + + BookmarkDialog + + + Add Bookmark + Könyvjelző hozzáadása + + + + Bookmark: + Könyvjelző: + + + + Add in Folder: + Hozzáadás dossziéban: + + + + New Folder + Új dosszié + + + + + + + + Bookmarks + Könyvjelzők + + + + + + + + + + + Delete Folder + Dosszié törlése + + + + Rename Folder + Dosszié átnevezése + + + + BookmarkManager + + + Bookmarks + Könyvjelzők + + + + Remove + Áthelyezés + + + + You are going to delete a Folder, this will also<br>remove it's content. Are you sure to continue? + Egy olyan dossziét fog törölni, ami <br> törli annak tartalmát is. Biztos benne, hogy folytatja? + + + + + New Folder + Új Dosszié + + + + BookmarkWidget + + + Filter: + Szűrő: + + + + Remove + Eltávolítás + + + + Delete Folder + Dosszié törlése + + + + Rename Folder + Dosszié átnevezése + + + + Show Bookmark + Könyvjelző megjelenítése + + + + Show Bookmark in New Tab + Könyvjelző megjelenítése új lapon + + + + Delete Bookmark + Könyvjelző törlése + + + + Rename Bookmark + Könyvjelző átnevezése + + + + Add + Hozzáadás + + + + CentralWidget + + + Add new page + Új lap hozzáadása + + + + Close current page + Aktuális lap bezárása + + + + Print Document + Dokumentum nyomtatása + + + + + unknown + ismeretlen + + + + Add New Page + Új lap hozzáadása + + + + Close This Page + Lap bezárása + + + + Close Other Pages + Többi lap bezárása + + + + Add Bookmark for this Page... + Könyvjelző hozzáadása ehhez a laphoz... + + + + Search + Keresés + + + + ContentWindow + + + Open Link + Link megnyitása + + + + Open Link in New Tab + Link megnyitása új lapon + + + + FilterNameDialogClass + + + Add Filter Name + Szűrő név hozzáadása + + + + Filter Name: + Szűrő név: + + + + FindWidget + + + Previous + Előző + + + + Next + Következő + + + + Case Sensitive + Kis és nagybetű érzékeny + + + + Whole words + Egész szavakat + + + + <img src=":/trolltech/assistant/images/wrap.png">&nbsp;Search wrapped + <img src=":/trolltech/assistant/images/wrap.png">&nbsp;Keresés tördelése + + + + FontPanel + + + Font + Betű + + + + &Writing system + Rendszer &írása + + + + &Family + &Család + + + + &Style + &Stílus + + + + &Point size + &Pont méret + + + + HelpViewer + + + Help + Segítség + + + + OK + OK + + + + <title>Error 404...</title><div align="center"><br><br><h1>The page could not be found</h1><br><h3>'%1'</h3></div> + <title>404-es hiba...</title><div align="center"><br><br><h1>A lap nem található </h1><br><h3>'%1'</h3></div> + + + + Copy &Link Location + &Link címének másolása + + + + Open Link in New Tab Ctrl+LMB + Link megnyitása új lapon Ctrl+LMB + + + + Open Link in New Tab + Link megnyitása új lapon + + + + Unable to launch external application. + + Nem lehet külső alkalmazást indítani. + + + + IndexWindow + + + &Look for: + &Keresés: + + + + Open Link + Link megnyitása + + + + Open Link in New Tab + Link megnyitása új lapon + + + + InstallDialog + + + + Install Documentation + + + + + Downloading documentation info... + Dokumentum információ letöltése... + + + + Download canceled. + Letöltés vmegszakítva. + + + + + + Done. + Kész. + + + + The file %1 already exists. Do you want to overwrite it? + A(z) %1 fájl már létezik. Felül szeretné írni? + + + + Unable to save the file %1: %2. + Nem lehet elmenteni a(z) %1 fájlt: %2. + + + + Downloading %1... + %1 letöltése... + + + + + + Download failed: %1. + Nem sikerült a letöltés: %1. + + + + Documentation info file is corrupt! + Dokumentum információ sérült! + + + + Download failed: Downloaded file is corrupted. + Nem sikerült letölteni: A letöltött fájl sérült. + + + + Installing documentation %1... + %1 dokumentáció telepítése... + + + + Error while installing documentation: +%1 + Hiba történt a dokumentáció telepítése közben: %1 + + + + Available Documentation: + Elérhető dokumentáció: + + + + Install + Telepítés + + + + Cancel + Mégse + + + + Close + Bezárás + + + + Installation Path: + Telepítési útvonal: + + + + ... + ... + + + + MainWindow + + + + Index + Index + + + + + Contents + Tartalom + + + + + Bookmarks + Könyvjelzők + + + + Search + Keresés + + + + + + Qt Assistant + Qt Assistant + + + + + Unfiltered + Szűrés nélküli + + + + Page Set&up... + Lap Beállí&tás... + + + + Print Preview... + Nyomtatási előnézet... + + + + &Print... + &Nyomtatás... + + + + New &Tab + Új &Lap + + + + &Close Tab + Lap &bezárása + + + + &Quit + &Kilépés + + + + &Copy selected Text + Kiválasztott szöveg &másolása + + + + &Find in Text... + &Keresés szövegben... + + + + &Find + &Keresés + + + + Find &Next + &Következő keresés + + + + Find &Previous + &Előző keresés + + + + Preferences... + Beállítások... + + + + Zoom &in + &Nagyítás + + + + Zoom &out + &Kicsinyítés + + + + Normal &Size + Normál &méret + + + + Ctrl+0 + Ctrl + 0 + + + + ALT+C + ALT + C + + + + ALT+I + ALT + l + + + + ALT+S + ALT + S + + + + &Home + &Otthon + + + + &Back + &Vissza + + + + &Forward + &Előre + + + + Sync with Table of Contents + Tartalomjegyzékkel való szinkronizálás + + + + Sync + Szinkronizálás + + + + Next Page + Következő lap + + + + Ctrl+Alt+Right + Ctrl+Alt+Right + + + + Previous Page + Előző lap + + + + Ctrl+Alt+Left + Ctrl+Alt+Left + + + + Add Bookmark... + Könyvjelző hozzáadása... + + + + About... + Névjegy... + + + + Navigation Toolbar + Navigációs eszköztár + + + + Toolbars + Eszköztár + + + + Filter Toolbar + Eszköztár szűrő + + + + Filtered by: + Szűrési feltétel: + + + + Address Toolbar + Eszköztár cím + + + + Address: + Cím: + + + + Could not find the associated content item. + Nem sikerült az összekapcsolt tartalom elemet megtalálni. + + + + About %1 + %1-ről + + + + Updating search index + Keresési index frissítése + + + + Looking for Qt Documentation... + Qt dokumentáció keresése... + + + + &Window + &Ablak + + + + Minimize + Minimalizálás + + + + Ctrl+M + Ctrl + M + + + + Zoom + Zoomolás + + + + &File + &Fájl + + + + &Edit + &Szerkesztés + + + + &View + &Nézet + + + + &Go + &Gyerünk + + + + ALT+Home + ALT+Home + + + + &Bookmarks + &Könyvjelzők + + + + &Help + &Segítség + + + + ALT+O + ALT + 0 + + + + CTRL+D + CTRL+D + + + + PreferencesDialog + + + + Add Documentation + Dokumentáció hozzáadása + + + + Qt Compressed Help Files (*.qch) + Qt tömörített súgó fájlok (*.qch) + + + + The specified file is not a valid Qt Help File! + A meghatározott fájl egy érvénytelen Qt Súgó fájl! + + + + The namespace %1 is already registered! + A(z) %1 névtér már regisztrálva van! + + + + Remove Documentation + Dokumentáció eltávolítása + + + + Some documents currently opened in Assistant reference the documentation you are attempting to remove. Removing the documentation will close those documents. + Néhány dokumentum jelenleg az Assistant hivatkozásban lett megnyitva, amely az a dokumentum, amit megpróbál eltávolítani. A dokumentum eltávolítása be fogja zárni azokat a dokumentumokat. + + + + Cancel + Mégse + + + + OK + OK + + + + Use custom settings + Szokásos beállítások használata + + + + PreferencesDialogClass + + + Preferences + Beállítások + + + + Fonts + Betűk + + + + Font settings: + Betű beállítások: + + + + Browser + Böngésző + + + + Application + Alkalmazás + + + + Filters + Szűrők + + + + Filter: + Szűrők: + + + + Attributes: + Attrubútumok: + + + + 1 + 1 + + + + Add + Hozzáadás + + + + Remove + Eltávolítás + + + + Documentation + Dokumentáció + + + + Registered Documentation: + Regisztrált dokumentáció: + + + + Add... + Hozzáadás... + + + + Options + Opciók + + + + Current Page + Aktuális lap + + + + Restore to default + Alapértelmezett beállítások visszaállítása + + + + Homepage + Honlap + + + + On help start: + Súgó indításra: + + + + Show my home page + Honlapom megjelenítése + + + + Show a blank page + Egy üres lap megjelenítése + + + + Show my tabs from last session + A lapjaim megjelenításe a legutolsó szakaszból + + + + Blank Page + Üres lap + + + + QObject + + + The specified collection file does not exist! + A meghatározott gyűjtemény fájl nem létezik! + + + + Missing collection file! + Hiányzó gyűjtemény fájl! + + + + Invalid URL! + Érvénytelen URL! + + + + Missing URL! + Hiányzó URL! + + + + + + Unknown widget: %1 + Ismeretlen widget: %1 + + + + + + Missing widget! + Hiányzó widget! + + + + + The specified Qt help file does not exist! + A meghatározott Qt súgó fájl nem létezik! + + + + + Missing help file! + Hiányzó súgó fájl! + + + + Missing filter argument! + Hiányzó szűrő argumentum! + + + + Unknown option: %1 + Ismeretlen opció: %1 + + + + + Qt Assistant + Qt Assistant + + + + Could not register documentation file +%1 + +Reason: +%2 + Nem sikerült a dokumentációs fájl regisztrálása +%1 + +Ok: +%2 + + + + Documentation successfully registered. + A dokumentáció regisztrálása sikeresen megtörtént. + + + + Could not unregister documentation file +%1 + +Reason: +%2 + Nem sikerült regisztrálni a dokumentációs fájlt +%1 + +Ok: +%2 + + + + Documentation successfully unregistered. + Dokumentáció regisztrációjának megszűntetése sikeresen megtörtént. + + + + Cannot load sqlite database driver! + Nem lehet betölteni az sqlite adatbázis vezérlőt! + + + + The specified collection file could not be read! + A meghatározott gyűjtemény fájlt nem lehet olvasni! + + + + RemoteControl + + + Debugging Remote Control + Debuggolás Távoli Vezérlő + + + + Received Command: %1 %2 + Elfogadott parancs: %1 %2 + + + + SearchWidget + + + &Copy + &Másolás + + + + Copy &Link Location + &Link címének másolása + + + + Open Link in New Tab + Link megnyitása új lapon + + + + Select All + Az összes kiválasztása + + + + TopicChooser + + + Choose a topic for <b>%1</b>: + Topik választása a következőhöz: <b>%1</b>: + + + + Choose Topic + Topik választása + + + + &Topics + &Topikok + + + + &Display + &Kijelzés + + + + &Close + &Bezárás + + + diff --git a/translations/designer_hu.ts b/translations/designer_hu.ts new file mode 100644 index 0000000..c2960bc --- /dev/null +++ b/translations/designer_hu.ts @@ -0,0 +1,7023 @@ + + + + + AbstractFindWidget + + + &Previous + &Előző + + + + &Next + &Következő + + + + &Case sensitive + &Kis ér nagybetű érzékeny + + + + Whole &words + Egész &szavakat + + + + <img src=":/trolltech/shared/images/wrap.png">&nbsp;Search wrapped + <img src=":/trolltech/shared/images/wrap.png">&nbsp;Keresés tördelve + + + + AddLinkDialog + + + Insert Link + Link beszúrása + + + + Title: + Cím: + + + + URL: + URL: + + + + AppFontDialog + + + Additional Fonts + További betűl + + + + AppFontManager + + + '%1' is not a file. + %1 nem egy fájl. + + + + The font file '%1' does not have read permissions. + '%1' betű fájlnak nincsen olvasási engedélye. + + + + The font file '%1' is already loaded. + '%1' font fájl már be van töltve. + + + + The font file '%1' could not be loaded. + '%1' font fájlt nem sikerült betölteni. + + + + '%1' is not a valid font id. + '%1' nem egy érvényes betű azonosító. + + + + There is no loaded font matching the id '%1'. + Nincsen '%1' azonosítóval megegyező betöltött betű. + + + + The font '%1' (%2) could not be unloaded. + '%1' betűt (%2) nem lehetett kirakni. + + + + AppFontWidget + + + Fonts + Betűk + + + + Add font files + Betű fájlok hozzáadása + + + + Remove current font file + Aktuális betű fájl eltávolítása + + + + Remove all font files + Az összes betű fájl eltávolítása + + + + Add Font Files + Betű fájlok hozzáadása + + + + Font files (*.ttf) + Betű fájlok (*.ttf) + + + + Error Adding Fonts + Hiba történt a betűk hozzáadásakor + + + + Error Removing Fonts + Hiba történt a betűk eltávolításakor + + + + Remove Fonts + Betűk eltávolítása + + + + Would you like to remove all fonts? + El szeretné távolítani az összes betűt? + + + + AppearanceOptionsWidget + + + Form + + + + + User Interface Mode + Felhasználói interfész mód + + + + AssistantClient + + + Unable to send request: Assistant is not responding. + Nem lehet elküldeni a kérést, az Assistant nem válaszol. + + + + The binary '%1' does not exist. + '%1' bináris nem létezik. + + + + Unable to launch assistant (%1). + Nem lehet elindítani a(z) %1 assistant. + + + + BrushPropertyManager + + + No brush + Nincs kefe + + + + Solid + Szolid + + + + Dense 1 + Sűrű 1 + + + + Dense 2 + Sűrű 2 + + + + Dense 3 + Sűrű 3 + + + + Dense 4 + Sűrű 4 + + + + Dense 5 + Sűrű 5 + + + + Dense 6 + Sűrű 6 + + + + Dense 7 + Sűrű 7 + + + + Horizontal + Horizontális + + + + Vertical + Vertikális + + + + Cross + Kereszt + + + + Backward diagonal + Visszafele átlós + + + + Forward diagonal + Előre átlós + + + + Crossing diagonal + Kereszt átlós + + + + Style + Stílus + + + + Color + Szín + + + + [%1, %2] + [%1, %2] + + + + Command + + + + Change signal + Jel változtatás + + + + + Change slot + Szlot változtatás + + + + Change signal-slot connection + Jel szlot kapcsolat változtatása + + + + Change sender + Küldő változtatás + + + + Change receiver + Fogadó változtatás + + + + Create button group + Gomb csoport létrehozása + + + + Break button group + Gomb csoport törése + + + + Break button group '%1' + '%1' gomb csoport törése + + + + Add buttons to group + Gomb hozzáadása a csoporthoz + + + + + Add '%1' to '%2' + Command description for adding buttons to a QButtonGroup + '%1' hozzáadása '%2'-höz + + + + Remove buttons from group + Gomb eltávolítása a csoportból + + + + Remove '%1' from '%2' + Command description for removing buttons from a QButtonGroup + '%1' eltávolítása '%2'-ból + + + + Add connection + Kapcsolat hozzáadása + + + + Adjust connection + Kapcsolat beállítása + + + + Delete connections + Kapcsolatok törlése + + + + Change source + Forrás változtatása + + + + Change target + Cél változtatása + + + + Morph %1/'%2' into %3 + MorphWidgetCommand description + %1/'%2' alakváltoztatása %3-re + + + + Insert '%1' + '%1' beszúrása + + + + Change Z-order of '%1' + '%1' Z sorrendjének megváltoztatása + + + + Raise '%1' + '%1' növelése + + + + Lower '%1' + Alsó '%1' + + + + Delete '%1' + '%1' törlése + + + + Reparent '%1' + '%1' újra szülősítése + + + + Promote to custom widget + Egyéni widget elősegítése + + + + Demote from custom widget + Egyéni widget lefokozása + + + + Lay out using grid + Tervraj rácsok használatával + + + + Lay out vertically + Tervrajz vertikálisan + + + + Lay out horizontally + Tervrajz horizontálisan + + + + Break layout + Tervrajz törése + + + + Simplify Grid Layout + Egyszerűsített rács tervrajz + + + + + + Move Page + Lap mozgatása + + + + + + + Delete Page + Lap törlése + + + + + Page + Lap + + + + page + lap + + + + + + + Insert Page + Lap beszúrása + + + + Change Tab order + Tab sorrend változtatása + + + + Create Menu Bar + Menü sáv + + + + Delete Menu Bar + Menü sáv törlése + + + + Create Status Bar + Státusz sáv létrehozása + + + + Delete Status Bar + Státusz sáv törlése + + + + Add Tool Bar + Eszköz sáv hozzáadása + + + + Add Dock Window + Dokk ablak hozzáadása + + + + Adjust Size of '%1' + '%1' méretének igazítása + + + + Change Form Layout Item Geometry + Űrlap tervrajz elem geometriájának megváltoztatása + + + + Change Layout Item Geometry + Tervrajz elem geometriájának megváltoztatása + + + + Delete Subwindow + Alablak törlése + + + + Insert Subwindow + Alablak beszúrása + + + + subwindow + alablak + + + + Subwindow + Alablak + + + + Change Table Contents + Táblázat tartalom megváltoztatása + + + + Change Tree Contents + Fa tartalom megváltoztatása + + + + + Add action + Tevékenység hozzáadása + + + + + Remove action + Tevékenység eltávolítása + + + + Add menu + Menü hozzáadása + + + + Remove menu + Menü eltávolítása + + + + Create submenu + Almenü létrehozása + + + + Delete Tool Bar + Eszköz sáv törlése + + + + Change layout of '%1' from %2 to %3 + '%1' tervrajz megváltoztatása %2-ről %3-ra + + + + Set action text + Tevékenység szöveg beállítása + + + + Insert action + Tevékenység beszúrása + + + + + Move action + Tevékenység mozgatása + + + + Change Title + Cím megváltoztatása + + + + Insert Menu + Menü beszúrása + + + + Changed '%1' of '%2' + '%2' '%1'-ének megváltoztatása + + + + Changed '%1' of %n objects + + %n objektum %1-ének megváltoztatása + + + + + Reset '%1' of '%2' + '%2' '%1'-ének megváltoztatása + + + + Reset '%1' of %n objects + + %n objektum '%1'-ének újraindítása + + + + + Add dynamic property '%1' to '%2' + '%2' '%1' dinamikus tulajdonságának hozzáadása + + + + Add dynamic property '%1' to %n objects + + %n objektum' '%1' dinamikus tulajdonságának hozzáadása + + + + + Remove dynamic property '%1' from '%2' + '%1' dinamikus tulajdonság eltávolítáas '%2'-ből + + + + Remove dynamic property '%1' from %n objects + + '%1' dinamikus tulajdonság eltávolítása %n objektumból + + + + + Change script + Szkript megváltoztatása + + + + Change signals/slots + Jelek/Szlotok megváltoztatása + + + + ConnectDialog + + + Configure Connection + Kapcsolat konfigurálása + + + + + GroupBox + CsoportDoboz + + + + + Edit... + Szerkesztés... + + + + Show signals and slots inherited from QWidget + QWidget-ből örökölt jelek és szlotok megjelenítése + + + + ConnectionDelegate + + + <object> + <objekttum> + + + + <signal> + <jel> + + + + <slot> + <szlot> + + + + DPI_Chooser + + + Standard (96 x 96) + Embedded device standard screen resolution + Szabványos (96 x 96) + + + + Greenphone (179 x 185) + Embedded device screen resolution + Greenphone (179 x 185) + + + + High (192 x 192) + Embedded device high definition screen resolution + Magasság (192 x 192) + + + + Designer + + + Qt Designer + Qt Designer + + + + This file contains top level spacers.<br>They have <b>NOT</b> been saved into the form. + Ez a fájl felső szintű távtartókat tartalmaz.<br> Nem tartalmaznak <b>SEMMIT</b>, ami el lenne mentve az űrlapba. + + + + Perhaps you forgot to create a layout? + Talán elfelejtette létrehozni a tervrajzot? + + + + Invalid UI file: The root element <ui> is missing. + Érvénytelen UI fájl. A rendszergazda elem <ui> hiányzik. + + + + An error has occurred while reading the UI file at line %1, column %2: %3 + Hiba történt az UI fájl olvasás közben %1 sorban, %2 oszlopban: %3 + + + + This file cannot be read because it was created using %1. + A fájl nem olvasható, mert %1 használatával hozták létre. + + + + This file was created using Designer from Qt-%1 and cannot be read. + A fájlt a(z) %1 Qt Designer-rel hozták létre és nem olvasható. + + + + The converted file could not be read. + A konvertált fájlt nem sikerült olvasni. + + + + This file was created using Designer from Qt-%1 and will be converted to a new form by Qt Designer. + A fájlt a(z) %1 Qt Designer-rel hozták létre és a Qt Designer egy új űrlapra fogja konvertálni. + + + + The old form has not been touched, but you will have to save the form under a new name. + A régi űrlap nem lett érintve, de az űrlapot új néven kell majd elmentenie. + + + + This file was created using Designer from Qt-%1 and could not be read: +%2 + A fájl a(z) %1 Qt Designer-rel lett létrehozva és nem olvasható: +%2 + + + + Please run it through <b>uic3&nbsp;-convert</b> to convert it to Qt-4's ui format. + Kérem futtassa a <br>uic3&nbsp;-convert</b> Qt 4-s ui formára konvertáláshoz. + + + + This file cannot be read because the extra info extension failed to load. + Ez a fájl nem olvasható, mert az extra információ kiterjesztést nem sikerült betölteni. + + + + Custom Widgets + Egyéni Widgetek + + + + Promoted Widgets + Támogatott Widgetek + + + + Unable to launch %1. + Nem lehet elindítani %1-t. + + + + %1 timed out. + %1 időtúllépés. + + + + DesignerMetaEnum + + + %1 is not a valid enumeration value of '%2'. + %1 nem egy érvényes '%2' felsorolási érték. + + + + '%1' could not be converted to an enumeration value of type '%2'. + '%1' nem konvertálható egy '%2' típusú felsorolási értékre. + + + + DesignerMetaFlags + + + '%1' could not be converted to a flag value of type '%2'. + '%1' nem konvertálható egy '%2' típusú jelző értékre. + + + + DeviceProfile + + + '%1' is not a number. + Reading a number for an embedded device profile + '%1' nem egy szám. + + + + An invalid tag <%1> was encountered. + Egy érvénytelen címkét <%1> talált. + + + + DeviceProfileDialog + + + &Family + &Család + + + + &Point Size + &Pont méret + + + + Style + Stílus + + + + Device DPI + Eszköz DPI + + + + Name + Név + + + + DeviceSkin + + + The image file '%1' could not be loaded. + Nem sikerült betölteni a(z) '%1' kép fájlt. + + + + The skin directory '%1' does not contain a configuration file. + A(z) '%1' szkin könyvtár nem tartalmaz egy konfigurációs fájlt sem. + + + + The skin configuration file '%1' could not be opened. + A(z) '%1' szkin konfigurációs fájlt nem sikerült megnyitni. + + + + The skin configuration file '%1' could not be read: %2 + A(z) '%1' szkin konfigurációs fájlt nem sikerült olvasni: %2 + + + + Syntax error: %1 + Szintakszis hiba: %1 + + + + The skin "up" image file '%1' does not exist. + A(z) '%1' szkin 'fel' kép fájl nem létezik. + + + + The skin "down" image file '%1' does not exist. + A(z) '%1' szkin 'le' kép fájl nem létezik. + + + + The skin "closed" image file '%1' does not exist. + A(z) '%1' szkin 'zárt' kép fájl nem létezik. + + + + The skin cursor image file '%1' does not exist. + A(z) '%1' szkin kurzor kép fájl nem létezik. + + + + Syntax error in area definition: %1 + Szintakszis hiba a terület definícióban: %1 + + + + Mismatch in number of areas, expected %1, got %2. + Rossz párosítás a területek számában, várt %1, kapot %2. + + + + EmbeddedOptionsControl + + + <html><table><tr><td><b>Font</b></td><td>%1, %2</td></tr><tr><td><b>Style</b></td><td>%3</td></tr><tr><td><b>Resolution</b></td><td>%4 x %5</td></tr></table></html> + Format embedded device profile description + <html><table><tr><td><b>Betű</b></td><td>%1, %2</td></tr><tr><td><b>Stílus</b></td><td>%3</td></tr><tr><td><b>Felbontás</b></td><td>%4 x %5</td></tr></table></html> + + + + EmbeddedOptionsPage + + + Embedded Design + Tab in preferences dialog + Tab a beállítások párbeszéd ablakban + + + + Device Profiles + EmbeddedOptionsControl group box" + BeágyazottOpciókVezérlő csoport doboz" + + + + FontPanel + + + Font + Betű + + + + &Writing system + Rendszer &írása + + + + &Family + &Család + + + + &Style + &Stílus + + + + &Point size + &Pont méret + + + + FontPropertyManager + + + PreferDefault + AlapértelmezettPreferálása + + + + NoAntialias + NincsÁtlapolás + + + + PreferAntialias + ÁtlapolásPreferálása + + + + Antialiasing + Átlapolás + + + + FormBuilder + + + Invalid stretch value for '%1': '%2' + Parsing layout stretch values + Érvénytelen érték kiterjesztés '%1'-re: '%2' + + + + Invalid minimum size for '%1': '%2' + Parsing grid layout minimum size values + Érvénytelen minimum méret '%1'-re: '%2' + + + + FormEditorOptionsPage + + + %1 % + %1 % + + + + Preview Zoom + Zoom előnézet + + + + Default Zoom + Alapértelmezett zoom + + + + Forms + Tab in preferences dialog + Űrlapok + + + + Default Grid + Alapértelmezett rács + + + + FormLayoutRowDialog + + + Add Form Layout Row + нелепица какая-то + Űrlap szerkezet sor hozzaadása + + + + &Label text: + &Címke szöveg: + + + + Field &type: + Mező &típus: + + + + &Field name: + &Mező név: + + + + &Buddy: + &Haver: + + + + &Row: + &Sor: + + + + Label &name: + Címke &név: + + + + FormWindow + + + Unexpected element <%1> + Váratlan elem <%1> + + + + Error while pasting clipboard contents at line %1, column %2: %3 + Hiba történt a vágólap tartalom beillesztése közben a(z) %1 sorban, %2 oszlopban: %3 + + + + FormWindowSettings + + + Form Settings + Űrlap beállítások + + + + Layout &Default + &Alapértelmezett elrendezés + + + + &Spacing: + &Ritkítás: + + + + &Margin: + &Margó: + + + + &Layout Function + &Elrendezés függvény + + + + + Ma&rgin: + Ma&rgó: + + + + Spa&cing: + Rit&kítás: + + + + &Author + &Szerző + + + + &Include Hints + Célzások &beleértése + + + + &Pixmap Function + &Pixmap függvény + + + + Grid + Rács + + + + Embedded Design + Beágyazott terv + + + + IconSelector + + + All Pixmaps ( + Az összes Pixmap ( + + + + ItemPropertyBrowser + + + XX Icon Selected off + Sample string to determinate the width for the first column of the list item property browser + XX ikon kiválasztásának kikapcsolása + + + + MainWindowBase + + + Main + Not currently used (main tool bar) + + + + + File + Fájl + + + + Edit + Szerkesztés + + + + Tools + Eszközök + + + + Form + Űrlap + + + + Qt Designer + Qt Designer + + + + NewForm + + + C&reate + &Létrehozás + + + + Recent + Utóbbi + + + + &Close + &Bezárás + + + + &Open... + &Megnyitás... + + + + &Recent Forms + &Utóbbi űrlapok + + + + Read error + Olvasási hiba + + + + New Form + Űj űrlap + + + + Show this Dialog on Startup + Párbeszédablak megjelenítése betöltéskor + + + + A temporary form file could not be created in %1. + Egy átmeneti űrlap fájlt nem sikerült létrehozni %1-ben. + + + + The temporary form file %1 could not be written. + A(z) %1 átmeneti űrlap fájlt nem sikerült írni. + + + + ObjectInspectorModel + + + Object + Objektum + + + + Class + Osztály + + + + separator + Elválasztó + + + + <noname> + <noname> + + + + ObjectNameDialog + + + Change Object Name + Objektum nevének megváltoztatása + + + + Object Name + Objektum név + + + + PluginDialog + + + Plugin Information + Beépülő modul információ + + + + 1 + 1 + + + + PreferencesDialog + + + Preferences + Beállítások + + + + PreviewConfigurationWidget + + + Form + Űrlap + + + + Print/Preview Configuration + Nyomtatás/Előnézet konfiguráció + + + + Style + Stílus + + + + Style sheet + Stíluslap + + + + + + ... + ... + + + + Device skin + Eszköz szkin + + + + PromotionModel + + + Not used + Usage of promoted widgets + Nincs használva + + + + Q3WizardContainer + + + + Page + Lap + + + + QAbstractFormBuilder + + + Unexpected element <%1> + Váratlan elem <%1> + + + + An error has occurred while reading the UI file at line %1, column %2: %3 + Hiba történt az UI fájl olvasása közben a(z) %1 sorban, %2 oszlopban: %3 + + + + Invalid UI file: The root element <ui> is missing. + Érvénytelen UI fájl. A rendszergazda elem <ui> hiányzik. + + + + The creation of a widget of the class '%1' failed. + A(z) '%1' osztály egy widget-ének létrehozása nem sikerült. + + + + Attempt to add child that is not of class QWizardPage to QWizard. + Gyermek hozzáadásának megkísérelése QWizard-hoz, amely nem egy QWizardPage osztály. + + + + Attempt to add a layout to a widget '%1' (%2) which already has a layout of non-box type %3. +This indicates an inconsistency in the ui-file. + Egy elrendezés hozzáadásának megprónálás egy "%1' widgethez (%2), melynek már egy %3 típusú nem doboz elrendezése van. +Ez ellentmondást mutat az ui fájlban. + + + + Empty widget item in %1 '%2'. + Üres widget elem %1-ben '%2'. + + + + Flags property are not supported yet. + Jelző tulajdonság még nem támogatott. + + + + While applying tab stops: The widget '%1' could not be found. + Tab stops alkalmazásakor: A(z) '%1' widget nem található. + + + + Invalid QButtonGroup reference '%1' referenced by '%2'. + Érvénytelen '%1' QButtonGroup hivatkozásra hivatkozik a(z) '%2'. + + + + This version of the uitools library is linked without script support. + Az uitools könyvtár ezen verziója szkript támogatás nélkül linkelt. + + + + QAxWidgetPlugin + + + ActiveX control + ActiveX vezérlő + + + + ActiveX control widget + ActiveX vezérlő widget + + + + QAxWidgetTaskMenu + + + Set Control + Vezérlő beállítása + + + + Reset Control + Vezérlő újraindítása + + + + Licensed Control + Felhatalmazott vezérlő + + + + The control requires a design-time license + A vezérlő egy tervezés idejű felhatalmazást igényel + + + + QCoreApplication + + + %1 is not a promoted class. + %1 nem egy támogatott osztály. + + + + The base class %1 is invalid. + A(z) %1 alap osztály érvénytelen. + + + + The class %1 already exists. + A(z) %1 osztály már létezik. + + + + Promoted Widgets + Támogatott Widget-ek + + + + The class %1 cannot be removed + A(z) %1 osztályt nem lehet eltávolítani + + + + The class %1 cannot be removed because it is still referenced. + A(z) %1 osztályt nem lehet eltávolítani, mert még mindig hivatkozott. + + + + The class %1 cannot be renamed + A(z) %1 osztályt nem lehet átnevezni + + + + The class %1 cannot be renamed to an empty name. + A(z) %1 osztályt nem lehet átnevezni egy üres névűre. + + + + There is already a class named %1. + Már van egy %1 nevű osztály. + + + + Cannot set an empty include file. + перевод близко к тексту - буквальный совсем глаз режет + Nem lehet beállítani egy üres bennefoglalt fájlt. + + + + Exception at line %1: %2 + Kivétel a(z) %1 sorban: %2 + + + + Unknown error + Ismeretlen hiba + + + + An error occurred while running the script for %1: %2 +Script: %3 + Hiba történt a szkript futtása közben %1-re: %2 +Szkript: %3 + + + + QDesigner + + + %1 - warning + %1 -figyelmeztetés + + + + Qt Designer + Qt Designer + + + + This application cannot be used for the Console edition of Qt + Ezt alkalmazást nem lehet a Qt konzol szerkesztésére használni + + + + QDesignerActions + + + Saved %1. + Mentve: %1. + + + + Edit Widgets + Widget-ek szerkesztése + + + + &Quit + &Bezárás + + + + &Minimize + &Minimalizálás + + + + Bring All to Front + Az összes előre hozása + + + + Preferences... + Beállítások... + + + + Clear &Menu + &Menü tisztítása + + + + CTRL+SHIFT+S + CTRL+SHIFT+S + + + + CTRL+R + CTRL+R + + + + CTRL+M + CTRL+M + + + + Qt Designer &Help + Qt Designer &Súgó + + + + Current Widget Help + Aktuális Widget Súgó + + + + What's New in Qt Designer? + Mi az újdonság a Qt Designer-ben? + + + + About Plugins + Beépülő modulokról + + + + + About Qt Designer + Qt Designer-ről + + + + About Qt + Qt-ról + + + + + Open Form + Űrlap megnyitása + + + + + + Designer UI files (*.%1);;All Files (*) + Designer UI fájlok (*.%1);;Az összes fájl (*) + + + + %1 already exists. +Do you want to replace it? + %1 már létezik. +Le szeretné cserélni? + + + + Additional Fonts... + További betűk... + + + + &Recent Forms + &Utóbbi űrlapok + + + + Designer + Designer + + + + Feature not implemented yet! + A tulajdonság még nincs implementálva! + + + + Read error + Olvasási hiba + + + + %1 +Do you want to update the file location or generate a new form? + %1 +Szeretné frissíteni a fájl helyét vagy generálni egy új űrlapot? + + + + &Update + &Frissítés + + + + &New Form + &Új űrlap + + + + + Save Form? + Menti az űrlapot? + + + + Could not open file + Nem sikerült megnyitni a fájlt + + + + Select New File + Új fájl kiválasztása + + + + Could not write file + Nem sikerült írni a fájlt + + + + &Close Preview + Előnézet &bezárása + + + + &New... + &Új... + + + + &Open... + &Megnyitás... + + + + &Save + &Mentés + + + + Save &As... + Mentés &másként... + + + + Save A&ll + Az ö&sszes mentése + + + + Save As &Template... + Mentés &sablonként... + + + + + &Close + &Bezárás + + + + Save &Image... + &Kép mentése... + + + + &Print... + &Nyomtatás... + + + + View &Code... + &Kód nézet... + + + + ALT+CTRL+S + ALT+CTRL+S + + + + + Save Form As + Mentés űrlapként + + + + Preview failed + Előnézet hiba + + + + Code generation failed + Kód generálási hiba + + + + The file %1 could not be opened. +Reason: %2 +Would you like to retry or select a different file? + Nem sikerült megnyitni a(z) %1 fájlt. +Ok: %2 +Meg szeretné újra próbálni vagy kiválasztani egy különböző fájlt? + + + + It was not possible to write the entire file %1 to disk. +Reason:%2 +Would you like to retry? + Nem lehetett az egész %1 fájlt a lemezre írni. +Ok: %2 +Meg szeretné próbálni újra? + + + + + Assistant + Assistant + + + + + The backup file %1 could not be written. + Nem sikerült írni az archivált %1 fájlt. + + + + The backup directory %1 could not be created. + Nem sikerült létrehozni a(z) %1 archivált könyvtárat. + + + + The temporary backup directory %1 could not be created. + Nem sikerült létrehozni az átmeneti archivált %1 könyvtárat. + + + + Image files (*.%1) + Kép fájlok (*.%1) + + + + + Save Image + Kép mentése + + + + Saved image %1. + Mentett kép: %1. + + + + The file %1 could not be written. + Nem sikerült írni a(z) %1 fájlt. + + + + Please close all forms to enable the loading of additional fonts. + Kérem zárja be az összes űrlapot további betűk betöltéséhez. + + + + Printed %1. + Kinyomtatva: %1. + + + + QDesignerAppearanceOptionsPage + + + Appearance + Tab in preferences dialog + Megjelenés + + + + QDesignerAppearanceOptionsWidget + + + Docked Window + Dokkolt ablak + + + + Multiple Top-Level Windows + Összes felső szintű ablakok + + + + Toolwindow Font + Eszköz ablak betű + + + + QDesignerAxWidget + + + Reset control + Vezérlés újraindítása + + + + Set control + Vezérlés beállítása + + + + Control loaded + Vezérlés betöltve + + + + A COM exception occurred when executing a meta call of type %1, index %2 of "%3". + Egy COM kivétel történt a(z) %1 típusú meta hívás végrehajtása közben, '%3' %2 indexe. + + + + QDesignerFormBuilder + + + Script errors occurred: + Szkript hiba történt: + + + + The preview failed to build. + Nem sikerült az előnézetet felépíteni. + + + + Designer + Designer + + + + QDesignerFormWindow + + + %1 - %2[*] + %1 - %2[*] + + + + Save Form? + Űrlap mentése? + + + + Do you want to save the changes to this document before closing? + El szeretné menteni a változtatásokat ebbe a dokumentumba a bezárás előtt? + + + + If you don't save, your changes will be lost. + Ha nem menti el, a változtatásai el fognak veszni. + + + + QDesignerMenu + + + Type Here + Gépelje be ide + + + + Add Separator + Elválasztó hozzáadása + + + + Insert separator + Elválasztó beszúrása + + + + Remove separator + Elválasztó eltávolítása + + + + Remove action '%1' + '%1' tevékenység eltávolítása + + + + + Add separator + Elválasztó hozzáadása + + + + Insert action + Tevékenység beszúrása + + + + QDesignerMenuBar + + + Type Here + Gépelje be ide + + + + Remove Menu '%1' + '%1' menü eltávolítása + + + + Remove Menu Bar + Menü sáv eltávolítása + + + + Menu + Menü + + + + QDesignerPluginManager + + + An XML error was encountered when parsing the XML of the custom widget %1: %2 + Egy XML hiba történt az egyéni %1 widget XML-ének elemzése közben: %2 + + + + A required attribute ('%1') is missing. + Egy szükséges attribútum ('%1') hiányzik. + + + + An invalid property specification ('%1') was encountered. Supported types: %2 + Egy érvénytelen tulajdonság specifikációt ('%1') talált. Támogatott típusok: %2 + + + + '%1' is not a valid string property specification. + '%1' nem egy érvényes sztring tulajdonság specifikáció. + + + + The XML of the custom widget %1 does not contain any of the elements <widget> or <ui>. + Az egyéni %1 widget XML-je nem tartalmaz semmilyen elemet <widget> vagy <ui>. + + + + The class attribute for the class %1 is missing. + Az osztály attribútum %1 osztályra hiányzik. + + + + The class attribute for the class %1 does not match the class name %2. + Az osztály attribútum %1 osztályra nem egyezik meg a(z) %2 osztály nevével. + + + + QDesignerPropertySheet + + + Dynamic Properties + Dinamikus tulajdonságok + + + + QDesignerResource + + + The layout type '%1' is not supported, defaulting to grid. + A(z) '%1' elrendezés típus nem támogatott, alapértelmezett rács. + + + + The container extension of the widget '%1' (%2) returned a widget not managed by Designer '%3' (%4) when queried for page #%5. +Container pages should only be added by specifying them in XML returned by the domXml() method of the custom widget. + A(z) '%1' (%2) widget konténer kiterjesztése egy olyan widget-et adott vissza, amelyet a(z) '%3' (%4) Designer nem kezel, %5 lap lekéréskor. +Konténer lapokat XML-ben való specifikációjuk által kellene hozzáadni, az egyéni widget domXML() eljárása által. + + + + Unexpected element <%1> + Parsing clipboard contents + Váratlan elem <%1> + + + + Error while pasting clipboard contents at line %1, column %2: %3 + Parsing clipboard contents + Hiba történt a vágólap tartalmának beillesztése közben a(z) %1 sorban, %2 oszlopban: %3 + + + + Error while pasting clipboard contents: The root element <ui> is missing. + Parsing clipboard contents + Hiba történt a vágólap tartalmának beillesztése közben. A rendszergazda elem <ui> hiányzik. + + + + QDesignerSharedSettings + + + The template path %1 could not be created. + Nem sikerült létrehozni a(z) %1 sablon útvonalat. + + + + An error has been encountered while parsing device profile XML: %1 + Hiba történt az eszköz profil %1 XML elemzése közben + + + + QDesignerToolWindow + + + Property Editor + Tulajdonság szerkesztő + + + + Action Editor + Tevékenység szerkesztő + + + + Object Inspector + Objektum felügyelő + + + + Resource Browser + Erőforrás böngésző + + + + Signal/Slot Editor + Jel/Szlot szerkesztő + + + + Widget Box + Widget doboz + + + + QDesignerWorkbench + + + &File + &Fájl + + + + F&orm + &Űrlap + + + + Preview in + Előnézetben + + + + &Window + &Ablak + + + + &Help + &Súgó + + + + Edit + Szerkesztés + + + + Toolbars + Eszközsávok + + + + Save Forms? + Űrlap mentése? + + + + There are %n forms with unsaved changes. Do you want to review these changes before quitting? + + %n űrlapban vannak el nem mentett változtatások. Át szeretné tekintei ezeket a változtatásokat a kilépés előtt? + + + + + &View + &Nézet + + + + &Settings + &Beállítások + + + + Widget Box + Widget doboz + + + + If you do not review your documents, all your changes will be lost. + Ha nem tekinti át újra a dokumentumokat, az összes változtatása el fog veszni. + + + + Discard Changes + Változtatások eldobása + + + + Review Changes + Változtatások áttekintése + + + + Backup Information + Archiválási információ + + + + The last session of Designer was not terminated correctly. Backup files were left behind. Do you want to load them? + A Designer utolsó szakasza nem megfelelően állt le. Archivált fájlok hagyott maga után. Be szeretné tölteni őket? + + + + The file <b>%1</b> could not be opened. + A(z) <b>%1</b> fájlt nem sikerült megnyitni. + + + + The file <b>%1</b> is not a valid Designer UI file. + A(z) <b>%1</b> fájl nem egy érvényes Designer UI fájl. + + + + QFormBuilder + + + An empty class name was passed on to %1 (object name: '%2'). + Empty class name passed to widget factory method + Egy üres osztály név volt %1-ra (objektum név: '%2'). + + + + QFormBuilder was unable to create a custom widget of the class '%1'; defaulting to base class '%2'. + QFormBuilder-nek nem sikerült létrehozni egy '%1' osztály egyéni widget-et, alapértelmezés a(z) '%2' alap osztályra. + + + + QFormBuilder was unable to create a widget of the class '%1'. + QFormBuilder-nak nem sikerült létrehoznia egy '%1' osztály widget-et. + + + + The layout type `%1' is not supported. + A(z) '%1' elrendezés terv nem támogatott. + + + + The set-type property %1 could not be read. + Nem sikerült olvasni a(z) %1 beállított típusú tulajdonságot. + + + + The enumeration-type property %1 could not be read. + A(z) %1 felsorolási típus tulajdonságot nem sikerült olvasni. + + + + Reading properties of the type %1 is not supported yet. + '%1' típus tulajdonságok olvasása még nem támogatott. + + + + The property %1 could not be written. The type %2 is not supported yet. + A(z) %1 tulajdonságot nem sikerült írni. A(z) %2 típus nem támogatott még. + + + + QStackedWidgetEventFilter + + + Previous Page + Előző lap + + + + Next Page + Következő lap + + + + Delete + Törlés + + + + Before Current Page + Aktuális lap előtt + + + + After Current Page + Aktuális lap után + + + + Change Page Order... + Lap sorrend megváltoztatása... + + + + Change Page Order + Lap sorrend megváltoztatása + + + + Page %1 of %2 + %2 %1 lapja + + + + + Insert Page + Lap beszúrása + + + + QStackedWidgetPreviewEventFilter + + + Go to previous page of %1 '%2' (%3/%4). + Ugrás a(z) %1 '%2' (%3/%4) előző lapjára. + + + + Go to next page of %1 '%2' (%3/%4). + Ugrás a(z) %1 '%2' (%3/%4) következő lapjára. + + + + QTabWidgetEventFilter + + + Delete + Törlés + + + + Before Current Page + Aktuális lap előtt + + + + After Current Page + Aktuális lap után + + + + Page %1 of %2 + %2 %1 lapja + + + + + Insert Page + Lap beszúrása + + + + QToolBoxHelper + + + Delete Page + Lap törlése + + + + Before Current Page + Aktuális lap előtt + + + + After Current Page + Aktuális lap után + + + + Change Page Order... + Lap sorrend megváltoztatása... + + + + Change Page Order + Lap sorrend megváltoztatása + + + + Page %1 of %2 + %2 %1 lapja + + + + Insert Page + Lap beszúrása + + + + QtBoolEdit + + + + + True + Igaz + + + + + False + Hamis + + + + QtBoolPropertyManager + + + True + Igaz + + + + False + Hamis + + + + QtCharEdit + + + Clear Char + Karakter ürítése + + + + QtColorEditWidget + + + ... + ... + + + + QtColorPropertyManager + + + Red + Piros + + + + Green + Zöld + + + + Blue + Kék + + + + Alpha + Alfa + + + + QtCursorDatabase + + + Arrow + Nyíl + + + + Up Arrow + Felfele nyíl + + + + Cross + Kereszt + + + + Wait + Várakozás + + + + IBeam + IBeam + + + + Size Vertical + Vertikális méret + + + + Size Horizontal + Horizontális méret + + + + Size Backslash + Visszaper méret + + + + Size Slash + Per méret + + + + Size All + Az összes méret + + + + Blank + Üres + + + + Split Vertical + Vertikális feldarabolás + + + + Split Horizontal + Horizontális feldarabolás + + + + Pointing Hand + Mutató kéz + + + + Forbidden + Tiltott + + + + Open Hand + Nyitott kéz + + + + Closed Hand + Zárt kéz + + + + What's This + Mi ez + + + + Busy + Elfoglalt + + + + QtFontEditWidget + + + ... + ... + + + + Select Font + Betű kiválasztása + + + + QtFontPropertyManager + + + Family + Család + + + + Point Size + Pont méret + + + + Bold + Félkövér + + + + Italic + Dőlt + + + + Underline + Aláhúzás + + + + Strikeout + Kitalálás + + + + Kerning + Szóközökkel feltöltés + + + + QtGradientDialog + + + Edit Gradient + Meredekség szerkesztése + + + + QtGradientEditor + + + Start X + X indítása + + + + Start Y + Y indítása + + + + Final X + Végső X + + + + Final Y + Végső Y + + + + + Central X + X középpont + + + + + Central Y + Y középpont + + + + Focal X + X gyújtópont + + + + Focal Y + Y gyújtópont + + + + Radius + Sugár + + + + Angle + Szög + + + + Linear + Lineáris + + + + Radial + Sugárirányú + + + + Conical + Kúp alakú + + + + Pad + Lyuk + + + + Repeat + Megismétlés + + + + Reflect + Prizma + + + + Form + Űrlap + + + + Gradient Editor + Meredekség szerkesztő + + + + This area shows a preview of the gradient being edited. It also allows you to edit parameters specific to the gradient's type such as start and final point, radius, etc. by drag & drop. + Ez a mező jeleníti meg a meredekség egy előzetének szerkesztését. Ez engedélyezi a meredekség típusához tartozó paraméter specifikus dolgok szerkesztését, mint a kezdő és végpont, sugár, stb. a fogd & vidd módszerrel. + + + + 1 + 1 + + + + 2 + 2 + + + + 3 + 3 + + + + 4 + 4 + + + + 5 + 5 + + + + Gradient Stops Editor + Meredekség leállítás szerkesztő + + + + This area allows you to edit gradient stops. Double click on the existing stop handle to duplicate it. Double click outside of the existing stop handles to create a new stop. Drag & drop the handle to reposition it. Use right mouse button to popup context menu with extra actions. + Ez a mező engedélyezi a meredekség leállításának szerkesztését.Dupla kattintás a létező leállítás kezelőn duplikálja ezt. Dupla kattintás a létező leállítás kezelőn kívül létrehoz egy új leállítást. Fogd & vidd az újrapozíciónálo kezelőt. Használja a jobb egér gombot a felugró menü összefüggéshez extra tevékenységekkel. + + + + Zoom + Zoom + + + + + Reset Zoom + Újraindítás zoom + + + + Position + Pozíció + + + + + + Hue + Színárnyalat + + + + H + H + + + + + Saturation + Telítettség + + + + S + S + + + + Sat + Sat + + + + + Value + Érték + + + + V + V + + + + Val + Val + + + + + + Alpha + Alfa + + + + A + A + + + + Type + Típus + + + + Spread + Kiterjedés + + + + Color + Szín + + + + Current stop's color + Aktuális leállítás színe + + + + Show HSV specification + HSV specifikáció megjelenítése + + + + HSV + HSV + + + + Show RGB specification + RGB specifikáció megjelenítése + + + + RGB + RGB + + + + Current stop's position + Aktuális leállítás pozíciója + + + + % + % + + + + Zoom In + Nagyítás + + + + Zoom Out + Kicsinyítés + + + + Toggle details extension + Részlet kiterjesztések kapcsolgatása + + + + > + > + + + + Linear Type + Lineáris típus + + + + + + + + + ... + ... + + + + Radial Type + Sugárirányú típus + + + + Conical Type + Kúp alakú típus + + + + Pad Spread + Lyuk kiterjedés + + + + Repeat Spread + Ismétlési kiterjedés + + + + Reflect Spread + Prizma kiterjedés + + + + QtGradientStopsWidget + + + New Stop + Új leállítás + + + + Delete + Törlés + + + + Flip All + Az összes feldobása + + + + Select All + Az összes kiválasztása + + + + Zoom In + Nagyítás + + + + Zoom Out + Kicsinyítés + + + + Reset Zoom + Zoom újraindítása + + + + QtGradientView + + + Grad + Diplomás + + + + Remove Gradient + Meredekség eltávolítása + + + + Are you sure you want to remove the selected gradient? + El szeretné távolítani a kiválasztott meredekséget? + + + + + New... + Új... + + + + + Edit... + Szerkesztés... + + + + + Rename + Átnevezés + + + + + Remove + Eltávolítás + + + + Gradient View + Meredekség nézet + + + + QtGradientViewDialog + + + Select Gradient + Meredekség kiválasztása + + + + QtKeySequenceEdit + + + Clear Shortcut + Gyorsbillentyű kitisztítása + + + + QtLocalePropertyManager + + + %1, %2 + %1, %2 + + + + Language + Nyelv + + + + Country + Ország + + + + QtPointFPropertyManager + + + (%1, %2) + (%1, %2) + + + + X + X + + + + Y + Y + + + + QtPointPropertyManager + + + (%1, %2) + (%1, %2) + + + + X + X + + + + Y + Y + + + + QtPropertyBrowserUtils + + + [%1, %2, %3] (%4) + [%1, %2, %3] (%4) + + + + [%1, %2] + [%1, %2] + + + + QtRectFPropertyManager + + + [(%1, %2), %3 x %4] + [(%1, %2), %3 x %4] + + + + X + X + + + + Y + Y + + + + Width + Szélesség + + + + Height + Magasság + + + + QtRectPropertyManager + + + [(%1, %2), %3 x %4] + [(%1, %2), %3 x %4] + + + + X + X + + + + Y + Y + + + + Width + Szélesség + + + + Height + Magasság + + + + QtResourceEditorDialog + + + %1 already exists. +Do you want to replace it? + %1 már létezik. +Le szeretné cserélni? + + + + The file does not appear to be a resource file; element '%1' was found where '%2' was expected. + A fájl nem egy erőforrás fájl, '%1' elem található, ahol '%2' a várt. + + + + %1 [read-only] + %1 [csak olvasható] + + + + + %1 [missing] + %1 [hiányzik] + + + + <no prefix> + <nincs előtag> + + + + + New Resource File + Új erőforrás fájl + + + + + Resource files (*.qrc) + Erőforrás fájlok (*.qrc) + + + + Import Resource File + Erőforrás fájl importálása + + + + newPrefix + újElőtag + + + + <p><b>Warning:</b> The file</p><p>%1</p><p>is outside of the current resource file's parent directory.</p> + <p><b>Figyelmeztetés:</b> A(z)</p><p>%1</p><p>fájl az aktuális erőforrás fájl szülő könyvtárán kívül helyezkedik el.</p> + + + + <p>To resolve the issue, press:</p><table><tr><th align="left">Copy</th><td>to copy the file to the resource file's parent directory.</td></tr><tr><th align="left">Copy As...</th><td>to copy the file into a subdirectory of the resource file's parent directory.</td></tr><tr><th align="left">Keep</th><td>to use its current location.</td></tr></table> + <p>A hiba megoldásához, nyomja le a következőt:</p><table><tr><th align="left">Másolás</th><td>a fájl erőforrás fájljának szülőkönyvtárába másoláshoz.</td></tr><tr><th align="left">Másolás másként...</th><td>a fájl erőforrás fájljának szülőkönyvtárának egy alkönyvtárába másoláshoz.</td></tr><tr><th align="left">Megtartás</th><td>az aktuális helyének használatához. </td></tr></table> + + + + Add Files + Fájlok hozzáadása + + + + Incorrect Path + Helytelen útvonal + + + + + + + Copy + Másolás + + + + Copy As... + Másolás, mint... + + + + Keep + Megtartás + + + + Skip + Kihagyás + + + + Clone Prefix + Előtag klónozása + + + + Enter the suffix which you want to add to the names of the cloned files. +This could for example be a language extension like "_de". + Gépelje be az utótagot, melyet hozzá akar adni a klónozott fájl nevekhez. +Ez például egy nyelv kiterjesztés lenne, úgy mint "_de". + + + + + Copy As + Másolás, mint + + + + <p>The selected file:</p><p>%1</p><p>is outside of the current resource file's directory:</p><p>%2</p><p>Please select another path within this directory.<p> + <p>A kiválaszott fájl:</p><p>%1</p><p>az aktuális erőforrás fájl könytárán kívül helyezkedik el:</p><p>%2</p><p>Kérem válasszon másik útvonalat ezen a könyvtáron belül.<p> + + + + Could not overwrite %1. + Nem sikerült felülírni %1. + + + + Could not copy +%1 +to +%2 + Nem sikerült másolni +%1 +ide +%2 + + + + A parse error occurred at line %1, column %2 of %3: +%4 + Egy elemzési hiba történt %3 %1 sorában, %2 oszlopában: +%4 + + + + Save Resource File + Erőforrás fájl mentése + + + + Could not write %1: %2 + Nem sikerült írni %1: %2 + + + + Edit Resources + Erőforrások szerkesztése + + + + New... + Új... + + + + Open... + Megnyitás... + + + + Open Resource File + Erőforrás fájl megnyitása + + + + + Remove + Eltávolítás + + + + + Move Up + Mozgatás felfelé + + + + + Move Down + Mozgatás lefelé + + + + + Add Prefix + Előtag hozzáadása + + + + Add Files... + Fájlok hozzáadása... + + + + Change Prefix + Előtag megváltoztatása + + + + Change Language + Nyelv megváltoztatása + + + + Change Alias + Álnév megváltoztatása + + + + Clone Prefix... + Előtag klónozása... + + + + Prefix / Path + Előtag / Útvonal + + + + Language / Alias + Nyelv / Álnév + + + + <html><p><b>Warning:</b> There have been problems while reloading the resources:</p><pre>%1</pre></html> + <html><p><b>Figyelmeztetés:</b> Hibák történtek az erőforrások újra töltése közben:</p><pre>%1</pre></html> + + + + Resource Warning + Erőforrás figyelmeztetés + + + + Dialog + Párbeszéd ablak + + + + New File + Új fájl + + + + + N + N + + + + Remove File + Fájl eltávolítása + + + + + R + R + + + + I + I + + + + New Resource + Új erőforrás + + + + A + A + + + + Remove Resource or File + Erőforrás vagy fájl eltávolítása + + + + QtResourceView + + + Size: %1 x %2 +%3 + Méret: %1 x %2 +%3 + + + + Edit Resources... + Erőforrások szerkesztése... + + + + Reload + Újratöltés + + + + Copy Path + Útvonal másolása + + + + QtResourceViewDialog + + + Select Resource + Erőforrás kiválasztása + + + + QtSizeFPropertyManager + + + %1 x %2 + %1 x %2 + + + + Width + Szélesség + + + + Height + Magasság + + + + QtSizePolicyPropertyManager + + + + <Invalid> + <Érvénytelen> + + + + [%1, %2, %3, %4] + [%1, %2, %3, %4] + + + + Horizontal Policy + Horizontális irányvonal + + + + Vertical Policy + Vertikális irányelv + + + + Horizontal Stretch + Horizontális terjedelem + + + + Vertical Stretch + Vertikális terjedelem + + + + QtSizePropertyManager + + + %1 x %2 + %1 x %2 + + + + Width + Szélesség + + + + Height + Magasság + + + + QtToolBarDialog + + + Custom Toolbar + Egyéni eszköz sáv + + + + < S E P A R A T O R > + < E L V Á L A S Z T Ó > + + + + Customize Toolbars + Eszköz sávok testreszabása + + + + 1 + 1 + + + + Actions + Tevékenységek + + + + Toolbars + Eszköz sávok + + + + Add new toolbar + Új eszköz sáv hozzáadása + + + + New + Új + + + + Remove selected toolbar + Kiválaszott eszköz sáv eltávolítás + + + + Remove + Eltávolítás + + + + Rename toolbar + Eszköz sáv átnevezése + + + + Rename + Átnevezés + + + + Move action up + Tevékenység mozgatása felfelé + + + + Up + Fel + + + + Remove action from toolbar + Tevékenység eltávolítása az eszköz sávról + + + + <- + <- + + + + Add action to toolbar + Tevékenység hozzáadása az eszközsávhoz + + + + -> + -> + + + + Move action down + Tevékenység mozgatása felfele + + + + Down + Le + + + + Current Toolbar Actions + Aktuális eszköz sáv tevékenységek + + + + QtTreePropertyBrowser + + + Property + Tulajdonság + + + + Value + Érték + + + + SaveFormAsTemplate + + + Add path... + Útvonal hozzáadása... + + + + Template Exists + A sablon létezik + + + + A template with the name %1 already exists. +Do you want overwrite the template? + Egy %1 nevű sablon már létezik. +Felül szeretné írni a sablont? + + + + Overwrite Template + Sablom felülírása + + + + Open Error + Megnyitási hiba + + + + There was an error opening template %1 for writing. Reason: %2 + Hiba történt a(z) %1 sablon írásra megnyitása közben. Ok: %2 + + + + Write Error + Írása hiba + + + + There was an error writing the template %1 to disk. Reason: %2 + Hiba történt a(z) %1 sablon lemezre írása közben. Ok: %2 + + + + Pick a directory to save templates in + Egy könyvtár gondos kiválasztása, melybe a könytárak lesznek elmentve + + + + Save Form As Template + Az űrlap sablonként mentése + + + + &Category: + &Kategória: + + + + &Name: + &Név: + + + + ScriptErrorDialog + + + An error occurred while running the scripts for "%1": + + Hiba történt a szkriptek futtatása közben '%1'-re: + + + + SelectSignalDialog + + + Go to slot + Szlotra ugrás + + + + Select signal + Jel kiválasztása + + + + signal + jel + + + + class + osztály + + + + SignalSlotConnection + + + SENDER(%1), SIGNAL(%2), RECEIVER(%3), SLOT(%4) + KÜLDŐ(%1), JEL(%2), FOGADÓ(%3), SZLOT(%4) + + + + SignalSlotDialogClass + + + Signals and slots + Jelek és szlotok + + + + Slots + Szlotok + + + + + Add + Hozzáadás + + + + + + + ... + ... + + + + + Delete + Törlés + + + + Signals + Jelek + + + + Spacer + + + Horizontal Spacer '%1', %2 x %3 + Horizontális távtartók '%1', %2 x %3 + + + + Vertical Spacer '%1', %2 x %3 + Vertikális távtartók '%1', %2 x %3 + + + + TemplateOptionsPage + + + Template Paths + Tab in preferences dialog + Слово "пути" опустил, т.к. с другими вкладками не перепутать, а длинная вкладка не смотрится. + Sablon útvonalak + + + + ToolBarManager + + + Configure Toolbars... + Eszköz sávok konfigurálása... + + + + Window + Ablak + + + + Help + Súgó + + + + Style + Stílus + + + + Dock views + Dokk nézetek + + + + Toolbars + Eszköz sávok + + + + VersionDialog + + + <h3>%1</h3><br/><br/>Version %2 + <h3>%1</h3><br/><br/>Verzió %2 + + + + Qt Designer + Qt Designer + + + + <br/>Qt Designer is a graphical user interface designer for Qt applications.<br/> + <br/>Qt Designer egy grafikus felhasználói felület tervező Qt alkalmazásokhoz.<br/> + + + + %1<br/>Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). + %1<br/>Szerzői jog (C) 2010 Nokia vállalat és/vagy leányvállalata(i). + + + + WidgetDataBase + + + The file contains a custom widget '%1' whose base class (%2) differs from the current entry in the widget database (%3). The widget database is left unchanged. + A fájl egy egyéni '%1' widget-t tartalmaz, aminek az alap osztálya (%2) különbözik az aktuális beviteltől a widget adatbázisban (%3). A widget adatbázis változatlanul lett hagyva. + + + + qdesigner_internal::ActionEditor + + + New... + Új... + + + + Edit... + Szerkesztés... + + + + Go to slot... + Ugrás a szlotra... + + + + Copy + Másolás + + + + Cut + Kivágás + + + + Paste + Beillesztés + + + + Select all + Az összes kiválasztása + + + + Delete + Törlés + + + + Actions + Tevékenységek + + + + Configure Action Editor + Tevékenység szerkesztő konfigurálása + + + + Icon View + Ikon nézet + + + + Detailed View + Részletezett nézet + + + + New action + Új tevékenység + + + + Edit action + Tevékenység szerkesztése + + + + Remove action '%1' + '%1' tevékenység eltávolítása + + + + Remove actions + Tevékenységek eltávolítása + + + + Used In + Használva ebben + + + + qdesigner_internal::ActionModel + + + Name + Név + + + + Used + Használt + + + + Text + Szöveg + + + + Shortcut + Rövidebb út + + + + Checkable + Leellenőrizhető + + + + ToolTip + Eszköz tipp + + + + qdesigner_internal::BrushManagerProxy + + + The element '%1' is missing the required attribute '%2'. + A(z) '%1' elem hiányzik, a szükséges attribútum '%2'. + + + + Empty brush name encountered. + Üres kefe nevet talált. + + + + An unexpected element '%1' was encountered. + Egy '%1' váratlan elemet talált. + + + + An error occurred when reading the brush definition file '%1' at line line %2, column %3: %4 + Hiba történt a(z) '%1' ecset definíciós fájl olvasása közben %2 sorban, %3 oszlopban: %4 + + + + An error occurred when reading the resource file '%1' at line %2, column %3: %4 + Hiba történt a(z) '%1' erőforrás fájl olvasása közben, %2 sorban, %3 oszlopban: %4 + + + + qdesigner_internal::BuddyEditor + + + Add buddy + Haver hozzáadása + + + + Remove buddies + Haverok eltávolítása + + + + Remove %n buddies + + %n haverok eltávolítása + + + + + Add %n buddies + + %n haver hozzáadása + + + + + Set automatically + Automatikus beállítás + + + + qdesigner_internal::BuddyEditorPlugin + + + Edit Buddies + Haverok szerkesztése + + + + qdesigner_internal::BuddyEditorTool + + + Edit Buddies + Haverok szerkesztése + + + + qdesigner_internal::ButtonGroupMenu + + + Select members + Tagok kiválasztása + + + + Break + Törés + + + + qdesigner_internal::ButtonTaskMenu + + + Assign to button group + Gomb csoporthoz rendelés + + + + Button group + Gomb csoport + + + + New button group + Új gomb csoport + + + + Change text... + Szöveg megváltoztatása... + + + + None + Semmi + + + + Button group '%1' + '%1' gomb csoport + + + + qdesigner_internal::CodeDialog + + + Save... + Mentés... + + + + Copy All + Az összes másolása + + + + &Find in Text... + &Keresés szövegben... + + + + A temporary form file could not be created in %1. + Egy átmeneti űrlap fájlt nem sikerült létrehozni %1-ben. + + + + The temporary form file %1 could not be written. + A(z) %1 átmeneti űrlap fájlt nem sikerült írni. + + + + %1 - [Code] + %1 - [Kód] + + + + Save Code + Kód mentése + + + + Header Files (*.%1) + Fejállományok (*.%1) + + + + The file %1 could not be opened: %2 + A(z) %1 fájlt nem sikerült megnyitni: %2 + + + + The file %1 could not be written: %2 + A(z) %1 fájlt nem sikerült írni: %2 + + + + %1 - Error + %1 - Hiba + + + + qdesigner_internal::ColorAction + + + Text Color + Szöveg szín + + + + qdesigner_internal::ComboBoxTaskMenu + + + Edit Items... + Elemek szerkesztése... + + + + Change Combobox Contents + Combobox tartalmának megváltoztatása + + + + qdesigner_internal::CommandLinkButtonTaskMenu + + + Change description... + Leírás megváltoztatása... + + + + qdesigner_internal::ConnectionEdit + + + Select All + Az összes kiválasztása + + + + Deselect All + Az összes kijelölés eltűntetése + + + + Delete + Törlés + + + + qdesigner_internal::ConnectionModel + + + Sender + Küldő + + + + Signal + Jel + + + + Receiver + Fogadó + + + + Slot + Szlot + + + + <sender> + <küldő> + + + + <signal> + <jel> + + + + <receiver> + <fogadó> + + + + <slot> + <szlot> + + + + The connection already exists!<br>%1 + A kapcsolat már létezik!<br>%1 + + + + Signal and Slot Editor + Jel és Szlot szerkesztő + + + + qdesigner_internal::ContainerWidgetTaskMenu + + + Delete + Törlés + + + + Insert + Beszúrás + + + + Insert Page Before Current Page + Lap beszúrása az aktuális lap elé + + + + Insert Page After Current Page + Lap beszúrása az aktuális lap után + + + + Add Subwindow + Alablak hozzáadása + + + + Subwindow + Al ablak + + + + Page + Lap + + + + Page %1 of %2 + %2 %1 lapja + + + + qdesigner_internal::DPI_Chooser + + + System (%1 x %2) + System resolution + Rendszer (%1 x %2) + + + + User defined + Felhasználó által definiált + + + + x + DPI X/Y separator + x + + + + qdesigner_internal::DesignerPropertyManager + + + + AlignLeft + IgazításBalra + + + + AlignHCenter + IgazításHKözépre + + + + AlignRight + IgazításJobbra + + + + AlignJustify + IgazításFeloldása + + + + AlignTop + IgazításTetejére + + + + + AlignVCenter + IgazításVKözépre + + + + AlignBottom + IgazításAlulra + + + + %1, %2 + %1, %2 + + + + Customized (%n roles) + + Testreszabva (%n szabály) + + + + + Inherited + Örökölt + + + + Horizontal + Horizontális + + + + Vertical + Vertikális + + + + Normal Off + Normál ki + + + + Normal On + Normál be + + + + Disabled Off + Tiltás ki + + + + Disabled On + Tiltás be + + + + Active Off + Aktív ki + + + + Active On + Aktív be + + + + Selected Off + Kiválasztás ki + + + + Selected On + Kiválasztás be + + + + + translatable + fordítható + + + + + disambiguation + Nem félreérthető + + + + + comment + megjegyzés + + + + qdesigner_internal::DeviceProfileDialog + + + Device Profiles (*.%1) + Eszköz profilok (*.%1) + + + + Default + Alapértelmezett + + + + Save Profile + Profil mentése + + + + Save Profile - Error + Profil mentése - Hiba + + + + Unable to open the file '%1' for writing: %2 + Nem lehet megnyitni a(z) '%1' fájlt írásra: %2 + + + + Open profile + Profil megnyitása + + + + + Open Profile - Error + Profil megnyitása - Hiba + + + + Unable to open the file '%1' for reading: %2 + Nem lehet megnyitni a(z) '%1' fájlt olvasásra: %2 + + + + '%1' is not a valid profile: %2 + '%1' nem egy érvényes profil: %2 + + + + qdesigner_internal::Dialog + + + Dialog + Párbeszéd ablak + + + + StringList + Sztring lista + + + + New String + Új Sztring + + + + &New + &Új + + + + Delete String + Sztring törlése + + + + &Delete + &Törlés + + + + &Value: + &Érték: + + + + Move String Up + Sztring felfelé mozgatása + + + + Up + Fel + + + + Move String Down + Sztring lefelé mozgatása + + + + Down + Le + + + + qdesigner_internal::EmbeddedOptionsControl + + + None + Semmi + + + + Add a profile + Egy profil hozzáadása + + + + Edit the selected profile + A kiválasztott profil szerkesztése + + + + Delete the selected profile + A kiválasztott profil törlése + + + + Add Profile + Profil hozzáadása + + + + New profile + Új profil + + + + Edit Profile + Profil szerkesztése + + + + Delete Profile + Profil törlése + + + + Would you like to delete the profile '%1'? + Törölni szeretné a(z) '%1' profilet? + + + + Default + Alapértelmezett + + + + qdesigner_internal::FilterWidget + + + <Filter> + <Szűrő> + + + + qdesigner_internal::FormEditor + + + Resource File Changed + Erőforrás fájl megváltoztatva + + + + The file "%1" has changed outside Designer. Do you want to reload it? + A(z) '%1' fájl megváltoztatták a Designer-en kívül. Újra szeretné tölteni? + + + + qdesigner_internal::FormLayoutMenu + + + Add form layout row... + Űrlap elrendezési sor hozzáadása... + + + + qdesigner_internal::FormWindow + + + Edit contents + Tartalom szerkesztése + + + + F2 + F2 + + + + Insert widget '%1' + '%1' widget beszúrása + + + + Resize + Átméretezés + + + + + Key Move + Kulcs mozgatás + + + + Paste %n action(s) + + %n tevékenység beillesztése + + + + + Paste %n widget(s) + + %n widget beillesztése + + + + + Paste (%1 widgets, %2 actions) + Beillesztés (%1 widget-ek, %2 tevékenységek) + + + + Cannot paste widgets. Designer could not find a container without a layout to paste into. + Nem lehet beilleszteni a widget-eket. A Designer nem talált egy tárolót sem elrendezés nélküli beillesztéshez. + + + + Break the layout of the container you want to paste into, select this container and then paste again. + A tároló elrendezésének megtörése, ahová be akarja illeszteni, válassza ki ezt a tárolót és aztán illessze e újra. + + + + Paste error + Beillesztési hiba + + + + Raise widgets + Widget-ek növelése + + + + Lower widgets + Alsó widget-ek + + + + Select Ancestor + Ős kiválasztása + + + + Lay out + Elrendezés + + + + + Drop widget + Widget ejtése + + + + A QMainWindow-based form does not contain a central widget. + Egy QMainWindow alapú űrlap nem tartalmaz egy központi widget-et. + + + + qdesigner_internal::FormWindowBase + + + Delete '%1' + '%1' törlése + + + + Delete + Törlés + + + + qdesigner_internal::FormWindowManager + + + Cu&t + &Kivágás + + + + Cuts the selected widgets and puts them on the clipboard + A kiválaszott widget-ek kivágása és vágólapra helyezése + + + + &Copy + &Másolás + + + + Copies the selected widgets to the clipboard + A kiválasztott widget-ek vágólapra másolása + + + + &Paste + &Beillesztés + + + + Pastes the clipboard's contents + A vágólap tartalmának beillesztése + + + + &Delete + &Törlés + + + + Deletes the selected widgets + A kiválasztott widget-ek törlése + + + + Select &All + Az &összes kiválasztása + + + + Selects all widgets + Az összes widget kiválasztása + + + + Bring to &Front + &Előre hozás + + + + + Raises the selected widgets + A kiválaszott widget-ek növelése + + + + Send to &Back + &Visszaküldés + + + + + Lowers the selected widgets + Alsó kiválasztott widget-ek + + + + Adjust &Size + &Méret igazítása + + + + Adjusts the size of the selected widget + A kiválasztott widget méretének igazítása + + + + Lay Out &Horizontally + Elrendezés &Horizontálisan + + + + Lays out the selected widgets horizontally + A kiválaszott widget-ek horizontális elrendezése + + + + Lay Out &Vertically + Elrendezés &vertikálisan + + + + Lays out the selected widgets vertically + A kiválaszott widget-ek vertikális elrendezése + + + + Lay Out in a &Form Layout + Elrendezés egy &Űrlap elrendezésben + + + + Lays out the selected widgets in a form layout + A kiválaszott widget-ek elrendezése egy űrlap elrendezésben + + + + Lay Out in a &Grid + Elrendezés egy &rácsban + + + + Lays out the selected widgets in a grid + A kiválasztott widget-ek elrendezése egy rácsban + + + + Lay Out Horizontally in S&plitter + Elrendezés Horizontálisan a &csúszkában + + + + Lays out the selected widgets horizontally in a splitter + A kiválasztott widget-ek horizontális elrendezése egy csúszkában + + + + Lay Out Vertically in Sp&litter + Elrendezés vertikálisan egy &csúszkában + + + + Lays out the selected widgets vertically in a splitter + A kiválaszott widget-ek vertikális elrendezése egy csúszkában + + + + &Break Layout + Elrendezés &törése + + + + Breaks the selected layout + A kiválaszott elrendezés törése + + + + Si&mplify Grid Layout + Egy&szerűsített rács elrendezés + + + + Removes empty columns and rows + Üres oszlopok és sorok eltávolítása + + + + &Preview... + &Előnézet... + + + + Preview current form + Aktuális űrlap előnézet + + + + Form &Settings... + Űrlap &beállítások... + + + + Break Layout + Elrendezés törése + + + + Adjust Size + Méret igazítása + + + + Could not create form preview + Title of warning message box + Nem sikerült létrehozni az űrlap előnézetet + + + + Form Settings - %1 + Űrlap beállítások - %1 + + + + qdesigner_internal::FormWindowSettings + + + None + Semmi + + + + Device Profile: %1 + Eszköz profil: %1 + + + + qdesigner_internal::GridPanel + + + Form + Űrlap + + + + Grid + Rács + + + + Visible + Látható + + + + Grid &X + Rács &X + + + + + Snap + Bepattintás + + + + Reset + Újraindítás + + + + Grid &Y + Rács &Y + + + + qdesigner_internal::GroupBoxTaskMenu + + + Change title... + Cím változtatása... + + + + qdesigner_internal::HtmlTextEdit + + + Insert HTML entity + HTML entitás beszúrása + + + + qdesigner_internal::IconSelector + + + The pixmap file '%1' cannot be read. + A(z) '%1' pixmap fájlt nem lehet olvasni. + + + + The file '%1' does not appear to be a valid pixmap file: %2 + A(z) '%1' fájlt nem egy érvényes pixmap fájl: %2 + + + + The file '%1' could not be read: %2 + A(z) '%1' fájlt nem sikerült olvasni: %2 + + + + Choose a Pixmap + Egy pixmap kiválasztása + + + + Pixmap Read Error + Pixmap olvasási hiba + + + + ... + ... + + + + Normal Off + Normál ki + + + + Normal On + Normál be + + + + Disabled Off + Tiltás ki + + + + Disabled On + Tiltás be + + + + Active Off + Aktív ki + + + + Active On + Aktív be + + + + Selected Off + Kiválaszott ki + + + + Selected On + Kiválaszott be + + + + Choose Resource... + Erőforrás kiválasztása... + + + + Choose File... + Fájl kiválasztása... + + + + Reset + Újraindítás + + + + Reset All + Az összes újraindítása + + + + qdesigner_internal::ItemListEditor + + + Properties &<< + Tulajdonságok &<< + + + + + Properties &>> + Tulajdonságok &>> + + + + Items List + Elem lista + + + + New Item + Új elem + + + + &New + &Új + + + + Delete Item + Elem törlése + + + + &Delete + &Törlés + + + + Move Item Up + Elem mozgatása felfelé + + + + U + U + + + + Move Item Down + Elem mozgatása lefelé + + + + D + D + + + + qdesigner_internal::LabelTaskMenu + + + Change rich text... + Gazdag szöveg választása... + + + + Change plain text... + Egyszerű szöveg választása... + + + + qdesigner_internal::LanguageResourceDialog + + + Choose Resource + Erőforrás kiválasztása + + + + qdesigner_internal::LineEditTaskMenu + + + Change text... + Szöveg kiválasztása... + + + + qdesigner_internal::ListWidgetEditor + + + New Item + Új elem + + + + Edit List Widget + Widget szerkesztési lista + + + + Edit Combobox + Combobox szerkesztése + + + + qdesigner_internal::ListWidgetTaskMenu + + + Edit Items... + Elemek szerkesztése... + + + + Change List Contents + Tartalom változtatási lista + + + + qdesigner_internal::MdiContainerWidgetTaskMenu + + + Next Subwindow + Új alablak + + + + Previous Subwindow + Előző alablak + + + + Tile + Cserép + + + + Cascade + Kaszkád + + + + qdesigner_internal::MenuTaskMenu + + + Remove + Eltávolítás + + + + qdesigner_internal::MorphMenu + + + Morph into + Morph into + + + + qdesigner_internal::NewActionDialog + + + New Action... + Új tevékenység... + + + + &Text: + &Szöveg: + + + + Object &name: + Objektum &név: + + + + &Icon: + &Ikon: + + + + Shortcut: + Rövidebb út: + + + + Checkable: + Ellenőrizhető: + + + + ToolTip: + Eszköz tipp: + + + + + ... + ... + + + + qdesigner_internal::NewDynamicPropertyDialog + + + Set Property Name + Tulajdonság nevének beállítása + + + + The current object already has a property named '%1'. +Please select another, unique one. + Az aktuális objektumnak már van egy '%1' nevű tulajdonsága. +Kérem válasszon másikat, egy egyedülállót. + + + + The '_q_' prefix is reserved for the Qt library. +Please select another name. + Az '_q_' előtag foglalt a Qt könyvtárhoz. +Kérem válasszon másikat. + + + + Create Dynamic Property + Dinamikus tulajdonság létrehozása + + + + Property Name + Tulajdonság Neve + + + + horizontalSpacer + horizontálisTávtartó + + + + Property Type + Tulajdonság Típusa + + + + qdesigner_internal::NewFormWidget + + + Default size + Alapértelmezett méret + + + + QVGA portrait (240x320) + QVGA portré (240x320) + + + + QVGA landscape (320x240) + QVGA tájkép (320x240) + + + + VGA portrait (480x640) + VGA portré (480x640) + + + + VGA landscape (640x480) + VGA tájkép: (640x480) + + + + Widgets + New Form Dialog Categories + Widget-ek + + + + Custom Widgets + Egyéni Widget-ek + + + + None + Semmi + + + + Error loading form + Hiba történt az űrlap betöltése közben + + + + Unable to open the form template file '%1': %2 + Nem lehet megnyitni a(z) '%1' űrlap sablon fájlt: %2 + + + + Internal error: No template selected. + Belső hiba: Nincsen sablon kiválasztva. + + + + 0 + 0 + + + + Choose a template for a preview + Válasszon egy sablont egy előnézetre + + + + Embedded Design + Beágyazott tervezés + + + + Device: + Eszköz: + + + + Screen Size: + Képernyő méret: + + + + qdesigner_internal::NewPromotedClassPanel + + + Add + Hozzáadás + + + + New Promoted Class + Új támogatott osztály + + + + Base class name: + Alap osztály név: + + + + Promoted class name: + Támogatott osztály neve: + + + + Header file: + Fejállomány: + + + + Global include + Globális include + + + + Reset + Újraindítás + + + + qdesigner_internal::ObjectInspector + + + &Find in Text... + &Keresés a szövegben... + + + + qdesigner_internal::ObjectInspector::ObjectInspectorPrivate + + + Change Current Page + Aktuális lap megváltoztatása + + + + qdesigner_internal::OrderDialog + + + Index %1 (%2) + Index %1 (%2) + + + + %1 %2 + %1 %2 + + + + Change Page Order + Lap sorrend megváltoztatása + + + + Page Order + Lap sorrend + + + + Move page up + Lap mozgatása felfelé + + + + Move page down + Lap mozgatása lefelé + + + + qdesigner_internal::PaletteEditor + + + Edit Palette + Paletta szerkesztése + + + + Tune Palette + Paletta finomhangolása + + + + Show Details + Részletek megjelenítése + + + + Compute Details + Számítási részletek + + + + Quick + Gyors + + + + Preview + Előnézet + + + + Disabled + Tiltott + + + + Inactive + Inaktív + + + + Active + Aktív + + + + qdesigner_internal::PaletteEditorButton + + + Change Palette + Paletta megváltoztatása + + + + qdesigner_internal::PaletteModel + + + Color Role + Szín szabály + + + + Active + Aktív + + + + Inactive + Inaktív + + + + Disabled + Tiltott + + + + qdesigner_internal::PixmapEditor + + + Choose Resource... + Erőforrás kiválasztása... + + + + Choose File... + Fájl kiválasztása... + + + + Copy Path + Útvonal kiválasztása + + + + Paste Path + Útvonal beillesztése + + + + + ... + ... + + + + qdesigner_internal::PlainTextEditorDialog + + + Edit text + Szöveg szerkesztése + + + + qdesigner_internal::PluginDialog + + + Components + Komponensek + + + + Plugin Information + Beépülő modul információ + + + + Refresh + Felfrissítés + + + + Scan for newly installed custom widget plugins. + Újonnan telepített egyéni widget beépülő modulok letapogatása. + + + + Qt Designer couldn't find any plugins + Qt Designer nem talált egyetlen beépülő modult sem + + + + Qt Designer found the following plugins + Qt Designer a következő beépülő modulokat találta + + + + New custom widget plugins have been found. + Új egyéni widget betöltő modul talált. + + + + qdesigner_internal::PreviewActionGroup + + + %1 Style + %1 Stílus + + + + qdesigner_internal::PreviewConfigurationWidget + + + Default + Alapértelmezett + + + + None + Semmi + + + + Browse... + Böngészés... + + + + qdesigner_internal::PreviewConfigurationWidget::PreviewConfigurationWidgetPrivate + + + Load Custom Device Skin + Egyéni eszköz szkin betöltése + + + + All QVFB Skins (*.%1) + Az összes QVFB szkin (*.%1) + + + + %1 - Duplicate Skin + %1 - Duplikált szkin + + + + The skin '%1' already exists. + A(z) '%1' szkin már létezik. + + + + %1 - Error + %1 - Hiba + + + + %1 is not a valid skin directory: +%2 + %1 nem egy érvényes szkin könyvtár: +%2 + + + + qdesigner_internal::PreviewDeviceSkin + + + &Portrait + + + + + Landscape (&CCW) + Rotate form preview counter-clockwise + + + + + &Landscape (CW) + Rotate form preview clockwise + + + + + &Close + &Bezárás + + + + qdesigner_internal::PreviewManager + + + %1 - [Preview] + + + + + qdesigner_internal::PreviewMdiArea + + + The moose in the noose +ate the goose who was loose. + Palette editor background + + + + + qdesigner_internal::PreviewWidget + + + Preview Window + + + + + LineEdit + + + + + ComboBox + + + + + PushButton + + + + + ButtonGroup2 + + + + + CheckBox1 + + + + + CheckBox2 + + + + + ButtonGroup + + + + + RadioButton1 + + + + + RadioButton2 + + + + + RadioButton3 + + + + + qdesigner_internal::PromotionModel + + + Name + + + + + Header file + + + + + Global include + + + + + Usage + + + + + qdesigner_internal::PromotionTaskMenu + + + Promoted widgets... + + + + + Promote to ... + + + + + Change signals/slots... + + + + + Promote to + + + + + Demote to %1 + + + + + qdesigner_internal::PropertyEditor + + + Add Dynamic Property... + + + + + Remove Dynamic Property + + + + + Sorting + + + + + Color Groups + + + + + Tree View + + + + + Drop Down Button View + + + + + String... + + + + + Bool... + + + + + Other... + + + + + Configure Property Editor + + + + + Object: %1 +Class: %2 + + + + + qdesigner_internal::PropertyLineEdit + + + Insert line break + + + + + qdesigner_internal::QDesignerPromotionDialog + + + Promoted Widgets + + + + + Promoted Classes + + + + + Promote + + + + + Change signals/slots... + + + + + %1 - Error + + + + + qdesigner_internal::QDesignerResource + + + Loading qrc file + + + + + The specified qrc file <p><b>%1</b></p><p>could not be found. Do you want to update the file location?</p> + + + + + New location for %1 + + + + + Resource files (*.qrc) + + + + + qdesigner_internal::QDesignerTaskMenu + + + Change objectName... + + + + + Change toolTip... + + + + + Change whatsThis... + + + + + Change styleSheet... + + + + + Create Menu Bar + + + + + Add Tool Bar + + + + + Create Status Bar + + + + + Remove Status Bar + + + + + Change script... + + + + + Change signals/slots... + + + + + Go to slot... + + + + + Size Constraints + + + + + Set Minimum Width + + + + + Set Minimum Height + + + + + Set Minimum Size + + + + + Set Maximum Width + + + + + Set Maximum Height + + + + + Set Maximum Size + + + + + Edit ToolTip + + + + + Edit WhatsThis + + + + + no signals available + + + + + Set size constraint on %n widget(s) + + + + + + + qdesigner_internal::QDesignerWidgetBox + + + + Unexpected element <%1> + + + + + A parse error occurred at line %1, column %2 of the XML code specified for the widget %3: %4 +%5 + + + + + The XML code specified for the widget %1 does not contain any widget elements. +%2 + + + + + An error has been encountered at line %1 of %2: %3 + + + + + Unexpected element <%1> encountered when parsing for <widget> or <ui> + + + + + Unexpected end of file encountered when parsing widgets. + + + + + A widget element could not be found. + + + + + qdesigner_internal::QtGradientStopsController + + + H + + + + + S + + + + + V + + + + + + Hue + + + + + Sat + + + + + Val + + + + + Saturation + + + + + Value + + + + + R + + + + + G + + + + + B + + + + + Red + + + + + Green + + + + + Blue + + + + + qdesigner_internal::RichTextEditorDialog + + + Edit text + + + + + Rich Text + + + + + Source + + + + + &OK + + + + + &Cancel + + + + + qdesigner_internal::RichTextEditorToolBar + + + Bold + + + + + CTRL+B + + + + + Italic + + + + + CTRL+I + + + + + Underline + + + + + CTRL+U + + + + + Left Align + + + + + Center + + + + + Right Align + + + + + Justify + + + + + Superscript + + + + + Subscript + + + + + Insert &Link + + + + + Insert &Image + + + + + qdesigner_internal::ScriptDialog + + + Edit script + + + + + <html>Enter a Qt Script snippet to be executed while loading the form.<br>The widget and its children are accessible via the variables <i>widget</i> and <i>childWidgets</i>, respectively. + + + + + Syntax error + + + + + qdesigner_internal::ScriptErrorDialog + + + Script errors + + + + + qdesigner_internal::SignalSlotDialog + + + There is already a slot with the signature '%1'. + + + + + There is already a signal with the signature '%1'. + + + + + %1 - Duplicate Signature + + + + + + Signals/Slots of %1 + + + + + qdesigner_internal::SignalSlotEditorPlugin + + + Edit Signals/Slots + + + + + F4 + + + + + qdesigner_internal::SignalSlotEditorTool + + + Edit Signals/Slots + + + + + qdesigner_internal::StatusBarTaskMenu + + + Remove + + + + + qdesigner_internal::StringListEditorButton + + + Change String List + + + + + qdesigner_internal::StyleSheetEditorDialog + + + + Valid Style Sheet + + + + + Add Resource... + + + + + Add Gradient... + + + + + Add Color... + + + + + Add Font... + + + + + Edit Style Sheet + + + + + Invalid Style Sheet + + + + + qdesigner_internal::TabOrderEditor + + + Start from Here + + + + + Restart + + + + + Tab Order List... + + + + + Tab Order List + + + + + Tab Order + + + + + qdesigner_internal::TabOrderEditorPlugin + + + Edit Tab Order + + + + + qdesigner_internal::TabOrderEditorTool + + + Edit Tab Order + + + + + qdesigner_internal::TableWidgetEditor + + + + Properties &>> + + + + + Edit Table Widget + + + + + &Items + + + + + Table Items + + + + + New Column + + + + + New Row + + + + + &Columns + + + + + &Rows + + + + + Properties &<< + + + + + qdesigner_internal::TableWidgetTaskMenu + + + Edit Items... + + + + + qdesigner_internal::TemplateOptionsWidget + + + Pick a directory to save templates in + + + + + Form + + + + + Additional Template Paths + + + + + + ... + + + + + qdesigner_internal::TextEditTaskMenu + + + Edit HTML + + + + + Change HTML... + + + + + Edit Text + + + + + Change Plain Text... + + + + + qdesigner_internal::TextEditor + + + Choose Resource... + + + + + Choose File... + + + + + ... + + + + + Choose a File + + + + + qdesigner_internal::ToolBarEventFilter + + + Insert Separator before '%1' + + + + + Append Separator + + + + + Remove action '%1' + + + + + Remove Toolbar '%1' + + + + + Insert Separator + + + + + qdesigner_internal::TreeWidgetEditor + + + New Column + + + + + &Columns + + + + + Per column properties + + + + + Common properties + + + + + + New Item + + + + + + New Subitem + + + + + Properties &<< + + + + + + Properties &>> + + + + + Edit Tree Widget + + + + + &Items + + + + + Tree Items + + + + + 1 + + + + + &New + + + + + New &Subitem + + + + + Delete Item + + + + + &Delete + + + + + Move Item Left (before Parent Item) + + + + + L + + + + + Move Item Right (as a First Subitem of the Next Sibling Item) + + + + + R + + + + + Move Item Up + + + + + U + + + + + Move Item Down + + + + + D + + + + + qdesigner_internal::TreeWidgetTaskMenu + + + Edit Items... + + + + + qdesigner_internal::WidgetBox + + + Warning: Widget creation failed in the widget box. This could be caused by invalid custom widget XML. + + + + + qdesigner_internal::WidgetBoxTreeWidget + + + Scratchpad + + + + + Custom Widgets + + + + + Expand all + + + + + Collapse all + + + + + List View + + + + + Icon View + + + + + Remove + + + + + Edit name + + + + + qdesigner_internal::WidgetDataBase + + + A custom widget plugin whose class name (%1) matches that of an existing class has been found. + + + + + qdesigner_internal::WidgetEditorTool + + + Edit Widgets + + + + + qdesigner_internal::WidgetFactory + + + The custom widget factory registered for widgets of class %1 returned 0. + + + + + A class name mismatch occurred when creating a widget using the custom widget factory registered for widgets of class %1. It returned a widget of class %2. + + + + + %1 Widget + + + + + The current page of the container '%1' (%2) could not be determined while creating a layout.This indicates an inconsistency in the ui-file, probably a layout being constructed on a container widget. + + + + + Attempt to add a layout to a widget '%1' (%2) which already has an unmanaged layout of type %3. +This indicates an inconsistency in the ui-file. + + + + + Cannot create style '%1'. + + + + + qdesigner_internal::WizardContainerWidgetTaskMenu + + + Next + + + + + Back + + + + + qdesigner_internal::ZoomMenu + + + %1 % + Zoom factor + + + + + qdesigner_internal::ZoomablePreviewDeviceSkin + + + &Zoom + + + + diff --git a/translations/linguist_hu.ts b/translations/linguist_hu.ts new file mode 100644 index 0000000..aaff893 --- /dev/null +++ b/translations/linguist_hu.ts @@ -0,0 +1,2014 @@ + + + + + AboutDialog + + + Qt Linguist + Qt Linguist + + + + BatchTranslationDialog + + + Batch Translation of '%1' - Qt Linguist + '%1' Qt Linguist egy adat fordítása + + + + Searching, please wait... + Keresés, kérem várjon... + + + + &Cancel + &Mégse + + + + Linguist batch translator + Linguist köteg fordító + + + + Batch translated %n entries + + %n adat belépés lefordítva + + + + + Qt Linguist - Batch Translation + Qt Linguist adat fordítás + + + + Options + Opciók + + + + Set translated entries to finished + Lefordított bevitelek befejezettre állítása + + + + Retranslate entries with existing translation + Bevitelek újrafordítása létező fordításokkal + + + + Translate also finished entries + Befejezett belépéseknek is a lefordítása + + + + Phrase book preference + Fázis könyv beállítások + + + + Move up + Felfelé mozgatás + + + + Move down + Lefelé mozgatás + + + + &Run + &Futtatás + + + + Cancel + Mégse + + + + Note that the modified entries will be reset to unfinished if 'Set translated entries to finished' above is unchecked + Ne felejtse el, hogy a módosított belépések újra lesznek indítva befejezetlenre, ha a 'lefordított bevitelek befejezettre állítása' felül meg van jelölve + + + + The batch translator will search through the selected phrase books in the order given above + A köteg fordító a kiválasztott fázis könyvek között fog keresni, a fent megadott sorrendben + + + + DataModel + + + <qt>Duplicate messages found in '%1': + <qt>Dupliált üzenetek találhatóak a(z) '%1'-ben: + + + + + <p>[more duplicates omitted] + <p>[többi duplikáció kihagyása] + + + + <p>* ID: %1 + <p>* Azonosító: %1 + + + + <p>* Context: %1<br>* Source: %2 + <p>* Szövegösszefüggés: %1<br>* Forrás: %2 + + + + <br>* Comment: %3 + <br>* Megjegyzés: %3 + + + + Linguist does not know the plural rules for '%1'. +Will assume a single universal form. + A Linguist nem ismeri a többes számú szabályokat a '%1'-re. Egy egyszerű univerzális formát fog feltételezni. + + + + Cannot create '%2': %1 + Nem lehet létrehozni '%2': %1 + + + + Universal Form + Univerzális forma + + + + ErrorsView + + + Accelerator possibly superfluous in translation. + A gyorsítás valószínűleg nélkülözhető a fordításban. + + + + Accelerator possibly missing in translation. + A gyorsítás valószínűleg hiányzik a fordításban. + + + + Translation does not end with the same punctuation as the source text. + A fordítás nem ugyanazzal az írásjellel végződik, mint a forrás szöveg. + + + + A phrase book suggestion for '%1' was ignored. + A(z) '%1'-re tett fáziskönyv ajánlat mellőzve lett. + + + + Translation does not refer to the same place markers as in the source text. + Nem ugyanazok a hely megjelölők találhatóak a fordításban, mint a forrás szövegben. + + + + Translation does not contain the necessary %n place marker. + A fordítás nem tartalmazza a szükséges %n hely megjelölőket. + + + + Unknown error + Ismeretlen hiba + + + + FindDialog + + + This window allows you to search for some text in the translation source file. + Ez az ablak engedélyezi, hogy szöveget keresses a fordítás forrás fájlban. + + + + Type in the text to search for. + Gépelje be szövegbe, amit keres.. + + + + Options + Opciók + + + + Source texts are searched when checked. + Forrás szövegek keresési ellenőrzéskor. + + + + Translations are searched when checked. + Fordítások keresése ellenőrzéskor. + + + + Texts such as 'TeX' and 'tex' are considered as different when checked. + 'TeX' és 'tex' szövegek különbözőként kezelése bejelöléskor. + + + + Comments and contexts are searched when checked. + Megjegyzések és tartalmak keresése bejelöléskor. + + + + Find + Keresés + + + + + &Find what: + Ennek &keresése: + + + + &Source texts + &Forrás szövegek + + + + &Translations + &Fordítások + + + + &Match case + &Egyezés + + + + &Comments + &Kommentek + + + + Ignore &accelerators + &Gyorsítások mellőzése + + + + Click here to find the next occurrence of the text you typed in. + Kattintson ide a begépelt szöveg következő előfordulásának megkereséséhez. + + + + Find Next + Következő keresése + + + + Click here to close this window. + Kattintson ide az ablak bezárásához. + + + + Cancel + Mégse + + + + + Choose Edit|Find from the menu bar or press Ctrl+F to pop up the Find dialog + Válassza ki a Szerkesztés/Keresés opciót a menüből vagy nyomja le a Ctrl+F billentyűket a keresési párbeszédablak felugrásához + + + + + FormMultiWidget + + + Alt+Delete + translate, but don't change + fordítsd, de ne változtasd + ALT+Delete + + + + Shift+Alt+Insert + translate, but don't change + Fordítsd, de ne változtasd. + Shift+Alt+Insert + + + + Alt+Insert + translate, but don't change + Alt+Insert + + + + Confirmation - Qt Linguist + Megerősítés - Qt Linguist + + + + Delete non-empty length variant? + Törölje az 0 hosszúságú változatok? + + + + LRelease + + + Dropped %n message(s) which had no ID. + + %n üzenez eldobva, melyek nem rendelkeztek azonosítóval. + + + + + Excess context/disambiguation dropped from %n message(s). + + Fölösleges szövegösszefüggés/egyértelműsítés törlése %n üzenetből. + + + + + Generated %n translation(s) (%1 finished and %2 unfinished) + + + %n fordítás legenerálása (%1 befejezett és %2 befejezetlen) + + + + + Ignored %n untranslated source text(s) + + + %n lefordítatlan forrás szöveg mellőzése + + + + + MainWindow + + + MainWindow + FőAblak + + + + &Phrases + &Fázisok + + + + &Close Phrase Book + &Fázis könyvek bezárása + + + + &Edit Phrase Book + Fázis könyvek &szerkesztése + + + + &Print Phrase Book + &Fázis könyvek nyomtatása + + + + V&alidation + &Érvényesítés + + + + &View + &Nézet + + + + Vie&ws + &Nézetek + + + + &Toolbars + &Eszköztár + + + + &Help + &Súgó + + + + &Translation + &Fordítások + + + + &File + &Fájl + + + + &Edit + &Szerkesztés + + + + &Open... + &Megnyitás... + + + + Open a Qt translation source file (TS file) for editing + Egy Qt fordítási forrás fájl (TS fájl) megnyitása szerkesztésre + + + + Ctrl+O + Ctrl+O + + + + E&xit + &Kilépés + + + + Close this window and exit. + Ablak bezárása és kilépés. + + + + Ctrl+Q + Ctrl+Q + + + + + &Save + &Mentés + + + + Save changes made to this Qt translation source file + Változtatások elmentése a Qt fordítási forrás fájlban + + + + Move to the previous unfinished item. + Az előző befejezetlen elemre mozgatás. + + + + Move to the next unfinished item. + A következő befejezetlen elemre mozgatás. + + + + Move to the previous item. + Az előző elemre mozgatás. + + + + Move to the next item. + A következő elemre mozgatás. + + + + Mark this item as done and move to the next unfinished item. + Az elem készre jelölése és a következő befejezetlen elemre mozgás. + + + + Copy from source text + Másolás forrás szövegből + + + + Toggle the validity check of accelerators, i.e. whether the number of ampersands in the source and translation text is the same. If the check fails, a message is shown in the warnings window. + Gyorsítások érvényesség ellenőrzésének kapcsolgatása, lásd vajon az et jelek száma megegyezik-e a a forrás és lefordított szövegben. Ha ez az ellenőrzés hibásan zárul le, a figyelmeztető ablakban egy üzenet tűnik fel. + + + + Toggle the validity check of ending punctuation. If the check fails, a message is shown in the warnings window. + A végződő írásjelek érvényesség ellenőrzésének kapcsolgatása. Ha ez az ellenőrzés nem sikerült, akkor egy üzenet bukkan fel a figyelmeztető ablakban. + + + + Toggle checking that phrase suggestions are used. If the check fails, a message is shown in the warnings window. + Fázis ajánlások ellenőrzésének kapcsolgatása. Ha az ellenőrzés sikertelen, akkor egy üzenet bukkan fel a figyelmeztető ablakban. + + + + Toggle the validity check of place markers, i.e. whether %1, %2, ... are used consistently in the source text and translation text. If the check fails, a message is shown in the warnings window. + A hely megjelelölők érvényesség ellenőrzésének kapcsolgatása, lásd vajon a(z) %1, %2.. következetesen vannak-e használva a forrás és lefordított szövegben. Ha az ellenőrzés sikertelen, egy üzenet bukkan fel a figyelmeztető ablakban. + + + + Open Read-O&nly... + &Csak olvasható megnyitása... + + + + &Save All + Az összes &mentése + + + + Ctrl+S + Ctrl+S + + + + + + Save &As... + &Másként mentés... + + + + Save As... + Másként mentés... + + + + Save changes made to this Qt translation source file into a new file. + A változtatások egy új fájlba mentése, amik ebben a Qt fordítási forrás fájlban keletkeztek. + + + + &Release + &Kiadás + + + + Create a Qt message file suitable for released applications from the current message file. + Qt üzenez fájl létrehozása az aktuális üzenet fájlból, ami alkalmas a kiadásra. + + + + &Print... + &Nyomtatás... + + + + Ctrl+P + Ctrl+P + + + + &Undo + &Visszacsinálás + + + + Recently Opened &Files + &Utoljára megnyitott &fájlok + + + + Save + Mentés + + + + Print a list of all the translation units in the current translation source file. + Az összes fordítási egység kinyomtatása az aktuális fordítási forrás fájlban. + + + + Undo the last editing operation performed on the current translation. + Az utoljára szerkesztett művelet visszavonása az aktuális fordításon. + + + + Ctrl+Z + Ctrl+Z + + + + &Redo + &Helyreállítás + + + + Redo an undone editing operation performed on the translation. + Szerkesztő művelet helyreállítása és visszavonása, ami az aktuális fordításon lett végrehajtva. + + + + Ctrl+Y + Ctrl+Y + + + + Cu&t + &Kivágás + + + + Copy the selected translation text to the clipboard and deletes it. + A kiválasztott fordítási szöveg vágólapra másolása és törlése. + + + + Ctrl+X + Ctrl+X + + + + &Copy + &Másolás + + + + Copy the selected translation text to the clipboard. + A kiválaszott fordítási szöveg vágólapra másolása. + + + + Ctrl+C + Ctrl+C + + + + &Paste + &Beillesztés + + + + Paste the clipboard text into the translation. + A vágólapon levő szöveg fordításba illesztése. + + + + Ctrl+V + Ctrl+V + + + + Select &All + Az &összes kiválasztása + + + + Select the whole translation text. + Az egész fordítási szöveg kiválasztása. + + + + Ctrl+A + Ctrl+A + + + + &Find... + &Keresés... + + + + Search for some text in the translation source file. + Néhány szövegre keresés a fordítási forrás fájlban. + + + + Ctrl+F + Ctrl+F + + + + Find &Next + &Következő keresése + + + + Continue the search where it was left. + A keresés folytatása ott, ahol abba lett hagyva. + + + + F3 + F3 + + + + &Prev Unfinished + Az &előző befejezetlen + + + + Close + Bezárás + + + + &Close All + Az összes &bezárása + + + + Ctrl+W + Ctrl+W + + + + Ctrl+K + Ctrl+K + + + + &Next Unfinished + &Következő befejezetlen + + + + P&rev + &Előző + + + + Ctrl+Shift+K + Ctrl+Shift+K + + + + Ne&xt + &Következő + + + + &Done and Next + &Kész és Következő + + + + Copies the source text into the translation field. + Forrás szövegek fordítási mezőbe másolása. + + + + Ctrl+B + Ctrl+B + + + + &Accelerators + &Gyorsítások + + + + &Ending Punctuation + &Vég írásjelek + + + + &Phrase matches + &Fázis egyezés + + + + Place &Marker Matches + Hely &megjelölők egyezései + + + + &New Phrase Book... + &Új fázis könyv... + + + + Create a new phrase book. + Egy új fázis könyv létrehozása. + + + + Ctrl+N + Ctrl+N + + + + &Open Phrase Book... + Fázis könyv &megnyitása... + + + + Open a phrase book to assist translation. + Fáris könyv megnyitása a fordítás támogatásával. + + + + Ctrl+H + Ctrl+H + + + + &Reset Sorting + &Rendezés helyreállítása + + + + Sort the items back in the same order as in the message file. + Az elemek visszarendezése ugyanabba a sorrendben, ahogy az üzenet fájlban található. + + + + &Display guesses + Feltételezések &kijelzése + + + + Set whether or not to display translation guesses. + Annak beállítása, hogy vajon kijelezze a fordítási feltételezéseket vagy sem. + + + + &Statistics + &Statisztikák + + + + Display translation statistics. + Fordítási statisztikák kijelzése. + + + + &Manual + &Kézi + + + + F1 + F1 + + + + About Qt Linguist + Qt Linguist-ról + + + + About Qt + Qt-ról + + + + Display information about the Qt toolkit by Trolltech. + Információ megjelenítése a Trolltech Qt eszközrendszeréről. + + + + &What's This? + &Mi ez? + + + + What's This? + Mi ez? + + + + Enter What's This? mode. + Mi ez? beviteli mód. + + + + Shift+F1 + Shift+F1 + + + + &Search And Translate... + &Keresés és fordítás... + + + + Replace the translation on all entries that matches the search source text. + A fordítások kicserélése az összes olyan helyen, ahol az megegyezik a keresett forrás szöveggel. + + + + + &Batch Translation... + &Köteg fordítás... + + + + Batch translate all entries using the information in the phrase books. + Köteg fordítás mindenhol, ahol az információ a fázis könyvekben van haszálva. + + + + + + Release As... + Kiadás, mint... + + + + + This is the application's main window. + Ez az alkalmazás fő ablaka. + + + + + Source text + Forrás szöveg + + + + + Index + Index + + + + + Context + Összefüggés + + + + Items + Elemek + + + + This panel lists the source contexts. + Ez a panel kilistázza a forrás összefüggéseket. + + + + Strings + Sztringek + + + + Phrases and guesses + Kommunikációk és feltételezések + + + + Sources and Forms + Források és formák + + + + Warnings + Figyelmeztetések + + + + MOD + status bar: file(s) modified + MOD + + + + Loading... + Betöltés... + + + + + Loading File - Qt Linguist + Fájl betöltése - Qt Linguist + + + + The file '%1' does not seem to be related to the currently open file(s) '%2'. + +Close the open file(s) first? + A(z) '%1' fájl nem tartozik hozzá egyetlen aktuálisan megnyitott '%2' fájlhoz sem. + +Bezárja először a megnyitott fájl(oka)t? + + + + The file '%1' does not seem to be related to the file '%2' which is being loaded as well. + +Skip loading the first named file? + A(z) '%1' fájl nem tartozik egyetlen '%2' fájlhoz sem, amelyik ugyanúgy be lett töltve. + +Azt első megnevezett fájl betöltésének kihagyása? + + + + %n translation unit(s) loaded. + + %n fordítási egység betöltése. + + + + + Related files (%1);; + Hozzákapcsolodó fájlok (%1);; + + + + Open Translation Files + Fordítási fájlok megnyitása + + + + + File saved. + Fájl elmentve. + + + + + + Release + Kiadás + + + + Qt message files for released applications (*.qm) +All files (*) + Qt üzenet fájlok a kiadott alkalmazásra (*.qm) +Az összes fájl(*) + + + + + File created. + Fál létrehozva. + + + + + Printing... + Nyomtatás... + + + + Context: %1 + Összefüggés: %1 + + + + finished + Befejezve + + + + unresolved + Nincs megoldva + + + + obsolete + Elavulás + + + + + Printing... (page %1) + Nyomtatás... (%1 lap) + + + + + Printing completed + Nyomtatás teljesítve + + + + + Printing aborted + Nyomtatás megszakítva + + + + Search wrapped. + Keresés elrejtése. + + + + + + + + + + + + + Qt Linguist + Qt Linguist + + + + + Cannot find the string '%1'. + A(z) '%1' sztring nem található. + + + + Search And Translate in '%1' - Qt Linguist + Keresés és fordítás a(z) '%1'-ben - Qt Linguist + + + + + + Translate - Qt Linguist + Qt Linguist fordítása + + + + Translated %n entry(s) + + %n bevitel lefordítva + + + + + No more occurrences of '%1'. Start over? + Nem található '%1' több előfordulása. Előlről kezdi? + + + + Create New Phrase Book + Új kommunikációs könyv létrehozása + + + + Qt phrase books (*.qph) +All files (*) + Qt kommunikációs könyv (*.qph) +Az összes fájl (*) + + + + Phrase book created. + Kommunikációs könyv létrehozva. + + + + Open Phrase Book + Kommunikációs könyv megnyitása + + + + Qt phrase books (*.qph);;All files (*) + Qt kommunikációs könyvek (*.qpm);;Az összes fájl (*) + + + + %n phrase(s) loaded. + + %n kommunikáció betöltése. + + + + + + + Add to phrase book + Kommunikációs könyv hozzáadása + + + + No appropriate phrasebook found. + Nem található megfelelő kommunikációs könyv. + + + + Adding entry to phrasebook %1 + Új elem hozzáadása a(z) %1 fázis fáziskönyvhöz + + + + Select phrase book to add to + Kommunikációs könyv kiválasztása hozzáadásra + + + + Unable to launch Qt Assistant (%1) + Nem lehet elindítani a Qt Assistant (%1) + + + + Version %1 + %1 Verzió + + + + <center><img src=":/images/splash.png"/></img><p>%1</p></center><p>Qt Linguist is a tool for adding translations to Qt applications.</p><p>Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). + <center><img src=":/images/splash.png"/></img><p>%1</p></center><p>Qt Linguist egy olyan eszköz, amelyekkel fordítások adhat hozzá a Qt alkalmazásokhoz.</p><p>Szerzői jog(C) 2010 Nokia Vállalat és/vagy leányvállalatai. + + + + Do you want to save the modified files? + El szeretné menteni a módosított fájlokat? + + + + Do you want to save '%1'? + El szeretné menteni a(z) %1-t ? + + + + Qt Linguist[*] + Qt Linguist[*] + + + + %1[*] - Qt Linguist + %1[*] - Qt Linguist + + + + + No untranslated translation units left. + Nem maradtak lefordítatlan fordítások. + + + + &Window + &Ablak + + + + Minimize + Minimalizálás + + + + Ctrl+M + Ctrl+M + + + + Display the manual for %1. + A manuál megjelenítése %1-re vonatkozóan. + + + + Display information about %1. + Információ megjelenítése a(z) %1-ről. + + + + &Save '%1' + '%1' &mentése + + + + Save '%1' &As... + '%1' &másként mentése... + + + + Release '%1' + '%1' kiadása + + + + Release '%1' As... + '%1' másként kiadása... + + + + &Close '%1' + '%1' &bezárása + + + + + &Close + &Bezárás + + + + Save All + Az összes mentése + + + + + &Release All + Az összes &kiadása + + + + Close All + Az összes bezárása + + + + Translation File &Settings for '%1'... + Fordítási fájlok &beállítása erre '%1'... + + + + &Batch Translation of '%1'... + A(z) '%1' &köteg fordítása... + + + + Search And &Translate in '%1'... + Keresés és &fordítás '%1'-ben... + + + + Search And &Translate... + Keresés és &fordítás... + + + + + File + Fájl + + + + + Edit + Szerkesztés + + + + + Translation + Fordítás + + + + + Validation + Érvényesítés + + + + + Help + Súgó + + + + Cannot read from phrase book '%1'. + Nem lehet a(z) '%1' kommunikációs könyvből olvasni. + + + + Close this phrase book. + A kommunikációs könyv bezárása. + + + + Enables you to add, modify, or delete entries in this phrase book. + Hozzáadás, módosítás, vagy törlés engedélyezése ebben a kommunikációs könyvben. + + + + Print the entries in this phrase book. + Az összes bevitel kinyomtatása ebben a társalgási szótárban. + + + + Cannot create phrase book '%1'. + Nem lehet a '%1' társalgási szótárat létrehozni. + + + + Do you want to save phrase book '%1'? + El szeretné menteni a '%1' társalgási szótárat? + + + + All + Mind + + + + Open/Refresh Form &Preview + Forma megnyitása/felfrissítése &nézet + + + + Form Preview Tool + Forma előnézeti eszköz + + + + F5 + F5 + + + + + Translation File &Settings... + Fordítási fájl &beállítások... + + + + &Add to Phrase Book + Társalgási szótárhoz &hozzáadás + + + + Ctrl+T + Ctrl+T + + + + Ctrl+J + Ctrl+J + + + + Ctrl+Shift+J + Ctrl+Shift+J + + + + Previous unfinished item + Előző befejezetlen elem + + + + Next unfinished item + Következő befejezetlen elem + + + + Move to previous item + Az előző befejezetlen elemre mozgás + + + + Next item + Következő elem + + + + Mark item as done and move to the next unfinished item + Az elem készként jelölése és a következő befejezetlen elemre mozgatás + + + + Copies the source text into the translation field + A forrás szöveg fordítási szövegbe másolása + + + + Toggle the validity check of accelerators + Gyorsítások érvényesség ellenőrzésének kapcsolgatása + + + + Toggle the validity check of ending punctuation + Vég írásjelek érvényesség ellenőrzésének kapcsolgatása + + + + Toggle checking that phrase suggestions are used + A használt társalgási ajánlások ellenőrzésének kapcsolgatása + + + + Toggle the validity check of place markers + Hely megjelölők érvényesség vizsgálatának kapcsolgatása + + + + Create a Qt message file suitable for released applications from the current message file. The filename will automatically be determined from the name of the TS file. + Egy Qt üzenet fájl létrehozása az aktuális üzenet fájlból, amely megfelelő az alkalmazás kiadásaira. A fájlnév TS fájl nevéből lesz automatikusan meghatározva. + + + + Length Variants + Hossz változatok + + + + MessageEditor + + + + This is the right panel of the main window. + Ez a fő ablak jobb panelja. + + + + + Russian + Orosz + + + + German + Német + + + + Japanese + Japán + + + + French + Francia + + + + Polish + Lengyel + + + + Chinese + Kínai + + + + This whole panel allows you to view and edit the translation of some source text. + Ez az egész pabel engedélyezi néhány forrás szöveg fordításának megtekintését és szerkesztését. + + + + Source text + Forrás szöveg + + + + This area shows the source text. + Ez a terület mutatja a forrás szöveget. + + + + Source text (Plural) + Forrás szöveg (Többesszám) + + + + This area shows the plural form of the source text. + Ez a terület mutatja a forrás szöveg többesszámú formáját. + + + + Developer comments + Fejlesztői megjegyzések + + + + This area shows a comment that may guide you, and the context in which the text occurs. + Ez a terület mutatja a megjegyzéseket, ami segítheti Önt, és az összefüggéseket, hogy melyik szövegben fordul elő. + + + + Here you can enter comments for your own use. They have no effect on the translated applications. + Itt hozzáadhatja a saját megjegyzését saját használatra. Nincsen hatásuk a lefordított alkalmazásokon. + + + + %1 translation (%2) + %1 fordítás (%2) + + + + This is where you can enter or modify the translation of the above source text. + Ez az a hely, ahol beviheti és módosíthatja a fentebb található forrás szöveg fordítását. + + + + %1 translation + %1 fordítás + + + + %1 translator comments + %1 fordító megjegyzések + + + + '%1' +Line: %2 + '%1' +Sor: %2 + + + + MessageModel + + + Completion status for %1 + %1 elkészítési státusza + + + + <file header> + <file header> + + + + <context comment> + <context comment> + + + + <unnamed context> + <unnamed context> + + + + MsgEdit + + + + This is the right panel of the main window. + Ez a fő ablak jobb panelja. + + + + + PhraseBookBox + + + + Go to Phrase > Edit Phrase Book... The dialog that pops up is a PhraseBookBox. + Társalgás -> Társalgási szótár szerkesztése... A felbukkanó ablak egy TársalgásiSzótárDoboz. + + + + + (New Entry) + (Új bevitel) + + + + %1[*] - Qt Linguist + %1[*] - Qt Linguist + + + + Qt Linguist + Qt Linguist + + + + Cannot save phrase book '%1'. + Nem lehet elmenteni a(z) '%1' társalgási szótárat. + + + + Edit Phrase Book + Társalgási szótár szerkesztése + + + + This window allows you to add, modify, or delete entries in a phrase book. + Ez az ablak engedélyezi új bevitelek hozzáadását, módosítását, vagy törlését egy társalgási szótárban. + + + + &Translation: + &Fordítás: + + + + This is the phrase in the target language corresponding to the source phrase. + Ez a forrás társalgás megfelelője a cél nyelvben. + + + + S&ource phrase: + &Forrás társalgás: + + + + This is a definition for the source phrase. + Ez egy forrás fordítás definíció. + + + + This is the phrase in the source language. + Ez egy társalgás a forrás nyelvben. + + + + &Definition: + &Definíció: + + + + Click here to add the phrase to the phrase book. + Kattintson ide a társalgás hozzáadásához a társalgási könyvben. + + + + &New Entry + &Új bevitel + + + + Click here to remove the entry from the phrase book. + Kattintson ide a bevitel társalgási könyvből való eltávolításához. + + + + &Remove Entry + Bevitel &eltávolítása + + + + Settin&gs... + &Beállítások... + + + + Click here to save the changes made. + Kattintson ide a változtatások elmentéséhez. + + + + &Save + &Mentés + + + + Click here to close this window. + Kattintson ide az ablak bezárásához. + + + + Close + Bezárás + + + + PhraseModel + + + Source phrase + Forrás társalgás + + + + Translation + Fordítás + + + + Definition + Definíció + + + + PhraseView + + + Insert + Beszúrás + + + + Edit + Szerkesztés + + + + Guess (%1) + Feltételezés (%1) + + + + Guess + Feltételezés + + + + QObject + + + Compiled Qt translations + Lefordított Qt fordítások + + + + Translation files (%1);; + Fordítási fájlok (%1);; + + + + All files (*) + Fájlok hozzáadása ( *) + + + + + + + + + + Qt Linguist + Qt Linguist + + + + GNU Gettext localization files + GNU Gettext lokalizációs fájlok + + + + Qt translation sources (format 1.1) + Qt fordítási forrása (1.1 formátum) + + + + Qt translation sources (format 2.0) + Qt fordítás források (2.0 formátum) + + + + Qt translation sources (latest format) + Qt fordítási források (legutolsó formátum) + + + + XLIFF localization files + XLIFF lokalizációs fájlok + + + + Qt Linguist 'Phrase Book' + Qt Linguist 'Társalgási Könyv' + + + + SourceCodeView + + + <i>Source code not available</i> + <i>A forrás kód nem elérhető</i> + + + + <i>File %1 not available</i> + <i>A(z) %1 fájl nem elérhető</i> + + + + <i>File %1 not readable</i> + <i>A(z) %1 fájl nem olvasható</i> + + + + Statistics + + + Statistics + Statisztikák + + + + Translation + Fordítás + + + + Source + Forrás + + + + 0 + 0 + + + + Words: + Szavak: + + + + Characters: + Karakterek: + + + + Characters (with spaces): + Karakterek (szóközökkel): + + + + Close + Bezárás + + + + TranslateDialog + + + This window allows you to search for some text in the translation source file. + Ez az ablak engedélyezi, hogy rákeressen néhány szövegre a fordítási forrás fájlban. + + + + Type in the text to search for. + Gépelje be a keresni kívánt szöveget. + + + + Find &source text: + &Forrás szöveg keresése: + + + + &Translate to: + &Fordítás erre: + + + + Search options + Keresés opciók + + + + Texts such as 'TeX' and 'tex' are considered as different when checked. + 'TeX' és 'text' szövegek különbözően kezelése bejelöléskor. + + + + Match &case + Megegyező &eset + + + + Mark new translation as &finished + Új fordítások &befejezettként jelölése + + + + Click here to find the next occurrence of the text you typed in. + Kattintson ide a begépelt szöveg következő előfordulásának megkereséséhez. + + + + Find Next + Következő keresése + + + + Translate + Fordítás + + + + Translate All + Az összes fordítása + + + + Click here to close this window. + Kattintson ide az ablak bezárásához. + + + + Cancel + Mégse + + + + TranslationSettingsDialog + + + Any Country + Bármeny ország + + + + + Settings for '%1' - Qt Linguist + '%1'-re állítás - Qt Linguist + + + + Source language + Forrás nyelv + + + + Language + Nyelv + + + + Country/Region + OrszágRégió + + + + Target language + Cél nyelv + + + diff --git a/translations/qt_help_hu.ts b/translations/qt_help_hu.ts new file mode 100644 index 0000000..3fbe0e9 --- /dev/null +++ b/translations/qt_help_hu.ts @@ -0,0 +1,298 @@ + + + + + QCLuceneResultWidget + + Search Results + Keresési eredmény + + + Note: + Megjegyzés: + + + The search results may not be complete since the documentation is still being indexed! + A keresési eredmény lehet, hogy nem teljes, mivel a dokumentáció még mindig indexelvan van! + + + Your search did not match any documents. + A keresési feltételeknek megfelően nincs találat. + + + (The reason for this might be that the documentation is still being indexed.) + (Ennek az oka az lehet, hogy a dokumentáció még mindig indexelve van.) + + + + QHelpCollectionHandler + + The collection file '%1' is not set up yet! + A(z) '%1'gyűjtemény fájl még nincs beállítva! + + + Cannot load sqlite database driver! + Nem lehet betölteni az sqlite adatbázis vezérlőt! + + + Cannot open collection file: %1 + Nem lehet megnyitni a gyűjtemény fájlt: %1 + + + Cannot create tables in file %1! + Nem lehet lehet a(z) %1 fájlban táblákat létrehozni! + + + The collection file '%1' already exists! + A(z) '%1' gyűjtemény fájl már létezik! + + + Unknown filter '%1'! + Ismeretlen szűrő '%1'! + + + Invalid documentation file '%1'! + Érvénytelen dokumentációs fájl '%1'! + + + Cannot register namespace '%1'! + Nem lehet regisztrálni a(z) '%1' névteret! + + + Cannot open database '%1' to optimize! + Nem lehet optimalizálásra megnyitni a(z) '%1' adatbázist! + + + Cannot create directory: %1 + Nem lehet a könyvtárat létrehozni: %1 + + + Cannot copy collection file: %1 + Nem lehet a gyűjtemény fájlt másolni: %1 + + + Cannot register filter %1! + Nem lehet regisztrálni a(z) %1 szűrőt! + + + Cannot open documentation file %1! + Nem lehet megnyitni a(z) %1 dokumentációs fájlt! + + + The namespace %1 was not registered! + A(z) %1 névteret nem regisztrálták! + + + Namespace %1 already exists! + A(z) %1 névtér már létezik! + + + + QHelpDBReader + + Cannot open database '%1' '%2': %3 + Nem lehet megnyitni az adatbázist '%1' '%2': %3 + + + + QHelpEngineCore + + The specified namespace does not exist! + A meghatározott névtér nem létezik! + + + + QHelpEngineCorePrivate + + Cannot open documentation file %1: %2! + Nem lehet megnyitni a(z) %1 fájlt: %2! + + + + QHelpGenerator + + Invalid help data! + Érvénytelen segítség adat! + + + No output file name specified! + Nincsen kimeneti fájl meghatározva! + + + Building up file structure... + Fájl struktúra felépítése... + + + The file %1 cannot be overwritten! + Nem lehet felülírni a(z) %1 fájlt! + + + Cannot open data base file %1! + Nem lehet megnyitni a(z) %1 adatbázis fájlt! + + + Cannot register namespace %1! + Nem lehet regisztrálni a(z) %1 névteret! + + + Insert custom filters... + Szokásos szűrő beszúrása... + + + Insert help data for filter section (%1 of %2)... + Segítség adatok beszúrása a szűrő szegmens számára (%1 %2-től)... + + + Documentation successfully generated. + A dokumentáció legenerálása sikeresen lezajlott. + + + Some tables already exist! + Néhány tábla már létezik! + + + Cannot create tables! + Nem lehet a táblákat létrehozni! + + + Cannot register virtual folder! + Nem lehet registrálni a virtuális dossziét! + + + Insert files... + Fájlok beszúrása... + + + The referenced file %1 must be inside or within a subdirectory of (%2). Skipping it. + A(z) %1 hivatkozott fájlnak a(z) (%2) alkönyvtárán belül kell elhelyezkednie. Ennek kihagyása. + + + The file %1 does not exist! Skipping it. + A(z) %1 fájl nem létezik! Ennek kihagyása. + + + Cannot open file %1! Skipping it. + Nem lehet megnyitni a(z) %1 fájlt! Ennek kihagyása. + + + The filter %1 is already registered! + A(z) %1 szűrő már regisztrálva van! + + + Cannot register filter %1! + Nem lehet regisztrálni a(z) %1 szűrőt! + + + Insert indices... + Indexek beszúrása... + + + Insert contents... + Tartalom beszúrása... + + + Cannot insert contents! + Nem lehet beszúrni a tartalmat! + + + Cannot register contents! + Nem lehet regisztrálni a tartalmat! + + + + QHelpSearchQueryWidget + + Search for: + Keresés erre: + + + Previous search + Előző keresése + + + Next search + Következő keresése + + + Search + Keresés + + + Advanced search + Összetett keresés + + + words <B>similar</B> to: + szavak <B>hasonlóak</B> ehhez: + + + <B>without</B> the words: + Ezen szavak <B>nélkül</B>: + + + with <B>exact phrase</B>: + <B>Pontos kifejezés</B>: + + + with <B>all</B> of the words: + Ezen szavak<B>mindegyikével</B>: + + + with <B>at least one</B> of the words: + <B>Legalább egy</B> a következő szavak közül: + + + + QHelpSearchResultWidget + + 0 - 0 of 0 Hits + 0 találat 0 - 0 + + + + QHelpSearchResultWidgetPrivate + + %1 - %2 of %3 Hits + %3 Találat %1 - %2 + + + + QObject + + Unknown token. + Ismeretlen jel. + + + Unknown token. Expected "QtHelpProject"! + Ismeretlen hel. "QtSegítségProjekt" várt! + + + Error in line %1: %2 + Hiba a(z) %1 sorban: %2 + + + A virtual folder must not contain a '/' character! + A virtuális dosszié nem tartalmazhat '/' karaktert! + + + A namespace must not contain a '/' character! + A névtér nem tartalmazhat '/' karaktert! + + + Missing namespace in QtHelpProject. + Hiányzó névtér a QtSegítségProjektben. + + + Missing virtual folder in QtHelpProject + Hiányzó virtuális dosszié a QtSegítségProjektben + + + Missing attribute in keyword at line %1. + Hiányzó attirbútum a kulcsszóban a(z) %1 sorban. + + + The input file %1 could not be opened! + Nem sikerült megnyitni a(z) %1 bemeneti fájlt! + + + diff --git a/translations/qt_hu.ts b/translations/qt_hu.ts new file mode 100644 index 0000000..ecc9826 --- /dev/null +++ b/translations/qt_hu.ts @@ -0,0 +1,10537 @@ + + + + + CloseButton + + + Close Tab + Lap bezárása + + + + FakeReply + + + Fake error ! + Hamisítási hiba ! + + + + Invalid URL + Érvénytelen URL + + + + Phonon:: + + + Notifications + Értesítések + + + + Music + Zene + + + + Video + Videó + + + + Communication + Kommunikáció + + + + Games + Játékok + + + + Accessibility + Hozzáférhetőség + + + + Phonon::AudioOutput + + + <html>The audio playback device <b>%1</b> does not work.<br/>Falling back to <b>%2</b>.</html> + <html>Az audió visszajátszó eszköz <b>%1</b> nem működik.<br/>Visszavonul ide: <b>%2</b>.</html> + + + + <html>Switching to the audio playback device <b>%1</b><br/>which just became available and has higher preference.</html> + <html>Az audió visszajátszó eszközre kapcsolás <b>%1</b><br/>amely éppen elérhetővé vált és magasabb prioritása van.</html> + + + + Revert back to device '%1' + Visszatérés a(z) '%1' eszközre + + + + Phonon::Gstreamer::Backend + + + Warning: You do not seem to have the package gstreamer0.10-plugins-good installed. + Some video features have been disabled. + Figyelmeztetés: Úgy tűnik nem telepítette megfelelően a gstreamer0.10-plugins csomagot. + Néhány videó tulajdonság tiltva van. + + + + Warning: You do not seem to have the base GStreamer plugins installed. + All audio and video support has been disabled + Figyelmeztetés: Úgy tűnik nem telepítette az alap GStreamer beépülő modulokat. + Az összes audió és videó támogatás tiltva van + + + + Phonon::Gstreamer::MediaObject + + + Cannot start playback. + +Check your GStreamer installation and make sure you +have libgstreamer-plugins-base installed. + Nem lehet elindítani a visszajátszást. + +Ellenőrizze le a GStreamer telepítését és győzödjön meg róla, hogy installálta a libgstreamer-plugins-base csomagot. + + + + A required codec is missing. You need to install the following codec(s) to play this content: %0 + Egy szükséges kódek hiányzik. A következő kódek(ek) telepítése szükséges ennek a tartalomnak a lejátszásához: %0 + + + + + + + + + + + Could not open media source. + Nem sikerült megnyitni a média forrást. + + + + Invalid source type. + Érvénytelen forrás típus. + + + + Could not locate media source. + Nem sikerült telepíteni a média forrást. + + + + Could not open audio device. The device is already in use. + Nem sikerült megnyitni az audió eszközt. Az eszköz már használatban van. + + + + Could not decode media source. + Nem sikerült dekódolni a forrást. + + + + Phonon::MMF + + + Audio Output + Audio kimenet + + + + The audio output device + A kimeneti audió eszköz + + + + Phonon::MMF::AudioEqualizer + + + Frequency band, %1 Hz + Frekvencia sáv, '%1' Hz + + + + Phonon::MMF::EffectFactory + + + Audio Equalizer + Audió hangszínszabályozó + + + + Bass Boost + Basszus erősítés + + + + Distance Attenuation + Távcsillapítás + + + + + Environmental Reverb + Környezeti visszhang + + + + Loudness + Hangosság + + + + Source Orientation + Forrás orientáció + + + + Stereo Widening + Sztereó szélesség + + + + Phonon::MMF::MediaObject + + + Media type could not be determined + Nem lehetet meghatározni a média típust + + + + Phonon::VolumeSlider + + + + + + Volume: %1% + Hangerő: %1% + + + + + + Use this slider to adjust the volume. The leftmost position is 0%, the rightmost is %1% + Használja ezt a csúszkát a hangerő szabályozásához. A legbaloldalib pozíció: 0%, a legjobboldalibb %1% + + + + Muted + Elnémított + + + + Q3Accel + + + %1, %2 not defined + %1, %2 nincs definiálva + + + + Ambiguous %1 not handled + Félreérthető %1 nincs lekezelve + + + + Q3DataTable + + + True + Igaz + + + + False + Hamis + + + + Insert + Beszúrás + + + + Update + Frissítés + + + + Delete + Törlés + + + + Q3FileDialog + + + Copy or Move a File + Egy fájl másolása vagy mozgatása + + + + Read: %1 + Olvasás: %1 + + + + + Write: %1 + Írás: %1 + + + + + Cancel + Mégse + + + + + + + All Files (*) + Az összes fájl (*) + + + + Name + Név + + + + Size + Méret + + + + Type + Típus + + + + Date + Dátum + + + + Attributes + Attribútumok + + + + + &OK + &OK + + + + Look &in: + &Benéz: + + + + + + File &name: + Fájl &név: + + + + File &type: + Fájl &típus: + + + + Back + Vissza + + + + One directory up + Egy könyvtárral kintebb + + + + Create New Folder + Új mappa létrehozása + + + + List View + Lista nézet + + + + Detail View + Részletes nézet + + + + Preview File Info + Fájl információ előnézet + + + + Preview File Contents + Fájl tartalom előnézet + + + + Read-write + Írás olvasás + + + + Read-only + Csak olvasható + + + + Write-only + Csak írható + + + + Inaccessible + Hozzáférhetetlen + + + + Symlink to File + Szimlink a fájlra + + + + Symlink to Directory + Szimlink a könyvtárra + + + + Symlink to Special + Szimlink egy speciálisra + + + + File + Fájl + + + + Dir + Könyvtár + + + + Special + Speciális + + + + + + Open + Megnyitás + + + + + Save As + Mentés másként + + + + + + &Open + &Megnyitás + + + + + &Save + &Mentés + + + + &Rename + &Átnevezés + + + + &Delete + &Törlés + + + + R&eload + &Újratöltés + + + + Sort by &Name + Rendezés &Név alapján + + + + Sort by &Size + Rendezés &Méret alapján + + + + Sort by &Date + Rendezés &Dátum alapján + + + + &Unsorted + &Rendezetlen + + + + Sort + Rendezés + + + + Show &hidden files + &Rejtett fájlok megjelenítése + + + + the file + a fájl + + + + the directory + a könyvtár + + + + the symlink + a szimlink + + + + Delete %1 + %1 törlése + + + + <qt>Are you sure you wish to delete %1 "%2"?</qt> + <qt>Biztos benne, hogy törölni kívánja a(z) %1 "%2"?</qt> + + + + &Yes + &Igen + + + + &No + &Nem + + + + New Folder 1 + Új mappa 1 + + + + New Folder + Új mappa + + + + New Folder %1 + Új mappa %1 + + + + Find Directory + Könyvtár keresése + + + + + Directories + Könyvtárak + + + + Directory: + Könyvtár: + + + + + Error + Hiba + + + + %1 +File not found. +Check path and filename. + %1 +Fájl nem található +Útvonal és fájlnév ellenőrzése. + + + + All Files (*.*) + Az összes fájl (*.*) + + + + Open + Megnyitás + + + + Select a Directory + Egy könyvtár kiválasztása + + + + Q3LocalFs + + + + Could not read directory +%1 + Nem sikerült a könytárat olvasni +%1 + + + + Could not create directory +%1 + Nem sikerült létrehozni a könyvtárat +%1 + + + + Could not remove file or directory +%1 + Nem sikerült eltávolítani egy fájlt vag könyvtárat +%1 + + + + Could not rename +%1 +to +%2 + Nem sikerült átnevezni ezt +%1 +erre +%2 + + + + Could not open +%1 + Nem sikerült megnyitni +%1 + + + + Could not write +%1 + Nem sikerült írni +%1 + + + + Q3MainWindow + + + Line up + Egy sorral feljebb + + + + Customize... + Egyéni... + + + + Q3NetworkProtocol + + + Operation stopped by the user + A felhasználó leállította a műveletet + + + + Q3ProgressDialog + + + + Cancel + Mégse + + + + Q3TabDialog + + + + OK + OK + + + + Apply + Alkalmazza + + + + Help + Súgó + + + + Defaults + Alapértelemett + + + + Cancel + Mégse + + + + Q3TextEdit + + + &Undo + &Visszavonás + + + + &Redo + &Helyreállítás + + + + Cu&t + &Kivágás + + + + &Copy + &Másolás + + + + &Paste + &Beillesztés + + + + Clear + Kiürítés + + + + + Select All + Az összes kiválasztása + + + + Q3TitleBar + + + System + Rendszer + + + + Restore up + Felállítás + + + + Minimize + Minimalizálás + + + + Restore down + Leállítás + + + + Maximize + Maximalizálás + + + + Close + Bezárás + + + + Contains commands to manipulate the window + Tartalmazza az ablak manipulációs parancsokat + + + + Puts a minimized window back to normal + Egy minimalizált ablak normálra visszatétele + + + + Moves the window out of the way + Az ablak félreeső helyre mozgatása + + + + Puts a maximized window back to normal + Maximalizált ablak normálra visszatétele + + + + Makes the window full screen + Az ablak maximális méretűvé tétele + + + + Closes the window + Az ablak bezárása + + + + Displays the name of the window and contains controls to manipulate it + Az ablak nevének megjelenítése és manipuláláshoz szükséges vezérlő elemek tartalmazása + + + + Q3ToolBar + + + More... + További... + + + + Q3UrlOperator + + + + + The protocol `%1' is not supported + A(z) '%1' protokoll nem támogatott + + + + The protocol `%1' does not support listing directories + A(z) '%1' protokoll nem támogatja a könyvtár listázást + + + + The protocol `%1' does not support creating new directories + A(z) '%1' protokoll nem támogatja az új könyvtárak létrehozását + + + + The protocol `%1' does not support removing files or directories + A(z) '%1' protokoll nem támogatja fájlok vagy könyvtárat áthelyezését + + + + The protocol `%1' does not support renaming files or directories + A(z) '%1' protokoll nem támogatja fájlok vagy könyvtárat átnevezését + + + + The protocol `%1' does not support getting files + A(z) '%1' protokoll nem támogatja fájlok szerzését + + + + The protocol `%1' does not support putting files + A(z) '%1' protokoll nem támogatja fájlok betevését + + + + + The protocol `%1' does not support copying or moving files or directories + A(z) '%1' protokoll nem támogatja fájlok vagy könyvtárak mozgatását vagy másolását + + + + + (unknown) + (ismeretlen) + + + + Q3Wizard + + + &Cancel + &Mégse + + + + < &Back + < &Vissza + + + + &Next > + &Következő > + + + + &Finish + &Befejezés + + + + &Help + &Súgó + + + + QAbstractSocket + + + + + + Host not found + A hoszt nem található + + + + + + Connection refused + A kapcsolódás elutasítva + + + + Connection timed out + Kapcsolódási időtúllépés + + + + + + Operation on socket is not supported + A socket művelet nem támogatott + + + + Socket operation timed out + Socket művelet időtúllépés + + + + Socket is not connected + Socket nincs csatlakoztatva + + + + Network unreachable + A hálózat nem elérhető + + + + QAbstractSpinBox + + + &Step up + &Növelés + + + + Step &down + &Csökkentés + + + + &Select All + Az összes &kiválasztása + + + + QAccessibleButton + + + Press + Megnyomás + + + + QApplication + + + QT_LAYOUT_DIRECTION + Translate this string to the string 'LTR' in left-to-right languages or to 'RTL' in right-to-left languages (such as Hebrew and Arabic) to get proper widget layout. + QT_LAYOUT_DIRECTION + + + + Executable '%1' requires Qt %2, found Qt %3. + A(z) '%1' futtatható fájl igényli a Qt %2, de Qt %3.-t talált. + + + + Incompatible Qt Library Error + Inkompatibilis Qt könyvtár hiba + + + + Activate + Aktiválás + + + + Activates the program's main window + A program fő ablakának aktiválása + + + + QAxSelect + + + Select ActiveX Control + ActiveX vezérlő kiválasztása + + + + OK + OK + + + + &Cancel + &Mégse + + + + COM &Object: + COM &Objektum: + + + + QCheckBox + + + Uncheck + Nincs bejelölve + + + + Check + Bejelölve + + + + Toggle + Kapcsolgatás + + + + QColorDialog + + + Hu&e: + &Színárnyalat: + + + + &Sat: + &Sat: + + + + &Val: + &Érték: + + + + &Red: + &Piros: + + + + &Green: + &Zöld: + + + + Bl&ue: + &Kék: + + + + A&lpha channel: + A&lfa csatorna: + + + + Select Color + Szín kiválasztása + + + + &Basic colors + &Alap színek + + + + &Custom colors + &Egyéni színek + + + + &Add to Custom Colors + &Egyéni színek hozzáadása + + + + QComboBox + + + + Open + Megnyitás + + + + False + Hamis + + + + True + Igaz + + + + Close + Bezárás + + + + QCoreApplication + + + %1: key is empty + QSystemSemaphore + %1:kulcs üres + + + + %1: unable to make key + QSystemSemaphore + %1: nem lehet kulcsot csinálni + + + + %1: ftok failed + QSystemSemaphore + %1: ftok hiba + + + + %1: already exists + QSystemSemaphore + %1: már létezik + + + + %1: does not exist + QSystemSemaphore + %1: nem létezik + + + + %1: out of resources + QSystemSemaphore + %1: elfogytak az erőforrások + + + + %1: unknown error %2 + QSystemSemaphore + %1: ismeretlen hiba %2 + + + + QDB2Driver + + + Unable to connect + Nem lehet csatlakozni + + + + Unable to commit transaction + Nem lehet kommitolni a tranzakciót + + + + Unable to rollback transaction + Nem lehet visszagörgetni a tranzakciót + + + + Unable to set autocommit + Nem lehet beállítani az automatikus kommitolást + + + + QDB2Result + + + + Unable to execute statement + Nem lehet végrehajtani a műveletet + + + + Unable to prepare statement + Nem lehet felkészülni a műveletre + + + + Unable to bind variable + Nem lehet összekötni a változót + + + + Unable to fetch record %1 + Nem lehet letölteni a(z) %1 felvételt + + + + Unable to fetch next + Nem lehet letölteni a következőt + + + + Unable to fetch first + Nem lehet letölteni az elsőt + + + + QDateTimeEdit + + + AM + AM + + + + am + am + + + + PM + PM + + + + pm + pm + + + + QDial + + + QDial + QDial + + + + SpeedoMeter + Sebességmérő + + + + SliderHandle + CsúszkaKezelő + + + + QDialog + + + What's This? + Mi ez? + + + + Done + Kész + + + + QDialogButtonBox + + + + + OK + OK + + + + Save + Mentés + + + + &Save + &Mentés + + + + Open + Megnyitás + + + + Cancel + Mégse + + + + &Cancel + &Mégse + + + + Close + Bezárás + + + + &Close + &Bezárás + + + + Apply + Alkalmazza + + + + Reset + Visszaállítás + + + + Help + Súgó + + + + Don't Save + Ne mentse + + + + Discard + Eldob + + + + &Yes + &Igen + + + + Yes to &All + Igen az &összesre + + + + &No + &Nem + + + + N&o to All + &Nem az összesre + + + + Save All + Az összes mentése + + + + Abort + Megszakítás + + + + Retry + Újra próbálkozás + + + + Ignore + Mellőzés + + + + Restore Defaults + Alapértelemezett beállítások visszaállítása + + + + Close without Saving + Bezárás mentés nélkül + + + + &OK + &OK + + + + QDirModel + + + Name + Név + + + + Size + Méret + + + + Kind + Match OS X Finder + Fajta + + + + Type + All other platforms + Típus + + + + Date Modified + Dátum módosítva + + + + QDockWidget + + + Close + Bezárás + + + + Dock + Dokkolás + + + + Float + Lebegtetés + + + + QDoubleSpinBox + + + More + Több + + + + Less + Kevesebb + + + + QErrorMessage + + + &Show this message again + Az üzenet újbóli &megjelenítése + + + + &OK + &OK + + + + Debug Message: + Debug üzenet: + + + + Warning: + Figyelmeztetés: + + + + Fatal Error: + Végzetes hiba: + + + + QFile + + + + Destination file exists + A cél fájl létezik + + + + Will not rename sequential file using block copy + Blokkos másolásnál nem lesznek átnevezve az egymást követő fájlok + + + + Cannot remove source file + Nem lehet a forrás fájlt eltávolítani + + + + Cannot open %1 for input + Nem lehet megnyitni %1-t bementre + + + + Cannot open for output + Nem lehet megnyitni a kimenetre + + + + Failure to write block + Hiba történt a blokk írás közben + + + + Cannot create %1 for output + Nem lehet létrehozni a(z) %1-t kimenetre + + + + QFileDialog + + + + All Files (*) + Az összes fájl (*) + + + + + Back + Vissza + + + + + List View + Lista nézet + + + + + Detail View + Részletes nézet + + + + + File + Fájl + + + + Open + Megnyitás + + + + Save As + Mentés másként + + + + + + &Open + &Megnyitás + + + + + &Save + &Mentés + + + + Recent Places + Utolsó helyek + + + + &Rename + &Átnevezés + + + + &Delete + &Törlés + + + + Show &hidden files + &Rejtett fájlok megjelenítése + + + + New Folder + Új mappa + + + + Find Directory + Könyvtár keresése + + + + Directories + Könyvtárak + + + + All Files (*.*) + Az összes fájl (*.*) + + + + + Directory: + Könyvtár: + + + + %1 already exists. +Do you want to replace it? + A(z) %1 már létezik. +Szeretné lecserélni? + + + + %1 +File not found. +Please verify the correct file name was given. + %1 +Fájl nem található. +Kérem ellenőrizze, hogy helyes fájlnevet adott meg. + + + + My Computer + Sajátgép + + + + + Parent Directory + Szülő könyvtár + + + + + Files of type: + Típusfájlok: + + + + + %1 +Directory not found. +Please verify the correct directory name was given. + %1 +A könyvtár nem található. +Kérem ellenőrizze le, hogy helyes könyvtár nevet adott meg. + + + + '%1' is write protected. +Do you want to delete it anyway? + A(z) '%1' írásvédett. +Mégis törölni szeretné? + + + + Are sure you want to delete '%1'? + Törölni szeretné '%1'? + + + + Could not delete directory. + Nem sikerült törölni a könyvtárat. + + + + Drive + Vezérlő + + + + File Folder + Match Windows Explorer + Fájl mappa + + + + Folder + All other platforms + Mappa + + + + Alias + Mac OS X Finder + Álnév + + + + Shortcut + All other platforms + Gyorsbillentyű + + + + Unknown + Ismeretlen + + + + Show + Megjelenítés + + + + + Forward + Előre + + + + &New Folder + &Új mappa + + + + + &Choose + &Kiválasztás + + + + Remove + Eltávolítás + + + + + File &name: + Fájl &név: + + + + + Look in: + Benéz: + + + + + Create New Folder + Új mappa létrehozása + + + + QFileSystemModel + + + + %1 TB + %1 TB + + + + + %1 GB + %1 GB + + + + + %1 MB + %1 MB + + + + + %1 KB + %1 KB + + + + %1 bytes + %1 bájt + + + + Invalid filename + Érvénytelen fájlnév + + + + <b>The name "%1" can not be used.</b><p>Try using another name, with fewer characters or no punctuations marks. + <b>A(z) "%1" név nem használható.</b><p>Próbáljon meg más nevet használni, kevesebb karakterrel vagy írásjelekek nélkül. + + + + Name + Név + + + + Size + Méret + + + + Kind + Match OS X Finder + Fajta + + + + Type + All other platforms + Típus + + + + Date Modified + Dátum módosítva + + + + My Computer + Sajátgép + + + + Computer + Számítógép + + + + %1 byte(s) + %1 bájt + + + + QFontDatabase + + + + Normal + Normál + + + + + + Bold + Kövér + + + + + Demi Bold + Félkövér + + + + + + Black + Fekete + + + + Demi + Fél + + + + + Light + Világos + + + + + Italic + Dőlt + + + + + Oblique + Homályos + + + + Any + Bármilyen + + + + Latin + Latin + + + + Greek + Görög + + + + Cyrillic + Ciril + + + + Armenian + Örmény + + + + Hebrew + Héber + + + + Arabic + Arab + + + + Syriac + Szíriai + + + + Thaana + Thana + + + + Devanagari + Dévanágari + + + + Bengali + Bengáli + + + + Gurmukhi + Gurmukhi + + + + Gujarati + Gujarati + + + + Oriya + Oriya + + + + Tamil + Tamil + + + + Telugu + Telugu + + + + Kannada + Kanadai + + + + Malayalam + Maláj + + + + Sinhala + Sinhala + + + + Thai + Tájföldi + + + + Lao + Lao + + + + Tibetan + Tibeti + + + + Myanmar + Mianmari + + + + Georgian + Grúz + + + + Khmer + Khmer + + + + Simplified Chinese + Egyszerűsített kínai + + + + Traditional Chinese + Hagyományos kínai + + + + Japanese + Japán + + + + Korean + Koreai + + + + Vietnamese + Vietnámi + + + + Symbol + Szimbólum + + + + Ogham + Ogham + + + + Runic + Székely + + + + N'Ko + N'Ko + + + + QFontDialog + + + &Font + &Betű + + + + Font st&yle + Betű st&ílus + + + + &Size + &Méret + + + + Effects + Hatások + + + + Stri&keout + Ki&talál + + + + &Underline + &Aláhúzás + + + + Sample + Minta + + + + + Select Font + Betű kiválasztása + + + + Wr&iting System + Rendszer &írása + + + + QFtp + + + Host %1 found + %1 host megtalálva + + + + Host found + Hoszt megtalálva + + + + + + Connected to host %1 + %1 hosztra csatlkoztatva + + + + Connected to host + Hosztra csatlakoztatva + + + + Connection to %1 closed + %1-re csatlakoztatása bezárva + + + + + + Connection closed + Kapcsolat bezárva + + + + + Host %1 not found + %1 host nem található + + + + + Connection refused to host %1 + Kapcsolat elutasítva a(z) %1 hoszttal + + + + Connection timed out to host %1 + Kapcsolati időtúllépés a %1 hoszttal + + + + + + + Unknown error + Ismeretlen hiba + + + + + Connecting to host failed: +%1 + A hoszthoz kapcsolódás nem sikerült: +%1 + + + + + Login failed: +%1 + Bejelentkezési hiba: +%1 + + + + + Listing directory failed: +%1 + Könyvtár listázási hiba: +%1 + + + + + Changing directory failed: +%1 + Könyvtár változtatási hiba: +%1 + + + + + Downloading file failed: +%1 + Fájl letöltési hiba: +%1 + + + + + Uploading file failed: +%1 + Fájl feltöltési hiba: +%1 + + + + + Removing file failed: +%1 + Fájl eltávolítási hiba: +%1 + + + + + Creating directory failed: +%1 + Könyvtár létrehozási hiba: +%1 + + + + + Removing directory failed: +%1 + Könyvtár eltávolítása hiba: +%1 + + + + + Not connected + Nincs csatlakoztatva + + + + + Connection refused for data connection + Adat kapcsolat érdekében történő csatlakozás megtagadva + + + + QHostInfo + + + Unknown error + Ismeretlen hiba + + + + QHostInfoAgent + + + + + + Host not found + A hoszt nem található + + + + + + + Unknown address type + Ismeretlen cím típus + + + + + + Unknown error + Ismeretlen hiba + + + + No host name given + Nincs hoszt név megadva + + + + Invalid hostname + Érvénytelen hoszt név + + + + QHttp + + + + Connection refused + Kapcsolat megtagadva + + + + + + Host %1 not found + A(z) %1 hoszt nem található + + + + + Wrong content length + Hibás tartalom hossz + + + + + + + HTTP request failed + HTTP kérési hiba + + + + Host %1 found + A(z) %1 hoszt nem található + + + + Host found + Hoszt megtalálható + + + + Connected to host %1 + %1 hoszthoz csatlakozva van + + + + Connected to host + Hosztra csatlakoztatva + + + + Connection to %1 closed + %1-re csatlkozás bezárva + + + + + Connection closed + Kapcsolat bezárva + + + + + + + Unknown error + Ismeretlen hiba + + + + + Request aborted + Kérés megszakítva + + + + + No server set to connect to + Nincsen szerver beállítva, amire csatlakozni lehetne + + + + + Server closed connection unexpectedly + A szerver váratlanul bezárta a kapcsolatot + + + + + Invalid HTTP response header + Érvénytelen HTTP válasz fejléc + + + + Unknown authentication method + Ismeretlen hitelesítési eljárás + + + + + + + Invalid HTTP chunked body + Érvénytelen nagy HTTP törzs + + + + Error writing response to device + Hiba történt a válasz eszközre írása közben + + + + Proxy authentication required + Proxy hitelesítés szükséges + + + + Authentication required + Hitelesítés szükséges + + + + Proxy requires authentication + A proxy a hitelesítést kéri + + + + Host requires authentication + A hoszt hitelesítést kér + + + + Data corrupted + Sérült adat + + + + SSL handshake failed + SSL kézfogási hiba + + + + Unknown protocol specified + Ismeretlen protokoll van megadva + + + + Connection refused (or timed out) + Kapcsolat megtagadva (vagy időtúllépés) + + + + HTTPS connection requested but SSL support not compiled in + HTTP kapcsolat lett kérve, de az SSL támogatás nincs beleforgatva + + + + QHttpSocketEngine + + + Did not receive HTTP response from proxy + Nem kapott HTTP választ a proxy-tól + + + + Error parsing authentication request from proxy + Hiba történt a proxy hitelesítés kérésének elemzése közben + + + + Authentication required + Hitelesítés szükséges + + + + Proxy denied connection + A proxy megtagadta a kapcsolatot + + + + Error communicating with HTTP proxy + Hiba történt a HTTP proxy-val történő kommunikáció közben + + + + Proxy server not found + A proxy szerver nem található + + + + Proxy connection refused + A proxy kapcsolat elutasítva + + + + Proxy server connection timed out + Proxy szerver kapcsolódási időtúllépés + + + + Proxy connection closed prematurely + Proxy kapcsolódás túl korán be lett zárva + + + + QIBaseDriver + + + Error opening database + Hiba történt az adatbázis megnyitása közben + + + + Could not start transaction + Nem sikerült elindítani a tranzakciót + + + + Unable to commit transaction + Nem lehet kommitolni a tranzakciót + + + + Unable to rollback transaction + Nem lehet visszagörgetni a tranzakciót + + + + QIBaseResult + + + Unable to create BLOB + Nem lehet BLOB-t létrehozni + + + + Unable to write BLOB + Nem lehet írni a BLOB-t + + + + Unable to open BLOB + Nem lehet megnyitni a BLOB-t + + + + Unable to read BLOB + Nem lehet olvasni a BLOB-t + + + + + Could not find array + Nem sikerült megtalálni a tömböt + + + + Could not get array data + Nem sikerüét megszerezni a tömb adatokat + + + + Could not get query info + Nem sikerült megszerezni a lekérdezi információt + + + + Could not start transaction + Nem sikerült elindítani a tranzakciót + + + + Unable to commit transaction + Nem lehet kommitolni a tranzakciót + + + + Could not allocate statement + Nem sikerült lefoglalni a műveletet + + + + Could not prepare statement + Nem sikerült felkészülni a műveletre + + + + + Could not describe input statement + Nem sikerült leírni a bemeneti állítást + + + + Could not describe statement + Nem sikerült leírni az állítást + + + + Unable to close statement + Nem lehet megnyitni az állítást + + + + Unable to execute query + Nem lehet végrehajtani a lekérdezést + + + + Could not fetch next item + Nem lehet letölteni a következő elemet + + + + Could not get statement info + Nem lehet az művelet információkat megszerezni + + + + QIODevice + + + Permission denied + Beleegyezés megtagadva + + + + Too many open files + Túl sok fájl megnyitása + + + + No such file or directory + Nincs ilyen fájl vagy könyvtár + + + + No space left on device + Nincs több hely a lemezen + + + + Unknown error + Ismeretlen hiba + + + + QInputContext + + + XIM + XIM + + + + FEP + FEP + + + + XIM input method + XIM beviteli eljárás + + + + Windows input method + Windows beviteli eljárás + + + + Mac OS X input method + Mac OS X beviteli eljárás + + + + S60 FEP input method + S60 FEP beviteli eljárás + + + + QInputDialog + + + Enter a value: + Egy értél bevitele: + + + + QLibrary + + + Could not mmap '%1': %2 + Nem sikerült az mmap '%1': %2 + + + + Plugin verification data mismatch in '%1' + Beépülő modul igazoló adata nem megfelelő a(z) '%1'-ben + + + + Could not unmap '%1': %2 + Nem lehet eltávolítani a letérképezést '%1': %2 + + + + The plugin '%1' uses incompatible Qt library. (%2.%3.%4) [%5] + A(z) '%1' beépülő modul inkompatibilis Qt könyvtárat használ. (%2.%3.%4) [%5] + + + + The plugin '%1' uses incompatible Qt library. Expected build key "%2", got "%3" + A(z) '%1' beépülő modul inkompatibilis Qt könyvtárat használ. A várt építési kulcs '%2', kapott '%3' + + + + Unknown error + Ismeretlen hiba + + + + + The shared library was not found. + A megosztott könyvtár nem található. + + + + The file '%1' is not a valid Qt plugin. + A(z) '%1' fájl nem egy érvényes Qt beépülő modul. + + + + The plugin '%1' uses incompatible Qt library. (Cannot mix debug and release libraries.) + A(z) '%1' beépülő modul inkompatibilis Qt könyvtárat használ. (Nem lehet a debug és kiadási könyvtárakat keverni.) + + + + + Cannot load library %1: %2 + Nem lehet betölteni a(z) %1 könyvtárat: %2 + + + + + Cannot unload library %1: %2 + Nem lehet kirakni a(z) %1 könyvtárat: %2 + + + + + Cannot resolve symbol "%1" in %2: %3 + Nem lehet megfejteni a(z) '%1' szimbólumot a(z) %2-ben: %3 + + + + QLineEdit + + + Select All + Az összes kiválasztása + + + + &Undo + &Visszavonás + + + + &Redo + &Helyreállítás + + + + Cu&t + &Kivágás + + + + &Copy + &Másolás + + + + &Paste + &Beillesztés + + + + Delete + Törlés + + + + QLocalServer + + + + %1: Name error + %1: Név hiba + + + + %1: Permission denied + %1: Engedély megtagadva + + + + %1: Address in use + %1: Cím használatban + + + + %1: Unknown error %2 + %1: Ismeretlen hiba %2 + + + + QLocalSocket + + + + %1: Connection refused + %1: Kapcsolat elutasítva + + + + + %1: Remote closed + %1: Távol bezárva + + + + + + + %1: Invalid name + %1: Érvénytelen név + + + + + %1: Socket access error + %1: Socket hozzáférési hiba + + + + + %1: Socket resource error + %1: Socket erőforrás hiba + + + + + %1: Socket operation timed out + %1: Socker művelet időtúllépés + + + + + %1: Datagram too large + %1: Túl nagy datagram + + + + + + %1: Connection error + %1: Kapcsolat hiba + + + + + %1: The socket operation is not supported + %1: A socket művelet nem támogatott + + + + %1: Unknown error + %1: Ismeretlen hiba + + + + + %1: Unknown error %2 + %1: Ismeretlen hiba %2 + + + + QMYSQLDriver + + + Unable to open database ' + Nem lehet megnyitni az adatbázist + + + + Unable to connect + Nem lehet kapcsolódni + + + + Unable to begin transaction + Nem lehet megkezdeni a tranzakciót + + + + Unable to commit transaction + Nem lehet kommitolni a tranzakciót + + + + Unable to rollback transaction + Nem lehet visszagörgetni a tranzakciót + + + + QMYSQLResult + + + Unable to fetch data + Nem lehet letölteni az adatot + + + + Unable to execute query + Nem lehet végrehajtani a lekérdezést + + + + Unable to store result + Nem lehet tárolni az eredményt + + + + + Unable to prepare statement + Nem lehet felkészülni a műveletre + + + + Unable to reset statement + Nem lehet visszaállítani a műveleteket + + + + Unable to bind value + Nem lehet összekötni az értéket + + + + Unable to execute statement + Nem lehet végrehajtani az állítást + + + + + Unable to bind outvalues + Nem lehet összekötni a kiértékeléseket + + + + Unable to store statement results + Nem lehet letárolni a művelet eredményeket + + + + Unable to execute next query + Nem lehet végrehajtani a következő lekérdezést + + + + Unable to store next result + Nem lehet letárolni a következő eredményt + + + + QMdiArea + + + (Untitled) + (Címtelen) + + + + QMdiSubWindow + + + %1 - [%2] + %1 - [%2] + + + + Close + Bezárás + + + + Minimize + Minimalizálás + + + + Restore Down + Leállítás + + + + &Restore + &Letárolás + + + + &Move + &Mozgatás + + + + &Size + &Méret + + + + Mi&nimize + &Minimalizálás + + + + Ma&ximize + Ma&ximalizálás + + + + Stay on &Top + &Tetején maradni + + + + &Close + &Bezárás + + + + Maximize + Maximalizálás + + + + Unshade + Árnyékolás megszüntetése + + + + Shade + Árnyákolás + + + + Restore + Visszaállítás + + + + Help + Súgó + + + + Menu + Menü + + + + - [%1] + - [%1] + + + + QMenu + + + + Close + Bezárás + + + + + Open + Megnyitás + + + + + + Execute + Végrehajtás + + + + QMenuBar + + + Actions + Tevékenységek + + + + QMessageBox + + + + + + OK + OK + + + + <h3>About Qt</h3><p>This program uses Qt version %1.</p> + <h3>Qt-ról</h3><p>Ez a program a(z) %1 Qt verziót használja.</p> + + + + <p>Qt is a C++ toolkit for cross-platform application development.</p><p>Qt provides single-source portability across MS&nbsp;Windows, Mac&nbsp;OS&nbsp;X, Linux, and all major commercial Unix variants. Qt is also available for embedded devices as Qt for Embedded Linux and Qt for Windows CE.</p><p>Qt is available under three different licensing options designed to accommodate the needs of our various users.</p><p>Qt licensed under our commercial license agreement is appropriate for development of proprietary/commercial software where you do not want to share any source code with third parties or otherwise cannot comply with the terms of the GNU LGPL version 2.1 or GNU GPL version 3.0.</p><p>Qt licensed under the GNU LGPL version 2.1 is appropriate for the development of Qt applications (proprietary or open source) provided you can comply with the terms and conditions of the GNU LGPL version 2.1.</p><p>Qt licensed under the GNU General Public License version 3.0 is appropriate for the development of Qt applications where you wish to use such applications in combination with software subject to the terms of the GNU GPL version 3.0 or where you are otherwise willing to comply with the terms of the GNU GPL version 3.0.</p><p>Please see <a href="http://qt.nokia.com/products/licensing">qt.nokia.com/products/licensing</a> for an overview of Qt licensing.</p><p>Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).</p><p>Qt is a Nokia product. See <a href="http://qt.nokia.com/">qt.nokia.com</a> for more information.</p> + + + + + About Qt + Qt-ról + + + + Help + Súgó + + + + Show Details... + Részletek megjelenítése... + + + + Hide Details... + Részletek elrejtése... + + + + QMultiInputContext + + + Select IM + IM kiválasztása + + + + QMultiInputContextPlugin + + + Multiple input method switcher + Összetett beviteli eljárás kapcsoló + + + + Multiple input method switcher that uses the context menu of the text widgets + Összetett beviteli eljárás kapcsoló, ami a szöveg widgetek menü összefüggéseit használja + + + + QNativeSocketEngine + + + The remote host closed the connection + A távoli hoszt bezárta a kapcsolatot + + + + Network operation timed out + Hálózati művelet időtúllépése + + + + Out of resources + Kifogytak az erőforrások + + + + Unsupported socket operation + Nem támogatott socket művelet + + + + Protocol type not supported + Nem támogatott protokoll típus + + + + Invalid socket descriptor + Érvénytelen socket leíró + + + + Network unreachable + A hálózat nem elérhető + + + + Permission denied + Engedély megtagadva + + + + Connection timed out + Kapcsolat időtúllépés + + + + Connection refused + Kapcsolat elutasítva + + + + The bound address is already in use + A cím összeköttetés már használatban van + + + + The address is not available + A cím nem elérhető + + + + The address is protected + A cím védett + + + + Unable to send a message + Nem lehet üzenetet küldeni + + + + Unable to receive a message + Nem lehet megkapni az üzeneteket + + + + Unable to write + Nem lehet írni + + + + Network error + Hálózati hiba + + + + Another socket is already listening on the same port + Egy másik socker már ugyanazon a porton figyel + + + + Unable to initialize non-blocking socket + Nem lehet inicializálni egy nem blokkoló socketet + + + + Unable to initialize broadcast socket + Nem lehet inicializálni a socket közvetítőt + + + + Attempt to use IPv6 socket on a platform with no IPv6 support + IPv6 socket használatának kipróbálása olyan platformon, amelyik nem támogatja az IPv6-t + + + + Host unreachable + A hoszt nem elérhető + + + + Datagram was too large to send + A datagram túl nagy volt elküldésre + + + + Operation on non-socket + Nem socketen végzett művelet + + + + Unknown error + Ismeretlen hiba + + + + The proxy type is invalid for this operation + A proxy típusa ismeretlen erre a műveletre + + + + QNetworkAccessCacheBackend + + + Error opening %1 + Hiba történt a(z) %1 megnyitása közben + + + + QNetworkAccessDebugPipeBackend + + + Write error writing to %1: %2 + Írása hiba történt a(z) %1-be történő írás közben: %2 + + + + QNetworkAccessFileBackend + + + + Request for opening non-local file %1 + Kérés a(z) %1 nem helyi fál megnyitására + + + + + Error opening %1: %2 + Hiba történt a(z) %1 megnyitása közben: %2 + + + + Write error writing to %1: %2 + Írási hiba történt a(z) %1-be írás közben: %2 + + + + + Cannot open %1: Path is a directory + Nem lehet megnyitni a(z) %1-t: az útvonal egy könyvtár + + + + Read error reading from %1: %2 + Olvasási hiba történt a(z) %1-ból való olvasás közben: %2 + + + + QNetworkAccessFtpBackend + + + No suitable proxy found + Nem található megfelelő proxy + + + + Cannot open %1: is a directory + Nem lehet megnyitni a(z) %1 t, mert az egy könyvtár + + + + Logging in to %1 failed: authentication required + A(z) %1-be történő loggolás nem sikerült: hitelesítés szükséges + + + + Error while downloading %1: %2 + Hiba történt a(z) %1 letöltése közben: %2 + + + + Error while uploading %1: %2 + Hiba történt a(z) %1 feltöltése közben: %2 + + + + QNetworkAccessHttpBackend + + + No suitable proxy found + Nem található megfelelő proxy + + + + QNetworkReply + + + Error downloading %1 - server replied: %2 + Hiba történt a(z) %1 letöltése közben - a szerver válasza: %2 + + + + Protocol "%1" is unknown + A(z) '%1' protokoll ismeretlen + + + + QNetworkReplyImpl + + + + Operation canceled + Művelet visszavonása + + + + QOCIDriver + + + Unable to logon + Nem lehet bejelentkezni + + + + Unable to initialize + QOCIDriver + Nem lehet inicializálni + + + + Unable to begin transaction + Nem lehet megkezdeni a tranzakciót + + + + Unable to commit transaction + Nem lehet kommitolni a tranzakciót + + + + Unable to rollback transaction + Nem lehet visszagörgetni a tranzakciót + + + + QOCIResult + + + + + Unable to bind column for batch execute + Nem lehet összekötni az oszlopot köteg végrehajtásra + + + + Unable to execute batch statement + Nem lehet végrehajtani a köteg állítást + + + + Unable to goto next + Nem lehet a következőre ugrani + + + + Unable to alloc statement + Nem lehet helyet lefoglalni az állításnak + + + + Unable to prepare statement + Nem lehet felkészülni a műveletre + + + + Unable to get statement type + Nem lehet megszerezni az állítás típusát + + + + Unable to bind value + Nem lehet összekötni az értéket + + + + Unable to execute statement + Nem lehet végrehajtani az állítást + + + + QODBCDriver + + + Unable to connect + Nem lehet kapcsolódni + + + + Unable to disable autocommit + Nem lehet letiltani az automatikus kommitolást + + + + Unable to commit transaction + Nem lehet kommitolni a tranzakciót + + + + Unable to rollback transaction + Nem lehet visszagörgetni a tranzakciót + + + + Unable to enable autocommit + Nem lehet engedélyezni az automatikus kommitolást + + + + Unable to connect - Driver doesn't support all functionality required + Nem lehet csatlakozni- A vezérlő nem támogatja az összes szükséges funkciót + + + + QODBCResult + + + + QODBCResult::reset: Unable to set 'SQL_CURSOR_STATIC' as statement attribute. Please check your ODBC driver configuration + QODBCEredmény::Visszaállítás: Nen lehet beállítani az 'SQL_CURSOR_STATIC' állítás attribútumra. Kérem ellenőrizze le az ODBC vezérlő konfigurációt + + + + + Unable to execute statement + Nem lehet végrehajtani az állítást + + + + Unable to fetch next + Nem lehet letölteni a következőt + + + + Unable to prepare statement + Nem lehet felkészülni az állításra + + + + Unable to bind variable + Nem lehet összekötni a változót + + + + + + Unable to fetch last + Nem lehet letölteni az utolsót + + + + Unable to fetch + Nem lehet letölteni + + + + Unable to fetch first + Nem letölteni az elsőt + + + + Unable to fetch previous + Nem lehet letölteni az előzőt + + + + QObject + + + Invalid hostname + Érvénytelen hoszt név + + + + Operation not supported on %1 + A művelet nem támogatott a(z) %1-n + + + + Invalid URI: %1 + Érvénytelen URI: %1 + + + + Socket error on %1: %2 + Socket hiba a(z) %1-n: %2 + + + + Remote host closed the connection prematurely on %1 + A távoli hoszt túl korán bezárta a kapcsolatot a(z) %1-n + + + + + No host name given + Nincs hoszt név megadva + + + + QPPDOptionsModel + + + Name + Név + + + + Value + Érték + + + + QPSQLDriver + + + Unable to connect + Nem lehet csatlakozni + + + + Could not begin transaction + Nem sikerült megkezdeni a tranzakciót + + + + Could not commit transaction + Nem lehet kommitolni a tranzakciót + + + + Could not rollback transaction + Nem lehet visszagörgetni a tranzakciót + + + + Unable to subscribe + Nem lehet feliratkozni + + + + Unable to unsubscribe + Nem lehet leiratkozni + + + + QPSQLResult + + + Unable to create query + Nem lehet létrehozni a lekérdezést + + + + Unable to prepare statement + Nem lehet felkészülni az állításra + + + + QPageSetupWidget + + + Centimeters (cm) + Centiméter (cm) + + + + Millimeters (mm) + Milliméter (mm) + + + + Inches (in) + Incs (in) + + + + Points (pt) + Pont (pt) + + + + Form + + + + + Paper + Papír + + + + Page size: + Lap méret: + + + + Width: + Szélesség: + + + + Height: + Magasság: + + + + Paper source: + Papír forrás: + + + + Orientation + Elhelyezkedés + + + + Portrait + Portré + + + + Landscape + Tájkép + + + + Reverse landscape + Fordított tájkép + + + + Reverse portrait + Fordított portré + + + + Margins + Margó + + + + top margin + Felső margó + + + + left margin + Bal margó + + + + right margin + Jobb margó + + + + bottom margin + Alsó margó + + + + QPluginLoader + + + Unknown error + Ismeretlen hiba + + + + The plugin was not loaded. + A beépülő modult nem sikerült betölteni. + + + + QPrintDialog + + + locally connected + Helyileg csatlakoztatva + + + + + Aliases: %1 + Álnevek: %1 + + + + + unknown + ismeretlen + + + + OK + OK + + + + Print all + Az összes kinyomtatása + + + + Print range + Egy tartomány kinyomtatása + + + + A0 (841 x 1189 mm) + A0 (841 x 1189 mm) + + + + A1 (594 x 841 mm) + A1 (594 x 841 mm) + + + + A2 (420 x 594 mm) + A2 (420 x 594 mm) + + + + A3 (297 x 420 mm) + A3 (297 x 420 mm) + + + + A5 (148 x 210 mm) + A5 (148 x 210 mm) + + + + A6 (105 x 148 mm) + A6 (105 x 148 mm) + + + + A7 (74 x 105 mm) + A7 (74 x 105 mm) + + + + A8 (52 x 74 mm) + A8 (52 x 74 mm) + + + + A9 (37 x 52 mm) + A9 (37 x 52 mm) + + + + B0 (1000 x 1414 mm) + B0 (1000 x 1414 mm) + + + + B1 (707 x 1000 mm) + B1 (707 x 1000 mm) + + + + B2 (500 x 707 mm) + B2 (500 x 707 mm) + + + + B3 (353 x 500 mm) + B3 (353 x 500 mm) + + + + B4 (250 x 353 mm) + B4 (250 x 353 mm) + + + + B6 (125 x 176 mm) + B6 (125 x 176 mm) + + + + B7 (88 x 125 mm) + B7 (88 x 125 mm) + + + + B8 (62 x 88 mm) + B8 (62 x 88 mm) + + + + B9 (44 x 62 mm) + B9 (44 x 62 mm) + + + + B10 (31 x 44 mm) + B10 (31 x 44 mm) + + + + C5E (163 x 229 mm) + C5E (163 x 229 mm) + + + + DLE (110 x 220 mm) + DLE (110 x 220 mm) + + + + Folio (210 x 330 mm) + Fólió (210 x 330 mm) + + + + Ledger (432 x 279 mm) + Főkönyv (432 x 279 mm) + + + + Tabloid (279 x 432 mm) + Tabletta (279 x 432 mm) + + + + US Common #10 Envelope (105 x 241 mm) + US közös #10 bélyeg (105 x 241 mm) + + + + A4 (210 x 297 mm, 8.26 x 11.7 inches) + A4 (210 x 297 mm, 8.26 x 11.7 inches) + + + + B5 (176 x 250 mm, 6.93 x 9.84 inches) + B5 (176 x 250 mm, 6.93 x 9.84 inches) + + + + Executive (7.5 x 10 inches, 191 x 254 mm) + Vezető (7.5 x 10 inches, 191 x 254 mm) + + + + Legal (8.5 x 14 inches, 216 x 356 mm) + Legális (8.5 x 14 inches, 216 x 356 mm) + + + + Letter (8.5 x 11 inches, 216 x 279 mm) + Levél (8.5 x 11 inches, 216 x 279 mm) + + + + Print selection + Nyomtatási kiválasztás + + + + + + Print + Nyomtatás + + + + Print To File ... + Fájlba nyomtatás ... + + + + File %1 is not writable. +Please choose a different file name. + A(z) %1 fájl nem írható. +Kérem válasszon különböző fájl nevet. + + + + %1 already exists. +Do you want to overwrite it? + A(z) %1 már létezik. +Felül szeretné írni? + + + + File exists + Fájl létezik + + + + <qt>Do you want to overwrite it?</qt> + <qt>Felül szeretné írni?</qt> + + + + %1 is a directory. +Please choose a different file name. + A(z) %1 egy könyvtár. +Kérem válasszon egy különböző fájl nevet. + + + + The 'From' value cannot be greater than the 'To' value. + A '-Tól' érték nem lehet nagyobb az '-Ig' értéknél. + + + + A0 + A0 + + + + A1 + A1 + + + + A2 + A2 + + + + A3 + A3 + + + + A4 + A4 + + + + A5 + A5 + + + + A6 + A6 + + + + A7 + A7 + + + + A8 + A8 + + + + A9 + A9 + + + + B0 + B0 + + + + B1 + B1 + + + + B2 + B2 + + + + B3 + B3 + + + + B4 + B4 + + + + B5 + B5 + + + + B6 + B6 + + + + B7 + B7 + + + + B8 + B8 + + + + B9 + B9 + + + + B10 + B10 + + + + C5E + C5E + + + + DLE + DLE + + + + Executive + Vezető + + + + Folio + Fólió + + + + Ledger + Főkönyv + + + + Legal + Legális + + + + Letter + Levél + + + + Tabloid + Tabletta + + + + US Common #10 Envelope + US közös #10 bélyeg + + + + Custom + Egyéni + + + + + &Options >> + &Opciók >> + + + + &Options << + &Opciók << + + + + Print to File (PDF) + Fájlba nyomtatás (PDF) + + + + Print to File (Postscript) + Fájlba nyomtatás (Postscript) + + + + Local file + Helyi fájl + + + + Write %1 file + %1 fájlba írás + + + + &Print + &Nyomtatás + + + + QPrintPreviewDialog + + + %1% + %1% + + + + Print Preview + Nyomtatási előnézet + + + + Next page + Következő lap + + + + Previous page + Előző lap + + + + First page + Első lap + + + + Last page + Utolsó lap + + + + Fit width + Megfelelő szélesség + + + + Fit page + Megfelelő lap + + + + Zoom in + Nagyítás + + + + Zoom out + Kicsinyítés + + + + Portrait + Portré + + + + Landscape + Tájkép + + + + Show single page + Egyetlen lap megjelenítése + + + + Show facing pages + Lapok megjelenítése szemből + + + + Show overview of all pages + Az összes lap áttekintésének megjelenítése + + + + Print + Nyomtatás + + + + Page setup + Lap beállítás + + + + Export to PDF + PDF-be exportálás + + + + Export to PostScript + PostScript-be exportálás + + + + + Page Setup + Lap beállítás + + + + QPrintPropertiesWidget + + + Form + Forma + + + + Page + Lap + + + + Advanced + Speciális + + + + QPrintSettingsOutput + + + Form + Forma + + + + Copies + Másolás + + + + Print range + Tartomány nyomtatása + + + + Print all + Az összes nyomtatása + + + + Pages from + Lapok ettől + + + + to + eddig + + + + Selection + Kiválasztás + + + + Output Settings + Kimeneti beállítások + + + + Copies: + Másolatok: + + + + Collate + Egyeztet + + + + Reverse + Fordítva + + + + Options + Opciók + + + + Color Mode + Színes mód + + + + Color + Szín + + + + Grayscale + Szürkeárnyalat + + + + Duplex Printing + Dupla nyomtatás + + + + None + Semmi + + + + Long side + Hosszú oldal + + + + Short side + Rövid oldal + + + + QPrintWidget + + + Form + Űrlap + + + + Printer + Nyomtató + + + + &Name: + &Név: + + + + P&roperties + Tu&lajdonságok + + + + Location: + Elhelyezkedés: + + + + Preview + Előnézet + + + + Type: + Típus: + + + + Output &file: + Kimeneti &fájl: + + + + ... + ... + + + + QProcess + + + + Could not open input redirection for reading + Nem sikerült megnyitni a bevitel olvasásra irányítását + + + + + Could not open output redirection for writing + Nem sikerült megnyitni a kimenet írásra irányítását + + + + Resource error (fork failure): %1 + Erőforrás hiba (Szétágazás hiba): %1 + + + + + + + + + + + + Process operation timed out + Folyamat művelet időtúllépés + + + + + + + Error reading from process + Hiba történt a folyamat olvasása közben + + + + + + Error writing to process + Hiba történt a folyamat írása közben + + + + Process crashed + A folyamat összeomlott + + + + No program defined + Nincs program definiálva + + + + Process failed to start: %1 + Nem sikerült elindítani a folyamatot: %1 + + + + QProgressDialog + + + Cancel + Mégse + + + + QPushButton + + + Open + Megnyitás + + + + QRadioButton + + + Check + Ellenőrzés + + + + QRegExp + + + no error occurred + nem történt hiba + + + + disabled feature used + tiltás tulajdonság használva + + + + bad char class syntax + rossz karakter osztály szintakszis + + + + bad lookahead syntax + rossz előreolvasási szintakszis + + + + bad repetition syntax + rossz ismétlési szintakszis + + + + invalid octal value + érvénytelen oktális érték + + + + missing left delim + hiányzó bal határolójel + + + + unexpected end + váratlan vég + + + + met internal limit + találkozott belső korlát + + + + invalid interval + érvénytelen intervallum + + + + invalid category + érvénytelen kategória + + + + QSQLite2Driver + + + Error opening database + Hiba történt az adatbázis megnyitása közben + + + + Unable to begin transaction + Nem lehet elkezdeni a tranzakciót + + + + Unable to commit transaction + Nem lehet kommitolni a tranzakciót + + + + Unable to rollback transaction + Nem lehet visszagörgetni a tranzakciót + + + + QSQLite2Result + + + Unable to fetch results + Nem lehet letölteni az eredményeket + + + + Unable to execute statement + Nem lehet végrehajtani az állítást + + + + QSQLiteDriver + + + Error opening database + Hiba történt az adatbázis megnyitása közben + + + + Error closing database + Hiba történt az adatbázis bezárása közben + + + + Unable to begin transaction + Nem lehet elkezdeni a tranzakciót + + + + Unable to commit transaction + Nem lehet kommitolni a tranzakciót + + + + Unable to rollback transaction + Nem lehet visszagörgetni a tranzakciót + + + + QSQLiteResult + + + + + Unable to fetch row + Nem lehet leszedni a sort + + + + Unable to execute statement + Nem lehet végrehajtani az állítást + + + + Unable to reset statement + Nem lehet visszaállítani az állítást + + + + Unable to bind parameters + Nem lehet összekötni a paramétereket + + + + Parameter count mismatch + A paraméter számláló nem megfelelő + + + + No query + Nincs lekérdezés + + + + QScriptBreakpointsModel + + + ID + Azonosító + + + + Location + Elhelyezkedés + + + + Condition + Feltétel + + + + Ignore-count + Számítás mellőzése + + + + Single-shot + Egylövetű + + + + Hit-count + Leütés számítás + + + + QScriptBreakpointsWidget + + + New + Új + + + + Delete + Törlés + + + + QScriptDebugger + + + + Go to Line + Ugrás erre a sorra + + + + Line: + Sor: + + + + Interrupt + Megszakítás + + + + Shift+F5 + Shift+F5 + + + + Continue + Folytatás + + + + F5 + F5 + + + + Step Into + Belelépés + + + + F11 + F11 + + + + Step Over + Átlépés + + + + F10 + F10 + + + + Step Out + Kilép + + + + Shift+F11 + Shift+F11 + + + + Run to Cursor + Kurzorra futás + + + + Ctrl+F10 + Ctrl+F10 + + + + Run to New Script + Az új Szkriptre futás + + + + Toggle Breakpoint + Töréspont kapcsolgatása + + + + F9 + F9 + + + + Clear Debug Output + Debug kimenet kiürítése + + + + Clear Error Log + Error Log kiürítése + + + + Clear Console + Konzol kiürítése + + + + &Find in Script... + Szkriptben &keresés... + + + + Ctrl+F + Ctrl+F + + + + Find &Next + &Következő keresése + + + + F3 + F3 + + + + Find &Previous + &Előző keresése + + + + Shift+F3 + Shift+F3 + + + + Ctrl+G + Ctrl+G + + + + Debug + Debug + + + + QScriptDebuggerCodeFinderWidget + + + Close + Bezárás + + + + Previous + Előző + + + + Next + Következő + + + + Case Sensitive + Kis és nagybetű érzékeny + + + + Whole words + Egész szavakat + + + + <img src=":/qt/scripttools/debugging/images/wrap.png">&nbsp;Search wrapped + <img src=":/qt/scripttools/debugging/images/wrap.png">&nbsp;Keresés tördelve + + + + QScriptDebuggerLocalsModel + + + Name + Név + + + + Value + Érték + + + + QScriptDebuggerStackModel + + + Level + Szint + + + + Name + Név + + + + Location + Elhelyezkedés + + + + QScriptEdit + + + Toggle Breakpoint + Töréspont kapcsolgatása + + + + Disable Breakpoint + Töréspont tiltása + + + + Enable Breakpoint + Töréspont engedélyezése + + + + Breakpoint Condition: + Töréspont feltétel: + + + + QScriptEngineDebugger + + + Loaded Scripts + Betöltött szkriptek + + + + Breakpoints + Töréspontok + + + + Stack + Verem + + + + Locals + Helyi változók + + + + Console + Konzol + + + + Debug Output + Debug kimenet + + + + Error Log + Hiba Log + + + + Search + Keresés + + + + View + Nézet + + + + Qt Script Debugger + Qt szkript debugger + + + + QScriptNewBreakpointWidget + + + Close + Bezárás + + + + QScrollBar + + + Scroll here + Görgetés itt + + + + Left edge + Bal szegély + + + + Top + Tető + + + + Right edge + Jobb szegély + + + + Bottom + Alja + + + + Page left + Lapzoás balra + + + + + Page up + Lapozás felfele + + + + Page right + Lapozás jobbra + + + + + Page down + Lapozás lefele + + + + Scroll left + Görgetés balra + + + + Scroll up + Görgetés felfele + + + + Scroll right + Görgetés jobbra + + + + Scroll down + Görgetés lefele + + + + Line up + Egy sorral feljebb + + + + Position + Pozíció + + + + Line down + Egy sorral lejjebb + + + + QSharedMemory + + + %1: create size is less then 0 + %1: 0-nál kisebb méret létrehozása + + + + + %1: unable to lock + %1: Nem lehet zárolni + + + + %1: unable to unlock + %1: Nem lehet kinyitni + + + + + + %1: permission denied + %1: engedély megtagadva + + + + + + %1: already exists + %1: már létezik + + + + %1: doesn't exists + %1: nem létezik + + + + + + %1: out of resources + %1: Kifogyott az erőforrásból + + + + + + %1: unknown error %2 + %1: ismeretlen hiba %2 + + + + %1: key is empty + %1: Üres kulcs + + + + %1: ftok failed + %1: ftok hiba + + + + + + %1: unable to make key + %1: Nem lehet kulcsot csinálni + + + + + %1: doesn't exist + %1: nem létezik + + + + %1: UNIX key file doesn't exist + %1: UNIX kulcs fájl nem létezik + + + + %1: system-imposed size restrictions + %1: a rendszer rárakott méretének korlátozásai + + + + %1: not attached + %1: nincs hozzácsatolva + + + + + %1: invalid size + %1: érvénytelen méret + + + + + %1: key error + %1: kulcs hiba + + + + %1: size query failed + %1: méret lekérdezési hiba + + + + %1: unable to set key on lock + %1: nem lehet beállítani a kulcsot a záron + + + + QShortcut + + + Space + Space + + + + Esc + Esc + + + + Tab + Tab + + + + Backtab + Backtab + + + + Backspace + Backspace + + + + Return + Return + + + + Enter + Enter + + + + Ins + Ins + + + + Del + Del + + + + Pause + Pause + + + + Print + Print + + + + SysReq + SysReq + + + + Home + Home + + + + End + End + + + + Left + Left + + + + Up + Up + + + + Right + Right + + + + Down + Down + + + + PgUp + PgUp + + + + PgDown + PgDown + + + + CapsLock + CapsLock + + + + NumLock + NumLock + + + + ScrollLock + ScrollLock + + + + Menu + Menü + + + + Help + Súgó + + + + Back + Vissza + + + + Forward + Előre + + + + Stop + Leállítás + + + + Refresh + Felfrissítés + + + + Volume Down + Hangerő lehalkítása + + + + Volume Mute + Hangerő Elnémítás + + + + Volume Up + Hangerő hangosítása + + + + Bass Boost + Basszus erősítés + + + + Bass Up + Basszus növelése + + + + Bass Down + Basszus csökkentése + + + + Treble Up + Felháromszorozás + + + + Treble Down + Leharmadolás + + + + Media Play + Média elindítása + + + + Media Stop + Média leállítása + + + + Media Previous + Előző média + + + + Media Next + Következő média + + + + Media Record + Média felvétel + + + + Favorites + Kedvcencek + + + + Search + Keresés + + + + Standby + Készenlét + + + + Open URL + URL megnyitása + + + + Launch Mail + Mail indítása + + + + Launch Media + Média indítása + + + + Launch (0) + Elindítás (0) + + + + Launch (1) + Elindítás (1) + + + + Launch (2) + Elindítás (2) + + + + Launch (3) + Elindítás (3) + + + + Launch (4) + Elindítás (4) + + + + Launch (5) + Elindítás (5) + + + + Launch (6) + Elindítás (6) + + + + Launch (7) + Elindítás (7) + + + + Launch (8) + Elindítás (8) + + + + Launch (9) + Elindítás (9) + + + + Launch (A) + Elindítás (A) + + + + Launch (B) + Elindítás (B) + + + + Launch (C) + Elindítás (C) + + + + Launch (D) + Elindítás (D) + + + + Launch (E) + Elindítás (E) + + + + Launch (F) + Elindítás (F) + + + + Monitor Brightness Up + Monitorfény növelése + + + + Monitor Brightness Down + Monitorfény csökkentése + + + + Keyboard Light On/Off + Billentyű világítás be/ki + + + + Keyboard Brightness Up + Billentyűfény növelése + + + + Keyboard Brightness Down + Billentyűfény csökkentése + + + + Power Off + Kikapcsolás + + + + Wake Up + Felébresztés + + + + Eject + Kidobás + + + + Screensaver + Képernyővédő + + + + WWW + WWW + + + + Sleep + Alvás + + + + LightBulb + Villanykörte + + + + Shop + Bolt + + + + History + Történelem + + + + Add Favorite + Hozzáadás a kedvencekhez + + + + Hot Links + Hot linkek + + + + Adjust Brightness + Fényszabályozás + + + + Finance + Pénzügy + + + + Community + Közösség + + + + Audio Rewind + Audió áttekercselés + + + + Back Forward + Előre hátra + + + + Application Left + Alkalmazás balra + + + + Application Right + Alkalmazás jobbra + + + + Book + Könyv + + + + CD + CD + + + + Calculator + Számológép + + + + Clear + Tiszta + + + + Clear Grab + Tiszta megmarkolás + + + + Close + Bezárás + + + + Copy + Másolás + + + + Cut + Kivágás + + + + Display + Megjelenítés + + + + DOS + DOS + + + + Documents + Dokumentumok + + + + Spreadsheet + Táblázatkezelő + + + + Browser + Böngésző + + + + Game + Játék + + + + Go + Gyerünk + + + + iTouch + iTouch + + + + Logoff + Kijelentkezés + + + + Market + Piac + + + + Meeting + Találkozó + + + + Keyboard Menu + Billlentyű menü + + + + Menu PB + PB menü + + + + My Sites + Oldalam + + + + News + Hírek + + + + Home Office + Otthoni iroda + + + + Option + Opció + + + + Paste + Beillesztés + + + + Phone + Telefon + + + + Reply + Válasz + + + + Reload + Újratöltés + + + + Rotate Windows + Ablakok forgatása + + + + Rotation PB + PB forgatás + + + + Rotation KB + KB forgatás + + + + Save + Mentés + + + + Send + Küldés + + + + Spellchecker + Helyesírás ellenőrző + + + + Split Screen + Képernyő felosztása + + + + Support + Támogatás + + + + Task Panel + Feladat panel + + + + Terminal + Terminál + + + + Tools + Eszközök + + + + Travel + Utazás + + + + Video + Videó + + + + Word Processor + Szó feldolgozó + + + + XFer + XFer + + + + Zoom In + Nagyítás + + + + Zoom Out + Kicsinyítés + + + + Away + Távol + + + + Messenger + Hírnök + + + + WebCam + WebCam + + + + Mail Forward + Mail továbbítása + + + + Pictures + Képek + + + + Music + Zene + + + + Battery + Elem + + + + Bluetooth + Bluetooth + + + + Wireless + Vezeték nélküli + + + + Ultra Wide Band + Ultra széles sáv + + + + Audio Forward + Audio továbbítás + + + + Audio Repeat + Audió ismétlés + + + + Audio Random Play + Audió véletlenszerű lejátszása + + + + Subtitle + Alcím + + + + Audio Cycle Track + Audió ciklikus követése + + + + Time + Idő + + + + View + Nézet + + + + Top Menu + Felső menü + + + + Suspend + Felfüggesztés + + + + Hibernate + Hibernálás + + + + Print Screen + Képernyő másolás + + + + Page Up + Feljebb lapozás + + + + Page Down + Lejjebb lapozás + + + + Caps Lock + Caps Lock + + + + Num Lock + Num Lock + + + + Number Lock + Number Lock + + + + Scroll Lock + Scroll Lock + + + + Insert + Insert + + + + Delete + Delete + + + + Escape + Escape + + + + System Request + System Request + + + + + Select + Kiválsztás + + + + Yes + Igen + + + + No + Nem + + + + Context1 + Tartalom1 + + + + Context2 + Tartalom2 + + + + Context3 + Tartalom3 + + + + Context4 + Tartalom4 + + + + Call + Hívás + + + + Hangup + Felfüggeszt + + + + Flip + Feldobás + + + + + Ctrl + Ctrl + + + + + Shift + Shift + + + + + Alt + Alt + + + + + Meta + Meta + + + + + + + + + + + F%1 + F%1 + + + + Home Page + Honlap + + + + QSlider + + + Page left + Lapozás balra + + + + Page up + Lapozás felfele + + + + Position + Pozíció + + + + Page right + Lapozás jobbra + + + + Page down + Lapozás lefele + + + + QSocks5SocketEngine + + + Connection to proxy refused + Proxyhoz kapcsolódás elutasítva + + + + Connection to proxy closed prematurely + A proxyhoz való csatlakozás túl korán be lett zárva + + + + Proxy host not found + Proxy hoszt nem található + + + + Connection to proxy timed out + Proxyhoz való csatlakozásnál időtúllépés történt + + + + Proxy authentication failed + Proxy hitelesítési hiba + + + + Proxy authentication failed: %1 + Proxy hitelesítési hiba: %1 + + + + SOCKS version 5 protocol error + SOCKS verzió 5-s protokoll hiba + + + + General SOCKSv5 server failure + Általános SOCKSv5 szerver hiba + + + + Connection not allowed by SOCKSv5 server + A csatlakozást nem engedi a SOCKSv5 szerver + + + + TTL expired + Lejárt a TTL + + + + SOCKSv5 command not supported + SOCKSv5 parancs nincs támogatva + + + + Address type not supported + Cím típus nincs támogatva + + + + Unknown SOCKSv5 proxy error code 0x%1 + Ismeretlen SOCKSv5 proxy hiba kód 0x%1 + + + + Network operation timed out + Hálózat műveleti időtúllépés + + + + QSoftKeyManager + + + Ok + Ok + + + + Select + Kiválasztás + + + + Done + Kész + + + + Options + Opciók + + + + Cancel + Mégse + + + + Exit + Kilépés + + + + QSpinBox + + + More + Több + + + + Less + Kevés + + + + QSql + + + Delete + Törlés + + + + Delete this record? + Törölni szeretné ezt a felvételt? + + + + + + Yes + Igen + + + + + + No + Nem + + + + Insert + Beszúrás + + + + Update + Frissítés + + + + Save edits? + Szerkesztések mentése? + + + + Cancel + Mégse + + + + Confirm + Megerősítés + + + + Cancel your edits? + Szerkesztések visszavonása? + + + + QSslSocket + + + Unable to write data: %1 + Nem lehet adatot írni: %1 + + + + Error while reading: %1 + Hiba történt olvasás közben: %1 + + + + Error during SSL handshake: %1 + Hiba történt az SSL kézfogás közben: %1 + + + + Error creating SSL context (%1) + Hiba történt az SSL összefüggés (%1) létrehozása közben + + + + Invalid or empty cipher list (%1) + Érvénytelen vagy üres számjegy lista (%1) + + + + Private key does not certify public key, %1 + A privát kulcs nem igazolja a publikus kulcsot, %1 + + + + Error creating SSL session, %1 + Hiba történt az SSL szakasz létrehozása közben, %1 + + + + Error creating SSL session: %1 + Hiba történt az SSL szakasz létrehozása közben: %1 + + + + Cannot provide a certificate with no key, %1 + Nem lehet biztosítani egy igazolást kulcs nélkül, %1 + + + + Error loading local certificate, %1 + Hiba történt a helyi igazolás betöltése közben, %1 + + + + Error loading private key, %1 + Hiba történt a privát kulcs betöltése közben, %1 + + + + No error + Nincs hiba + + + + The issuer certificate could not be found + A problémás igazolás nem található + + + + The certificate signature could not be decrypted + Az igazolás aláírás titkosítását nem sikerült feloldani + + + + The public key in the certificate could not be read + Az igazolásban található publikus kulcsot nem sikerült olvasni + + + + The signature of the certificate is invalid + Az igazolás aláírása érvénytelen + + + + The certificate is not yet valid + Az igazolás még nem érvényes + + + + The certificate has expired + Az igazolás lejárt + + + + The certificate's notBefore field contains an invalid time + A mező érvénytelen idő tartalmazása előtt nincsen igazolás + + + + The certificate's notAfter field contains an invalid time + A mező érvénytelen idő tartalmazása után nincsen igazolás + + + + The certificate is self-signed, and untrusted + Az igazolás ön jelölt, és megbízhatatlan + + + + The root certificate of the certificate chain is self-signed, and untrusted + Az igazolás lánc rendszergazda igazolása ön jelölt és megbízhatatlan + + + + The issuer certificate of a locally looked up certificate could not be found + Egy helyileg utánanézett igazolás problémás igazolása nem található + + + + No certificates could be verified + Nem sikerült igazolást leellenőrizni + + + + One of the CA certificates is invalid + A CA igazolások egyike érvénytelen + + + + The basicConstraints path length parameter has been exceeded + Az alap megszorítási útvonal hossz paramétereket meghaladták + + + + The supplied certificate is unsuitable for this purpose + A szolgáltatott igazolás nem alkalmas erre a célra + + + + The root CA certificate is not trusted for this purpose + A rendszergazda CA igazolás nem megbízható erre a célra + + + + The root CA certificate is marked to reject the specified purpose + A rendszergazda CA igazolás a specializást cél megtagadására lett megjelölve + + + + The current candidate issuer certificate was rejected because its subject name did not match the issuer name of the current certificate + Az aktuális jelölt problémás igazolása meg lett tagadva, mert a téma neve nem egyezett az aktuális igazolás problémás nevével + + + + The current candidate issuer certificate was rejected because its issuer name and serial number was present and did not match the authority key identifier of the current certificate + Az aktuális jelölt problémás igazolása el lett utasítva, mert a problémás név és sorszám benyűjtva és nem egyezett az aktuális igazolás hitelesítési kulcs azonosítójával + + + + The peer did not present any certificate + A kortárs nem nyújtott be egyetlen igazolást sem + + + + The host name did not match any of the valid hosts for this certificate + A hoszt név nem egyezik egyetlen érvényes hoszttal sem erre az igazolásra + + + + Unknown error + Ismeretlen hiba + + + + QStateMachine + + + Missing initial state in compound state '%1' + Hiányzó kezdeti állapot összetett helyzetben '%1' + + + + Missing default state in history state '%1' + Hiányzó alapértelmezett állapot a történelmi állapotokban '%1' + + + + No common ancestor for targets and source of transition from state '%1' + Nincs közös őse az átmeneti céloknak és forrásnak a(z) '%1' helyzetből + + + + Unknown error + Ismeretlen hiba + + + + QSystemSemaphore + + + %1: does not exist + %1 : nem létezik + + + + + %1: out of resources + %1: kifogyott az erőforrásból + + + + + %1: permission denied + %1: Engedély megtagadva + + + + %1: already exists + %1: már létezik + + + + + %1: unknown error %2 + %1: ismeretlen hiba %2 + + + + QTDSDriver + + + Unable to open connection + Nem lehet megnyitni a kapcsolatot + + + + Unable to use database + Nem lehet az adatbázist használni + + + + QTabBar + + + Scroll Left + Görgetés balra + + + + Scroll Right + Görgetésre jobbra + + + + QTcpServer + + + Operation on socket is not supported + A socketen végzett művelet nem támogatott + + + + QTextControl + + + &Undo + &Visszavonás + + + + &Redo + &Megismétlés + + + + Cu&t + &Kivágás + + + + &Copy + &Másolás + + + + Copy &Link Location + &Link címének másolása + + + + &Paste + &Beillesztés + + + + Delete + Törlés + + + + Select All + Az összes kiválasztása + + + + QToolButton + + + + Press + Megnyomás + + + + + Open + Megnyitás + + + + QUdpSocket + + + This platform does not support IPv6 + Ez a platform nem támogatja az IPv6-t + + + + QUndoGroup + + + Undo + Visszavonás + + + + Redo + Megismétlés + + + + QUndoModel + + + <empty> + <üres> + + + + QUndoStack + + + Undo + Visszavonás + + + + Redo + Megismétlés + + + + QUnicodeControlCharacterMenu + + + LRM Left-to-right mark + LRM balról jobbra jelölés + + + + RLM Right-to-left mark + RLM jobbról balra jelölés + + + + ZWJ Zero width joiner + ZWJ Nulla szélességű asztalos + + + + ZWNJ Zero width non-joiner + ZWNJ Nulla szélességű nem asztalos + + + + ZWSP Zero width space + ZWSP Nulla szélességű hely + + + + LRE Start of left-to-right embedding + LRE Balról jobbra beágyazás kezdete + + + + RLE Start of right-to-left embedding + RLE Jobbról balra beágyazás kezdete + + + + LRO Start of left-to-right override + LRO Balról jobbra megsemmisítés kezdete + + + + RLO Start of right-to-left override + RLO Jobbról balra megsemmisítés kezdete + + + + PDF Pop directional formatting + PDF Kérirányú formázás benézése + + + + Insert Unicode control character + Unicode vezérlő karakter beszúrása + + + + QWebFrame + + + Request cancelled + Kérés visszavonva + + + + Request blocked + Kérés blokkolva + + + + Cannot show URL + Nem lehet megjeleníteni az URL-t + + + + Frame load interrupted by policy change + Irányvonal megváltozása miatt a szerkezet töltése megszakítva + + + + Cannot show mimetype + Nem lehet megjeleníteni mime típust + + + + File does not exist + A fájl nem létezik + + + + QWebPage + + + Submit + default label for Submit buttons in forms on web pages + Feltöltés + + + + Submit + Submit (input element) alt text for <input> elements with no alt, title, or value + Feltöltés + + + + Reset + default label for Reset buttons in forms on web pages + Helyreállítás + + + + Choose File + title for file button used in HTML forms + Fájl kiválasztása + + + + No file selected + text to display in file button used in HTML forms when no file is selected + Nincsen egyetlen fájl sem kiválasztva + + + + Open in New Window + Open in New Window context menu item + Megnyitás új ablakban + + + + Save Link... + Download Linked File context menu item + Link mentése... + + + + Copy Link + Copy Link context menu item + Link másolása + + + + Open Image + Open Image in New Window context menu item + Kép megnyitása + + + + Save Image + Download Image context menu item + Kép elmentése + + + + Copy Image + Copy Link context menu item + Kép másolása + + + + Open Frame + Open Frame in New Window context menu item + Szerkezet megnyitása + + + + Copy + Copy context menu item + Másolás + + + + Go Back + Back context menu item + Menj vissza + + + + Go Forward + Forward context menu item + Menj előre + + + + Stop + Stop context menu item + Leállítás + + + + Reload + Reload context menu item + Újratöltés + + + + Cut + Cut context menu item + Kivágás + + + + Paste + Paste context menu item + Beillesztés + + + + No Guesses Found + No Guesses Found context menu item + Nincs feltételezések találata + + + + Ignore + Ignore Spelling context menu item + Mellőzés + + + + Add To Dictionary + Learn Spelling context menu item + Hozzáadás a szótárhoz + + + + Search The Web + Search The Web context menu item + Keresés a weben + + + + Look Up In Dictionary + Look Up in Dictionary context menu item + Utánanézés szótárban + + + + Open Link + Open Link context menu item + Link megnyitása + + + + Ignore + Ignore Grammar context menu item + Mellőzés + + + + Spelling + Spelling and Grammar context sub-menu item + Helyesírás + + + + Show Spelling and Grammar + menu item title + Helyesírás és nyelvtan megjelenítése + + + + Hide Spelling and Grammar + menu item title + Helyesírás és nyelvtan elrejtése + + + + Check Spelling + Check spelling context menu item + Helyesírás ellenőrzés + + + + Check Spelling While Typing + Check spelling while typing context menu item + Helyesírás ellenőrzés gépelés közben + + + + Check Grammar With Spelling + Check grammar with spelling context menu item + Nyelvtani ellenőrzés helyesírás ellenőrzéssel + + + + Fonts + Font context sub-menu item + Betű + + + + Bold + Bold context menu item + Félkövér + + + + Italic + Italic context menu item + Dőlt + + + + Underline + Underline context menu item + Aláhúzás + + + + Outline + Outline context menu item + Kontúrozás + + + + Direction + Writing direction context sub-menu item + Irány összefüggések írás, menü elem + + + + Text Direction + Text direction context sub-menu item + Szöveg irány + + + + Default + Default writing direction context menu item + Alapértelmezett + + + + Left to Right + Left to Right context menu item + Balról jobbra + + + + Right to Left + Right to Left context menu item + Jobbról balra + + + + Loading... + Media controller status message when the media is loading + Betöltés... + + + + Live Broadcast + Media controller status message when watching a live broadcast + Élő bejelentés + + + + Audio Element + Media controller element + Audió elem + + + + Video Element + Media controller element + Videó elem + + + + Mute Button + Media controller element + Elnémítás gomb + + + + Unmute Button + Media controller element + Elnémítás megszűntetése gomb + + + + Play Button + Media controller element + Lejátszás gomb + + + + Pause Button + Media controller element + Szünet gomb + + + + Slider + Media controller element + Csúszka + + + + Slider Thumb + Media controller element + Csuszka ujj + + + + Rewind Button + Media controller element + Áttekercselés gomb + + + + Return to Real-time Button + Media controller element + A valós idejűre visszatérés gomb + + + + Elapsed Time + Media controller element + Eltelt idő + + + + Remaining Time + Media controller element + Fennmaradó idő + + + + Status Display + Media controller element + Státusz kijelzés + + + + Fullscreen Button + Media controller element + Teljes képernyő gomb + + + + Seek Forward Button + Media controller element + Keresés továbbítása gomb + + + + Seek Back Button + Media controller element + Keresés visszafele gomb + + + + Audio element playback controls and status display + Media controller element + Audió elem visszajátszás vezérlők és státusz kijelzés + + + + Video element playback controls and status display + Media controller element + Videó elem visszajátszás vezérlők és státusz kijelzés + + + + Mute audio tracks + Media controller element + Audió számok elnémítása + + + + Unmute audio tracks + Media controller element + Audió számok elnémításának megszűntetése + + + + Begin playback + Media controller element + Visszajátszás megkezdése + + + + Pause playback + Media controller element + Visszajátszás szüneteltetése + + + + Movie time scrubber + Media controller element + Film idő súroló + + + + Movie time scrubber thumb + Media controller element + Film idő súrolókörte + + + + Rewind movie + Media controller element + Film visszatekerése + + + + Return streaming movie to real-time + Media controller element + Özönlő filmek visszaadása a valós idő számára + + + + Current movie time + Media controller element + Az aktuális filmidő + + + + Remaining movie time + Media controller element + Fennmaradó filmidő + + + + Current movie status + Media controller element + Az aktuális film státusz + + + + Play movie in full-screen mode + Media controller element + Film lejátszása teljes képernyős módban + + + + Seek quickly back + Media controller element + Gyorsan visszafele keresés + + + + Seek quickly forward + Media controller element + Gyorsan előre keresés + + + + Indefinite time + Media time description + Bizonytalan idő + + + + %1 days %2 hours %3 minutes %4 seconds + Media time description + %1 nap %2 óra %3 perc %4 másodperc + + + + %1 hours %2 minutes %3 seconds + Media time description + %1 óra %2 perc %3 másodperc + + + + %1 minutes %2 seconds + Media time description + %1 perc %2 másodperc + + + + %1 seconds + Media time description + %1 másodperc + + + + Inspect + Inspect Element context menu item + Megtekintés + + + + No recent searches + Label for only item in menu that appears when clicking on the search field image, when no searches have been performed + Nincsenek utóbbi keresések + + + + Recent searches + label for first item in the menu that appears when clicking on the search field image, used as embedded menu title + Utóbbi keresések + + + + Clear recent searches + menu item in Recent Searches menu that empties menu's contents + Utóbbi keresések kiürítése + + + + Unknown + Unknown filesize FTP directory listing item + Ismeretlen + + + + Web Inspector - %2 + Web felügyelő - %2 + + + + %1 (%2x%3 pixels) + Title string for images + %1 (%2x%3 pixelek) + + + + Bad HTTP request + Érvénytelen HTTP kérés + + + + This is a searchable index. Enter search keywords: + text that appears at the start of nearly-obsolete web pages in the form of a 'searchable index' + Ez egy kereshető index. Gépelje be a kívánt kulcsszavakat: + + + + Scroll here + Görgetés ide + + + + Left edge + Bal szegély + + + + Top + Felül + + + + Right edge + Jobb szegély + + + + Bottom + Alul + + + + Page left + Lapozás balra + + + + Page up + Lapozás fel + + + + Page right + Lapozás jobbra + + + + Page down + Lapozás balra + + + + Scroll left + Görgetés balra + + + + Scroll up + Görgetés fel + + + + Scroll right + Görgetés jobbra + + + + Scroll down + Görgetés lefele + + + + %n file(s) + number of chosen file + + %n fájl + + + + + JavaScript Alert - %1 + JavaSzkript figyelmeztetés - %1 + + + + JavaScript Confirm - %1 + JavaSzkript megerősítés - %1 + + + + JavaScript Prompt - %1 + JavaSzkript prompt - %1 + + + + JavaScript Problem - %1 + JavaSzkript probléma - %1 + + + + The script on this page appears to have a problem. Do you want to stop the script? + Az ezen a lapon található szkriptnek úgy tűnik, hogy van egy problémája. Le szeretné állítani a szkriptet? + + + + Move the cursor to the next character + Az egér mozgatása a következő karakterre + + + + Move the cursor to the previous character + Az egér mozgatása az előző karakterre + + + + Move the cursor to the next word + Az egér mozgatása a következő szóra + + + + Move the cursor to the previous word + Az egér mozgatása az előző szóra + + + + Move the cursor to the next line + Az egér mozgatása a következő sorra + + + + Move the cursor to the previous line + Az egér mozgatása az előző sorra + + + + Move the cursor to the start of the line + Az egér mozgatása a sor elejére + + + + Move the cursor to the end of the line + Az egér mozgatása a sor végére + + + + Move the cursor to the start of the block + Az egér mozgatása a blokk elejére + + + + Move the cursor to the end of the block + Az egér mozgatása a blokk végére + + + + Move the cursor to the start of the document + Az egér mozgatása a dokumentum elejére + + + + Move the cursor to the end of the document + Az egér mozgatása a dokumentum végére + + + + Select all + Az összes kiválasztása + + + + Select to the next character + A következő karakter kiválasztása + + + + Select to the previous character + Az előző karakter kiválasztása + + + + Select to the next word + A következő szó kiválasztása + + + + Select to the previous word + Az előző szó kiválasztása + + + + Select to the next line + A következő sor kiválasztása + + + + Select to the previous line + Az előző sor kiválasztása + + + + Select to the start of the line + A sor elejének kiválasztása + + + + Select to the end of the line + A sor végének kiválasztása + + + + Select to the start of the block + A blokk elejének kiválsztása + + + + Select to the end of the block + A blokk végének kiválasztása + + + + Select to the start of the document + A dokumentum elejének kiválasztása + + + + Select to the end of the document + A dokumentum végének kiválasztása + + + + Delete to the start of the word + A szó elejének törlése + + + + Delete to the end of the word + A szó végének törlése + + + + Insert a new paragraph + Egy új bekezdés beszúrása + + + + Insert a new line + Egy új sor beszúrása + + + + Paste and Match Style + Stílus beillesztése és összepasszintása + + + + Remove formatting + Formázás eltávolítása + + + + Strikethrough + Áthúzás + + + + Subscript + Alsó index + + + + Superscript + Felső index + + + + Insert Bulleted List + Hivatalos közlemény lista beszúrása + + + + Insert Numbered List + Számozott lista beszúrása + + + + Indent + Behúzás + + + + Outdent + Behúzás kifelé + + + + Center + Közép + + + + Justify + Igazolás + + + + Align Left + Balra állít + + + + Align Right + Jobbra állít + + + + QWhatsThisAction + + + What's This? + Mi ez? + + + + QWidget + + + * + * + + + + QWizard + + + Cancel + Mégse + + + + Help + Súgó + + + + < &Back + < &Vissza + + + + &Finish + &Befejezés + + + + &Help + &Súgó + + + + Go Back + Vissza ugrás + + + + Continue + Folytatás + + + + Commit + Kommit + + + + Done + Kész + + + + &Next + &Következő + + + + &Next > + &Következő > + + + + QWorkspace + + + &Restore + &Visszaállítás + + + + &Move + &Mozgatás + + + + &Size + &Méret + + + + Mi&nimize + &Minimalizálás + + + + Ma&ximize + Ma&ximalizálás + + + + &Close + &Bezárás + + + + Stay on &Top + &Tetején maradni + + + + Minimize + Minimalizálás + + + + Restore Down + Letárolás + + + + Close + Bezárás + + + + + Sh&ade + Árnya&lat + + + + + %1 - [%2] + %1 - [%2] + + + + &Unshade + &Leeresztés + + + + QXml + + + no error occurred + nem történt hiba + + + + error triggered by consumer + Ügyfél által előidézett hiba + + + + unexpected end of file + Váratlan fájlvég + + + + more than one document type definition + Több mint egy dokumentum típus definíció + + + + error occurred while parsing element + Hiba történt az elem elemzése közben + + + + tag mismatch + Nem egyező címke + + + + error occurred while parsing content + Hiba történt a tartalom elemzése közben + + + + unexpected character + váratlan karakter + + + + invalid name for processing instruction + érvénytelen név az utasítás feldolgozására + + + + version expected while reading the XML declaration + várt verzió az XML deklaráció olvasása közben + + + + wrong value for standalone declaration + Hibás egyedülálló deklaráció érték + + + + error occurred while parsing document type definition + Hiba történt a dokumentum típus definíció elemzése közben + + + + letter is expected + betű várt + + + + error occurred while parsing comment + hiba történt az elemző megjegyzés előfordulása közben + + + + error occurred while parsing reference + Hiba történt az elemző hivatkozás előfordulása közben + + + + internal general entity reference not allowed in DTD + A DTD-ben nem engedélyezett a belső általános valós hivatkozás + + + + external parsed general entity reference not allowed in attribute value + Az attribútum értékben nem engedélyezett a külsőleg elemzett általános valós hivatkozás + + + + external parsed general entity reference not allowed in DTD + A DTD-ben nem engedélyezett a külsőleg elemzett általános valós hivatkozás + + + + unparsed entity reference in wrong context + Hivatkozás egy nem értelmezett entitásra hibás összefüggésben + + + + recursive entities + Rekurzív entitások + + + + error in the text declaration of an external entity + Hiba egy külső entitás szöveg deklarációjában + + + + encoding declaration or standalone declaration expected while reading the XML declaration + Kódolása deklaráció vagy egyedülálló deklaráció várt az XML deklaráció olvasása közben + + + + standalone declaration expected while reading the XML declaration + Egyedülálló deklaráció várt az XML deklaráció olvasása közben + + + + QXmlPatternistCLI + + + Warning in %1, at line %2, column %3: %4 + Figyelmeztetés %1-ben, %2 sorban, %3 oszlopban: %4 + + + + Warning in %1: %2 + Figyelmeztetés %1-ben: %2 + + + + Unknown location + Ismeretlen elhelyezkedés + + + + Error %1 in %2, at line %3, column %4: %5 + %1 hiba %2-ben, %3 sorban, %4 oszlopban: %5 + + + + Error %1 in %2: %3 + %1 hiba %2-ben: %3 + + + + QXmlStream + + + + Extra content at end of document. + Extra tartalom a dokumentum végén. + + + + Invalid entity value. + Érvénytelen entitás érték. + + + + Invalid XML character. + Érvénytelen XML karakter. + + + + Sequence ']]>' not allowed in content. + ']]>' sor nem engedélyezett a tartalomban. + + + + Namespace prefix '%1' not declared + '%1' névtér előtag nincsen deklarálva + + + + Attribute redefined. + Attribútum újradefiniálva. + + + + Unexpected character '%1' in public id literal. + Váratlan karakter '%1' a publikus azonosító literál. + + + + Invalid XML version string. + Érvénytelen XML verzió sztring. + + + + Unsupported XML version. + Nem támogatott XML verzió. + + + + %1 is an invalid encoding name. + %1 egy érvénytelen kódolási név. + + + + Encoding %1 is unsupported + %1 kódolás nem támogatva + + + + Standalone accepts only yes or no. + Egyedülálló elfogadás kizárólas igen vagy nem. + + + + Invalid attribute in XML declaration. + Érvénytelen attribútum az XML deklarációban. + + + + Premature end of document. + Túl korai dokumentum vég. + + + + Invalid document. + Érvénytelen dokumentum. + + + + Expected + Várt + + + + , but got ' + , pedig megkapta ' + + + + Unexpected ' + Váratlan ' + + + + Expected character data. + Várt karakter adat. + + + + Recursive entity detected. + Rekurzív entitás észlelve. + + + + Start tag expected. + Kezdő címke várva. + + + + XML declaration not at start of document. + XML deklaráció nem a dokumentum elején található. + + + + NDATA in parameter entity declaration. + NDATA a paraméter entitás deklarációban. + + + + %1 is an invalid processing instruction name. + %1 egy érvénytelen feldolgozó utasítás neve. + + + + Invalid processing instruction name. + Érvénytelen feldolgozó utasítás név. + + + + + + + Illegal namespace declaration. + Illegális névtér deklarációk. + + + + Invalid XML name. + Érvénytelen XML név. + + + + Opening and ending tag mismatch. + Nyitó és záró címkék nem egyeznek. + + + + Reference to unparsed entity '%1'. + Hivatkozás egy nem értelmezett entitásra '%1'. + + + + + + Entity '%1' not declared. + '%1' entitás nincsen deklarálva. + + + + Reference to external entity '%1' in attribute value. + Hivatkozás egy külső entitásra '%1' az attribútum értékben. + + + + Invalid character reference. + Érvénytelen karakter hivatkozás. + + + + + Encountered incorrectly encoded content. + Helytelen kódolási tartalommal találta szembe magát. + + + + The standalone pseudo attribute must appear after the encoding. + Az egyedülálló ál attribútumnak a kódolás után kell feltűnnie. + + + + %1 is an invalid PUBLIC identifier. + %1 egy érvénytelen PUBLIC-us azonosító. + + + + QtXmlPatterns + + + + At least one component must be present. + Legalább egy komponenset be kell nyújtani. + + + + %1 is not a valid value of type %2. + %1 nem egy érvény értéke a(z) %2 típusnak. + + + + When casting to %1 from %2, the source value cannot be %3. + A(z) %1-ről %2-re történő kasztoláskor, a forrás érték nem lehet %3. + + + + Effective Boolean Value cannot be calculated for a sequence containing two or more atomic values. + Hatékony logikai értéket nem lehet egy sor számára kiszámítani, amely kettő vagy több atomikus értéket tartalmaz. + + + + The data of a processing instruction cannot contain the string %1 + Egy feldolgozó utasítás adata nem tartalmazhat %1 sztringet + + + + + %1 is an invalid %2 + %1 egy érvénytelen %2 + + + + %1 is not a valid XML 1.0 character. + %1 egy érvénytelen 1.0 XML karakter. + + + + %1 was called. + %1 lett meghívva. + + + + In the replacement string, %1 must be followed by at least one digit when not escaped. + A kicserélési sztrinben, %1 -t legalább egy számnak kell követnie nem meneküléskor. + + + + In the replacement string, %1 can only be used to escape itself or %2, not %3 + A kicserelési sztringben, %1-t csak magának a(z) %2 vagy %3 menekülésére lehet használni + + + + %1 matches newline characters + %1 megegyező újsor karakterek + + + + Matches are case insensitive + Az egyezés kis és nagybetűre nem érzékeny + + + + %1 is an invalid regular expression pattern: %2 + %1 egy érvénytelen reguláris kifejezés minta: %2 + + + + It will not be possible to retrieve %1. + Nem lesz lehetséges kinyerni %1. + + + + The default collection is undefined + Az alapértelmezett gyűjtemény nincs definiálva + + + + %1 cannot be retrieved + %1 nem lehet megszerezni + + + + The item %1 did not match the required type %2. + A(z) %1 elem nem egyezik a szükséges típussal %2. + + + + + %1 is an unknown schema type. + %1 egy ismeretlen terv típus. + + + + A template with name %1 has already been declared. + Egy %1 nevű sablon már deklarálva van. + + + + Only one %1 declaration can occur in the query prolog. + Kizárólag egy %1 deklaráció fordulhat elő a kérdéses előszóban. + + + + The initialization of variable %1 depends on itself + A(z) %1 változó inicializálása önmagától függ + + + + The variable %1 is unused + A(z) %1 változó nincsen használva + + + + Version %1 is not supported. The supported XQuery version is 1.0. + %1-es verzió nem támogatott. A támogatott XQuery verzió az 1.0. + + + + No function with signature %1 is available + Nincs %1 aláírással rendelkező függvény + + + + It is not possible to redeclare prefix %1. + Nem lehetséges a(z) %1 előtag újradeklarálása. + + + + Prefix %1 is already declared in the prolog. + %1 előtag már deklarálva van az előszóban. + + + + The name of an option must have a prefix. There is no default namespace for options. + Az opció nevének tartalmaznia kell egy előtagot. Nincs alapértelmezett névtér ezekre az opciókra. + + + + The Schema Import feature is not supported, and therefore %1 declarations cannot occur. + A terv importálása tulajdonság nem támogatott, és ennek következtében a(z) %1 deklarációk nem fordulhatnak elő. + + + + The target namespace of a %1 cannot be empty. + Egy %1 cél névtere nem lehet üres. + + + + The module import feature is not supported + A modul importáló tulajdonság nem támogatott + + + + The namespace of a user defined function in a library module must be equivalent to the module namespace. In other words, it should be %1 instead of %2 + Egy felhasználó által definiált függvény névterének egy könyvtár modulban megfelelőnek kell lenni a modul névtérrel. Más szóval, %1-nek kellene lennie %2 helyett + + + + A function already exists with the signature %1. + Egy függvény már létezik ezzel az aláírással %1. + + + + No external functions are supported. All supported functions can be used directly, without first declaring them as external + Kulső függvények nincsenek támogatva. Az összes támogatott függvényt lehet közvetlenül haszálni, az első külső deklarálásuk nélkül + + + + The %1-axis is unsupported in XQuery + A(z) %1 tengely nem támogatott az XQuery-ben + + + + The namespace URI cannot be the empty string when binding to a prefix, %1. + Az URI névtér nem lehet üres sztring egy előtaghoz való összeköttetéskor, %1. + + + + %1 is an invalid namespace URI. + %1 egy érvénytelen URI névtér. + + + + It is not possible to bind to the prefix %1 + Nem lehetséges a(z) %1 előtaggal összekötni + + + + Two namespace declaration attributes have the same name: %1. + Két névtér deklaráció attribútumnak ugyanaz a neve: %1. + + + + The namespace URI must be a constant and cannot use enclosed expressions. + Az URI névtérnek állandónak kell lennie és nem használhat elhatárolt kifejezéseket. + + + + + %1 is not in the in-scope attribute declarations. Note that the schema import feature is not supported. + %1 nem a hatókör attribútum deklarációin belül található. Vegye figyelembe, hogy a terv importáló tulajdonság nem támogatott. + + + + empty + üres + + + + zero or one + nulla vagy egy + + + + exactly one + pontosan egy + + + + one or more + egy vagy több + + + + zero or more + nulla vagy több + + + + The focus is undefined. + A fókusz nincs definiálva. + + + + An attribute by name %1 has already been created. + Egy %1 nevű attribútum már létre lett hozva. + + + + Network timeout. + Hálózati időtúllépés. + + + + Element %1 can't be serialized because it appears outside the document element. + %1 elemet nem lehet besorolni, mert úgy tűnik a dokumentum elem külső oldalán található. + + + + Year %1 is invalid because it begins with %2. + %1 év érvénytelen, mert %2-vel kezdődik. + + + + Day %1 is outside the range %2..%3. + %1 nap a tartomány külsp oldalán van %2..%3. + + + + Month %1 is outside the range %2..%3. + %1 hónap a tartomány külső felületén van %2..%3. + + + + Overflow: Can't represent date %1. + Túlcsordulás: Nem lehet feltünteti a(z) %1 dátumot. + + + + Day %1 is invalid for month %2. + %1 nap érvénytelen a(z) %2 hónapra vonatkozólag. + + + + Time 24:%1:%2.%3 is invalid. Hour is 24, but minutes, seconds, and milliseconds are not all 0; + Idő 24:%1:%2:%3 érvénytelen. Az óra 24, de a perc, másodperc, és milliszekundum egyáltalán nem 0; + + + + Time %1:%2:%3.%4 is invalid. + Idő %1:%2:%3.%4 érvénytelen. + + + + Overflow: Date can't be represented. + Túlcsordulás: A dátumot nem lehet feltüntetni. + + + + At least one time component must appear after the %1-delimiter. + Legalább egy idő komponensnek lennie kell a(z) %1 határolójel után. + + + + + Dividing a value of type %1 by %2 (not-a-number) is not allowed. + %1 típus értékének osztása egy %2(nem szám)-mal nem engedélyezett. + + + + Dividing a value of type %1 by %2 or %3 (plus or minus zero) is not allowed. + %1 típus értékének osztása egy %2 vagy %3(plusz vagy minusz nulla)-mal nem engedélyezett. + + + + Multiplication of a value of type %1 by %2 or %3 (plus or minus infinity) is not allowed. + %1 típusú érték %2 vagy %3-mal való szorzása(plusz vagy minusz végtelen) nem engedélyezett. + + + + A value of type %1 cannot have an Effective Boolean Value. + %1 típusú értéknek nincsen hatékony logikai értéke. + + + + Value %1 of type %2 exceeds maximum (%3). + %2 típus %1 értéke elérte a maxiumot (%3). + + + + Value %1 of type %2 is below minimum (%3). + %1 típus %2 értéke a minimum alatt van (%3). + + + + A value of type %1 must contain an even number of digits. The value %2 does not. + %1 típus értékének tartalmaznia kell egy páratlan számú számot. A(z) %2 érték nem. + + + + %1 is not valid as a value of type %2. + %1 érvénytelen %2 típusú értékként. + + + + Operator %1 cannot be used on type %2. + %1 műveletet nem lehet a(z) %2 típuson használni. + + + + Operator %1 cannot be used on atomic values of type %2 and %3. + %1 műveletet nem lehet a %2 és %3-as típusú atomikus értéken használni. + + + + The namespace URI in the name for a computed attribute cannot be %1. + Az URI névtér a névben számított attribútumra nem lehet %1. + + + + The name for a computed attribute cannot have the namespace URI %1 with the local name %2. + Egy kiszámított attribútumnak nem lehet %1 URI névtere %2 helyi névvel. + + + + Type error in cast, expected %1, received %2. + Típus hiba a kasztolásban, %1 várt, %2 kapott. + + + + When casting to %1 or types derived from it, the source value must be of the same type, or it must be a string literal. Type %2 is not allowed. + %1-re kasztoláskor vagy típus származtatáskor, a forrás értéknek ugyanolyan típusúnak kell lennie, vagy sztring literálnak kell lennie. %2 típus nem engedélyezett. + + + + A comment cannot contain %1 + A megjegyzés nem tartalmazhat %1-t + + + + A comment cannot end with a %1. + A megjegyzés nem végződget %1-gyel. + + + + An attribute node cannot be a child of a document node. Therefore, the attribute %1 is out of place. + Az attribútum csomópont egy dokumentum csomópont gyermeke. Ennek következtében a(z) %1 attribútum nem helyénvaló. + + + + A library module cannot be evaluated directly. It must be imported from a main module. + A köbyvtár modult nem lehet közvetlenül kiértékelni. A fő modulból kell importálni. + + + + No template by name %1 exists. + %1 nevű sablon nem létezik. + + + + A value of type %1 cannot be a predicate. A predicate must have either a numeric type or an Effective Boolean Value type. + A(z) %1 típus értéke egy állítmány. Egy állítmánynak tartalmaznia kell vagy egy szám típust vagy egy effektív logikai érték típust. + + + + A positional predicate must evaluate to a single numeric value. + A helyzet állítmányt egy egyetlen szám értékként kell kiértékelni. + + + + The target name in a processing instruction cannot be %1 in any combination of upper and lower case. Therefore, %2 is invalid. + A cél neve egy utasítás feldolgozásban nem lehet %1 kis és nagybetűk bármely kombinációjában. Ennek következtében a(z) %2 érvénytelen. + + + + %1 is not a valid target name in a processing instruction. It must be a %2 value, e.g. %3. + %1 nem egy érvényes cél név az utasítás feldolgozásban. %2 vagy %3 értéknek kell lennie. + + + + The last step in a path must contain either nodes or atomic values. It cannot be a mixture between the two. + Az utolsó lépésnek vagy csomópontokat vagy atomikus értékeket kell tartalmaznia. Ez nem lehet a kettő közötti keverék. + + + + No namespace binding exists for the prefix %1 + Nem létezik névtér összeköttetés a(z) %1 előtagra + + + + No namespace binding exists for the prefix %1 in %2 + Nem létezik névtér összeköttetés a(z) %1 előtagra %2-ben + + + + The first argument to %1 cannot be of type %2. It must be a numeric type, xs:yearMonthDuration or xs:dayTimeDuration. + Az első argumentum %1 nem lehet %2 típusú. Egy számos típusnak kelle lennie, xs:évHónapIdőtartam vagy xs:napIdőTartam. + + + + The first argument to %1 cannot be of type %2. It must be of type %3, %4, or %5. + Az első argumentum %1 nem lehet %2 típusú. %3, %4 vagy %5 típusúnak kell lennie. + + + + The second argument to %1 cannot be of type %2. It must be of type %3, %4, or %5. + Az második argumentum %1 nem lehet %2 típusú. %3, %4 vagy %5 típusúnak kell lennie. + + + + If both values have zone offsets, they must have the same zone offset. %1 and %2 are not the same. + Ha mindkét értéknek zóna eltolása van, ugyanazt a zóna eltolást kell tartalmazniuk. %1 és %2 nem ugyanaz. + + + + %1 must be followed by %2 or %3, not at the end of the replacement string. + %1-t %2 vagy %3-nak kell követnie, nem a kicserélési sztring végén. + + + + %1 and %2 match the start and end of a line. + %1 és %2 egyezik a sor elején és végén. + + + + Whitespace characters are removed, except when they appear in character classes + Nem látható karakterek eltávolítva, kivéve mikor karakter osztályokban tűnnek fel + + + + %1 is an invalid flag for regular expressions. Valid flags are: + %1 egy érvénytelen jelző reguláris kifejezésekre. Érvényes flagek: + + + + If the first argument is the empty sequence or a zero-length string (no namespace), a prefix cannot be specified. Prefix %1 was specified. + Ha az első argumentum üres sorozat vagy nulla hosszúságú sztring (nincsen névtér), egy előtagot nem lehet meghatározni. %1 előtag volt meghatározva. + + + + The normalization form %1 is unsupported. The supported forms are %2, %3, %4, and %5, and none, i.e. the empty string (no normalization). + A(z) %1 szabványosítási forma nem támogatott. A támogatott formák %2, %3, %4 és %5 és semmi más, lásd az üres sztringet (nincs szabványosítás). + + + + A zone offset must be in the range %1..%2 inclusive. %3 is out of range. + A zóna eltolásnak a(z) %1..%2 tartományban kell benne lennie. %3 az tartományon kívüli. + + + + Required cardinality is %1; got cardinality %2. + Szükséges számosság %1, szerzett számosság %2. + + + + The encoding %1 is invalid. It must contain Latin characters only, must not contain whitespace, and must match the regular expression %2. + A(z) %1 kódolás érvénytelen. Kizárólag latin karaktereket kell tartalmaznia, nem szabad látható karaktereket tartalmaznia, és a(z) %2 reguláris kifejezéssel kell megegyeznie. + + + + The keyword %1 cannot occur with any other mode name. + A(z) %1 kulcscszó nem fordulhat elő semmilyen más mód névvel. + + + + No variable with name %1 exists + %1 nevű változó nem létezik + + + + The value of attribute %1 must be of type %2, which %3 isn't. + A(z) %1 attribútumnak %2 típusúnak kell lennie, amelyik nem %3-as. + + + + The prefix %1 cannot be bound. By default, it is already bound to the namespace %2. + A(z) %1 előtagot nem lehet összekötni. Alapértelmezetten, már hozzá van kötve a %2 névtérhez. + + + + A variable with name %1 has already been declared. + %1 nevű változó már deklarálva van. + + + + No value is available for the external variable with name %1. + %1 nevű külső változóhoz nem érhető el érték. + + + + A stylesheet function must have a prefixed name. + A stíluslap függvénynek tartalmaznia kell egy előtag nevet. + + + + The namespace %1 is reserved; therefore user defined functions may not use it. Try the predefined prefix %2, which exists for these cases. + A(z) %1 névtér foglalt, ennek következtében a felhasználó által definiált függvényt nem lehet használni. Próbálja ki az előredefiniált %2 előtagot, amely erre az esetekre van kitalálva. + + + + An argument with name %1 has already been declared. Every argument name must be unique. + Egy %1 nevű argumentum már deklarálva van. Minden argumentum névnek egyedülállónak kell lennie. + + + + When function %1 is used for matching inside a pattern, the argument must be a variable reference or a string literal. + Mikor %1 függvény van használva egyeztetése egy mintán belül, az argumentumnak egy változó hivatkozásnak vagy egy sztring literálnak kell lennie. + + + + In an XSL-T pattern, the first argument to function %1 must be a string literal, when used for matching. + Egy XSLT mintában, az első argumentumnak a(z) %1 függvényre egy sztring literálnak kell lennie, amikor egyeztetésre használják. + + + + In an XSL-T pattern, the first argument to function %1 must be a literal or a variable reference, when used for matching. + Egy XSLT mintában, az első argumentumnak a(z) %1 függvény esetén egy literálnak vagy egy változó hibatkozásnak kell lennie, mikor egyeztetésre használják. + + + + In an XSL-T pattern, function %1 cannot have a third argument. + Egy XSLT mintában, %1 függvénynek nem lehet egy harmadik argumentuma. + + + + In an XSL-T pattern, only function %1 and %2, not %3, can be used for matching. + Egy XSLT mintában, kizárólag a(z) %1 és %2 függvényeket, és %3-at nem lehet egyeztetésre használni. + + + + In an XSL-T pattern, axis %1 cannot be used, only axis %2 or %3 can. + Egy XSLT mintában, %1 tengelyt nem lehet használni, kizárólag a(z) %2 vagy %3 tengelyeket. + + + + %1 is an invalid template mode name. + %1 egy érvénytelen sablon mód név. + + + + The name of a variable bound in a for-expression must be different from the positional variable. Hence, the two variables named %1 collide. + Egy változó összeköttetés nevének egy for kifejezésben különböznie kell a pozícionális változótol. Ezért, a két %1 nevű változó ütközik. + + + + The Schema Validation Feature is not supported. Hence, %1-expressions may not be used. + A terv jóváhagyási tulajdonság nem támogatott. Ezért, %1 kifejezést nem lehet használni. + + + + None of the pragma expressions are supported. Therefore, a fallback expression must be present + A pragma kifejezések egyike sem támogatott. Ezért egy visszavonuló kifejezést kell nyújtani + + + + Each name of a template parameter must be unique; %1 is duplicated. + Sablon paraméter mindegyik nevének egyedülállónak kell lennie, %1 az duplikáns. + + + + No function with name %1 is available. + %1 nevű függvény nem elérhető. + + + + %1 is not a valid numeric literal. + %1 nem egy érvényes számos literál. + + + + W3C XML Schema identity constraint selector + W3C XML terv azonosító megszorító kiválasztó + + + + W3C XML Schema identity constraint field + W3C XML Terv azonosító megszorító mező + + + + A construct was encountered which is disallowed in the current language(%1). + Egy olyan konstruktort talált amelyik nincsen engedélyezve az aktuális nyelvben(%1). + + + + Namespace %1 can only be bound to %2 (and it is, in either case, pre-declared). + %1 névteret kizárólag a %2-vel lehet összekötni (és ennyi, vagy mindkét esetben, előre deklarált). + + + + Prefix %1 can only be bound to %2 (and it is, in either case, pre-declared). + %1 előtagot kizárólag a %2-vel lehet összekötni (és ennyi, vagy mindkét esetben, előre deklarált). + + + + An attribute with name %1 has already appeared on this element. + %1 attribútum név már van ebben az elemben. + + + + A direct element constructor is not well-formed. %1 is ended with %2. + Egy közvetlen elem konstruktor, mely nincsen jól megformázva. %1 a(z) %2-ben végzőik. + + + + The name %1 does not refer to any schema type. + A(z) %1 név nem vonatkozik egyetlen terv típusra sem. + + + + %1 is an complex type. Casting to complex types is not possible. However, casting to atomic types such as %2 works. + %1 egy összetett típus. Összetett típusra kasztolás nem lehetséges. De egy atomikus típusra mint egy %2 működik. + + + + %1 is not an atomic type. Casting is only possible to atomic types. + %1 nem egy atomikus típus. Kaszolás kizárólag csak atomikus típusra lehetséges. + + + + %1 is not a valid name for a processing-instruction. + %1 nem egy érvényes név egy utasítás feldolgozásra. + + + + The name of an extension expression must be in a namespace. + Egy kifejezés kiterjesztés nevének egy névtérben kell lennie. + + + + Required type is %1, but %2 was found. + %1 a szükséges típus, de %2 található. + + + + Promoting %1 to %2 may cause loss of precision. + %1 elősegítése %2-re precíziós vesztést okozhat. + + + + It's not possible to add attributes after any other kind of node. + Nem lehetséges attribútumokat hozzáadni, bármely másik csomópont után. + + + + Only the Unicode Codepoint Collation is supported(%1). %2 is unsupported. + Kizárólag a Unicode Kódpontos összevetés támogatott(%1). %2 nem támogatott. + + + + Integer division (%1) by zero (%2) is undefined. + Egész számos (%1) osztás nullával (%2) nem definiált. + + + + Division (%1) by zero (%2) is undefined. + Osztás (%1) nullával (%2) nem definiált. + + + + Modulus division (%1) by zero (%2) is undefined. + Tényezős osztás (%1) nullával (%2) nem definiált. + + + + %1 takes at most %n argument(s). %2 is therefore invalid. + + %1 legalább %n argumentumot vár. A(z) %2 ennel következtében érvénytelen. + + + + + %1 requires at least %n argument(s). %2 is therefore invalid. + + %1 legalább %n argumentumot igényel. Ennek következtében a(z) %2 érvénytelen. + + + + + The root node of the second argument to function %1 must be a document node. %2 is not a document node. + A második argumentum rendszergazda csomópontja %1 függvényre dokumentum csomópontnak kell lenni. %2 nem egy dokumentum csomópont. + + + + The namespace for a user defined function cannot be empty (try the predefined prefix %1 which exists for cases like this) + A névtér a felhasználó által definiált függvényre nem lehet üres (próbálja ki az előredefiniált %1 előtagot, mely innen esetekre lett kitalálva) + + + + + A default namespace declaration must occur before function, variable, and option declarations. + Egy alapértelmezett névtér deklarációnak a függvény, változó, és opció deklarációk előtt kell elhelyezkednie. + + + + Namespace declarations must occur before function, variable, and option declarations. + A névtér deklarációnak a függvény, változó, és opció deklarációk előtt kell elhelyezkednie. + + + + Module imports must occur before function, variable, and option declarations. + Modul importálásnak a függvény, változó, és opció deklarációk előtt kell elhelyezkednie. + + + + %1 is not a whole number of minutes. + %1 nem egy egész számú perc érték. + + + + Attribute %1 can't be serialized because it appears at the top level. + %1 attribtútumot nem lehet sorozatosítani, mert legfelső szinten tűnik fel. + + + + %1 is an unsupported encoding. + %1 egy nem támogatott kódolás. + + + + %1 contains octets which are disallowed in the requested encoding %2. + %1 oktálisokat tartalmat, melyek tiltva vannak a lekérdezett %2 kódolásban. + + + + The codepoint %1, occurring in %2 using encoding %3, is an invalid XML character. + A kódpont %1, mely a %2-ben fordul elő %3 kódolást használva, egy érvénytelen XML karakter. + + + + Ambiguous rule match. + Bizonytalan szabály egyezés. + + + + In a namespace constructor, the value for a namespace cannot be an empty string. + Egy névtér konstruktorban, egy névtér értéke nem lehet egy üres sztring. + + + + The prefix must be a valid %1, which %2 is not. + Az előtagnak egy érvényes %1-nek kell lennie, %2 nem lehet. + + + + The prefix %1 cannot be bound. + A(z) %1 előtagot nem lehet összekötni. + + + + Only the prefix %1 can be bound to %2 and vice versa. + Kizárólag a(z) %1 előtagot lehet összekötni a %2-vel és fordítva. + + + + The parameter %1 is required, but no corresponding %2 is supplied. + A(z) %1 paraméter követelik, de nincs megelelő %2 támogatás hozzá. + + + + The parameter %1 is passed, but no corresponding %2 exists. + A(z) %1 paraméter teljesítve, de a megfelelő %2 nem létezik. + + + + The URI cannot have a fragment + Az URI nem tartalmaz tördezettséget + + + + Element %1 is not allowed at this location. + %1 elem nincs engedélyezve ezen a ponton. + + + + Text nodes are not allowed at this location. + Szöveg csomópontok nincsenek engedélyezve ezen a ponton. + + + + Parse error: %1 + Elemzési hiba: %1 + + + + The value of the XSL-T version attribute must be a value of type %1, which %2 isn't. + XSLT verzió attribútum értékének %1 típusú értéknek kell lennie, %2 nem lehet. + + + + Running an XSL-T 1.0 stylesheet with a 2.0 processor. + Egy XSLT 1.0 stíluslap egy 2.0 feldolgozóval való futtatása. + + + + Unknown XSL-T attribute %1. + Ismeretlen XSLT attribútum %1. + + + + Attribute %1 and %2 are mutually exclusive. + A(z) %1 és %2 attribútum kölcsönösen kizárják egymást. + + + + In a simplified stylesheet module, attribute %1 must be present. + Egy leegyszerűsített stíluslap modulban, %1 attribútumot kell nyújtani. + + + + If element %1 has no attribute %2, it cannot have attribute %3 or %4. + Ha a(z) %1 elem nem tartalmaz %2 attribútumot, akkor nem tartalmazhat %3 vagy %4 attribútumot. + + + + Element %1 must have at least one of the attributes %2 or %3. + %1 elemnek legalább egy %2 vagy %3 attribútumot kell tartalmaznia. + + + + At least one mode must be specified in the %1-attribute on element %2. + Legalább egy csomópontot meg kell határozni a(z) %1 attribútumban a(z) %2 elemen. + + + + Element %1 must come last. + %1 elemnek kell utoljára következnie. + + + + At least one %1-element must occur before %2. + Legalább egy %1 elemnek kell előfordulnia %2 előtt. + + + + Only one %1-element can appear. + Csak egy %1 elem jelenhet meg. + + + + At least one %1-element must occur inside %2. + Legalább egy %1 elem fordulhat elő %2-n belül. + + + + When attribute %1 is present on %2, a sequence constructor cannot be used. + Mikor %1 attribútuk van benyújtva %2-n, egy sorozat konstruktort nem lehet használni. + + + + Element %1 must have either a %2-attribute or a sequence constructor. + %1 elemnek vagy egy %2 attribútumot vagy egy sorozat konstruktort kell tartalmaznia. + + + + When a parameter is required, a default value cannot be supplied through a %1-attribute or a sequence constructor. + Amikor egy paramétert igényel, egy alapértelmezett érték ellátni egy %1 attribútum vagy egy sorozat konstruktoron keresztül. + + + + Element %1 cannot have children. + %1 elem nem tartalmazhat gyereket. + + + + Element %1 cannot have a sequence constructor. + %1 elem nem tartalmazhat egy sorozat konstruktort. + + + + + The attribute %1 cannot appear on %2, when it is a child of %3. + A(z) %1 attribútum nem jelenhet meg %2-n, mikor egy %3 gyereke. + + + + A parameter in a function cannot be declared to be a tunnel. + Egy paramétert nem lehet behangoltnak deklarálni egy függvényben. + + + + This processor is not Schema-aware and therefore %1 cannot be used. + Ez a feldolgozó nem terv biztos és ennek következtében a(z) %1-t nem lehet használni. + + + + Top level stylesheet elements must be in a non-null namespace, which %1 isn't. + Felső szintű stíluslap elemeknek nem szabad egy nem nulla névtérnek lenniük, %1 nem jó. + + + + The value for attribute %1 on element %2 must either be %3 or %4, not %5. + %1 attribútum értékének a(z) %2-s elemen vagy %3 vagy %4, vagy %5-nek kell lennie. + + + + Attribute %1 cannot have the value %2. + %1 attribútum nem tartalmazhat %2 értéket. + + + + The attribute %1 can only appear on the first %2 element. + A(z) %1 attribútum kizárólag az első %2 elemen tűnhet fel. + + + + At least one %1 element must appear as child of %2. + Legalább egy %1 elemnek mutatkoznia %2 gyerekeként. + + + + %1 has inheritance loop in its base type %2. + %1 tartalmaz egy öröklődési hurkot annak %2 alaptípusában. + + + + + Circular inheritance of base type %1. + A(z) %1 alaptípus cirkuláris öröklődése. + + + + Circular inheritance of union %1. + A(z) %1 union cirkuláris öröklődése. + + + + %1 is not allowed to derive from %2 by restriction as the latter defines it as final. + A(z) %1 %2-ből való származtatása nem megengedett, azzal a korlátozassal, hogy az utóbbi utolsónak definiálja. + + + + %1 is not allowed to derive from %2 by extension as the latter defines it as final. + %1-nek nem engedélyezett a %2-ből való származtatása, azzal a kiegészítéssel, hogy a utóbbi végsőnek definiálja. + + + + Base type of simple type %1 cannot be complex type %2. + A(z) %1 egyszerű típus alaptípusa nem lehet egy %2 összetett típus. + + + + Simple type %1 cannot have direct base type %2. + A(z) %1 egyszerű típus nem tartalmazhat közvetlen %2 alap típust. + + + + + Simple type %1 is not allowed to have base type %2. + %1 egyszerű típusnak nincs engedélyezve, hogy %2 alap típusokat tartalmazzon. + + + + Simple type %1 can only have simple atomic type as base type. + A(z) %1 egyszerű típus kizárólag egyszerű atomikus típusokat tartalmazhat alaptípusként. + + + + Simple type %1 cannot derive from %2 as the latter defines restriction as final. + %1 egyszerű típus nem származtatható %2-ből, mint ahogy az utóbbi végső korlátozásokat definiál. + + + + + Variety of item type of %1 must be either atomic or union. + %1 elemtípus különbözőségeinek vagy vagy atomikus vagy unionnak kell lenni. + + + + + Variety of member types of %1 must be atomic. + %1 tagtípusok különbözőségének atomikusnak kell lennie. + + + + + %1 is not allowed to derive from %2 by list as the latter defines it as final. + %1 származtatása a(z) %2-ből nem engedélyezett, listázva azt, hogy az utóbbi végsőként definiálja. + + + + Simple type %1 is only allowed to have %2 facet. + %1 egyszerű típus kizárólag %2 oldalt tartalmazhat. + + + + Base type of simple type %1 must have variety of type list. + %1 egyszerű típus alap típusának különböző típus listákat kell tartalmaznia. + + + + Base type of simple type %1 has defined derivation by restriction as final. + %1 egyszerű típus alaptípusa definiálja a számaztatást végső korlátozással. + + + + Item type of base type does not match item type of %1. + Az alap típus elem típusa nem egyezik a(z) %1 elemtípusával. + + + + + Simple type %1 contains not allowed facet type %2. + %1 egyszerű típus nem engedélyezett oldal %2 típusokat tartalmaz. + + + + + %1 is not allowed to derive from %2 by union as the latter defines it as final. + %1 %2-ből történő származtatása nem engedélyezett az unió által, az utóbbi végsőként definiálja. + + + + %1 is not allowed to have any facets. + %1 nem tartalmazhat semmilyen oldalt. + + + + Base type %1 of simple type %2 must have variety of union. + %2 egyszerű típus %1 alap típusának különböző egységeket kell tartalmaznia. + + + + Base type %1 of simple type %2 is not allowed to have restriction in %3 attribute. + %2 egyszerű típus %1 alap típusa nem tartalmazhat korlátozásokat a %3 attribútumban. + + + + Member type %1 cannot be derived from member type %2 of %3's base type %4. + %1 tag típus nem származtatható a(z) %3 %4 alap típusának %2 tagtípusából. + + + + Derivation method of %1 must be extension because the base type %2 is a simple type. + %1 származtatása eljárásának kiterjesztésnek kell lennie, mert %2 alap típus egy egyszerű típus. + + + + Complex type %1 has duplicated element %2 in its content model. + A(z) %1 összetett típusnak duplikáns %2 eleme van a tartalmi modellében. + + + + Complex type %1 has non-deterministic content. + %1 összetett típusnak nincsen meghatározott tartalma. + + + + Attributes of complex type %1 are not a valid extension of the attributes of base type %2: %3. + %1 összetett típus attribútumai a(z) %2 alap típus attribútumainak nem érvényes kiterjesztései: %3. + + + + Content model of complex type %1 is not a valid extension of content model of %2. + %1 komplex típus tartalmi modelle a(z) %2 tartalmi modellének nem egy érvényes kiterjesztése. + + + + Complex type %1 must have simple content. + %1 komplex típusnak tartalmaznia kell egy egyszerű tartalmat. + + + + Complex type %1 must have the same simple type as its base class %2. + %1 komplex típusnak ugyanazt az egyszerű típust kell tartalmaznia a(z) %2 alap osztálya számára. + + + + Complex type %1 cannot be derived from base type %2%3. + %1 komplex típus nem származtatható a(z) %2%3 alap típusból. + + + + Attributes of complex type %1 are not a valid restriction from the attributes of base type %2: %3. + %1 komplex típus attribútumai nem egy érvényes korlátozások a(z) %2 alap típus attribútumaitól: %3. + + + + Complex type %1 with simple content cannot be derived from complex base type %2. + %1 komplex típus egyszerű tartalommal nem származtatható %2 komplex alap típusból. + + + + Item type of simple type %1 cannot be a complex type. + A(z) %1 egyszerű típus elemi típusa nem lehet egy komplex típus. + + + + Member type of simple type %1 cannot be a complex type. + %1 egyszerű típus tag típusa nem lehet egy komplex típus. + + + + %1 is not allowed to have a member type with the same name as itself. + %1 nem engedélyzett, hogy tartalmazzon egy tag típust ugyanazzal a névvel, mint a saját neve. + + + + + + %1 facet collides with %2 facet. + %1 oldal ütközik a(z) %2 oldallal. + + + + %1 facet must have the same value as %2 facet of base type. + %1 oldalnak ugyanazt az értéket kell tartalmaznia, mint az alap típus %2 oldalának. + + + + %1 facet must be equal or greater than %2 facet of base type. + %1 oldalnak nagyobbnak vagy egyenlőnek kell lennie, mint az alap típus %2 oldalának. + + + + + + + + + + + %1 facet must be less than or equal to %2 facet of base type. + %1 oldalnal kisebb vagy egyenlőnek kell lennie az alap típus %2 oldalánál. + + + + %1 facet contains invalid regular expression + %1 oldal érvénytelen reguláris kifejezéseket tartalmaz + + + + Unknown notation %1 used in %2 facet. + %1 ismeretlen jelölési mód van használva a(z) %2 oldalon. + + + + %1 facet contains invalid value %2: %3. + %1 oldal érvénytelen %2 értéket tartalmaz: %3. + + + + %1 facet cannot be %2 or %3 if %4 facet of base type is %5. + %1 oldal nem lehet %2 vagy %3, ha az alap típus %4 oldala %5. + + + + %1 facet cannot be %2 if %3 facet of base type is %4. + %1 oldal nem lehet %2, ha az alap típus %3 oldala %4. + + + + + + %1 facet must be less than or equal to %2 facet. + %1 oldalnak kisebb egyenlőnek kell lennie a(z) %2 oldalnál. + + + + + + %1 facet must be less than %2 facet of base type. + %1 oldalnak kisebbnek kell lennie az alap típus %2 oldalánál. + + + + + %1 facet and %2 facet cannot appear together. + %1 oldal és %2 oldal nem fordulhat elő együtt. + + + + + + %1 facet must be greater than %2 facet of base type. + %1 oldalnak nagyobbnak kell lennie, mint az alaptípus %2 oldalának. + + + + + %1 facet must be less than %2 facet. + %1 oldalnak kisebbnek kell lenni a(z) %2 oldalnál. + + + + + %1 facet must be greater than or equal to %2 facet of base type. + %1 oldalnak nagyobb vagy egyenlőnek kell lennie az alap típus %2 oldalánál. + + + + Simple type contains not allowed facet %1. + Egyszerű típus nem tartalmazhat %1 oldalt. + + + + %1, %2, %3, %4, %5 and %6 facets are not allowed when derived by list. + %1, %2, %3, %4, %5 és %6 oldalak nem engedélyezettek listáról származtatáskor. + + + + Only %1 and %2 facets are allowed when derived by union. + Csak a(z) %1 és %2 oldalak engedélyezettek union származtatásakor. + + + + + %1 contains %2 facet with invalid data: %3. + %1 %2 oldalt tartalmaz érvénytelen adattal: %3. + + + + Attribute group %1 contains attribute %2 twice. + A(z) %1 attribútum csoport a(z) %2 attribútumot kétszer tartalmazza. + + + + Attribute group %1 contains two different attributes that both have types derived from %2. + A(z) %1 attribútum csoport két különböző attribútumot tartalmaz, melyek közül mindkettő %2-ból számaztatott típusokat tartalmaz. + + + + Attribute group %1 contains attribute %2 that has value constraint but type that inherits from %3. + A(z) %1 attribútum csoport %2 attribútumot tartalmaz, amely olyan megszorított értéket tartalmaz, kivéve a típust, amit %3-ból örököl. + + + + Complex type %1 contains attribute %2 twice. + A(z) %1 összetett típus %2 attribútumot tartalmazza kétszer. + + + + Complex type %1 contains two different attributes that both have types derived from %2. + %1 komplex típus két különböző attribútumot tartalmaz, amelyek közül mindkettő %2-ból származtatott típusokat tartalmaz. + + + + Complex type %1 contains attribute %2 that has value constraint but type that inherits from %3. + %1 kompex típus %2 attribútumot tartalmaz, aminek megszorító értéke van, kivéve a típust, amit a(z) %3-ból örököl. + + + + Element %1 is not allowed to have a value constraint if its base type is complex. + %1 elem nem tartalmazhat egy korlátozott értéket, ha az alaptípusa komplex. + + + + Element %1 is not allowed to have a value constraint if its type is derived from %2. + %1 elem nem tartalmazhat egy korlátozott értéket, ha a típusa a(z) %2-ből származik. + + + + + Value constraint of element %1 is not of elements type: %2. + %1 elem korlátozó értéke nem elemi típus: %2. + + + + Element %1 is not allowed to have substitution group affiliation as it is no global element. + %1 elem nem tartalmazhat helyettesítési csoport egyesítést, mert nem egy globális elem. + + + + Type of element %1 cannot be derived from type of substitution group affiliation. + %1 elem típus nem származtatható helyettesítési csoport egyesítési típusból. + + + + Value constraint of attribute %1 is not of attributes type: %2. + %1 attribútum korlátozó értéke nem attribútum típus: %2. + + + + Attribute %1 has value constraint but has type derived from %2. + %1 attribútumnak korlátozó értéke van, de %2-ből származtatott típust tartalmaz. + + + + %1 attribute in derived complex type must be %2 like in base type. + %1 attribútum egy származtatott komplex típusban %2-nek kell lennie, mint az alap típusban. + + + + Attribute %1 in derived complex type must have %2 value constraint like in base type. + A származtatott komplex típusban levő %1 attribútumnak %2 érték korlátozót kell tartalmaznia, mint az alap típusban. + + + + Attribute %1 in derived complex type must have the same %2 value constraint like in base type. + Származtatott komplex típusban levő %1 attribútumnak ugyanazt a(z) %2 korlátozott értéket kell tartalmaznia, mint az alap típusban. + + + + Attribute %1 in derived complex type must have %2 value constraint. + Származtatott komplex típusban levő %1 attribútumnak %2 érték korlátozót kell tartalmaznia. + + + + processContent of base wildcard must be weaker than derived wildcard. + Az alap helyettesítő jel folyamat tartalma gyengébb kell legyen, mint a származtatott helyettesítő jel. + + + + + Element %1 exists twice with different types. + %1 elem kétszer létezik különböző típusokkal. + + + + Particle contains non-deterministic wildcards. + A részecske nem meghatározott helyettesítő jeleket tartalmaz. + + + + + Base attribute %1 is required but derived attribute is not. + A(z) %1 alap attribútum szükséges, de a származtatott attribútum nem. + + + + Type of derived attribute %1 cannot be validly derived from type of base attribute. + A(z) %1 származtatott attribútum típusa nem lehet érvényesen származtatni az alap attribútum típusból. + + + + Value constraint of derived attribute %1 does not match value constraint of base attribute. + '%1 származtatott attribútum érték korlátozója nem egyezik az alap attribútum érték korlátozójával. + + + + Derived attribute %1 does not exist in the base definition. + %1 származtatott attribútum nem létezik az alap definícióban. + + + + Derived attribute %1 does not match the wildcard in the base definition. + %1 származtatott attribútum nem egyezik a helyettesítő jellel az alap definícióban. + + + + Base attribute %1 is required but missing in derived definition. + %1 alap attribútum szükséges, de hiáynzik a származtatott definícióban. + + + + Derived definition contains an %1 element that does not exists in the base definition + A származtatot definíció egy %1 elemet tartalmaz, ami nem létezik az alap definícióban + + + + Derived wildcard is not a subset of the base wildcard. + Származtatott helyettesítőjel nem az alap helyettesítőjel egy részhalmaza. + + + + %1 of derived wildcard is not a valid restriction of %2 of base wildcard + Származtaott helyettesítő jel %1-e nem az alap helyettesítőjel %2-nek egy érvényes korlátozója + + + + Attribute %1 from base type is missing in derived type. + Az alap típus %1 attribútuma hiányzik a származtatott típusban. + + + + Type of derived attribute %1 differs from type of base attribute. + A(z) %1 származtatott típus az alap attribútum típusától különbözik. + + + + Base definition contains an %1 element that is missing in the derived definition + Az alap definíció egy %1 elemet tartalmaz, ami hiányzik a származtatott definícióból + + + + %1 references unknown %2 or %3 element %4. + %1 ismeretlen %2 vagy %3 elemre hivatkozik %4. + + + + %1 references identity constraint %2 that is no %3 or %4 element. + %1 %2 indentitás korlátozóra hivatkozik, ami nem %3 vagy %4 elem. + + + + %1 has a different number of fields from the identity constraint %2 that it references. + %1 mezők egy különböző számát tartalmazza a(z) %2 indetitás korlátozóbol, amelyik erre hivatkozik. + + + + Base type %1 of %2 element cannot be resolved. + %1 elem %2 alap típusát nem lehet megfejteni. + + + + Item type %1 of %2 element cannot be resolved. + %2 elem %1 elem típusát nem lehet megfejteni. + + + + Member type %1 of %2 element cannot be resolved. + %2 elem %1 tag típusát nem lehet megoldani. + + + + + + Type %1 of %2 element cannot be resolved. + %2 elem %1 típusát nem lehet megoldani. + + + + Base type %1 of complex type cannot be resolved. + Komplex típus %1 alap típusát nem lehet megfejteni. + + + + %1 cannot have complex base type that has a %2. + %1 nem tartalmazhat komplex alap típusokat, egy %2-t tartalmaz. + + + + Content model of complex type %1 contains %2 element so it cannot be derived by extension from a non-empty type. + %1 komplex típus tartalmi modelle %2 elemet tartalmaz, tehát nem származtatható kiterjesztésben egy nem üres típusból. + + + + Complex type %1 cannot be derived by extension from %2 as the latter contains %3 element in its content model. + %1 komplex nem típus nem származtatható kiterjesztésben %2-ből, mert az utóbbi %3 elemet tartalmaz a tartalmi modellében. + + + + Type of %1 element must be a simple type, %2 is not. + %1 elem típusnak egy egyszerű típusnak kell, de %2 nem az. + + + + Substitution group %1 of %2 element cannot be resolved. + %2 elem %1 helyettesítési csoportját nem lehet megoldani. + + + + Substitution group %1 has circular definition. + %1 helyettesítési csoport cirkuláris definíciót tartalmaz. + + + + + Duplicated element names %1 in %2 element. + Duplikát %1 elemnév %2 elemben. + + + + + + + Reference %1 of %2 element cannot be resolved. + %2 elem %1 hivatkozását nem lehet megoldani. + + + + Circular group reference for %1. + Cirkuláris csoport hivatkozás %1-re. + + + + %1 element is not allowed in this scope + %1 elem nem engedélyezett ebben a hatókörben + + + + %1 element cannot have %2 attribute with value other than %3. + %1 elem nem tartalmazhat %2 attribútumot %3-tól eltérő értékkel. + + + + %1 element cannot have %2 attribute with value other than %3 or %4. + %1 element nem tartalmazhat %2 attribútumot %3 vagy %4-től eltérő értékkel. + + + + %1 or %2 attribute of reference %3 does not match with the attribute declaration %4. + %3 hivatkozás %1 vagy %2 attribútuma nem egyezik meg a(z) %4 attribútum deklarációval. + + + + Attribute group %1 has circular reference. + %1 attribútum csoport cirkuláris hivatkozást tartalmaz. + + + + %1 attribute in %2 must have %3 use like in base type %4. + %2-ben található %1 attribútumnak %3 használatát kell tartalmaznia, mint a(z) %4 alap típusban. + + + + Attribute wildcard of %1 is not a valid restriction of attribute wildcard of base type %2. + %1 attribútum helyettesítő jele nem a(z) %2 alap típus attribútum helyettesítő jelének egy érvényes korlátozása. + + + + %1 has attribute wildcard but its base type %2 has not. + %1 attribútum helyettesítő jelet tartalmaz, de a(z) %2 alap típusa nem. + + + + Union of attribute wildcard of type %1 and attribute wildcard of its base type %2 is not expressible. + %2 alaptípusának attribútum helyettesítő jele és a(z) %1 típus attribútum helyettesítő jelének union-ja nem kifejezhető. + + + + Enumeration facet contains invalid content: {%1} is not a value of type %2. + Felsorolás oldal érvénytelen tartalmat tartalmaz. {%1} nem egy érvényes %2 típus érték. + + + + Namespace prefix of qualified name %1 is not defined. + %1 minősített név névtér előtagja nincs definiálva. + + + + + %1 element %2 is not a valid restriction of the %3 element it redefines: %4. + %2 elem %1 nem a(z) %3 elem egy érvényes korlátozása, újradefininálja: %4. + + + + Empty particle cannot be derived from non-empty particle. + Üres részecskét nem lehet egy üres részecskéből származtatni. + + + + Derived particle is missing element %1. + Származtatott részecskének van egy %1 hiányzó eleme. + + + + Derived element %1 is missing value constraint as defined in base particle. + %1 származtatott elem hiányol egy érték korlátozót, ami az alap részecskében van definiálva. + + + + Derived element %1 has weaker value constraint than base particle. + %1 származtatott elem gyengébb érték korlátozót tartalmaz, mint az alap részecske. + + + + Fixed value constraint of element %1 differs from value constraint in base particle. + %1 elem fix érték korlátozója különbözik az alap részecskében található érték korlátozótól. + + + + Derived element %1 cannot be nillable as base element is not nillable. + %1 származtatott elem nem lehet nullázható, mint ahogy az alap elem sem nullázható. + + + + Block constraints of derived element %1 must not be more weaker than in the base element. + %1 származtatott elem blokk korlátozója nem lehet gyengébb, mint az alap elemben. + + + + Simple type of derived element %1 cannot be validly derived from base element. + %1 származtatott elem egyszerű típusa nem származtatható érvényesen az alap elemből. + + + + Complex type of derived element %1 cannot be validly derived from base element. + %1 származtatott elem komplex típusa nem származtatható érvényesen az alap elemből. + + + + Element %1 is missing in derived particle. + %1 elem hiányzik a származtott récseszkében. + + + + Element %1 does not match namespace constraint of wildcard in base particle. + %1 elem nem egyezik meg az alap részecskében található helyettesítő jel névtér korlátozójával. + + + + Wildcard in derived particle is not a valid subset of wildcard in base particle. + Helyettesítő jel a származtatott részecskénen nem az alap részecskében található helyettesítő jel egy érvényes részhalmaza. + + + + processContent of wildcard in derived particle is weaker than wildcard in base particle. + A származtatott részecskében található helyettesítő jel folyamatTartalma gyengébb, mint az alap részecskében található helyettesítő jel. + + + + Derived particle allows content that is not allowed in the base particle. + Származtatott részecske engedélyezi a tartalmat, ami nem engedélyezett az alap részecskében. + + + + Can not process unknown element %1, expected elements are: %2. + Nem lehet feldolgozni ismeretlen %1 elemet, várt elemek: %2. + + + + Element %1 is not allowed in this scope, possible elements are: %2. + %1 elem nem engedélyezett ebben a hatórközben, lehetséges elemek: %2. + + + + Child element is missing in that scope, possible child elements are: %1. + Gyermek elem hiányzik abban a hatókörben, lehetséges gyermek elemek: %1. + + + + Document is not a XML schema. + Dokumentum nem egy XML terv. + + + + %1 attribute of %2 element contains invalid content: {%3} is not a value of type %4. + %2 elem %1 attribútuma érvénytelen tartalmat tartalmaz: {%3} nem egy %4 típus érték. + + + + %1 attribute of %2 element contains invalid content: {%3}. + %2 elem %1 attribútuma érvénytelen tartalmat tartalmaz: {%3}. + + + + Target namespace %1 of included schema is different from the target namespace %2 as defined by the including schema. + A beleértett terv %1 cél névtere különbözik a %2 cél névtértől, amit a beleértett terv által lett definiálva. + + + + + Target namespace %1 of imported schema is different from the target namespace %2 as defined by the importing schema. + Az importált terv %1 cél névtere különbözik a(z) %2 cél névtértől, ami az importált terv által van definiálva. + + + + %1 element is not allowed to have the same %2 attribute value as the target namespace %3. + %1 elem nem tartalmazhatja ugyanazt a(z) %2 attribútum értéket, mint a(z) %3 cél névtér. + + + + %1 element without %2 attribute is not allowed inside schema without target namespace. + %1 elem %2 attribútum nélkül nem engedélyezett a vázlaton belül cél névtér nélkül. + + + + + %1 element is not allowed inside %2 element if %3 attribute is present. + %1 elem nem engedélyezett a(z) %2 elemen belül, ha %3 attribútum van nyújtva. + + + + + + %1 element has neither %2 attribute nor %3 child element. + %1 elem nem tartalmaz %2 attribútumot és %3 gyermek elemet sem. + + + + + + + + + + + + + + + + + %1 element with %2 child element must not have a %3 attribute. + %1 elem %2 gyermek elemmel nem tartalmazhat egy %3 attribútumot. + + + + %1 attribute of %2 element must be %3 or %4. + %2 elem %1 attribútumának %3 vagy %4-nek kell lennie. + + + + %1 attribute of %2 element must have a value of %3. + %2 elem %1 attribútumának %3 egy értékét tartalmaznia kell. + + + + + %1 attribute of %2 element must have a value of %3 or %4. + %2 elem %1 attribútumának tartalmaznia kell %3 vagy %4 egy értékét. + + + + + + + + + + + + + + + + + %1 element must not have %2 and %3 attribute together. + %1 elemnek tartalmaznia kell %2 és %3 attribútumokat együttesen. + + + + + Content of %1 attribute of %2 element must not be from namespace %3. + %2 elem %1 attribútumának tartalmának nem szabad a(z) %3 névtérből lennie. + + + + + %1 attribute of %2 element must not be %3. + %2 elem %1 attribútumának nem szabad %3-nak lennie. + + + + %1 attribute of %2 element must have the value %3 because the %4 attribute is set. + %2 elem %1 attribútumának tartalmaznia kell %3 értéket, mert %4 attribútum be van állítva. + + + + Specifying use='prohibited' inside an attribute group has no effect. + Használat meghatározásának = 'tiltott' egy attribútum csoportját belül nincsen hatása. + + + + %1 element must have either %2 or %3 attribute. + %1 elemnek vagy %2 vagy %3 attribútumot tartalmaznia kell. + + + + %1 element must have either %2 attribute or %3 or %4 as child element. + %1 elemnek tartalmaznia kell vagy %2 vagy %3 vagy %4 attribútumot, mint ahogy a gyermek elem. + + + + %1 element requires either %2 or %3 attribute. + %1 elem vagy %2 vagy %3 attribútumot igényli. + + + + Text or entity references not allowed inside %1 element + Szöveg avgy entitás hivatkozás nem engedélyezett a(z) %1 elemen belül + + + + + %1 attribute of %2 element must contain %3, %4 or a list of URIs. + %2 elem %1 attribútumának tartalmaznia kell %3, %4 vagy URI-k egy listáját. + + + + %1 element is not allowed in this context. + %1 elem nem engedélyezett ebben a szöveg környezetben. + + + + %1 attribute of %2 element has larger value than %3 attribute. + %2 elem %1 attribútuma nagyobb értéket tartalmaz, mint a %3 attribútum. + + + + Prefix of qualified name %1 is not defined. + A(z) %1 minősített név előtagja nem definiált. + + + + + %1 attribute of %2 element must either contain %3 or the other values. + %2 elem %1 attribútumának vagy %3 vagy más értékeket kell tartalmaznia. + + + + Component with ID %1 has been defined previously. + %1 azonosítóval rendelkezővel komponens előzőleg definiálva lett. + + + + Element %1 already defined. + %1 elem már definiálva van. + + + + Attribute %1 already defined. + %1 attribútum már definiálva van. + + + + Type %1 already defined. + %1 típus már definiálva van. + + + + Attribute group %1 already defined. + %1 csoport attribútum már definiálva van. + + + + Element group %1 already defined. + %1 csoport elem már definiálva van. + + + + Notation %1 already defined. + %1 értesítés már definiálva van. + + + + Identity constraint %1 already defined. + %1 azonosító korlátozó már definiálva van. + + + + Duplicated facets in simple type %1. + Duplikált oldalak %1 egyszerű típusban. + + + + + + %1 is not valid according to %2. + %1 nem érvényes %2 szerint. + + + + String content does not match the length facet. + Sztring tartalom nem egyezik a hossz oldallal. + + + + String content does not match the minLength facet. + Sztring tartalom nem egyezik a minimális hosszúságú felülettel. + + + + String content does not match the maxLength facet. + Sztring tartalom nem egyezik a maximális hosszúságú felülettel. + + + + String content does not match pattern facet. + Sztrng tartalom nem egyezik a minta felülettel. + + + + String content is not listed in the enumeration facet. + Sztring tartalom nincs listázva a felsorol felületben. + + + + Signed integer content does not match the maxInclusive facet. + Előjeles egész szám tartalom nem egyezik a maximális beleszámított felülettel. + + + + Signed integer content does not match the maxExclusive facet. + Előjeles egész szám tartalom nem egyzik a maximális kizárólagos felülettel. + + + + Signed integer content does not match the minInclusive facet. + Előjeles egész szám tartalom nem egyezik a minimális beleértet felülettel. + + + + Signed integer content does not match the minExclusive facet. + Előjeles egész szám tartalom nem egyezik a minimális kizárólagos felülettel. + + + + Signed integer content is not listed in the enumeration facet. + Előjeles egész szám tartalom nincsen kilistázva a felsorolási felületben. + + + + Signed integer content does not match pattern facet. + Előjeles egész szám tartalom nem egyezik a minta felületben. + + + + Signed integer content does not match in the totalDigits facet. + Előjeles egész szám tartalom nem egyezik a teljesSzámos felület. + + + + Unsigned integer content does not match the maxInclusive facet. + Nem előjeles egész szám tartalom nem egyezik a maximális beleértett felülettel. + + + + Unsigned integer content does not match the maxExclusive facet. + Nem előjeles egész szám tartalom nem egyezik a maximális kizárólagos felülettel. + + + + Unsigned integer content does not match the minInclusive facet. + Nem előjeles tartalom nem egyezik a minimális beleértett felülettel. + + + + Unsigned integer content does not match the minExclusive facet. + Nem előjeleg egész szám tartalom nem egyezik a beleértett minimális felülettel. + + + + Unsigned integer content is not listed in the enumeration facet. + Nem előjeles egész szám tartalom nincsen kilistázva a felsorolási felületben. + + + + Unsigned integer content does not match pattern facet. + Nem előjeles egész szám tartalom nem egyezik a minta felületben. + + + + Unsigned integer content does not match in the totalDigits facet. + Nem előjeles egész szám tartalom nem egyezik a teljesSzámos felületben. + + + + Double content does not match the maxInclusive facet. + Dupla tartalom nem egyezik a maximális beleértett felületben. + + + + Double content does not match the maxExclusive facet. + Dupla tartalom nem egyezik a maximális kizárólagos felülettel. + + + + Double content does not match the minInclusive facet. + Dupla tartalom nem egyezik a minimális beleértett felülettel. + + + + Double content does not match the minExclusive facet. + Dupla tartalom nem egyezik a minimális kizárólag felülettel. + + + + Double content is not listed in the enumeration facet. + Dupla tartalom nincs listázva a felsorolási felületben. + + + + Double content does not match pattern facet. + Dupla tartalom nem egyezik a minta felületben. + + + + Decimal content does not match in the fractionDigits facet. + Tizedes tartalom nem egyezik a szám tényezős felületben. + + + + Decimal content does not match in the totalDigits facet. + Tizedes tartalom nem egyezik a teljesenSzámos felületben. + + + + Date time content does not match the maxInclusive facet. + Dátum idő tartalom nem egyezik a maximális beleértett felülettel. + + + + Date time content does not match the maxExclusive facet. + Dátum idő tartalom nem egyezik a maximális kizárólagos felülettel. + + + + Date time content does not match the minInclusive facet. + Dátum idő tartalom nem egyezik a minimális beleértett felülettel. + + + + Date time content does not match the minExclusive facet. + Dátum idő tartalom nem egyezik a minimális kizárólagos felülettel. + + + + Date time content is not listed in the enumeration facet. + Dátum idő tartalom nincsen kilistázva a felsorolási felületben. + + + + Date time content does not match pattern facet. + Dátum idő tartalom nem egyezik a minta felületben. + + + + Duration content does not match the maxInclusive facet. + Tartalom időtartam nem egyezik a maximális beleértett felülettel. + + + + Duration content does not match the maxExclusive facet. + Tartalom időtartam nem egyezik a maximális kizárólagos felülettel. + + + + Duration content does not match the minInclusive facet. + Tartalom időtartam nem egyezik a minimális benne foglalt felülettel. + + + + Duration content does not match the minExclusive facet. + Tartalom időtartam nem egyezik a minimális kizárólagos felülettel. + + + + Duration content is not listed in the enumeration facet. + Tartalom időtartam nincs listázva a felsorolási felületben. + + + + Duration content does not match pattern facet. + Tartalom időtartam nem egyezik a felület mintában. + + + + Boolean content does not match pattern facet. + Logikai tartalom nem egyezik a minta felületben. + + + + Binary content does not match the length facet. + Bináris tartalom nem egyezik a hossz felületben. + + + + Binary content does not match the minLength facet. + Bináris tartalom nem egyezik a minimális hossz felületben. + + + + Binary content does not match the maxLength facet. + Bináris tartalom nem egyezik a maximális hossz felületben. + + + + Binary content is not listed in the enumeration facet. + Bináris tartalom nincsen kilistázva a felsorolási felületben. + + + + Invalid QName content: %1. + Érvénytelen QName tartalom: %1. + + + + QName content is not listed in the enumeration facet. + QName tartalom nincsen kilistázva a felsorolási felületben. + + + + QName content does not match pattern facet. + QName tartalom nem egyezik a mintha felületben. + + + + Notation content is not listed in the enumeration facet. + Tartalom jelölés nincsen kilistázva a felsorolási felületben. + + + + List content does not match length facet. + Tartalom lista nem egyezik a hossz felületben. + + + + List content does not match minLength facet. + Tartalmi lista nem egyezik a minimális hossz felületben. + + + + List content does not match maxLength facet. + Tartalmi list nem egyezik a maximális hossz felületen. + + + + List content is not listed in the enumeration facet. + Tartalmi lista nincsen kilistázva a felsorolási felületen. + + + + List content does not match pattern facet. + Tartalmi lista nem egyezik a minta felületen. + + + + Union content is not listed in the enumeration facet. + Egység tartalom nincsen kilistázva a felsorolási felületen. + + + + Union content does not match pattern facet. + Egység tartalom nem egyezik a minta felületen. + + + + Data of type %1 are not allowed to be empty. + %1 típus adata nem engedélyezett, hogy üres legyen. + + + + Element %1 is missing child element. + %1 elem hiányzik a gyermek elemből. + + + + There is one IDREF value with no corresponding ID: %1. + Van egy IDREF érték nem megfelelő azonosítóval: %1. + + + + Loaded schema file is invalid. + Betöltött terv fájl nem létezik. + + + + %1 contains invalid data. + %1 érvénytelen adatot tartalmaz. + + + + xsi:schemaLocation namespace %1 has already appeared earlier in the instance document. + xsi:tervElhelyezkedés %1 névtér már előfordult korábban a példa dokumentumban. + + + + xsi:noNamespaceSchemaLocation cannot appear after the first no-namespace element or attribute. + xsi:tervElhelyezkedés névtér nem fordulhat elő az első nem névtér elem vagy attribútum után. + + + + No schema defined for validation. + Nincsen terv definiálva jóváhagyásra. + + + + No definition for element %1 available. + Nincsen elérhető definíció a(z) %1 elemre. + + + + + + Specified type %1 is not known to the schema. + %1 meghatározott típus ismeretlen a terv számára. + + + + Element %1 is not defined in this scope. + %1 elem nincs definiálva ebben a hatókörben. + + + + Declaration for element %1 does not exist. + %1 elem deklaráció nem létezik. + + + + Element %1 contains invalid content. + %1 elem érvénytelen tartalmat tartalmaz. + + + + Element %1 is declared as abstract. + %1 elem elvontkét lett deklarálva. + + + + Element %1 is not nillable. + %1 elem nem nullázható. + + + + Attribute %1 contains invalid data: %2 + %1 attribútum érvénytelen adatokat tartalmaz: %2 + + + + Element contains content although it is nillable. + Elem nem nullázható elemeket tartalmaz. + + + + Fixed value constraint not allowed if element is nillable. + Fix érték korlátozó nem engedélyezett, ha az elem nullázható. + + + + Element %1 cannot contain other elements, as it has a fixed content. + %1 nem tartalmazhat másik elemeket, mint ennek is egy fix mérete van. + + + + Specified type %1 is not validly substitutable with element type %2. + %1 meghatározott típus nem helyettesíthető érvényesen %2 elem típussal. + + + + Complex type %1 is not allowed to be abstract. + %1 komplex típus nem engedélyezett, hogy elvont legyen. + + + + Element %1 contains not allowed attributes. + %1 nem engedélyezett attribútumokat tartalmaz. + + + + + Element %1 contains not allowed child element. + %1 nem engedélyezett gyermek attribútumokat tartalmaz. + + + + + Content of element %1 does not match its type definition: %2. + %1 elem tartalma nem egyezik meg a típus definíciójával: %2. + + + + + + Content of element %1 does not match defined value constraint. + %1 elem tartalma nem egyezik meg a definiált érték korlátozóval. + + + + Element %1 contains not allowed child content. + %1 nem engedélyezett gyermek tartalmat tartalmaz. + + + + Element %1 contains not allowed text content. + %1 nem engedélyezett szöveg tartalmat tartalmaz. + + + + Element %1 is missing required attribute %2. + %1 hiányzik, %2 attribútum igényli. + + + + Attribute %1 does not match the attribute wildcard. + %1 attribűtum nem egyezik meg az attribútum helyettesítő jellel. + + + + Declaration for attribute %1 does not exist. + %1 attribútum deklarációja nem létezik. + + + + Element %1 contains two attributes of type %2. + %1 elem %2 típus két attribútumát tartalmazza. + + + + Attribute %1 contains invalid content. + %1 attribútum érvénytelen tartalmaz tartalmaz. + + + + Element %1 contains unknown attribute %2. + %1 elem ismeretlen %2 attribútumokat tartalmaz. + + + + + Content of attribute %1 does not match its type definition: %2. + %1 attribútum tartalma nem egyezik a típus definíciójával: %2. + + + + + Content of attribute %1 does not match defined value constraint. + %1 attribútum tartalma nem egyezik meg a definiált érték korlátozóval. + + + + Non-unique value found for constraint %1. + Nem található egyedülálló érték a(z) %1 módosítóra. + + + + Key constraint %1 contains absent fields. + %1 kulcs korlátozó hiányzó mezőket tartalmaz. + + + + Key constraint %1 contains references nillable element %2. + %1 kulcs korlátozó hivatkozásokat nem tartalmaz nullázható %2 elemekre. + + + + No referenced value found for key reference %1. + Nem található referencia érték a(z) %1 kulcs referenciára. + + + + More than one value found for field %1. + Több mint egy érték található a(z) %1-es mezőre. + + + + Field %1 has no simple type. + %1 mezőnek nincsen egyszerű típusa. + + + + ID value '%1' is not unique. + %1 azonosító érték nem egyedülálló. + + + + '%1' attribute contains invalid QName content: %2. + %1 attribútum érvénytelen QName tartalmaz tartalmaz: %2. + + + diff --git a/translations/qtconfig_hu.ts b/translations/qtconfig_hu.ts new file mode 100644 index 0000000..0eaead0 --- /dev/null +++ b/translations/qtconfig_hu.ts @@ -0,0 +1,920 @@ + + + + + MainWindow + + + Desktop Settings (Default) + Asztali beállítások (Alapértelmezett) + + + + Choose style and palette based on your desktop settings. + Stílus és paletta alapú kiválasztása az asztali beállításokban. + + + + On The Spot + Azon nyomban + + + + + + + Auto (default) + Automatikus (alapértelmezett) + + + + Choose audio output automatically. + Audió kimenet automatikus kiválasztása. + + + + + aRts + aRts + + + + Experimental aRts support for GStreamer. + Kísérleti aRts támogatás a GStreamerhez. + + + + Phonon GStreamer backend not available. + Phonon GStreamer backend nem elérhető. + + + + Choose render method automatically + Render eljárás automatikus kiválasztása + + + + + X11 + X11 + + + + Use X11 Overlays + X11 borítás használata + + + + + OpenGL + OpenGL + + + + Use OpenGL if avaiable + OpenGL használata, ha rendelkezésre áll + + + + + Software + Szoftver + + + + Use simple software rendering + Egyszerű szoftver adás használata + + + + No changes to be saved. + A változtatások nincsenek elmentve. + + + + Saving changes... + Változtatások elmentése... + + + + Over The Spot + Célon túlmenően + + + + Off The Spot + Elkalandozás + + + + Root + Rendszergazda + + + + Select a Directory + Egy könyvtár kiválasztása + + + + <h3>%1</h3><br/>Version %2<br/><br/>Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). + <h3>%1</h3><br/>Verzió %2<br/><br/>Szerzői jog (C) 2010 Nokia vállalat és/vagy leányvállalata(i). + + + + + + Qt Configuration + Qt Konfiguráció + + + + Save Changes + Változtatások elmentése + + + + Save changes to settings? + Változtatások elmentése a beállításokba ? + + + + &Yes + &Igen + + + + &No + &Nem + + + + &Cancel + &Mégse + + + + MainWindowBase + + + Qt Configuration + Qt Konfiguráció + + + + + Appearance + Feltűnés + + + + GUI Style + GUI Stílus + + + + Select GUI &Style: + GUI &Stílus kiválasztása: + + + + Build Palette + Építési paletta + + + + &3-D Effects: + &3 D Hatások: + + + + Window Back&ground: + Ablak Hát&tér: + + + + &Tune Palette... + &Hangolási paletta... + + + + Please use the KDE Control Center to set the palette. + Kérem használja a KDE Vezérlő Központot a paletta beállításához. + + + + Preview + Előnézet + + + + Select &Palette: + &Paletta kiválasztása: + + + + Active Palette + Aktív paletta + + + + Inactive Palette + Inaktív paletta + + + + Disabled Palette + Tiltott paletta + + + + Fonts + Betűk + + + + Default Font + Alapértelmezett betű + + + + &Style: + &Stílus: + + + + &Point Size: + &Pont méret: + + + + F&amily: + Csa&lád: + + + + Sample Text + Minta szöveg + + + + Font Substitution + Betű helyettesítés + + + + S&elect or Enter a Family: + Egy család ki&választása vgy bevitele: + + + + Current Substitutions: + Aktuális helyettesítés: + + + + + Up + Fel + + + + + Down + Le + + + + + Remove + Eltávolítás + + + + Select s&ubstitute Family: + Család &helyettesítésének kiválasztása: + + + + + Add + Hozzáad + + + + Interface + Interfész + + + + Feel Settings + Érzet beállítások + + + + + ms + ms + + + + &Double Click Interval: + &Dupla kattintási intervallum: + + + + No blinking + Nincs villogás + + + + &Cursor Flash Time: + &Kurzor flash idő: + + + + lines + sorok + + + + Wheel &Scroll Lines: + Kerék sor &görgetés: + + + + Resolve symlinks in URLs + URL-ben található szimlinkek megoldása + + + + GUI Effects + GUI hatások + + + + &Enable + &Engedélyezés + + + + Alt+E + Alt+E + + + + &Menu Effect: + &Menü hatás: + + + + C&omboBox Effect: + C&omboBox hatás: + + + + &ToolTip Effect: + &Eszköz tipp hatás: + + + + Tool&Box Effect: + Eszköz&doboz hatás: + + + + + + + Disable + Tiltás + + + + + + + Animate + Animálás + + + + + Fade + Elhalkulás + + + + Global Strut + Globális struktúra + + + + Minimum &Width: + Minimum &szélesség: + + + + Minimum Hei&ght: + Minimum ma&gasség: + + + + + pixels + pixelek + + + + Enhanced support for languages written right-to-left + Kiterjesztett támogatás a jobbról balra írt nyelvek számára + + + + XIM Input Style: + XIM beviteli stílus: + + + + On The Spot + Azon nyomban + + + + Over The Spot + Célon túlmenően + + + + Off The Spot + Elkalandozás + + + + Root + Rendszergazda + + + + Default Input Method: + Alapértelmezett beviteli eljárás: + + + + Printer + Nyomtató + + + + Enable Font embedding + Betű beágyazás engedélyezése + + + + Font Paths + Betű útvonalak + + + + Browse... + Böngészés... + + + + Press the <b>Browse</b> button or enter a directory and press Enter to add them to the list. + Nyomja meg a <b>Böngészés</b> gombot vagy lépjen be egy könyvtárba és nyomja meg az Enter gombot hogy hozzáadja őket a listához. + + + + Phonon + Phonon + + + + About Phonon + Phonon-ról + + + + + Current Version: + Aktuális verzió: + + + + + Not available + Nem elérhető + + + + + Website: + Weblap: + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://phonon.kde.org"><span style=" text-decoration: underline; color:#0000ff;">http://phonon.kde.org</span></a></p></body></html> + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://phonon.kde.org"><span style=" text-decoration: underline; color:#0000ff;">http://phonon.kde.org</span></a></p></body></html> + + + + About GStreamer + GStreamer-ről + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://gstreamer.freedesktop.org/"><span style=" text-decoration: underline; color:#0000ff;">http://gstreamer.freedesktop.org/</span></a></p></body></html> + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://gstreamer.freedesktop.org/"><span style=" text-decoration: underline; color:#0000ff;">http://gstreamer.freedesktop.org/</span></a></p></body></html> + + + + GStreamer backend settings + GStreamer backend beállítások + + + + Preferred audio sink: + Preferrált audió tartály: + + + + Preferred render method: + Preferrált render eljárás: + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-style:italic;">Note: changes to these settings may prevent applications from starting up correctly.</span></p></body></html> + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-style:italic;">Megjegyzés: Ezekben a beállításokban történő változtatások megakadályozhatják az alkalmazásokat a megfelelő betöltéstől.</span></p></body></html> + + + + &File + &Fájl + + + + &Help + &Súgó + + + + &Save + &Mentés + + + + Save + Mentés + + + + Ctrl+S + Ctrl+S + + + + E&xit + &Kilépés + + + + Exit + Kilépés + + + + &About + &Névjegy + + + + About + Névjegy + + + + About &Qt + &Qt-ról + + + + About Qt + Qt-ról + + + + PaletteEditorAdvancedBase + + + Tune Palette + Hangoló paletta + + + + <b>Edit Palette</b><p>Change the palette of the current widget or form.</p><p>Use a generated palette or select colors for each color group and each color role.</p><p>The palette can be tested with different widget layouts in the preview section.</p> + <b>Paletta szerkesztése</b><p>Az aktuális widget vagy űrlap palettájának megváltoztatása</p><p>Egy generált paletta használata vagy szín kiválasztás mindegyik színcsoport és szín szabályra.</p><p>A paletta tesztelhető különböző widget szerkezetekkel az előnézeti szegmensben.</p> + + + + Select &Palette: + &Paletta kiválasztása: + + + + Active Palette + Aktív paletta + + + + Inactive Palette + Inaktív paletta + + + + Disabled Palette + Paletta tiltása + + + + Auto + Auto + + + + Build inactive palette from active + Inaktív paletta építése aktívból + + + + Build disabled palette from active + Tiltott paletta építése aktívból + + + + Central color &roles + Központi szín &szabályok + + + + Choose central color role + Központi szín szabályok kiválasztása + + + + <b>Select a color role.</b><p>Available central roles are: <ul> <li>Window - general background color.</li> <li>WindowText - general foreground color. </li> <li>Base - used as background color for e.g. text entry widgets, usually white or another light color. </li> <li>Text - the foreground color used with Base. Usually this is the same as WindowText, in what case it must provide good contrast both with Window and Base. </li> <li>Button - general button background color, where buttons need a background different from Window, as in the Macintosh style. </li> <li>ButtonText - a foreground color used with the Button color. </li> <li>Highlight - a color to indicate a selected or highlighted item. </li> <li>HighlightedText - a text color that contrasts to Highlight. </li> <li>BrightText - a text color that is very different from WindowText and contrasts well with e.g. black. </li> </ul> </p> + <b>Egy szín szabály kiválasztása.</b><p>Az elérhetp központi szabályok: <ul> <li>Ablak - általános háttér szín.</li> <li>AblakSzöveg - általános előtér szín. </li> <li>Alap - háttérszínként használva példul szöveg beviteli widgetekre, rendszerint fehér vagy más világos színekre. </li> <li>Szöveg - az előtér szín van haszálva a bázissal. Rendszerint ez ugyanaz, mint az AblakSzöveg, amilyen esetekben egy jó ellentétet kell biztosítania mindkettőre Ablakkal és Bázissal. </li> <li>Gomb - általános gomb háttér szín, ahol a gomboknak szüksége van egy háttére ami különbözik az ablakétól, mint a Macintosh stílusban. </li> <li>GombSzöveg - egy előtér szín van használva gomb színnel. </li> <li>Kihangsúlyozás - egy szín a kiválasztott vagy kihangsúlyozott elem jelölésére. </li> <li>KihangsúlyozottSzöveg - egy szöveg szín, ami ellentétes a kihangsúlyozással. </li> <li>VilágosSzöveg - egy szöveg szín, ami nagyon különböző az AblakSzövegtől és a kontrasztoktól jól van példul feketével. </li> </ul> </p> + + + + Window + Ablak + + + + WindowText + AblakSzöveg + + + + Button + Gomb + + + + Base + Bázis + + + + Text + Szöveg + + + + BrightText + VilágosSzöveg + + + + ButtonText + GombSzöveg + + + + Highlight + Kihangsúlyozás + + + + HighlightedText + KihangsúlyozottSzöveg + + + + &Select Color: + Szín &kiválasztása: + + + + + Choose a color + Egy szín kiválasztása + + + + Choose a color for the selected central color role. + Egy szín kiválasztása a kiválasztott központi szín szabályokra. + + + + 3-D shadow &effects + 3 D árnyék &hatások + + + + Build &from button color + Építés gomb szín&ből + + + + Generate shadings + Árnyékolások generálása + + + + Check to let 3D-effect colors be calculated from button-color. + + + + + Choose 3D-effect color role + 3D hatás szín szabályok kiválasztása + + + + <b>Select a color role.</b><p>Available effect roles are: <ul> <li>Light - lighter than Button color. </li> <li>Midlight - between Button and Light. </li> <li>Mid - between Button and Dark. </li> <li>Dark - darker than Button. </li> <li>Shadow - a very dark color. </li> </ul> + + + + + Light + Világos + + + + Midlight + Központi fény + + + + Mid + Középső + + + + Dark + Sötét + + + + Shadow + Árnyék + + + + Select Co&lor: + &Szín kiválasztása: + + + + Choose a color for the selected effect color role. + Egy szín kiválasztása a kiválaszott hatás szín szabályra. + + + + OK + OK + + + + Close dialog and apply all changes. + Párbeszéd ablak bezárása és az összes változtatás alkalmazása. + + + + Cancel + Mégse + + + + Close dialog and discard all changes. + Párbeszédablak bezárása és az összes változtatás eldobása. + + + + PreviewFrame + + + Desktop settings will only take effect after an application restart. + Az asztal beállítások kizárólag az alkalmazás újraindítása utan lépnek érvénybe. + + + + PreviewWidgetBase + + + Preview Window + Előnézet ablak + + + + ButtonGroup + GombCsoport + + + + RadioButton1 + RádioGomb1 + + + + RadioButton2 + RádioGomb2 + + + + RadioButton3 + RádioGomb3 + + + + ButtonGroup2 + GombCsoport2 + + + + CheckBox1 + Jelölőnégyzet1 + + + + CheckBox2 + Jelölőnégyzet2 + + + + LineEdit + SorSzerkesztés + + + + ComboBox + ComboBox + + + + PushButton + NyomóGomb + + + + <p> +<a href="http://qt.nokia.com">http://qt.nokia.com</a> +</p> +<p> +<a href="http://www.kde.org">http://www.kde.org</a> +</p> + <p> +<a href="http://qt.nokia.com">http://qt.nokia.com</a> +</p> +<p> +<a href="http://www.kde.org">http://www.kde.org</a> +</p> + + + diff --git a/translations/qvfb_hu.ts b/translations/qvfb_hu.ts new file mode 100644 index 0000000..bb8c931 --- /dev/null +++ b/translations/qvfb_hu.ts @@ -0,0 +1,344 @@ + + + + + AnimationSaveWidget + + + + Record + Rekord + + + + Reset + Visszaállítás + + + + Save + Mentés + + + + Save in MPEG format (requires netpbm package installed) + MPEG formátumba mentés (netpbm csomag telepítése szükséges) + + + + + Click record to begin recording. + Kattintson az írásra az írás megkezdéséhez. + + + + + Finished saving. + Befejezett mentés. + + + + Paused. Click record to resume, or save if done. + Szüneteltetve. Kattintson az írásra a folytatáshoz, vagy mentse el, ha kész. + + + + Pause + Szünet + + + + Recording... + Felvétel... + + + + Saving... + Mentés... + + + + + Save animation... + Animáció mentése... + + + + Save canceled. + Megnés visszavonva. + + + + Save failed! + Mentési hiba! + + + + Config + + + Configure + Konfigurálás + + + + Size + Méret + + + + 176x220 "SmartPhone" + 176x220 "ÜgyesTelefon" + + + + 240x320 "PDA" + 240x320 "PDA" + + + + 320x240 "TV" / "QVGA" + 320x240 "TV" / "QVGA" + + + + 640x480 "VGA" + 640x480 "VGA" + + + + 800x600 + 800x600 + + + + 1024x768 + 1024x768 + + + + Custom + Szokásos + + + + Depth + Mélység + + + + 1 bit monochrome + 1 bites egyszínű + + + + 2 bit grayscale + 2 bites szürke skálázás + + + + 4 bit grayscale + 4 bites szürke slálázás + + + + 8 bit + 8 bites + + + + 12 (16) bit + 12 (16) bites + + + + 15 bit + 15 bites + + + + 16 bit + 16 bites + + + + 18 bit + 18 bites + + + + 24 bit + 24 bites + + + + 32 bit + 32 bites + + + + 32 bit ARGB + 32 bites ARGB + + + + Swap red and blue channels + Piros és kék csatornák felcserélése + + + + BGR format + BGR formátum + + + + Skin + Szkin + + + + None + Semmi + + + + Emulate touch screen (no mouse move) + указателя? + Érintő képernyő emulálása (nincs egér mozgatás) + + + + Emulate LCD screen (Only with fixed zoom of 3.0 times magnification) + LCD kijelző emulálása (Kizárólag egy fix 3-szoros nagyítással) + + + + <p>Note that any applications using the virtual framebuffer will be terminated if you change the Size or Depth <i>above</i>. You may freely modify the Gamma <i>below</i>. + <p>Vegye figyelembe azt, hogy bármely alkalmazás, amely virtuális framebuffer-t használ, be lesz fejezve, ha megváltoztatja a méretet vagy a mélységet <i>felül</i>. Szabadon módosíthatja a Gamma-t <i>alul</i>. + + + + Gamma + Gamma + + + + Blue + Kék + + + + + + + 1.0 + 1.0 + + + + Green + Zöld + + + + All + Mind + + + + Red + Piros + + + + Set all to 1.0 + Az összes 1.0-ra állítása + + + + &OK + &OK + + + + &Cancel + &Mégse + + + + DeviceSkin + + + The image file '%1' could not be loaded. + Nem sikerült betölteni a(z) '%1' kép fájlt. + + + + The skin directory '%1' does not contain a configuration file. + A(z) '%1' skin könyvtár nem tartalmaz egyetlen konfigurációs fájlt sem. + + + + The skin configuration file '%1' could not be opened. + Nem lehetett megnyitni a(z) '%1' skin konfigurációs fájlt. + + + + The skin configuration file '%1' could not be read: %2 + Nem lehetett olvasni a(z) '%1' skin konfigurációs fájlt: %2 + + + + Syntax error: %1 + Szintakszis hiba: %1 + + + + The skin "up" image file '%1' does not exist. + A(z) '%1 'fel' skinezett kép fájl nem létezik. + + + + The skin "down" image file '%1' does not exist. + A(z) '%1 'le' skinezett kép fájl nem létezik. + + + + The skin "closed" image file '%1' does not exist. + A(z) '%1' skin "bezárt" kép fájl nem létezik. + + + + The skin cursor image file '%1' does not exist. + A(z) '%1' skin kurzor kép fájl nem létezik. + + + + Syntax error in area definition: %1 + Szintaszis hiba a terület definícióban: %1 + + + + Mismatch in number of areas, expected %1, got %2. + Nem megfelelő terület szám, %1 várt, %2 kapott. + + + + QVFb + + + Browse... + Böngészés... + + + + Load Custom Skin... + Szokásos skin betöltése... + + + + All QVFB Skins (*.skin) + Minden QVFB skin (*.skin) + + + -- cgit v0.12 From c88e93ef075dcc3d10e37500bac170b3cfe8f0b1 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Wed, 3 Feb 2010 13:00:38 +0100 Subject: QFileDialog: Compilation fix on windows The structs that we declare are all now prefixed with qt_ to avoid clashes with system defined ones. --- src/gui/dialogs/qfiledialog_win.cpp | 10 +++++----- src/gui/dialogs/qfiledialog_win_p.h | 30 ++++++++++++------------------ 2 files changed, 17 insertions(+), 23 deletions(-) diff --git a/src/gui/dialogs/qfiledialog_win.cpp b/src/gui/dialogs/qfiledialog_win.cpp index c7cef1e..3120938 100644 --- a/src/gui/dialogs/qfiledialog_win.cpp +++ b/src/gui/dialogs/qfiledialog_win.cpp @@ -71,9 +71,9 @@ static const CLSID QT_CLSID_FileOpenDialog = {0xdc1c5a9c, 0xe88a, 0x4dde, {0xa5, #endif -typedef LPITEMIDLIST (WINAPI *PtrSHBrowseForFolder)(BROWSEINFO*); +typedef qt_LPITEMIDLIST (WINAPI *PtrSHBrowseForFolder)(qt_BROWSEINFO*); static PtrSHBrowseForFolder ptrSHBrowseForFolder = 0; -typedef BOOL (WINAPI *PtrSHGetPathFromIDList)(LPITEMIDLIST,LPWSTR); +typedef BOOL (WINAPI *PtrSHGetPathFromIDList)(qt_LPITEMIDLIST, LPWSTR); static PtrSHGetPathFromIDList ptrSHGetPathFromIDList = 0; typedef HRESULT (WINAPI *PtrSHGetMalloc)(LPMALLOC *); static PtrSHGetMalloc ptrSHGetMalloc = 0; @@ -687,7 +687,7 @@ static int __stdcall winGetExistDirCallbackProc(HWND hwnd, qt_win_resolve_libs(); if (ptrSHGetPathFromIDList) { wchar_t path[MAX_PATH]; - ptrSHGetPathFromIDList(LPITEMIDLIST(lParam), path); + ptrSHGetPathFromIDList(qt_LPITEMIDLIST(lParam), path); QString tmpStr = QString::fromWCharArray(path); if (!tmpStr.isEmpty()) SendMessage(hwnd, BFFM_ENABLEOK, 1, 1); @@ -723,7 +723,7 @@ QString qt_win_get_existing_directory(const QFileDialogArgs &args) path[0] = 0; tTitle = args.caption; - BROWSEINFO bi; + qt_BROWSEINFO bi; Q_ASSERT(!parent ||parent->testAttribute(Qt::WA_WState_Created)); bi.hwndOwner = (parent ? parent->winId() : 0); @@ -737,7 +737,7 @@ QString qt_win_get_existing_directory(const QFileDialogArgs &args) qt_win_resolve_libs(); if (ptrSHBrowseForFolder) { - LPITEMIDLIST pItemIDList = ptrSHBrowseForFolder(&bi); + qt_LPITEMIDLIST pItemIDList = ptrSHBrowseForFolder(&bi); if (pItemIDList) { ptrSHGetPathFromIDList(pItemIDList, path); IMalloc *pMalloc; diff --git a/src/gui/dialogs/qfiledialog_win_p.h b/src/gui/dialogs/qfiledialog_win_p.h index 39e6f5d..527ab3f 100644 --- a/src/gui/dialogs/qfiledialog_win_p.h +++ b/src/gui/dialogs/qfiledialog_win_p.h @@ -49,9 +49,6 @@ //and we won't have to declare it ourselves //declarations -typedef DWORD SICHINTF; -typedef ULONG SFGAOF; -typedef DWORD SHCONTF; #define FOS_OVERWRITEPROMPT 0x2 #define FOS_STRICTFILETYPES 0x4 #define FOS_NOCHANGEDIR 0x8 @@ -143,32 +140,29 @@ typedef struct { LPCWSTR pszName; LPCWSTR pszSpec; } qt_COMDLG_FILTERSPEC; -#ifndef PROPERTYKEY_DEFINED -#define PROPERTYKEY_DEFINED typedef struct { GUID fmtid; DWORD pid; -} PROPERTYKEY; -#endif +} qt_PROPERTYKEY; typedef struct { USHORT cb; BYTE abID[1]; -} SHITEMID, *LPSHITEMID; +} qt_SHITEMID, *qt_LPSHITEMID; typedef struct { - SHITEMID mkid; -} ITEMIDLIST, *LPITEMIDLIST; -typedef const ITEMIDLIST *LPCITEMIDLIST; + qt_SHITEMID mkid; +} qt_ITEMIDLIST, *qt_LPITEMIDLIST; +typedef const qt_ITEMIDLIST *qt_LPCITEMIDLIST; typedef struct { HWND hwndOwner; - LPCITEMIDLIST pidlRoot; + qt_LPCITEMIDLIST pidlRoot; LPWSTR pszDisplayName; LPCWSTR lpszTitle; UINT ulFlags; BFFCALLBACK lpfn; LPARAM lParam; int iImage; -} BROWSEINFO; +} qt_BROWSEINFO; DECLARE_INTERFACE(IFileDialogEvents); DECLARE_INTERFACE_(IShellItem, IUnknown) @@ -176,13 +170,13 @@ DECLARE_INTERFACE_(IShellItem, IUnknown) STDMETHOD(BindToHandler)(THIS_ IBindCtx *pbc, REFGUID bhid, REFIID riid, void **ppv) PURE; STDMETHOD(GetParent)(THIS_ IShellItem **ppsi) PURE; STDMETHOD(GetDisplayName)(THIS_ SIGDN sigdnName, LPWSTR *ppszName) PURE; - STDMETHOD(GetAttributes)(THIS_ SFGAOF sfgaoMask, SFGAOF *psfgaoAttribs) PURE; - STDMETHOD(Compare)(THIS_ IShellItem *psi, SICHINTF hint, int *piOrder) PURE; + STDMETHOD(GetAttributes)(THIS_ ULONG sfgaoMask, ULONG *psfgaoAttribs) PURE; + STDMETHOD(Compare)(THIS_ IShellItem *psi, DWORD hint, int *piOrder) PURE; }; DECLARE_INTERFACE_(IShellItemFilter, IUnknown) { STDMETHOD(IncludeItem)(THIS_ IShellItem *psi) PURE; - STDMETHOD(GetEnumFlagsForItem)(THIS_ IShellItem *psi, SHCONTF *pgrfFlags) PURE; + STDMETHOD(GetEnumFlagsForItem)(THIS_ IShellItem *psi, DWORD *pgrfFlags) PURE; }; DECLARE_INTERFACE_(IEnumShellItems, IUnknown) { @@ -195,8 +189,8 @@ DECLARE_INTERFACE_(IShellItemArray, IUnknown) { STDMETHOD(BindToHandler)(THIS_ IBindCtx *pbc, REFGUID rbhid, REFIID riid, void **ppvOut) PURE; STDMETHOD(GetPropertyStore)(THIS_ GETPROPERTYSTOREFLAGS flags, REFIID riid, void **ppv) PURE; - STDMETHOD(GetPropertyDescriptionList)(THIS_ const PROPERTYKEY *keyType, REFIID riid, void **ppv) PURE; - STDMETHOD(GetAttributes)(THIS_ SIATTRIBFLAGS dwAttribFlags, SFGAOF sfgaoMask, SFGAOF *psfgaoAttribs) PURE; + STDMETHOD(GetPropertyDescriptionList)(THIS_ const qt_PROPERTYKEY *keyType, REFIID riid, void **ppv) PURE; + STDMETHOD(GetAttributes)(THIS_ SIATTRIBFLAGS dwAttribFlags, ULONG sfgaoMask, ULONG *psfgaoAttribs) PURE; STDMETHOD(GetCount)(THIS_ DWORD *pdwNumItems) PURE; STDMETHOD(GetItemAt)(THIS_ DWORD dwIndex, IShellItem **ppsi) PURE; STDMETHOD(EnumItems)(THIS_ IEnumShellItems **ppenumShellItems) PURE; -- cgit v0.12 From 63f66fb0008f93638de782b03f53e9777a941ab7 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 3 Feb 2010 14:45:20 +0100 Subject: qdoc3: Added support for the \qmlbasictype command. --- tools/qdoc3/cppcodeparser.cpp | 18 +++++++++++++++++- tools/qdoc3/htmlgenerator.cpp | 9 +++++++-- tools/qdoc3/node.cpp | 28 ++++++++++++++++++++++++++-- tools/qdoc3/node.h | 11 ++++++++++- tools/qdoc3/pagegenerator.cpp | 7 ++++++- tools/qdoc3/tree.cpp | 3 ++- 6 files changed, 68 insertions(+), 8 deletions(-) diff --git a/tools/qdoc3/cppcodeparser.cpp b/tools/qdoc3/cppcodeparser.cpp index 9b6a516..7d08c77 100644 --- a/tools/qdoc3/cppcodeparser.cpp +++ b/tools/qdoc3/cppcodeparser.cpp @@ -95,6 +95,7 @@ QT_BEGIN_NAMESPACE #define COMMAND_QMLMETHOD Doc::alias("qmlmethod") #define COMMAND_QMLATTACHEDMETHOD Doc::alias("qmlattachedmethod") #define COMMAND_QMLDEFAULT Doc::alias("default") +#define COMMAND_QMLBASICTYPE Doc::alias("qmlbasictype") #endif QStringList CppCodeParser::exampleFiles; @@ -536,7 +537,8 @@ QSet CppCodeParser::topicCommands() << COMMAND_QMLSIGNAL << COMMAND_QMLATTACHEDSIGNAL << COMMAND_QMLMETHOD - << COMMAND_QMLATTACHEDMETHOD; + << COMMAND_QMLATTACHEDMETHOD + << COMMAND_QMLBASICTYPE; #else << COMMAND_VARIABLE; #endif @@ -728,6 +730,20 @@ Node *CppCodeParser::processTopicCommand(const Doc& doc, } return new QmlClassNode(tre->root(), names[0], classNode); } + else if (command == COMMAND_QMLBASICTYPE) { +#if 0 + QStringList parts = arg.split(" "); + qDebug() << command << parts; + if (parts.size() > 1) { + FakeNode* pageNode = static_cast(tre->root()->findNode(parts[1], Node::Fake)); + if (pageNode) { + qDebug() << "FOUND"; + return new QmlBasicTypeNode(pageNode, parts[0]); + } + } +#endif + return new QmlBasicTypeNode(tre->root(), arg); + } else if ((command == COMMAND_QMLSIGNAL) || (command == COMMAND_QMLMETHOD) || (command == COMMAND_QMLATTACHEDSIGNAL) || diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index a3cdae6..15386f1 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -1428,14 +1428,19 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker) QList
sections; QList
::const_iterator s; - QString htmlTitle = fake->fullTitle(); + QString fullTitle = fake->fullTitle(); + QString htmlTitle = fullTitle; if (fake->subType() == Node::File && !fake->subTitle().isEmpty()) { subTitleSize = SmallSubTitle; htmlTitle += " (" + fake->subTitle() + ")"; } + else if (fake->subType() == Node::QmlBasicType) { + fullTitle = "QML Basic Type: " + fullTitle; + htmlTitle = fullTitle; + } generateHeader(htmlTitle, fake, marker, true); - generateTitle(fake->fullTitle(), + generateTitle(fullTitle, Text() << fake->subTitle(), subTitleSize, fake, diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp index 5796ea4..4da916c 100644 --- a/tools/qdoc3/node.cpp +++ b/tools/qdoc3/node.cpp @@ -85,6 +85,9 @@ void Node::setDoc(const Doc& doc, bool replace) } /*! + Construct a node with the given \a type and having the + given \a parent and \a name. The new node is added to the + parent's child list. */ Node::Node(Type type, InnerNode *parent, const QString& name) : typ(type), @@ -490,6 +493,8 @@ NodeList InnerNode::overloads(const QString &funcName) const } /*! + Construct an inner node (i.e., not a leaf node) of the + given \a type and having the given \a parent and \a name. */ InnerNode::InnerNode(Type type, InnerNode *parent, const QString& name) : Node(type, parent, name) @@ -547,6 +552,7 @@ bool InnerNode::isSameSignature(const FunctionNode *f1, const FunctionNode *f2) } /*! + Adds the \a child to this node's child list. */ void InnerNode::addChild(Node *child) { @@ -564,7 +570,9 @@ void InnerNode::addChild(Node *child) else { if (child->type() == Enum) enumChildren.append(child); - childMap.insert(child->name(), child); + if (childMap.contains(child->name())) + qDebug() << "Duplicate child" << child->name(); + childMap.insert(child->name(), child); } } @@ -1207,7 +1215,11 @@ bool TargetNode::isInnerNode() const bool QmlClassNode::qmlOnly = false; /*! - Constructor for the Qml class node. + Constructs a Qml class node (i.e. a Fake node with the + subtype QmlClass. The new node has the given \a parent + and \a name and is associated with the C++ class node + specified by \a cn which may be null if the the Qml + class node is not associated with a C++ class node. */ QmlClassNode::QmlClassNode(InnerNode *parent, const QString& name, @@ -1234,6 +1246,18 @@ QString QmlClassNode::fileBase() const } /*! + Constructs a Qml basic type node (i.e. a Fake node with + the subtype QmlBasicType. The new node has the given + \a parent and \a name. + */ +QmlBasicTypeNode::QmlBasicTypeNode(InnerNode *parent, + const QString& name) + : FakeNode(parent, name, QmlBasicType) +{ + setTitle(name); +} + +/*! Constructor for the Qml property group node. \a parent is always a QmlClassNode. */ diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h index c77fbeb..077aeb8 100644 --- a/tools/qdoc3/node.h +++ b/tools/qdoc3/node.h @@ -96,7 +96,8 @@ class Node #ifdef QDOC_QML ExternalPage, QmlClass, - QmlPropertyGroup + QmlPropertyGroup, + QmlBasicType #else ExternalPage #endif @@ -373,6 +374,14 @@ class QmlClassNode : public FakeNode const ClassNode* cnode; }; +class QmlBasicTypeNode : public FakeNode +{ + public: + QmlBasicTypeNode(InnerNode *parent, + const QString& name); + virtual ~QmlBasicTypeNode() { } +}; + class QmlPropGroupNode : public FakeNode { public: diff --git a/tools/qdoc3/pagegenerator.cpp b/tools/qdoc3/pagegenerator.cpp index a001c10..07edcc4 100644 --- a/tools/qdoc3/pagegenerator.cpp +++ b/tools/qdoc3/pagegenerator.cpp @@ -104,7 +104,8 @@ QString PageGenerator::fileBase(const Node *node) we prepend "qml-" to the file name of QML element doc files. */ - if (p->subType() == Node::QmlClass) { + if ((p->subType() == Node::QmlClass) || + (p->subType() == Node::QmlBasicType)) { base.prepend("qml-"); } #endif @@ -209,6 +210,10 @@ void PageGenerator::generateInnerNode(const InnerNode *node, if (fakeNode->subType() == Node::QmlPropertyGroup) return; #endif + if (fakeNode->subType() == Node::Page) { + if (node->count() > 0) + qDebug() << "PAGE" << fakeNode->title() << "HAS CHILDREN"; + } } if (node->parent() != 0) { diff --git a/tools/qdoc3/tree.cpp b/tools/qdoc3/tree.cpp index d46da95..6c2502d 100644 --- a/tools/qdoc3/tree.cpp +++ b/tools/qdoc3/tree.cpp @@ -1914,7 +1914,8 @@ QString Tree::fullDocumentLocation(const Node *node) const } else if (node->type() == Node::Fake) { #ifdef QDOC_QML - if (node->subType() == Node::QmlClass) + if ((node->subType() == Node::QmlClass) || + (node->subType() == Node::QmlBasicType)) return "qml-" + node->fileBase() + ".html"; else #endif -- cgit v0.12 From 14054a47230d41063a10ce8fbf7dc65c916163d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Tue, 2 Feb 2010 20:34:23 +0100 Subject: QDir fix issues with (shared) cached lists With 2964718224c0ed356511335742368d4fc421c6bd, QDir started really using the cached file lists. However, these were not being properly updated on setNameFilters, setFilter and setSorting. QDir::refresh, on the other hand, would invalidate the lists without first detaching, thus breaking the copy-on-write promise. Summarizing, shared data must be detached and cached lists invalidated, so they get regenerated. Reviewed-by: Olivier Goffart Reviewed-by: Ritt Konstantin --- src/corelib/io/qdir.cpp | 10 +++-- tests/auto/qdir/tst_qdir.cpp | 92 +++++++++++++++++++++++++++++++++++++++++ tests/shared/filesystem.h | 97 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 195 insertions(+), 4 deletions(-) create mode 100644 tests/shared/filesystem.h diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp index 250e5e5..f5d803e 100644 --- a/src/corelib/io/qdir.cpp +++ b/src/corelib/io/qdir.cpp @@ -960,7 +960,7 @@ void QDir::setNameFilters(const QStringList &nameFilters) { Q_D(QDir); - d->detach(); + d->reset(); d->data->nameFilters = nameFilters; } @@ -1146,7 +1146,7 @@ void QDir::setFilter(Filters filters) { Q_D(QDir); - d->detach(); + d->reset(); d->data->filters = filters; } @@ -1204,7 +1204,7 @@ void QDir::setSorting(SortFlags sort) { Q_D(QDir); - d->detach(); + d->reset(); d->data->sort = sort; } @@ -2155,7 +2155,7 @@ void QDir::refresh() const { Q_D(const QDir); - d->data->clear(); + const_cast(d)->reset(); } /*! @@ -2244,6 +2244,8 @@ bool QDir::matchAllDirs() const void QDir::setMatchAllDirs(bool on) { Q_D(QDir); + + d->reset(); d->matchAllDirs = on; } diff --git a/tests/auto/qdir/tst_qdir.cpp b/tests/auto/qdir/tst_qdir.cpp index 1d909c9..ba18bbb 100644 --- a/tests/auto/qdir/tst_qdir.cpp +++ b/tests/auto/qdir/tst_qdir.cpp @@ -49,6 +49,7 @@ #include #include #include "../network-settings.h" +#include "../../shared/filesystem.h" #if defined(Q_OS_SYMBIAN) # define STRINGIFY(x) #x @@ -164,6 +165,8 @@ private slots: void longFileName_data(); void longFileName(); + + void updateFileLists(); }; // Testing get/set functions @@ -1442,6 +1445,95 @@ void tst_QDir::longFileName() QFile::remove(fileName); } +void tst_QDir::updateFileLists() +{ + // Test setup + + FileSystem fs; + + QVERIFY( fs.createDirectory("update-file-lists") ); + QVERIFY( fs.createFile("update-file-lists/file1.txt") ); + QVERIFY( fs.createFile("update-file-lists/file2.doc") ); + + QVERIFY( fs.createDirectory("update-file-lists/sub-dir1") ); + QVERIFY( fs.createFile("update-file-lists/sub-dir1/file3.txt") ); + QVERIFY( fs.createFile("update-file-lists/sub-dir1/file4.doc") ); + QVERIFY( fs.createFile("update-file-lists/sub-dir1/file5.txt") ); + + QVERIFY( fs.createDirectory("update-file-lists/sub-dir2") ); + QVERIFY( fs.createFile("update-file-lists/sub-dir2/file6.txt") ); + QVERIFY( fs.createFile("update-file-lists/sub-dir2/file7.txt") ); + QVERIFY( fs.createFile("update-file-lists/sub-dir2/file8.doc") ); + QVERIFY( fs.createFile("update-file-lists/sub-dir2/file9.doc") ); + + // Actual test + + QDir dir("update-file-lists"); + + QCOMPARE(dir.count(), uint(6)); + QCOMPARE(dir.entryList().size(), 6); + QCOMPARE(dir.entryInfoList().size(), 6); + + dir.setFilter(QDir::AllEntries | QDir::NoDotAndDotDot); + + QCOMPARE(dir.entryList().size(), 4); + QCOMPARE(dir.count(), uint(4)); + QCOMPARE(dir.entryInfoList().size(), 4); + + dir.setPath("update-file-lists/sub-dir1"); + + QCOMPARE(dir.entryInfoList().size(), 3); + QCOMPARE(dir.count(), uint(3)); + QCOMPARE(dir.entryList().size(), 3); + + dir.setNameFilters(QStringList("*.txt")); + + QCOMPARE(dir.entryInfoList().size(), 2); + QCOMPARE(dir.entryList().size(), 2); + QCOMPARE(dir.count(), uint(2)); + + dir.setPath("update-file-lists"); + dir = QDir(dir.path(), + "*.txt", + QDir::Name | QDir::DirsLast, + QDir::AllEntries | QDir::AllDirs | QDir::NoDotAndDotDot); + + QCOMPARE(dir.count(), uint(3)); + QCOMPARE(dir.entryList().size(), 3); + QCOMPARE(dir.entryInfoList().size(), 3); + QCOMPARE(dir.entryList(), QStringList() << "file1.txt" << "sub-dir1" << "sub-dir2"); + + dir.setSorting(QDir::Name | QDir::DirsFirst); + + QCOMPARE(dir.count(), uint(3)); + QCOMPARE(dir.entryList().size(), 3); + QCOMPARE(dir.entryInfoList().size(), 3); + QCOMPARE(dir.entryList(), QStringList() << "sub-dir1" << "sub-dir2" << "file1.txt"); + + { + QVERIFY( fs.createFile("update-file-lists/extra-file.txt") ); + + QDir dir2(dir); + + QCOMPARE(dir2.count(), uint(3)); + QCOMPARE(dir2.entryList().size(), 3); + QCOMPARE(dir2.entryInfoList().size(), 3); + QCOMPARE(dir2.entryList(), QStringList() << "sub-dir1" << "sub-dir2" << "file1.txt"); + + dir2.refresh(); + + QCOMPARE(dir2.count(), uint(4)); + QCOMPARE(dir2.entryList().size(), 4); + QCOMPARE(dir2.entryInfoList().size(), 4); + QCOMPARE(dir2.entryList(), QStringList() << "sub-dir1" << "sub-dir2" << "extra-file.txt" << "file1.txt"); + } + + QCOMPARE(dir.count(), uint(3)); + QCOMPARE(dir.entryList().size(), 3); + QCOMPARE(dir.entryInfoList().size(), 3); + QCOMPARE(dir.entryList(), QStringList() << "sub-dir1" << "sub-dir2" << "file1.txt"); +} + QTEST_MAIN(tst_QDir) #include "tst_qdir.moc" diff --git a/tests/shared/filesystem.h b/tests/shared/filesystem.h new file mode 100644 index 0000000..2d46c0d --- /dev/null +++ b/tests/shared/filesystem.h @@ -0,0 +1,97 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +// Helper functions for creating file-system hierarchies and cleaning up. + +#ifndef QT_TESTS_SHARED_FILESYSTEM_H_INCLUDED +#define QT_TESTS_SHARED_FILESYSTEM_H_INCLUDED + +#include +#include +#include +#include + +struct FileSystem +{ + ~FileSystem() + { + Q_FOREACH(QString fileName, createdFiles) + QFile::remove(fileName); + + Q_FOREACH(QString dirName, createdDirectories) + currentDir.rmdir(dirName); + } + + bool createDirectory(const QString &dirName) + { + if (currentDir.mkdir(dirName)) { + createdDirectories.prepend(dirName); + return true; + } + return false; + } + + bool createFile(const QString &fileName) + { + QFile file(fileName); + if (file.open(QIODevice::WriteOnly)) { + createdFiles << fileName; + return true; + } + return false; + } + + bool createLink(const QString &destination, const QString &linkName) + { + if (QFile::link(destination, linkName)) { + createdFiles << linkName; + return true; + } + return false; + } + +private: + QDir currentDir; + + QStringList createdDirectories; + QStringList createdFiles; +}; + +#endif // include guard -- cgit v0.12 From dc7aa1a9f9cd89f726a54a88ff31731c56142eb8 Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Tue, 2 Feb 2010 13:56:03 +0100 Subject: Qt applications not responding to WM_GETHOTKEY on windows. On windows when an application has been started through a shortcut link, (either by double-clicking or by pressing the shortcut key assigned in the link) the STARTUPINFO contains the hotkey associated to the application. This should be set on the toplevel using WM_SETHOTKEY, so that it behaves like native applications. Task-number: QUTBUG-3426 Reviewed-by: Jens Bache-Wiig Reviewed-by: bnilsen --- src/gui/kernel/qwidget_p.h | 1 + src/gui/kernel/qwidget_win.cpp | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h index d3bc2d8..ff8f276 100644 --- a/src/gui/kernel/qwidget_p.h +++ b/src/gui/kernel/qwidget_p.h @@ -158,6 +158,7 @@ struct QTLWExtra { quint32 newCounterValueLo; #endif #elif defined(Q_WS_WIN) // <--------------------------------------------------------- WIN + uint hotkeyRegistered: 1; // Hot key from the STARTUPINFO has been registered. HICON winIconBig; // internal big Windows icon HICON winIconSmall; // internal small Windows icon #elif defined(Q_WS_MAC) // <--------------------------------------------------------- MAC diff --git a/src/gui/kernel/qwidget_win.cpp b/src/gui/kernel/qwidget_win.cpp index 10522ed..a57aacc 100644 --- a/src/gui/kernel/qwidget_win.cpp +++ b/src/gui/kernel/qwidget_win.cpp @@ -1094,6 +1094,21 @@ void QWidgetPrivate::show_sys() return; } + if (data.window_flags & Qt::Window) { + QTLWExtra *extra = topData(); + if (!extra->hotkeyRegistered) { + // Try to set the hotkey using information from STARTUPINFO + STARTUPINFO startupInfo; + GetStartupInfo(&startupInfo); + // If STARTF_USEHOTKEY is set, hStdInput is the virtual keycode + if (startupInfo.dwFlags & 0x00000200) { + WPARAM hotKey = (WPARAM)startupInfo.hStdInput; + SendMessage(data.winid, WM_SETHOTKEY, hotKey, 0); + } + extra->hotkeyRegistered = 1; + } + } + int sm = SW_SHOWNORMAL; bool fakedMaximize = false; if (q->isWindow()) { @@ -1687,6 +1702,7 @@ void QWidgetPrivate::deleteSysExtra() void QWidgetPrivate::createTLSysExtra() { + extra->topextra->hotkeyRegistered = 0; extra->topextra->savedFlags = 0; extra->topextra->winIconBig = 0; extra->topextra->winIconSmall = 0; -- cgit v0.12 From ad47f9cee2cd47ef566f86ca20f54e3f6da54070 Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Fri, 29 Jan 2010 10:48:15 +1000 Subject: Remove obsolete OpenGL/ES CommonLite (fixed-point) support Task-number: QTBUG-7683 Reviewed-by: Tom Cooksey --- config.tests/unix/opengles1cl/opengles1cl.cpp | 51 ------ config.tests/unix/opengles1cl/opengles1cl.pro | 9 -- configure | 41 ++--- demos/demos.pro | 2 +- doc/src/development/qmake-manual.qdoc | 12 +- doc/src/platforms/wince-opengl.qdoc | 13 +- doc/src/snippets/code/doc_src_wince-opengl.qdoc | 2 +- examples/opengl/hellogl_es/cl_helper.h | 133 ---------------- examples/opengl/hellogl_es/glwidget.cpp | 137 ++++++++-------- examples/opengl/hellogl_es/glwidget.h | 5 +- examples/opengl/opengl.pro | 6 +- mkspecs/common/linux.conf | 3 - mkspecs/common/wince/qmake.conf | 1 - mkspecs/features/egl.prf | 8 - mkspecs/features/unix/opengl.prf | 5 - mkspecs/unsupported/linux-host-g++/qmake.conf | 3 - src/opengl/opengl.pro | 8 +- src/opengl/qgl.cpp | 69 ++++----- src/opengl/qgl.h | 2 +- src/opengl/qgl_cl_p.h | 141 ----------------- src/opengl/qgl_p.h | 16 -- src/opengl/qglframebufferobject.cpp | 10 +- src/opengl/qglpaintdevice.cpp | 8 +- src/opengl/qglpixelbuffer.cpp | 6 +- src/opengl/qglpixelbuffer_egl.cpp | 4 - src/opengl/qglshaderprogram.cpp | 4 +- src/opengl/qglshaderprogram.h | 2 +- src/opengl/qgraphicsshadereffect.cpp | 2 +- src/opengl/qpaintengine_opengl.cpp | 197 ++++++++++++------------ src/opengl/qpixmapdata_x11gl_egl.cpp | 8 +- src/opengl/qwindowsurface_gl.cpp | 22 ++- src/plugins/graphicssystems/opengl/main.cpp | 4 +- tests/auto/qgl/tst_qgl.cpp | 2 - tools/configure/configureapp.cpp | 14 -- 34 files changed, 252 insertions(+), 698 deletions(-) delete mode 100644 config.tests/unix/opengles1cl/opengles1cl.cpp delete mode 100644 config.tests/unix/opengles1cl/opengles1cl.pro delete mode 100644 examples/opengl/hellogl_es/cl_helper.h delete mode 100644 src/opengl/qgl_cl_p.h diff --git a/config.tests/unix/opengles1cl/opengles1cl.cpp b/config.tests/unix/opengles1cl/opengles1cl.cpp deleted file mode 100644 index 4f27c75..0000000 --- a/config.tests/unix/opengles1cl/opengles1cl.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -int main(int, char **) -{ - GLfixed a = 0; - glColor4x(a, a, a, a); - glClear(GL_COLOR_BUFFER_BIT); - - return 0; -} diff --git a/config.tests/unix/opengles1cl/opengles1cl.pro b/config.tests/unix/opengles1cl/opengles1cl.pro deleted file mode 100644 index c4c069e..0000000 --- a/config.tests/unix/opengles1cl/opengles1cl.pro +++ /dev/null @@ -1,9 +0,0 @@ -SOURCES = opengles1cl.cpp -INCLUDEPATH += $$QMAKE_INCDIR_OPENGL_ES1CL - -for(p, QMAKE_LIBDIR_OPENGL_ES1CL) { - exists($$p):LIBS += -L$$p -} - -CONFIG -= qt -LIBS += $$QMAKE_LIBS_OPENGL_ES1CL diff --git a/configure b/configure index 722846c..ae6d724 100755 --- a/configure +++ b/configure @@ -1225,7 +1225,7 @@ while [ "$#" -gt 0 ]; do opengl) if [ "$VAL" = "auto" ] || [ "$VAL" = "desktop" ] || [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || - [ "$VAL" = "es1cl" ] || [ "$VAL" = "es1" ] || [ "$VAL" = "es2" ]; then + [ "$VAL" = "es1" ] || [ "$VAL" = "es2" ]; then CFG_OPENGL="$VAL" else UNKNOWN_OPT=yes @@ -3709,11 +3709,11 @@ Qt/X11 only: + -opengl ...... Enable OpenGL support. With no parameter, this will auto-detect the "best" OpenGL API to use. If desktop OpenGL is available, it - will be used. Use desktop, es1, es1cl or es2 for + will be used. Use desktop, es1, or es2 for to force the use of the Desktop (OpenGL 1.x or 2.x), - OpenGL ES 1.x Common profile, 1.x Common Lite profile - or 2.x APIs instead. On X11, the EGL API will be used - to manage GL contexts in the case of OpenGL ES + OpenGL ES 1.x Common profile, or 2.x APIs instead. + On X11, the EGL API will be used to manage GL + contexts in the case of OpenGL ES -no-openvg ........ Do not support OpenVG. + -openvg ........... Enable OpenVG support. @@ -3867,7 +3867,7 @@ Qt for Embedded Linux only: -no-opengl .......... Do not support OpenGL. -opengl ....... Enable OpenGL ES support With no parameter, this will attempt to auto-detect OpenGL ES 1.x - or 2.x. Use es1, es1cl or es2 for to override auto-detection. + or 2.x. Use es1 or es2 for to override auto-detection. NOTE: A QGLScreen driver for the hardware is required to support OpenGL ES on Qt for Embedded Linux. @@ -4972,7 +4972,7 @@ if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QWS" = "yes" ]; then CFG_EGL=yes CFG_EGL_GLES_INCLUDES=yes fi - if ( [ "$CFG_OPENGL" = "es1" ] || [ "$CFG_OPENGL" = "es1cl" ] || [ "$CFG_OPENGL" = "es2" ] ) && [ "$CFG_EGL" != "yes" ]; then + if ( [ "$CFG_OPENGL" = "es1" ] || [ "$CFG_OPENGL" = "es2" ] ) && [ "$CFG_EGL" != "yes" ]; then echo "The EGL functionality test failed!" echo " EGL is required for OpenGL ES to manage contexts & surfaces." echo " You might need to modify the include and library search paths by editing" @@ -5072,7 +5072,7 @@ if [ "$PLATFORM_X11" = "yes" ]; then exit 1 fi - # auto-detect OpenGL support (es1 = OpenGL ES 1.x Common, es1cl = ES 1.x common lite, es2 = OpenGL ES 2.x) + # auto-detect OpenGL support (es1 = OpenGL ES 1.x Common, es2 = OpenGL ES 2.x) if [ "$CFG_OPENGL" = "auto" ] || [ "$CFG_OPENGL" = "yes" ]; then if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/opengl "OpenGL" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS; then CFG_OPENGL=desktop @@ -5080,8 +5080,6 @@ if [ "$PLATFORM_X11" = "yes" ]; then CFG_OPENGL=es2 elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles1 "OpenGL ES 1.x" $L_FLAGS $I_FLAGS $l_FLAGS; then CFG_OPENGL=es1 - elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles1cl "OpenGL ES 1.x Lite" $L_FLAGS $I_FLAGS $l_FLAGS; then - CFG_OPENGL=es1cl else if [ "$CFG_OPENGL" = "yes" ]; then echo "All the OpenGL functionality tests failed!" @@ -5105,16 +5103,6 @@ if [ "$PLATFORM_X11" = "yes" ]; then *) ;; esac - elif [ "$CFG_OPENGL" = "es1cl" ]; then - # OpenGL ES 1.x common lite - "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles1cl "OpenGL ES 1.x Lite" $L_FLAGS $I_FLAGS $l_FLAGS - if [ $? != "0" ]; then - echo "The OpenGL ES 1.x Common Lite Profile functionality test failed!" - echo " You might need to modify the include and library search paths by editing" - echo " QMAKE_INCDIR_OPENGL_ES1CL, QMAKE_LIBDIR_OPENGL_ES1CL and QMAKE_LIBS_OPENGL_ES1CL in" - echo " ${XQMAKESPEC}." - exit 1 - fi elif [ "$CFG_OPENGL" = "es1" ]; then # OpenGL ES 1.x "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles1 "OpenGL ES 1.x" $L_FLAGS $I_FLAGS $l_FLAGS @@ -5424,14 +5412,12 @@ fi # QWS if [ "$PLATFORM_QWS" = "yes" ]; then - # auto-detect OpenGL support (es1 = OpenGL ES 1.x Common, es1cl = ES 1.x common lite, es2 = OpenGL ES 2.x) + # auto-detect OpenGL support (es1 = OpenGL ES 1.x Common, es2 = OpenGL ES 2.x) if [ "$CFG_OPENGL" = "yes" ]; then if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles2 "OpenGL ES 2.x" $L_FLAGS $I_FLAGS $l_FLAGS; then CFG_OPENGL=es2 elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles1 "OpenGL ES 1.x" $L_FLAGS $I_FLAGS $l_FLAGS; then CFG_OPENGL=es1 - elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles1cl "OpenGL ES 1.x Lite" $L_FLAGS $I_FLAGS $l_FLAGS; then - CFG_OPENGL=es1cl else echo "All the OpenGL ES functionality tests failed!" echo " You might need to modify the include and library search paths by editing" @@ -6072,7 +6058,7 @@ else QT_CONFIG="$QT_CONFIG opengl" fi -if [ "$CFG_OPENGL" = "es1" ] || [ "$CFG_OPENGL" = "es1cl" ] || [ "$CFG_OPENGL" = "es2" ]; then +if [ "$CFG_OPENGL" = "es1" ] || [ "$CFG_OPENGL" = "es2" ]; then if [ "$PLATFORM_QWS" = "yes" ]; then QCONFIG_FLAGS="$QCONFIG_FLAGS Q_BACKINGSTORE_SUBSURFACES" QCONFIG_FLAGS="$QCONFIG_FLAGS Q_USE_EGLWINDOWSURFACE" @@ -6085,11 +6071,6 @@ if [ "$CFG_OPENGL" = "es1" ]; then QT_CONFIG="$QT_CONFIG opengles1" fi -if [ "$CFG_OPENGL" = "es1cl" ]; then - QCONFIG_FLAGS="$QCONFIG_FLAGS QT_OPENGL_ES_1_CL" - QT_CONFIG="$QT_CONFIG opengles1cl" -fi - if [ "$CFG_OPENGL" = "es2" ]; then QCONFIG_FLAGS="$QCONFIG_FLAGS QT_OPENGL_ES_2" QT_CONFIG="$QT_CONFIG opengles2" @@ -7513,8 +7494,6 @@ if [ "$CFG_OPENGL" = "desktop" ]; then echo "OpenGL support ...... yes (Desktop OpenGL)" elif [ "$CFG_OPENGL" = "es1" ]; then echo "OpenGL support ...... yes (OpenGL ES 1.x Common profile)" -elif [ "$CFG_OPENGL" = "es1cl" ]; then - echo "OpenGL support ...... yes (OpenGL ES 1.x Common Lite profile)" elif [ "$CFG_OPENGL" = "es2" ]; then echo "OpenGL support ...... yes (OpenGL ES 2.x)" else diff --git a/demos/demos.pro b/demos/demos.pro index 5a9b6db..08dd8af 100644 --- a/demos/demos.pro +++ b/demos/demos.pro @@ -38,7 +38,7 @@ wince*: SUBDIRS = \ demos_undo \ demos_sub-attaq -contains(QT_CONFIG, opengl):!contains(QT_CONFIG, opengles1):!contains(QT_CONFIG, opengles1cl):!contains(QT_CONFIG, opengles2):{ +contains(QT_CONFIG, opengl):!contains(QT_CONFIG, opengles1):!contains(QT_CONFIG, opengles2):{ SUBDIRS += demos_boxes } diff --git a/doc/src/development/qmake-manual.qdoc b/doc/src/development/qmake-manual.qdoc index 3d5c792..8fc4058 100644 --- a/doc/src/development/qmake-manual.qdoc +++ b/doc/src/development/qmake-manual.qdoc @@ -2252,11 +2252,11 @@ For example: If the OpenGL implementation uses EGL (most OpenGL/ES systems), then QMAKE_INCDIR_EGL may also need to be set. - \section1 QMAKE_INCDIR_OPENGL_ES1, QMAKE_INCDIR_OPENGL_ES1CL, QMAKE_INCDIR_OPENGL_ES2 + \section1 QMAKE_INCDIR_OPENGL_ES1, QMAKE_INCDIR_OPENGL_ES2 These variables contain the location of OpenGL headers files to be added - to INCLUDEPATH when building an application with OpenGL ES 1, OpenGL ES 1 Common - Lite or OpenGL ES 2 support respectively. + to INCLUDEPATH when building an application with OpenGL ES 1 + or OpenGL ES 2 support respectively. The value of this variable is typically handled by \c qmake or \l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified. @@ -2510,10 +2510,10 @@ For example: variable is typically handled by \c qmake or \l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified. - \section1 QMAKE_LIBS_OPENGL_ES1, QMAKE_LIBS_OPENGL_ES1CL, QMAKE_LIBS_OPENGL_ES2 + \section1 QMAKE_LIBS_OPENGL_ES1, QMAKE_LIBS_OPENGL_ES2 - These variables contain all the OpenGL libraries for OpenGL ES 1, - OpenGL ES 1 Common Lite profile and OpenGL ES 2. + These variables contain all the OpenGL libraries for OpenGL ES 1 + and OpenGL ES 2. The value of these variables is typically handled by \c qmake or \l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified. diff --git a/doc/src/platforms/wince-opengl.qdoc b/doc/src/platforms/wince-opengl.qdoc index afc1c0b..c1be4bc 100644 --- a/doc/src/platforms/wince-opengl.qdoc +++ b/doc/src/platforms/wince-opengl.qdoc @@ -53,7 +53,7 @@ Windows CE window manager. \section2 Configure -To configure Qt for Windows Mobile 5.0 and OpenGL ES Common Lite support +To configure Qt for Windows Mobile 5.0 and OpenGL ES Common support you can run \c{configure} like this: \snippet doc/src/snippets/code/doc_src_wince-opengl.qdoc 0 @@ -61,17 +61,12 @@ you can run \c{configure} like this: OpenGL ES includes profiles for floating-point and fixed-point arithmetic. The floating point profile is called OpenGL ES CM (Common) and the fixed-point profile is called OpenGL ES CL (Common Lite). +The fixed-point profile is no longer supported since Qt 4.7. You can run \c{configure} with the \c{-opengl-es-cm} option for the Common -profile or \c{-opengl-es-cl} for the Common Lite profile. In both cases, -ensure that the \c{lib} and \c{includes} paths include the OpenGL ES +profile. Ensure that the \c{lib} and \c{includes} paths include the OpenGL ES headers and libararies from your SDK. The OpenGL ES lib should be called -either \c{libGLES_CM.lib} for the Common profile or \c{libGLES_CL.lib} for -the Common Lite profile. - -The distinction between the Common and Common Lite profiles is important, -because the Common Lite profile has less functionality and only supports a -fixed-point vertex format. +either \c{libGLES_CM.lib} for the Common profile. To start programming with Qt and OpenGL ES on Windows CE, you can start with the \l{Hello GL ES Example}. This example shows how to use QGLWidget diff --git a/doc/src/snippets/code/doc_src_wince-opengl.qdoc b/doc/src/snippets/code/doc_src_wince-opengl.qdoc index eef1540..601b00a 100644 --- a/doc/src/snippets/code/doc_src_wince-opengl.qdoc +++ b/doc/src/snippets/code/doc_src_wince-opengl.qdoc @@ -40,5 +40,5 @@ ****************************************************************************/ //! [0] -configure -platform win32-msvc2005 -xplatform wincewm50pocket-msvc2005 -opengl-es-cl +configure -platform win32-msvc2005 -xplatform wincewm50pocket-msvc2005 -opengl-es-cm //! [0] diff --git a/examples/opengl/hellogl_es/cl_helper.h b/examples/opengl/hellogl_es/cl_helper.h deleted file mode 100644 index 4f4c2bd..0000000 --- a/examples/opengl/hellogl_es/cl_helper.h +++ /dev/null @@ -1,133 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifdef QT_OPENGL_ES_1_CL - -//! [0] -#define FLOAT2X(f) ((int) ( (f) * (65536))) -#define X2FLOAT(x) ((float)(x) / 65536.0f) - -#define f2vt(f) FLOAT2X(f) -#define vt2f(x) X2FLOAT(x) - -#define q_vertexType GLfixed -#define q_vertexTypeEnum GL_FIXED - -#define q_glFog glFogx -#define q_glFogv glFogxv -//! [0] - -#define q_glLight glLightx -#define q_glLightv glLightxv -#define q_glLightModel glLightModelx -#define q_glLightModelv glLightModelxv - -#define q_glAlphaFunc glAlphaFuncx - -#define q_glMaterial glMaterialx -#define q_glMaterialv glMaterialxv -#define q_glColor4 glColor4x - -#define q_glTexParameter glTexParameterx -#define q_glTexEnv glTexEnvx - -#define q_glOrtho glOrthox -#define q_glFrustum glFrustumx - -#define q_glTranslate glTranslatex -#define q_glScale glScalex -#define q_glRotate glRotatex -#define q_glLoadMatrix glLoadMatrixx - -#define q_glClearColor glClearColorx - -#define q_glMultMatrix glMultMatrixx - -#define q_glNormal3 glNormal3x - -#define q_glPolygonOffset glPolygonOffsetx -#define q_glPointSize glPointSizex - -//! [1] -#else - -#define f2vt(f) (f) -#define vt2f(x) (x) - -#define q_vertexType GLfloat -#define q_vertexTypeEnum GL_FLOAT - -#define q_glFog glFogf -#define q_glFogv glFogfv -//! [1] - -#define q_glLight glLightf -#define q_glLightv glLightfv -#define q_glLightModel glLightModelf -#define q_glLightModelv glLightModelfv - -#define q_glAlphaFunc glAlphaFuncf - -#define q_glMaterial glMaterialf -#define q_glMaterialv glMaterialfv -#define q_glColor4 glColor4f - -#define q_glTexParameter glTexParameterf -#define q_glTexEnv glTexEnvf - -#define q_glOrtho glOrthof -#define q_glFrustum glFrustumf - -#define q_glTranslate glTranslatef -#define q_glScale glScalef -#define q_glRotate glRotatef -#define q_glLoadMatrix glLoadMatrixf - -#define q_glClearColor glClearColor - -#define q_glMultMatrix glMultMatrixf - -#define q_glNormal3 glNormal3f - -#define q_glPolygonOffset glPolygonOffsetf -#define q_glPointSize glPointSizef - -#endif diff --git a/examples/opengl/hellogl_es/glwidget.cpp b/examples/opengl/hellogl_es/glwidget.cpp index 9a45a11..8a6543d 100644 --- a/examples/opengl/hellogl_es/glwidget.cpp +++ b/examples/opengl/hellogl_es/glwidget.cpp @@ -44,7 +44,6 @@ #include #include "bubble.h" -#include "cl_helper.h" const int bubbleNum = 8; @@ -114,9 +113,9 @@ void GLWidget::paintQtLogo() { glDisable(GL_TEXTURE_2D); glEnableClientState(GL_VERTEX_ARRAY); - glVertexPointer(3,q_vertexTypeEnum,0, createdVertices); + glVertexPointer(3,GL_FLOAT,0, createdVertices); glEnableClientState(GL_NORMAL_ARRAY); - glNormalPointer(q_vertexTypeEnum,0,createdNormals); + glNormalPointer(GL_FLOAT,0,createdNormals); glDrawArrays(GL_TRIANGLES, 0, m_vertexNumber / 3); } //! [2] @@ -125,83 +124,83 @@ void GLWidget::paintTexturedCube() { glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, m_uiTexture); - q_vertexType afVertices[] = { - f2vt(-0.5), f2vt(0.5), f2vt(0.5), f2vt(0.5),f2vt(-0.5),f2vt(0.5),f2vt(-0.5),f2vt(-0.5),f2vt(0.5), - f2vt(0.5), f2vt(-0.5), f2vt(0.5), f2vt(-0.5),f2vt(0.5),f2vt(0.5),f2vt(0.5),f2vt(0.5),f2vt(0.5), - f2vt(-0.5), f2vt(-0.5), f2vt(-0.5), f2vt(0.5),f2vt(-0.5),f2vt(-0.5),f2vt(-0.5),f2vt(0.5),f2vt(-0.5), - f2vt(0.5), f2vt(0.5), f2vt(-0.5), f2vt(-0.5),f2vt(0.5),f2vt(-0.5),f2vt(0.5),f2vt(-0.5),f2vt(-0.5), - - f2vt(0.5), f2vt(-0.5), f2vt(-0.5), f2vt(0.5),f2vt(-0.5),f2vt(0.5),f2vt(0.5),f2vt(0.5),f2vt(-0.5), - f2vt(0.5), f2vt(0.5), f2vt(0.5), f2vt(0.5),f2vt(0.5),f2vt(-0.5),f2vt(0.5),f2vt(-0.5),f2vt(0.5), - f2vt(-0.5), f2vt(0.5), f2vt(-0.5), f2vt(-0.5),f2vt(-0.5),f2vt(0.5),f2vt(-0.5),f2vt(-0.5),f2vt(-0.5), - f2vt(-0.5), f2vt(-0.5), f2vt(0.5), f2vt(-0.5),f2vt(0.5),f2vt(-0.5),f2vt(-0.5),f2vt(0.5),f2vt(0.5), - - f2vt(0.5), f2vt(0.5), f2vt(-0.5), f2vt(-0.5), f2vt(0.5), f2vt(0.5), f2vt(-0.5), f2vt(0.5), f2vt(-0.5), - f2vt(-0.5), f2vt(0.5), f2vt(0.5), f2vt(0.5), f2vt(0.5), f2vt(-0.5), f2vt(0.5), f2vt(0.5), f2vt(0.5), - f2vt(-0.5), f2vt(-0.5), f2vt(-0.5), f2vt(-0.5), f2vt(-0.5), f2vt(0.5), f2vt(0.5), f2vt(-0.5), f2vt(-0.5), - f2vt(0.5), f2vt(-0.5), f2vt(0.5), f2vt(0.5), f2vt(-0.5), f2vt(-0.5), f2vt(-0.5), f2vt(-0.5), f2vt(0.5) + GLfloat afVertices[] = { + -0.5, 0.5, 0.5, 0.5,-0.5,0.5,-0.5,-0.5,0.5, + 0.5, -0.5, 0.5, -0.5,0.5,0.5,0.5,0.5,0.5, + -0.5, -0.5, -0.5, 0.5,-0.5,-0.5,-0.5,0.5,-0.5, + 0.5, 0.5, -0.5, -0.5,0.5,-0.5,0.5,-0.5,-0.5, + + 0.5, -0.5, -0.5, 0.5,-0.5,0.5,0.5,0.5,-0.5, + 0.5, 0.5, 0.5, 0.5,0.5,-0.5,0.5,-0.5,0.5, + -0.5, 0.5, -0.5, -0.5,-0.5,0.5,-0.5,-0.5,-0.5, + -0.5, -0.5, 0.5, -0.5,0.5,-0.5,-0.5,0.5,0.5, + + 0.5, 0.5, -0.5, -0.5, 0.5, 0.5, -0.5, 0.5, -0.5, + -0.5, 0.5, 0.5, 0.5, 0.5, -0.5, 0.5, 0.5, 0.5, + -0.5, -0.5, -0.5, -0.5, -0.5, 0.5, 0.5, -0.5, -0.5, + 0.5, -0.5, 0.5, 0.5, -0.5, -0.5, -0.5, -0.5, 0.5 }; glEnableClientState(GL_VERTEX_ARRAY); - glVertexPointer(3,q_vertexTypeEnum,0,afVertices); - - q_vertexType afTexCoord[] = { - f2vt(0.0f),f2vt(0.0f), f2vt(1.0f),f2vt(1.0f), f2vt(1.0f),f2vt(0.0f), - f2vt(1.0f),f2vt(1.0f), f2vt(0.0f),f2vt(0.0f), f2vt(0.0f),f2vt(1.0f), - f2vt(1.0f),f2vt(1.0f), f2vt(1.0f),f2vt(0.0f), f2vt(0.0f),f2vt(1.0f), - f2vt(0.0f),f2vt(0.0f), f2vt(0.0f),f2vt(1.0f), f2vt(1.0f),f2vt(0.0f), - - f2vt(1.0f),f2vt(1.0f), f2vt(1.0f),f2vt(0.0f), f2vt(0.0f),f2vt(1.0f), - f2vt(0.0f),f2vt(0.0f), f2vt(0.0f),f2vt(1.0f), f2vt(1.0f),f2vt(0.0f), - f2vt(0.0f),f2vt(0.0f), f2vt(1.0f),f2vt(1.0f), f2vt(1.0f),f2vt(0.0f), - f2vt(1.0f),f2vt(1.0f), f2vt(0.0f),f2vt(0.0f), f2vt(0.0f),f2vt(1.0f), - - f2vt(0.0f),f2vt(1.0f), f2vt(1.0f),f2vt(0.0f), f2vt(1.0f),f2vt(1.0f), - f2vt(1.0f),f2vt(0.0f), f2vt(0.0f),f2vt(1.0f), f2vt(0.0f),f2vt(0.0f), - f2vt(1.0f),f2vt(0.0f), f2vt(1.0f),f2vt(1.0f), f2vt(0.0f),f2vt(0.0f), - f2vt(0.0f),f2vt(1.0f), f2vt(0.0f),f2vt(0.0f), f2vt(1.0f),f2vt(1.0f) + glVertexPointer(3,GL_FLOAT,0,afVertices); + + GLfloat afTexCoord[] = { + 0.0f,0.0f, 1.0f,1.0f, 1.0f,0.0f, + 1.0f,1.0f, 0.0f,0.0f, 0.0f,1.0f, + 1.0f,1.0f, 1.0f,0.0f, 0.0f,1.0f, + 0.0f,0.0f, 0.0f,1.0f, 1.0f,0.0f, + + 1.0f,1.0f, 1.0f,0.0f, 0.0f,1.0f, + 0.0f,0.0f, 0.0f,1.0f, 1.0f,0.0f, + 0.0f,0.0f, 1.0f,1.0f, 1.0f,0.0f, + 1.0f,1.0f, 0.0f,0.0f, 0.0f,1.0f, + + 0.0f,1.0f, 1.0f,0.0f, 1.0f,1.0f, + 1.0f,0.0f, 0.0f,1.0f, 0.0f,0.0f, + 1.0f,0.0f, 1.0f,1.0f, 0.0f,0.0f, + 0.0f,1.0f, 0.0f,0.0f, 1.0f,1.0f }; glEnableClientState(GL_TEXTURE_COORD_ARRAY); - glTexCoordPointer(2,q_vertexTypeEnum,0,afTexCoord); + glTexCoordPointer(2,GL_FLOAT,0,afTexCoord); - q_vertexType afNormals[] = { + GLfloat afNormals[] = { - f2vt(0),f2vt(0),f2vt(-1), f2vt(0),f2vt(0),f2vt(-1), f2vt(0),f2vt(0),f2vt(-1), - f2vt(0),f2vt(0),f2vt(-1), f2vt(0),f2vt(0),f2vt(-1), f2vt(0),f2vt(0),f2vt(-1), - f2vt(0),f2vt(0),f2vt(1), f2vt(0),f2vt(0),f2vt(1), f2vt(0),f2vt(0),f2vt(1), - f2vt(0),f2vt(0),f2vt(1), f2vt(0),f2vt(0),f2vt(1), f2vt(0),f2vt(0),f2vt(1), + 0,0,-1, 0,0,-1, 0,0,-1, + 0,0,-1, 0,0,-1, 0,0,-1, + 0,0,1, 0,0,1, 0,0,1, + 0,0,1, 0,0,1, 0,0,1, - f2vt(-1),f2vt(0),f2vt(0), f2vt(-1),f2vt(0),f2vt(0), f2vt(-1),f2vt(0),f2vt(0), - f2vt(-1),f2vt(0),f2vt(0), f2vt(-1),f2vt(0),f2vt(0), f2vt(-1),f2vt(0),f2vt(0), - f2vt(1),f2vt(0),f2vt(0), f2vt(1),f2vt(0),f2vt(0), f2vt(1),f2vt(0),f2vt(0), - f2vt(1),f2vt(0),f2vt(0), f2vt(1),f2vt(0),f2vt(0), f2vt(1),f2vt(0),f2vt(0), + -1,0,0, -1,0,0, -1,0,0, + -1,0,0, -1,0,0, -1,0,0, + 1,0,0, 1,0,0, 1,0,0, + 1,0,0, 1,0,0, 1,0,0, - f2vt(0),f2vt(-1),f2vt(0), f2vt(0),f2vt(-1),f2vt(0), f2vt(0),f2vt(-1),f2vt(0), - f2vt(0),f2vt(-1),f2vt(0), f2vt(0),f2vt(-1),f2vt(0), f2vt(0),f2vt(-1),f2vt(0), - f2vt(0),f2vt(1),f2vt(0), f2vt(0),f2vt(1),f2vt(0), f2vt(0),f2vt(1),f2vt(0), - f2vt(0),f2vt(1),f2vt(0), f2vt(0),f2vt(1),f2vt(0), f2vt(0),f2vt(1),f2vt(0) + 0,-1,0, 0,-1,0, 0,-1,0, + 0,-1,0, 0,-1,0, 0,-1,0, + 0,1,0, 0,1,0, 0,1,0, + 0,1,0, 0,1,0, 0,1,0 }; glEnableClientState(GL_NORMAL_ARRAY); - glNormalPointer(q_vertexTypeEnum,0,afNormals); + glNormalPointer(GL_FLOAT,0,afNormals); glDrawArrays(GL_TRIANGLES, 0, 36); } void GLWidget::initializeGL () { - q_glClearColor(f2vt(0.1f), f2vt(0.1f), f2vt(0.2f), f2vt(1.0f)); + glClearColor(0.1f, 0.1f, 0.2f, 1.0f); glEnable(GL_TEXTURE_2D); glGenTextures(1, &m_uiTexture); m_uiTexture = bindTexture(QImage(":/qt.png")); - q_glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); - q_glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); glEnable(GL_LIGHTING); glEnable(GL_LIGHT0); - q_vertexType aLightPosition[] = {f2vt(0.0f),f2vt(0.3f),f2vt(1.0f),f2vt(0.0f)}; + GLfloat aLightPosition[] = {0.0f,0.3f,1.0f,0.0f}; - q_glLightv(GL_LIGHT0, GL_SPOT_DIRECTION, aLightPosition); + glLightfv(GL_LIGHT0, GL_SPOT_DIRECTION, aLightPosition); m_fAngle = 0; m_fScale = 1; createGeometry(); @@ -230,12 +229,12 @@ void GLWidget::paintGL() //Since OpenGL ES does not support glPush/PopAttrib(GL_ALL_ATTRIB_BITS) //we have to take care of the states ourselves - q_glClearColor(f2vt(0.1f), f2vt(0.1f), f2vt(0.2f), f2vt(1.0f)); + glClearColor(0.1f, 0.1f, 0.2f, 1.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glEnable(GL_TEXTURE_2D); - q_glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); - q_glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); glEnable(GL_LIGHTING); glEnable(GL_LIGHT0); @@ -248,14 +247,14 @@ void GLWidget::paintGL() glMatrixMode(GL_MODELVIEW); glLoadIdentity(); - q_glRotate(f2vt(m_fAngle), f2vt(0.0), f2vt(1.0), f2vt(0.0)); - q_glRotate(f2vt(m_fAngle), f2vt(1.0), f2vt(0.0), f2vt(0.0)); - q_glRotate(f2vt(m_fAngle), f2vt(0.0), f2vt(0.0), f2vt(1.0)); - q_glScale(f2vt(m_fScale), f2vt(m_fScale),f2vt(m_fScale)); - q_glTranslate(f2vt(0),f2vt(-0.2),f2vt(0)); + glRotatef(m_fAngle, 0.0f, 1.0f, 0.0f); + glRotatef(m_fAngle, 1.0f, 0.0f, 0.0f); + glRotatef(m_fAngle, 0.0f, 0.0f, 1.0f); + glScalef(m_fScale, m_fScale,m_fScale); + glTranslatef(0.0f,-0.2f,0.0f); - q_vertexType matDiff[] = {f2vt(0.40), f2vt(1.0), f2vt(0.0), f2vt(1.0)}; - q_glMaterialv(GL_FRONT_AND_BACK, GL_DIFFUSE, matDiff); + GLfloat matDiff[] = {0.40f, 1.0f, 0.0f, 1.0f}; + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, matDiff); if (qtLogo) paintQtLogo(); @@ -376,11 +375,11 @@ void GLWidget::createGeometry() //! [1] m_vertexNumber = vertices.size(); - createdVertices = new q_vertexType[m_vertexNumber]; - createdNormals = new q_vertexType[m_vertexNumber]; + createdVertices = new GLfloat[m_vertexNumber]; + createdNormals = new GLfloat[m_vertexNumber]; for (int i = 0;i < m_vertexNumber;i++) { - createdVertices[i] = f2vt(vertices.at(i) * 2); - createdNormals[i] = f2vt(normals.at(i)); + createdVertices[i] = vertices.at(i) * 2; + createdNormals[i] = normals.at(i); } vertices.clear(); normals.clear(); diff --git a/examples/opengl/hellogl_es/glwidget.h b/examples/opengl/hellogl_es/glwidget.h index 7a8df53..3b2b5d4 100644 --- a/examples/opengl/hellogl_es/glwidget.h +++ b/examples/opengl/hellogl_es/glwidget.h @@ -45,7 +45,6 @@ #include #include -#include "cl_helper.h" class Bubble; @@ -76,8 +75,8 @@ private: void extrude(qreal x1, qreal y1, qreal x2, qreal y2); QList vertices; QList normals; - q_vertexType *createdVertices; - q_vertexType *createdNormals; + GLfloat *createdVertices; + GLfloat *createdNormals; int m_vertexNumber; bool qtLogo; QList bubbles; diff --git a/examples/opengl/opengl.pro b/examples/opengl/opengl.pro index eaac9b8..c3fbc77 100644 --- a/examples/opengl/opengl.pro +++ b/examples/opengl/opengl.pro @@ -1,14 +1,12 @@ TEMPLATE = subdirs -contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles1cl)|contains(QT_CONFIG, opengles2){ +contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2){ contains(QT_CONFIG, opengles2) { SUBDIRS = hellogl_es2 } else { SUBDIRS = hellogl_es } - !contains(QT_CONFIG, opengles1cl) { - SUBDIRS += textures - } + SUBDIRS += textures contains(QT_CONFIG, opengles1) { SUBDIRS += hellogl } diff --git a/mkspecs/common/linux.conf b/mkspecs/common/linux.conf index 1ae5608..4fbe2dc 100644 --- a/mkspecs/common/linux.conf +++ b/mkspecs/common/linux.conf @@ -15,8 +15,6 @@ QMAKE_INCDIR_OPENGL = /usr/X11R6/include QMAKE_LIBDIR_OPENGL = /usr/X11R6/lib QMAKE_INCDIR_OPENGL_ES1 = $$QMAKE_INCDIR_OPENGL QMAKE_LIBDIR_OPENGL_ES1 = $$QMAKE_LIBDIR_OPENGL -QMAKE_INCDIR_OPENGL_ES1CL = $$QMAKE_INCDIR_OPENGL -QMAKE_LIBDIR_OPENGL_ES1CL = $$QMAKE_LIBDIR_OPENGL QMAKE_INCDIR_OPENGL_ES2 = $$QMAKE_INCDIR_OPENGL QMAKE_LIBDIR_OPENGL_ES2 = $$QMAKE_LIBDIR_OPENGL QMAKE_INCDIR_EGL = @@ -33,7 +31,6 @@ QMAKE_LIBS_EGL = -lEGL QMAKE_LIBS_OPENGL = -lGLU -lGL QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_LIBS_OPENGL_ES1 = -lGLES_CM -QMAKE_LIBS_OPENGL_ES1CL = -lGLES_CL QMAKE_LIBS_OPENGL_ES2 = -lGLESv2 QMAKE_LIBS_OPENVG = -lOpenVG QMAKE_LIBS_THREAD = -lpthread diff --git a/mkspecs/common/wince/qmake.conf b/mkspecs/common/wince/qmake.conf index ff99f1b..705cdc3 100644 --- a/mkspecs/common/wince/qmake.conf +++ b/mkspecs/common/wince/qmake.conf @@ -66,7 +66,6 @@ QMAKE_LIBS_COMPAT = QMAKE_LIBS_EGL = libEGL.lib QMAKE_LIBS_OPENGL_ES1 = libGLES_CM.lib -QMAKE_LIBS_OPENGL_ES1CL = libGLES_CL.lib QMAKE_LIBS_OPENGL_ES2 = libGLESv2.lib QMAKE_LIBS_QT_ENTRY = -lqtmain diff --git a/mkspecs/features/egl.prf b/mkspecs/features/egl.prf index 00f70d3..7e7d098 100644 --- a/mkspecs/features/egl.prf +++ b/mkspecs/features/egl.prf @@ -11,14 +11,6 @@ wince*:contains(QT_CONFIG, opengles1) { exists($$p):LIBS_PRIVATE += -L$$p } DEFINES += QT_GLES_EGL -} else:wince*:contains(QT_CONFIG, opengles1cl) { - INCLUDEPATH += $$QMAKE_INCDIR_OPENGL_ES1CL - LIBS_PRIVATE += $$QMAKE_LIBS_OPENGL_ES1CL - LIBS += $$QMAKE_LFLAGS_EGL - for(p, QMAKE_LIBDIR_OPENGL_ES1CL) { - exists($$p):LIBS_PRIVATE += -L$$p - } - DEFINES += QT_GLES_EGL } else { INCLUDEPATH += $$QMAKE_INCDIR_EGL LIBS_PRIVATE += $$QMAKE_LIBS_EGL diff --git a/mkspecs/features/unix/opengl.prf b/mkspecs/features/unix/opengl.prf index f2db819..74a5149 100644 --- a/mkspecs/features/unix/opengl.prf +++ b/mkspecs/features/unix/opengl.prf @@ -3,11 +3,6 @@ contains(QT_CONFIG, opengles1) { !isEmpty(QMAKE_LIBDIR_OPENGL_ES1):QMAKE_LIBDIR += $$QMAKE_LIBDIR_OPENGL_ES1 target_qt:LIBS_PRIVATE += $$QMAKE_LIBS_OPENGL_ES1 else:LIBS += $$QMAKE_LIBS_OPENGL_ES1 -} else:contains(QT_CONFIG, opengles1cl) { - INCLUDEPATH += $$QMAKE_INCDIR_OPENGL_ES1CL - !isEmpty(QMAKE_LIBDIR_OPENGL_ES1CL):QMAKE_LIBDIR += $$QMAKE_LIBDIR_OPENGL_ES1CL - target_qt:LIBS_PRIVATE += $$QMAKE_LIBS_OPENGL_ES1CL - else:LIBS += $$QMAKE_LIBS_OPENGL_ES1CL } else:contains(QT_CONFIG, opengles2) { INCLUDEPATH += $$QMAKE_INCDIR_OPENGL_ES2 !isEmpty(QMAKE_LIBDIR_OPENGL_ES2):QMAKE_LIBDIR += $$QMAKE_LIBDIR_OPENGL_ES2 diff --git a/mkspecs/unsupported/linux-host-g++/qmake.conf b/mkspecs/unsupported/linux-host-g++/qmake.conf index 8a480c4..7b17789 100644 --- a/mkspecs/unsupported/linux-host-g++/qmake.conf +++ b/mkspecs/unsupported/linux-host-g++/qmake.conf @@ -88,8 +88,6 @@ QMAKE_INCDIR_OPENGL = /usr/X11R6/include QMAKE_LIBDIR_OPENGL = /usr/X11R6/lib QMAKE_INCDIR_OPENGL_ES1 = $$QMAKE_INCDIR_OPENGL QMAKE_LIBDIR_OPENGL_ES1 = $$QMAKE_LIBDIR_OPENGL -QMAKE_INCDIR_OPENGL_ES1CL = $$QMAKE_INCDIR_OPENGL -QMAKE_LIBDIR_OPENGL_ES1CL = $$QMAKE_LIBDIR_OPENGL QMAKE_INCDIR_OPENGL_ES2 = $$QMAKE_INCDIR_OPENGL QMAKE_LIBDIR_OPENGL_ES2 = $$QMAKE_LIBDIR_OPENGL QMAKE_INCDIR_EGL = @@ -106,7 +104,6 @@ QMAKE_LIBS_EGL = -lEGL QMAKE_LIBS_OPENGL = -lGLU -lGL QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_LIBS_OPENGL_ES1 = -lGLES_CM -QMAKE_LIBS_OPENGL_ES1CL = -lGLES_CL QMAKE_LIBS_OPENGL_ES2 = -lGLESv2 QMAKE_LIBS_OPENVG = -lOpenVG QMAKE_LIBS_THREAD = -lpthread diff --git a/src/opengl/opengl.pro b/src/opengl/opengl.pro index 7338534..ff42a49 100644 --- a/src/opengl/opengl.pro +++ b/src/opengl/opengl.pro @@ -13,7 +13,6 @@ include(../qbase.pri) !win32:!embedded:!mac:CONFIG += x11 contains(QT_CONFIG, opengl):CONFIG += opengl contains(QT_CONFIG, opengles1):CONFIG += opengles1 -contains(QT_CONFIG, opengles1cl):CONFIG += opengles1cl contains(QT_CONFIG, opengles2):CONFIG += opengles2 contains(QT_CONFIG, egl):CONFIG += egl @@ -43,7 +42,7 @@ SOURCES += qgl.cpp \ SOURCES += qpaintengine_opengl.cpp } -!contains(QT_CONFIG, opengles1):!contains(QT_CONFIG, opengles1cl) { +!contains(QT_CONFIG, opengles1) { HEADERS += qglshaderprogram.h \ qglpixmapfilter_p.h \ qgraphicsshadereffect_p.h \ @@ -78,7 +77,7 @@ SOURCES += qgl.cpp \ } x11 { - contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles1cl)|contains(QT_CONFIG, opengles2) { + contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2) { SOURCES += qgl_x11egl.cpp \ qglpixelbuffer_egl.cpp \ qgl_egl.cpp \ @@ -125,8 +124,7 @@ wince*: { qglpixelbuffer_egl.cpp \ qgl_egl.cpp - HEADERS += qgl_cl_p.h \ - qgl_egl_p.h \ + HEADERS += qgl_egl_p.h } embedded { diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index bb76f1a..f2d190f 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -67,7 +67,7 @@ #include "qimage.h" #include "qgl_p.h" -#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) +#if !defined(QT_OPENGL_ES_1) #include "gl2paintengineex/qpaintengineex_opengl2_p.h" #endif @@ -95,11 +95,6 @@ QT_BEGIN_NAMESPACE -#ifdef QT_OPENGL_ES_1_CL -#include "qgl_cl_p.h" -#endif - - #if defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_WS_QWS) QGLExtensionFuncs QGLContextPrivate::qt_extensionFuncs; #endif @@ -1655,7 +1650,7 @@ QImage qt_gl_read_texture(const QSize &size, bool alpha_format, bool include_alp QImage img(size, alpha_format ? QImage::Format_ARGB32_Premultiplied : QImage::Format_RGB32); int w = size.width(); int h = size.height(); -#if !defined(QT_OPENGL_ES_2) && !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) +#if !defined(QT_OPENGL_ES_2) && !defined(QT_OPENGL_ES_1) //### glGetTexImage not in GL ES 2.0, need to do something else here! glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_BYTE, img.bits()); #endif @@ -2433,7 +2428,7 @@ QGLTexture *QGLContextPrivate::bindTexture(const QPixmap &pixmap, GLenum target, { Q_Q(QGLContext); QPixmapData *pd = pixmap.pixmapData(); -#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) +#if !defined(QT_OPENGL_ES_1) if (target == GL_TEXTURE_2D && pd->classId() == QPixmapData::OpenGLClass) { const QGLPixmapData *data = static_cast(pd); @@ -2680,41 +2675,41 @@ void QGLContext::deleteTexture(QMacCompatGLuint id) } #endif -void qt_add_rect_to_array(const QRectF &r, q_vertexType *array) +void qt_add_rect_to_array(const QRectF &r, GLfloat *array) { qreal left = r.left(); qreal right = r.right(); qreal top = r.top(); qreal bottom = r.bottom(); - array[0] = f2vt(left); - array[1] = f2vt(top); - array[2] = f2vt(right); - array[3] = f2vt(top); - array[4] = f2vt(right); - array[5] = f2vt(bottom); - array[6] = f2vt(left); - array[7] = f2vt(bottom); + array[0] = left; + array[1] = top; + array[2] = right; + array[3] = top; + array[4] = right; + array[5] = bottom; + array[6] = left; + array[7] = bottom; } -void qt_add_texcoords_to_array(qreal x1, qreal y1, qreal x2, qreal y2, q_vertexType *array) +void qt_add_texcoords_to_array(qreal x1, qreal y1, qreal x2, qreal y2, GLfloat *array) { - array[0] = f2vt(x1); - array[1] = f2vt(y1); - array[2] = f2vt(x2); - array[3] = f2vt(y1); - array[4] = f2vt(x2); - array[5] = f2vt(y2); - array[6] = f2vt(x1); - array[7] = f2vt(y2); + array[0] = x1; + array[1] = y1; + array[2] = x2; + array[3] = y1; + array[4] = x2; + array[5] = y2; + array[6] = x1; + array[7] = y2; } #if !defined(QT_OPENGL_ES_2) static void qDrawTextureRect(const QRectF &target, GLint textureWidth, GLint textureHeight, GLenum textureTarget) { - q_vertexType tx = f2vt(1); - q_vertexType ty = f2vt(1); + GLfloat tx = 1.0f; + GLfloat ty = 1.0f; #ifdef QT_OPENGL_ES Q_UNUSED(textureWidth); @@ -2727,20 +2722,20 @@ static void qDrawTextureRect(const QRectF &target, GLint textureWidth, GLint tex glGetTexLevelParameteriv(textureTarget, 0, GL_TEXTURE_HEIGHT, &textureHeight); } - tx = f2vt(textureWidth); - ty = f2vt(textureHeight); + tx = GLfloat(textureWidth); + ty = GLfloat(textureHeight); } #endif - q_vertexType texCoordArray[4*2] = { + GLfloat texCoordArray[4*2] = { 0, ty, tx, ty, tx, 0, 0, 0 }; - q_vertexType vertexArray[4*2]; + GLfloat vertexArray[4*2]; qt_add_rect_to_array(target, vertexArray); - glVertexPointer(2, q_vertexTypeEnum, 0, vertexArray); - glTexCoordPointer(2, q_vertexTypeEnum, 0, texCoordArray); + glVertexPointer(2, GL_FLOAT, 0, vertexArray); + glTexCoordPointer(2, GL_FLOAT, 0, texCoordArray); glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_TEXTURE_COORD_ARRAY); @@ -4902,7 +4897,7 @@ void QGLWidget::drawTexture(const QPointF &point, QMacCompatGLuint textureId, QM } #endif -#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) +#if !defined(QT_OPENGL_ES_1) Q_GLOBAL_STATIC(QGL2PaintEngineEx, qt_gl_2_engine) #endif @@ -4912,7 +4907,7 @@ Q_GLOBAL_STATIC(QOpenGLPaintEngine, qt_gl_engine) Q_OPENGL_EXPORT QPaintEngine* qt_qgl_paint_engine() { -#if defined(QT_OPENGL_ES_1) || defined(QT_OPENGL_ES_1_CL) +#if defined(QT_OPENGL_ES_1) return qt_gl_engine(); #elif defined(QT_OPENGL_ES_2) return qt_gl_2_engine(); @@ -5035,7 +5030,7 @@ QGLExtensions::Extensions QGLExtensions::currentContextExtensions() glExtensions |= GenerateMipmap; glExtensions |= FragmentShader; #endif -#if defined(QT_OPENGL_ES_1) || defined(QT_OPENGL_ES_1_CL) +#if defined(QT_OPENGL_ES_1) if (extensions.match("GL_OES_framebuffer_object")) glExtensions |= FramebufferObject; #endif diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h index 8ada8ce..64f54a3 100644 --- a/src/opengl/qgl.h +++ b/src/opengl/qgl.h @@ -57,7 +57,7 @@ QT_BEGIN_HEADER #if defined(Q_WS_MAC) # include # include -#elif defined(QT_OPENGL_ES_1) || defined(QT_OPENGL_ES_1_CL) +#elif defined(QT_OPENGL_ES_1) # include #ifndef GL_DOUBLE # define GL_DOUBLE GL_FLOAT diff --git a/src/opengl/qgl_cl_p.h b/src/opengl/qgl_cl_p.h deleted file mode 100644 index 82b492b..0000000 --- a/src/opengl/qgl_cl_p.h +++ /dev/null @@ -1,141 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtOpenGL module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - - -#ifdef QT_OPENGL_ES_1_CL - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists for the convenience -// of the QGLWidget class. This header file may change from -// version to version without notice, or even be removed. -// -// We mean it. -// - -QT_BEGIN_NAMESPACE - -inline void glTexParameterf (GLenum target, GLenum pname, GLfloat param) -{ - glTexParameterx(target, pname, FLOAT2X(param)); -} -inline void glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) -{ - glClearColorx(FLOAT2X(red) ,FLOAT2X(green), FLOAT2X(blue), FLOAT2X(alpha)); -} -inline void glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) -{ - glColor4x(FLOAT2X(red) ,FLOAT2X(green), FLOAT2X(blue), FLOAT2X(alpha)); -} - -inline void glOrthof (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar) -{ - glOrthox(FLOAT2X(left), FLOAT2X(right), FLOAT2X(bottom), FLOAT2X(top), FLOAT2X(zNear), FLOAT2X(zFar)); -} - -inline void glPointSize (GLfloat size) -{ - glPointSizex(FLOAT2X(size)); -} - -inline void glPolygonOffset (GLfloat factor, GLfloat units) -{ - glPolygonOffsetx (FLOAT2X(factor), FLOAT2X(units)); -} - -inline void glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z) -{ - glRotatex(FLOAT2X(angle), FLOAT2X(x), FLOAT2X(y), FLOAT2X(z)); -} - -inline void glTranslatef (GLfloat x, GLfloat y, GLfloat z) -{ - glTranslatex(FLOAT2X(x) ,FLOAT2X(y) ,FLOAT2X(z)); -} - -inline void glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz) -{ - glNormal3x(FLOAT2X(nx), FLOAT2X(ny), FLOAT2X(nz)); -} - -inline void glScalef(GLfloat x, GLfloat y, GLfloat z) -{ - glScalex(FLOAT2X(x), FLOAT2X(y), FLOAT2X(z)); -} - -inline void glClearDepthf (GLclampf depth) -{ - glClearDepthx(FLOAT2X(depth)); -} - -inline void glAlphaFunc (GLenum func, GLclampf ref) -{ - glAlphaFuncx(func, FLOAT2X(ref)); -} - -inline void glLoadMatrixf (const GLfloat *_m) -{ - GLfixed m[16]; - for (int i =0; i < 16; i++) - m[i] = FLOAT2X(_m[i]); - glLoadMatrixx(m); -} - -inline void glMultMatrixf (const GLfloat *_m) -{ - GLfixed m[16]; - for (int i =0; i < 16; i++) - m[i] = FLOAT2X(_m[i]); - glMultMatrixx (m); -} - - -inline void glLineWidth (GLfloat width) -{ - glLineWidthx(FLOAT2X(width)); -} - -QT_END_NAMESPACE - -#endif //QT_OPENGL_ES_1_CL - diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h index 9e8e335..d17db3a 100644 --- a/src/opengl/qgl_p.h +++ b/src/opengl/qgl_p.h @@ -64,22 +64,6 @@ #include "qcache.h" #include "qglpaintdevice_p.h" -#ifndef QT_OPENGL_ES_1_CL -#define q_vertexType float -#define q_vertexTypeEnum GL_FLOAT -#define f2vt(f) (f) -#define vt2f(x) (x) -#define i2vt(i) (float(i)) -#else -#define FLOAT2X(f) (int( (f) * (65536))) -#define X2FLOAT(x) (float(x) / 65536.0f) -#define f2vt(f) FLOAT2X(f) -#define i2vt(i) ((i)*65536) -#define vt2f(x) X2FLOAT(x) -#define q_vertexType GLfixed -#define q_vertexTypeEnum GL_FIXED -#endif //QT_OPENGL_ES_1_CL - #ifdef QT_OPENGL_ES QT_BEGIN_INCLUDE_NAMESPACE #if defined(QT_OPENGL_ES_2) diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp index ce80796..f1d2325 100644 --- a/src/opengl/qglframebufferobject.cpp +++ b/src/opengl/qglframebufferobject.cpp @@ -44,7 +44,7 @@ #include #include -#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) +#if !defined(QT_OPENGL_ES_1) #include #endif @@ -56,10 +56,6 @@ #include #include -#ifdef QT_OPENGL_ES_1_CL -#include "qgl_cl_p.h" -#endif - QT_BEGIN_NAMESPACE extern QImage qt_gl_read_framebuffer(const QSize&, bool, bool); @@ -980,7 +976,7 @@ QImage QGLFramebufferObject::toImage() const return image; } -#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) +#if !defined(QT_OPENGL_ES_1) Q_GLOBAL_STATIC(QGL2PaintEngineEx, qt_buffer_2_engine) #endif @@ -995,7 +991,7 @@ QPaintEngine *QGLFramebufferObject::paintEngine() const if (d->engine) return d->engine; -#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) +#if !defined(QT_OPENGL_ES_1) #if !defined (QT_OPENGL_ES_2) if (qt_gl_preferGL2Engine()) { #endif diff --git a/src/opengl/qglpaintdevice.cpp b/src/opengl/qglpaintdevice.cpp index 7697570..a0b1a79 100644 --- a/src/opengl/qglpaintdevice.cpp +++ b/src/opengl/qglpaintdevice.cpp @@ -48,14 +48,10 @@ #include #endif -#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) +#if !defined(QT_OPENGL_ES_1) #include #endif -#if defined(QT_OPENGL_ES_1_CL) -#include "qgl_cl_p.h" -#endif - QT_BEGIN_NAMESPACE QGLPaintDevice::QGLPaintDevice() @@ -198,7 +194,7 @@ QGLPaintDevice* QGLPaintDevice::getDevice(QPaintDevice* pd) glpd = &(static_cast(pd)->d_func()->glDevice); break; case QInternal::Pixmap: { -#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) +#if !defined(QT_OPENGL_ES_1) QPixmapData* pmd = static_cast(pd)->pixmapData(); if (pmd->classId() == QPixmapData::OpenGLClass) glpd = static_cast(pmd)->glDevice(); diff --git a/src/opengl/qglpixelbuffer.cpp b/src/opengl/qglpixelbuffer.cpp index 46f7697..eca9550 100644 --- a/src/opengl/qglpixelbuffer.cpp +++ b/src/opengl/qglpixelbuffer.cpp @@ -78,7 +78,7 @@ #include -#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) +#if !defined(QT_OPENGL_ES_1) #include #endif @@ -387,7 +387,7 @@ bool QGLPixelBuffer::isValid() const return !d->invalid; } -#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) +#if !defined(QT_OPENGL_ES_1) Q_GLOBAL_STATIC(QGL2PaintEngineEx, qt_buffer_2_engine) #endif @@ -398,7 +398,7 @@ Q_GLOBAL_STATIC(QOpenGLPaintEngine, qt_buffer_engine) /*! \reimp */ QPaintEngine *QGLPixelBuffer::paintEngine() const { -#if defined(QT_OPENGL_ES_1) || defined(QT_OPENGL_ES_1_CL) +#if defined(QT_OPENGL_ES_1) return qt_buffer_engine(); #elif defined(QT_OPENGL_ES_2) return qt_buffer_2_engine(); diff --git a/src/opengl/qglpixelbuffer_egl.cpp b/src/opengl/qglpixelbuffer_egl.cpp index ca19011..1e3223e 100644 --- a/src/opengl/qglpixelbuffer_egl.cpp +++ b/src/opengl/qglpixelbuffer_egl.cpp @@ -47,10 +47,6 @@ #include #include -#ifdef QT_OPENGL_ES_1_CL -#include "qgl_cl_p.h" -#endif - QT_BEGIN_NAMESPACE #ifdef EGL_BIND_TO_TEXTURE_RGBA diff --git a/src/opengl/qglshaderprogram.cpp b/src/opengl/qglshaderprogram.cpp index 79484fa..7c6f159 100644 --- a/src/opengl/qglshaderprogram.cpp +++ b/src/opengl/qglshaderprogram.cpp @@ -50,7 +50,7 @@ QT_BEGIN_NAMESPACE -#if !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1) +#if !defined(QT_OPENGL_ES_1) /*! \class QGLShaderProgram @@ -2943,6 +2943,6 @@ void QGLShaderProgram::setUniformValueArray(const char *name, const QMacCompatGL } #endif -#endif // !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1) +#endif // !defined(QT_OPENGL_ES_1) QT_END_NAMESPACE diff --git a/src/opengl/qglshaderprogram.h b/src/opengl/qglshaderprogram.h index 24ab986..215750e 100644 --- a/src/opengl/qglshaderprogram.h +++ b/src/opengl/qglshaderprogram.h @@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE QT_MODULE(OpenGL) -#if !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1) +#if !defined(QT_OPENGL_ES_1) class QGLShaderProgram; class QGLShaderPrivate; diff --git a/src/opengl/qgraphicsshadereffect.cpp b/src/opengl/qgraphicsshadereffect.cpp index dddc85d..f53ef54 100644 --- a/src/opengl/qgraphicsshadereffect.cpp +++ b/src/opengl/qgraphicsshadereffect.cpp @@ -40,7 +40,7 @@ ****************************************************************************/ #include "qgraphicsshadereffect_p.h" -#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) +#if !defined(QT_OPENGL_ES_1) #include "qglshaderprogram.h" #include "gl2paintengineex/qglcustomshaderstage_p.h" #define QGL_HAVE_CUSTOM_SHADERS 1 diff --git a/src/opengl/qpaintengine_opengl.cpp b/src/opengl/qpaintengine_opengl.cpp index 57918d0..3845e43 100644 --- a/src/opengl/qpaintengine_opengl.cpp +++ b/src/opengl/qpaintengine_opengl.cpp @@ -71,10 +71,6 @@ #include "private/qwsmanager_p.h" #endif -#ifdef QT_OPENGL_ES_1_CL -#include "qgl_cl_p.h" -#endif - #define QGL_FUNC_CONTEXT QGLContext *ctx = const_cast(device->context()); #include @@ -780,7 +776,7 @@ public: void drawOffscreenPath(const QPainterPath &path); void composite(const QRectF &rect, const QPoint &maskOffset = QPoint()); - void composite(GLuint primitive, const q_vertexType *vertexArray, int vertexCount, const QPoint &maskOffset = QPoint()); + void composite(GLuint primitive, const GLfloat *vertexArray, int vertexCount, const QPoint &maskOffset = QPoint()); bool createFragmentPrograms(); void deleteFragmentPrograms(); @@ -1787,7 +1783,7 @@ class QOpenGLTrapezoidToArrayTessellator : public QOpenGLTessellator public: QOpenGLTrapezoidToArrayTessellator() : vertices(0), allocated(0), size(0) {} ~QOpenGLTrapezoidToArrayTessellator() { free(vertices); } - q_vertexType *vertices; + GLfloat *vertices; int allocated; int size; QRectF bounds; @@ -1808,36 +1804,36 @@ void QOpenGLTrapezoidToArrayTessellator::addTrap(const Trapezoid &trap) if (size > allocated - 12) { #endif allocated = qMax(2*allocated, 512); - vertices = (q_vertexType *)realloc(vertices, allocated * sizeof(q_vertexType)); + vertices = (GLfloat *)realloc(vertices, allocated * sizeof(GLfloat)); } QGLTrapezoid t = toGLTrapezoid(trap); #ifndef QT_OPENGL_ES - vertices[size++] = f2vt(t.topLeftX); - vertices[size++] = f2vt(t.top); - vertices[size++] = f2vt(t.topRightX); - vertices[size++] = f2vt(t.top); - vertices[size++] = f2vt(t.bottomRightX); - vertices[size++] = f2vt(t.bottom); - vertices[size++] = f2vt(t.bottomLeftX); - vertices[size++] = f2vt(t.bottom); + vertices[size++] = t.topLeftX; + vertices[size++] = t.top; + vertices[size++] = t.topRightX; + vertices[size++] = t.top; + vertices[size++] = t.bottomRightX; + vertices[size++] = t.bottom; + vertices[size++] = t.bottomLeftX; + vertices[size++] = t.bottom; #else // First triangle - vertices[size++] = f2vt(t.topLeftX); - vertices[size++] = f2vt(t.top); - vertices[size++] = f2vt(t.topRightX); - vertices[size++] = f2vt(t.top); - vertices[size++] = f2vt(t.bottomRightX); - vertices[size++] = f2vt(t.bottom); + vertices[size++] = t.topLeftX; + vertices[size++] = t.top; + vertices[size++] = t.topRightX; + vertices[size++] = t.top; + vertices[size++] = t.bottomRightX; + vertices[size++] = t.bottom; // Second triangle - vertices[size++] = f2vt(t.bottomLeftX); - vertices[size++] = f2vt(t.bottom); - vertices[size++] = f2vt(t.topLeftX); - vertices[size++] = f2vt(t.top); - vertices[size++] = f2vt(t.bottomRightX); - vertices[size++] = f2vt(t.bottom); + vertices[size++] = t.bottomLeftX; + vertices[size++] = t.bottom; + vertices[size++] = t.topLeftX; + vertices[size++] = t.top; + vertices[size++] = t.bottomRightX; + vertices[size++] = t.bottom; #endif } @@ -1864,7 +1860,7 @@ void QOpenGLPaintEnginePrivate::fillPolygon_dev(const QPointF *polygonPoints, in if (use_fragment_programs && !(fast_style && has_fast_composition_mode)) { composite(geometry_mode, tessellator.vertices, tessellator.size / 2); } else { - glVertexPointer(2, q_vertexTypeEnum, 0, tessellator.vertices); + glVertexPointer(2, GL_FLOAT, 0, tessellator.vertices); glEnableClientState(GL_VERTEX_ARRAY); glDrawArrays(geometry_mode, 0, tessellator.size/2); glDisableClientState(GL_VERTEX_ARRAY); @@ -2265,7 +2261,7 @@ void QOpenGLPaintEnginePrivate::updateDepthClip() return; } -#if defined(QT_OPENGL_ES_1) || defined(QT_OPENGL_ES_2) || defined(QT_OPENGL_ES_1_CL) +#if defined(QT_OPENGL_ES_1) || defined(QT_OPENGL_ES_2) glClearDepthf(0.0f); #else glClearDepth(0.0f); @@ -2281,12 +2277,12 @@ void QOpenGLPaintEnginePrivate::updateDepthClip() const QVector rects = q->state()->clipEnabled ? q->state()->clipRegion.rects() : q->systemClip().rects(); // rectangle count * 2 (triangles) * vertex count * component count (Z omitted) - QDataBuffer clipVertex(rects.size()*2*3*2); + QDataBuffer clipVertex(rects.size()*2*3*2); for (int i = 0; i < rects.size(); ++i) { - q_vertexType x = i2vt(rects.at(i).left()); - q_vertexType w = i2vt(rects.at(i).width()); - q_vertexType h = i2vt(rects.at(i).height()); - q_vertexType y = i2vt(rects.at(i).top()); + GLfloat x = GLfloat(rects.at(i).left()); + GLfloat w = GLfloat(rects.at(i).width()); + GLfloat h = GLfloat(rects.at(i).height()); + GLfloat y = GLfloat(rects.at(i).top()); // First triangle clipVertex.add(x); @@ -2314,7 +2310,7 @@ void QOpenGLPaintEnginePrivate::updateDepthClip() glLoadIdentity(); glEnableClientState(GL_VERTEX_ARRAY); - glVertexPointer(2, q_vertexTypeEnum, 0, clipVertex.data()); + glVertexPointer(2, GL_FLOAT, 0, clipVertex.data()); glDrawArrays(GL_TRIANGLES, 0, rects.size()*2*3); glDisableClientState(GL_VERTEX_ARRAY); @@ -3106,8 +3102,8 @@ QGLTrapezoidMaskGenerator::QGLTrapezoidMaskGenerator(const QPainterPath &path, c { } -extern void qt_add_rect_to_array(const QRectF &r, q_vertexType *array); -extern void qt_add_texcoords_to_array(qreal x1, qreal y1, qreal x2, qreal y2, q_vertexType *array); +extern void qt_add_rect_to_array(const QRectF &r, GLfloat *array); +extern void qt_add_texcoords_to_array(qreal x1, qreal y1, qreal x2, qreal y2, GLfloat *array); void QGLTrapezoidMaskGenerator::drawMask(const QRect &rect) { @@ -3138,7 +3134,7 @@ void QGLTrapezoidMaskGenerator::drawMask(const QRect &rect) // clear mask glBlendFunc(GL_ZERO, GL_ZERO); // clear - glVertexPointer(2, q_vertexTypeEnum, 0, vertexArray); + glVertexPointer(2, GL_FLOAT, 0, vertexArray); glEnableClientState(GL_VERTEX_ARRAY); glDrawArrays(GL_TRIANGLE_FAN, 0, 4); glDisableClientState(GL_VERTEX_ARRAY); @@ -3369,7 +3365,7 @@ void QGLEllipseMaskGenerator::drawMask(const QRect &rect) glProgramLocalParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, maskVariableLocations[VAR_ELLIPSE_OFFSET], ellipse_offset); glEnableClientState(GL_VERTEX_ARRAY); - glVertexPointer(2, q_vertexTypeEnum, 0, vertexArray); + glVertexPointer(2, GL_FLOAT, 0, vertexArray); glDrawArrays(GL_TRIANGLE_FAN, 0, 4); glDisableClientState(GL_VERTEX_ARRAY); glDisable(GL_FRAGMENT_PROGRAM_ARB); @@ -3399,7 +3395,7 @@ void QOpenGLPaintEnginePrivate::drawFastRect(const QRectF &r) Q_Q(QOpenGLPaintEngine); DEBUG_ONCE_STR("QOpenGLPaintEngine::drawRects(): drawing fast rect"); - q_vertexType vertexArray[10]; + GLfloat vertexArray[10]; qt_add_rect_to_array(r, vertexArray); if (has_pen) @@ -3420,7 +3416,7 @@ void QOpenGLPaintEnginePrivate::drawFastRect(const QRectF &r) if (fast_style && has_fast_composition_mode) { glEnableClientState(GL_VERTEX_ARRAY); - glVertexPointer(2, q_vertexTypeEnum, 0, vertexArray); + glVertexPointer(2, GL_FLOAT, 0, vertexArray); glDrawArrays(GL_TRIANGLE_FAN, 0, 4); glDisableClientState(GL_VERTEX_ARRAY); } else { @@ -3439,7 +3435,7 @@ void QOpenGLPaintEnginePrivate::drawFastRect(const QRectF &r) vertexArray[8] = vertexArray[0]; vertexArray[9] = vertexArray[1]; - glVertexPointer(2, q_vertexTypeEnum, 0, vertexArray); + glVertexPointer(2, GL_FLOAT, 0, vertexArray); glEnableClientState(GL_VERTEX_ARRAY); glDrawArrays(GL_LINE_STRIP, 0, 5); glDisableClientState(GL_VERTEX_ARRAY); @@ -3546,7 +3542,7 @@ void QOpenGLPaintEngine::drawRects(const QRectF *rects, int rectCount) } } -static void addQuadAsTriangle(q_vertexType *quad, q_vertexType *triangle) +static void addQuadAsTriangle(GLfloat *quad, GLfloat *triangle) { triangle[0] = quad[0]; triangle[1] = quad[1]; @@ -3607,7 +3603,7 @@ void QOpenGLPaintEngine::drawPoints(const QPointF *points, int pointCount) d->flushDrawQueue(); if (d->has_fast_pen) { - QVarLengthArray vertexArray(6 * pointCount); + QVarLengthArray vertexArray(6 * pointCount); glMatrixMode(GL_MODELVIEW); glPushMatrix(); @@ -3617,25 +3613,22 @@ void QOpenGLPaintEngine::drawPoints(const QPointF *points, int pointCount) for (int i = 0; i < pointCount; ++i) { QPointF mapped = d->matrix.map(points[i]); - qreal xf = qRound(mapped.x()); - qreal yf = qRound(mapped.y()); - - q_vertexType x = f2vt(xf); - q_vertexType y = f2vt(yf); + GLfloat x = GLfloat(qRound(mapped.x())); + GLfloat y = GLfloat(qRound(mapped.y())); vertexArray[j++] = x; - vertexArray[j++] = y - f2vt(0.5); + vertexArray[j++] = y - 0.5f; - vertexArray[j++] = x + f2vt(1.5); - vertexArray[j++] = y + f2vt(1.0); + vertexArray[j++] = x + 1.5f; + vertexArray[j++] = y + 1.0f; vertexArray[j++] = x; - vertexArray[j++] = y + f2vt(1.0); + vertexArray[j++] = y + 1.0f; } glEnableClientState(GL_VERTEX_ARRAY); - glVertexPointer(2, q_vertexTypeEnum, 0, vertexArray.constData()); + glVertexPointer(2, GL_FLOAT, 0, vertexArray.constData()); glDrawArrays(GL_TRIANGLES, 0, pointCount*3); glDisableClientState(GL_VERTEX_ARRAY); @@ -3652,7 +3645,7 @@ void QOpenGLPaintEngine::drawPoints(const QPointF *points, int pointCount) } else { Q_ASSERT(sizeof(QPointF) == 8); - glVertexPointer(2, q_vertexTypeEnum, 0, vertexArray); + glVertexPointer(2, GL_FLOAT, 0, vertexArray); } glEnableClientState(GL_VERTEX_ARRAY); @@ -3720,47 +3713,47 @@ void QOpenGLPaintEngine::drawLines(const QLineF *lines, int lineCount) } } - q_vertexType endCap = f2vt(d->cpen.capStyle() == Qt::FlatCap ? 0 : 0.5); + GLfloat endCap = d->cpen.capStyle() == Qt::FlatCap ? 0.0f : 0.5f; if (useRects) { - QVarLengthArray vertexArray(12 * lineCount); + QVarLengthArray vertexArray(12 * lineCount); - q_vertexType quad[8]; + GLfloat quad[8]; for (int i = 0; i < lineCount; ++i) { - q_vertexType x1 = f2vt(lines[i].x1()); - q_vertexType x2 = f2vt(lines[i].x2()); - q_vertexType y1 = f2vt(lines[i].y1()); - q_vertexType y2 = f2vt(lines[i].y2()); + GLfloat x1 = lines[i].x1(); + GLfloat x2 = lines[i].x2(); + GLfloat y1 = lines[i].y1(); + GLfloat y2 = lines[i].y2(); if (x1 == x2) { if (y1 > y2) qSwap(y1, y2); - quad[0] = x1 - f2vt(0.5); + quad[0] = x1 - 0.5f; quad[1] = y1 - endCap; - quad[2] = x1 + f2vt(0.5); + quad[2] = x1 + 0.5f; quad[3] = y1 - endCap; - quad[4] = x1 + f2vt(0.5); + quad[4] = x1 + 0.5f; quad[5] = y2 + endCap; - quad[6] = x1 - f2vt(0.5); + quad[6] = x1 - 0.5f; quad[7] = y2 + endCap; } else { if (x1 > x2) qSwap(x1, x2); quad[0] = x1 - endCap; - quad[1] = y1 + f2vt(0.5); + quad[1] = y1 + 0.5f; quad[2] = x1 - endCap; - quad[3] = y1 - f2vt(0.5); + quad[3] = y1 - 0.5f; quad[4] = x2 + endCap; - quad[5] = y1 - f2vt(0.5); + quad[5] = y1 - 0.5f; quad[6] = x2 + endCap; - quad[7] = y1 + f2vt(0.5); + quad[7] = y1 + 0.5f; } addQuadAsTriangle(quad, &vertexArray[12*i]); @@ -3768,26 +3761,26 @@ void QOpenGLPaintEngine::drawLines(const QLineF *lines, int lineCount) glEnableClientState(GL_VERTEX_ARRAY); - glVertexPointer(2, q_vertexTypeEnum, 0, vertexArray.constData()); + glVertexPointer(2, GL_FLOAT, 0, vertexArray.constData()); glDrawArrays(GL_TRIANGLES, 0, lineCount*6); glDisableClientState(GL_VERTEX_ARRAY); } else { - QVarLengthArray vertexArray(4 * lineCount); + QVarLengthArray vertexArray(4 * lineCount); for (int i = 0; i < lineCount; ++i) { const QPointF a = lines[i].p1(); - vertexArray[4*i] = f2vt(lines[i].x1()); - vertexArray[4*i+1] = f2vt(lines[i].y1()); - vertexArray[4*i+2] = f2vt(lines[i].x2()); - vertexArray[4*i+3] = f2vt(lines[i].y2()); + vertexArray[4*i] = lines[i].x1(); + vertexArray[4*i+1] = lines[i].y1(); + vertexArray[4*i+2] = lines[i].x2(); + vertexArray[4*i+3] = lines[i].y2(); } glEnableClientState(GL_VERTEX_ARRAY); - glVertexPointer(2, q_vertexTypeEnum, 0, vertexArray.constData()); + glVertexPointer(2, GL_FLOAT, 0, vertexArray.constData()); glDrawArrays(GL_LINES, 0, lineCount*2); - glVertexPointer(2, q_vertexTypeEnum, 4*sizeof(q_vertexType), vertexArray.constData() + 2); + glVertexPointer(2, GL_FLOAT, 4*sizeof(GLfloat), vertexArray.constData() + 2); glDrawArrays(GL_POINTS, 0, lineCount); glDisableClientState(GL_VERTEX_ARRAY); @@ -3874,7 +3867,7 @@ void QOpenGLPaintEngine::drawPolygon(const QPointF *points, int pointCount, Poly } else { Q_ASSERT(sizeof(QPointF) == 8); - glVertexPointer(2, q_vertexTypeEnum, 0, vertexArray); + glVertexPointer(2, GL_FLOAT, 0, vertexArray); } glEnableClientState(GL_VERTEX_ARRAY); @@ -3893,12 +3886,12 @@ void QOpenGLPaintEngine::drawPolygon(const QPointF *points, int pointCount, Poly if (d->has_pen) { if (d->has_fast_pen && !d->high_quality_antialiasing) { d->setGradientOps(d->cpen.brush(), bounds); - QVarLengthArray vertexArray(pointCount*2 + 2); - glVertexPointer(2, q_vertexTypeEnum, 0, vertexArray.constData()); + QVarLengthArray vertexArray(pointCount*2 + 2); + glVertexPointer(2, GL_FLOAT, 0, vertexArray.constData()); int i; for (i=0; igetProgram(device->context(), fragment_brush, diff --git a/src/opengl/qpixmapdata_x11gl_egl.cpp b/src/opengl/qpixmapdata_x11gl_egl.cpp index 55aa1d0..edce56a 100644 --- a/src/opengl/qpixmapdata_x11gl_egl.cpp +++ b/src/opengl/qpixmapdata_x11gl_egl.cpp @@ -45,7 +45,7 @@ #include #include -#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) +#if !defined(QT_OPENGL_ES_1) #include #endif @@ -196,7 +196,7 @@ QX11GLPixmapData::~QX11GLPixmapData() { } -#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) +#if !defined(QT_OPENGL_ES_1) Q_GLOBAL_STATIC(QGL2PaintEngineEx, qt_gl_pixmap_2_engine) #endif @@ -220,7 +220,7 @@ QPaintEngine* QX11GLPixmapData::paintEngine() const QPaintEngine* engine; -#if defined(QT_OPENGL_ES_1) || defined(QT_OPENGL_ES_1_CL) +#if defined(QT_OPENGL_ES_1) engine = qt_gl_pixmap_engine(); #elif defined(QT_OPENGL_ES_2) engine = qt_gl_pixmap_2_engine(); @@ -237,7 +237,7 @@ QPaintEngine* QX11GLPixmapData::paintEngine() const if (engine->isActive()) { qWarning("Pixmap paint engine already active"); -#if defined(QT_OPENGL_ES_1) || defined(QT_OPENGL_ES_1_CL) +#if defined(QT_OPENGL_ES_1) engine = new QOpenGLPaintEngine; #elif defined(QT_OPENGL_ES_2) engine = new QGL2PaintEngineEx; diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp index 7a565e6..4ac4a3a 100644 --- a/src/opengl/qwindowsurface_gl.cpp +++ b/src/opengl/qwindowsurface_gl.cpp @@ -82,10 +82,6 @@ #define GLX_SAMPLES_ARB 100001 #endif -#ifdef QT_OPENGL_ES_1_CL -#include "qgl_cl_p.h" -#endif - #ifdef QT_OPENGL_ES #include #endif @@ -838,22 +834,22 @@ static void drawTexture(const QRectF &rect, GLuint tex_id, const QSize &texSize, src.setBottom(src.bottom() / height); } - const q_vertexType tx1 = f2vt(src.left()); - const q_vertexType tx2 = f2vt(src.right()); - const q_vertexType ty1 = f2vt(src.top()); - const q_vertexType ty2 = f2vt(src.bottom()); + const GLfloat tx1 = src.left(); + const GLfloat tx2 = src.right(); + const GLfloat ty1 = src.top(); + const GLfloat ty2 = src.bottom(); - q_vertexType texCoordArray[4*2] = { + GLfloat texCoordArray[4*2] = { tx1, ty2, tx2, ty2, tx2, ty1, tx1, ty1 }; - q_vertexType vertexArray[4*2]; - extern void qt_add_rect_to_array(const QRectF &r, q_vertexType *array); // qpaintengine_opengl.cpp + GLfloat vertexArray[4*2]; + extern void qt_add_rect_to_array(const QRectF &r, GLfloat *array); // qpaintengine_opengl.cpp qt_add_rect_to_array(rect, vertexArray); #if !defined(QT_OPENGL_ES_2) - glVertexPointer(2, q_vertexTypeEnum, 0, vertexArray); - glTexCoordPointer(2, q_vertexTypeEnum, 0, texCoordArray); + glVertexPointer(2, GL_FLOAT, 0, vertexArray); + glTexCoordPointer(2, GL_FLOAT, 0, texCoordArray); glBindTexture(target, tex_id); glEnable(target); diff --git a/src/plugins/graphicssystems/opengl/main.cpp b/src/plugins/graphicssystems/opengl/main.cpp index 19631b6..abcfb7f 100644 --- a/src/plugins/graphicssystems/opengl/main.cpp +++ b/src/plugins/graphicssystems/opengl/main.cpp @@ -56,7 +56,7 @@ QStringList QGLGraphicsSystemPlugin::keys() const { QStringList list; list << QLatin1String("OpenGL") << QLatin1String("OpenGL1"); -#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) +#if !defined(QT_OPENGL_ES_1) list << QLatin1String("OpenGL2"); #endif return list; @@ -69,7 +69,7 @@ QGraphicsSystem* QGLGraphicsSystemPlugin::create(const QString& system) return new QGLGraphicsSystem; } -#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) +#if !defined(QT_OPENGL_ES_1) if (system.toLower() == QLatin1String("opengl2")) { QGL::setPreferredPaintEngine(QPaintEngine::OpenGL2); return new QGLGraphicsSystem; diff --git a/tests/auto/qgl/tst_qgl.cpp b/tests/auto/qgl/tst_qgl.cpp index d0d69ae..972a0ae 100644 --- a/tests/auto/qgl/tst_qgl.cpp +++ b/tests/auto/qgl/tst_qgl.cpp @@ -739,8 +739,6 @@ void tst_QGL::openGLVersionCheck() #if defined(QT_OPENGL_ES_1) QVERIFY(QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_ES_Common_Version_1_0); -#elif defined(QT_OPENGL_ES_1_CL) - QVERIFY(QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_ES_CommonLite_Version_1_0); #elif defined(QT_OPENGL_ES_2) QVERIFY(QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_ES_Version_2_0); #else diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 7ab574d..fc926e0 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -700,9 +700,6 @@ void Configure::parseCmdLine() } else if ( configCmdLine.at(i) == "-opengl-es-cm" ) { dictionary[ "OPENGL" ] = "yes"; dictionary[ "OPENGL_ES_CM" ] = "yes"; - } else if ( configCmdLine.at(i) == "-opengl-es-cl" ) { - dictionary[ "OPENGL" ] = "yes"; - dictionary[ "OPENGL_ES_CL" ] = "yes"; } else if ( configCmdLine.at(i) == "-opengl-es-2" ) { dictionary[ "OPENGL" ] = "yes"; dictionary[ "OPENGL_ES_2" ] = "yes"; @@ -1819,7 +1816,6 @@ bool Configure::displayHelp() desc("CETEST", "yes", "-cetest", "Compile Windows CE remote test application"); desc( "-signature ", "Use file for signing the target project"); desc("OPENGL_ES_CM", "no", "-opengl-es-cm", "Enable support for OpenGL ES Common"); - desc("OPENGL_ES_CL", "no", "-opengl-es-cl", "Enable support for OpenGL ES Common Lite"); desc("OPENGL_ES_2", "no", "-opengl-es-2", "Enable support for OpenGL ES 2.0"); desc("DIRECTSHOW", "no", "-phonon-wince-ds9", "Enable Phonon Direct Show 9 backend for Windows CE"); @@ -2008,8 +2004,6 @@ bool Configure::checkAvailability(const QString &part) available = (dictionary[ "ARCHITECTURE" ] == "windowsce"); else if (part == "OPENGL_ES_CM") available = (dictionary[ "ARCHITECTURE" ] == "windowsce"); - else if (part == "OPENGL_ES_CL") - available = (dictionary[ "ARCHITECTURE" ] == "windowsce"); else if (part == "OPENGL_ES_2") available = (dictionary[ "ARCHITECTURE" ] == "windowsce"); else if (part == "DIRECTSHOW") @@ -2487,11 +2481,6 @@ void Configure::generateOutputVars() qtConfig += "egl"; } - if ( dictionary["OPENGL_ES_CL"] == "yes" ) { - qtConfig += "opengles1cl"; - qtConfig += "egl"; - } - if ( dictionary["OPENVG"] == "yes" ) { qtConfig += "openvg"; qtConfig += "egl"; @@ -2945,13 +2934,10 @@ void Configure::generateConfigfiles() if(dictionary["NATIVE_GESTURES"] == "no") qconfigList += "QT_NO_NATIVE_GESTURES"; if(dictionary["OPENGL_ES_CM"] == "yes" || - dictionary["OPENGL_ES_CL"] == "yes" || dictionary["OPENGL_ES_2"] == "yes") qconfigList += "QT_OPENGL_ES"; if(dictionary["OPENGL_ES_CM"] == "yes") qconfigList += "QT_OPENGL_ES_1"; if(dictionary["OPENGL_ES_2"] == "yes") qconfigList += "QT_OPENGL_ES_2"; - if(dictionary["OPENGL_ES_CL"] == "yes") qconfigList += "QT_OPENGL_ES_1_CL"; - if(dictionary["SQL_MYSQL"] == "yes") qconfigList += "QT_SQL_MYSQL"; if(dictionary["SQL_ODBC"] == "yes") qconfigList += "QT_SQL_ODBC"; if(dictionary["SQL_OCI"] == "yes") qconfigList += "QT_SQL_OCI"; -- cgit v0.12 From 5cff63b217118e087a6cbd1f27c2a28be83374bb Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Thu, 4 Feb 2010 11:18:08 +1000 Subject: Improvements to the QGLShaderProgram API GLfloat[2][2] & GLfloat[3][3] uniform setters. Generic overrides to setAttributeArray() for setting the component type to something other than GL_FLOAT. setAttributeBuffer() for specifiying offsets within vertex buffers. Task-number: QTBUG-7391 Reviewed-By: Sarah Smith --- src/opengl/qglshaderprogram.cpp | 183 ++++++++++++++++++++++++++++++++++++++++ src/opengl/qglshaderprogram.h | 13 +++ 2 files changed, 196 insertions(+) diff --git a/src/opengl/qglshaderprogram.cpp b/src/opengl/qglshaderprogram.cpp index 7c6f159..80b4872 100644 --- a/src/opengl/qglshaderprogram.cpp +++ b/src/opengl/qglshaderprogram.cpp @@ -1426,6 +1426,38 @@ void QGLShaderProgram::setAttributeArray } /*! + Sets an array of vertex \a values on the attribute at \a location + in this shader program. The \a stride indicates the number of bytes + between vertices. A default \a stride value of zero indicates that + the vertices are densely packed in \a values. + + The \a type indicates the type of elements in the \a values array, + usually \c{GL_FLOAT}, \c{GL_UNSIGNED_BYTE}, etc. The \a tupleSize + indicates the number of components per vertex: 1, 2, 3, or 4. + + The array will become active when enableAttributeArray() is called + on the \a location. Otherwise the value specified with + setAttributeValue() for \a location will be used. + + The setAttributeBuffer() function can be used to set the attribute + array to an offset within a vertex buffer. + + \sa setAttributeValue(), setUniformValue(), enableAttributeArray() + \sa disableAttributeArray(), setAttributeBuffer() + \since 4.7 +*/ +void QGLShaderProgram::setAttributeArray + (int location, GLenum type, const void *values, int tupleSize, int stride) +{ + Q_D(QGLShaderProgram); + Q_UNUSED(d); + if (location != -1) { + glVertexAttribPointer(location, tupleSize, type, GL_FALSE, + stride, values); + } +} + +/*! \overload Sets an array of vertex \a values on the attribute called \a name @@ -1511,6 +1543,90 @@ void QGLShaderProgram::setAttributeArray } /*! + \overload + + Sets an array of vertex \a values on the attribute called \a name + in this shader program. The \a stride indicates the number of bytes + between vertices. A default \a stride value of zero indicates that + the vertices are densely packed in \a values. + + The \a type indicates the type of elements in the \a values array, + usually \c{GL_FLOAT}, \c{GL_UNSIGNED_BYTE}, etc. The \a tupleSize + indicates the number of components per vertex: 1, 2, 3, or 4. + + The array will become active when enableAttributeArray() is called + on the \a location. Otherwise the value specified with + setAttributeValue() for \a location will be used. + + The setAttributeBuffer() function can be used to set the attribute + array to an offset within a vertex buffer. + + \sa setAttributeValue(), setUniformValue(), enableAttributeArray() + \sa disableAttributeArray(), setAttributeBuffer() + \since 4.7 +*/ +void QGLShaderProgram::setAttributeArray + (const char *name, GLenum type, const void *values, int tupleSize, int stride) +{ + setAttributeArray(attributeLocation(name), type, values, tupleSize, stride); +} + +/*! + Sets an array of vertex values on the attribute at \a location + in this shader program, starting at a specific \a offset in the + currently bound vertex buffer. The \a stride indicates the number + of bytes between vertices. A default \a stride value of zero + indicates that the vertices are densely packed in \a values. + + The \a type indicates the type of elements in the \a values array, + usually \c{GL_FLOAT}, \c{GL_UNSIGNED_BYTE}, etc. The \a tupleSize + indicates the number of components per vertex: 1, 2, 3, or 4. + + The array will become active when enableAttributeArray() is called + on the \a location. Otherwise the value specified with + setAttributeValue() for \a location will be used. + + \sa setAttributeArray() + \since 4.7 +*/ +void QGLShaderProgram::setAttributeBuffer + (int location, GLenum type, int offset, int tupleSize, int stride) +{ + Q_D(QGLShaderProgram); + Q_UNUSED(d); + if (location != -1) { + glVertexAttribPointer(location, tupleSize, type, GL_FALSE, stride, + reinterpret_cast(offset)); + } +} + +/*! + \overload + + Sets an array of vertex values on the attribute called \a name + in this shader program, starting at a specific \a offset in the + currently bound vertex buffer. The \a stride indicates the number + of bytes between vertices. A default \a stride value of zero + indicates that the vertices are densely packed in \a values. + + The \a type indicates the type of elements in the \a values array, + usually \c{GL_FLOAT}, \c{GL_UNSIGNED_BYTE}, etc. The \a tupleSize + indicates the number of components per vertex: 1, 2, 3, or 4. + + The array will become active when enableAttributeArray() is called + on the \a location. Otherwise the value specified with + setAttributeValue() for \a location will be used. + + \sa setAttributeArray() + \since 4.7 +*/ +void QGLShaderProgram::setAttributeBuffer + (const char *name, GLenum type, int offset, int tupleSize, int stride) +{ + setAttributeBuffer(attributeLocation(name), type, offset, tupleSize, stride); +} + +/*! Enables the vertex array at \a location in this shader program so that the value set by setAttributeArray() on \a location will be used by the shader program. @@ -2307,6 +2423,42 @@ void QGLShaderProgram::setUniformValue(const char *name, const QMatrix4x4& value \overload Sets the uniform variable at \a location in the current context + to a 2x2 matrix \a value. The matrix elements must be specified + in column-major order. + + \sa setAttributeValue() + \since 4.7 +*/ +void QGLShaderProgram::setUniformValue(int location, const GLfloat value[2][2]) +{ + Q_D(QGLShaderProgram); + Q_UNUSED(d); + if (location != -1) + glUniformMatrix2fv(location, 1, GL_FALSE, value[0]); +} + +/*! + \overload + + Sets the uniform variable at \a location in the current context + to a 3x3 matrix \a value. The matrix elements must be specified + in column-major order. + + \sa setAttributeValue() + \since 4.7 +*/ +void QGLShaderProgram::setUniformValue(int location, const GLfloat value[3][3]) +{ + Q_D(QGLShaderProgram); + Q_UNUSED(d); + if (location != -1) + glUniformMatrix3fv(location, 1, GL_FALSE, value[0]); +} + +/*! + \overload + + Sets the uniform variable at \a location in the current context to a 4x4 matrix \a value. The matrix elements must be specified in column-major order. @@ -2320,6 +2472,37 @@ void QGLShaderProgram::setUniformValue(int location, const GLfloat value[4][4]) glUniformMatrix4fv(location, 1, GL_FALSE, value[0]); } + +/*! + \overload + + Sets the uniform variable called \a name in the current context + to a 2x2 matrix \a value. The matrix elements must be specified + in column-major order. + + \sa setAttributeValue() + \since 4.7 +*/ +void QGLShaderProgram::setUniformValue(const char *name, const GLfloat value[2][2]) +{ + setUniformValue(uniformLocation(name), value); +} + +/*! + \overload + + Sets the uniform variable called \a name in the current context + to a 3x3 matrix \a value. The matrix elements must be specified + in column-major order. + + \sa setAttributeValue() + \since 4.7 +*/ +void QGLShaderProgram::setUniformValue(const char *name, const GLfloat value[3][3]) +{ + setUniformValue(uniformLocation(name), value); +} + /*! \overload diff --git a/src/opengl/qglshaderprogram.h b/src/opengl/qglshaderprogram.h index 215750e..2500275 100644 --- a/src/opengl/qglshaderprogram.h +++ b/src/opengl/qglshaderprogram.h @@ -165,6 +165,8 @@ public: void setAttributeArray (int location, const QVector4D *values, int stride = 0); void setAttributeArray + (int location, GLenum type, const void *values, int tupleSize, int stride = 0); + void setAttributeArray (const char *name, const GLfloat *values, int tupleSize, int stride = 0); void setAttributeArray (const char *name, const QVector2D *values, int stride = 0); @@ -172,6 +174,13 @@ public: (const char *name, const QVector3D *values, int stride = 0); void setAttributeArray (const char *name, const QVector4D *values, int stride = 0); + void setAttributeArray + (const char *name, GLenum type, const void *values, int tupleSize, int stride = 0); + + void setAttributeBuffer + (int location, GLenum type, int offset, int tupleSize, int stride = 0); + void setAttributeBuffer + (const char *name, GLenum type, int offset, int tupleSize, int stride = 0); void enableAttributeArray(int location); void enableAttributeArray(const char *name); @@ -216,6 +225,8 @@ public: void setUniformValue(int location, const QMatrix4x2& value); void setUniformValue(int location, const QMatrix4x3& value); void setUniformValue(int location, const QMatrix4x4& value); + void setUniformValue(int location, const GLfloat value[2][2]); + void setUniformValue(int location, const GLfloat value[3][3]); void setUniformValue(int location, const GLfloat value[4][4]); void setUniformValue(int location, const QTransform& value); @@ -242,6 +253,8 @@ public: void setUniformValue(const char *name, const QMatrix4x2& value); void setUniformValue(const char *name, const QMatrix4x3& value); void setUniformValue(const char *name, const QMatrix4x4& value); + void setUniformValue(const char *name, const GLfloat value[2][2]); + void setUniformValue(const char *name, const GLfloat value[3][3]); void setUniformValue(const char *name, const GLfloat value[4][4]); void setUniformValue(const char *name, const QTransform& value); -- cgit v0.12 From 188c2ef11e92d04dcf334309c85a7f1b14945aaa Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 3 Feb 2010 18:00:24 +0100 Subject: QHeaderView: fixes sectionClicked() emitted with wrong section index The obvious fix is to use the previsously computed 'section' as paramatter. (It is even faster) But one might wonder why logicalIndexAt() does not return the same result before and after flipSortIndicator(). The reason is that while being sorted, in _q_layoutChanged, all the hidden section where unhidden and hidden again. Leaving some pending computation. Task-number: QTBUG-7833 Reviewed-by: Gabriel --- src/gui/itemviews/qheaderview.cpp | 14 ++++--- tests/auto/qheaderview/tst_qheaderview.cpp | 64 ++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+), 5 deletions(-) diff --git a/src/gui/itemviews/qheaderview.cpp b/src/gui/itemviews/qheaderview.cpp index 8a456e6..1c26e51 100644 --- a/src/gui/itemviews/qheaderview.cpp +++ b/src/gui/itemviews/qheaderview.cpp @@ -1853,11 +1853,9 @@ void QHeaderViewPrivate::_q_layoutChanged() persistentHiddenSections.clear(); return; } + + QBitArray oldSectionHidden = sectionHidden; bool sectionCountChanged = false; - for (int i = 0; i < sectionHidden.count(); ++i) { - if (sectionHidden.testBit(i)) - q->setSectionHidden(logicalIndex(i), false); - } for (int i = 0; i < persistentHiddenSections.count(); ++i) { QModelIndex index = persistentHiddenSections.at(i); @@ -1866,6 +1864,7 @@ void QHeaderViewPrivate::_q_layoutChanged() ? index.column() : index.row()); q->setSectionHidden(logical, true); + oldSectionHidden.setBit(logical, false); } else if (!sectionCountChanged && (modelSectionCount() != sectionCount)) { sectionCountChanged = true; break; @@ -1873,6 +1872,11 @@ void QHeaderViewPrivate::_q_layoutChanged() } persistentHiddenSections.clear(); + for (int i = 0; i < oldSectionHidden.count(); ++i) { + if (oldSectionHidden.testBit(i)) + q->setSectionHidden(logicalIndex(i), false); + } + // the number of sections changed; we need to reread the state of the model if (sectionCountChanged) q->initializeSections(); @@ -2300,7 +2304,7 @@ void QHeaderView::mouseReleaseEvent(QMouseEvent *e) int section = logicalIndexAt(pos); if (section != -1 && section == d->pressed) { d->flipSortIndicator(section); - emit sectionClicked(logicalIndexAt(pos)); + emit sectionClicked(section); } if (d->pressed != -1) updateSection(d->pressed); diff --git a/tests/auto/qheaderview/tst_qheaderview.cpp b/tests/auto/qheaderview/tst_qheaderview.cpp index 857e7e3..4642830 100644 --- a/tests/auto/qheaderview/tst_qheaderview.cpp +++ b/tests/auto/qheaderview/tst_qheaderview.cpp @@ -44,6 +44,7 @@ #include #include #include +#include #include #include @@ -190,6 +191,7 @@ private slots: void task236450_hidden(); void task248050_hideRow(); void QTBUG6058_reset(); + void QTBUG7833_sectionClicked(); protected: QHeaderView *view; @@ -1992,6 +1994,68 @@ void tst_QHeaderView::QTBUG6058_reset() QCOMPARE(checkHeaderViewOrder(&view, QVector() << 2 << 0 << 1 << 3 << 4 << 5 ) , 0); } +void tst_QHeaderView::QTBUG7833_sectionClicked() +{ + + + + + QTableView tv; + QStandardItemModel *sim = new QStandardItemModel(&tv); + QSortFilterProxyModel *proxyModel = new QSortFilterProxyModel(&tv); + proxyModel->setSourceModel(sim); + proxyModel->setDynamicSortFilter(true); + proxyModel->setSortCaseSensitivity(Qt::CaseInsensitive); + + QList row; + for (int i = 0; i < 12; i++) + row.append(new QStandardItem(QString(QLatin1Char('A' + i)))); + sim->appendRow(row); + row.clear(); + for (int i = 12; i > 0; i--) + row.append(new QStandardItem(QString(QLatin1Char('A' + i)))); + sim->appendRow(row); + + tv.setSortingEnabled(true); + tv.horizontalHeader()->setSortIndicatorShown(true); + tv.horizontalHeader()->setClickable(true); + tv.horizontalHeader()->setStretchLastSection(true); + tv.horizontalHeader()->setResizeMode(QHeaderView::Interactive); + + tv.setModel(proxyModel); + tv.setColumnHidden(5, true); + tv.setColumnHidden(6, true); + tv.horizontalHeader()->swapSections(8, 10); + tv.sortByColumn(1, Qt::AscendingOrder); + + QSignalSpy clickedSpy(tv.horizontalHeader(), SIGNAL(sectionClicked(int))); + QSignalSpy pressedSpy(tv.horizontalHeader(), SIGNAL(sectionPressed(int))); + + + QTest::mouseClick(tv.horizontalHeader()->viewport(), Qt::LeftButton, Qt::NoModifier, + QPoint(tv.horizontalHeader()->sectionViewportPosition(11) + 5, 5)); + QCOMPARE(clickedSpy.count(), 1); + QCOMPARE(pressedSpy.count(), 1); + QCOMPARE(clickedSpy.at(0).at(0).toInt(), 11); + QCOMPARE(pressedSpy.at(0).at(0).toInt(), 11); + + QTest::mouseClick(tv.horizontalHeader()->viewport(), Qt::LeftButton, Qt::NoModifier, + QPoint(tv.horizontalHeader()->sectionViewportPosition(8) + 5, 5)); + + QCOMPARE(clickedSpy.count(), 2); + QCOMPARE(pressedSpy.count(), 2); + QCOMPARE(clickedSpy.at(1).at(0).toInt(), 8); + QCOMPARE(pressedSpy.at(1).at(0).toInt(), 8); + + QTest::mouseClick(tv.horizontalHeader()->viewport(), Qt::LeftButton, Qt::NoModifier, + QPoint(tv.horizontalHeader()->sectionViewportPosition(0) + 5, 5)); + + QCOMPARE(clickedSpy.count(), 3); + QCOMPARE(pressedSpy.count(), 3); + QCOMPARE(clickedSpy.at(2).at(0).toInt(), 0); + QCOMPARE(pressedSpy.at(2).at(0).toInt(), 0); +} + QTEST_MAIN(tst_QHeaderView) #include "tst_qheaderview.moc" -- cgit v0.12 From acfa79cb4021c7afd4986ce061cacf550c9f803e Mon Sep 17 00:00:00 2001 From: Fabien Freling Date: Thu, 4 Feb 2010 10:35:35 +0100 Subject: Update QTestLib documentation with chart use case. --- doc/src/images/container_bench.png | Bin 0 -> 71461 bytes examples/qtestlib/tutorial5/containers.cpp | 269 +++++++++++++++++++++++++++++ 2 files changed, 269 insertions(+) create mode 100644 doc/src/images/container_bench.png create mode 100644 examples/qtestlib/tutorial5/containers.cpp diff --git a/doc/src/images/container_bench.png b/doc/src/images/container_bench.png new file mode 100644 index 0000000..a707b1a Binary files /dev/null and b/doc/src/images/container_bench.png differ diff --git a/examples/qtestlib/tutorial5/containers.cpp b/examples/qtestlib/tutorial5/containers.cpp new file mode 100644 index 0000000..fe68c85 --- /dev/null +++ b/examples/qtestlib/tutorial5/containers.cpp @@ -0,0 +1,269 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +// This file contains benchmarks for comparing QVector against std::vector + +#include +#include +#include + +#include + +template // T is the item type +class UseCases { +public: + virtual ~UseCases() {} + + // Use case: Insert \a size items into the vector. + virtual void insert(int size) = 0; + + // Use case: Lookup \a size items from the vector. + virtual void lookup(int size) = 0; +}; + +template +T * f(T *ts) // dummy function to prevent code from being optimized away by the compiler +{ + return ts; +} + +// This subclass implements the use cases using QVector as efficiently as possible. +template +class UseCases_QVector : public UseCases +{ + void insert(int size) + { + QVector v; + T t; + QBENCHMARK { + for (int i = 0; i < size; ++i) + v.append(t); + } + } + + void lookup(int size) + { + QVector v; + + T t; + for (int i = 0; i < size; ++i) + v.append(t); + + T *ts = new T[size]; + QBENCHMARK { + for (int i = 0; i < size; ++i) + ts[i] = v.value(i); + } + f(ts); + delete[] ts; + } +}; + +// This subclass implements the use cases using std::vector as efficiently as possible. +template +class UseCases_stdvector : public UseCases +{ + void insert(int size) + { + std::vector v; + T t; + QBENCHMARK { + for (int i = 0; i < size; ++i) + v.push_back(t); + } + } + + void lookup(int size) + { + std::vector v; + + T t; + for (int i = 0; i < size; ++i) + v.push_back(t); + + T *ts = new T[size]; + QBENCHMARK { + for (int i = 0; i < size; ++i) + ts[i] = v[i]; + } + f(ts); + delete[] ts; + } +}; + +struct Large { // A "large" item type + int x[1000]; +}; + +// Symbian devices typically have limited memory +#ifdef Q_OS_SYMBIAN +# define LARGE_MAX_SIZE 2000 +#else +# define LARGE_MAX_SIZE 20000 +#endif + +class tst_vector_vs_std : public QObject +{ + Q_OBJECT +public: + tst_vector_vs_std() + { + useCases_QVector_int = new UseCases_QVector; + useCases_stdvector_int = new UseCases_stdvector; + + useCases_QVector_Large = new UseCases_QVector; + useCases_stdvector_Large = new UseCases_stdvector; + } + +private: + UseCases *useCases_QVector_int; + UseCases *useCases_stdvector_int; + UseCases *useCases_QVector_Large; + UseCases *useCases_stdvector_Large; + +private slots: + void insert_int_data(); + void insert_int(); + void insert_Large_data(); + void insert_Large(); + void lookup_int_data(); + void lookup_int(); + void lookup_Large_data(); + void lookup_Large(); +}; + +void tst_vector_vs_std::insert_int_data() +{ + QTest::addColumn("useStd"); + QTest::addColumn("size"); + + for (int size = 10; size < 20000; size += 100) { + const QByteArray sizeString = QByteArray::number(size); + QTest::newRow(("std::vector-int--" + sizeString).constData()) << true << size; + QTest::newRow(("QVector-int--" + sizeString).constData()) << false << size; + } +} + +void tst_vector_vs_std::insert_int() +{ + QFETCH(bool, useStd); + QFETCH(int, size); + + if (useStd) + useCases_stdvector_int->insert(size); + else + useCases_QVector_int->insert(size); +} + +void tst_vector_vs_std::insert_Large_data() +{ + QTest::addColumn("useStd"); + QTest::addColumn("size"); + + for (int size = 10; size < LARGE_MAX_SIZE; size += 100) { + const QByteArray sizeString = QByteArray::number(size); + QTest::newRow(("std::vector-Large--" + sizeString).constData()) << true << size; + QTest::newRow(("QVector-Large--" + sizeString).constData()) << false << size; + } +} + +void tst_vector_vs_std::insert_Large() +{ + QFETCH(bool, useStd); + QFETCH(int, size); + + if (useStd) + useCases_stdvector_Large->insert(size); + else + useCases_QVector_Large->insert(size); +} + +//! [1] +void tst_vector_vs_std::lookup_int_data() +{ + QTest::addColumn("useStd"); + QTest::addColumn("size"); + + for (int size = 10; size < 20000; size += 100) { + const QByteArray sizeString = QByteArray::number(size); + QTest::newRow(("std::vector-int--" + sizeString).constData()) << true << size; + QTest::newRow(("QVector-int--" + sizeString).constData()) << false << size; + } +} +//! [1] + +//! [2] +void tst_vector_vs_std::lookup_int() +{ + QFETCH(bool, useStd); + QFETCH(int, size); + + if (useStd) + useCases_stdvector_int->lookup(size); // Create a std::vector and run the benchmark. + else + useCases_QVector_int->lookup(size); // Create a QVector and run the benchmark. +} +//! [2] + +void tst_vector_vs_std::lookup_Large_data() +{ + QTest::addColumn("useStd"); + QTest::addColumn("size"); + + for (int size = 10; size < LARGE_MAX_SIZE; size += 100) { + const QByteArray sizeString = QByteArray::number(size); + QTest::newRow(("std::vector-Large--" + sizeString).constData()) << true << size; + QTest::newRow(("QVector-Large--" + sizeString).constData()) << false << size; + } +} + +void tst_vector_vs_std::lookup_Large() +{ + QFETCH(bool, useStd); + QFETCH(int, size); + + if (useStd) + useCases_stdvector_Large->lookup(size); + else + useCases_QVector_Large->lookup(size); +} + +QTEST_MAIN(tst_vector_vs_std) +#include "main.moc" -- cgit v0.12 From 8ba14f6640a836a42a67363259da7055b33385b9 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 4 Feb 2010 11:46:13 +0100 Subject: qdoc3: Removed a debug output. --- tools/qdoc3/node.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp index 4da916c..9357671 100644 --- a/tools/qdoc3/node.cpp +++ b/tools/qdoc3/node.cpp @@ -570,8 +570,6 @@ void InnerNode::addChild(Node *child) else { if (child->type() == Enum) enumChildren.append(child); - if (childMap.contains(child->name())) - qDebug() << "Duplicate child" << child->name(); childMap.insert(child->name(), child); } } -- cgit v0.12 From 818ef4e93f40f2c3c6cf9d2a0a1fc42150f0d0cd Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Thu, 4 Feb 2010 12:21:24 +0100 Subject: Cocoa: Tool Windows steal focus from the main window The example that shows this off is tools/inputpanel. This example is strangely written, and calls activateWindow on the main window in an activate callback to another window. So a bit recursion will happend, and this caused troubble for the cocoa port. In addition, in Qt several windows can be active at the same time, expecially tool windows. This means that we need to be careful when returning early from the becomeKeyWindow methods for NSWindow. This patch fixes up on this stuff. Task-number: QTBUG-6002 Reviewed-by: msorvig --- src/gui/kernel/qcocoasharedwindowmethods_mac_p.h | 3 ++- src/gui/kernel/qcocoawindowdelegate_mac.mm | 7 ------- src/gui/kernel/qwidget_mac.mm | 2 +- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h b/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h index 2117551..d8bbcd4 100644 --- a/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h +++ b/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h @@ -95,7 +95,8 @@ QT_END_NAMESPACE bool isToolTip = (widget->windowType() == Qt::ToolTip); bool isPopup = (widget->windowType() == Qt::Popup); - return !(isPopup || isToolTip); + bool isTool = (widget->windowType() == Qt::Tool); + return !(isPopup || isToolTip || isTool); } - (void)orderWindow:(NSWindowOrderingMode)orderingMode relativeTo:(NSInteger)otherWindowNumber diff --git a/src/gui/kernel/qcocoawindowdelegate_mac.mm b/src/gui/kernel/qcocoawindowdelegate_mac.mm index db87491..24498f8 100644 --- a/src/gui/kernel/qcocoawindowdelegate_mac.mm +++ b/src/gui/kernel/qcocoawindowdelegate_mac.mm @@ -269,9 +269,6 @@ static void cleanupCocoaWindowDelegate() { QWidget *qwidget = m_windowHash->value([notification object]); Q_ASSERT(qwidget); - if (qwidget->isActiveWindow()) - return; // Widget is already active, no need to go through re-activation. - onApplicationWindowChangedActivation(qwidget, true); } @@ -288,10 +285,6 @@ static void cleanupCocoaWindowDelegate() { QWidget *qwidget = m_windowHash->value([notification object]); Q_ASSERT(qwidget); - if (qwidget->isActiveWindow()) - return; // Widget is already active, no need to go through re-activation - - onApplicationWindowChangedActivation(qwidget, true); } diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index 43b945e..878b776 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -3233,10 +3233,10 @@ void QWidget::activateWindow() || windowActive) { #ifndef QT_MAC_USE_COCOA ActivateWindow(win, true); + qApp->setActiveWindow(tlw); #else [win makeKeyWindow]; #endif - qApp->setActiveWindow(tlw); } else if(!isMinimized()) { #ifndef QT_MAC_USE_COCOA SelectWindow(win); -- cgit v0.12 From 1ef9b16f76b3ec2e8e12911777387a723185e518 Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Thu, 4 Feb 2010 11:18:47 +0100 Subject: Add the QMAKE_FILE_EXT variable to extra compilers generation. This give the possibility to get the file name with the extension and without the path. Reviewed-by: Joao Reviewed-by: Marius Storm-Olsen --- qmake/generators/makefile.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 0f5bdcd..cb68e7c 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -1519,6 +1519,19 @@ MakefileGenerator::replaceExtraCompilerVariables(const QString &orig_var, const base = fi.fileName(); val += base; } + } else if(var == QLatin1String("QMAKE_FILE_EXT")) { + filePath = true; + for(int i = 0; i < in.size(); ++i) { + QFileInfo fi(fileInfo(Option::fixPathToLocalOS(in.at(i)))); + QString ext; + // Ensure complementarity with QMAKE_FILE_BASE + int baseLen = fi.completeBaseName().length(); + if(baseLen == 0) + ext = fi.fileName(); + else + ext = fi.fileName().remove(0, baseLen); + val += ext; + } } else if(var == QLatin1String("QMAKE_FILE_PATH") || var == QLatin1String("QMAKE_FILE_IN_PATH")) { filePath = true; for(int i = 0; i < in.size(); ++i) -- cgit v0.12 From 3d10c27c7674663028941d41af9ab845dbf31d86 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 4 Feb 2010 13:44:08 +0100 Subject: doc: Fixed some qdoc warnings. --- src/corelib/io/qdatastream.cpp | 1 + src/corelib/tools/qbytearray.cpp | 2 +- src/testlib/qbenchmarkmetric.cpp | 28 ++++++++++++++++++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/corelib/io/qdatastream.cpp b/src/corelib/io/qdatastream.cpp index 27f7632..7c1887e 100644 --- a/src/corelib/io/qdatastream.cpp +++ b/src/corelib/io/qdatastream.cpp @@ -571,6 +571,7 @@ void QDataStream::setByteOrder(ByteOrder bo) \value Qt_4_4 Version 10 (Qt 4.4) \value Qt_4_5 Version 11 (Qt 4.5) \value Qt_4_6 Version 12 (Qt 4.6) + \value Qt_4_7 Same as Qt_4_6. \sa setVersion(), version() */ diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp index 6c87a86..a27e488 100644 --- a/src/corelib/tools/qbytearray.cpp +++ b/src/corelib/tools/qbytearray.cpp @@ -1061,7 +1061,7 @@ QByteArray &QByteArray::operator=(const char *str) \internal */ -/*! \fn bool QByteArray::isSharedWith(const QByteArray &other) +/*! \fn bool QByteArray::isSharedWith(const QByteArray &other) const \internal */ diff --git a/src/testlib/qbenchmarkmetric.cpp b/src/testlib/qbenchmarkmetric.cpp index 75297c4..7356134 100644 --- a/src/testlib/qbenchmarkmetric.cpp +++ b/src/testlib/qbenchmarkmetric.cpp @@ -41,6 +41,29 @@ #include +/*! + \enum QTest::QBenchmarkMetric + \since 4.7 + + This enum lists all the things that can be benchmarked. + + \value FramesPerSecond Frames per second + \value BitsPerSecond Bits per second + \value BytesPerSecond Bytes per second + \value WalltimeMilliseconds Clock time in milliseconds + \value CPUTicks CPU time + \value InstructionReads Instruction reads + \value Events Event count + + \sa QTest::benchmarkMetricName(), QTest::benchmarkMetricUnit() + + */ + +/*! + \relates QTest + \since 4.7 + Returns the enum value \a metric as a character string. + */ const char * QTest::benchmarkMetricName(QBenchmarkMetric metric) { switch (metric) { @@ -63,6 +86,11 @@ const char * QTest::benchmarkMetricName(QBenchmarkMetric metric) } }; +/*! + \relates QTest + \since 4.7 + Retuns the units of measure for the specified \a metric. + */ const char * QTest::benchmarkMetricUnit(QBenchmarkMetric metric) { switch (metric) { -- cgit v0.12 From fe2611f98fd4167cd4746100f062380cbc72f6bd Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 4 Feb 2010 14:20:07 +0100 Subject: Designer: Emit QDesignerPropertyEditorInterface::propertyChanged(). Broken by introduction of new signal with extended parameters. Emit both signals and block against each other. Tested against Eclipse integration. Reviewed-by: Jarek Kobus Task-number: QTBUG-7764 --- .../src/components/propertyeditor/propertyeditor.cpp | 4 ++-- .../designer/src/lib/shared/qdesigner_propertyeditor.cpp | 16 ++++++++++++++-- .../designer/src/lib/shared/qdesigner_propertyeditor_p.h | 8 +++++++- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/tools/designer/src/components/propertyeditor/propertyeditor.cpp b/tools/designer/src/components/propertyeditor/propertyeditor.cpp index b171ddc..512cc82 100644 --- a/tools/designer/src/components/propertyeditor/propertyeditor.cpp +++ b/tools/designer/src/components/propertyeditor/propertyeditor.cpp @@ -1175,11 +1175,11 @@ void PropertyEditor::slotValueChanged(QtProperty *property, const QVariant &valu Q_ASSERT(ok); QVariant v; qVariantSetValue(v, e); - emit propertyValueChanged(property->propertyName(), v, true); + emitPropertyValueChanged(property->propertyName(), v, true); return; } - emit propertyValueChanged(property->propertyName(), value, enableSubPropertyHandling); + emitPropertyValueChanged(property->propertyName(), value, enableSubPropertyHandling); } bool PropertyEditor::isDynamicProperty(const QtBrowserItem* item) const diff --git a/tools/designer/src/lib/shared/qdesigner_propertyeditor.cpp b/tools/designer/src/lib/shared/qdesigner_propertyeditor.cpp index e89c47c..9a1739e 100644 --- a/tools/designer/src/lib/shared/qdesigner_propertyeditor.cpp +++ b/tools/designer/src/lib/shared/qdesigner_propertyeditor.cpp @@ -92,7 +92,8 @@ static const PropertyNameTypeMap &stringPropertyTypes() } QDesignerPropertyEditor::QDesignerPropertyEditor(QWidget *parent, Qt::WindowFlags flags) : - QDesignerPropertyEditorInterface(parent, flags) + QDesignerPropertyEditorInterface(parent, flags), + m_propertyChangedForwardingBlocked(false) { // Make old signal work for compatibility connect(this, SIGNAL(propertyChanged(QString,QVariant)), this, SLOT(slotPropertyChanged(QString,QVariant))); @@ -147,9 +148,20 @@ QDesignerPropertyEditor::StringPropertyParameters QDesignerPropertyEditor::textP return StringPropertyParameters(ValidationSingleLine, true); } +void QDesignerPropertyEditor::emitPropertyValueChanged(const QString &name, const QVariant &value, bool enableSubPropertyHandling) +{ + // Avoid duplicate signal emission - see below + m_propertyChangedForwardingBlocked = true; + emit propertyValueChanged(name, value, enableSubPropertyHandling); + emit propertyChanged(name, value); + m_propertyChangedForwardingBlocked = false; +} + void QDesignerPropertyEditor::slotPropertyChanged(const QString &name, const QVariant &value) { - emit propertyValueChanged(name, value, true); + // Forward signal from Integration using the old interfaces. + if (!m_propertyChangedForwardingBlocked) + emit propertyValueChanged(name, value, true); } } diff --git a/tools/designer/src/lib/shared/qdesigner_propertyeditor_p.h b/tools/designer/src/lib/shared/qdesigner_propertyeditor_p.h index c618bd7..dac2f11 100644 --- a/tools/designer/src/lib/shared/qdesigner_propertyeditor_p.h +++ b/tools/designer/src/lib/shared/qdesigner_propertyeditor_p.h @@ -79,7 +79,6 @@ public: static StringPropertyParameters textPropertyValidationMode(QDesignerFormEditorInterface *core, const QObject *object, const QString &propertyName, bool isMainContainer); - Q_SIGNALS: void propertyValueChanged(const QString &name, const QVariant &value, bool enableSubPropertyHandling); void resetProperty(const QString &name); @@ -97,6 +96,13 @@ public Q_SLOTS: private Q_SLOTS: void slotPropertyChanged(const QString &name, const QVariant &value); + +protected: + void emitPropertyValueChanged(const QString &name, const QVariant &value, bool enableSubPropertyHandling); + +private: + bool m_propertyChangedForwardingBlocked; + }; } // namespace qdesigner_internal -- cgit v0.12 From af7d2b2127dadbdf828c60c75255bb1b4f591651 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Thu, 4 Feb 2010 14:24:30 +0100 Subject: Always activate popup windows on show The problem was that popups that were opened from a system tray icon did not get activated and clicking outside would not close the popup as intended. Ensuring that all popups get activated on show should solve this problem in the general sense. Task-number: QTBUG-7386 Reviewed-by: denis --- src/gui/kernel/qwidget_win.cpp | 2 ++ src/gui/util/qsystemtrayicon_win.cpp | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qwidget_win.cpp b/src/gui/kernel/qwidget_win.cpp index a57aacc..6a36293 100644 --- a/src/gui/kernel/qwidget_win.cpp +++ b/src/gui/kernel/qwidget_win.cpp @@ -1156,6 +1156,8 @@ void QWidgetPrivate::show_sys() data.window_state |= Qt::WindowMinimized; if (IsZoomed(q->internalWinId())) data.window_state |= Qt::WindowMaximized; + if (q->windowType() == Qt::Popup) + q->activateWindow(); } winSetupGestures(); diff --git a/src/gui/util/qsystemtrayicon_win.cpp b/src/gui/util/qsystemtrayicon_win.cpp index 092909f..8e482e0 100644 --- a/src/gui/util/qsystemtrayicon_win.cpp +++ b/src/gui/util/qsystemtrayicon_win.cpp @@ -325,8 +325,6 @@ bool QSystemTrayIconSys::winEvent( MSG *m, long *result ) q->contextMenu()->move(gpos); } #endif - q->contextMenu()->activateWindow(); - //Must be activated for proper keyboardfocus and menu closing on windows: } emit q->activated(QSystemTrayIcon::Context); break; -- cgit v0.12 From e39feabbcdb10b47c7eaad14fe653e62280e6237 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 4 Feb 2010 15:00:37 +0100 Subject: doc: Fixed some qdoc warnings. --- src/corelib/kernel/qcoreevent.cpp | 1 - src/gui/image/qpixmap.cpp | 9 +++++---- src/network/access/qnetworkreply.cpp | 9 +++++++++ src/network/access/qnetworkrequest.cpp | 17 ++++++++++++++--- src/opengl/qgl.cpp | 14 ++++++++------ 5 files changed, 36 insertions(+), 14 deletions(-) diff --git a/src/corelib/kernel/qcoreevent.cpp b/src/corelib/kernel/qcoreevent.cpp index d177b26..16b8798 100644 --- a/src/corelib/kernel/qcoreevent.cpp +++ b/src/corelib/kernel/qcoreevent.cpp @@ -272,7 +272,6 @@ QT_BEGIN_NAMESPACE \omitvalue MacGLClearDrawable \omitvalue NetworkReplyUpdated \omitvalue FutureCallOut - \omitvalue CocoaRequestModal \omitvalue UpdateSoftKeys \omitvalue NativeGesture */ diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index fe03c93..e51d858 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -1379,10 +1379,11 @@ void QPixmap::deref() */ /*! - Replaces this pixmap's data with the given \a image using the specified - \a flags to control the conversion. The \a flags argument is a - bitwise-OR of the \l{Qt::ImageConversionFlags}. Passing 0 for \a - flags sets all the default options. + Replaces this pixmap's data with the given \a image using the + specified \a flags to control the conversion. The \a flags + argument is a bitwise-OR of the \l{Qt::ImageConversionFlags}. + Passing 0 for \a flags sets all the default options. Returns true + if the result is that this pixmap is not null. Note: this function was part of Qt 3 support in Qt 4.6 and earlier. It has been promoted to official API status in 4.7 to support updating diff --git a/src/network/access/qnetworkreply.cpp b/src/network/access/qnetworkreply.cpp index be4339c..15748fe 100644 --- a/src/network/access/qnetworkreply.cpp +++ b/src/network/access/qnetworkreply.cpp @@ -533,6 +533,15 @@ QByteArray QNetworkReply::rawHeader(const QByteArray &headerName) const return QByteArray(); } +/*! \typedef QNetworkReply::RawHeaderPair + + RawHeaderPair is a QPair where the first + QByteArray is the header name and the second is the header. + */ + +/*! + Returns a list of raw header pairs. + */ const QList& QNetworkReply::rawHeaderPairs() const { Q_D(const QNetworkReply); diff --git a/src/network/access/qnetworkrequest.cpp b/src/network/access/qnetworkrequest.cpp index 52b88a3..b8438a2 100644 --- a/src/network/access/qnetworkrequest.cpp +++ b/src/network/access/qnetworkrequest.cpp @@ -532,13 +532,24 @@ QNetworkRequest::Priority QNetworkRequest::priority() const return d->priority; } +/*! \enum QNetworkRequest::Priority + + \since 4.7 + + This enum lists the possible network request priorities. + + \value HighPriority High priority + \value NormalPriority Normal priority + \value LowPriority Low priority + */ + /*! \since 4.7 - Set the priority of this request. + Set the priority of this request to \a priority. - \note The priority is only a hint to the network access manager. - It can use it or not. Currently it is used for HTTP to + \note The \a priority is only a hint to the network access + manager. It can use it or not. Currently it is used for HTTP to decide which request should be sent first to a server. \sa priority() diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index bb76f1a..97b1c2f 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -1085,8 +1085,9 @@ int QGLFormat::stencilBufferSize() const /*! \since 4.7 - Set the OpenGL version. If a context compatible with the requested OpenGL version - cannot be created, a context compatible with version 1.x is created instead. + Set the OpenGL version to the \a major and \a minor numbers. If a + context compatible with the requested OpenGL version cannot be + created, a context compatible with version 1.x is created instead. \sa majorVersion(), minorVersion() */ @@ -1129,8 +1130,9 @@ int QGLFormat::minorVersion() const \enum QGLFormat::OpenGLContextProfile \since 4.7 - This enum describes the OpenGL context profiles that can be specified for contexts implementing - OpenGL version 3.2 or higher. These profiles are different from OpenGL ES profiles. + This enum describes the OpenGL context profiles that can be + specified for contexts implementing OpenGL version 3.2 or + higher. These profiles are different from OpenGL ES profiles. \value NoProfile OpenGL version is lower than 3.2. \value CoreProfile Functionality deprecated in OpenGL version 3.0 is not available. @@ -1140,8 +1142,8 @@ int QGLFormat::minorVersion() const /*! \since 4.7 - Set the OpenGL context profile. The profile is ignored if the requested OpenGL - version is less than 3.2. + Set the OpenGL context profile to \a profile. The \a profile is + ignored if the requested OpenGL version is less than 3.2. \sa profile() */ -- cgit v0.12 From c1ee25eb5889a349ca0fd5eb8ed24892ddc34b01 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Thu, 4 Feb 2010 15:03:38 +0100 Subject: Fixed wrong variable name Reviewed-by: Olivier --- src/opengl/qglbuffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/opengl/qglbuffer.cpp b/src/opengl/qglbuffer.cpp index 62f6078..7022a53 100644 --- a/src/opengl/qglbuffer.cpp +++ b/src/opengl/qglbuffer.cpp @@ -272,7 +272,7 @@ bool QGLBuffer::read(int offset, void *data, int count) #else Q_UNUSED(offset); Q_UNUSED(data); - Q_UNUSED(size); + Q_UNUSED(count); return false; #endif } -- cgit v0.12 From 760319b312aceb2cc7438ad09eecd305c1b663e8 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Thu, 4 Feb 2010 06:48:30 -0800 Subject: Fix Geometry shaders based on review --- src/opengl/qglshaderprogram.cpp | 24 +++++++++++++++--------- src/opengl/qglshaderprogram.h | 2 +- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/opengl/qglshaderprogram.cpp b/src/opengl/qglshaderprogram.cpp index 43d1df8..7af488d 100644 --- a/src/opengl/qglshaderprogram.cpp +++ b/src/opengl/qglshaderprogram.cpp @@ -517,9 +517,6 @@ public: , geometryVertexCount(64) , geometryInputType(0) , geometryOutputType(0) - , vertexShader(0) - , fragmentShader(0) - , geometryShader(0) { } ~QGLShaderProgramPrivate(); @@ -536,9 +533,6 @@ public: QString log; QList shaders; QList anonShaders; - QGLShader *vertexShader; - QGLShader *fragmentShader; - QGLShader *geometryShader; bool hasShader(QGLShader::ShaderType type) const; }; @@ -564,6 +558,17 @@ bool QGLShaderProgramPrivate::hasShader(QGLShader::ShaderType type) const #define ctx d->programGuard.context() /*! + \enum GeometryTypes + + Defines the geometry types specificed by the GL_EXT_geometry_shader4 extension + + \value LinesWithAdjacencyGeometryType Corresponds to GL_LINES_ADJACENCY. + \value LineStripWithAdjacencyGeometryType Corresponds to GL_LINE_STRIP_ADJACENCY. + \value TrianglesWithAdjacencyGeometryType Corresponds to GL_TRIANGLES_ADJACENCY. + \value TriangleStripWithAdjacencyGeometryType Corresponds to GL_TRIANGLE_STRIP_ADJACENCY. + */ + +/*! Constructs a new shader program and attaches it to \a parent. The program will be invalid until addShader() is called. @@ -2995,7 +3000,7 @@ void QGLShaderProgram::shaderDestroyed() The \a context is used to resolve the GLSL extensions. If \a context is null, then QGLContext::currentContext() is used. */ -bool QGLShader::hasShaders(ShaderType type, const QGLContext *context) +bool QGLShader::hasOpenGLShaders(ShaderType type, const QGLContext *context) { #if !defined(QT_OPENGL_ES_2) if (!context) @@ -3006,9 +3011,10 @@ bool QGLShader::hasShaders(ShaderType type, const QGLContext *context) bool resolved = qt_resolve_glsl_extensions(const_cast(context)); if (!resolved) return false; - const QGLContext *ctx = context; - if ((type & Geometry) && !glProgramParameteriEXT) + + if ((type & Geometry) && !QByteArray((const char *) glGetString(GL_EXTENSIONS)).contains("GL_EXT_geometry_shader4")) return false; + return true; } diff --git a/src/opengl/qglshaderprogram.h b/src/opengl/qglshaderprogram.h index face66e..6dfbb77 100644 --- a/src/opengl/qglshaderprogram.h +++ b/src/opengl/qglshaderprogram.h @@ -89,7 +89,7 @@ public: GLuint shaderId() const; - static bool hasShaders(ShaderType type, const QGLContext *context = 0); + static bool hasOpenGLShaders(ShaderType type, const QGLContext *context = 0); private: friend class QGLShaderProgram; -- cgit v0.12 From 17ba81e9587f3202363b42f6662a2866506e9247 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Thu, 4 Feb 2010 15:40:29 +0100 Subject: Fix QtScript debugger hang/crash issue with updating locals model Since the model is updated lazily, it's possible that a new model has been set on the view (and the old model deleted) before the old model has finished refreshing. This was discovered while holding down the F11 key (Step Into) when debugging plasma.js in the script/context2d example, which causes many events (and hence asynchronous model updates) to trigger rapidly. --- .../debugging/qscriptdebuggerlocalsmodel.cpp | 55 ++++++++++++++++------ .../debugging/qscriptdebuggerlocalswidget.cpp | 5 +- 2 files changed, 44 insertions(+), 16 deletions(-) diff --git a/src/scripttools/debugging/qscriptdebuggerlocalsmodel.cpp b/src/scripttools/debugging/qscriptdebuggerlocalsmodel.cpp index 068de42..ec6230b 100644 --- a/src/scripttools/debugging/qscriptdebuggerlocalsmodel.cpp +++ b/src/scripttools/debugging/qscriptdebuggerlocalsmodel.cpp @@ -54,6 +54,7 @@ #include #include +#include #include #include @@ -370,6 +371,7 @@ public: { if (!m_index.isValid()) { // nothing to do, the node has been removed + finish(); return; } QScriptDebuggerCommandSchedulerFrontend frontend(commandScheduler(), this); @@ -475,7 +477,7 @@ namespace { class InitModelJob : public QScriptDebuggerCommandSchedulerJob { public: - InitModelJob(QScriptDebuggerLocalsModelPrivate *model, + InitModelJob(QScriptDebuggerLocalsModel *model, int frameIndex, QScriptDebuggerCommandSchedulerInterface *scheduler) : QScriptDebuggerCommandSchedulerJob(scheduler), @@ -484,6 +486,11 @@ public: void start() { + if (!m_model) { + // Model has been deleted. + finish(); + return; + } QScriptDebuggerCommandSchedulerFrontend frontend(commandScheduler(), this); frontend.scheduleGetScopeChain(m_frameIndex); } @@ -491,7 +498,13 @@ public: void handleResponse(const QScriptDebuggerResponse &response, int) { + if (!m_model) { + // Model has been deleted. + finish(); + return; + } QScriptDebuggerCommandSchedulerFrontend frontend(commandScheduler(), this); + QScriptDebuggerLocalsModelPrivate *model_d = QScriptDebuggerLocalsModelPrivate::get(m_model); switch (m_state) { case 0: { QScriptDebuggerValueList scopeChain = response.resultAsScriptValueList(); @@ -500,23 +513,23 @@ public: QString name = QString::fromLatin1("Scope"); if (i > 0) name.append(QString::fromLatin1(" (%0)").arg(i)); - QModelIndex index = m_model->addTopLevelObject(name, scopeObject); + QModelIndex index = model_d->addTopLevelObject(name, scopeObject); if (i == 0) - m_model->emitScopeObjectAvailable(index); + model_d->emitScopeObjectAvailable(index); } frontend.scheduleGetThisObject(m_frameIndex); ++m_state; } break; case 1: { QScriptDebuggerValue thisObject = response.resultAsScriptValue(); - m_model->addTopLevelObject(QLatin1String("this"), thisObject); + model_d->addTopLevelObject(QLatin1String("this"), thisObject); finish(); } break; } } private: - QScriptDebuggerLocalsModelPrivate *m_model; + QPointer m_model; int m_frameIndex; int m_state; }; @@ -527,7 +540,7 @@ void QScriptDebuggerLocalsModel::init(int frameIndex) { Q_D(QScriptDebuggerLocalsModel); d->frameIndex = frameIndex; - QScriptDebuggerJob *job = new InitModelJob(d, frameIndex, d->commandScheduler); + QScriptDebuggerJob *job = new InitModelJob(this, frameIndex, d->commandScheduler); d->jobScheduler->scheduleJob(job); } @@ -536,7 +549,7 @@ namespace { class SyncModelJob : public QScriptDebuggerCommandSchedulerJob { public: - SyncModelJob(QScriptDebuggerLocalsModelPrivate *model, + SyncModelJob(QScriptDebuggerLocalsModel *model, int frameIndex, QScriptDebuggerCommandSchedulerInterface *scheduler) : QScriptDebuggerCommandSchedulerJob(scheduler), @@ -545,6 +558,11 @@ public: void start() { + if (!m_model) { + // Model has been deleted. + finish(); + return; + } QScriptDebuggerCommandSchedulerFrontend frontend(commandScheduler(), this); frontend.scheduleGetScopeChain(m_frameIndex); } @@ -552,6 +570,11 @@ public: void handleResponse(const QScriptDebuggerResponse &response, int) { + if (!m_model) { + // Model has been deleted. + finish(); + return; + } QScriptDebuggerCommandSchedulerFrontend frontend(commandScheduler(), this); switch (m_state) { case 0: { @@ -561,18 +584,19 @@ public: ++m_state; } break; case 1: { + QScriptDebuggerLocalsModelPrivate *model_d = QScriptDebuggerLocalsModelPrivate::get(m_model); QScriptDebuggerValue thisObject = response.resultAsScriptValue(); m_topLevelObjects.append(thisObject); - bool equal = (m_topLevelObjects.size() == m_model->invisibleRootNode->children.size()); + bool equal = (m_topLevelObjects.size() == model_d->invisibleRootNode->children.size()); for (int i = 0; equal && (i < m_topLevelObjects.size()); ++i) { const QScriptDebuggerValue &object = m_topLevelObjects.at(i); - equal = (object == m_model->invisibleRootNode->children.at(i)->property.value()); + equal = (object == model_d->invisibleRootNode->children.at(i)->property.value()); } if (!equal) { // the scope chain and/or this-object changed, so invalidate the model. // we could try to be more clever, i.e. figure out // exactly which objects were popped/pushed - m_model->removeTopLevelNodes(); + model_d->removeTopLevelNodes(); for (int j = 0; j < m_topLevelObjects.size(); ++j) { const QScriptDebuggerValue &object = m_topLevelObjects.at(j); QString name; @@ -583,12 +607,12 @@ public: if (j > 0) name.append(QString::fromLatin1(" (%0)").arg(j)); } - QModelIndex index = m_model->addTopLevelObject(name, object); + QModelIndex index = model_d->addTopLevelObject(name, object); if (j == 0) - m_model->emitScopeObjectAvailable(index); + model_d->emitScopeObjectAvailable(index); } } else { - m_model->syncTopLevelNodes(); + model_d->syncTopLevelNodes(); } finish(); } break; @@ -596,7 +620,7 @@ public: } private: - QScriptDebuggerLocalsModelPrivate *m_model; + QPointer m_model; int m_frameIndex; int m_state; QScriptDebuggerValueList m_topLevelObjects; @@ -608,7 +632,7 @@ void QScriptDebuggerLocalsModel::sync(int frameIndex) { Q_D(QScriptDebuggerLocalsModel); d->frameIndex = frameIndex; - QScriptDebuggerJob *job = new SyncModelJob(d, frameIndex, d->commandScheduler); + QScriptDebuggerJob *job = new SyncModelJob(this, frameIndex, d->commandScheduler); d->jobScheduler->scheduleJob(job); } @@ -636,6 +660,7 @@ public: { if (!m_index.isValid()) { // nothing to do, the node has been removed + finish(); return; } QScriptDebuggerCommandSchedulerFrontend frontend(commandScheduler(), this); diff --git a/src/scripttools/debugging/qscriptdebuggerlocalswidget.cpp b/src/scripttools/debugging/qscriptdebuggerlocalswidget.cpp index 516a200..bbced5f 100644 --- a/src/scripttools/debugging/qscriptdebuggerlocalswidget.cpp +++ b/src/scripttools/debugging/qscriptdebuggerlocalswidget.cpp @@ -70,6 +70,8 @@ public: bool hasChildren(const QModelIndex &parent) const { + if (!sourceModel()) + return false; QModelIndex sourceParent = mapToSource(parent); if (parent.isValid() && !sourceParent.isValid()) return false; @@ -184,7 +186,8 @@ void QScriptDebuggerLocalsWidgetPrivate::_q_insertCompletion(const QString &text void QScriptDebuggerLocalsWidgetPrivate::_q_expandIndex(const QModelIndex &index) { - view->expand(proxy->mapFromSource(index)); + if (view->model() == index.model()) + view->expand(proxy->mapFromSource(index)); } class QScriptDebuggerLocalsItemDelegate -- cgit v0.12 From 5762a988fbcd95c9c44e58993c25f5cd1d53f897 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Thu, 4 Feb 2010 16:08:47 +0100 Subject: Use a shared QScriptEngine for debugger console command scripts A single engine was used for each script (i.e. command), which was just ridiculous. Use one engine with multiple global objects to isolate each script's state. Task-number: QTBUG-7227 --- .../debugging/qscriptdebuggerconsole.cpp | 221 ++++++++++++++++++- .../qscriptdebuggerscriptedconsolecommand.cpp | 237 +-------------------- .../qscriptdebuggerscriptedconsolecommand_p.h | 4 +- 3 files changed, 233 insertions(+), 229 deletions(-) diff --git a/src/scripttools/debugging/qscriptdebuggerconsole.cpp b/src/scripttools/debugging/qscriptdebuggerconsole.cpp index 7fd80f0..2f7a998 100644 --- a/src/scripttools/debugging/qscriptdebuggerconsole.cpp +++ b/src/scripttools/debugging/qscriptdebuggerconsole.cpp @@ -44,16 +44,216 @@ #include "qscriptdebuggerconsolecommandmanager_p.h" #include "qscriptdebuggerscriptedconsolecommand_p.h" #include "qscriptmessagehandlerinterface_p.h" +#include "qscriptbreakpointdata_p.h" +#include "qscriptdebuggerresponse_p.h" +#include "qscriptdebuggervalueproperty_p.h" +#include "qscriptscriptdata_p.h" #include #include #include #include #include +#include #include +Q_DECLARE_METATYPE(QScriptDebuggerResponse) +Q_DECLARE_METATYPE(QScriptBreakpointData) +Q_DECLARE_METATYPE(QScriptBreakpointMap) +Q_DECLARE_METATYPE(QScriptScriptData) +Q_DECLARE_METATYPE(QScriptScriptMap) +Q_DECLARE_METATYPE(QScriptContextInfo) +Q_DECLARE_METATYPE(QScriptDebuggerValue) +Q_DECLARE_METATYPE(QScriptDebuggerValueProperty) +Q_DECLARE_METATYPE(QScriptDebuggerValuePropertyList) +Q_DECLARE_METATYPE(QScriptDebuggerConsoleCommand*) +Q_DECLARE_METATYPE(QScriptDebuggerConsoleCommandList) +Q_DECLARE_METATYPE(QScriptDebuggerConsoleCommandGroupData) +Q_DECLARE_METATYPE(QScriptDebuggerConsoleCommandGroupMap) + QT_BEGIN_NAMESPACE +static QScriptValue debuggerResponseToScriptValue(QScriptEngine *eng, const QScriptDebuggerResponse &in) +{ + QScriptValue out = eng->newObject(); + out.setProperty(QString::fromLatin1("result"), qScriptValueFromValue(eng, in.result())); + out.setProperty(QString::fromLatin1("error"), QScriptValue(eng, in.error())); + out.setProperty(QString::fromLatin1("async"), QScriptValue(eng, in.async())); + return out; +} + +static void debuggerResponseFromScriptValue(const QScriptValue &, QScriptDebuggerResponse &) +{ + Q_ASSERT(0); +} + +static QScriptValue breakpointDataToScriptValue(QScriptEngine *eng, const QScriptBreakpointData &in) +{ + QScriptValue out = eng->newObject(); + out.setProperty(QString::fromLatin1("scriptId"), QScriptValue(eng, qsreal(in.scriptId()))); + out.setProperty(QString::fromLatin1("fileName"), QScriptValue(eng, in.fileName())); + out.setProperty(QString::fromLatin1("lineNumber"), QScriptValue(eng, in.lineNumber())); + out.setProperty(QString::fromLatin1("enabled"), QScriptValue(eng, in.isEnabled())); + out.setProperty(QString::fromLatin1("singleShot"), QScriptValue(eng, in.isSingleShot())); + out.setProperty(QString::fromLatin1("ignoreCount"), QScriptValue(eng, in.ignoreCount())); + out.setProperty(QString::fromLatin1("condition"), QScriptValue(eng, in.condition())); + return out; +} + +static void breakpointDataFromScriptValue(const QScriptValue &in, QScriptBreakpointData &out) +{ + QScriptValue scriptId = in.property(QString::fromLatin1("scriptId")); + if (scriptId.isValid()) + out.setScriptId((qint64)scriptId.toNumber()); + out.setFileName(in.property(QString::fromLatin1("fileName")).toString()); + out.setLineNumber(in.property(QString::fromLatin1("lineNumber")).toInt32()); + QScriptValue enabled = in.property(QString::fromLatin1("enabled")); + if (enabled.isValid()) + out.setEnabled(enabled.toBoolean()); + QScriptValue singleShot = in.property(QString::fromLatin1("singleShot")); + if (singleShot.isValid()) + out.setSingleShot(singleShot.toBoolean()); + out.setIgnoreCount(in.property(QString::fromLatin1("ignoreCount")).toInt32()); + out.setCondition(in.property(QString::fromLatin1("condition")).toString()); +} + +static QScriptValue breakpointMapToScriptValue(QScriptEngine *eng, const QScriptBreakpointMap &in) +{ + QScriptValue out = eng->newObject(); + QScriptBreakpointMap::const_iterator it; + for (it = in.constBegin(); it != in.constEnd(); ++it) { + out.setProperty(QString::number(it.key()), qScriptValueFromValue(eng, it.value())); + } + return out; +} + +static void breakpointMapFromScriptValue(const QScriptValue &, QScriptBreakpointMap &) +{ + Q_ASSERT(0); +} + +static QScriptValue scriptDataToScriptValue(QScriptEngine *eng, const QScriptScriptData &in) +{ + QScriptValue out = eng->newObject(); + out.setProperty(QString::fromLatin1("contents"), QScriptValue(eng, in.contents())); + out.setProperty(QString::fromLatin1("fileName"), QScriptValue(eng, in.fileName())); + out.setProperty(QString::fromLatin1("baseLineNumber"), QScriptValue(eng, in.baseLineNumber())); + return out; +} + +static void scriptDataFromScriptValue(const QScriptValue &in, QScriptScriptData &out) +{ + QString contents = in.property(QString::fromLatin1("contents")).toString(); + QString fileName = in.property(QString::fromLatin1("fileName")).toString(); + int baseLineNumber = in.property(QString::fromLatin1("baseLineNumber")).toInt32(); + QScriptScriptData tmp(contents, fileName, baseLineNumber); + out = tmp; +} + +static QScriptValue scriptMapToScriptValue(QScriptEngine *eng, const QScriptScriptMap &in) +{ + QScriptValue out = eng->newObject(); + QScriptScriptMap::const_iterator it; + for (it = in.constBegin(); it != in.constEnd(); ++it) { + out.setProperty(QString::number(it.key()), qScriptValueFromValue(eng, it.value())); + } + return out; +} + +static void scriptMapFromScriptValue(const QScriptValue &, QScriptScriptMap &) +{ + Q_ASSERT(0); +} + +static QScriptValue consoleCommandToScriptValue( + QScriptEngine *eng, QScriptDebuggerConsoleCommand* const &in) +{ + if (!in) + return eng->undefinedValue(); + QScriptValue out = eng->newObject(); + out.setProperty(QString::fromLatin1("name"), QScriptValue(eng, in->name())); + out.setProperty(QString::fromLatin1("group"), QScriptValue(eng, in->group())); + out.setProperty(QString::fromLatin1("shortDescription"), QScriptValue(eng, in->shortDescription())); + out.setProperty(QString::fromLatin1("longDescription"), QScriptValue(eng, in->longDescription())); + out.setProperty(QString::fromLatin1("aliases"), qScriptValueFromValue(eng, in->aliases())); + out.setProperty(QString::fromLatin1("seeAlso"), qScriptValueFromValue(eng, in->seeAlso())); + return out; +} + +static void consoleCommandFromScriptValue( + const QScriptValue &, QScriptDebuggerConsoleCommand* &) +{ + Q_ASSERT(0); +} + +static QScriptValue consoleCommandGroupDataToScriptValue( + QScriptEngine *eng, const QScriptDebuggerConsoleCommandGroupData &in) +{ + QScriptValue out = eng->newObject(); + out.setProperty(QString::fromLatin1("longDescription"), QScriptValue(eng, in.longDescription())); + out.setProperty(QString::fromLatin1("shortDescription"), QScriptValue(eng, in.shortDescription())); + return out; +} + +static void consoleCommandGroupDataFromScriptValue( + const QScriptValue &, QScriptDebuggerConsoleCommandGroupData &) +{ + Q_ASSERT(0); +} + +static QScriptValue consoleCommandGroupMapToScriptValue( + QScriptEngine *eng, const QScriptDebuggerConsoleCommandGroupMap &in) +{ + QScriptValue out = eng->newObject(); + QScriptDebuggerConsoleCommandGroupMap::const_iterator it; + for (it = in.constBegin(); it != in.constEnd(); ++it) { + out.setProperty(it.key(), qScriptValueFromValue(eng, it.value())); + } + return out; +} + +static void consoleCommandGroupMapFromScriptValue( + const QScriptValue &, QScriptDebuggerConsoleCommandGroupMap &) +{ + Q_ASSERT(0); +} + +static QScriptValue contextInfoToScriptValue(QScriptEngine *eng, const QScriptContextInfo &in) +{ + QScriptValue out = eng->newObject(); + out.setProperty(QString::fromLatin1("scriptId"), QScriptValue(eng, qsreal(in.scriptId()))); + out.setProperty(QString::fromLatin1("fileName"), QScriptValue(eng, in.fileName())); + out.setProperty(QString::fromLatin1("lineNumber"), QScriptValue(eng, in.lineNumber())); + out.setProperty(QString::fromLatin1("columnNumber"), QScriptValue(eng, in.columnNumber())); + out.setProperty(QString::fromLatin1("functionName"), QScriptValue(eng, in.functionName())); + return out; +} + +static void contextInfoFromScriptValue(const QScriptValue &, QScriptContextInfo &) +{ + Q_ASSERT(0); +} + +static QScriptValue debuggerScriptValuePropertyToScriptValue(QScriptEngine *eng, const QScriptDebuggerValueProperty &in) +{ + QScriptValue out = eng->newObject(); + out.setProperty(QString::fromLatin1("name"), QScriptValue(eng, in.name())); + out.setProperty(QString::fromLatin1("value"), qScriptValueFromValue(eng, in.value())); + out.setProperty(QString::fromLatin1("valueAsString"), QScriptValue(eng, in.valueAsString())); + out.setProperty(QString::fromLatin1("flags"), QScriptValue(eng, static_cast(in.flags()))); + return out; +} + +static void debuggerScriptValuePropertyFromScriptValue(const QScriptValue &in, QScriptDebuggerValueProperty &out) +{ + QString name = in.property(QString::fromLatin1("name")).toString(); + QScriptDebuggerValue value = qscriptvalue_cast(in.property(QString::fromLatin1("value"))); + QString valueAsString = in.property(QString::fromLatin1("valueAsString")).toString(); + int flags = in.property(QString::fromLatin1("flags")).toInt32(); + QScriptDebuggerValueProperty tmp(name, value, valueAsString, QScriptValue::PropertyFlags(flags)); + out = tmp; +} + /*! \since 4.5 \class QScriptDebuggerConsole @@ -76,6 +276,7 @@ public: QScriptMessageHandlerInterface *messageHandler, QScriptDebuggerCommandSchedulerInterface *commandScheduler); + QScriptEngine *commandEngine; QScriptDebuggerConsoleCommandManager *commandManager; QString commandPrefix; QString input; @@ -99,11 +300,29 @@ QScriptDebuggerConsolePrivate::QScriptDebuggerConsolePrivate(QScriptDebuggerCons evaluateAction = 0; commandPrefix = QLatin1String("."); commandManager = new QScriptDebuggerConsoleCommandManager(); + + commandEngine = new QScriptEngine; + qScriptRegisterMetaType(commandEngine, breakpointDataToScriptValue, breakpointDataFromScriptValue); + qScriptRegisterMetaType(commandEngine, breakpointMapToScriptValue, breakpointMapFromScriptValue); + qScriptRegisterMetaType(commandEngine, scriptDataToScriptValue, scriptDataFromScriptValue); + qScriptRegisterMetaType(commandEngine, scriptMapToScriptValue, scriptMapFromScriptValue); + qScriptRegisterMetaType(commandEngine, contextInfoToScriptValue, contextInfoFromScriptValue); + qScriptRegisterMetaType(commandEngine, debuggerScriptValuePropertyToScriptValue, debuggerScriptValuePropertyFromScriptValue); + qScriptRegisterSequenceMetaType(commandEngine); + qScriptRegisterMetaType(commandEngine, debuggerResponseToScriptValue, debuggerResponseFromScriptValue); + qScriptRegisterMetaType(commandEngine, consoleCommandToScriptValue, consoleCommandFromScriptValue); + qScriptRegisterSequenceMetaType(commandEngine); + qScriptRegisterMetaType(commandEngine, consoleCommandGroupDataToScriptValue, consoleCommandGroupDataFromScriptValue); + qScriptRegisterMetaType(commandEngine, consoleCommandGroupMapToScriptValue, consoleCommandGroupMapFromScriptValue); +// ### can't do this, if it's an object ID the conversion will be incorrect since +// ### the object ID refers to an object in a different engine! +// qScriptRegisterMetaType(commandEngine, debuggerScriptValueToScriptValue, debuggerScriptValueFromScriptValue); } QScriptDebuggerConsolePrivate::~QScriptDebuggerConsolePrivate() { delete commandManager; + delete commandEngine; } /*! @@ -126,7 +345,7 @@ void QScriptDebuggerConsolePrivate::loadScriptedCommands( QString program = stream.readAll(); QScriptDebuggerScriptedConsoleCommand *command; command = QScriptDebuggerScriptedConsoleCommand::parse( - program, fileName, messageHandler); + program, fileName, commandEngine, messageHandler); if (!command) continue; commandManager->addCommand(command); diff --git a/src/scripttools/debugging/qscriptdebuggerscriptedconsolecommand.cpp b/src/scripttools/debugging/qscriptdebuggerscriptedconsolecommand.cpp index 8d6a579..117c2d6 100644 --- a/src/scripttools/debugging/qscriptdebuggerscriptedconsolecommand.cpp +++ b/src/scripttools/debugging/qscriptdebuggerscriptedconsolecommand.cpp @@ -46,8 +46,6 @@ #include "qscriptmessagehandlerinterface_p.h" #include "qscriptdebuggerconsoleglobalobject_p.h" #include "qscriptdebuggerresponse_p.h" -#include "qscriptdebuggervalue_p.h" -#include "qscriptdebuggervalueproperty_p.h" #include "qscriptdebuggercommandschedulerinterface_p.h" #include @@ -59,202 +57,9 @@ #include Q_DECLARE_METATYPE(QScriptDebuggerResponse) -Q_DECLARE_METATYPE(QScriptBreakpointData) -Q_DECLARE_METATYPE(QScriptBreakpointMap) -Q_DECLARE_METATYPE(QScriptScriptData) -Q_DECLARE_METATYPE(QScriptScriptMap) -Q_DECLARE_METATYPE(QScriptContextInfo) -Q_DECLARE_METATYPE(QScriptDebuggerValue) -Q_DECLARE_METATYPE(QScriptDebuggerValueProperty) -Q_DECLARE_METATYPE(QScriptDebuggerValuePropertyList) -Q_DECLARE_METATYPE(QScriptDebuggerConsoleCommand*) -Q_DECLARE_METATYPE(QScriptDebuggerConsoleCommandList) -Q_DECLARE_METATYPE(QScriptDebuggerConsoleCommandGroupData) -Q_DECLARE_METATYPE(QScriptDebuggerConsoleCommandGroupMap) QT_BEGIN_NAMESPACE -static QScriptValue debuggerResponseToScriptValue(QScriptEngine *eng, const QScriptDebuggerResponse &in) -{ - QScriptValue out = eng->newObject(); - out.setProperty(QString::fromLatin1("result"), qScriptValueFromValue(eng, in.result())); - out.setProperty(QString::fromLatin1("error"), QScriptValue(eng, in.error())); - out.setProperty(QString::fromLatin1("async"), QScriptValue(eng, in.async())); - return out; -} - -static void debuggerResponseFromScriptValue(const QScriptValue &, QScriptDebuggerResponse &) -{ - Q_ASSERT(0); -} - -static QScriptValue breakpointDataToScriptValue(QScriptEngine *eng, const QScriptBreakpointData &in) -{ - QScriptValue out = eng->newObject(); - out.setProperty(QString::fromLatin1("scriptId"), QScriptValue(eng, qsreal(in.scriptId()))); - out.setProperty(QString::fromLatin1("fileName"), QScriptValue(eng, in.fileName())); - out.setProperty(QString::fromLatin1("lineNumber"), QScriptValue(eng, in.lineNumber())); - out.setProperty(QString::fromLatin1("enabled"), QScriptValue(eng, in.isEnabled())); - out.setProperty(QString::fromLatin1("singleShot"), QScriptValue(eng, in.isSingleShot())); - out.setProperty(QString::fromLatin1("ignoreCount"), QScriptValue(eng, in.ignoreCount())); - out.setProperty(QString::fromLatin1("condition"), QScriptValue(eng, in.condition())); - return out; -} - -static void breakpointDataFromScriptValue(const QScriptValue &in, QScriptBreakpointData &out) -{ - QScriptValue scriptId = in.property(QString::fromLatin1("scriptId")); - if (scriptId.isValid()) - out.setScriptId((qint64)scriptId.toNumber()); - out.setFileName(in.property(QString::fromLatin1("fileName")).toString()); - out.setLineNumber(in.property(QString::fromLatin1("lineNumber")).toInt32()); - QScriptValue enabled = in.property(QString::fromLatin1("enabled")); - if (enabled.isValid()) - out.setEnabled(enabled.toBoolean()); - QScriptValue singleShot = in.property(QString::fromLatin1("singleShot")); - if (singleShot.isValid()) - out.setSingleShot(singleShot.toBoolean()); - out.setIgnoreCount(in.property(QString::fromLatin1("ignoreCount")).toInt32()); - out.setCondition(in.property(QString::fromLatin1("condition")).toString()); -} - -static QScriptValue breakpointMapToScriptValue(QScriptEngine *eng, const QScriptBreakpointMap &in) -{ - QScriptValue out = eng->newObject(); - QScriptBreakpointMap::const_iterator it; - for (it = in.constBegin(); it != in.constEnd(); ++it) { - out.setProperty(QString::number(it.key()), qScriptValueFromValue(eng, it.value())); - } - return out; -} - -static void breakpointMapFromScriptValue(const QScriptValue &, QScriptBreakpointMap &) -{ - Q_ASSERT(0); -} - -static QScriptValue scriptDataToScriptValue(QScriptEngine *eng, const QScriptScriptData &in) -{ - QScriptValue out = eng->newObject(); - out.setProperty(QString::fromLatin1("contents"), QScriptValue(eng, in.contents())); - out.setProperty(QString::fromLatin1("fileName"), QScriptValue(eng, in.fileName())); - out.setProperty(QString::fromLatin1("baseLineNumber"), QScriptValue(eng, in.baseLineNumber())); - return out; -} - -static void scriptDataFromScriptValue(const QScriptValue &in, QScriptScriptData &out) -{ - QString contents = in.property(QString::fromLatin1("contents")).toString(); - QString fileName = in.property(QString::fromLatin1("fileName")).toString(); - int baseLineNumber = in.property(QString::fromLatin1("baseLineNumber")).toInt32(); - QScriptScriptData tmp(contents, fileName, baseLineNumber); - out = tmp; -} - -static QScriptValue scriptMapToScriptValue(QScriptEngine *eng, const QScriptScriptMap &in) -{ - QScriptValue out = eng->newObject(); - QScriptScriptMap::const_iterator it; - for (it = in.constBegin(); it != in.constEnd(); ++it) { - out.setProperty(QString::number(it.key()), qScriptValueFromValue(eng, it.value())); - } - return out; -} - -static void scriptMapFromScriptValue(const QScriptValue &, QScriptScriptMap &) -{ - Q_ASSERT(0); -} - -static QScriptValue consoleCommandToScriptValue( - QScriptEngine *eng, QScriptDebuggerConsoleCommand* const &in) -{ - if (!in) - return eng->undefinedValue(); - QScriptValue out = eng->newObject(); - out.setProperty(QString::fromLatin1("name"), QScriptValue(eng, in->name())); - out.setProperty(QString::fromLatin1("group"), QScriptValue(eng, in->group())); - out.setProperty(QString::fromLatin1("shortDescription"), QScriptValue(eng, in->shortDescription())); - out.setProperty(QString::fromLatin1("longDescription"), QScriptValue(eng, in->longDescription())); - out.setProperty(QString::fromLatin1("aliases"), qScriptValueFromValue(eng, in->aliases())); - out.setProperty(QString::fromLatin1("seeAlso"), qScriptValueFromValue(eng, in->seeAlso())); - return out; -} - -static void consoleCommandFromScriptValue( - const QScriptValue &, QScriptDebuggerConsoleCommand* &) -{ - Q_ASSERT(0); -} - -static QScriptValue consoleCommandGroupDataToScriptValue( - QScriptEngine *eng, const QScriptDebuggerConsoleCommandGroupData &in) -{ - QScriptValue out = eng->newObject(); - out.setProperty(QString::fromLatin1("longDescription"), QScriptValue(eng, in.longDescription())); - out.setProperty(QString::fromLatin1("shortDescription"), QScriptValue(eng, in.shortDescription())); - return out; -} - -static void consoleCommandGroupDataFromScriptValue( - const QScriptValue &, QScriptDebuggerConsoleCommandGroupData &) -{ - Q_ASSERT(0); -} - -static QScriptValue consoleCommandGroupMapToScriptValue( - QScriptEngine *eng, const QScriptDebuggerConsoleCommandGroupMap &in) -{ - QScriptValue out = eng->newObject(); - QScriptDebuggerConsoleCommandGroupMap::const_iterator it; - for (it = in.constBegin(); it != in.constEnd(); ++it) { - out.setProperty(it.key(), qScriptValueFromValue(eng, it.value())); - } - return out; -} - -static void consoleCommandGroupMapFromScriptValue( - const QScriptValue &, QScriptDebuggerConsoleCommandGroupMap &) -{ - Q_ASSERT(0); -} - -static QScriptValue contextInfoToScriptValue(QScriptEngine *eng, const QScriptContextInfo &in) -{ - QScriptValue out = eng->newObject(); - out.setProperty(QString::fromLatin1("scriptId"), QScriptValue(eng, qsreal(in.scriptId()))); - out.setProperty(QString::fromLatin1("fileName"), QScriptValue(eng, in.fileName())); - out.setProperty(QString::fromLatin1("lineNumber"), QScriptValue(eng, in.lineNumber())); - out.setProperty(QString::fromLatin1("columnNumber"), QScriptValue(eng, in.columnNumber())); - out.setProperty(QString::fromLatin1("functionName"), QScriptValue(eng, in.functionName())); - return out; -} - -static void contextInfoFromScriptValue(const QScriptValue &, QScriptContextInfo &) -{ - Q_ASSERT(0); -} - -static QScriptValue debuggerScriptValuePropertyToScriptValue(QScriptEngine *eng, const QScriptDebuggerValueProperty &in) -{ - QScriptValue out = eng->newObject(); - out.setProperty(QString::fromLatin1("name"), QScriptValue(eng, in.name())); - out.setProperty(QString::fromLatin1("value"), qScriptValueFromValue(eng, in.value())); - out.setProperty(QString::fromLatin1("valueAsString"), QScriptValue(eng, in.valueAsString())); - out.setProperty(QString::fromLatin1("flags"), QScriptValue(eng, static_cast(in.flags()))); - return out; -} - -static void debuggerScriptValuePropertyFromScriptValue(const QScriptValue &in, QScriptDebuggerValueProperty &out) -{ - QString name = in.property(QString::fromLatin1("name")).toString(); - QScriptDebuggerValue value = qscriptvalue_cast(in.property(QString::fromLatin1("value"))); - QString valueAsString = in.property(QString::fromLatin1("valueAsString")).toString(); - int flags = in.property(QString::fromLatin1("flags")).toInt32(); - QScriptDebuggerValueProperty tmp(name, value, valueAsString, QScriptValue::PropertyFlags(flags)); - out = tmp; -} - /*! \since 4.5 \class QScriptDebuggerScriptedConsoleCommand @@ -279,19 +84,17 @@ public: QStringList seeAlso; QStringList argumentTypes; QStringList subCommands; - QScriptEngine *engine; + QScriptValue globalObject; QScriptValue execFunction; QScriptValue responseFunction; }; QScriptDebuggerScriptedConsoleCommandPrivate::QScriptDebuggerScriptedConsoleCommandPrivate() { - engine = 0; } QScriptDebuggerScriptedConsoleCommandPrivate::~QScriptDebuggerScriptedConsoleCommandPrivate() { - delete engine; } QScriptDebuggerScriptedConsoleCommand::QScriptDebuggerScriptedConsoleCommand( @@ -299,6 +102,7 @@ QScriptDebuggerScriptedConsoleCommand::QScriptDebuggerScriptedConsoleCommand( const QString &shortDescription, const QString &longDescription, const QStringList &aliases, const QStringList &seeAlso, const QStringList &argumentTypes, const QStringList &subCommands, + const QScriptValue &globalObject, const QScriptValue &execFunction, const QScriptValue &responseFunction) : QScriptDebuggerConsoleCommand(*new QScriptDebuggerScriptedConsoleCommandPrivate) { @@ -311,25 +115,9 @@ QScriptDebuggerScriptedConsoleCommand::QScriptDebuggerScriptedConsoleCommand( d->seeAlso = seeAlso; d->argumentTypes = argumentTypes; d->subCommands = subCommands; + d->globalObject = globalObject; d->execFunction = execFunction; d->responseFunction = responseFunction; - d->engine = execFunction.engine(); - - qScriptRegisterMetaType(d->engine, breakpointDataToScriptValue, breakpointDataFromScriptValue); - qScriptRegisterMetaType(d->engine, breakpointMapToScriptValue, breakpointMapFromScriptValue); - qScriptRegisterMetaType(d->engine, scriptDataToScriptValue, scriptDataFromScriptValue); - qScriptRegisterMetaType(d->engine, scriptMapToScriptValue, scriptMapFromScriptValue); - qScriptRegisterMetaType(d->engine, contextInfoToScriptValue, contextInfoFromScriptValue); - qScriptRegisterMetaType(d->engine, debuggerScriptValuePropertyToScriptValue, debuggerScriptValuePropertyFromScriptValue); - qScriptRegisterSequenceMetaType(d->engine); - qScriptRegisterMetaType(d->engine, debuggerResponseToScriptValue, debuggerResponseFromScriptValue); - qScriptRegisterMetaType(d->engine, consoleCommandToScriptValue, consoleCommandFromScriptValue); - qScriptRegisterSequenceMetaType(d->engine); - qScriptRegisterMetaType(d->engine, consoleCommandGroupDataToScriptValue, consoleCommandGroupDataFromScriptValue); - qScriptRegisterMetaType(d->engine, consoleCommandGroupMapToScriptValue, consoleCommandGroupMapFromScriptValue); -// ### can't do this, if it's an object ID the conversion will be incorrect since -// ### the object ID refers to an object in a different engine! -// qScriptRegisterMetaType(d->engine, debuggerScriptValueToScriptValue, debuggerScriptValueFromScriptValue); } QScriptDebuggerScriptedConsoleCommand::~QScriptDebuggerScriptedConsoleCommand() @@ -405,7 +193,8 @@ int QScriptDebuggerScriptedConsoleCommandJob::scheduleCommand( void QScriptDebuggerScriptedConsoleCommandJob::start() { Q_D(QScriptDebuggerScriptedConsoleCommandJob); - QScriptEngine *engine = d->command->engine; + QScriptEngine *engine = d->command->globalObject.engine(); + engine->setGlobalObject(d->command->globalObject); QScriptValueList args; for (int i = 0; i < d->arguments.size(); ++i) args.append(QScriptValue(engine, d->arguments.at(i))); @@ -435,12 +224,13 @@ void QScriptDebuggerScriptedConsoleCommandJob::handleResponse( { Q_D(QScriptDebuggerScriptedConsoleCommandJob); // ### generalize - QScriptEngine *engine = d->command->engine; + QScriptEngine *engine = d->command->globalObject.engine(); + engine->setGlobalObject(d->command->globalObject); QScriptValueList args; args.append(qScriptValueFromValue(engine, response)); args.append(QScriptValue(engine, commandId)); QScriptDebuggerConsoleGlobalObject *global; - global = qobject_cast(engine->globalObject().toQObject()); + global = qobject_cast(d->command->globalObject.toQObject()); Q_ASSERT(global != 0); global->setScheduler(this); global->setResponseHandler(this); @@ -551,9 +341,8 @@ QScriptDebuggerConsoleCommandJob *QScriptDebuggerScriptedConsoleCommand::createJ */ QScriptDebuggerScriptedConsoleCommand *QScriptDebuggerScriptedConsoleCommand::parse( const QString &program, const QString &fileName, - QScriptMessageHandlerInterface *messageHandler) + QScriptEngine *engine, QScriptMessageHandlerInterface *messageHandler) { - QScriptEngine *engine = new QScriptEngine(); // create a custom global object QScriptDebuggerConsoleGlobalObject *cppGlobal = new QScriptDebuggerConsoleGlobalObject(); QScriptValue global = engine->newQObject(cppGlobal, @@ -574,14 +363,12 @@ QScriptDebuggerScriptedConsoleCommand *QScriptDebuggerScriptedConsoleCommand::pa if (engine->hasUncaughtException()) { messageHandler->message(QtCriticalMsg, ret.toString(), fileName, engine->uncaughtExceptionLineNumber()); - delete engine; return 0; } QScriptValue name = global.property(QLatin1String("name")); if (!name.isString()) { messageHandler->message(QtCriticalMsg, QLatin1String("command definition lacks a name"), fileName); - delete engine; return 0; } QString nameStr = name.toString(); @@ -590,7 +377,6 @@ QScriptDebuggerScriptedConsoleCommand *QScriptDebuggerScriptedConsoleCommand::pa if (!group.isString()) { messageHandler->message(QtCriticalMsg, QString::fromLatin1("definition of command \"%0\" lacks a group name") .arg(nameStr), fileName); - delete engine; return 0; } QString groupStr = group.toString(); @@ -599,7 +385,6 @@ QScriptDebuggerScriptedConsoleCommand *QScriptDebuggerScriptedConsoleCommand::pa if (!shortDesc.isString()) { messageHandler->message(QtCriticalMsg, QString::fromLatin1("definition of command \"%0\" lacks shortDescription") .arg(nameStr), fileName); - delete engine; return 0; } QString shortDescStr = shortDesc.toString(); @@ -608,7 +393,6 @@ QScriptDebuggerScriptedConsoleCommand *QScriptDebuggerScriptedConsoleCommand::pa if (!longDesc.isString()) { messageHandler->message(QtCriticalMsg, QString::fromLatin1("definition of command \"%0\" lacks longDescription") .arg(nameStr), fileName); - delete engine; return 0; } QString longDescStr = longDesc.toString(); @@ -629,7 +413,6 @@ QScriptDebuggerScriptedConsoleCommand *QScriptDebuggerScriptedConsoleCommand::pa if (!execFunction.isFunction()) { messageHandler->message(QtCriticalMsg, QString::fromLatin1("definition of command \"%0\" lacks execute() function") .arg(nameStr), fileName); - delete engine; return 0; } @@ -640,7 +423,7 @@ QScriptDebuggerScriptedConsoleCommand *QScriptDebuggerScriptedConsoleCommand::pa shortDescStr, longDescStr, aliases, seeAlso, argTypes, subCommands, - execFunction, responseFunction); + global, execFunction, responseFunction); return result; } diff --git a/src/scripttools/debugging/qscriptdebuggerscriptedconsolecommand_p.h b/src/scripttools/debugging/qscriptdebuggerscriptedconsolecommand_p.h index 1536de2..2b2b3f8 100644 --- a/src/scripttools/debugging/qscriptdebuggerscriptedconsolecommand_p.h +++ b/src/scripttools/debugging/qscriptdebuggerscriptedconsolecommand_p.h @@ -57,6 +57,7 @@ QT_BEGIN_NAMESPACE +class QScriptEngine; class QScriptValue; class QScriptDebuggerScriptedConsoleCommandPrivate; @@ -72,6 +73,7 @@ protected: const QStringList &seeAlso, const QStringList &argumentTypes, const QStringList &subCommands, + const QScriptValue &globalObject, const QScriptValue &execFunction, const QScriptValue &responseFunction); public: @@ -79,7 +81,7 @@ public: static QScriptDebuggerScriptedConsoleCommand *parse( const QString &program, const QString &fileName, - QScriptMessageHandlerInterface *messageHandler); + QScriptEngine *engine, QScriptMessageHandlerInterface *messageHandler); QString name() const; QString group() const; -- cgit v0.12 From 622446fdd8b6ac14287b65fc640e07819e136a3c Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Fri, 5 Feb 2010 15:17:16 +1000 Subject: Add QMacCompatGLenum overrides for new QGLShaderProgram functions Task-number: QTBUG-7391 Reviewed-by: Sarah Smith --- src/opengl/qglshaderprogram.cpp | 28 ++++++++++++++++++++++++++++ src/opengl/qglshaderprogram.h | 11 +++++++++++ 2 files changed, 39 insertions(+) diff --git a/src/opengl/qglshaderprogram.cpp b/src/opengl/qglshaderprogram.cpp index 80b4872..255d51a 100644 --- a/src/opengl/qglshaderprogram.cpp +++ b/src/opengl/qglshaderprogram.cpp @@ -3078,6 +3078,34 @@ void QGLShaderProgram::shaderDestroyed() #ifdef Q_MAC_COMPAT_GL_FUNCTIONS /*! \internal */ +void QGLShaderProgram::setAttributeArray + (int location, QMacCompatGLenum type, const void *values, int tupleSize, int stride) +{ + setAttributeArray(location, GLenum(type), values, tupleSize, stride); +} + +/*! \internal */ +void QGLShaderProgram::setAttributeArray + (const char *name, QMacCompatGLenum type, const void *values, int tupleSize, int stride) +{ + setAttributeArray(name, GLenum(type), values, tupleSize, stride); +} + +/*! \internal */ +void QGLShaderProgram::setAttributeBuffer + (int location, QMacCompatGLenum type, int offset, int tupleSize, int stride) +{ + setAttributeBuffer(location, GLenum(type), offset, tupleSize, stride); +} + +/*! \internal */ +void QGLShaderProgram::setAttributeBuffer + (const char *name, QMacCompatGLenum type, int offset, int tupleSize, int stride) +{ + setAttributeBuffer(name, GLenum(type), offset, tupleSize, stride); +} + +/*! \internal */ void QGLShaderProgram::setUniformValue(int location, QMacCompatGLint value) { setUniformValue(location, GLint(value)); diff --git a/src/opengl/qglshaderprogram.h b/src/opengl/qglshaderprogram.h index 2500275..19ce9f2 100644 --- a/src/opengl/qglshaderprogram.h +++ b/src/opengl/qglshaderprogram.h @@ -182,6 +182,17 @@ public: void setAttributeBuffer (const char *name, GLenum type, int offset, int tupleSize, int stride = 0); +#ifdef Q_MAC_COMPAT_GL_FUNCTIONS + void setAttributeArray + (int location, QMacCompatGLenum type, const void *values, int tupleSize, int stride = 0); + void setAttributeArray + (const char *name, QMacCompatGLenum type, const void *values, int tupleSize, int stride = 0); + void setAttributeBuffer + (int location, QMacCompatGLenum type, int offset, int tupleSize, int stride = 0); + void setAttributeBuffer + (const char *name, QMacCompatGLenum type, int offset, int tupleSize, int stride = 0); +#endif + void enableAttributeArray(int location); void enableAttributeArray(const char *name); void disableAttributeArray(int location); -- cgit v0.12 From a398796e689dfccf5ab8b89a59663b690f4a03c0 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 5 Feb 2010 10:45:19 +0100 Subject: doc: Fixed some qdoc warnings. --- doc/src/qt4-intro.qdoc | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/doc/src/qt4-intro.qdoc b/doc/src/qt4-intro.qdoc index daceba5..5344bcc 100644 --- a/doc/src/qt4-intro.qdoc +++ b/doc/src/qt4-intro.qdoc @@ -457,6 +457,30 @@ */ /*! + \page qt4-7-intro.html + \title What's New in Qt 4.7 + + Qt 4.7 provides many improvements and enhancements over the + previous releases in the Qt 4 series. This document covers the + most important features in this release, separated by category. + + A list of other Qt 4 features can be found on the \bold{\l{What's + New in Qt 4}} page. + + \bold{Highlights} + + \tableofcontents + + \section1 New Classes, Functions, Macros, etc. + + Links to new classes, functions, macros, and other items + introduced in Qt 4.7. + + \sincelist 4.7 + +*/ + +/*! \page qt4-6-intro.html \title What's New in Qt 4.6 -- cgit v0.12 From c6393ddce6fc9df8f52039089cc67699eb95aada Mon Sep 17 00:00:00 2001 From: Pierre Rossi Date: Thu, 4 Feb 2010 16:06:00 +0100 Subject: Get rid of setFirstActionActive on mouse release in QMenu The point in keeping this behaviour seems limited, and it is causing a bug on touch-screens where there are no mouse moves. Task-number: QTBUG-7907 Reviewed-by: ogoffart Reviewed-by: Thierry --- src/gui/widgets/qmenu.cpp | 4 +--- tests/auto/qmenu/tst_qmenu.cpp | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp index 8ce7cc0..08960da 100644 --- a/src/gui/widgets/qmenu.cpp +++ b/src/gui/widgets/qmenu.cpp @@ -2302,9 +2302,7 @@ void QMenu::mouseReleaseEvent(QMouseEvent *e) QAction *action = d->actionAt(e->pos()); if (action && action == d->currentAction) { - if (action->menu()) - action->menu()->d_func()->setFirstActionActive(); - else { + if (!action->menu()){ #if defined(Q_WS_WIN) //On Windows only context menus can be activated with the right button if (e->button() == Qt::LeftButton || d->topCausedWidget() == 0) diff --git a/tests/auto/qmenu/tst_qmenu.cpp b/tests/auto/qmenu/tst_qmenu.cpp index 9dc18e0..3559b15 100644 --- a/tests/auto/qmenu/tst_qmenu.cpp +++ b/tests/auto/qmenu/tst_qmenu.cpp @@ -104,6 +104,7 @@ private slots: void setFixedWidth(); void deleteActionInTriggered(); void pushButtonPopulateOnAboutToShow(); + void QTBUG7907_submenus_autoselect(); protected slots: void onActivated(QAction*); void onHighlighted(QAction*); @@ -930,6 +931,22 @@ void tst_QMenu::pushButtonPopulateOnAboutToShow() QVERIFY(!lastMenu->geometry().intersects(b.geometry())); } +void tst_QMenu::QTBUG7907_submenus_autoselect() +{ + QMenu menu("Test Menu"); + QMenu set1("Setting1"); + QMenu set2("Setting2"); + QMenu subset("Subsetting"); + subset.addAction("Values"); + set1.addMenu(&subset); + menu.addMenu(&set1); + menu.addMenu(&set2); + menu.show(); + QTest::qWaitForWindowShown(&menu); + QTest::mouseClick(&menu, Qt::LeftButton, Qt::NoModifier, QPoint(5,5) ); + QTest::qWait(500); + QVERIFY(!subset.isVisible()); +} QTEST_MAIN(tst_QMenu) -- cgit v0.12 From 76bcd00f74b0977b5f6ce12295aae987ea9ad4c1 Mon Sep 17 00:00:00 2001 From: aavit Date: Fri, 5 Feb 2010 12:04:38 +0100 Subject: Performance: Use QImage's smoothscaling instead of old private code For historical reasons, QJpegHandler had its own smoothscaling code. QImage's scaling has since evolved to become both faster and better, so avoid code duplication and just use QImage for scaling. Reviewed-by: Trond --- src/plugins/imageformats/jpeg/qjpeghandler.cpp | 574 +++---------------------- 1 file changed, 67 insertions(+), 507 deletions(-) diff --git a/src/plugins/imageformats/jpeg/qjpeghandler.cpp b/src/plugins/imageformats/jpeg/qjpeghandler.cpp index 6cb93ad..4b4712c 100644 --- a/src/plugins/imageformats/jpeg/qjpeghandler.cpp +++ b/src/plugins/imageformats/jpeg/qjpeghandler.cpp @@ -52,8 +52,6 @@ #undef FAR #endif -// hw: optimize smoothscaler for returning 24-bit images - // including jpeglib.h seems to be a little messy extern "C" { // mingw includes rpcndr.h but does not define boolean @@ -76,433 +74,6 @@ extern "C" { QT_BEGIN_NAMESPACE -//#define QT_NO_IMAGE_SMOOTHSCALE -#ifndef QT_NO_IMAGE_SMOOTHSCALE -class QImageSmoothScalerPrivate; -class QImageSmoothScaler -{ -public: - QImageSmoothScaler(const int w, const int h, const QImage &src); - QImageSmoothScaler(const int srcWidth, const int srcHeight, - const int dstWidth, const int dstHeight); - - virtual ~QImageSmoothScaler(void); - - QImage scale(); - -private: - QImageSmoothScalerPrivate *d; - virtual QRgb *scanLine(const int line = 0, const QImage *src = 0); -}; - -class QImageSmoothScalerPrivate -{ -public: - int cols; - int newcols; - int rows; - int newrows; - bool hasAlpha; - - const QImage *src; - - void setup(const int srcWidth, const int srcHeight, const int dstWidth, - const int dstHeight, bool hasAlphaChannel); -}; - -QImageSmoothScaler::QImageSmoothScaler(const int w, const int h, - const QImage &src) -{ - d = new QImageSmoothScalerPrivate; - - d->setup(src.width(), src.height(), w, h, src.hasAlphaChannel() ); - this->d->src = &src; -} - -QImageSmoothScaler::QImageSmoothScaler(const int srcWidth, const int srcHeight, - const int dstWidth, const int dstHeight) -{ - d = new QImageSmoothScalerPrivate; - d->setup(srcWidth, srcHeight, dstWidth, dstHeight, 0); -} - -void QImageSmoothScalerPrivate::setup(const int srcWidth, const int srcHeight, - const int dstWidth, const int dstHeight, - bool hasAlphaChannel) -{ - cols = srcWidth; - rows = srcHeight; - newcols = dstWidth; - newrows = dstHeight; - hasAlpha = hasAlphaChannel; -} - -QImageSmoothScaler::~QImageSmoothScaler() -{ - delete d; -} - -inline QRgb *QImageSmoothScaler::scanLine(const int line, const QImage *src) -{ - return (QRgb*)src->scanLine(line); -} - -/* - This function uses code based on pnmscale.c by Jef Poskanzer. - - pnmscale.c - read a portable anymap and scale it - - Copyright (C) 1989, 1991 by Jef Poskanzer. - - Permission to use, copy, modify, and distribute this software and its - documentation for any purpose and without fee is hereby granted, provided - that the above copyright notice appear in all copies and that both that - copyright notice and this permission notice appear in supporting - documentation. This software is provided "as is" without express or - implied warranty. -*/ - -QImage QImageSmoothScaler::scale() -{ - long SCALE; - long HALFSCALE; - QRgb *xelrow = 0; - QRgb *tempxelrow = 0; - QRgb *xP; - QRgb *nxP; - int row, rowsread; - int col, needtoreadrow; - uchar maxval = 255; - qreal xscale, yscale; - long sxscale, syscale; - long fracrowtofill, fracrowleft; - long *as; - long *rs; - long *gs; - long *bs; - int rowswritten = 0; - QImage dst; - - if (d->cols > 4096) { - SCALE = 4096; - HALFSCALE = 2048; - } else { - int fac = 4096; - while (d->cols * fac > 4096) - fac /= 2; - - SCALE = fac * d->cols; - HALFSCALE = fac * d->cols / 2; - } - - xscale = (qreal)d->newcols / (qreal)d->cols; - yscale = (qreal)d->newrows / (qreal)d->rows; - sxscale = (long)(xscale * SCALE); - syscale = (long)(yscale * SCALE); - - // shortcut Y scaling if possible - if (d->newrows != d->rows) - tempxelrow = new QRgb[d->cols]; - - if (d->hasAlpha) { - as = new long[d->cols]; - for (col = 0; col < d->cols; ++col) - as[col] = HALFSCALE; - } else { - as = 0; - } - rs = new long[d->cols]; - gs = new long[d->cols]; - bs = new long[d->cols]; - rowsread = 0; - fracrowleft = syscale; - needtoreadrow = 1; - for (col = 0; col < d->cols; ++col) - rs[col] = gs[col] = bs[col] = HALFSCALE; - fracrowtofill = SCALE; - - dst = QImage(d->newcols, d->newrows, d->hasAlpha ? QImage::Format_ARGB32 : QImage::Format_RGB32); - - for (row = 0; row < d->newrows; ++row) { - // First scale Y from xelrow into tempxelrow. - if (d->newrows == d->rows) { - // shortcut Y scaling if possible - tempxelrow = xelrow = scanLine(rowsread++, d->src); - } else { - while (fracrowleft < fracrowtofill) { - if (needtoreadrow && rowsread < d->rows) - xelrow = scanLine(rowsread++, d->src); - for (col = 0, xP = xelrow; col < d->cols; ++col, ++xP) { - if (as) { - as[col] += fracrowleft * qAlpha(*xP); - rs[col] += fracrowleft * qRed(*xP) * qAlpha(*xP) / 255; - gs[col] += fracrowleft * qGreen(*xP) * qAlpha(*xP) / 255; - bs[col] += fracrowleft * qBlue(*xP) * qAlpha(*xP) / 255; - } else { - rs[col] += fracrowleft * qRed(*xP); - gs[col] += fracrowleft * qGreen(*xP); - bs[col] += fracrowleft * qBlue(*xP); - } - } - fracrowtofill -= fracrowleft; - fracrowleft = syscale; - needtoreadrow = 1; - } - // Now fracrowleft is >= fracrowtofill, so we can produce a row. - if (needtoreadrow && rowsread < d->rows) { - xelrow = scanLine(rowsread++, d->src); - needtoreadrow = 0; - } - for (col = 0, xP = xelrow, nxP = tempxelrow; col < d->cols; ++col, ++xP, ++nxP) { - register long a, r, g, b; - - if (as) { - r = rs[col] + fracrowtofill * qRed(*xP) * qAlpha(*xP) / 255; - g = gs[col] + fracrowtofill * qGreen(*xP) * qAlpha(*xP) / 255; - b = bs[col] + fracrowtofill * qBlue(*xP) * qAlpha(*xP) / 255; - a = as[col] + fracrowtofill * qAlpha(*xP); - if (a) { - r = r * 255 / a * SCALE; - g = g * 255 / a * SCALE; - b = b * 255 / a * SCALE; - } - } else { - r = rs[col] + fracrowtofill * qRed(*xP); - g = gs[col] + fracrowtofill * qGreen(*xP); - b = bs[col] + fracrowtofill * qBlue(*xP); - a = 0; // unwarn - } - r /= SCALE; - if (r > maxval) - r = maxval; - g /= SCALE; - if (g > maxval) - g = maxval; - b /= SCALE; - if (b > maxval) - b = maxval; - if (as) { - a /= SCALE; - if (a > maxval) - a = maxval; - *nxP = qRgba((int)r, (int)g, (int)b, (int)a); - as[col] = HALFSCALE; - } else { - *nxP = qRgb((int)r, (int)g, (int)b); - } - rs[col] = gs[col] = bs[col] = HALFSCALE; - } - fracrowleft -= fracrowtofill; - if (fracrowleft == 0) { - fracrowleft = syscale; - needtoreadrow = 1; - } - fracrowtofill = SCALE; - } - - // Now scale X from tempxelrow into dst and write it out. - if (d->newcols == d->cols) { - // shortcut X scaling if possible - memcpy(dst.scanLine(rowswritten++), tempxelrow, d->newcols * 4); - } else { - register long a, r, g, b; - register long fraccoltofill, fraccolleft = 0; - register int needcol; - - nxP = (QRgb *)dst.scanLine(rowswritten++); - QRgb *nxPEnd = nxP + d->newcols; - fraccoltofill = SCALE; - a = r = g = b = HALFSCALE; - needcol = 0; - for (col = 0, xP = tempxelrow; col < d->cols; ++col, ++xP) { - fraccolleft = sxscale; - while (fraccolleft >= fraccoltofill) { - if (needcol) { - ++nxP; - a = r = g = b = HALFSCALE; - } - if (as) { - r += fraccoltofill * qRed(*xP) * qAlpha(*xP) / 255; - g += fraccoltofill * qGreen(*xP) * qAlpha(*xP) / 255; - b += fraccoltofill * qBlue(*xP) * qAlpha(*xP) / 255; - a += fraccoltofill * qAlpha(*xP); - if (a) { - r = r * 255 / a * SCALE; - g = g * 255 / a * SCALE; - b = b * 255 / a * SCALE; - } - } else { - r += fraccoltofill * qRed(*xP); - g += fraccoltofill * qGreen(*xP); - b += fraccoltofill * qBlue(*xP); - } - r /= SCALE; - if (r > maxval) - r = maxval; - g /= SCALE; - if (g > maxval) - g = maxval; - b /= SCALE; - if (b > maxval) - b = maxval; - if (as) { - a /= SCALE; - if (a > maxval) - a = maxval; - *nxP = qRgba((int)r, (int)g, (int)b, (int)a); - } else { - *nxP = qRgb((int)r, (int)g, (int)b); - } - fraccolleft -= fraccoltofill; - fraccoltofill = SCALE; - needcol = 1; - } - if (fraccolleft > 0) { - if (needcol) { - ++nxP; - a = r = g = b = HALFSCALE; - needcol = 0; - } - if (as) { - a += fraccolleft * qAlpha(*xP); - r += fraccolleft * qRed(*xP) * qAlpha(*xP) / 255; - g += fraccolleft * qGreen(*xP) * qAlpha(*xP) / 255; - b += fraccolleft * qBlue(*xP) * qAlpha(*xP) / 255; - } else { - r += fraccolleft * qRed(*xP); - g += fraccolleft * qGreen(*xP); - b += fraccolleft * qBlue(*xP); - } - fraccoltofill -= fraccolleft; - } - } - if (fraccoltofill > 0) { - --xP; - if (as) { - a += fraccolleft * qAlpha(*xP); - r += fraccoltofill * qRed(*xP) * qAlpha(*xP) / 255; - g += fraccoltofill * qGreen(*xP) * qAlpha(*xP) / 255; - b += fraccoltofill * qBlue(*xP) * qAlpha(*xP) / 255; - if (a) { - r = r * 255 / a * SCALE; - g = g * 255 / a * SCALE; - b = b * 255 / a * SCALE; - } - } else { - r += fraccoltofill * qRed(*xP); - g += fraccoltofill * qGreen(*xP); - b += fraccoltofill * qBlue(*xP); - } - } - if (nxP < nxPEnd) { - r /= SCALE; - if (r > maxval) - r = maxval; - g /= SCALE; - if (g > maxval) - g = maxval; - b /= SCALE; - if (b > maxval) - b = maxval; - if (as) { - a /= SCALE; - if (a > maxval) - a = maxval; - *nxP = qRgba((int)r, (int)g, (int)b, (int)a); - } else { - *nxP = qRgb((int)r, (int)g, (int)b); - } - while (++nxP != nxPEnd) - nxP[0] = nxP[-1]; - } - } - } - - if (d->newrows != d->rows && tempxelrow)// Robust, tempxelrow might be 0 1 day - delete [] tempxelrow; - if (as) // Avoid purify complaint - delete [] as; - if (rs) // Robust, rs might be 0 one day - delete [] rs; - if (gs) // Robust, gs might be 0 one day - delete [] gs; - if (bs) // Robust, bs might be 0 one day - delete [] bs; - - return dst; -} - -class jpegSmoothScaler : public QImageSmoothScaler -{ -public: - jpegSmoothScaler(struct jpeg_decompress_struct *info, const QSize& dstSize, const QRect& clipRect) - : QImageSmoothScaler(clipRect.width(), clipRect.height(), - dstSize.width(), dstSize.height()) - { - cinfo = info; - clip = clipRect; - imageCache = QImage(info->output_width, 1, QImage::Format_RGB32); - } - -private: - QRect clip; - QImage imageCache; - struct jpeg_decompress_struct *cinfo; - - QRgb *scanLine(const int line = 0, const QImage *src = 0) - { - QRgb *out; - uchar *in; - - Q_UNUSED(line); - Q_UNUSED(src); - - uchar* data = imageCache.bits(); - - // Read ahead if we haven't reached the first clipped scanline yet. - while (int(cinfo->output_scanline) < clip.y() && - cinfo->output_scanline < cinfo->output_height) - jpeg_read_scanlines(cinfo, &data, 1); - - // Read the next scanline. We assume that "line" - // will never be >= clip.height(). - jpeg_read_scanlines(cinfo, &data, 1); - if (cinfo->output_scanline == cinfo->output_height) - jpeg_finish_decompress(cinfo); - - out = ((QRgb*)data) + clip.x(); - - // - // The smooth scale algorithm only works on 32-bit images; - // convert from (8|24) bits to 32. - // - if (cinfo->output_components == 1) { - in = data + clip.right(); - for (int i = clip.width(); i--; ) { - out[i] = qRgb(*in, *in, *in); - in--; - } - } else if (cinfo->out_color_space == JCS_CMYK) { - in = data + clip.right() * 4; - for (int i = clip.width(); i--; ) { - int k = in[3]; - out[i] = qRgb(k * in[0] / 255, k * in[1] / 255, k * in[2] / 255); - in -= 4; - } - } else { - in = data + clip.right() * 3; - for (int i = clip.width(); i--; ) { - out[i] = qRgb(in[0], in[1], in[2]); - in -= 3; - } - } - - return out; - } - -}; -#endif - struct my_error_mgr : public jpeg_error_mgr { jmp_buf setjmp_buffer; }; @@ -844,93 +415,82 @@ static bool read_jpeg_image(QIODevice *device, QImage *outImage, clip = clip.intersected(imageRect); } -#ifndef QT_NO_IMAGE_SMOOTHSCALE - if (scaledSize.isValid() && scaledSize != clip.size() - && quality >= HIGH_QUALITY_THRESHOLD) { + // Allocate memory for the clipped QImage. + if (!ensureValidImage(outImage, &cinfo, clip.size())) + longjmp(jerr.setjmp_buffer, 1); + + // Avoid memcpy() overhead if grayscale with no clipping. + bool quickGray = (cinfo.output_components == 1 && + clip == imageRect); + if (!quickGray) { + // Ask the jpeg library to allocate a temporary row. + // The library will automatically delete it for us later. + // The libjpeg docs say we should do this before calling + // jpeg_start_decompress(). We can't use "new" here + // because we are inside the setjmp() block and an error + // in the jpeg input stream would cause a memory leak. + JSAMPARRAY rows = (cinfo.mem->alloc_sarray) + ((j_common_ptr)&cinfo, JPOOL_IMAGE, + cinfo.output_width * cinfo.output_components, 1); (void) jpeg_start_decompress(&cinfo); - jpegSmoothScaler scaler(&cinfo, scaledSize, clip); - *outImage = scaler.scale(); - } else -#endif - { - // Allocate memory for the clipped QImage. - if (!ensureValidImage(outImage, &cinfo, clip.size())) - longjmp(jerr.setjmp_buffer, 1); - - // Avoid memcpy() overhead if grayscale with no clipping. - bool quickGray = (cinfo.output_components == 1 && - clip == imageRect); - if (!quickGray) { - // Ask the jpeg library to allocate a temporary row. - // The library will automatically delete it for us later. - // The libjpeg docs say we should do this before calling - // jpeg_start_decompress(). We can't use "new" here - // because we are inside the setjmp() block and an error - // in the jpeg input stream would cause a memory leak. - JSAMPARRAY rows = (cinfo.mem->alloc_sarray) - ((j_common_ptr)&cinfo, JPOOL_IMAGE, - cinfo.output_width * cinfo.output_components, 1); - - (void) jpeg_start_decompress(&cinfo); - - while (cinfo.output_scanline < cinfo.output_height) { - int y = int(cinfo.output_scanline) - clip.y(); - if (y >= clip.height()) - break; // We've read the entire clip region, so abort. - - (void) jpeg_read_scanlines(&cinfo, rows, 1); - - if (y < 0) - continue; // Haven't reached the starting line yet. - - if (cinfo.output_components == 3) { - // Expand 24->32 bpp. - uchar *in = rows[0] + clip.x() * 3; - QRgb *out = (QRgb*)outImage->scanLine(y); - for (int i = 0; i < clip.width(); ++i) { - *out++ = qRgb(in[0], in[1], in[2]); - in += 3; - } - } else if (cinfo.out_color_space == JCS_CMYK) { - // Convert CMYK->RGB. - uchar *in = rows[0] + clip.x() * 4; - QRgb *out = (QRgb*)outImage->scanLine(y); - for (int i = 0; i < clip.width(); ++i) { - int k = in[3]; - *out++ = qRgb(k * in[0] / 255, k * in[1] / 255, - k * in[2] / 255); - in += 4; - } - } else if (cinfo.output_components == 1) { - // Grayscale. - memcpy(outImage->scanLine(y), - rows[0] + clip.x(), clip.width()); + while (cinfo.output_scanline < cinfo.output_height) { + int y = int(cinfo.output_scanline) - clip.y(); + if (y >= clip.height()) + break; // We've read the entire clip region, so abort. + + (void) jpeg_read_scanlines(&cinfo, rows, 1); + + if (y < 0) + continue; // Haven't reached the starting line yet. + + if (cinfo.output_components == 3) { + // Expand 24->32 bpp. + uchar *in = rows[0] + clip.x() * 3; + QRgb *out = (QRgb*)outImage->scanLine(y); + for (int i = 0; i < clip.width(); ++i) { + *out++ = qRgb(in[0], in[1], in[2]); + in += 3; } - } - } else { - // Load unclipped grayscale data directly into the QImage. - (void) jpeg_start_decompress(&cinfo); - while (cinfo.output_scanline < cinfo.output_height) { - uchar *row = outImage->scanLine(cinfo.output_scanline); - (void) jpeg_read_scanlines(&cinfo, &row, 1); + } else if (cinfo.out_color_space == JCS_CMYK) { + // Convert CMYK->RGB. + uchar *in = rows[0] + clip.x() * 4; + QRgb *out = (QRgb*)outImage->scanLine(y); + for (int i = 0; i < clip.width(); ++i) { + int k = in[3]; + *out++ = qRgb(k * in[0] / 255, k * in[1] / 255, + k * in[2] / 255); + in += 4; + } + } else if (cinfo.output_components == 1) { + // Grayscale. + memcpy(outImage->scanLine(y), + rows[0] + clip.x(), clip.width()); } } + } else { + // Load unclipped grayscale data directly into the QImage. + (void) jpeg_start_decompress(&cinfo); + while (cinfo.output_scanline < cinfo.output_height) { + uchar *row = outImage->scanLine(cinfo.output_scanline); + (void) jpeg_read_scanlines(&cinfo, &row, 1); + } + } - if (cinfo.output_scanline == cinfo.output_height) - (void) jpeg_finish_decompress(&cinfo); + if (cinfo.output_scanline == cinfo.output_height) + (void) jpeg_finish_decompress(&cinfo); - if (cinfo.density_unit == 1) { - outImage->setDotsPerMeterX(int(100. * cinfo.X_density / 2.54)); - outImage->setDotsPerMeterY(int(100. * cinfo.Y_density / 2.54)); - } else if (cinfo.density_unit == 2) { - outImage->setDotsPerMeterX(int(100. * cinfo.X_density)); - outImage->setDotsPerMeterY(int(100. * cinfo.Y_density)); - } + if (cinfo.density_unit == 1) { + outImage->setDotsPerMeterX(int(100. * cinfo.X_density / 2.54)); + outImage->setDotsPerMeterY(int(100. * cinfo.Y_density / 2.54)); + } else if (cinfo.density_unit == 2) { + outImage->setDotsPerMeterX(int(100. * cinfo.X_density)); + outImage->setDotsPerMeterY(int(100. * cinfo.Y_density)); + } - if (scaledSize.isValid() && scaledSize != clip.size()) - *outImage = outImage->scaled(scaledSize, Qt::IgnoreAspectRatio, Qt::FastTransformation); + if (scaledSize.isValid() && scaledSize != clip.size()) { + *outImage = outImage->scaled(scaledSize, Qt::IgnoreAspectRatio, quality >= HIGH_QUALITY_THRESHOLD ? Qt::SmoothTransformation : Qt::FastTransformation); } } -- cgit v0.12 From e47c4f7d842724921b0f4c41e4bf0abed380b0ed Mon Sep 17 00:00:00 2001 From: kh1 Date: Mon, 1 Feb 2010 15:32:55 +0100 Subject: Fix some warnings. Reviewed-by: ck --- tools/assistant/tools/assistant/main.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/assistant/tools/assistant/main.cpp b/tools/assistant/tools/assistant/main.cpp index cc76f81..77e5e7c 100644 --- a/tools/assistant/tools/assistant/main.cpp +++ b/tools/assistant/tools/assistant/main.cpp @@ -243,6 +243,9 @@ bool useGui(int argc, char *argv[]) } } } +#else + Q_UNUSED(argc) + Q_UNUSED(argv) #endif return gui; } -- cgit v0.12 From 1e52af6135f293b353d15d2436e431bac426c5fb Mon Sep 17 00:00:00 2001 From: kh1 Date: Mon, 1 Feb 2010 15:33:48 +0100 Subject: Small style cleanup. --- tools/assistant/tools/assistant/topicchooser.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tools/assistant/tools/assistant/topicchooser.cpp b/tools/assistant/tools/assistant/topicchooser.cpp index 5aafd5a..262fea8 100644 --- a/tools/assistant/tools/assistant/topicchooser.cpp +++ b/tools/assistant/tools/assistant/topicchooser.cpp @@ -62,12 +62,10 @@ TopicChooser::TopicChooser(QWidget *parent, const QString &keyword, ui.listWidget->setCurrentRow(0); ui.listWidget->setFocus(); - connect(ui.buttonDisplay, SIGNAL(clicked()), - this, SLOT(accept())); - connect(ui.buttonCancel, SIGNAL(clicked()), - this, SLOT(reject())); - connect(ui.listWidget, SIGNAL(itemActivated(QListWidgetItem*)), - this, SLOT(accept())); + connect(ui.buttonDisplay, SIGNAL(clicked()), this, SLOT(accept())); + connect(ui.buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); + connect(ui.listWidget, SIGNAL(itemActivated(QListWidgetItem*)), this, + SLOT(accept())); } QUrl TopicChooser::link() const -- cgit v0.12 From 919a8b360950718c68b4da68aeb22a402f99ae3b Mon Sep 17 00:00:00 2001 From: kh1 Date: Wed, 3 Feb 2010 13:54:51 +0100 Subject: Rewrote bookmark handling, the previous code was just plain awful. Task-number: QT-2603 Reviewed-by: ck --- tools/assistant/tools/assistant/assistant.pro | 83 +- tools/assistant/tools/assistant/bookmarkdialog.cpp | 222 +++++ tools/assistant/tools/assistant/bookmarkdialog.h | 88 ++ tools/assistant/tools/assistant/bookmarkdialog.ui | 82 +- .../tools/assistant/bookmarkfiltermodel.cpp | 322 ++++++ .../tools/assistant/bookmarkfiltermodel.h | 118 +++ tools/assistant/tools/assistant/bookmarkitem.cpp | 138 +++ tools/assistant/tools/assistant/bookmarkitem.h | 90 ++ .../assistant/tools/assistant/bookmarkmanager.cpp | 1029 ++++++-------------- tools/assistant/tools/assistant/bookmarkmanager.h | 201 ++-- tools/assistant/tools/assistant/bookmarkmodel.cpp | 426 ++++++++ tools/assistant/tools/assistant/bookmarkmodel.h | 115 +++ tools/assistant/tools/assistant/bookmarkwidget.ui | 82 ++ tools/assistant/tools/assistant/centralwidget.cpp | 2 +- tools/assistant/tools/assistant/centralwidget.h | 2 +- tools/assistant/tools/assistant/mainwindow.cpp | 170 +--- tools/assistant/tools/assistant/mainwindow.h | 29 +- tools/assistant/tools/assistant/xbelsupport.cpp | 152 ++- tools/assistant/tools/assistant/xbelsupport.h | 22 +- 19 files changed, 2174 insertions(+), 1199 deletions(-) create mode 100644 tools/assistant/tools/assistant/bookmarkdialog.cpp create mode 100644 tools/assistant/tools/assistant/bookmarkdialog.h create mode 100644 tools/assistant/tools/assistant/bookmarkfiltermodel.cpp create mode 100644 tools/assistant/tools/assistant/bookmarkfiltermodel.h create mode 100644 tools/assistant/tools/assistant/bookmarkitem.cpp create mode 100644 tools/assistant/tools/assistant/bookmarkitem.h create mode 100644 tools/assistant/tools/assistant/bookmarkmodel.cpp create mode 100644 tools/assistant/tools/assistant/bookmarkmodel.h create mode 100644 tools/assistant/tools/assistant/bookmarkwidget.ui diff --git a/tools/assistant/tools/assistant/assistant.pro b/tools/assistant/tools/assistant/assistant.pro index 980f078..e62d30c 100644 --- a/tools/assistant/tools/assistant/assistant.pro +++ b/tools/assistant/tools/assistant/assistant.pro @@ -16,64 +16,79 @@ DEPENDPATH += ../shared # ## Work around a qmake issue when statically linking to # ## not-yet-installed plugins LIBS += -L$$QT_BUILD_TREE/plugins/sqldrivers -HEADERS += helpviewer.h \ - mainwindow.h \ - indexwindow.h \ - topicchooser.h \ +HEADERS += aboutdialog.h \ + bookmarkdialog.h \ + bookmarkfiltermodel.h \ + bookmarkitem.h \ + bookmarkmanager.h \ + bookmarkmodel.h \ + centralwidget.h \ + cmdlineparser.h \ contentwindow.h \ - searchwidget.h \ - preferencesdialog.h \ filternamedialog.h \ - centralwidget.h \ + helpenginewrapper.h \ + helpviewer.h \ + indexwindow.h \ installdialog.h \ - bookmarkmanager.h \ - remotecontrol.h \ - cmdlineparser.h \ - aboutdialog.h \ + mainwindow.h \ + preferencesdialog.h \ qtdocinstaller.h \ + remotecontrol.h \ + searchwidget.h \ + topicchooser.h \ + tracer.h \ xbelsupport.h \ - ../shared/collectionconfiguration.h \ - helpenginewrapper.h \ - tracer.h + ../shared/collectionconfiguration.h win32:HEADERS += remotecontrol_win.h -SOURCES += helpviewer.cpp \ - main.cpp \ - mainwindow.cpp \ - indexwindow.cpp \ - topicchooser.cpp \ + +SOURCES += aboutdialog.cpp \ + bookmarkdialog.cpp \ + bookmarkfiltermodel.cpp \ + bookmarkitem.cpp \ + bookmarkmanager.cpp \ + bookmarkmodel.cpp \ + centralwidget.cpp \ + cmdlineparser.cpp \ contentwindow.cpp \ - searchwidget.cpp \ - preferencesdialog.cpp \ filternamedialog.cpp \ - centralwidget.cpp \ + helpenginewrapper.cpp \ + helpviewer.cpp \ + indexwindow.cpp \ installdialog.cpp \ - bookmarkmanager.cpp \ - remotecontrol.cpp \ - cmdlineparser.cpp \ - aboutdialog.cpp \ + main.cpp \ + mainwindow.cpp \ + preferencesdialog.cpp \ qtdocinstaller.cpp \ + remotecontrol.cpp \ + searchwidget.cpp \ + topicchooser.cpp \ xbelsupport.cpp \ ../shared/collectionconfiguration.cpp \ - helpenginewrapper.cpp -FORMS += topicchooser.ui \ - preferencesdialog.ui \ + +FORMS += bookmarkdialog.ui \ + bookmarkwidget.ui \ filternamedialog.ui \ installdialog.ui \ - bookmarkdialog.ui + preferencesdialog.ui \ + topicchooser.ui + RESOURCES += assistant.qrc \ assistant_images.qrc -win32 { + +win32 { !wince*:LIBS += -lshell32 RC_FILE = assistant.rc } -mac { + +mac { ICON = assistant.icns TARGET = Assistant QMAKE_INFO_PLIST = Info_mac.plist } -contains(CONFIG, static): { + +contains(CONFIG, static): { SQLPLUGINS = $$unique(sql-plugins) - contains(SQLPLUGINS, sqlite): { + contains(SQLPLUGINS, sqlite): { QTPLUGIN += qsqlite DEFINES += USE_STATIC_SQLITE_PLUGIN } diff --git a/tools/assistant/tools/assistant/bookmarkdialog.cpp b/tools/assistant/tools/assistant/bookmarkdialog.cpp new file mode 100644 index 0000000..f081c15 --- /dev/null +++ b/tools/assistant/tools/assistant/bookmarkdialog.cpp @@ -0,0 +1,222 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "tracer.h" + +#include "bookmarkdialog.h" +#include "bookmarkfiltermodel.h" +#include "bookmarkitem.h" +#include "bookmarkmodel.h" + +#include +#include + +QT_BEGIN_NAMESPACE + +BookmarkDialog::BookmarkDialog(BookmarkModel *sourceModel, const QString &title, + const QString &url, QWidget *parent) + : QDialog(parent) + , m_url(url) + , m_title(title) + , bookmarkModel(sourceModel) +{ + TRACE_OBJ + ui.setupUi(this); + + ui.bookmarkEdit->setText(m_title); + ui.newFolderButton->setVisible(false); + ui.buttonBox->button(QDialogButtonBox::Ok)->setDefault(true); + + connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(accepted())); + connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(rejected())); + connect(ui.newFolderButton, SIGNAL(clicked()), this, SLOT(addFolder())); + connect(ui.toolButton, SIGNAL(clicked()), this, SLOT(toolButtonClicked())); + connect(ui.bookmarkEdit, SIGNAL(textChanged(QString)), this, + SLOT(textChanged(QString))); + + bookmarkProxyModel = new BookmarkFilterModel(this); + bookmarkProxyModel->setSourceModel(bookmarkModel); + ui.bookmarkFolders->setModel(bookmarkProxyModel); + connect(ui.bookmarkFolders, SIGNAL(currentIndexChanged(int)), this, + SLOT(currentIndexChanged(int))); + + bookmarkTreeModel = new BookmarkTreeModel(this); + bookmarkTreeModel->setSourceModel(bookmarkModel); + ui.treeView->setModel(bookmarkTreeModel); + + ui.treeView->expandAll(); + ui.treeView->setVisible(false); + ui.treeView->installEventFilter(this); + ui.treeView->viewport()->installEventFilter(this); + ui.treeView->setContextMenuPolicy(Qt::CustomContextMenu); + + connect(ui.treeView, SIGNAL(customContextMenuRequested(QPoint)), this, + SLOT(customContextMenuRequested(QPoint))); + connect(ui.treeView->selectionModel(), SIGNAL(currentChanged(QModelIndex, + QModelIndex)), this, SLOT(currentIndexChanged(QModelIndex))); + + ui.bookmarkFolders->setCurrentIndex(0); + ui.treeView->setCurrentIndex(ui.treeView->indexAt(QPoint(2, 2))); +} + +BookmarkDialog::~BookmarkDialog() +{ + TRACE_OBJ +} + +bool BookmarkDialog::eventFilter(QObject *object, QEvent *event) +{ + TRACE_OBJ + if (object != ui.treeView && object != ui.treeView->viewport()) + return QWidget::eventFilter(object, event); + + if (event->type() == QEvent::KeyPress) { + QKeyEvent *ke = static_cast(event); + switch (ke->key()) { + case Qt::Key_F2: { + bookmarkModel->setItemsEditable(true); + ui.treeView->edit(ui.treeView->currentIndex()); + bookmarkModel->setItemsEditable(false); + } break; + default: break; + } + } + + return QObject::eventFilter(object, event); +} + +void BookmarkDialog::currentIndexChanged(int row) +{ + TRACE_OBJ + QModelIndex next = bookmarkProxyModel->index(row, 0, QModelIndex()); + if (next.isValid()) { + next = bookmarkProxyModel->mapToSource(next); + ui.treeView->setCurrentIndex(bookmarkTreeModel->mapFromSource(next)); + } +} + +void BookmarkDialog::currentIndexChanged(const QModelIndex &index) +{ + TRACE_OBJ + const QModelIndex current = bookmarkTreeModel->mapToSource(index); + if (current.isValid()) { + const int row = bookmarkProxyModel->mapFromSource(current).row(); + ui.bookmarkFolders->setCurrentIndex(row); + } +} + +void BookmarkDialog::accepted() +{ + TRACE_OBJ + QModelIndex index = ui.treeView->currentIndex(); + if (index.isValid()) { + index = bookmarkModel->addItem(bookmarkTreeModel->mapToSource(index)); + if (BookmarkItem *item = bookmarkModel->itemFromIndex(index)) + item->setData(DataVector() << m_title << m_url << false); + } else + rejected(); + + accept(); +} + +void BookmarkDialog::rejected() +{ + TRACE_OBJ + foreach (const QPersistentModelIndex &index, cache) + bookmarkModel->removeItem(index); + reject(); +} + +void BookmarkDialog::addFolder() +{ + TRACE_OBJ + QModelIndex index = ui.treeView->currentIndex(); + if (index.isValid()) { + index = bookmarkModel->addItem(bookmarkTreeModel->mapToSource(index), + true); + cache.append(index); + + index = bookmarkTreeModel->mapFromSource(index); + if (index.isValid()) { + bookmarkModel->setItemsEditable(true); + ui.treeView->edit(index); + ui.treeView->expand(index); + ui.treeView->setCurrentIndex(index); + bookmarkModel->setItemsEditable(false); + } + } +} + +void BookmarkDialog::toolButtonClicked() +{ + TRACE_OBJ + const bool visible = !ui.treeView->isVisible(); + ui.treeView->setVisible(visible); + ui.newFolderButton->setVisible(visible); + + if (visible) { + resize(QSize(width(), 400)); + ui.toolButton->setText(QLatin1String("-")); + } else { + resize(width(), minimumHeight()); + ui.toolButton->setText(QLatin1String("+")); + } +} + +void BookmarkDialog::textChanged(const QString& text) +{ + m_title = text; +} + +void BookmarkDialog::customContextMenuRequested(const QPoint &point) +{ + TRACE_OBJ + QMenu menu(QLatin1String(""), this); + QAction *renameItem = menu.addAction(tr("Rename Folder")); + + QAction *picked = menu.exec(ui.treeView->mapToGlobal(point)); + if (picked == renameItem) { + bookmarkModel->setItemsEditable(true); + ui.treeView->edit(ui.treeView->currentIndex()); + bookmarkModel->setItemsEditable(false); + } +} + +QT_END_NAMESPACE diff --git a/tools/assistant/tools/assistant/bookmarkdialog.h b/tools/assistant/tools/assistant/bookmarkdialog.h new file mode 100644 index 0000000..ba38c7a --- /dev/null +++ b/tools/assistant/tools/assistant/bookmarkdialog.h @@ -0,0 +1,88 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef BOOKMARKDIALOG_H +#define BOOKMARKDIALOG_H + +#include "ui_bookmarkdialog.h" + +QT_BEGIN_NAMESPACE + +class BookmarkModel; +class BookmarkFilterModel; +class BookmarkTreeModel; + +class BookmarkDialog : public QDialog +{ + Q_OBJECT +public: + BookmarkDialog(BookmarkModel *bookmarkModel, const QString &title, + const QString &url, QWidget *parent = 0); + ~BookmarkDialog(); + +private: + bool eventFilter(QObject *object, QEvent *event); + +private slots: + void currentIndexChanged(int index); + void currentIndexChanged(const QModelIndex &index); + + void accepted(); + void rejected(); + + void addFolder(); + void toolButtonClicked(); + void textChanged(const QString& text); + void customContextMenuRequested(const QPoint &point); + +private: + QString m_url; + QString m_title; + Ui::BookmarkDialog ui; + QList cache; + + BookmarkModel *bookmarkModel; + BookmarkTreeModel *bookmarkTreeModel; + BookmarkFilterModel *bookmarkProxyModel; +}; + +QT_END_NAMESPACE + +#endif // BOOKMARKDIALOG_H diff --git a/tools/assistant/tools/assistant/bookmarkdialog.ui b/tools/assistant/tools/assistant/bookmarkdialog.ui index 7a878f9..5131531 100644 --- a/tools/assistant/tools/assistant/bookmarkdialog.ui +++ b/tools/assistant/tools/assistant/bookmarkdialog.ui @@ -1,38 +1,39 @@ - + + BookmarkDialog - - + + 0 0 450 - 135 + 133 - - + + 0 0 - + Add Bookmark - + - + - + - - + + Bookmark: - - + + Add in Folder: @@ -40,35 +41,35 @@ - + - + - + - + - - + + 25 20 - + + - - + + Qt::Horizontal @@ -76,30 +77,39 @@ - - - + + + 0 0 + + true + + + true + + + true + - + - - + + New Folder - - + + Qt::Horizontal - + QDialogButtonBox::Cancel|QDialogButtonBox::Ok @@ -116,11 +126,11 @@ BookmarkDialog accept() - + 248 254 - + 157 274 @@ -132,11 +142,11 @@ BookmarkDialog reject() - + 316 260 - + 286 274 diff --git a/tools/assistant/tools/assistant/bookmarkfiltermodel.cpp b/tools/assistant/tools/assistant/bookmarkfiltermodel.cpp new file mode 100644 index 0000000..5874493 --- /dev/null +++ b/tools/assistant/tools/assistant/bookmarkfiltermodel.cpp @@ -0,0 +1,322 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "bookmarkfiltermodel.h" + +#include "bookmarkitem.h" +#include "bookmarkmodel.h" + +BookmarkFilterModel::BookmarkFilterModel(QObject *parent) + : QAbstractProxyModel(parent) + , hideBookmarks(true) + , sourceModel(0) +{ +} + +void +BookmarkFilterModel::setSourceModel(QAbstractItemModel *_sourceModel) +{ + beginResetModel(); + + QAbstractProxyModel::setSourceModel(sourceModel); + sourceModel = qobject_cast (_sourceModel); + + connect(sourceModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, + SLOT(changed(QModelIndex, QModelIndex))); + + connect(sourceModel, SIGNAL(rowsInserted(QModelIndex, int, int)), + this, SLOT(rowsInserted(QModelIndex, int, int))); + + connect(sourceModel, SIGNAL(rowsAboutToBeRemoved(QModelIndex, int, int)), + this, SLOT(rowsAboutToBeRemoved(QModelIndex, int, int))); + connect(sourceModel, SIGNAL(rowsRemoved(QModelIndex, int, int)), this, + SLOT(rowsRemoved(QModelIndex, int, int))); + + connect(sourceModel, SIGNAL(layoutAboutToBeChanged()), this, + SLOT(layoutAboutToBeChanged())); + connect(sourceModel, SIGNAL(layoutChanged()), this, + SLOT(layoutChanged())); + + connect(sourceModel, SIGNAL(modelAboutToBeReset()), this, + SLOT(modelAboutToBeReset())); + connect(sourceModel, SIGNAL(modelReset()), this, SLOT(modelReset())); + + if (sourceModel) + setupCache(sourceModel->index(0, 0, QModelIndex())); + + endResetModel(); +} + +int +BookmarkFilterModel::rowCount(const QModelIndex &index) const +{ + Q_UNUSED(index) + return cache.count(); +} + +int +BookmarkFilterModel::columnCount(const QModelIndex &index) const +{ + Q_UNUSED(index) + if (sourceModel) + return sourceModel->columnCount(); + return 0; +} + +QModelIndex +BookmarkFilterModel::mapToSource(const QModelIndex &proxyIndex) const +{ + const int row = proxyIndex.row(); + if (proxyIndex.isValid() && row >= 0 && row < cache.count()) + return cache[row]; + return QModelIndex(); +} + +QModelIndex +BookmarkFilterModel::mapFromSource(const QModelIndex &sourceIndex) const +{ + return index(cache.indexOf(sourceIndex), 0, QModelIndex()); +} + +QModelIndex +BookmarkFilterModel::parent(const QModelIndex &child) const +{ + Q_UNUSED(child) + return QModelIndex(); +} + +QModelIndex +BookmarkFilterModel::index(int row, int column, const QModelIndex &index) const +{ + Q_UNUSED(index) + if (row < 0 || column < 0 || cache.count() <= row + || !sourceModel || sourceModel->columnCount() <= column) { + return QModelIndex(); + } + return createIndex(row, 0); +} + +Qt::DropActions +BookmarkFilterModel::supportedDropActions () const +{ + if (sourceModel) + return sourceModel->supportedDropActions(); + return Qt::IgnoreAction; +} + +Qt::ItemFlags +BookmarkFilterModel::flags(const QModelIndex &index) const +{ + if (sourceModel) + return sourceModel->flags(index); + return Qt::NoItemFlags; +} + +QVariant +BookmarkFilterModel::data(const QModelIndex &index, int role) const +{ + if (sourceModel) + return sourceModel->data(mapToSource(index), role); + return QVariant(); +} + +bool +BookmarkFilterModel::setData(const QModelIndex &index, const QVariant &value, + int role) +{ + if (sourceModel) + return sourceModel->setData(mapToSource(index), value, role); + return false; +} + +void +BookmarkFilterModel::filterBookmarks() +{ + if (sourceModel) { + beginResetModel(); + hideBookmarks = true; + setupCache(sourceModel->index(0, 0, QModelIndex())); + endResetModel(); + } +} + +void +BookmarkFilterModel::filterBookmarkFolders() +{ + if (sourceModel) { + beginResetModel(); + hideBookmarks = false; + setupCache(sourceModel->index(0, 0, QModelIndex())); + endResetModel(); + } +} + +void +BookmarkFilterModel::changed(const QModelIndex &topLeft, + const QModelIndex &bottomRight) +{ + emit dataChanged(mapFromSource(topLeft), mapFromSource(bottomRight)); +} + +void +BookmarkFilterModel::rowsInserted(const QModelIndex &parent, int start, int end) +{ + if (!sourceModel) + return; + + QModelIndex cachePrevious = parent; + if (BookmarkItem *parentItem = sourceModel->itemFromIndex(parent)) { + BookmarkItem *newItem = parentItem->child(start); + + // iterate over tree hirarchie to find the previous folder + for (int i = 0; i < parentItem->childCount(); ++i) { + if (BookmarkItem *child = parentItem->child(i)) { + const QModelIndex &tmp = sourceModel->indexFromItem(child); + if (tmp.data(UserRoleFolder).toBool() && child != newItem) + cachePrevious = tmp; + } + } + + const QModelIndex &newIndex = sourceModel->indexFromItem(newItem); + const bool isFolder = newIndex.data(UserRoleFolder).toBool(); + if ((isFolder && hideBookmarks) || (!isFolder && !hideBookmarks)) { + beginInsertRows(mapFromSource(parent), start, end); + cache.insert(cache.indexOf(cachePrevious) + 1, newIndex); + endInsertRows(); + } + } +} + +void +BookmarkFilterModel::rowsAboutToBeRemoved(const QModelIndex &parent, int start, + int end) +{ + if (!sourceModel) + return; + + if (BookmarkItem *parentItem = sourceModel->itemFromIndex(parent)) { + if (BookmarkItem *child = parentItem->child(start)) { + indexToRemove = sourceModel->indexFromItem(child); + if (cache.contains(indexToRemove)) + beginRemoveRows(mapFromSource(parent), start, end); + } + } +} + +void +BookmarkFilterModel::rowsRemoved(const QModelIndex &/*parent*/, int, int) +{ + if (cache.contains(indexToRemove)) { + cache.removeAll(indexToRemove); + endRemoveRows(); + } +} + +void +BookmarkFilterModel::layoutAboutToBeChanged() +{ + // TODO: ??? +} + +void +BookmarkFilterModel::layoutChanged() +{ + // TODO: ??? +} + +void +BookmarkFilterModel::modelAboutToBeReset() +{ + beginResetModel(); +} + +void +BookmarkFilterModel::modelReset() +{ + if (sourceModel) + setupCache(sourceModel->index(0, 0, QModelIndex())); + endResetModel(); +} + +void +BookmarkFilterModel::setupCache(const QModelIndex &parent) +{ + cache.clear(); + collectItems(parent); +} + +void +BookmarkFilterModel::collectItems(const QModelIndex &parent) +{ + if (parent.isValid()) { + bool isFolder = sourceModel->data(parent, UserRoleFolder).toBool(); + if ((isFolder && hideBookmarks) || (!isFolder && !hideBookmarks)) + cache.append(parent); + + if (sourceModel->hasChildren(parent)) { + for (int i = 0; i < sourceModel->rowCount(parent); ++i) + collectItems(sourceModel->index(i, 0, parent)); + } + } +} + +// -- BookmarkTreeModel + +BookmarkTreeModel::BookmarkTreeModel(QObject *parent) + : QSortFilterProxyModel(parent) +{ +} + +int +BookmarkTreeModel::columnCount(const QModelIndex &parent) const +{ + return qMin(1, QSortFilterProxyModel::columnCount(parent)); +} + +bool +BookmarkTreeModel::filterAcceptsRow(int row, const QModelIndex &parent) const +{ + Q_UNUSED(row) + BookmarkModel *model = qobject_cast (sourceModel()); + if (model->rowCount(parent) > 0 + && model->data(model->index(row, 0, parent), UserRoleFolder).toBool()) + return true; + return false; +} \ No newline at end of file diff --git a/tools/assistant/tools/assistant/bookmarkfiltermodel.h b/tools/assistant/tools/assistant/bookmarkfiltermodel.h new file mode 100644 index 0000000..4ea7ab9 --- /dev/null +++ b/tools/assistant/tools/assistant/bookmarkfiltermodel.h @@ -0,0 +1,118 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef BOOKMARKFILTERMODEL_H +#define BOOKMARKFILTERMODEL_H + +#include + +#include +#include + +QT_BEGIN_NAMESPACE + +class BookmarkItem; +class BookmarkModel; + +typedef QList PersistentModelIndexCache; + +class BookmarkFilterModel : public QAbstractProxyModel +{ + Q_OBJECT +public: + explicit BookmarkFilterModel(QObject *parent = 0); + + void setSourceModel(QAbstractItemModel *sourceModel); + + int rowCount(const QModelIndex &index) const; + int columnCount(const QModelIndex &index) const; + + QModelIndex mapToSource(const QModelIndex &proxyIndex) const; + QModelIndex mapFromSource(const QModelIndex &sourceIndex) const; + + QModelIndex parent(const QModelIndex &child) const; + QModelIndex index(int row, int column, const QModelIndex &parent) const; + + Qt::DropActions supportedDropActions () const; + Qt::ItemFlags flags(const QModelIndex &index) const; + + QVariant data(const QModelIndex &index, int role) const; + bool setData(const QModelIndex &index, const QVariant &value, int role); + + void filterBookmarks(); + void filterBookmarkFolders(); + +private slots: + void changed(const QModelIndex &topLeft, const QModelIndex &bottomRight); + void rowsInserted(const QModelIndex &parent, int start, int end); + void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end); + void rowsRemoved(const QModelIndex &parent, int start, int end); + void layoutAboutToBeChanged(); + void layoutChanged(); + void modelAboutToBeReset(); + void modelReset(); + +private: + void setupCache(const QModelIndex &parent); + void collectItems(const QModelIndex &parent); + +private: + bool hideBookmarks; + BookmarkModel *sourceModel; + PersistentModelIndexCache cache; + QPersistentModelIndex indexToRemove; +}; + +// -- BookmarkTreeModel + +class BookmarkTreeModel : public QSortFilterProxyModel +{ + Q_OBJECT +public: + BookmarkTreeModel(QObject *parent = 0); + int columnCount(const QModelIndex &parent = QModelIndex()) const; + +protected: + bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const; +}; + +QT_END_NAMESPACE + +#endif // BOOKMARKFILTERMODEL_H diff --git a/tools/assistant/tools/assistant/bookmarkitem.cpp b/tools/assistant/tools/assistant/bookmarkitem.cpp new file mode 100644 index 0000000..082ffce --- /dev/null +++ b/tools/assistant/tools/assistant/bookmarkitem.cpp @@ -0,0 +1,138 @@ +#include "bookmarkitem.h" + +#include + +QT_BEGIN_NAMESPACE + +BookmarkItem::BookmarkItem(const DataVector &data, BookmarkItem *parent) + : m_data(data) + , m_parent(parent) +{ +} + +BookmarkItem::~BookmarkItem() +{ + qDeleteAll(m_children); +} + +BookmarkItem* +BookmarkItem::parent() const +{ + return m_parent; +} + +void +BookmarkItem::setParent(BookmarkItem *parent) +{ + m_parent = parent; +} + +void +BookmarkItem::addChild(BookmarkItem *child) +{ + child->setParent(this); + m_children.append(child); +} + +BookmarkItem* +BookmarkItem::child(int number) const +{ + if (number >= 0 && number < m_children.count()) + return m_children[number]; + return 0; +} + +int BookmarkItem::childCount() const +{ + return m_children.count(); +} + +int BookmarkItem::childNumber() const +{ + if (m_parent) + return m_parent->m_children.indexOf(const_cast(this)); + return 0; +} + +QVariant +BookmarkItem::data(int column) const +{ + if (column == 0) + return m_data[0]; + + if (column == 1 || column == UserRoleUrl) + return m_data[1]; + + if (column == UserRoleFolder) + return m_data[1].toString() == QLatin1String("Folder"); + + if (column == UserRoleExpanded) + return m_data[2]; + + return QVariant(); +} + +void +BookmarkItem::setData(const DataVector &data) +{ + m_data = data; +} + +bool +BookmarkItem::setData(int column, const QVariant &newValue) +{ + int index = -1; + if (column == 0 || column == 1) + index = column; + + if (column == UserRoleUrl || column == UserRoleFolder) + index = 1; + + if (column == UserRoleExpanded) + index = 2; + + if (index < 0) + return false; + + m_data[index] = newValue; + return true; +} + +bool +BookmarkItem::insertChildren(bool isFolder, int position, int count) +{ + if (position < 0 || position > m_children.size()) + return false; + + for (int row = 0; row < count; ++row) { + m_children.insert(position, new BookmarkItem(DataVector() + << QObject::tr(isFolder ? "New Folder" : "Untitled") + << (isFolder ? "Folder" : "about:blank") << false, this)); + } + + return true; +} + +bool +BookmarkItem::removeChildren(int position, int count) +{ + if (position < 0 || position > m_children.size()) + return false; + + for (int row = 0; row < count; ++row) + delete m_children.takeAt(position); + + return true; +} + +void +BookmarkItem::dumpTree(int indent) const +{ + const QString tree(indent, ' '); + qDebug() << tree + (data(UserRoleFolder).toBool() ? "Folder" : "Bookmark") + << "Label:" << data(0).toString() << "parent:" << m_parent << "this:" + << this; + + foreach (BookmarkItem *item, m_children) + item->dumpTree(indent + 4); +} diff --git a/tools/assistant/tools/assistant/bookmarkitem.h b/tools/assistant/tools/assistant/bookmarkitem.h new file mode 100644 index 0000000..be77e24 --- /dev/null +++ b/tools/assistant/tools/assistant/bookmarkitem.h @@ -0,0 +1,90 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef BOOKMARKITEM_H +#define BOOKMARKITEM_H + +#include +#include + +QT_BEGIN_NAMESPACE + +enum { + UserRoleUrl = Qt::UserRole + 50, + UserRoleFolder = Qt::UserRole + 100, + UserRoleExpanded = Qt::UserRole + 150 +}; + +typedef QVector DataVector; + +class BookmarkItem +{ +public: + BookmarkItem(const DataVector &data, BookmarkItem *parent = 0); + ~BookmarkItem(); + + BookmarkItem *parent() const; + void setParent(BookmarkItem *parent); + + void addChild(BookmarkItem *child); + BookmarkItem *child(int number) const; + + int childCount() const; + int childNumber() const; + + QVariant data(int column) const; + void setData(const DataVector &data); + bool setData(int column, const QVariant &value); + + bool insertChildren(bool isFolder, int position, int count); + bool removeChildren(int position, int count); + + void dumpTree(int indent) const; + +private: + DataVector m_data; + + BookmarkItem *m_parent; + QList m_children; +}; + +QT_END_NAMESPACE + +#endif // BOOKMARKITEM_H diff --git a/tools/assistant/tools/assistant/bookmarkmanager.cpp b/tools/assistant/tools/assistant/bookmarkmanager.cpp index b7bd449..8fba811 100644 --- a/tools/assistant/tools/assistant/bookmarkmanager.cpp +++ b/tools/assistant/tools/assistant/bookmarkmanager.cpp @@ -41,575 +41,207 @@ #include "tracer.h" #include "bookmarkmanager.h" +#include "bookmarkdialog.h" +#include "bookmarkfiltermodel.h" +#include "bookmarkitem.h" +#include "bookmarkmodel.h" #include "centralwidget.h" #include "helpenginewrapper.h" +#include #include -#include -#include -#include -#include -#include -#include #include -#include #include -#include -#include -#include -#include -#include #include -QT_BEGIN_NAMESPACE - -BookmarkDialog::BookmarkDialog(BookmarkManager *manager, const QString &title, - const QString &url, QWidget *parent) - : QDialog(parent) - , m_url(url) - , m_title(title) - , bookmarkManager(manager) -{ - TRACE_OBJ - ui.setupUi(this); - - installEventFilter(this); - ui.treeView->installEventFilter(this); - ui.treeView->viewport()->installEventFilter(this); - - ui.bookmarkEdit->setText(title); - ui.newFolderButton->setVisible(false); - ui.buttonBox->button(QDialogButtonBox::Ok)->setDefault(true); - ui.bookmarkFolders->addItems(bookmarkManager->bookmarkFolders()); - - proxyModel = new QSortFilterProxyModel(this); - proxyModel->setFilterKeyColumn(0); - proxyModel->setDynamicSortFilter(true); - proxyModel->setFilterRole(Qt::UserRole + 10); - proxyModel->setSourceModel(bookmarkManager->treeBookmarkModel()); - proxyModel->setFilterRegExp(QRegExp(QLatin1String("Folder"), - Qt::CaseSensitive, QRegExp::FixedString)); - ui.treeView->setModel(proxyModel); - - ui.treeView->expandAll(); - ui.treeView->setVisible(false); - ui.treeView->header()->setVisible(false); - ui.treeView->setContextMenuPolicy(Qt::CustomContextMenu); - - connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(reject())); - connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(addAccepted())); - connect(ui.newFolderButton, SIGNAL(clicked()), this, SLOT(addNewFolder())); - connect(ui.toolButton, SIGNAL(clicked()), this, SLOT(toolButtonClicked())); - connect(ui.bookmarkEdit, SIGNAL(textChanged(QString)), this, - SLOT(textChanged(QString))); - - connect(bookmarkManager->treeBookmarkModel(), - SIGNAL(itemChanged(QStandardItem*)), - this, SLOT(itemChanged(QStandardItem*))); - - connect(ui.bookmarkFolders, SIGNAL(currentIndexChanged(QString)), this, - SLOT(selectBookmarkFolder(QString))); +#include +#include "xbelsupport.h" - connect(ui.treeView, SIGNAL(customContextMenuRequested(QPoint)), this, - SLOT(customContextMenuRequested(QPoint))); +QT_BEGIN_NAMESPACE - connect(ui.treeView->selectionModel(), SIGNAL(currentChanged(QModelIndex, - QModelIndex)), this, SLOT(currentChanged(QModelIndex))); -} +// -- BookmarkManager::BookmarkWidget -BookmarkDialog::~BookmarkDialog() +void BookmarkManager::BookmarkWidget::focusInEvent(QFocusEvent *event) { TRACE_OBJ -} + if (event->reason() != Qt::MouseFocusReason) { + ui.lineEdit->selectAll(); + ui.lineEdit->setFocus(); -void BookmarkDialog::addAccepted() -{ - TRACE_OBJ - QItemSelectionModel *model = ui.treeView->selectionModel(); - const QModelIndexList &list = model->selection().indexes(); - - QModelIndex index; - if (!list.isEmpty()) - index = proxyModel->mapToSource(list.at(0)); - - bookmarkManager->addNewBookmark(index, ui.bookmarkEdit->text(), m_url); - accept(); -} - -void BookmarkDialog::addNewFolder() -{ - TRACE_OBJ - QItemSelectionModel *model = ui.treeView->selectionModel(); - const QModelIndexList &list = model->selection().indexes(); - - QModelIndex index; - if (!list.isEmpty()) - index = list.at(0); - - QModelIndex newFolder = - bookmarkManager->addNewFolder(proxyModel->mapToSource(index)); - if (newFolder.isValid()) { - ui.treeView->expand(index); - const QModelIndex &index = proxyModel->mapFromSource(newFolder); - model->setCurrentIndex(index, QItemSelectionModel::ClearAndSelect); - - ui.bookmarkFolders->clear(); - ui.bookmarkFolders->addItems(bookmarkManager->bookmarkFolders()); - - const QString &name = index.data().toString(); - ui.bookmarkFolders->setCurrentIndex(ui.bookmarkFolders->findText(name)); - renameFolder(index, newFolder); + // force the focus in event on bookmark manager + emit focusInEvent(); } } -void BookmarkDialog::toolButtonClicked() -{ - TRACE_OBJ - bool visible = !ui.treeView->isVisible(); - ui.treeView->setVisible(visible); - ui.newFolderButton->setVisible(visible); - - if (visible) { - resize(QSize(width(), 400)); - ui.toolButton->setText(QLatin1String("-")); - } else { - resize(width(), minimumHeight()); - ui.toolButton->setText(QLatin1String("+")); - } -} +// -- BookmarkManager::BookmarkTreeView -void BookmarkDialog::itemChanged(QStandardItem *item) +BookmarkManager::BookmarkTreeView::BookmarkTreeView(QWidget *parent) + : QTreeView(parent) { TRACE_OBJ - if (renameItem != item) { - renameItem = item; - oldText = item->text(); - return; - } + setAcceptDrops(true); + setDragEnabled(true); + setAutoExpandDelay(1000); + setUniformRowHeights(true); + setDropIndicatorShown(true); + setExpandsOnDoubleClick(true); - if (item->text() != oldText) { - ui.bookmarkFolders->clear(); - ui.bookmarkFolders->addItems(bookmarkManager->bookmarkFolders()); + connect(this, SIGNAL(expanded(QModelIndex)), this, + SLOT(setExpandedData(QModelIndex))); + connect(this, SIGNAL(collapsed(QModelIndex)), this, + SLOT(setExpandedData(QModelIndex))); - QString name = tr("Bookmarks"); - const QModelIndex &index = ui.treeView->currentIndex(); - if (index.isValid()) - name = index.data().toString(); - ui.bookmarkFolders->setCurrentIndex(ui.bookmarkFolders->findText(name)); - } } -void BookmarkDialog::textChanged(const QString &string) +void BookmarkManager::BookmarkTreeView::subclassKeyPressEvent(QKeyEvent *event) { TRACE_OBJ - ui.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(!string.isEmpty()); + QTreeView::keyPressEvent(event); } -void BookmarkDialog::selectBookmarkFolder(const QString &folderName) +void BookmarkManager::BookmarkTreeView::setExpandedData(const QModelIndex &index) { TRACE_OBJ - if (folderName.isEmpty()) - return; - - if (folderName == tr("Bookmarks")) { - ui.treeView->clearSelection(); - return; - } - - QStandardItemModel *model = bookmarkManager->treeBookmarkModel(); - QList list = model->findItems(folderName, - Qt::MatchCaseSensitive | Qt::MatchRecursive, 0); - if (!list.isEmpty()) { - const QModelIndex &index = model->indexFromItem(list.at(0)); - QItemSelectionModel *model = ui.treeView->selectionModel(); - if (model) { - model->setCurrentIndex(proxyModel->mapFromSource(index), - QItemSelectionModel::ClearAndSelect); - } - } + if (BookmarkModel *treeModel = qobject_cast (model())) + treeModel->setData(index, isExpanded(index), UserRoleExpanded); } -void BookmarkDialog::customContextMenuRequested(const QPoint &point) -{ - TRACE_OBJ - QModelIndex index = ui.treeView->indexAt(point); - if (!index.isValid()) - return; - - QMenu menu(QLatin1String(""), this); +// -- BookmarkManager - QAction *removeItem = menu.addAction(tr("Delete Folder")); - QAction *renameItem = menu.addAction(tr("Rename Folder")); +QMutex BookmarkManager::mutex; +BookmarkManager* BookmarkManager::bookmarkManager = 0; - QAction *picked = menu.exec(ui.treeView->mapToGlobal(point)); - if (!picked) - return; - - const QModelIndex &proxyIndex = proxyModel->mapToSource(index); - if (picked == removeItem) { - bookmarkManager->removeBookmarkItem(ui.treeView, proxyIndex); - ui.bookmarkFolders->clear(); - ui.bookmarkFolders->addItems(bookmarkManager->bookmarkFolders()); - - QString name = tr("Bookmarks"); - index = ui.treeView->currentIndex(); - if (index.isValid()) - name = index.data().toString(); - ui.bookmarkFolders->setCurrentIndex(ui.bookmarkFolders->findText(name)); - } else if (picked == renameItem) { - renameFolder(index, proxyIndex); - } -} +// -- public -void BookmarkDialog::renameFolder(const QModelIndex &index, - const QModelIndex &proxyIndex) +BookmarkManager* BookmarkManager::instance() { TRACE_OBJ - const BookmarkModel * const model = bookmarkManager->treeBookmarkModel(); - if (QStandardItem *item = model->itemFromIndex(proxyIndex)) { - item->setEditable(true); - ui.treeView->edit(index); - item->setEditable(false); + if (!bookmarkManager) { + QMutexLocker _(&mutex); + if (!bookmarkManager) + bookmarkManager = new BookmarkManager(); } + return bookmarkManager; } -void BookmarkDialog::currentChanged(const QModelIndex ¤t) +void BookmarkManager::destroy() { TRACE_OBJ - QString text = tr("Bookmarks"); - if (current.isValid()) - text = current.data().toString(); - ui.bookmarkFolders->setCurrentIndex(ui.bookmarkFolders->findText(text)); + delete bookmarkManager; + bookmarkManager = 0; } -bool BookmarkDialog::eventFilter(QObject *object, QEvent *e) +QWidget* BookmarkManager::bookmarkDockWidget() const { TRACE_OBJ - if (object != ui.treeView && object != ui.treeView->viewport()) - return QWidget::eventFilter(object, e); - - if (e->type() == QEvent::KeyPress) { - QKeyEvent *ke = static_cast(e); - switch (ke->key()) { - case Qt::Key_F2: { - const QModelIndex &index = ui.treeView->currentIndex(); - const QModelIndex &source = proxyModel->mapToSource(index); - QStandardItem *item = - bookmarkManager->treeBookmarkModel()->itemFromIndex(source); - if (item) { - item->setEditable(true); - ui.treeView->edit(index); - item->setEditable(false); - } - } break; - - case Qt::Key_Delete: { - const QModelIndex &index = ui.treeView->currentIndex(); - bookmarkManager->removeBookmarkItem(ui.treeView, - proxyModel->mapToSource(index)); - ui.bookmarkFolders->clear(); - ui.bookmarkFolders->addItems(bookmarkManager->bookmarkFolders()); - - QString name = tr("Bookmarks"); - if (index.isValid()) - name = index.data().toString(); - ui.bookmarkFolders->setCurrentIndex(ui.bookmarkFolders->findText(name)); - } break; - - default: - break; - } - } - - return QObject::eventFilter(object, e); + if (bookmarkWidget) + return bookmarkWidget; + return 0; } - -// BookmarkWidget - - -BookmarkWidget::BookmarkWidget(BookmarkManager *manager, QWidget *parent, - bool showButtons) - : QWidget(parent) - , addButton(0) - , removeButton(0) - , bookmarkManager(manager) +void BookmarkManager::takeBookmarksMenu(QMenu* menu) { TRACE_OBJ - setup(showButtons); - - installEventFilter(this); - treeView->installEventFilter(this); - treeView->viewport()->installEventFilter(this); + bookmarkMenu = menu; + refeshBookmarkMenu(); } -BookmarkWidget::~BookmarkWidget() -{ - TRACE_OBJ -} +// -- public slots -void BookmarkWidget::removeClicked() +void BookmarkManager::addBookmark(const QString &title, const QString &url) { TRACE_OBJ - const QModelIndex &index = treeView->currentIndex(); - if (searchField->text().isEmpty()) { - bookmarkManager->removeBookmarkItem(treeView, - filterBookmarkModel->mapToSource(index)); - } + showBookmarkDialog(title.isEmpty() ? tr("Untiled") : title, + url.isEmpty() ? QLatin1String("about:blank") : url); } -void BookmarkWidget::filterChanged() -{ - TRACE_OBJ - bool searchBookmarks = searchField->text().isEmpty(); - if (!searchBookmarks) { - regExp.setPattern(searchField->text()); - filterBookmarkModel->setSourceModel(bookmarkManager->listBookmarkModel()); - } else { - regExp.setPattern(QLatin1String("")); - filterBookmarkModel->setSourceModel(bookmarkManager->treeBookmarkModel()); - } - - if (addButton) - addButton->setEnabled(searchBookmarks); - - if (removeButton) - removeButton->setEnabled(searchBookmarks); - - filterBookmarkModel->setFilterRegExp(regExp); +// -- private - const QModelIndex &index = treeView->indexAt(QPoint(1, 1)); - if (index.isValid()) - treeView->setCurrentIndex(index); - - if (searchBookmarks) - expandItems(); -} +BookmarkManager::BookmarkManager() + : typeAndSearch(false) + , bookmarkMenu(0) + , bookmarkModel(new BookmarkModel) + , bookmarkWidget(new BookmarkWidget) + , bookmarkTreeView(new BookmarkTreeView) +{ + TRACE_OBJ + bookmarkWidget->installEventFilter(this); + connect(bookmarkWidget->ui.add, SIGNAL(clicked()), this, + SLOT(addBookmark())); + connect(bookmarkWidget->ui.remove, SIGNAL(clicked()), this, + SLOT(removeBookmark())); + connect(bookmarkWidget->ui.lineEdit, SIGNAL(textChanged(QString)), this, + SLOT(textChanged(QString))); + connect(bookmarkWidget, SIGNAL(focusInEvent()), this, SLOT(focusInEvent())); -void BookmarkWidget::expand(const QModelIndex &index) -{ - TRACE_OBJ - const QModelIndex &source = filterBookmarkModel->mapToSource(index); - QStandardItem *item = - bookmarkManager->treeBookmarkModel()->itemFromIndex(source); - if (item) - item->setData(treeView->isExpanded(index), Qt::UserRole + 11); -} + bookmarkTreeView->setModel(bookmarkModel); + bookmarkTreeView->installEventFilter(this); + bookmarkTreeView->viewport()->installEventFilter(this); + bookmarkTreeView->setContextMenuPolicy(Qt::CustomContextMenu); + bookmarkWidget->ui.stackedWidget->addWidget(bookmarkTreeView); -void BookmarkWidget::activated(const QModelIndex &index) -{ - TRACE_OBJ - if (!index.isValid()) - return; + connect(bookmarkTreeView, SIGNAL(activated(QModelIndex)), this, + SLOT(setSourceFromIndex(QModelIndex))); + connect(bookmarkTreeView, SIGNAL(customContextMenuRequested(QPoint)), this, + SLOT(customContextMenuRequested(QPoint))); - QString data = index.data(Qt::UserRole + 10).toString(); - if (data != QLatin1String("Folder")) - emit requestShowLink(data); + connect(&HelpEngineWrapper::instance(), SIGNAL(setupFinished()), this, + SLOT(setupFinished())); + connect(bookmarkModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, + SLOT(refeshBookmarkMenu())); } -void BookmarkWidget::customContextMenuRequested(const QPoint &point) +BookmarkManager::~BookmarkManager() { TRACE_OBJ - QModelIndex index = treeView->indexAt(point); - if (!index.isValid()) - return; - - QAction *showItem = 0; - QAction *removeItem = 0; - QAction *renameItem = 0; - QAction *showItemNewTab = 0; - - QMenu menu(QLatin1String(""), this); - QString data = index.data(Qt::UserRole + 10).toString(); - if (data == QLatin1String("Folder")) { - removeItem = menu.addAction(tr("Delete Folder")); - renameItem = menu.addAction(tr("Rename Folder")); - } else { - showItem = menu.addAction(tr("Show Bookmark")); - showItemNewTab = menu.addAction(tr("Show Bookmark in New Tab")); - if (searchField->text().isEmpty()) { - menu.addSeparator(); - removeItem = menu.addAction(tr("Delete Bookmark")); - renameItem = menu.addAction(tr("Rename Bookmark")); - } - } - - QAction *pickedAction = menu.exec(treeView->mapToGlobal(point)); - if (!pickedAction) - return; - - if (pickedAction == showItem) { - emit requestShowLink(data); - } - else if (pickedAction == showItemNewTab) { - CentralWidget::instance()->setSourceInNewTab(data); - } - else if (pickedAction == removeItem) { - bookmarkManager->removeBookmarkItem(treeView, - filterBookmarkModel->mapToSource(index)); - } - else if (pickedAction == renameItem) { - const QModelIndex &source = filterBookmarkModel->mapToSource(index); - QStandardItem *item = - bookmarkManager->treeBookmarkModel()->itemFromIndex(source); - if (item) { - item->setEditable(true); - treeView->edit(index); - item->setEditable(false); - } - } + HelpEngineWrapper::instance().setBookmarks(bookmarkModel->bookmarks()); } -void BookmarkWidget::setup(bool showButtons) +void BookmarkManager::removeItem(const QModelIndex &index) { TRACE_OBJ - regExp.setPatternSyntax(QRegExp::FixedString); - regExp.setCaseSensitivity(Qt::CaseInsensitive); - - QLayout *vlayout = new QVBoxLayout(this); - vlayout->setMargin(4); - - QLabel *label = new QLabel(tr("Filter:"), this); - vlayout->addWidget(label); - - searchField = new QLineEdit(this); - vlayout->addWidget(searchField); - connect(searchField, SIGNAL(textChanged(QString)), this, - SLOT(filterChanged())); - - treeView = new TreeView(this); - vlayout->addWidget(treeView); - -#ifdef Q_OS_MAC -# define SYSTEM "mac" -#else -# define SYSTEM "win" -#endif - - if (showButtons) { - QLayout *hlayout = new QHBoxLayout(); - vlayout->addItem(hlayout); - - hlayout->addItem(new QSpacerItem(40, 20, QSizePolicy::Expanding)); - - addButton = new QToolButton(this); - addButton->setText(tr("Add")); - addButton->setIcon(QIcon(QLatin1String(":/trolltech/assistant/images/" - SYSTEM "/addtab.png"))); - addButton->setAutoRaise(true); - addButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); - hlayout->addWidget(addButton); - connect(addButton, SIGNAL(clicked()), this, SIGNAL(addBookmark())); - - removeButton = new QToolButton(this); - removeButton->setText(tr("Remove")); - removeButton->setIcon(QIcon(QLatin1String(":/trolltech/assistant/images/" - SYSTEM "/closetab.png"))); - removeButton->setAutoRaise(true); - removeButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); - hlayout->addWidget(removeButton); - connect(removeButton, SIGNAL(clicked()), this, SLOT(removeClicked())); + QModelIndex current = index; + if (typeAndSearch) { // need to map because of proxy + current = typeAndSearchModel->mapToSource(current); + current = bookmarkFilterModel->mapToSource(current); + } else if (!bookmarkModel->parent(index).isValid()) { + return; // check if we should delete the "Bookmarks Menu", bail } - filterBookmarkModel = new QSortFilterProxyModel(this); - treeView->setModel(filterBookmarkModel); - - treeView->setDragEnabled(true); - treeView->setAcceptDrops(true); - treeView->setAutoExpandDelay(1000); - treeView->setDropIndicatorShown(true); - treeView->header()->setVisible(false); - treeView->setContextMenuPolicy(Qt::CustomContextMenu); - - connect(treeView, SIGNAL(expanded(QModelIndex)), this, - SLOT(expand(QModelIndex))); - connect(treeView, SIGNAL(collapsed(QModelIndex)), this, - SLOT(expand(QModelIndex))); - connect(treeView, SIGNAL(activated(QModelIndex)), this, - SLOT(activated(QModelIndex))); - connect(treeView, SIGNAL(customContextMenuRequested(QPoint)), - this, SLOT(customContextMenuRequested(QPoint))); - - filterBookmarkModel->setFilterKeyColumn(0); - filterBookmarkModel->setDynamicSortFilter(true); - filterBookmarkModel->setSourceModel(bookmarkManager->treeBookmarkModel()); - - expandItems(); -} - -void BookmarkWidget::expandItems() -{ - TRACE_OBJ - QStandardItemModel *model = bookmarkManager->treeBookmarkModel(); - QListlist = model->findItems(QLatin1String("*"), - Qt::MatchWildcard | Qt::MatchRecursive, 0); - foreach (const QStandardItem *item, list) { - const QModelIndex &index = model->indexFromItem(item); - treeView->setExpanded(filterBookmarkModel->mapFromSource(index), - item->data(Qt::UserRole + 11).toBool()); + if (bookmarkModel->hasChildren(current)) { + int value = QMessageBox::question(bookmarkTreeView, tr("Remove"), + tr("You are going to delete a Folder, this will also
" + "remove it's content. Are you sure to continue?"), + QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Cancel); + if (value == QMessageBox::Cancel) + return; } + bookmarkModel->removeItem(current); } -void BookmarkWidget::focusInEvent(QFocusEvent *e) +bool BookmarkManager::eventFilter(QObject *object, QEvent *event) { - TRACE_OBJ - if (e->reason() != Qt::MouseFocusReason) { - searchField->selectAll(); - searchField->setFocus(); - - QModelIndex index = treeView->indexAt(QPoint(1, 1)); - if (index.isValid()) - treeView->setCurrentIndex(index); - - } -} + if (object != bookmarkTreeView && object != bookmarkTreeView->viewport() + && object != bookmarkWidget) + return QObject::eventFilter(object, event); -bool BookmarkWidget::eventFilter(QObject *object, QEvent *e) -{ TRACE_OBJ - if (object != this && object != treeView - && object != treeView->viewport()) { - return QWidget::eventFilter(object, e); - } - - if (e->type() == QEvent::KeyPress) { - QKeyEvent *ke = static_cast(e); - const bool tree = object == treeView || object == treeView->viewport(); + const bool isWidget = object == bookmarkWidget; + if (event->type() == QEvent::KeyPress) { + QKeyEvent *ke = static_cast(event); switch (ke->key()) { case Qt::Key_F2: { - const QModelIndex &index = treeView->currentIndex(); - const QModelIndex &src = filterBookmarkModel->mapToSource(index); - if (tree && searchField->text().isEmpty()) { - if (QStandardItem *item = bookmarkManager->treeBookmarkModel() - ->itemFromIndex(src)) { - item->setEditable(true); - treeView->edit(index); - item->setEditable(false); - } - } - } break; - - case Qt::Key_Enter: { - case Qt::Key_Return: - if (tree) { - const QString &data = treeView->selectionModel()->currentIndex() - .data(Qt::UserRole + 10).toString(); - if (!data.isEmpty() && data != QLatin1String("Folder")) - emit requestShowLink(data); - } + renameBookmark(bookmarkTreeView->currentIndex()); } break; case Qt::Key_Delete: { - const QModelIndex &index = treeView->currentIndex(); - const QModelIndex &src = filterBookmarkModel->mapToSource(index); - if (tree && searchField->text().isEmpty()) - bookmarkManager->removeBookmarkItem(treeView, src); + removeItem(bookmarkTreeView->currentIndex()); } break; - case Qt::Key_Up: { + case Qt::Key_Up: { // needs event filter on widget case Qt::Key_Down: - if (!tree) - treeView->subclassKeyPressEvent(ke); + if (isWidget) + bookmarkTreeView->subclassKeyPressEvent(ke); } break; case Qt::Key_Escape: { @@ -620,348 +252,255 @@ bool BookmarkWidget::eventFilter(QObject *object, QEvent *e) } } - if (e->type() == QEvent::MouseButtonRelease) { - QMouseEvent *me = static_cast(e); - bool controlPressed = me->modifiers() & Qt::ControlModifier; - if(((me->button() == Qt::LeftButton) && controlPressed) - || (me->button() == Qt::MidButton)) { - const QModelIndex &index = treeView->currentIndex(); - const QString &data = index.data(Qt::UserRole + 10).toString(); - if (!data.isEmpty() && data != QLatin1String("Folder")) - CentralWidget::instance()->setSourceInNewTab(data); + if (event->type() == QEvent::MouseButtonRelease && !isWidget) { + QMouseEvent *me = static_cast(event); + switch (me->button()) { + case Qt::LeftButton: { + if (me->modifiers() & Qt::ControlModifier) + setSourceFromIndex(bookmarkTreeView->currentIndex(), true); + } break; + + case Qt::MidButton: { + setSourceFromIndex(bookmarkTreeView->currentIndex(), true); + } break; + + default: break; } } - return QWidget::eventFilter(object, e); + return QObject::eventFilter(object, event); } - -// BookmarkModel - - -BookmarkModel::BookmarkModel(int rows, int columns, QObject *parent) - : QStandardItemModel(rows, columns, parent) +void BookmarkManager::buildBookmarksMenu(const QModelIndex &index, QMenu* menu) { TRACE_OBJ -} + if (!index.isValid()) + return; -BookmarkModel::~BookmarkModel() -{ - TRACE_OBJ + const QString &text = index.data().toString(); + const QIcon &icon = qVariantValue(index.data(Qt::DecorationRole)); + if (index.data(UserRoleFolder).toBool()) { + if (QMenu* subMenu = menu->addMenu(icon, text)) { + for (int i = 0; i < bookmarkModel->rowCount(index); ++i) + buildBookmarksMenu(bookmarkModel->index(i, 0, index), subMenu); + } + } else { + QAction *action = menu->addAction(icon, text); + action->setData(index.data(UserRoleUrl).toString()); + } } -Qt::DropActions BookmarkModel::supportedDropActions() const +void BookmarkManager::showBookmarkDialog(const QString &name, const QString &url) { TRACE_OBJ - return Qt::MoveAction; + BookmarkDialog dialog(bookmarkModel, name, url, bookmarkTreeView); + dialog.exec(); } -Qt::ItemFlags BookmarkModel::flags(const QModelIndex &index) const +// -- private slots + +void BookmarkManager::setupFinished() { TRACE_OBJ - Qt::ItemFlags defaultFlags = QStandardItemModel::flags(index); - if ((!index.isValid()) // can only happen for the invisible root item - || index.data(Qt::UserRole + 10).toString() == QLatin1String("Folder")) - return (Qt::ItemIsDropEnabled | defaultFlags) &~ Qt::ItemIsDragEnabled; - - return (Qt::ItemIsDragEnabled | defaultFlags) &~ Qt::ItemIsDropEnabled; -} + bookmarkModel->setBookmarks(HelpEngineWrapper::instance().bookmarks()); + bookmarkModel->expandFoldersIfNeeeded(bookmarkTreeView); + refeshBookmarkMenu(); -// BookmarkManager + bookmarkTreeView->hideColumn(1); + bookmarkTreeView->header()->setVisible(false); + bookmarkTreeView->header()->setStretchLastSection(true); + bookmarkFilterModel = new BookmarkFilterModel(this); + bookmarkFilterModel->setSourceModel(bookmarkModel); + bookmarkFilterModel->filterBookmarkFolders(); -BookmarkManager::BookmarkManager() - : treeModel(new BookmarkModel(0, 1, this)) - , listModel(new BookmarkModel(0, 1, this)) - , renameItem(0) -{ - TRACE_OBJ - folderIcon = QApplication::style()->standardIcon(QStyle::SP_DirClosedIcon); - bookmarkIcon = QIcon(QLatin1String(":/trolltech/assistant/images/bookmark.png")); - - connect(treeModel, SIGNAL(itemChanged(QStandardItem*)), this, - SLOT(itemChanged(QStandardItem*))); - connect(treeModel, SIGNAL(itemChanged(QStandardItem*)), this, - SIGNAL(bookmarksChanged())); - connect(treeModel, SIGNAL(rowsRemoved(QModelIndex,int,int)), - this, SIGNAL(bookmarksChanged())); + typeAndSearchModel = new QSortFilterProxyModel(this); + typeAndSearchModel->setDynamicSortFilter(true); + typeAndSearchModel->setSourceModel(bookmarkFilterModel); } -BookmarkManager::~BookmarkManager() +void BookmarkManager::addBookmark() { TRACE_OBJ - treeModel->clear(); - listModel->clear(); + if (CentralWidget *widget = CentralWidget::instance()) { + showBookmarkDialog(widget->currentTitle(), + widget->currentSource().toString()); + } } -BookmarkModel* BookmarkManager::treeBookmarkModel() +void BookmarkManager::removeBookmark() { TRACE_OBJ - return treeModel; + removeItem(bookmarkTreeView->currentIndex()); } -BookmarkModel* BookmarkManager::listBookmarkModel() -{ - TRACE_OBJ - return listModel; -} +//void BookmarkManager::manageBookmarks() +//{ +// TRACE_OBJ +//} -void BookmarkManager::saveBookmarks() +void BookmarkManager::refeshBookmarkMenu() { TRACE_OBJ - QByteArray bookmarks; - QDataStream stream(&bookmarks, QIODevice::WriteOnly); + if (!bookmarkMenu) + return; - readBookmarksRecursive(treeModel->invisibleRootItem(), stream, 0); - HelpEngineWrapper::instance().setBookmarks(bookmarks); -} + bookmarkMenu->clear(); -QStringList BookmarkManager::bookmarkFolders() const -{ - TRACE_OBJ - QStringList folders(tr("Bookmarks")); + //bookmarkMenu->addAction(tr("Manage Bookmarks..."), this, + // SLOT(manageBookmarks())); + bookmarkMenu->addAction(tr("Import..."), this, SLOT(importBookmarks())); + bookmarkMenu->addAction(tr("Export..."), this, SLOT(exportBookmarks())); + bookmarkMenu->addAction(tr("Add Bookmark..."), this, SLOT(addBookmark()), + QKeySequence(tr("Ctrl+D"))); + bookmarkMenu->addSeparator(); - QListlist = treeModel->findItems(QLatin1String("*"), - Qt::MatchWildcard | Qt::MatchRecursive, 0); + const QModelIndex &root = bookmarkModel->index(0, 0, QModelIndex()); + for (int i = 0; i < bookmarkModel->rowCount(root); ++i) + buildBookmarksMenu(bookmarkModel->index(i, 0, root), bookmarkMenu); - QString data; - foreach (const QStandardItem *item, list) { - data = item->data(Qt::UserRole + 10).toString(); - if (data == QLatin1String("Folder")) - folders << item->data(Qt::DisplayRole).toString(); - } - return folders; + connect(bookmarkMenu, SIGNAL(triggered(QAction*)), this, + SLOT(setSourceFromAction(QAction*))); } -QModelIndex BookmarkManager::addNewFolder(const QModelIndex &index) +void BookmarkManager::renameBookmark(const QModelIndex &index) { - TRACE_OBJ - QStandardItem *item = new QStandardItem(uniqueFolderName()); - item->setEditable(false); - item->setData(false, Qt::UserRole + 11); - item->setData(QLatin1String("Folder"), Qt::UserRole + 10); - item->setIcon(QApplication::style()->standardIcon(QStyle::SP_DirClosedIcon)); - - if (index.isValid()) { - treeModel->itemFromIndex(index)->appendRow(item); - } else { - treeModel->appendRow(item); - } - return treeModel->indexFromItem(item); + // check if we should rename the "Bookmarks Menu", bail + if (!typeAndSearch && !bookmarkModel->parent(index).isValid()) + return; + + bookmarkModel->setItemsEditable(true); + bookmarkTreeView->edit(index); + bookmarkModel->setItemsEditable(false); } -void BookmarkManager::removeBookmarkItem(QTreeView *treeView, - const QModelIndex &index) +void BookmarkManager::importBookmarks() { TRACE_OBJ - QStandardItem *item = treeModel->itemFromIndex(index); - if (item) { - QString data = index.data(Qt::UserRole + 10).toString(); - if (data == QLatin1String("Folder") && item->rowCount() > 0) { - int value = QMessageBox::question(treeView, tr("Remove"), - tr("You are going to delete a Folder, this will also
" - "remove it's content. Are you sure to continue?"), - QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Cancel); - - if (value == QMessageBox::Cancel) - return; - } + const QString &fileName = QFileDialog::getOpenFileName(0, tr("Open File"), + QDir::currentPath(), tr("Files (*.xbel)")); - if (data != QLatin1String("Folder")) { - QListitemList = listModel->findItems(item->text()); - foreach (const QStandardItem *i, itemList) { - if (i->data(Qt::UserRole + 10) == data) { - listModel->removeRow(i->row()); - break; - } - } - } else { - removeBookmarkFolderItems(item); - } - treeModel->removeRow(item->row(), index.parent()); + if (fileName.isEmpty()) + return; + + QFile file(fileName); + if (file.open(QIODevice::ReadOnly)) { + XbelReader reader(bookmarkModel); + reader.readFromFile(&file); } } -void BookmarkManager::showBookmarkDialog(QWidget *parent, const QString &name, - const QString &url) +void BookmarkManager::exportBookmarks() { TRACE_OBJ - BookmarkDialog dialog(this, name, url, parent); - dialog.exec(); -} + QString fileName = QFileDialog::getSaveFileName(0, tr("Save File"), + QLatin1String("untitled.xbel"), tr("Files (*.xbel)")); -void BookmarkManager::addNewBookmark(const QModelIndex &index, - const QString &name, const QString &url) -{ - TRACE_OBJ - QStandardItem *item = new QStandardItem(name); - item->setEditable(false); - item->setIcon(bookmarkIcon); - item->setData(false, Qt::UserRole + 11); - item->setData(url, Qt::UserRole + 10); + const QLatin1String suffix(".xbel"); + if (!fileName.endsWith(suffix)) + fileName.append(suffix); - if (index.isValid()) - treeModel->itemFromIndex(index)->appendRow(item); - else - treeModel->appendRow(item); - listModel->appendRow(item->clone()); - emit bookmarksChanged(); + QFile file(fileName); + if (file.open(QIODevice::WriteOnly)) { + XbelWriter writer(bookmarkModel); + writer.writeToFile(&file); + } else { + QMessageBox::information(bookmarkTreeView, tr("Qt Assistant"), + tr("Unable to save bookmarks."), tr("OK")); + } } -void BookmarkManager::fillBookmarkMenu(QMenu *menu) +void BookmarkManager::setSourceFromAction(QAction *action) { TRACE_OBJ - if (!menu || !treeModel) - return; + const QVariant &data = action->data(); - map.clear(); - fillBookmarkMenu(menu, treeModel->invisibleRootItem()); + if (data.canConvert()) + emit setSource(data.toUrl()); } -void BookmarkManager::fillBookmarkMenu(QMenu *menu, QStandardItem *root) +void BookmarkManager::setSourceFromIndex(const QModelIndex &index, bool newTab) { TRACE_OBJ - for (int i = 0; i < root->rowCount(); ++i) { - QStandardItem *item = root->child(i); - if (item && item->data(Qt::UserRole + 10) - .toString() == QLatin1String("Folder")) { - QMenu* newMenu = menu->addMenu(folderIcon, item->text()); - if (item->rowCount() > 0) - fillBookmarkMenu(newMenu, item); - } else { - map.insert(menu->addAction(item->text()), item->index()); - } - } -} + QAbstractItemModel *base = bookmarkModel; + if (typeAndSearch) + base = typeAndSearchModel; -QUrl BookmarkManager::urlForAction(QAction* action) const -{ - TRACE_OBJ - if (map.contains(action)) { - const QModelIndex &index = map.value(action); - if (QStandardItem* item = treeModel->itemFromIndex(index)) - return QUrl(item->data(Qt::UserRole + 10).toString()); + if (base->data(index, UserRoleFolder).toBool()) + return; + + const QVariant &data = base->data(index, UserRoleUrl); + if (data.canConvert()) { + if (newTab) + emit setSourceInNewTab(data.toUrl()); + else + emit setSource(data.toUrl()); } - return QUrl(); } -void BookmarkManager::itemChanged(QStandardItem *item) +void BookmarkManager::customContextMenuRequested(const QPoint &point) { TRACE_OBJ - if (renameItem != item) { - renameItem = item; - oldText = item->text(); + QModelIndex index = bookmarkTreeView->indexAt(point); + if (!index.isValid()) return; - } - if (item->text() != oldText) { - if (item->data(Qt::UserRole + 10).toString() != QLatin1String("Folder")) { - QListitemList = listModel->findItems(oldText); - if (itemList.count() > 0) - itemList.at(0)->setText(item->text()); - } - } -} + // check if we should open the menu on "Bookmarks Menu", bail + if (!typeAndSearch && !bookmarkModel->parent(index).isValid()) + return; -void BookmarkManager::setupBookmarkModels() -{ - TRACE_OBJ - treeModel->clear(); - listModel->clear(); - - qint32 depth; - bool expanded; - QString name, type; - QList lastDepths; - QList parents; - - QByteArray ba = HelpEngineWrapper::instance().bookmarks(); - QDataStream stream(ba); - while (!stream.atEnd()) { - stream >> depth >> name >> type >> expanded; - - QStandardItem *item = new QStandardItem(name); - item->setEditable(false); - item->setData(type, Qt::UserRole + 10); - item->setData(expanded, Qt::UserRole + 11); - if (depth == 0) { - parents.clear(); lastDepths.clear(); - treeModel->appendRow(item); - parents << item; lastDepths << depth; - } else { - if (depth <= lastDepths.last()) { - while (depth <= lastDepths.last() && parents.count() > 0) { - parents.pop_back(); lastDepths.pop_back(); - } - } - parents.last()->appendRow(item); - if (type == QLatin1String("Folder")) { - parents << item; lastDepths << depth; - } - } + QAction *remove = 0; + QAction *rename = 0; + QAction *showItem = 0; + QAction *showItemInNewTab = 0; - if (type != QLatin1String("Folder")) { - item->setIcon(bookmarkIcon); - listModel->appendRow(item->clone()); - } else { - item->setIcon(folderIcon); - } + QMenu menu(QLatin1String("")); + if (!typeAndSearch && bookmarkModel->data(index, UserRoleFolder).toBool()) { + remove = menu.addAction(tr("Delete Folder")); + rename = menu.addAction(tr("Rename Folder")); + } else { + showItem = menu.addAction(tr("Show Bookmark")); + showItemInNewTab = menu.addAction(tr("Show Bookmark in New Tab")); + menu.addSeparator(); + remove = menu.addAction(tr("Delete Bookmark")); + rename = menu.addAction(tr("Rename Bookmark")); } -} -QString BookmarkManager::uniqueFolderName() const -{ - TRACE_OBJ - QString folderName = tr("New Folder"); - QList list = treeModel->findItems(folderName, - Qt::MatchContains | Qt::MatchRecursive, 0); - if (!list.isEmpty()) { - QStringList names; - foreach (const QStandardItem *item, list) - names << item->text(); - - for (int i = 1; i <= names.count(); ++i) { - folderName = (tr("New Folder") + QLatin1String(" %1")).arg(i); - if (!names.contains(folderName)) - break; - } - } - return folderName; + QAction *pickedAction = menu.exec(bookmarkTreeView->mapToGlobal(point)); + if (pickedAction == rename) + renameBookmark(index); + else if (pickedAction == remove) + removeItem(index); + else if (pickedAction == showItem || pickedAction == showItemInNewTab) + setSourceFromIndex(index, pickedAction == showItemInNewTab); } -void BookmarkManager::removeBookmarkFolderItems(QStandardItem *item) +void BookmarkManager::focusInEvent() { TRACE_OBJ - for (int j = 0; j < item->rowCount(); ++j) { - QStandardItem *child = item->child(j); - if (child->rowCount() > 0) - removeBookmarkFolderItems(child); - - QString data = child->data(Qt::UserRole + 10).toString(); - QListitemList = listModel->findItems(child->text()); - foreach (const QStandardItem *i, itemList) { - if (i->data(Qt::UserRole + 10) == data) { - listModel->removeRow(i->row()); - break; - } - } - } + const QModelIndex &index = bookmarkTreeView->indexAt(QPoint(2, 2)); + if (index.isValid()) + bookmarkTreeView->setCurrentIndex(index); } -void BookmarkManager::readBookmarksRecursive(const QStandardItem *item, - QDataStream &stream, const qint32 depth) const +void BookmarkManager::textChanged(const QString &text) { TRACE_OBJ - for (int j = 0; j < item->rowCount(); ++j) { - const QStandardItem *child = item->child(j); - stream << depth; - stream << child->data(Qt::DisplayRole).toString(); - stream << child->data(Qt::UserRole + 10).toString(); - stream << child->data(Qt::UserRole + 11).toBool(); - - if (child->rowCount() > 0) - readBookmarksRecursive(child, stream, (depth +1)); + if (!bookmarkWidget->ui.lineEdit->text().isEmpty()) { + if (!typeAndSearch) { + typeAndSearch = true; + bookmarkTreeView->setItemsExpandable(false); + bookmarkTreeView->setRootIsDecorated(false); + bookmarkTreeView->setModel(typeAndSearchModel); + } + typeAndSearchModel->setFilterRegExp(QRegExp(text)); + } else { + typeAndSearch = false; + bookmarkTreeView->setModel(bookmarkModel); + bookmarkTreeView->setItemsExpandable(true); + bookmarkTreeView->setRootIsDecorated(true); + bookmarkModel->expandFoldersIfNeeeded(bookmarkTreeView); } } diff --git a/tools/assistant/tools/assistant/bookmarkmanager.h b/tools/assistant/tools/assistant/bookmarkmanager.h index fbacc2c..88342d5 100644 --- a/tools/assistant/tools/assistant/bookmarkmanager.h +++ b/tools/assistant/tools/assistant/bookmarkmanager.h @@ -38,179 +38,118 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ - #ifndef BOOKMARKMANAGER_H #define BOOKMARKMANAGER_H -#include "ui_bookmarkdialog.h" - -#include -#include -#include -#include -#include - -#include -#include -#include +#include #include -#include + +#include "ui_bookmarkwidget.h" QT_BEGIN_NAMESPACE -class QEvent; -class QLineEdit; -class QTreeView; -class QToolButton; -class QStandardItem; -class QHelpEngineCore; -class QAbstractItemModel; +class BookmarkModel; +class BookmarkFilterModel; +class QKeyEvent; class QSortFilterProxyModel; -class BookmarkManager; - -class BookmarkDialog : public QDialog +class BookmarkManager : public QObject { Q_OBJECT + class BookmarkWidget; + class BookmarkTreeView; + class BookmarkListView; + Q_DISABLE_COPY(BookmarkManager); public: - BookmarkDialog(BookmarkManager *manager, const QString &title, - const QString &url, QWidget *parent = 0); - ~BookmarkDialog(); + static BookmarkManager* instance(); + static void destroy(); -private slots: - void addAccepted(); - void addNewFolder(); - void toolButtonClicked(); - void itemChanged(QStandardItem *item); - void textChanged(const QString& string); - void selectBookmarkFolder(const QString &folderName); - void customContextMenuRequested(const QPoint &point); - void currentChanged(const QModelIndex& current); + QWidget* bookmarkDockWidget() const; + void takeBookmarksMenu(QMenu* menu); -private: - bool eventFilter(QObject *object, QEvent *e); - void renameFolder(const QModelIndex &index, const QModelIndex &proxyIndex); +public slots: + void addBookmark(const QString &title, const QString &url); + +signals: + void escapePressed(); + void setSource(const QUrl &url); + void setSourceInNewTab(const QUrl &url); private: - QString m_url; - QString m_title; + BookmarkManager(); + ~BookmarkManager(); - QString oldText; - QStandardItem *renameItem; + void removeItem(const QModelIndex &index); + bool eventFilter(QObject *object, QEvent *event); + void buildBookmarksMenu(const QModelIndex &index, QMenu *menu); + void showBookmarkDialog(const QString &name, const QString &url); - Ui::BookmarkDialog ui; - BookmarkManager *bookmarkManager; - QSortFilterProxyModel *proxyModel; -}; +private slots: + void setupFinished(); -class TreeView : public QTreeView { - Q_OBJECT -public: - TreeView(QWidget* parent = 0) : QTreeView(parent) {} - void subclassKeyPressEvent(QKeyEvent* event) - { - QTreeView::keyPressEvent(event); - } -}; + void addBookmark(); + void removeBookmark(); +// void manageBookmarks(); + void refeshBookmarkMenu(); + void renameBookmark(const QModelIndex &index); -class BookmarkWidget : public QWidget -{ - Q_OBJECT + void importBookmarks(); + void exportBookmarks(); -public: - BookmarkWidget(BookmarkManager *manager, QWidget *parent = 0, - bool showButtons = true); - ~BookmarkWidget(); + void setSourceFromAction(QAction *action); + void setSourceFromIndex(const QModelIndex &index, bool newTab = false); -signals: - void addBookmark(); - void requestShowLink(const QUrl &url); - void escapePressed(); - -private slots: - void removeClicked(); - void filterChanged(); - void expand(const QModelIndex& index); - void activated(const QModelIndex &index); + void focusInEvent(); + void textChanged(const QString &text); void customContextMenuRequested(const QPoint &point); private: - void setup(bool showButtons); - void expandItems(); - void focusInEvent(QFocusEvent *e); - bool eventFilter(QObject *object, QEvent *event); + bool typeAndSearch; -private: - QRegExp regExp; - TreeView *treeView; - QLineEdit *searchField; - QToolButton *addButton; - QToolButton *removeButton; - BookmarkManager *bookmarkManager; - QSortFilterProxyModel* filterBookmarkModel; -}; + static QMutex mutex; + static BookmarkManager *bookmarkManager; -class BookmarkModel : public QStandardItemModel -{ - Q_OBJECT + QMenu *bookmarkMenu; -public: - BookmarkModel(int rows, int columns, QObject *parent = 0); - ~BookmarkModel(); + BookmarkModel *bookmarkModel; + BookmarkFilterModel *bookmarkFilterModel; + QSortFilterProxyModel *typeAndSearchModel; - Qt::DropActions supportedDropActions() const; - Qt::ItemFlags flags(const QModelIndex &index) const; + BookmarkWidget *bookmarkWidget; + BookmarkTreeView *bookmarkTreeView; }; -class BookmarkManager : public QObject +class BookmarkManager::BookmarkWidget : public QWidget { Q_OBJECT - public: - BookmarkManager(); - ~BookmarkManager(); + BookmarkWidget(QWidget *parent = 0) + : QWidget(parent) { ui.setupUi(this); } + virtual ~BookmarkWidget() {} - BookmarkModel* treeBookmarkModel(); - BookmarkModel* listBookmarkModel(); - - void saveBookmarks(); - QStringList bookmarkFolders() const; - QModelIndex addNewFolder(const QModelIndex& index); - void removeBookmarkItem(QTreeView *treeView, const QModelIndex& index); - void showBookmarkDialog(QWidget* parent, const QString &name, - const QString &url); - void addNewBookmark(const QModelIndex& index, const QString &name, - const QString &url); - void setupBookmarkModels(); - - void fillBookmarkMenu(QMenu *menu); - QUrl urlForAction(QAction* action) const; + Ui::BookmarkWidget ui; signals: - void bookmarksChanged(); - -private slots: - void itemChanged(QStandardItem *item); + void focusInEvent(); private: - QString uniqueFolderName() const; - void removeBookmarkFolderItems(QStandardItem *item); - void readBookmarksRecursive(const QStandardItem *item, QDataStream &stream, - const qint32 depth) const; - void fillBookmarkMenu(QMenu *menu, QStandardItem *root); + void focusInEvent(QFocusEvent *event); +}; -private: - QString oldText; - QIcon folderIcon; - QIcon bookmarkIcon; - - BookmarkModel *treeModel; - BookmarkModel *listModel; - QStandardItem *renameItem; - QMap map; +class BookmarkManager::BookmarkTreeView : public QTreeView +{ + Q_OBJECT +public: + BookmarkTreeView(QWidget *parent = 0); + ~BookmarkTreeView() {} + + void subclassKeyPressEvent(QKeyEvent *event); + +private slots: + void setExpandedData(const QModelIndex &index); }; QT_END_NAMESPACE -#endif +#endif // BOOKMARKMANAGER_H diff --git a/tools/assistant/tools/assistant/bookmarkmodel.cpp b/tools/assistant/tools/assistant/bookmarkmodel.cpp new file mode 100644 index 0000000..f265ca4 --- /dev/null +++ b/tools/assistant/tools/assistant/bookmarkmodel.cpp @@ -0,0 +1,426 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "bookmarkmodel.h" +#include "bookmarkitem.h" + +#include +#include + +#include +#include +#include + +const QLatin1String MIMETYPE("application/bookmarks.assistant"); + +BookmarkModel::BookmarkModel() + : QAbstractItemModel() + , m_folder(false) + , m_editable(false) + , rootItem(0) +{ +} + +BookmarkModel::~BookmarkModel() +{ + delete rootItem; +} + +QByteArray +BookmarkModel::bookmarks() const +{ + QByteArray ba; + QDataStream stream(&ba, QIODevice::WriteOnly); + + const QModelIndex &root = index(0,0, QModelIndex()); + for (int i = 0; i < rowCount(root); ++i) + collectItems(index(i, 0, root), 0, &stream); + + return ba; +} + +void +BookmarkModel::setBookmarks(const QByteArray &bookmarks) +{ + folderIcon = QApplication::style()->standardIcon(QStyle::SP_DirClosedIcon); + bookmarkIcon = QIcon(QLatin1String(":/trolltech/assistant/images/bookmark.png")); + + rootItem = new BookmarkItem(DataVector() << tr("Name") << tr("Address") + << true); + BookmarkItem* item = new BookmarkItem(DataVector() << tr("Bookmarks Menu") + << QLatin1String("Folder") << true); + rootItem->addChild(item); + + QStack parents; + parents.push(item); + + qint32 depth; + bool expanded; + QString name, url; + QDataStream stream(bookmarks); + while (!stream.atEnd()) { + stream >> depth >> name >> url >> expanded; + + while ((parents.count() - 1) != depth) + parents.pop(); + + item = new BookmarkItem(DataVector() << name << url << expanded); + if (url == QLatin1String("Folder")) { + parents.top()->addChild(item); + parents.push(item); + } else { + parents.top()->addChild(item); + } + } + + cache.clear(); + const QModelIndex &root = index(0,0, QModelIndex()); + + setupCache(root); + cache.insert(static_cast (root.internalPointer()), root); +} + +void +BookmarkModel::setItemsEditable(bool editable) +{ + m_editable = editable; +} + +void +BookmarkModel::expandFoldersIfNeeeded(QTreeView *treeView) +{ + foreach (const QModelIndex &index, cache) + treeView->setExpanded(index, index.data(UserRoleExpanded).toBool()); +} + +QModelIndex +BookmarkModel::addItem(const QModelIndex &parent, bool isFolder) +{ + m_folder = isFolder; + QModelIndex next; + if (insertRow(rowCount(parent), parent)) + next = index(rowCount(parent) - 1, 0, parent); + m_folder = false; + + return next; +} + +bool +BookmarkModel::removeItem(const QModelIndex &index) +{ + if (!index.isValid()) + return false; + + QModelIndexList indexes; + if (index.rowCount() > 0) + indexes = collectItems(index); + indexes.append(index); + + foreach (const QModelIndex &itemToRemove, indexes) { + if (!removeRow(itemToRemove.row(), itemToRemove.parent())) + return false; + cache.remove(itemFromIndex(itemToRemove)); + } + return true; +} + +int +BookmarkModel::rowCount(const QModelIndex &index) const +{ + if (BookmarkItem *item = itemFromIndex(index)) + return item->childCount(); + return 0; +} + +int +BookmarkModel::columnCount(const QModelIndex &/*index*/) const +{ + return 2; +} + +QModelIndex +BookmarkModel::parent(const QModelIndex &index) const +{ + if (!index.isValid()) + return QModelIndex(); + + if (BookmarkItem *childItem = itemFromIndex(index)) { + if (BookmarkItem *parent = childItem->parent()) { + if (parent != rootItem) + return createIndex(parent->childNumber(), 0, parent); + } + } + return QModelIndex(); +} + +QModelIndex +BookmarkModel::index(int row, int column, const QModelIndex &index) const +{ + if (index.isValid() && (index.column() != 0 && index.column() != 1)) + return QModelIndex(); + + if (BookmarkItem *parent = itemFromIndex(index)) { + if (BookmarkItem *childItem = parent->child(row)) + return createIndex(row, column, childItem); + } + return QModelIndex(); +} + +Qt::DropActions +BookmarkModel::supportedDropActions () const +{ + return /* Qt::CopyAction | */Qt::MoveAction; +} + +Qt::ItemFlags +BookmarkModel::flags(const QModelIndex &index) const +{ + if (!index.isValid()) + return Qt::NoItemFlags; + + Qt::ItemFlags defaultFlags = Qt::ItemIsEnabled | Qt::ItemIsSelectable; + + if (m_editable) + defaultFlags |= Qt::ItemIsEditable; + + if (BookmarkItem *item = itemFromIndex(index)) { + if (index.data(UserRoleFolder).toBool()) { + if (index.column() > 0) + defaultFlags &= ~Qt::ItemIsEditable; + return defaultFlags | Qt::ItemIsDropEnabled; + } + } + return defaultFlags | Qt::ItemIsDragEnabled; +} + +QVariant +BookmarkModel::data(const QModelIndex &index, int role) const +{ + if (index.isValid()) { + if (BookmarkItem *item = itemFromIndex(index)) { + switch (role) { + case Qt::EditRole: { + case Qt::DisplayRole: + if (index.data(UserRoleFolder).toBool() && index.column() == 1) + return QLatin1String(""); + return item->data(index.column()); + } break; + case Qt::DecorationRole: { + if (index.column() == 0) + return index.data(UserRoleFolder).toBool() + ? folderIcon : bookmarkIcon; + } break; + default:; + return item->data(role); + } + } + } + return QVariant(); +} + +bool +BookmarkModel::setData(const QModelIndex &index, const QVariant &value, int role) +{ + bool result = false; + if (role != Qt::EditRole && role != UserRoleExpanded) + return result; + + if (BookmarkItem *item = itemFromIndex(index)) { + if (role == Qt::EditRole) { + const bool isFolder = index.data(UserRoleFolder).toBool(); + if (!isFolder || (isFolder && index.column() == 0)) + result = item->setData(index.column(), value); + } else if (role == UserRoleExpanded) { + result = item->setData(UserRoleExpanded, value); + } + } + + if (result) + emit dataChanged(index, index); + return result; +} + +QVariant +BookmarkModel::headerData(int section, Qt::Orientation orientation, + int role) const +{ + if (rootItem && orientation == Qt::Horizontal && role == Qt::DisplayRole) + return rootItem->data(section); + return QVariant(); +} + +QModelIndex +BookmarkModel::indexFromItem(BookmarkItem *item) const +{ + return cache.value(item, QModelIndex()); +} + +BookmarkItem* +BookmarkModel::itemFromIndex(const QModelIndex &index) const +{ + if (index.isValid()) + return static_cast(index.internalPointer()); + return rootItem; +} + +bool +BookmarkModel::insertRows(int position, int rows, const QModelIndex &parent) +{ + if (!parent.data(UserRoleFolder).toBool()) + return false; + + bool success = false; + if (BookmarkItem *parentItem = itemFromIndex(parent)) { + beginInsertRows(parent, position, position + rows - 1); + success = parentItem->insertChildren(m_folder, position, rows); + if (success) { + const QModelIndex ¤t = index(position, 0, parent); + cache.insert(itemFromIndex(current), current); + } + endInsertRows(); + } + return success; +} + +bool +BookmarkModel::removeRows(int position, int rows, const QModelIndex &index) +{ + bool success = false; + if (BookmarkItem *parent = itemFromIndex(index)) { + beginRemoveRows(index, position, position + rows - 1); + success = parent->removeChildren(position, rows); + endRemoveRows(); + } + return success; +} + +QStringList +BookmarkModel::mimeTypes() const +{ + return QStringList() << MIMETYPE; +} + +QMimeData* +BookmarkModel::mimeData(const QModelIndexList &indexes) const +{ + if (indexes.isEmpty()) + return 0; + + QByteArray data; + QDataStream stream(&data, QIODevice::WriteOnly); + + foreach (const QModelIndex &index, indexes) { + if (index.column() == 0) + collectItems(index, 0, &stream); + } + + QMimeData *mimeData = new QMimeData(); + mimeData->setData(MIMETYPE, data); + return mimeData; +} + +bool +BookmarkModel::dropMimeData(const QMimeData *data, Qt::DropAction action, + int row, int column, const QModelIndex &parent) +{ + if (action == Qt::IgnoreAction) + return true; + + if (!data->hasFormat(MIMETYPE) || column > 0) + return false; + + QByteArray ba = data->data(MIMETYPE); + QDataStream stream(&ba, QIODevice::ReadOnly); + while (stream.atEnd()) + return false; + + qint32 depth; + bool expanded; + QString name, url; + while (!stream.atEnd()) { + stream >> depth >> name >> url >> expanded; + if (insertRow(qMax(0, row), parent)) { + const QModelIndex ¤t = index(qMax(0, row), 0, parent); + if (current.isValid()) { + BookmarkItem* item = itemFromIndex(current); + item->setData(DataVector() << name << url << expanded); + } + } + } + return true; +} + +void +BookmarkModel::setupCache(const QModelIndex &parent) +{ + const QModelIndexList &list = collectItems(parent); + foreach (const QModelIndex &index, list) + cache.insert(itemFromIndex(index), index); +} + +QModelIndexList +BookmarkModel::collectItems(const QModelIndex &parent) const +{ + QModelIndexList list; + for (int i = rowCount(parent) - 1; i >= 0 ; --i) { + const QModelIndex &next = index(i, 0, parent); + if (data(next, UserRoleFolder).toBool()) + list += collectItems(next); + list.append(next); + } + return list; +} + +void +BookmarkModel::collectItems(const QModelIndex &parent, qint32 depth, + QDataStream *stream) const +{ + if (parent.isValid()) { + *stream << depth; + *stream << parent.data().toString(); + *stream << parent.data(UserRoleUrl).toString(); + *stream << parent.data(UserRoleExpanded).toBool(); + + for (int i = 0; i < rowCount(parent); ++i) { + if (parent.data(UserRoleFolder).toBool()) + collectItems(index(i, 0 , parent), depth + 1, stream); + } + } +} diff --git a/tools/assistant/tools/assistant/bookmarkmodel.h b/tools/assistant/tools/assistant/bookmarkmodel.h new file mode 100644 index 0000000..6b2a0b8 --- /dev/null +++ b/tools/assistant/tools/assistant/bookmarkmodel.h @@ -0,0 +1,115 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef BOOKMARKMODEL_H +#define BOOKMARKMODEL_H + +#include + +#include + +QT_BEGIN_NAMESPACE + +class BookmarkItem; +class QMimeData; +class QTreeView; + +typedef QMap ItemModelIndexCache; + +class BookmarkModel : public QAbstractItemModel +{ + Q_OBJECT +public: + BookmarkModel(); + ~BookmarkModel(); + + QByteArray bookmarks() const; + void setBookmarks(const QByteArray &bookmarks); + + void setItemsEditable(bool editable); + void expandFoldersIfNeeeded(QTreeView *treeView); + + QModelIndex addItem(const QModelIndex &parent, bool isFolder = false); + bool removeItem(const QModelIndex &index); + + int rowCount(const QModelIndex &index = QModelIndex()) const; + int columnCount(const QModelIndex &index = QModelIndex()) const; + + QModelIndex parent(const QModelIndex &index) const; + QModelIndex index(int row, int column, const QModelIndex &index) const; + + Qt::DropActions supportedDropActions () const; + Qt::ItemFlags flags(const QModelIndex &index) const; + + QVariant data(const QModelIndex &index, int role) const; + bool setData(const QModelIndex &index, const QVariant &value, int role); + QVariant headerData(int section, Qt::Orientation orientation, int role) const; + + QModelIndex indexFromItem(BookmarkItem *item) const; + BookmarkItem *itemFromIndex(const QModelIndex &index) const; + + bool insertRows(int position, int rows, const QModelIndex &parent); + bool removeRows(int position, int rows, const QModelIndex &parent); + + QStringList mimeTypes() const; + QMimeData* mimeData(const QModelIndexList &indexes) const; + bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, + int column, const QModelIndex &parent); + +private: + void setupCache(const QModelIndex &parent); + QModelIndexList collectItems(const QModelIndex &parent) const; + void collectItems(const QModelIndex &parent, qint32 depth, + QDataStream *stream) const; + +private: + int columns; + bool m_folder; + bool m_editable; + QIcon folderIcon; + QIcon bookmarkIcon; + QTreeView *treeView; + BookmarkItem *rootItem; + ItemModelIndexCache cache; +}; + +QT_END_NAMESPACE + +#endif // BOOKMARKMODEL_H diff --git a/tools/assistant/tools/assistant/bookmarkwidget.ui b/tools/assistant/tools/assistant/bookmarkwidget.ui new file mode 100644 index 0000000..3015740 --- /dev/null +++ b/tools/assistant/tools/assistant/bookmarkwidget.ui @@ -0,0 +1,82 @@ + + + BookmarkWidget + + + + 0 + 0 + 235 + 606 + + + + Bookmarks + + + + + + + + Filter: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Add + + + + + + + Remove + + + + + + + + + + diff --git a/tools/assistant/tools/assistant/centralwidget.cpp b/tools/assistant/tools/assistant/centralwidget.cpp index 076498e..77b9678 100644 --- a/tools/assistant/tools/assistant/centralwidget.cpp +++ b/tools/assistant/tools/assistant/centralwidget.cpp @@ -842,7 +842,7 @@ void CentralWidget::showTabBarContextMenu(const QPoint &point) } if (pickedAction == newBookmark) - emit addNewBookmark(viewer->documentTitle(), viewer->source().toString()); + emit addBookmark(viewer->documentTitle(), viewer->source().toString()); } bool CentralWidget::eventFilter(QObject *object, QEvent *e) diff --git a/tools/assistant/tools/assistant/centralwidget.h b/tools/assistant/tools/assistant/centralwidget.h index c0bee81..a7c0d6f 100644 --- a/tools/assistant/tools/assistant/centralwidget.h +++ b/tools/assistant/tools/assistant/centralwidget.h @@ -170,7 +170,7 @@ signals: void highlighted(const QString &link); void forwardAvailable(bool available); void backwardAvailable(bool available); - void addNewBookmark(const QString &title, const QString &url); + void addBookmark(const QString &title, const QString &url); protected: void keyPressEvent(QKeyEvent *); diff --git a/tools/assistant/tools/assistant/mainwindow.cpp b/tools/assistant/tools/assistant/mainwindow.cpp index cfd0fee..2ff6b5e 100644 --- a/tools/assistant/tools/assistant/mainwindow.cpp +++ b/tools/assistant/tools/assistant/mainwindow.cpp @@ -41,20 +41,20 @@ #include "tracer.h" #include "mainwindow.h" + +#include "bookmarkmanager.h" #include "centralwidget.h" #include "helpviewer.h" #include "indexwindow.h" #include "topicchooser.h" #include "contentwindow.h" #include "preferencesdialog.h" -#include "bookmarkmanager.h" #include "helpenginewrapper.h" #include "remotecontrol.h" #include "cmdlineparser.h" #include "aboutdialog.h" #include "searchwidget.h" #include "qtdocinstaller.h" -#include "xbelsupport.h" // #define TRACING_REQUESTED @@ -95,6 +95,7 @@ QT_BEGIN_NAMESPACE MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent) : QMainWindow(parent) + , m_bookmarkWidget(0) , m_filterCombo(0) , m_toolBarMenu(0) , m_cmdLine(cmdLine) @@ -131,10 +132,22 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent) contentDock->setWidget(m_contentWindow); addDockWidget(Qt::LeftDockWidgetArea, contentDock); - QDockWidget *bookmarkDock = new QDockWidget(tr("Bookmarks"), this); - bookmarkDock->setObjectName(QLatin1String("BookmarkWindow")); - bookmarkDock->setWidget(setupBookmarkWidget()); - addDockWidget(Qt::LeftDockWidgetArea, bookmarkDock); + QDockWidget *bookmarkDock = 0; + if (BookmarkManager *manager = BookmarkManager::instance()) { + bookmarkDock = new QDockWidget(tr("Bookmarks"), this); + bookmarkDock->setObjectName(QLatin1String("BookmarkWindow")); + bookmarkDock->setWidget(m_bookmarkWidget = manager->bookmarkDockWidget()); + addDockWidget(Qt::LeftDockWidgetArea, bookmarkDock); + + connect(manager, SIGNAL(escapePressed()), this, + SLOT(activateCurrentCentralWidgetTab())); + connect(manager, SIGNAL(setSource(QUrl)), m_centralWidget, + SLOT(setSource(QUrl))); + connect(manager, SIGNAL(setSourceInNewTab(QUrl)), m_centralWidget, + SLOT(setSourceInNewTab(QUrl))); + connect(m_centralWidget, SIGNAL(addBookmark(QString, QString)), manager, + SLOT(addBookmark(QString, QString))); + } QHelpSearchEngine *searchEngine = helpEngineWrapper.searchEngine(); connect(searchEngine, SIGNAL(indexingStarted()), this, SLOT(indexingStarted())); @@ -153,14 +166,6 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent) setupFilterToolbar(); setupAddressToolbar(); - m_bookmarkManager->setupBookmarkModels(); - m_bookmarkMenu->addSeparator(); - m_bookmarkManager->fillBookmarkMenu(m_bookmarkMenu); - connect(m_bookmarkMenu, SIGNAL(triggered(QAction*)), this, - SLOT(showBookmark(QAction*))); - connect(m_bookmarkManager, SIGNAL(bookmarksChanged()), this, - SLOT(updateBookmarkMenu())); - const QString windowTitle = helpEngineWrapper.windowTitle(); setWindowTitle(windowTitle.isEmpty() ? defWindowTitle : windowTitle); QByteArray iconArray = helpEngineWrapper.applicationIcon(); @@ -186,7 +191,8 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent) restoreGeometry(ba); } else { tabifyDockWidget(contentDock, indexDock); - tabifyDockWidget(indexDock, bookmarkDock); + if (bookmarkDock) + tabifyDockWidget(indexDock, bookmarkDock); contentDock->raise(); resize(QSize(800, 600)); } @@ -219,9 +225,9 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent) hideIndex(); if (m_cmdLine->bookmarks() == CmdLineParser::Show) - showBookmarks(); + showBookmarksDockWidget(); else if (m_cmdLine->bookmarks() == CmdLineParser::Hide) - hideBookmarks(); + hideBookmarksDockWidget(); if (m_cmdLine->search() == CmdLineParser::Show) showSearch(); @@ -233,7 +239,7 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent) else if (m_cmdLine->index() == CmdLineParser::Activate) showIndex(); else if (m_cmdLine->bookmarks() == CmdLineParser::Activate) - showBookmarks(); + showBookmarksDockWidget(); if (!m_cmdLine->currentFilter().isEmpty()) { const QString &curFilter = m_cmdLine->currentFilter(); @@ -270,7 +276,7 @@ bool MainWindow::usesDefaultCollection() const void MainWindow::closeEvent(QCloseEvent *e) { TRACE_OBJ - m_bookmarkManager->saveBookmarks(); + BookmarkManager::destroy(); HelpEngineWrapper::instance().setMainWindow(saveState()); HelpEngineWrapper::instance().setMainWindowGeometry(saveGeometry()); QMainWindow::closeEvent(e); @@ -380,35 +386,6 @@ void MainWindow::checkInitState() } } -void MainWindow::updateBookmarkMenu() -{ - TRACE_OBJ - if (m_bookmarkManager) { - m_bookmarkMenu->removeAction(m_importBookmarkAction); - m_bookmarkMenu->removeAction(m_exportBookmarkAction); - m_bookmarkMenu->removeAction(m_bookmarkMenuAction); - - m_bookmarkMenu->clear(); - - m_bookmarkMenu->addAction(m_importBookmarkAction); - m_bookmarkMenu->addAction(m_exportBookmarkAction); - m_bookmarkMenu->addAction(m_bookmarkMenuAction); - m_bookmarkMenu->addSeparator(); - - m_bookmarkManager->fillBookmarkMenu(m_bookmarkMenu); - } -} - -void MainWindow::showBookmark(QAction *action) -{ - TRACE_OBJ - if (m_bookmarkManager) { - const QUrl &url = m_bookmarkManager->urlForAction(action); - if (url.isValid()) - m_centralWidget->setSource(url); - } -} - void MainWindow::insertLastPages() { TRACE_OBJ @@ -513,7 +490,7 @@ void MainWindow::setupActions() QKeySequence(tr("ALT+C"))); m_viewMenu->addAction(tr("Index"), this, SLOT(showIndex()), QKeySequence(tr("ALT+I"))); - m_viewMenu->addAction(tr("Bookmarks"), this, SLOT(showBookmarks()), + m_viewMenu->addAction(tr("Bookmarks"), this, SLOT(showBookmarksDockWidget()), QKeySequence(tr("ALT+O"))); m_viewMenu->addAction(tr("Search"), this, SLOT(showSearchWidget()), QKeySequence(tr("ALT+S"))); @@ -549,14 +526,8 @@ void MainWindow::setupActions() tmp->setShortcuts(QList() << QKeySequence(tr("Ctrl+Alt+Left")) << QKeySequence(Qt::CTRL + Qt::Key_PageUp)); - m_bookmarkMenu = menuBar()->addMenu(tr("&Bookmarks")); - m_importBookmarkAction = m_bookmarkMenu->addAction(tr("Import..."), - this, SLOT(importBookmarks())); - m_exportBookmarkAction = m_bookmarkMenu->addAction(tr("Export..."), - this, SLOT(exportBookmarks())); - m_bookmarkMenuAction = m_bookmarkMenu->addAction(tr("Add Bookmark..."), - this, SLOT(addBookmark())); - m_bookmarkMenuAction->setShortcut(tr("CTRL+D")); + if (BookmarkManager *manager = BookmarkManager::instance()) + manager->takeBookmarksMenu(menuBar()->addMenu(tr("&Bookmarks"))); menu = menuBar()->addMenu(tr("&Help")); m_aboutAction = menu->addAction(tr("About..."), this, SLOT(showAboutDialog())); @@ -617,14 +588,6 @@ void MainWindow::setupActions() SLOT(updateNavigationItems())); connect(m_centralWidget, SIGNAL(highlighted(QString)), statusBar(), SLOT(showMessage(QString))); - connect(m_centralWidget, SIGNAL(addNewBookmark(QString,QString)), this, - SLOT(addNewBookmark(QString,QString))); - - // bookmarks - connect(m_bookmarkWidget, SIGNAL(requestShowLink(QUrl)), m_centralWidget, - SLOT(setSource(QUrl))); - connect(m_bookmarkWidget, SIGNAL(escapePressed()), this, - SLOT(activateCurrentCentralWidgetTab())); // index window connect(m_indexWindow, SIGNAL(linkActivated(QUrl)), m_centralWidget, @@ -757,13 +720,6 @@ void MainWindow::showNewAddress(const QUrl &url) m_addressLineEdit->setText(url.toString()); } -void MainWindow::addBookmark() -{ - TRACE_OBJ - addNewBookmark(m_centralWidget->currentTitle(), - m_centralWidget->currentSource().toString()); -} - void MainWindow::gotoAddress() { TRACE_OBJ @@ -831,15 +787,6 @@ void MainWindow::copyAvailable(bool yes) m_copyAction->setEnabled(yes); } -void MainWindow::addNewBookmark(const QString &title, const QString &url) -{ - TRACE_OBJ - if (url.isEmpty() || url == QLatin1String("about:blank")) - return; - - m_bookmarkManager->showBookmarkDialog(this, title, url); -} - void MainWindow::showAboutDialog() { TRACE_OBJ @@ -940,22 +887,23 @@ void MainWindow::setBookmarksVisible(bool visible) { TRACE_OBJ if (visible) - showBookmarks(); + showBookmarksDockWidget(); else - hideBookmarks(); + hideBookmarksDockWidget(); } - -void MainWindow::showBookmarks() +void MainWindow::showBookmarksDockWidget() { TRACE_OBJ - activateDockWidget(m_bookmarkWidget); + if (m_bookmarkWidget) + activateDockWidget(m_bookmarkWidget); } -void MainWindow::hideBookmarks() +void MainWindow::hideBookmarksDockWidget() { TRACE_OBJ - m_bookmarkWidget->parentWidget()->hide(); + if (m_bookmarkWidget) + m_bookmarkWidget->parentWidget()->hide(); } void MainWindow::setSearchVisible(bool visible) @@ -1087,15 +1035,6 @@ void MainWindow::indexingFinished() m_progressWidget = 0; } -QWidget* MainWindow::setupBookmarkWidget() -{ - TRACE_OBJ - m_bookmarkManager = new BookmarkManager; - m_bookmarkWidget = new BookmarkWidget(m_bookmarkManager, this); - connect(m_bookmarkWidget, SIGNAL(addBookmark()), this, SLOT(addBookmark())); - return m_bookmarkWidget; -} - QString MainWindow::collectionFileDirectory(bool createDir, const QString &cacheDir) { TRACE_OBJ @@ -1131,43 +1070,6 @@ QString MainWindow::defaultHelpCollectionFileName() arg(QLatin1String(QT_VERSION_STR)); } -void MainWindow::importBookmarks() -{ - TRACE_OBJ - const QString &fileName = QFileDialog::getOpenFileName(0, tr("Open File"), - QDir::currentPath(), tr("Files (*.xbel)")); - - if (fileName.isEmpty()) - return; - - QFile file(fileName); - if (file.open(QIODevice::ReadOnly)) { - XbelReader reader(m_bookmarkManager->treeBookmarkModel(), - m_bookmarkManager->listBookmarkModel()); - reader.readFromFile(&file); - } -} - -void MainWindow::exportBookmarks() -{ - TRACE_OBJ - QString fileName = QFileDialog::getSaveFileName(0, tr("Save File"), - "untitled.xbel", tr("Files (*.xbel)")); - - QLatin1String suffix(".xbel"); - if (!fileName.endsWith(suffix)) - fileName.append(suffix); - - QFile file(fileName); - if (file.open(QIODevice::WriteOnly)) { - XbelWriter writer(m_bookmarkManager->treeBookmarkModel()); - writer.writeToFile(&file); - } else { - QMessageBox::information(this, tr("Qt Assistant"), - tr("Unable to save bookmarks."), tr("OK")); - } -} - void MainWindow::currentFilterChanged(const QString &filter) { TRACE_OBJ diff --git a/tools/assistant/tools/assistant/mainwindow.h b/tools/assistant/tools/assistant/mainwindow.h index 3c70666..40ca624 100644 --- a/tools/assistant/tools/assistant/mainwindow.h +++ b/tools/assistant/tools/assistant/mainwindow.h @@ -58,8 +58,6 @@ class QHelpEngineCore; class QHelpEngine; class CentralWidget; class ContentWindow; -class BookmarkManager; -class BookmarkWidget; class CmdLineParser; class QtDocInstaller; @@ -97,10 +95,8 @@ public slots: private slots: void showContents(); void showIndex(); - void showBookmarks(); void showSearch(); void insertLastPages(); - void addBookmark(); void gotoAddress(); void showPreferences(); void showNewAddress(); @@ -109,7 +105,6 @@ private slots: void updateNavigationItems(); void updateTabCloseAction(); void showNewAddress(const QUrl &url); - void addNewBookmark(const QString &title, const QString &url); void showTopicChooser(const QMap &links, const QString &keyword); void updateApplicationFont(); void filterDocumentation(const QString &customFilter); @@ -119,18 +114,12 @@ private slots: void indexingFinished(); void qtDocumentationInstalled(bool newDocsInstalled); void registerDocumentation(const QString &component, - const QString &absFileName); + const QString &absFileName); void resetQtDocInfo(const QString &component); void checkInitState(); void documentationRemoved(const QString &namespaceName); void documentationUpdated(const QString &namespaceName); - void updateBookmarkMenu(); - void showBookmark(QAction *action); - - void importBookmarks(); - void exportBookmarks(); - private: bool initHelpDB(); void setupActions(); @@ -140,17 +129,21 @@ private: void setupFilterToolbar(); void setupAddressToolbar(); QMenu *toolBarMenu(); - QWidget *setupBookmarkWidget(); void hideContents(); void hideIndex(); - void hideBookmarks(); void hideSearch(); +private slots: + void showBookmarksDockWidget(); + void hideBookmarksDockWidget(); + +private: + QWidget *m_bookmarkWidget; + +private: CentralWidget *m_centralWidget; IndexWindow *m_indexWindow; ContentWindow *m_contentWindow; - BookmarkWidget *m_bookmarkWidget; - BookmarkManager *m_bookmarkManager; QLineEdit *m_addressLineEdit; QComboBox *m_filterCombo; @@ -172,10 +165,6 @@ private: QMenu *m_viewMenu; QMenu *m_toolBarMenu; - QMenu *m_bookmarkMenu; - QAction *m_bookmarkMenuAction; - QAction *m_importBookmarkAction; - QAction *m_exportBookmarkAction; CmdLineParser *m_cmdLine; diff --git a/tools/assistant/tools/assistant/xbelsupport.cpp b/tools/assistant/tools/assistant/xbelsupport.cpp index f2c0bcb..7d5a08b 100644 --- a/tools/assistant/tools/assistant/xbelsupport.cpp +++ b/tools/assistant/tools/assistant/xbelsupport.cpp @@ -41,9 +41,12 @@ #include "tracer.h" #include "xbelsupport.h" -#include "bookmarkmanager.h" -#include +#include "bookmarkitem.h" +#include "bookmarkmodel.h" + +#include +#include QT_BEGIN_NAMESPACE @@ -55,7 +58,7 @@ struct Bookmark { XbelWriter::XbelWriter(BookmarkModel *model) : QXmlStreamWriter() - , treeModel(model) + , bookmarkModel(model) { TRACE_OBJ setAutoFormatting(true); @@ -71,53 +74,46 @@ void XbelWriter::writeToFile(QIODevice *device) writeStartElement(QLatin1String("xbel")); writeAttribute(QLatin1String("version"), QLatin1String("1.0")); - QStandardItem *root = treeModel->invisibleRootItem(); - for (int i = 0; i < root->rowCount(); ++i) - writeData(root->child(i)); - + const QModelIndex &root = bookmarkModel->index(0,0, QModelIndex()); + for (int i = 0; i < bookmarkModel->rowCount(root); ++i) + writeData(bookmarkModel->index(i, 0, root)); writeEndDocument(); } -void XbelWriter::writeData(QStandardItem *child) +void XbelWriter::writeData(const QModelIndex &index) { TRACE_OBJ - Bookmark entry; - entry.title = child->data(Qt::DisplayRole).toString(); - entry.url = child->data(Qt::UserRole + 10).toString(); - - if (entry.url == QLatin1String("Folder")) { - writeStartElement(QLatin1String("folder")); - - entry.folded = !child->data(Qt::UserRole + 11).toBool(); - writeAttribute(QLatin1String("folded"), - entry.folded ? QLatin1String("yes") : QLatin1String("no")); - - writeTextElement(QLatin1String("title"), entry.title); - - for (int i = 0; i < child->rowCount(); ++i) - writeData(child->child(i)); - - writeEndElement(); - } else { - writeStartElement(QLatin1String("bookmark")); - writeAttribute(QLatin1String("href"), entry.url); - writeTextElement(QLatin1String("title"), entry.title); - writeEndElement(); + if (index.isValid()) { + Bookmark entry; + entry.title = index.data().toString(); + entry.url = index.data(UserRoleUrl).toString(); + + if (index.data(UserRoleFolder).toBool()) { + writeStartElement(QLatin1String("folder")); + entry.folded = !index.data(UserRoleExpanded).toBool(); + writeAttribute(QLatin1String("folded"), entry.folded + ? QLatin1String("yes") : QLatin1String("no")); + writeTextElement(QLatin1String("title"), entry.title); + + for (int i = 0; i < bookmarkModel->rowCount(index); ++i) + writeData(bookmarkModel->index(i, 0 , index)); + writeEndElement(); + } else { + writeStartElement(QLatin1String("bookmark")); + writeAttribute(QLatin1String("href"), entry.url); + writeTextElement(QLatin1String("title"), entry.title); + writeEndElement(); + } } } +// -- XbelReader -// XbelReader - - -XbelReader::XbelReader(BookmarkModel *tree, BookmarkModel *list) +XbelReader::XbelReader(BookmarkModel *model) : QXmlStreamReader() - , treeModel(tree) - , listModel(list) + , bookmarkModel(model) { TRACE_OBJ - folderIcon = QApplication::style()->standardIcon(QStyle::SP_DirClosedIcon); - bookmarkIcon = QIcon(QLatin1String(":/trolltech/assistant/images/bookmark.png")); } bool XbelReader::readFromFile(QIODevice *device) @@ -132,7 +128,11 @@ bool XbelReader::readFromFile(QIODevice *device) if (name() == QLatin1String("xbel") && attributes().value(QLatin1String("version")) == QLatin1String("1.0")) { + const QModelIndex &root = bookmarkModel->index(0,0, QModelIndex()); + parents.append(bookmarkModel->addItem(root, true)); readXBEL(); + bookmarkModel->setData(parents.first(), + QDate::currentDate().toString(Qt::ISODate), Qt::EditRole); } else { raiseError(QLatin1String("The file is not an XBEL version 1.0 file.")); } @@ -153,39 +153,22 @@ void XbelReader::readXBEL() if (isStartElement()) { if (name() == QLatin1String("folder")) - readFolder(0); + readFolder(); else if (name() == QLatin1String("bookmark")) - readBookmark(0); + readBookmark(); else readUnknownElement(); } } } -void XbelReader::readUnknownElement() +void XbelReader::readFolder() { TRACE_OBJ - while (!atEnd()) { - readNext(); - - if (isEndElement()) - break; - - if (isStartElement()) - readUnknownElement(); - } -} - -void XbelReader::readFolder(QStandardItem *item) -{ - TRACE_OBJ - QStandardItem *folder = createChildItem(item); - folder->setIcon(folderIcon); - folder->setData(QLatin1String("Folder"), Qt::UserRole + 10); - - bool expanded = - (attributes().value(QLatin1String("folded")) != QLatin1String("no")); - folder->setData(expanded, Qt::UserRole + 11); + parents.append(bookmarkModel->addItem(parents.last(), true)); + bookmarkModel->setData(parents.last(), + attributes().value(QLatin1String("folded")) == QLatin1String("no"), + UserRoleExpanded); while (!atEnd()) { readNext(); @@ -194,26 +177,29 @@ void XbelReader::readFolder(QStandardItem *item) break; if (isStartElement()) { - if (name() == QLatin1String("title")) - folder->setText(readElementText()); - else if (name() == QLatin1String("folder")) - readFolder(folder); + if (name() == QLatin1String("title")) { + bookmarkModel->setData(parents.last(), readElementText(), + Qt::EditRole); + } else if (name() == QLatin1String("folder")) + readFolder(); else if (name() == QLatin1String("bookmark")) - readBookmark(folder); + readBookmark(); else readUnknownElement(); } } + + parents.removeLast(); } -void XbelReader::readBookmark(QStandardItem *item) +void XbelReader::readBookmark() { TRACE_OBJ - QStandardItem *bookmark = createChildItem(item); - bookmark->setIcon(bookmarkIcon); - bookmark->setText(QCoreApplication::tr("Unknown title")); - bookmark->setData(attributes().value(QLatin1String("href")).toString(), - Qt::UserRole + 10); + const QModelIndex &index = bookmarkModel->addItem(parents.last(), false); + if (BookmarkItem* item = bookmarkModel->itemFromIndex(index)) { + item->setData(UserRoleUrl, attributes().value(QLatin1String("href")) + .toString()); + } while (!atEnd()) { readNext(); @@ -223,27 +209,25 @@ void XbelReader::readBookmark(QStandardItem *item) if (isStartElement()) { if (name() == QLatin1String("title")) - bookmark->setText(readElementText()); + bookmarkModel->setData(index, readElementText(), Qt::EditRole); else readUnknownElement(); } } - - listModel->appendRow(bookmark->clone()); } -QStandardItem *XbelReader::createChildItem(QStandardItem *item) +void XbelReader::readUnknownElement() { TRACE_OBJ - QStandardItem *childItem = new QStandardItem(); - childItem->setEditable(false); + while (!atEnd()) { + readNext(); - if (item) - item->appendRow(childItem); - else - treeModel->appendRow(childItem); + if (isEndElement()) + break; - return childItem; + if (isStartElement()) + readUnknownElement(); + } } QT_END_NAMESPACE diff --git a/tools/assistant/tools/assistant/xbelsupport.h b/tools/assistant/tools/assistant/xbelsupport.h index 16f53f5..037415f 100644 --- a/tools/assistant/tools/assistant/xbelsupport.h +++ b/tools/assistant/tools/assistant/xbelsupport.h @@ -42,11 +42,11 @@ #ifndef XBELSUPPORT_H #define XBELSUPPORT_H -#include #include +#include QT_FORWARD_DECLARE_CLASS(QIODevice) -QT_FORWARD_DECLARE_CLASS(QStandardItem) +QT_FORWARD_DECLARE_CLASS(QModelIndex) QT_BEGIN_NAMESPACE @@ -59,31 +59,27 @@ public: void writeToFile(QIODevice *device); private: - void writeData(QStandardItem *item); + void writeData(const QModelIndex &index); private: - BookmarkModel *treeModel; + BookmarkModel *bookmarkModel; }; class XbelReader : public QXmlStreamReader { public: - XbelReader(BookmarkModel *tree, BookmarkModel *list); + XbelReader(BookmarkModel *model); bool readFromFile(QIODevice *device); private: void readXBEL(); + void readFolder(); + void readBookmark(); void readUnknownElement(); - void readFolder(QStandardItem *item); - void readBookmark(QStandardItem *item); - QStandardItem* createChildItem(QStandardItem *item); private: - QIcon folderIcon; - QIcon bookmarkIcon; - - BookmarkModel *treeModel; - BookmarkModel *listModel; + BookmarkModel *bookmarkModel; + QList parents; }; QT_END_NAMESPACE -- cgit v0.12 From 297a36484574f3551f2e6ac5c29ea835709100e1 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 5 Feb 2010 12:23:36 +0100 Subject: doc: Fixed some qdoc warnings. --- doc/src/examples/hellogl_es.qdoc | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/doc/src/examples/hellogl_es.qdoc b/doc/src/examples/hellogl_es.qdoc index fca1150..67a83e0 100644 --- a/doc/src/examples/hellogl_es.qdoc +++ b/doc/src/examples/hellogl_es.qdoc @@ -64,29 +64,6 @@ the OpenGL ES window within the native window manager. In QGLWidget::initializeGL() we initialize OpenGL ES. - \section1 Using OpenGL ES rendering commands - - To update the scene, we reimplment QGLWidget::paintGL(). We use OpenGL ES - rendering commands just like we do with standard OpenGL. Since the OpenGL - ES common light profile only supports fixed point functions, we need to - abstract it somehow. Hence, we define an abstraction layer in - \c{cl_helper.h}. - - \snippet examples/opengl/hellogl_es/cl_helper.h 0 - - Instead of \c glFogxv() or \c glFogfv() we use \c q_glFogv() and to - convert the coordinates of a vertice we use the macro \c f2vt(). That way, - if QT_OPENGL_ES_CL is defined we use the fixed point functions and every - float is converted to fixed point. - - If QT_OPENGL_ES_CL is not defined we use the floating point functions. - - \snippet examples/opengl/hellogl_es/cl_helper.h 1 - - This way we support OpenGL ES Common and Common Light with the same code - and abstract the fact that we use either the floating point functions or - otherwise the fixed point functions. - \section1 Porting OpenGL to OpenGL ES Since OpenGL ES is missing the immediate mode and does not support quads, -- cgit v0.12 From 1b0ad21ab4e476d4285d580eaa5dca8212b82883 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 5 Feb 2010 12:56:35 +0100 Subject: doc: Fixed some qdoc warnings. --- src/opengl/qglshaderprogram.cpp | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/src/opengl/qglshaderprogram.cpp b/src/opengl/qglshaderprogram.cpp index 80b4872..dc722b3 100644 --- a/src/opengl/qglshaderprogram.cpp +++ b/src/opengl/qglshaderprogram.cpp @@ -1555,8 +1555,8 @@ void QGLShaderProgram::setAttributeArray indicates the number of components per vertex: 1, 2, 3, or 4. The array will become active when enableAttributeArray() is called - on the \a location. Otherwise the value specified with - setAttributeValue() for \a location will be used. + on the \a name. Otherwise the value specified with + setAttributeValue() for \a name will be used. The setAttributeBuffer() function can be used to set the attribute array to an offset within a vertex buffer. @@ -1572,15 +1572,16 @@ void QGLShaderProgram::setAttributeArray } /*! - Sets an array of vertex values on the attribute at \a location - in this shader program, starting at a specific \a offset in the + Sets an array of vertex values on the attribute at \a location in + this shader program, starting at a specific \a offset in the currently bound vertex buffer. The \a stride indicates the number of bytes between vertices. A default \a stride value of zero - indicates that the vertices are densely packed in \a values. + indicates that the vertices are densely packed in the value array. - The \a type indicates the type of elements in the \a values array, - usually \c{GL_FLOAT}, \c{GL_UNSIGNED_BYTE}, etc. The \a tupleSize - indicates the number of components per vertex: 1, 2, 3, or 4. + The \a type indicates the type of elements in the vertex value + array, usually \c{GL_FLOAT}, \c{GL_UNSIGNED_BYTE}, etc. The \a + tupleSize indicates the number of components per vertex: 1, 2, 3, + or 4. The array will become active when enableAttributeArray() is called on the \a location. Otherwise the value specified with @@ -1607,15 +1608,16 @@ void QGLShaderProgram::setAttributeBuffer in this shader program, starting at a specific \a offset in the currently bound vertex buffer. The \a stride indicates the number of bytes between vertices. A default \a stride value of zero - indicates that the vertices are densely packed in \a values. + indicates that the vertices are densely packed in the value array. - The \a type indicates the type of elements in the \a values array, - usually \c{GL_FLOAT}, \c{GL_UNSIGNED_BYTE}, etc. The \a tupleSize - indicates the number of components per vertex: 1, 2, 3, or 4. + The \a type indicates the type of elements in the vertex value + array, usually \c{GL_FLOAT}, \c{GL_UNSIGNED_BYTE}, etc. The \a + tupleSize indicates the number of components per vertex: 1, 2, 3, + or 4. The array will become active when enableAttributeArray() is called - on the \a location. Otherwise the value specified with - setAttributeValue() for \a location will be used. + on the \a name. Otherwise the value specified with + setAttributeValue() for \a name will be used. \sa setAttributeArray() \since 4.7 -- cgit v0.12 From 9a561bfe957cdbb906df263eb4f7e9e1c7e47117 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 5 Feb 2010 13:19:44 +0100 Subject: doc: Fixed some qdoc warnings. --- doc/src/deployment/deployment.qdoc | 2 -- 1 file changed, 2 deletions(-) diff --git a/doc/src/deployment/deployment.qdoc b/doc/src/deployment/deployment.qdoc index bc6ae98..005f066 100644 --- a/doc/src/deployment/deployment.qdoc +++ b/doc/src/deployment/deployment.qdoc @@ -109,8 +109,6 @@ \row \o \l {Phonon Module}{Phonon} \o \l {Qt3Support} - \o \l {} - \o \l {} \endtable Since Qt is not a system library, it has to be redistributed along -- cgit v0.12 From a767da6f2d0fbee707f5c2fe896fa501b3da6b07 Mon Sep 17 00:00:00 2001 From: Thomas Sondergaard Date: Fri, 5 Feb 2010 13:24:13 +0100 Subject: Fix for number entry in QDateTimeEntry using Shift+KeyPad (QTBUG-7842) Merge-request: 2300 Reviewed-by: Olivier Goffart --- src/gui/widgets/qdatetimeedit.cpp | 2 +- tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/widgets/qdatetimeedit.cpp b/src/gui/widgets/qdatetimeedit.cpp index 762db86..50fa9c9 100644 --- a/src/gui/widgets/qdatetimeedit.cpp +++ b/src/gui/widgets/qdatetimeedit.cpp @@ -1175,7 +1175,7 @@ void QDateTimeEdit::keyPressEvent(QKeyEvent *event) return; } } QAbstractSpinBox::keyPressEvent(event); - if (select && !(event->modifiers() & Qt::ShiftModifier) && !d->edit->hasSelectedText()) { + if (select && !d->edit->hasSelectedText()) { if (inserted && d->sectionAt(d->edit->cursorPosition()) == QDateTimeParser::NoSectionIndex) { QString str = d->displayText(); int pos = d->edit->cursorPosition(); diff --git a/tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp b/tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp index b92b873..558d4de 100644 --- a/tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp +++ b/tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp @@ -3357,6 +3357,8 @@ void tst_QDateTimeEdit::keypadAutoAdvance_data() QTest::addColumn("modifiers"); QTest::newRow("None") << (Qt::KeyboardModifiers)Qt::NoModifier; QTest::newRow("Keypad") << (Qt::KeyboardModifiers)Qt::KeypadModifier; + // QTBUG-7842: Using KeyPad with shift (numlock off) + QTest::newRow("Keypad+Shift") << (Qt::KeyboardModifiers)(Qt::KeypadModifier|Qt::ShiftModifier); } -- cgit v0.12 From cc1f88b869f23bb2855c1ada0fc6187ca21413b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= Date: Fri, 5 Feb 2010 14:29:53 +0100 Subject: A few trivial optimizations Don't use QHash/QMap::values/keys unnecessarily. Reviewed-by: Alessandro Portale --- src/corelib/io/qfilesystemwatcher_inotify.cpp | 2 +- src/corelib/io/qfilesystemwatcher_kqueue.cpp | 2 +- src/gui/styles/qs60style_simulated.cpp | 12 ++++++------ src/plugins/accessible/widgets/qaccessiblewidgets.cpp | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/corelib/io/qfilesystemwatcher_inotify.cpp b/src/corelib/io/qfilesystemwatcher_inotify.cpp index a7dc8fa..4740a89 100644 --- a/src/corelib/io/qfilesystemwatcher_inotify.cpp +++ b/src/corelib/io/qfilesystemwatcher_inotify.cpp @@ -235,7 +235,7 @@ QInotifyFileSystemWatcherEngine::QInotifyFileSystemWatcherEngine(int fd) QInotifyFileSystemWatcherEngine::~QInotifyFileSystemWatcherEngine() { - foreach (int id, pathToID.values()) + foreach (int id, pathToID) inotify_rm_watch(inotifyFd, id < 0 ? -id : id); ::close(inotifyFd); diff --git a/src/corelib/io/qfilesystemwatcher_kqueue.cpp b/src/corelib/io/qfilesystemwatcher_kqueue.cpp index f088ded..8396481 100644 --- a/src/corelib/io/qfilesystemwatcher_kqueue.cpp +++ b/src/corelib/io/qfilesystemwatcher_kqueue.cpp @@ -109,7 +109,7 @@ QKqueueFileSystemWatcherEngine::~QKqueueFileSystemWatcherEngine() close(kqpipe[0]); close(kqpipe[1]); - foreach (int id, pathToID.values()) + foreach (int id, pathToID) ::close(id < 0 ? -id : id); } diff --git a/src/gui/styles/qs60style_simulated.cpp b/src/gui/styles/qs60style_simulated.cpp index bd43eb7..f1da1c5 100644 --- a/src/gui/styles/qs60style_simulated.cpp +++ b/src/gui/styles/qs60style_simulated.cpp @@ -94,12 +94,12 @@ bool saveThemeToBlob(const QString &themeBlob, dataOut << color; } - const int picturesCount = partPictures.count(); - dataOut << picturesCount; - foreach (const QString &key, partPictures.keys()) { - const QPicture picture = partPictures.value(key); - dataOut << key; - dataOut << picture; + dataOut << partPictures.count(); + QHashIterator i(partPictures); + while (i.hasNext()) { + i.next(); + dataOut << i.key(); + dataOut << i.value(); // the QPicture } QDataStream blobOut(&blob); diff --git a/src/plugins/accessible/widgets/qaccessiblewidgets.cpp b/src/plugins/accessible/widgets/qaccessiblewidgets.cpp index ad33d0b..499eb1d 100644 --- a/src/plugins/accessible/widgets/qaccessiblewidgets.cpp +++ b/src/plugins/accessible/widgets/qaccessiblewidgets.cpp @@ -176,7 +176,7 @@ static inline QWidget *mdiAreaNavigate(QWidget *area, int minimumDistance = INT_MAX; QWidget *target = 0; - foreach (QWidget *candidate, candidates.values()) { + foreach (QWidget *candidate, candidates) { switch (relation) { case QAccessible::Up: case QAccessible::Down: -- cgit v0.12 From f75d55f1a71cae9864ca4bf12c92fcd9e34ed651 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 22 Jan 2010 14:01:54 +0100 Subject: Revert "Prevent widgets with WA_DontShowOnScreen from keeping the app running" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 424eabac69df3234006669a69ca0ec9653e4ce63. The commit changed behavior of WA_QuitOnClose when WA_DontShowOnScreen was used, but WA_DontShowOnScreen should only have visual effects. Reviewed-by: Bjørn Erik Nilsen --- src/gui/kernel/qwidget.cpp | 20 +++++++++---------- tests/auto/qapplication/tst_qapplication.cpp | 30 ---------------------------- 2 files changed, 9 insertions(+), 41 deletions(-) diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index e678220..884447d 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -7573,23 +7573,21 @@ bool QWidgetPrivate::close_helper(CloseMode mode) if (isMain) QApplication::quit(); #endif - // Attempt to close the application only if this widget has the - // WA_QuitOnClose flag set set and has a non-visible parent - quitOnClose = quitOnClose && (parentWidget.isNull() || !parentWidget->isVisible() || parentWidget->testAttribute(Qt::WA_DontShowOnScreen)); + // Attempt to close the application only if this has WA_QuitOnClose set and a non-visible parent + quitOnClose = quitOnClose && (parentWidget.isNull() || !parentWidget->isVisible()); if (quitOnClose) { - // If there is no non-withdrawn primary window left (except - // the ones without QuitOnClose or with WA_DontShowOnScreen), - // we emit the lastWindowClosed signal + /* if there is no non-withdrawn primary window left (except + the ones without QuitOnClose), we emit the lastWindowClosed + signal */ QWidgetList list = QApplication::topLevelWidgets(); bool lastWindowClosed = true; for (int i = 0; i < list.size(); ++i) { QWidget *w = list.at(i); - if ((w->isVisible() && !w->testAttribute(Qt::WA_DontShowOnScreen)) - && !w->parentWidget() && w->testAttribute(Qt::WA_QuitOnClose)) { - lastWindowClosed = false; - break; - } + if (!w->isVisible() || w->parentWidget() || !w->testAttribute(Qt::WA_QuitOnClose)) + continue; + lastWindowClosed = false; + break; } if (lastWindowClosed) QApplicationPrivate::emitLastWindowClosed(); diff --git a/tests/auto/qapplication/tst_qapplication.cpp b/tests/auto/qapplication/tst_qapplication.cpp index b464867..459ac2b 100644 --- a/tests/auto/qapplication/tst_qapplication.cpp +++ b/tests/auto/qapplication/tst_qapplication.cpp @@ -706,36 +706,6 @@ void tst_QApplication::quitOnLastWindowClosed() QSignalSpy spy(&app, SIGNAL(aboutToQuit())); QSignalSpy spy2(&timer, SIGNAL(timeout())); - QPointer mainWindow = new QMainWindow; - QPointer invisibleTopLevelWidget = new QWidget; - invisibleTopLevelWidget->setAttribute(Qt::WA_DontShowOnScreen); - - QVERIFY(app.quitOnLastWindowClosed()); - QVERIFY(mainWindow->testAttribute(Qt::WA_QuitOnClose)); - QVERIFY(invisibleTopLevelWidget->testAttribute(Qt::WA_QuitOnClose)); - QVERIFY(invisibleTopLevelWidget->testAttribute(Qt::WA_DontShowOnScreen)); - - mainWindow->show(); - invisibleTopLevelWidget->show(); - - timer.start(); - QTimer::singleShot(1000, mainWindow, SLOT(close())); // This should quit the application - QTimer::singleShot(2000, &app, SLOT(quit())); // This makes sure we quit even if it didn't - - app.exec(); - - QCOMPARE(spy.count(), 1); - QVERIFY(spy2.count() < 15); // Should be around 10 if closing caused the quit - } - { - int argc = 0; - QApplication app(argc, 0, QApplication::GuiServer); - QTimer timer; - timer.setInterval(100); - - QSignalSpy spy(&app, SIGNAL(aboutToQuit())); - QSignalSpy spy2(&timer, SIGNAL(timeout())); - QPointer mainWindow = new CloseEventTestWindow; QVERIFY(app.quitOnLastWindowClosed()); -- cgit v0.12 From b0fae930224894584230fc5041b65c9bc207fbe3 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Fri, 5 Feb 2010 15:56:05 +0100 Subject: Doc: add \since 4.7 to new functions. --- src/multimedia/audio/qaudioformat.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/multimedia/audio/qaudioformat.cpp b/src/multimedia/audio/qaudioformat.cpp index e349b9e..86d72f6 100644 --- a/src/multimedia/audio/qaudioformat.cpp +++ b/src/multimedia/audio/qaudioformat.cpp @@ -225,6 +225,8 @@ bool QAudioFormat::isValid() const /*! Sets the sample rate to \a samplerate Hertz. + + \since 4.7 */ void QAudioFormat::setSampleRate(int samplerate) @@ -245,6 +247,8 @@ void QAudioFormat::setFrequency(int frequency) /*! Returns the current sample rate in Hertz. + + \since 4.7 */ int QAudioFormat::sampleRate() const @@ -265,6 +269,8 @@ int QAudioFormat::frequency() const /*! Sets the channel count to \a channels. + + \since 4.7 */ void QAudioFormat::setChannelCount(int channels) @@ -285,6 +291,8 @@ void QAudioFormat::setChannels(int channels) /*! Returns the current channel count value. + + \since 4.7 */ int QAudioFormat::channelCount() const -- cgit v0.12 From 00d08740a1a5234c7f73eb634dcd45092b97dacd Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Fri, 5 Feb 2010 16:11:58 +0100 Subject: Doc: more \since 4.7 --- src/multimedia/audio/qaudiodeviceinfo.cpp | 4 ++++ src/testlib/qbenchmark.cpp | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/multimedia/audio/qaudiodeviceinfo.cpp b/src/multimedia/audio/qaudiodeviceinfo.cpp index 19b4669..ff04b4e 100644 --- a/src/multimedia/audio/qaudiodeviceinfo.cpp +++ b/src/multimedia/audio/qaudiodeviceinfo.cpp @@ -260,6 +260,8 @@ QStringList QAudioDeviceInfo::supportedCodecs() const /*! Returns a list of supported sample rates. + + \since 4.7 */ QList QAudioDeviceInfo::supportedSampleRates() const @@ -280,6 +282,8 @@ QList QAudioDeviceInfo::supportedFrequencies() const /*! Returns a list of supported channel counts. + + \since 4.7 */ QList QAudioDeviceInfo::supportedChannelCounts() const diff --git a/src/testlib/qbenchmark.cpp b/src/testlib/qbenchmark.cpp index 95e2658..52b5287 100644 --- a/src/testlib/qbenchmark.cpp +++ b/src/testlib/qbenchmark.cpp @@ -282,6 +282,8 @@ quint64 QTest::endBenchmarkMeasurement() Note that the -iterations command line argument has no effect on test functions without the QBENCHMARK macro. + + \since 4.7 */ void QTest::setBenchmarkResult(qreal result, QTest::QBenchmarkMetric metric) { -- cgit v0.12 From 1efb2693b15f23f269be1db393a83af132924e06 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Fri, 5 Feb 2010 15:25:23 +0100 Subject: Added new mouse cursor types. Added Qt::DragCopyCursor, DragMoveCursor and DragLinkCursor that are already used internally for drag-n-drop, but were not exposed before. On X11 made them use themed cursors through the Xcursor library. Drag-n-drop now use these new cursors. Inspired-by: David Benjamin MR#2215 Reviewed-by: Bradley T. Hughes --- src/corelib/global/qnamespace.h | 5 +- src/corelib/global/qnamespace.qdoc | 9 ++ src/gui/image/qpixmap_x11.cpp | 26 ++-- src/gui/image/qpixmap_x11_p.h | 2 + src/gui/kernel/qapplication.cpp | 242 +++++++++++++++++++++++++++++++++++++ src/gui/kernel/qapplication_p.h | 11 ++ src/gui/kernel/qcursor.cpp | 6 + src/gui/kernel/qcursor_mac.mm | 24 ++++ src/gui/kernel/qcursor_win.cpp | 7 ++ src/gui/kernel/qcursor_x11.cpp | 50 +++++++- src/gui/kernel/qdnd.cpp | 220 ++------------------------------- src/gui/kernel/qdnd_p.h | 4 +- src/gui/kernel/qdnd_x11.cpp | 6 +- 13 files changed, 381 insertions(+), 231 deletions(-) diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index 177bee4..35ff8e7 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -1235,7 +1235,10 @@ public: BusyCursor, OpenHandCursor, ClosedHandCursor, - LastCursor = ClosedHandCursor, + DragCopyCursor, + DragMoveCursor, + DragLinkCursor, + LastCursor = DragLinkCursor, BitmapCursor = 24, CustomCursor = 25 diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index 6627c76..3d49d60 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -2508,6 +2508,15 @@ operations that allow the user to interact with the application while they are performed in the background. + \value DragMoveCursor + A cursor that is usually used when dragging an item. + \value DragCopyCursor + A cursor that is usually used when dragging an item + to copy it. + \value DragLinkCursor + A cursor that is usually used when dragging an item + to make a link to it. + \value BitmapCursor \omitvalue LastCursor \omitvalue CustomCursor diff --git a/src/gui/image/qpixmap_x11.cpp b/src/gui/image/qpixmap_x11.cpp index 0e66e09..4de5bc4 100644 --- a/src/gui/image/qpixmap_x11.cpp +++ b/src/gui/image/qpixmap_x11.cpp @@ -1141,7 +1141,7 @@ void QX11PixmapData::fromImage(const QImage &img, } } -void QX11PixmapData::bitmapFromImage(const QImage &image) +Qt::HANDLE QX11PixmapData::createBitmapFromImage(const QImage &image) { QImage img = image.convertToFormat(QImage::Format_MonoLSB); const QRgb c0 = QColor(Qt::black).rgb(); @@ -1154,10 +1154,8 @@ void QX11PixmapData::bitmapFromImage(const QImage &image) char *bits; uchar *tmp_bits; - w = img.width(); - h = img.height(); - d = 1; - is_null = (w <= 0 || h <= 0); + int w = img.width(); + int h = img.height(); int bpl = (w + 7) / 8; int ibpl = img.bytesPerLine(); if (bpl != ibpl) { @@ -1176,18 +1174,26 @@ void QX11PixmapData::bitmapFromImage(const QImage &image) bits = (char *)img.bits(); tmp_bits = 0; } - hd = (Qt::HANDLE)XCreateBitmapFromData(xinfo.display(), - RootWindow(xinfo.display(), xinfo.screen()), + Qt::HANDLE hd = (Qt::HANDLE)XCreateBitmapFromData(X11->display, + QX11Info::appRootWindow(), bits, w, h); + if (tmp_bits) // Avoid purify complaint + delete [] tmp_bits; + return hd; +} +void QX11PixmapData::bitmapFromImage(const QImage &image) +{ + w = image.width(); + h = image.height(); + d = 1; + is_null = (w <= 0 || h <= 0); + hd = createBitmapFromImage(image); #ifndef QT_NO_XRENDER if (X11->use_xrender) picture = XRenderCreatePicture(X11->display, hd, XRenderFindStandardFormat(X11->display, PictStandardA1), 0, 0); #endif // QT_NO_XRENDER - - if (tmp_bits) // Avoid purify complaint - delete [] tmp_bits; } void QX11PixmapData::fill(const QColor &fillColor) diff --git a/src/gui/image/qpixmap_x11_p.h b/src/gui/image/qpixmap_x11_p.h index 20fb654..0c0a9bd 100644 --- a/src/gui/image/qpixmap_x11_p.h +++ b/src/gui/image/qpixmap_x11_p.h @@ -92,6 +92,8 @@ public: Qt::HANDLE handle() const { return hd; } Qt::HANDLE x11ConvertToDefaultDepth(); + static Qt::HANDLE createBitmapFromImage(const QImage &image); + protected: int metric(QPaintDevice::PaintDeviceMetric metric) const; diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index b9ea540..1fc1b45 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -182,6 +182,15 @@ QApplicationPrivate::QApplicationPrivate(int &argc, char **argv, QApplication::T gestureManager = 0; gestureWidget = 0; +#if defined(Q_WS_X11) || defined(Q_WS_WIN) + move_cursor = 0; + copy_cursor = 0; + link_cursor = 0; +#endif +#if defined(Q_WS_WIN) + ignore_cursor = 0; +#endif + if (!self) self = this; } @@ -1032,6 +1041,15 @@ QApplication::~QApplication() qt_clipboard = 0; #endif +#if defined(Q_WS_X11) || defined(Q_WS_WIN) + delete d->move_cursor; d->move_cursor = 0; + delete d->copy_cursor; d->copy_cursor = 0; + delete d->link_cursor; d->link_cursor = 0; +#endif +#if defined(Q_WS_WIN) + delete d->ignore_cursor; d->ignore_cursor = 0; +#endif + delete QWidgetPrivate::mapper; QWidgetPrivate::mapper = 0; @@ -5689,6 +5707,230 @@ QGestureManager* QGestureManager::instance() return qAppPriv->gestureManager; } +#if defined(Q_WS_X11) || defined(Q_WS_WIN) +// These pixmaps approximate the images in the Windows User Interface Guidelines. + +// XPM + +static const char * const move_xpm[] = { +"11 20 3 1", +". c None", +#if defined(Q_WS_WIN) +"a c #000000", +"X c #FFFFFF", // Windows cursor is traditionally white +#else +"a c #FFFFFF", +"X c #000000", // X11 cursor is traditionally black +#endif +"aa.........", +"aXa........", +"aXXa.......", +"aXXXa......", +"aXXXXa.....", +"aXXXXXa....", +"aXXXXXXa...", +"aXXXXXXXa..", +"aXXXXXXXXa.", +"aXXXXXXXXXa", +"aXXXXXXaaaa", +"aXXXaXXa...", +"aXXaaXXa...", +"aXa..aXXa..", +"aa...aXXa..", +"a.....aXXa.", +"......aXXa.", +".......aXXa", +".......aXXa", +"........aa."}; + +#ifdef Q_WS_WIN +/* XPM */ +static const char * const ignore_xpm[] = { +"24 30 3 1", +". c None", +"a c #000000", +"X c #FFFFFF", +"aa......................", +"aXa.....................", +"aXXa....................", +"aXXXa...................", +"aXXXXa..................", +"aXXXXXa.................", +"aXXXXXXa................", +"aXXXXXXXa...............", +"aXXXXXXXXa..............", +"aXXXXXXXXXa.............", +"aXXXXXXaaaa.............", +"aXXXaXXa................", +"aXXaaXXa................", +"aXa..aXXa...............", +"aa...aXXa...............", +"a.....aXXa..............", +"......aXXa.....XXXX.....", +".......aXXa..XXaaaaXX...", +".......aXXa.XaaaaaaaaX..", +"........aa.XaaaXXXXaaaX.", +"...........XaaaaX..XaaX.", +"..........XaaXaaaX..XaaX", +"..........XaaXXaaaX.XaaX", +"..........XaaX.XaaaXXaaX", +"..........XaaX..XaaaXaaX", +"...........XaaX..XaaaaX.", +"...........XaaaXXXXaaaX.", +"............XaaaaaaaaX..", +".............XXaaaaXX...", +"...............XXXX....."}; +#endif + +/* XPM */ +static const char * const copy_xpm[] = { +"24 30 3 1", +". c None", +"a c #000000", +"X c #FFFFFF", +#if defined(Q_WS_WIN) // Windows cursor is traditionally white +"aa......................", +"aXa.....................", +"aXXa....................", +"aXXXa...................", +"aXXXXa..................", +"aXXXXXa.................", +"aXXXXXXa................", +"aXXXXXXXa...............", +"aXXXXXXXXa..............", +"aXXXXXXXXXa.............", +"aXXXXXXaaaa.............", +"aXXXaXXa................", +"aXXaaXXa................", +"aXa..aXXa...............", +"aa...aXXa...............", +"a.....aXXa..............", +"......aXXa..............", +".......aXXa.............", +".......aXXa.............", +"........aa...aaaaaaaaaaa", +#else +"XX......................", +"XaX.....................", +"XaaX....................", +"XaaaX...................", +"XaaaaX..................", +"XaaaaaX.................", +"XaaaaaaX................", +"XaaaaaaaX...............", +"XaaaaaaaaX..............", +"XaaaaaaaaaX.............", +"XaaaaaaXXXX.............", +"XaaaXaaX................", +"XaaXXaaX................", +"XaX..XaaX...............", +"XX...XaaX...............", +"X.....XaaX..............", +"......XaaX..............", +".......XaaX.............", +".......XaaX.............", +"........XX...aaaaaaaaaaa", +#endif +".............aXXXXXXXXXa", +".............aXXXXXXXXXa", +".............aXXXXaXXXXa", +".............aXXXXaXXXXa", +".............aXXaaaaaXXa", +".............aXXXXaXXXXa", +".............aXXXXaXXXXa", +".............aXXXXXXXXXa", +".............aXXXXXXXXXa", +".............aaaaaaaaaaa"}; + +/* XPM */ +static const char * const link_xpm[] = { +"24 30 3 1", +". c None", +"a c #000000", +"X c #FFFFFF", +#if defined(Q_WS_WIN) // Windows cursor is traditionally white +"aa......................", +"aXa.....................", +"aXXa....................", +"aXXXa...................", +"aXXXXa..................", +"aXXXXXa.................", +"aXXXXXXa................", +"aXXXXXXXa...............", +"aXXXXXXXXa..............", +"aXXXXXXXXXa.............", +"aXXXXXXaaaa.............", +"aXXXaXXa................", +"aXXaaXXa................", +"aXa..aXXa...............", +"aa...aXXa...............", +"a.....aXXa..............", +"......aXXa..............", +".......aXXa.............", +".......aXXa.............", +"........aa...aaaaaaaaaaa", +#else +"XX......................", +"XaX.....................", +"XaaX....................", +"XaaaX...................", +"XaaaaX..................", +"XaaaaaX.................", +"XaaaaaaX................", +"XaaaaaaaX...............", +"XaaaaaaaaX..............", +"XaaaaaaaaaX.............", +"XaaaaaaXXXX.............", +"XaaaXaaX................", +"XaaXXaaX................", +"XaX..XaaX...............", +"XX...XaaX...............", +"X.....XaaX..............", +"......XaaX..............", +".......XaaX.............", +".......XaaX.............", +"........XX...aaaaaaaaaaa", +#endif +".............aXXXXXXXXXa", +".............aXXXaaaaXXa", +".............aXXXXaaaXXa", +".............aXXXaaaaXXa", +".............aXXaaaXaXXa", +".............aXXaaXXXXXa", +".............aXXaXXXXXXa", +".............aXXXaXXXXXa", +".............aXXXXXXXXXa", +".............aaaaaaaaaaa"}; + +QPixmap QApplicationPrivate::getPixmapCursor(Qt::CursorShape cshape) +{ + if (!move_cursor) { + move_cursor = new QPixmap((const char **)move_xpm); + copy_cursor = new QPixmap((const char **)copy_xpm); + link_cursor = new QPixmap((const char **)link_xpm); +#ifdef Q_WS_WIN + ignore_cursor = new QPixmap((const char **)ignore_xpm); +#endif + } + + switch (cshape) { + case Qt::DragMoveCursor: + return *move_cursor; + case Qt::DragCopyCursor: + return *copy_cursor; + case Qt::DragLinkCursor: + return *link_cursor; +#ifdef Q_WS_WIN + case Qt::ForbiddenCursor: + return *ignore_cursor; +#endif + default: + break; + } + return QPixmap(); +} +#endif + QT_END_NAMESPACE #include "moc_qapplication.cpp" diff --git a/src/gui/kernel/qapplication_p.h b/src/gui/kernel/qapplication_p.h index 59565d4..0764553 100644 --- a/src/gui/kernel/qapplication_p.h +++ b/src/gui/kernel/qapplication_p.h @@ -518,6 +518,17 @@ public: QGestureManager *gestureManager; QWidget *gestureWidget; +#if defined(Q_WS_X11) || defined(Q_WS_WIN) + QPixmap *move_cursor; + QPixmap *copy_cursor; + QPixmap *link_cursor; +#endif +#if defined(Q_WS_WIN) + QPixmap *ignore_cursor; +#endif +#if defined(Q_WS_X11) || defined(Q_WS_WIN) + QPixmap getPixmapCursor(Qt::CursorShape cshape); +#endif QMap > widgetForTouchPointId; QMap appCurrentTouchPoints; diff --git a/src/gui/kernel/qcursor.cpp b/src/gui/kernel/qcursor.cpp index 0f0470c..f38e4f5 100644 --- a/src/gui/kernel/qcursor.cpp +++ b/src/gui/kernel/qcursor.cpp @@ -141,6 +141,12 @@ QT_BEGIN_NAMESPACE \o Qt::WhatsThisCursor \o \c whats_this \o \inlineimage cursor-closedhand.png \o Qt::ClosedHandCursor \o \c closedhand + \row \o + \o Qt::DragMoveCursor \o \c dnd-move or \c move + \o + \o Qt::DragCopyCursor \o \c dnd-copy or \c copy + \row \o + \o Qt::DragLinkCursor \o \c dnd-link or \c link \endtable \sa QWidget, {fowler}{GUI Design Handbook: Cursors} diff --git a/src/gui/kernel/qcursor_mac.mm b/src/gui/kernel/qcursor_mac.mm index 48bb9cc..cfebf60 100644 --- a/src/gui/kernel/qcursor_mac.mm +++ b/src/gui/kernel/qcursor_mac.mm @@ -424,6 +424,18 @@ void QCursorData::update() type = QCursorData::TYPE_ThemeCursor; curs.cp.nscursor = [NSCursor closedHandCursor]; break; + case Qt::DragCopyCursor: + type = QCursorData::TYPE_ThemeCursor; + curs.cp.nscursor = [NSCursor dragCopyCursor]; + break; + case Qt::DragMoveCursor: + type = QCursorData::TYPE_ThemeCursor; + curs.cp.nscursor = [NSCursor arrowCursor]; + break; + case Qt::DragLinkCursor: + type = QCursorData::TYPE_ThemeCursor; + curs.cp.nscursor = [NSCursor dragLinkCursor]; + break; #define QT_USE_APPROXIMATE_CURSORS #ifdef QT_USE_APPROXIMATE_CURSORS case Qt::SizeVerCursor: @@ -519,6 +531,18 @@ void QCursorData::update() type = QCursorData::TYPE_ThemeCursor; curs.tc.curs = kThemeClosedHandCursor; break; + case Qt::DragMoveCursor: + type = QCursorData::TYPE_ThemeCursor; + curs.tc.curs = kThemeArrowCursor; + break; + case Qt::DragCopyCursor: + type = QCursorData::TYPE_ThemeCursor; + curs.tc.curs = kThemeCopyArrowCursor; + break; + case Qt::DragLinkCursor: + type = QCursorData::TYPE_ThemeCursor; + curs.tc.curs = kThemeAliasArrowCursor; + break; #define QT_USE_APPROXIMATE_CURSORS #ifdef QT_USE_APPROXIMATE_CURSORS case Qt::SizeVerCursor: diff --git a/src/gui/kernel/qcursor_win.cpp b/src/gui/kernel/qcursor_win.cpp index 6f651d4..ae1c004 100644 --- a/src/gui/kernel/qcursor_win.cpp +++ b/src/gui/kernel/qcursor_win.cpp @@ -47,6 +47,7 @@ #include #include +#include QT_BEGIN_NAMESPACE @@ -470,6 +471,12 @@ void QCursorData::update() #endif return; } + case Qt::DragCopyCursor: + case Qt::DragMoveCursor: + case Qt::DragLinkCursor: { + QPixmap pixmap = QApplicationPrivate::instance()->getPixmapCursor(cshape); + hcurs = create32BitCursor(pixmap, hx, hy); + } default: qWarning("QCursor::update: Invalid cursor shape %d", cshape); return; diff --git a/src/gui/kernel/qcursor_x11.cpp b/src/gui/kernel/qcursor_x11.cpp index 3e83363..4e871a6 100644 --- a/src/gui/kernel/qcursor_x11.cpp +++ b/src/gui/kernel/qcursor_x11.cpp @@ -39,9 +39,11 @@ ** ****************************************************************************/ +#include #include #include #include +#include #include #include #include @@ -57,6 +59,7 @@ #endif // QT_NO_XFIXES #include "qx11info_x11.h" +#include QT_BEGIN_NAMESPACE @@ -262,12 +265,31 @@ void QCursorData::update() "whats_this", "left_ptr_watch", "openhand", - "closedhand" + "closedhand", + "copy", + "move", + "link" }; #ifndef QT_NO_XCURSOR - if (X11->ptrXcursorLibraryLoadCursor) - hcurs = X11->ptrXcursorLibraryLoadCursor(dpy, cursorNames[cshape]); + if (X11->ptrXcursorLibraryLoadCursor) { + // special case for non-standard dnd-* cursors + switch (cshape) { + case Qt::DragCopyCursor: + hcurs = X11->ptrXcursorLibraryLoadCursor(dpy, "dnd-copy"); + break; + case Qt::DragMoveCursor: + hcurs = X11->ptrXcursorLibraryLoadCursor(dpy, "dnd-move"); + break; + case Qt::DragLinkCursor: + hcurs = X11->ptrXcursorLibraryLoadCursor(dpy, "dnd-link"); + break; + default: + break; + } + if (!hcurs) + hcurs = X11->ptrXcursorLibraryLoadCursor(dpy, cursorNames[cshape]); + } if (hcurs) return; #endif // QT_NO_XCURSOR @@ -504,6 +526,19 @@ void QCursorData::update() pm = XCreateBitmapFromData(dpy, rootwin, open ? openhand_bits : closedhand_bits, 16, 16); pmm = XCreateBitmapFromData(dpy, rootwin, open ? openhandm_bits : closedhandm_bits, 16, 16); hcurs = XCreatePixmapCursor(dpy, pm, pmm, &fg, &bg, 8, 8); + } else if (cshape == Qt::DragCopyCursor || cshape == Qt::DragMoveCursor + || cshape == Qt::DragLinkCursor) { + XColor bg, fg; + bg.red = 255 << 8; + bg.green = 255 << 8; + bg.blue = 255 << 8; + fg.red = 0; + fg.green = 0; + fg.blue = 0; + QImage image = QApplicationPrivate::instance()->getPixmapCursor(cshape).toImage(); + pm = QX11PixmapData::createBitmapFromImage(image); + pmm = QX11PixmapData::createBitmapFromImage(image.createAlphaMask().convertToFormat(QImage::Format_MonoLSB)); + hcurs = XCreatePixmapCursor(dpy, pm, pmm, &fg, &bg, 8, 8); } if (hcurs) @@ -577,6 +612,15 @@ void QCursorData::update() case Qt::BusyCursor: sh = XC_watch; break; + case Qt::DragCopyCursor: + sh = XC_tcross; + break; + case Qt::DragLinkCursor: + sh = XC_center_ptr; + break; + case Qt::DragMoveCursor: + sh = XC_top_left_arrow; + break; #endif /* QT_USE_APPROXIMATE_CURSORS */ default: qWarning("QCursor::update: Invalid cursor shape %d", cshape); diff --git a/src/gui/kernel/qdnd.cpp b/src/gui/kernel/qdnd.cpp index 21438a8..82708ef 100644 --- a/src/gui/kernel/qdnd.cpp +++ b/src/gui/kernel/qdnd.cpp @@ -60,204 +60,12 @@ #include "qdebug.h" #include +#include + #ifndef QT_NO_DRAGANDDROP QT_BEGIN_NAMESPACE -// These pixmaps approximate the images in the Windows User Interface Guidelines. - -// XPM - -static const char * const move_xpm[] = { -"11 20 3 1", -". c None", -#if defined(Q_WS_WIN) -"a c #000000", -"X c #FFFFFF", // Windows cursor is traditionally white -#else -"a c #FFFFFF", -"X c #000000", // X11 cursor is traditionally black -#endif -"aa.........", -"aXa........", -"aXXa.......", -"aXXXa......", -"aXXXXa.....", -"aXXXXXa....", -"aXXXXXXa...", -"aXXXXXXXa..", -"aXXXXXXXXa.", -"aXXXXXXXXXa", -"aXXXXXXaaaa", -"aXXXaXXa...", -"aXXaaXXa...", -"aXa..aXXa..", -"aa...aXXa..", -"a.....aXXa.", -"......aXXa.", -".......aXXa", -".......aXXa", -"........aa."}; - -#ifdef Q_WS_WIN -/* XPM */ -static const char * const ignore_xpm[] = { -"24 30 3 1", -". c None", -"a c #000000", -"X c #FFFFFF", -"aa......................", -"aXa.....................", -"aXXa....................", -"aXXXa...................", -"aXXXXa..................", -"aXXXXXa.................", -"aXXXXXXa................", -"aXXXXXXXa...............", -"aXXXXXXXXa..............", -"aXXXXXXXXXa.............", -"aXXXXXXaaaa.............", -"aXXXaXXa................", -"aXXaaXXa................", -"aXa..aXXa...............", -"aa...aXXa...............", -"a.....aXXa..............", -"......aXXa.....XXXX.....", -".......aXXa..XXaaaaXX...", -".......aXXa.XaaaaaaaaX..", -"........aa.XaaaXXXXaaaX.", -"...........XaaaaX..XaaX.", -"..........XaaXaaaX..XaaX", -"..........XaaXXaaaX.XaaX", -"..........XaaX.XaaaXXaaX", -"..........XaaX..XaaaXaaX", -"...........XaaX..XaaaaX.", -"...........XaaaXXXXaaaX.", -"............XaaaaaaaaX..", -".............XXaaaaXX...", -"...............XXXX....."}; -#endif - -/* XPM */ -static const char * const copy_xpm[] = { -"24 30 3 1", -". c None", -"a c #000000", -"X c #FFFFFF", -#if defined(Q_WS_WIN) // Windows cursor is traditionally white -"aa......................", -"aXa.....................", -"aXXa....................", -"aXXXa...................", -"aXXXXa..................", -"aXXXXXa.................", -"aXXXXXXa................", -"aXXXXXXXa...............", -"aXXXXXXXXa..............", -"aXXXXXXXXXa.............", -"aXXXXXXaaaa.............", -"aXXXaXXa................", -"aXXaaXXa................", -"aXa..aXXa...............", -"aa...aXXa...............", -"a.....aXXa..............", -"......aXXa..............", -".......aXXa.............", -".......aXXa.............", -"........aa...aaaaaaaaaaa", -#else -"XX......................", -"XaX.....................", -"XaaX....................", -"XaaaX...................", -"XaaaaX..................", -"XaaaaaX.................", -"XaaaaaaX................", -"XaaaaaaaX...............", -"XaaaaaaaaX..............", -"XaaaaaaaaaX.............", -"XaaaaaaXXXX.............", -"XaaaXaaX................", -"XaaXXaaX................", -"XaX..XaaX...............", -"XX...XaaX...............", -"X.....XaaX..............", -"......XaaX..............", -".......XaaX.............", -".......XaaX.............", -"........XX...aaaaaaaaaaa", -#endif -".............aXXXXXXXXXa", -".............aXXXXXXXXXa", -".............aXXXXaXXXXa", -".............aXXXXaXXXXa", -".............aXXaaaaaXXa", -".............aXXXXaXXXXa", -".............aXXXXaXXXXa", -".............aXXXXXXXXXa", -".............aXXXXXXXXXa", -".............aaaaaaaaaaa"}; - -/* XPM */ -static const char * const link_xpm[] = { -"24 30 3 1", -". c None", -"a c #000000", -"X c #FFFFFF", -#if defined(Q_WS_WIN) // Windows cursor is traditionally white -"aa......................", -"aXa.....................", -"aXXa....................", -"aXXXa...................", -"aXXXXa..................", -"aXXXXXa.................", -"aXXXXXXa................", -"aXXXXXXXa...............", -"aXXXXXXXXa..............", -"aXXXXXXXXXa.............", -"aXXXXXXaaaa.............", -"aXXXaXXa................", -"aXXaaXXa................", -"aXa..aXXa...............", -"aa...aXXa...............", -"a.....aXXa..............", -"......aXXa..............", -".......aXXa.............", -".......aXXa.............", -"........aa...aaaaaaaaaaa", -#else -"XX......................", -"XaX.....................", -"XaaX....................", -"XaaaX...................", -"XaaaaX..................", -"XaaaaaX.................", -"XaaaaaaX................", -"XaaaaaaaX...............", -"XaaaaaaaaX..............", -"XaaaaaaaaaX.............", -"XaaaaaaXXXX.............", -"XaaaXaaX................", -"XaaXXaaX................", -"XaX..XaaX...............", -"XX...XaaX...............", -"X.....XaaX..............", -"......XaaX..............", -".......XaaX.............", -".......XaaX.............", -"........XX...aaaaaaaaaaa", -#endif -".............aXXXXXXXXXa", -".............aXXXaaaaXXa", -".............aXXXXaaaXXa", -".............aXXXaaaaXXa", -".............aXXaaaXaXXa", -".............aXXaaXXXXXa", -".............aXXaXXXXXXa", -".............aXXXaXXXXXa", -".............aXXXXXXXXXa", -".............aaaaaaaaaaa"}; - #ifndef QT_NO_DRAGANDDROP //#define QDND_DEBUG @@ -326,22 +134,9 @@ QDragManager::QDragManager() { Q_ASSERT(!instance); -#ifdef Q_WS_WIN - n_cursor = 4; -#else - n_cursor = 3; -#endif - #ifdef Q_WS_QWS currentActionForOverrideCursor = Qt::IgnoreAction; #endif - pm_cursor = new QPixmap[n_cursor]; - pm_cursor[0] = QPixmap((const char **)move_xpm); - pm_cursor[1] = QPixmap((const char **)copy_xpm); - pm_cursor[2] = QPixmap((const char **)link_xpm); -#ifdef Q_WS_WIN - pm_cursor[3] = QPixmap((const char **)ignore_xpm); -#endif object = 0; beingCancelled = false; restoreCursor = false; @@ -362,7 +157,6 @@ QDragManager::~QDragManager() QApplication::restoreOverrideCursor(); #endif instance = 0; - delete [] pm_cursor; delete dropData; } @@ -373,23 +167,25 @@ QDragManager *QDragManager::self() return instance; } +#if defined(Q_WS_X11) || defined(Q_WS_WIN) QPixmap QDragManager::dragCursor(Qt::DropAction action) const { QDragPrivate * d = dragPrivate(); if (d && d->customCursors.contains(action)) return d->customCursors[action]; else if (action == Qt::MoveAction) - return pm_cursor[0]; + return QApplicationPrivate::instance()->getPixmapCursor(Qt::DragMoveCursor); else if (action == Qt::CopyAction) - return pm_cursor[1]; + return QApplicationPrivate::instance()->getPixmapCursor(Qt::DragCopyCursor); else if (action == Qt::LinkAction) - return pm_cursor[2]; + return QApplicationPrivate::instance()->getPixmapCursor(Qt::DragLinkCursor); #ifdef Q_WS_WIN else if (action == Qt::IgnoreAction) - return pm_cursor[3]; + return QApplicationPrivate::instance()->getPixmapCursor(Qt::ForbiddenCursor); #endif return QPixmap(); } +#endif bool QDragManager::hasCustomDragCursors() const { diff --git a/src/gui/kernel/qdnd_p.h b/src/gui/kernel/qdnd_p.h index d70b983..1eb85ed 100644 --- a/src/gui/kernel/qdnd_p.h +++ b/src/gui/kernel/qdnd_p.h @@ -244,7 +244,9 @@ public: bool willDrop; QEventLoop *eventLoop; +#if defined(Q_WS_X11) || defined(Q_WS_WIN) QPixmap dragCursor(Qt::DropAction action) const; +#endif bool hasCustomDragCursors() const; @@ -261,8 +263,6 @@ public: #endif private: - QPixmap *pm_cursor; - int n_cursor; #ifdef Q_WS_QWS Qt::DropAction currentActionForOverrideCursor; #endif diff --git a/src/gui/kernel/qdnd_x11.cpp b/src/gui/kernel/qdnd_x11.cpp index 33968bd..9591b9a 100644 --- a/src/gui/kernel/qdnd_x11.cpp +++ b/src/gui/kernel/qdnd_x11.cpp @@ -1340,9 +1340,9 @@ void QDragManager::updateCursor() if (!noDropCursor) { #ifndef QT_NO_CURSOR noDropCursor = new QCursor(Qt::ForbiddenCursor); - moveCursor = new QCursor(dragCursor(Qt::MoveAction), 0,0); - copyCursor = new QCursor(dragCursor(Qt::CopyAction), 0,0); - linkCursor = new QCursor(dragCursor(Qt::LinkAction), 0,0); + moveCursor = new QCursor(Qt::DragMoveCursor); + copyCursor = new QCursor(Qt::DragCopyCursor); + linkCursor = new QCursor(Qt::DragLinkCursor); #endif } -- cgit v0.12 From 045a6447397c522de2c904e760a08b75fcd0c002 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Mon, 1 Feb 2010 17:40:55 +0100 Subject: Fixed draggabletext example. The example expects that you can only move items around inside the same application. However when dragging items to another application it is allowed to either move or copy items. Mouse cursors during the DND should respect that. Reviewed-by: Bradley T. Hughes --- examples/draganddrop/draggabletext/dragwidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/draganddrop/draggabletext/dragwidget.cpp b/examples/draganddrop/draggabletext/dragwidget.cpp index 0ada3ac..1fd40be 100644 --- a/examples/draganddrop/draggabletext/dragwidget.cpp +++ b/examples/draganddrop/draggabletext/dragwidget.cpp @@ -82,7 +82,7 @@ DragWidget::DragWidget(QWidget *parent) void DragWidget::dragEnterEvent(QDragEnterEvent *event) { if (event->mimeData()->hasText()) { - if (children().contains(event->source())) { + if (event->source() == this) { event->setDropAction(Qt::MoveAction); event->accept(); } else { -- cgit v0.12 From 9ffdfa58b3ad2ed4100a7d223a85399b72c6deb7 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Fri, 5 Feb 2010 17:19:48 +0100 Subject: Revised fix for system tray popup activation Change af7d2b2127dadbdf828c60c75255bb1b4f591651 does have some negative side-effects. This should limit the fix to void unnecessary activation when the parent window already has focus. Reviewed-by: denis --- src/gui/kernel/qwidget_win.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qwidget_win.cpp b/src/gui/kernel/qwidget_win.cpp index 6a36293..8cab387 100644 --- a/src/gui/kernel/qwidget_win.cpp +++ b/src/gui/kernel/qwidget_win.cpp @@ -1156,7 +1156,10 @@ void QWidgetPrivate::show_sys() data.window_state |= Qt::WindowMinimized; if (IsZoomed(q->internalWinId())) data.window_state |= Qt::WindowMaximized; - if (q->windowType() == Qt::Popup) + // This is to resolve the problem where popups are opened from the + // system tray and not being implicitly activated + if (q->windowType() == Qt::Popup && + (!q->parentWidget() || !q->parentWidget()->isActiveWindow())) q->activateWindow(); } -- cgit v0.12 From fd30747b5b54a760ca280ad1e75ce87026478f5e Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Mon, 8 Feb 2010 10:28:08 +1000 Subject: Replace qt_vg_imageBits() with constBits() in the OpenVG code Reviewed-by: Sarah Smith --- src/openvg/qpaintengine_vg.cpp | 21 +++++++++------------ src/openvg/qpixmapdata_vg.cpp | 12 ++---------- 2 files changed, 11 insertions(+), 22 deletions(-) diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp index cc9ba77..923563b 100644 --- a/src/openvg/qpaintengine_vg.cpp +++ b/src/openvg/qpaintengine_vg.cpp @@ -978,7 +978,7 @@ static QImage colorizeBitmap(const QImage &image, const QColor &color) int height = sourceImage.height(); int width = sourceImage.width(); for (int y=0; y(dest.scanLine(y)); for (int x=0; x < width; ++x) target[x] = (source[x>>3] >> (x&7)) & 1 ? fg : bg; @@ -986,9 +986,6 @@ static QImage colorizeBitmap(const QImage &image, const QColor &color) return dest; } -// defined in qpixmapdata_vg.cpp. -const uchar *qt_vg_imageBits(const QImage& image); - static VGImage toVGImage (const QImage & image, Qt::ImageConversionFlags flags = Qt::AutoColor) { @@ -1022,7 +1019,7 @@ static VGImage toVGImage break; } - const uchar *pixels = qt_vg_imageBits(img); + const uchar *pixels = img.constBits(); VGImage vgImg = QVGImagePool::instance()->createPermanentImage (format, img.width(), img.height(), VG_IMAGE_QUALITY_FASTER); @@ -1066,7 +1063,7 @@ static VGImage toVGImageSubRect break; } - const uchar *pixels = qt_vg_imageBits(img) + bpp * sr.x() + + const uchar *pixels = img.constBits() + bpp * sr.x() + img.bytesPerLine() * sr.y(); VGImage vgImg = QVGImagePool::instance()->createPermanentImage @@ -1088,7 +1085,7 @@ static VGImage toVGImageWithOpacity(const QImage & image, qreal opacity) painter.drawImage(0, 0, image); painter.end(); - const uchar *pixels = qt_vg_imageBits(img); + const uchar *pixels = img.constBits(); VGImage vgImg = QVGImagePool::instance()->createPermanentImage (VG_sARGB_8888_PRE, img.width(), img.height(), VG_IMAGE_QUALITY_FASTER); @@ -1110,7 +1107,7 @@ static VGImage toVGImageWithOpacitySubRect painter.drawImage(QPoint(0, 0), image, sr); painter.end(); - const uchar *pixels = qt_vg_imageBits(img); + const uchar *pixels = img.constBits(); VGImage vgImg = QVGImagePool::instance()->createPermanentImage (VG_sARGB_8888_PRE, img.width(), img.height(), VG_IMAGE_QUALITY_FASTER); @@ -3175,15 +3172,15 @@ void QVGFontGlyphCache::cacheGlyphs if (!scaledImage.isNull()) { // Not a space character if (scaledImage.format() == QImage::Format_Indexed8) { vgImage = vgCreateImage(VG_A_8, scaledImage.width(), scaledImage.height(), VG_IMAGE_QUALITY_FASTER); - vgImageSubData(vgImage, qt_vg_imageBits(scaledImage), scaledImage.bytesPerLine(), VG_A_8, 0, 0, scaledImage.width(), scaledImage.height()); + vgImageSubData(vgImage, scaledImage.constBits(), scaledImage.bytesPerLine(), VG_A_8, 0, 0, scaledImage.width(), scaledImage.height()); } else if (scaledImage.format() == QImage::Format_Mono) { QImage img = scaledImage.convertToFormat(QImage::Format_Indexed8); vgImage = vgCreateImage(VG_A_8, img.width(), img.height(), VG_IMAGE_QUALITY_FASTER); - vgImageSubData(vgImage, qt_vg_imageBits(img), img.bytesPerLine(), VG_A_8, 0, 0, img.width(), img.height()); + vgImageSubData(vgImage, img.constBits(), img.bytesPerLine(), VG_A_8, 0, 0, img.width(), img.height()); } else { QImage img = scaledImage.convertToFormat(QImage::Format_ARGB32_Premultiplied); vgImage = vgCreateImage(VG_sARGB_8888_PRE, img.width(), img.height(), VG_IMAGE_QUALITY_FASTER); - vgImageSubData(vgImage, qt_vg_imageBits(img), img.bytesPerLine(), VG_sARGB_8888_PRE, 0, 0, img.width(), img.height()); + vgImageSubData(vgImage, img.constBits(), img.bytesPerLine(), VG_sARGB_8888_PRE, 0, 0, img.width(), img.height()); } } origin[0] = -metrics.x.toReal() + 0.5f; @@ -3650,7 +3647,7 @@ void QVGCompositionHelper::drawCursorPixmap if (vgImage == VG_INVALID_HANDLE) return; vgImageSubData - (vgImage, qt_vg_imageBits(img) + img.bytesPerLine() * (img.height() - 1), + (vgImage, img.constBits() + img.bytesPerLine() * (img.height() - 1), -(img.bytesPerLine()), VG_sARGB_8888_PRE, 0, 0, img.width(), img.height()); diff --git a/src/openvg/qpixmapdata_vg.cpp b/src/openvg/qpixmapdata_vg.cpp index 3087b77..44814cc 100644 --- a/src/openvg/qpixmapdata_vg.cpp +++ b/src/openvg/qpixmapdata_vg.cpp @@ -231,14 +231,6 @@ QPaintEngine* QVGPixmapData::paintEngine() const return source.paintEngine(); } -// This function works around QImage::bits() making a deep copy if the -// QImage is not const. We force it to be const and then get the bits. -// XXX: Should add a QImage::constBits() in the future to replace this. -const uchar *qt_vg_imageBits(const QImage& image) -{ - return image.bits(); -} - VGImage QVGPixmapData::toVGImage() { if (!isValid()) @@ -271,7 +263,7 @@ VGImage QVGPixmapData::toVGImage() if (!source.isNull() && recreate) { vgImageSubData (vgImage, - qt_vg_imageBits(source), source.bytesPerLine(), + source.constBits(), source.bytesPerLine(), VG_sARGB_8888_PRE, 0, 0, w, h); } @@ -670,7 +662,7 @@ void* QVGPixmapData::toNativeType(NativeType type) if (bitmap) { if (bitmap->Create(TSize(source.width(), source.height()), EColor16MAP) == KErrNone) { - const uchar *sptr = qt_vg_imageBits(source); + const uchar *sptr = source.constBits(); bitmap->BeginDataAccess(); uchar *dptr = (uchar*)bitmap->DataAddress(); -- cgit v0.12 From e26bd0cc9928cd480f03b55f65bce7dcec4337fa Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 8 Feb 2010 09:24:57 +0100 Subject: S60 style: Compile fix. Fix up cc1f88b8. --- src/gui/styles/qs60style_simulated.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/styles/qs60style_simulated.cpp b/src/gui/styles/qs60style_simulated.cpp index 2df55b7..3f09ebc 100644 --- a/src/gui/styles/qs60style_simulated.cpp +++ b/src/gui/styles/qs60style_simulated.cpp @@ -95,7 +95,7 @@ bool saveThemeToBlob(const QString &themeBlob, } dataOut << partPictures.count(); - QHashIterator i(partPictures); + QHashIterator i(partPictures); while (i.hasNext()) { i.next(); dataOut << i.key(); -- cgit v0.12 From 8e74eb07383e909b0514fe174ebbde2c837a58ea Mon Sep 17 00:00:00 2001 From: ck Date: Mon, 8 Feb 2010 10:30:49 +0100 Subject: Compile fixes. --- examples/dbus/dbus-chat/chat_adaptor.h | 3 +++ examples/dbus/remotecontrolledcar/car/car_adaptor.h | 3 +++ tools/assistant/tools/assistant/bookmarkitem.cpp | 2 ++ tools/assistant/tools/assistant/bookmarkmodel.cpp | 13 ++++++------- tools/assistant/tools/assistant/cmdlineparser.cpp | 9 ++++----- 5 files changed, 18 insertions(+), 12 deletions(-) diff --git a/examples/dbus/dbus-chat/chat_adaptor.h b/examples/dbus/dbus-chat/chat_adaptor.h index 831c4f5..47b7f8f 100644 --- a/examples/dbus/dbus-chat/chat_adaptor.h +++ b/examples/dbus/dbus-chat/chat_adaptor.h @@ -54,12 +54,15 @@ #include #include + +QT_BEGIN_NAMESPACE class QByteArray; template class QList; template class QMap; class QString; class QStringList; class QVariant; +QT_END_NAMESPACE /* * Adaptor class for interface com.trolltech.chat diff --git a/examples/dbus/remotecontrolledcar/car/car_adaptor.h b/examples/dbus/remotecontrolledcar/car/car_adaptor.h index d109883..d16972e 100644 --- a/examples/dbus/remotecontrolledcar/car/car_adaptor.h +++ b/examples/dbus/remotecontrolledcar/car/car_adaptor.h @@ -54,12 +54,15 @@ #include #include + +QT_BEGIN_NAMESPACE class QByteArray; template class QList; template class QMap; class QString; class QStringList; class QVariant; +QT_END_NAMESPACE /* * Adaptor class for interface com.trolltech.Examples.CarInterface diff --git a/tools/assistant/tools/assistant/bookmarkitem.cpp b/tools/assistant/tools/assistant/bookmarkitem.cpp index 082ffce..6c3d06c 100644 --- a/tools/assistant/tools/assistant/bookmarkitem.cpp +++ b/tools/assistant/tools/assistant/bookmarkitem.cpp @@ -136,3 +136,5 @@ BookmarkItem::dumpTree(int indent) const foreach (BookmarkItem *item, m_children) item->dumpTree(indent + 4); } + +QT_END_NAMESPACE diff --git a/tools/assistant/tools/assistant/bookmarkmodel.cpp b/tools/assistant/tools/assistant/bookmarkmodel.cpp index f265ca4..c785f16 100644 --- a/tools/assistant/tools/assistant/bookmarkmodel.cpp +++ b/tools/assistant/tools/assistant/bookmarkmodel.cpp @@ -149,7 +149,7 @@ BookmarkModel::removeItem(const QModelIndex &index) return false; QModelIndexList indexes; - if (index.rowCount() > 0) + if (rowCount(index) > 0) indexes = collectItems(index); indexes.append(index); @@ -220,13 +220,12 @@ BookmarkModel::flags(const QModelIndex &index) const if (m_editable) defaultFlags |= Qt::ItemIsEditable; - if (BookmarkItem *item = itemFromIndex(index)) { - if (index.data(UserRoleFolder).toBool()) { - if (index.column() > 0) - defaultFlags &= ~Qt::ItemIsEditable; - return defaultFlags | Qt::ItemIsDropEnabled; - } + if (itemFromIndex(index) && index.data(UserRoleFolder).toBool() + && index.column() > 0) { + defaultFlags &= ~Qt::ItemIsEditable; + return defaultFlags | Qt::ItemIsDropEnabled; } + return defaultFlags | Qt::ItemIsDragEnabled; } diff --git a/tools/assistant/tools/assistant/cmdlineparser.cpp b/tools/assistant/tools/assistant/cmdlineparser.cpp index b063830..bbc0c37 100644 --- a/tools/assistant/tools/assistant/cmdlineparser.cpp +++ b/tools/assistant/tools/assistant/cmdlineparser.cpp @@ -41,6 +41,7 @@ #include "tracer.h" #include +#include #include #include "cmdlineparser.h" @@ -277,13 +278,11 @@ void CmdLineParser::showMessage(const QString &msg, bool error) if (m_quiet) return; #ifdef Q_OS_WIN - QString s = QLatin1String("
") + msg + QLatin1String("
"); - const QString &message - = QCoreApplication::translate("Assistant", "Qt Assistant"), s); + QString message = QLatin1String("
") % msg % QLatin1String("
"); if (error) - QMessageBox::critical(0, message); + QMessageBox::critical(0, tr("Error"), message); else - QMessageBox::information(0, message); + QMessageBox::information(0, tr("Notice"), message); #else fprintf(error ? stderr : stdout, "%s\n", qPrintable(msg)); #endif -- cgit v0.12 From e98c07e5247a5ad4876c4add595ec1897b73b190 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Mon, 8 Feb 2010 13:03:34 +0100 Subject: Another round of Geometry shader review. Reviewed-by: Trond --- src/opengl/qglshaderprogram.cpp | 18 +++++------------- src/opengl/qglshaderprogram.h | 16 ++++++++-------- 2 files changed, 13 insertions(+), 21 deletions(-) diff --git a/src/opengl/qglshaderprogram.cpp b/src/opengl/qglshaderprogram.cpp index 7af488d..22db731 100644 --- a/src/opengl/qglshaderprogram.cpp +++ b/src/opengl/qglshaderprogram.cpp @@ -558,17 +558,6 @@ bool QGLShaderProgramPrivate::hasShader(QGLShader::ShaderType type) const #define ctx d->programGuard.context() /*! - \enum GeometryTypes - - Defines the geometry types specificed by the GL_EXT_geometry_shader4 extension - - \value LinesWithAdjacencyGeometryType Corresponds to GL_LINES_ADJACENCY. - \value LineStripWithAdjacencyGeometryType Corresponds to GL_LINE_STRIP_ADJACENCY. - \value TrianglesWithAdjacencyGeometryType Corresponds to GL_TRIANGLES_ADJACENCY. - \value TriangleStripWithAdjacencyGeometryType Corresponds to GL_TRIANGLE_STRIP_ADJACENCY. - */ - -/*! Constructs a new shader program and attaches it to \a parent. The program will be invalid until addShader() is called. @@ -612,6 +601,7 @@ bool QGLShaderProgram::init() context = QGLContext::currentContext(); d->programGuard.setContext(context); } + if (!context) return false; if (qt_resolve_glsl_extensions(const_cast(context))) { @@ -3002,12 +2992,14 @@ void QGLShaderProgram::shaderDestroyed() */ bool QGLShader::hasOpenGLShaders(ShaderType type, const QGLContext *context) { -#if !defined(QT_OPENGL_ES_2) if (!context) context = QGLContext::currentContext(); if (!context) return false; -#endif + + if ((type & ~(Geometry | Vertex | Fragment)) || type == 0) + return false; + bool resolved = qt_resolve_glsl_extensions(const_cast(context)); if (!resolved) return false; diff --git a/src/opengl/qglshaderprogram.h b/src/opengl/qglshaderprogram.h index 6dfbb77..56034ee 100644 --- a/src/opengl/qglshaderprogram.h +++ b/src/opengl/qglshaderprogram.h @@ -103,18 +103,18 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QGLShader::ShaderType) class QGLShaderProgramPrivate; +#ifndef GL_EXT_geometry_shader4 +# define GL_LINES_ADJACENCY_EXT 0xA +# define GL_LINE_STRIP_ADJACENCY_EXT 0xB +# define GL_TRIANGLES_ADJACENCY_EXT 0xC +# define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0xD +#endif + + class Q_OPENGL_EXPORT QGLShaderProgram : public QObject { Q_OBJECT public: - enum GeometryTypes - { - LinesWithAdjacencyGeometryType = 0xa, - LineStripWithAdjacencyGeometryType = 0xb, - TrianglesWithAdjacencyGeometryType = 0xc, - TriangleStripWithAdjacencyGeometryType = 0xd - }; - explicit QGLShaderProgram(QObject *parent = 0); explicit QGLShaderProgram(const QGLContext *context, QObject *parent = 0); virtual ~QGLShaderProgram(); -- cgit v0.12 From f09fc6c958ac8f0307686cd8a59a1adc92771b0c Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Mon, 8 Feb 2010 15:12:34 +0100 Subject: Compile fix for embedded. Reviewed-by: trustme --- src/gui/kernel/qapplication.cpp | 2 -- src/gui/kernel/qapplication_p.h | 4 ---- src/gui/kernel/qdnd.cpp | 2 -- src/gui/kernel/qdnd_p.h | 2 -- 4 files changed, 10 deletions(-) diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index 1fc1b45..bb6aca9 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -5707,7 +5707,6 @@ QGestureManager* QGestureManager::instance() return qAppPriv->gestureManager; } -#if defined(Q_WS_X11) || defined(Q_WS_WIN) // These pixmaps approximate the images in the Windows User Interface Guidelines. // XPM @@ -5929,7 +5928,6 @@ QPixmap QApplicationPrivate::getPixmapCursor(Qt::CursorShape cshape) } return QPixmap(); } -#endif QT_END_NAMESPACE diff --git a/src/gui/kernel/qapplication_p.h b/src/gui/kernel/qapplication_p.h index 0764553..d19d86e 100644 --- a/src/gui/kernel/qapplication_p.h +++ b/src/gui/kernel/qapplication_p.h @@ -518,17 +518,13 @@ public: QGestureManager *gestureManager; QWidget *gestureWidget; -#if defined(Q_WS_X11) || defined(Q_WS_WIN) QPixmap *move_cursor; QPixmap *copy_cursor; QPixmap *link_cursor; -#endif #if defined(Q_WS_WIN) QPixmap *ignore_cursor; #endif -#if defined(Q_WS_X11) || defined(Q_WS_WIN) QPixmap getPixmapCursor(Qt::CursorShape cshape); -#endif QMap > widgetForTouchPointId; QMap appCurrentTouchPoints; diff --git a/src/gui/kernel/qdnd.cpp b/src/gui/kernel/qdnd.cpp index 82708ef..2b3a3d0 100644 --- a/src/gui/kernel/qdnd.cpp +++ b/src/gui/kernel/qdnd.cpp @@ -167,7 +167,6 @@ QDragManager *QDragManager::self() return instance; } -#if defined(Q_WS_X11) || defined(Q_WS_WIN) QPixmap QDragManager::dragCursor(Qt::DropAction action) const { QDragPrivate * d = dragPrivate(); @@ -185,7 +184,6 @@ QPixmap QDragManager::dragCursor(Qt::DropAction action) const #endif return QPixmap(); } -#endif bool QDragManager::hasCustomDragCursors() const { diff --git a/src/gui/kernel/qdnd_p.h b/src/gui/kernel/qdnd_p.h index 1eb85ed..033e6a6 100644 --- a/src/gui/kernel/qdnd_p.h +++ b/src/gui/kernel/qdnd_p.h @@ -244,9 +244,7 @@ public: bool willDrop; QEventLoop *eventLoop; -#if defined(Q_WS_X11) || defined(Q_WS_WIN) QPixmap dragCursor(Qt::DropAction action) const; -#endif bool hasCustomDragCursors() const; -- cgit v0.12 From 692e9103ebb85b90e79377206d5d03b704d43d42 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 8 Feb 2010 15:27:12 +0100 Subject: QMainWindow: update the separator size when the style change Task-number: QTBUG-2774 Reviewed-ny: Thierry --- src/gui/widgets/qdockarealayout.cpp | 62 +++++++++++++++++------------- src/gui/widgets/qdockarealayout_p.h | 5 ++- src/gui/widgets/qmainwindow.cpp | 1 + tests/auto/qmainwindow/tst_qmainwindow.cpp | 40 +++++++++++++++++++ 4 files changed, 79 insertions(+), 29 deletions(-) diff --git a/src/gui/widgets/qdockarealayout.cpp b/src/gui/widgets/qdockarealayout.cpp index d754800..13f31df 100644 --- a/src/gui/widgets/qdockarealayout.cpp +++ b/src/gui/widgets/qdockarealayout.cpp @@ -220,15 +220,17 @@ static quintptr tabId(const QDockAreaLayoutItem &item) } #endif +static const int zero = 0; + QDockAreaLayoutInfo::QDockAreaLayoutInfo() - : sep(0), dockPos(QInternal::LeftDock), o(Qt::Horizontal), mainWindow(0) + : sep(&zero), dockPos(QInternal::LeftDock), o(Qt::Horizontal), mainWindow(0) #ifndef QT_NO_TABBAR , tabbed(false), tabBar(0), tabBarShape(QTabBar::RoundedSouth), tabBarVisible(false) #endif { } -QDockAreaLayoutInfo::QDockAreaLayoutInfo(int _sep, QInternal::DockPosition _dockPos, +QDockAreaLayoutInfo::QDockAreaLayoutInfo(const int *_sep, QInternal::DockPosition _dockPos, Qt::Orientation _o, int tbshape, QMainWindow *window) : sep(_sep), dockPos(_dockPos), o(_o), mainWindow(window) @@ -281,7 +283,7 @@ QSize QDockAreaLayoutInfo::minimumSize() const #endif { if (!first) - a += sep; + a += *sep; a += pick(o, min_size); } b = qMax(b, perp(o, min_size)); @@ -349,7 +351,7 @@ QSize QDockAreaLayoutInfo::maximumSize() const #endif { if (!first) - a += sep; + a += *sep; a += pick(o, max_size); } b = qMin(b, perp(o, max_size)); @@ -415,7 +417,7 @@ QSize QDockAreaLayoutInfo::sizeHint() const { if (previous && !gap && !(previous->flags & QDockAreaLayoutItem::GapItem) && !previous->hasFixedSize(o)) { - a += sep; + a += *sep; } a += gap ? item.size : pick(o, size_hint); } @@ -491,7 +493,7 @@ static int realMinSize(const QDockAreaLayoutInfo &info) min = pick(info.o, item.minimumSize()); if (!first) - result += info.sep; + result += *info.sep; result += min; first = false; @@ -516,7 +518,7 @@ static int realMaxSize(const QDockAreaLayoutInfo &info) max = pick(info.o, item.maximumSize()); if (!first) - result += info.sep; + result += *info.sep; result += max; if (result >= QWIDGETSIZE_MAX) @@ -555,7 +557,7 @@ void QDockAreaLayoutInfo::fitItems() if (!(previous->flags & QDockAreaLayoutItem::GapItem)) { QLayoutStruct &ls = layout_struct_list[j++]; ls.init(); - ls.minimumSize = ls.maximumSize = ls.sizeHint = previous->hasFixedSize(o) ? 0 : sep; + ls.minimumSize = ls.maximumSize = ls.sizeHint = previous->hasFixedSize(o) ? 0 : *sep; ls.empty = false; } } @@ -938,7 +940,7 @@ int QDockAreaLayoutInfo::separatorMove(int index, int delta) if (item.skip()) { ls.empty = true; } else { - const int separatorSpace = item.hasFixedSize(o) ? 0 : sep; + const int separatorSpace = item.hasFixedSize(o) ? 0 : *sep; ls.empty = false; ls.pos = item.pos; ls.size = item.size + separatorSpace; @@ -956,7 +958,7 @@ int QDockAreaLayoutInfo::separatorMove(int index, int delta) if (item.skip()) continue; QLayoutStruct &ls = list[i]; - const int separatorSpace = item.hasFixedSize(o) ? 0 : sep; + const int separatorSpace = item.hasFixedSize(o) ? 0 : *sep; item.size = ls.size - separatorSpace; item.pos = ls.pos; if (item.subinfo != 0) { @@ -1041,11 +1043,11 @@ QLayoutItem *QDockAreaLayoutInfo::plug(const QList &path) int next = this->next(index); if (prev != -1 && !(item_list.at(prev).flags & QDockAreaLayoutItem::GapItem)) { - item.pos += sep; - item.size -= sep; + item.pos += *sep; + item.size -= *sep; } if (next != -1 && !(item_list.at(next).flags & QDockAreaLayoutItem::GapItem)) - item.size -= sep; + item.size -= *sep; QPoint pos; rpick(o, pos) = item.pos; @@ -1083,11 +1085,11 @@ QLayoutItem *QDockAreaLayoutInfo::unplug(const QList &path) #endif { if (prev != -1 && !(item_list.at(prev).flags & QDockAreaLayoutItem::GapItem)) { - item.pos -= sep; - item.size += sep; + item.pos -= *sep; + item.size += *sep; } if (next != -1 && !(item_list.at(next).flags & QDockAreaLayoutItem::GapItem)) - item.size += sep; + item.size += *sep; } return item.widgetItem; @@ -1255,9 +1257,9 @@ bool QDockAreaLayoutInfo::insertGap(const QList &path, QLayoutItem *dockWid QRect r = dockedGeometry(dockWidgetItem->widget()); gap_size = pick(o, r.size()); if (prev != -1 && !(item_list.at(prev).flags & QDockAreaLayoutItem::GapItem)) - sep_size += sep; + sep_size += *sep; if (next != -1 && !(item_list.at(next).flags & QDockAreaLayoutItem::GapItem)) - sep_size += sep; + sep_size += *sep; } if (gap_size + sep_size > space) gap_size = pick(o, gap_item.minimumSize()); @@ -1364,7 +1366,7 @@ QRect QDockAreaLayoutInfo::separatorRect(int index) const QPoint pos = rect.topLeft(); rpick(o, pos) = item.pos + item.size; QSize s = rect.size(); - rpick(o, s) = sep; + rpick(o, s) = *sep; return QRect(pos, s); } @@ -1413,7 +1415,7 @@ QList QDockAreaLayoutInfo::findSeparator(const QPoint &_pos) const continue; QRect sepRect = separatorRect(i); - if (!sepRect.isNull() && sep == 1) + if (!sepRect.isNull() && *sep == 1) sepRect.adjust(-2, -2, 2, 2); //we also make sure we don't find a separator that's not there if (sepRect.contains(_pos) && !item.hasFixedSize(o)) { @@ -1560,7 +1562,7 @@ void QDockAreaLayoutInfo::apply(bool animate) } } #ifndef QT_NO_TABBAR - if (sep == 1) + if (*sep == 1) updateSeparatorWidgets(); #endif //QT_NO_TABBAR } @@ -2010,7 +2012,7 @@ bool QDockAreaLayoutInfo::restoreState(QDataStream &stream, QList updateTabBar(); setCurrentTabId(tabId(item_list.at(index))); } - if (!testing && sep == 1) + if (!testing && *sep == 1) updateSeparatorWidgets(); #endif @@ -2273,13 +2275,13 @@ QDockAreaLayout::QDockAreaLayout(QMainWindow *win) : fallbackToSizeHints(true) const int tabShape = 0; #endif docks[QInternal::LeftDock] - = QDockAreaLayoutInfo(sep, QInternal::LeftDock, Qt::Vertical, tabShape, win); + = QDockAreaLayoutInfo(&sep, QInternal::LeftDock, Qt::Vertical, tabShape, win); docks[QInternal::RightDock] - = QDockAreaLayoutInfo(sep, QInternal::RightDock, Qt::Vertical, tabShape, win); + = QDockAreaLayoutInfo(&sep, QInternal::RightDock, Qt::Vertical, tabShape, win); docks[QInternal::TopDock] - = QDockAreaLayoutInfo(sep, QInternal::TopDock, Qt::Horizontal, tabShape, win); + = QDockAreaLayoutInfo(&sep, QInternal::TopDock, Qt::Horizontal, tabShape, win); docks[QInternal::BottomDock] - = QDockAreaLayoutInfo(sep, QInternal::BottomDock, Qt::Horizontal, tabShape, win); + = QDockAreaLayoutInfo(&sep, QInternal::BottomDock, Qt::Horizontal, tabShape, win); centralWidgetItem = 0; @@ -3028,7 +3030,7 @@ void QDockAreaLayout::addDockWidget(QInternal::DockPosition pos, QDockWidget *do #else int tbshape = 0; #endif - QDockAreaLayoutInfo new_info(sep, pos, orientation, tbshape, mainWindow); + QDockAreaLayoutInfo new_info(&sep, pos, orientation, tbshape, mainWindow); new_info.item_list.append(new QDockAreaLayoutInfo(info)); new_info.item_list.append(dockWidgetItem); info = new_info; @@ -3324,6 +3326,12 @@ void QDockAreaLayout::keepSize(QDockWidget *w) item.flags |= QDockAreaLayoutItem::KeepSize; } +void QDockAreaLayout::styleChangedEvent() +{ + sep = mainWindow->style()->pixelMetric(QStyle::PM_DockWidgetSeparatorExtent, 0, mainWindow); + fitLayout(); +} + QT_END_NAMESPACE #endif // QT_NO_DOCKWIDGET diff --git a/src/gui/widgets/qdockarealayout_p.h b/src/gui/widgets/qdockarealayout_p.h index 0bc1aa9..0088f00 100644 --- a/src/gui/widgets/qdockarealayout_p.h +++ b/src/gui/widgets/qdockarealayout_p.h @@ -128,7 +128,7 @@ class Q_AUTOTEST_EXPORT QDockAreaLayoutInfo { public: QDockAreaLayoutInfo(); - QDockAreaLayoutInfo(int _sep, QInternal::DockPosition _dockPos, Qt::Orientation _o, + QDockAreaLayoutInfo(const int *_sep, QInternal::DockPosition _dockPos, Qt::Orientation _o, int tbhape, QMainWindow *window); QSize minimumSize() const; @@ -189,7 +189,7 @@ public: QMainWindowLayout *mainWindowLayout() const; - int sep; + const int *sep; mutable QVector separatorWidgets; QInternal::DockPosition dockPos; Qt::Orientation o; @@ -300,6 +300,7 @@ public: QSet usedTabBars() const; QSet usedSeparatorWidgets() const; #endif //QT_NO_TABBAR + void styleChangedEvent(); }; QT_END_NAMESPACE diff --git a/src/gui/widgets/qmainwindow.cpp b/src/gui/widgets/qmainwindow.cpp index 269cd12..eb25417 100644 --- a/src/gui/widgets/qmainwindow.cpp +++ b/src/gui/widgets/qmainwindow.cpp @@ -1393,6 +1393,7 @@ bool QMainWindow::event(QEvent *event) #endif // QT_NO_STATUSTIP case QEvent::StyleChange: + d->layout->layoutState.dockAreaLayout.styleChangedEvent(); if (!d->explicitIconSize) setIconSize(QSize()); break; diff --git a/tests/auto/qmainwindow/tst_qmainwindow.cpp b/tests/auto/qmainwindow/tst_qmainwindow.cpp index b1c44be..1273e85 100644 --- a/tests/auto/qmainwindow/tst_qmainwindow.cpp +++ b/tests/auto/qmainwindow/tst_qmainwindow.cpp @@ -108,6 +108,7 @@ private slots: void addToolbarAfterShow(); void centralWidgetSize(); void dockWidgetSize(); + void QTBUG2774_stylechange(); }; // Testing get/set functions @@ -1709,6 +1710,45 @@ void tst_QMainWindow::dockWidgetSize() } } +void tst_QMainWindow::QTBUG2774_stylechange() +{ + + QMainWindow mw; + QDockWidget *dockw = new QDockWidget(); + mw.addDockWidget(Qt::LeftDockWidgetArea, dockw); + mw.addDockWidget(Qt::LeftDockWidgetArea, new QDockWidget()); + QTextEdit *central = new QTextEdit(&mw); + mw.setCentralWidget(central); + dockw->resize(10,10); + mw.show(); + QTest::qWaitForWindowShown(&mw); + int centralOriginalWidth = central->width(); + + QVERIFY(!mw.isSeparator(QPoint(4, dockw->pos().y() + dockw->size().height() - 3))); + QVERIFY( mw.isSeparator(QPoint(4, dockw->pos().y() + dockw->size().height()))); + QVERIFY(!mw.isSeparator(QPoint(4, dockw->pos().y() + dockw->size().height() + 30))); + + + { + QTest::qWait(1000); + mw.setStyleSheet("QMainWindow::separator { width: 50px; height:50px; }"); + QTest::qWait(5000); + QApplication::processEvents(); + QVERIFY(central->width() < centralOriginalWidth); + QVERIFY( mw.isSeparator(QPoint(4, dockw->pos().y() + dockw->size().height()))); + QVERIFY( mw.isSeparator(QPoint(4, dockw->pos().y() + dockw->size().height() + 49))); + } + + { + mw.setStyleSheet("QMainWindow::separator { width: 0px; height: 0px; }"); + QApplication::processEvents(); + QVERIFY(central->width() > centralOriginalWidth); + QVERIFY(!mw.isSeparator(QPoint(4, dockw->pos().y() + dockw->size().height()))); + QVERIFY(!mw.isSeparator(QPoint(4, dockw->pos().y() + dockw->size().height() + 1))); + } +} + + QTEST_MAIN(tst_QMainWindow) #include "tst_qmainwindow.moc" -- cgit v0.12 From 11d9e81b3b1a7f3463edb98fa2303a44f8499462 Mon Sep 17 00:00:00 2001 From: ck Date: Mon, 8 Feb 2010 14:59:56 +0100 Subject: Assistant: Add missing license header. --- tools/assistant/tools/assistant/bookmarkitem.cpp | 34 ++++++++++++++++++++++++ tools/assistant/tools/assistant/bookmarkitem.h | 7 ----- 2 files changed, 34 insertions(+), 7 deletions(-) diff --git a/tools/assistant/tools/assistant/bookmarkitem.cpp b/tools/assistant/tools/assistant/bookmarkitem.cpp index 6c3d06c..8036959 100644 --- a/tools/assistant/tools/assistant/bookmarkitem.cpp +++ b/tools/assistant/tools/assistant/bookmarkitem.cpp @@ -1,3 +1,37 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + #include "bookmarkitem.h" #include diff --git a/tools/assistant/tools/assistant/bookmarkitem.h b/tools/assistant/tools/assistant/bookmarkitem.h index be77e24..7acaf86 100644 --- a/tools/assistant/tools/assistant/bookmarkitem.h +++ b/tools/assistant/tools/assistant/bookmarkitem.h @@ -28,13 +28,6 @@ ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. ** -** -** -** -** -** -** -** ** $QT_END_LICENSE$ ** ****************************************************************************/ -- cgit v0.12 From 8a81562af30435f82255830489dca691031a5408 Mon Sep 17 00:00:00 2001 From: aavit Date: Tue, 9 Feb 2010 10:32:04 +0100 Subject: Use libpng API as recommended. Preparation for upgrade to libpng 1.4.0. The libpng doc advises against accessing the info_ptr structure directly, and in 1.4.0 the members are flagged as deprecated, so such access gives compilation warnings. This patch makes qpnghandler use the recommended access functions instead. Reviewed-by: Trond --- src/gui/image/qpnghandler.cpp | 135 +++++++++++++++++++----------------------- 1 file changed, 62 insertions(+), 73 deletions(-) diff --git a/src/gui/image/qpnghandler.cpp b/src/gui/image/qpnghandler.cpp index d5406cb..bba54b9 100644 --- a/src/gui/image/qpnghandler.cpp +++ b/src/gui/image/qpnghandler.cpp @@ -50,8 +50,13 @@ #include #include +#ifdef QT_USE_BUNDLED_LIBPNG +#include <../../3rdparty/libpng/png.h> +#include <../../3rdparty/libpng/pngconf.h> +#else #include #include +#endif #ifdef Q_OS_WINCE #define CALLBACK_CALL_TYPE __cdecl @@ -162,11 +167,16 @@ void setup_qt(QImage& image, png_structp png_ptr, png_infop info_ptr, float scre png_uint_32 height; int bit_depth; int color_type; + png_bytep trans_alpha = 0; + png_color_16p trans_color_p = 0; + int num_trans; + png_colorp palette = 0; + int num_palette; png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, 0, 0, 0); if (color_type == PNG_COLOR_TYPE_GRAY) { // Black & White or 8-bit grayscale - if (bit_depth == 1 && info_ptr->channels == 1) { + if (bit_depth == 1 && png_get_channels(png_ptr, info_ptr) == 1) { png_set_invert_mono(png_ptr); png_read_update_info(png_ptr, info_ptr); if (image.size() != QSize(width, height) || image.format() != QImage::Format_Mono) { @@ -207,20 +217,16 @@ void setup_qt(QImage& image, png_structp png_ptr, png_infop info_ptr, float scre int c = i*255/(ncols-1); image.setColor(i, qRgba(c,c,c,0xff)); } - if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) { -#if PNG_LIBPNG_VER_MAJOR < 1 || (PNG_LIBPNG_VER_MAJOR == 1 && PNG_LIBPNG_VER_MINOR < 4) - const int g = info_ptr->trans_values.gray; -#else - const int g = info_ptr->trans_color.gray; -#endif + if (png_get_tRNS(png_ptr, info_ptr, &trans_alpha, &num_trans, &trans_color_p) && trans_color_p) { + const int g = trans_color_p->gray; if (g < ncols) { image.setColor(g, 0); } } } } else if (color_type == PNG_COLOR_TYPE_PALETTE - && png_get_valid(png_ptr, info_ptr, PNG_INFO_PLTE) - && info_ptr->num_palette <= 256) + && png_get_PLTE(png_ptr, info_ptr, &palette, &num_palette) + && num_palette <= 256) { // 1-bit and 8-bit color if (bit_depth != 1) @@ -233,29 +239,26 @@ void setup_qt(QImage& image, png_structp png_ptr, png_infop info_ptr, float scre if (image.isNull()) return; } - image.setColorCount(info_ptr->num_palette); + png_get_PLTE(png_ptr, info_ptr, &palette, &num_palette); + image.setColorCount(num_palette); int i = 0; - if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) { - while (i < info_ptr->num_trans) { + if (png_get_tRNS(png_ptr, info_ptr, &trans_alpha, &num_trans, &trans_color_p) && trans_alpha) { + while (i < num_trans) { image.setColor(i, qRgba( - info_ptr->palette[i].red, - info_ptr->palette[i].green, - info_ptr->palette[i].blue, -#if PNG_LIBPNG_VER_MAJOR < 1 || (PNG_LIBPNG_VER_MAJOR == 1 && PNG_LIBPNG_VER_MINOR < 4) - info_ptr->trans[i] -#else - info_ptr->trans_alpha[i] -#endif + palette[i].red, + palette[i].green, + palette[i].blue, + trans_alpha[i] ) ); i++; } } - while (i < info_ptr->num_palette) { + while (i < num_palette) { image.setColor(i, qRgba( - info_ptr->palette[i].red, - info_ptr->palette[i].green, - info_ptr->palette[i].blue, + palette[i].red, + palette[i].green, + palette[i].blue, 0xff ) ); @@ -531,33 +534,36 @@ QImage::Format QPngHandlerPrivate::readImageFormat() QImage::Format format = QImage::Format_Invalid; png_uint_32 width, height; int bit_depth, color_type; - if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY) { + png_colorp palette; + int num_palette; + png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, 0, 0, 0); + if (color_type == PNG_COLOR_TYPE_GRAY) { // Black & White or 8-bit grayscale - if (info_ptr->bit_depth == 1 && info_ptr->channels == 1) { + if (bit_depth == 1 && png_get_channels(png_ptr, info_ptr) == 1) { format = QImage::Format_Mono; - } else if (info_ptr->bit_depth == 16 && png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) { + } else if (bit_depth == 16 && png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) { format = QImage::Format_ARGB32; } else { format = QImage::Format_Indexed8; } - } else if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE - && png_get_valid(png_ptr, info_ptr, PNG_INFO_PLTE) - && info_ptr->num_palette <= 256) + } else if (color_type == PNG_COLOR_TYPE_PALETTE + && png_get_PLTE(png_ptr, info_ptr, &palette, &num_palette) + && num_palette <= 256) { // 1-bit and 8-bit color - if (info_ptr->bit_depth != 1) + if (bit_depth != 1) png_set_packing(png_ptr); png_read_update_info(png_ptr, info_ptr); png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, 0, 0, 0); format = bit_depth == 1 ? QImage::Format_Mono : QImage::Format_Indexed8; } else { // 32-bit - if (info_ptr->bit_depth == 16) + if (bit_depth == 16) png_set_strip_16(png_ptr); format = QImage::Format_ARGB32; // Only add filler if no alpha, or we can get 5 channel data. - if (!(info_ptr->color_type & PNG_COLOR_MASK_ALPHA) + if (!(color_type & PNG_COLOR_MASK_ALPHA) && !png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) { // We want 4 bytes, but it isn't an alpha channel format = QImage::Format_RGB32; @@ -648,7 +654,7 @@ static void set_text(const QImage &image, png_structp png_ptr, png_infop info_pt text_ptr[i].text = qstrdup(value.constData()); text_ptr[i].text_length = 0; text_ptr[i].itxt_length = value.size(); - text_ptr[i].lang = "UTF-8"; + text_ptr[i].lang = const_cast("UTF-8"); text_ptr[i].lang_key = qstrdup(it.key().toUtf8().constData()); #endif ++i; @@ -735,64 +741,51 @@ bool Q_INTERNAL_WIN_NO_THROW QPNGImageWriter::writeImage(const QImage& image_in, png_set_compression_level(png_ptr, quality); } - if (gamma != 0.0) { - png_set_gAMA(png_ptr, info_ptr, 1.0/gamma); - } - png_set_write_fn(png_ptr, (void*)this, qpiw_write_fn, qpiw_flush_fn); - info_ptr->channels = - (image.depth() == 32) - ? (image.format() == QImage::Format_RGB32 ? 3 : 4) - : 1; - png_set_IHDR(png_ptr, info_ptr, image.width(), image.height(), image.depth() == 1 ? 1 : 8 /* per channel */, image.depth() == 32 ? image.format() == QImage::Format_RGB32 ? PNG_COLOR_TYPE_RGB : PNG_COLOR_TYPE_RGB_ALPHA - : PNG_COLOR_TYPE_PALETTE, 0, 0, 0); + : PNG_COLOR_TYPE_PALETTE, 0, 0, 0); // also sets #channels + if (gamma != 0.0) { + png_set_gAMA(png_ptr, info_ptr, 1.0/gamma); + } - //png_set_sBIT(png_ptr, info_ptr, 8); - info_ptr->sig_bit.red = 8; - info_ptr->sig_bit.green = 8; - info_ptr->sig_bit.blue = 8; + png_color_8 sig_bit; + sig_bit.red = 8; + sig_bit.green = 8; + sig_bit.blue = 8; + sig_bit.alpha = image.hasAlphaChannel() ? 8 : 0; + png_set_sBIT(png_ptr, info_ptr, &sig_bit); if (image.format() == QImage::Format_MonoLSB) png_set_packswap(png_ptr); - png_colorp palette = 0; - png_bytep copy_trans = 0; if (image.colorCount()) { // Paletted int num_palette = image.colorCount(); - palette = new png_color[num_palette]; - png_set_PLTE(png_ptr, info_ptr, palette, num_palette); - int* trans = new int[num_palette]; + png_color palette[num_palette]; + png_byte trans[num_palette]; int num_trans = 0; for (int i=0; ipalette[i].red = qRed(rgb); - info_ptr->palette[i].green = qGreen(rgb); - info_ptr->palette[i].blue = qBlue(rgb); - trans[i] = rgb >> 24; + QRgb rgba=image.color(i); + palette[i].red = qRed(rgba); + palette[i].green = qGreen(rgba); + palette[i].blue = qBlue(rgba); + trans[i] = qAlpha(rgba); if (trans[i] < 255) { num_trans = i+1; } } + png_set_PLTE(png_ptr, info_ptr, palette, num_palette); + if (num_trans) { - copy_trans = new png_byte[num_trans]; - for (int i=0; isig_bit.alpha = 8; } // Swap ARGB to RGBA (normal PNG format) before saving on @@ -868,11 +861,6 @@ bool Q_INTERNAL_WIN_NO_THROW QPNGImageWriter::writeImage(const QImage& image_in, png_write_end(png_ptr, info_ptr); frames_written++; - if (palette) - delete [] palette; - if (copy_trans) - delete [] copy_trans; - png_destroy_write_struct(&png_ptr, &info_ptr); return true; @@ -958,7 +946,8 @@ QVariant QPngHandler::option(ImageOption option) const else if (option == Description) return d->description; else if (option == Size) - return QSize(d->info_ptr->width, d->info_ptr->height); + return QSize(png_get_image_width(d->png_ptr, d->info_ptr), + png_get_image_height(d->png_ptr, d->info_ptr)); else if (option == ImageFormat) return d->readImageFormat(); return 0; -- cgit v0.12 From 81f50bd9691dc671f9185d6a91ca0b24a8c84402 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Tue, 9 Feb 2010 10:42:20 +0100 Subject: Fix failing QDoubleValidator tests Results seem consistent with the class documentation, and so have altered the expected results to match. Likely a change was made to the class internals and the auto tests were not updated. --- tests/auto/qdoublevalidator/tst_qdoublevalidator.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/auto/qdoublevalidator/tst_qdoublevalidator.cpp b/tests/auto/qdoublevalidator/tst_qdoublevalidator.cpp index 37dd6d8..26890b3 100644 --- a/tests/auto/qdoublevalidator/tst_qdoublevalidator.cpp +++ b/tests/auto/qdoublevalidator/tst_qdoublevalidator.cpp @@ -68,7 +68,7 @@ void tst_QDoubleValidator::validateThouSep_data() QTest::addColumn("value"); QTest::addColumn("result"); - QTest::newRow("1,000C") << "C" << QString("1,000") << INV; + QTest::newRow("1,000C") << "C" << QString("1,000") << ACC; QTest::newRow("1.000C") << "C" << QString("1.000") << ACC; QTest::newRow("1,000de") << "de" << QString("1,000") << ACC; @@ -160,9 +160,9 @@ void tst_QDoubleValidator::validate_data() QTest::newRow("data_de0") << "de" << 0.0 << 100.0 << 1 << QString("50,0") << ACC << ACC; QTest::newRow("data_de1") << "de" << 00.0 << 100.0 << 1 << QString("500,0") << ITM << ITM; QTest::newRow("data_de1a") << "de" << 00.0 << 100.0 << 1 << QString("5001,0") << ITM << INV; - QTest::newRow("data_de0C") << "de" << 0.0 << 100.0 << 1 << QString("50.0") << ACC << ACC; - QTest::newRow("data_de1C") << "de" << 00.0 << 100.0 << 1 << QString("500.0") << ITM << ITM; - QTest::newRow("data_de1aC") << "de" << 00.0 << 100.0 << 1 << QString("5001.0") << ITM << INV; + QTest::newRow("data_de0C") << "de" << 0.0 << 100.0 << 1 << QString("50,0") << ACC << ACC; + QTest::newRow("data_de1C") << "de" << 00.0 << 100.0 << 1 << QString("500,0") << ITM << ITM; + QTest::newRow("data_de1aC") << "de" << 00.0 << 100.0 << 1 << QString("5001,0") << ITM << INV; QTest::newRow("data_de2") << "de" << 00.0 << 100.0 << 1 << QString("-35,0") << INV << INV; QTest::newRow("data_de3") << "de" << 00.0 << 100.0 << 1 << QString("a") << INV << INV; QTest::newRow("data_de4") << "de" << 0.0 << 100.0 << 1 << QString("-") << INV << INV; @@ -172,7 +172,7 @@ void tst_QDoubleValidator::validate_data() QTest::newRow("data_de8") << "de" << -100.0 << 100.0 << 1 << QString("-100") << ACC << ACC; QTest::newRow("data_de9") << "de" << -100.0 << -10.0 << 1 << QString("10") << ITM << ITM; QTest::newRow("data_de10") << "de" << 0.3 << 0.5 << 5 << QString("0,34567") << ACC << ACC; - QTest::newRow("data_de11") << "de" << -0.3 << -0.5 << 5 << QString("-0,345678") << INV << INV; + QTest::newRow("data_de11") << "de" << -0.3 << -0.5 << 5 << QString("-0,345678") << ITM << INV; QTest::newRow("data_de12") << "de" << -0.32 << 0.32 << 1 << QString("0") << ACC << ACC; QTest::newRow("data_de13") << "de" << 0.0 << 100.0 << 1 << QString("3456a") << INV << INV; QTest::newRow("data_de14") << "de" << -100.0 << 100.0 << 1 << QString("-3456a") << INV << INV; -- cgit v0.12 From dfe41315c16d20f5e61cd572204bb4194285bc63 Mon Sep 17 00:00:00 2001 From: kh1 Date: Tue, 9 Feb 2010 11:14:59 +0100 Subject: Move find widget in it's own source file. Some further cleanup. Reviewed-by: ck --- tools/assistant/tools/assistant/assistant.pro | 2 + tools/assistant/tools/assistant/centralwidget.cpp | 250 +++++----------------- tools/assistant/tools/assistant/centralwidget.h | 74 +------ tools/assistant/tools/assistant/findwidget.cpp | 233 ++++++++++++++++++++ tools/assistant/tools/assistant/findwidget.h | 101 +++++++++ 5 files changed, 394 insertions(+), 266 deletions(-) create mode 100644 tools/assistant/tools/assistant/findwidget.cpp create mode 100644 tools/assistant/tools/assistant/findwidget.h diff --git a/tools/assistant/tools/assistant/assistant.pro b/tools/assistant/tools/assistant/assistant.pro index e62d30c..edaf076 100644 --- a/tools/assistant/tools/assistant/assistant.pro +++ b/tools/assistant/tools/assistant/assistant.pro @@ -25,6 +25,7 @@ HEADERS += aboutdialog.h \ centralwidget.h \ cmdlineparser.h \ contentwindow.h \ + findwidget.h \ filternamedialog.h \ helpenginewrapper.h \ helpviewer.h \ @@ -50,6 +51,7 @@ SOURCES += aboutdialog.cpp \ centralwidget.cpp \ cmdlineparser.cpp \ contentwindow.cpp \ + findwidget.cpp \ filternamedialog.cpp \ helpenginewrapper.cpp \ helpviewer.cpp \ diff --git a/tools/assistant/tools/assistant/centralwidget.cpp b/tools/assistant/tools/assistant/centralwidget.cpp index 8bb2ffe..03af06c 100644 --- a/tools/assistant/tools/assistant/centralwidget.cpp +++ b/tools/assistant/tools/assistant/centralwidget.cpp @@ -41,34 +41,26 @@ #include "tracer.h" #include "centralwidget.h" +#include "findwidget.h" #include "helpenginewrapper.h" #include "helpviewer.h" #include "searchwidget.h" #include "mainwindow.h" -#include "preferencesdialog.h" #include "../shared/collectionconfiguration.h" -#include -#include #include -#include -#include +#include +#include #include +#include #include -#include -#include #include #include #include -#include -#include -#include +#include #include -#include -#include #include -#include #include @@ -88,135 +80,13 @@ namespace { CentralWidget *staticCentralWidget = 0; } -FindWidget::FindWidget(QWidget *parent) - : QWidget(parent) - , appPalette(qApp->palette()) -{ - TRACE_OBJ - QHBoxLayout *hboxLayout = new QHBoxLayout(this); - QString resourcePath = QLatin1String(":/trolltech/assistant/images/"); - -#ifndef Q_OS_MAC - hboxLayout->setMargin(0); - hboxLayout->setSpacing(6); - resourcePath.append(QLatin1String("win")); -#else - resourcePath.append(QLatin1String("mac")); -#endif - - toolClose = setupToolButton(QLatin1String(""), - resourcePath + QLatin1String("/closetab.png")); - hboxLayout->addWidget(toolClose); - - editFind = new QLineEdit(this); - hboxLayout->addWidget(editFind); - editFind->setMinimumSize(QSize(150, 0)); - connect(editFind, SIGNAL(textChanged(QString)), this, SLOT(updateButtons())); - toolPrevious = setupToolButton(tr("Previous"), - resourcePath + QLatin1String("/previous.png")); - hboxLayout->addWidget(toolPrevious); - - toolNext = setupToolButton(tr("Next"), - resourcePath + QLatin1String("/next.png")); - hboxLayout->addWidget(toolNext); - - checkCase = new QCheckBox(tr("Case Sensitive"), this); - hboxLayout->addWidget(checkCase); - - checkWholeWords = new QCheckBox(tr("Whole words"), this); - hboxLayout->addWidget(checkWholeWords); -#if !defined(QT_NO_WEBKIT) - checkWholeWords->hide(); -#endif - - labelWrapped = new QLabel(this); - labelWrapped->setScaledContents(true); - labelWrapped->setTextFormat(Qt::RichText); - labelWrapped->setMinimumSize(QSize(0, 20)); - labelWrapped->setMaximumSize(QSize(105, 20)); - labelWrapped->setAlignment(Qt::AlignLeading | Qt::AlignLeft | Qt::AlignVCenter); - labelWrapped->setText(tr(" Search wrapped")); - hboxLayout->addWidget(labelWrapped); - - QSpacerItem *spacerItem = new QSpacerItem(20, 20, QSizePolicy::Expanding, - QSizePolicy::Minimum); - hboxLayout->addItem(spacerItem); - setMinimumWidth(minimumSizeHint().width()); - labelWrapped->hide(); - - updateButtons(); -} - -FindWidget::~FindWidget() -{ - TRACE_OBJ -} - -void FindWidget::hideEvent(QHideEvent* event) -{ - TRACE_OBJ -#if !defined(QT_NO_WEBKIT) - // TODO: remove this once webkit supports setting the palette - if (!event->spontaneous()) - qApp->setPalette(appPalette); -#else - Q_UNUSED(event); -#endif -} - -void FindWidget::showEvent(QShowEvent* event) -{ - TRACE_OBJ -#if !defined(QT_NO_WEBKIT) - // TODO: remove this once webkit supports setting the palette - if (!event->spontaneous()) { - QPalette p = appPalette; - p.setColor(QPalette::Inactive, QPalette::Highlight, - p.color(QPalette::Active, QPalette::Highlight)); - p.setColor(QPalette::Inactive, QPalette::HighlightedText, - p.color(QPalette::Active, QPalette::HighlightedText)); - qApp->setPalette(p); - } -#else - Q_UNUSED(event); -#endif -} - -void FindWidget::updateButtons() -{ - TRACE_OBJ - if (editFind->text().isEmpty()) { - toolPrevious->setEnabled(false); - toolNext->setEnabled(false); - } else { - toolPrevious->setEnabled(true); - toolNext->setEnabled(true); - } -} - -QToolButton* FindWidget::setupToolButton(const QString &text, const QString &icon) -{ - TRACE_OBJ - QToolButton *toolButton = new QToolButton(this); - - toolButton->setText(text); - toolButton->setAutoRaise(true); - toolButton->setIcon(QIcon(icon)); - toolButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); - - return toolButton; -} - - -// -- +// -- CentralWidget CentralWidget::CentralWidget(MainWindow *parent) : QWidget(parent) , lastTabPage(0) - , findBar(0) , tabWidget(0) , findWidget(0) , printer(0) @@ -260,20 +130,15 @@ CentralWidget::CentralWidget(MainWindow *parent) vboxLayout->addWidget(tabWidget); - findBar = new QWidget(this); - findWidget = new FindWidget(findBar); - findBar->setMinimumHeight(findWidget->minimumSizeHint().height()); - findWidget->move(0, 0); - vboxLayout->addWidget(findBar); - findBar->hide(); - findWidget->editFind->installEventFilter(this); - - connect(findWidget->toolClose, SIGNAL(clicked()), findBar, SLOT(hide())); - connect(findWidget->toolNext, SIGNAL(clicked()), this, SLOT(findNext())); - connect(findWidget->editFind, SIGNAL(returnPressed()), this, SLOT(findNext())); - connect(findWidget->editFind, SIGNAL(textChanged(QString)), this, - SLOT(findCurrentText(QString))); - connect(findWidget->toolPrevious, SIGNAL(clicked()), this, SLOT(findPrevious())); + findWidget = new FindWidget(this); + vboxLayout->addWidget(findWidget); + findWidget->hide(); + + connect(findWidget, SIGNAL(findNext()), this, SLOT(findNext())); + connect(findWidget, SIGNAL(findPrevious()), this, SLOT(findPrevious())); + connect(findWidget, SIGNAL(find(QString, bool)), this, + SLOT(find(QString, bool))); + connect(findWidget, SIGNAL(escapePressed()), this, SLOT(activateTab())); QTabBar *tabBar = qFindChild(tabWidget); if (tabBar) { @@ -360,12 +225,6 @@ void CentralWidget::zoomOut() m_searchWidget->zoomOut(); } -void CentralWidget::findNext() -{ - TRACE_OBJ - find(findWidget->editFind->text(), true); -} - void CentralWidget::nextPage() { TRACE_OBJ @@ -395,12 +254,6 @@ void CentralWidget::previousPage() tabWidget->setCurrentIndex(index); } -void CentralWidget::findPrevious() -{ - TRACE_OBJ - find(findWidget->editFind->text(), false); -} - void CentralWidget::closeTab() { TRACE_OBJ @@ -527,9 +380,7 @@ void CentralWidget::copySelection() void CentralWidget::showTextSearch() { TRACE_OBJ - findBar->show(); - findWidget->editFind->selectAll(); - findWidget->editFind->setFocus(Qt::ShortcutFocusReason); + findWidget->show(); } void CentralWidget::initPrinter() @@ -708,12 +559,6 @@ HelpViewer *CentralWidget::newEmptyTab() return viewer; } -void CentralWidget::findCurrentText(const QString &text) -{ - TRACE_OBJ - find(text, true); -} - void CentralWidget::connectSignals() { TRACE_OBJ @@ -855,14 +700,6 @@ bool CentralWidget::eventFilter(QObject *object, QEvent *e) return QWidget::eventFilter(object, e); } break; - case Qt::Key_Escape: { - if (findWidget->editFind == object) { - findBar->hide(); - if (HelpViewer *viewer = currentHelpViewer()) - viewer->setFocus(); - } - } break; - case Qt::Key_Backspace: { HelpViewer *viewer = currentHelpViewer(); if (viewer == object) { @@ -906,38 +743,43 @@ void CentralWidget::keyPressEvent(QKeyEvent *e) TRACE_OBJ const QString &text = e->text(); if (text.startsWith(QLatin1Char('/'))) { - if (!findBar->isVisible()) { - findBar->show(); - findWidget->editFind->clear(); + if (!findWidget->isVisible()) { + findWidget->showAndClear(); } else { - findWidget->editFind->selectAll(); + findWidget->show(); } - findWidget->editFind->setFocus(); - return; + } else { + QWidget::keyPressEvent(e); } - QWidget::keyPressEvent(e); } -void CentralWidget::find(const QString &ttf, bool forward) +void CentralWidget::findNext() +{ + find(findWidget->text(), true); +} + +void CentralWidget::findPrevious() { TRACE_OBJ - QPalette p = findWidget->editFind->palette(); - p.setColor(QPalette::Active, QPalette::Base, Qt::white); + find(findWidget->text(), false); +} +void CentralWidget::find(const QString &ttf, bool forward) +{ + TRACE_OBJ bool found = false; - #if defined(QT_NO_WEBKIT) found = findInTextBrowser(ttf, forward); #else found = findInWebPage(ttf, forward); #endif - if (!found && !ttf.isEmpty()) - p.setColor(QPalette::Active, QPalette::Base, QColor(255, 102, 102)); + if (!found && ttf.isEmpty()) + found = true; // the line edit is empty, no need to mark it red... if (!findWidget->isVisible()) findWidget->show(); - findWidget->editFind->setPalette(p); + findWidget->setPalette(found); } bool CentralWidget::findInWebPage(const QString &ttf, bool forward) @@ -951,21 +793,23 @@ bool CentralWidget::findInWebPage(const QString &ttf, bool forward) if (!forward) options |= QWebPage::FindBackward; - if (findWidget->checkCase->isChecked()) + if (findWidget->caseSensitive()) options |= QWebPage::FindCaseSensitively; found = viewer->findText(ttf, options); - findWidget->labelWrapped->hide(); + findWidget->setTextWrappedVisible(false); if (!found) { options |= QWebPage::FindWrapsAroundDocument; found = viewer->findText(ttf, options); if (found) - findWidget->labelWrapped->show(); + findWidget->setTextWrappedVisible(true); } } // force highlighting of all other matches, also when empty (clear) options = QWebPage::HighlightAllOccurrences; + if (findWidget->caseSensitive()) + options |= QWebPage::FindCaseSensitively; viewer->findText(QLatin1String(""), options); viewer->findText(ttf, options); return found; @@ -1006,13 +850,10 @@ bool CentralWidget::findInTextBrowser(const QString &ttf, bool forward) if (!forward) options |= QTextDocument::FindBackward; - if (findWidget->checkCase->isChecked()) + if (findWidget->caseSensitive()) options |= QTextDocument::FindCaseSensitively; - if (findWidget->checkWholeWords->isChecked()) - options |= QTextDocument::FindWholeWords; - - findWidget->labelWrapped->hide(); + findWidget->setTextWrappedVisible(false); bool found = true; QTextCursor newCursor = doc->find(ttf, cursor, options); @@ -1025,7 +866,7 @@ bool CentralWidget::findInTextBrowser(const QString &ttf, bool forward) found = false; newCursor = cursor; } else { - findWidget->labelWrapped->show(); + findWidget->setTextWrappedVisible(true); } } browser->setTextCursor(newCursor); @@ -1048,6 +889,11 @@ void CentralWidget::updateBrowserFont() setBrowserFontFor(tabWidget->widget(i), font); } +bool CentralWidget::searchWidgetAttached() const +{ + return m_searchWidget && m_searchWidget->isAttached(); +} + void CentralWidget::createSearchWidget(QHelpSearchEngine *searchEngine) { TRACE_OBJ diff --git a/tools/assistant/tools/assistant/centralwidget.h b/tools/assistant/tools/assistant/centralwidget.h index a7c0d6f..6c3e93c 100644 --- a/tools/assistant/tools/assistant/centralwidget.h +++ b/tools/assistant/tools/assistant/centralwidget.h @@ -38,72 +38,20 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ - #ifndef CENTRALWIDGET_H #define CENTRALWIDGET_H -#include #include -#include -#include - #include -#include "searchwidget.h" - QT_BEGIN_NAMESPACE -class QEvent; -class QLabel; -class QAction; -class QCheckBox; -class QLineEdit; -class QTextBrowser; -class QToolButton; - +class FindWidget; class HelpViewer; -class QTabWidget; -class QHelpEngine; -class CentralWidget; -class PrintHelper; class MainWindow; - class QHelpSearchEngine; - -class FindWidget : public QWidget -{ - Q_OBJECT - -public: - FindWidget(QWidget *parent = 0); - ~FindWidget(); - -signals: - void findNext(); - void findPrevious(); - -protected: - void hideEvent(QHideEvent* event); - void showEvent(QShowEvent * event); - -private slots: - void updateButtons(); - -private: - QToolButton* setupToolButton(const QString &text, const QString &icon); - -private: - QLineEdit *editFind; - QCheckBox *checkCase; - QLabel *labelWrapped; - QToolButton *toolNext; - QToolButton *toolClose; - QToolButton *toolPrevious; - QCheckBox *checkWholeWords; - - QPalette appPalette; - friend class CentralWidget; -}; +class QTabWidget; +class SearchWidget; class CentralWidget : public QWidget { @@ -123,11 +71,8 @@ public: QList globalActions() const; void setGlobalActions(const QList &actions); HelpViewer *currentHelpViewer() const; - void activateTab(bool onlyHelpViewer = false); - bool searchWidgetAttached() const { - return m_searchWidget && m_searchWidget->isAttached(); - } + bool searchWidgetAttached() const; void createSearchWidget(QHelpSearchEngine *searchEngine); void activateSearchWidget(bool updateLastTabPage = false); void removeSearchWidget(); @@ -144,11 +89,9 @@ public: public slots: void zoomIn(); void zoomOut(); - void findNext(); void nextPage(); void resetZoom(); void previousPage(); - void findPrevious(); void copySelection(); void showTextSearch(); void print(); @@ -157,12 +100,17 @@ public slots: void updateBrowserFont(); void setSource(const QUrl &url); void setSourceInNewTab(const QUrl &url, qreal zoom = 0.0); - void findCurrentText(const QString &text); HelpViewer *newEmptyTab(); void home(); void forward(); void backward(); + void activateTab(bool onlyHelpViewer = false); + + void findNext(); + void findPrevious(); + void find(const QString &text, bool forward); + signals: void currentViewerChanged(); void copyAvailable(bool yes); @@ -189,7 +137,6 @@ private slots: private: void connectSignals(); bool eventFilter(QObject *object, QEvent *e); - void find(const QString &ttf, bool forward); bool findInWebPage(const QString &ttf, bool forward); bool findInTextBrowser(const QString &ttf, bool forward); void initPrinter(); @@ -203,7 +150,6 @@ private: int lastTabPage; QList globalActionList; - QWidget *findBar; QTabWidget *tabWidget; FindWidget *findWidget; QPrinter *printer; diff --git a/tools/assistant/tools/assistant/findwidget.cpp b/tools/assistant/tools/assistant/findwidget.cpp new file mode 100644 index 0000000..2e40ab0 --- /dev/null +++ b/tools/assistant/tools/assistant/findwidget.cpp @@ -0,0 +1,233 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "tracer.h" +#include "findwidget.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +FindWidget::FindWidget(QWidget *parent) + : QWidget(parent) + , appPalette(qApp->palette()) +{ + TRACE_OBJ + installEventFilter(this); + QHBoxLayout *hboxLayout = new QHBoxLayout(this); + QString resourcePath = QLatin1String(":/trolltech/assistant/images/"); + +#ifndef Q_OS_MAC + hboxLayout->setMargin(0); + hboxLayout->setSpacing(6); + resourcePath.append(QLatin1String("win")); +#else + resourcePath.append(QLatin1String("mac")); +#endif + + toolClose = setupToolButton(QLatin1String(""), + resourcePath + QLatin1String("/closetab.png")); + hboxLayout->addWidget(toolClose); + + editFind = new QLineEdit(this); + hboxLayout->addWidget(editFind); + editFind->setMinimumSize(QSize(150, 0)); + connect(editFind, SIGNAL(textChanged(QString)), this, + SLOT(textChanged(QString))); + connect(editFind, SIGNAL(returnPressed()), this, SIGNAL(findNext())); + connect(editFind, SIGNAL(textChanged(QString)), this, SLOT(updateButtons())); + + toolPrevious = setupToolButton(tr("Previous"), + resourcePath + QLatin1String("/previous.png")); + connect(toolPrevious, SIGNAL(clicked()), this, SIGNAL(findPrevious())); + + hboxLayout->addWidget(toolPrevious); + + toolNext = setupToolButton(tr("Next"), + resourcePath + QLatin1String("/next.png")); + hboxLayout->addWidget(toolNext); + connect(toolNext, SIGNAL(clicked()), this, SIGNAL(findNext())); + + checkCase = new QCheckBox(tr("Case Sensitive"), this); + hboxLayout->addWidget(checkCase); + + labelWrapped = new QLabel(this); + labelWrapped->setScaledContents(true); + labelWrapped->setTextFormat(Qt::RichText); + labelWrapped->setMinimumSize(QSize(0, 20)); + labelWrapped->setMaximumSize(QSize(105, 20)); + labelWrapped->setAlignment(Qt::AlignLeading | Qt::AlignLeft | Qt::AlignVCenter); + labelWrapped->setText(tr(" Search wrapped")); + hboxLayout->addWidget(labelWrapped); + + QSpacerItem *spacerItem = new QSpacerItem(20, 20, QSizePolicy::Expanding, + QSizePolicy::Minimum); + hboxLayout->addItem(spacerItem); + setMinimumWidth(minimumSizeHint().width()); + labelWrapped->hide(); + + updateButtons(); +} + +FindWidget::~FindWidget() +{ + TRACE_OBJ +} + +void FindWidget::show() +{ + TRACE_OBJ + QWidget::show(); + editFind->selectAll(); + editFind->setFocus(Qt::ShortcutFocusReason); +} + +void FindWidget::showAndClear() +{ + TRACE_OBJ + show(); + editFind->clear(); +} + +QString FindWidget::text() const +{ + TRACE_OBJ + return editFind->text(); +} + +bool FindWidget::caseSensitive() const +{ + TRACE_OBJ + return checkCase->isChecked(); +} + +void FindWidget::setPalette(bool found) +{ + TRACE_OBJ + QPalette palette = editFind->palette(); + palette.setColor(QPalette::Active, QPalette::Base, found ? Qt::white + : QColor(255, 102, 102)); + editFind->setPalette(palette); +} + +void FindWidget::setTextWrappedVisible(bool visible) +{ + TRACE_OBJ + labelWrapped->setVisible(visible); +} + +void FindWidget::hideEvent(QHideEvent* event) +{ + TRACE_OBJ +#if !defined(QT_NO_WEBKIT) + // TODO: remove this once webkit supports setting the palette + if (!event->spontaneous()) + qApp->setPalette(appPalette); +#else + Q_UNUSED(event); +#endif +} + +void FindWidget::showEvent(QShowEvent* event) +{ + TRACE_OBJ +#if !defined(QT_NO_WEBKIT) + // TODO: remove this once webkit supports setting the palette + if (!event->spontaneous()) { + QPalette p = appPalette; + p.setColor(QPalette::Inactive, QPalette::Highlight, + p.color(QPalette::Active, QPalette::Highlight)); + p.setColor(QPalette::Inactive, QPalette::HighlightedText, + p.color(QPalette::Active, QPalette::HighlightedText)); + qApp->setPalette(p); + } +#else + Q_UNUSED(event); +#endif +} + +void FindWidget::updateButtons() +{ + TRACE_OBJ + const bool enable = !editFind->text().isEmpty(); + toolNext->setEnabled(enable); + toolPrevious->setEnabled(enable); +} + +void FindWidget::textChanged(const QString &text) +{ + TRACE_OBJ + emit find(text, true); +} + +bool FindWidget::eventFilter(QObject *object, QEvent *e) +{ + TRACE_OBJ + if (e->type() == QEvent::KeyPress) { + if ((static_cast(e))->key() == Qt::Key_Escape) { + hide(); + emit escapePressed(); + } + } + return QWidget::eventFilter(object, e); +} + +QToolButton* FindWidget::setupToolButton(const QString &text, const QString &icon) +{ + TRACE_OBJ + QToolButton *toolButton = new QToolButton(this); + + toolButton->setText(text); + toolButton->setAutoRaise(true); + toolButton->setIcon(QIcon(icon)); + toolButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); + + return toolButton; +} + +QT_END_NAMESPACE diff --git a/tools/assistant/tools/assistant/findwidget.h b/tools/assistant/tools/assistant/findwidget.h new file mode 100644 index 0000000..cf78003 --- /dev/null +++ b/tools/assistant/tools/assistant/findwidget.h @@ -0,0 +1,101 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef FINDWIDGET_H +#define FINDWIDGET_H + +#include + +QT_BEGIN_NAMESPACE + +class QCheckBox; +class QLabel; +class QLineEdit; +class QToolButton; + +class FindWidget : public QWidget +{ + Q_OBJECT +public: + FindWidget(QWidget *parent = 0); + ~FindWidget(); + + void show(); + void showAndClear(); + + QString text() const; + bool caseSensitive() const; + + void setPalette(bool found); + void setTextWrappedVisible(bool visible); + +signals: + void escapePressed(); + + void findNext(); + void findPrevious(); + void find(const QString &text, bool forward); + +protected: + void hideEvent(QHideEvent* event); + void showEvent(QShowEvent * event); + +private slots: + void updateButtons(); + void textChanged(const QString &text); + +private: + bool eventFilter(QObject *object, QEvent *e); + QToolButton* setupToolButton(const QString &text, const QString &icon); + +private: + QPalette appPalette; + + QLineEdit *editFind; + QCheckBox *checkCase; + QLabel *labelWrapped; + QToolButton *toolNext; + QToolButton *toolClose; + QToolButton *toolPrevious; +}; + +QT_END_NAMESPACE + +#endif // FINDWIDGET_H -- cgit v0.12 From 4710521ab62540378816d3888936eace9686ff97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= Date: Sat, 28 Nov 2009 13:02:58 +0100 Subject: Fixed setting back spaces when streaming a QPointF When streaming a QPointF, it did not restore the inserting of spaces like the QPoint does. --- src/corelib/tools/qpoint.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/tools/qpoint.cpp b/src/corelib/tools/qpoint.cpp index d60087f..9850ee7 100644 --- a/src/corelib/tools/qpoint.cpp +++ b/src/corelib/tools/qpoint.cpp @@ -374,7 +374,7 @@ QDebug operator<<(QDebug dbg, const QPoint &p) { QDebug operator<<(QDebug d, const QPointF &p) { d.nospace() << "QPointF(" << p.x() << ", " << p.y() << ')'; - return d; + return d.space(); } #endif -- cgit v0.12 From 54290ef776a311f0c303e2a8df4de5e39e9a032a Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Tue, 9 Feb 2010 14:30:08 +0100 Subject: Added method to clear the undo/redo stacks. Reviewed-by: mae --- src/gui/text/qtextdocument.cpp | 17 +++++++++++ src/gui/text/qtextdocument.h | 7 +++++ src/gui/text/qtextdocument_p.cpp | 62 ++++++++++++++++++++++++++-------------- src/gui/text/qtextdocument_p.h | 3 +- 4 files changed, 67 insertions(+), 22 deletions(-) diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp index b8c9b94..80931c9 100644 --- a/src/gui/text/qtextdocument.cpp +++ b/src/gui/text/qtextdocument.cpp @@ -436,6 +436,23 @@ void QTextDocument::redo(QTextCursor *cursor) } /*! + \since 4.7 + Clears the specified stacks. + + This method clears any commands on the undo stack, the redo stack, or both (the + default). If any commands got cleared, the appropriate signals + (\a QTextDocument::undoAvailable or \a QTextDocument::redoAvailable) get + emitted. + + \sa QTextDocument::undoAvailable QTextDocument::redoAvailable +*/ +void QTextDocument::clearUndoRedoStacks(Stacks stacksToClear) +{ + Q_D(QTextDocument); + d->clearUndoRedoStacks(stacksToClear, true); +} + +/*! \overload */ diff --git a/src/gui/text/qtextdocument.h b/src/gui/text/qtextdocument.h index b5bcb41..0140772 100644 --- a/src/gui/text/qtextdocument.h +++ b/src/gui/text/qtextdocument.h @@ -256,6 +256,13 @@ public: void undo(QTextCursor *cursor); void redo(QTextCursor *cursor); + enum Stacks { + UndoStack = 0x01, + RedoStack = 0x02, + UndoAndRedoStacks = UndoStack | RedoStack + }; + void clearUndoRedoStacks(Stacks historyToClear = UndoAndRedoStacks); + int maximumBlockCount() const; void setMaximumBlockCount(int maximum); diff --git a/src/gui/text/qtextdocument_p.cpp b/src/gui/text/qtextdocument_p.cpp index 372b9dc..b36642b 100644 --- a/src/gui/text/qtextdocument_p.cpp +++ b/src/gui/text/qtextdocument_p.cpp @@ -260,7 +260,7 @@ void QTextDocumentPrivate::clear() title.clear(); undoState = 0; - truncateUndoStack(); + clearUndoRedoStacks(QTextDocument::UndoStack); text = QString(); unreachableCharacterCount = 0; modifiedState = 0; @@ -292,7 +292,7 @@ QTextDocumentPrivate::~QTextDocumentPrivate() cursors.clear(); undoState = 0; undoEnabled = true; - truncateUndoStack(); + clearUndoRedoStacks(QTextDocument::UndoStack); } void QTextDocumentPrivate::setLayout(QAbstractTextDocumentLayout *layout) @@ -1027,7 +1027,7 @@ void QTextDocumentPrivate::appendUndoItem(const QTextUndoCommand &c) if (!undoEnabled) return; if (undoState < undoStack.size()) - truncateUndoStack(); + clearUndoRedoStacks(QTextDocument::UndoStack); if (!undoStack.isEmpty() && modified) { QTextUndoCommand &last = undoStack[undoState - 1]; @@ -1050,26 +1050,46 @@ void QTextDocumentPrivate::appendUndoItem(const QTextUndoCommand &c) emit document()->undoCommandAdded(); } -void QTextDocumentPrivate::truncateUndoStack() +void QTextDocumentPrivate::clearUndoRedoStacks(QTextDocument::Stacks stacksToClear, + bool emitSignals) { - if (undoState == undoStack.size()) - return; - - for (int i = undoState; i < undoStack.size(); ++i) { - QTextUndoCommand c = undoStack[i]; - if (c.command & QTextUndoCommand::Removed) { - // ######## -// QTextFragment *f = c.fragment_list; -// while (f) { -// QTextFragment *n = f->right; -// delete f; -// f = n; -// } - } else if (c.command & QTextUndoCommand::Custom) { - delete c.custom; + bool undoCommandsAvailable = undoState != 0; + bool redoCommandsAvailable = undoState != undoStack.size(); + if (stacksToClear == QTextDocument::UndoStack && undoCommandsAvailable) { + for (int i = 0; i < undoState; ++i) { + QTextUndoCommand c = undoStack[undoState]; + if (c.command & QTextUndoCommand::Custom) + delete c.custom; + } + undoStack.remove(0, undoState); + undoStack.resize(undoStack.size() - undoState); + undoState = 0; + if (emitSignals) + emitUndoAvailable(false); + } else if (stacksToClear == QTextDocument::RedoStack + && redoCommandsAvailable) { + for (int i = undoState; i < undoStack.size(); ++i) { + QTextUndoCommand c = undoStack[i]; + if (c.command & QTextUndoCommand::Custom) + delete c.custom; + } + undoStack.resize(undoState); + if (emitSignals) + emitRedoAvailable(false); + } else if (stacksToClear == QTextDocument::UndoAndRedoStacks + && (undoCommandsAvailable || redoCommandsAvailable)) { + for (int i = 0; i < undoStack.size(); ++i) { + QTextUndoCommand c = undoStack[i]; + if (c.command & QTextUndoCommand::Custom) + delete c.custom; } + undoState = 0; + undoStack.resize(0); + if (emitSignals && undoCommandsAvailable) + emitUndoAvailable(false); + if (emitSignals && redoCommandsAvailable) + emitRedoAvailable(false); } - undoStack.resize(undoState); } void QTextDocumentPrivate::emitUndoAvailable(bool available) @@ -1097,7 +1117,7 @@ void QTextDocumentPrivate::enableUndoRedo(bool enable) if (!enable) { undoState = 0; - truncateUndoStack(); + clearUndoRedoStacks(QTextDocument::UndoStack); emitUndoAvailable(false); emitRedoAvailable(false); } diff --git a/src/gui/text/qtextdocument_p.h b/src/gui/text/qtextdocument_p.h index 4ecc2fa..ac5ed3c 100644 --- a/src/gui/text/qtextdocument_p.h +++ b/src/gui/text/qtextdocument_p.h @@ -252,10 +252,11 @@ public: inline QFont defaultFont() const { return formats.defaultFont(); } inline void setDefaultFont(const QFont &f) { formats.setDefaultFont(f); } + void clearUndoRedoStacks(QTextDocument::Stacks stacksToClear, bool emitSignals = false); + private: bool split(int pos); bool unite(uint f); - void truncateUndoStack(); void insert_string(int pos, uint strPos, uint length, int format, QTextUndoCommand::Operation op); int insert_block(int pos, uint strPos, int format, int blockformat, QTextUndoCommand::Operation op, int command); -- cgit v0.12 From 6f155d010b6dd5ae3c04e62b3a29f8c0ed9f0a36 Mon Sep 17 00:00:00 2001 From: aavit Date: Wed, 10 Feb 2010 10:05:51 +0100 Subject: Workaround for a certain functionally challenged compiler Reviewed-by: Trond --- src/gui/image/qpnghandler.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/image/qpnghandler.cpp b/src/gui/image/qpnghandler.cpp index bba54b9..dd31834 100644 --- a/src/gui/image/qpnghandler.cpp +++ b/src/gui/image/qpnghandler.cpp @@ -767,9 +767,9 @@ bool Q_INTERNAL_WIN_NO_THROW QPNGImageWriter::writeImage(const QImage& image_in, if (image.colorCount()) { // Paletted - int num_palette = image.colorCount(); - png_color palette[num_palette]; - png_byte trans[num_palette]; + int num_palette = qMin(256, image.colorCount()); + png_color palette[256]; + png_byte trans[256]; int num_trans = 0; for (int i=0; i Date: Tue, 9 Feb 2010 09:56:25 +0100 Subject: Crash when deleting the parent of a context menu while it is being displayed Asynchronous deletion of a widget (e.g. calling deleteLater() after a timeout) could be caught by the context menu's event loop if called with exec() instead of popup(). This causes the context menu to be deleted twice in some cases, and a crash generally follows. Although this introduces a minor behaviour change, we now use popup() with the WA_DeleteOnClose attribute to display the context menu in all the contextMenuEvent() bodies, except in those where the menu was already protected by a QPointer. In QDialog::contextMenuEvent(), we use QWeakPointer to reflect the fact that the menu was previously allocated in the stack. QAbstractSpinBox, QDialog and QMdiSubWindow keep using QMenu::exec() in contextMenuEvent() as they need the QAction returned. Some auto-tests included. Reviewed-by: Olivier Task-number: QTBUG-7902 --- src/gui/dialogs/qdialog.cpp | 7 ++++--- src/gui/dialogs/qmessagebox.cpp | 4 ++-- src/gui/text/qtextcontrol.cpp | 4 ++-- src/gui/widgets/qlabel.cpp | 4 ++-- src/gui/widgets/qlineedit.cpp | 6 +++--- src/gui/widgets/qmainwindow.cpp | 12 ++++++++---- tests/auto/qlabel/tst_qlabel.cpp | 24 ++++++++++++++++++++++++ tests/auto/qlineedit/tst_qlineedit.cpp | 23 +++++++++++++++++++++++ tests/auto/qtextedit/tst_qtextedit.cpp | 22 ++++++++++++++++++++++ 9 files changed, 90 insertions(+), 16 deletions(-) diff --git a/src/gui/dialogs/qdialog.cpp b/src/gui/dialogs/qdialog.cpp index 9ff2ad8..fb0dba4 100644 --- a/src/gui/dialogs/qdialog.cpp +++ b/src/gui/dialogs/qdialog.cpp @@ -648,13 +648,14 @@ void QDialog::contextMenuEvent(QContextMenuEvent *e) while (w && w->whatsThis().size() == 0 && !w->testAttribute(Qt::WA_CustomWhatsThis)) w = w->isWindow() ? 0 : w->parentWidget(); if (w) { - QMenu p(this); - QAction *wt = p.addAction(tr("What's This?")); - if (p.exec(e->globalPos()) == wt) { + QWeakPointer p = new QMenu(this); + QAction *wt = p.data()->addAction(tr("What's This?")); + if (p.data()->exec(e->globalPos()) == wt) { QHelpEvent e(QEvent::WhatsThis, w->rect().center(), w->mapToGlobal(w->rect().center())); QApplication::sendEvent(w, &e); } + delete p.data(); } #endif } diff --git a/src/gui/dialogs/qmessagebox.cpp b/src/gui/dialogs/qmessagebox.cpp index d1b2e3f..ed437ff 100644 --- a/src/gui/dialogs/qmessagebox.cpp +++ b/src/gui/dialogs/qmessagebox.cpp @@ -92,8 +92,8 @@ public: { #ifndef QT_NO_CONTEXTMENU QMenu *menu = createStandardContextMenu(); - menu->exec(e->globalPos()); - delete menu; + menu->setAttribute(Qt::WA_DeleteOnClose); + menu->popup(e->globalPos()); #else Q_UNUSED(e); #endif diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp index aaaa3ca..8d3923f 100644 --- a/src/gui/text/qtextcontrol.cpp +++ b/src/gui/text/qtextcontrol.cpp @@ -1762,8 +1762,8 @@ void QTextControlPrivate::contextMenuEvent(const QPoint &screenPos, const QPoint QMenu *menu = q->createStandardContextMenu(docPos, contextWidget); if (!menu) return; - menu->exec(screenPos); - delete menu; + menu->setAttribute(Qt::WA_DeleteOnClose); + menu->popup(screenPos); #endif } diff --git a/src/gui/widgets/qlabel.cpp b/src/gui/widgets/qlabel.cpp index c779312..b81f04f 100644 --- a/src/gui/widgets/qlabel.cpp +++ b/src/gui/widgets/qlabel.cpp @@ -951,8 +951,8 @@ void QLabel::contextMenuEvent(QContextMenuEvent *ev) return; } ev->accept(); - menu->exec(ev->globalPos()); - delete menu; + menu->setAttribute(Qt::WA_DeleteOnClose); + menu->popup(ev->globalPos()); #endif } diff --git a/src/gui/widgets/qlineedit.cpp b/src/gui/widgets/qlineedit.cpp index 2d2df92..141f844 100644 --- a/src/gui/widgets/qlineedit.cpp +++ b/src/gui/widgets/qlineedit.cpp @@ -2046,9 +2046,9 @@ void QLineEdit::dropEvent(QDropEvent* e) */ void QLineEdit::contextMenuEvent(QContextMenuEvent *event) { - QPointer menu = createStandardContextMenu(); - menu->exec(event->globalPos()); - delete menu; + QMenu *menu = createStandardContextMenu(); + menu->setAttribute(Qt::WA_DeleteOnClose); + menu->popup(event->globalPos()); } #if defined(Q_WS_WIN) diff --git a/src/gui/widgets/qmainwindow.cpp b/src/gui/widgets/qmainwindow.cpp index eb25417..a63f3bf 100644 --- a/src/gui/widgets/qmainwindow.cpp +++ b/src/gui/widgets/qmainwindow.cpp @@ -1555,11 +1555,15 @@ void QMainWindow::contextMenuEvent(QContextMenuEvent *event) #ifndef QT_NO_MENU QMenu *popup = createPopupMenu(); - if (popup && !popup->isEmpty()) { - popup->exec(event->globalPos()); - event->accept(); + if (popup) { + if (!popup->isEmpty()) { + popup->setAttribute(Qt::WA_DeleteOnClose); + popup->popup(event->globalPos()); + event->accept(); + } else { + delete popup; + } } - delete popup; #endif } #endif // QT_NO_CONTEXTMENU diff --git a/tests/auto/qlabel/tst_qlabel.cpp b/tests/auto/qlabel/tst_qlabel.cpp index 7099917..153149e7 100644 --- a/tests/auto/qlabel/tst_qlabel.cpp +++ b/tests/auto/qlabel/tst_qlabel.cpp @@ -121,6 +121,10 @@ private slots: void mnemonic(); void selection(); +#ifndef QT_NO_CONTEXTMENU + void taskQTBUG_7902_contextMenuCrash(); +#endif + private: QLabel *testWidget; QPointer test_box; @@ -582,5 +586,25 @@ void tst_QLabel::selection() QCOMPARE(label.selectionStart(), 6); } +#ifndef QT_NO_CONTEXTMENU +void tst_QLabel::taskQTBUG_7902_contextMenuCrash() +{ + QLabel *w = new QLabel("Test or crash?"); + w->setTextInteractionFlags(Qt::TextSelectableByMouse); + w->show(); + QTest::qWaitForWindowShown(w); + + QTimer ti; + w->connect(&ti, SIGNAL(timeout()), w, SLOT(deleteLater())); + ti.start(300); + + QContextMenuEvent *cme = new QContextMenuEvent(QContextMenuEvent::Mouse, w->rect().center()); + qApp->postEvent(w, cme); + + QTest::qWait(350); + // No crash, it's allright. +} +#endif + QTEST_MAIN(tst_QLabel) #include "tst_qlabel.moc" diff --git a/tests/auto/qlineedit/tst_qlineedit.cpp b/tests/auto/qlineedit/tst_qlineedit.cpp index 7283916..fcca58a 100644 --- a/tests/auto/qlineedit/tst_qlineedit.cpp +++ b/tests/auto/qlineedit/tst_qlineedit.cpp @@ -271,6 +271,9 @@ private slots: void taskQTBUG_4401_enterKeyClearsPassword(); void taskQTBUG_4679_moveToStartEndOfBlock(); void taskQTBUG_4679_selectToStartEndOfBlock(); +#ifndef QT_NO_CONTEXTMENU + void taskQTBUG_7902_contextMenuCrash(); +#endif protected slots: #ifdef QT3_SUPPORT @@ -3638,5 +3641,25 @@ void tst_QLineEdit::taskQTBUG_4679_selectToStartEndOfBlock() #endif // Q_OS_MAC } +#ifndef QT_NO_CONTEXTMENU +void tst_QLineEdit::taskQTBUG_7902_contextMenuCrash() +{ + // Would pass before the associated commit, but left as a guard. + QLineEdit *w = new QLineEdit; + w->show(); + QTest::qWaitForWindowShown(w); + + QTimer ti; + w->connect(&ti, SIGNAL(timeout()), w, SLOT(deleteLater())); + ti.start(200); + + QContextMenuEvent *cme = new QContextMenuEvent(QContextMenuEvent::Mouse, w->rect().center()); + qApp->postEvent(w, cme); + + QTest::qWait(300); + // No crash, it's allright. +} +#endif + QTEST_MAIN(tst_QLineEdit) #include "tst_qlineedit.moc" diff --git a/tests/auto/qtextedit/tst_qtextedit.cpp b/tests/auto/qtextedit/tst_qtextedit.cpp index deb9379..101baa5 100644 --- a/tests/auto/qtextedit/tst_qtextedit.cpp +++ b/tests/auto/qtextedit/tst_qtextedit.cpp @@ -201,6 +201,9 @@ private slots: void noWrapBackgrounds(); void preserveCharFormatAfterUnchangingSetPosition(); void twoSameInputMethodEvents(); +#ifndef QT_NO_CONTEXTMENU + void taskQTBUG_7902_contextMenuCrash(); +#endif private: void createSelection(); @@ -2202,5 +2205,24 @@ void tst_QTextEdit::twoSameInputMethodEvents() QCOMPARE(ed->document()->firstBlock().layout()->lineCount(), 1); } +#ifndef QT_NO_CONTEXTMENU +void tst_QTextEdit::taskQTBUG_7902_contextMenuCrash() +{ + QTextEdit *w = new QTextEdit; + w->show(); + QTest::qWaitForWindowShown(w); + + QTimer ti; + w->connect(&ti, SIGNAL(timeout()), w, SLOT(deleteLater())); + ti.start(200); + + QContextMenuEvent *cme = new QContextMenuEvent(QContextMenuEvent::Mouse, w->rect().center()); + qApp->postEvent(w->viewport(), cme); + + QTest::qWait(300); + // No crash, it's allright. +} +#endif + QTEST_MAIN(tst_QTextEdit) #include "tst_qtextedit.moc" -- cgit v0.12 From d7c2a9065f05845a7378e77ddc41b63b8dff6d1c Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Wed, 10 Feb 2010 16:07:40 +0100 Subject: Fixed regression. --- src/gui/text/qtextdocument_p.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/text/qtextdocument_p.cpp b/src/gui/text/qtextdocument_p.cpp index b36642b..e2fdf0e 100644 --- a/src/gui/text/qtextdocument_p.cpp +++ b/src/gui/text/qtextdocument_p.cpp @@ -260,7 +260,7 @@ void QTextDocumentPrivate::clear() title.clear(); undoState = 0; - clearUndoRedoStacks(QTextDocument::UndoStack); + clearUndoRedoStacks(QTextDocument::RedoStack); text = QString(); unreachableCharacterCount = 0; modifiedState = 0; @@ -292,7 +292,7 @@ QTextDocumentPrivate::~QTextDocumentPrivate() cursors.clear(); undoState = 0; undoEnabled = true; - clearUndoRedoStacks(QTextDocument::UndoStack); + clearUndoRedoStacks(QTextDocument::RedoStack); } void QTextDocumentPrivate::setLayout(QAbstractTextDocumentLayout *layout) @@ -1027,7 +1027,7 @@ void QTextDocumentPrivate::appendUndoItem(const QTextUndoCommand &c) if (!undoEnabled) return; if (undoState < undoStack.size()) - clearUndoRedoStacks(QTextDocument::UndoStack); + clearUndoRedoStacks(QTextDocument::RedoStack); if (!undoStack.isEmpty() && modified) { QTextUndoCommand &last = undoStack[undoState - 1]; @@ -1117,7 +1117,7 @@ void QTextDocumentPrivate::enableUndoRedo(bool enable) if (!enable) { undoState = 0; - clearUndoRedoStacks(QTextDocument::UndoStack); + clearUndoRedoStacks(QTextDocument::RedoStack); emitUndoAvailable(false); emitRedoAvailable(false); } -- cgit v0.12 From 8b20c0ec6d676b3b297b8fa0ee436ad2e3d9a720 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Wed, 10 Feb 2010 16:57:23 +0100 Subject: Added geometry shaders to changes-4.7.0 file + a small doc update about it --- dist/changes-4.7.0 | 3 +++ src/opengl/qglshaderprogram.cpp | 2 ++ 2 files changed, 5 insertions(+) diff --git a/dist/changes-4.7.0 b/dist/changes-4.7.0 index 92f5244..3504763 100644 --- a/dist/changes-4.7.0 +++ b/dist/changes-4.7.0 @@ -24,6 +24,9 @@ General Improvements - Documentation and Examples +- Support for the GL_EXT_geometry_shader4, aka Geometry Shaders, was added + to QGLShaderProgram. + Third party components ---------------------- diff --git a/src/opengl/qglshaderprogram.cpp b/src/opengl/qglshaderprogram.cpp index 8e256ab..170b650 100644 --- a/src/opengl/qglshaderprogram.cpp +++ b/src/opengl/qglshaderprogram.cpp @@ -143,6 +143,8 @@ QT_BEGIN_NAMESPACE \value Vertex Vertex shader written in the OpenGL Shading Language (GLSL). \value Fragment Fragment shader written in the OpenGL Shading Language (GLSL). + \value Geometry Geometry shaders written in the OpenGL Shading + Language (GLSL), based on the GL_EXT_geometry_shader4 extension. */ #ifndef GL_FRAGMENT_SHADER -- cgit v0.12 From a0fa7657a11ceb6bffc8387b4a76a274884a9508 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Wed, 10 Feb 2010 17:07:43 +0100 Subject: Added \since 4.7 tags --- src/opengl/qglshaderprogram.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/opengl/qglshaderprogram.cpp b/src/opengl/qglshaderprogram.cpp index 170b650..a0b332d 100644 --- a/src/opengl/qglshaderprogram.cpp +++ b/src/opengl/qglshaderprogram.cpp @@ -3080,6 +3080,8 @@ void QGLShaderProgram::setUniformValueArray(const char *name, const QMatrix4x4 * Returns the hardware limit for how many vertices a geometry shader can output. + \since 4.7 + \sa setGeometryShaderOutputVertexCount */ int QGLShaderProgram::maxGeometryOutputVertices() const @@ -3095,6 +3097,8 @@ int QGLShaderProgram::maxGeometryOutputVertices() const Sets the maximum number of vertices the current geometry shader program will produce, if active. + \since 4.7 + This parameter takes effect the next time the program is linked. */ void QGLShaderProgram::setGeometryOutputVertexCount(int count) @@ -3114,6 +3118,8 @@ void QGLShaderProgram::setGeometryOutputVertexCount(int count) Returns the maximum number of vertices the current geometry shader program will produce, if active. + \since 4.7 + This parameter takes effect the ntext time the program is linked. */ int QGLShaderProgram::geometryOutputVertexCount() const @@ -3137,6 +3143,8 @@ void QGLShaderProgram::setGeometryInputType(GLenum inputType) Returns the geometry shader input type, if active. This parameter takes effect the next time the program is linked. + + \since 4.7 */ GLenum QGLShaderProgram::geometryInputType() const @@ -3149,6 +3157,8 @@ GLenum QGLShaderProgram::geometryInputType() const Sets the output type from the geometry shader, if active. This parameter takes effect the next time the program is linked. + + \since 4.7 */ void QGLShaderProgram::setGeometryOutputType(GLenum outputType) { @@ -3160,6 +3170,8 @@ void QGLShaderProgram::setGeometryOutputType(GLenum outputType) Returns the geometry shader output type, if active. This parameter takes effect the next time the program is linked. + + \since 4.7 */ GLenum QGLShaderProgram::geometryOutputType() const { @@ -3209,6 +3221,8 @@ void QGLShaderProgram::shaderDestroyed() The \a context is used to resolve the GLSL extensions. If \a context is null, then QGLContext::currentContext() is used. + + \since 4.7 */ bool QGLShader::hasOpenGLShaders(ShaderType type, const QGLContext *context) { -- cgit v0.12 From e396749026f1a22f905540befa9e2ed8ba8b46b9 Mon Sep 17 00:00:00 2001 From: ck Date: Wed, 10 Feb 2010 17:11:23 +0100 Subject: Assistant: Remove assertion for all files being watched. For unknown reasons, the assumption does not hold at times. --- .../tools/assistant/helpenginewrapper.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/tools/assistant/tools/assistant/helpenginewrapper.cpp b/tools/assistant/tools/assistant/helpenginewrapper.cpp index ddc056a..76211c5 100644 --- a/tools/assistant/tools/assistant/helpenginewrapper.cpp +++ b/tools/assistant/tools/assistant/helpenginewrapper.cpp @@ -103,7 +103,7 @@ private: HelpEngineWrapperPrivate(const QString &collectionFile); void initFileSystemWatchers(); - void assertDocFilesWatched(); + void checkDocFilesWatched(); void qchFileChanged(const QString &fileName, bool fromTimeout); static const int UpdateGracePeriod = 2000; @@ -202,23 +202,23 @@ const QString HelpEngineWrapper::collectionFile() const bool HelpEngineWrapper::registerDocumentation(const QString &docFile) { TRACE_OBJ - d->assertDocFilesWatched(); + d->checkDocFilesWatched(); if (!d->m_helpEngine->registerDocumentation(docFile)) return false; d->m_qchWatcher->addPath(docFile); - d->assertDocFilesWatched(); + d->checkDocFilesWatched(); return true; } bool HelpEngineWrapper::unregisterDocumentation(const QString &namespaceName) { TRACE_OBJ - d->assertDocFilesWatched(); + d->checkDocFilesWatched(); const QString &file = d->m_helpEngine->documentationFileName(namespaceName); if (!d->m_helpEngine->unregisterDocumentation(namespaceName)) return false; d->m_qchWatcher->removePath(file); - d->assertDocFilesWatched(); + d->checkDocFilesWatched(); return true; } @@ -715,7 +715,7 @@ void HelpEngineWrapperPrivate::initFileSystemWatchers() connect(m_qchWatcher, SIGNAL(fileChanged(QString)), this, SLOT(qchFileChanged(QString))); } - assertDocFilesWatched(); + checkDocFilesWatched(); } void HelpEngineWrapperPrivate::qchFileChanged(const QString &fileName) @@ -724,11 +724,15 @@ void HelpEngineWrapperPrivate::qchFileChanged(const QString &fileName) qchFileChanged(fileName, false); } -void HelpEngineWrapperPrivate::assertDocFilesWatched() +void HelpEngineWrapperPrivate::checkDocFilesWatched() { TRACE_OBJ - Q_ASSERT(m_qchWatcher->files().count() - == m_helpEngine->registeredDocumentations().count()); + const int watchedFilesCount = m_qchWatcher->files().count(); + const int docFilesCount = m_helpEngine->registeredDocumentations().count(); + if (watchedFilesCount != docFilesCount) { + qWarning("Strange: Have %d docs, but %d are being watched", + watchedFilesCount, docFilesCount); + } } void HelpEngineWrapperPrivate::qchFileChanged(const QString &fileName, -- cgit v0.12 From 29d4342b2f87183e4bd4c2611aea157834c0f492 Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Thu, 11 Feb 2010 11:45:01 +0100 Subject: Fixed cleaning of both undo- and redo-stacks. --- src/gui/text/qtextdocument_p.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gui/text/qtextdocument_p.cpp b/src/gui/text/qtextdocument_p.cpp index e2fdf0e..969d5b4 100644 --- a/src/gui/text/qtextdocument_p.cpp +++ b/src/gui/text/qtextdocument_p.cpp @@ -259,8 +259,7 @@ void QTextDocumentPrivate::clear() objects.clear(); title.clear(); - undoState = 0; - clearUndoRedoStacks(QTextDocument::RedoStack); + clearUndoRedoStacks(QTextDocument::UndoAndRedoStacks); text = QString(); unreachableCharacterCount = 0; modifiedState = 0; @@ -1077,7 +1076,7 @@ void QTextDocumentPrivate::clearUndoRedoStacks(QTextDocument::Stacks stacksToCle if (emitSignals) emitRedoAvailable(false); } else if (stacksToClear == QTextDocument::UndoAndRedoStacks - && (undoCommandsAvailable || redoCommandsAvailable)) { + && !undoStack.isEmpty()) { for (int i = 0; i < undoStack.size(); ++i) { QTextUndoCommand c = undoStack[i]; if (c.command & QTextUndoCommand::Custom) -- cgit v0.12 From 0924b406e5749c52987cf7d6dcab3ce0b9ae5a89 Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Thu, 11 Feb 2010 15:30:30 +0100 Subject: Changed a couple of GL defines from decimal to hex. Reviewed-by: Gunnar --- src/opengl/qglextensions_p.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/opengl/qglextensions_p.h b/src/opengl/qglextensions_p.h index f6613fd..4edd5f7 100644 --- a/src/opengl/qglextensions_p.h +++ b/src/opengl/qglextensions_p.h @@ -465,11 +465,11 @@ struct QGLExtensionFuncs #endif #ifndef GL_RGB16 -#define GL_RGB16 32852 +#define GL_RGB16 0x8054 #endif #ifndef GL_UNSIGNED_SHORT_5_6_5 -#define GL_UNSIGNED_SHORT_5_6_5 33635 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 #endif #ifndef GL_UNSIGNED_INT_8_8_8_8_REV -- cgit v0.12 From 6a8a8f851edbc9b93948bf88d8c792e1c5dfda35 Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Thu, 11 Feb 2010 15:32:02 +0100 Subject: Turned off subpixel AA text on surface with alpha in GL2 engine. Subpixel antialiased text does not look good on translucent surfaces, so turn it off if the surface the text is rendered on has an alpha channel. This makes change eb84acd899aee992f5631ee0b9c0d992c8fbbd5a redundant. Task-number: QTBUG-7190 Reviewed-by: Gunnar --- .../gl2paintengineex/qpaintengineex_opengl2.cpp | 31 +++++++++++++++++----- .../gl2paintengineex/qpaintengineex_opengl2_p.h | 1 + 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index b17e3a1..d2fb925 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -1332,14 +1332,14 @@ void QGL2PaintEngineEx::drawTextItem(const QPointF &p, const QTextItem &textItem ? QFontEngineGlyphCache::Type(ti.fontEngine->glyphFormat) : d->glyphCacheType; - if (txtype > QTransform::TxTranslate) - glyphType = QFontEngineGlyphCache::Raster_A8; - if (glyphType == QFontEngineGlyphCache::Raster_RGBMask - && state()->composition_mode != QPainter::CompositionMode_Source - && state()->composition_mode != QPainter::CompositionMode_SourceOver) - { - drawCached = false; + if (glyphType == QFontEngineGlyphCache::Raster_RGBMask) { + if (d->deviceHasAlpha || txtype > QTransform::TxTranslate + || (state()->composition_mode != QPainter::CompositionMode_Source + && state()->composition_mode != QPainter::CompositionMode_SourceOver)) + { + glyphType = QFontEngineGlyphCache::Raster_A8; + } } if (drawCached) { @@ -1630,6 +1630,23 @@ bool QGL2PaintEngineEx::begin(QPaintDevice *pdev) d->dirtyStencilRegion = QRect(0, 0, d->width, d->height); d->stencilClean = true; + switch (pdev->devType()) { + case QInternal::Pixmap: + d->deviceHasAlpha = static_cast(pdev)->hasAlphaChannel(); + break; + case QInternal::FramebufferObject: + { + GLenum f = static_cast(pdev)->format().internalTextureFormat(); + d->deviceHasAlpha = (f != GL_RGB && f != GL_RGB5 && f != GL_RGB8); + } + break; + default: + // widget, pbuffer + d->deviceHasAlpha = d->ctx->d_func()->reqFormat.alpha(); + break; + } + + // Calling begin paint should make the correct context current. So, any // code which calls into GL or otherwise needs a current context *must* // go after beginPaint: diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h index 35c88f4..e816e17 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h @@ -278,6 +278,7 @@ public: bool needsSync; bool multisamplingAlwaysEnabled; + bool deviceHasAlpha; GLfloat depthRange[2]; -- cgit v0.12